import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs"; window.addEventListener("load", async () => { const theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" // dark : "default"; // light mermaid.initialize({ startOnLoad: false, theme: theme }); await mermaid.run({ querySelector: ".language-mermaid", }); });