UNPKG

mermaid

Version:

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

1,306 lines 764 kB
import { l as qr, c as Ji, W as ti, d as ri, P as Ca, Q as $l, Y as pp, U as yp, t as mp, j as bp, at as Ep, au as wp, av as xp } from "./mermaid-9f2aa176.js"; import { a as Tp } from "./createText-03b82060.js"; var Qi = function() { var de = function(ee, H, te, S) { for (te = te || {}, S = ee.length; S--; te[ee[S]] = H) ; return te; }, Pe = [1, 4], _ = [1, 13], fe = [1, 12], Q = [1, 15], C = [1, 16], T = [1, 20], x = [1, 19], I = [6, 7, 8], z = [1, 26], Y = [1, 24], P = [1, 25], Z = [6, 7, 11], A = [1, 6, 13, 15, 16, 19, 22], $ = [1, 33], U = [1, 34], J = [1, 6, 7, 11, 13, 15, 16, 19, 22], ne = { trace: function() { }, yy: {}, symbols_: { error: 2, start: 3, mindMap: 4, spaceLines: 5, SPACELINE: 6, NL: 7, MINDMAP: 8, document: 9, stop: 10, EOF: 11, statement: 12, SPACELIST: 13, node: 14, ICON: 15, CLASS: 16, nodeWithId: 17, nodeWithoutId: 18, NODE_DSTART: 19, NODE_DESCR: 20, NODE_DEND: 21, NODE_ID: 22, $accept: 0, $end: 1 }, terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "MINDMAP", 11: "EOF", 13: "SPACELIST", 15: "ICON", 16: "CLASS", 19: "NODE_DSTART", 20: "NODE_DESCR", 21: "NODE_DEND", 22: "NODE_ID" }, productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 2], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [18, 3], [17, 1], [17, 4]], performAction: function(H, te, S, V, R, q, ve) { var pe = q.length - 1; switch (R) { case 6: case 7: return V; case 8: V.getLogger().trace("Stop NL "); break; case 9: V.getLogger().trace("Stop EOF "); break; case 11: V.getLogger().trace("Stop NL2 "); break; case 12: V.getLogger().trace("Stop EOF2 "); break; case 15: V.getLogger().info("Node: ", q[pe].id), V.addNode(q[pe - 1].length, q[pe].id, q[pe].descr, q[pe].type); break; case 16: V.getLogger().trace("Icon: ", q[pe]), V.decorateNode({ icon: q[pe] }); break; case 17: case 21: V.decorateNode({ class: q[pe] }); break; case 18: V.getLogger().trace("SPACELIST"); break; case 19: V.getLogger().trace("Node: ", q[pe].id), V.addNode(0, q[pe].id, q[pe].descr, q[pe].type); break; case 20: V.decorateNode({ icon: q[pe] }); break; case 25: V.getLogger().trace("node found ..", q[pe - 2]), this.$ = { id: q[pe - 1], descr: q[pe - 1], type: V.getType(q[pe - 2], q[pe]) }; break; case 26: this.$ = { id: q[pe], descr: q[pe], type: V.nodeType.DEFAULT }; break; case 27: V.getLogger().trace("node found ..", q[pe - 3]), this.$ = { id: q[pe - 3], descr: q[pe - 1], type: V.getType(q[pe - 2], q[pe]) }; break; } }, table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: Pe }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: Pe }, { 6: _, 7: [1, 10], 9: 9, 12: 11, 13: fe, 14: 14, 15: Q, 16: C, 17: 17, 18: 18, 19: T, 22: x }, de(I, [2, 3]), { 1: [2, 2] }, de(I, [2, 4]), de(I, [2, 5]), { 1: [2, 6], 6: _, 12: 21, 13: fe, 14: 14, 15: Q, 16: C, 17: 17, 18: 18, 19: T, 22: x }, { 6: _, 9: 22, 12: 11, 13: fe, 14: 14, 15: Q, 16: C, 17: 17, 18: 18, 19: T, 22: x }, { 6: z, 7: Y, 10: 23, 11: P }, de(Z, [2, 22], { 17: 17, 18: 18, 14: 27, 15: [1, 28], 16: [1, 29], 19: T, 22: x }), de(Z, [2, 18]), de(Z, [2, 19]), de(Z, [2, 20]), de(Z, [2, 21]), de(Z, [2, 23]), de(Z, [2, 24]), de(Z, [2, 26], { 19: [1, 30] }), { 20: [1, 31] }, { 6: z, 7: Y, 10: 32, 11: P }, { 1: [2, 7], 6: _, 12: 21, 13: fe, 14: 14, 15: Q, 16: C, 17: 17, 18: 18, 19: T, 22: x }, de(A, [2, 14], { 7: $, 11: U }), de(J, [2, 8]), de(J, [2, 9]), de(J, [2, 10]), de(Z, [2, 15]), de(Z, [2, 16]), de(Z, [2, 17]), { 20: [1, 35] }, { 21: [1, 36] }, de(A, [2, 13], { 7: $, 11: U }), de(J, [2, 11]), de(J, [2, 12]), { 21: [1, 37] }, de(Z, [2, 25]), de(Z, [2, 27])], defaultActions: { 2: [2, 1], 6: [2, 2] }, parseError: function(H, te) { if (te.recoverable) this.trace(H); else { var S = new Error(H); throw S.hash = te, S; } }, parse: function(H) { var te = this, S = [0], V = [], R = [null], q = [], ve = this.table, pe = "", Ae = 0, Ne = 0, Ye = 2, at = 1, dt = q.slice.call(arguments, 1), Re = Object.create(this.lexer), Ve = { yy: {} }; for (var Ze in this.yy) Object.prototype.hasOwnProperty.call(this.yy, Ze) && (Ve.yy[Ze] = this.yy[Ze]); Re.setInput(H, Ve.yy), Ve.yy.lexer = Re, Ve.yy.parser = this, typeof Re.yylloc > "u" && (Re.yylloc = {}); var nt = Re.yylloc; q.push(nt); var ht = Re.options && Re.options.ranges; typeof Ve.yy.parseError == "function" ? this.parseError = Ve.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function it() { var jt; return jt = V.pop() || Re.lex() || at, typeof jt != "number" && (jt instanceof Array && (V = jt, jt = V.pop()), jt = te.symbols_[jt] || jt), jt; } for (var tt, yt, Et, Pt, gt = {}, dr, qt, nn, Kr; ; ) { if (yt = S[S.length - 1], this.defaultActions[yt] ? Et = this.defaultActions[yt] : ((tt === null || typeof tt > "u") && (tt = it()), Et = ve[yt] && ve[yt][tt]), typeof Et > "u" || !Et.length || !Et[0]) { var Da = ""; Kr = []; for (dr in ve[yt]) this.terminals_[dr] && dr > Ye && Kr.push("'" + this.terminals_[dr] + "'"); Re.showPosition ? Da = "Parse error on line " + (Ae + 1) + `: ` + Re.showPosition() + ` Expecting ` + Kr.join(", ") + ", got '" + (this.terminals_[tt] || tt) + "'" : Da = "Parse error on line " + (Ae + 1) + ": Unexpected " + (tt == at ? "end of input" : "'" + (this.terminals_[tt] || tt) + "'"), this.parseError(Da, { text: Re.match, token: this.terminals_[tt] || tt, line: Re.yylineno, loc: nt, expected: Kr }); } if (Et[0] instanceof Array && Et.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + yt + ", token: " + tt); switch (Et[0]) { case 1: S.push(tt), R.push(Re.yytext), q.push(Re.yylloc), S.push(Et[1]), tt = null, Ne = Re.yyleng, pe = Re.yytext, Ae = Re.yylineno, nt = Re.yylloc; break; case 2: if (qt = this.productions_[Et[1]][1], gt.$ = R[R.length - qt], gt._$ = { first_line: q[q.length - (qt || 1)].first_line, last_line: q[q.length - 1].last_line, first_column: q[q.length - (qt || 1)].first_column, last_column: q[q.length - 1].last_column }, ht && (gt._$.range = [ q[q.length - (qt || 1)].range[0], q[q.length - 1].range[1] ]), Pt = this.performAction.apply(gt, [ pe, Ne, Ae, Ve.yy, Et[1], R, q ].concat(dt)), typeof Pt < "u") return Pt; qt && (S = S.slice(0, -1 * qt * 2), R = R.slice(0, -1 * qt), q = q.slice(0, -1 * qt)), S.push(this.productions_[Et[1]][0]), R.push(gt.$), q.push(gt._$), nn = ve[S[S.length - 2]][S[S.length - 1]], S.push(nn); break; case 3: return !0; } } return !0; } }, le = function() { var ee = { EOF: 1, parseError: function(te, S) { if (this.yy.parser) this.yy.parser.parseError(te, S); else throw new Error(te); }, // resets the lexer, sets new input setInput: function(H, te) { return this.yy = te || this.yy || {}, this._input = H, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, // consumes and returns one char from the input input: function() { var H = this._input[0]; this.yytext += H, this.yyleng++, this.offset++, this.match += H, this.matched += H; var te = H.match(/(?:\r\n?|\n).*/g); return te ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), H; }, // unshifts one char (or a string) into the input unput: function(H) { var te = H.length, S = H.split(/(?:\r\n?|\n)/g); this._input = H + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - te), this.offset -= te; var V = 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), S.length - 1 && (this.yylineno -= S.length - 1); var R = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: S ? (S.length === V.length ? this.yylloc.first_column : 0) + V[V.length - S.length].length - S[0].length : this.yylloc.first_column - te }, this.options.ranges && (this.yylloc.range = [R[0], R[0] + this.yyleng - te]), this.yyleng = this.yytext.length, this; }, // When called from action, caches matched text and appends it on next action more: function() { return this._more = !0, this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). ` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, // retain first n characters of the match less: function(H) { this.unput(this.match.slice(H)); }, // displays already matched input, i.e. for error messages pastInput: function() { var H = this.matched.substr(0, this.matched.length - this.match.length); return (H.length > 20 ? "..." : "") + H.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput: function() { var H = this.match; return H.length < 20 && (H += this._input.substr(0, 20 - H.length)), (H.substr(0, 20) + (H.length > 20 ? "..." : "")).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition: function() { var H = this.pastInput(), te = new Array(H.length + 1).join("-"); return H + this.upcomingInput() + ` ` + te + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match: function(H, te) { var S, V, R; if (this.options.backtrack_lexer && (R = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (R.yylloc.range = this.yylloc.range.slice(0))), V = H[0].match(/(?:\r\n?|\n).*/g), V && (this.yylineno += V.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: V ? V[V.length - 1].length - V[V.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + H[0].length }, this.yytext += H[0], this.match += H[0], this.matches = H, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(H[0].length), this.matched += H[0], S = this.performAction.call(this, this.yy, this, te, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), S) return S; if (this._backtrack) { for (var q in R) this[q] = R[q]; return !1; } return !1; }, // return next match in input next: function() { if (this.done) return this.EOF; this._input || (this.done = !0); var H, te, S, V; this._more || (this.yytext = "", this.match = ""); for (var R = this._currentRules(), q = 0; q < R.length; q++) if (S = this._input.match(this.rules[R[q]]), S && (!te || S[0].length > te[0].length)) { if (te = S, V = q, this.options.backtrack_lexer) { if (H = this.test_match(S, R[q]), H !== !1) return H; if (this._backtrack) { te = !1; continue; } else return !1; } else if (!this.options.flex) break; } return te ? (H = this.test_match(te, R[V]), H !== !1 ? H : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text. ` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, // return next match that has a token lex: function() { var te = this.next(); return te || this.lex(); }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: function(te) { this.conditionStack.push(te); }, // pop the previously active lexer condition state off the condition stack popState: function() { var te = this.conditionStack.length - 1; return te > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: function(te) { return te = this.conditionStack.length - 1 - Math.abs(te || 0), te >= 0 ? this.conditionStack[te] : "INITIAL"; }, // alias for begin(condition) pushState: function(te) { this.begin(te); }, // return the number of states currently on the stack stateStackSize: function() { return this.conditionStack.length; }, options: { "case-insensitive": !0 }, performAction: function(te, S, V, R) { switch (V) { case 0: return te.getLogger().trace("Found comment", S.yytext), 6; case 1: return 8; case 2: this.begin("CLASS"); break; case 3: return this.popState(), 16; case 4: this.popState(); break; case 5: te.getLogger().trace("Begin icon"), this.begin("ICON"); break; case 6: return te.getLogger().trace("SPACELINE"), 6; case 7: return 7; case 8: return 15; case 9: te.getLogger().trace("end icon"), this.popState(); break; case 10: return te.getLogger().trace("Exploding node"), this.begin("NODE"), 19; case 11: return te.getLogger().trace("Cloud"), this.begin("NODE"), 19; case 12: return te.getLogger().trace("Explosion Bang"), this.begin("NODE"), 19; case 13: return te.getLogger().trace("Cloud Bang"), this.begin("NODE"), 19; case 14: return this.begin("NODE"), 19; case 15: return this.begin("NODE"), 19; case 16: return this.begin("NODE"), 19; case 17: return this.begin("NODE"), 19; case 18: return 13; case 19: return 22; case 20: return 11; case 21: this.begin("NSTR2"); break; case 22: return "NODE_DESCR"; case 23: this.popState(); break; case 24: te.getLogger().trace("Starting NSTR"), this.begin("NSTR"); break; case 25: return te.getLogger().trace("description:", S.yytext), "NODE_DESCR"; case 26: this.popState(); break; case 27: return this.popState(), te.getLogger().trace("node end ))"), "NODE_DEND"; case 28: return this.popState(), te.getLogger().trace("node end )"), "NODE_DEND"; case 29: return this.popState(), te.getLogger().trace("node end ...", S.yytext), "NODE_DEND"; case 30: return this.popState(), te.getLogger().trace("node end (("), "NODE_DEND"; case 31: return this.popState(), te.getLogger().trace("node end (-"), "NODE_DEND"; case 32: return this.popState(), te.getLogger().trace("node end (-"), "NODE_DEND"; case 33: return this.popState(), te.getLogger().trace("node end (("), "NODE_DEND"; case 34: return this.popState(), te.getLogger().trace("node end (("), "NODE_DEND"; case 35: return te.getLogger().trace("Long description:", S.yytext), 20; case 36: return te.getLogger().trace("Long description:", S.yytext), 20; } }, rules: [/^(?:\s*%%.*)/i, /^(?:mindmap\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i], conditions: { CLASS: { rules: [3, 4], inclusive: !1 }, ICON: { rules: [8, 9], inclusive: !1 }, NSTR2: { rules: [22, 23], inclusive: !1 }, NSTR: { rules: [25, 26], inclusive: !1 }, NODE: { rules: [21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], inclusive: !0 } } }; return ee; }(); ne.lexer = le; function j() { this.yy = {}; } return j.prototype = ne, ne.Parser = j, new j(); }(); Qi.parser = Qi; const Cp = Qi; let or = [], _l = 0, ji = {}; const Dp = () => { or = [], _l = 0, ji = {}; }, Sp = function(de) { for (let Pe = or.length - 1; Pe >= 0; Pe--) if (or[Pe].level < de) return or[Pe]; return null; }, Lp = () => or.length > 0 ? or[0] : null, Ap = (de, Pe, _, fe) => { var I, z; qr.info("addNode", de, Pe, _, fe); const Q = Ji(); let C = ((I = Q.mindmap) == null ? void 0 : I.padding) ?? ti.mindmap.padding; switch (fe) { case St.ROUNDED_RECT: case St.RECT: case St.HEXAGON: C *= 2; } const T = { id: _l++, nodeId: ri(Pe, Q), level: de, descr: ri(_, Q), type: fe, children: [], width: ((z = Q.mindmap) == null ? void 0 : z.maxNodeWidth) ?? ti.mindmap.maxNodeWidth, padding: C }, x = Sp(de); if (x) x.children.push(T), or.push(T); else if (or.length === 0) or.push(T); else throw new Error( 'There can be only one root. No parent could be found for ("' + T.descr + '")' ); }, St = { DEFAULT: 0, NO_BORDER: 0, ROUNDED_RECT: 1, RECT: 2, CIRCLE: 3, CLOUD: 4, BANG: 5, HEXAGON: 6 }, Op = (de, Pe) => { switch (qr.debug("In get type", de, Pe), de) { case "[": return St.RECT; case "(": return Pe === ")" ? St.ROUNDED_RECT : St.CLOUD; case "((": return St.CIRCLE; case ")": return St.CLOUD; case "))": return St.BANG; case "{{": return St.HEXAGON; default: return St.DEFAULT; } }, Np = (de, Pe) => { ji[de] = Pe; }, Ip = (de) => { if (!de) return; const Pe = Ji(), _ = or[or.length - 1]; de.icon && (_.icon = ri(de.icon, Pe)), de.class && (_.class = ri(de.class, Pe)); }, Mp = (de) => { switch (de) { case St.DEFAULT: return "no-border"; case St.RECT: return "rect"; case St.ROUNDED_RECT: return "rounded-rect"; case St.CIRCLE: return "circle"; case St.CLOUD: return "cloud"; case St.BANG: return "bang"; case St.HEXAGON: return "hexgon"; default: return "no-border"; } }, Rp = () => qr, kp = (de) => ji[de], Pp = { clear: Dp, addNode: Ap, getMindmap: Lp, nodeType: St, getType: Op, setElementForId: Np, decorateNode: Ip, type2Str: Mp, getLogger: Rp, getElementById: kp }, Bp = Pp; var Yl = { exports: {} }; (function(de, Pe) { (function(_, fe) { de.exports = fe(); })(Ca, function() { function _(t) { "@babel/helpers - typeof"; return _ = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) { return typeof e; } : function(e) { return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; }, _(t); } function fe(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function Q(t, e) { for (var r = 0; r < e.length; r++) { var a = e[r]; a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(t, a.key, a); } } function C(t, e, r) { return e && Q(t.prototype, e), r && Q(t, r), Object.defineProperty(t, "prototype", { writable: !1 }), t; } function T(t, e, r) { return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t; } function x(t, e) { return I(t) || z(t, e) || Y(t, e) || Z(); } function I(t) { if (Array.isArray(t)) return t; } function z(t, e) { var r = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (r != null) { var a = [], n = !0, i = !1, s, o; try { for (r = r.call(t); !(n = (s = r.next()).done) && (a.push(s.value), !(e && a.length === e)); n = !0) ; } catch (u) { i = !0, o = u; } finally { try { !n && r.return != null && r.return(); } finally { if (i) throw o; } } return a; } } function Y(t, e) { if (t) { if (typeof t == "string") return P(t, e); var r = Object.prototype.toString.call(t).slice(8, -1); if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t); if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return P(t, e); } } function P(t, e) { (e == null || e > t.length) && (e = t.length); for (var r = 0, a = new Array(e); r < e; r++) a[r] = t[r]; return a; } function Z() { throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } var A = typeof window > "u" ? null : window, $ = A ? A.navigator : null; A && A.document; var U = _(""), J = _({}), ne = _(function() { }), le = typeof HTMLElement > "u" ? "undefined" : _(HTMLElement), j = function(e) { return e && e.instanceString && H(e.instanceString) ? e.instanceString() : null; }, ee = function(e) { return e != null && _(e) == U; }, H = function(e) { return e != null && _(e) === ne; }, te = function(e) { return !pe(e) && (Array.isArray ? Array.isArray(e) : e != null && e instanceof Array); }, S = function(e) { return e != null && _(e) === J && !te(e) && e.constructor === Object; }, V = function(e) { return e != null && _(e) === J; }, R = function(e) { return e != null && _(e) === _(1) && !isNaN(e); }, q = function(e) { return R(e) && Math.floor(e) === e; }, ve = function(e) { if (le !== "undefined") return e != null && e instanceof HTMLElement; }, pe = function(e) { return Ae(e) || Ne(e); }, Ae = function(e) { return j(e) === "collection" && e._private.single; }, Ne = function(e) { return j(e) === "collection" && !e._private.single; }, Ye = function(e) { return j(e) === "core"; }, at = function(e) { return j(e) === "stylesheet"; }, dt = function(e) { return j(e) === "event"; }, Re = function(e) { return e == null ? !0 : !!(e === "" || e.match(/^\s+$/)); }, Ve = function(e) { return typeof HTMLElement > "u" ? !1 : e instanceof HTMLElement; }, Ze = function(e) { return S(e) && R(e.x1) && R(e.x2) && R(e.y1) && R(e.y2); }, nt = function(e) { return V(e) && H(e.then); }, ht = function() { return $ && $.userAgent.match(/msie|trident|edge/i); }, it = function(e, r) { r || (r = function() { if (arguments.length === 1) return arguments[0]; if (arguments.length === 0) return "undefined"; for (var i = [], s = 0; s < arguments.length; s++) i.push(arguments[s]); return i.join("$"); }); var a = function n() { var i = this, s = arguments, o, u = r.apply(i, s), l = n.cache; return (o = l[u]) || (o = l[u] = e.apply(i, s)), o; }; return a.cache = {}, a; }, tt = it(function(t) { return t.replace(/([A-Z])/g, function(e) { return "-" + e.toLowerCase(); }); }), yt = it(function(t) { return t.replace(/(-\w)/g, function(e) { return e[1].toUpperCase(); }); }), Et = it(function(t, e) { return t + e[0].toUpperCase() + e.substring(1); }, function(t, e) { return t + "$" + e; }), Pt = function(e) { return Re(e) ? e : e.charAt(0).toUpperCase() + e.substring(1); }, gt = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))", dr = "rgb[a]?\\((" + gt + "[%]?)\\s*,\\s*(" + gt + "[%]?)\\s*,\\s*(" + gt + "[%]?)(?:\\s*,\\s*(" + gt + "))?\\)", qt = "rgb[a]?\\((?:" + gt + "[%]?)\\s*,\\s*(?:" + gt + "[%]?)\\s*,\\s*(?:" + gt + "[%]?)(?:\\s*,\\s*(?:" + gt + "))?\\)", nn = "hsl[a]?\\((" + gt + ")\\s*,\\s*(" + gt + "[%])\\s*,\\s*(" + gt + "[%])(?:\\s*,\\s*(" + gt + "))?\\)", Kr = "hsl[a]?\\((?:" + gt + ")\\s*,\\s*(?:" + gt + "[%])\\s*,\\s*(?:" + gt + "[%])(?:\\s*,\\s*(?:" + gt + "))?\\)", Da = "\\#[0-9a-fA-F]{3}", jt = "\\#[0-9a-fA-F]{6}", es = function(e, r) { return e < r ? -1 : e > r ? 1 : 0; }, Kl = function(e, r) { return -1 * es(e, r); }, He = Object.assign != null ? Object.assign.bind(Object) : function(t) { for (var e = arguments, r = 1; r < e.length; r++) { var a = e[r]; if (a != null) for (var n = Object.keys(a), i = 0; i < n.length; i++) { var s = n[i]; t[s] = a[s]; } } return t; }, Zl = function(e) { if (!(!(e.length === 4 || e.length === 7) || e[0] !== "#")) { var r = e.length === 4, a, n, i, s = 16; return r ? (a = parseInt(e[1] + e[1], s), n = parseInt(e[2] + e[2], s), i = parseInt(e[3] + e[3], s)) : (a = parseInt(e[1] + e[2], s), n = parseInt(e[3] + e[4], s), i = parseInt(e[5] + e[6], s)), [a, n, i]; } }, Ql = function(e) { var r, a, n, i, s, o, u, l; function f(c, y, p) { return p < 0 && (p += 1), p > 1 && (p -= 1), p < 1 / 6 ? c + (y - c) * 6 * p : p < 1 / 2 ? y : p < 2 / 3 ? c + (y - c) * (2 / 3 - p) * 6 : c; } var h = new RegExp("^" + nn + "$").exec(e); if (h) { if (a = parseInt(h[1]), a < 0 ? a = (360 - -1 * a % 360) % 360 : a > 360 && (a = a % 360), a /= 360, n = parseFloat(h[2]), n < 0 || n > 100 || (n = n / 100, i = parseFloat(h[3]), i < 0 || i > 100) || (i = i / 100, s = h[4], s !== void 0 && (s = parseFloat(s), s < 0 || s > 1))) return; if (n === 0) o = u = l = Math.round(i * 255); else { var v = i < 0.5 ? i * (1 + n) : i + n - i * n, d = 2 * i - v; o = Math.round(255 * f(d, v, a + 1 / 3)), u = Math.round(255 * f(d, v, a)), l = Math.round(255 * f(d, v, a - 1 / 3)); } r = [o, u, l, s]; } return r; }, Jl = function(e) { var r, a = new RegExp("^" + dr + "$").exec(e); if (a) { r = []; for (var n = [], i = 1; i <= 3; i++) { var s = a[i]; if (s[s.length - 1] === "%" && (n[i] = !0), s = parseFloat(s), n[i] && (s = s / 100 * 255), s < 0 || s > 255) return; r.push(Math.floor(s)); } var o = n[1] || n[2] || n[3], u = n[1] && n[2] && n[3]; if (o && !u) return; var l = a[4]; if (l !== void 0) { if (l = parseFloat(l), l < 0 || l > 1) return; r.push(l); } } return r; }, jl = function(e) { return tu[e.toLowerCase()]; }, eu = function(e) { return (te(e) ? e : null) || jl(e) || Zl(e) || Jl(e) || Ql(e); }, tu = { // special colour names transparent: [0, 0, 0, 0], // NB alpha === 0 // regular colours aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], grey: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50] }, ts = function(e) { for (var r = e.map, a = e.keys, n = a.length, i = 0; i < n; i++) { var s = a[i]; if (S(s)) throw Error("Tried to set map with object key"); i < a.length - 1 ? (r[s] == null && (r[s] = {}), r = r[s]) : r[s] = e.value; } }, rs = function(e) { for (var r = e.map, a = e.keys, n = a.length, i = 0; i < n; i++) { var s = a[i]; if (S(s)) throw Error("Tried to get map with object key"); if (r = r[s], r == null) return r; } return r; }; function ru(t) { var e = typeof t; return t != null && (e == "object" || e == "function"); } var kr = ru, Sa = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof Ca < "u" ? Ca : typeof self < "u" ? self : {}; function au(t, e) { return e = { exports: {} }, t(e, e.exports), e.exports; } var nu = typeof Sa == "object" && Sa && Sa.Object === Object && Sa, iu = nu, su = typeof self == "object" && self && self.Object === Object && self, ou = iu || su || Function("return this")(), sn = ou, lu = function() { return sn.Date.now(); }, ai = lu, uu = /\s/; function fu(t) { for (var e = t.length; e-- && uu.test(t.charAt(e)); ) ; return e; } var hu = fu, vu = /^\s+/; function cu(t) { return t && t.slice(0, hu(t) + 1).replace(vu, ""); } var du = cu, gu = sn.Symbol, Zr = gu, as = Object.prototype, pu = as.hasOwnProperty, yu = as.toString, La = Zr ? Zr.toStringTag : void 0; function mu(t) { var e = pu.call(t, La), r = t[La]; try { t[La] = void 0; var a = !0; } catch { } var n = yu.call(t); return a && (e ? t[La] = r : delete t[La]), n; } var bu = mu, Eu = Object.prototype, wu = Eu.toString; function xu(t) { return wu.call(t); } var Tu = xu, Cu = "[object Null]", Du = "[object Undefined]", ns = Zr ? Zr.toStringTag : void 0; function Su(t) { return t == null ? t === void 0 ? Du : Cu : ns && ns in Object(t) ? bu(t) : Tu(t); } var is = Su; function Lu(t) { return t != null && typeof t == "object"; } var Au = Lu, Ou = "[object Symbol]"; function Nu(t) { return typeof t == "symbol" || Au(t) && is(t) == Ou; } var Aa = Nu, ss = 0 / 0, Iu = /^[-+]0x[0-9a-f]+$/i, Mu = /^0b[01]+$/i, Ru = /^0o[0-7]+$/i, ku = parseInt; function Pu(t) { if (typeof t == "number") return t; if (Aa(t)) return ss; if (kr(t)) { var e = typeof t.valueOf == "function" ? t.valueOf() : t; t = kr(e) ? e + "" : e; } if (typeof t != "string") return t === 0 ? t : +t; t = du(t); var r = Mu.test(t); return r || Ru.test(t) ? ku(t.slice(2), r ? 2 : 8) : Iu.test(t) ? ss : +t; } var os = Pu, Bu = "Expected a function", Fu = Math.max, Gu = Math.min; function zu(t, e, r) { var a, n, i, s, o, u, l = 0, f = !1, h = !1, v = !0; if (typeof t != "function") throw new TypeError(Bu); e = os(e) || 0, kr(r) && (f = !!r.leading, h = "maxWait" in r, i = h ? Fu(os(r.maxWait) || 0, e) : i, v = "trailing" in r ? !!r.trailing : v); function d(L) { var w = a, k = n; return a = n = void 0, l = L, s = t.apply(k, w), s; } function c(L) { return l = L, o = setTimeout(g, e), f ? d(L) : s; } function y(L) { var w = L - u, k = L - l, D = e - w; return h ? Gu(D, i - k) : D; } function p(L) { var w = L - u, k = L - l; return u === void 0 || w >= e || w < 0 || h && k >= i; } function g() { var L = ai(); if (p(L)) return m(L); o = setTimeout(g, y(L)); } function m(L) { return o = void 0, v && a ? d(L) : (a = n = void 0, s); } function b() { o !== void 0 && clearTimeout(o), l = 0, a = u = n = o = void 0; } function E() { return o === void 0 ? s : m(ai()); } function M() { var L = ai(), w = p(L); if (a = arguments, n = this, u = L, w) { if (o === void 0) return c(u); if (h) return clearTimeout(o), o = setTimeout(g, e), d(u); } return o === void 0 && (o = setTimeout(g, e)), s; } return M.cancel = b, M.flush = E, M; } var on = zu, ni = A ? A.performance : null, ls = ni && ni.now ? function() { return ni.now(); } : function() { return Date.now(); }, Vu = function() { if (A) { if (A.requestAnimationFrame) return function(t) { A.requestAnimationFrame(t); }; if (A.mozRequestAnimationFrame) return function(t) { A.mozRequestAnimationFrame(t); }; if (A.webkitRequestAnimationFrame) return function(t) { A.webkitRequestAnimationFrame(t); }; if (A.msRequestAnimationFrame) return function(t) { A.msRequestAnimationFrame(t); }; } return function(t) { t && setTimeout(function() { t(ls()); }, 1e3 / 60); }; }(), ln = function(e) { return Vu(e); }, gr = ls, Qr = 9261, us = 65599, Oa = 5381, fs = function(e) { for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Qr, a = r, n; n = e.next(), !n.done; ) a = a * us + n.value | 0; return a; }, Na = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Qr; return r * us + e | 0; }, Ia = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Oa; return (r << 5) + r + e | 0; }, Uu = function(e, r) { return e * 2097152 + r; }, wr = function(e) { return e[0] * 2097152 + e[1]; }, un = function(e, r) { return [Na(e[0], r[0]), Ia(e[1], r[1])]; }, $u = function(e, r) { var a = { value: 0, done: !1 }, n = 0, i = e.length, s = { next: function() { return n < i ? a.value = e[n++] : a.done = !0, a; } }; return fs(s, r); }, Pr = function(e, r) { var a = { value: 0, done: !1 }, n = 0, i = e.length, s = { next: function() { return n < i ? a.value = e.charCodeAt(n++) : a.done = !0, a; } }; return fs(s, r); }, hs = function() { return _u(arguments); }, _u = function(e) { for (var r, a = 0; a < e.length; a++) { var n = e[a]; a === 0 ? r = Pr(n) : r = Pr(n, r); } return r; }, vs = !0, Yu = console.warn != null, Hu = console.trace != null, ii = Number.MAX_SAFE_INTEGER || 9007199254740991, cs = function() { return !0; }, fn = function() { return !1; }, ds = function() { return 0; }, si = function() { }, xt = function(e) { throw new Error(e); }, gs = function(e) { if (e !== void 0) vs = !!e; else return vs; }, vt = function(e) { gs() && (Yu ? console.warn(e) : (console.log(e), Hu && console.trace())); }, Xu = function(e) { return He({}, e); }, lr = function(e) { return e == null ? e : te(e) ? e.slice() : S(e) ? Xu(e) : e; }, Wu = function(e) { return e.slice(); }, ps = function(e, r) { for ( // loop :) r = e = ""; // b - result , a - numeric letiable e++ < 36; // r += e * 51 & 52 ? ( // return a random number or 4 (e ^ 15 ? ( // generate a random number from 0 to 15 8 ^ Math.random() * (e ^ 20 ? 16 : 4) ) : 4).toString(16) ) : "-" ) ; return r; }, qu = {}, ys = function() { return qu; }, At = function(e) { var r = Object.keys(e); return function(a) { for (var n = {}, i = 0; i < r.length; i++) { var s = r[i], o = a == null ? void 0 : a[s]; n[s] = o === void 0 ? e[s] : o; } return n; }; }, xr = function(e, r, a) { for (var n = e.length - 1; n >= 0 && !(e[n] === r && (e.splice(n, 1), a)); n--) ; }, oi = function(e) { e.splice(0, e.length); }, Ku = function(e, r) { for (var a = 0; a < r.length; a++) { var n = r[a]; e.push(n); } }, er = function(e, r, a) { return a && (r = Et(a, r)), e[r]; }, Tr = function(e, r, a, n) { a && (r = Et(a, r)), e[r] = n; }, Zu = /* @__PURE__ */ function() { function t() { fe(this, t), this._obj = {}; } return C(t, [{ key: "set", value: function(r, a) { return this._obj[r] = a, this; } }, { key: "delete", value: function(r) { return this._obj[r] = void 0, this; } }, { key: "clear", value: function() { this._obj = {}; } }, { key: "has", value: function(r) { return this._obj[r] !== void 0; } }, { key: "get", value: function(r) { return this._obj[r]; } }]), t; }(), ur = typeof Map < "u" ? Map : Zu, Qu = "undefined", Ju = /* @__PURE__ */ function() { function t(e) { if (fe(this, t), this._obj = /* @__PURE__ */ Object.create(null), this.size = 0, e != null) { var r; e.instanceString != null && e.instanceString() === this.instanceString() ? r = e.toArray() : r = e; for (var a = 0; a < r.length; a++) this.add(r[a]); } } return C(t, [{ key: "instanceString", value: function() { return "set"; } }, { key: "add", value: function(r) { var a = this._obj; a[r] !== 1 && (a[r] = 1, this.size++); } }, { key: "delete", value: function(r) { var a = this._obj; a[r] === 1 && (a[r] = 0, this.size--); } }, { key: "clear", value: function() { this._obj = /* @__PURE__ */ Object.create(null); } }, { key: "has", value: function(r) { return this._obj[r] === 1; } }, { key: "toArray", value: function() { var r = this; return Object.keys(this._obj).filter(function(a) { return r.has(a); }); } }, { key: "forEach", value: function(r, a) { return this.toArray().forEach(r, a); } }]), t; }(), Jr = (typeof Set > "u" ? "undefined" : _(Set)) !== Qu ? Set : Ju, hn = function(e, r) { var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0; if (e === void 0 || r === void 0 || !Ye(e)) { xt("An element must have a core reference and parameters set"); return; } var n = r.group; if (n == null && (r.data && r.data.source != null && r.data.target != null ? n = "edges" : n = "nodes"), n !== "nodes" && n !== "edges") { xt("An element must be of type `nodes` or `edges`; you specified `" + n + "`"); return; } this.length = 1, this[0] = this; var i = this._private = { cy: e, single: !0, // indicates this is an element data: r.data || {}, // data object position: r.position || { x: 0, y: 0 }, // (x, y) position pair autoWidth: void 0, // width and height of nodes calculated by the renderer when set to special 'auto' value autoHeight: void 0, autoPadding: void 0, compoundBoundsClean: !1, // whether the compound dimensions need to be recalculated the next time dimensions are read listeners: [], // array of bound listeners group: n, // string; 'nodes' or 'edges' style: {}, // properties as set by the style rstyle: {}, // properties for style sent from the renderer to the core styleCxts: [], // applied style contexts from the styler styleKeys: {}, // per-group keys of style property values removed: !0, // whether it's inside the vis; true if removed (set true here since we call restore) selected: !!r.selected, // whether it's selected selectable: r.selectable === void 0 ? !0 : !!r.selectable, // whether it's selectable locked: !!r.locked, // whether the element is locked (cannot be moved) grabbed: !1, // whether the element is grabbed by the mouse; renderer sets this privately grabbable: r.grabbable === void 0 ? !0 : !!r.grabbable, // whether the element can be grabbed pannable: r.pannable === void 0 ? n === "edges" : !!r.pannable, // whether the element has passthrough panning enabled active: !1, // whether the element is active from user interaction classes: new Jr(), // map ( className => true ) animation: { // object for currently-running animations current: [], queue: [] }, rscratch: {}, // object in which the renderer can store information scratch: r.scratch || {}, // scratch objects edges: [], // array of connected edges children: [], // array of children parent: r.parent && r.parent.isNode() ? r.parent : null, // parent ref traversalCache: {}, // cache of output of traversal functions backgrounding: !1, // whether background images are loading bbCache: null, // cache of the current bounding box bbCacheShift: { x: 0, y: 0 }, // shift applied to cached bb to be applied on n