import { g as e, h as t } from "./src-CFVe5TPD.js";
import { L as n, O as r, Q as i, Z as a, b as o, d as s, et as c, y as l } from "./chunk-ICPOFSXX-B9JXAgJU.js";
import "./chunk-5PVQY5BW-BCjrVrWB.js";
import "./chunk-U2HBQHQK-75Isf1R4.js";
import "./chunk-BSJP7CBP-DE8WR0MI.js";
import "./chunk-ZZ45TVLE-DUagTZ9d.js";
import { t as u } from "./chunk-55IACEB6-DBivnNb2.js";
import { t as d } from "./chunk-EDXVE4YY-DE9KzYM-.js";
import "./chunk-X2U36JSP-DSzducJI.js";
import "./chunk-5FUZZQ4R-tiEjqlP4.js";
import "./chunk-ENJZ2VHE-DlxIC-A3.js";
import { r as f, t as p } from "./chunk-336JU56O-CFKWNcxR.js";
//#region ../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/stringify.js
var m = [];
for (let e = 0; e < 256; ++e) m.push((e + 256).toString(16).slice(1));
function h(e, t = 0) {
	return (m[e[t + 0]] + m[e[t + 1]] + m[e[t + 2]] + m[e[t + 3]] + "-" + m[e[t + 4]] + m[e[t + 5]] + "-" + m[e[t + 6]] + m[e[t + 7]] + "-" + m[e[t + 8]] + m[e[t + 9]] + "-" + m[e[t + 10]] + m[e[t + 11]] + m[e[t + 12]] + m[e[t + 13]] + m[e[t + 14]] + m[e[t + 15]]).toLowerCase();
}
//#endregion
//#region ../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/rng.js
var g, _ = new Uint8Array(16);
function v() {
	if (!g) {
		if (typeof crypto > "u" || !crypto.getRandomValues) throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
		g = crypto.getRandomValues.bind(crypto);
	}
	return g(_);
}
var y = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
//#endregion
//#region ../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/v4.js
function b(e, t, n) {
	if (y.randomUUID && !t && !e) return y.randomUUID();
	e ||= {};
	let r = e.random ?? e.rng?.() ?? v();
	if (r.length < 16) throw Error("Random bytes length must be >= 16");
	if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
		if (n ||= 0, n < 0 || n + 16 > t.length) throw RangeError(`UUID byte range ${n}:${n + 15} is out of buffer bounds`);
		for (let e = 0; e < 16; ++e) t[n + e] = r[e];
		return t;
	}
	return h(r);
}
//#endregion
//#region ../../node_modules/.pnpm/mermaid@11.14.0/node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-QFDTVHPH.mjs
var x = (function() {
	var e = /* @__PURE__ */ t(function(e, t, n, r) {
		for (n ||= {}, r = e.length; r--; n[e[r]] = t);
		return n;
	}, "o"), n = [1, 4], r = [1, 13], i = [1, 12], a = [1, 15], o = [1, 16], s = [1, 20], c = [1, 19], l = [
		6,
		7,
		8
	], u = [1, 26], d = [1, 24], f = [1, 25], p = [
		6,
		7,
		11
	], m = [
		1,
		6,
		13,
		15,
		16,
		19,
		22
	], h = [1, 33], g = [1, 34], _ = [
		1,
		6,
		7,
		11,
		13,
		15,
		16,
		19,
		22
	], v = {
		trace: /* @__PURE__ */ t(function() {}, "trace"),
		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: /* @__PURE__ */ t(function(e, t, n, r, i, a, o) {
			var s = a.length - 1;
			switch (i) {
				case 6:
				case 7: return r;
				case 8:
					r.getLogger().trace("Stop NL ");
					break;
				case 9:
					r.getLogger().trace("Stop EOF ");
					break;
				case 11:
					r.getLogger().trace("Stop NL2 ");
					break;
				case 12:
					r.getLogger().trace("Stop EOF2 ");
					break;
				case 15:
					r.getLogger().info("Node: ", a[s].id), r.addNode(a[s - 1].length, a[s].id, a[s].descr, a[s].type);
					break;
				case 16:
					r.getLogger().trace("Icon: ", a[s]), r.decorateNode({ icon: a[s] });
					break;
				case 17:
				case 21:
					r.decorateNode({ class: a[s] });
					break;
				case 18:
					r.getLogger().trace("SPACELIST");
					break;
				case 19:
					r.getLogger().trace("Node: ", a[s].id), r.addNode(0, a[s].id, a[s].descr, a[s].type);
					break;
				case 20:
					r.decorateNode({ icon: a[s] });
					break;
				case 25:
					r.getLogger().trace("node found ..", a[s - 2]), this.$ = {
						id: a[s - 1],
						descr: a[s - 1],
						type: r.getType(a[s - 2], a[s])
					};
					break;
				case 26:
					this.$ = {
						id: a[s],
						descr: a[s],
						type: r.nodeType.DEFAULT
					};
					break;
				case 27:
					r.getLogger().trace("node found ..", a[s - 3]), this.$ = {
						id: a[s - 3],
						descr: a[s - 1],
						type: r.getType(a[s - 2], a[s])
					};
					break;
			}
		}, "anonymous"),
		table: [
			{
				3: 1,
				4: 2,
				5: 3,
				6: [1, 5],
				8: n
			},
			{ 1: [3] },
			{ 1: [2, 1] },
			{
				4: 6,
				6: [1, 7],
				7: [1, 8],
				8: n
			},
			{
				6: r,
				7: [1, 10],
				9: 9,
				12: 11,
				13: i,
				14: 14,
				15: a,
				16: o,
				17: 17,
				18: 18,
				19: s,
				22: c
			},
			e(l, [2, 3]),
			{ 1: [2, 2] },
			e(l, [2, 4]),
			e(l, [2, 5]),
			{
				1: [2, 6],
				6: r,
				12: 21,
				13: i,
				14: 14,
				15: a,
				16: o,
				17: 17,
				18: 18,
				19: s,
				22: c
			},
			{
				6: r,
				9: 22,
				12: 11,
				13: i,
				14: 14,
				15: a,
				16: o,
				17: 17,
				18: 18,
				19: s,
				22: c
			},
			{
				6: u,
				7: d,
				10: 23,
				11: f
			},
			e(p, [2, 22], {
				17: 17,
				18: 18,
				14: 27,
				15: [1, 28],
				16: [1, 29],
				19: s,
				22: c
			}),
			e(p, [2, 18]),
			e(p, [2, 19]),
			e(p, [2, 20]),
			e(p, [2, 21]),
			e(p, [2, 23]),
			e(p, [2, 24]),
			e(p, [2, 26], { 19: [1, 30] }),
			{ 20: [1, 31] },
			{
				6: u,
				7: d,
				10: 32,
				11: f
			},
			{
				1: [2, 7],
				6: r,
				12: 21,
				13: i,
				14: 14,
				15: a,
				16: o,
				17: 17,
				18: 18,
				19: s,
				22: c
			},
			e(m, [2, 14], {
				7: h,
				11: g
			}),
			e(_, [2, 8]),
			e(_, [2, 9]),
			e(_, [2, 10]),
			e(p, [2, 15]),
			e(p, [2, 16]),
			e(p, [2, 17]),
			{ 20: [1, 35] },
			{ 21: [1, 36] },
			e(m, [2, 13], {
				7: h,
				11: g
			}),
			e(_, [2, 11]),
			e(_, [2, 12]),
			{ 21: [1, 37] },
			e(p, [2, 25]),
			e(p, [2, 27])
		],
		defaultActions: {
			2: [2, 1],
			6: [2, 2]
		},
		parseError: /* @__PURE__ */ t(function(e, t) {
			if (t.recoverable) this.trace(e);
			else {
				var n = Error(e);
				throw n.hash = t, n;
			}
		}, "parseError"),
		parse: /* @__PURE__ */ t(function(e) {
			var n = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = o.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
			for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
			h.setInput(e, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
			var v = h.yylloc;
			o.push(v);
			var y = h.options && h.options.ranges;
			typeof g.yy.parseError == "function" ? this.parseError = g.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
			function b(e) {
				r.length -= 2 * e, a.length -= e, o.length -= e;
			}
			t(b, "popStack");
			function x() {
				var e = i.pop() || h.lex() || p;
				return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = n.symbols_[e] || e), e;
			}
			t(x, "lex");
			for (var S, C, w, T, E, D = {}, O, k, A, j;;) {
				if (w = r[r.length - 1], this.defaultActions[w] ? T = this.defaultActions[w] : (S ??= x(), T = s[w] && s[w][S]), T === void 0 || !T.length || !T[0]) {
					var M = "";
					for (O in j = [], s[w]) this.terminals_[O] && O > f && j.push("'" + this.terminals_[O] + "'");
					M = h.showPosition ? "Parse error on line " + (l + 1) + ":\n" + h.showPosition() + "\nExpecting " + j.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (S == p ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(M, {
						text: h.match,
						token: this.terminals_[S] || S,
						line: h.yylineno,
						loc: v,
						expected: j
					});
				}
				if (T[0] instanceof Array && T.length > 1) throw Error("Parse Error: multiple actions possible at state: " + w + ", token: " + S);
				switch (T[0]) {
					case 1:
						r.push(S), a.push(h.yytext), o.push(h.yylloc), r.push(T[1]), S = null, C ? (S = C, C = null) : (u = h.yyleng, c = h.yytext, l = h.yylineno, v = h.yylloc, d > 0 && d--);
						break;
					case 2:
						if (k = this.productions_[T[1]][1], D.$ = a[a.length - k], D._$ = {
							first_line: o[o.length - (k || 1)].first_line,
							last_line: o[o.length - 1].last_line,
							first_column: o[o.length - (k || 1)].first_column,
							last_column: o[o.length - 1].last_column
						}, y && (D._$.range = [o[o.length - (k || 1)].range[0], o[o.length - 1].range[1]]), E = this.performAction.apply(D, [
							c,
							u,
							l,
							g.yy,
							T[1],
							a,
							o
						].concat(m)), E !== void 0) return E;
						k && (r = r.slice(0, -1 * k * 2), a = a.slice(0, -1 * k), o = o.slice(0, -1 * k)), r.push(this.productions_[T[1]][0]), a.push(D.$), o.push(D._$), A = s[r[r.length - 2]][r[r.length - 1]], r.push(A);
						break;
					case 3: return !0;
				}
			}
			return !0;
		}, "parse")
	};
	v.lexer = /* @__PURE__ */ (function() {
		return {
			EOF: 1,
			parseError: /* @__PURE__ */ t(function(e, t) {
				if (this.yy.parser) this.yy.parser.parseError(e, t);
				else throw Error(e);
			}, "parseError"),
			setInput: /* @__PURE__ */ t(function(e, t) {
				return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
					first_line: 1,
					first_column: 0,
					last_line: 1,
					last_column: 0
				}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
			}, "setInput"),
			input: /* @__PURE__ */ t(function() {
				var e = this._input[0];
				return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
			}, "input"),
			unput: /* @__PURE__ */ t(function(e) {
				var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
				this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
				var r = 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), n.length - 1 && (this.yylineno -= n.length - 1);
				var i = 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: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
				}, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
			}, "unput"),
			more: /* @__PURE__ */ t(function() {
				return this._more = !0, this;
			}, "more"),
			reject: /* @__PURE__ */ t(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).\n" + this.showPosition(), {
					text: "",
					token: null,
					line: this.yylineno
				});
				return this;
			}, "reject"),
			less: /* @__PURE__ */ t(function(e) {
				this.unput(this.match.slice(e));
			}, "less"),
			pastInput: /* @__PURE__ */ t(function() {
				var e = this.matched.substr(0, this.matched.length - this.match.length);
				return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
			}, "pastInput"),
			upcomingInput: /* @__PURE__ */ t(function() {
				var e = this.match;
				return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
			}, "upcomingInput"),
			showPosition: /* @__PURE__ */ t(function() {
				var e = this.pastInput(), t = Array(e.length + 1).join("-");
				return e + this.upcomingInput() + "\n" + t + "^";
			}, "showPosition"),
			test_match: /* @__PURE__ */ t(function(e, t) {
				var n, r, i;
				if (this.options.backtrack_lexer && (i = {
					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 && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
					first_line: this.yylloc.last_line,
					last_line: this.yylineno + 1,
					first_column: this.yylloc.last_column,
					last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
				}, this.yytext += e[0], this.match += e[0], this.matches = e, 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(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
				if (this._backtrack) {
					for (var a in i) this[a] = i[a];
					return !1;
				}
				return !1;
			}, "test_match"),
			next: /* @__PURE__ */ t(function() {
				if (this.done) return this.EOF;
				this._input || (this.done = !0);
				var e, t, n, r;
				this._more || (this.yytext = "", this.match = "");
				for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
					if (t = n, r = a, this.options.backtrack_lexer) {
						if (e = this.test_match(n, i[a]), e !== !1) return e;
						if (this._backtrack) {
							t = !1;
							continue;
						} else return !1;
					} else if (!this.options.flex) break;
				}
				return t ? (e = this.test_match(t, i[r]), e === !1 ? !1 : e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
					text: "",
					token: null,
					line: this.yylineno
				});
			}, "next"),
			lex: /* @__PURE__ */ t(function() {
				return this.next() || this.lex();
			}, "lex"),
			begin: /* @__PURE__ */ t(function(e) {
				this.conditionStack.push(e);
			}, "begin"),
			popState: /* @__PURE__ */ t(function() {
				return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
			}, "popState"),
			_currentRules: /* @__PURE__ */ t(function() {
				return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
			}, "_currentRules"),
			topState: /* @__PURE__ */ t(function(e) {
				return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
			}, "topState"),
			pushState: /* @__PURE__ */ t(function(e) {
				this.begin(e);
			}, "pushState"),
			stateStackSize: /* @__PURE__ */ t(function() {
				return this.conditionStack.length;
			}, "stateStackSize"),
			options: { "case-insensitive": !0 },
			performAction: /* @__PURE__ */ t(function(e, t, n, r) {
				switch (n) {
					case 0: return e.getLogger().trace("Found comment", t.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:
						e.getLogger().trace("Begin icon"), this.begin("ICON");
						break;
					case 6: return e.getLogger().trace("SPACELINE"), 6;
					case 7: return 7;
					case 8: return 15;
					case 9:
						e.getLogger().trace("end icon"), this.popState();
						break;
					case 10: return e.getLogger().trace("Exploding node"), this.begin("NODE"), 19;
					case 11: return e.getLogger().trace("Cloud"), this.begin("NODE"), 19;
					case 12: return e.getLogger().trace("Explosion Bang"), this.begin("NODE"), 19;
					case 13: return e.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:
						e.getLogger().trace("Starting NSTR"), this.begin("NSTR");
						break;
					case 25: return e.getLogger().trace("description:", t.yytext), "NODE_DESCR";
					case 26:
						this.popState();
						break;
					case 27: return this.popState(), e.getLogger().trace("node end ))"), "NODE_DEND";
					case 28: return this.popState(), e.getLogger().trace("node end )"), "NODE_DEND";
					case 29: return this.popState(), e.getLogger().trace("node end ...", t.yytext), "NODE_DEND";
					case 30: return this.popState(), e.getLogger().trace("node end (("), "NODE_DEND";
					case 31: return this.popState(), e.getLogger().trace("node end (-"), "NODE_DEND";
					case 32: return this.popState(), e.getLogger().trace("node end (-"), "NODE_DEND";
					case 33: return this.popState(), e.getLogger().trace("node end (("), "NODE_DEND";
					case 34: return this.popState(), e.getLogger().trace("node end (("), "NODE_DEND";
					case 35: return e.getLogger().trace("Long description:", t.yytext), 20;
					case 36: return e.getLogger().trace("Long description:", t.yytext), 20;
				}
			}, "anonymous"),
			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
				}
			}
		};
	})();
	function y() {
		this.yy = {};
	}
	return t(y, "Parser"), y.prototype = v, v.Parser = y, new y();
})();
x.parser = x;
var S = x, C = 12, w = {
	DEFAULT: 0,
	NO_BORDER: 0,
	ROUNDED_RECT: 1,
	RECT: 2,
	CIRCLE: 3,
	CLOUD: 4,
	BANG: 5,
	HEXAGON: 6
}, T = class {
	constructor() {
		this.nodes = [], this.count = 0, this.elements = {}, this.getLogger = this.getLogger.bind(this), this.nodeType = w, this.clear(), this.getType = this.getType.bind(this), this.getElementById = this.getElementById.bind(this), this.getParent = this.getParent.bind(this), this.getMindmap = this.getMindmap.bind(this), this.addNode = this.addNode.bind(this), this.decorateNode = this.decorateNode.bind(this);
	}
	static {
		t(this, "MindmapDB");
	}
	clear() {
		this.nodes = [], this.count = 0, this.elements = {}, this.baseLevel = void 0;
	}
	getParent(e) {
		for (let t = this.nodes.length - 1; t >= 0; t--) if (this.nodes[t].level < e) return this.nodes[t];
		return null;
	}
	getMindmap() {
		return this.nodes.length > 0 ? this.nodes[0] : null;
	}
	addNode(t, r, i, a) {
		e.info("addNode", t, r, i, a);
		let c = !1;
		this.nodes.length === 0 ? (this.baseLevel = t, t = 0, c = !0) : this.baseLevel !== void 0 && (t -= this.baseLevel, c = !1);
		let l = o(), u = l.mindmap?.padding ?? s.mindmap.padding;
		switch (a) {
			case this.nodeType.ROUNDED_RECT:
			case this.nodeType.RECT:
			case this.nodeType.HEXAGON:
				u *= 2;
				break;
		}
		let d = {
			id: this.count++,
			nodeId: n(r, l),
			level: t,
			descr: n(i, l),
			type: a,
			children: [],
			width: l.mindmap?.maxNodeWidth ?? s.mindmap.maxNodeWidth,
			padding: u,
			isRoot: c
		}, f = this.getParent(t);
		if (f) f.children.push(d), this.nodes.push(d);
		else if (c) this.nodes.push(d);
		else throw Error(`There can be only one root. No parent could be found for ("${d.descr}")`);
	}
	getType(t, n) {
		switch (e.debug("In get type", t, n), t) {
			case "[": return this.nodeType.RECT;
			case "(": return n === ")" ? this.nodeType.ROUNDED_RECT : this.nodeType.CLOUD;
			case "((": return this.nodeType.CIRCLE;
			case ")": return this.nodeType.CLOUD;
			case "))": return this.nodeType.BANG;
			case "{{": return this.nodeType.HEXAGON;
			default: return this.nodeType.DEFAULT;
		}
	}
	setElementForId(e, t) {
		this.elements[e] = t;
	}
	getElementById(e) {
		return this.elements[e];
	}
	decorateNode(e) {
		if (!e) return;
		let t = o(), r = this.nodes[this.nodes.length - 1];
		e.icon && (r.icon = n(e.icon, t)), e.class && (r.class = n(e.class, t));
	}
	type2Str(e) {
		switch (e) {
			case this.nodeType.DEFAULT: return "no-border";
			case this.nodeType.RECT: return "rect";
			case this.nodeType.ROUNDED_RECT: return "rounded-rect";
			case this.nodeType.CIRCLE: return "circle";
			case this.nodeType.CLOUD: return "cloud";
			case this.nodeType.BANG: return "bang";
			case this.nodeType.HEXAGON: return "hexgon";
			default: return "no-border";
		}
	}
	assignSections(e, t) {
		if (e.level === 0 ? e.section = void 0 : e.section = t, e.children) for (let [n, r] of e.children.entries()) {
			let i = e.level === 0 ? n % (C - 1) : t;
			this.assignSections(r, i);
		}
	}
	flattenNodes(e, n) {
		let r = o(), i = ["mindmap-node"];
		e.isRoot === !0 ? i.push("section-root", "section--1") : e.section !== void 0 && i.push(`section-${e.section}`), e.class && i.push(e.class);
		let a = i.join(" "), s = /* @__PURE__ */ t((e) => {
			let t = (r.theme?.toLowerCase() ?? "").includes("redux");
			switch (e) {
				case w.CIRCLE: return "mindmapCircle";
				case w.RECT: return "rect";
				case w.ROUNDED_RECT: return "rounded";
				case w.CLOUD: return "cloud";
				case w.BANG: return "bang";
				case w.HEXAGON: return "hexagon";
				case w.DEFAULT: return t ? "rounded" : "defaultMindmapNode";
				case w.NO_BORDER:
				default: return "rect";
			}
		}, "getShapeFromType"), c = {
			id: e.id.toString(),
			domId: "node_" + e.id.toString(),
			label: e.descr,
			labelType: "markdown",
			isGroup: !1,
			shape: s(e.type),
			width: e.width,
			height: e.height ?? 0,
			padding: e.padding,
			cssClasses: a,
			cssStyles: [],
			look: r.look,
			icon: e.icon,
			x: e.x,
			y: e.y,
			level: e.level,
			nodeId: e.nodeId,
			type: e.type,
			section: e.section
		};
		if (n.push(c), e.children) for (let t of e.children) this.flattenNodes(t, n);
	}
	generateEdges(e, t) {
		if (!e.children) return;
		let n = o();
		for (let r of e.children) {
			let i = "edge";
			r.section !== void 0 && (i += ` section-edge-${r.section}`);
			let a = e.level + 1;
			i += ` edge-depth-${a}`;
			let o = {
				id: `edge_${e.id}_${r.id}`,
				start: e.id.toString(),
				end: r.id.toString(),
				type: "normal",
				curve: "basis",
				thickness: "normal",
				look: n.look,
				classes: i,
				depth: e.level,
				section: r.section
			};
			t.push(o), this.generateEdges(r, t);
		}
	}
	getData() {
		let t = this.getMindmap(), n = o(), i = r().layout !== void 0, a = n;
		if (i || (a.layout = "cose-bilkent"), !t) return {
			nodes: [],
			edges: [],
			config: a
		};
		e.debug("getData: mindmapRoot", t, n), this.assignSections(t);
		let s = [], c = [];
		this.flattenNodes(t, s), this.generateEdges(t, c), e.debug(`getData: processed ${s.length} nodes and ${c.length} edges`);
		let l = /* @__PURE__ */ new Map();
		for (let e of s) l.set(e.id, {
			shape: e.shape,
			width: e.width,
			height: e.height,
			padding: e.padding
		});
		return {
			nodes: s,
			edges: c,
			config: a,
			rootNode: t,
			markers: ["point"],
			direction: "TB",
			nodeSpacing: 50,
			rankSpacing: 50,
			shapes: Object.fromEntries(l),
			type: "mindmap",
			diagramId: "mindmap-" + b()
		};
	}
	getLogger() {
		return e;
	}
}, E = { draw: /* @__PURE__ */ t(async (t, n, r, i) => {
	e.debug("Rendering mindmap diagram\n" + t);
	let a = i.db, o = a.getData(), c = u(n, o.config.securityLevel);
	if (o.type = i.type, o.layoutAlgorithm = p(o.config.layout, { fallback: "cose-bilkent" }), o.diagramId = n, !a.getMindmap()) return;
	o.nodes.forEach((e) => {
		e.shape === "rounded" ? (e.radius = 15, e.taper = 15, e.stroke = "none", e.width = 0, e.padding = 15) : e.shape === "circle" ? e.padding = 10 : e.shape === "rect" ? (e.width = 0, e.padding = 10) : e.shape === "hexagon" && (e.width = 0, e.height = 0);
	}), await f(o, c);
	let { themeVariables: m } = l(), { useGradient: h, gradientStart: g, gradientStop: _ } = m;
	if (h && g && _) {
		let e = c.attr("id"), t = c.append("defs").append("linearGradient").attr("id", `${e}-gradient`).attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
		t.append("stop").attr("offset", "0%").attr("stop-color", g).attr("stop-opacity", 1), t.append("stop").attr("offset", "100%").attr("stop-color", _).attr("stop-opacity", 1);
	}
	d(c, o.config.mindmap?.padding ?? s.mindmap.padding, "mindmapDiagram", o.config.mindmap?.useMaxWidth ?? s.mindmap.useMaxWidth);
}, "draw") }, D = /* @__PURE__ */ t((e) => {
	let { theme: t, look: n } = e, r = "";
	for (let t = 0; t < e.THEME_COLOR_LIMIT; t++) e["lineColor" + t] = e["lineColor" + t] || e["cScaleInv" + t], c(e["lineColor" + t]) ? e["lineColor" + t] = i(e["lineColor" + t], 20) : e["lineColor" + t] = a(e["lineColor" + t], 20);
	for (let i = 0; i < e.THEME_COLOR_LIMIT; i++) {
		let a = "" + (n === "neo" ? Math.max(10 - (i - 1) * 2, 2) : 17 - 3 * i);
		r += `
    .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} polygon, .section-${i - 1} path  {
      fill: ${e["cScale" + i]};
    }
    .section-${i - 1} text {
     fill: ${e["cScaleLabel" + i]};
    }
     .section-${i - 1} span {
     color: ${e["cScaleLabel" + i]};
    }
    .node-icon-${i - 1} {
      font-size: 40px;
      color: ${e["cScaleLabel" + i]};
    }
    .section-edge-${i - 1}{
      stroke: ${e["cScale" + i]};
    }
    .edge-depth-${i - 1}{
      stroke-width: ${a};
    }
    .section-${i - 1} line {
      stroke: ${e["cScaleInv" + i]} ;
      stroke-width: 3;
    }

    .disabled, .disabled circle, .disabled text {
      fill: lightgray;
    }
    .disabled text {
      fill: #efefef;
    }
    [data-look="neo"].mindmap-node.section-${i - 1} rect, [data-look="neo"].mindmap-node.section-${i - 1} path, [data-look="neo"].mindmap-node.section-${i - 1} circle, [data-look="neo"].mindmap-node.section-${i - 1} polygon {
      fill: ${t === "redux" || t === "redux-dark" || t === "neutral" ? e.mainBkg : e["cScale" + i]};
      stroke: ${t === "redux" || t === "redux-dark" ? e.nodeBorder : e["cScale" + i]};
      stroke-width: ${e.strokeWidth ?? 2}px;
    }
    [data-look="neo"].section-edge-${i - 1}{
      stroke: ${t?.includes("redux") || t === "neo-dark" ? e.nodeBorder : e["cScale" + i]};
    }
    [data-look="neo"].mindmap-node.section-${i - 1} text {
     fill: ${t === "redux" || t === "redux-dark" ? e.nodeBorder : e["cScaleLabel" + (t === "neutral" ? 1 : i)]};
    }
    `;
	}
	return r;
}, "genSections"), O = /* @__PURE__ */ t((e, t, n) => {
	let r = "";
	for (let i = 0; i < e; i++) r += `
    [data-look="neo"].mindmap-node.section-${i - 1} rect, [data-look="neo"].mindmap-node.section-${i - 1} path, [data-look="neo"].mindmap-node.section-${i - 1} circle, [data-look="neo"].mindmap-node.section-${i - 1} polygon {
      stroke: url(${t}-gradient);
      fill: ${n};
    }
    .section-${i - 1} line {
      stroke-width: 0;
    }`;
	return r;
}, "genGradient"), k = {
	get db() {
		return new T();
	},
	renderer: E,
	parser: S,
	styles: /* @__PURE__ */ t((e) => {
		let { theme: t } = e, n = e.svgId, r = e.dropShadow ? e.dropShadow.replace("url(#drop-shadow)", `url(${n}-drop-shadow)`) : "none";
		return `
  .edge {
    stroke-width: 3;
  }
  ${D(e)}
  .section-root rect, .section-root path, .section-root circle, .section-root polygon  {
    fill: ${e.git0};
  }
  .section-root text {
    fill: ${e.gitBranchLabel0};
  }
  .section-root span {
    color: ${t?.includes("redux") ? e.nodeBorder : e.gitBranchLabel0};
  }
  .icon-container {
    height:100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .edge {
    fill: none;
  }
  .mindmap-node-label {
    dy: 1em;
    alignment-baseline: middle;
    text-anchor: middle;
    dominant-baseline: middle;
    text-align: center;
  }
  [data-look="neo"].mindmap-node  {
    filter: ${r};
  }
  [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon  {
    fill: ${t?.includes("redux") ? e.mainBkg : e.git0};
  }
  [data-look="neo"].mindmap-node.section-root .text-inner-tspan {
    fill:  ${t?.includes("redux") ? e.nodeBorder : e["cScaleLabel" + +(t === "neutral")]};
  }
  ${e.useGradient && n && e.mainBkg ? O(e.THEME_COLOR_LIMIT, n, e.mainBkg) : ""}
`;
	}, "getStyles")
};
//#endregion
export { k as diagram };
