markstream-vue 0.0.4-beta.1 → 0.0.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -1
- package/README.zh-CN.md +34 -1
- package/dist/exports.js +1 -1
- package/dist/index.d.ts +90 -1
- package/dist/index.js +1 -1
- package/dist/tailwind.ts +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -104,6 +104,38 @@ enableMermaid()
|
|
|
104
104
|
enableKatex()
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
+
If you load KaTeX via CDN and want KaTeX rendering in a Web Worker (no bundler / optional peer not installed), inject a CDN-backed worker:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
import { createKaTeXWorkerFromCDN, setKaTeXWorker } from 'markstream-vue'
|
|
111
|
+
|
|
112
|
+
const { worker } = createKaTeXWorkerFromCDN({
|
|
113
|
+
mode: 'classic',
|
|
114
|
+
// UMD builds used by importScripts() inside the worker
|
|
115
|
+
katexUrl: 'https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.js',
|
|
116
|
+
mhchemUrl: 'https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/contrib/mhchem.min.js',
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
if (worker)
|
|
120
|
+
setKaTeXWorker(worker)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
If you load Mermaid via CDN and want off-main-thread parsing (used by progressive Mermaid rendering), inject a Mermaid parser worker:
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
import { createMermaidWorkerFromCDN, setMermaidWorker } from 'markstream-vue'
|
|
127
|
+
|
|
128
|
+
const { worker } = createMermaidWorkerFromCDN({
|
|
129
|
+
// Mermaid CDN builds are commonly ESM; module worker is recommended.
|
|
130
|
+
mode: 'module',
|
|
131
|
+
workerOptions: { type: 'module' },
|
|
132
|
+
mermaidUrl: 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs',
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
if (worker)
|
|
136
|
+
setMermaidWorker(worker)
|
|
137
|
+
```
|
|
138
|
+
|
|
107
139
|
### Nuxt quick drop-in
|
|
108
140
|
|
|
109
141
|
```ts
|
|
@@ -274,7 +306,8 @@ Parse hooks example (match server + client):
|
|
|
274
306
|
|
|
275
307
|
## ❓ FAQ (quick answers)
|
|
276
308
|
|
|
277
|
-
- Mermaid/KaTeX not rendering? Install the peer (`mermaid` / `katex`) and pass `:enable-mermaid="true"` / `:enable-katex="true"` or call the loader setters.
|
|
309
|
+
- Mermaid/KaTeX not rendering? Install the peer (`mermaid` / `katex`) and pass `:enable-mermaid="true"` / `:enable-katex="true"` or call the loader setters. If you load them via CDN script tags, the library will also pick up `window.mermaid` / `window.katex`.
|
|
310
|
+
- CDN + KaTeX worker: if you don't bundle `katex` but still want off-main-thread rendering, create and inject a worker that loads KaTeX via CDN (UMD) using `createKaTeXWorkerFromCDN()` + `setKaTeXWorker()`.
|
|
278
311
|
- Bundle size: peers are optional and not bundled; import only `markstream-vue/index.css` once. Use Shiki (`MarkdownCodeBlockNode`) when Monaco is too heavy.
|
|
279
312
|
- Custom UI: register components via `setCustomComponents` (global) or `custom-components` prop, then emit markers/placeholders in Markdown and map them to Vue components.
|
|
280
313
|
|
package/README.zh-CN.md
CHANGED
|
@@ -103,6 +103,38 @@ enableMermaid()
|
|
|
103
103
|
enableKatex()
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
+
如果你是用 CDN 引入 KaTeX,并且希望公式在 Web Worker 中渲染(不打包 / 不安装可选 peer),可以注入一个“CDN 加载 KaTeX”的 worker:
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
import { createKaTeXWorkerFromCDN, setKaTeXWorker } from 'markstream-vue'
|
|
110
|
+
|
|
111
|
+
const { worker } = createKaTeXWorkerFromCDN({
|
|
112
|
+
mode: 'classic',
|
|
113
|
+
// worker 内通过 importScripts() 加载的 UMD 构建
|
|
114
|
+
katexUrl: 'https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.js',
|
|
115
|
+
mhchemUrl: 'https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/contrib/mhchem.min.js',
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
if (worker)
|
|
119
|
+
setKaTeXWorker(worker)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
如果你是用 CDN 引入 Mermaid,并且希望 Mermaid 的解析在 worker 中进行(用于渐进式 Mermaid 渲染的后台解析),可以注入 Mermaid parser worker:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import { createMermaidWorkerFromCDN, setMermaidWorker } from 'markstream-vue'
|
|
126
|
+
|
|
127
|
+
const { worker } = createMermaidWorkerFromCDN({
|
|
128
|
+
// Mermaid CDN 构建通常是 ESM,推荐 module worker。
|
|
129
|
+
mode: 'module',
|
|
130
|
+
workerOptions: { type: 'module' },
|
|
131
|
+
mermaidUrl: 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs',
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
if (worker)
|
|
135
|
+
setMermaidWorker(worker)
|
|
136
|
+
```
|
|
137
|
+
|
|
106
138
|
### Nuxt 快速接入
|
|
107
139
|
|
|
108
140
|
```ts
|
|
@@ -273,7 +305,8 @@ setCustomComponents({
|
|
|
273
305
|
|
|
274
306
|
## ❓ 快问快答
|
|
275
307
|
|
|
276
|
-
- Mermaid / KaTeX 不显示?安装对应 peer(`mermaid` / `katex`),并传入 `:enable-mermaid="true"` / `:enable-katex="true"` 或调用 loader
|
|
308
|
+
- Mermaid / KaTeX 不显示?安装对应 peer(`mermaid` / `katex`),并传入 `:enable-mermaid="true"` / `:enable-katex="true"` 或调用 loader 设置函数。如果你是用 CDN `<script>` 引入,库也会自动读取 `window.mermaid` / `window.katex`。
|
|
309
|
+
- CDN + KaTeX worker:如果你不打包 `katex` 但仍希望公式在 worker 中渲染(不占主线程),可以用 `createKaTeXWorkerFromCDN()` 创建一个“CDN 加载 KaTeX”的 worker,然后通过 `setKaTeXWorker()` 注入。
|
|
277
310
|
- 体积问题:可选 peer 不会被打包,CSS 只需导入一次;对代码块可用 Shiki(`MarkdownCodeBlockNode`)替代 Monaco 以减轻体积。
|
|
278
311
|
- 自定义 UI:通过 `setCustomComponents`(全局)或 `custom-components` prop 注册组件,在 Markdown 中放置占位标记并映射到 Vue 组件。
|
|
279
312
|
|
package/dist/exports.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,n=Object.defineProperties,t=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(n,t,o)=>t in n?e(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,i=(e,n)=>{for(var t in n||(n={}))l.call(n,t)&&a(e,t,n[t]);if(o)for(var t of o(n))r.call(n,t)&&a(e,t,n[t]);return e},s=(e,o)=>n(e,t(o)),u=(e,n,t)=>new Promise((o,l)=>{var r=e=>{try{i(t.next(e))}catch(n){l(n)}},a=e=>{try{i(t.throw(e))}catch(n){l(n)}},i=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,a);i((t=t.apply(e,n)).next())});import{getMarkdown as c,parseMarkdownToStructure as d,setDefaultMathOptions as v}from"stream-markdown-parser";import{defineComponent as m,createElementBlock as h,openBlock as p,withMemo as g,createVNode as f,unref as w,createElementVNode as y,Fragment as k,renderList as x,toDisplayString as b,ref as M,onMounted as _,watch as C,onBeforeUnmount as B,normalizeClass as T,createApp as I,h as j,inject as $,provide as S,computed as L,createCommentVNode as H,Transition as E,withCtx as N,normalizeStyle as D,renderSlot as z,shallowRef as A,readonly as P,defineAsyncComponent as V,createBlock as R,resolveDynamicComponent as O,useAttrs as K,mergeProps as F,isMemoSame as W,markRaw as X,reactive as Z,nextTick as q,withDirectives as Y,vShow as U,onUnmounted as G,toHandlers as J,Teleport as Q,withModifiers as ee}from"vue";const ne=["cite"],te=(e,n)=>{const t=e.__vccOpts||e;for(const[o,l]of n)t[o]=l;return t},oe=/* @__PURE__ */te(/* @__PURE__ */m({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(p(),h("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[g([n.node.children],()=>f(w(ht),{"index-key":`blockquote-${n.indexKey}`,nodes:n.node.children||[],"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],8,ne))}}),[["__scopeId","data-v-eeadc8a3"]]);oe.install=e=>{e.component(oe.__name,oe)};const le={class:"checkbox-node"},re=["checked"],ae=/* @__PURE__ */te(/* @__PURE__ */m({__name:"CheckboxNode",props:{node:{}},setup:e=>(n,t)=>(p(),h("span",le,[y("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,re)]))}),[["__scopeId","data-v-8dc6c46f"]]);ae.install=e=>{e.component(ae.__name,ae)};const ie={class:"definition-list"},se={class:"definition-term"},ue={class:"definition-desc"},ce=/* @__PURE__ */te(/* @__PURE__ */m({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(e,t)=>(p(),h("dl",ie,[(p(!0),h(k,null,x(n.node.items,(o,l)=>(p(),h(k,{key:l},[y("dt",se,[f(w(ht),{"index-key":`definition-term-${n.indexKey}-${l}`,nodes:o.term,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[0]||(t[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])]),y("dd",ue,[f(w(ht),{"index-key":`definition-desc-${n.indexKey}-${l}`,nodes:o.definition,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[1]||(t[1]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),[["__scopeId","data-v-f88691d6"]]);ce.install=e=>{e.component(ce.__name,ce)};const de={class:"emoji-node"},ve=/* @__PURE__ */te(/* @__PURE__ */m({__name:"EmojiNode",props:{node:{}},setup:e=>(n,t)=>(p(),h("span",de,b(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);ve.install=e=>{e.component(ve.__name,ve)};const me="__global__",he={};function pe(e,n){"string"==typeof e?he[e]=n||{}:he[me]=e||{}}function ge(e){return e?he[e]||he[me]||{}:he[me]||{}}function fe(e){if(e===me)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete he[e]}function we(){delete he[me]}const ye=["id"],ke=["title"],xe=/* @__PURE__ */te(/* @__PURE__ */m({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const n=`#footnote-${e.node.id}`;function t(){if("undefined"==typeof document)return;const e=document.querySelector(n);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}return(o,l)=>(p(),h("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:t},[y("span",{href:n,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+b(e.node.id)+"]",9,ke)],8,ye))}}),[["__scopeId","data-v-01af0fee"]]);xe.install=e=>{e.component(xe.__name,xe)};const be=/* @__PURE__ */te(/* @__PURE__ */m({__name:"HtmlInlineNode",props:{node:{}},setup(e){const n=e,t=M(null),o="undefined"!=typeof window;function l(){if(!o||!t.value)return;const e=t.value;e.innerHTML="";const l=document.createElement("template");l.innerHTML=n.node.content,e.appendChild(l.content.cloneNode(!0))}function r(){if(!t.value)return;const e=t.value;e.innerHTML="",e.textContent=n.node.content}return _(()=>{n.node.loading&&!n.node.autoClosed?r():l()}),C(()=>[n.node.content,n.node.loading,n.node.autoClosed],()=>{n.node.loading&&!n.node.autoClosed?r():l()}),B(()=>{t.value&&(t.value.innerHTML="")}),(e,o)=>(p(),h("span",{ref_key:"containerRef",ref:t,class:T(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},null,2))}}),[["__scopeId","data-v-e632756e"]]);be.install=e=>{e.component(be.__name,be)};const Me={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-secondary whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},_e=/* @__PURE__ */m({__name:"InlineCodeNode",props:{node:{}},setup:e=>(n,t)=>(p(),h("code",Me,b(e.node.code),1))});_e.install=e=>{e.component(_e.__name,_e)};const Ce=M(!1),Be=M(""),Te=M("top"),Ie=M(null),je=M(null),$e=M(null),Se=M(null),Le=M(null);let He=null,Ee=null;function Ne(){He&&(clearTimeout(He),He=null),Ee&&(clearTimeout(Ee),Ee=null)}let De=!1,ze=null;function Ae(e,n,t="top",o=!1,l,r){if(!e)return;De||"undefined"!=typeof document&&(ze||(ze=import("./Tooltip.js").then(({default:e})=>{De=!0;const n=document.createElement("div");n.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(n),I({setup:()=>()=>{var n;return j(e,{visible:Ce.value,"anchor-el":Ie.value,content:Be.value,placement:Te.value,id:je.value,originX:$e.value,originY:Se.value,isDark:null!=(n=Le.value)?n:void 0})}}).mount(n)}).catch(e=>{ze=null,De=!1,console.warn("[markstream-vue] Failed to load Tooltip component. Tooltips will be disabled.",e)}))),Ne();const a=()=>{var o,a;je.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ie.value=e,Be.value=n,Te.value=t,$e.value=null!=(o=null==l?void 0:l.x)?o:null,Se.value=null!=(a=null==l?void 0:l.y)?a:null,Le.value="boolean"==typeof r?r:null,Ce.value=!0;try{e.setAttribute("aria-describedby",je.value)}catch(i){}};o?a():He=setTimeout(a,80)}function Pe(e=!1){Ne();const n=()=>{if(Ie.value&&je.value)try{Ie.value.removeAttribute("aria-describedby")}catch(e){}Ce.value=!1,Ie.value=null,je.value=null,$e.value=null,Se.value=null};e?n():Ee=setTimeout(n,120)}const Ve={"common.copy":"Copy","common.copySuccess":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."};function Re(e){Object.assign(Ve,e)}function Oe(){try{const n=globalThis.$vueI18nUse||null;if(n&&"function"==typeof n)try{const e=n();if(e&&"function"==typeof e.t)return{t:e.t.bind(e)}}catch(e){}}catch(e){}return u(null,null,function*(){try{const n=yield import("vue-i18n"),t=n.useI18n||n.default&&n.default.useI18n;if(t&&"function"==typeof t)try{const n=t();if(n&&"function"==typeof n.t)try{globalThis.$vueI18nUse=()=>n}catch(e){}}catch(e){}}catch(e){}}),{t:e=>{var n;return null!=(n=Ve[e])?n:function(e){return(e.split(".").pop()||e).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}(e)}}}const Ke=/* @__PURE__ */Symbol("ViewportPriority");function Fe(){const e=$(Ke,void 0);if(e)return e;const n=/* @__PURE__ */new WeakMap;let t=null;return e=>{const o=M(!1);let l,r=!1;const a=new Promise(e=>{l=()=>{r||(r=!0,e())}}),i=()=>{try{null==t||t.unobserve(e)}catch(o){}n.delete(e)},s=t||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(t=new IntersectionObserver(e=>{for(const l of e){const e=n.get(l.target);if(e&&(l.isIntersecting||l.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==t||t.unobserve(l.target),n.delete(l.target)}}},{root:null,rootMargin:"300px",threshold:0}),t));return s?(n.set(e,{resolve:l,visible:o}),s.observe(e),{isVisible:o,whenVisible:a,destroy:i}):(o.value=!0,l(),{isVisible:o,whenVisible:a,destroy:i})}}const We={class:"relative inline-block"},Xe=["src","alt","title","loading","tabindex","aria-label"],Ze={class:"text-sm whitespace-nowrap"},qe={key:1,class:"text-sm text-gray-500"},Ye={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},Ue={class:"text-sm whitespace-nowrap"},Ge={key:0,class:"mt-2 text-sm text-gray-500 italic"},Je=/* @__PURE__ */te(/* @__PURE__ */m({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},showCaption:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},svgMinHeight:{default:"12rem"},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:n}){const t=e,o=n,l=M(!1),r=M(!1),a=M(!1),i=M(null),s=Fe(),u=M(null),c=M("undefined"==typeof window);"undefined"!=typeof window&&C(()=>i.value,e=>{var n;if(null==(n=u.value)||n.destroy(),u.value=null,!e)return void(c.value=!1);const t=s(e,{rootMargin:"400px"});u.value=t,c.value=t.isVisible.value,t.whenVisible.then(()=>{c.value=!0})},{immediate:!0}),B(()=>{var e;null==(e=u.value)||e.destroy(),u.value=null});const d=L(()=>r.value&&t.fallbackSrc?t.fallbackSrc:t.node.src),v=L(()=>!t.lazy||c.value),m=L(()=>/\.svg(?:\?|$)/i.test(d.value));function g(){t.fallbackSrc&&!a.value?(a.value=!0,r.value=!0):(r.value=!0,o("error",t.node.src))}function k(){l.value=!0,r.value=!1,o("load",d.value)}function x(e){e.preventDefault(),l.value&&!r.value&&o("click",[e,d.value])}const{t:_}=Oe();return C(d,()=>{l.value=!1,r.value=!1}),(n,o)=>(p(),h("figure",{ref_key:"figureRef",ref:i,class:"text-center my-8"},[y("div",We,[f(E,{name:"img-switch",mode:"out-in"},{default:N(()=>{var a,i,s,u,c;return[e.node.loading||r.value||!v.value?r.value?e.node.loading||t.fallbackSrc?H("",!0):(p(),h("div",Ye,[z(n.$slots,"error",{node:t.node,displaySrc:d.value,imageLoaded:l.value,hasError:r.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:m.value},()=>[o[1]||(o[1]=y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[y("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),y("span",Ue,b(w(_)("image.loadError")),1)],!0)])):(p(),h("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:D(m.value?{minHeight:t.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[t.usePlaceholder?z(n.$slots,"placeholder",{key:0,node:t.node,displaySrc:d.value,imageLoaded:l.value,hasError:r.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:m.value},()=>[o[0]||(o[0]=y("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),y("span",Ze,b(w(_)("image.loading")),1)],!0):(p(),h("span",qe,b(e.node.raw),1))],4)):(p(),h("img",{key:"image",src:d.value,alt:String(null!=(i=null!=(a=t.node.alt)?a:t.node.title)?i:""),title:String(null!=(u=null!=(s=t.node.title)?s:t.node.alt)?u:""),class:T(["max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",{"opacity-0":!l.value,"opacity-100":l.value,"cursor-pointer":l.value}]),style:D(m.value?{minHeight:t.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:t.lazy?"lazy":"eager",decoding:"async",tabindex:l.value?0:-1,"aria-label":null!=(c=t.node.alt)?c:w(_)("image.preview"),onError:g,onLoad:k,onClick:x},null,46,Xe))]}),_:3})]),t.showCaption&&t.node.alt?(p(),h("figcaption",Ge,b(t.node.alt),1)):H("",!0)],512))}}),[["__scopeId","data-v-7ca79b66"]]);Je.install=e=>{e.component(Je.__name,Je)};let Qe=null,en=!1,nn=tn;function tn(){return u(null,null,function*(){const e=yield import("katex");return yield import("katex/contrib/mhchem"),e})}function on(e){nn=e,Qe=null,en=!1}function ln(e){on(null!=e?e:tn)}function rn(){on(null)}function an(){return"function"==typeof nn}function sn(){return u(this,null,function*(){if(Qe)return Qe;if(en)return null;const e=nn;if(!e)return en=!0,null;try{const n=yield e();if(n)return Qe=n,Qe}catch(n){}return en=!0,null})}const un=A(!1);let cn=null;function dn(){return cn||(cn=sn().then(e=>{un.value=!!e}).catch(()=>{un.value=!1})),P(un)}const vn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const n=dn();return(t,o)=>(p(),h("span",{class:T([[w(n)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},b(e.node.content),3))}}),[["__scopeId","data-v-56f30838"]]);vn.install=e=>{e.component(vn.__name,vn)};const mn=V(()=>u(null,null,function*(){var e,n;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(n=null==(e=globalThis.process)?void 0:e.env)?void 0:n.NODE_ENV))return e=>{var n,t;return j(vn,s(i({},e),{node:s(i({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))};try{if(yield sn())return(yield import("./index2.js")).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return e=>{var n,t;return j(vn,s(i({},e),{node:s(i({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))}})),hn=V(()=>u(null,null,function*(){try{if(yield sn())return(yield import("./index3.js")).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var n,t;return j(vn,s(i({},e),{node:s(i({},e.node),{content:null!=(t=e.node.raw)?t:`$$${null!=(n=e.node.content)?n:""}$$`})}))}})),pn=/* @__PURE__ */m({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(n,t)=>(p(),h("span",{class:"reference-node cursor-pointer bg-accent text-xs rounded-md px-1.5 mx-0.5 hover:bg-secondary",role:"button",tabindex:"0",onClick:t[0]||(t[0]=t=>n.$emit("click",t,e.node.id,e.messageId,e.threadId)),onMouseenter:t[1]||(t[1]=t=>n.$emit("mouseEnter",t,e.node.id,e.messageId,e.threadId)),onMouseleave:t[2]||(t[2]=t=>n.$emit("mouseLeave",t,e.node.id,e.messageId,e.threadId))},b(e.node.id),33))});pn.install=e=>{e.component(pn.__name,pn)};const gn={class:"superscript-node"},fn={key:1},wn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ge(n.customId),o=i({text:vn,inline_code:_e,link:Sn,html_inline:be,strong:Mn,emphasis:zn,footnote_reference:xe,strikethrough:Cn,highlight:Nn,insert:Hn,subscript:xn,emoji:ve,math_inline:mn,reference:pn},t);return(t,l)=>(p(),h("sup",gn,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),h(k,{key:`${e.indexKey||"superscript"}-${l}`},[o[t.type]?(p(),R(O(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"superscript"}-${l}`},null,8,["node","custom-id","index-key"])):(p(),h("span",fn,b(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-6dc1e3ba"]]);wn.install=e=>{e.component(wn.__name,wn)};const yn={class:"subscript-node"},kn={key:1},xn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ge(n.customId),o=i({text:vn,inline_code:_e,link:Sn,html_inline:be,strong:Mn,emphasis:zn,footnote_reference:xe,strikethrough:Cn,highlight:Nn,insert:Hn,superscript:wn,emoji:ve,math_inline:mn,reference:pn},t);return(t,l)=>(p(),h("sub",yn,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),h(k,{key:`${e.indexKey||"subscript"}-${l}`},[o[t.type]?(p(),R(O(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"subscript"}-${l}`},null,8,["node","custom-id","index-key"])):(p(),h("span",kn,b(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-69de9b81"]]);xn.install=e=>{e.component(xn.__name,xn)};const bn={class:"strong-node"},Mn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ge(n.customId),o=i({text:vn,inline_code:_e,link:Sn,html_inline:be,emphasis:zn,strikethrough:Cn,highlight:Nn,insert:Hn,subscript:xn,superscript:wn,emoji:ve,footnote_reference:xe,math_inline:mn,reference:pn},t);return(t,l)=>(p(),h("strong",bn,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),R(O(o[t.type]),{key:`${e.indexKey||"strong"}-${l}`,"index-key":`${e.indexKey||"strong"}-${l}`,node:t,"custom-id":n.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-af3ce037"]]);Mn.install=e=>{e.component(Mn.__name,Mn)};const _n={class:"strikethrough-node"},Cn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ge(n.customId),o=i({text:vn,inline_code:_e,link:Sn,html_inline:be,strong:Mn,emphasis:zn,highlight:Nn,insert:Hn,subscript:xn,superscript:wn,emoji:ve,footnote_reference:xe,math_inline:mn,reference:pn},t);return(t,l)=>(p(),h("del",_n,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),R(O(o[t.type]),{key:`${e.indexKey||"strikethrough"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-904d5bd1"]]);Cn.install=e=>{e.component(Cn.__name,Cn)};const Bn=["href","title","aria-label","aria-hidden"],Tn=["aria-hidden"],In={class:"link-text-wrapper relative inline-flex"},jn={class:"leading-[normal] link-text"},$n={class:"leading-[normal] link-text"},Sn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const n=e,t=L(()=>{var e,t,o,l,r,a;const i=void 0!==n.underlineBottom?"number"==typeof n.underlineBottom?`${n.underlineBottom}px`:String(n.underlineBottom):"-3px";return{"--link-color":null!=(e=n.color)?e:"#0366d6","--underline-height":`${null!=(t=n.underlineHeight)?t:2}px`,"--underline-bottom":i,"--underline-opacity":String(null!=(o=n.animationOpacity)?o:.9),"--underline-duration":`${null!=(l=n.animationDuration)?l:.8}s`,"--underline-timing":null!=(r=n.animationTiming)?r:"linear","--underline-iteration":"number"==typeof n.animationIteration?String(n.animationIteration):null!=(a=n.animationIteration)?a:"infinite"}}),o={text:vn,strong:Mn,strikethrough:Cn,emphasis:zn,image:Je,html_inline:be},l=K();function r(){n.showTooltip&&Pe()}const a=L(()=>{var e,t;return String(null!=(t=null!=(e=n.node.title)?e:n.node.href)?t:"")});return(i,s)=>e.node.loading?(p(),h("span",F({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},w(l),{style:t.value}),[y("span",In,[y("span",jn,[y("span",$n,b(e.node.text),1)]),s[1]||(s[1]=y("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,Tn)):(p(),h("a",F({key:0,class:"link-node",href:e.node.href,title:e.showTooltip?"":a.value,"aria-label":`Link: ${a.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},w(l),{style:t.value,onMouseenter:s[0]||(s[0]=e=>function(e){var t,o,l;if(!n.showTooltip)return;const r=e,a=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0,i=(null==(t=n.node)?void 0:t.title)||(null==(o=n.node)?void 0:o.href)||(null==(l=n.node)?void 0:l.text)||"";Ae(e.currentTarget,i,"top",!1,a)}(e)),onMouseleave:r}),[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),R(O(o[t.type]),{key:`${e.indexKey||"emphasis"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"link-text"}-${l}`},null,8,["node","custom-id","index-key"]))),128))],16,Bn))}}),[["__scopeId","data-v-0753b32c"]]);Sn.install=e=>{e.component(Sn.__name,Sn)};const Ln={class:"insert-node"},Hn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ge(n.customId),o=i({text:vn,inline_code:_e,link:Sn,html_inline:be,strong:Mn,emphasis:zn,strikethrough:Cn,highlight:Nn,subscript:xn,superscript:wn,emoji:ve,footnote_reference:xe,math_inline:mn,reference:pn},t);return(t,l)=>(p(),h("ins",Ln,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),R(O(o[t.type]),{key:`${e.indexKey||"insert"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-ab1ec9bc"]]);Hn.install=e=>{e.component(Hn.__name,Hn)};const En={class:"highlight-node"},Nn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ge(n.customId),o=i({text:vn,inline_code:_e,link:Sn,html_inline:be,strong:Mn,emphasis:zn,strikethrough:Cn,insert:Hn,subscript:xn,superscript:wn,emoji:ve,footnote_reference:xe,math_inline:mn,reference:pn},t);return(t,l)=>(p(),h("mark",En,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),R(O(o[t.type]),{key:`${e.indexKey||"highlight"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-38e31bf6"]]);Nn.install=e=>{e.component(Nn.__name,Nn)};const Dn={class:"emphasis-node"},zn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ge(n.customId),o=i({text:vn,inline_code:_e,link:Sn,html_inline:be,strong:Mn,strikethrough:Cn,highlight:Nn,insert:Hn,subscript:xn,superscript:wn,emoji:ve,footnote_reference:xe,math_inline:mn,reference:pn},t);return(t,l)=>(p(),h("em",Dn,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),R(O(o[t.type]),{key:`${e.indexKey||"emphasis"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8264674d"]]);zn.install=e=>{e.component(zn.__name,zn)};const An=["href","title"],Pn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const n=e;function t(e){var t;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(t=n.node.id)?t:"")}`,l=document.getElementById(o);l&&l.scrollIntoView({behavior:"smooth"})}return(n,o)=>(p(),h("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:t}," ↩︎ ",8,An))}}),[["__scopeId","data-v-4756ce0d"]]);Pn.install=e=>{e.component(Pn.__name,Pn)};const Vn=["id"],Rn={class:"flex-1"},On=/* @__PURE__ */m({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(p(),h("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[y("div",Rn,[g([n.node.children],()=>f(w(ht),{"index-key":`footnote-${n.indexKey}`,nodes:n.node.children,"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)])],8,Vn))}});On.install=e=>{e.component(On.__name,On)};const Kn={class:"hard-break"},Fn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,n)=>(p(),h("br",Kn))}),[["__scopeId","data-v-50c58f70"]]);Fn.install=e=>{e.component(Fn.__name,Fn)};const Wn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ge(n.customId),o=i({text:vn,inline_code:_e,link:Sn,image:Je,strong:Mn,emphasis:zn,strikethrough:Cn,highlight:Nn,insert:Hn,subscript:xn,superscript:wn,emoji:ve,checkbox:ae,checkbox_input:ae,footnote_reference:xe,hardbreak:Fn,math_inline:mn,reference:pn},t);return(t,l)=>g([e.node.children],()=>(p(),R(O(`h${e.node.level}`),{class:T(["heading-node",[`heading-${e.node.level}`]]),dir:"auto"},{default:N(()=>[(p(!0),h(k,null,x(e.node.children,(t,l,r,a)=>{const i=[t];if(a&&a.key===`${e.indexKey||"heading"}-${l}`&&W(a,i))return a;const s=(p(),R(O(o[t.type]),{key:`${e.indexKey||"heading"}-${l}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"heading"}-${l}`},null,8,["custom-id","node","index-key"]));return s.memo=i,s},l,0),128))]),_:1},8,["class"])),l,2)}}),[["__scopeId","data-v-e3e7e2ce"]]),Xn=Wn;Xn.install=e=>{e.component(Wn.__name,Wn)};const Zn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"ListItemNode",props:{item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const n=e,t=L(()=>null==n.value?{}:{value:n.value});return(e,o)=>(p(),h("li",F({class:"list-item pl-1.5 my-2",dir:"auto"},t.value),[g([n.item.children],()=>f(w(ht),{"index-key":`list-item-${n.indexKey}`,nodes:n.item.children,"custom-id":n.customId,typewriter:n.typewriter,"batch-rendering":!1,onCopy:o[0]||(o[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],16))}}),[["__scopeId","data-v-7a618746"]]);Zn.install=e=>{e.component(Zn.__name,Zn)};const qn=/* @__PURE__ */te(/* @__PURE__ */m({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup:e=>(n,t)=>(p(),R(O(e.node.ordered?"ol":"ul"),{class:T(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:N(()=>[(p(!0),h(k,null,x(e.node.items,(o,l,r,a)=>{var i;const s=[o];if(a&&a.key===`${e.indexKey||"list"}-${l}`&&W(a,s))return a;const u=(p(),R(w(Zn),{key:`${e.indexKey||"list"}-${l}`,item:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${l}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(i=e.node.start)?i:1)+l:void 0,onCopy:t[0]||(t[0]=e=>n.$emit("copy",e))},null,8,["item","custom-id","index-key","typewriter","value"]));return u.memo=s,u},t,1),128))]),_:1},8,["class"]))}),[["__scopeId","data-v-79057d57"]]);qn.install=e=>{e.component(qn.__name,qn)};const Yn={dir:"auto",class:"paragraph-node"},Un=/* @__PURE__ */te(/* @__PURE__ */m({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ge(n.customId),o=i({inline_code:_e,image:Je,link:Sn,hardbreak:Fn,emphasis:zn,strong:Mn,strikethrough:Cn,highlight:Nn,insert:Hn,subscript:xn,superscript:wn,html_inline:be,emoji:ve,checkbox:ae,math_inline:mn,checkbox_input:ae,reference:pn,footnote_anchor:Pn,footnote_reference:xe},t),l=dn();return(t,r)=>(p(),h("p",Yn,[(p(!0),h(k,null,x(e.node.children,(t,r)=>(p(),h(k,{key:`${e.indexKey||"paragraph"}-${r}`},["text"!==t.type?(p(),R(O(o[t.type]),{key:0,node:t,"index-key":`${e.indexKey}-${r}`,"custom-id":n.customId},null,8,["node","index-key","custom-id"])):(p(),h("span",{key:1,class:T([[w(l)&&t.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},b(t.content),3))],64))),128))]))}}),[["__scopeId","data-v-0117537a"]]);Un.install=e=>{e.component(Un.__name,Un)};const Gn=["aria-busy","aria-label","data-language"],Jn=["textContent"],Qn=/* @__PURE__ */m({__name:"PreCodeNode",props:{node:{}},setup(e){const n=e,t=L(()=>{var e,t,o;const l=String(null!=(t=null==(e=n.node)?void 0:e.language)?t:"");return String(null!=(o=String(l).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=L(()=>`language-${t.value}`),l=L(()=>{const e=t.value;return e?`Code block: ${e}`:"Code block"});return(n,r)=>(p(),h("pre",{class:T([o.value]),"aria-busy":!0===e.node.loading,"aria-label":l.value,"data-language":t.value,tabindex:"0"},[y("code",{translate:"no",textContent:b(e.node.code)},null,8,Jn)],10,Gn))}});Qn.install=e=>{e.component(Qn.__name,Qn)};const et={class:"table-node-wrapper"},nt=["aria-busy"],tt={class:"border-[var(--table-border,#cbd5e1)]"},ot={class:"border-b"},lt={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},rt=/* @__PURE__ */te(/* @__PURE__ */m({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e,t=L(()=>{var e,t,o,l;return null!=(l=null==(o=null==(t=null==(e=n.node)?void 0:e.header)?void 0:t.cells)?void 0:o.length)?l:0}),o=L(()=>{const e=t.value||1,n=Math.floor(100/e);return Array.from({length:e}).map((t,o)=>o===e-1?100-n*(e-1)+"%":`${n}%`)}),l=L(()=>{var e;return null!=(e=n.node.loading)&&e}),r=L(()=>{var e;return null!=(e=n.node.rows)?e:[]});return(t,a)=>(p(),h("div",et,[y("table",{class:T(["w-full my-8 text-sm table-fixed table-node",{"table-node--loading":l.value}]),"aria-busy":l.value},[y("colgroup",null,[(p(!0),h(k,null,x(o.value,(e,n)=>(p(),h("col",{key:`col-${n}`,style:D({width:e})},null,4))),128))]),y("thead",tt,[y("tr",ot,[(p(!0),h(k,null,x(e.node.header.cells,(e,o)=>(p(),h("th",{key:`header-${o}`,dir:"auto",class:T(["font-semibold p-[calc(4/7*1em)] overflow-x-auto",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]])},[f(w(ht),{nodes:e.children,"index-key":`table-th-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:a[0]||(a[0]=e=>t.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),y("tbody",null,[(p(!0),h(k,null,x(r.value,(e,o)=>(p(),h("tr",{key:`row-${o}`,class:T(["border-[var(--table-border,#cbd5e1)]",[o<r.value.length-1?"border-b":""]])},[(p(!0),h(k,null,x(e.cells,(e,l)=>(p(),h("td",{key:`cell-${o}-${l}`,class:T(["p-[calc(4/7*1em)] overflow-x-auto",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]]),dir:"auto"},[f(w(ht),{nodes:e.children,"index-key":`table-td-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:a[1]||(a[1]=e=>t.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,nt),f(E,{name:"table-node-fade"},{default:N(()=>[l.value?(p(),h("div",lt,[z(t.$slots,"loading",{isLoading:l.value},()=>[a[2]||(a[2]=y("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),a[3]||(a[3]=y("span",{class:"sr-only"},"Loading",-1))],!0)])):H("",!0)]),_:3})]))}}),[["__scopeId","data-v-a874491c"]]);rt.install=e=>{e.component(rt.__name,rt)};const at={class:"hr-node"},it=/* @__PURE__ */te({},[["render",function(e,n){return p(),h("hr",at)}],["__scopeId","data-v-639cbad9"]]);it.install=e=>{e.component(it.__name,it)};const st={class:"unknown-node"},ut=/* @__PURE__ */m({__name:"FallbackComponent",props:{node:{}},setup:e=>(n,t)=>(p(),h("div",st,b(e.node.raw),1))}),ct=/* @__PURE__ */te(/* @__PURE__ */m({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},setup(e){const n=e,t=L(()=>`vmr-container vmr-container-${n.node.name}`),o=ge(n.customId),l=i({text:vn,paragraph:Un,heading:Xn,inline_code:_e,link:Sn,image:Je,strong:Mn,emphasis:zn,strikethrough:Cn,insert:Hn,subscript:xn,superscript:wn,checkbox:ae,checkbox_input:ae,hardbreak:Fn,math_inline:mn,reference:pn,list:qn,math_block:hn,table:rt},o);return(o,r)=>(p(),h("div",F({class:t.value},e.node.attrs),[(p(!0),h(k,null,x(e.node.children,(t,o,r,a)=>{const i=[t];if(a&&a.key===`${e.indexKey||"vmr-container"}-${o}`&&W(a,i))return a;const s=(p(),R(O((u=t.type,l[u]||ut)),{key:`${e.indexKey||"vmr-container"}-${o}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"vmr-container"}-${o}`},null,8,["custom-id","node","index-key"]));var u;return s.memo=i,s},r,0),128))],16))}}),[["__scopeId","data-v-7804f891"]]);ct.install=e=>{e.component(ct.__name,ct)};const dt={key:1,class:"html-block-node__placeholder"},vt=/* @__PURE__ */te(/* @__PURE__ */m({__name:"HtmlBlockNode",props:{node:{}},setup(e){const n=e,t=L(()=>{const e=n.node.attrs;if(e){if(Array.isArray(e)){const n={};for(const t of e){if(!t||t.length<2)continue;const[e,o]=t;null!=e&&(n[String(e)]=null==o?"":String(o))}return n}return e}}),o=M(null),l=M("undefined"==typeof window),r=M(n.node.content),a=Fe(),i=M(null),s=!!n.node.loading;return"undefined"!=typeof window?(C(o,e=>{var t,o;if(null==(o=null==(t=i.value)?void 0:t.destroy)||o.call(t),i.value=null,!s)return l.value=!0,void(r.value=n.node.content);if(!e)return void(l.value=!1);const u=a(e,{rootMargin:"400px"});i.value=u,l.value=u.isVisible.value,u.whenVisible.then(()=>{l.value=!0})},{immediate:!0}),C(()=>n.node.content,e=>{s&&!l.value||(r.value=e)})):l.value=!0,B(()=>{var e,n;null==(n=null==(e=i.value)?void 0:e.destroy)||n.call(e),i.value=null}),(n,a)=>(p(),h("div",F({ref_key:"htmlRef",ref:o,class:"html-block-node"},t.value),[l.value?g([r.value],()=>(p(),h("div",{key:0,innerHTML:r.value},null,8,["innerHTML"])),a,0):(p(),h("div",dt,[z(n.$slots,"placeholder",{node:e.node},()=>[a[1]||(a[1]=y("span",{class:"html-block-node__placeholder-bar"},null,-1)),a[2]||(a[2]=y("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),a[3]||(a[3]=y("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-ed22b926"]]),mt=["data-node-index","data-node-type"],ht=/* @__PURE__ */te(/* @__PURE__ */m({__name:"NodeRenderer",props:{content:{},nodes:{},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!0},batchRendering:{type:Boolean,default:!0},initialRenderBatchSize:{default:40},renderBatchSize:{default:80},renderBatchDelay:{default:16},renderBatchBudgetMs:{default:6},renderBatchIdleTimeoutMs:{default:120},deferNodesUntilVisible:{type:Boolean,default:!0},maxLiveNodes:{default:320},liveNodeBuffer:{default:60}},emits:["copy","handleArtifactClick","click","mouseover","mouseout"],setup(e,{emit:n}){var t,o,l;const r=e,a=n,v=M(),m=M(!1),g=/auto|scroll|overlay/i,f="undefined"!=typeof window,w=L(()=>r.debugPerformance&&f&&"undefined"!=typeof console);function y(e,n){w.value&&console.info(`[markstream-vue][perf] ${e}`,n)}function b(e){if("undefined"==typeof window)return null;const n=null!=e?e:v.value;if(!n)return null;const t=n.ownerDocument||document,o=t.scrollingElement||t.documentElement;let l=n;for(;l&&l!==t.body&&l!==o;){const e=window.getComputedStyle(l),n=(e.overflowY||"").toLowerCase(),t=(e.overflow||"").toLowerCase();if(g.test(n)||g.test(t))return l;l=l.parentElement}return null}const _=r.customId?`renderer-${r.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,I=c(_),j=L(()=>{const e=r.customHtmlTags;return e&&0!==e.length?c(_,{customHtmlTags:e}):I}),$=L(()=>{const e=j.value;return r.customMarkdownIt?r.customMarkdownIt(e):e});function z(e){const n=String(null!=e?e:"").trim();if(!n)return"";const t=n.match(/^[<\s/]*([A-Z][\w-]*)/i);return t?t[1].toLowerCase():""}const A=L(()=>{var e,n,t;const o=null!=(e=r.parseOptions)?e:{},l=[...null!=(n=r.customHtmlTags)?n:[],...null!=(t=o.customHtmlTags)?t:[]].map(z).filter(Boolean);return l.length?s(i({},o),{customHtmlTags:Array.from(new Set(l))}):o}),P=L(()=>{var e;if(null==(e=r.nodes)?void 0:e.length)return X(r.nodes.slice());if(r.content){const e=w.value?performance.now():0,n=d(r.content,$.value,A.value);return w.value&&y("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:r.content.length}),X(n)}return[]}),K=L(()=>{var e;return Math.max(1,null!=(e=r.maxLiveNodes)?e:320)}),W=L(()=>{var e;return!((null!=(e=r.maxLiveNodes)?e:0)<=0)&&P.value.length>K.value}),Y=L(()=>!1!==r.viewportPriority&&!m.value),U=function(e,n){const t="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof n?M(n):n;let l=null,r=null;const a=/* @__PURE__ */new WeakMap,s=(n,s)=>{const u=M(!1);let c,d=!1;const v=new Promise(e=>{c=()=>{d||(d=!0,e())}}),m=()=>{try{null==l||l.unobserve(n)}catch(e){}a.delete(n)};if(!t||!o.value)return u.value=!0,c(),{isVisible:u,whenVisible:v,destroy:m};!r&&s&&(r=i({},s));const h=function(n){var o,i,s;if(l||!t)return l;if("undefined"==typeof IntersectionObserver)return null;const u=null!=(o=null==e?void 0:e(null!=n?n:null))?o:null,c=r||{};return l=new IntersectionObserver(e=>{for(const t of e){const e=a.get(t.target);if(e&&(t.isIntersecting||t.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(n){}}null==l||l.unobserve(t.target),a.delete(t.target)}}},{root:u,rootMargin:null!=(i=c.rootMargin)?i:"300px",threshold:null!=(s=c.threshold)?s:0}),l}(n);return h?(a.set(n,{resolve:c,visible:u}),h.observe(n),{isVisible:u,whenVisible:v,destroy:m}):(u.value=!0,c(),{isVisible:u,whenVisible:v,destroy:m})};return S(Ke,s),s}(e=>{var n;return b(null!=(n=null!=e?e:v.value)?n:null)},Y),G=f&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,J=f&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,Q="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(t=globalThis.process)?void 0:t.env)?void 0:o.NODE_ENV),ee=f&&"function"==typeof window.requestIdleCallback,ne=L(()=>{var e;const n=Math.trunc(null!=(e=r.renderBatchSize)?e:80);return Number.isFinite(n)?Math.max(0,n):0}),te=L(()=>{var e;const n=Math.trunc(null!=(e=r.initialRenderBatchSize)?e:ne.value);return Number.isFinite(n)?Math.max(0,n):ne.value}),le=L(()=>!1!==r.batchRendering&&ne.value>0&&f&&!Q),re=M(0),ie=M({key:r.indexKey,total:0}),se=M(Math.max(1,ne.value||1)),ue=Z({}),de=/* @__PURE__ */new Map,me=/* @__PURE__ */new Map,he=/* @__PURE__ */new Map,pe=M(null);let fe=null,we=null;const ye=L(()=>{var e;return!1!==r.deferNodesUntilVisible&&!((null!=(e=r.maxLiveNodes)?e:0)<=0)&&!W.value&&!(P.value.length>900)&&Y.value}),ke=L(()=>{var e;return le.value&&(null!=(e=r.maxLiveNodes)?e:0)<=0}),Me=M({batchSize:ne.value,initial:te.value,delay:null!=(l=r.renderBatchDelay)?l:16,enabled:ke.value}),Ce=L(()=>!!U&&(ye.value||W.value)),Be=L(()=>{var e;return Math.max(0,null!=(e=r.liveNodeBuffer)?e:60)}),Te=M(0),Ie=Z({start:0,end:0}),je=/* @__PURE__ */new Map,$e=L(()=>{if(!W.value)return P.value.length;const e=Be.value,n=Math.max(Ie.end+e,te.value),t=Math.min(P.value.length,n);return Math.max(re.value,t)});function Se(e){var n,t,o,l;const r=b(null!=(n=null!=e?e:v.value)?n:null);if(r)return r;const a=null!=(l=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(t=v.value)?void 0:t.ownerDocument)?l:"undefined"!=typeof document?document:null;return(null==a?void 0:a.scrollingElement)||(null==a?void 0:a.documentElement)||null}function Le(e){if(!f)return!1;try{const n=window.getComputedStyle(e);return!!(n.display||"").toLowerCase().includes("flex")&&(n.flexDirection||"").toLowerCase().endsWith("reverse")}catch(n){return!1}}function He(){fe&&(fe(),fe=null),pe.value=null}function Ee(){if(!f||!W.value)return;const e=Se();if(!e||pe.value===e)return;He();const n=()=>De();e.addEventListener("scroll",n,{passive:!0}),pe.value=e,fe=()=>{e.removeEventListener("scroll",n)}}function Ne(){var e,n,t;if(!we)return;const o=null!=(t=null==(n=null==(e=v.value)?void 0:e.ownerDocument)?void 0:n.defaultView)?t:"undefined"!=typeof window?window:null;we.viaTimeout?o?o.clearTimeout(we.id):clearTimeout(we.id):null==J||J(we.id),we=null}function De(e={}){var n,t,o;if(!W.value)return;if(!f)return void ze(!0);if(e.immediate)return Ne(),void ze(!0);if(we)return;const l=()=>{we=null,ze()};if(G)we={id:G(l),viaTimeout:!1};else{const e=null!=(o=null==(t=null==(n=v.value)?void 0:n.ownerDocument)?void 0:t.defaultView)?o:"undefined"!=typeof window?window:null,r=e?e.setTimeout(l,16):setTimeout(l,16);we={id:r,viaTimeout:!0}}}function ze(e=!1){var n,t,o,l,r,a,i;if(!W.value)return;const s=pe.value||Se();if(!s)return;const u=s.ownerDocument||(null==(n=v.value)?void 0:n.ownerDocument)||document,c=(null==u?void 0:u.defaultView)||("undefined"!=typeof window?window:null),d=s===(null==u?void 0:u.documentElement)||s===(null==u?void 0:u.body),m=P.value.length;if(!d&&m>0&&Le(s)){const n=s.clientHeight||0,t=s.scrollTop,o=t<0?-t:t,l=function(e){var n;const t=P.value;if(!t.length)return 0;if(e<=0)return Math.max(0,t.length-1);let o=e;for(let l=t.length-1;l>=0;l--){const e=null!=(n=Pe[l])?n:Re.value;if(o<=e)return l;o-=e}return 0}(Math.max(0,o)+.5*Math.max(0,n)),r=Ae(l,0,Math.max(0,m-1));return void((e||Math.abs(r-Te.value)>1)&&(Te.value=r))}const h=d?null:s.getBoundingClientRect(),p=d?0:h.top,g=d?null!=(o=null!=(t=null==c?void 0:c.innerHeight)?t:s.clientHeight)?o:0:h.bottom,f=Array.from(he.entries()).sort((e,n)=>e[0]-n[0]);let w=null,y=null;for(const[v,x]of f){if(!x)continue;const e=x.getBoundingClientRect();e.bottom<=p||e.top>=g||(null==w&&(w=v),y=v)}if(null==w||null==y){const e=v.value;if(!e)return;const n=d?{top:0}:s.getBoundingClientRect(),t=function(e,n,t){var o,l,r,a,i,s;if(t)return null!=(a=null!=(r=null==(o=null==n?void 0:n.documentElement)?void 0:o.scrollTop)?r:null==(l=null==n?void 0:n.body)?void 0:l.scrollTop)?a:0;const u=e.scrollTop;if(!Le(e))return u;const c=u<0?-u:u;return Math.max(0,(null!=(i=e.scrollHeight)?i:0)-(null!=(s=e.clientHeight)?s:0))-c}(s,u,d),o=d?(()=>{const t=e.getBoundingClientRect(),o=(d?0:n.top)-t.top;return Math.max(0,o)})():(()=>{const n=function(e,n){let t=e,o=0,l=0;for(;t&&t!==n&&l++<64;)o+=t.offsetTop||0,t=t.offsetParent;return o}(e,s);return Math.max(0,t-n)})(),m=d?null!=(i=null!=(a=null!=(r=null==c?void 0:c.innerHeight)?r:null==(l=null==u?void 0:u.documentElement)?void 0:l.clientHeight)?a:s.clientHeight)?i:0:s.clientHeight,h=function(e){var n;if(e<=0)return 0;let t=e;const o=P.value;for(let l=0;l<o.length;l++){const e=null!=(n=Pe[l])?n:Re.value;if(t<=e)return l;t-=e}return Math.max(0,o.length-1)}(o+.5*Math.max(0,m));return void(Te.value=Ae(h,0,Math.max(0,P.value.length-1)))}const k=Math.round((w+y)/2);!e&&Math.abs(k-Te.value)<=1||(Te.value=Ae(k,0,Math.max(0,P.value.length-1)))}function Ae(e,n,t){return Math.min(Math.max(e,n),t)}const Pe=Z({}),Ve=Z({total:0,count:0}),Re=L(()=>Ve.count>0?Math.max(12,Ve.total/Ve.count):32);function Oe(e,n){var t;if(e>=n)return 0;let o=0;for(let l=e;l<n;l++)o+=null!=(t=Pe[l])?t:Re.value;return o}const Fe=L(()=>{if(!W.value)return P.value.map((e,n)=>({node:e,index:n}));const e=P.value.length,n=Ae(Ie.start,0,e),t=Ae(Ie.end,n,e);return P.value.slice(n,t).map((e,t)=>({node:e,index:n+t}))}),We=L(()=>W.value?Oe(0,Math.min(Ie.start,P.value.length)):0),Xe=L(()=>{if(!W.value)return 0;const e=P.value.length;return Oe(Math.min(Ie.end,e),e)});function Ze(e){if(de.size&&W.value)for(const[n,t]of de)n>=e&&(t.destroy(),de.delete(n),ye.value&&delete ue[n],ln(n),he.delete(n))}function qe(e,n){ye.value&&(ue[e]=n),n&&(W.value?De():Te.value=Ae(e,0,Math.max(0,P.value.length-1)))}function Ye(e){const n=de.get(e);n&&(n.destroy(),de.delete(e)),ln(e)}function Ue(e,n){if(n?he.set(e,n):he.delete(e),n||ln(e),!Ce.value||!U)return Ye(e),void(n?qe(e,!0):ye.value&&delete ue[e]);if(!W.value&&ye.value&&!m.value&&de.size>=640&&(function(){if(!m.value){m.value=!0;for(const e of de.values())e.destroy();if(de.clear(),f)for(const e of me.values())window.clearTimeout(e);me.clear();for(const e of Object.keys(ue))delete ue[e]}}(),!Ce.value||!U))return Ye(e),void(n?qe(e,!0):ye.value&&delete ue[e]);if(e<te.value&&!W.value)return Ye(e),void qe(e,!0);if(!n)return Ye(e),void(ye.value&&delete ue[e]);Ye(e);const t=U(n,{rootMargin:"400px"});t&&(de.set(e,t),qe(e,t.isVisible.value),ye.value&&function(e){if(!f||!ye.value)return;ln(e);const n=e%17*23,t=window.setTimeout(()=>{var n,t;if(me.delete(e),!ye.value)return;if(!0===ue[e])return;const o=he.get(e);if(!o)return void delete ue[e];const l=Se(o),r=o.ownerDocument||document,a=r.defaultView||window,i=!l||l===r.documentElement||l===r.body,s=!i&&l?l.getBoundingClientRect():null,u=i?0:s.top,c=i?null!=(t=null!=(n=a.innerHeight)?n:null==l?void 0:l.clientHeight)?t:0:s.bottom,d=o.getBoundingClientRect();d.bottom>=u-500&&d.top<=c+500&&qe(e,!0)},1800+n);me.set(e,t)}(e),t.whenVisible.then(()=>{ln(e),qe(e,!0)}).catch(()=>{}).finally(()=>{de.get(e)===t&&de.delete(e);try{t.destroy()}catch(n){}}),W.value&&De())}let Ge=null,Qe=null,en=!1,nn=null,tn=null;function on(){f&&(null!=Ge&&(null==J||J(Ge),Ge=null),null!=Qe&&(window.clearTimeout(Qe),Qe=null),null!=tn&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(tn),tn=null),en=!1,nn=null)}function ln(e){if(!f)return;const n=me.get(e);null!=n&&(window.clearTimeout(n),me.delete(e))}function rn(e,n={}){var t,o;if(!ke.value)return;const l=$e.value;if(re.value>=l)return;const a=Math.max(1,e),i=e=>{var n;Ge=null,Qe=null,tn=null,en=!1;const t=null!=nn?nn:a;nn=null;const o=Math.max(2,null!=(n=r.renderBatchBudgetMs)?n:6),i=e=>{const n="undefined"!=typeof performance?performance.now():Date.now();re.value=Math.min(l,re.value+Math.max(1,e)),Ze(re.value);const t=("undefined"!=typeof performance?performance.now():Date.now())-n;return function(e){var n;if(!ke.value)return;const t=Math.max(2,null!=(n=r.renderBatchBudgetMs)?n:6),o=Math.max(1,ne.value||1),l=Math.max(1,Math.floor(o/4));e>1.2*t?se.value=Math.max(l,Math.floor(.7*se.value)):e<.5*t&&se.value<o&&(se.value=Math.min(o,Math.ceil(1.2*se.value)))}(t),t};let s=t;for(;(i(s),!(re.value>=l)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(se.value));re.value<l&&an()};if(!f||n.immediate)return void i();const s=Math.max(0,null!=(t=r.renderBatchDelay)?t:16);if(nn=null!=nn?Math.max(nn,a):a,!en){if(en=!0,!Q&&ee&&window.requestIdleCallback){const e=Math.max(0,null!=(o=r.renderBatchIdleTimeoutMs)?o:120);return void(tn=window.requestIdleCallback(e=>{i(e)},{timeout:e}))}G&&!Q?Ge=G(()=>{0!==s?Qe=window.setTimeout(()=>i(),s):i()}):Qe=window.setTimeout(()=>i(),s)}}function an(){ke.value&&rn(le.value?Math.max(1,Math.round(se.value)):Math.max(1,ne.value))}C([()=>P.value,()=>P.value.length,()=>ke.value,()=>ne.value,()=>te.value,()=>r.renderBatchDelay,()=>r.indexKey],()=>{var e;const n=P.value.length,t=ie.value,o=r.indexKey,l=void 0!==o&&o!==t.key,a=n!==t.total,i=l||a;ie.value={key:o,total:n};const s=Me.value,u=null!=(e=r.renderBatchDelay)?e:16,c=s.batchSize!==ne.value||s.initial!==te.value||s.delay!==u||s.enabled!==ke.value;Me.value={batchSize:ne.value,initial:te.value,delay:u,enabled:ke.value},(i||c||!ke.value)&&on(),(i||c)&&(se.value=Math.max(1,ne.value||1)),i&&W.value&&De({immediate:!0});const d=$e.value;if(!n)return re.value=0,void Ze(0);if(!ke.value)return re.value=d,void Ze(re.value);const v=l||0===t.total;re.value=v||c?Math.min(d,te.value):Math.min(re.value,d);const m=Math.max(1,te.value||ne.value||n);re.value<d?rn(m,{immediate:!f}):Ze(re.value)},{immediate:!0}),C(()=>W.value,e=>{if(!e)return He(),void Ne();Ee(),De({immediate:!0})},{immediate:!0}),C([()=>P.value.length,()=>W.value],e=>u(null,[e],function*([e,n]){n&&e&&f&&(yield q(),De({immediate:!0}))}),{flush:"post"}),C(()=>v.value,()=>{W.value&&(Ee(),De({immediate:!0}))}),C(()=>P.value.length,()=>{W.value&&De({immediate:!0})}),C(()=>ye.value,e=>{if(e)for(const[n,t]of he)Ue(n,t);else{for(const e of de.values())e.destroy();de.clear();for(const e of Array.from(me.keys()))ln(e);for(const e of Object.keys(ue))delete ue[e];for(const[e,n]of he)n&&qe(e,!0)}},{immediate:!1}),C([()=>r.viewportPriority,()=>P.value.length],([e,n])=>{!1!==e?m.value&&n<=200&&(m.value=!1):m.value=!1}),C(()=>re.value,()=>{W.value&&De({immediate:!0})}),C([Te,K,Be,()=>P.value.length,W],()=>{!function(){const e=P.value.length;if(!W.value||0===e)return Ie.start=0,void(Ie.end=e);const n=Math.min(K.value,e),t=Be.value,o=Ae(Te.value-t,0,Math.max(0,e-n));Ie.start=o,Ie.end=Math.min(e,o+n)}()},{immediate:!0}),C([()=>P.value.length,W,K,Be,()=>Ie.start,()=>Ie.end],([e,n,t,o,l,r])=>{w.value&&y("virtualization",{nodes:e,virtualization:n,maxLiveNodes:t,buffer:o,focusIndex:Te.value,scroll:n?(()=>{const e=pe.value||Se();return e?{reverse:Le(e),scrollTop:Math.round(e.scrollTop),scrollTopAbs:Math.round(Math.abs(e.scrollTop)),scrollHeight:Math.round(e.scrollHeight),clientHeight:Math.round(e.clientHeight)}:null})():null,liveRange:{start:l,end:r},rendered:re.value})}),C(()=>$e.value,(e,n)=>{ke.value&&("number"==typeof n&&e<=n||e>re.value&&an())}),B(()=>{on();for(const e of de.values())e.destroy();de.clear();for(const e of Array.from(me.keys()))ln(e);He(),Ne()});const sn=V(()=>u(null,null,function*(){try{return(yield import("./index4.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to inline-code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),Qn}})),un=V(()=>u(null,null,function*(){try{return(yield Promise.resolve().then(()=>_o)).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',e),Qn}})),cn=L(()=>r.renderCodeBlocksAsPre?Qn:sn),dn={text:vn,paragraph:Un,heading:Xn,code_block:sn,list:qn,blockquote:oe,table:rt,definition_list:ce,footnote:On,footnote_reference:xe,footnote_anchor:Pn,admonition:xt,vmr_container:ct,hardbreak:Fn,link:Sn,image:Je,thematic_break:it,math_inline:mn,math_block:hn,strong:Mn,emphasis:zn,strikethrough:Cn,highlight:Nn,insert:Hn,subscript:xn,superscript:wn,emoji:ve,checkbox:ae,checkbox_input:ae,inline_code:_e,html_inline:be,reference:pn,html_block:vt};function gn(e){var n;if(!e)return ut;const t=ge(r.customId),o=t[String(e.type)];if("code_block"===e.type){if("mermaid"===String(null!=(n=e.language)?n:"").trim().toLowerCase())return t.mermaid||un;if(o)return o;return t.code_block||cn.value}return o||dn[String(e.type)]||ut}function fn(e){var n;return"code_block"===(null==e?void 0:e.type)&&"mermaid"===String(null!=(n=e.language)?n:"").trim().toLowerCase()?{}:"code_block"===e.type?i({stream:r.codeBlockStream,darkTheme:r.codeBlockDarkTheme,lightTheme:r.codeBlockLightTheme,monacoOptions:r.codeBlockMonacoOptions,themes:r.themes,minWidth:r.codeBlockMinWidth,maxWidth:r.codeBlockMaxWidth},r.codeBlockProps||{}):{typewriter:r.typewriter}}function yn(e){a("click",e)}function kn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&a("mouseover",e)}function bn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&a("mouseout",e)}return(n,t)=>(p(),h("div",{ref_key:"containerRef",ref:v,class:T(["markstream-vue markdown-renderer",[{dark:r.isDark},{virtualized:W.value}]]),onClick:yn,onMouseover:kn,onMouseout:bn},[W.value?(p(),h("div",{key:0,class:"node-spacer",style:D({height:`${We.value}px`}),"aria-hidden":"true"},null,4)):H("",!0),(p(!0),h(k,null,x(Fe.value,n=>{var o,l;return p(),h("div",{key:n.index,ref_for:!0,ref:e=>Ue(n.index,e),class:"node-slot","data-node-index":n.index,"data-node-type":n.node.type},[(l=n.index,ke.value&&l>=re.value||ye.value&&!(l<te.value)&&!0!==ue[l]?(p(),h("div",{key:1,class:"node-placeholder",style:D({height:`${null!=(o=Pe[n.index])?o:Re.value}px`})},null,4)):(p(),h("div",{key:0,ref_for:!0,ref:e=>function(e,n){n?(je.set(e,n),queueMicrotask(()=>{!function(e,n){if(!Number.isFinite(n)||n<=0)return;const t=Pe[e];Pe[e]=n,t?Ve.total+=n-t:(Ve.total+=n,Ve.count++)}(e,n.offsetHeight)})):je.delete(e)}(n.index,e),class:"node-content"},["code_block"!==n.node.type&&!1!==r.typewriter?(p(),R(E,{key:0,name:"typewriter",appear:""},{default:N(()=>[(p(),R(O(gn(n.node)),F({node:n.node,loading:n.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${n.index}`},{ref_for:!0},fn(n.node),{"custom-id":r.customId,"is-dark":r.isDark,onCopy:t[0]||(t[0]=e=>a("copy",e)),onHandleArtifactClick:t[1]||(t[1]=e=>a("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024)):(p(),R(O(gn(n.node)),F({key:1,node:n.node,loading:n.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${n.index}`},{ref_for:!0},fn(n.node),{"custom-id":r.customId,"is-dark":r.isDark,onCopy:t[2]||(t[2]=e=>a("copy",e)),onHandleArtifactClick:t[3]||(t[3]=e=>a("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],512)))],8,mt)}),128)),W.value?(p(),h("div",{key:1,class:"node-spacer",style:D({height:`${Xe.value}px`}),"aria-hidden":"true"},null,4)):H("",!0)],34))}}),[["__scopeId","data-v-14605a64"]]);ht.install=e=>{var n,t;const o=null!=(t=null!=(n=ht.__name)?n:ht.name)?t:"NodeRenderer";e.component(o,ht)};const pt={key:0,class:"admonition-icon"},gt={class:"admonition-title"},ft=["aria-expanded","aria-controls","title"],wt={key:0},yt={key:1},kt=["id"],xt=/* @__PURE__ */te(/* @__PURE__ */m({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:n}){var t;const o=e,l=n,r={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},a=L(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const e=o.node.kind||"note";return e.charAt(0).toUpperCase()+e.slice(1)}),i=M(!!o.node.collapsible&&!(null==(t=o.node.open)||t));function s(){o.node.collapsible&&(i.value=!i.value)}const u=`admonition-${Math.random().toString(36).slice(2,9)}`;return(n,t)=>(p(),h("div",{class:T(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[y("div",{id:u,class:"admonition-header"},[r[o.node.kind]?(p(),h("span",pt,b(r[o.node.kind]),1)):H("",!0),y("span",gt,b(a.value),1),o.node.collapsible?(p(),h("button",{key:1,class:"admonition-toggle","aria-expanded":!i.value,"aria-controls":`${u}-content`,title:i.value?"Expand":"Collapse",onClick:s},[i.value?(p(),h("span",wt,"▶")):(p(),h("span",yt,"▼"))],8,ft)):H("",!0)]),Y(y("div",{id:`${u}-content`,class:"admonition-content","aria-labelledby":u},[g([o.node.children],()=>f(w(ht),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:t[0]||(t[0]=e=>l("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),t,1)],8,kt),[[U,!i.value]])],2))}}),[["__scopeId","data-v-5e95c2b7"]]);xt.install=e=>{e.component(xt.__name,xt)};let bt=!1,Mt=null,_t=!1;function Ct(){return u(this,null,function*(){if(Mt)return Mt;if(_t)return null;try{return Mt=yield import("stream-monaco"),yield function(e){return u(this,null,function*(){if(!bt)return bt=!0,e.preloadMonacoWorkers()})}(Mt),Mt}catch(e){return _t=!0,null}})}let Bt=null;function Tt(e){Bt=null!=e?e:null}const It={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function jt(e){var n;const t=function(e){if(!e)return"";const n=e.trim();if(!n)return"";const[t]=n.split(/\s+/),[o]=t.split(":");return o.toLowerCase()}(e);return null!=(n=It[t])?n:t}function $t(e){const n=jt(e);if(!n)return"plaintext";switch(n){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return n}}function St(e){if(Bt){const n=Bt(e);if(null!=n&&""!==n)return n}switch(jt(e)){case"javascript":case"js":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n';case"typescript":case"ts":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n';case"jsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"tsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"html":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n';case"css":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n';case"scss":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#f4b8e4" stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.38c1.85 1.07 3.35.74 4.83-.2 1.5-.95 2.7-2.78 1.3-4.15-.7-.68-3.25-.8-5.62.19-2.36.99-4.59 3.02-4.74 4.11-.31 2.19 3.15 2.88 3.64 4.23s.28 1.98-.2 2.83c-.5.85-1.96 1.62-2.8.68-.83-.95 1.67-2.75 2.98-3.25 1.3-.5 3.1-.4 3.69.25.58.64-.07 1.79-.03 1.79" />\n</svg>\n';case"json":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n';case"python":case"py":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n';case"ruby":case"rb":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M1.5 9.06v2.5c.02.86.36 1.61.9 2.15 1.76 1.76 5.71.65 8.84-2.47 3.12-3.13 4.23-7.08 2.47-8.84a3.1 3.1 0 00-2.15-.9h-2.5M14.5 4l-.25 10.25L4 14.5m4.39-6.11c2.34-2.35 3.29-5.2 2.12-6.37S6.49 1.8 4.14 4.14C1.8 6.5.85 9.34 2.02 10.51s4.02.22 6.37-2.12M5.5 14.5l.25-3.75L11 11l-.25-5.25 3.75-.25" />\n</svg>\n';case"go":case"golang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m15.48 8.06-4.85.48m4.85-.48a4.98 4.98 0 01-4.54 5.42 5 5 0 112.95-8.66l-1.7 1.84a2.5 2.5 0 00-4.18 2.06c.05.57.3 1.1.69 1.51.25.27 1 .83 1.78.82.8-.02 1.58-.25 2.07-.81 0 0 .8-.96.68-1.88M2.5 8.5l-2 .01m1.5 2h1.5m-2-3.99 2-.02" />\n</svg>\n';case"r":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#838ba7" d="M13.5 9.5c.63-.7 1-1.54 1-2.43 0-2.52-2.91-4.57-6.5-4.57S1.5 4.55 1.5 7.07c0 1.9 1.65 3.53 4 4.22" />\n <path stroke="#8caaee" d="M10.5 9.5c.4 0 .86.34 1 .7l1 3.3m-5 0v-8h3.05c.95 0 1.95 1 1.95 2s-1 2-1.95 2H7.5Z" />\n </g>\n</svg>\n';case"java":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.73 8.41c.57 3 1.59 5.83 2.77 7.09-6.63-3.45-9.76-1.75-10.5 0-.66-3.4-.54-5.74.09-7.78" />\n <path stroke="#e78284" d="M8.5 7c.63.34 1.82 1.07 2.24 1.41-.54-2.9-.64-5.96-.74-7.91-2.13.58-5.73 1.98-6.9 7.22.52-.69 1.72-1.05 2.4-1.22" />\n <path stroke="#e78284" d="M5.5 7A1.5 1.5 0 007 8.5 1.5 1.5 0 008.5 7 1.5 1.5 0 007 5.5 1.5 1.5 0 005.5 7" />\n </g>\n</svg>\n';case"kotlin":case"kt":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />\n <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />\n <path stroke="#e78284" d="M2.5 13.5V8" />\n <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />\n </g>\n</svg>\n';case"c":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 4.0559072,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441188,0 l -1.789955,-1.782586 c -1.75742,1.750224 -4.6067879,1.750224 -6.3642294,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642294,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.746003,-2.73472867 -7.1981359,-2.73472867 -9.944119,0 -2.7459858,2.7347089 -2.7459858,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n</svg>\n';case"cpp":case"c++":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n';case"cs":case"csharp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" d="m 6.665625,1.0107144 c 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 7.18125,3.9983098 h 2.971875 L 10.5125,1.8326156 c 0.09063,-0.5437673 0.60625,-0.9125291 1.15,-0.8219012 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 12.18125,3.9983098 H 14 c 0.553125,0 1,0.4468892 1,1.0000319 0,0.5531426 -0.446875,1.0000319 -1,1.0000319 H 11.846875 L 11.18125,9.9985013 H 13 c 0.553125,0 1,0.4468897 1,1.0000317 0,0.553143 -0.446875,1.000032 -1,1.000032 H 10.846875 L 10.4875,14.164259 c -0.09063,0.543768 -0.60625,0.912529 -1.15,0.821902 -0.54375,-0.09063 -0.9125,-0.60627 -0.821875,-1.150037 l 0.30625,-1.834434 h -2.975 L 5.4875,14.167384 c -0.090625,0.543768 -0.60625,0.91253 -1.15,0.821902 C 3.79375,14.898658 3.425,14.383016 3.515625,13.839249 L 3.81875,11.998565 H 2 c -0.553125,0 -1,-0.446889 -1,-1.000032 C 1,10.445391 1.446875,9.9985013 2,9.9985013 H 4.153125 L 4.81875,5.9983736 H 3 c -0.553125,0 -1,-0.4468893 -1,-1.0000319 C 2,4.445199 2.446875,3.9983098 3,3.9983098 H 5.153125 L 5.5125,1.8326156 C 5.603125,1.2888483 6.11875,0.9200865 6.6625,1.0107144 Z M 6.846875,5.9983736 6.18125,9.9985013 H 9.153125 L 9.81875,5.9983736 Z" />\n</svg>\n';case"php":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M0.5,12.5 L0.5,13.24 C0.5,14 1.27360724,14.5 2,14.5 C2.9375516,14.5 3.5,14 3.5,13.2445661 L3.5,6.00089968 C3.5,4.28551107 4.99401107,2.52263547 7.14960413,2.5 C9.49387886,2.5 11,4.0579782 11,5.5 C11.1657296,8.48962302 9.57820404,9.63684469 7.49621582,10.5 L7.49621582,14.5 L15.4979764,14.5 L15.4979764,9 C15.5394484,8.36478228 14.9387379,7.15595371 14.1308258,6.5 C13.1942239,5.80827275 12.0584852,5.50253264 11,5.5 M11.5,14.5 L11.5,11.5 M6,6.5 C6.27614237,6.5 6.5,6.27614237 6.5,6 C6.5,5.72385763 6.27614237,5.5 6,5.5 C5.72385763,5.5 5.5,5.72385763 5.5,6 C5.5,6.27614237 5.72385763,6.5 6,6.5 Z" />\n</svg>\n';case"scala":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="m2.5 2.48 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1z" />\n</svg>\n';case"shell":case"sh":case"bash":case"zsh":case"powershell":case"ps1":case"bat":case"batch":case"shellscript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n';case"sql":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />\n</svg>\n';case"yaml":case"yml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />\n</svg>\n';case"markdown":case"md":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n';case"xml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5 1 8 4.5 11.5M11.5 4.5 15 8 11.5 11.5M9.5 2 6.5 14" />\n</svg>\n';case"rust":case"rs":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M15.5 9.5Q8 13.505.5 9.5l1-1-1-2 2-.5V4.5h2l.5-2 1.5 1 1.5-2 1.5 2 1.5-1 .5 2h2V6l2 .5-1 2z" />\n <path d="M6.5 7.5a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1m5 0a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1M4 11.02c-.67.37-1.5.98-1.5 2.23s1.22 1.22 2 1.25v-2M12 11c.67.37 1.5 1 1.5 2.25s-1.22 1.22-2 1.25v-2" />\n </g>\n</svg>\n';case"swift":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M14.34 10.2c.34-1.08 1.1-5.07-4.45-8.62a.48.48 0 00-.6.07.44.44 0 00-.02.6c.03.02 2.07 2.5 1.34 5.34-1.26-.86-6.24-4.81-6.24-4.81L7.25 7.5 1.9 4.05S5.68 8.7 8 10.45c-1.12.4-3.56.82-6.78-1.18a.48.48 0 00-.58.06.44.44 0 00-.08.56c.11.18 2.7 4.36 8.14 4.36 1.5 0 2.37-.42 3.08-.77.43-.2.77-.37 1.14-.37.93 0 1.54.92 1.54.93.1.14.27.22.44.21a.46.46 0 00.4-.28c.67-1.55-.49-3.2-.96-3.78h0Z" />\n</svg>\n';case"perl":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M12.5 14.5v-3.34c-1-.66-1-1.35-1-2.66m-3 1 .02 2.53.98 2.47m-4-5v5m9 0V9.23s.17-1.73-1-1.73c0-1.5-.5-6-2.5-6S8.75 4.25 8.75 4.25A3.67 3.67 0 006.5 7.12v-3.5c0-.63-.85-1.32-1.5-1.32-.92 0-1.33.59-1.5 1.2H2.25c-.42.11-.75.59-.75 1 0 .5.28 1 .75 1h1.22l.02 3c.01.75.51 1 1.51 1h4.5" />\n</svg>\n';case"lua":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.5 7A1.5 1.5 0 019 8.5 1.5 1.5 0 017.5 7 1.5 1.5 0 019 5.5 1.5 1.5 0 0110.5 7" />\n <path stroke="#8caaee" d="M7 2.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13m7-2a1.5 1.5 0 100 3 1.5 1.5 0 000-3" />\n </g>\n</svg>\n';case"haskell":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M12.5 4.5h3m-1.5 3h1.5m-10 6 2.5-5-2.5-5H8l5.6 10h-2.53l-1.52-2.92L8 13.5zm-5 0 2.5-5-2.5-5H3l2.5 5-2.5 5z" />\n</svg>\n';case"erlang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M6.5 5.5c0-1.25 1-2 2-2s2 .75 2 2z" />\n <path d="M13.5 13c.47-.57 1.12-1.24 1.5-2l-2.25-1.25c-.74 1.36-1.76 2.75-3.25 2.75-2.1 0-3-2.3-3-5h8c.05-1.61-.31-3.45-1-4.5M3 13c-1.08-1.3-1.5-3-1.5-5S2.1 4.24 3 3" />\n </g>\n</svg>\n';case"clojure":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M14.17 10.03A6.5 6.5 0 011.81 6.02" />\n <path stroke="#8caaee" d="M1.87 5.85A6.5 6.5 0 0114.22 9.9" />\n <path stroke="#a6d189" d="M6.36 4.9a3.5 3.5 0 103.41 6.12" />\n <path stroke="#8caaee" d="M9.77 11.02a3.5 3.5 0 00-3.03-6.29" />\n <path stroke="#c6d0f5" d="M8 7.5s-1.66 2.48-1.5 3.65" />\n <path stroke="#c6d0f5" d="M1.81 6.02C2.47 5 3.83 4.49 5 4.46c4.06 0 3 5.56 5.03 6.86 1.21.52 3.5-.21 4.15-1.32" />\n </g>\n</svg>\n';case"vue":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n';case"svg":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="m4.54 10 6.92-4m-6.92 4a1.5 1.5 0 10-2.6 1.5 1.5 1.5 0 002.6-1.5M8 4v8m0-8a1.5 1.5 0 100-3 1.5 1.5 0 000 3M4.54 6l6.92 4M4.54 6a1.5 1.5 0 10-2.6-1.5A1.5 1.5 0 004.54 6M8 12a1.5 1.5 0 100 3 1.5 1.5 0 000-3m3.46-2a1.5 1.5 0 102.6 1.5 1.5 1.5 0 00-2.6-1.5m0-4a1.5 1.5 0 102.6-1.5 1.5 1.5 0 00-2.6 1.5" />\n</svg>\n';case"mermaid":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n';case"dart":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M7 14.5h4.5v-3h3V7L9.17 1.64c-.28-.29-.8-.47-1.17-.29L3.5 3.5 1.35 8c-.18.37 0 .88.3 1.17z" />\n <path d="M3.5 11V3.5H11m-7.5 0 8 8" />\n </g>\n</svg>\n';case"assembly":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <rect width="8" height="13.001" x="4" y="1.499" fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" rx="2.286" ry="2.286" />\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M 4,4.500025 H 1.5 M 4,7.9999993 H 1.5 M 4,11.499973 H 1.5 m 13,-6.999948 H 12 m 2.5,3.4999743 H 12 m 2.5,3.4999737 H 12" />\n</svg>\n';case"dockerfile":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M.5 8.5H11l.75-.5a5.35 5.35 0 010-3.5c1 .6 1 1.88 1.74 2 .77-.09 1.23.01 2 .52 0 0-.97 1.77-2.5 1.98-1.93 3.65-4.5 5.5-6.98 5.5C0 14.5.5 8.5.5 8.5m1 0v-2m0 0h8m-6 2v-4m0 0h4m-2-2h2m-2 6v-6m2 6v-6m2 6v-2" />\n</svg>\n';case"fortran":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M7.5 14.5v-1l-1-1v-3h2l1 2h1v-6h-1l-1 2h-2v-4h5l1 3h1v-5h-11v1l1 1v9l-1 1.25v.75z" />\n</svg>\n';case"lisp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M.5 5.06v6.07C.5 12.41.82 13 2.27 13h5.6c1.04 0 1.63-.51 1.63-1.62 0-.85-.2-1.88-1.5-1.88h-.36C6.4 9.5 6 8.77 6 7.75 6 6.81 6.8 6 7.49 6h2.68" />\n <path d="M3.5 10.5V4.99C3.5 3.89 3.62 3 5 3h9c.97 0 1.5.99 1.5 1.63.12 1.55-.98 1.62-2.1 2.16-.58.26-1.4.52-1.4.98V11" />\n </g>\n</svg>\n';case"ocaml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1.5 8V3c0-.83.67-1.5 1.5-1.5h10c.83 0 1.5.67 1.5 1.5v10c0 .83-.67 1.5-1.5 1.5H9" />\n <path d="m1.5 8 1.14-2.3q.09-.21.36-.24a.8.8 0 01.44.13c.18.12.23.53.28.64.06.1.64 1.23.85 1.23.2 0 .71-1.47.71-1.47s.37-.49.72-.49.55.32.67.49c.12.16.24 1.76.46 2.01s1.32.87 1.67.73c.34-.13.53-.4.63-.73.1-.34-.14-.75 0-1a1.1 1.1 0 011.02-.55c.56.03 2.05.56 2.05 1.05q0 .75-1.5.75c-.48 1.33.28 2.22-3 2.25l1 4" />\n <path d="m4.5 14.5 1.5-4 1 4zm-2 0 1.5-4-1.5-.5-1 1.54V14l1 .49Z" />\n </g>\n</svg>\n';case"prolog":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 13.5c-.33.33-.5.67-.5 1s.17.67.5 1c.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.83.5-1.5h2c0 .67.17 1.17.5 1.5.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.67.5-1s-.17-.67-.5-1l1-1 1.25 1.25c0-2.75 1-2.75 1-5.75a7.1 7.1 0 00-2-5.25A3.64 3.64 0 0113 .5c-1.17 0-2 .42-2.5 1.25A3.08 3.08 0 008 .5c-1 0-1.83.42-2.5 1.25C5 .92 4.17.5 3 .5c.5.83.58 1.58.25 2.25a7.1 7.1 0 00-2 5.25c0 3 1 3 1 5.75L3.5 12.5zm6-5a2 2 0 100-4 2 2 0 000 4m-5 0a2 2 0 100-4 2 2 0 000 4M7 8l1 2.5L9 8m1.5-1.5" />\n</svg>\n';case"groovy":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M11.68 5.38c.4.19.54.68 1.53 3.25 1 2.57-.92 4.07-.92 4.07s-6.73 2.47-6.73 1.63c-.18-.92-1.92-2.08-1.92-2.08s-.52-.63.06-.75c5.89-1.27 6.96-.61 7.3-2" />\n <path d="M7.38 10.63C2.62 10.88 2.48 8.08 2.5 8 3.6 4.6 9.24.91 10.8 1.58 14.07 3.04 9.2 8.96 7 8.5c-4.02-.83 1.5-4 1.5-4" />\n </g>\n</svg>\n';case"matlab":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#85c1dc" d="M4 11 .5 8.5 5 7q.78-1.77 1.89-1.89c.74-.07 1.94-1.28 3.61-3.61M5 7l1.5 1.5" />\n <path stroke="#ef9f76" d="m15.5 12.5-5-11C8.5 6.83 6.33 10 4 11c1.67-.33 2.67.83 3 3.5 3.5-1.5 3.5-3.5 5-4s1.5 1.5 3.5 2" />\n </g>\n</svg>\n';case"cobol":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M6.74 2.24c.32-1.32 2.2-1.32 2.52 0a1.3 1.3 0 001.93.8c1.15-.7 2.48.62 1.77 1.77a1.3 1.3 0 00.8 1.93c1.32.32 1.32 2.2 0 2.52a1.3 1.3 0 00-.8 1.93c.7 1.15-.62 2.48-1.77 1.77a1.3 1.3 0 00-1.93.8c-.32 1.32-2.2 1.32-2.52 0a1.3 1.3 0 00-1.93-.8c-1.15.7-2.48-.62-1.77-1.77a1.3 1.3 0 00-.8-1.93c-1.32-.32-1.32-2.2 0-2.52a1.3 1.3 0 00.8-1.93c-.7-1.15.62-2.48 1.77-1.77a1.3 1.3 0 001.93-.8M10 6.5a2.5 2.5 0 100 3" />\n</svg>\n';case"ada":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#0f23c3" d="M24.554 20.075c.209.27 1.356.961 1.37 1.246a7 7 0 0 0-1.4-.324a17 17 0 0 1-1.412-.48a9.2 9.2 0 0 1-2.375-1.3A3.15 3.15 0 0 1 19.3 16.75a1.72 1.72 0 0 1 1.767-1.822a3.6 3.6 0 0 1 1.593.321c.146.066 1.31.606 1.256.809a5.5 5.5 0 0 0-1.41-.112c-.649.244-.4.828-.168 1.311a8 8 0 0 0 1.078 1.554c.164.194.884 1.271 1.138 1.264"/><path fill="#1a1978" d="M24.141 16.276c.128-.59.819-1.384 1.344-.773a4.2 4.2 0 0 1 .578 1.918c.12.656.2 1.327.261 1.982c.038.379.34 1.794.123 2.075a23 23 0 0 1-2.922-2.838a3.76 3.76 0 0 1-.925-1.7c-.1-1.073.879-.73 1.541-.664"/><path fill="#0f23c3" d="M26.3 17.781c.141-.732-.406-2.592-1.067-2.949a.06.06 0 0 0 .044-.007c-.156-.444-1.359 1.116-1.228 1.174c-.316-.138.774-1.984.988-2.16c.7-.578 1.372-.086 1.845.543a6.04 6.04 0 0 1 .733 4.434a4.5 4.5 0 0 1-.421 1.312c-.1.22-.45 1.1-.682 1.174a14.8 14.8 0 0 0-.212-3.521"/><path fill="#d2d2d2" d="M3.687 8.4c.179-.188-.041-1.527.324-1.548c.262-.015.553 1.741.627 1.968a9.2 9.2 0 0 0 1.127 2.329a7.53 7.53 0 0 0 4.016 2.978a4.55 4.55 0 0 0 2.366.2c.931-.208 1.82-.577 2.757-.765c1.35-.27 3.342-.352 4.438.647c.7.641.376.76.043 1.421a2.44 2.44 0 0 0 .178 2.562c.235.342 1.033.827.675 1.094c-.567.424-1.277-.452-1.636-.776c-1.4-1.264-2.711-1.313-4.492-1.074a9 9 0 0 1-4.883-.708A9.47 9.47 0 0 1 3.687 8.4M19.941 30a3.6 3.6 0 0 1-2.325-.817c.469-.092 1.021.025 1.508-.044a9.7 9.7 0 0 0 1.754-.43a10.5 10.5 0 0 0 3.022-1.554a6.55 6.55 0 0 0 2.757-5.214c.149-.088.316 1.034.319 1.091a5.8 5.8 0 0 1-.19 1.727a6.9 6.9 0 0 1-1.423 2.774A7.3 7.3 0 0 1 19.941 30"/><path fill="#d2d2d2" d="M18.962 19.109a5.8 5.8 0 0 1-2.05.859a13.4 13.4 0 0 1-2.224.549a8.86 8.86 0 0 1-4.435-.51a9.94 9.94 0 0 1-3.849-2.4c-.352-.367-2.104-2.417-1.548-3.05c.248-.282.875.846 1 .992a5 5 0 0 0 1.357 1.11a10.9 10.9 0 0 0 4.035 1.456a6.7 6.7 0 0 0 2.34-.094a13 13 0 0 1 1.694-.485a4 4 0 0 1 2.113.457c.344.17 1.523.743 1.567 1.116m9.351-4.031a19.3 19.3 0 0 1-.453 3.774c-.176-.242.016-1.47 0-1.792a6 6 0 0 0-.384-2.087a4.9 4.9 0 0 0-1.376-1.661a15 15 0 0 1-1.27-1.536c-1.837-2.382-3.245-5.211-2.9-8.3c.034-.308.069-1.448.411-1.445c.152 0 .266 1.561.29 1.718a12.5 12.5 0 0 0 1.224 4.116c.67 1.222 1.947 2.023 2.825 3.1a6.58 6.58 0 0 1 1.633 4.113M15.7 26.935a10.85 10.85 0 0 0 6.436-.687a6.94 6.94 0 0 0 4.278-4.418c.319.2-.048 1.529-.128 1.781a5.7 5.7 0 0 1-1.01 1.813a8.9 8.9 0 0 1-3.257 2.514c-1.703.772-5.662 1.652-6.319-1.003"/><path fill="#d2d2d2" d="M19.151 19.376c.367 2.107-2.957 3.124-4.478 3.213c-1.859.11-4.929-.292-6.06-2.031c-.673-1.035.781-.09 1.188.058a8.7 8.7 0 0 0 3.06.5a11.6 11.6 0 0 0 3.305-.5a14 14 0 0 0 1.533-.576c.301-.132 1.124-.691 1.452-.664m4.991 4.084c.4-.945-1.883-1.578-2.445-1.858a4.9 4.9 0 0 1-1.315-.867c-.181-.181-.872-.92-.807-1.219a5 5 0 0 1 1.087-.175a6 6 0 0 1 .855.588a10 10 0 0 0 .964.5a16 16 0 0 0 2.119.771c.308.09 1.549.208 1.727.428c-.04.296-1.97 2.021-2.185 1.832"/><path fill="#d2d2d2" d="M26.1 22.172c.265.43-1.08 1.831-1.363 2.105a9.3 9.3 0 0 1-2.566 1.728a7.8 7.8 0 0 1-2.56.753c-.679.058-1.966-.124-2.141-.979a7 7 0 0 1 1.177-.086c.462-.059.921-.149 1.376-.246a13 13 0 0 0 2.184-.645a11.5 11.5 0 0 0 2.084-1.11a11 11 0 0 0 1.078-.822c.105-.089.617-.702.731-.698m-7.342-10.207c-.1-1.308 2.612-1.3 3.271-1.092a5.98 5.98 0 0 1 2.982 2.475c-1.082.8-2.449.094-3.3-.654a4.3 4.3 0 0 0-1.481-1.029c-.809-.265-.818.094-1.472.3"/><path fill="#d2d2d2" d="M25.783 13.341c-.444-.029-.316.071-.647-.212c-.358-.307-.614-.795-.945-1.141c-.534-.558-1.242-.895-1.723-1.485a7.27 7.27 0 0 1-1.624-4.848c.018-1.489.407.187.551.675a12.3 12.3 0 0 0 1.126 2.708a46 46 0 0 0 3.4 4.321c-.039.002-.097-.021-.138-.018m-5.715 1.415c.033-.625-.911-.792-1.211-1.42c-.164-.343-.211-.569.029-.7c.082-.045.383.012.5-.02c.271-.076.335-.273.581-.4a1.193 1.193 0 0 1 1.633 1.021a1.82 1.82 0 0 1-1.532 1.519"/><path fill="#d2d2d2" d="M20.5 14.745a1.93 1.93 0 0 0 1.323-1.7c.524.139.928.658 1.521.771a2.6 2.6 0 0 0 1.029-.017c.207-.045.54-.274.721-.259c-.033.163-.464.546-.565.717a4.2 4.2 0 0 0-.388.9c-.229.741-.061.739-.709.311a4.3 4.3 0 0 0-1.957-.72c-.266-.026-.881.019-.975-.003m-.595 5.989a2.01 2.01 0 0 1-1.4 1.712c-.205.091-2.018.733-2.032.348c-.007-.2 1.624-.954 1.809-1.11a3.4 3.4 0 0 0 .867-1.071c.055-.112.232-.925.271-.943c.224-.106.488.93.485 1.064m-8.532-8.202a10.6 10.6 0 0 1 3.71-.914a10.3 10.3 0 0 1 1.865.024c.366.039 1.469.054 1.74.343a.255.255 0 0 1-.273.173c-.037.077.251.371.3.425c-.034.034-1.445-.4-1.572-.424a10.6 10.6 0 0 0-2.282-.134a16 16 0 0 0-1.841.194a6.2 6.2 0 0 1-1.647.313m11.139-1.801a1.89 1.89 0 0 1-1.517-.6c-.247-.349-.737-1.692-.385-2.021c.209-.2.384.662.484.846a11 11 0 0 0 1.418 1.775m5.276 8.469a19 19 0 0 1-.749 3.313c-.173-.077-.275-.778-.562-.95a4.1 4.1 0 0 0 .76-1.154c.152-.302.303-1.046.551-1.209m-7.807-7.357c-.132.268-.932 1.1-1.118.481c-.107-.356.876-.841 1.118-.481m-.747.45c.228.006.012-.248.012-.266c-.001-.043-.368.266-.012.266"/></svg>';case"julia":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M10.5 5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#e78284" d="M6.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#ca9ee6" d="M14.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n </g>\n</svg>\n';case"elixir":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M8.03 14.5C5 14.5 3.5 12.49 3.5 10.01c0-2.82 2.25-7.02 4.62-8.48a.24.24 0 01.24 0c.08.04.12.12.11.2-.13 1.25.22 2.5.98 3.54.3.43.63.8 1.02 1.27.54.66.94 1.03 1.52 2.08l.01.02c.33.56.5 1.2.5 1.84 0 2.03-1.69 4.02-4.47 4.02" />\n</svg>\n';case"vb.net":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#00519a" d="M6.67 7.836L9 18.915l2.336-11.079H16l-4.664 16.328H6.672L2 7.836Zm11.661 0h7.6a4.08 4.08 0 0 1 2.9 1.749a3.8 3.8 0 0 1 .571 2.04a4 4 0 0 1-.571 2.034a4.1 4.1 0 0 1-2.341 1.763a4.1 4.1 0 0 1 2.929 1.756a3.8 3.8 0 0 1 .58 2.1a4.66 4.66 0 0 1-.579 2.546a5.05 5.05 0 0 1-3.5 2.338h-7.589ZM23 14.252h1.166a1.754 1.754 0 0 0 0-3.5H23Zm0 7h1.39a2.047 2.047 0 0 0 0-4.089H23Z"/></svg>';case"nim":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M1 7 .5 4.5l1.01.67c.28-.27.47-.48 1.18-.85l.56-1.82L4.5 3.84c.77-.18 1.53-.36 2.4-.33L8 1.5l1.1 2.01c.87-.03 1.63.15 2.4.33l1.25-1.34.56 1.82c.7.37.9.58 1.18.85l1.01-.67L15 7m-1.5 1C13 6.5 11 5.5 8 5.5S3 6.5 2.5 8m11.5.75L13.5 8l-1 1.5-1.5.5-3-1.5L5 10l-1.5-.5-1-1.5-.5.75L1 7l1.25 3.75C3 12.75 6 13.5 8 13.5s5-.75 5.75-2.75L15 7z" />\n</svg>\n';case"crystal":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="m 15.4712,10.050637 -5.433601,5.433968 c -0.015,0.01505 -0.04554,0.01505 -0.09055,0.01505 L 2.536327,13.517264 c -0.015,0 -0.04501,-0.01505 -0.06055,-0.06072 L 0.50026325,6.0396501 a 0.21432208,0.21495127 0 0 1 0.015,-0.090817 L 5.9483283,0.5154023 c 0.015,-0.0150465 0.04501,-0.0150465 0.09055,-0.0150465 l 7.4101857,1.997972 c 0.015,0 0.04501,0.015046 0.06055,0.060724 l 1.977121,7.4158186 c 0.03001,0.03063 0.01608,0.060724 -0.01554,0.07577 M 8.2121063,4.1480782 0.93801425,6.1154197 q -0.0225,0 0,0.04514 L 6.2655263,11.50371 c 0.015,0.01505 0.015,0 0.04501,0 l 1.962119,-7.2803988 c -0.03054,-0.075233 -0.06055,-0.075233 -0.06055,-0.075233" />\n</svg>\n';case"d":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<defs><linearGradient id="SVGMV3iTbAN" x1="185.455" x2="181.955" y1="1601.641" y2="1630.224" gradientTransform="translate(-62.523 -666.646)scale(.427)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="SVGniw2Mvsa" x1="176.136" x2="172.636" y1="1600.5" y2="1629.083" href="#SVGMV3iTbAN"/></defs><path fill="#b03931" d="m3.978 15.462l-.009-6.953a.59.59 0 0 1 .531-.562h.076l6.074-.009a15.7 15.7 0 0 1 6.067.95a8.9 8.9 0 0 1 2.244 1.359a4.47 4.47 0 0 1 2.946-1.083a4.11 4.11 0 0 1 4.276 3.92A4.11 4.11 0 0 1 21.907 17c-.089 0-.177-.008-.265-.012a7 7 0 0 1-.232.953a85 85 0 0 1 8.59 2.6V2H2v13.4q.992.02 1.978.062m22.8-7.944a1.32 1.32 0 0 1 1.374 1.259a1.379 1.379 0 0 1-2.747 0a1.32 1.32 0 0 1 1.375-1.26Z"/><path fill="#b03931" d="M17.861 15.787a4.11 4.11 0 0 0-1.748-3.458a5.8 5.8 0 0 0-1.508-.822a7.4 7.4 0 0 0-1.629-.438a22 22 0 0 0-2.588-.1H7.769l.006 4.737a89 89 0 0 1 9.91 1.408a5 5 0 0 0 .176-1.327m3.132 3.192a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035"/><path fill="url(#SVGMV3iTbAN)" d="M20.993 18.979a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035" opacity=".3"/><path fill="#b03931" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z"/><path fill="url(#SVGniw2Mvsa)" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z" opacity=".3"/><path fill="#fff" d="M20.383 11.746a7 7 0 0 1 1.36 4.148a6.6 6.6 0 0 1-.1 1.1c.088 0 .176.012.265.012a4.11 4.11 0 0 0 4.276-3.92a4.11 4.11 0 0 0-4.276-3.92a4.47 4.47 0 0 0-2.946 1.083a8 8 0 0 1 1.421 1.497"/><ellipse cx="26.78" cy="8.777" fill="#fff" rx="1.374" ry="1.259"/><path fill="#fff" d="m4.673 23.877l5.625-.022a32 32 0 0 0 3.326-.111h.015a11.5 11.5 0 0 0 1.971-.472a9.7 9.7 0 0 0 3.256-1.71a7.9 7.9 0 0 0 2.128-2.582a7 7 0 0 0 .417-1.034a7 7 0 0 0 .332-2.051a7 7 0 0 0-1.36-4.148a8 8 0 0 0-1.421-1.5a8.9 8.9 0 0 0-2.244-1.359a15.7 15.7 0 0 0-6.067-.95l-6.074.009h-.076a.59.59 0 0 0-.532.562l.009 6.952l.01 7.734a.616.616 0 0 0 .685.682m3.1-12.908h2.619a22 22 0 0 1 2.588.1a7.4 7.4 0 0 1 1.629.438a5.8 5.8 0 0 1 1.508.822a4.12 4.12 0 0 1 1.748 3.458a5 5 0 0 1-.175 1.327a4.46 4.46 0 0 1-1.518 2.271a5.6 5.6 0 0 1-1.187.748a7.7 7.7 0 0 1-1.628.5a16 16 0 0 1-2.877.2H7.786L7.78 15.7Z"/></svg>';case"applescript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M14.4561802 11.3673353C13.0276218 14.1261537 11.8858593 15.5 10.8437759 15.5 10.3588459 15.5 9.88231005 15.3491298 9.41749082 15.0543006 8.74000639 14.6241577 7.8668418 14.6059458 7.17068967 15.0074382 6.60881451 15.3319356 6.07177167 15.5 5.56305868 15.5 4.02887542 15.5 1.5 10.9491129 1.5 8.45090396 1.5 5.78581061 2.95006811 3.551507 5.15647301 3.551507 6.19383481 3.551507 7.09007204 4.20001691 7.84308619 4.497206 8.16210316 4.62512517 8.52255587 4.61592787 8.83410596 4.47192 9.44477141 4.18872223 10.2497236 3.551507 11.2503615 3.551507 12.4715175 3.551507 13.5338865 4.33779342 14.4184071 5.47479877 14.5532906 5.64778615 14.5172013 5.89341518 14.3377895 6.02349446 13.3500923 6.736546 12.8746057 7.53893969 12.8746057 8.45090396 12.8746057 9.36404821 13.3502672 10.1652619 14.3377895 10.8793249 14.4946576 10.992887 14.5445377 11.1984946 14.4561802 11.3673353ZM8.5 3C8.5 3 8.3468635 1.3936039 10 1" />\n</svg>\n';case"solidity":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m3 11.5 2.5 4 2.5-4 2.5 4 2.5-4-2.5-4-2.5 4m2.5 4h-5m7.5-4H3m10-7-2.5-4-2.5 4-2.5-4-2.5 4 2.5 4 2.5-4M5.5.5h5M3 4.5h10" />\n</svg>\n';case"objectivec":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M11.29 15.976a8.9 8.9 0 0 0 1.039 4.557a4.82 4.82 0 0 0 5.579 2.13a3.79 3.79 0 0 0 2.734-3.181c.095-.535.1-.54.1-.54c1.537.222 4.014.582 5.55.8l-.1.389A9.96 9.96 0 0 1 23.8 24.9a8.35 8.35 0 0 1-4.747 2.378a12.93 12.93 0 0 1-7.322-.725a8.98 8.98 0 0 1-5.106-5.524A14.35 14.35 0 0 1 6.642 10.9a9.32 9.32 0 0 1 7.929-6.24a11.8 11.8 0 0 1 5.9.491a8.47 8.47 0 0 1 5.456 6.1c.083.311.1.369.1.369c-1.709.311-3.821.705-5.518 1.075c-.323-1.695-1.122-3.029-2.831-3.445a4.656 4.656 0 0 0-5.853 3.158a9 9 0 0 0-.341 1.273a11 11 0 0 0-.194 2.295"/><path fill="#c2c2c2" d="M2.033 30V2h5.934v2.227H4.723v23.546h3.244V30zm27.934-.001h-5.934v-2.228h3.244V4.226h-3.244V1.999h5.934z"/></svg>';case"objectivecpp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M19.5 24.833a11.24 11.24 0 0 1-5.13 1.009a8.37 8.37 0 0 1-6.492-2.576A9.75 9.75 0 0 1 5.512 16.4a10.4 10.4 0 0 1 2.659-7.406a9.02 9.02 0 0 1 6.9-2.841a12.2 12.2 0 0 1 4.43.7v4.129a7.5 7.5 0 0 0-4.108-1.142a5.28 5.28 0 0 0-4.075 1.685A6.48 6.48 0 0 0 9.766 16.1a6.37 6.37 0 0 0 1.464 4.4a5.02 5.02 0 0 0 3.941 1.639a8.03 8.03 0 0 0 4.329-1.223Z"/><path fill="#c2c2c2" d="M16.572 15.081V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zm6.44 0V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zM2.035 30V2.001h5.933v2.227H4.725v23.545h3.243V30z"/><path fill="#c2c2c2" d="M29.965 29.999h-5.933v-2.228h3.243V4.227h-3.243V2h5.933z"/></svg>';case"terraform":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m1.5 6 8 4.25 4-2.25m-12-2V1.5l8 4.25 4-2.25V8m-4-2.25v8.75M5.53 3.82 5.5 12.5l4 2" />\n</svg>\n';case"plain":case"text":case"":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n';default:return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">\x3c!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --\x3e<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>'}}const Lt={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown","":"Plain Text",plain:"Plain Text"};function Ht(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(n){}return globalThis.setTimeout(e,0)}const Et=()=>import("mermaid");let Nt=null,Dt=Et;function zt(e){Dt=e,Nt=null}function At(e){zt(null!=e?e:Et)}function Pt(){zt(null)}function Vt(){return"function"==typeof Dt}let Rt=null,Ot=null;const Kt=/* @__PURE__ */new Map;let Ft=5,Wt=!1;function Xt(e){Wt=!!e}function Zt(e){Number.isFinite(e)&&e>0&&(Ft=Math.floor(e))}function qt(){return{inFlight:Kt.size,max:Ft}}const Yt="WORKER_BUSY",Ut="MERMAID_DISABLED";function Gt(e){Rt=e,Ot=null;const n=e;Rt.onmessage=e=>{if(Rt!==n)return;const{id:t,ok:o,result:l,error:r}=e.data,a=Kt.get(t);a&&(!1===o||r?a.reject(new Error(r||"Unknown error")):a.resolve(l))},Rt.onerror=e=>{var t,o;if(Rt===n)if(0!==Kt.size){try{Wt?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch(l){}for(const[n,t]of Kt.entries())t.reject(new Error(`Worker error: ${e.message}`));Kt.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Rt.onmessageerror=e=>{var t,o;if(Rt===n)if(0!==Kt.size){try{Wt?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(l){}for(const[e,n]of Kt.entries())n.reject(new Error("Worker messageerror"));Kt.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function Jt(){var e;if(Rt)try{for(const[e,n]of Kt.entries())n.reject(new Error("Worker cleared"));Kt.clear(),null==(e=Rt.terminate)||e.call(Rt)}catch(n){}Rt=null,Ot=null}function Qt(e,n,t=1400){if(!Vt()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=Ut,Promise.reject(e)}if(Ot)return Promise.reject(Ot);const o=Rt||(Ot=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Ot.name="WorkerInitError",Ot.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Ot);if(Kt.size>=Ft){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Yt,e.inFlight=Kt.size,e.max=Ft,Promise.reject(e)}return new Promise((l,r)=>{const a=Math.random().toString(36).slice(2);let i,s=!1;const u=()=>{s||(s=!0,null!=i&&globalThis.clearTimeout(i),Kt.delete(a))},c={resolve:e=>{u(),l(e)},reject:e=>{u(),r(e)}};Kt.set(a,c);try{o.postMessage({id:a,action:e,payload:n})}catch(d){return Kt.delete(a),void r(d)}i=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const n=Kt.get(a);n&&n.reject(e)},t)})}function eo(e,n,t=1400){return u(this,null,function*(){try{return yield Qt("canParse",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function no(e,n,t=1400){return u(this,null,function*(){try{return yield Qt("findPrefix",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function to(){if(Rt)try{for(const[e,n]of Kt.entries())n.reject(new Error("Worker terminated"));Kt.clear(),Rt.terminate()}finally{Rt=null}}const oo={key:0},lo={key:1,class:"flex items-center space-x-2 overflow-hidden"},ro=["src"],ao={key:2},io={class:"flex items-center space-x-1"},so={class:"flex items-center space-x-1"},uo={key:4},co={key:5,class:"flex items-center space-x-1"},vo=["aria-pressed"],mo={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},ho={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},po=["disabled"],go=["disabled"],fo={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},wo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},yo={key:1,class:"relative"},ko={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},xo={class:"flex items-center gap-2 backdrop-blur rounded-lg"},bo={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},Mo=/* @__PURE__ */te(/* @__PURE__ */m({__name:"MermaidBlockNode",props:{node:{},maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!1}},emits:["copy","export","openModal","toggleMode"],setup(e,{emit:n}){var t,o;const l=e,r=n,a={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},c=M(!1),d=L(()=>l.isStrict?"strict":"loose"),v=L(()=>({startOnLoad:!1,securityLevel:d.value,dompurifyConfig:"strict"===d.value?a:void 0,flowchart:"strict"===d.value?{htmlLabels:!1}:void 0})),m=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],g=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function k(e){if(!e)return"";const n=e.trim();return g.test(n)?n:""}function x(e){if(e)try{e.replaceChildren()}catch(n){e.innerHTML=""}}function I(e,n){if(!e)return"";if("strict"===d.value)return function(e,n){if(!e)return"";try{e.replaceChildren()}catch(o){e.innerHTML=""}const t=function(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return null;if(!e)return null;const n=e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),t=(new DOMParser).parseFromString(n,"image/svg+xml").documentElement;if(!t||"svg"!==t.nodeName.toLowerCase())return null;const o=t;return function(e){const n=/* @__PURE__ */new Set(["script"]),t=[e,...Array.from(e.querySelectorAll("*"))];for(const o of t){if(n.has(o.tagName.toLowerCase())){o.remove();continue}const e=Array.from(o.attributes);for(const n of e){const e=n.name;if(/^on/i.test(e))o.removeAttribute(e);else{if("style"===e&&n.value){const t=n.value;if(m.some(e=>e.test(t))){o.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&n.value){const t=k(n.value);if(!t){o.removeAttribute(e);continue}t!==n.value&&o.setAttribute(e,t)}}}}}(o),o}(n);return t?(e.appendChild(t),e.innerHTML):""}(e,n);try{e.replaceChildren()}catch(t){e.innerHTML=""}if(n)try{e.insertAdjacentHTML("afterbegin",n)}catch(t){e.innerHTML=n}return e.innerHTML}const{t:j}=Oe();function $(){return u(this,null,function*(){try{const e=yield function(){return u(this,null,function*(){if(Nt)return Nt;const e=Dt;if(!e)return null;let n;try{n=yield e()}catch(t){if(e===Et)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw t}return n?(Nt=function(e){if(!e)return e;const n=e&&e.default?e.default:e;if(n&&("function"==typeof n.render||"function"==typeof n.parse||"function"==typeof n.initialize))return n;if(n&&n.mermaidAPI&&("function"==typeof n.mermaidAPI.render||"function"==typeof n.mermaidAPI.parse)){const e=n.mermaidAPI;return s(i({},n),{render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:t=>"function"==typeof n.initialize?n.initialize(t):e.initialize?e.initialize(t):void 0})}return e.mermaid&&"function"==typeof e.mermaid.render?e.mermaid:n}(n),function(e){if(e)try{const n=null==e?void 0:e.initialize;e.initialize=t=>{const o=i({suppressErrorRendering:!0},t||{});return"function"==typeof n?n.call(e,o):(null==e?void 0:e.mermaidAPI)&&"function"==typeof e.mermaidAPI.initialize?e.mermaidAPI.initialize(o):void 0}}catch(n){}}(Nt),Nt):null})}();return c.value=!!e,e}catch(e){throw c.value=!1,e}})}"undefined"!=typeof window&&u(null,null,function*(){var e;try{const n=yield $();if(!n)return;null==(e=null==n?void 0:n.initialize)||e.call(n,i({},v.value))}catch(n){c.value=!1,console.warn("[markstream-vue] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",n)}});const S=M(!1),A=M(!1),P=M(),V=M(),O=M(),K=M(null),W=Fe(),X=M(null),Z=M("undefined"==typeof window),ne=M(),te=L(()=>l.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),oe=M(1),le=M(0),re=M(0),ae=M(!1),ie=M({x:0,y:0}),se=M(!1),ue=M(!1),ce=M(!1),de=M(null),ve=M(0),me=M(!1);let he=null,pe=null,ge=0;const fe=null!=(t=globalThis.requestIdleCallback)?t:(e,n)=>setTimeout(()=>e({didTimeout:!0}),16),we=function(){let e=null;return(...n)=>{e&&clearTimeout(e),e=setTimeout(()=>(()=>{fe(()=>{bn()},{timeout:500})})(...n),300)}}();function ye(){null!=pe&&(globalThis.clearTimeout(pe),pe=null)}function ke(e=600){if("undefined"==typeof globalThis)return;const n=Math.max(0,e);ye(),pe=globalThis.setTimeout(()=>{pe=null,l.loading||ce.value||!Z.value?ke(Math.min(1200,Math.max(300,1.2*n))):we()},n)}const xe=M("360px");let be=null;const Me=M(!1),_e=M(!1),Ce=M({}),Be=M(null),Te=M(""),Ie=M(0);let je=null;const $e=M(!1),Se=M({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),Le=L(()=>l.enableWheelZoom?{wheel:pn}:{}),He=L(()=>{var e,n,t,o;return{worker:null!=(e=l.workerTimeoutMs)?e:1400,parse:null!=(n=l.parseTimeoutMs)?n:1800,render:null!=(t=l.renderTimeoutMs)?t:2500,fullRender:null!=(o=l.fullRenderTimeoutMs)?o:4e3}}),Ee=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let Ne=null,De=null,ze=!1,Ve=800,Re=null,Ke=0,We=!0;function Xe(e,n){const t=null==n?void 0:n.timeoutMs,o=null==n?void 0:n.signal;if(null==o?void 0:o.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let l=null,r=!1,a=null;return new Promise((n,i)=>{const s=()=>{null!=l&&clearTimeout(l),a&&o&&o.removeEventListener("abort",a)};t&&t>0&&(l=globalThis.setTimeout(()=>{r||(r=!0,s(),i(new Error("Operation timed out")))},t)),o&&(a=()=>{r||(r=!0,s(),i(new DOMException("Aborted","AbortError")))},o.addEventListener("abort",a)),e().then(e=>{r||(r=!0,s(),n(e))}).catch(e=>{r||(r=!0,s(),i(e))})})}function Ze(e){if("undefined"==typeof document)return;if(!V.value)return;const n=document.createElement("div");n.className="text-red-500 p-4",n.textContent="Failed to render diagram: ";const t=document.createElement("span");t.textContent=e instanceof Error?e.message:"Unknown error",n.appendChild(t),x(V.value),V.value.appendChild(n),xe.value="360px",$e.value=!0,Mn()}function qe(e){return!e||e.disabled}function Ye(e,n,t="top"){if(qe(e.currentTarget))return;const o=e,r=null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0;Ae(e.currentTarget,n,t,!1,r,l.isDark)}function Ue(){Pe()}function Ge(e){if(qe(e.currentTarget))return;const n=S.value?j("common.copied")||"Copied":j("common.copy")||"Copy",t=e,o=null!=(null==t?void 0:t.clientX)&&null!=(null==t?void 0:t.clientY)?{x:t.clientX,y:t.clientY}:void 0;Ae(e.currentTarget,n,"top",!1,o,l.isDark)}function Je(e,n){const t=`%%{init: {"theme": "${"dark"===n?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:t+e}function Qe(){return We&&!se.value&&!Me.value&&!$e.value}function en(e){const n=e.split(/\r?\n/);for(;n.length>0;){const e=n[n.length-1].trimEnd();if(""!==e){if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;n.pop()}else n.pop()}return n.join("\n")}function nn(e,n,t){return u(this,null,function*(){var o;try{return yield eo(e,n,null!=(o=null==t?void 0:t.timeoutMs)?o:He.value.worker)}catch(l){return yield function(e,n,t){return u(this,null,function*(){var o,l;const r=yield $();if(!r)return;const a=r,i=Je(e,n);if("function"==typeof a.parse)return yield Xe(()=>a.parse(i),{timeoutMs:null!=(o=null==t?void 0:t.timeoutMs)?o:He.value.parse,signal:null==t?void 0:t.signal}),!0;const s=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield Xe(()=>r.render(s,i),{timeoutMs:null!=(l=null==t?void 0:t.timeoutMs)?l:He.value.render,signal:null==t?void 0:t.signal}),!0})}(e,n,t)}})}"undefined"!=typeof window&&C(()=>P.value,e=>{var n;if(null==(n=X.value)||n.destroy(),X.value=null,!e)return void(Z.value=!1);const t=W(e,{rootMargin:"400px"});X.value=t,Z.value=t.isVisible.value,t.whenVisible.then(()=>{Z.value=!0})},{immediate:!0}),B(()=>{var e;null==(e=X.value)||e.destroy(),X.value=null});const tn=L(()=>se.value||ce.value||A.value);function on(e){if(!P.value||!V.value)return;const n=V.value.querySelector("svg");if(!n)return;let t=0,o=0;const l=n.getAttribute("viewBox"),r=n.getAttribute("width"),a=n.getAttribute("height");if(l){const e=l.split(" ");4===e.length&&(t=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(t&&o||r&&a&&(t=Number.parseFloat(r),o=Number.parseFloat(a)),Number.isNaN(t)||Number.isNaN(o)||t<=0||o<=0)try{const e=n.getBBox();e&&e.width>0&&e.height>0&&(t=e.width,o=e.height)}catch(i){return void console.error("Failed to get SVG BBox:",i)}if(t>0&&o>0){const n=o/t;let l=(null!=e?e:P.value.clientWidth)*n;l>o&&(l=o),xe.value=`${l}px`}}const ln=M(!1),rn=L(()=>({transform:`translate(${le.value}px, ${re.value}px) scale(${oe.value})`}));function an(e){"Escape"===e.key&&ln.value&&sn()}function sn(){if(ln.value=!1,O.value&&x(O.value),K.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",an)}catch(e){}}function un(){oe.value<3&&(oe.value+=.1)}function cn(){oe.value>.5&&(oe.value-=.1)}function dn(){oe.value=1,le.value=0,re.value=0}function vn(e){ae.value=!0,e instanceof MouseEvent?ie.value={x:e.clientX-le.value,y:e.clientY-re.value}:ie.value={x:e.touches[0].clientX-le.value,y:e.touches[0].clientY-re.value}}function mn(e){if(!ae.value)return;let n,t;e instanceof MouseEvent?(n=e.clientX,t=e.clientY):(n=e.touches[0].clientX,t=e.touches[0].clientY),le.value=n-ie.value.x,re.value=t-ie.value.y}function hn(){ae.value=!1}function pn(e){if(l.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!P.value)return;const n=P.value.getBoundingClientRect(),t=e.clientX-n.left,o=e.clientY-n.top,l=t-n.width/2,r=o-n.height/2,a=(l-le.value)/oe.value,i=(r-re.value)/oe.value,s=.01,u=-e.deltaY*s,c=Math.min(Math.max(oe.value+u,.5),3);c!==oe.value&&(le.value=l-a*c,re.value=r-i*c,oe.value=c)}}function gn(){return u(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(te.value)),S.value=!0,r("copy",te.value),setTimeout(()=>{S.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})}function fn(){var e;const n=null==(e=V.value)?void 0:e.querySelector("svg");if(!n)return void console.error("SVG element not found");const t=(new XMLSerializer).serializeToString(n),o={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:t};r("export",o),o.defaultPrevented||function(e,n=null){u(this,null,function*(){try{const o=null!=n?n:(new XMLSerializer).serializeToString(e),l=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(l);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(t){}URL.revokeObjectURL(r)}}catch(o){console.error("Failed to export SVG:",o)}})}(n,t)}function wn(){var e,n;const t=null!=(n=null==(e=V.value)?void 0:e.querySelector("svg"))?n:null,o=t?(new XMLSerializer).serializeToString(t):null,l={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:t,svgString:o};r("openModal",l),l.defaultPrevented||function(){if(ln.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",an)}catch(e){}q(()=>{if(P.value&&O.value){const e=P.value.cloneNode(!0);e.classList.add("fullscreen");const n=e.querySelector("[data-mermaid-wrapper]");n&&(K.value=n,n.style.transform=rn.value.transform),x(O.value),O.value.appendChild(e)}})}()}function yn(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};r("toggleMode",e,n),n.defaultPrevented||kn(e)}function kn(e){return u(this,null,function*(){const n=ne.value;if(!n)return ue.value=!0,void(se.value="source"===e);const t=n.getBoundingClientRect().height;n.style.height=`${t}px`,n.style.overflow="hidden",ue.value=!0,se.value="source"===e,yield q();const o=n.scrollHeight;n.style.transition="height 180ms ease",n.offsetHeight,n.style.height=`${o}px`;const l=()=>{n.style.transition="",n.style.height="",n.style.overflow="",n.removeEventListener("transitionend",r)};function r(){l()}n.addEventListener("transitionend",r),setTimeout(()=>l(),220)})}function xn(){return u(this,null,function*(){return ce.value?de.value:V.value||(yield q(),V.value)?(ce.value=!0,de.value=u(null,null,function*(){var e;V.value&&(V.value.style.opacity="0");try{const n=yield $();if(!n)return;const t=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;Me.value||_e.value||null==(e=n.initialize)||e.call(n,s(i({},v.value),{dompurifyConfig:i({},a)}));const o=function(e,n=te.value){const t=n,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return t.trim().startsWith("%%{")?t:o+t}(l.isDark?"dark":"light"),r=yield Xe(()=>n.render(t,o),{timeoutMs:He.value.fullRender}),u=null==r?void 0:r.svg;if(V.value){const e=I(V.value,u);Me.value||_e.value||(on(),Me.value=!0,Se.value={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:xe.value});const n=l.isDark?"dark":"light";e&&(Ce.value[n]=e),_e.value&&(_e.value=!1),$e.value=!1,ge=0,ye()}}catch(n){const e=function(e){const n="string"==typeof e?e:"string"==typeof(null==e?void 0:e.message)?e.message:"";return"string"==typeof n&&/timed out/i.test(n)}(n),t=ge+1;e&&t<=3?(ge=t,ke(Math.min(1200,600*t))):(ge=0,ye(),console.error("Failed to render mermaid diagram:",n),!1===l.loading&&Ze(n))}finally{yield q(),V.value&&(V.value.style.opacity="1"),ce.value=!1,de.value=null}}),de.value):void console.warn("Mermaid container not ready")})}function bn(){return u(this,null,function*(){var e,n;const t=Date.now(),o=++Ie.value;je&&je.abort(),je=new AbortController;const r=je.signal,a=l.isDark?"dark":"light",i=te.value,s=i.replace(/\s+/g,"");if(!i.trim())return V.value&&x(V.value),Be.value=null,Te.value="",void($e.value=!1);if(s===Te.value)return;try{const c=yield function(e,n,t){return u(this,null,function*(){var o;try{if(yield nn(e,n,t))return{fullOk:!0,prefixOk:!1}}catch(r){if("AbortError"===(null==r?void 0:r.name))throw r}let l=en(e);if(l&&l.trim()&&l!==e)try{try{const r=yield no(e,n,null!=(o=null==t?void 0:t.timeoutMs)?o:He.value.worker);r&&r.trim()&&(l=r)}catch(r){}if(yield nn(l,n,t))return{fullOk:!1,prefixOk:!0,prefix:l}}catch(r){if("AbortError"===(null==r?void 0:r.name))throw r}return{fullOk:!1,prefixOk:!1}})}(i,a,{signal:r,timeoutMs:He.value.worker});if(c.fullOk)return yield xn(),void(Ie.value===o&&(Be.value=null!=(n=null==(e=V.value)?void 0:e.innerHTML)?n:null,Te.value=s,$e.value=!1));const d=Ke&&t<=Ke;if(c.prefixOk&&c.prefix&&Qe()&&!d)return void(yield function(e){return u(this,null,function*(){if(Qe()&&(V.value||(yield q(),V.value))&&!ce.value){ce.value=!0;try{const n=yield $();if(!n)return;const t=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,o=l.isDark?"dark":"light",r=en(e),a=Je(r&&r.trim()?r:e,o);V.value&&(V.value.style.opacity="0");const i=yield Xe(()=>n.render(t,a),{timeoutMs:He.value.render}),s=null==i?void 0:i.svg;V.value&&s&&(I(V.value,s),on())}catch(n){}finally{yield q(),V.value&&(V.value.style.opacity="1"),ce.value=!1}}})}(c.prefix))}catch(d){if("AbortError"===(null==d?void 0:d.name))return}if(Ie.value!==o)return;if($e.value)return;const c=Ce.value[a];c&&V.value&&I(V.value,c)})}function Mn(){ze&&(ze=!1,Ve=800,We=!1,Re&&(Re.abort(),Re=null),Ne&&(globalThis.clearTimeout(Ne),Ne=null),De&&(Ee(De),De=null),Ke=Date.now())}function _n(){if(Mn(),je){try{je.abort()}catch(e){}je=null}if(Re){try{Re.abort()}catch(e){}Re=null}to(),ye(),ge=0}function Cn(e=800){ze&&(Ne&&globalThis.clearTimeout(Ne),Ne=globalThis.setTimeout(()=>{De=fe(()=>u(null,null,function*(){if(!ze)return;if(se.value||Me.value)return void Mn();const e=l.isDark?"dark":"light",n=te.value;if(n.trim()){Re&&Re.abort(),Re=new AbortController;try{if((yield nn(n,e,{signal:Re.signal,timeoutMs:He.value.worker}))&&(yield xn(),Me.value))return void Mn()}catch(t){}Ve=Math.min(Math.floor(1.5*Ve),4e3),Cn(Ve)}else Cn(Ve)}),{timeout:500})},e))}function Bn(){ze||se.value||Me.value||(ze=!0,Ke=0,We=!0,Cn(500))}C(rn,e=>{ln.value&&K.value&&(K.value.style.transform=e.transform)},{immediate:!0}),C(()=>te.value,()=>{Me.value=!1,Ce.value={},we(),!se.value&&c.value&&Bn(),function(){if(!se.value)return;if(!c.value)return;const e=te.value.length;e!==ve.value&&(me.value=!0,ve.value=e,he&&clearTimeout(he),he=setTimeout(()=>{me.value&&se.value&&te.value.trim()&&(me.value=!1,kn("preview"))},500))}()}),C(()=>l.isDark,()=>u(null,null,function*(){if(!Me.value)return;if($e.value)return;const e=l.isDark?"dark":"light",n=Ce.value[e];if(n)return void(V.value&&I(V.value,n));const t={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:xe.value},o=1!==oe.value||0!==le.value||0!==re.value;_e.value=!0,o&&(oe.value=1,le.value=0,re.value=0,yield q()),yield xn(),o&&(yield q(),oe.value=t.zoom,le.value=t.translateX,re.value=t.translateY,xe.value=t.containerHeight,Se.value=t)})),C(()=>se.value,e=>u(null,null,function*(){if(e)Mn(),Me.value&&(Se.value={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:xe.value});else{if($e.value)return;const e=l.isDark?"dark":"light";if(Me.value&&Ce.value[e])return yield q(),V.value&&I(V.value,Ce.value[e]),oe.value=Se.value.zoom,le.value=Se.value.translateX,re.value=Se.value.translateY,void(xe.value=Se.value.containerHeight);if(yield q(),!c.value)return;yield bn(),Bn()}})),C(()=>l.loading,(e,n)=>u(null,null,function*(){if(!0===n&&!1===e){const e=te.value.trim();if(!e)return _n();const n=l.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(Me.value&&o===Te.value)return yield q(),V.value&&!V.value.querySelector("svg")&&Ce.value[n]&&I(V.value,Ce.value[n]),void _n();try{yield nn(e,n,{timeoutMs:He.value.worker}),yield xn(),Te.value=o,$e.value=!1,_n()}catch(t){_n(),Ze(t)}}})),C(P,e=>{be&&be.disconnect(),!e||Me.value||_e.value||(be=new ResizeObserver(e=>{e&&e.length>0&&!Me.value&&!_e.value&&Ht(()=>{on(e[0].contentRect.width)})}),be.observe(e))},{immediate:!0}),_(()=>u(null,null,function*(){yield q(),ue.value||(se.value=!c.value),Z.value&&(we(),ve.value=te.value.length)})),C(()=>c.value,e=>{ue.value||(se.value=!e)}),C(()=>Z.value,e=>{e&&(Me.value||(we(),ve.value=te.value.length),l.loading||Me.value||we())},{immediate:!1}),G(()=>{he&&clearTimeout(he),be&&be.disconnect(),je&&(je.abort(),je=null),to(),Mn(),ye()}),C(()=>A.value,e=>u(null,null,function*(){e?(Mn(),je&&je.abort()):Me.value||(yield q(),we(),se.value||Bn())}),{immediate:!1});const Tn=L(()=>l.isDark?"mermaid-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"mermaid-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700");return(e,n)=>(p(),h("div",{class:T(["my-4 rounded-lg border overflow-hidden shadow-sm",[l.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":l.loading}]])},[l.showHeader?(p(),h("div",{key:0,class:T(["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",l.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"])},[e.$slots["header-left"]?(p(),h("div",oo,[z(e.$slots,"header-left",{},void 0,!0)])):(p(),h("div",lo,[y("img",{src:w("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%3e%3cpath%20fill='none'%20stroke='%23ca9ee6'%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M1.5%202.5c0%206%202.25%205.75%204%207%20.83.67%201.17%202%201%204h3c-.17-2%20.17-3.33%201-4%201.75-1.25%204-1%204-7C12%202.5%2010%203%208%207%206%203%204%202.5%201.5%202.5'%20/%3e%3c/svg%3e"),class:"w-4 h-4 my-0",alt:"Mermaid"},null,8,ro),y("span",{class:T(["text-sm font-medium font-mono truncate",l.isDark?"text-gray-400":"text-gray-600"])},"Mermaid",2)])),e.$slots["header-center"]?(p(),h("div",ao,[z(e.$slots,"header-center",{},void 0,!0)])):l.showModeToggle&&c.value?(p(),h("div",{key:3,class:T(["flex items-center space-x-1 rounded-md p-0.5",l.isDark?"bg-gray-700":"bg-gray-100"])},[y("button",{class:T(["px-2.5 py-1 text-xs rounded transition-colors",[se.value?l.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":l.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"]]),onClick:n[0]||(n[0]=()=>yn("preview")),onMouseenter:n[1]||(n[1]=e=>Ye(e,w(j)("common.preview")||"Preview")),onFocus:n[2]||(n[2]=e=>Ye(e,w(j)("common.preview")||"Preview")),onMouseleave:Ue,onBlur:Ue},[y("div",io,[n[21]||(n[21]=y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),y("circle",{cx:"12",cy:"12",r:"3"})])],-1)),y("span",null,b(w(j)("common.preview")||"Preview"),1)])],34),y("button",{class:T(["px-2.5 py-1 text-xs rounded transition-colors",[se.value?l.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":l.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"]]),onClick:n[3]||(n[3]=()=>yn("source")),onMouseenter:n[4]||(n[4]=e=>Ye(e,w(j)("common.source")||"Source")),onFocus:n[5]||(n[5]=e=>Ye(e,w(j)("common.source")||"Source")),onMouseleave:Ue,onBlur:Ue},[y("div",so,[n[22]||(n[22]=y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"})],-1)),y("span",null,b(w(j)("common.source")||"Source"),1)])],34)],2)):H("",!0),e.$slots["header-right"]?(p(),h("div",uo,[z(e.$slots,"header-right",{},void 0,!0)])):(p(),h("div",co,[l.showCollapseButton?(p(),h("button",{key:0,class:T(Tn.value),"aria-pressed":A.value,onClick:n[6]||(n[6]=e=>A.value=!A.value),onMouseenter:n[7]||(n[7]=e=>Ye(e,A.value?w(j)("common.expand")||"Expand":w(j)("common.collapse")||"Collapse")),onFocus:n[8]||(n[8]=e=>Ye(e,A.value?w(j)("common.expand")||"Expand":w(j)("common.collapse")||"Collapse")),onMouseleave:Ue,onBlur:Ue},[(p(),h("svg",{style:D({rotate:A.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...n[23]||(n[23]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],42,vo)):H("",!0),l.showCopyButton?(p(),h("button",{key:1,class:T(Tn.value),onClick:gn,onMouseenter:n[9]||(n[9]=e=>Ge(e)),onFocus:n[10]||(n[10]=e=>Ge(e)),onMouseleave:Ue,onBlur:Ue},[S.value?(p(),h("svg",ho,[...n[25]||(n[25]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(p(),h("svg",mo,[...n[24]||(n[24]=[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),y("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],34)):H("",!0),l.showExportButton&&c.value?(p(),h("button",{key:2,class:T(`${Tn.value} ${tn.value?"opacity-50 cursor-not-allowed":""}`),disabled:tn.value,onClick:fn,onMouseenter:n[11]||(n[11]=e=>Ye(e,w(j)("common.export")||"Export")),onFocus:n[12]||(n[12]=e=>Ye(e,w(j)("common.export")||"Export")),onMouseleave:Ue,onBlur:Ue},[...n[26]||(n[26]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),y("path",{d:"m7 10l5 5l5-5"})])],-1)])],42,po)):H("",!0),l.showFullscreenButton&&c.value?(p(),h("button",{key:3,class:T(`${Tn.value} ${tn.value?"opacity-50 cursor-not-allowed":""}`),disabled:tn.value,onClick:wn,onMouseenter:n[13]||(n[13]=e=>Ye(e,ln.value?w(j)("common.minimize")||"Minimize":w(j)("common.open")||"Open")),onFocus:n[14]||(n[14]=e=>Ye(e,ln.value?w(j)("common.minimize")||"Minimize":w(j)("common.open")||"Open")),onMouseleave:Ue,onBlur:Ue},[ln.value?(p(),h("svg",wo,[...n[28]||(n[28]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(p(),h("svg",fo,[...n[27]||(n[27]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])]))],42,go)):H("",!0)]))],2)):H("",!0),Y(y("div",{ref_key:"modeContainerRef",ref:ne},[se.value?(p(),h("div",{key:0,class:T(["p-4",l.isDark?"bg-gray-900":"bg-gray-50"])},[y("pre",{class:T(["text-sm font-mono whitespace-pre-wrap",l.isDark?"text-gray-300":"text-gray-700"])},b(te.value),3)],2)):(p(),h("div",yo,[l.showZoomControls?(p(),h("div",ko,[y("div",xo,[y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:un,onMouseenter:n[15]||(n[15]=e=>Ye(e,w(j)("common.zoomIn")||"Zoom in")),onFocus:n[16]||(n[16]=e=>Ye(e,w(j)("common.zoomIn")||"Zoom in")),onMouseleave:Ue,onBlur:Ue},[...n[29]||(n[29]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("circle",{cx:"11",cy:"11",r:"8"}),y("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],34),y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:cn,onMouseenter:n[17]||(n[17]=e=>Ye(e,w(j)("common.zoomOut")||"Zoom out")),onFocus:n[18]||(n[18]=e=>Ye(e,w(j)("common.zoomOut")||"Zoom out")),onMouseleave:Ue,onBlur:Ue},[...n[30]||(n[30]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("circle",{cx:"11",cy:"11",r:"8"}),y("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],34),y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:dn,onMouseenter:n[19]||(n[19]=e=>Ye(e,w(j)("common.resetZoom")||"Reset zoom")),onFocus:n[20]||(n[20]=e=>Ye(e,w(j)("common.resetZoom")||"Reset zoom")),onMouseleave:Ue,onBlur:Ue},b(Math.round(100*oe.value))+"% ",35)])])):H("",!0),y("div",F({ref_key:"mermaidContainer",ref:P,class:["min-h-[360px] relative transition-all duration-100 overflow-hidden block",l.isDark?"bg-gray-900":"bg-gray-50"],style:{height:xe.value}},J(Le.value,!0),{onMousedown:vn,onMousemove:mn,onMouseup:hn,onMouseleave:hn,onTouchstartPassive:vn,onTouchmovePassive:mn,onTouchendPassive:hn}),[y("div",{"data-mermaid-wrapper":"",class:T(["absolute inset-0 cursor-grab",{"cursor-grabbing":ae.value}]),style:D(rn.value)},[y("div",{ref_key:"mermaidContent",ref:V,class:"_mermaid w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],16),(p(),R(Q,{to:"body"},[f(E,{name:"mermaid-dialog",appear:""},{default:N(()=>[ln.value?(p(),h("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:ee(sn,["self"])},[y("div",{class:T(["dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",l.isDark?"bg-gray-900":"bg-white"])},[y("div",bo,[y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:un},[...n[31]||(n[31]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("circle",{cx:"11",cy:"11",r:"8"}),y("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],2),y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:cn},[...n[32]||(n[32]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("circle",{cx:"11",cy:"11",r:"8"}),y("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],2),y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:dn},b(Math.round(100*oe.value))+"% ",3),y("button",{class:T(["inline-flex items-center justify-center p-2 rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:sn},[...n[33]||(n[33]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"})],-1)])],2)]),y("div",F({ref_key:"modalContent",ref:O,class:"w-full h-full flex items-center justify-center p-4 overflow-hidden"},J(Le.value,!0),{onMousedown:vn,onMousemove:mn,onMouseup:hn,onMouseleave:hn,onTouchstartPassive:vn,onTouchmovePassive:mn,onTouchendPassive:hn}),null,16)],2)])):H("",!0)]),_:1})]))]))],512),[[U,!A.value]])],2))}}),[["__scopeId","data-v-3636e700"]]);Mo.install=e=>{e.component(Mo.__name,Mo)};const _o=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:Mo},Symbol.toStringTag,{value:"Module"})),Co={key:0,class:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},Bo={class:"flex items-center space-x-2"},To=["innerHTML"],Io={class:"text-sm font-medium font-mono"},jo={class:"flex items-center space-x-2"},$o=["aria-pressed"],So=["disabled"],Lo=["disabled"],Ho=["disabled"],Eo=["aria-label"],No={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},Do={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},zo=["aria-pressed"],Ao={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},Po={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},Vo=["aria-label"],Ro=["innerHTML"],Oo={class:"code-loading-placeholder"},Ko=/* @__PURE__ */te(/* @__PURE__ */m({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(e,{emit:n}){var t;const o=e,l=n,{t:r}=Oe(),a=M(String(null!=(t=o.node.language)?t:"")),i=M(!1),s=M(!1),c=M(!1),d=M(null),v=M(null),m=M(""),g=M(!1);let f;const x=M(!0),B=M(0),I=M(14),j=M(I.value),$=L(()=>{const e=I.value,n=j.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof n&&Number.isFinite(n)&&n>0}),S=L(()=>{const e=a.value.trim().toLowerCase();return Lt[e]||e.charAt(0).toUpperCase()+e.slice(1)}),E=L(()=>"mermaid"===a.value.trim().toLowerCase()),N=L(()=>St(a.value.trim().toLowerCase().split(":")[0])),A=L(()=>{const e=a.value.trim().toLowerCase();return o.isShowPreview&&("html"===e||"svg"===e)}),P=L(()=>{const e={},n=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},t=n(o.minWidth),l=n(o.maxWidth);return t&&(e.minWidth=t),l&&(e.maxWidth=l),e}),V=L(()=>({fontSize:`${j.value}px`}));function O(){return o.isDark?o.darkTheme:o.lightTheme}function K(e){if(null==f||f.disconnect(),f=void 0,!e)return m.value="",void(g.value=!1);var n;m.value=`<pre class="shiki shiki-fallback"><code>${n=e,n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code></pre>`,g.value=!1}function F(){m.value="",g.value=!0}function W(){var e;const n=v.value;return!!n&&(n.childNodes.length>0||Boolean(null==(e=n.textContent)?void 0:e.trim().length))}function X(){return u(this,null,function*(){if(yield q(),W())return void F();const e=v.value;e&&(null==f||f.disconnect(),f=new MutationObserver(()=>{W()&&(F(),null==f||f.disconnect(),f=void 0)}),f.observe(e,{childList:!0,subtree:!0}))})}let Z,G,J,Q,ee=()=>{};const ne=/* @__PURE__ */new Set,te=/* @__PURE__ */new Set,oe=void 0!==import.meta&&Boolean(!1);function le(e,n){return u(this,null,function*(){if(!Z)return;const t=function(e,n=!1){var t;const[o]=String(null!=e?e:"").split(":"),l=null!=(t=null==o?void 0:o.trim().toLowerCase())?t:"";return l?!Q||Q.has(l)?l:(n&&oe&&!ne.has(l)&&(ne.add(l),console.warn(`[MarkdownCodeBlockNode] Language "${l}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}(n,Boolean(e&&e.length));try{yield Z.updateCode(e,t)}catch(o){"plaintext"!==t?(oe&&!te.has(t)&&(te.add(t),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${t}", retrying as plaintext.`,o)),yield Z.updateCode(e,"plaintext")):oe&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o)}})}function re(){return u(this,null,function*(){if(E.value)return ee(),null==Z||Z.dispose(),Z=void 0,void(g.value=!1);yield function(){return u(this,null,function*(){if(!G)try{const e=yield import("stream-markdown");G=e.createShikiStreamRenderer,J=e.registerHighlight,ee=e.disposeHighlighter;const n=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;Q=n?new Set(n.map(e=>e.toLowerCase())):void 0,null==J||J({themes:o.themes})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}(),d.value&&v.value?(null==J||J({themes:o.themes}),!Z&&G&&(Z=G(v.value,{theme:O()}),g.value=!0),Z?!1===o.stream&&o.loading?K(o.node.code):(K(o.node.code),yield le(o.node.code,a.value),yield X()):K(o.node.code)):K(o.node.code)})}re(),_(()=>{re()}),C(()=>o.themes,()=>u(null,null,function*(){J&&J({themes:o.themes})})),C(()=>o.loading,e=>{e||re()}),C(()=>[o.node.code,o.node.language],e=>u(null,[e],function*([e,n]){if(n!==a.value&&(a.value=n.trim()),d.value&&v.value){if(E.value)return ee(),void(null==Z||Z.dispose());Z||(K(e),yield re()),Z&&e&&(!1===o.stream&&o.loading||(K(e),yield le(e,n),yield X()))}else K(e)}));const ae=C(()=>[o.darkTheme,o.lightTheme],()=>u(null,null,function*(){if(d.value&&v.value){if(E.value)return ee(),null==Z||Z.dispose(),ae();Z||(yield re()),null==Z||Z.setTheme(O())}}));function ie(){const e=d.value;if(!e||s.value)return;const n=e.scrollTop;n<B.value?x.value=!1:function(e,n=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=n}(e)&&(x.value=!0),B.value=n}function se(){return u(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(o.node.code)),i.value=!0,l("copy",o.node.code),setTimeout(()=>{i.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function ue(e){return!e||e.disabled}function ce(e,n,t="top"){if(ue(e.currentTarget))return;const l=e,r=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0;Ae(e.currentTarget,n,t,!1,r,o.isDark)}function de(){Pe()}function ve(e){if(ue(e.currentTarget))return;const n=i.value?r("common.copied")||"Copied":r("common.copy")||"Copy",t=e,l=null!=(null==t?void 0:t.clientX)&&null!=(null==t?void 0:t.clientY)?{x:t.clientX,y:t.clientY}:void 0;Ae(e.currentTarget,n,"top",!1,l,o.isDark)}function me(){s.value=!s.value;const e=d.value;e&&(s.value?(e.style.maxHeight="none",e.style.overflow="visible"):(e.style.maxHeight="500px",e.style.overflow="auto",x.value=!0,q(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))}function he(){c.value=!c.value}function pe(){if(!A.value)return;const e=(a.value||o.node.language).toLowerCase(),n="html"===e?"HTML Preview":"SVG Preview";l("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:o.node.code,title:n})}return C(()=>o.node.code,()=>u(null,null,function*(){if(s.value||!x.value)return;yield q();const e=d.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(n,t)=>E.value?(p(),R(w(Mo),{key:0,node:e.node,"is-dark":o.isDark,loading:o.loading},null,8,["node","is-dark","loading"])):(p(),h("div",{key:1,style:D(P.value),class:T(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[o.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",o.isDark?"is-dark":""]])},[o.showHeader?(p(),h("div",Co,[z(n.$slots,"header-left",{},()=>[y("div",Bo,[y("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:N.value},null,8,To),y("span",Io,b(S.value),1)])],!0),z(n.$slots,"header-right",{},()=>[y("div",jo,[y("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":c.value,onClick:he,onMouseenter:t[0]||(t[0]=e=>ce(e,c.value?w(r)("common.expand")||"Expand":w(r)("common.collapse")||"Collapse")),onFocus:t[1]||(t[1]=e=>ce(e,c.value?w(r)("common.expand")||"Expand":w(r)("common.collapse")||"Collapse")),onMouseleave:de,onBlur:de},[(p(),h("svg",{style:D({rotate:c.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...t[17]||(t[17]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,$o),o.showFontSizeButtons&&o.enableFontSizeControl?(p(),h(k,{key:0},[y("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(j.value)&&j.value<=10,onClick:t[2]||(t[2]=e=>function(){const e=Math.max(10,j.value-1);j.value=e}()),onMouseenter:t[3]||(t[3]=e=>ce(e,w(r)("common.decrease")||"Decrease")),onFocus:t[4]||(t[4]=e=>ce(e,w(r)("common.decrease")||"Decrease")),onMouseleave:de,onBlur:de},[...t[18]||(t[18]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,So),y("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!$.value||j.value===I.value,onClick:t[5]||(t[5]=e=>{j.value=I.value}),onMouseenter:t[6]||(t[6]=e=>ce(e,w(r)("common.reset")||"Reset")),onFocus:t[7]||(t[7]=e=>ce(e,w(r)("common.reset")||"Reset")),onMouseleave:de,onBlur:de},[...t[19]||(t[19]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),y("path",{d:"M3 3v5h5"})])],-1)])],40,Lo),y("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(j.value)&&j.value>=36,onClick:t[8]||(t[8]=e=>function(){const e=Math.min(36,j.value+1);j.value=e}()),onMouseenter:t[9]||(t[9]=e=>ce(e,w(r)("common.increase")||"Increase")),onFocus:t[10]||(t[10]=e=>ce(e,w(r)("common.increase")||"Increase")),onMouseleave:de,onBlur:de},[...t[20]||(t[20]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,Ho)],64)):H("",!0),o.showCopyButton?(p(),h("button",{key:1,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":i.value?w(r)("common.copied")||"Copied":w(r)("common.copy")||"Copy",onClick:se,onMouseenter:t[11]||(t[11]=e=>ve(e)),onFocus:t[12]||(t[12]=e=>ve(e)),onMouseleave:de,onBlur:de},[i.value?(p(),h("svg",Do,[...t[22]||(t[22]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(p(),h("svg",No,[...t[21]||(t[21]=[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),y("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Eo)):H("",!0),o.showExpandButton?(p(),h("button",{key:2,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":s.value,onClick:me,onMouseenter:t[13]||(t[13]=e=>ce(e,s.value?w(r)("common.collapse")||"Collapse":w(r)("common.expand")||"Expand")),onFocus:t[14]||(t[14]=e=>ce(e,s.value?w(r)("common.collapse")||"Collapse":w(r)("common.expand")||"Expand")),onMouseleave:de,onBlur:de},[s.value?(p(),h("svg",Ao,[...t[23]||(t[23]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])):(p(),h("svg",Po,[...t[24]||(t[24]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])]))],40,zo)):H("",!0),A.value&&o.showPreviewButton?(p(),h("button",{key:3,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":w(r)("common.preview")||"Preview",onClick:pe,onMouseenter:t[15]||(t[15]=e=>ce(e,w(r)("common.preview")||"Preview")),onFocus:t[16]||(t[16]=e=>ce(e,w(r)("common.preview")||"Preview")),onMouseleave:de,onBlur:de},[...t[25]||(t[25]=[y("svg",{"data-v-3d59cc65":"",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),y("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,Vo)):H("",!0)])],!0)])):H("",!0),Y(y("div",{ref_key:"codeBlockContent",ref:d,class:"code-block-content",style:D(V.value),onScroll:ie},[y("div",{ref_key:"rendererTarget",ref:v,class:"code-block-render"},null,512),g.value?H("",!0):(p(),h("div",{key:0,class:"code-fallback-plain",innerHTML:m.value},null,8,Ro))],36),[[U,!(c.value||!e.stream&&e.loading)]]),Y(y("div",Oo,[z(n.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[t[26]||(t[26]=y("div",{class:"loading-skeleton"},[y("div",{class:"skeleton-line"}),y("div",{class:"skeleton-line"}),y("div",{class:"skeleton-line short"})],-1))],!0)],512),[[U,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-34bf55f7"]]);Ko.install=e=>{e.component(Ko.__name,Ko)};let Fo=null,Wo=null,Xo=!1;const Zo=/* @__PURE__ */new Map,qo=/* @__PURE__ */new Map;let Yo=5;const Uo=/* @__PURE__ */new Set;function Go(){if(Zo.size<Yo&&Uo.size){const n=Array.from(Uo);Uo.clear();for(const t of n)try{t()}catch(e){}}}function Jo(e){Fo=e,Wo=null,Fo.onmessage=e=>{const{id:n,html:t,error:o}=e.data,l=Zo.get(n);if(l)if(Zo.delete(n),clearTimeout(l.timeoutId),Go(),o)l.reject(new Error(o));else{const{content:n,displayMode:o}=e.data;if(n){const e=`${o?"d":"i"}:${n}`;if(qo.set(e,t),qo.size>200){const e=qo.keys().next().value;qo.delete(e)}}l.resolve(t)}},Fo.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[n,t]of Zo.entries())clearTimeout(t.timeoutId),t.reject(new Error(`Worker error: ${e.message}`));Zo.clear(),Go()}}function Qo(){var e;Fo&&(null==(e=Fo.terminate)||e.call(Fo)),Fo=null,Wo=null}function el(e){Xo=!!e,Fo&&Fo.postMessage({type:"init",debug:Xo})}function nl(e,n=!0,t=2e3,o){return u(this,null,function*(){if(performance.now(),!an()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(Wo)return Promise.reject(Wo);const l=`${n?"d":"i"}:${e}`,r=qo.get(l);if(r)return Promise.resolve(r);const a=Fo||(Wo=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Wo.name="WorkerInitError",Wo.code="WORKER_INIT_ERROR",null);if(!a)return Promise.reject(Wo);if(Zo.size>=Yo){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=Zo.size,e.max=Yo,Promise.reject(e)}return new Promise((l,r)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void r(e)}const i=Math.random().toString(36).slice(2),s=globalThis.setTimeout(()=>{Zo.delete(i);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",r(e),Go()},t);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),Zo.has(i)&&Zo.delete(i);const e=new Error("Aborted");e.name="AbortError",r(e),Go()},{once:!0});const u=l,c=r;Zo.set(i,{resolve:e=>{u(e)},reject:e=>{c(e)},timeoutId:s}),a.postMessage({id:i,content:e,displayMode:n})})})}function tl(e,n=!0,t){const o=`${n?"d":"i"}:${e}`;if(qo.set(o,t),qo.size>200){const e=qo.keys().next().value;qo.delete(e)}}function ol(){return{inFlight:Zo.size,max:Yo}}function ll(e){Number.isFinite(e)&&e>0&&(Yo=Math.floor(e))}const rl="WORKER_BUSY";function al(){return Zo.size>=Yo}function il(e=2e3,n){return Zo.size<Yo?Promise.resolve():new Promise((t,o)=>{let l,r=!1;const a=()=>{r||(r=!0,l&&globalThis.clearTimeout(l),Uo.delete(a),t())};if(Uo.add(a),l=globalThis.setTimeout(()=>{if(r)return;r=!0,Uo.delete(a);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>Go()),n){const e=()=>{if(r)return;r=!0,l&&globalThis.clearTimeout(l),Uo.delete(a);const e=new Error("Aborted");e.name="AbortError",o(e)};n.aborted?e():n.addEventListener("abort",e,{once:!0})}})}const sl={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function ul(e){null!=e.timeout&&(sl.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(sl.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(sl.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(sl.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function cl(){return i({},sl)}function dl(e){return u(this,arguments,function*(e,n=!0,t={}){var o,l,r,a;if(!an()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const i=null!=(o=t.timeout)?o:sl.timeout,s=null!=(l=t.waitTimeout)?l:sl.waitTimeout,u=null!=(r=t.backoffMs)?r:sl.backoffMs,c=null!=(a=t.maxRetries)?a:sl.maxRetries,d=t.signal;let v=0;for(;;){if(null==d?void 0:d.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield nl(e,n,i,d)}catch(m){if((null==m?void 0:m.code)!==rl||v>=c)throw m;if(v++,yield il(s,d).catch(()=>{}),null==d?void 0:d.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*v)))}}})}const vl=V(()=>import("./index4.js")),ml=V(()=>import("./index3.js")),hl=V(()=>import("./index2.js")),pl=V(()=>Promise.resolve().then(()=>_o)),gl={AdmonitionNode:xt,BlockquoteNode:oe,CheckboxNode:ae,CodeBlockNode:vl,DefinitionListNode:ce,EmojiNode:ve,FootnoteNode:On,FootnoteReferenceNode:xe,FootnoteAnchorNode:Pn,HardBreakNode:Fn,HeadingNode:Xn,HtmlInlineNode:be,HighlightNode:Nn,ImageNode:Je,InlineCodeNode:_e,PreCodeNode:Qn,InsertNode:Hn,LinkNode:Sn,ListItemNode:Zn,ListNode:qn,MathBlockNode:ml,MathInlineNode:hl,MermaidBlockNode:pl,ParagraphNode:Un,StrikethroughNode:Cn,StrongNode:Mn,SubscriptNode:xn,SuperscriptNode:wn,TableNode:rt,TextNode:vn,ThematicBreakNode:it,ReferenceNode:pn,MarkdownCodeBlockNode:Ko},fl={install(e,n){Object.entries(gl).forEach(([n,t])=>{e.component(n,t)}),(null==n?void 0:n.getLanguageIcon)&&Tt(n.getLanguageIcon),(null==n?void 0:n.mathOptions)&&v(n.mathOptions)}};export{on as $,xt as A,oe as B,ae as C,ce as D,ve as E,Pn as F,_e as G,Fn as H,Je as I,Hn as J,an as K,Vt as L,Sn as M,Zn as N,qn as O,Ko as P,ht as Q,ml as R,hl as S,pl as T,Un as U,pn as V,rl as W,fe as X,pe as Y,Re as Z,te as _,Fe as a,zt as a0,Cn as a1,Mn as a2,xn as a3,wn as a4,rt as a5,vn as a6,it as a7,fl as a8,Tt as a9,Jo as aa,Qo as ab,el as ac,nl as ad,ol as ae,ll as af,al as ag,il as ah,ul as ai,cl as aj,Xt as ak,Zt as al,qt as am,Yt as an,Ut as ao,Gt as ap,Jt as aq,eo as ar,no as as,to as at,St as b,Qn as c,Ae as d,dl as e,sn as f,Ct as g,Pe as h,tl as i,we as j,vl as k,Lt as l,rn as m,jt as n,Pt as o,ln as p,At as q,$t as r,Ht as s,On as t,Oe as u,xe as v,ge as w,Xn as x,Nn as y,be as z};
|
|
1
|
+
var e=Object.defineProperty,n=Object.defineProperties,t=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(n,t,o)=>t in n?e(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,i=(e,n)=>{for(var t in n||(n={}))l.call(n,t)&&a(e,t,n[t]);if(o)for(var t of o(n))r.call(n,t)&&a(e,t,n[t]);return e},s=(e,o)=>n(e,t(o)),u=(e,n,t)=>new Promise((o,l)=>{var r=e=>{try{i(t.next(e))}catch(n){l(n)}},a=e=>{try{i(t.throw(e))}catch(n){l(n)}},i=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,a);i((t=t.apply(e,n)).next())});import{getMarkdown as d,parseMarkdownToStructure as c,setDefaultMathOptions as m}from"stream-markdown-parser";import{defineComponent as v,createElementBlock as h,openBlock as p,withMemo as f,createVNode as g,unref as w,createElementVNode as y,Fragment as k,renderList as x,toDisplayString as b,ref as M,onMounted as _,watch as B,onBeforeUnmount as C,normalizeClass as T,createApp as I,h as L,inject as $,provide as j,computed as S,createCommentVNode as E,Transition as H,withCtx as N,normalizeStyle as z,renderSlot as D,shallowRef as P,readonly as A,defineAsyncComponent as R,createBlock as O,resolveDynamicComponent as V,useAttrs as K,mergeProps as W,isMemoSame as F,markRaw as U,reactive as X,nextTick as q,withDirectives as Z,vShow as G,onUnmounted as Y,toHandlers as J,Teleport as Q,withModifiers as ee}from"vue";const ne=["cite"],te=(e,n)=>{const t=e.__vccOpts||e;for(const[o,l]of n)t[o]=l;return t},oe=/* @__PURE__ */te(/* @__PURE__ */v({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(p(),h("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[f([n.node.children],()=>g(w(ft),{"index-key":`blockquote-${n.indexKey}`,nodes:n.node.children||[],"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],8,ne))}}),[["__scopeId","data-v-eeadc8a3"]]);oe.install=e=>{e.component(oe.__name,oe)};const le={class:"checkbox-node"},re=["checked"],ae=/* @__PURE__ */te(/* @__PURE__ */v({__name:"CheckboxNode",props:{node:{}},setup:e=>(n,t)=>(p(),h("span",le,[y("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,re)]))}),[["__scopeId","data-v-8dc6c46f"]]);ae.install=e=>{e.component(ae.__name,ae)};const ie={class:"definition-list"},se={class:"definition-term"},ue={class:"definition-desc"},de=/* @__PURE__ */te(/* @__PURE__ */v({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(e,t)=>(p(),h("dl",ie,[(p(!0),h(k,null,x(n.node.items,(o,l)=>(p(),h(k,{key:l},[y("dt",se,[g(w(ft),{"index-key":`definition-term-${n.indexKey}-${l}`,nodes:o.term,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[0]||(t[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])]),y("dd",ue,[g(w(ft),{"index-key":`definition-desc-${n.indexKey}-${l}`,nodes:o.definition,"custom-id":n.customId,typewriter:n.typewriter,onCopy:t[1]||(t[1]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),[["__scopeId","data-v-f88691d6"]]);de.install=e=>{e.component(de.__name,de)};const ce={class:"emoji-node"},me=/* @__PURE__ */te(/* @__PURE__ */v({__name:"EmojiNode",props:{node:{}},setup:e=>(n,t)=>(p(),h("span",ce,b(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);me.install=e=>{e.component(me.__name,me)};const ve="__global__",he={};function pe(e,n){"string"==typeof e?he[e]=n||{}:he[ve]=e||{}}function fe(e){return e?he[e]||he[ve]||{}:he[ve]||{}}function ge(e){if(e===ve)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete he[e]}function we(){delete he[ve]}const ye=["id"],ke=["title"],xe=/* @__PURE__ */te(/* @__PURE__ */v({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const n=`#footnote-${e.node.id}`;function t(){if("undefined"==typeof document)return;const e=document.querySelector(n);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}return(o,l)=>(p(),h("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:t},[y("span",{href:n,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+b(e.node.id)+"]",9,ke)],8,ye))}}),[["__scopeId","data-v-01af0fee"]]);xe.install=e=>{e.component(xe.__name,xe)};const be=/* @__PURE__ */te(/* @__PURE__ */v({__name:"HtmlInlineNode",props:{node:{}},setup(e){const n=e,t=M(null),o="undefined"!=typeof window;function l(){if(!o||!t.value)return;const e=t.value;e.innerHTML="";const l=document.createElement("template");l.innerHTML=n.node.content,e.appendChild(l.content.cloneNode(!0))}function r(){if(!t.value)return;const e=t.value;e.innerHTML="",e.textContent=n.node.content}return _(()=>{n.node.loading&&!n.node.autoClosed?r():l()}),B(()=>[n.node.content,n.node.loading,n.node.autoClosed],()=>{n.node.loading&&!n.node.autoClosed?r():l()}),C(()=>{t.value&&(t.value.innerHTML="")}),(e,o)=>(p(),h("span",{ref_key:"containerRef",ref:t,class:T(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},null,2))}}),[["__scopeId","data-v-e632756e"]]);be.install=e=>{e.component(be.__name,be)};const Me={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-secondary whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},_e=/* @__PURE__ */v({__name:"InlineCodeNode",props:{node:{}},setup:e=>(n,t)=>(p(),h("code",Me,b(e.node.code),1))});_e.install=e=>{e.component(_e.__name,_e)};const Be=M(!1),Ce=M(""),Te=M("top"),Ie=M(null),Le=M(null),$e=M(null),je=M(null),Se=M(null);let Ee=null,He=null;function Ne(){Ee&&(clearTimeout(Ee),Ee=null),He&&(clearTimeout(He),He=null)}let ze=!1,De=null;function Pe(e,n,t="top",o=!1,l,r){if(!e)return;ze||"undefined"!=typeof document&&(De||(De=import("./Tooltip.js").then(({default:e})=>{ze=!0;const n=document.createElement("div");n.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(n),I({setup:()=>()=>{var n;return L(e,{visible:Be.value,"anchor-el":Ie.value,content:Ce.value,placement:Te.value,id:Le.value,originX:$e.value,originY:je.value,isDark:null!=(n=Se.value)?n:void 0})}}).mount(n)}).catch(e=>{De=null,ze=!1,console.warn("[markstream-vue] Failed to load Tooltip component. Tooltips will be disabled.",e)}))),Ne();const a=()=>{var o,a;Le.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ie.value=e,Ce.value=n,Te.value=t,$e.value=null!=(o=null==l?void 0:l.x)?o:null,je.value=null!=(a=null==l?void 0:l.y)?a:null,Se.value="boolean"==typeof r?r:null,Be.value=!0;try{e.setAttribute("aria-describedby",Le.value)}catch(i){}};o?a():Ee=setTimeout(a,80)}function Ae(e=!1){Ne();const n=()=>{if(Ie.value&&Le.value)try{Ie.value.removeAttribute("aria-describedby")}catch(e){}Be.value=!1,Ie.value=null,Le.value=null,$e.value=null,je.value=null};e?n():He=setTimeout(n,120)}const Re={"common.copy":"Copy","common.copySuccess":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."};function Oe(e){Object.assign(Re,e)}function Ve(){try{const n=globalThis.$vueI18nUse||null;if(n&&"function"==typeof n)try{const e=n();if(e&&"function"==typeof e.t)return{t:e.t.bind(e)}}catch(e){}}catch(e){}return u(null,null,function*(){try{const n=yield import("vue-i18n"),t=n.useI18n||n.default&&n.default.useI18n;if(t&&"function"==typeof t)try{const n=t();if(n&&"function"==typeof n.t)try{globalThis.$vueI18nUse=()=>n}catch(e){}}catch(e){}}catch(e){}}),{t:e=>{var n;return null!=(n=Re[e])?n:function(e){return(e.split(".").pop()||e).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}(e)}}}const Ke=/* @__PURE__ */Symbol("ViewportPriority");function We(){const e=$(Ke,void 0);if(e)return e;const n=/* @__PURE__ */new WeakMap;let t=null;return e=>{const o=M(!1);let l,r=!1;const a=new Promise(e=>{l=()=>{r||(r=!0,e())}}),i=()=>{try{null==t||t.unobserve(e)}catch(o){}n.delete(e)},s=t||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(t=new IntersectionObserver(e=>{for(const l of e){const e=n.get(l.target);if(e&&(l.isIntersecting||l.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==t||t.unobserve(l.target),n.delete(l.target)}}},{root:null,rootMargin:"300px",threshold:0}),t));return s?(n.set(e,{resolve:l,visible:o}),s.observe(e),{isVisible:o,whenVisible:a,destroy:i}):(o.value=!0,l(),{isVisible:o,whenVisible:a,destroy:i})}}const Fe={class:"relative inline-block"},Ue=["src","alt","title","loading","tabindex","aria-label"],Xe={class:"text-sm whitespace-nowrap"},qe={key:1,class:"text-sm text-gray-500"},Ze={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},Ge={class:"text-sm whitespace-nowrap"},Ye={key:0,class:"mt-2 text-sm text-gray-500 italic"},Je=/* @__PURE__ */te(/* @__PURE__ */v({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},showCaption:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},svgMinHeight:{default:"12rem"},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:n}){const t=e,o=n,l=M(!1),r=M(!1),a=M(!1),i=M(null),s=We(),u=M(null),d=M("undefined"==typeof window);"undefined"!=typeof window&&B(()=>i.value,e=>{var n;if(null==(n=u.value)||n.destroy(),u.value=null,!e)return void(d.value=!1);const t=s(e,{rootMargin:"400px"});u.value=t,d.value=t.isVisible.value,t.whenVisible.then(()=>{d.value=!0})},{immediate:!0}),C(()=>{var e;null==(e=u.value)||e.destroy(),u.value=null});const c=S(()=>r.value&&t.fallbackSrc?t.fallbackSrc:t.node.src),m=S(()=>!t.lazy||d.value),v=S(()=>/\.svg(?:\?|$)/i.test(c.value));function f(){t.fallbackSrc&&!a.value?(a.value=!0,r.value=!0):(r.value=!0,o("error",t.node.src))}function k(){l.value=!0,r.value=!1,o("load",c.value)}function x(e){e.preventDefault(),l.value&&!r.value&&o("click",[e,c.value])}const{t:_}=Ve();return B(c,()=>{l.value=!1,r.value=!1}),(n,o)=>(p(),h("figure",{ref_key:"figureRef",ref:i,class:"text-center my-8"},[y("div",Fe,[g(H,{name:"img-switch",mode:"out-in"},{default:N(()=>{var a,i,s,u,d;return[e.node.loading||r.value||!m.value?r.value?e.node.loading||t.fallbackSrc?E("",!0):(p(),h("div",Ze,[D(n.$slots,"error",{node:t.node,displaySrc:c.value,imageLoaded:l.value,hasError:r.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:v.value},()=>[o[1]||(o[1]=y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[y("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),y("span",Ge,b(w(_)("image.loadError")),1)],!0)])):(p(),h("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:z(v.value?{minHeight:t.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[t.usePlaceholder?D(n.$slots,"placeholder",{key:0,node:t.node,displaySrc:c.value,imageLoaded:l.value,hasError:r.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:v.value},()=>[o[0]||(o[0]=y("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),y("span",Xe,b(w(_)("image.loading")),1)],!0):(p(),h("span",qe,b(e.node.raw),1))],4)):(p(),h("img",{key:"image",src:c.value,alt:String(null!=(i=null!=(a=t.node.alt)?a:t.node.title)?i:""),title:String(null!=(u=null!=(s=t.node.title)?s:t.node.alt)?u:""),class:T(["max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",{"opacity-0":!l.value,"opacity-100":l.value,"cursor-pointer":l.value}]),style:z(v.value?{minHeight:t.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:t.lazy?"lazy":"eager",decoding:"async",tabindex:l.value?0:-1,"aria-label":null!=(d=t.node.alt)?d:w(_)("image.preview"),onError:f,onLoad:k,onClick:x},null,46,Ue))]}),_:3})]),t.showCaption&&t.node.alt?(p(),h("figcaption",Ye,b(t.node.alt),1)):E("",!0)],512))}}),[["__scopeId","data-v-7ca79b66"]]);Je.install=e=>{e.component(Je.__name,Je)};let Qe=null,en=!1,nn=ln;function tn(e){var n;const t=null!=(n=null==e?void 0:e.default)?n:e;return t&&"function"==typeof t.renderToString?t:null}function on(){try{const e=globalThis;return tn(null==e?void 0:e.katex)}catch(e){return null}}function ln(){return u(null,null,function*(){const e=on();if(e)return e;const n=yield import("katex");try{yield import("katex/contrib/mhchem")}catch(t){}return tn(n)})}function rn(e){nn=e,Qe=null,en=!1}function an(e){rn(null!=e?e:ln)}function sn(){rn(null)}function un(){return"function"==typeof nn}function dn(){return u(this,null,function*(){var e;const n=on();if(n)return Qe=n,Qe;if(Qe)return Qe;if(en)return null;const t=nn;if(!t)return en=!0,null;try{const n=yield t();if(n)return Qe=null!=(e=tn(n))?e:n,Qe}catch(o){}return en=!0,null})}const cn=P(!1);let mn=null;function vn(){return mn||(mn=dn().then(e=>{cn.value=!!e}).catch(()=>{cn.value=!1})),A(cn)}const hn=/* @__PURE__ */te(/* @__PURE__ */v({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const n=vn();return(t,o)=>(p(),h("span",{class:T([[w(n)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},b(e.node.content),3))}}),[["__scopeId","data-v-56f30838"]]);hn.install=e=>{e.component(hn.__name,hn)};const pn=R(()=>u(null,null,function*(){var e,n;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(n=null==(e=globalThis.process)?void 0:e.env)?void 0:n.NODE_ENV))return e=>{var n,t;return L(hn,s(i({},e),{node:s(i({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))};try{if(yield dn())return(yield import("./index2.js")).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return e=>{var n,t;return L(hn,s(i({},e),{node:s(i({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))}})),fn=R(()=>u(null,null,function*(){try{if(yield dn())return(yield import("./index3.js")).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var n,t;return L(hn,s(i({},e),{node:s(i({},e.node),{content:null!=(t=e.node.raw)?t:`$$${null!=(n=e.node.content)?n:""}$$`})}))}})),gn=/* @__PURE__ */v({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(n,t)=>(p(),h("span",{class:"reference-node cursor-pointer bg-accent text-xs rounded-md px-1.5 mx-0.5 hover:bg-secondary",role:"button",tabindex:"0",onClick:t[0]||(t[0]=t=>n.$emit("click",t,e.node.id,e.messageId,e.threadId)),onMouseenter:t[1]||(t[1]=t=>n.$emit("mouseEnter",t,e.node.id,e.messageId,e.threadId)),onMouseleave:t[2]||(t[2]=t=>n.$emit("mouseLeave",t,e.node.id,e.messageId,e.threadId))},b(e.node.id),33))});gn.install=e=>{e.component(gn.__name,gn)};const wn={class:"superscript-node"},yn={key:1},kn=/* @__PURE__ */te(/* @__PURE__ */v({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=fe(n.customId),o=i({text:hn,inline_code:_e,link:En,html_inline:be,strong:Bn,emphasis:An,footnote_reference:xe,strikethrough:Tn,highlight:Dn,insert:Nn,subscript:Mn,emoji:me,math_inline:pn,reference:gn},t);return(t,l)=>(p(),h("sup",wn,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),h(k,{key:`${e.indexKey||"superscript"}-${l}`},[o[t.type]?(p(),O(V(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"superscript"}-${l}`},null,8,["node","custom-id","index-key"])):(p(),h("span",yn,b(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-6dc1e3ba"]]);kn.install=e=>{e.component(kn.__name,kn)};const xn={class:"subscript-node"},bn={key:1},Mn=/* @__PURE__ */te(/* @__PURE__ */v({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=fe(n.customId),o=i({text:hn,inline_code:_e,link:En,html_inline:be,strong:Bn,emphasis:An,footnote_reference:xe,strikethrough:Tn,highlight:Dn,insert:Nn,superscript:kn,emoji:me,math_inline:pn,reference:gn},t);return(t,l)=>(p(),h("sub",xn,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),h(k,{key:`${e.indexKey||"subscript"}-${l}`},[o[t.type]?(p(),O(V(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"subscript"}-${l}`},null,8,["node","custom-id","index-key"])):(p(),h("span",bn,b(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-69de9b81"]]);Mn.install=e=>{e.component(Mn.__name,Mn)};const _n={class:"strong-node"},Bn=/* @__PURE__ */te(/* @__PURE__ */v({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=fe(n.customId),o=i({text:hn,inline_code:_e,link:En,html_inline:be,emphasis:An,strikethrough:Tn,highlight:Dn,insert:Nn,subscript:Mn,superscript:kn,emoji:me,footnote_reference:xe,math_inline:pn,reference:gn},t);return(t,l)=>(p(),h("strong",_n,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),O(V(o[t.type]),{key:`${e.indexKey||"strong"}-${l}`,"index-key":`${e.indexKey||"strong"}-${l}`,node:t,"custom-id":n.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-af3ce037"]]);Bn.install=e=>{e.component(Bn.__name,Bn)};const Cn={class:"strikethrough-node"},Tn=/* @__PURE__ */te(/* @__PURE__ */v({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=fe(n.customId),o=i({text:hn,inline_code:_e,link:En,html_inline:be,strong:Bn,emphasis:An,highlight:Dn,insert:Nn,subscript:Mn,superscript:kn,emoji:me,footnote_reference:xe,math_inline:pn,reference:gn},t);return(t,l)=>(p(),h("del",Cn,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),O(V(o[t.type]),{key:`${e.indexKey||"strikethrough"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-904d5bd1"]]);Tn.install=e=>{e.component(Tn.__name,Tn)};const In=["href","title","aria-label","aria-hidden"],Ln=["aria-hidden"],$n={class:"link-text-wrapper relative inline-flex"},jn={class:"leading-[normal] link-text"},Sn={class:"leading-[normal] link-text"},En=/* @__PURE__ */te(/* @__PURE__ */v({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const n=e,t=S(()=>{var e,t,o,l,r,a;const i=void 0!==n.underlineBottom?"number"==typeof n.underlineBottom?`${n.underlineBottom}px`:String(n.underlineBottom):"-3px";return{"--link-color":null!=(e=n.color)?e:"#0366d6","--underline-height":`${null!=(t=n.underlineHeight)?t:2}px`,"--underline-bottom":i,"--underline-opacity":String(null!=(o=n.animationOpacity)?o:.9),"--underline-duration":`${null!=(l=n.animationDuration)?l:.8}s`,"--underline-timing":null!=(r=n.animationTiming)?r:"linear","--underline-iteration":"number"==typeof n.animationIteration?String(n.animationIteration):null!=(a=n.animationIteration)?a:"infinite"}}),o={text:hn,strong:Bn,strikethrough:Tn,emphasis:An,image:Je,html_inline:be},l=K();function r(){n.showTooltip&&Ae()}const a=S(()=>{var e,t;return String(null!=(t=null!=(e=n.node.title)?e:n.node.href)?t:"")});return(i,s)=>e.node.loading?(p(),h("span",W({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},w(l),{style:t.value}),[y("span",$n,[y("span",jn,[y("span",Sn,b(e.node.text),1)]),s[1]||(s[1]=y("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,Ln)):(p(),h("a",W({key:0,class:"link-node",href:e.node.href,title:e.showTooltip?"":a.value,"aria-label":`Link: ${a.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},w(l),{style:t.value,onMouseenter:s[0]||(s[0]=e=>function(e){var t,o,l;if(!n.showTooltip)return;const r=e,a=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0,i=(null==(t=n.node)?void 0:t.title)||(null==(o=n.node)?void 0:o.href)||(null==(l=n.node)?void 0:l.text)||"";Pe(e.currentTarget,i,"top",!1,a)}(e)),onMouseleave:r}),[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),O(V(o[t.type]),{key:`${e.indexKey||"emphasis"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"link-text"}-${l}`},null,8,["node","custom-id","index-key"]))),128))],16,In))}}),[["__scopeId","data-v-0753b32c"]]);En.install=e=>{e.component(En.__name,En)};const Hn={class:"insert-node"},Nn=/* @__PURE__ */te(/* @__PURE__ */v({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=fe(n.customId),o=i({text:hn,inline_code:_e,link:En,html_inline:be,strong:Bn,emphasis:An,strikethrough:Tn,highlight:Dn,subscript:Mn,superscript:kn,emoji:me,footnote_reference:xe,math_inline:pn,reference:gn},t);return(t,l)=>(p(),h("ins",Hn,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),O(V(o[t.type]),{key:`${e.indexKey||"insert"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-ab1ec9bc"]]);Nn.install=e=>{e.component(Nn.__name,Nn)};const zn={class:"highlight-node"},Dn=/* @__PURE__ */te(/* @__PURE__ */v({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=fe(n.customId),o=i({text:hn,inline_code:_e,link:En,html_inline:be,strong:Bn,emphasis:An,strikethrough:Tn,insert:Nn,subscript:Mn,superscript:kn,emoji:me,footnote_reference:xe,math_inline:pn,reference:gn},t);return(t,l)=>(p(),h("mark",zn,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),O(V(o[t.type]),{key:`${e.indexKey||"highlight"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-38e31bf6"]]);Dn.install=e=>{e.component(Dn.__name,Dn)};const Pn={class:"emphasis-node"},An=/* @__PURE__ */te(/* @__PURE__ */v({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=fe(n.customId),o=i({text:hn,inline_code:_e,link:En,html_inline:be,strong:Bn,strikethrough:Tn,highlight:Dn,insert:Nn,subscript:Mn,superscript:kn,emoji:me,footnote_reference:xe,math_inline:pn,reference:gn},t);return(t,l)=>(p(),h("em",Pn,[(p(!0),h(k,null,x(e.node.children,(t,l)=>(p(),O(V(o[t.type]),{key:`${e.indexKey||"emphasis"}-${l}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8264674d"]]);An.install=e=>{e.component(An.__name,An)};const Rn=["href","title"],On=/* @__PURE__ */te(/* @__PURE__ */v({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const n=e;function t(e){var t;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(t=n.node.id)?t:"")}`,l=document.getElementById(o);l&&l.scrollIntoView({behavior:"smooth"})}return(n,o)=>(p(),h("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:t}," ↩︎ ",8,Rn))}}),[["__scopeId","data-v-4756ce0d"]]);On.install=e=>{e.component(On.__name,On)};const Vn=["id"],Kn={class:"flex-1"},Wn=/* @__PURE__ */v({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(p(),h("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[y("div",Kn,[f([n.node.children],()=>g(w(ft),{"index-key":`footnote-${n.indexKey}`,nodes:n.node.children,"custom-id":n.customId,typewriter:n.typewriter,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)])],8,Vn))}});Wn.install=e=>{e.component(Wn.__name,Wn)};const Fn={class:"hard-break"},Un=/* @__PURE__ */te(/* @__PURE__ */v({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,n)=>(p(),h("br",Fn))}),[["__scopeId","data-v-50c58f70"]]);Un.install=e=>{e.component(Un.__name,Un)};const Xn=/* @__PURE__ */te(/* @__PURE__ */v({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=fe(n.customId),o=i({text:hn,inline_code:_e,link:En,image:Je,strong:Bn,emphasis:An,strikethrough:Tn,highlight:Dn,insert:Nn,subscript:Mn,superscript:kn,emoji:me,checkbox:ae,checkbox_input:ae,footnote_reference:xe,hardbreak:Un,math_inline:pn,reference:gn},t);return(t,l)=>f([e.node.children],()=>(p(),O(V(`h${e.node.level}`),{class:T(["heading-node",[`heading-${e.node.level}`]]),dir:"auto"},{default:N(()=>[(p(!0),h(k,null,x(e.node.children,(t,l,r,a)=>{const i=[t];if(a&&a.key===`${e.indexKey||"heading"}-${l}`&&F(a,i))return a;const s=(p(),O(V(o[t.type]),{key:`${e.indexKey||"heading"}-${l}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"heading"}-${l}`},null,8,["custom-id","node","index-key"]));return s.memo=i,s},l,0),128))]),_:1},8,["class"])),l,2)}}),[["__scopeId","data-v-e3e7e2ce"]]),qn=Xn;qn.install=e=>{e.component(Xn.__name,Xn)};const Zn=/* @__PURE__ */te(/* @__PURE__ */v({__name:"ListItemNode",props:{item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const n=e,t=S(()=>null==n.value?{}:{value:n.value});return(e,o)=>(p(),h("li",W({class:"list-item pl-1.5 my-2",dir:"auto"},t.value),[f([n.item.children],()=>g(w(ft),{"index-key":`list-item-${n.indexKey}`,nodes:n.item.children,"custom-id":n.customId,typewriter:n.typewriter,"batch-rendering":!1,onCopy:o[0]||(o[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"]),o,1)],16))}}),[["__scopeId","data-v-7a618746"]]);Zn.install=e=>{e.component(Zn.__name,Zn)};const Gn=/* @__PURE__ */te(/* @__PURE__ */v({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup:e=>(n,t)=>(p(),O(V(e.node.ordered?"ol":"ul"),{class:T(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:N(()=>[(p(!0),h(k,null,x(e.node.items,(o,l,r,a)=>{var i;const s=[o];if(a&&a.key===`${e.indexKey||"list"}-${l}`&&F(a,s))return a;const u=(p(),O(w(Zn),{key:`${e.indexKey||"list"}-${l}`,item:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${l}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(i=e.node.start)?i:1)+l:void 0,onCopy:t[0]||(t[0]=e=>n.$emit("copy",e))},null,8,["item","custom-id","index-key","typewriter","value"]));return u.memo=s,u},t,1),128))]),_:1},8,["class"]))}),[["__scopeId","data-v-79057d57"]]);Gn.install=e=>{e.component(Gn.__name,Gn)};const Yn={dir:"auto",class:"paragraph-node"},Jn=/* @__PURE__ */te(/* @__PURE__ */v({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=fe(n.customId),o=i({inline_code:_e,image:Je,link:En,hardbreak:Un,emphasis:An,strong:Bn,strikethrough:Tn,highlight:Dn,insert:Nn,subscript:Mn,superscript:kn,html_inline:be,emoji:me,checkbox:ae,math_inline:pn,checkbox_input:ae,reference:gn,footnote_anchor:On,footnote_reference:xe},t),l=vn();return(t,r)=>(p(),h("p",Yn,[(p(!0),h(k,null,x(e.node.children,(t,r)=>(p(),h(k,{key:`${e.indexKey||"paragraph"}-${r}`},["text"!==t.type?(p(),O(V(o[t.type]),{key:0,node:t,"index-key":`${e.indexKey}-${r}`,"custom-id":n.customId},null,8,["node","index-key","custom-id"])):(p(),h("span",{key:1,class:T([[w(l)&&t.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},b(t.content),3))],64))),128))]))}}),[["__scopeId","data-v-0117537a"]]);Jn.install=e=>{e.component(Jn.__name,Jn)};const Qn=["aria-busy","aria-label","data-language"],et=["textContent"],nt=/* @__PURE__ */v({__name:"PreCodeNode",props:{node:{}},setup(e){const n=e,t=S(()=>{var e,t,o;const l=String(null!=(t=null==(e=n.node)?void 0:e.language)?t:"");return String(null!=(o=String(l).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=S(()=>`language-${t.value}`),l=S(()=>{const e=t.value;return e?`Code block: ${e}`:"Code block"});return(n,r)=>(p(),h("pre",{class:T([o.value]),"aria-busy":!0===e.node.loading,"aria-label":l.value,"data-language":t.value,tabindex:"0"},[y("code",{translate:"no",textContent:b(e.node.code)},null,8,et)],10,Qn))}});nt.install=e=>{e.component(nt.__name,nt)};const tt={class:"table-node-wrapper"},ot=["aria-busy"],lt={class:"border-[var(--table-border,#cbd5e1)]"},rt={class:"border-b"},at={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},it=/* @__PURE__ */te(/* @__PURE__ */v({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e,t=S(()=>{var e,t,o,l;return null!=(l=null==(o=null==(t=null==(e=n.node)?void 0:e.header)?void 0:t.cells)?void 0:o.length)?l:0}),o=S(()=>{const e=t.value||1,n=Math.floor(100/e);return Array.from({length:e}).map((t,o)=>o===e-1?100-n*(e-1)+"%":`${n}%`)}),l=S(()=>{var e;return null!=(e=n.node.loading)&&e}),r=S(()=>{var e;return null!=(e=n.node.rows)?e:[]});return(t,a)=>(p(),h("div",tt,[y("table",{class:T(["w-full my-8 text-sm table-fixed table-node",{"table-node--loading":l.value}]),"aria-busy":l.value},[y("colgroup",null,[(p(!0),h(k,null,x(o.value,(e,n)=>(p(),h("col",{key:`col-${n}`,style:z({width:e})},null,4))),128))]),y("thead",lt,[y("tr",rt,[(p(!0),h(k,null,x(e.node.header.cells,(e,o)=>(p(),h("th",{key:`header-${o}`,dir:"auto",class:T(["font-semibold p-[calc(4/7*1em)] overflow-x-auto",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]])},[g(w(ft),{nodes:e.children,"index-key":`table-th-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:a[0]||(a[0]=e=>t.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),y("tbody",null,[(p(!0),h(k,null,x(r.value,(e,o)=>(p(),h("tr",{key:`row-${o}`,class:T(["border-[var(--table-border,#cbd5e1)]",[o<r.value.length-1?"border-b":""]])},[(p(!0),h(k,null,x(e.cells,(e,l)=>(p(),h("td",{key:`cell-${o}-${l}`,class:T(["p-[calc(4/7*1em)] overflow-x-auto",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]]),dir:"auto"},[g(w(ft),{nodes:e.children,"index-key":`table-td-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:a[1]||(a[1]=e=>t.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,ot),g(H,{name:"table-node-fade"},{default:N(()=>[l.value?(p(),h("div",at,[D(t.$slots,"loading",{isLoading:l.value},()=>[a[2]||(a[2]=y("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),a[3]||(a[3]=y("span",{class:"sr-only"},"Loading",-1))],!0)])):E("",!0)]),_:3})]))}}),[["__scopeId","data-v-a874491c"]]);it.install=e=>{e.component(it.__name,it)};const st={class:"hr-node"},ut=/* @__PURE__ */te({},[["render",function(e,n){return p(),h("hr",st)}],["__scopeId","data-v-639cbad9"]]);ut.install=e=>{e.component(ut.__name,ut)};const dt={class:"unknown-node"},ct=/* @__PURE__ */v({__name:"FallbackComponent",props:{node:{}},setup:e=>(n,t)=>(p(),h("div",dt,b(e.node.raw),1))}),mt=/* @__PURE__ */te(/* @__PURE__ */v({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},setup(e){const n=e,t=S(()=>`vmr-container vmr-container-${n.node.name}`),o=fe(n.customId),l=i({text:hn,paragraph:Jn,heading:qn,inline_code:_e,link:En,image:Je,strong:Bn,emphasis:An,strikethrough:Tn,insert:Nn,subscript:Mn,superscript:kn,checkbox:ae,checkbox_input:ae,hardbreak:Un,math_inline:pn,reference:gn,list:Gn,math_block:fn,table:it},o);return(o,r)=>(p(),h("div",W({class:t.value},e.node.attrs),[(p(!0),h(k,null,x(e.node.children,(t,o,r,a)=>{const i=[t];if(a&&a.key===`${e.indexKey||"vmr-container"}-${o}`&&F(a,i))return a;const s=(p(),O(V((u=t.type,l[u]||ct)),{key:`${e.indexKey||"vmr-container"}-${o}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"vmr-container"}-${o}`},null,8,["custom-id","node","index-key"]));var u;return s.memo=i,s},r,0),128))],16))}}),[["__scopeId","data-v-7804f891"]]);mt.install=e=>{e.component(mt.__name,mt)};const vt={key:1,class:"html-block-node__placeholder"},ht=/* @__PURE__ */te(/* @__PURE__ */v({__name:"HtmlBlockNode",props:{node:{}},setup(e){const n=e,t=S(()=>{const e=n.node.attrs;if(e){if(Array.isArray(e)){const n={};for(const t of e){if(!t||t.length<2)continue;const[e,o]=t;null!=e&&(n[String(e)]=null==o?"":String(o))}return n}return e}}),o=M(null),l=M("undefined"==typeof window),r=M(n.node.content),a=We(),i=M(null),s=!!n.node.loading;return"undefined"!=typeof window?(B(o,e=>{var t,o;if(null==(o=null==(t=i.value)?void 0:t.destroy)||o.call(t),i.value=null,!s)return l.value=!0,void(r.value=n.node.content);if(!e)return void(l.value=!1);const u=a(e,{rootMargin:"400px"});i.value=u,l.value=u.isVisible.value,u.whenVisible.then(()=>{l.value=!0})},{immediate:!0}),B(()=>n.node.content,e=>{s&&!l.value||(r.value=e)})):l.value=!0,C(()=>{var e,n;null==(n=null==(e=i.value)?void 0:e.destroy)||n.call(e),i.value=null}),(n,a)=>(p(),h("div",W({ref_key:"htmlRef",ref:o,class:"html-block-node"},t.value),[l.value?f([r.value],()=>(p(),h("div",{key:0,innerHTML:r.value},null,8,["innerHTML"])),a,0):(p(),h("div",vt,[D(n.$slots,"placeholder",{node:e.node},()=>[a[1]||(a[1]=y("span",{class:"html-block-node__placeholder-bar"},null,-1)),a[2]||(a[2]=y("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),a[3]||(a[3]=y("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-ed22b926"]]),pt=["data-node-index","data-node-type"],ft=/* @__PURE__ */te(/* @__PURE__ */v({__name:"NodeRenderer",props:{content:{},nodes:{},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!0},batchRendering:{type:Boolean,default:!0},initialRenderBatchSize:{default:40},renderBatchSize:{default:80},renderBatchDelay:{default:16},renderBatchBudgetMs:{default:6},renderBatchIdleTimeoutMs:{default:120},deferNodesUntilVisible:{type:Boolean,default:!0},maxLiveNodes:{default:320},liveNodeBuffer:{default:60}},emits:["copy","handleArtifactClick","click","mouseover","mouseout"],setup(e,{emit:n}){var t,o,l;const r=e,a=n,m=M(),v=M(!1),f=/auto|scroll|overlay/i,g="undefined"!=typeof window,w=S(()=>r.debugPerformance&&g&&"undefined"!=typeof console);function y(e,n){w.value&&console.info(`[markstream-vue][perf] ${e}`,n)}function b(e){if("undefined"==typeof window)return null;const n=null!=e?e:m.value;if(!n)return null;const t=n.ownerDocument||document,o=t.scrollingElement||t.documentElement;let l=n;for(;l&&l!==t.body&&l!==o;){const e=window.getComputedStyle(l),n=(e.overflowY||"").toLowerCase(),t=(e.overflow||"").toLowerCase();if(f.test(n)||f.test(t))return l;l=l.parentElement}return null}const _=r.customId?`renderer-${r.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,I=d(_),L=S(()=>{const e=r.customHtmlTags;return e&&0!==e.length?d(_,{customHtmlTags:e}):I}),$=S(()=>{const e=L.value;return r.customMarkdownIt?r.customMarkdownIt(e):e});function D(e){const n=String(null!=e?e:"").trim();if(!n)return"";const t=n.match(/^[<\s/]*([A-Z][\w-]*)/i);return t?t[1].toLowerCase():""}const P=S(()=>{var e,n,t;const o=null!=(e=r.parseOptions)?e:{},l=[...null!=(n=r.customHtmlTags)?n:[],...null!=(t=o.customHtmlTags)?t:[]].map(D).filter(Boolean);return l.length?s(i({},o),{customHtmlTags:Array.from(new Set(l))}):o}),A=S(()=>{var e;if(null==(e=r.nodes)?void 0:e.length)return U(r.nodes.slice());if(r.content){const e=w.value?performance.now():0,n=c(r.content,$.value,P.value);return w.value&&y("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:r.content.length}),U(n)}return[]}),K=S(()=>{var e;return Math.max(1,null!=(e=r.maxLiveNodes)?e:320)}),F=S(()=>{var e;return!((null!=(e=r.maxLiveNodes)?e:0)<=0)&&A.value.length>K.value}),Z=S(()=>!1!==r.viewportPriority&&!v.value),G=function(e,n){const t="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof n?M(n):n;let l=null,r=null;const a=/* @__PURE__ */new WeakMap,s=(n,s)=>{const u=M(!1);let d,c=!1;const m=new Promise(e=>{d=()=>{c||(c=!0,e())}}),v=()=>{try{null==l||l.unobserve(n)}catch(e){}a.delete(n)};if(!t||!o.value)return u.value=!0,d(),{isVisible:u,whenVisible:m,destroy:v};!r&&s&&(r=i({},s));const h=function(n){var o,i,s;if(l||!t)return l;if("undefined"==typeof IntersectionObserver)return null;const u=null!=(o=null==e?void 0:e(null!=n?n:null))?o:null,d=r||{};return l=new IntersectionObserver(e=>{for(const t of e){const e=a.get(t.target);if(e&&(t.isIntersecting||t.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(n){}}null==l||l.unobserve(t.target),a.delete(t.target)}}},{root:u,rootMargin:null!=(i=d.rootMargin)?i:"300px",threshold:null!=(s=d.threshold)?s:0}),l}(n);return h?(a.set(n,{resolve:d,visible:u}),h.observe(n),{isVisible:u,whenVisible:m,destroy:v}):(u.value=!0,d(),{isVisible:u,whenVisible:m,destroy:v})};return j(Ke,s),s}(e=>{var n;return b(null!=(n=null!=e?e:m.value)?n:null)},Z),Y=g&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,J=g&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,Q="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(t=globalThis.process)?void 0:t.env)?void 0:o.NODE_ENV),ee=g&&"function"==typeof window.requestIdleCallback,ne=S(()=>{var e;const n=Math.trunc(null!=(e=r.renderBatchSize)?e:80);return Number.isFinite(n)?Math.max(0,n):0}),te=S(()=>{var e;const n=Math.trunc(null!=(e=r.initialRenderBatchSize)?e:ne.value);return Number.isFinite(n)?Math.max(0,n):ne.value}),le=S(()=>!1!==r.batchRendering&&ne.value>0&&g&&!Q),re=M(0),ie=M({key:r.indexKey,total:0}),se=M(Math.max(1,ne.value||1)),ue=X({}),ce=/* @__PURE__ */new Map,ve=/* @__PURE__ */new Map,he=/* @__PURE__ */new Map,pe=M(null);let ge=null,we=null;const ye=S(()=>{var e;return!1!==r.deferNodesUntilVisible&&!((null!=(e=r.maxLiveNodes)?e:0)<=0)&&!F.value&&!(A.value.length>900)&&Z.value}),ke=S(()=>{var e;return le.value&&(null!=(e=r.maxLiveNodes)?e:0)<=0}),Me=M({batchSize:ne.value,initial:te.value,delay:null!=(l=r.renderBatchDelay)?l:16,enabled:ke.value}),Be=S(()=>!!G&&(ye.value||F.value)),Ce=S(()=>{var e;return Math.max(0,null!=(e=r.liveNodeBuffer)?e:60)}),Te=M(0),Ie=X({start:0,end:0}),Le=/* @__PURE__ */new Map,$e=S(()=>{if(!F.value)return A.value.length;const e=Ce.value,n=Math.max(Ie.end+e,te.value),t=Math.min(A.value.length,n);return Math.max(re.value,t)});function je(e){var n,t,o,l;const r=b(null!=(n=null!=e?e:m.value)?n:null);if(r)return r;const a=null!=(l=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(t=m.value)?void 0:t.ownerDocument)?l:"undefined"!=typeof document?document:null;return(null==a?void 0:a.scrollingElement)||(null==a?void 0:a.documentElement)||null}function Se(e){if(!g)return!1;try{const n=window.getComputedStyle(e);return!!(n.display||"").toLowerCase().includes("flex")&&(n.flexDirection||"").toLowerCase().endsWith("reverse")}catch(n){return!1}}function Ee(){ge&&(ge(),ge=null),pe.value=null}function He(){if(!g||!F.value)return;const e=je();if(!e||pe.value===e)return;Ee();const n=()=>ze();e.addEventListener("scroll",n,{passive:!0}),pe.value=e,ge=()=>{e.removeEventListener("scroll",n)}}function Ne(){var e,n,t;if(!we)return;const o=null!=(t=null==(n=null==(e=m.value)?void 0:e.ownerDocument)?void 0:n.defaultView)?t:"undefined"!=typeof window?window:null;we.viaTimeout?o?o.clearTimeout(we.id):clearTimeout(we.id):null==J||J(we.id),we=null}function ze(e={}){var n,t,o;if(!F.value)return;if(!g)return void De(!0);if(e.immediate)return Ne(),void De(!0);if(we)return;const l=()=>{we=null,De()};if(Y)we={id:Y(l),viaTimeout:!1};else{const e=null!=(o=null==(t=null==(n=m.value)?void 0:n.ownerDocument)?void 0:t.defaultView)?o:"undefined"!=typeof window?window:null,r=e?e.setTimeout(l,16):setTimeout(l,16);we={id:r,viaTimeout:!0}}}function De(e=!1){var n,t,o,l,r,a,i;if(!F.value)return;const s=pe.value||je();if(!s)return;const u=s.ownerDocument||(null==(n=m.value)?void 0:n.ownerDocument)||document,d=(null==u?void 0:u.defaultView)||("undefined"!=typeof window?window:null),c=s===(null==u?void 0:u.documentElement)||s===(null==u?void 0:u.body),v=A.value.length;if(!c&&v>0&&Se(s)){const n=s.clientHeight||0,t=s.scrollTop,o=t<0?-t:t,l=function(e){var n;const t=A.value;if(!t.length)return 0;if(e<=0)return Math.max(0,t.length-1);let o=e;for(let l=t.length-1;l>=0;l--){const e=null!=(n=Ae[l])?n:Oe.value;if(o<=e)return l;o-=e}return 0}(Math.max(0,o)+.5*Math.max(0,n)),r=Pe(l,0,Math.max(0,v-1));return void((e||Math.abs(r-Te.value)>1)&&(Te.value=r))}const h=c?null:s.getBoundingClientRect(),p=c?0:h.top,f=c?null!=(o=null!=(t=null==d?void 0:d.innerHeight)?t:s.clientHeight)?o:0:h.bottom,g=Array.from(he.entries()).sort((e,n)=>e[0]-n[0]);let w=null,y=null;for(const[m,x]of g){if(!x)continue;const e=x.getBoundingClientRect();e.bottom<=p||e.top>=f||(null==w&&(w=m),y=m)}if(null==w||null==y){const e=m.value;if(!e)return;const n=c?{top:0}:s.getBoundingClientRect(),t=function(e,n,t){var o,l,r,a,i,s;if(t)return null!=(a=null!=(r=null==(o=null==n?void 0:n.documentElement)?void 0:o.scrollTop)?r:null==(l=null==n?void 0:n.body)?void 0:l.scrollTop)?a:0;const u=e.scrollTop;if(!Se(e))return u;const d=u<0?-u:u;return Math.max(0,(null!=(i=e.scrollHeight)?i:0)-(null!=(s=e.clientHeight)?s:0))-d}(s,u,c),o=c?(()=>{const t=e.getBoundingClientRect(),o=(c?0:n.top)-t.top;return Math.max(0,o)})():(()=>{const n=function(e,n){let t=e,o=0,l=0;for(;t&&t!==n&&l++<64;)o+=t.offsetTop||0,t=t.offsetParent;return o}(e,s);return Math.max(0,t-n)})(),v=c?null!=(i=null!=(a=null!=(r=null==d?void 0:d.innerHeight)?r:null==(l=null==u?void 0:u.documentElement)?void 0:l.clientHeight)?a:s.clientHeight)?i:0:s.clientHeight,h=function(e){var n;if(e<=0)return 0;let t=e;const o=A.value;for(let l=0;l<o.length;l++){const e=null!=(n=Ae[l])?n:Oe.value;if(t<=e)return l;t-=e}return Math.max(0,o.length-1)}(o+.5*Math.max(0,v));return void(Te.value=Pe(h,0,Math.max(0,A.value.length-1)))}const k=Math.round((w+y)/2);!e&&Math.abs(k-Te.value)<=1||(Te.value=Pe(k,0,Math.max(0,A.value.length-1)))}function Pe(e,n,t){return Math.min(Math.max(e,n),t)}const Ae=X({}),Re=X({total:0,count:0}),Oe=S(()=>Re.count>0?Math.max(12,Re.total/Re.count):32);function Ve(e,n){var t;if(e>=n)return 0;let o=0;for(let l=e;l<n;l++)o+=null!=(t=Ae[l])?t:Oe.value;return o}const We=S(()=>{if(!F.value)return A.value.map((e,n)=>({node:e,index:n}));const e=A.value.length,n=Pe(Ie.start,0,e),t=Pe(Ie.end,n,e);return A.value.slice(n,t).map((e,t)=>({node:e,index:n+t}))}),Fe=S(()=>F.value?Ve(0,Math.min(Ie.start,A.value.length)):0),Ue=S(()=>{if(!F.value)return 0;const e=A.value.length;return Ve(Math.min(Ie.end,e),e)});function Xe(e){if(ce.size&&F.value)for(const[n,t]of ce)n>=e&&(t.destroy(),ce.delete(n),ye.value&&delete ue[n],ln(n),he.delete(n))}function qe(e,n){ye.value&&(ue[e]=n),n&&(F.value?ze():Te.value=Pe(e,0,Math.max(0,A.value.length-1)))}function Ze(e){const n=ce.get(e);n&&(n.destroy(),ce.delete(e)),ln(e)}function Ge(e,n){if(n?he.set(e,n):he.delete(e),n||ln(e),!Be.value||!G)return Ze(e),void(n?qe(e,!0):ye.value&&delete ue[e]);if(!F.value&&ye.value&&!v.value&&ce.size>=640&&(function(){if(!v.value){v.value=!0;for(const e of ce.values())e.destroy();if(ce.clear(),g)for(const e of ve.values())window.clearTimeout(e);ve.clear();for(const e of Object.keys(ue))delete ue[e]}}(),!Be.value||!G))return Ze(e),void(n?qe(e,!0):ye.value&&delete ue[e]);if(e<te.value&&!F.value)return Ze(e),void qe(e,!0);if(!n)return Ze(e),void(ye.value&&delete ue[e]);Ze(e);const t=G(n,{rootMargin:"400px"});t&&(ce.set(e,t),qe(e,t.isVisible.value),ye.value&&function(e){if(!g||!ye.value)return;ln(e);const n=e%17*23,t=window.setTimeout(()=>{var n,t;if(ve.delete(e),!ye.value)return;if(!0===ue[e])return;const o=he.get(e);if(!o)return void delete ue[e];const l=je(o),r=o.ownerDocument||document,a=r.defaultView||window,i=!l||l===r.documentElement||l===r.body,s=!i&&l?l.getBoundingClientRect():null,u=i?0:s.top,d=i?null!=(t=null!=(n=a.innerHeight)?n:null==l?void 0:l.clientHeight)?t:0:s.bottom,c=o.getBoundingClientRect();c.bottom>=u-500&&c.top<=d+500&&qe(e,!0)},1800+n);ve.set(e,t)}(e),t.whenVisible.then(()=>{ln(e),qe(e,!0)}).catch(()=>{}).finally(()=>{ce.get(e)===t&&ce.delete(e);try{t.destroy()}catch(n){}}),F.value&&ze())}let Ye=null,Qe=null,en=!1,nn=null,tn=null;function on(){g&&(null!=Ye&&(null==J||J(Ye),Ye=null),null!=Qe&&(window.clearTimeout(Qe),Qe=null),null!=tn&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(tn),tn=null),en=!1,nn=null)}function ln(e){if(!g)return;const n=ve.get(e);null!=n&&(window.clearTimeout(n),ve.delete(e))}function rn(e,n={}){var t,o;if(!ke.value)return;const l=$e.value;if(re.value>=l)return;const a=Math.max(1,e),i=e=>{var n;Ye=null,Qe=null,tn=null,en=!1;const t=null!=nn?nn:a;nn=null;const o=Math.max(2,null!=(n=r.renderBatchBudgetMs)?n:6),i=e=>{const n="undefined"!=typeof performance?performance.now():Date.now();re.value=Math.min(l,re.value+Math.max(1,e)),Xe(re.value);const t=("undefined"!=typeof performance?performance.now():Date.now())-n;return function(e){var n;if(!ke.value)return;const t=Math.max(2,null!=(n=r.renderBatchBudgetMs)?n:6),o=Math.max(1,ne.value||1),l=Math.max(1,Math.floor(o/4));e>1.2*t?se.value=Math.max(l,Math.floor(.7*se.value)):e<.5*t&&se.value<o&&(se.value=Math.min(o,Math.ceil(1.2*se.value)))}(t),t};let s=t;for(;(i(s),!(re.value>=l)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(se.value));re.value<l&&an()};if(!g||n.immediate)return void i();const s=Math.max(0,null!=(t=r.renderBatchDelay)?t:16);if(nn=null!=nn?Math.max(nn,a):a,!en){if(en=!0,!Q&&ee&&window.requestIdleCallback){const e=Math.max(0,null!=(o=r.renderBatchIdleTimeoutMs)?o:120);return void(tn=window.requestIdleCallback(e=>{i(e)},{timeout:e}))}Y&&!Q?Ye=Y(()=>{0!==s?Qe=window.setTimeout(()=>i(),s):i()}):Qe=window.setTimeout(()=>i(),s)}}function an(){ke.value&&rn(le.value?Math.max(1,Math.round(se.value)):Math.max(1,ne.value))}B([()=>A.value,()=>A.value.length,()=>ke.value,()=>ne.value,()=>te.value,()=>r.renderBatchDelay,()=>r.indexKey],()=>{var e;const n=A.value.length,t=ie.value,o=r.indexKey,l=void 0!==o&&o!==t.key,a=n!==t.total,i=l||a;ie.value={key:o,total:n};const s=Me.value,u=null!=(e=r.renderBatchDelay)?e:16,d=s.batchSize!==ne.value||s.initial!==te.value||s.delay!==u||s.enabled!==ke.value;Me.value={batchSize:ne.value,initial:te.value,delay:u,enabled:ke.value},(i||d||!ke.value)&&on(),(i||d)&&(se.value=Math.max(1,ne.value||1)),i&&F.value&&ze({immediate:!0});const c=$e.value;if(!n)return re.value=0,void Xe(0);if(!ke.value)return re.value=c,void Xe(re.value);const m=l||0===t.total;re.value=m||d?Math.min(c,te.value):Math.min(re.value,c);const v=Math.max(1,te.value||ne.value||n);re.value<c?rn(v,{immediate:!g}):Xe(re.value)},{immediate:!0}),B(()=>F.value,e=>{if(!e)return Ee(),void Ne();He(),ze({immediate:!0})},{immediate:!0}),B([()=>A.value.length,()=>F.value],e=>u(null,[e],function*([e,n]){n&&e&&g&&(yield q(),ze({immediate:!0}))}),{flush:"post"}),B(()=>m.value,()=>{F.value&&(He(),ze({immediate:!0}))}),B(()=>A.value.length,()=>{F.value&&ze({immediate:!0})}),B(()=>ye.value,e=>{if(e)for(const[n,t]of he)Ge(n,t);else{for(const e of ce.values())e.destroy();ce.clear();for(const e of Array.from(ve.keys()))ln(e);for(const e of Object.keys(ue))delete ue[e];for(const[e,n]of he)n&&qe(e,!0)}},{immediate:!1}),B([()=>r.viewportPriority,()=>A.value.length],([e,n])=>{!1!==e?v.value&&n<=200&&(v.value=!1):v.value=!1}),B(()=>re.value,()=>{F.value&&ze({immediate:!0})}),B([Te,K,Ce,()=>A.value.length,F],()=>{!function(){const e=A.value.length;if(!F.value||0===e)return Ie.start=0,void(Ie.end=e);const n=Math.min(K.value,e),t=Ce.value,o=Pe(Te.value-t,0,Math.max(0,e-n));Ie.start=o,Ie.end=Math.min(e,o+n)}()},{immediate:!0}),B([()=>A.value.length,F,K,Ce,()=>Ie.start,()=>Ie.end],([e,n,t,o,l,r])=>{w.value&&y("virtualization",{nodes:e,virtualization:n,maxLiveNodes:t,buffer:o,focusIndex:Te.value,scroll:n?(()=>{const e=pe.value||je();return e?{reverse:Se(e),scrollTop:Math.round(e.scrollTop),scrollTopAbs:Math.round(Math.abs(e.scrollTop)),scrollHeight:Math.round(e.scrollHeight),clientHeight:Math.round(e.clientHeight)}:null})():null,liveRange:{start:l,end:r},rendered:re.value})}),B(()=>$e.value,(e,n)=>{ke.value&&("number"==typeof n&&e<=n||e>re.value&&an())}),C(()=>{on();for(const e of ce.values())e.destroy();ce.clear();for(const e of Array.from(ve.keys()))ln(e);Ee(),Ne()});const sn=R(()=>u(null,null,function*(){try{return(yield import("./index4.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to inline-code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),nt}})),un=R(()=>u(null,null,function*(){try{return(yield Promise.resolve().then(()=>Io)).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',e),nt}})),dn=S(()=>r.renderCodeBlocksAsPre?nt:sn),cn={text:hn,paragraph:Jn,heading:qn,code_block:sn,list:Gn,blockquote:oe,table:it,definition_list:de,footnote:Wn,footnote_reference:xe,footnote_anchor:On,admonition:Mt,vmr_container:mt,hardbreak:Un,link:En,image:Je,thematic_break:ut,math_inline:pn,math_block:fn,strong:Bn,emphasis:An,strikethrough:Tn,highlight:Dn,insert:Nn,subscript:Mn,superscript:kn,emoji:me,checkbox:ae,checkbox_input:ae,inline_code:_e,html_inline:be,reference:gn,html_block:ht};function mn(e){var n;if(!e)return ct;const t=fe(r.customId),o=t[String(e.type)];if("code_block"===e.type){if("mermaid"===String(null!=(n=e.language)?n:"").trim().toLowerCase())return t.mermaid||un;if(o)return o;return t.code_block||dn.value}return o||cn[String(e.type)]||ct}function vn(e){var n;return"code_block"===(null==e?void 0:e.type)&&"mermaid"===String(null!=(n=e.language)?n:"").trim().toLowerCase()?{}:"code_block"===e.type?i({stream:r.codeBlockStream,darkTheme:r.codeBlockDarkTheme,lightTheme:r.codeBlockLightTheme,monacoOptions:r.codeBlockMonacoOptions,themes:r.themes,minWidth:r.codeBlockMinWidth,maxWidth:r.codeBlockMaxWidth},r.codeBlockProps||{}):{typewriter:r.typewriter}}function wn(e){a("click",e)}function yn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&a("mouseover",e)}function xn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&a("mouseout",e)}return(n,t)=>(p(),h("div",{ref_key:"containerRef",ref:m,class:T(["markstream-vue markdown-renderer",[{dark:r.isDark},{virtualized:F.value}]]),onClick:wn,onMouseover:yn,onMouseout:xn},[F.value?(p(),h("div",{key:0,class:"node-spacer",style:z({height:`${Fe.value}px`}),"aria-hidden":"true"},null,4)):E("",!0),(p(!0),h(k,null,x(We.value,n=>{var o,l;return p(),h("div",{key:n.index,ref_for:!0,ref:e=>Ge(n.index,e),class:"node-slot","data-node-index":n.index,"data-node-type":n.node.type},[(l=n.index,ke.value&&l>=re.value||ye.value&&!(l<te.value)&&!0!==ue[l]?(p(),h("div",{key:1,class:"node-placeholder",style:z({height:`${null!=(o=Ae[n.index])?o:Oe.value}px`})},null,4)):(p(),h("div",{key:0,ref_for:!0,ref:e=>function(e,n){n?(Le.set(e,n),queueMicrotask(()=>{!function(e,n){if(!Number.isFinite(n)||n<=0)return;const t=Ae[e];Ae[e]=n,t?Re.total+=n-t:(Re.total+=n,Re.count++)}(e,n.offsetHeight)})):Le.delete(e)}(n.index,e),class:"node-content"},["code_block"!==n.node.type&&!1!==r.typewriter?(p(),O(H,{key:0,name:"typewriter",appear:""},{default:N(()=>[(p(),O(V(mn(n.node)),W({node:n.node,loading:n.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${n.index}`},{ref_for:!0},vn(n.node),{"custom-id":r.customId,"is-dark":r.isDark,onCopy:t[0]||(t[0]=e=>a("copy",e)),onHandleArtifactClick:t[1]||(t[1]=e=>a("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024)):(p(),O(V(mn(n.node)),W({key:1,node:n.node,loading:n.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${n.index}`},{ref_for:!0},vn(n.node),{"custom-id":r.customId,"is-dark":r.isDark,onCopy:t[2]||(t[2]=e=>a("copy",e)),onHandleArtifactClick:t[3]||(t[3]=e=>a("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],512)))],8,pt)}),128)),F.value?(p(),h("div",{key:1,class:"node-spacer",style:z({height:`${Ue.value}px`}),"aria-hidden":"true"},null,4)):E("",!0)],34))}}),[["__scopeId","data-v-14605a64"]]);ft.install=e=>{var n,t;const o=null!=(t=null!=(n=ft.__name)?n:ft.name)?t:"NodeRenderer";e.component(o,ft)};const gt={key:0,class:"admonition-icon"},wt={class:"admonition-title"},yt=["aria-expanded","aria-controls","title"],kt={key:0},xt={key:1},bt=["id"],Mt=/* @__PURE__ */te(/* @__PURE__ */v({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:n}){var t;const o=e,l=n,r={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},a=S(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const e=o.node.kind||"note";return e.charAt(0).toUpperCase()+e.slice(1)}),i=M(!!o.node.collapsible&&!(null==(t=o.node.open)||t));function s(){o.node.collapsible&&(i.value=!i.value)}const u=`admonition-${Math.random().toString(36).slice(2,9)}`;return(n,t)=>(p(),h("div",{class:T(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[y("div",{id:u,class:"admonition-header"},[r[o.node.kind]?(p(),h("span",gt,b(r[o.node.kind]),1)):E("",!0),y("span",wt,b(a.value),1),o.node.collapsible?(p(),h("button",{key:1,class:"admonition-toggle","aria-expanded":!i.value,"aria-controls":`${u}-content`,title:i.value?"Expand":"Collapse",onClick:s},[i.value?(p(),h("span",kt,"▶")):(p(),h("span",xt,"▼"))],8,yt)):E("",!0)]),Z(y("div",{id:`${u}-content`,class:"admonition-content","aria-labelledby":u},[f([o.node.children],()=>g(w(ft),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:t[0]||(t[0]=e=>l("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),t,1)],8,bt),[[G,!i.value]])],2))}}),[["__scopeId","data-v-5e95c2b7"]]);Mt.install=e=>{e.component(Mt.__name,Mt)};let _t=!1,Bt=null,Ct=!1;function Tt(){return u(this,null,function*(){if(Bt)return Bt;if(Ct)return null;try{return Bt=yield import("stream-monaco"),yield function(e){return u(this,null,function*(){if(!_t)return _t=!0,e.preloadMonacoWorkers()})}(Bt),Bt}catch(e){return Ct=!0,null}})}let It=null;function Lt(e){It=null!=e?e:null}const $t={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function jt(e){var n;const t=function(e){if(!e)return"";const n=e.trim();if(!n)return"";const[t]=n.split(/\s+/),[o]=t.split(":");return o.toLowerCase()}(e);return null!=(n=$t[t])?n:t}function St(e){const n=jt(e);if(!n)return"plaintext";switch(n){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return n}}function Et(e){if(It){const n=It(e);if(null!=n&&""!==n)return n}switch(jt(e)){case"javascript":case"js":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />\n <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />\n </g>\n</svg>\n';case"typescript":case"ts":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />\n <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />\n </g>\n</svg>\n';case"jsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />\n <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />\n <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />\n <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"tsx":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />\n <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />\n <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />\n <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />\n </g>\n</svg>\n';case"html":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />\n <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />\n </g>\n</svg>\n';case"css":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">\n <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />\n <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />\n </g>\n</svg>\n';case"scss":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#f4b8e4" stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.38c1.85 1.07 3.35.74 4.83-.2 1.5-.95 2.7-2.78 1.3-4.15-.7-.68-3.25-.8-5.62.19-2.36.99-4.59 3.02-4.74 4.11-.31 2.19 3.15 2.88 3.64 4.23s.28 1.98-.2 2.83c-.5.85-1.96 1.62-2.8.68-.83-.95 1.67-2.75 2.98-3.25 1.3-.5 3.1-.4 3.69.25.58.64-.07 1.79-.03 1.79" />\n</svg>\n';case"json":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />\n</svg>\n';case"python":case"py":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />\n <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />\n <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />\n <path stroke="#e5c890" d="m 8.5,12.5 v 0" />\n </g>\n</svg>\n';case"ruby":case"rb":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M1.5 9.06v2.5c.02.86.36 1.61.9 2.15 1.76 1.76 5.71.65 8.84-2.47 3.12-3.13 4.23-7.08 2.47-8.84a3.1 3.1 0 00-2.15-.9h-2.5M14.5 4l-.25 10.25L4 14.5m4.39-6.11c2.34-2.35 3.29-5.2 2.12-6.37S6.49 1.8 4.14 4.14C1.8 6.5.85 9.34 2.02 10.51s4.02.22 6.37-2.12M5.5 14.5l.25-3.75L11 11l-.25-5.25 3.75-.25" />\n</svg>\n';case"go":case"golang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m15.48 8.06-4.85.48m4.85-.48a4.98 4.98 0 01-4.54 5.42 5 5 0 112.95-8.66l-1.7 1.84a2.5 2.5 0 00-4.18 2.06c.05.57.3 1.1.69 1.51.25.27 1 .83 1.78.82.8-.02 1.58-.25 2.07-.81 0 0 .8-.96.68-1.88M2.5 8.5l-2 .01m1.5 2h1.5m-2-3.99 2-.02" />\n</svg>\n';case"r":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#838ba7" d="M13.5 9.5c.63-.7 1-1.54 1-2.43 0-2.52-2.91-4.57-6.5-4.57S1.5 4.55 1.5 7.07c0 1.9 1.65 3.53 4 4.22" />\n <path stroke="#8caaee" d="M10.5 9.5c.4 0 .86.34 1 .7l1 3.3m-5 0v-8h3.05c.95 0 1.95 1 1.95 2s-1 2-1.95 2H7.5Z" />\n </g>\n</svg>\n';case"java":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.73 8.41c.57 3 1.59 5.83 2.77 7.09-6.63-3.45-9.76-1.75-10.5 0-.66-3.4-.54-5.74.09-7.78" />\n <path stroke="#e78284" d="M8.5 7c.63.34 1.82 1.07 2.24 1.41-.54-2.9-.64-5.96-.74-7.91-2.13.58-5.73 1.98-6.9 7.22.52-.69 1.72-1.05 2.4-1.22" />\n <path stroke="#e78284" d="M5.5 7A1.5 1.5 0 007 8.5 1.5 1.5 0 008.5 7 1.5 1.5 0 007 5.5 1.5 1.5 0 005.5 7" />\n </g>\n</svg>\n';case"kotlin":case"kt":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />\n <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />\n <path stroke="#e78284" d="M2.5 13.5V8" />\n <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />\n </g>\n</svg>\n';case"c":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 4.0559072,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441188,0 l -1.789955,-1.782586 c -1.75742,1.750224 -4.6067879,1.750224 -6.3642294,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642294,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.746003,-2.73472867 -7.1981359,-2.73472867 -9.944119,0 -2.7459858,2.7347089 -2.7459858,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n</svg>\n';case"cpp":case"c++":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />\n</svg>\n';case"cs":case"csharp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" d="m 6.665625,1.0107144 c 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 7.18125,3.9983098 h 2.971875 L 10.5125,1.8326156 c 0.09063,-0.5437673 0.60625,-0.9125291 1.15,-0.8219012 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 12.18125,3.9983098 H 14 c 0.553125,0 1,0.4468892 1,1.0000319 0,0.5531426 -0.446875,1.0000319 -1,1.0000319 H 11.846875 L 11.18125,9.9985013 H 13 c 0.553125,0 1,0.4468897 1,1.0000317 0,0.553143 -0.446875,1.000032 -1,1.000032 H 10.846875 L 10.4875,14.164259 c -0.09063,0.543768 -0.60625,0.912529 -1.15,0.821902 -0.54375,-0.09063 -0.9125,-0.60627 -0.821875,-1.150037 l 0.30625,-1.834434 h -2.975 L 5.4875,14.167384 c -0.090625,0.543768 -0.60625,0.91253 -1.15,0.821902 C 3.79375,14.898658 3.425,14.383016 3.515625,13.839249 L 3.81875,11.998565 H 2 c -0.553125,0 -1,-0.446889 -1,-1.000032 C 1,10.445391 1.446875,9.9985013 2,9.9985013 H 4.153125 L 4.81875,5.9983736 H 3 c -0.553125,0 -1,-0.4468893 -1,-1.0000319 C 2,4.445199 2.446875,3.9983098 3,3.9983098 H 5.153125 L 5.5125,1.8326156 C 5.603125,1.2888483 6.11875,0.9200865 6.6625,1.0107144 Z M 6.846875,5.9983736 6.18125,9.9985013 H 9.153125 L 9.81875,5.9983736 Z" />\n</svg>\n';case"php":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M0.5,12.5 L0.5,13.24 C0.5,14 1.27360724,14.5 2,14.5 C2.9375516,14.5 3.5,14 3.5,13.2445661 L3.5,6.00089968 C3.5,4.28551107 4.99401107,2.52263547 7.14960413,2.5 C9.49387886,2.5 11,4.0579782 11,5.5 C11.1657296,8.48962302 9.57820404,9.63684469 7.49621582,10.5 L7.49621582,14.5 L15.4979764,14.5 L15.4979764,9 C15.5394484,8.36478228 14.9387379,7.15595371 14.1308258,6.5 C13.1942239,5.80827275 12.0584852,5.50253264 11,5.5 M11.5,14.5 L11.5,11.5 M6,6.5 C6.27614237,6.5 6.5,6.27614237 6.5,6 C6.5,5.72385763 6.27614237,5.5 6,5.5 C5.72385763,5.5 5.5,5.72385763 5.5,6 C5.5,6.27614237 5.72385763,6.5 6,6.5 Z" />\n</svg>\n';case"scala":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="m2.5 2.48 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1zm0 5 11-.98v3.04l-11 1z" />\n</svg>\n';case"shell":case"sh":case"bash":case"zsh":case"powershell":case"ps1":case"bat":case"batch":case"shellscript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">\n <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />\n <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />\n </g>\n</svg>\n';case"sql":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />\n</svg>\n';case"yaml":case"yml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />\n</svg>\n';case"markdown":case"md":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />\n</svg>\n';case"xml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5 1 8 4.5 11.5M11.5 4.5 15 8 11.5 11.5M9.5 2 6.5 14" />\n</svg>\n';case"rust":case"rs":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M15.5 9.5Q8 13.505.5 9.5l1-1-1-2 2-.5V4.5h2l.5-2 1.5 1 1.5-2 1.5 2 1.5-1 .5 2h2V6l2 .5-1 2z" />\n <path d="M6.5 7.5a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1m5 0a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1M4 11.02c-.67.37-1.5.98-1.5 2.23s1.22 1.22 2 1.25v-2M12 11c.67.37 1.5 1 1.5 2.25s-1.22 1.22-2 1.25v-2" />\n </g>\n</svg>\n';case"swift":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M14.34 10.2c.34-1.08 1.1-5.07-4.45-8.62a.48.48 0 00-.6.07.44.44 0 00-.02.6c.03.02 2.07 2.5 1.34 5.34-1.26-.86-6.24-4.81-6.24-4.81L7.25 7.5 1.9 4.05S5.68 8.7 8 10.45c-1.12.4-3.56.82-6.78-1.18a.48.48 0 00-.58.06.44.44 0 00-.08.56c.11.18 2.7 4.36 8.14 4.36 1.5 0 2.37-.42 3.08-.77.43-.2.77-.37 1.14-.37.93 0 1.54.92 1.54.93.1.14.27.22.44.21a.46.46 0 00.4-.28c.67-1.55-.49-3.2-.96-3.78h0Z" />\n</svg>\n';case"perl":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M12.5 14.5v-3.34c-1-.66-1-1.35-1-2.66m-3 1 .02 2.53.98 2.47m-4-5v5m9 0V9.23s.17-1.73-1-1.73c0-1.5-.5-6-2.5-6S8.75 4.25 8.75 4.25A3.67 3.67 0 006.5 7.12v-3.5c0-.63-.85-1.32-1.5-1.32-.92 0-1.33.59-1.5 1.2H2.25c-.42.11-.75.59-.75 1 0 .5.28 1 .75 1h1.22l.02 3c.01.75.51 1 1.51 1h4.5" />\n</svg>\n';case"lua":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#c6d0f5" d="M10.5 7A1.5 1.5 0 019 8.5 1.5 1.5 0 017.5 7 1.5 1.5 0 019 5.5 1.5 1.5 0 0110.5 7" />\n <path stroke="#8caaee" d="M7 2.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13m7-2a1.5 1.5 0 100 3 1.5 1.5 0 000-3" />\n </g>\n</svg>\n';case"haskell":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M12.5 4.5h3m-1.5 3h1.5m-10 6 2.5-5-2.5-5H8l5.6 10h-2.53l-1.52-2.92L8 13.5zm-5 0 2.5-5-2.5-5H3l2.5 5-2.5 5z" />\n</svg>\n';case"erlang":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M6.5 5.5c0-1.25 1-2 2-2s2 .75 2 2z" />\n <path d="M13.5 13c.47-.57 1.12-1.24 1.5-2l-2.25-1.25c-.74 1.36-1.76 2.75-3.25 2.75-2.1 0-3-2.3-3-5h8c.05-1.61-.31-3.45-1-4.5M3 13c-1.08-1.3-1.5-3-1.5-5S2.1 4.24 3 3" />\n </g>\n</svg>\n';case"clojure":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M14.17 10.03A6.5 6.5 0 011.81 6.02" />\n <path stroke="#8caaee" d="M1.87 5.85A6.5 6.5 0 0114.22 9.9" />\n <path stroke="#a6d189" d="M6.36 4.9a3.5 3.5 0 103.41 6.12" />\n <path stroke="#8caaee" d="M9.77 11.02a3.5 3.5 0 00-3.03-6.29" />\n <path stroke="#c6d0f5" d="M8 7.5s-1.66 2.48-1.5 3.65" />\n <path stroke="#c6d0f5" d="M1.81 6.02C2.47 5 3.83 4.49 5 4.46c4.06 0 3 5.56 5.03 6.86 1.21.52 3.5-.21 4.15-1.32" />\n </g>\n</svg>\n';case"vue":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />\n <path d="M12.05 1.73 8 9.28 3.95 1.73" />\n </g>\n</svg>\n';case"svg":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="m4.54 10 6.92-4m-6.92 4a1.5 1.5 0 10-2.6 1.5 1.5 1.5 0 002.6-1.5M8 4v8m0-8a1.5 1.5 0 100-3 1.5 1.5 0 000 3M4.54 6l6.92 4M4.54 6a1.5 1.5 0 10-2.6-1.5A1.5 1.5 0 004.54 6M8 12a1.5 1.5 0 100 3 1.5 1.5 0 000-3m3.46-2a1.5 1.5 0 102.6 1.5 1.5 1.5 0 00-2.6-1.5m0-4a1.5 1.5 0 102.6-1.5 1.5 1.5 0 00-2.6 1.5" />\n</svg>\n';case"mermaid":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />\n</svg>\n';case"dart":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M7 14.5h4.5v-3h3V7L9.17 1.64c-.28-.29-.8-.47-1.17-.29L3.5 3.5 1.35 8c-.18.37 0 .88.3 1.17z" />\n <path d="M3.5 11V3.5H11m-7.5 0 8 8" />\n </g>\n</svg>\n';case"assembly":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <rect width="8" height="13.001" x="4" y="1.499" fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" rx="2.286" ry="2.286" />\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M 4,4.500025 H 1.5 M 4,7.9999993 H 1.5 M 4,11.499973 H 1.5 m 13,-6.999948 H 12 m 2.5,3.4999743 H 12 m 2.5,3.4999737 H 12" />\n</svg>\n';case"dockerfile":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M.5 8.5H11l.75-.5a5.35 5.35 0 010-3.5c1 .6 1 1.88 1.74 2 .77-.09 1.23.01 2 .52 0 0-.97 1.77-2.5 1.98-1.93 3.65-4.5 5.5-6.98 5.5C0 14.5.5 8.5.5 8.5m1 0v-2m0 0h8m-6 2v-4m0 0h4m-2-2h2m-2 6v-6m2 6v-6m2 6v-2" />\n</svg>\n';case"fortran":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M7.5 14.5v-1l-1-1v-3h2l1 2h1v-6h-1l-1 2h-2v-4h5l1 3h1v-5h-11v1l1 1v9l-1 1.25v.75z" />\n</svg>\n';case"lisp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round">\n <path d="M.5 5.06v6.07C.5 12.41.82 13 2.27 13h5.6c1.04 0 1.63-.51 1.63-1.62 0-.85-.2-1.88-1.5-1.88h-.36C6.4 9.5 6 8.77 6 7.75 6 6.81 6.8 6 7.49 6h2.68" />\n <path d="M3.5 10.5V4.99C3.5 3.89 3.62 3 5 3h9c.97 0 1.5.99 1.5 1.63.12 1.55-.98 1.62-2.1 2.16-.58.26-1.4.52-1.4.98V11" />\n </g>\n</svg>\n';case"ocaml":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1.5 8V3c0-.83.67-1.5 1.5-1.5h10c.83 0 1.5.67 1.5 1.5v10c0 .83-.67 1.5-1.5 1.5H9" />\n <path d="m1.5 8 1.14-2.3q.09-.21.36-.24a.8.8 0 01.44.13c.18.12.23.53.28.64.06.1.64 1.23.85 1.23.2 0 .71-1.47.71-1.47s.37-.49.72-.49.55.32.67.49c.12.16.24 1.76.46 2.01s1.32.87 1.67.73c.34-.13.53-.4.63-.73.1-.34-.14-.75 0-1a1.1 1.1 0 011.02-.55c.56.03 2.05.56 2.05 1.05q0 .75-1.5.75c-.48 1.33.28 2.22-3 2.25l1 4" />\n <path d="m4.5 14.5 1.5-4 1 4zm-2 0 1.5-4-1.5-.5-1 1.54V14l1 .49Z" />\n </g>\n</svg>\n';case"prolog":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 13.5c-.33.33-.5.67-.5 1s.17.67.5 1c.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.83.5-1.5h2c0 .67.17 1.17.5 1.5.17-.67.5-1 1-1s.83.33 1 1c.33-.33.5-.67.5-1s-.17-.67-.5-1l1-1 1.25 1.25c0-2.75 1-2.75 1-5.75a7.1 7.1 0 00-2-5.25A3.64 3.64 0 0113 .5c-1.17 0-2 .42-2.5 1.25A3.08 3.08 0 008 .5c-1 0-1.83.42-2.5 1.25C5 .92 4.17.5 3 .5c.5.83.58 1.58.25 2.25a7.1 7.1 0 00-2 5.25c0 3 1 3 1 5.75L3.5 12.5zm6-5a2 2 0 100-4 2 2 0 000 4m-5 0a2 2 0 100-4 2 2 0 000 4M7 8l1 2.5L9 8m1.5-1.5" />\n</svg>\n';case"groovy":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round">\n <path d="M11.68 5.38c.4.19.54.68 1.53 3.25 1 2.57-.92 4.07-.92 4.07s-6.73 2.47-6.73 1.63c-.18-.92-1.92-2.08-1.92-2.08s-.52-.63.06-.75c5.89-1.27 6.96-.61 7.3-2" />\n <path d="M7.38 10.63C2.62 10.88 2.48 8.08 2.5 8 3.6 4.6 9.24.91 10.8 1.58 14.07 3.04 9.2 8.96 7 8.5c-4.02-.83 1.5-4 1.5-4" />\n </g>\n</svg>\n';case"matlab":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#85c1dc" d="M4 11 .5 8.5 5 7q.78-1.77 1.89-1.89c.74-.07 1.94-1.28 3.61-3.61M5 7l1.5 1.5" />\n <path stroke="#ef9f76" d="m15.5 12.5-5-11C8.5 6.83 6.33 10 4 11c1.67-.33 2.67.83 3 3.5 3.5-1.5 3.5-3.5 5-4s1.5 1.5 3.5 2" />\n </g>\n</svg>\n';case"cobol":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M6.74 2.24c.32-1.32 2.2-1.32 2.52 0a1.3 1.3 0 001.93.8c1.15-.7 2.48.62 1.77 1.77a1.3 1.3 0 00.8 1.93c1.32.32 1.32 2.2 0 2.52a1.3 1.3 0 00-.8 1.93c.7 1.15-.62 2.48-1.77 1.77a1.3 1.3 0 00-1.93.8c-.32 1.32-2.2 1.32-2.52 0a1.3 1.3 0 00-1.93-.8c-1.15.7-2.48-.62-1.77-1.77a1.3 1.3 0 00-.8-1.93c-1.32-.32-1.32-2.2 0-2.52a1.3 1.3 0 00.8-1.93c-.7-1.15.62-2.48 1.77-1.77a1.3 1.3 0 001.93-.8M10 6.5a2.5 2.5 0 100 3" />\n</svg>\n';case"ada":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#0f23c3" d="M24.554 20.075c.209.27 1.356.961 1.37 1.246a7 7 0 0 0-1.4-.324a17 17 0 0 1-1.412-.48a9.2 9.2 0 0 1-2.375-1.3A3.15 3.15 0 0 1 19.3 16.75a1.72 1.72 0 0 1 1.767-1.822a3.6 3.6 0 0 1 1.593.321c.146.066 1.31.606 1.256.809a5.5 5.5 0 0 0-1.41-.112c-.649.244-.4.828-.168 1.311a8 8 0 0 0 1.078 1.554c.164.194.884 1.271 1.138 1.264"/><path fill="#1a1978" d="M24.141 16.276c.128-.59.819-1.384 1.344-.773a4.2 4.2 0 0 1 .578 1.918c.12.656.2 1.327.261 1.982c.038.379.34 1.794.123 2.075a23 23 0 0 1-2.922-2.838a3.76 3.76 0 0 1-.925-1.7c-.1-1.073.879-.73 1.541-.664"/><path fill="#0f23c3" d="M26.3 17.781c.141-.732-.406-2.592-1.067-2.949a.06.06 0 0 0 .044-.007c-.156-.444-1.359 1.116-1.228 1.174c-.316-.138.774-1.984.988-2.16c.7-.578 1.372-.086 1.845.543a6.04 6.04 0 0 1 .733 4.434a4.5 4.5 0 0 1-.421 1.312c-.1.22-.45 1.1-.682 1.174a14.8 14.8 0 0 0-.212-3.521"/><path fill="#d2d2d2" d="M3.687 8.4c.179-.188-.041-1.527.324-1.548c.262-.015.553 1.741.627 1.968a9.2 9.2 0 0 0 1.127 2.329a7.53 7.53 0 0 0 4.016 2.978a4.55 4.55 0 0 0 2.366.2c.931-.208 1.82-.577 2.757-.765c1.35-.27 3.342-.352 4.438.647c.7.641.376.76.043 1.421a2.44 2.44 0 0 0 .178 2.562c.235.342 1.033.827.675 1.094c-.567.424-1.277-.452-1.636-.776c-1.4-1.264-2.711-1.313-4.492-1.074a9 9 0 0 1-4.883-.708A9.47 9.47 0 0 1 3.687 8.4M19.941 30a3.6 3.6 0 0 1-2.325-.817c.469-.092 1.021.025 1.508-.044a9.7 9.7 0 0 0 1.754-.43a10.5 10.5 0 0 0 3.022-1.554a6.55 6.55 0 0 0 2.757-5.214c.149-.088.316 1.034.319 1.091a5.8 5.8 0 0 1-.19 1.727a6.9 6.9 0 0 1-1.423 2.774A7.3 7.3 0 0 1 19.941 30"/><path fill="#d2d2d2" d="M18.962 19.109a5.8 5.8 0 0 1-2.05.859a13.4 13.4 0 0 1-2.224.549a8.86 8.86 0 0 1-4.435-.51a9.94 9.94 0 0 1-3.849-2.4c-.352-.367-2.104-2.417-1.548-3.05c.248-.282.875.846 1 .992a5 5 0 0 0 1.357 1.11a10.9 10.9 0 0 0 4.035 1.456a6.7 6.7 0 0 0 2.34-.094a13 13 0 0 1 1.694-.485a4 4 0 0 1 2.113.457c.344.17 1.523.743 1.567 1.116m9.351-4.031a19.3 19.3 0 0 1-.453 3.774c-.176-.242.016-1.47 0-1.792a6 6 0 0 0-.384-2.087a4.9 4.9 0 0 0-1.376-1.661a15 15 0 0 1-1.27-1.536c-1.837-2.382-3.245-5.211-2.9-8.3c.034-.308.069-1.448.411-1.445c.152 0 .266 1.561.29 1.718a12.5 12.5 0 0 0 1.224 4.116c.67 1.222 1.947 2.023 2.825 3.1a6.58 6.58 0 0 1 1.633 4.113M15.7 26.935a10.85 10.85 0 0 0 6.436-.687a6.94 6.94 0 0 0 4.278-4.418c.319.2-.048 1.529-.128 1.781a5.7 5.7 0 0 1-1.01 1.813a8.9 8.9 0 0 1-3.257 2.514c-1.703.772-5.662 1.652-6.319-1.003"/><path fill="#d2d2d2" d="M19.151 19.376c.367 2.107-2.957 3.124-4.478 3.213c-1.859.11-4.929-.292-6.06-2.031c-.673-1.035.781-.09 1.188.058a8.7 8.7 0 0 0 3.06.5a11.6 11.6 0 0 0 3.305-.5a14 14 0 0 0 1.533-.576c.301-.132 1.124-.691 1.452-.664m4.991 4.084c.4-.945-1.883-1.578-2.445-1.858a4.9 4.9 0 0 1-1.315-.867c-.181-.181-.872-.92-.807-1.219a5 5 0 0 1 1.087-.175a6 6 0 0 1 .855.588a10 10 0 0 0 .964.5a16 16 0 0 0 2.119.771c.308.09 1.549.208 1.727.428c-.04.296-1.97 2.021-2.185 1.832"/><path fill="#d2d2d2" d="M26.1 22.172c.265.43-1.08 1.831-1.363 2.105a9.3 9.3 0 0 1-2.566 1.728a7.8 7.8 0 0 1-2.56.753c-.679.058-1.966-.124-2.141-.979a7 7 0 0 1 1.177-.086c.462-.059.921-.149 1.376-.246a13 13 0 0 0 2.184-.645a11.5 11.5 0 0 0 2.084-1.11a11 11 0 0 0 1.078-.822c.105-.089.617-.702.731-.698m-7.342-10.207c-.1-1.308 2.612-1.3 3.271-1.092a5.98 5.98 0 0 1 2.982 2.475c-1.082.8-2.449.094-3.3-.654a4.3 4.3 0 0 0-1.481-1.029c-.809-.265-.818.094-1.472.3"/><path fill="#d2d2d2" d="M25.783 13.341c-.444-.029-.316.071-.647-.212c-.358-.307-.614-.795-.945-1.141c-.534-.558-1.242-.895-1.723-1.485a7.27 7.27 0 0 1-1.624-4.848c.018-1.489.407.187.551.675a12.3 12.3 0 0 0 1.126 2.708a46 46 0 0 0 3.4 4.321c-.039.002-.097-.021-.138-.018m-5.715 1.415c.033-.625-.911-.792-1.211-1.42c-.164-.343-.211-.569.029-.7c.082-.045.383.012.5-.02c.271-.076.335-.273.581-.4a1.193 1.193 0 0 1 1.633 1.021a1.82 1.82 0 0 1-1.532 1.519"/><path fill="#d2d2d2" d="M20.5 14.745a1.93 1.93 0 0 0 1.323-1.7c.524.139.928.658 1.521.771a2.6 2.6 0 0 0 1.029-.017c.207-.045.54-.274.721-.259c-.033.163-.464.546-.565.717a4.2 4.2 0 0 0-.388.9c-.229.741-.061.739-.709.311a4.3 4.3 0 0 0-1.957-.72c-.266-.026-.881.019-.975-.003m-.595 5.989a2.01 2.01 0 0 1-1.4 1.712c-.205.091-2.018.733-2.032.348c-.007-.2 1.624-.954 1.809-1.11a3.4 3.4 0 0 0 .867-1.071c.055-.112.232-.925.271-.943c.224-.106.488.93.485 1.064m-8.532-8.202a10.6 10.6 0 0 1 3.71-.914a10.3 10.3 0 0 1 1.865.024c.366.039 1.469.054 1.74.343a.255.255 0 0 1-.273.173c-.037.077.251.371.3.425c-.034.034-1.445-.4-1.572-.424a10.6 10.6 0 0 0-2.282-.134a16 16 0 0 0-1.841.194a6.2 6.2 0 0 1-1.647.313m11.139-1.801a1.89 1.89 0 0 1-1.517-.6c-.247-.349-.737-1.692-.385-2.021c.209-.2.384.662.484.846a11 11 0 0 0 1.418 1.775m5.276 8.469a19 19 0 0 1-.749 3.313c-.173-.077-.275-.778-.562-.95a4.1 4.1 0 0 0 .76-1.154c.152-.302.303-1.046.551-1.209m-7.807-7.357c-.132.268-.932 1.1-1.118.481c-.107-.356.876-.841 1.118-.481m-.747.45c.228.006.012-.248.012-.266c-.001-.043-.368.266-.012.266"/></svg>';case"julia":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="#a6d189" d="M10.5 5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#e78284" d="M6.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n <path stroke="#ca9ee6" d="M14.5 11a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0" />\n </g>\n</svg>\n';case"elixir":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M8.03 14.5C5 14.5 3.5 12.49 3.5 10.01c0-2.82 2.25-7.02 4.62-8.48a.24.24 0 01.24 0c.08.04.12.12.11.2-.13 1.25.22 2.5.98 3.54.3.43.63.8 1.02 1.27.54.66.94 1.03 1.52 2.08l.01.02c.33.56.5 1.2.5 1.84 0 2.03-1.69 4.02-4.47 4.02" />\n</svg>\n';case"vb.net":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#00519a" d="M6.67 7.836L9 18.915l2.336-11.079H16l-4.664 16.328H6.672L2 7.836Zm11.661 0h7.6a4.08 4.08 0 0 1 2.9 1.749a3.8 3.8 0 0 1 .571 2.04a4 4 0 0 1-.571 2.034a4.1 4.1 0 0 1-2.341 1.763a4.1 4.1 0 0 1 2.929 1.756a3.8 3.8 0 0 1 .58 2.1a4.66 4.66 0 0 1-.579 2.546a5.05 5.05 0 0 1-3.5 2.338h-7.589ZM23 14.252h1.166a1.754 1.754 0 0 0 0-3.5H23Zm0 7h1.39a2.047 2.047 0 0 0 0-4.089H23Z"/></svg>';case"nim":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M1 7 .5 4.5l1.01.67c.28-.27.47-.48 1.18-.85l.56-1.82L4.5 3.84c.77-.18 1.53-.36 2.4-.33L8 1.5l1.1 2.01c.87-.03 1.63.15 2.4.33l1.25-1.34.56 1.82c.7.37.9.58 1.18.85l1.01-.67L15 7m-1.5 1C13 6.5 11 5.5 8 5.5S3 6.5 2.5 8m11.5.75L13.5 8l-1 1.5-1.5.5-3-1.5L5 10l-1.5-.5-1-1.5-.5.75L1 7l1.25 3.75C3 12.75 6 13.5 8 13.5s5-.75 5.75-2.75L15 7z" />\n</svg>\n';case"crystal":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="m 15.4712,10.050637 -5.433601,5.433968 c -0.015,0.01505 -0.04554,0.01505 -0.09055,0.01505 L 2.536327,13.517264 c -0.015,0 -0.04501,-0.01505 -0.06055,-0.06072 L 0.50026325,6.0396501 a 0.21432208,0.21495127 0 0 1 0.015,-0.090817 L 5.9483283,0.5154023 c 0.015,-0.0150465 0.04501,-0.0150465 0.09055,-0.0150465 l 7.4101857,1.997972 c 0.015,0 0.04501,0.015046 0.06055,0.060724 l 1.977121,7.4158186 c 0.03001,0.03063 0.01608,0.060724 -0.01554,0.07577 M 8.2121063,4.1480782 0.93801425,6.1154197 q -0.0225,0 0,0.04514 L 6.2655263,11.50371 c 0.015,0.01505 0.015,0 0.04501,0 l 1.962119,-7.2803988 c -0.03054,-0.075233 -0.06055,-0.075233 -0.06055,-0.075233" />\n</svg>\n';case"d":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<defs><linearGradient id="SVGMV3iTbAN" x1="185.455" x2="181.955" y1="1601.641" y2="1630.224" gradientTransform="translate(-62.523 -666.646)scale(.427)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="SVGniw2Mvsa" x1="176.136" x2="172.636" y1="1600.5" y2="1629.083" href="#SVGMV3iTbAN"/></defs><path fill="#b03931" d="m3.978 15.462l-.009-6.953a.59.59 0 0 1 .531-.562h.076l6.074-.009a15.7 15.7 0 0 1 6.067.95a8.9 8.9 0 0 1 2.244 1.359a4.47 4.47 0 0 1 2.946-1.083a4.11 4.11 0 0 1 4.276 3.92A4.11 4.11 0 0 1 21.907 17c-.089 0-.177-.008-.265-.012a7 7 0 0 1-.232.953a85 85 0 0 1 8.59 2.6V2H2v13.4q.992.02 1.978.062m22.8-7.944a1.32 1.32 0 0 1 1.374 1.259a1.379 1.379 0 0 1-2.747 0a1.32 1.32 0 0 1 1.375-1.26Z"/><path fill="#b03931" d="M17.861 15.787a4.11 4.11 0 0 0-1.748-3.458a5.8 5.8 0 0 0-1.508-.822a7.4 7.4 0 0 0-1.629-.438a22 22 0 0 0-2.588-.1H7.769l.006 4.737a89 89 0 0 1 9.91 1.408a5 5 0 0 0 .176-1.327m3.132 3.192a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035"/><path fill="url(#SVGMV3iTbAN)" d="M20.993 18.979a7.9 7.9 0 0 1-2.128 2.582a9.7 9.7 0 0 1-3.256 1.71a11.6 11.6 0 0 1-1.971.472h-.015a32 32 0 0 1-3.326.111l-5.625.022a.616.616 0 0 1-.686-.681l-.01-7.734Q2.992 15.42 2 15.4V30h28v-9.456a85 85 0 0 0-8.59-2.6a7 7 0 0 1-.417 1.035" opacity=".3"/><path fill="#b03931" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z"/><path fill="url(#SVGniw2Mvsa)" d="M10.477 20.835a16 16 0 0 0 2.877-.2a7.6 7.6 0 0 0 1.628-.5a5.6 5.6 0 0 0 1.187-.748a4.46 4.46 0 0 0 1.518-2.271a89 89 0 0 0-9.91-1.408l.006 5.133Z" opacity=".3"/><path fill="#fff" d="M20.383 11.746a7 7 0 0 1 1.36 4.148a6.6 6.6 0 0 1-.1 1.1c.088 0 .176.012.265.012a4.11 4.11 0 0 0 4.276-3.92a4.11 4.11 0 0 0-4.276-3.92a4.47 4.47 0 0 0-2.946 1.083a8 8 0 0 1 1.421 1.497"/><ellipse cx="26.78" cy="8.777" fill="#fff" rx="1.374" ry="1.259"/><path fill="#fff" d="m4.673 23.877l5.625-.022a32 32 0 0 0 3.326-.111h.015a11.5 11.5 0 0 0 1.971-.472a9.7 9.7 0 0 0 3.256-1.71a7.9 7.9 0 0 0 2.128-2.582a7 7 0 0 0 .417-1.034a7 7 0 0 0 .332-2.051a7 7 0 0 0-1.36-4.148a8 8 0 0 0-1.421-1.5a8.9 8.9 0 0 0-2.244-1.359a15.7 15.7 0 0 0-6.067-.95l-6.074.009h-.076a.59.59 0 0 0-.532.562l.009 6.952l.01 7.734a.616.616 0 0 0 .685.682m3.1-12.908h2.619a22 22 0 0 1 2.588.1a7.4 7.4 0 0 1 1.629.438a5.8 5.8 0 0 1 1.508.822a4.12 4.12 0 0 1 1.748 3.458a5 5 0 0 1-.175 1.327a4.46 4.46 0 0 1-1.518 2.271a5.6 5.6 0 0 1-1.187.748a7.7 7.7 0 0 1-1.628.5a16 16 0 0 1-2.877.2H7.786L7.78 15.7Z"/></svg>';case"applescript":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round" d="M14.4561802 11.3673353C13.0276218 14.1261537 11.8858593 15.5 10.8437759 15.5 10.3588459 15.5 9.88231005 15.3491298 9.41749082 15.0543006 8.74000639 14.6241577 7.8668418 14.6059458 7.17068967 15.0074382 6.60881451 15.3319356 6.07177167 15.5 5.56305868 15.5 4.02887542 15.5 1.5 10.9491129 1.5 8.45090396 1.5 5.78581061 2.95006811 3.551507 5.15647301 3.551507 6.19383481 3.551507 7.09007204 4.20001691 7.84308619 4.497206 8.16210316 4.62512517 8.52255587 4.61592787 8.83410596 4.47192 9.44477141 4.18872223 10.2497236 3.551507 11.2503615 3.551507 12.4715175 3.551507 13.5338865 4.33779342 14.4184071 5.47479877 14.5532906 5.64778615 14.5172013 5.89341518 14.3377895 6.02349446 13.3500923 6.736546 12.8746057 7.53893969 12.8746057 8.45090396 12.8746057 9.36404821 13.3502672 10.1652619 14.3377895 10.8793249 14.4946576 10.992887 14.5445377 11.1984946 14.4561802 11.3673353ZM8.5 3C8.5 3 8.3468635 1.3936039 10 1" />\n</svg>\n';case"solidity":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m3 11.5 2.5 4 2.5-4 2.5 4 2.5-4-2.5-4-2.5 4m2.5 4h-5m7.5-4H3m10-7-2.5-4-2.5 4-2.5-4-2.5 4 2.5 4 2.5-4M5.5.5h5M3 4.5h10" />\n</svg>\n';case"objectivec":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M11.29 15.976a8.9 8.9 0 0 0 1.039 4.557a4.82 4.82 0 0 0 5.579 2.13a3.79 3.79 0 0 0 2.734-3.181c.095-.535.1-.54.1-.54c1.537.222 4.014.582 5.55.8l-.1.389A9.96 9.96 0 0 1 23.8 24.9a8.35 8.35 0 0 1-4.747 2.378a12.93 12.93 0 0 1-7.322-.725a8.98 8.98 0 0 1-5.106-5.524A14.35 14.35 0 0 1 6.642 10.9a9.32 9.32 0 0 1 7.929-6.24a11.8 11.8 0 0 1 5.9.491a8.47 8.47 0 0 1 5.456 6.1c.083.311.1.369.1.369c-1.709.311-3.821.705-5.518 1.075c-.323-1.695-1.122-3.029-2.831-3.445a4.656 4.656 0 0 0-5.853 3.158a9 9 0 0 0-.341 1.273a11 11 0 0 0-.194 2.295"/><path fill="#c2c2c2" d="M2.033 30V2h5.934v2.227H4.723v23.546h3.244V30zm27.934-.001h-5.934v-2.228h3.244V4.226h-3.244V1.999h5.934z"/></svg>';case"objectivecpp":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16">\x3c!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --\x3e<path fill="#c2c2c2" d="M19.5 24.833a11.24 11.24 0 0 1-5.13 1.009a8.37 8.37 0 0 1-6.492-2.576A9.75 9.75 0 0 1 5.512 16.4a10.4 10.4 0 0 1 2.659-7.406a9.02 9.02 0 0 1 6.9-2.841a12.2 12.2 0 0 1 4.43.7v4.129a7.5 7.5 0 0 0-4.108-1.142a5.28 5.28 0 0 0-4.075 1.685A6.48 6.48 0 0 0 9.766 16.1a6.37 6.37 0 0 0 1.464 4.4a5.02 5.02 0 0 0 3.941 1.639a8.03 8.03 0 0 0 4.329-1.223Z"/><path fill="#c2c2c2" d="M16.572 15.081V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zm6.44 0V13.24h1.841v1.841h1.84v1.84h-1.84v1.841h-1.841v-1.841h-1.839V15.08zM2.035 30V2.001h5.933v2.227H4.725v23.545h3.243V30z"/><path fill="#c2c2c2" d="M29.965 29.999h-5.933v-2.228h3.243V4.227h-3.243V2h5.933z"/></svg>';case"terraform":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="m1.5 6 8 4.25 4-2.25m-12-2V1.5l8 4.25 4-2.25V8m-4-2.25v8.75M5.53 3.82 5.5 12.5l4 2" />\n</svg>\n';case"plain":case"text":case"":return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">\n <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />\n <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />\n </g>\n</svg>\n';default:return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">\x3c!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --\x3e<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>'}}const Ht={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown","":"Plain Text",plain:"Plain Text"};function Nt(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(n){}return globalThis.setTimeout(e,0)}const zt=()=>import("mermaid");let Dt=null,Pt=zt;function At(e){Pt=e,Dt=null}function Rt(e){At(null!=e?e:zt)}function Ot(){At(null)}function Vt(){return"function"==typeof Pt}function Kt(e){if(!e)return e;const n=e&&e.default?e.default:e;if(n&&("function"==typeof n.render||"function"==typeof n.parse||"function"==typeof n.initialize))return n;if(n&&n.mermaidAPI&&("function"==typeof n.mermaidAPI.render||"function"==typeof n.mermaidAPI.parse)){const e=n.mermaidAPI;return s(i({},n),{render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:t=>"function"==typeof n.initialize?n.initialize(t):e.initialize?e.initialize(t):void 0})}return e.mermaid&&"function"==typeof e.mermaid.render?e.mermaid:n}function Wt(e){if(e)try{const n=null==e?void 0:e.initialize;e.initialize=t=>{const o=i({suppressErrorRendering:!0},t||{});return"function"==typeof n?n.call(e,o):(null==e?void 0:e.mermaidAPI)&&"function"==typeof e.mermaidAPI.initialize?e.mermaidAPI.initialize(o):void 0}}catch(n){}}let Ft=null,Ut=null;const Xt=/* @__PURE__ */new Map;let qt=5,Zt=!1;function Gt(e){Zt=!!e}function Yt(e){Number.isFinite(e)&&e>0&&(qt=Math.floor(e))}function Jt(){return{inFlight:Xt.size,max:qt}}const Qt="WORKER_BUSY",eo="MERMAID_DISABLED";function no(e){Ft=e,Ut=null;const n=e;Ft.onmessage=e=>{if(Ft!==n)return;const{id:t,ok:o,result:l,error:r}=e.data,a=Xt.get(t);a&&(!1===o||r?a.reject(new Error(r||"Unknown error")):a.resolve(l))},Ft.onerror=e=>{var t,o;if(Ft===n)if(0!==Xt.size){try{Zt?console.error("[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker error:",(null==e?void 0:e.message)||e)}catch(l){}for(const[n,t]of Xt.entries())t.reject(new Error(`Worker error: ${e.message}`));Xt.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Ft.onmessageerror=e=>{var t,o;if(Ft===n)if(0!==Xt.size){try{Zt?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(l){}for(const[e,n]of Xt.entries())n.reject(new Error("Worker messageerror"));Xt.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function to(){var e;if(Ft)try{for(const[e,n]of Xt.entries())n.reject(new Error("Worker cleared"));Xt.clear(),null==(e=Ft.terminate)||e.call(Ft)}catch(n){}Ft=null,Ut=null}function oo(e,n,t=1400){if(!Vt()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=eo,Promise.reject(e)}if(Ut)return Promise.reject(Ut);const o=Ft||(Ut=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Ut.name="WorkerInitError",Ut.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Ut);if(Xt.size>=qt){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Qt,e.inFlight=Xt.size,e.max=qt,Promise.reject(e)}return new Promise((l,r)=>{const a=Math.random().toString(36).slice(2);let i,s=!1;const u=()=>{s||(s=!0,null!=i&&globalThis.clearTimeout(i),Xt.delete(a))},d={resolve:e=>{u(),l(e)},reject:e=>{u(),r(e)}};Xt.set(a,d);try{o.postMessage({id:a,action:e,payload:n})}catch(c){return Xt.delete(a),void r(c)}i=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const n=Xt.get(a);n&&n.reject(e)},t)})}function lo(e,n,t=1400){return u(this,null,function*(){try{return yield oo("canParse",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function ro(e,n,t=1400){return u(this,null,function*(){try{return yield oo("findPrefix",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function ao(){if(Ft)try{for(const[e,n]of Xt.entries())n.reject(new Error("Worker terminated"));Xt.clear(),Ft.terminate()}finally{Ft=null}}const io={key:0},so={key:1,class:"flex items-center space-x-2 overflow-hidden"},uo=["src"],co={key:2},mo={class:"flex items-center space-x-1"},vo={class:"flex items-center space-x-1"},ho={key:4},po={key:5,class:"flex items-center space-x-1"},fo=["aria-pressed"],go={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},wo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},yo=["disabled"],ko=["disabled"],xo={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},bo={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},Mo={key:1,class:"relative"},_o={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},Bo={class:"flex items-center gap-2 backdrop-blur rounded-lg"},Co={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},To=/* @__PURE__ */te(/* @__PURE__ */v({__name:"MermaidBlockNode",props:{node:{},maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!1}},emits:["copy","export","openModal","toggleMode"],setup(e,{emit:n}){var t,o;const l=e,r=n,a={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},d=M(!1),c=S(()=>l.isStrict?"strict":"loose"),m=S(()=>({startOnLoad:!1,securityLevel:c.value,dompurifyConfig:"strict"===c.value?a:void 0,flowchart:"strict"===c.value?{htmlLabels:!1}:void 0})),v=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],f=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function k(e){if(!e)return"";const n=e.trim();return f.test(n)?n:""}function x(e){if(e)try{e.replaceChildren()}catch(n){e.innerHTML=""}}function I(e,n){if(!e)return"";if("strict"===c.value)return function(e,n){if(!e)return"";try{e.replaceChildren()}catch(o){e.innerHTML=""}const t=function(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return null;if(!e)return null;const n=e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),t=(new DOMParser).parseFromString(n,"image/svg+xml").documentElement;if(!t||"svg"!==t.nodeName.toLowerCase())return null;const o=t;return function(e){const n=/* @__PURE__ */new Set(["script"]),t=[e,...Array.from(e.querySelectorAll("*"))];for(const o of t){if(n.has(o.tagName.toLowerCase())){o.remove();continue}const e=Array.from(o.attributes);for(const n of e){const e=n.name;if(/^on/i.test(e))o.removeAttribute(e);else{if("style"===e&&n.value){const t=n.value;if(v.some(e=>e.test(t))){o.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&n.value){const t=k(n.value);if(!t){o.removeAttribute(e);continue}t!==n.value&&o.setAttribute(e,t)}}}}}(o),o}(n);return t?(e.appendChild(t),e.innerHTML):""}(e,n);try{e.replaceChildren()}catch(t){e.innerHTML=""}if(n)try{e.insertAdjacentHTML("afterbegin",n)}catch(t){e.innerHTML=n}return e.innerHTML}const{t:L}=Ve();function $(){return u(this,null,function*(){try{const e=yield function(){return u(this,null,function*(){if(Dt)return Dt;const e=function(){try{const e=globalThis;return Kt(null==e?void 0:e.mermaid)}catch(e){return null}}();if(e)return Dt=e,Wt(Dt),Dt;const n=Pt;if(!n)return null;let t;try{t=yield n()}catch(o){if(n===zt)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return t?(Dt=Kt(t),Wt(Dt),Dt):null})}();return d.value=!!e,e}catch(e){throw d.value=!1,e}})}"undefined"!=typeof window&&u(null,null,function*(){var e;try{const n=yield $();if(!n)return;null==(e=null==n?void 0:n.initialize)||e.call(n,i({},m.value))}catch(n){d.value=!1,console.warn("[markstream-vue] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",n)}});const j=M(!1),P=M(!1),A=M(),R=M(),V=M(),K=M(null),F=We(),U=M(null),X=M("undefined"==typeof window),ne=M(),te=S(()=>l.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),oe=M(1),le=M(0),re=M(0),ae=M(!1),ie=M({x:0,y:0}),se=M(!1),ue=M(!1),de=M(!1),ce=M(null),me=M(0),ve=M(!1);let he=null,pe=null,fe=0;const ge=null!=(t=globalThis.requestIdleCallback)?t:(e,n)=>setTimeout(()=>e({didTimeout:!0}),16),we=function(){let e=null;return(...n)=>{e&&clearTimeout(e),e=setTimeout(()=>(()=>{ge(()=>{bn()},{timeout:500})})(...n),300)}}();function ye(){null!=pe&&(globalThis.clearTimeout(pe),pe=null)}function ke(e=600){if("undefined"==typeof globalThis)return;const n=Math.max(0,e);ye(),pe=globalThis.setTimeout(()=>{pe=null,l.loading||de.value||!X.value?ke(Math.min(1200,Math.max(300,1.2*n))):we()},n)}const xe=M("360px");let be=null;const Me=M(!1),_e=M(!1),Be=M({}),Ce=M(null),Te=M(""),Ie=M(0);let Le=null;const $e=M(!1),je=M({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),Se=S(()=>l.enableWheelZoom?{wheel:pn}:{}),Ee=S(()=>{var e,n,t,o;return{worker:null!=(e=l.workerTimeoutMs)?e:1400,parse:null!=(n=l.parseTimeoutMs)?n:1800,render:null!=(t=l.renderTimeoutMs)?t:2500,fullRender:null!=(o=l.fullRenderTimeoutMs)?o:4e3}}),He=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let Ne=null,ze=null,De=!1,Re=800,Oe=null,Ke=0,Fe=!0;function Ue(e,n){const t=null==n?void 0:n.timeoutMs,o=null==n?void 0:n.signal;if(null==o?void 0:o.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let l=null,r=!1,a=null;return new Promise((n,i)=>{const s=()=>{null!=l&&clearTimeout(l),a&&o&&o.removeEventListener("abort",a)};t&&t>0&&(l=globalThis.setTimeout(()=>{r||(r=!0,s(),i(new Error("Operation timed out")))},t)),o&&(a=()=>{r||(r=!0,s(),i(new DOMException("Aborted","AbortError")))},o.addEventListener("abort",a)),e().then(e=>{r||(r=!0,s(),n(e))}).catch(e=>{r||(r=!0,s(),i(e))})})}function Xe(e){if("undefined"==typeof document)return;if(!R.value)return;const n=document.createElement("div");n.className="text-red-500 p-4",n.textContent="Failed to render diagram: ";const t=document.createElement("span");t.textContent=e instanceof Error?e.message:"Unknown error",n.appendChild(t),x(R.value),R.value.appendChild(n),xe.value="360px",$e.value=!0,Mn()}function qe(e){return!e||e.disabled}function Ze(e,n,t="top"){if(qe(e.currentTarget))return;const o=e,r=null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0;Pe(e.currentTarget,n,t,!1,r,l.isDark)}function Ge(){Ae()}function Ye(e){if(qe(e.currentTarget))return;const n=j.value?L("common.copied")||"Copied":L("common.copy")||"Copy",t=e,o=null!=(null==t?void 0:t.clientX)&&null!=(null==t?void 0:t.clientY)?{x:t.clientX,y:t.clientY}:void 0;Pe(e.currentTarget,n,"top",!1,o,l.isDark)}function Je(e,n){const t=`%%{init: {"theme": "${"dark"===n?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:t+e}function Qe(){return Fe&&!se.value&&!Me.value&&!$e.value}function en(e){const n=e.split(/\r?\n/);for(;n.length>0;){const e=n[n.length-1].trimEnd();if(""!==e){if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;n.pop()}else n.pop()}return n.join("\n")}function nn(e,n,t){return u(this,null,function*(){var o;try{return yield lo(e,n,null!=(o=null==t?void 0:t.timeoutMs)?o:Ee.value.worker)}catch(l){return yield function(e,n,t){return u(this,null,function*(){var o,l;const r=yield $();if(!r)return;const a=r,i=Je(e,n);if("function"==typeof a.parse)return yield Ue(()=>a.parse(i),{timeoutMs:null!=(o=null==t?void 0:t.timeoutMs)?o:Ee.value.parse,signal:null==t?void 0:t.signal}),!0;const s=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield Ue(()=>r.render(s,i),{timeoutMs:null!=(l=null==t?void 0:t.timeoutMs)?l:Ee.value.render,signal:null==t?void 0:t.signal}),!0})}(e,n,t)}})}"undefined"!=typeof window&&B(()=>A.value,e=>{var n;if(null==(n=U.value)||n.destroy(),U.value=null,!e)return void(X.value=!1);const t=F(e,{rootMargin:"400px"});U.value=t,X.value=t.isVisible.value,t.whenVisible.then(()=>{X.value=!0})},{immediate:!0}),C(()=>{var e;null==(e=U.value)||e.destroy(),U.value=null});const tn=S(()=>se.value||de.value||P.value);function on(e){if(!A.value||!R.value)return;const n=R.value.querySelector("svg");if(!n)return;let t=0,o=0;const l=n.getAttribute("viewBox"),r=n.getAttribute("width"),a=n.getAttribute("height");if(l){const e=l.split(" ");4===e.length&&(t=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(t&&o||r&&a&&(t=Number.parseFloat(r),o=Number.parseFloat(a)),Number.isNaN(t)||Number.isNaN(o)||t<=0||o<=0)try{const e=n.getBBox();e&&e.width>0&&e.height>0&&(t=e.width,o=e.height)}catch(i){return void console.error("Failed to get SVG BBox:",i)}if(t>0&&o>0){const n=o/t;let l=(null!=e?e:A.value.clientWidth)*n;l>o&&(l=o),xe.value=`${l}px`}}const ln=M(!1),rn=S(()=>({transform:`translate(${le.value}px, ${re.value}px) scale(${oe.value})`}));function an(e){"Escape"===e.key&&ln.value&&sn()}function sn(){if(ln.value=!1,V.value&&x(V.value),K.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",an)}catch(e){}}function un(){oe.value<3&&(oe.value+=.1)}function dn(){oe.value>.5&&(oe.value-=.1)}function cn(){oe.value=1,le.value=0,re.value=0}function mn(e){ae.value=!0,e instanceof MouseEvent?ie.value={x:e.clientX-le.value,y:e.clientY-re.value}:ie.value={x:e.touches[0].clientX-le.value,y:e.touches[0].clientY-re.value}}function vn(e){if(!ae.value)return;let n,t;e instanceof MouseEvent?(n=e.clientX,t=e.clientY):(n=e.touches[0].clientX,t=e.touches[0].clientY),le.value=n-ie.value.x,re.value=t-ie.value.y}function hn(){ae.value=!1}function pn(e){if(l.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!A.value)return;const n=A.value.getBoundingClientRect(),t=e.clientX-n.left,o=e.clientY-n.top,l=t-n.width/2,r=o-n.height/2,a=(l-le.value)/oe.value,i=(r-re.value)/oe.value,s=.01,u=-e.deltaY*s,d=Math.min(Math.max(oe.value+u,.5),3);d!==oe.value&&(le.value=l-a*d,re.value=r-i*d,oe.value=d)}}function fn(){return u(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(te.value)),j.value=!0,r("copy",te.value),setTimeout(()=>{j.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})}function gn(){var e;const n=null==(e=R.value)?void 0:e.querySelector("svg");if(!n)return void console.error("SVG element not found");const t=(new XMLSerializer).serializeToString(n),o={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:t};r("export",o),o.defaultPrevented||function(e,n=null){u(this,null,function*(){try{const o=null!=n?n:(new XMLSerializer).serializeToString(e),l=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(l);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(t){}URL.revokeObjectURL(r)}}catch(o){console.error("Failed to export SVG:",o)}})}(n,t)}function wn(){var e,n;const t=null!=(n=null==(e=R.value)?void 0:e.querySelector("svg"))?n:null,o=t?(new XMLSerializer).serializeToString(t):null,l={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:t,svgString:o};r("openModal",l),l.defaultPrevented||function(){if(ln.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",an)}catch(e){}q(()=>{if(A.value&&V.value){const e=A.value.cloneNode(!0);e.classList.add("fullscreen");const n=e.querySelector("[data-mermaid-wrapper]");n&&(K.value=n,n.style.transform=rn.value.transform),x(V.value),V.value.appendChild(e)}})}()}function yn(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};r("toggleMode",e,n),n.defaultPrevented||kn(e)}function kn(e){return u(this,null,function*(){const n=ne.value;if(!n)return ue.value=!0,void(se.value="source"===e);const t=n.getBoundingClientRect().height;n.style.height=`${t}px`,n.style.overflow="hidden",ue.value=!0,se.value="source"===e,yield q();const o=n.scrollHeight;n.style.transition="height 180ms ease",n.offsetHeight,n.style.height=`${o}px`;const l=()=>{n.style.transition="",n.style.height="",n.style.overflow="",n.removeEventListener("transitionend",r)};function r(){l()}n.addEventListener("transitionend",r),setTimeout(()=>l(),220)})}function xn(){return u(this,null,function*(){return de.value?ce.value:R.value||(yield q(),R.value)?(de.value=!0,ce.value=u(null,null,function*(){var e;R.value&&(R.value.style.opacity="0");try{const n=yield $();if(!n)return;const t=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;Me.value||_e.value||null==(e=n.initialize)||e.call(n,s(i({},m.value),{dompurifyConfig:i({},a)}));const o=function(e,n=te.value){const t=n,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return t.trim().startsWith("%%{")?t:o+t}(l.isDark?"dark":"light"),r=yield Ue(()=>n.render(t,o),{timeoutMs:Ee.value.fullRender}),u=null==r?void 0:r.svg;if(R.value){const e=I(R.value,u);Me.value||_e.value||(on(),Me.value=!0,je.value={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:xe.value});const n=l.isDark?"dark":"light";e&&(Be.value[n]=e),_e.value&&(_e.value=!1),$e.value=!1,fe=0,ye()}}catch(n){const e=function(e){const n="string"==typeof e?e:"string"==typeof(null==e?void 0:e.message)?e.message:"";return"string"==typeof n&&/timed out/i.test(n)}(n),t=fe+1;e&&t<=3?(fe=t,ke(Math.min(1200,600*t))):(fe=0,ye(),console.error("Failed to render mermaid diagram:",n),!1===l.loading&&Xe(n))}finally{yield q(),R.value&&(R.value.style.opacity="1"),de.value=!1,ce.value=null}}),ce.value):void console.warn("Mermaid container not ready")})}function bn(){return u(this,null,function*(){var e,n;const t=Date.now(),o=++Ie.value;Le&&Le.abort(),Le=new AbortController;const r=Le.signal,a=l.isDark?"dark":"light",i=te.value,s=i.replace(/\s+/g,"");if(!i.trim())return R.value&&x(R.value),Ce.value=null,Te.value="",void($e.value=!1);if(s===Te.value)return;try{const d=yield function(e,n,t){return u(this,null,function*(){var o;try{if(yield nn(e,n,t))return{fullOk:!0,prefixOk:!1}}catch(r){if("AbortError"===(null==r?void 0:r.name))throw r}let l=en(e);if(l&&l.trim()&&l!==e)try{try{const r=yield ro(e,n,null!=(o=null==t?void 0:t.timeoutMs)?o:Ee.value.worker);r&&r.trim()&&(l=r)}catch(r){}if(yield nn(l,n,t))return{fullOk:!1,prefixOk:!0,prefix:l}}catch(r){if("AbortError"===(null==r?void 0:r.name))throw r}return{fullOk:!1,prefixOk:!1}})}(i,a,{signal:r,timeoutMs:Ee.value.worker});if(d.fullOk)return yield xn(),void(Ie.value===o&&(Ce.value=null!=(n=null==(e=R.value)?void 0:e.innerHTML)?n:null,Te.value=s,$e.value=!1));const c=Ke&&t<=Ke;if(d.prefixOk&&d.prefix&&Qe()&&!c)return void(yield function(e){return u(this,null,function*(){if(Qe()&&(R.value||(yield q(),R.value))&&!de.value){de.value=!0;try{const n=yield $();if(!n)return;const t=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,o=l.isDark?"dark":"light",r=en(e),a=Je(r&&r.trim()?r:e,o);R.value&&(R.value.style.opacity="0");const i=yield Ue(()=>n.render(t,a),{timeoutMs:Ee.value.render}),s=null==i?void 0:i.svg;R.value&&s&&(I(R.value,s),on())}catch(n){}finally{yield q(),R.value&&(R.value.style.opacity="1"),de.value=!1}}})}(d.prefix))}catch(c){if("AbortError"===(null==c?void 0:c.name))return}if(Ie.value!==o)return;if($e.value)return;const d=Be.value[a];d&&R.value&&I(R.value,d)})}function Mn(){De&&(De=!1,Re=800,Fe=!1,Oe&&(Oe.abort(),Oe=null),Ne&&(globalThis.clearTimeout(Ne),Ne=null),ze&&(He(ze),ze=null),Ke=Date.now())}function _n(){if(Mn(),Le){try{Le.abort()}catch(e){}Le=null}if(Oe){try{Oe.abort()}catch(e){}Oe=null}ao(),ye(),fe=0}function Bn(e=800){De&&(Ne&&globalThis.clearTimeout(Ne),Ne=globalThis.setTimeout(()=>{ze=ge(()=>u(null,null,function*(){if(!De)return;if(se.value||Me.value)return void Mn();const e=l.isDark?"dark":"light",n=te.value;if(n.trim()){Oe&&Oe.abort(),Oe=new AbortController;try{if((yield nn(n,e,{signal:Oe.signal,timeoutMs:Ee.value.worker}))&&(yield xn(),Me.value))return void Mn()}catch(t){}Re=Math.min(Math.floor(1.5*Re),4e3),Bn(Re)}else Bn(Re)}),{timeout:500})},e))}function Cn(){De||se.value||Me.value||(De=!0,Ke=0,Fe=!0,Bn(500))}B(rn,e=>{ln.value&&K.value&&(K.value.style.transform=e.transform)},{immediate:!0}),B(()=>te.value,()=>{Me.value=!1,Be.value={},we(),!se.value&&d.value&&Cn(),function(){if(!se.value)return;if(!d.value)return;const e=te.value.length;e!==me.value&&(ve.value=!0,me.value=e,he&&clearTimeout(he),he=setTimeout(()=>{ve.value&&se.value&&te.value.trim()&&(ve.value=!1,kn("preview"))},500))}()}),B(()=>l.isDark,()=>u(null,null,function*(){if(!Me.value)return;if($e.value)return;const e=l.isDark?"dark":"light",n=Be.value[e];if(n)return void(R.value&&I(R.value,n));const t={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:xe.value},o=1!==oe.value||0!==le.value||0!==re.value;_e.value=!0,o&&(oe.value=1,le.value=0,re.value=0,yield q()),yield xn(),o&&(yield q(),oe.value=t.zoom,le.value=t.translateX,re.value=t.translateY,xe.value=t.containerHeight,je.value=t)})),B(()=>se.value,e=>u(null,null,function*(){if(e)Mn(),Me.value&&(je.value={zoom:oe.value,translateX:le.value,translateY:re.value,containerHeight:xe.value});else{if($e.value)return;const e=l.isDark?"dark":"light";if(Me.value&&Be.value[e])return yield q(),R.value&&I(R.value,Be.value[e]),oe.value=je.value.zoom,le.value=je.value.translateX,re.value=je.value.translateY,void(xe.value=je.value.containerHeight);if(yield q(),!d.value)return;yield bn(),Cn()}})),B(()=>l.loading,(e,n)=>u(null,null,function*(){if(!0===n&&!1===e){const e=te.value.trim();if(!e)return _n();const n=l.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(Me.value&&o===Te.value)return yield q(),R.value&&!R.value.querySelector("svg")&&Be.value[n]&&I(R.value,Be.value[n]),void _n();try{yield nn(e,n,{timeoutMs:Ee.value.worker}),yield xn(),Te.value=o,$e.value=!1,_n()}catch(t){_n(),Xe(t)}}})),B(A,e=>{be&&be.disconnect(),!e||Me.value||_e.value||(be=new ResizeObserver(e=>{e&&e.length>0&&!Me.value&&!_e.value&&Nt(()=>{on(e[0].contentRect.width)})}),be.observe(e))},{immediate:!0}),_(()=>u(null,null,function*(){yield q(),ue.value||(se.value=!d.value),X.value&&(we(),me.value=te.value.length)})),B(()=>d.value,e=>{ue.value||(se.value=!e)}),B(()=>X.value,e=>{e&&(Me.value||(we(),me.value=te.value.length),l.loading||Me.value||we())},{immediate:!1}),Y(()=>{he&&clearTimeout(he),be&&be.disconnect(),Le&&(Le.abort(),Le=null),ao(),Mn(),ye()}),B(()=>P.value,e=>u(null,null,function*(){e?(Mn(),Le&&Le.abort()):Me.value||(yield q(),we(),se.value||Cn())}),{immediate:!1});const Tn=S(()=>l.isDark?"mermaid-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"mermaid-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700");return(e,n)=>(p(),h("div",{class:T(["my-4 rounded-lg border overflow-hidden shadow-sm",[l.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":l.loading}]])},[l.showHeader?(p(),h("div",{key:0,class:T(["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",l.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"])},[e.$slots["header-left"]?(p(),h("div",io,[D(e.$slots,"header-left",{},void 0,!0)])):(p(),h("div",so,[y("img",{src:w("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%3e%3cpath%20fill='none'%20stroke='%23ca9ee6'%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M1.5%202.5c0%206%202.25%205.75%204%207%20.83.67%201.17%202%201%204h3c-.17-2%20.17-3.33%201-4%201.75-1.25%204-1%204-7C12%202.5%2010%203%208%207%206%203%204%202.5%201.5%202.5'%20/%3e%3c/svg%3e"),class:"w-4 h-4 my-0",alt:"Mermaid"},null,8,uo),y("span",{class:T(["text-sm font-medium font-mono truncate",l.isDark?"text-gray-400":"text-gray-600"])},"Mermaid",2)])),e.$slots["header-center"]?(p(),h("div",co,[D(e.$slots,"header-center",{},void 0,!0)])):l.showModeToggle&&d.value?(p(),h("div",{key:3,class:T(["flex items-center space-x-1 rounded-md p-0.5",l.isDark?"bg-gray-700":"bg-gray-100"])},[y("button",{class:T(["px-2.5 py-1 text-xs rounded transition-colors",[se.value?l.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":l.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"]]),onClick:n[0]||(n[0]=()=>yn("preview")),onMouseenter:n[1]||(n[1]=e=>Ze(e,w(L)("common.preview")||"Preview")),onFocus:n[2]||(n[2]=e=>Ze(e,w(L)("common.preview")||"Preview")),onMouseleave:Ge,onBlur:Ge},[y("div",mo,[n[21]||(n[21]=y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),y("circle",{cx:"12",cy:"12",r:"3"})])],-1)),y("span",null,b(w(L)("common.preview")||"Preview"),1)])],34),y("button",{class:T(["px-2.5 py-1 text-xs rounded transition-colors",[se.value?l.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":l.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"]]),onClick:n[3]||(n[3]=()=>yn("source")),onMouseenter:n[4]||(n[4]=e=>Ze(e,w(L)("common.source")||"Source")),onFocus:n[5]||(n[5]=e=>Ze(e,w(L)("common.source")||"Source")),onMouseleave:Ge,onBlur:Ge},[y("div",vo,[n[22]||(n[22]=y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"})],-1)),y("span",null,b(w(L)("common.source")||"Source"),1)])],34)],2)):E("",!0),e.$slots["header-right"]?(p(),h("div",ho,[D(e.$slots,"header-right",{},void 0,!0)])):(p(),h("div",po,[l.showCollapseButton?(p(),h("button",{key:0,class:T(Tn.value),"aria-pressed":P.value,onClick:n[6]||(n[6]=e=>P.value=!P.value),onMouseenter:n[7]||(n[7]=e=>Ze(e,P.value?w(L)("common.expand")||"Expand":w(L)("common.collapse")||"Collapse")),onFocus:n[8]||(n[8]=e=>Ze(e,P.value?w(L)("common.expand")||"Expand":w(L)("common.collapse")||"Collapse")),onMouseleave:Ge,onBlur:Ge},[(p(),h("svg",{style:z({rotate:P.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...n[23]||(n[23]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],42,fo)):E("",!0),l.showCopyButton?(p(),h("button",{key:1,class:T(Tn.value),onClick:fn,onMouseenter:n[9]||(n[9]=e=>Ye(e)),onFocus:n[10]||(n[10]=e=>Ye(e)),onMouseleave:Ge,onBlur:Ge},[j.value?(p(),h("svg",wo,[...n[25]||(n[25]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(p(),h("svg",go,[...n[24]||(n[24]=[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),y("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],34)):E("",!0),l.showExportButton&&d.value?(p(),h("button",{key:2,class:T(`${Tn.value} ${tn.value?"opacity-50 cursor-not-allowed":""}`),disabled:tn.value,onClick:gn,onMouseenter:n[11]||(n[11]=e=>Ze(e,w(L)("common.export")||"Export")),onFocus:n[12]||(n[12]=e=>Ze(e,w(L)("common.export")||"Export")),onMouseleave:Ge,onBlur:Ge},[...n[26]||(n[26]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),y("path",{d:"m7 10l5 5l5-5"})])],-1)])],42,yo)):E("",!0),l.showFullscreenButton&&d.value?(p(),h("button",{key:3,class:T(`${Tn.value} ${tn.value?"opacity-50 cursor-not-allowed":""}`),disabled:tn.value,onClick:wn,onMouseenter:n[13]||(n[13]=e=>Ze(e,ln.value?w(L)("common.minimize")||"Minimize":w(L)("common.open")||"Open")),onFocus:n[14]||(n[14]=e=>Ze(e,ln.value?w(L)("common.minimize")||"Minimize":w(L)("common.open")||"Open")),onMouseleave:Ge,onBlur:Ge},[ln.value?(p(),h("svg",bo,[...n[28]||(n[28]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(p(),h("svg",xo,[...n[27]||(n[27]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])]))],42,ko)):E("",!0)]))],2)):E("",!0),Z(y("div",{ref_key:"modeContainerRef",ref:ne},[se.value?(p(),h("div",{key:0,class:T(["p-4",l.isDark?"bg-gray-900":"bg-gray-50"])},[y("pre",{class:T(["text-sm font-mono whitespace-pre-wrap",l.isDark?"text-gray-300":"text-gray-700"])},b(te.value),3)],2)):(p(),h("div",Mo,[l.showZoomControls?(p(),h("div",_o,[y("div",Bo,[y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:un,onMouseenter:n[15]||(n[15]=e=>Ze(e,w(L)("common.zoomIn")||"Zoom in")),onFocus:n[16]||(n[16]=e=>Ze(e,w(L)("common.zoomIn")||"Zoom in")),onMouseleave:Ge,onBlur:Ge},[...n[29]||(n[29]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("circle",{cx:"11",cy:"11",r:"8"}),y("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],34),y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:dn,onMouseenter:n[17]||(n[17]=e=>Ze(e,w(L)("common.zoomOut")||"Zoom out")),onFocus:n[18]||(n[18]=e=>Ze(e,w(L)("common.zoomOut")||"Zoom out")),onMouseleave:Ge,onBlur:Ge},[...n[30]||(n[30]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("circle",{cx:"11",cy:"11",r:"8"}),y("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],34),y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:cn,onMouseenter:n[19]||(n[19]=e=>Ze(e,w(L)("common.resetZoom")||"Reset zoom")),onFocus:n[20]||(n[20]=e=>Ze(e,w(L)("common.resetZoom")||"Reset zoom")),onMouseleave:Ge,onBlur:Ge},b(Math.round(100*oe.value))+"% ",35)])])):E("",!0),y("div",W({ref_key:"mermaidContainer",ref:A,class:["min-h-[360px] relative transition-all duration-100 overflow-hidden block",l.isDark?"bg-gray-900":"bg-gray-50"],style:{height:xe.value}},J(Se.value,!0),{onMousedown:mn,onMousemove:vn,onMouseup:hn,onMouseleave:hn,onTouchstartPassive:mn,onTouchmovePassive:vn,onTouchendPassive:hn}),[y("div",{"data-mermaid-wrapper":"",class:T(["absolute inset-0 cursor-grab",{"cursor-grabbing":ae.value}]),style:z(rn.value)},[y("div",{ref_key:"mermaidContent",ref:R,class:"_mermaid w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],16),(p(),O(Q,{to:"body"},[g(H,{name:"mermaid-dialog",appear:""},{default:N(()=>[ln.value?(p(),h("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:ee(sn,["self"])},[y("div",{class:T(["dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",l.isDark?"bg-gray-900":"bg-white"])},[y("div",Co,[y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:un},[...n[31]||(n[31]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("circle",{cx:"11",cy:"11",r:"8"}),y("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],2),y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:dn},[...n[32]||(n[32]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("circle",{cx:"11",cy:"11",r:"8"}),y("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],2),y("button",{class:T(["p-2 text-xs rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:cn},b(Math.round(100*oe.value))+"% ",3),y("button",{class:T(["inline-flex items-center justify-center p-2 rounded transition-colors",[l.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:sn},[...n[33]||(n[33]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"})],-1)])],2)]),y("div",W({ref_key:"modalContent",ref:V,class:"w-full h-full flex items-center justify-center p-4 overflow-hidden"},J(Se.value,!0),{onMousedown:mn,onMousemove:vn,onMouseup:hn,onMouseleave:hn,onTouchstartPassive:mn,onTouchmovePassive:vn,onTouchendPassive:hn}),null,16)],2)])):E("",!0)]),_:1})]))]))],512),[[G,!P.value]])],2))}}),[["__scopeId","data-v-3636e700"]]);To.install=e=>{e.component(To.__name,To)};const Io=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:To},Symbol.toStringTag,{value:"Module"})),Lo={key:0,class:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},$o={class:"flex items-center space-x-2"},jo=["innerHTML"],So={class:"text-sm font-medium font-mono"},Eo={class:"flex items-center space-x-2"},Ho=["aria-pressed"],No=["disabled"],zo=["disabled"],Do=["disabled"],Po=["aria-label"],Ao={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},Ro={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},Oo=["aria-pressed"],Vo={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},Ko={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},Wo=["aria-label"],Fo=["innerHTML"],Uo={class:"code-loading-placeholder"},Xo=/* @__PURE__ */te(/* @__PURE__ */v({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(e,{emit:n}){var t;const o=e,l=n,{t:r}=Ve(),a=M(String(null!=(t=o.node.language)?t:"")),i=M(!1),s=M(!1),d=M(!1),c=M(null),m=M(null),v=M(""),f=M(!1);let g;const x=M(!0),C=M(0),I=M(14),L=M(I.value),$=S(()=>{const e=I.value,n=L.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof n&&Number.isFinite(n)&&n>0}),j=S(()=>{const e=a.value.trim().toLowerCase();return Ht[e]||e.charAt(0).toUpperCase()+e.slice(1)}),H=S(()=>"mermaid"===a.value.trim().toLowerCase()),N=S(()=>Et(a.value.trim().toLowerCase().split(":")[0])),P=S(()=>{const e=a.value.trim().toLowerCase();return o.isShowPreview&&("html"===e||"svg"===e)}),A=S(()=>{const e={},n=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},t=n(o.minWidth),l=n(o.maxWidth);return t&&(e.minWidth=t),l&&(e.maxWidth=l),e}),R=S(()=>({fontSize:`${L.value}px`}));function V(){return o.isDark?o.darkTheme:o.lightTheme}function K(e){if(null==g||g.disconnect(),g=void 0,!e)return v.value="",void(f.value=!1);var n;v.value=`<pre class="shiki shiki-fallback"><code>${n=e,n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code></pre>`,f.value=!1}function W(){v.value="",f.value=!0}function F(){var e;const n=m.value;return!!n&&(n.childNodes.length>0||Boolean(null==(e=n.textContent)?void 0:e.trim().length))}function U(){return u(this,null,function*(){if(yield q(),F())return void W();const e=m.value;e&&(null==g||g.disconnect(),g=new MutationObserver(()=>{F()&&(W(),null==g||g.disconnect(),g=void 0)}),g.observe(e,{childList:!0,subtree:!0}))})}let X,Y,J,Q,ee=()=>{};const ne=/* @__PURE__ */new Set,te=/* @__PURE__ */new Set,oe=void 0!==import.meta&&Boolean(!1);function le(e,n){return u(this,null,function*(){if(!X)return;const t=function(e,n=!1){var t;const[o]=String(null!=e?e:"").split(":"),l=null!=(t=null==o?void 0:o.trim().toLowerCase())?t:"";return l?!Q||Q.has(l)?l:(n&&oe&&!ne.has(l)&&(ne.add(l),console.warn(`[MarkdownCodeBlockNode] Language "${l}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}(n,Boolean(e&&e.length));try{yield X.updateCode(e,t)}catch(o){"plaintext"!==t?(oe&&!te.has(t)&&(te.add(t),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${t}", retrying as plaintext.`,o)),yield X.updateCode(e,"plaintext")):oe&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o)}})}function re(){return u(this,null,function*(){if(H.value)return ee(),null==X||X.dispose(),X=void 0,void(f.value=!1);yield function(){return u(this,null,function*(){if(!Y)try{const e=yield import("stream-markdown");Y=e.createShikiStreamRenderer,J=e.registerHighlight,ee=e.disposeHighlighter;const n=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;Q=n?new Set(n.map(e=>e.toLowerCase())):void 0,null==J||J({themes:o.themes})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}(),c.value&&m.value?(null==J||J({themes:o.themes}),!X&&Y&&(X=Y(m.value,{theme:V()}),f.value=!0),X?!1===o.stream&&o.loading?K(o.node.code):(K(o.node.code),yield le(o.node.code,a.value),yield U()):K(o.node.code)):K(o.node.code)})}re(),_(()=>{re()}),B(()=>o.themes,()=>u(null,null,function*(){J&&J({themes:o.themes})})),B(()=>o.loading,e=>{e||re()}),B(()=>[o.node.code,o.node.language],e=>u(null,[e],function*([e,n]){if(n!==a.value&&(a.value=n.trim()),c.value&&m.value){if(H.value)return ee(),void(null==X||X.dispose());X||(K(e),yield re()),X&&e&&(!1===o.stream&&o.loading||(K(e),yield le(e,n),yield U()))}else K(e)}));const ae=B(()=>[o.darkTheme,o.lightTheme],()=>u(null,null,function*(){if(c.value&&m.value){if(H.value)return ee(),null==X||X.dispose(),ae();X||(yield re()),null==X||X.setTheme(V())}}));function ie(){const e=c.value;if(!e||s.value)return;const n=e.scrollTop;n<C.value?x.value=!1:function(e,n=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=n}(e)&&(x.value=!0),C.value=n}function se(){return u(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(o.node.code)),i.value=!0,l("copy",o.node.code),setTimeout(()=>{i.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function ue(e){return!e||e.disabled}function de(e,n,t="top"){if(ue(e.currentTarget))return;const l=e,r=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0;Pe(e.currentTarget,n,t,!1,r,o.isDark)}function ce(){Ae()}function me(e){if(ue(e.currentTarget))return;const n=i.value?r("common.copied")||"Copied":r("common.copy")||"Copy",t=e,l=null!=(null==t?void 0:t.clientX)&&null!=(null==t?void 0:t.clientY)?{x:t.clientX,y:t.clientY}:void 0;Pe(e.currentTarget,n,"top",!1,l,o.isDark)}function ve(){s.value=!s.value;const e=c.value;e&&(s.value?(e.style.maxHeight="none",e.style.overflow="visible"):(e.style.maxHeight="500px",e.style.overflow="auto",x.value=!0,q(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))}function he(){d.value=!d.value}function pe(){if(!P.value)return;const e=(a.value||o.node.language).toLowerCase(),n="html"===e?"HTML Preview":"SVG Preview";l("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:o.node.code,title:n})}return B(()=>o.node.code,()=>u(null,null,function*(){if(s.value||!x.value)return;yield q();const e=c.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(n,t)=>H.value?(p(),O(w(To),{key:0,node:e.node,"is-dark":o.isDark,loading:o.loading},null,8,["node","is-dark","loading"])):(p(),h("div",{key:1,style:z(A.value),class:T(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[o.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",o.isDark?"is-dark":""]])},[o.showHeader?(p(),h("div",Lo,[D(n.$slots,"header-left",{},()=>[y("div",$o,[y("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:N.value},null,8,jo),y("span",So,b(j.value),1)])],!0),D(n.$slots,"header-right",{},()=>[y("div",Eo,[y("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":d.value,onClick:he,onMouseenter:t[0]||(t[0]=e=>de(e,d.value?w(r)("common.expand")||"Expand":w(r)("common.collapse")||"Collapse")),onFocus:t[1]||(t[1]=e=>de(e,d.value?w(r)("common.expand")||"Expand":w(r)("common.collapse")||"Collapse")),onMouseleave:ce,onBlur:ce},[(p(),h("svg",{style:z({rotate:d.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...t[17]||(t[17]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,Ho),o.showFontSizeButtons&&o.enableFontSizeControl?(p(),h(k,{key:0},[y("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(L.value)&&L.value<=10,onClick:t[2]||(t[2]=e=>function(){const e=Math.max(10,L.value-1);L.value=e}()),onMouseenter:t[3]||(t[3]=e=>de(e,w(r)("common.decrease")||"Decrease")),onFocus:t[4]||(t[4]=e=>de(e,w(r)("common.decrease")||"Decrease")),onMouseleave:ce,onBlur:ce},[...t[18]||(t[18]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,No),y("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!$.value||L.value===I.value,onClick:t[5]||(t[5]=e=>{L.value=I.value}),onMouseenter:t[6]||(t[6]=e=>de(e,w(r)("common.reset")||"Reset")),onFocus:t[7]||(t[7]=e=>de(e,w(r)("common.reset")||"Reset")),onMouseleave:ce,onBlur:ce},[...t[19]||(t[19]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),y("path",{d:"M3 3v5h5"})])],-1)])],40,zo),y("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(L.value)&&L.value>=36,onClick:t[8]||(t[8]=e=>function(){const e=Math.min(36,L.value+1);L.value=e}()),onMouseenter:t[9]||(t[9]=e=>de(e,w(r)("common.increase")||"Increase")),onFocus:t[10]||(t[10]=e=>de(e,w(r)("common.increase")||"Increase")),onMouseleave:ce,onBlur:ce},[...t[20]||(t[20]=[y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,Do)],64)):E("",!0),o.showCopyButton?(p(),h("button",{key:1,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":i.value?w(r)("common.copied")||"Copied":w(r)("common.copy")||"Copy",onClick:se,onMouseenter:t[11]||(t[11]=e=>me(e)),onFocus:t[12]||(t[12]=e=>me(e)),onMouseleave:ce,onBlur:ce},[i.value?(p(),h("svg",Ro,[...t[22]||(t[22]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(p(),h("svg",Ao,[...t[21]||(t[21]=[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),y("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Po)):E("",!0),o.showExpandButton?(p(),h("button",{key:2,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":s.value,onClick:ve,onMouseenter:t[13]||(t[13]=e=>de(e,s.value?w(r)("common.collapse")||"Collapse":w(r)("common.expand")||"Expand")),onFocus:t[14]||(t[14]=e=>de(e,s.value?w(r)("common.collapse")||"Collapse":w(r)("common.expand")||"Expand")),onMouseleave:ce,onBlur:ce},[s.value?(p(),h("svg",Vo,[...t[23]||(t[23]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])):(p(),h("svg",Ko,[...t[24]||(t[24]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])]))],40,Oo)):E("",!0),P.value&&o.showPreviewButton?(p(),h("button",{key:3,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":w(r)("common.preview")||"Preview",onClick:pe,onMouseenter:t[15]||(t[15]=e=>de(e,w(r)("common.preview")||"Preview")),onFocus:t[16]||(t[16]=e=>de(e,w(r)("common.preview")||"Preview")),onMouseleave:ce,onBlur:ce},[...t[25]||(t[25]=[y("svg",{"data-v-3d59cc65":"",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),y("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,Wo)):E("",!0)])],!0)])):E("",!0),Z(y("div",{ref_key:"codeBlockContent",ref:c,class:"code-block-content",style:z(R.value),onScroll:ie},[y("div",{ref_key:"rendererTarget",ref:m,class:"code-block-render"},null,512),f.value?E("",!0):(p(),h("div",{key:0,class:"code-fallback-plain",innerHTML:v.value},null,8,Fo))],36),[[G,!(d.value||!e.stream&&e.loading)]]),Z(y("div",Uo,[D(n.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[t[26]||(t[26]=y("div",{class:"loading-skeleton"},[y("div",{class:"skeleton-line"}),y("div",{class:"skeleton-line"}),y("div",{class:"skeleton-line short"})],-1))],!0)],512),[[G,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-34bf55f7"]]);function qo(e){return JSON.stringify(e)}function Zo(e){var n;const t=null!=(n=e.mode)?n:"classic",o=e.katexUrl,l=e.mhchemUrl,r=qo(i({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),a=qo(o),s=l?qo(l):'""';return"module"===t?`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\nlet loadPromise = null\n\nfunction normalizeKaTeX(mod) {\n const resolved = (mod && mod.default) ? mod.default : mod\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nasync function loadKaTeX() {\n if (katex || katexLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${a})\n katex = normalizeKaTeX(mod) || null\n const mhchemUrl = ${s}\n if (mhchemUrl) {\n try {\n await import(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n }\n catch (e) {\n katexLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n await loadKaTeX()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${r}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart():`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\n\nfunction normalizeKaTeX(val) {\n const resolved = (val && val.default) ? val.default : val\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nfunction loadKaTeXClassic() {\n if (katex || katexLoadError)\n return\n try {\n importScripts(${a})\n const mhchemUrl = ${s}\n if (mhchemUrl) {\n try {\n importScripts(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n katex = normalizeKaTeX(globalThis.katex)\n }\n catch (e) {\n katexLoadError = e\n }\n}\n\nloadKaTeXClassic()\n\nglobalThis.addEventListener('message', (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n if (!katex && !katexLoadError)\n loadKaTeXClassic()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${r}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart()}function Go(e){var n,t;const o=Zo(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const l=new Blob([o],{type:"text/javascript"}),r=URL.createObjectURL(l);let a=!1;const u="module"===(null!=(n=e.mode)?n:"classic")?s(i({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,d=new Worker(r,u);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(c){}return{worker:d,dispose:()=>{if(!a){a=!0;try{URL.revokeObjectURL(r)}catch(c){}}},source:o}}Xo.install=e=>{e.component(Xo.__name,Xo)};let Yo=null,Jo=null,Qo=!1;const el=/* @__PURE__ */new Map,nl=/* @__PURE__ */new Map;let tl=5;const ol=/* @__PURE__ */new Set;function ll(){if(el.size<tl&&ol.size){const n=Array.from(ol);ol.clear();for(const t of n)try{t()}catch(e){}}}function rl(e){Yo=e,Jo=null,Yo.onmessage=e=>{const{id:n,html:t,error:o}=e.data,l=el.get(n);if(l)if(el.delete(n),clearTimeout(l.timeoutId),ll(),o)l.reject(new Error(o));else{const{content:n,displayMode:o}=e.data;if(n){const e=`${o?"d":"i"}:${n}`;if(nl.set(e,t),nl.size>200){const e=nl.keys().next().value;nl.delete(e)}}l.resolve(t)}},Yo.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[n,t]of el.entries())clearTimeout(t.timeoutId),t.reject(new Error(`Worker error: ${e.message}`));el.clear(),ll()}}function al(){var e;Yo&&(null==(e=Yo.terminate)||e.call(Yo)),Yo=null,Jo=null}function il(e){Qo=!!e,Yo&&Yo.postMessage({type:"init",debug:Qo})}function sl(e,n=!0,t=2e3,o){return u(this,null,function*(){if(performance.now(),!un()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(Jo)return Promise.reject(Jo);const l=`${n?"d":"i"}:${e}`,r=nl.get(l);if(r)return Promise.resolve(r);const a=Yo||(Jo=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Jo.name="WorkerInitError",Jo.code="WORKER_INIT_ERROR",null);if(!a)return Promise.reject(Jo);if(el.size>=tl){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=el.size,e.max=tl,Promise.reject(e)}return new Promise((l,r)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void r(e)}const i=Math.random().toString(36).slice(2),s=globalThis.setTimeout(()=>{el.delete(i);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",r(e),ll()},t);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),el.has(i)&&el.delete(i);const e=new Error("Aborted");e.name="AbortError",r(e),ll()},{once:!0});const u=l,d=r;el.set(i,{resolve:e=>{u(e)},reject:e=>{d(e)},timeoutId:s}),a.postMessage({id:i,content:e,displayMode:n})})})}function ul(e,n=!0,t){const o=`${n?"d":"i"}:${e}`;if(nl.set(o,t),nl.size>200){const e=nl.keys().next().value;nl.delete(e)}}function dl(){return{inFlight:el.size,max:tl}}function cl(e){Number.isFinite(e)&&e>0&&(tl=Math.floor(e))}const ml="WORKER_BUSY";function vl(){return el.size>=tl}function hl(e=2e3,n){return el.size<tl?Promise.resolve():new Promise((t,o)=>{let l,r=!1;const a=()=>{r||(r=!0,l&&globalThis.clearTimeout(l),ol.delete(a),t())};if(ol.add(a),l=globalThis.setTimeout(()=>{if(r)return;r=!0,ol.delete(a);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>ll()),n){const e=()=>{if(r)return;r=!0,l&&globalThis.clearTimeout(l),ol.delete(a);const e=new Error("Aborted");e.name="AbortError",o(e)};n.aborted?e():n.addEventListener("abort",e,{once:!0})}})}const pl={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function fl(e){null!=e.timeout&&(pl.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(pl.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(pl.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(pl.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function gl(){return i({},pl)}function wl(e){return u(this,arguments,function*(e,n=!0,t={}){var o,l,r,a;if(!un()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const i=null!=(o=t.timeout)?o:pl.timeout,s=null!=(l=t.waitTimeout)?l:pl.waitTimeout,u=null!=(r=t.backoffMs)?r:pl.backoffMs,d=null!=(a=t.maxRetries)?a:pl.maxRetries,c=t.signal;let m=0;for(;;){if(null==c?void 0:c.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield sl(e,n,i,c)}catch(v){if((null==v?void 0:v.code)!==ml||m>=d)throw v;if(m++,yield hl(s,c).catch(()=>{}),null==c?void 0:c.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*m)))}}})}function yl(e){return JSON.stringify(e)}function kl(e){var n;const t=null!=(n=e.mode)?n:"module",o=yl(e.mermaidUrl),l=`\nlet DEBUG = false\nlet mermaid = null\nlet mermaidLoadError = null\n\nfunction normalizeMermaidModule(mod) {\n if (!mod)\n return mod\n const candidate = (mod && mod.default) ? mod.default : mod\n if (candidate && (typeof candidate.render === 'function' || typeof candidate.parse === 'function' || typeof candidate.initialize === 'function'))\n return candidate\n if (candidate && candidate.mermaidAPI && (typeof candidate.mermaidAPI.render === 'function' || typeof candidate.mermaidAPI.parse === 'function')) {\n const api = candidate.mermaidAPI\n return {\n ...candidate,\n render: api.render ? api.render.bind(api) : undefined,\n parse: api.parse ? api.parse.bind(api) : undefined,\n initialize: (opts) => {\n if (typeof candidate.initialize === 'function')\n return candidate.initialize(opts)\n return api.initialize ? api.initialize(opts) : undefined\n },\n }\n }\n if (mod && mod.mermaid && typeof mod.mermaid.parse === 'function')\n return mod.mermaid\n return candidate\n}\n\nfunction applyThemeTo(code, theme) {\n const themeValue = theme === 'dark' ? 'dark' : 'default'\n const themeConfig = \`%%{init: {"theme": "\${themeValue}"}}%%\\n\`\n const trimmed = (code || '').trimStart()\n if (trimmed.startsWith('%%{'))\n return code\n return themeConfig + code\n}\n\nfunction findHeaderIndex(lines) {\n const headerRe = /^(?:graph|flowchart|flowchart\\s+tb|flowchart\\s+lr|sequenceDiagram|gantt|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|pie|quadrantChart|timeline|xychart(?:-beta)?)\\b/\n for (let i = 0; i < lines.length; i++) {\n const l = (lines[i] || '').trim()\n if (!l)\n continue\n if (l.startsWith('%%'))\n continue\n if (headerRe.test(l))\n return i\n }\n return -1\n}\n\nasync function canParse(code, theme) {\n const themed = applyThemeTo(code, theme)\n const anyMermaid = mermaid\n if (anyMermaid && typeof anyMermaid.parse === 'function') {\n await anyMermaid.parse(themed)\n return true\n }\n throw new Error('mermaid.parse not available in worker')\n}\n\nasync function findLastRenderablePrefix(baseCode, theme) {\n const lines = String(baseCode || '').split('\\n')\n const headerIdx = findHeaderIndex(lines)\n if (headerIdx === -1)\n return null\n const head = lines.slice(0, headerIdx + 1)\n await canParse(head.join('\\n'), theme)\n\n let low = headerIdx + 1\n let high = lines.length\n let lastGood = headerIdx + 1\n let tries = 0\n const MAX_TRIES = 12\n\n while (low <= high && tries < MAX_TRIES) {\n const mid = Math.floor((low + high) / 2)\n const candidate = [...head, ...lines.slice(headerIdx + 1, mid)].join('\\n')\n tries++\n try {\n await canParse(candidate, theme)\n lastGood = mid\n low = mid + 1\n }\n catch {\n high = mid - 1\n }\n }\n\n return [...head, ...lines.slice(headerIdx + 1, lastGood)].join('\\n')\n}\n\nfunction initMermaidOnce() {\n if (!mermaid)\n return\n try {\n if (typeof mermaid.initialize === 'function')\n mermaid.initialize(${yl(i({startOnLoad:!1,securityLevel:"loose"},e.initializeOptions||{}))})\n }\n catch (e) {\n if (DEBUG)\n console.warn('[mermaid-cdn-worker] initialize failed', e)\n }\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const msg = ev.data || {}\n if (msg.type === 'init') {\n DEBUG = !!msg.debug\n if (DEBUG)\n console.debug('[mermaid-cdn-worker] debug enabled')\n return\n }\n\n const id = msg.id\n const action = msg.action\n const payload = msg.payload || {}\n\n if (!mermaid) {\n const errMsg = mermaidLoadError ? String(mermaidLoadError?.message || mermaidLoadError) : 'Mermaid is not available in worker'\n globalThis.postMessage({ id, ok: false, error: errMsg })\n return\n }\n\n try {\n if (action === 'canParse') {\n const ok = await canParse(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: ok })\n return\n }\n if (action === 'findPrefix') {\n const res = await findLastRenderablePrefix(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: res })\n return\n }\n globalThis.postMessage({ id, ok: false, error: 'Unknown action' })\n }\n catch (e) {\n globalThis.postMessage({ id, ok: false, error: String(e?.message || e) })\n }\n})\n`.trimStart();return"module"===t?`\n${l}\n\nlet loadPromise = null\nasync function loadMermaid() {\n if (mermaid || mermaidLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${o})\n mermaid = normalizeMermaidModule(mod) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\n// Load immediately; failures are reported per-request\nawait loadMermaid()\n`.trimStart():`\n${l}\n\nfunction loadMermaidClassic() {\n if (mermaid || mermaidLoadError)\n return\n try {\n importScripts(${o})\n mermaid = normalizeMermaidModule(globalThis.mermaid) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n}\n\nloadMermaidClassic()\n`.trimStart()}function xl(e){var n,t;const o=kl(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const l=new Blob([o],{type:"text/javascript"}),r=URL.createObjectURL(l);let a=!1;const u="module"===(null!=(n=e.mode)?n:"module")?s(i({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,d=new Worker(r,u);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(c){}return{worker:d,dispose:()=>{if(!a){a=!0;try{URL.revokeObjectURL(r)}catch(c){}}},source:o}}const bl=R(()=>import("./index4.js")),Ml=R(()=>import("./index3.js")),_l=R(()=>import("./index2.js")),Bl=R(()=>Promise.resolve().then(()=>Io)),Cl={AdmonitionNode:Mt,BlockquoteNode:oe,CheckboxNode:ae,CodeBlockNode:bl,DefinitionListNode:de,EmojiNode:me,FootnoteNode:Wn,FootnoteReferenceNode:xe,FootnoteAnchorNode:On,HardBreakNode:Un,HeadingNode:qn,HtmlInlineNode:be,HighlightNode:Dn,ImageNode:Je,InlineCodeNode:_e,PreCodeNode:nt,InsertNode:Nn,LinkNode:En,ListItemNode:Zn,ListNode:Gn,MathBlockNode:Ml,MathInlineNode:_l,MermaidBlockNode:Bl,ParagraphNode:Jn,StrikethroughNode:Tn,StrongNode:Bn,SubscriptNode:Mn,SuperscriptNode:kn,TableNode:it,TextNode:hn,ThematicBreakNode:ut,ReferenceNode:gn,MarkdownCodeBlockNode:Xo},Tl={install(e,n){Object.entries(Cl).forEach(([n,t])=>{e.component(n,t)}),(null==n?void 0:n.getLanguageIcon)&&Lt(n.getLanguageIcon),(null==n?void 0:n.mathOptions)&&m(n.mathOptions)}};export{rn as $,Mt as A,oe as B,ae as C,de as D,me as E,On as F,_e as G,Un as H,Je as I,Nn as J,un as K,Vt as L,En as M,Zn as N,Gn as O,Xo as P,ft as Q,Ml as R,_l as S,Bl as T,Jn as U,gn as V,ml as W,ge as X,pe as Y,Oe as Z,te as _,We as a,At as a0,Tn as a1,Bn as a2,Mn as a3,kn as a4,it as a5,hn as a6,ut as a7,Tl as a8,Lt as a9,Zo as aa,Go as ab,rl as ac,al as ad,il as ae,sl as af,dl as ag,cl as ah,vl as ai,hl as aj,fl as ak,gl as al,kl as am,xl as an,Gt as ao,Yt as ap,Jt as aq,Qt as ar,eo as as,no as at,to as au,lo as av,ro as aw,ao as ax,Et as b,nt as c,Pe as d,wl as e,dn as f,Tt as g,Ae as h,ul as i,we as j,bl as k,Ht as l,sn as m,jt as n,Ot as o,an as p,Rt as q,St as r,Nt as s,Wn as t,Ve as u,xe as v,fe as w,qn as x,Dn as y,be as z};
|
package/dist/index.d.ts
CHANGED
|
@@ -857,6 +857,59 @@ declare function resolveMonacoLanguageId(lang?: string | null): string;
|
|
|
857
857
|
declare function getLanguageIcon(lang: string): string;
|
|
858
858
|
declare const languageMap: Record<string, string>;
|
|
859
859
|
|
|
860
|
+
type KaTeXCDNWorkerMode = 'classic' | 'module';
|
|
861
|
+
interface KaTeXCDNWorkerOptions {
|
|
862
|
+
/**
|
|
863
|
+
* Where to load KaTeX from inside the worker.
|
|
864
|
+
* - classic mode: UMD build (used via importScripts)
|
|
865
|
+
* - module mode: ESM build (used via dynamic import(url))
|
|
866
|
+
*/
|
|
867
|
+
katexUrl: string;
|
|
868
|
+
/**
|
|
869
|
+
* Optional mhchem plugin URL to load in the worker (recommended).
|
|
870
|
+
* - classic mode: UMD build (importScripts)
|
|
871
|
+
* - module mode: ESM build (dynamic import(url))
|
|
872
|
+
*/
|
|
873
|
+
mhchemUrl?: string;
|
|
874
|
+
/**
|
|
875
|
+
* - classic: widest compatibility, uses importScripts()
|
|
876
|
+
* - module: requires { type: 'module' } workers, uses import(url)
|
|
877
|
+
*/
|
|
878
|
+
mode?: KaTeXCDNWorkerMode;
|
|
879
|
+
/**
|
|
880
|
+
* If set, worker prints verbose logs.
|
|
881
|
+
*/
|
|
882
|
+
debug?: boolean;
|
|
883
|
+
/**
|
|
884
|
+
* Worker constructor options (name/type/credentials).
|
|
885
|
+
* Note: for module mode you should pass { type: 'module' }.
|
|
886
|
+
*/
|
|
887
|
+
workerOptions?: WorkerOptions;
|
|
888
|
+
/**
|
|
889
|
+
* KaTeX render options used in the worker.
|
|
890
|
+
* Keep this minimal and stable for caching and predictable output.
|
|
891
|
+
*/
|
|
892
|
+
renderOptions?: {
|
|
893
|
+
throwOnError?: boolean;
|
|
894
|
+
output?: string;
|
|
895
|
+
strict?: string;
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
interface KaTeXCDNWorkerHandle {
|
|
899
|
+
worker: Worker | null;
|
|
900
|
+
/**
|
|
901
|
+
* Revoke the generated Blob URL. Call this when you no longer need the worker.
|
|
902
|
+
* This does not terminate the worker automatically.
|
|
903
|
+
*/
|
|
904
|
+
dispose: () => void;
|
|
905
|
+
/**
|
|
906
|
+
* The generated worker source code (useful for debugging/tests).
|
|
907
|
+
*/
|
|
908
|
+
source: string;
|
|
909
|
+
}
|
|
910
|
+
declare function buildKaTeXCDNWorkerSource(options: KaTeXCDNWorkerOptions): string;
|
|
911
|
+
declare function createKaTeXWorkerFromCDN(options: KaTeXCDNWorkerOptions): KaTeXCDNWorkerHandle;
|
|
912
|
+
|
|
860
913
|
/**
|
|
861
914
|
* Allow user to inject a Worker instance, e.g. from Vite ?worker import.
|
|
862
915
|
*/
|
|
@@ -905,6 +958,42 @@ declare function getKaTeXBackpressureDefaults(): {
|
|
|
905
958
|
*/
|
|
906
959
|
declare function renderKaTeXWithBackpressure(content: string, displayMode?: boolean, opts?: BackpressureOptions): Promise<string>;
|
|
907
960
|
|
|
961
|
+
type MermaidCDNWorkerMode = 'classic' | 'module';
|
|
962
|
+
interface MermaidCDNWorkerOptions {
|
|
963
|
+
/**
|
|
964
|
+
* Where to load mermaid from inside the worker.
|
|
965
|
+
* - classic mode: non-module build (used via importScripts)
|
|
966
|
+
* - module mode: ESM build (used via dynamic import(url))
|
|
967
|
+
*/
|
|
968
|
+
mermaidUrl: string;
|
|
969
|
+
/**
|
|
970
|
+
* - classic: widest compatibility, uses importScripts()
|
|
971
|
+
* - module: requires { type: 'module' } workers, uses import(url)
|
|
972
|
+
*/
|
|
973
|
+
mode?: MermaidCDNWorkerMode;
|
|
974
|
+
/**
|
|
975
|
+
* If set, worker prints verbose logs.
|
|
976
|
+
*/
|
|
977
|
+
debug?: boolean;
|
|
978
|
+
/**
|
|
979
|
+
* Worker constructor options (name/type/credentials).
|
|
980
|
+
* Note: for module mode you should pass { type: 'module' }.
|
|
981
|
+
*/
|
|
982
|
+
workerOptions?: WorkerOptions;
|
|
983
|
+
/**
|
|
984
|
+
* Mermaid initialize options used in the worker.
|
|
985
|
+
* This worker is used for parsing only; keep options minimal.
|
|
986
|
+
*/
|
|
987
|
+
initializeOptions?: Record<string, any>;
|
|
988
|
+
}
|
|
989
|
+
interface MermaidCDNWorkerHandle {
|
|
990
|
+
worker: Worker | null;
|
|
991
|
+
dispose: () => void;
|
|
992
|
+
source: string;
|
|
993
|
+
}
|
|
994
|
+
declare function buildMermaidCDNWorkerSource(options: MermaidCDNWorkerOptions): string;
|
|
995
|
+
declare function createMermaidWorkerFromCDN(options: MermaidCDNWorkerOptions): MermaidCDNWorkerHandle;
|
|
996
|
+
|
|
908
997
|
type Theme = 'light' | 'dark';
|
|
909
998
|
declare function setMermaidWorkerClientDebug(enabled: boolean): void;
|
|
910
999
|
declare function setMermaidWorkerMaxConcurrency(n: number): void;
|
|
@@ -1134,4 +1223,4 @@ declare const MermaidBlockNode: {
|
|
|
1134
1223
|
|
|
1135
1224
|
declare const VueRendererMarkdown: Plugin;
|
|
1136
1225
|
|
|
1137
|
-
export { _default$s as AdmonitionNode, BackpressureOptions, _default$r as BlockquoteNode, _default$q as CheckboxNode, CodeBlockNode, _default$p as DefinitionListNode, _default$o as EmojiNode, _default$n as FootnoteAnchorNode, _default$m as FootnoteNode, _default$l as FootnoteReferenceNode, _default$k as HardBreakNode, _HeadingNode as HeadingNode, _default$j as HighlightNode, _default$i as HtmlInlineNode, _default$h as ImageNode, _default$g as InlineCodeNode, _default$f as InsertNode, KatexLoader, LanguageIconResolver, _default$e as LinkNode, _default$d as ListItemNode, _default$c as ListNode, MERMAID_DISABLED_CODE, MERMAID_WORKER_BUSY_CODE, _default$b as MarkdownCodeBlockNode, _default$a as MarkdownRender, MathBlockNode, MathInlineNode, MermaidBlockNode, MermaidLoader, _default$9 as ParagraphNode, _default$8 as PreCodeNode, _default$7 as ReferenceNode, _default$6 as StrikethroughNode, _default$5 as StrongNode, _default$4 as SubscriptNode, _default$3 as SuperscriptNode, _default$2 as TableNode, _default$1 as TextNode, _default as ThematicBreakNode, VueRendererMarkdown, WORKER_BUSY_CODE, canParseOffthread, clearGlobalCustomComponents, clearKaTeXWorker, clearMermaidWorker, _default$a as default, disableKatex, disableMermaid, enableKatex, enableMermaid, findPrefixOffthread, getCustomNodeComponents, getKaTeXBackpressureDefaults, getKaTeXWorkerLoad, getLanguageIcon, getMermaidWorkerLoad, getUseMonaco, isKaTeXWorkerBusy, isKatexEnabled, isMermaidEnabled, languageMap, normalizeLanguageIdentifier, removeCustomComponents, renderKaTeXInWorker, renderKaTeXWithBackpressure, resolveMonacoLanguageId, setCustomComponents, setDefaultI18nMap, setKaTeXBackpressureDefaults, setKaTeXCache, setKaTeXWorker, setKaTeXWorkerDebug, setKaTeXWorkerMaxConcurrency, setKatexLoader, setLanguageIconResolver, setMermaidLoader, setMermaidWorker, setMermaidWorkerClientDebug, setMermaidWorkerMaxConcurrency, terminateWorker, waitForKaTeXWorkerSlot };
|
|
1226
|
+
export { _default$s as AdmonitionNode, BackpressureOptions, _default$r as BlockquoteNode, _default$q as CheckboxNode, CodeBlockNode, _default$p as DefinitionListNode, _default$o as EmojiNode, _default$n as FootnoteAnchorNode, _default$m as FootnoteNode, _default$l as FootnoteReferenceNode, _default$k as HardBreakNode, _HeadingNode as HeadingNode, _default$j as HighlightNode, _default$i as HtmlInlineNode, _default$h as ImageNode, _default$g as InlineCodeNode, _default$f as InsertNode, KaTeXCDNWorkerHandle, KaTeXCDNWorkerMode, KaTeXCDNWorkerOptions, KatexLoader, LanguageIconResolver, _default$e as LinkNode, _default$d as ListItemNode, _default$c as ListNode, MERMAID_DISABLED_CODE, MERMAID_WORKER_BUSY_CODE, _default$b as MarkdownCodeBlockNode, _default$a as MarkdownRender, MathBlockNode, MathInlineNode, MermaidBlockNode, MermaidCDNWorkerHandle, MermaidCDNWorkerMode, MermaidCDNWorkerOptions, MermaidLoader, _default$9 as ParagraphNode, _default$8 as PreCodeNode, _default$7 as ReferenceNode, _default$6 as StrikethroughNode, _default$5 as StrongNode, _default$4 as SubscriptNode, _default$3 as SuperscriptNode, _default$2 as TableNode, _default$1 as TextNode, _default as ThematicBreakNode, VueRendererMarkdown, WORKER_BUSY_CODE, buildKaTeXCDNWorkerSource, buildMermaidCDNWorkerSource, canParseOffthread, clearGlobalCustomComponents, clearKaTeXWorker, clearMermaidWorker, createKaTeXWorkerFromCDN, createMermaidWorkerFromCDN, _default$a as default, disableKatex, disableMermaid, enableKatex, enableMermaid, findPrefixOffthread, getCustomNodeComponents, getKaTeXBackpressureDefaults, getKaTeXWorkerLoad, getLanguageIcon, getMermaidWorkerLoad, getUseMonaco, isKaTeXWorkerBusy, isKatexEnabled, isMermaidEnabled, languageMap, normalizeLanguageIdentifier, removeCustomComponents, renderKaTeXInWorker, renderKaTeXWithBackpressure, resolveMonacoLanguageId, setCustomComponents, setDefaultI18nMap, setKaTeXBackpressureDefaults, setKaTeXCache, setKaTeXWorker, setKaTeXWorkerDebug, setKaTeXWorkerMaxConcurrency, setKatexLoader, setLanguageIconResolver, setMermaidLoader, setMermaidWorker, setMermaidWorkerClientDebug, setMermaidWorkerMaxConcurrency, terminateWorker, waitForKaTeXWorkerSlot };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"stream-markdown-parser";import{KATEX_COMMANDS as e,normalizeStandaloneBackslashT as a,setDefaultMathOptions as s}from"stream-markdown-parser";import"vue";import{A as o,B as r,C as t,k as d,D as n,E as i,F as m,t as N,v as k,H as l,x as c,y as u,z as
|
|
1
|
+
export*from"stream-markdown-parser";import{KATEX_COMMANDS as e,normalizeStandaloneBackslashT as a,setDefaultMathOptions as s}from"stream-markdown-parser";import"vue";import{A as o,B as r,C as t,k as d,D as n,E as i,F as m,t as N,v as k,H as l,x as c,y as u,z as M,I as g,G as C,J as p,M as W,N as K,O as f,as as D,ar as T,P as I,Q as b,R as h,S as B,T as X,U as L,c as x,V as E,a1 as R,a2 as S,a3 as O,a4 as _,a5 as w,a6 as F,a7 as A,a8 as v,W as H,aa as P,am as y,av as U,j,ad as Y,au as q,ab as z,an as G,Q,m as V,o as J,p as Z,q as $,aw as ee,w as ae,al as se,ag as oe,b as re,aq as te,g as de,ai as ne,K as ie,L as me,l as Ne,n as ke,X as le,af as ce,e as ue,r as Me,Y as ge,Z as Ce,ak as pe,i as We,ac as Ke,ae as fe,ah as De,$ as Te,a9 as Ie,a0 as be,at as he,ao as Be,ap as Xe,ax as Le,aj as xe}from"./exports.js";export{o as AdmonitionNode,r as BlockquoteNode,t as CheckboxNode,d as CodeBlockNode,n as DefinitionListNode,i as EmojiNode,m as FootnoteAnchorNode,N as FootnoteNode,k as FootnoteReferenceNode,l as HardBreakNode,c as HeadingNode,u as HighlightNode,M as HtmlInlineNode,g as ImageNode,C as InlineCodeNode,p as InsertNode,e as KATEX_COMMANDS,W as LinkNode,K as ListItemNode,f as ListNode,D as MERMAID_DISABLED_CODE,T as MERMAID_WORKER_BUSY_CODE,I as MarkdownCodeBlockNode,b as MarkdownRender,h as MathBlockNode,B as MathInlineNode,X as MermaidBlockNode,L as ParagraphNode,x as PreCodeNode,E as ReferenceNode,R as StrikethroughNode,S as StrongNode,O as SubscriptNode,_ as SuperscriptNode,w as TableNode,F as TextNode,A as ThematicBreakNode,v as VueRendererMarkdown,H as WORKER_BUSY_CODE,P as buildKaTeXCDNWorkerSource,y as buildMermaidCDNWorkerSource,U as canParseOffthread,j as clearGlobalCustomComponents,Y as clearKaTeXWorker,q as clearMermaidWorker,z as createKaTeXWorkerFromCDN,G as createMermaidWorkerFromCDN,Q as default,V as disableKatex,J as disableMermaid,Z as enableKatex,$ as enableMermaid,ee as findPrefixOffthread,ae as getCustomNodeComponents,se as getKaTeXBackpressureDefaults,oe as getKaTeXWorkerLoad,re as getLanguageIcon,te as getMermaidWorkerLoad,de as getUseMonaco,ne as isKaTeXWorkerBusy,ie as isKatexEnabled,me as isMermaidEnabled,Ne as languageMap,ke as normalizeLanguageIdentifier,a as normalizeStandaloneBackslashT,le as removeCustomComponents,ce as renderKaTeXInWorker,ue as renderKaTeXWithBackpressure,Me as resolveMonacoLanguageId,ge as setCustomComponents,Ce as setDefaultI18nMap,s as setDefaultMathOptions,pe as setKaTeXBackpressureDefaults,We as setKaTeXCache,Ke as setKaTeXWorker,fe as setKaTeXWorkerDebug,De as setKaTeXWorkerMaxConcurrency,Te as setKatexLoader,Ie as setLanguageIconResolver,be as setMermaidLoader,he as setMermaidWorker,Be as setMermaidWorkerClientDebug,Xe as setMermaidWorkerMaxConcurrency,Le as terminateWorker,xe as waitForKaTeXWorkerSlot};
|
package/dist/tailwind.ts
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markstream-vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.4-beta.
|
|
4
|
+
"version": "0.0.4-beta.2",
|
|
5
5
|
"packageManager": "pnpm@10.26.1",
|
|
6
6
|
"description": "Vue 3 Markdown renderer optimized for large docs: progressive Mermaid, streaming diff code blocks, and fast real-time preview.",
|
|
7
7
|
"author": "Simon He",
|