import { __name as e } from "./chunks/mermaid-parser.core/chunk-NNHCCRGN.js";
import "./chunks/mermaid-parser.core/chunk-4EGX6M5U.js";
import "./chunks/mermaid-parser.core/chunk-N66VUXT2.js";
import "./chunks/mermaid-parser.core/chunk-UIBZB4QT.js";
import "./chunks/mermaid-parser.core/chunk-5DO6E6H7.js";
import "./chunks/mermaid-parser.core/chunk-MPE355IW.js";
import "./chunks/mermaid-parser.core/chunk-MZUSXYTE.js";
import "./chunks/mermaid-parser.core/chunk-FHYWG6QK.js";
import "./chunks/mermaid-parser.core/chunk-WCWK7LTN.js";
import "./chunks/mermaid-parser.core/chunk-BR22UD5L.js";
import "./chunks/mermaid-parser.core/chunk-PUPMXCY4.js";
//#region ../../node_modules/@mermaid-js/parser/dist/mermaid-parser.core.mjs
var t = {}, n = {
	info: /* @__PURE__ */ e(async () => {
		let { createInfoServices: e } = await import("./chunks/mermaid-parser.core/info-J43DQDTF.js");
		t.info = e().Info.parser.LangiumParser;
	}, "info"),
	packet: /* @__PURE__ */ e(async () => {
		let { createPacketServices: e } = await import("./chunks/mermaid-parser.core/packet-YPE3B663.js");
		t.packet = e().Packet.parser.LangiumParser;
	}, "packet"),
	pie: /* @__PURE__ */ e(async () => {
		let { createPieServices: e } = await import("./chunks/mermaid-parser.core/pie-LRSECV5Y.js");
		t.pie = e().Pie.parser.LangiumParser;
	}, "pie"),
	treeView: /* @__PURE__ */ e(async () => {
		let { createTreeViewServices: e } = await import("./chunks/mermaid-parser.core/treeView-BLDUP644.js");
		t.treeView = e().TreeView.parser.LangiumParser;
	}, "treeView"),
	architecture: /* @__PURE__ */ e(async () => {
		let { createArchitectureServices: e } = await import("./chunks/mermaid-parser.core/architecture-7EHR7CIX.js");
		t.architecture = e().Architecture.parser.LangiumParser;
	}, "architecture"),
	gitGraph: /* @__PURE__ */ e(async () => {
		let { createGitGraphServices: e } = await import("./chunks/mermaid-parser.core/gitGraph-WXDBUCRP.js");
		t.gitGraph = e().GitGraph.parser.LangiumParser;
	}, "gitGraph"),
	eventmodeling: /* @__PURE__ */ e(async () => {
		let { createEventModelingServices: e } = await import("./chunks/mermaid-parser.core/eventmodeling-FCH6USID.js");
		t.eventmodeling = e().EventModel.parser.LangiumParser;
	}, "eventmodeling"),
	radar: /* @__PURE__ */ e(async () => {
		let { createRadarServices: e } = await import("./chunks/mermaid-parser.core/radar-GUYGQ44K.js");
		t.radar = e().Radar.parser.LangiumParser;
	}, "radar"),
	treemap: /* @__PURE__ */ e(async () => {
		let { createTreemapServices: e } = await import("./chunks/mermaid-parser.core/treemap-LRROVOQU.js");
		t.treemap = e().Treemap.parser.LangiumParser;
	}, "treemap"),
	wardley: /* @__PURE__ */ e(async () => {
		let { createWardleyServices: e } = await import("./chunks/mermaid-parser.core/wardley-L42UT6IY.js");
		t.wardley = e().Wardley.parser.LangiumParser;
	}, "wardley")
};
async function r(e, r) {
	let a = n[e];
	if (!a) throw Error(`Unknown diagram type: ${e}`);
	t[e] || await a();
	let o = t[e].parse(r);
	if (o.lexerErrors.length > 0 || o.parserErrors.length > 0) throw new i(o);
	return o.value;
}
e(r, "parse");
var i = class extends Error {
	constructor(e) {
		let t = e.lexerErrors.map((e) => `Lexer error on line ${e.line !== void 0 && !isNaN(e.line) ? e.line : "?"}, column ${e.column !== void 0 && !isNaN(e.column) ? e.column : "?"}: ${e.message}`).join("\n"), n = e.parserErrors.map((e) => `Parse error on line ${e.token.startLine !== void 0 && !isNaN(e.token.startLine) ? e.token.startLine : "?"}, column ${e.token.startColumn !== void 0 && !isNaN(e.token.startColumn) ? e.token.startColumn : "?"}: ${e.message}`).join("\n");
		super(`Parsing failed: ${t} ${n}`), this.result = e;
	}
	static {
		e(this, "MermaidParseError");
	}
};
//#endregion
export { r as parse };

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