import{a}from"./chunk-7AJGXJKH.js";var i={},c={info:a(async()=>{let{createInfoServices:e}=await import("./chunk-4C7B5E62.js"),r=e().Info.parser.LangiumParser;i.info=r},"info"),packet:a(async()=>{let{createPacketServices:e}=await import("./chunk-GVFT3SAT.js"),r=e().Packet.parser.LangiumParser;i.packet=r},"packet"),pie:a(async()=>{let{createPieServices:e}=await import("./chunk-JIKZJCN6.js"),r=e().Pie.parser.LangiumParser;i.pie=r},"pie"),treeView:a(async()=>{let{createTreeViewServices:e}=await import("./chunk-LVHV4VSA.js"),r=e().TreeView.parser.LangiumParser;i.treeView=r},"treeView"),architecture:a(async()=>{let{createArchitectureServices:e}=await import("./chunk-VTH7QRKM.js"),r=e().Architecture.parser.LangiumParser;i.architecture=r},"architecture"),gitGraph:a(async()=>{let{createGitGraphServices:e}=await import("./chunk-AJLTREVB.js"),r=e().GitGraph.parser.LangiumParser;i.gitGraph=r},"gitGraph"),eventmodeling:a(async()=>{let{createEventModelingServices:e}=await import("./chunk-H5AUG3HW.js"),r=e().EventModel.parser.LangiumParser;i.eventmodeling=r},"eventmodeling"),radar:a(async()=>{let{createRadarServices:e}=await import("./chunk-XB5BNRYL.js"),r=e().Radar.parser.LangiumParser;i.radar=r},"radar"),railroad:a(async()=>{let{createRailroadServices:e}=await import("./chunk-ZG7CS6VW.js"),r=e().Railroad.parser.LangiumParser;i.railroad=r},"railroad"),railroadEbnf:a(async()=>{let{createRailroadEbnfServices:e}=await import("./chunk-O5QV33YF.js"),r=e().RailroadEbnf.parser.LangiumParser;i.railroadEbnf=r},"railroadEbnf"),railroadAbnf:a(async()=>{let{createRailroadAbnfServices:e}=await import("./chunk-BMB736VC.js"),r=e().RailroadAbnf.parser.LangiumParser;i.railroadAbnf=r},"railroadAbnf"),railroadPeg:a(async()=>{let{createRailroadPegServices:e}=await import("./chunk-U2JD5QW6.js"),r=e().RailroadPeg.parser.LangiumParser;i.railroadPeg=r},"railroadPeg"),treemap:a(async()=>{let{createTreemapServices:e}=await import("./chunk-HWR2ZW7L.js"),r=e().Treemap.parser.LangiumParser;i.treemap=r},"treemap"),wardley:a(async()=>{let{createWardleyServices:e}=await import("./chunk-DUVQHOZY.js"),r=e().Wardley.parser.LangiumParser;i.wardley=r},"wardley"),cynefin:a(async()=>{let{createCynefinServices:e}=await import("./chunk-XPZECOOT.js"),r=e().Cynefin.parser.LangiumParser;i.cynefin=r},"cynefin")};async function d(e,r){let n=c[e];if(!n)throw new Error(`Unknown diagram type: ${e}`);i[e]||await n();let t=i[e].parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new l(t);return t.value}a(d,"parse");var l=class extends Error{constructor(e){let r=e.lexerErrors.map(o=>{let t=o.line!==void 0&&!isNaN(o.line)?o.line:"?",s=o.column!==void 0&&!isNaN(o.column)?o.column:"?";return`Lexer error on line ${t}, column ${s}: ${o.message}`}).join(`
`),n=e.parserErrors.map(o=>{let t=o.token.startLine!==void 0&&!isNaN(o.token.startLine)?o.token.startLine:"?",s=o.token.startColumn!==void 0&&!isNaN(o.token.startColumn)?o.token.startColumn:"?";return`Parse error on line ${t}, column ${s}: ${o.message}`}).join(`
`);super(`Parsing failed: ${r} ${n}`),this.result=e}static{a(this,"MermaidParseError")}};export{d as a,l as b};
