import { t as e } from "./purify.es-Dsqc2y0I.js";
import { w as t } from "./src-BEYP07TO.js";
import { t as n } from "./isEmpty-SB7gHWzg.js";
import { a as r, d as i, h as a, i as o, m as s, r as c } from "./chunk-GEFDOKGD-bXEkwPrJ.js";
import { i as l, n as u, r as d } from "./src-hxErHTV1.js";
import { F as f, G as p, H as m, J as h, M as g, N as _, S as v, T as y, X as b, Y as x, c as S, f as C, g as ee, h as te, l as w, n as ne, p as T, r as re, t as ie, w as ae, x as E, y as D, z as oe } from "./chunk-7R4GIKGN-DiZ1HYFd.js";
import { t as se } from "./chunk-HHEYEP7N-BdiTBCvb.js";
import { i as ce, o as le } from "./chunk-PU5JKC2W-CAfe4Tg3.js";
import "./chunk-MX3YWQON-DnBlqD44.js";
import "./chunk-YBOYWFTD-DVqQ1pen.js";
import "./chunk-PQ6SQG4A-DPz_e-Es.js";
import "./chunk-KYZI473N-4Y4_4kXL.js";
import "./chunk-O4XLMI2P-BcKxBhcn.js";
import { n as ue } from "./chunk-GLR3WWYH-GIQ55uMn.js";
import { n as de, t as fe } from "./chunk-XPW4576I-DkznIIIK.js";
//#region node_modules/stylis/src/Enum.js
var pe = "comm", me = "rule", he = "decl", ge = "@import", _e = "@namespace", ve = "@keyframes", ye = "@layer", be = Math.abs, O = String.fromCharCode;
function xe(e) {
	return e.trim();
}
function k(e, t, n) {
	return e.replace(t, n);
}
function Se(e, t, n) {
	return e.indexOf(t, n);
}
function A(e, t) {
	return e.charCodeAt(t) | 0;
}
function j(e, t, n) {
	return e.slice(t, n);
}
function M(e) {
	return e.length;
}
function Ce(e) {
	return e.length;
}
function N(e, t) {
	return t.push(e), e;
}
//#endregion
//#region node_modules/stylis/src/Tokenizer.js
var P = 1, F = 1, we = 0, I = 0, L = 0, R = "";
function z(e, t, n, r, i, a, o, s) {
	return {
		value: e,
		root: t,
		parent: n,
		type: r,
		props: i,
		children: a,
		line: P,
		column: F,
		length: o,
		return: "",
		siblings: s
	};
}
function Te() {
	return L;
}
function Ee() {
	return L = I > 0 ? A(R, --I) : 0, F--, L === 10 && (F = 1, P--), L;
}
function B() {
	return L = I < we ? A(R, I++) : 0, F++, L === 10 && (F = 1, P++), L;
}
function V() {
	return A(R, I);
}
function H() {
	return I;
}
function U(e, t) {
	return j(R, e, t);
}
function W(e) {
	switch (e) {
		case 0:
		case 9:
		case 10:
		case 13:
		case 32: return 5;
		case 33:
		case 43:
		case 44:
		case 47:
		case 62:
		case 64:
		case 126:
		case 59:
		case 123:
		case 125: return 4;
		case 58: return 3;
		case 34:
		case 39:
		case 40:
		case 91: return 2;
		case 41:
		case 93: return 1;
	}
	return 0;
}
function De(e) {
	return P = F = 1, we = M(R = e), I = 0, [];
}
function Oe(e) {
	return R = "", e;
}
function G(e) {
	return xe(U(I - 1, K(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
}
function ke(e) {
	for (; (L = V()) && L < 33;) B();
	return W(e) > 2 || W(L) > 3 ? "" : " ";
}
function Ae(e, t) {
	for (; --t && B() && !(L < 48 || L > 102 || L > 57 && L < 65 || L > 70 && L < 97););
	return U(e, H() + (t < 6 && V() == 32 && B() == 32));
}
function K(e) {
	for (; B();) switch (L) {
		case e: return I;
		case 34:
		case 39:
			e !== 34 && e !== 39 && K(L);
			break;
		case 40:
			e === 41 && K(e);
			break;
		case 92:
			B();
			break;
	}
	return I;
}
function je(e, t) {
	for (; B() && e + L !== 57 && !(e + L === 84 && V() === 47););
	return "/*" + U(t, I - 1) + "*" + O(e === 47 ? e : B());
}
function Me(e) {
	for (; !W(V());) B();
	return U(e, I);
}
//#endregion
//#region node_modules/stylis/src/Parser.js
function Ne(e) {
	return Oe(q("", null, null, null, [""], e = De(e), 0, [0], e));
}
function q(e, t, n, r, i, a, o, s, c) {
	for (var l = 0, u = 0, d = o, f = 0, p = 0, m = 0, h = 1, g = 1, _ = 1, v = 0, y = "", b = i, x = a, S = r, C = y; g;) switch (m = v, v = B()) {
		case 40: if (m != 108 && A(C, d - 1) == 58) {
			Se(C += k(G(v), "&", "&\f"), "&\f", be(l ? s[l - 1] : 0)) != -1 && (_ = -1);
			break;
		}
		case 34:
		case 39:
		case 91:
			C += G(v);
			break;
		case 9:
		case 10:
		case 13:
		case 32:
			C += ke(m);
			break;
		case 92:
			C += Ae(H() - 1, 7);
			continue;
		case 47:
			switch (V()) {
				case 42:
				case 47:
					N(Fe(je(B(), H()), t, n, c), c), (W(m || 1) == 5 || W(V() || 1) == 5) && M(C) && j(C, -1, void 0) !== " " && (C += " ");
					break;
				default: C += "/";
			}
			break;
		case 123 * h: s[l++] = M(C) * _;
		case 125 * h:
		case 59:
		case 0:
			switch (v) {
				case 0:
				case 125: g = 0;
				case 59 + u:
					_ == -1 && (C = k(C, /\f/g, "")), p > 0 && (M(C) - d || h === 0 && m === 47) && N(p > 32 ? Ie(C + ";", r, n, d - 1, c) : Ie(k(C, " ", "") + ";", r, n, d - 2, c), c);
					break;
				case 59: C += ";";
				default: if (N(S = Pe(C, t, n, l, u, i, s, y, b = [], x = [], d, a), a), v === 123) if (u === 0) q(C, t, S, S, b, a, d, s, x);
				else {
					switch (f) {
						case 99: if (A(C, 3) === 110) break;
						case 108: if (A(C, 2) === 97) break;
						default: u = 0;
						case 100:
						case 109:
						case 115:
					}
					u ? q(e, S, S, r && N(Pe(e, S, S, 0, 0, i, s, y, i, b = [], d, x), x), i, x, d, s, r ? b : x) : q(C, S, S, S, [""], x, 0, s, x);
				}
			}
			l = u = p = 0, h = _ = 1, y = C = "", d = o;
			break;
		case 58: d = 1 + M(C), p = m;
		default:
			if (h < 1) {
				if (v == 123) --h;
				else if (v == 125 && h++ == 0 && Ee() == 125) continue;
			}
			switch (C += O(v), v * h) {
				case 38:
					_ = u > 0 ? 1 : (C += "\f", -1);
					break;
				case 44:
					s[l++] = (M(C) - 1) * _, _ = 1;
					break;
				case 64:
					V() === 45 && (C += G(B())), f = V(), u = d = M(y = C += Me(H())), v++;
					break;
				case 45: m === 45 && M(C) == 2 && (h = 0);
			}
	}
	return a;
}
function Pe(e, t, n, r, i, a, o, s, c, l, u, d) {
	for (var f = i - 1, p = i === 0 ? a : [""], m = Ce(p), h = 0, g = 0, _ = 0; h < r; ++h) for (var v = 0, y = j(e, f + 1, f = be(g = o[h])), b = e; v < m; ++v) (b = xe(g > 0 ? p[v] + " " + y : k(y, /&\f/g, p[v]))) && (c[_++] = b);
	return z(e, t, n, i === 0 ? me : s, c, l, u, d);
}
function Fe(e, t, n, r) {
	return z(e, t, n, pe, O(Te()), j(e, 2, -2), 0, r);
}
function Ie(e, t, n, r, i) {
	return z(e, t, n, he, j(e, 0, r), j(e, r + 1, -1), r, i);
}
//#endregion
//#region node_modules/stylis/src/Serializer.js
function J(e, t) {
	for (var n = "", r = 0; r < e.length; r++) n += t(e[r], r, e, t) || "";
	return n;
}
function Le(e, t, n, r) {
	switch (e.type) {
		case ye: if (e.children.length) break;
		case ge:
		case _e:
		case he: return e.return = e.return || e.value;
		case pe: return "";
		case ve: return e.return = e.value + "{" + J(e.children, r) + "}";
		case me: if (!M(e.value = e.props.join(","))) return "";
	}
	return M(n = J(e.children, r)) ? e.return = e.value + "{" + n + "}" : "";
}
//#endregion
//#region node_modules/mermaid/dist/mermaid.core.mjs
var Re = "c4", ze = {
	id: Re,
	detector: /* @__PURE__ */ u((e) => /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./c4Diagram-IC4MRINW-Du1j-C4R.js");
		return {
			id: Re,
			diagram: e
		};
	}, "loader")
}, Be = "flowchart", Ve = {
	id: Be,
	detector: /* @__PURE__ */ u((e, t) => t?.flowchart?.defaultRenderer === "dagre-wrapper" || t?.flowchart?.defaultRenderer === "elk" ? !1 : /^\s*graph/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./flowDiagram-PKNHOUZH-BFdCj6uy.js");
		return {
			id: Be,
			diagram: e
		};
	}, "loader")
}, He = "flowchart-v2", Ue = {
	id: He,
	detector: /* @__PURE__ */ u((e, t) => t?.flowchart?.defaultRenderer === "dagre-d3" ? !1 : (t?.flowchart?.defaultRenderer === "elk" && (t.layout = "elk"), /^\s*graph/.test(e) && t?.flowchart?.defaultRenderer === "dagre-wrapper" ? !0 : /^\s*flowchart/.test(e)), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./flowDiagram-PKNHOUZH-BFdCj6uy.js");
		return {
			id: He,
			diagram: e
		};
	}, "loader")
}, We = "er", Ge = {
	id: We,
	detector: /* @__PURE__ */ u((e) => /^\s*erDiagram/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./erDiagram-INFDFZHY-Ccs6kW39.js");
		return {
			id: We,
			diagram: e
		};
	}, "loader")
}, Ke = "gitGraph", qe = {
	id: Ke,
	detector: /* @__PURE__ */ u((e) => /^\s*gitGraph/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./gitGraphDiagram-K3NZZRJ6-BaZX5GA5.js");
		return {
			id: Ke,
			diagram: e
		};
	}, "loader")
}, Je = "gantt", Ye = {
	id: Je,
	detector: /* @__PURE__ */ u((e) => /^\s*gantt/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./ganttDiagram-A5KZAMGK-11X4ChEO.js");
		return {
			id: Je,
			diagram: e
		};
	}, "loader")
}, Xe = "info", Ze = {
	id: Xe,
	detector: /* @__PURE__ */ u((e) => /^\s*info/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./infoDiagram-LFFYTUFH-iswGOIAk.js");
		return {
			id: Xe,
			diagram: e
		};
	}, "loader")
}, Qe = "pie", $e = {
	id: Qe,
	detector: /* @__PURE__ */ u((e) => /^\s*pie/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./pieDiagram-SKSYHLDU-BMrGgUAv.js");
		return {
			id: Qe,
			diagram: e
		};
	}, "loader")
}, et = "quadrantChart", tt = {
	id: et,
	detector: /* @__PURE__ */ u((e) => /^\s*quadrantChart/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./quadrantDiagram-337W2JSQ-kFO50yPy.js");
		return {
			id: et,
			diagram: e
		};
	}, "loader")
}, nt = "xychart", rt = {
	id: nt,
	detector: /* @__PURE__ */ u((e) => /^\s*xychart(-beta)?/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./xychartDiagram-JWTSCODW-DjFaG2VD.js");
		return {
			id: nt,
			diagram: e
		};
	}, "loader")
}, it = "requirement", at = {
	id: it,
	detector: /* @__PURE__ */ u((e) => /^\s*requirement(Diagram)?/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./requirementDiagram-Z7DCOOCP-D2Oxfw6G.js");
		return {
			id: it,
			diagram: e
		};
	}, "loader")
}, ot = "sequence", st = {
	id: ot,
	detector: /* @__PURE__ */ u((e) => /^\s*sequenceDiagram/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./sequenceDiagram-2WXFIKYE-BCEaH0s_.js");
		return {
			id: ot,
			diagram: e
		};
	}, "loader")
}, ct = "class", lt = {
	id: ct,
	detector: /* @__PURE__ */ u((e, t) => t?.class?.defaultRenderer === "dagre-wrapper" ? !1 : /^\s*classDiagram/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./classDiagram-VBA2DB6C-DFfohpM0.js");
		return {
			id: ct,
			diagram: e
		};
	}, "loader")
}, ut = "classDiagram", dt = {
	id: ut,
	detector: /* @__PURE__ */ u((e, t) => /^\s*classDiagram/.test(e) && t?.class?.defaultRenderer === "dagre-wrapper" ? !0 : /^\s*classDiagram-v2/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./classDiagram-v2-RAHNMMFH-kUMm28FB.js");
		return {
			id: ut,
			diagram: e
		};
	}, "loader")
}, ft = "state", pt = {
	id: ft,
	detector: /* @__PURE__ */ u((e, t) => t?.state?.defaultRenderer === "dagre-wrapper" ? !1 : /^\s*stateDiagram/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./stateDiagram-RAJIS63D-B-Mu-_BR.js");
		return {
			id: ft,
			diagram: e
		};
	}, "loader")
}, mt = "stateDiagram", ht = {
	id: mt,
	detector: /* @__PURE__ */ u((e, t) => !!(/^\s*stateDiagram-v2/.test(e) || /^\s*stateDiagram/.test(e) && t?.state?.defaultRenderer === "dagre-wrapper"), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./stateDiagram-v2-FVOUBMTO-Cnp2uGxd.js");
		return {
			id: mt,
			diagram: e
		};
	}, "loader")
}, gt = "journey", _t = {
	id: gt,
	detector: /* @__PURE__ */ u((e) => /^\s*journey/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./journeyDiagram-4ABVD52K-BlCQNVun.js");
		return {
			id: gt,
			diagram: e
		};
	}, "loader")
}, vt = { draw: /* @__PURE__ */ u((e, t, n) => {
	d.debug("rendering svg for syntax error\n");
	let r = se(t), i = r.append("g");
	r.attr("viewBox", "0 0 2412 512"), S(r, 100, 512, !0), i.append("path").attr("class", "error-icon").attr("d", "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"), i.append("path").attr("class", "error-icon").attr("d", "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"), i.append("path").attr("class", "error-icon").attr("d", "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"), i.append("path").attr("class", "error-icon").attr("d", "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"), i.append("path").attr("class", "error-icon").attr("d", "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"), i.append("path").attr("class", "error-icon").attr("d", "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"), i.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in text"), i.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${n}`);
}, "draw") }, yt = vt, bt = {
	db: {},
	renderer: vt,
	parser: { parse: /* @__PURE__ */ u(() => {}, "parse") }
}, xt = "flowchart-elk", St = {
	id: xt,
	detector: /* @__PURE__ */ u((e, t = {}) => /^\s*flowchart-elk/.test(e) || /^\s*(flowchart|graph)/.test(e) && t?.flowchart?.defaultRenderer === "elk" ? (t.layout = "elk", !0) : !1, "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./flowDiagram-PKNHOUZH-BFdCj6uy.js");
		return {
			id: xt,
			diagram: e
		};
	}, "loader")
}, Ct = "timeline", wt = {
	id: Ct,
	detector: /* @__PURE__ */ u((e) => /^\s*timeline/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./timeline-definition-YZTLITO2-B0SegHNN.js");
		return {
			id: Ct,
			diagram: e
		};
	}, "loader")
}, Tt = "mindmap", Et = {
	id: Tt,
	detector: /* @__PURE__ */ u((e) => /^\s*mindmap/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./mindmap-definition-YRQLILUH-CNBsYwDI.js");
		return {
			id: Tt,
			diagram: e
		};
	}, "loader")
}, Dt = "kanban", Ot = {
	id: Dt,
	detector: /* @__PURE__ */ u((e) => /^\s*kanban/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./kanban-definition-K7BYSVSG-85hLaVO4.js");
		return {
			id: Dt,
			diagram: e
		};
	}, "loader")
}, kt = "sankey", At = {
	id: kt,
	detector: /* @__PURE__ */ u((e) => /^\s*sankey(-beta)?/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./sankeyDiagram-WA2Y5GQK-q1_lwNBY.js");
		return {
			id: kt,
			diagram: e
		};
	}, "loader")
}, jt = "packet", Mt = {
	id: jt,
	detector: /* @__PURE__ */ u((e) => /^\s*packet(-beta)?/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./diagram-P4PSJMXO-DjNveg1t.js");
		return {
			id: jt,
			diagram: e
		};
	}, "loader")
}, Nt = "radar", Pt = {
	id: Nt,
	detector: /* @__PURE__ */ u((e) => /^\s*radar-beta/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./diagram-IFDJBPK2--zOQrB5O.js");
		return {
			id: Nt,
			diagram: e
		};
	}, "loader")
}, Ft = "block", It = {
	id: Ft,
	detector: /* @__PURE__ */ u((e) => /^\s*block(-beta)?/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./blockDiagram-WCTKOSBZ-DdPMGZ7X.js");
		return {
			id: Ft,
			diagram: e
		};
	}, "loader")
}, Lt = "architecture", Rt = {
	id: Lt,
	detector: /* @__PURE__ */ u((e) => /^\s*architecture/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./architectureDiagram-2XIMDMQ5-B4qk6eh9.js");
		return {
			id: Lt,
			diagram: e
		};
	}, "loader")
}, zt = "ishikawa", Bt = {
	id: zt,
	detector: /* @__PURE__ */ u((e) => /^\s*ishikawa(-beta)?\b/i.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./ishikawaDiagram-PHBUUO56-BYrA8GRt.js");
		return {
			id: zt,
			diagram: e
		};
	}, "loader")
}, Vt = "venn", Ht = {
	id: Vt,
	detector: /* @__PURE__ */ u((e) => /^\s*venn-beta/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./vennDiagram-LZ73GAT5-ClN0stHq.js");
		return {
			id: Vt,
			diagram: e
		};
	}, "loader")
}, Ut = "treemap", Wt = {
	id: Ut,
	detector: /* @__PURE__ */ u((e) => /^\s*treemap/.test(e), "detector"),
	loader: /* @__PURE__ */ u(async () => {
		let { diagram: e } = await import("./diagram-E7M64L7V-DWS26Zbm.js");
		return {
			id: Ut,
			diagram: e
		};
	}, "loader")
}, Gt = !1, Y = /* @__PURE__ */ u(() => {
	Gt || (Gt = !0, g("error", bt, (e) => e.toLowerCase().trim() === "error"), g("---", {
		db: { clear: /* @__PURE__ */ u(() => {}, "clear") },
		styles: {},
		renderer: { draw: /* @__PURE__ */ u(() => {}, "draw") },
		parser: { parse: /* @__PURE__ */ u(() => {
			throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks");
		}, "parse") },
		init: /* @__PURE__ */ u(() => null, "init")
	}, (e) => e.toLowerCase().trimStart().startsWith("---")), _(St, Et, Rt), _(ze, Ot, dt, lt, Ge, Ye, Ze, $e, at, st, Ue, Ve, wt, qe, ht, pt, _t, tt, At, Mt, rt, It, Pt, Bt, Wt, Ht));
}, "addDiagrams"), Kt = /* @__PURE__ */ u(async () => {
	d.debug("Loading registered diagrams");
	let e = (await Promise.allSettled(Object.entries(T).map(async ([e, { detector: t, loader: n }]) => {
		if (n) try {
			E(e);
		} catch {
			try {
				let { diagram: e, id: r } = await n();
				g(r, e, t);
			} catch (t) {
				throw d.error(`Failed to load external diagram with key ${e}. Removing from detectors.`), delete T[e], t;
			}
		}
	}))).filter((e) => e.status === "rejected");
	if (e.length > 0) {
		d.error(`Failed to load ${e.length} external diagrams`);
		for (let t of e) d.error(t);
		throw Error(`Failed to load ${e.length} external diagrams`);
	}
}, "loadRegisteredDiagrams"), qt = "graphics-document document";
function Jt(e, t) {
	e.attr("role", qt), t !== "" && e.attr("aria-roledescription", t);
}
u(Jt, "setA11yDiagramInfo");
function Yt(e, t, n, r) {
	if (e.insert !== void 0) {
		if (n) {
			let t = `chart-desc-${r}`;
			e.attr("aria-describedby", t), e.insert("desc", ":first-child").attr("id", t).text(n);
		}
		if (t) {
			let n = `chart-title-${r}`;
			e.attr("aria-labelledby", n), e.insert("title", ":first-child").attr("id", n).text(t);
		}
	}
}
u(Yt, "addSVGa11yTitleDescription");
var X = class e {
	constructor(e, t, n, r, i) {
		this.type = e, this.text = t, this.db = n, this.parser = r, this.renderer = i;
	}
	static {
		u(this, "Diagram");
	}
	static async fromText(t, n = {}) {
		let i = D(), a = C(t, i);
		t = r(t) + "\n";
		try {
			E(a);
		} catch {
			let e = v(a);
			if (!e) throw new ie(`Diagram ${a} not found.`);
			let { id: t, diagram: n } = await e();
			g(t, n);
		}
		let { db: o, parser: s, renderer: c, init: l } = E(a);
		return s.parser && (s.parser.yy = o), o.clear?.(), l?.(i), n.title && o.setDiagramTitle?.(n.title), await s.parse(t), new e(a, t, o, s, c);
	}
	async render(e, t) {
		await this.renderer.draw(this.text, e, t, this);
	}
	getParser() {
		return this.parser;
	}
	getType() {
		return this.type;
	}
}, Xt = [], Zt = /* @__PURE__ */ u(() => {
	Xt.forEach((e) => {
		e();
	}), Xt = [];
}, "attachFunctions"), Qt = /* @__PURE__ */ u((e) => e.replace(/^\s*%%(?!{)[^\n]+\n?/gm, "").trimStart(), "cleanupComments");
function $t(e) {
	let t = e.match(ee);
	if (!t) return {
		text: e,
		metadata: {}
	};
	let n = de(t[1], { schema: fe }) ?? {};
	n = typeof n == "object" && !Array.isArray(n) ? n : {};
	let r = {};
	return n.displayMode && (r.displayMode = n.displayMode.toString()), n.title && (r.title = n.title.toString()), n.config && (r.config = n.config), {
		text: e.slice(t[0].length),
		metadata: r
	};
}
u($t, "extractFrontMatter");
var en = /* @__PURE__ */ u((e) => e.replace(/\r\n?/g, "\n").replace(/<(\w+)([^>]*)>/g, (e, t, n) => "<" + t + n.replace(/="([^"]*)"/g, "='$1'") + ">"), "cleanupText"), tn = /* @__PURE__ */ u((e) => {
	let { text: t, metadata: n } = $t(e), { displayMode: r, title: i, config: a = {} } = n;
	return r && (a.gantt ||= {}, a.gantt.displayMode = r), {
		title: i,
		config: a,
		text: t
	};
}, "processFrontmatter"), nn = /* @__PURE__ */ u((e) => {
	let t = a.detectInit(e) ?? {}, n = a.detectDirective(e, "wrap");
	return Array.isArray(n) ? t.wrap = n.some(({ type: e }) => e === "wrap") : n?.type === "wrap" && (t.wrap = !0), {
		text: s(e),
		directive: t
	};
}, "processDirectives");
function rn(e) {
	let t = tn(en(e)), n = nn(t.text), r = c(t.config, n.directive);
	return e = Qt(n.text), {
		code: e,
		title: t.title,
		config: r
	};
}
u(rn, "preprocessDiagram");
function an(e) {
	let t = new TextEncoder().encode(e), n = Array.from(t, (e) => String.fromCodePoint(e)).join("");
	return btoa(n);
}
u(an, "toBase64");
var on = 5e4, sn = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa", cn = "sandbox", ln = "loose", un = "http://www.w3.org/2000/svg", dn = "http://www.w3.org/1999/xlink", fn = "http://www.w3.org/1999/xhtml", pn = "100%", mn = "100%", hn = "border:0;margin:0;", gn = "margin:0", _n = "allow-top-navigation-by-user-activation allow-popups", vn = "The \"iframe\" tag is not supported by your browser.", yn = ["foreignobject"], bn = ["dominant-baseline"];
function xn(e) {
	let t = rn(e);
	return f(), ne(t.config ?? {}), t;
}
u(xn, "processAndSetConfigs");
async function Sn(e, t) {
	Y();
	try {
		let { code: t, config: n } = xn(e);
		return {
			diagramType: (await Nn(t)).type,
			config: n
		};
	} catch (e) {
		if (t?.suppressErrors) return !1;
		throw e;
	}
}
u(Sn, "parse");
var Cn = /* @__PURE__ */ u((e, t, n = []) => `
.${e} ${t} { ${n.join(" !important; ")} !important; }`, "cssImportantStyles"), wn = /* @__PURE__ */ u((e, t = /* @__PURE__ */ new Map()) => {
	let r = "";
	if (e.themeCSS !== void 0 && (r += `
${e.themeCSS}`), e.fontFamily !== void 0 && (r += `
:root { --mermaid-font-family: ${e.fontFamily}}`), e.altFontFamily !== void 0 && (r += `
:root { --mermaid-alt-font-family: ${e.altFontFamily}}`), t instanceof Map) {
		let i = ae(e) ? ["> *", "span"] : [
			"rect",
			"polygon",
			"ellipse",
			"circle",
			"path"
		];
		t.forEach((e) => {
			n(e.styles) || i.forEach((t) => {
				r += Cn(e.id, t, e.styles);
			}), n(e.textStyles) || (r += Cn(e.id, "tspan", (e?.textStyles || []).map((e) => e.replace("color", "fill"))));
		});
	}
	return r;
}, "createCssStyles"), Tn = /* @__PURE__ */ u((e, t, n, r) => J(Ne(`${r}{${h(t, wn(e, n), e.themeVariables)}}`), Le), "createUserStyles"), En = /* @__PURE__ */ u((e = "", t, n) => {
	let r = e;
	return !n && !t && (r = r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g, "marker-end=\"url(#")), r = o(r), r = r.replace(/<br>/g, "<br/>"), r;
}, "cleanUpSvgCode"), Dn = /* @__PURE__ */ u((e = "", t) => `<iframe style="width:${pn};height:${t?.viewBox?.baseVal?.height ? t.viewBox.baseVal.height + "px" : mn};${hn}" src="data:text/html;charset=UTF-8;base64,${an(`<body style="${gn}">${e}</body>`)}" sandbox="${_n}">
  ${vn}
</iframe>`, "putIntoIFrame"), On = /* @__PURE__ */ u((e, t, n, r, i) => {
	let a = e.append("div");
	a.attr("id", n), r && a.attr("style", r);
	let o = a.append("svg").attr("id", t).attr("width", "100%").attr("xmlns", un);
	return i && o.attr("xmlns:xlink", i), o.append("g"), e;
}, "appendDivSvgG");
function kn(e, t) {
	return e.append("iframe").attr("id", t).attr("style", "width: 100%; height: 100%;").attr("sandbox", "");
}
u(kn, "sandboxedIframe");
var An = /* @__PURE__ */ u((e, t, n, r) => {
	e.getElementById(t)?.remove(), e.getElementById(n)?.remove(), e.getElementById(r)?.remove();
}, "removeExistingElements"), jn = /* @__PURE__ */ u(async function(n, r, i) {
	Y();
	let a = xn(r);
	r = a.code;
	let o = D();
	d.debug(o), r.length > (o?.maxTextSize ?? on) && (r = sn);
	let s = "#" + n, c = "i" + n, l = "#" + c, f = "d" + n, p = "#" + f, m = /* @__PURE__ */ u(() => {
		let e = t(g ? l : p).node();
		e && "remove" in e && e.remove();
	}, "removeTempElements"), h = t("body"), g = o.securityLevel === cn, _ = o.securityLevel === ln, v = o.fontFamily;
	i === void 0 ? (An(document, n, f, c), g ? (h = t(kn(t("body"), c).nodes()[0].contentDocument.body), h.node().style.margin = 0) : h = t("body"), On(h, n, f)) : (i && (i.innerHTML = ""), g ? (h = t(kn(t(i), c).nodes()[0].contentDocument.body), h.node().style.margin = 0) : h = t(i), On(h, n, f, `font-family: ${v}`, dn));
	let y, b;
	try {
		y = await X.fromText(r, { title: a.title });
	} catch (e) {
		if (o.suppressErrorRendering) throw m(), e;
		y = await X.fromText("error"), b = e;
	}
	let x = h.select(p).node(), S = y.type, C = x.firstChild, ee = C.firstChild, w = y.renderer.getClasses?.(r, y), ne = Tn(o, S, w, s), T = document.createElement("style");
	T.innerHTML = ne, C.insertBefore(T, ee);
	try {
		await y.renderer.draw(r, n, "11.13.0", y);
	} catch (e) {
		throw o.suppressErrorRendering ? m() : yt.draw(r, n, "11.13.0"), e;
	}
	let re = h.select(`${p} svg`), ie = y.db.getAccTitle?.(), ae = y.db.getAccDescription?.();
	Pn(S, re, ie, ae), h.select(`[id="${n}"]`).selectAll("foreignobject > *").attr("xmlns", fn);
	let E = h.select(p).node().innerHTML;
	if (d.debug("config.arrowMarkerAbsolute", o.arrowMarkerAbsolute), E = En(E, g, te(o.arrowMarkerAbsolute)), g) {
		let e = h.select(p + " svg").node();
		E = Dn(E, e);
	} else _ || (E = e.sanitize(E, {
		ADD_TAGS: yn,
		ADD_ATTR: bn,
		HTML_INTEGRATION_POINTS: { foreignobject: !0 }
	}));
	if (Zt(), b) throw b;
	return m(), {
		diagramType: S,
		svg: E,
		bindFunctions: y.db.bindFunctions
	};
}, "render");
function Mn(e = {}) {
	let t = re({}, e);
	t?.fontFamily && !t.themeVariables?.fontFamily && (t.themeVariables ||= {}, t.themeVariables.fontFamily = t.fontFamily), oe(t), t?.theme && t.theme in x ? t.themeVariables = x[t.theme].getThemeVariables(t.themeVariables) : t && (t.themeVariables = x.default.getThemeVariables(t.themeVariables)), l((typeof t == "object" ? p(t) : y()).logLevel), Y();
}
u(Mn, "initialize");
var Nn = /* @__PURE__ */ u((e, t = {}) => {
	let { code: n } = rn(e);
	return X.fromText(n, t);
}, "getDiagramFromText");
function Pn(e, t, n, r) {
	Jt(t, e), Yt(t, n, r, t.attr("id"));
}
u(Pn, "addA11yInfo");
var Z = Object.freeze({
	render: jn,
	parse: Sn,
	getDiagramFromText: Nn,
	initialize: Mn,
	getConfig: D,
	setConfig: m,
	getSiteConfig: y,
	updateSiteConfig: b,
	reset: /* @__PURE__ */ u(() => {
		f();
	}, "reset"),
	globalReset: /* @__PURE__ */ u(() => {
		f(w);
	}, "globalReset"),
	defaultConfig: w
});
l(D().logLevel), f(D());
var Fn = /* @__PURE__ */ u((e, t, n) => {
	d.warn(e), i(e) ? (n && n(e.str, e.hash), t.push({
		...e,
		message: e.str,
		error: e
	})) : (n && n(e), e instanceof Error && t.push({
		str: e.message,
		message: e.message,
		hash: e.name,
		error: e
	}));
}, "handleError"), In = /* @__PURE__ */ u(async function(e = { querySelector: ".mermaid" }) {
	try {
		await Ln(e);
	} catch (t) {
		if (i(t) && d.error(t.str), $.parseError && $.parseError(t), !e.suppressErrors) throw d.error("Use the suppressErrors option to suppress these errors"), t;
	}
}, "run"), Ln = /* @__PURE__ */ u(async function({ postRenderCallback: e, querySelector: t, nodes: n } = { querySelector: ".mermaid" }) {
	let r = Z.getConfig();
	d.debug(`${e ? "" : "No "}Callback function found`);
	let i;
	if (n) i = n;
	else if (t) i = document.querySelectorAll(t);
	else throw Error("Nodes and querySelector are both undefined");
	d.debug(`Found ${i.length} diagrams`), r?.startOnLoad !== void 0 && (d.debug("Start On Load: " + r?.startOnLoad), Z.updateSiteConfig({ startOnLoad: r?.startOnLoad }));
	let o = new a.InitIDGenerator(r.deterministicIds, r.deterministicIDSeed), s, c = [];
	for (let t of Array.from(i)) {
		if (d.info("Rendering diagram: " + t.id), t.getAttribute("data-processed")) continue;
		t.setAttribute("data-processed", "true");
		let n = `mermaid-${o.next()}`;
		s = t.innerHTML, s = le(a.entityDecode(s)).trim().replace(/<br\s*\/?>/gi, "<br/>");
		let r = a.detectInit(s);
		r && d.debug("Detected early reinit: ", r);
		try {
			let { svg: r, bindFunctions: i } = await Kn(n, s, t);
			t.innerHTML = r, e && await e(n), i && i(t);
		} catch (e) {
			Fn(e, c, $.parseError);
		}
	}
	if (c.length > 0) throw c[0];
}, "runThrowsErrors"), Rn = /* @__PURE__ */ u(function(e) {
	Z.initialize(e);
}, "initialize"), zn = /* @__PURE__ */ u(async function(e, t, n) {
	d.warn("mermaid.init is deprecated. Please use run instead."), e && Rn(e);
	let r = {
		postRenderCallback: n,
		querySelector: ".mermaid"
	};
	typeof t == "string" ? r.querySelector = t : t && (t instanceof HTMLElement ? r.nodes = [t] : r.nodes = t), await In(r);
}, "init"), Bn = /* @__PURE__ */ u(async (e, { lazyLoad: t = !0 } = {}) => {
	Y(), _(...e), t === !1 && await Kt();
}, "registerExternalDiagrams"), Vn = /* @__PURE__ */ u(function() {
	if ($.startOnLoad) {
		let { startOnLoad: e } = Z.getConfig();
		e && $.run().catch((e) => d.error("Mermaid failed to initialize", e));
	}
}, "contentLoaded");
typeof document < "u" && window.addEventListener("load", Vn, !1);
var Hn = /* @__PURE__ */ u(function(e) {
	$.parseError = e;
}, "setParseErrorHandler"), Q = [], Un = !1, Wn = /* @__PURE__ */ u(async () => {
	if (!Un) {
		for (Un = !0; Q.length > 0;) {
			let e = Q.shift();
			if (e) try {
				await e();
			} catch (e) {
				d.error("Error executing queue", e);
			}
		}
		Un = !1;
	}
}, "executeQueue"), Gn = /* @__PURE__ */ u(async (e, t) => new Promise((n, r) => {
	let i = /* @__PURE__ */ u(() => new Promise((i, a) => {
		Z.parse(e, t).then((e) => {
			i(e), n(e);
		}, (e) => {
			d.error("Error parsing", e), $.parseError?.(e), a(e), r(e);
		});
	}), "performCall");
	Q.push(i), Wn().catch(r);
}), "parse"), Kn = /* @__PURE__ */ u((e, t, n) => new Promise((r, i) => {
	let a = /* @__PURE__ */ u(() => new Promise((a, o) => {
		Z.render(e, t, n).then((e) => {
			a(e), r(e);
		}, (e) => {
			d.error("Error parsing", e), $.parseError?.(e), o(e), i(e);
		});
	}), "performCall");
	Q.push(a), Wn().catch(i);
}), "render"), $ = {
	startOnLoad: !0,
	mermaidAPI: Z,
	parse: Gn,
	render: Kn,
	init: zn,
	run: In,
	registerExternalDiagrams: Bn,
	registerLayoutLoaders: ue,
	initialize: Rn,
	parseError: void 0,
	contentLoaded: Vn,
	setParseErrorHandler: Hn,
	detectType: C,
	registerIconPacks: ce,
	getRegisteredDiagramsMetadata: /* @__PURE__ */ u(() => Object.keys(T).map((e) => ({ id: e })), "getRegisteredDiagramsMetadata")
}, qn = $;
//#endregion
export { qn as default };

//# sourceMappingURL=mermaid.core-beWmNAWY.js.map