markstream-vue 0.0.7-beta.3 → 0.0.7-beta.4
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 +9 -10
- package/README.zh-CN.md +9 -10
- package/dist/exports.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +171 -86
- package/dist/index.js +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/index5.js +1 -1
- package/dist/tailwind.ts +0 -0
- package/package.json +8 -8
- package/dist/Tooltip.js +0 -1
package/dist/exports.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,n=Object.defineProperties,t=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,l=(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={}))r.call(n,t)&&l(e,t,n[t]);if(o)for(var t of o(n))a.call(n,t)&&l(e,t,n[t]);return e},s=(e,o)=>n(e,t(o)),d=(e,n,t)=>new Promise((o,r)=>{var a=e=>{try{i(t.next(e))}catch(n){r(n)}},l=e=>{try{i(t.throw(e))}catch(n){r(n)}},i=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,l);i((t=t.apply(e,n)).next())});import{getMarkdown as c,parseMarkdownToStructure as u,setDefaultMathOptions as m}from"stream-markdown-parser";import{defineComponent as h,createElementBlock as p,openBlock as v,withMemo as f,createVNode as g,unref as w,createElementVNode as k,Fragment as y,renderList as x,toDisplayString as b,shallowRef as M,h as _,computed as C,ref as B,watch as I,onMounted as T,onBeforeUnmount as L,normalizeClass as j,createApp as S,inject as $,provide as E,createCommentVNode as N,Transition as H,withCtx as z,normalizeStyle as A,renderSlot as P,readonly as V,defineAsyncComponent as K,createBlock as O,resolveDynamicComponent as R,useAttrs as W,mergeProps as D,isMemoSame as U,markRaw as F,reactive as q,nextTick as X,withDirectives as G,vShow as Z}from"vue";const Y=["cite"],J=(e,n)=>{const t=e.__vccOpts||e;for(const[o,r]of n)t[o]=r;return t},Q=/* @__PURE__ */J(/* @__PURE__ */h({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(v(),p("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[f([n.node.children],()=>g(w(jt),{"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,Y))}}),[["__scopeId","data-v-eeadc8a3"]]);Q.install=e=>{e.component(Q.__name,Q)};const ee={class:"checkbox-node"},ne=["checked"],te=/* @__PURE__ */J(/* @__PURE__ */h({__name:"CheckboxNode",props:{node:{}},setup:e=>(n,t)=>(v(),p("span",ee,[k("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,ne)]))}),[["__scopeId","data-v-8dc6c46f"]]);te.install=e=>{e.component(te.__name,te)};const oe={class:"definition-list"},re={class:"definition-term"},ae={class:"definition-desc"},le=/* @__PURE__ */J(/* @__PURE__ */h({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(e,t)=>(v(),p("dl",oe,[(v(!0),p(y,null,x(n.node.items,(o,r)=>(v(),p(y,{key:r},[k("dt",re,[g(w(jt),{"index-key":`definition-term-${n.indexKey}-${r}`,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"])]),k("dd",ae,[g(w(jt),{"index-key":`definition-desc-${n.indexKey}-${r}`,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"]]);le.install=e=>{e.component(le.__name,le)};const ie={class:"emoji-node"},se=/* @__PURE__ */J(/* @__PURE__ */h({__name:"EmojiNode",props:{node:{}},setup:e=>(n,t)=>(v(),p("span",ie,b(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);se.install=e=>{e.component(se.__name,se)};const de="__global__",ce="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",ue=(()=>{const e=globalThis;if(e[ce])return e[ce];const n={scopedCustomComponents:{},revision:M(0)};return e[ce]=n,n})(),me=ue.revision;function he(e,n){"string"==typeof e?ue.scopedCustomComponents[e]=n||{}:ue.scopedCustomComponents[de]=e||{},me.value++}function pe(e){const n=ue.scopedCustomComponents[de]||{};if(!e)return n;const t=ue.scopedCustomComponents[e]||{};return n&&0!==Object.keys(n).length?t&&0!==Object.keys(t).length?i(i({},n),t):n:t}function ve(e){if(e===de)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete ue.scopedCustomComponents[e],me.value++}function fe(){delete ue.scopedCustomComponents[de],me.value++}const ge=["id"],we=["title"],ke=/* @__PURE__ */J(/* @__PURE__ */h({__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,r)=>(v(),p("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:t},[k("span",{href:n,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+b(e.node.id)+"]",9,we)],8,ge))}}),[["__scopeId","data-v-01af0fee"]]);ke.install=e=>{e.component(ke.__name,ke)};const ye=/* @__PURE__ */new Set(["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onreset","onsearch","onsubmit"]),xe=/* @__PURE__ */new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),be=/* @__PURE__ */new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Me=/* @__PURE__ */new Set(["script"]),_e=/* @__PURE__ */new Set(["href","src","srcset","xlink:href","formaction"]),Ce=(()=>{try{return Boolean(!1)}catch(e){}return!1})();function Be(e){Ce&&console.warn(e)}function Ie(e){const n=function(e){let n="";for(const t of e){const e=t.charCodeAt(0);e<=31||127===e||/\s/u.test(t)||(n+=t)}return n}(e).toLowerCase();return!(!n.startsWith("javascript:")&&!n.startsWith("vbscript:"))||!!n.startsWith("data:")&&!(n.startsWith("data:image/")||n.startsWith("data:video/")||n.startsWith("data:audio/"))}function Te(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function Le(e,n){const t=e.toLowerCase();return!be.has(t)&&(Te(n,t)||Te(n,e))}function je(e,n){const t=n.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(t))return"true"===e||""===e||e===n;if(["value","min","max","step","width","height","size","maxlength"].includes(t)){const n=Number(e);if(""!==e&&!Number.isNaN(n))return n}return e}function Se(e){return e.trim().length>0}function $e(e,n,t,o,r){if(Me.has(e.toLowerCase()))return null;const a=function(e){const n={};for(const[t,o]of Object.entries(e)){const e=t.toLowerCase();ye.has(e)||_e.has(e)&&o&&Ie(o)||(n[t]=o)}return n}(n),l=a.key,d=null!=l&&""!==l?l:r;if(Le(e,o)){const n=o[e]||o[e.toLowerCase()],r=function(e){const n={};for(const[t,o]of Object.entries(e))n[t]=je(o,t);return n}(a);return _(n,s(i({},r),{key:d}),t.length>0?t:void 0)}return _(e,s(i({},a),{innerHTML:void 0,key:d}),t.length>0?t:void 0)}function Ee(e,n){const t=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;let o;for(;null!==(o=t.exec(e));)if(Le(o[1],n))return!0;return!1}function Ne(e,n){if(!e)return[];try{const t=function(e,n){let t=0;const o=[],r=[];for(const a of e)if("text"===a.type)(o.length>0?o[o.length-1].children:r).push(a.content);else if("self_closing"===a.type){const e=$e(a.tagName,a.attrs||{},[],n,"ms-html-"+t++),l=o.length>0?o[o.length-1].children:r;null!=e&&l.push(e)}else if("tag_open"===a.type)o.push({tagName:a.tagName,children:[],attrs:a.attrs,autoKey:"ms-html-"+t++});else if("tag_close"===a.type){const e=a.tagName.toLowerCase();let t=-1;for(let n=o.length-1;n>=0;n--)if(o[n].tagName.toLowerCase()===e){t=n;break}if(-1!==t)for(;o.length>t;){const a=o.pop(),l=$e(a.tagName,a.attrs||{},a.children,n,a.autoKey);o.length>0?null!=l&&o[o.length-1].children.push(l):null!=l&&r.push(l),a.tagName.toLowerCase()!==e&&o.length>t&&Be(`Auto-closing unclosed tag: <${a.tagName}>`)}else Be(`Ignoring closing tag with no matching opening tag: </${a.tagName}>`)}for(;o.length>0;){const e=o.pop(),t=$e(e.tagName,e.attrs||{},e.children,n,e.autoKey);o.length>0?null!=t&&o[o.length-1].children.push(t):null!=t&&r.push(t),Be(`Auto-closing unclosed tag: <${e.tagName}>`)}return r}(function(e){var n,t,o;const r=[];let a=0;for(;a<e.length;){if(e.startsWith("\x3c!--",a)){const n=e.indexOf("--\x3e",a);if(-1!==n){a=n+3;continue}break}const l=e.indexOf("<",a);if(-1===l){if(a<e.length){const n=e.slice(a);Se(n)&&r.push({type:"text",content:n})}break}if(l>a){const n=e.slice(a,l);Se(n)&&r.push({type:"text",content:n})}if(e.startsWith("![CDATA[",l+1)){const n=e.indexOf("]]>",l);if(-1!==n){r.push({type:"text",content:e.slice(l,n+3)}),a=n+3;continue}break}if(e.startsWith("!",l+1)){const n=e.indexOf(">",l);if(-1!==n){a=n+1;continue}break}const i=e.indexOf(">",l);if(-1===i)break;const s=e.slice(l+1,i).trim(),d=s.startsWith("/"),c=s.endsWith("/");if(d){const e=s.slice(1).trim();r.push({type:"tag_close",tagName:e})}else{const e=s.indexOf(" ");let a,l="";-1===e?a=c?s.slice(0,-1).trim():s.trim():(a=s.slice(0,e).trim(),l=s.slice(e+1));const i={};if(l){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let r;for(;null!==(r=e.exec(l));){const e=r[1],a=null!=(o=null!=(t=null!=(n=r[2])?n:r[3])?t:r[4])?o:"";e&&!e.endsWith("/")&&(i[e]=a)}}r.push({type:c||xe.has(a.toLowerCase())?"self_closing":"tag_open",tagName:a,attrs:i})}a=i+1}return r}(e),n);return t}catch(o){return t=o,Ce&&console.error("Failed to parse HTML to VNodes:",t),null}var t}const He=/* @__PURE__ */J(/* @__PURE__ */h({__name:"HtmlInlineNode",props:{node:{},customId:{}},setup(e){const n=e,t=C(()=>(me.value,pe(n.customId))),o=h({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=C(()=>{const e=n.node.content;if(!e)return{mode:"html",content:""};if(n.node.loading&&n.node.autoClosed){const n=Ne(e,t.value);if(null!==n)return{mode:"dynamic",nodes:n}}if(!Ee(e,t.value))return{mode:"html",content:e};const o=Ne(e,t.value);return null===o?{mode:"html",content:e}:{mode:"dynamic",nodes:o}}),a=B(null),l="undefined"!=typeof window;function i(){if(!l||!a.value)return;const e=a.value;e.innerHTML="";const t=document.createElement("template");t.innerHTML=n.node.content,e.appendChild(t.content.cloneNode(!0))}function s(){if(!a.value)return;const e=a.value;e.innerHTML="",e.textContent=n.node.content}return I(()=>[n.node.content,n.node.loading,n.node.autoClosed,r.value.mode],()=>{"html"===r.value.mode&&(n.node.loading&&!n.node.autoClosed?s():i())}),T(()=>{"html"===r.value.mode&&(n.node.loading&&!n.node.autoClosed?s():i())}),L(()=>{a.value&&(a.value.innerHTML="")}),(e,t)=>"dynamic"===r.value.mode?(v(),p("span",{key:0,class:j(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},[g(w(o),{nodes:r.value.nodes},null,8,["nodes"])],2)):(v(),p("span",{key:1,ref_key:"containerRef",ref:a,class:j(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},null,2))}}),[["__scopeId","data-v-9a7c4c59"]]);He.install=e=>{e.component(He.__name,He)};const ze={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},Ae=/* @__PURE__ */h({__name:"InlineCodeNode",props:{node:{}},setup:e=>(n,t)=>(v(),p("code",ze,b(e.node.code),1))});Ae.install=e=>{e.component(Ae.__name,Ae)};const Pe=B(!1),Ve=B(""),Ke=B("top"),Oe=B(null),Re=B(null),We=B(null),De=B(null),Ue=B(null);let Fe=null,qe=null;function Xe(){Fe&&(clearTimeout(Fe),Fe=null),qe&&(clearTimeout(qe),qe=null)}let Ge=!1,Ze=null;function Ye(e,n,t="top",o=!1,r,a){if(!e)return;Ge||"undefined"!=typeof document&&(Ze||(Ze=import("./Tooltip.js").then(({default:e})=>{Ge=!0;const n=document.createElement("div");n.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(n),S({setup:()=>()=>{var n;return _(e,{visible:Pe.value,"anchor-el":Oe.value,content:Ve.value,placement:Ke.value,id:Re.value,originX:We.value,originY:De.value,isDark:null!=(n=Ue.value)?n:void 0})}}).mount(n)}).catch(e=>{Ze=null,Ge=!1,console.warn("[markstream-vue] Failed to load Tooltip component. Tooltips will be disabled.",e)}))),Xe();const l=()=>{var o,l;Re.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Oe.value=e,Ve.value=n,Ke.value=t,We.value=null!=(o=null==r?void 0:r.x)?o:null,De.value=null!=(l=null==r?void 0:r.y)?l:null,Ue.value="boolean"==typeof a?a:null,Pe.value=!0;try{e.setAttribute("aria-describedby",Re.value)}catch(i){}};o?l():Fe=setTimeout(l,80)}function Je(e=!1){Xe();const n=()=>{if(Oe.value&&Re.value)try{Oe.value.removeAttribute("aria-describedby")}catch(e){}Pe.value=!1,Oe.value=null,Re.value=null,We.value=null,De.value=null};e?n():qe=setTimeout(n,120)}const Qe={"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 en(e){Object.assign(Qe,e)}function nn(){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 d(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=Qe[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 tn=/* @__PURE__ */Symbol("ViewportPriority");function on(){const e=$(tn,void 0);if(e)return e;const n=/* @__PURE__ */new WeakMap;let t=null;return e=>{const o=B(!1);let r,a=!1;const l=new Promise(e=>{r=()=>{a||(a=!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 r of e){const e=n.get(r.target);if(e&&(r.isIntersecting||r.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==t||t.unobserve(r.target),n.delete(r.target)}}},{root:null,rootMargin:"300px",threshold:0}),t));return s?(n.set(e,{resolve:r,visible:o}),s.observe(e),{isVisible:o,whenVisible:l,destroy:i}):(o.value=!0,r(),{isVisible:o,whenVisible:l,destroy:i})}}const rn={class:"relative inline-block"},an=["src","alt","title","loading","tabindex","aria-label"],ln={class:"text-sm whitespace-nowrap"},sn={key:1,class:"text-sm text-gray-500"},dn={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},cn={class:"text-sm whitespace-nowrap"},un={key:0,class:"mt-2 text-sm text-gray-500 italic"},mn=/* @__PURE__ */J(/* @__PURE__ */h({__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,r=B(!1),a=B(!1),l=B(!1),i=B(null),s=on(),d=B(null),c=B("undefined"==typeof window);"undefined"!=typeof window&&I(()=>i.value,e=>{var n;if(null==(n=d.value)||n.destroy(),d.value=null,!e)return void(c.value=!1);const t=s(e,{rootMargin:"400px"});d.value=t,c.value=t.isVisible.value,t.whenVisible.then(()=>{c.value=!0})},{immediate:!0}),L(()=>{var e;null==(e=d.value)||e.destroy(),d.value=null});const u=C(()=>a.value&&t.fallbackSrc?t.fallbackSrc:t.node.src),m=C(()=>!t.lazy||c.value),h=C(()=>/\.svg(?:\?|$)/i.test(u.value));function f(){t.fallbackSrc&&!l.value?(l.value=!0,a.value=!0):(a.value=!0,o("error",t.node.src))}function y(){r.value=!0,a.value=!1,o("load",u.value)}function x(e){e.preventDefault(),r.value&&!a.value&&o("click",[e,u.value])}const{t:M}=nn();return I(u,()=>{r.value=!1,a.value=!1}),(n,o)=>(v(),p("figure",{ref_key:"figureRef",ref:i,class:"text-center my-8"},[k("div",rn,[g(H,{name:"img-switch",mode:"out-in"},{default:z(()=>{var l,i,s,d,c;return[e.node.loading||a.value||!m.value?a.value?e.node.loading||t.fallbackSrc?N("",!0):(v(),p("div",dn,[P(n.$slots,"error",{node:t.node,displaySrc:u.value,imageLoaded:r.value,hasError:a.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:h.value},()=>[o[1]||(o[1]=k("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[k("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)),k("span",cn,b(w(M)("image.loadError")),1)],!0)])):(v(),p("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:A(h.value?{minHeight:t.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[t.usePlaceholder?P(n.$slots,"placeholder",{key:0,node:t.node,displaySrc:u.value,imageLoaded:r.value,hasError:a.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:h.value},()=>[o[0]||(o[0]=k("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),k("span",ln,b(w(M)("image.loading")),1)],!0):(v(),p("span",sn,b(e.node.raw),1))],4)):(v(),p("img",{key:"image",src:u.value,alt:String(null!=(i=null!=(l=t.node.alt)?l:t.node.title)?i:""),title:String(null!=(d=null!=(s=t.node.title)?s:t.node.alt)?d:""),class:j(["max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",{"opacity-0":!r.value,"opacity-100":r.value,"cursor-pointer":r.value}]),style:A(h.value?{minHeight:t.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:t.lazy?"lazy":"eager",decoding:"async",tabindex:r.value?0:-1,"aria-label":null!=(c=t.node.alt)?c:w(M)("image.preview"),onError:f,onLoad:y,onClick:x},null,46,an))]}),_:3})]),t.showCaption&&t.node.alt?(v(),p("figcaption",un,b(t.node.alt),1)):N("",!0)],512))}}),[["__scopeId","data-v-7ca79b66"]]);mn.install=e=>{e.component(mn.__name,mn)};let hn=null,pn=!1,vn=wn;function fn(e){var n;const t=null!=(n=null==e?void 0:e.default)?n:e;return t&&"function"==typeof t.renderToString?t:null}function gn(){try{const e=globalThis;return fn(null==e?void 0:e.katex)}catch(e){return null}}function wn(){return d(null,null,function*(){const e=gn();if(e)return e;const n=yield import("katex");try{yield import("katex/dist/contrib/mhchem")}catch(t){}return fn(n)})}function kn(e){vn=e,hn=null,pn=!1}function yn(e){kn(null!=e?e:wn)}function xn(){kn(null)}function bn(){return"function"==typeof vn}function Mn(){return d(this,null,function*(){var e;const n=gn();if(n)return hn=n,hn;if(hn)return hn;if(pn)return null;const t=vn;if(!t)return pn=!0,null;try{const n=yield t();if(n)return hn=null!=(e=fn(n))?e:n,hn}catch(o){}return pn=!0,null})}const _n=M(!1);let Cn=null;function Bn(){return Cn||(Cn=Mn().then(e=>{_n.value=!!e}).catch(()=>{_n.value=!1})),V(_n)}const In=/* @__PURE__ */J(/* @__PURE__ */h({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const n=Bn();return(t,o)=>(v(),p("span",{class:j([[w(n)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},b(e.node.content),3))}}),[["__scopeId","data-v-56f30838"]]);In.install=e=>{e.component(In.__name,In)};const Tn=K(()=>d(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 _(In,s(i({},e),{node:s(i({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))};try{if(yield Mn())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 _(In,s(i({},e),{node:s(i({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))}})),Ln=K(()=>d(null,null,function*(){try{if(yield Mn())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 _(In,s(i({},e),{node:s(i({},e.node),{content:null!=(t=e.node.raw)?t:`$$${null!=(n=e.node.content)?n:""}$$`})}))}})),jn=/* @__PURE__ */h({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(n,t)=>(v(),p("span",{class:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--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))});jn.install=e=>{e.component(jn.__name,jn)};const Sn={class:"superscript-node"},$n={key:1},En=/* @__PURE__ */J(/* @__PURE__ */h({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=pe(n.customId),o=i({text:In,inline_code:Ae,link:Fn,html_inline:He,strong:Pn,emphasis:Jn,footnote_reference:ke,strikethrough:Kn,highlight:Zn,insert:Xn,subscript:zn,emoji:se,math_inline:Tn,reference:jn},t);return(t,r)=>(v(),p("sup",Sn,[(v(!0),p(y,null,x(e.node.children,(t,r)=>(v(),p(y,{key:`${e.indexKey||"superscript"}-${r}`},[o[t.type]?(v(),O(R(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"superscript"}-${r}`},null,8,["node","custom-id","index-key"])):(v(),p("span",$n,b(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-6dc1e3ba"]]);En.install=e=>{e.component(En.__name,En)};const Nn={class:"subscript-node"},Hn={key:1},zn=/* @__PURE__ */J(/* @__PURE__ */h({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=pe(n.customId),o=i({text:In,inline_code:Ae,link:Fn,html_inline:He,strong:Pn,emphasis:Jn,footnote_reference:ke,strikethrough:Kn,highlight:Zn,insert:Xn,superscript:En,emoji:se,math_inline:Tn,reference:jn},t);return(t,r)=>(v(),p("sub",Nn,[(v(!0),p(y,null,x(e.node.children,(t,r)=>(v(),p(y,{key:`${e.indexKey||"subscript"}-${r}`},[o[t.type]?(v(),O(R(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"subscript"}-${r}`},null,8,["node","custom-id","index-key"])):(v(),p("span",Hn,b(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-69de9b81"]]);zn.install=e=>{e.component(zn.__name,zn)};const An={class:"strong-node"},Pn=/* @__PURE__ */J(/* @__PURE__ */h({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=pe(n.customId),o=i({text:In,inline_code:Ae,link:Fn,html_inline:He,emphasis:Jn,strikethrough:Kn,highlight:Zn,insert:Xn,subscript:zn,superscript:En,emoji:se,footnote_reference:ke,math_inline:Tn,reference:jn},t);return(t,r)=>(v(),p("strong",An,[(v(!0),p(y,null,x(e.node.children,(t,r)=>(v(),O(R(o[t.type]),{key:`${e.indexKey||"strong"}-${r}`,"index-key":`${e.indexKey||"strong"}-${r}`,node:t,"custom-id":n.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-af3ce037"]]);Pn.install=e=>{e.component(Pn.__name,Pn)};const Vn={class:"strikethrough-node"},Kn=/* @__PURE__ */J(/* @__PURE__ */h({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=pe(n.customId),o=i({text:In,inline_code:Ae,link:Fn,html_inline:He,strong:Pn,emphasis:Jn,highlight:Zn,insert:Xn,subscript:zn,superscript:En,emoji:se,footnote_reference:ke,math_inline:Tn,reference:jn},t);return(t,r)=>(v(),p("del",Vn,[(v(!0),p(y,null,x(e.node.children,(t,r)=>(v(),O(R(o[t.type]),{key:`${e.indexKey||"strikethrough"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-904d5bd1"]]);Kn.install=e=>{e.component(Kn.__name,Kn)};const On=["href","title","aria-label","aria-hidden"],Rn=["aria-hidden"],Wn={class:"link-text-wrapper relative inline-flex"},Dn={class:"leading-[normal] link-text"},Un={class:"leading-[normal] link-text"},Fn=/* @__PURE__ */J(/* @__PURE__ */h({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const n=e,t=C(()=>{var e,t,o,r,a,l;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!=(r=n.animationDuration)?r:.8}s`,"--underline-timing":null!=(a=n.animationTiming)?a:"linear","--underline-iteration":"number"==typeof n.animationIteration?String(n.animationIteration):null!=(l=n.animationIteration)?l:"infinite"}}),o={text:In,strong:Pn,strikethrough:Kn,emphasis:Jn,image:mn,html_inline:He,inline_code:Ae},r=W();function a(){n.showTooltip&&Je()}const l=C(()=>{var e,t;return String(null!=(t=null!=(e=n.node.title)?e:n.node.href)?t:"")});return(i,s)=>e.node.loading?(v(),p("span",D({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},w(r),{style:t.value}),[k("span",Wn,[k("span",Dn,[k("span",Un,b(e.node.text),1)]),s[1]||(s[1]=k("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,Rn)):(v(),p("a",D({key:0,class:"link-node",href:e.node.href,title:e.showTooltip?"":l.value,"aria-label":`Link: ${l.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},w(r),{style:t.value,onMouseenter:s[0]||(s[0]=e=>function(e){var t,o,r;if(!n.showTooltip)return;const a=e,l=null!=(null==a?void 0:a.clientX)&&null!=(null==a?void 0:a.clientY)?{x:a.clientX,y:a.clientY}:void 0,i=(null==(t=n.node)?void 0:t.title)||(null==(o=n.node)?void 0:o.href)||(null==(r=n.node)?void 0:r.text)||"";Ye(e.currentTarget,i,"top",!1,l)}(e)),onMouseleave:a}),[(v(!0),p(y,null,x(e.node.children,(t,r)=>(v(),O(R(function(e){return pe(n.customId)[e.type]||o[e.type]||null}(t)),{key:`${e.indexKey||"emphasis"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"link-text"}-${r}`},null,8,["node","custom-id","index-key"]))),128))],16,On))}}),[["__scopeId","data-v-529b3b1e"]]);Fn.install=e=>{e.component(Fn.__name,Fn)};const qn={class:"insert-node"},Xn=/* @__PURE__ */J(/* @__PURE__ */h({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=pe(n.customId),o=i({text:In,inline_code:Ae,link:Fn,html_inline:He,strong:Pn,emphasis:Jn,strikethrough:Kn,highlight:Zn,subscript:zn,superscript:En,emoji:se,footnote_reference:ke,math_inline:Tn,reference:jn},t);return(t,r)=>(v(),p("ins",qn,[(v(!0),p(y,null,x(e.node.children,(t,r)=>(v(),O(R(o[t.type]),{key:`${e.indexKey||"insert"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"insert"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-ab1ec9bc"]]);Xn.install=e=>{e.component(Xn.__name,Xn)};const Gn={class:"highlight-node"},Zn=/* @__PURE__ */J(/* @__PURE__ */h({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=pe(n.customId),o=i({text:In,inline_code:Ae,link:Fn,html_inline:He,strong:Pn,emphasis:Jn,strikethrough:Kn,insert:Xn,subscript:zn,superscript:En,emoji:se,footnote_reference:ke,math_inline:Tn,reference:jn},t);return(t,r)=>(v(),p("mark",Gn,[(v(!0),p(y,null,x(e.node.children,(t,r)=>(v(),O(R(o[t.type]),{key:`${e.indexKey||"highlight"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"highlight"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-38e31bf6"]]);Zn.install=e=>{e.component(Zn.__name,Zn)};const Yn={class:"emphasis-node"},Jn=/* @__PURE__ */J(/* @__PURE__ */h({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=pe(n.customId),o=i({text:In,inline_code:Ae,link:Fn,html_inline:He,strong:Pn,strikethrough:Kn,highlight:Zn,insert:Xn,subscript:zn,superscript:En,emoji:se,footnote_reference:ke,math_inline:Tn,reference:jn},t);return(t,r)=>(v(),p("em",Yn,[(v(!0),p(y,null,x(e.node.children,(t,r)=>(v(),O(R(o[t.type]),{key:`${e.indexKey||"emphasis"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8264674d"]]);Jn.install=e=>{e.component(Jn.__name,Jn)};const Qn=["href","title"],et=/* @__PURE__ */J(/* @__PURE__ */h({__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:"")}`,r=document.getElementById(o);r&&r.scrollIntoView({behavior:"smooth"})}return(n,o)=>(v(),p("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:t}," ↩︎ ",8,Qn))}}),[["__scopeId","data-v-4756ce0d"]]);et.install=e=>{e.component(et.__name,et)};const nt=["id"],tt={class:"flex-1"},ot=/* @__PURE__ */h({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(v(),p("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[k("div",tt,[f([n.node.children],()=>g(w(jt),{"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,nt))}});ot.install=e=>{e.component(ot.__name,ot)};const rt={class:"hard-break"},at=/* @__PURE__ */J(/* @__PURE__ */h({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,n)=>(v(),p("br",rt))}),[["__scopeId","data-v-50c58f70"]]);at.install=e=>{e.component(at.__name,at)};const lt=/* @__PURE__ */J(/* @__PURE__ */h({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=pe(n.customId),o=i({text:In,inline_code:Ae,link:Fn,image:mn,strong:Pn,emphasis:Jn,strikethrough:Kn,highlight:Zn,insert:Xn,subscript:zn,superscript:En,emoji:se,checkbox:te,checkbox_input:te,footnote_reference:ke,hardbreak:at,math_inline:Tn,reference:jn},t);return(t,r)=>f([e.node.level,e.node.children,e.node.attrs],()=>(v(),O(R(`h${e.node.level}`),D({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:z(()=>[(v(!0),p(y,null,x(e.node.children,(t,r,a,l)=>{const i=[t];if(l&&l.key===`${e.indexKey||"heading"}-${r}`&&U(l,i))return l;const s=(v(),O(R(o[t.type]),{key:`${e.indexKey||"heading"}-${r}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"heading"}-${r}`},null,8,["custom-id","node","index-key"]));return s.memo=i,s},r,0),128))]),_:1},16,["class"])),r,2)}}),[["__scopeId","data-v-af2f957a"]]),it=lt;it.install=e=>{e.component(lt.__name,lt)};const st=/* @__PURE__ */J(/* @__PURE__ */h({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const n=e,t=C(()=>{var e;return null!=(e=n.node)?e:n.item}),o=C(()=>null==n.value?{}:{value:n.value});return(e,r)=>{var a;return v(),p("li",D({class:"list-item pl-1.5 my-2",dir:"auto"},o.value),[f([null==(a=t.value)?void 0:a.children],()=>{var o,a;return g(w(jt),{"index-key":`list-item-${n.indexKey}`,nodes:null!=(a=null==(o=t.value)?void 0:o.children)?a:[],"custom-id":n.customId,typewriter:n.typewriter,"batch-rendering":!1,onCopy:r[0]||(r[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])},r,1)],16)}}}),[["__scopeId","data-v-31a88b1f"]]);st.install=e=>{e.component(st.__name,st)};const dt=/* @__PURE__ */J(/* @__PURE__ */h({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const n=C(()=>(me.value,pe(e.customId).list_item||st));return(t,o)=>(v(),O(R(e.node.ordered?"ol":"ul"),{class:j(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:z(()=>[(v(!0),p(y,null,x(e.node.items,(r,a,l,i)=>{var s;const d=[r];if(i&&i.key===`${e.indexKey||"list"}-${a}`&&U(i,d))return i;const c=(v(),O(R(n.value),{key:`${e.indexKey||"list"}-${a}`,node:r,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${a}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(s=e.node.start)?s:1)+a:void 0,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,40,["node","custom-id","index-key","typewriter","value"]));return c.memo=d,c},o,1),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-01209c2b"]]);dt.install=e=>{e.component(dt.__name,dt)};const ct={key:1,class:"html-block-node__raw"},ut={key:1,class:"html-block-node__placeholder"},mt=/* @__PURE__ */J(/* @__PURE__ */h({__name:"HtmlBlockNode",props:{node:{},customId:{}},setup(e){const n=e,t=C(()=>{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=C(()=>(me.value,pe(n.customId))),r=h({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),a=B(null),l=B("undefined"==typeof window),i=B(n.node.content),s=C(()=>{var e,t,r;if(!l.value)return{mode:"html",content:null!=(e=i.value)?e:""};const a=null!=(t=i.value)?t:n.node.content;if(!a)return{mode:"html",content:""};if(n.node.loading){const e=Ne(a,o.value);return null===e?{mode:"text",content:null!=(r=n.node.raw)?r:a}:{mode:"dynamic",nodes:e}}if(!Ee(a,o.value))return{mode:"html",content:a};const s=Ne(a,o.value);return null===s?{mode:"html",content:a}:{mode:"dynamic",nodes:s}}),d=on(),c=B(null),u=!!n.node.loading;return"undefined"!=typeof window?(I(a,e=>{var t,o;if(null==(o=null==(t=c.value)?void 0:t.destroy)||o.call(t),c.value=null,!u)return l.value=!0,void(i.value=n.node.content);if(!e)return void(l.value=!1);const r=d(e,{rootMargin:"400px"});c.value=r,l.value=r.isVisible.value,r.whenVisible.then(()=>{l.value=!0})},{immediate:!0}),I(()=>n.node.content,e=>{u&&!l.value||(i.value=e)})):l.value=!0,L(()=>{var e,n;null==(n=null==(e=c.value)?void 0:e.destroy)||n.call(e),c.value=null}),(n,o)=>(v(),p("div",D({ref_key:"htmlRef",ref:a,class:"html-block-node"},t.value),[l.value?(v(),p(y,{key:0},["dynamic"===s.value.mode?(v(),O(w(r),{key:0,nodes:s.value.nodes},null,8,["nodes"])):"text"===s.value.mode?(v(),p("pre",ct,b(s.value.content),1)):f([i.value],()=>(v(),p("div",{key:2,innerHTML:i.value},null,8,["innerHTML"])),o,0)],64)):(v(),p("div",ut,[P(n.$slots,"placeholder",{node:e.node},()=>[o[1]||(o[1]=k("span",{class:"html-block-node__placeholder-bar"},null,-1)),o[2]||(o[2]=k("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),o[3]||(o[3]=k("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-6797fa3c"]]);mt.install=e=>{e.component(mt.__name,mt)};const ht={dir:"auto",class:"paragraph-node"},pt=/* @__PURE__ */J(/* @__PURE__ */h({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=pe(n.customId),o=i({inline_code:Ae,image:mn,link:Fn,hardbreak:at,emphasis:Jn,strong:Pn,strikethrough:Kn,highlight:Zn,insert:Xn,subscript:zn,superscript:En,html_inline:He,html_block:mt,emoji:se,checkbox:te,math_inline:Tn,checkbox_input:te,reference:jn,footnote_anchor:et,footnote_reference:ke},t),r=Bn();return(t,a)=>(v(),p("p",ht,[(v(!0),p(y,null,x(e.node.children,(t,a)=>(v(),p(y,{key:`${e.indexKey||"paragraph"}-${a}`},["text"!==t.type?(v(),O(R(o[t.type]),{key:0,node:t,"index-key":`${e.indexKey}-${a}`,"custom-id":n.customId},null,8,["node","index-key","custom-id"])):(v(),p("span",{key:1,class:j([[w(r)&&t.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},b(t.content),3))],64))),128))]))}}),[["__scopeId","data-v-4e2afdbc"]]);pt.install=e=>{e.component(pt.__name,pt)};const vt=["aria-busy","aria-label","data-language"],ft=["textContent"],gt=/* @__PURE__ */h({__name:"PreCodeNode",props:{node:{}},setup(e){const n=e,t=C(()=>{var e,t,o;const r=String(null!=(t=null==(e=n.node)?void 0:e.language)?t:"");return String(null!=(o=String(r).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=C(()=>`language-${t.value}`),r=C(()=>{const e=t.value;return e?`Code block: ${e}`:"Code block"});return(n,a)=>(v(),p("pre",{class:j([o.value]),"aria-busy":!0===e.node.loading,"aria-label":r.value,"data-language":t.value,tabindex:"0"},[k("code",{translate:"no",textContent:b(e.node.code)},null,8,ft)],10,vt))}});gt.install=e=>{e.component(gt.__name,gt)};const wt={class:"table-node-wrapper"},kt=["aria-busy"],yt={class:"border-[var(--table-border,#cbd5e1)]"},xt={class:"border-b"},bt={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Mt=/* @__PURE__ */J(/* @__PURE__ */h({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e,t=C(()=>{var e;return null!=(e=n.node.loading)&&e}),o=C(()=>{var e;return null!=(e=n.node.rows)?e:[]});return(r,a)=>(v(),p("div",wt,[k("table",{class:j(["my-8 text-sm table-node",{"table-node--loading":t.value}]),"aria-busy":t.value},[k("thead",yt,[k("tr",xt,[(v(!0),p(y,null,x(e.node.header.cells,(e,t)=>(v(),p("th",{key:`header-${t}`,dir:"auto",class:j(["font-semibold p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]])},[g(w(jt),{nodes:e.children,"index-key":`table-th-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:a[0]||(a[0]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),k("tbody",null,[(v(!0),p(y,null,x(o.value,(e,t)=>(v(),p("tr",{key:`row-${t}`,class:j(["border-[var(--table-border,#cbd5e1)]",[t<o.value.length-1?"border-b":""]])},[(v(!0),p(y,null,x(e.cells,(e,o)=>(v(),p("td",{key:`cell-${t}-${o}`,class:j(["p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]]),dir:"auto"},[g(w(jt),{nodes:e.children,"index-key":`table-td-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:a[1]||(a[1]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,kt),g(H,{name:"table-node-fade"},{default:z(()=>[t.value?(v(),p("div",bt,[P(r.$slots,"loading",{isLoading:t.value},()=>[a[2]||(a[2]=k("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),a[3]||(a[3]=k("span",{class:"sr-only"},"Loading",-1))],!0)])):N("",!0)]),_:3})]))}}),[["__scopeId","data-v-369096fa"]]);Mt.install=e=>{e.component(Mt.__name,Mt)};const _t={class:"hr-node"},Ct=/* @__PURE__ */J({},[["render",function(e,n){return v(),p("hr",_t)}],["__scopeId","data-v-639cbad9"]]);Ct.install=e=>{e.component(Ct.__name,Ct)};const Bt={class:"unknown-node"},It=/* @__PURE__ */h({__name:"FallbackComponent",props:{node:{}},setup:e=>(n,t)=>(v(),p("div",Bt,b(e.node.raw),1))}),Tt=/* @__PURE__ */J(/* @__PURE__ */h({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},setup(e){const n=e,t=C(()=>`vmr-container vmr-container-${n.node.name}`),o=pe(n.customId),r=i({text:In,paragraph:pt,heading:it,inline_code:Ae,link:Fn,image:mn,strong:Pn,emphasis:Jn,strikethrough:Kn,insert:Xn,subscript:zn,superscript:En,checkbox:te,checkbox_input:te,hardbreak:at,math_inline:Tn,reference:jn,list:dt,math_block:Ln,table:Mt},o);return(o,a)=>(v(),p("div",D({class:t.value},e.node.attrs),[(v(!0),p(y,null,x(e.node.children,(t,o,a,l)=>{const i=[t];if(l&&l.key===`${e.indexKey||"vmr-container"}-${o}`&&U(l,i))return l;const s=(v(),O(R((d=t.type,r[d]||It)),{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 d;return s.memo=i,s},a,0),128))],16))}}),[["__scopeId","data-v-fac7405d"]]);Tt.install=e=>{e.component(Tt.__name,Tt)};const Lt=["data-node-index","data-node-type"],jt=/* @__PURE__ */J(/* @__PURE__ */h({__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},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,r;const a=e,l=n,s=B(),m=B(!1),h=/auto|scroll|overlay/i,f="undefined"!=typeof window,g=C(()=>a.debugPerformance&&f&&"undefined"!=typeof console);function w(e,n){g.value&&console.info(`[markstream-vue][perf] ${e}`,n)}function k(e){if("undefined"==typeof window)return null;const n=null!=e?e:s.value;if(!n)return null;const t=n.ownerDocument||document,o=t.scrollingElement||t.documentElement;let r=n;for(;r&&r!==t.body&&r!==o;){const e=window.getComputedStyle(r),n=(e.overflowY||"").toLowerCase(),t=(e.overflow||"").toLowerCase();if(h.test(n)||h.test(t))return r;r=r.parentElement}return null}const b=a.customId?`renderer-${a.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,M=c(b),_=C(()=>{const e=a.customHtmlTags;return e&&0!==e.length?c(b,{customHtmlTags:e}):M}),T=C(()=>{const e=_.value;return a.customMarkdownIt?a.customMarkdownIt(e):e});function S(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 $=C(()=>{var e,n,t,o;const r=null!=(e=a.parseOptions)?e:{},l=null!=(n=a.final)?n:r.final,s=[...null!=(t=a.customHtmlTags)?t:[],...null!=(o=r.customHtmlTags)?o:[]].map(S).filter(Boolean),d=null!=l,c=s.length>0;return d||c?i(i(i({},r),d?{final:l}:{}),c?{customHtmlTags:Array.from(new Set(s))}:{}):r}),P=C(()=>{var e;if(null==(e=a.nodes)?void 0:e.length)return F(a.nodes.slice());if(a.content){const e=g.value?performance.now():0,n=u(a.content,T.value,$.value);return g.value&&w("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:a.content.length}),F(n)}return[]}),V=C(()=>{var e;return Math.max(1,null!=(e=a.maxLiveNodes)?e:320)}),W=C(()=>{var e;return!((null!=(e=a.maxLiveNodes)?e:0)<=0)&&P.value.length>V.value}),U=C(()=>!1!==a.viewportPriority&&!m.value),G=function(e,n){const t="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof n?B(n):n;let r=null,a=null;const l=/* @__PURE__ */new WeakMap,s=(n,s)=>{const d=B(!1);let c,u=!1;const m=new Promise(e=>{c=()=>{u||(u=!0,e())}}),h=()=>{try{null==r||r.unobserve(n)}catch(e){}l.delete(n)};if(!t||!o.value)return d.value=!0,c(),{isVisible:d,whenVisible:m,destroy:h};!a&&s&&(a=i({},s));const p=function(n){var o,i,s;if(r||!t)return r;if("undefined"==typeof IntersectionObserver)return null;const d=null!=(o=null==e?void 0:e(null!=n?n:null))?o:null,c=a||{};return r=new IntersectionObserver(e=>{for(const t of e){const e=l.get(t.target);if(e&&(t.isIntersecting||t.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(n){}}null==r||r.unobserve(t.target),l.delete(t.target)}}},{root:d,rootMargin:null!=(i=c.rootMargin)?i:"300px",threshold:null!=(s=c.threshold)?s:0}),r}(n);return p?(l.set(n,{resolve:c,visible:d}),p.observe(n),{isVisible:d,whenVisible:m,destroy:h}):(d.value=!0,c(),{isVisible:d,whenVisible:m,destroy:h})};return E(tn,s),s}(e=>{var n;return k(null!=(n=null!=e?e:s.value)?n:null)},U),Z=f&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,Y=f&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,J="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=C(()=>{var e;const n=Math.trunc(null!=(e=a.renderBatchSize)?e:80);return Number.isFinite(n)?Math.max(0,n):0}),oe=C(()=>{var e;const n=Math.trunc(null!=(e=a.initialRenderBatchSize)?e:ne.value);return Number.isFinite(n)?Math.max(0,n):ne.value}),re=C(()=>!1!==a.batchRendering&&ne.value>0&&f&&!J),ae=B(0),ie=B({key:a.indexKey,total:0}),de=B(Math.max(1,ne.value||1)),ce=q({}),ue=/* @__PURE__ */new Map,he=/* @__PURE__ */new Map,ve=/* @__PURE__ */new Map,fe=B(null);let ge=null,we=null;const ye=C(()=>{var e;return!1!==a.deferNodesUntilVisible&&!((null!=(e=a.maxLiveNodes)?e:0)<=0)&&!W.value&&!(P.value.length>900)&&U.value}),xe=C(()=>{var e;return re.value&&(null!=(e=a.maxLiveNodes)?e:0)<=0}),be=B({batchSize:ne.value,initial:oe.value,delay:null!=(r=a.renderBatchDelay)?r:16,enabled:xe.value}),Me=C(()=>!!G&&(ye.value||W.value)),_e=C(()=>{var e;return Math.max(0,null!=(e=a.liveNodeBuffer)?e:60)}),Ce=B(0),Be=q({start:0,end:0}),Ie=/* @__PURE__ */new Map,Te=C(()=>{if(!W.value)return P.value.length;const e=_e.value,n=Math.max(Be.end+e,oe.value),t=Math.min(P.value.length,n);return Math.max(ae.value,t)});function Le(e){var n,t,o,r;const a=k(null!=(n=null!=e?e:s.value)?n:null);if(a)return a;const l=null!=(r=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(t=s.value)?void 0:t.ownerDocument)?r:"undefined"!=typeof document?document:null;return(null==l?void 0:l.scrollingElement)||(null==l?void 0:l.documentElement)||null}function je(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 Se(){ge&&(ge(),ge=null),fe.value=null}function $e(){if(!f||!W.value)return;const e=Le();if(!e||fe.value===e)return;Se();const n=()=>Ne();e.addEventListener("scroll",n,{passive:!0}),fe.value=e,ge=()=>{e.removeEventListener("scroll",n)}}function Ee(){var e,n,t;if(!we)return;const o=null!=(t=null==(n=null==(e=s.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==Y||Y(we.id),we=null}function Ne(e={}){var n,t,o;if(!W.value)return;if(!f)return void ze(!0);if(e.immediate)return Ee(),void ze(!0);if(we)return;const r=()=>{we=null,ze()};if(Z)we={id:Z(r),viaTimeout:!1};else{const e=null!=(o=null==(t=null==(n=s.value)?void 0:n.ownerDocument)?void 0:t.defaultView)?o:"undefined"!=typeof window?window:null,a=e?e.setTimeout(r,16):setTimeout(r,16);we={id:a,viaTimeout:!0}}}function ze(e=!1){var n,t,o,r,a,l,i;if(!W.value)return;const d=fe.value||Le();if(!d)return;const c=d.ownerDocument||(null==(n=s.value)?void 0:n.ownerDocument)||document,u=(null==c?void 0:c.defaultView)||("undefined"!=typeof window?window:null),m=d===(null==c?void 0:c.documentElement)||d===(null==c?void 0:c.body),h=P.value.length;if(!m&&h>0&&je(d)){const n=d.clientHeight||0,t=d.scrollTop,o=t<0?-t:t,r=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 r=t.length-1;r>=0;r--){const e=null!=(n=Ve[r])?n:Oe.value;if(o<=e)return r;o-=e}return 0}(Math.max(0,o)+.5*Math.max(0,n)),a=Pe(r,0,Math.max(0,h-1));return void((e||Math.abs(a-Ce.value)>1)&&(Ce.value=a))}const p=m?null:d.getBoundingClientRect(),v=m?0:p.top,f=m?null!=(o=null!=(t=null==u?void 0:u.innerHeight)?t:d.clientHeight)?o:0:p.bottom,g=Array.from(ve.entries()).sort((e,n)=>e[0]-n[0]);let w=null,k=null;for(const[s,x]of g){if(!x)continue;const e=x.getBoundingClientRect();e.bottom<=v||e.top>=f||(null==w&&(w=s),k=s)}if(null==w||null==k){const e=s.value;if(!e)return;const n=m?{top:0}:d.getBoundingClientRect(),t=function(e,n,t){var o,r,a,l,i,s;if(t)return null!=(l=null!=(a=null==(o=null==n?void 0:n.documentElement)?void 0:o.scrollTop)?a:null==(r=null==n?void 0:n.body)?void 0:r.scrollTop)?l:0;const d=e.scrollTop;if(!je(e))return d;const c=d<0?-d:d;return Math.max(0,(null!=(i=e.scrollHeight)?i:0)-(null!=(s=e.clientHeight)?s:0))-c}(d,c,m),o=m?(()=>{const t=e.getBoundingClientRect(),o=(m?0:n.top)-t.top;return Math.max(0,o)})():(()=>{const n=function(e,n){let t=e,o=0,r=0;for(;t&&t!==n&&r++<64;)o+=t.offsetTop||0,t=t.offsetParent;return o}(e,d);return Math.max(0,t-n)})(),h=m?null!=(i=null!=(l=null!=(a=null==u?void 0:u.innerHeight)?a:null==(r=null==c?void 0:c.documentElement)?void 0:r.clientHeight)?l:d.clientHeight)?i:0:d.clientHeight,p=function(e){var n;if(e<=0)return 0;let t=e;const o=P.value;for(let r=0;r<o.length;r++){const e=null!=(n=Ve[r])?n:Oe.value;if(t<=e)return r;t-=e}return Math.max(0,o.length-1)}(o+.5*Math.max(0,h));return void(Ce.value=Pe(p,0,Math.max(0,P.value.length-1)))}const y=Math.round((w+k)/2);!e&&Math.abs(y-Ce.value)<=1||(Ce.value=Pe(y,0,Math.max(0,P.value.length-1)))}function Pe(e,n,t){return Math.min(Math.max(e,n),t)}const Ve=q({}),Ke=q({total:0,count:0}),Oe=C(()=>Ke.count>0?Math.max(12,Ke.total/Ke.count):32);function Re(e,n){var t;if(e>=n)return 0;let o=0;for(let r=e;r<n;r++)o+=null!=(t=Ve[r])?t:Oe.value;return o}const We=C(()=>{if(!W.value)return P.value.map((e,n)=>({node:e,index:n}));const e=P.value.length,n=Pe(Be.start,0,e),t=Pe(Be.end,n,e);return P.value.slice(n,t).map((e,t)=>({node:e,index:n+t}))}),De=C(()=>W.value?Re(0,Math.min(Be.start,P.value.length)):0),Ue=C(()=>{if(!W.value)return 0;const e=P.value.length;return Re(Math.min(Be.end,e),e)});function Fe(e){if(ue.size&&W.value)for(const[n,t]of ue)n>=e&&(t.destroy(),ue.delete(n),ye.value&&delete ce[n],on(n),ve.delete(n))}function qe(e,n){ye.value&&(ce[e]=n),n&&(W.value?Ne():Ce.value=Pe(e,0,Math.max(0,P.value.length-1)))}function Xe(e){const n=ue.get(e);n&&(n.destroy(),ue.delete(e)),on(e)}function Ge(e,n){if(n?ve.set(e,n):ve.delete(e),n||on(e),!Me.value||!G)return Xe(e),void(n?qe(e,!0):ye.value&&delete ce[e]);if(!W.value&&ye.value&&!m.value&&ue.size>=640&&(function(){if(!m.value){m.value=!0;for(const e of ue.values())e.destroy();if(ue.clear(),f)for(const e of he.values())window.clearTimeout(e);he.clear();for(const e of Object.keys(ce))delete ce[e]}}(),!Me.value||!G))return Xe(e),void(n?qe(e,!0):ye.value&&delete ce[e]);if(e<oe.value&&!W.value)return Xe(e),void qe(e,!0);if(!n)return Xe(e),void(ye.value&&delete ce[e]);Xe(e);const t=G(n,{rootMargin:"400px"});t&&(ue.set(e,t),qe(e,t.isVisible.value),ye.value&&function(e){if(!f||!ye.value)return;on(e);const n=e%17*23,t=window.setTimeout(()=>{var n,t;if(he.delete(e),!ye.value)return;if(!0===ce[e])return;const o=ve.get(e);if(!o)return void delete ce[e];const r=Le(o),a=o.ownerDocument||document,l=a.defaultView||window,i=!r||r===a.documentElement||r===a.body,s=!i&&r?r.getBoundingClientRect():null,d=i?0:s.top,c=i?null!=(t=null!=(n=l.innerHeight)?n:null==r?void 0:r.clientHeight)?t:0:s.bottom,u=o.getBoundingClientRect();u.bottom>=d-500&&u.top<=c+500&&qe(e,!0)},1800+n);he.set(e,t)}(e),t.whenVisible.then(()=>{on(e),qe(e,!0)}).catch(()=>{}).finally(()=>{ue.get(e)===t&&ue.delete(e);try{t.destroy()}catch(n){}}),W.value&&Ne())}let Ze=null,Ye=null,Je=!1,Qe=null,en=null;function nn(){f&&(null!=Ze&&(null==Y||Y(Ze),Ze=null),null!=Ye&&(window.clearTimeout(Ye),Ye=null),null!=en&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(en),en=null),Je=!1,Qe=null)}function on(e){if(!f)return;const n=he.get(e);null!=n&&(window.clearTimeout(n),he.delete(e))}function rn(e,n={}){var t,o;if(!xe.value)return;const r=Te.value;if(ae.value>=r)return;const l=Math.max(1,e),i=e=>{var n;Ze=null,Ye=null,en=null,Je=!1;const t=null!=Qe?Qe:l;Qe=null;const o=Math.max(2,null!=(n=a.renderBatchBudgetMs)?n:6),i=e=>{const n="undefined"!=typeof performance?performance.now():Date.now();ae.value=Math.min(r,ae.value+Math.max(1,e)),Fe(ae.value);const t=("undefined"!=typeof performance?performance.now():Date.now())-n;return function(e){var n;if(!xe.value)return;const t=Math.max(2,null!=(n=a.renderBatchBudgetMs)?n:6),o=Math.max(1,ne.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*t?de.value=Math.max(r,Math.floor(.7*de.value)):e<.5*t&&de.value<o&&(de.value=Math.min(o,Math.ceil(1.2*de.value)))}(t),t};let s=t;for(;(i(s),!(ae.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(de.value));ae.value<r&&an()};if(!f||n.immediate)return void i();const s=Math.max(0,null!=(t=a.renderBatchDelay)?t:16);if(Qe=null!=Qe?Math.max(Qe,l):l,!Je){if(Je=!0,!J&&ee&&window.requestIdleCallback){const e=Math.max(0,null!=(o=a.renderBatchIdleTimeoutMs)?o:120);return void(en=window.requestIdleCallback(e=>{i(e)},{timeout:e}))}Z&&!J?Ze=Z(()=>{0!==s?Ye=window.setTimeout(()=>i(),s):i()}):Ye=window.setTimeout(()=>i(),s)}}function an(){xe.value&&rn(re.value?Math.max(1,Math.round(de.value)):Math.max(1,ne.value))}I([()=>P.value,()=>P.value.length,()=>xe.value,()=>ne.value,()=>oe.value,()=>a.renderBatchDelay,()=>a.indexKey],()=>{var e;const n=P.value.length,t=ie.value,o=a.indexKey,r=void 0!==o&&o!==t.key,l=n!==t.total,i=r||l;ie.value={key:o,total:n};const s=be.value,d=null!=(e=a.renderBatchDelay)?e:16,c=s.batchSize!==ne.value||s.initial!==oe.value||s.delay!==d||s.enabled!==xe.value;be.value={batchSize:ne.value,initial:oe.value,delay:d,enabled:xe.value},(i||c||!xe.value)&&nn(),(i||c)&&(de.value=Math.max(1,ne.value||1)),i&&W.value&&Ne({immediate:!0});const u=Te.value;if(!n)return ae.value=0,void Fe(0);if(!xe.value)return ae.value=u,void Fe(ae.value);const m=r||0===t.total;ae.value=m||c?Math.min(u,oe.value):Math.min(ae.value,u);const h=Math.max(1,oe.value||ne.value||n);ae.value<u?rn(h,{immediate:!f}):Fe(ae.value)},{immediate:!0}),I(()=>W.value,e=>{if(!e)return Se(),void Ee();$e(),Ne({immediate:!0})},{immediate:!0}),I([()=>P.value.length,()=>W.value],e=>d(null,[e],function*([e,n]){n&&e&&f&&(yield X(),Ne({immediate:!0}))}),{flush:"post"}),I(()=>s.value,()=>{W.value&&($e(),Ne({immediate:!0}))}),I(()=>P.value.length,()=>{W.value&&Ne({immediate:!0})}),I(()=>ye.value,e=>{if(e)for(const[n,t]of ve)Ge(n,t);else{for(const e of ue.values())e.destroy();ue.clear();for(const e of Array.from(he.keys()))on(e);for(const e of Object.keys(ce))delete ce[e];for(const[e,n]of ve)n&&qe(e,!0)}},{immediate:!1}),I([()=>a.viewportPriority,()=>P.value.length],([e,n])=>{!1!==e?m.value&&n<=200&&(m.value=!1):m.value=!1}),I(()=>ae.value,()=>{W.value&&Ne({immediate:!0})}),I([Ce,V,_e,()=>P.value.length,W],()=>{!function(){const e=P.value.length;if(!W.value||0===e)return Be.start=0,void(Be.end=e);const n=Math.min(V.value,e),t=_e.value,o=Pe(Ce.value-t,0,Math.max(0,e-n));Be.start=o,Be.end=Math.min(e,o+n)}()},{immediate:!0}),I([()=>P.value.length,W,V,_e,()=>Be.start,()=>Be.end],([e,n,t,o,r,a])=>{g.value&&w("virtualization",{nodes:e,virtualization:n,maxLiveNodes:t,buffer:o,focusIndex:Ce.value,scroll:n?(()=>{const e=fe.value||Le();return e?{reverse:je(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:r,end:a},rendered:ae.value})}),I(()=>Te.value,(e,n)=>{xe.value&&("number"==typeof n&&e<=n||e>ae.value&&an())}),L(()=>{nn();for(const e of ue.values())e.destroy();ue.clear();for(const e of Array.from(he.keys()))on(e);Se(),Ee()});const ln=K(()=>d(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),gt}})),sn=K(()=>d(null,null,function*(){try{return(yield import("./index5.js")).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),gt}})),dn=K(()=>d(null,null,function*(){try{return(yield import("./index6.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering. To enable Infographic rendering, please install "@antv/infographic".',e),gt}})),cn=C(()=>a.renderCodeBlocksAsPre?gt:ln),un={text:In,paragraph:pt,heading:it,code_block:ln,list:dt,list_item:st,blockquote:Q,table:Mt,definition_list:le,footnote:ot,footnote_reference:ke,footnote_anchor:et,admonition:At,vmr_container:Tt,hardbreak:at,link:Fn,image:mn,thematic_break:Ct,math_inline:Tn,math_block:Ln,strong:Pn,emphasis:Jn,strikethrough:Kn,highlight:Zn,insert:Xn,subscript:zn,superscript:En,emoji:se,checkbox:te,checkbox_input:te,inline_code:Ae,html_inline:He,reference:jn,html_block:mt};function hn(e){var n;if(!e)return It;me.value;const t=pe(a.customId),o=t[String(e.type)];if("code_block"===e.type){const r=String(null!=(n=e.language)?n:"").trim().toLowerCase();if("mermaid"===r)return t.mermaid||sn;if("infographic"===r)return t.infographic||dn;if(o)return o;return t.code_block||cn.value}return o||un[String(e.type)]||It}function pn(e){var n;const t="code_block"===(null==e?void 0:e.type)?String(null!=(n=e.language)?n:"").trim().toLowerCase():"";return"mermaid"===t||"infographic"===t?{}:"code_block"===e.type?i({stream:a.codeBlockStream,darkTheme:a.codeBlockDarkTheme,lightTheme:a.codeBlockLightTheme,monacoOptions:a.codeBlockMonacoOptions,themes:a.themes,minWidth:a.codeBlockMinWidth,maxWidth:a.codeBlockMaxWidth},a.codeBlockProps||{}):{typewriter:a.typewriter}}function vn(e){l("click",e)}function fn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&l("mouseover",e)}function gn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&l("mouseout",e)}return(n,t)=>(v(),p("div",{ref_key:"containerRef",ref:s,class:j(["markstream-vue markdown-renderer",[{dark:a.isDark},{virtualized:W.value}]]),onClick:vn,onMouseover:fn,onMouseout:gn},[W.value?(v(),p("div",{key:0,class:"node-spacer",style:A({height:`${De.value}px`}),"aria-hidden":"true"},null,4)):N("",!0),(v(!0),p(y,null,x(We.value,n=>{var o,r;return v(),p("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},[(r=n.index,xe.value&&r>=ae.value||ye.value&&!(r<oe.value)&&!0!==ce[r]?(v(),p("div",{key:1,class:"node-placeholder",style:A({height:`${null!=(o=Ve[n.index])?o:Oe.value}px`})},null,4)):(v(),p("div",{key:0,ref_for:!0,ref:e=>function(e,n){n?(Ie.set(e,n),queueMicrotask(()=>{!function(e,n){if(!Number.isFinite(n)||n<=0)return;const t=Ve[e];Ve[e]=n,t?Ke.total+=n-t:(Ke.total+=n,Ke.count++)}(e,n.offsetHeight)})):Ie.delete(e)}(n.index,e),class:"node-content"},["code_block"!==n.node.type&&!1!==a.typewriter?(v(),O(H,{key:0,name:"typewriter",appear:""},{default:z(()=>[(v(),O(R(hn(n.node)),D({node:n.node,loading:n.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${n.index}`},{ref_for:!0},pn(n.node),{"custom-id":a.customId,"is-dark":a.isDark,onCopy:t[0]||(t[0]=e=>l("copy",e)),onHandleArtifactClick:t[1]||(t[1]=e=>l("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024)):(v(),O(R(hn(n.node)),D({key:1,node:n.node,loading:n.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${n.index}`},{ref_for:!0},pn(n.node),{"custom-id":a.customId,"is-dark":a.isDark,onCopy:t[2]||(t[2]=e=>l("copy",e)),onHandleArtifactClick:t[3]||(t[3]=e=>l("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],512)))],8,Lt)}),128)),W.value?(v(),p("div",{key:1,class:"node-spacer",style:A({height:`${Ue.value}px`}),"aria-hidden":"true"},null,4)):N("",!0)],34))}}),[["__scopeId","data-v-d5398a71"]]);jt.install=e=>{var n,t;const o=null!=(t=null!=(n=jt.__name)?n:jt.name)?t:"NodeRenderer";e.component(o,jt)};const St={key:0,class:"admonition-icon"},$t={class:"admonition-title"},Et=["aria-expanded","aria-controls","title"],Nt={key:0},Ht={key:1},zt=["id"],At=/* @__PURE__ */J(/* @__PURE__ */h({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:n}){var t;const o=e,r=n,a={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},l=C(()=>{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=B(!!o.node.collapsible&&!(null==(t=o.node.open)||t));function s(){o.node.collapsible&&(i.value=!i.value)}const d=`admonition-${Math.random().toString(36).slice(2,9)}`;return(n,t)=>(v(),p("div",{class:j(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[k("div",{id:d,class:"admonition-header"},[a[o.node.kind]?(v(),p("span",St,b(a[o.node.kind]),1)):N("",!0),k("span",$t,b(l.value),1),o.node.collapsible?(v(),p("button",{key:1,class:"admonition-toggle","aria-expanded":!i.value,"aria-controls":`${d}-content`,title:i.value?"Expand":"Collapse",onClick:s},[i.value?(v(),p("span",Nt,"▶")):(v(),p("span",Ht,"▼"))],8,Et)):N("",!0)]),G(k("div",{id:`${d}-content`,class:"admonition-content","aria-labelledby":d},[f([o.node.children],()=>g(w(jt),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:t[0]||(t[0]=e=>r("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),t,1)],8,zt),[[Z,!i.value]])],2))}}),[["__scopeId","data-v-5e95c2b7"]]);At.install=e=>{e.component(At.__name,At)};let Pt=!1,Vt=null,Kt=!1;function Ot(){return d(this,null,function*(){if(Vt)return Vt;if(Kt)return null;try{return Vt=yield import("stream-monaco"),yield function(e){return d(this,null,function*(){if(Pt)return;Pt=!0;const n=null==globalThis?void 0:globalThis.MonacoEnvironment;return!n||"function"!=typeof n.getWorker&&"function"!=typeof n.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(Vt),(yield function(e){return d(this,null,function*(){const n=null==e?void 0:e.getOrCreateHighlighter;if("function"!=typeof n)return!0;try{const e=yield n(["vitesse-dark","vitesse-light"],["plaintext","text","javascript"]);return e&&"function"==typeof e.codeToTokens&&e.codeToTokens("const a = 1",{lang:"javascript",theme:"vitesse-dark"}),!0}catch(t){return console.warn("[markstream-vue] Failed to warm up Shiki tokenizer; disabling stream-monaco for this session.",t),!1}})}(Vt))?Vt:(Vt=null,Kt=!0,null)}catch(e){return Kt=!0,null}})}let Rt=null;function Wt(e){Rt=null!=e?e:null}const Dt={"":"",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 Ut(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=Dt[t])?n:t}function Ft(e){const n=Ut(e);if(!n)return"plaintext";switch(n){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return n}}function qt(e){if(Rt){const n=Rt(e);if(null!=n&&""!==n)return n}switch(Ut(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 Xt={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"},Gt={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)"}},Zt={class:"flex items-center gap-x-2"},Yt=["innerHTML"],Jt={class:"text-sm font-medium font-mono"},Qt={class:"flex items-center gap-x-2"},eo=["aria-pressed"],no=["disabled"],to=["disabled"],oo=["disabled"],ro=["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"},lo={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"},io=["aria-pressed"],so={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"},co={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"},uo=["aria-label"],mo=["innerHTML"],ho={class:"code-loading-placeholder"},po=/* @__PURE__ */J(/* @__PURE__ */h({__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,r=n,{t:a}=nn(),l=B(String(null!=(t=o.node.language)?t:"")),i=B(!1),s=B(!1),c=B(!1),u=B(null),m=B(null),h=B(""),f=B(!1);let g;const x=B(!0),M=B(0),_=B(14),L=B(_.value),S=C(()=>{const e=_.value,n=L.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof n&&Number.isFinite(n)&&n>0}),$=C(()=>{const e=l.value.trim().toLowerCase();return Xt[e]||e.charAt(0).toUpperCase()+e.slice(1)}),E=C(()=>qt(l.value.trim().toLowerCase().split(":")[0])),H=C(()=>{const e=l.value.trim().toLowerCase();return o.isShowPreview&&("html"===e||"svg"===e)}),z=C(()=>{const e={},n=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},t=n(o.minWidth),r=n(o.maxWidth);return t&&(e.minWidth=t),r&&(e.maxWidth=r),e}),V=C(()=>({fontSize:`${L.value}px`}));function K(){return o.isDark?o.darkTheme:o.lightTheme}function O(e){if(null==g||g.disconnect(),g=void 0,!e)return h.value="",void(f.value=!1);var n;h.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 R(){h.value="",f.value=!0}function W(){var e;const n=m.value;return!!n&&(n.childNodes.length>0||Boolean(null==(e=n.textContent)?void 0:e.trim().length))}function D(){return d(this,null,function*(){if(yield X(),W())return void R();const e=m.value;e&&(null==g||g.disconnect(),g=new MutationObserver(()=>{W()&&(R(),null==g||g.disconnect(),g=void 0)}),g.observe(e,{childList:!0,subtree:!0}))})}let U,F,q,Y;const J=/* @__PURE__ */new Set,Q=/* @__PURE__ */new Set,ee=void 0!==import.meta&&Boolean(!1);function ne(e,n){return d(this,null,function*(){if(!U)return;const t=function(e,n=!1){var t;const[o]=String(null!=e?e:"").split(":"),r=null!=(t=null==o?void 0:o.trim().toLowerCase())?t:"";return r?!Y||Y.has(r)?r:(n&&ee&&!J.has(r)&&(J.add(r),console.warn(`[MarkdownCodeBlockNode] Language "${r}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}(n,Boolean(e&&e.length));try{yield U.updateCode(e,t)}catch(o){"plaintext"!==t?(ee&&!Q.has(t)&&(Q.add(t),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${t}", retrying as plaintext.`,o)),yield U.updateCode(e,"plaintext")):ee&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o)}})}function te(){return d(this,null,function*(){yield function(){return d(this,null,function*(){if(!F)try{const e=yield import("stream-markdown");F=e.createShikiStreamRenderer,q=e.registerHighlight;const n=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;Y=n?new Set(n.map(e=>e.toLowerCase())):void 0,null==q||q({themes:o.themes})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}(),u.value&&m.value?(null==q||q({themes:o.themes}),!U&&F&&(U=F(m.value,{theme:K()}),f.value=!0),U?!1===o.stream&&o.loading?O(o.node.code):(O(o.node.code),yield ne(o.node.code,l.value),yield D()):O(o.node.code)):O(o.node.code)})}function oe(){const e=u.value;if(!e||s.value)return;const n=e.scrollTop;n<M.value?x.value=!1:function(e,n=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=n}(e)&&(x.value=!0),M.value=n}function re(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(o.node.code)),i.value=!0,r("copy",o.node.code),setTimeout(()=>{i.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function ae(e){return!e||e.disabled}function le(e,n,t="top"){if(ae(e.currentTarget))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;Ye(e.currentTarget,n,t,!1,a,o.isDark)}function ie(){Je()}function se(e){if(ae(e.currentTarget))return;const n=i.value?a("common.copied")||"Copied":a("common.copy")||"Copy",t=e,r=null!=(null==t?void 0:t.clientX)&&null!=(null==t?void 0:t.clientY)?{x:t.clientX,y:t.clientY}:void 0;Ye(e.currentTarget,n,"top",!1,r,o.isDark)}function de(){s.value=!s.value;const e=u.value;e&&(s.value?(e.style.maxHeight="none",e.style["overflow-y"]="visible",e.style["overflow-x"]="auto"):(e.style.maxHeight="500px",e.style.overflow="auto",x.value=!0,X(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))}function ce(){c.value=!c.value}function ue(){if(!H.value)return;const e=(l.value||o.node.language).toLowerCase(),n="html"===e?"HTML Preview":"SVG Preview";r("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:o.node.code,title:n})}return te(),T(()=>{te()}),I(()=>o.themes,()=>d(null,null,function*(){q&&q({themes:o.themes})})),I(()=>o.loading,e=>{e||te()}),I(()=>[o.node.code,o.node.language],e=>d(null,[e],function*([e,n]){n!==l.value&&(l.value=n.trim()),u.value&&m.value?(U||(O(e),yield te()),U&&e&&(!1===o.stream&&o.loading||(O(e),yield ne(e,n),yield D()))):O(e)})),I(()=>[o.darkTheme,o.lightTheme],()=>d(null,null,function*(){u.value&&m.value&&(U||(yield te()),null==U||U.setTheme(K()))})),I(()=>o.node.code,()=>d(null,null,function*(){if(s.value||!x.value)return;yield X();const e=u.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(n,t)=>(v(),p("div",{style:A(z.value),class:j(["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?(v(),p("div",Gt,[P(n.$slots,"header-left",{},()=>[k("div",Zt,[k("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:E.value},null,8,Yt),k("span",Jt,b($.value),1)])],!0),P(n.$slots,"header-right",{},()=>[k("div",Qt,[k("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:ce,onMouseenter:t[0]||(t[0]=e=>le(e,c.value?w(a)("common.expand")||"Expand":w(a)("common.collapse")||"Collapse")),onFocus:t[1]||(t[1]=e=>le(e,c.value?w(a)("common.expand")||"Expand":w(a)("common.collapse")||"Collapse")),onMouseleave:ie,onBlur:ie},[(v(),p("svg",{style:A({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]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,eo),o.showFontSizeButtons&&o.enableFontSizeControl?(v(),p(y,{key:0},[k("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=>le(e,w(a)("common.decrease")||"Decrease")),onFocus:t[4]||(t[4]=e=>le(e,w(a)("common.decrease")||"Decrease")),onMouseleave:ie,onBlur:ie},[...t[18]||(t[18]=[k("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"},[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,no),k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!S.value||L.value===_.value,onClick:t[5]||(t[5]=e=>{L.value=_.value}),onMouseenter:t[6]||(t[6]=e=>le(e,w(a)("common.reset")||"Reset")),onFocus:t[7]||(t[7]=e=>le(e,w(a)("common.reset")||"Reset")),onMouseleave:ie,onBlur:ie},[...t[19]||(t[19]=[k("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"},[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),k("path",{d:"M3 3v5h5"})])],-1)])],40,to),k("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=>le(e,w(a)("common.increase")||"Increase")),onFocus:t[10]||(t[10]=e=>le(e,w(a)("common.increase")||"Increase")),onMouseleave:ie,onBlur:ie},[...t[20]||(t[20]=[k("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"},[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,oo)],64)):N("",!0),o.showCopyButton?(v(),p("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(a)("common.copied")||"Copied":w(a)("common.copy")||"Copy",onClick:re,onMouseenter:t[11]||(t[11]=e=>se(e)),onFocus:t[12]||(t[12]=e=>se(e)),onMouseleave:ie,onBlur:ie},[i.value?(v(),p("svg",lo,[...t[22]||(t[22]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),p("svg",ao,[...t[21]||(t[21]=[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),k("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,ro)):N("",!0),o.showExpandButton?(v(),p("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:de,onMouseenter:t[13]||(t[13]=e=>le(e,s.value?w(a)("common.collapse")||"Collapse":w(a)("common.expand")||"Expand")),onFocus:t[14]||(t[14]=e=>le(e,s.value?w(a)("common.collapse")||"Collapse":w(a)("common.expand")||"Expand")),onMouseleave:ie,onBlur:ie},[s.value?(v(),p("svg",so,[...t[23]||(t[23]=[k("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)])])):(v(),p("svg",co,[...t[24]||(t[24]=[k("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,io)):N("",!0),H.value&&o.showPreviewButton?(v(),p("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(a)("common.preview")||"Preview",onClick:ue,onMouseenter:t[15]||(t[15]=e=>le(e,w(a)("common.preview")||"Preview")),onFocus:t[16]||(t[16]=e=>le(e,w(a)("common.preview")||"Preview")),onMouseleave:ie,onBlur:ie},[...t[25]||(t[25]=[k("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"},[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("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"}),k("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,uo)):N("",!0)])],!0)])):N("",!0),G(k("div",{ref_key:"codeBlockContent",ref:u,class:"code-block-content",style:A(V.value),onScroll:oe},[k("div",{ref_key:"rendererTarget",ref:m,class:"code-block-render"},null,512),f.value?N("",!0):(v(),p("div",{key:0,class:"code-fallback-plain",innerHTML:h.value},null,8,mo))],36),[[Z,!(c.value||!e.stream&&e.loading)]]),G(k("div",ho,[P(n.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[t[26]||(t[26]=k("div",{class:"loading-skeleton"},[k("div",{class:"skeleton-line"}),k("div",{class:"skeleton-line"}),k("div",{class:"skeleton-line short"})],-1))],!0)],512),[[Z,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-d2ddc5f5"]]);po.install=e=>{e.component(po.__name,po)};const vo=()=>import("mermaid");let fo=null,go=vo;function wo(e){go=e,fo=null}function ko(e){wo(null!=e?e:vo)}function yo(){wo(null)}function xo(){return"function"==typeof go}function bo(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 Mo(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){}}function _o(){return d(this,null,function*(){if(fo)return fo;const e=function(){try{const e=globalThis;return bo(null==e?void 0:e.mermaid)}catch(e){return null}}();if(e)return fo=e,Mo(fo),fo;const n=go;if(!n)return null;let t;try{t=yield n()}catch(o){if(n===vo)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return t?(fo=bo(t),Mo(fo),fo):null})}function Co(e){return JSON.stringify(e)}function Bo(e){var n;const t=null!=(n=e.mode)?n:"classic",o=e.katexUrl,r=e.mhchemUrl,a=Co(i({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),l=Co(o),s=r?Co(r):'""';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(${l})\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 = ${a}\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(${l})\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 = ${a}\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 Io(e){var n,t;const o=Bo(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),a=URL.createObjectURL(r);let l=!1;const d="module"===(null!=(n=e.mode)?n:"classic")?s(i({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,c=new Worker(a,d);if(e.debug)try{c.postMessage({type:"init",debug:!0})}catch(u){}return{worker:c,dispose:()=>{if(!l){l=!0;try{URL.revokeObjectURL(a)}catch(u){}}},source:o}}let To=null,Lo=null,jo=!1;const So=/* @__PURE__ */new Map,$o=/* @__PURE__ */new Map;let Eo=5;const No=/* @__PURE__ */new Set;function Ho(){if(So.size<Eo&&No.size){const n=Array.from(No);No.clear();for(const t of n)try{t()}catch(e){}}}function zo(e){To=e,Lo=null,To.onmessage=e=>{const{id:n,html:t,error:o}=e.data,r=So.get(n);if(r)if(So.delete(n),clearTimeout(r.timeoutId),Ho(),o)r.reject(new Error(o));else{const{content:n,displayMode:o}=e.data;if(n){const e=`${o?"d":"i"}:${n}`;if($o.set(e,t),$o.size>200){const e=$o.keys().next().value;$o.delete(e)}}r.resolve(t)}},To.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[n,t]of So.entries())clearTimeout(t.timeoutId),t.reject(new Error(`Worker error: ${e.message}`));So.clear(),Ho()}}function Ao(){var e;To&&(null==(e=To.terminate)||e.call(To)),To=null,Lo=null}function Po(e){jo=!!e,To&&To.postMessage({type:"init",debug:jo})}function Vo(e,n=!0,t=2e3,o){return d(this,null,function*(){if(performance.now(),!bn()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(Lo)return Promise.reject(Lo);const r=`${n?"d":"i"}:${e}`,a=$o.get(r);if(a)return Promise.resolve(a);const l=To||(Lo=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Lo.name="WorkerInitError",Lo.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Lo);if(So.size>=Eo){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=So.size,e.max=Eo,Promise.reject(e)}return new Promise((r,a)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void a(e)}const i=Math.random().toString(36).slice(2),s=globalThis.setTimeout(()=>{So.delete(i);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",a(e),Ho()},t);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),So.has(i)&&So.delete(i);const e=new Error("Aborted");e.name="AbortError",a(e),Ho()},{once:!0});const d=r,c=a;So.set(i,{resolve:e=>{d(e)},reject:e=>{c(e)},timeoutId:s}),l.postMessage({id:i,content:e,displayMode:n})})})}function Ko(e,n=!0,t){const o=`${n?"d":"i"}:${e}`;if($o.set(o,t),$o.size>200){const e=$o.keys().next().value;$o.delete(e)}}function Oo(){return{inFlight:So.size,max:Eo}}function Ro(e){Number.isFinite(e)&&e>0&&(Eo=Math.floor(e))}const Wo="WORKER_BUSY";function Do(){return So.size>=Eo}function Uo(e=2e3,n){return So.size<Eo?Promise.resolve():new Promise((t,o)=>{let r,a=!1;const l=()=>{a||(a=!0,r&&globalThis.clearTimeout(r),No.delete(l),t())};if(No.add(l),r=globalThis.setTimeout(()=>{if(a)return;a=!0,No.delete(l);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>Ho()),n){const e=()=>{if(a)return;a=!0,r&&globalThis.clearTimeout(r),No.delete(l);const e=new Error("Aborted");e.name="AbortError",o(e)};n.aborted?e():n.addEventListener("abort",e,{once:!0})}})}const Fo={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function qo(e){null!=e.timeout&&(Fo.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Fo.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Fo.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Fo.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function Xo(){return i({},Fo)}function Go(e){return d(this,arguments,function*(e,n=!0,t={}){var o,r,a,l;if(!bn()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const i=null!=(o=t.timeout)?o:Fo.timeout,s=null!=(r=t.waitTimeout)?r:Fo.waitTimeout,d=null!=(a=t.backoffMs)?a:Fo.backoffMs,c=null!=(l=t.maxRetries)?l:Fo.maxRetries,u=t.signal;let m=0;for(;;){if(null==u?void 0:u.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield Vo(e,n,i,u)}catch(h){if((null==h?void 0:h.code)!==Wo||m>=c)throw h;if(m++,yield Uo(s,u).catch(()=>{}),null==u?void 0:u.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}d>0&&(yield new Promise(e=>globalThis.setTimeout(e,d*m)))}}})}function Zo(e){return JSON.stringify(e)}function Yo(e){var n;const t=null!=(n=e.mode)?n:"module",o=Zo(e.mermaidUrl),r=`\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(${Zo(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${r}\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${r}\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 Jo(e){var n,t;const o=Yo(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),a=URL.createObjectURL(r);let l=!1;const d="module"===(null!=(n=e.mode)?n:"module")?s(i({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,c=new Worker(a,d);if(e.debug)try{c.postMessage({type:"init",debug:!0})}catch(u){}return{worker:c,dispose:()=>{if(!l){l=!0;try{URL.revokeObjectURL(a)}catch(u){}}},source:o}}let Qo=null,er=null;const nr=/* @__PURE__ */new Map;let tr=5,or=!1;function rr(e){or=!!e}function ar(e){Number.isFinite(e)&&e>0&&(tr=Math.floor(e))}function lr(){return{inFlight:nr.size,max:tr}}const ir="WORKER_BUSY",sr="MERMAID_DISABLED";function dr(e){Qo=e,er=null;const n=e;Qo.onmessage=e=>{if(Qo!==n)return;const{id:t,ok:o,result:r,error:a}=e.data,l=nr.get(t);l&&(!1===o||a?l.reject(new Error(a||"Unknown error")):l.resolve(r))},Qo.onerror=e=>{var t,o;if(Qo===n)if(0!==nr.size){try{or?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(r){}for(const[n,t]of nr.entries())t.reject(new Error(`Worker error: ${e.message}`));nr.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Qo.onmessageerror=e=>{var t,o;if(Qo===n)if(0!==nr.size){try{or?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(r){}for(const[e,n]of nr.entries())n.reject(new Error("Worker messageerror"));nr.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function cr(){var e;if(Qo)try{for(const[e,n]of nr.entries())n.reject(new Error("Worker cleared"));nr.clear(),null==(e=Qo.terminate)||e.call(Qo)}catch(n){}Qo=null,er=null}function ur(e,n,t=1400){if(!xo()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=sr,Promise.reject(e)}if(er)return Promise.reject(er);const o=Qo||(er=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),er.name="WorkerInitError",er.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(er);if(nr.size>=tr){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=ir,e.inFlight=nr.size,e.max=tr,Promise.reject(e)}return new Promise((r,a)=>{const l=Math.random().toString(36).slice(2);let i,s=!1;const d=()=>{s||(s=!0,null!=i&&globalThis.clearTimeout(i),nr.delete(l))},c={resolve:e=>{d(),r(e)},reject:e=>{d(),a(e)}};nr.set(l,c);try{o.postMessage({id:l,action:e,payload:n})}catch(u){return nr.delete(l),void a(u)}i=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const n=nr.get(l);n&&n.reject(e)},t)})}function mr(e,n,t=1400){return d(this,null,function*(){try{return yield ur("canParse",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function hr(e,n,t=1400){return d(this,null,function*(){try{return yield ur("findPrefix",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function pr(){if(Qo)try{for(const[e,n]of nr.entries())n.reject(new Error("Worker terminated"));nr.clear(),Qo.terminate()}finally{Qo=null}}const vr=K(()=>import("./index4.js")),fr=K(()=>import("./index3.js")),gr=K(()=>import("./index2.js")),wr=K(()=>import("./index5.js")),kr=K(()=>import("./index6.js")),yr={AdmonitionNode:At,BlockquoteNode:Q,CheckboxNode:te,CodeBlockNode:vr,DefinitionListNode:le,EmojiNode:se,FootnoteNode:ot,FootnoteReferenceNode:ke,FootnoteAnchorNode:et,HardBreakNode:at,HeadingNode:it,HtmlInlineNode:He,HighlightNode:Zn,ImageNode:mn,InfographicBlockNode:kr,InlineCodeNode:Ae,PreCodeNode:gt,InsertNode:Xn,LinkNode:Fn,ListItemNode:st,ListNode:dt,MathBlockNode:fr,MathInlineNode:gr,MermaidBlockNode:wr,ParagraphNode:pt,StrikethroughNode:Kn,StrongNode:Pn,SubscriptNode:zn,SuperscriptNode:En,TableNode:Mt,TextNode:In,ThematicBreakNode:Ct,ReferenceNode:jn,MarkdownCodeBlockNode:po},xr={install(e,n){Object.entries(yr).forEach(([n,t])=>{e.component(n,t)}),(null==n?void 0:n.getLanguageIcon)&&Wt(n.getLanguageIcon),(null==n?void 0:n.mathOptions)&&m(n.mathOptions)}};export{jn as $,At as A,Q as B,te as C,le as D,se as E,et as F,it as G,at as H,Zn as I,He as J,mn as K,kr as L,Ae as M,Xn as N,bn as O,xo as P,Fn as Q,st as R,dt as S,po as T,jt as U,fr as V,Wo as W,gr as X,wr as Y,pt as Z,J as _,on as a,ve as a0,he as a1,en as a2,kn as a3,wo as a4,Kn as a5,Pn as a6,zn as a7,En as a8,Mt as a9,In as aa,Ct as ab,xr as ac,Wt as ad,Bo as ae,Io as af,zo as ag,Ao as ah,Po as ai,Vo as aj,Oo as ak,Ro as al,Do as am,Uo as an,qo as ao,Xo as ap,Yo as aq,Jo as ar,rr as as,ar as at,lr as au,ir as av,sr as aw,dr as ax,cr as ay,qt as b,gt as c,Go as d,Mn as e,Ko as f,Ot as g,Je as h,_o as i,mr as j,hr as k,Xt as l,fe as m,Ut as n,vr as o,xn as p,yo as q,Ft as r,Ye as s,pr as t,nn as u,yn as v,ko as w,ot as x,ke as y,pe as z};
|
|
1
|
+
var e=Object.defineProperty,n=Object.defineProperties,t=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,i=(n,t,o)=>t in n?e(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,a=(e,n)=>{for(var t in n||(n={}))r.call(n,t)&&i(e,t,n[t]);if(o)for(var t of o(n))l.call(n,t)&&i(e,t,n[t]);return e},s=(e,o)=>n(e,t(o)),c=(e,n)=>{var t={};for(var i in e)r.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&o)for(var i of o(e))n.indexOf(i)<0&&l.call(e,i)&&(t[i]=e[i]);return t},d=(e,n,t)=>new Promise((o,r)=>{var l=e=>{try{a(t.next(e))}catch(n){r(n)}},i=e=>{try{a(t.throw(e))}catch(n){r(n)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(l,i);a((t=t.apply(e,n)).next())});import{getMarkdown as u,parseMarkdownToStructure as m,setDefaultMathOptions as h}from"stream-markdown-parser";import{defineComponent as p,createElementBlock as f,openBlock as v,withMemo as g,createVNode as w,unref as y,createElementVNode as k,Fragment as x,renderList as b,toDisplayString as M,shallowRef as _,h as C,computed as B,ref as T,watch as L,onMounted as I,onBeforeUnmount as S,normalizeClass as E,createApp as j,inject as $,provide as N,createCommentVNode as H,Transition as R,withCtx as A,normalizeStyle as O,renderSlot as z,readonly as P,defineAsyncComponent as D,createBlock as V,resolveDynamicComponent as W,useAttrs as K,mergeProps as F,isMemoSame as U,markRaw as X,reactive as q,nextTick as G,withDirectives as Z,vShow as Y,Teleport as J}from"vue";const Q=["cite"],ee=(e,n)=>{const t=e.__vccOpts||e;for(const[o,r]of n)t[o]=r;return t},ne=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(v(),f("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[g([n.node.children],()=>w(y(Nt),{"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,Q))}}),[["__scopeId","data-v-eeadc8a3"]]);ne.install=e=>{e.component(ne.__name,ne)};const te={class:"checkbox-node"},oe=["checked"],re=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"CheckboxNode",props:{node:{}},setup:e=>(n,t)=>(v(),f("span",te,[k("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,oe)]))}),[["__scopeId","data-v-8dc6c46f"]]);re.install=e=>{e.component(re.__name,re)};const le={class:"definition-list"},ie={class:"definition-term"},ae={class:"definition-desc"},se=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(e,t)=>(v(),f("dl",le,[(v(!0),f(x,null,b(n.node.items,(o,r)=>(v(),f(x,{key:r},[k("dt",ie,[w(y(Nt),{"index-key":`definition-term-${n.indexKey}-${r}`,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"])]),k("dd",ae,[w(y(Nt),{"index-key":`definition-desc-${n.indexKey}-${r}`,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"]]);se.install=e=>{e.component(se.__name,se)};const ce={class:"emoji-node"},de=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"EmojiNode",props:{node:{}},setup:e=>(n,t)=>(v(),f("span",ce,M(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);de.install=e=>{e.component(de.__name,de)};const ue="__global__",me="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",he=(()=>{const e=globalThis;if(e[me])return e[me];const n={scopedCustomComponents:{},revision:_(0)};return e[me]=n,n})(),pe=he.revision;function fe(e,n){"string"==typeof e?he.scopedCustomComponents[e]=n||{}:he.scopedCustomComponents[ue]=e||{},pe.value++}function ve(e){const n=he.scopedCustomComponents[ue]||{};if(!e)return n;const t=he.scopedCustomComponents[e]||{};return n&&0!==Object.keys(n).length?t&&0!==Object.keys(t).length?a(a({},n),t):n:t}function ge(e){if(e===ue)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete he.scopedCustomComponents[e],pe.value++}function we(){delete he.scopedCustomComponents[ue],pe.value++}const ye=["id"],ke=["title"],xe=/* @__PURE__ */ee(/* @__PURE__ */p({__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,r)=>(v(),f("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:t},[k("span",{href:n,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+M(e.node.id)+"]",9,ke)],8,ye))}}),[["__scopeId","data-v-01af0fee"]]);xe.install=e=>{e.component(xe.__name,xe)};const be=/* @__PURE__ */new Set(["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onreset","onsearch","onsubmit"]),Me=/* @__PURE__ */new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),_e=/* @__PURE__ */new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Ce=/<([a-z][a-z0-9-]*)\b[^>]*>/gi,Be=/* @__PURE__ */new Set(["script"]),Te=/* @__PURE__ */new Set(["href","src","srcset","xlink:href","formaction"]),Le=(()=>{try{return Boolean(!1)}catch(e){}return!1})();function Ie(e){Le&&console.warn(e)}function Se(e){const n=function(e){let n="";for(const t of e){const e=t.charCodeAt(0);e<=31||127===e||/\s/u.test(t)||(n+=t)}return n}(e).toLowerCase();return!(!n.startsWith("javascript:")&&!n.startsWith("vbscript:"))||!!n.startsWith("data:")&&!(n.startsWith("data:image/")||n.startsWith("data:video/")||n.startsWith("data:audio/"))}function Ee(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function je(e,n){const t=e.toLowerCase();return!_e.has(t)&&(Ee(n,t)||Ee(n,e))}function $e(e,n){const t=n.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(t))return"true"===e||""===e||e===n;if(["value","min","max","step","width","height","size","maxlength"].includes(t)){const n=Number(e);if(""!==e&&!Number.isNaN(n))return n}return e}function Ne(e){return e.trim().length>0}function He(e,n,t,o,r){if(Be.has(e.toLowerCase()))return null;const l=function(e){const n={};for(const[t,o]of Object.entries(e)){const e=t.toLowerCase();be.has(e)||Te.has(e)&&o&&Se(o)||(n[t]=o)}return n}(n),i=l.key,c=null!=i&&""!==i?i:r;if(je(e,o)){const n=o[e]||o[e.toLowerCase()],r=function(e){const n={};for(const[t,o]of Object.entries(e))n[t]=$e(o,t);return n}(l);return C(n,s(a({},r),{key:c}),t.length>0?t:void 0)}return C(e,s(a({},l),{innerHTML:void 0,key:c}),t.length>0?t:void 0)}function Re(e,n){if(!e||!e.includes("<"))return!1;if(!n||0===Object.keys(n).length)return!1;let t;for(Ce.lastIndex=0;null!==(t=Ce.exec(e));)if(je(t[1],n))return!0;return!1}function Ae(e,n){if(!e)return[];try{const t=function(e,n){let t=0;const o=[],r=[];for(const l of e)if("text"===l.type)(o.length>0?o[o.length-1].children:r).push(l.content);else if("self_closing"===l.type){const e=He(l.tagName,l.attrs||{},[],n,"ms-html-"+t++),i=o.length>0?o[o.length-1].children:r;null!=e&&i.push(e)}else if("tag_open"===l.type)o.push({tagName:l.tagName,children:[],attrs:l.attrs,autoKey:"ms-html-"+t++});else if("tag_close"===l.type){const e=l.tagName.toLowerCase();let t=-1;for(let n=o.length-1;n>=0;n--)if(o[n].tagName.toLowerCase()===e){t=n;break}if(-1!==t)for(;o.length>t;){const l=o.pop(),i=He(l.tagName,l.attrs||{},l.children,n,l.autoKey);o.length>0?null!=i&&o[o.length-1].children.push(i):null!=i&&r.push(i),l.tagName.toLowerCase()!==e&&o.length>t&&Ie(`Auto-closing unclosed tag: <${l.tagName}>`)}else Ie(`Ignoring closing tag with no matching opening tag: </${l.tagName}>`)}for(;o.length>0;){const e=o.pop(),t=He(e.tagName,e.attrs||{},e.children,n,e.autoKey);o.length>0?null!=t&&o[o.length-1].children.push(t):null!=t&&r.push(t),Ie(`Auto-closing unclosed tag: <${e.tagName}>`)}return r}(function(e){var n,t,o;const r=[];let l=0;for(;l<e.length;){if(e.startsWith("\x3c!--",l)){const n=e.indexOf("--\x3e",l);if(-1!==n){l=n+3;continue}break}const i=e.indexOf("<",l);if(-1===i){if(l<e.length){const n=e.slice(l);Ne(n)&&r.push({type:"text",content:n})}break}if(i>l){const n=e.slice(l,i);Ne(n)&&r.push({type:"text",content:n})}if(e.startsWith("![CDATA[",i+1)){const n=e.indexOf("]]>",i);if(-1!==n){r.push({type:"text",content:e.slice(i,n+3)}),l=n+3;continue}break}if(e.startsWith("!",i+1)){const n=e.indexOf(">",i);if(-1!==n){l=n+1;continue}break}const a=e.indexOf(">",i);if(-1===a)break;const s=e.slice(i+1,a).trim(),c=s.startsWith("/"),d=s.endsWith("/");if(c){const e=s.slice(1).trim();r.push({type:"tag_close",tagName:e})}else{const e=s.indexOf(" ");let l,i="";-1===e?l=d?s.slice(0,-1).trim():s.trim():(l=s.slice(0,e).trim(),i=s.slice(e+1));const a={};if(i){const e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let r;for(;null!==(r=e.exec(i));){const e=r[1],l=null!=(o=null!=(t=null!=(n=r[2])?n:r[3])?t:r[4])?o:"";e&&!e.endsWith("/")&&(a[e]=l)}}r.push({type:d||Me.has(l.toLowerCase())?"self_closing":"tag_open",tagName:l,attrs:a})}l=a+1}return r}(e),n);return t}catch(o){return t=o,Le&&console.error("Failed to parse HTML to VNodes:",t),null}var t}const Oe=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HtmlInlineNode",props:{node:{},customId:{}},setup(e){const n=e,t=B(()=>(pe.value,ve(n.customId))),o=p({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=B(()=>{const e=n.node.content;if(!e)return{mode:"html",content:""};if(n.node.loading&&n.node.autoClosed){const n=Ae(e,t.value);if(null!==n)return{mode:"dynamic",nodes:n}}if(!Re(e,t.value))return{mode:"html",content:e};const o=Ae(e,t.value);return null===o?{mode:"html",content:e}:{mode:"dynamic",nodes:o}}),l=T(null),i="undefined"!=typeof window,a=T({mode:"",content:"",el:null});let s=null;function c(e,n){if(!i||!l.value)return;const t=l.value,o=a.value;if(o.el!==t||o.mode!==e||o.content!==n){if("text"===e)t.textContent=n;else{const e=(!s&&i&&(s=document.createElement("template")),s);if(e){e.innerHTML=n;const o=e.content.cloneNode(!0);"function"==typeof t.replaceChildren?t.replaceChildren(o):(t.innerHTML="",t.appendChild(o))}else t.innerHTML=n}a.value={mode:e,content:n,el:t}}}function d(){c("html",n.node.content)}function u(){c("text",n.node.content)}return L(()=>[n.node.content,n.node.loading,n.node.autoClosed,r.value.mode],()=>{"html"===r.value.mode&&(n.node.loading&&!n.node.autoClosed?u():d())}),I(()=>{"html"===r.value.mode&&(n.node.loading&&!n.node.autoClosed?u():d())}),S(()=>{l.value&&(l.value.innerHTML="",a.value={mode:"",content:"",el:null})}),(e,t)=>"dynamic"===r.value.mode?(v(),f("span",{key:0,class:E(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},[w(y(o),{nodes:r.value.nodes},null,8,["nodes"])],2)):(v(),f("span",{key:1,ref_key:"containerRef",ref:l,class:E(["html-inline-node",{"html-inline-node--loading":n.node.loading}])},null,2))}}),[["__scopeId","data-v-4add5e85"]]);Oe.install=e=>{e.component(Oe.__name,Oe)};const ze={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},Pe=/* @__PURE__ */p({__name:"InlineCodeNode",props:{node:{}},setup:e=>(n,t)=>(v(),f("code",ze,M(e.node.code),1))});Pe.install=e=>{e.component(Pe.__name,Pe)};const De=T(!1),Ve=T(""),We=T("top"),Ke=T(null),Fe=T(null),Ue=T(null),Xe=T(null),qe=T(null);let Ge=null,Ze=null;function Ye(){Ge&&(clearTimeout(Ge),Ge=null),Ze&&(clearTimeout(Ze),Ze=null)}let Je=!1,Qe=null;function en(e,n,t="top",o=!1,r,l){if(!e)return;Je||"undefined"!=typeof document&&(Qe||(Qe=Promise.resolve().then(()=>Yr).then(({default:e})=>{Je=!0;const n=document.createElement("div");n.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(n),j({setup:()=>()=>{var n;return C(e,{visible:De.value,"anchor-el":Ke.value,content:Ve.value,placement:We.value,id:Fe.value,originX:Ue.value,originY:Xe.value,isDark:null!=(n=qe.value)?n:void 0})}}).mount(n)}).catch(e=>{Qe=null,Je=!1,console.warn("[markstream-vue] Failed to load Tooltip component. Tooltips will be disabled.",e)}))),Ye();const i=()=>{var o,i;Fe.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ke.value=e,Ve.value=n,We.value=t,Ue.value=null!=(o=null==r?void 0:r.x)?o:null,Xe.value=null!=(i=null==r?void 0:r.y)?i:null,qe.value="boolean"==typeof l?l:null,De.value=!0;try{e.setAttribute("aria-describedby",Fe.value)}catch(a){}};o?i():Ge=setTimeout(i,80)}function nn(e=!1){Ye();const n=()=>{if(Ke.value&&Fe.value)try{Ke.value.removeAttribute("aria-describedby")}catch(e){}De.value=!1,Ke.value=null,Fe.value=null,Ue.value=null,Xe.value=null};e?n():Ze=setTimeout(n,120)}const tn={"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 on(e){Object.assign(tn,e)}function rn(){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 d(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=tn[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 ln=/* @__PURE__ */Symbol("ViewportPriority");function an(){const e=$(ln,void 0);if(e)return e;const n=/* @__PURE__ */new WeakMap;let t=null;return e=>{const o=T(!1);let r,l=!1;const i=new Promise(e=>{r=()=>{l||(l=!0,e())}}),a=()=>{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 r of e){const e=n.get(r.target);if(e&&(r.isIntersecting||r.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==t||t.unobserve(r.target),n.delete(r.target)}}},{root:null,rootMargin:"300px",threshold:0}),t));return s?(n.set(e,{resolve:r,visible:o}),s.observe(e),{isVisible:o,whenVisible:i,destroy:a}):(o.value=!0,r(),{isVisible:o,whenVisible:i,destroy:a})}}const sn={class:"relative inline-block"},cn=["src","alt","title","loading","tabindex","aria-label"],dn={class:"text-sm whitespace-nowrap"},un={key:1,class:"text-sm text-gray-500"},mn={key:"error",class:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},hn={class:"text-sm whitespace-nowrap"},pn={key:0,class:"mt-2 text-sm text-gray-500 italic"},fn=/* @__PURE__ */ee(/* @__PURE__ */p({__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,r=T(!1),l=T(!1),i=T(!1),a=T(null),s=an(),c=T(null),d=T("undefined"==typeof window);"undefined"!=typeof window&&L(()=>a.value,e=>{var n;if(null==(n=c.value)||n.destroy(),c.value=null,!e)return void(d.value=!1);const t=s(e,{rootMargin:"400px"});c.value=t,d.value=t.isVisible.value,t.whenVisible.then(()=>{d.value=!0})},{immediate:!0}),S(()=>{var e;null==(e=c.value)||e.destroy(),c.value=null});const u=B(()=>l.value&&t.fallbackSrc?t.fallbackSrc:t.node.src),m=B(()=>!t.lazy||d.value),h=B(()=>/\.svg(?:\?|$)/i.test(u.value));function p(){t.fallbackSrc&&!i.value?(i.value=!0,l.value=!0):(l.value=!0,o("error",t.node.src))}function g(){r.value=!0,l.value=!1,o("load",u.value)}function x(e){e.preventDefault(),r.value&&!l.value&&o("click",[e,u.value])}const{t:b}=rn();return L(u,()=>{r.value=!1,l.value=!1}),(n,o)=>(v(),f("figure",{ref_key:"figureRef",ref:a,class:"text-center my-8"},[k("div",sn,[w(R,{name:"img-switch",mode:"out-in"},{default:A(()=>{var i,a,s,c,d;return[e.node.loading||l.value||!m.value?l.value?e.node.loading||t.fallbackSrc?H("",!0):(v(),f("div",mn,[z(n.$slots,"error",{node:t.node,displaySrc:u.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:h.value},()=>[o[1]||(o[1]=k("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[k("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)),k("span",hn,M(y(b)("image.loadError")),1)],!0)])):(v(),f("div",{key:"placeholder",class:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:O(h.value?{minHeight:t.svgMinHeight,width:"100%"}:{minHeight:"6rem"})},[t.usePlaceholder?z(n.$slots,"placeholder",{key:0,node:t.node,displaySrc:u.value,imageLoaded:r.value,hasError:l.value,fallbackSrc:t.fallbackSrc,lazy:t.lazy,isSvg:h.value},()=>[o[0]||(o[0]=k("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),k("span",dn,M(y(b)("image.loading")),1)],!0):(v(),f("span",un,M(e.node.raw),1))],4)):(v(),f("img",{key:"image",src:u.value,alt:String(null!=(a=null!=(i=t.node.alt)?i:t.node.title)?a:""),title:String(null!=(c=null!=(s=t.node.title)?s:t.node.alt)?c:""),class:E(["max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",{"opacity-0":!r.value,"opacity-100":r.value,"cursor-pointer":r.value}]),style:O(h.value?{minHeight:t.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0),loading:t.lazy?"lazy":"eager",decoding:"async",tabindex:r.value?0:-1,"aria-label":null!=(d=t.node.alt)?d:y(b)("image.preview"),onError:p,onLoad:g,onClick:x},null,46,cn))]}),_:3})]),t.showCaption&&t.node.alt?(v(),f("figcaption",pn,M(t.node.alt),1)):H("",!0)],512))}}),[["__scopeId","data-v-7ca79b66"]]);fn.install=e=>{e.component(fn.__name,fn)};let vn=null,gn=!1,wn=xn;function yn(e){var n;const t=null!=(n=null==e?void 0:e.default)?n:e;return t&&"function"==typeof t.renderToString?t:null}function kn(){try{const e=globalThis;return yn(null==e?void 0:e.katex)}catch(e){return null}}function xn(){return d(null,null,function*(){const e=kn();if(e)return e;const n=yield import("katex");try{yield import("katex/dist/contrib/mhchem")}catch(t){}return yn(n)})}function bn(e){wn=e,vn=null,gn=!1}function Mn(e){bn(null!=e?e:xn)}function _n(){bn(null)}function Cn(){return"function"==typeof wn}function Bn(){return d(this,null,function*(){var e;const n=kn();if(n)return vn=n,vn;if(vn)return vn;if(gn)return null;const t=wn;if(!t)return gn=!0,null;try{const n=yield t();if(n)return vn=null!=(e=yn(n))?e:n,vn}catch(o){}return gn=!0,null})}const Tn=_(!1);let Ln=null;function In(){return Ln||(Ln=Bn().then(e=>{Tn.value=!!e}).catch(()=>{Tn.value=!1})),P(Tn)}const Sn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const n=In();return(t,o)=>(v(),f("span",{class:E([[y(n)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(e.node.content),3))}}),[["__scopeId","data-v-56f30838"]]);Sn.install=e=>{e.component(Sn.__name,Sn)};const En=D(()=>d(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 C(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))};try{if(yield Bn())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 C(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$${null!=(n=e.node.content)?n:""}$`})}))}})),jn=D(()=>d(null,null,function*(){try{if(yield Bn())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 C(Sn,s(a({},e),{node:s(a({},e.node),{content:null!=(t=e.node.raw)?t:`$$${null!=(n=e.node.content)?n:""}$$`})}))}})),$n=/* @__PURE__ */p({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(n,t)=>(v(),f("span",{class:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--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))},M(e.node.id),33))});$n.install=e=>{e.component($n.__name,$n)};const Nn={class:"superscript-node"},Hn={key:1},Rn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:Pe,link:Gn,html_inline:Oe,strong:Dn,emphasis:nt,footnote_reference:xe,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:zn,emoji:de,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("sup",Nn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),f(x,{key:`${e.indexKey||"superscript"}-${r}`},[o[t.type]?(v(),V(W(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"superscript"}-${r}`},null,8,["node","custom-id","index-key"])):(v(),f("span",Hn,M(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-6dc1e3ba"]]);Rn.install=e=>{e.component(Rn.__name,Rn)};const An={class:"subscript-node"},On={key:1},zn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:Pe,link:Gn,html_inline:Oe,strong:Dn,emphasis:nt,footnote_reference:xe,strikethrough:Wn,highlight:Qn,insert:Yn,superscript:Rn,emoji:de,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("sub",An,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),f(x,{key:`${e.indexKey||"subscript"}-${r}`},[o[t.type]?(v(),V(W(o[t.type]),{key:0,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"subscript"}-${r}`},null,8,["node","custom-id","index-key"])):(v(),f("span",On,M(t.content||t.raw),1))],64))),128))]))}}),[["__scopeId","data-v-69de9b81"]]);zn.install=e=>{e.component(zn.__name,zn)};const Pn={class:"strong-node"},Dn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:Pe,link:Gn,html_inline:Oe,emphasis:nt,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:zn,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("strong",Pn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"strong"}-${r}`,"index-key":`${e.indexKey||"strong"}-${r}`,node:t,"custom-id":n.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-af3ce037"]]);Dn.install=e=>{e.component(Dn.__name,Dn)};const Vn={class:"strikethrough-node"},Wn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:Pe,link:Gn,html_inline:Oe,strong:Dn,emphasis:nt,highlight:Qn,insert:Yn,subscript:zn,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("del",Vn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"strikethrough"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-904d5bd1"]]);Wn.install=e=>{e.component(Wn.__name,Wn)};const Kn=["href","title","aria-label","aria-hidden"],Fn=["aria-hidden"],Un={class:"link-text-wrapper relative inline-flex"},Xn={class:"leading-[normal] link-text"},qn={class:"leading-[normal] link-text"},Gn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const n=e,t=B(()=>{var e,t,o,r,l,i;const a=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":a,"--underline-opacity":String(null!=(o=n.animationOpacity)?o:.9),"--underline-duration":`${null!=(r=n.animationDuration)?r:.8}s`,"--underline-timing":null!=(l=n.animationTiming)?l:"linear","--underline-iteration":"number"==typeof n.animationIteration?String(n.animationIteration):null!=(i=n.animationIteration)?i:"infinite"}}),o={text:Sn,strong:Dn,strikethrough:Wn,emphasis:nt,image:fn,html_inline:Oe,inline_code:Pe},r=B(()=>(pe.value,ve(n.customId))),l=K();function i(){n.showTooltip&&nn()}const a=B(()=>{var e,t;return String(null!=(t=null!=(e=n.node.title)?e:n.node.href)?t:"")});return(s,c)=>e.node.loading?(v(),f("span",F({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},y(l),{style:t.value}),[k("span",Un,[k("span",Xn,[k("span",qn,M(e.node.text),1)]),c[1]||(c[1]=k("span",{class:"underline-anim","aria-hidden":"true"},null,-1))])],16,Fn)):(v(),f("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"},y(l),{style:t.value,onMouseenter:c[0]||(c[0]=e=>function(e){var t,o,r;if(!n.showTooltip)return;const l=e,i=null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,a=(null==(t=n.node)?void 0:t.title)||(null==(o=n.node)?void 0:o.href)||(null==(r=n.node)?void 0:r.text)||"";en(e.currentTarget,a,"top",!1,i)}(e)),onMouseleave:i}),[(v(!0),f(x,null,b(e.node.children,(t,l)=>(v(),V(W(function(e){return r.value[e.type]||o[e.type]||null}(t)),{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,Kn))}}),[["__scopeId","data-v-2ccf6f70"]]);Gn.install=e=>{e.component(Gn.__name,Gn)};const Zn={class:"insert-node"},Yn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:Pe,link:Gn,html_inline:Oe,strong:Dn,emphasis:nt,strikethrough:Wn,highlight:Qn,subscript:zn,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("ins",Zn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"insert"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"insert"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-ab1ec9bc"]]);Yn.install=e=>{e.component(Yn.__name,Yn)};const Jn={class:"highlight-node"},Qn=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:Pe,link:Gn,html_inline:Oe,strong:Dn,emphasis:nt,strikethrough:Wn,insert:Yn,subscript:zn,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("mark",Jn,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"highlight"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"highlight"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-38e31bf6"]]);Qn.install=e=>{e.component(Qn.__name,Qn)};const et={class:"emphasis-node"},nt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:Pe,link:Gn,html_inline:Oe,strong:Dn,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:zn,superscript:Rn,emoji:de,footnote_reference:xe,math_inline:En,reference:$n},t);return(t,r)=>(v(),f("em",et,[(v(!0),f(x,null,b(e.node.children,(t,r)=>(v(),V(W(o[t.type]),{key:`${e.indexKey||"emphasis"}-${r}`,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8264674d"]]);nt.install=e=>{e.component(nt.__name,nt)};const tt=["href","title"],ot=/* @__PURE__ */ee(/* @__PURE__ */p({__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:"")}`,r=document.getElementById(o);r&&r.scrollIntoView({behavior:"smooth"})}return(n,o)=>(v(),f("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:t}," ↩︎ ",8,tt))}}),[["__scopeId","data-v-4756ce0d"]]);ot.install=e=>{e.component(ot.__name,ot)};const rt=["id"],lt={class:"flex-1"},it=/* @__PURE__ */p({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e;return(t,o)=>(v(),f("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[k("div",lt,[g([n.node.children],()=>w(y(Nt),{"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,rt))}});it.install=e=>{e.component(it.__name,it)};const at={class:"hard-break"},st=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HardBreakNode",props:{node:{}},setup:e=>(e,n)=>(v(),f("br",at))}),[["__scopeId","data-v-50c58f70"]]);st.install=e=>{e.component(st.__name,st)};const ct=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({text:Sn,inline_code:Pe,link:Gn,image:fn,strong:Dn,emphasis:nt,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:zn,superscript:Rn,emoji:de,checkbox:re,checkbox_input:re,footnote_reference:xe,hardbreak:st,math_inline:En,reference:$n},t);return(t,r)=>g([e.node.level,e.node.children,e.node.attrs],()=>(v(),V(W(`h${e.node.level}`),F({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:A(()=>[(v(!0),f(x,null,b(e.node.children,(t,r,l,i)=>{const a=[t];if(i&&i.key===`${e.indexKey||"heading"}-${r}`&&U(i,a))return i;const s=(v(),V(W(o[t.type]),{key:`${e.indexKey||"heading"}-${r}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||"heading"}-${r}`},null,8,["custom-id","node","index-key"]));return s.memo=a,s},r,0),128))]),_:1},16,["class"])),r,2)}}),[["__scopeId","data-v-af2f957a"]]),dt=ct;dt.install=e=>{e.component(ct.__name,ct)};const ut=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const n=e,t=B(()=>{var e;return null!=(e=n.node)?e:n.item}),o=B(()=>null==n.value?{}:{value:n.value});return(e,r)=>{var l;return v(),f("li",F({class:"list-item pl-1.5 my-2",dir:"auto"},o.value),[g([null==(l=t.value)?void 0:l.children],()=>{var o,l;return w(y(Nt),{"index-key":`list-item-${n.indexKey}`,nodes:null!=(l=null==(o=t.value)?void 0:o.children)?l:[],"custom-id":n.customId,typewriter:n.typewriter,"batch-rendering":!1,onCopy:r[0]||(r[0]=n=>e.$emit("copy",n))},null,8,["index-key","nodes","custom-id","typewriter"])},r,1)],16)}}}),[["__scopeId","data-v-31a88b1f"]]);ut.install=e=>{e.component(ut.__name,ut)};const mt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean}},emits:["copy"],setup(e){const n=B(()=>(pe.value,ve(e.customId).list_item||ut));return(t,o)=>(v(),V(W(e.node.ordered?"ol":"ul"),{class:E(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:A(()=>[(v(!0),f(x,null,b(e.node.items,(r,l,i,a)=>{var s;const c=[r];if(a&&a.key===`${e.indexKey||"list"}-${l}`&&U(a,c))return a;const d=(v(),V(W(n.value),{key:`${e.indexKey||"list"}-${l}`,node:r,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${l}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(s=e.node.start)?s:1)+l:void 0,onCopy:o[0]||(o[0]=e=>t.$emit("copy",e))},null,40,["node","custom-id","index-key","typewriter","value"]));return d.memo=c,d},o,1),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-01209c2b"]]);mt.install=e=>{e.component(mt.__name,mt)};const ht={key:1,class:"html-block-node__raw"},pt={key:1,class:"html-block-node__placeholder"},ft=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"HtmlBlockNode",props:{node:{},customId:{}},setup(e){const n=e,t=B(()=>{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=B(()=>(pe.value,ve(n.customId))),r=p({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),l=T(null),i=T("undefined"==typeof window),a=T(n.node.content),s=B(()=>{var e,t,r;if(!i.value)return{mode:"html",content:null!=(e=a.value)?e:""};const l=null!=(t=a.value)?t:n.node.content;if(!l)return{mode:"html",content:""};if(n.node.loading){const e=Ae(l,o.value);return null===e?{mode:"text",content:null!=(r=n.node.raw)?r:l}:{mode:"dynamic",nodes:e}}if(!Re(l,o.value))return{mode:"html",content:l};const s=Ae(l,o.value);return null===s?{mode:"html",content:l}:{mode:"dynamic",nodes:s}}),c=an(),d=T(null),u=!!n.node.loading;return"undefined"!=typeof window?(L(l,e=>{var t,o;if(null==(o=null==(t=d.value)?void 0:t.destroy)||o.call(t),d.value=null,!u)return i.value=!0,void(a.value=n.node.content);if(!e)return void(i.value=!1);const r=c(e,{rootMargin:"400px"});d.value=r,i.value=r.isVisible.value,r.whenVisible.then(()=>{i.value=!0})},{immediate:!0}),L(()=>n.node.content,e=>{u&&!i.value||(a.value=e)})):i.value=!0,S(()=>{var e,n;null==(n=null==(e=d.value)?void 0:e.destroy)||n.call(e),d.value=null}),(n,o)=>(v(),f("div",F({ref_key:"htmlRef",ref:l,class:"html-block-node"},t.value),[i.value?(v(),f(x,{key:0},["dynamic"===s.value.mode?(v(),V(y(r),{key:0,nodes:s.value.nodes},null,8,["nodes"])):"text"===s.value.mode?(v(),f("pre",ht,M(s.value.content),1)):g([a.value],()=>(v(),f("div",{key:2,innerHTML:a.value},null,8,["innerHTML"])),o,0)],64)):(v(),f("div",pt,[z(n.$slots,"placeholder",{node:e.node},()=>[o[1]||(o[1]=k("span",{class:"html-block-node__placeholder-bar"},null,-1)),o[2]||(o[2]=k("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),o[3]||(o[3]=k("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-6797fa3c"]]);ft.install=e=>{e.component(ft.__name,ft)};const vt={dir:"auto",class:"paragraph-node"},gt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const n=e,t=ve(n.customId),o=a({inline_code:Pe,image:fn,link:Gn,hardbreak:st,emphasis:nt,strong:Dn,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:zn,superscript:Rn,html_inline:Oe,html_block:ft,emoji:de,checkbox:re,math_inline:En,checkbox_input:re,reference:$n,footnote_anchor:ot,footnote_reference:xe},t),r=In();return(t,l)=>(v(),f("p",vt,[(v(!0),f(x,null,b(e.node.children,(t,l)=>(v(),f(x,{key:`${e.indexKey||"paragraph"}-${l}`},["text"!==t.type?(v(),V(W(o[t.type]),{key:0,node:t,"index-key":`${e.indexKey}-${l}`,"custom-id":n.customId},null,8,["node","index-key","custom-id"])):(v(),f("span",{key:1,class:E([[y(r)&&t.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},M(t.content),3))],64))),128))]))}}),[["__scopeId","data-v-4e2afdbc"]]);gt.install=e=>{e.component(gt.__name,gt)};const wt=["aria-busy","aria-label","data-language"],yt=["textContent"],kt=/* @__PURE__ */p({__name:"PreCodeNode",props:{node:{}},setup(e){const n=e,t=B(()=>{var e,t,o;const r=String(null!=(t=null==(e=n.node)?void 0:e.language)?t:"");return String(null!=(o=String(r).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=B(()=>`language-${t.value}`),r=B(()=>{const e=t.value;return e?`Code block: ${e}`:"Code block"});return(n,l)=>(v(),f("pre",{class:E([o.value]),"aria-busy":!0===e.node.loading,"aria-label":r.value,"data-language":t.value,tabindex:"0"},[k("code",{translate:"no",textContent:M(e.node.code)},null,8,yt)],10,wt))}});kt.install=e=>{e.component(kt.__name,kt)};const xt={class:"table-node-wrapper"},bt=["aria-busy"],Mt={class:"border-[var(--table-border,#cbd5e1)]"},_t={class:"border-b"},Ct={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Bt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const n=e,t=B(()=>{var e;return null!=(e=n.node.loading)&&e}),o=B(()=>{var e;return null!=(e=n.node.rows)?e:[]});return(r,l)=>(v(),f("div",xt,[k("table",{class:E(["my-8 text-sm table-node",{"table-node--loading":t.value}]),"aria-busy":t.value},[k("thead",Mt,[k("tr",_t,[(v(!0),f(x,null,b(e.node.header.cells,(e,t)=>(v(),f("th",{key:`header-${t}`,dir:"auto",class:E(["font-semibold p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]])},[w(y(Nt),{nodes:e.children,"index-key":`table-th-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:l[0]||(l[0]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),k("tbody",null,[(v(!0),f(x,null,b(o.value,(e,t)=>(v(),f("tr",{key:`row-${t}`,class:E(["border-[var(--table-border,#cbd5e1)]",[t<o.value.length-1?"border-b":""]])},[(v(!0),f(x,null,b(e.cells,(e,o)=>(v(),f("td",{key:`cell-${t}-${o}`,class:E(["p-[calc(4/7*1em)]",["right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"]]),dir:"auto"},[w(y(Nt),{nodes:e.children,"index-key":`table-td-${n.indexKey}`,"custom-id":n.customId,typewriter:n.typewriter,onCopy:l[1]||(l[1]=e=>r.$emit("copy",e))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,bt),w(R,{name:"table-node-fade"},{default:A(()=>[t.value?(v(),f("div",Ct,[z(r.$slots,"loading",{isLoading:t.value},()=>[l[2]||(l[2]=k("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),l[3]||(l[3]=k("span",{class:"sr-only"},"Loading",-1))],!0)])):H("",!0)]),_:3})]))}}),[["__scopeId","data-v-369096fa"]]);Bt.install=e=>{e.component(Bt.__name,Bt)};const Tt={class:"hr-node"},Lt=/* @__PURE__ */ee({},[["render",function(e,n){return v(),f("hr",Tt)}],["__scopeId","data-v-639cbad9"]]);Lt.install=e=>{e.component(Lt.__name,Lt)};const It={class:"unknown-node"},St=/* @__PURE__ */p({__name:"FallbackComponent",props:{node:{}},setup:e=>(n,t)=>(v(),f("div",It,M(e.node.raw),1))}),Et=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},setup(e){const n=e,t=B(()=>`vmr-container vmr-container-${n.node.name}`),o=ve(n.customId),r=a({text:Sn,paragraph:gt,heading:dt,inline_code:Pe,link:Gn,image:fn,strong:Dn,emphasis:nt,strikethrough:Wn,insert:Yn,subscript:zn,superscript:Rn,checkbox:re,checkbox_input:re,hardbreak:st,math_inline:En,reference:$n,list:mt,math_block:jn,table:Bt},o);return(o,l)=>(v(),f("div",F({class:t.value},e.node.attrs),[(v(!0),f(x,null,b(e.node.children,(t,o,l,i)=>{const a=[t];if(i&&i.key===`${e.indexKey||"vmr-container"}-${o}`&&U(i,a))return i;const s=(v(),V(W((c=t.type,r[c]||St)),{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 c;return s.memo=a,s},l,0),128))],16))}}),[["__scopeId","data-v-fac7405d"]]);Et.install=e=>{e.component(Et.__name,Et)};const jt=["data-custom-id"],$t=["data-node-index","data-node-type"],Nt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},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,r;const l=e,i=n,c=T(),h=T(!1),p=/auto|scroll|overlay/i,g="undefined"!=typeof window,w=B(()=>l.debugPerformance&&g&&"undefined"!=typeof console);function y(e,n){w.value&&console.info(`[markstream-vue][perf] ${e}`,n)}function k(e){if("undefined"==typeof window)return null;const n=null!=e?e:c.value;if(!n)return null;const t=n.ownerDocument||document,o=t.scrollingElement||t.documentElement;let r=n;for(;r&&r!==t.body&&r!==o;){const e=window.getComputedStyle(r),n=(e.overflowY||"").toLowerCase(),t=(e.overflow||"").toLowerCase();if(p.test(n)||p.test(t))return r;r=r.parentElement}return null}const M=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,_=u(M),C=/* @__PURE__ */new Map,I=B(()=>{const{key:e,tags:n}=function(e){if(!e||0===e.length)return{key:"",tags:[]};const n=/* @__PURE__ */new Set,t=[];for(const o of e){const e=$(o);e&&!n.has(e)&&(n.add(e),t.push(e))}return 0===t.length?{key:"",tags:[]}:{key:t.join(","),tags:t}}(l.customHtmlTags);if(!e)return _;const t=C.get(e);if(t)return t;const o=u(M,{customHtmlTags:n});return C.set(e,o),o}),j=B(()=>{const e=I.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function $(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 z=B(()=>{var e,n,t,o;const r=null!=(e=l.parseOptions)?e:{},i=null!=(n=l.final)?n:r.final,s=[...null!=(t=l.customHtmlTags)?t:[],...null!=(o=r.customHtmlTags)?o:[]].map($).filter(Boolean),c=null!=i,d=s.length>0;return c||d?a(a(a({},r),c?{final:i}:{}),d?{customHtmlTags:Array.from(new Set(s))}:{}):r}),P=B(()=>{var e;if(null==(e=l.nodes)?void 0:e.length)return X(l.nodes.slice());if(l.content){const e=w.value?performance.now():0,n=m(l.content,j.value,z.value);return w.value&&y("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:l.content.length}),X(n)}return[]}),K=B(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),U=B(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&P.value.length>K.value}),Z=B(()=>!1!==l.viewportPriority&&!h.value),Y=function(e,n){const t="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof n?T(n):n;let r=null,l=null;const i=/* @__PURE__ */new WeakMap,s=(n,s)=>{const c=T(!1);let d,u=!1;const m=new Promise(e=>{d=()=>{u||(u=!0,e())}}),h=()=>{try{null==r||r.unobserve(n)}catch(e){}i.delete(n)};if(!t||!o.value)return c.value=!0,d(),{isVisible:c,whenVisible:m,destroy:h};!l&&s&&(l=a({},s));const p=function(n){var o,a,s;if(r||!t)return r;if("undefined"==typeof IntersectionObserver)return null;const c=null!=(o=null==e?void 0:e(null!=n?n:null))?o:null,d=l||{};return r=new IntersectionObserver(e=>{for(const t of e){const e=i.get(t.target);if(e&&(t.isIntersecting||t.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(n){}}null==r||r.unobserve(t.target),i.delete(t.target)}}},{root:c,rootMargin:null!=(a=d.rootMargin)?a:"300px",threshold:null!=(s=d.threshold)?s:0}),r}(n);return p?(i.set(n,{resolve:d,visible:c}),p.observe(n),{isVisible:c,whenVisible:m,destroy:h}):(c.value=!0,d(),{isVisible:c,whenVisible:m,destroy:h})};return N(ln,s),s}(e=>{var n;return k(null!=(n=null!=e?e:c.value)?n:null)},Z),J=g&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,Q=g&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,ee="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(t=globalThis.process)?void 0:t.env)?void 0:o.NODE_ENV),te=g&&"function"==typeof window.requestIdleCallback,oe=B(()=>{var e;const n=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(n)?Math.max(0,n):0}),le=B(()=>{var e;const n=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:oe.value);return Number.isFinite(n)?Math.max(0,n):oe.value}),ie=B(()=>!1!==l.batchRendering&&oe.value>0&&g&&!ee),ae=T(0),ce=T({key:l.indexKey,total:0}),ue=T(Math.max(1,oe.value||1)),me=q({}),he=/* @__PURE__ */new Map,fe=/* @__PURE__ */new Map,ge=/* @__PURE__ */new Map,we=T(0),ye=B(()=>(we.value,Array.from(ge.entries()).sort((e,n)=>e[0]-n[0]))),ke=T(0),be=T([]),Me=T([]),_e=T(null);let Ce=null,Be=null;const Te=B(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!U.value&&!(P.value.length>900)&&Z.value}),Le=B(()=>{var e;return ie.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),Ie=T({batchSize:oe.value,initial:le.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:Le.value}),Se=B(()=>!!Y&&(Te.value||U.value)),Ee=B(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),je=T(0),$e=q({start:0,end:0}),Ne=/* @__PURE__ */new Map,He=B(()=>{if(!U.value)return P.value.length;const e=Ee.value,n=Math.max($e.end+e,le.value),t=Math.min(P.value.length,n);return Math.max(ae.value,t)});function Re(e){var n,t,o,r;const l=k(null!=(n=null!=e?e:c.value)?n:null);if(l)return l;const i=null!=(r=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(t=c.value)?void 0:t.ownerDocument)?r:"undefined"!=typeof document?document:null;return(null==i?void 0:i.scrollingElement)||(null==i?void 0:i.documentElement)||null}function Ae(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 ze(){Ce&&(Ce(),Ce=null),_e.value=null}function De(){if(!g||!U.value)return;const e=Re();if(!e||_e.value===e)return;ze();const n=()=>We();e.addEventListener("scroll",n,{passive:!0}),_e.value=e,Ce=()=>{e.removeEventListener("scroll",n)}}function Ve(){var e,n,t;if(!Be)return;const o=null!=(t=null==(n=null==(e=c.value)?void 0:e.ownerDocument)?void 0:n.defaultView)?t:"undefined"!=typeof window?window:null;Be.viaTimeout?o?o.clearTimeout(Be.id):clearTimeout(Be.id):null==Q||Q(Be.id),Be=null}function We(e={}){var n,t,o;if(!U.value)return;if(!g)return void Ke(!0);if(e.immediate)return Ve(),void Ke(!0);if(Be)return;const r=()=>{Be=null,Ke()};if(J)Be={id:J(r),viaTimeout:!1};else{const e=null!=(o=null==(t=null==(n=c.value)?void 0:n.ownerDocument)?void 0:t.defaultView)?o:"undefined"!=typeof window?window:null,l=e?e.setTimeout(r,16):setTimeout(r,16);Be={id:l,viaTimeout:!0}}}function Ke(e=!1){var n,t,o,r,l,i,a;if(!U.value)return;const s=_e.value||Re();if(!s)return;const d=s.ownerDocument||(null==(n=c.value)?void 0:n.ownerDocument)||document,u=(null==d?void 0:d.defaultView)||("undefined"!=typeof window?window:null),m=s===(null==d?void 0:d.documentElement)||s===(null==d?void 0:d.body),h=P.value.length;if(!m&&h>0&&Ae(s)){const n=s.clientHeight||0,t=s.scrollTop,o=t<0?-t:t,r=function(e){var n;const t=P.value;if(!t.length)return 0;if(e<=0)return Math.max(0,t.length-1);if(ke.value===t.length){const n=Je(0,t.length);return tn(Math.max(0,n-e))}let o=e;for(let r=t.length-1;r>=0;r--){const e=null!=(n=Ue[r])?n:Ye.value;if(o<=e)return r;o-=e}return 0}(Math.max(0,o)+.5*Math.max(0,n)),l=Fe(r,0,Math.max(0,h-1));return void((e||Math.abs(l-je.value)>1)&&(je.value=l))}const p=m?null:s.getBoundingClientRect(),f=m?0:p.top,v=m?null!=(o=null!=(t=null==u?void 0:u.innerHeight)?t:s.clientHeight)?o:0:p.bottom,g=ye.value;let w=null,y=null;for(const[c,x]of g){if(!x)continue;const e=x.getBoundingClientRect();e.bottom<=f||e.top>=v||(null==w&&(w=c),y=c)}if(null==w||null==y){const e=c.value;if(!e)return;const n=m?{top:0}:s.getBoundingClientRect(),t=function(e,n,t){var o,r,l,i,a,s;if(t)return null!=(i=null!=(l=null==(o=null==n?void 0:n.documentElement)?void 0:o.scrollTop)?l:null==(r=null==n?void 0:n.body)?void 0:r.scrollTop)?i:0;const c=e.scrollTop;if(!Ae(e))return c;const d=c<0?-c:c;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-d}(s,d,m),o=m?(()=>{const t=e.getBoundingClientRect(),o=(m?0:n.top)-t.top;return Math.max(0,o)})():(()=>{const n=function(e,n){let t=e,o=0,r=0;for(;t&&t!==n&&r++<64;)o+=t.offsetTop||0,t=t.offsetParent;return o}(e,s);return Math.max(0,t-n)})(),h=m?null!=(a=null!=(i=null!=(l=null==u?void 0:u.innerHeight)?l:null==(r=null==d?void 0:d.documentElement)?void 0:r.clientHeight)?i:s.clientHeight)?a:0:s.clientHeight,p=tn(o+.5*Math.max(0,h));return void(je.value=Fe(p,0,Math.max(0,P.value.length-1)))}const k=Math.round((w+y)/2);!e&&Math.abs(k-je.value)<=1||(je.value=Fe(k,0,Math.max(0,P.value.length-1)))}function Fe(e,n,t){return Math.min(Math.max(e,n),t)}const Ue=q({}),Xe=q({total:0,count:0});function qe(e,n,t){for(let o=n+1;o<e.length;o+=o&-o)e[o]+=t}function Ge(e,n){let t=0;for(let o=n+1;o>0;o-=o&-o)t+=e[o];return t}function Ze(e,n,t){if(t<=n)return 0;const o=Ge(e,t-1);return n<=0?o:o-Ge(e,n-1)}const Ye=B(()=>Xe.count>0?Math.max(12,Xe.total/Xe.count):32);function Je(e,n){var t,o;if(e>=n)return 0;if(ke.value!==P.value.length){let o=0;for(let r=e;r<n;r++)o+=null!=(t=Ue[r])?t:Ye.value;return o}const r=be.value,l=Me.value;if(!r.length||!l.length){let t=0;for(let r=e;r<n;r++)t+=null!=(o=Ue[r])?o:Ye.value;return t}return Ze(r,e,n)+(n-e-Ze(l,e,n))*Ye.value}L(()=>P.value.length,e=>{if(e<=0)return ke.value=0,be.value=[],void(Me.value=[]);e!==ke.value&&function(e){ke.value=e;const n=new Array(e+1).fill(0),t=new Array(e+1).fill(0);for(const[o,r]of Object.entries(Ue)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(qe(n,l,i),qe(t,l,1))}be.value=n,Me.value=t}(e)},{immediate:!0});const Qe=B(()=>{if(!U.value)return P.value.map((e,n)=>({node:e,index:n}));const e=P.value.length,n=Fe($e.start,0,e),t=Fe($e.end,n,e);return P.value.slice(n,t).map((e,t)=>({node:e,index:n+t}))}),en=B(()=>U.value?Je(0,Math.min($e.start,P.value.length)):0),nn=B(()=>{if(!U.value)return 0;const e=P.value.length;return Je(Math.min($e.end,e),e)});function tn(e){var n;if(e<=0)return 0;const t=P.value;if(ke.value===t.length&&be.value.length&&Me.value.length){const n=Ye.value,o=be.value,r=Me.value,l=e=>e<=0?0:Ge(o,e-1)+(e-Ge(r,e-1))*n;let i=0,a=t.length-1,s=t.length-1;for(;i<=a;){const n=i+a>>1;l(n+1)>=e?(s=n,a=n-1):i=n+1}return s}let o=e;for(let r=0;r<t.length;r++){const e=null!=(n=Ue[r])?n:Ye.value;if(o<=e)return r;o-=e}return Math.max(0,t.length-1)}function on(){we.value+=1}function rn(e){if(!he.size)return;if(!U.value)return;let n=!1;for(const[t,o]of he)t>=e&&(o.destroy(),he.delete(t),Te.value&&delete me[t],gn(t),ge.delete(t)&&(n=!0));n&&on()}function an(e,n){Te.value&&(me[e]=n),n&&(U.value?We():je.value=Fe(e,0,Math.max(0,P.value.length-1)))}function sn(e){const n=he.get(e);n&&(n.destroy(),he.delete(e)),gn(e)}function cn(e,n){let t=!1;if(n){const o=ge.get(e);ge.set(e,n),o!==n&&(t=!0)}else ge.delete(e)&&(t=!0);if(t&&on(),n||gn(e),!Se.value||!Y)return sn(e),void(n?an(e,!0):Te.value&&delete me[e]);if(!U.value&&Te.value&&!h.value&&he.size>=640&&(function(){if(!h.value){h.value=!0;for(const e of he.values())e.destroy();if(he.clear(),g)for(const e of fe.values())window.clearTimeout(e);fe.clear();for(const e of Object.keys(me))delete me[e]}}(),!Se.value||!Y))return sn(e),void(n?an(e,!0):Te.value&&delete me[e]);if(e<le.value&&!U.value)return sn(e),void an(e,!0);if(!n)return sn(e),void(Te.value&&delete me[e]);sn(e);const o=Y(n,{rootMargin:"400px"});o&&(he.set(e,o),an(e,o.isVisible.value),Te.value&&function(e){if(!g||!Te.value)return;gn(e);const n=e%17*23,t=window.setTimeout(()=>{var n,t;if(fe.delete(e),!Te.value)return;if(!0===me[e])return;const o=ge.get(e);if(!o)return void delete me[e];const r=Re(o),l=o.ownerDocument||document,i=l.defaultView||window,a=!r||r===l.documentElement||r===l.body,s=!a&&r?r.getBoundingClientRect():null,c=a?0:s.top,d=a?null!=(t=null!=(n=i.innerHeight)?n:null==r?void 0:r.clientHeight)?t:0:s.bottom,u=o.getBoundingClientRect();u.bottom>=c-500&&u.top<=d+500&&an(e,!0)},1800+n);fe.set(e,t)}(e),o.whenVisible.then(()=>{gn(e),an(e,!0)}).catch(()=>{}).finally(()=>{he.get(e)===o&&he.delete(e);try{o.destroy()}catch(n){}}),U.value&&We())}let dn=null,un=null,mn=!1,hn=null,pn=null;function vn(){g&&(null!=dn&&(null==Q||Q(dn),dn=null),null!=un&&(window.clearTimeout(un),un=null),null!=pn&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(pn),pn=null),mn=!1,hn=null)}function gn(e){if(!g)return;const n=fe.get(e);null!=n&&(window.clearTimeout(n),fe.delete(e))}function wn(e,n={}){var t,o;if(!Le.value)return;const r=He.value;if(ae.value>=r)return;const i=Math.max(1,e),a=e=>{var n;dn=null,un=null,pn=null,mn=!1;const t=null!=hn?hn:i;hn=null;const o=Math.max(2,null!=(n=l.renderBatchBudgetMs)?n:6),a=e=>{const n="undefined"!=typeof performance?performance.now():Date.now();ae.value=Math.min(r,ae.value+Math.max(1,e)),rn(ae.value);const t=("undefined"!=typeof performance?performance.now():Date.now())-n;return function(e){var n;if(!Le.value)return;const t=Math.max(2,null!=(n=l.renderBatchBudgetMs)?n:6),o=Math.max(1,oe.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*t?ue.value=Math.max(r,Math.floor(.7*ue.value)):e<.5*t&&ue.value<o&&(ue.value=Math.min(o,Math.ceil(1.2*ue.value)))}(t),t};let s=t;for(;(a(s),!(ae.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(ue.value));ae.value<r&&yn()};if(!g||n.immediate)return void a();const s=Math.max(0,null!=(t=l.renderBatchDelay)?t:16);if(hn=null!=hn?Math.max(hn,i):i,!mn){if(mn=!0,!ee&&te&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(pn=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}J&&!ee?dn=J(()=>{0!==s?un=window.setTimeout(()=>a(),s):a()}):un=window.setTimeout(()=>a(),s)}}function yn(){Le.value&&wn(ie.value?Math.max(1,Math.round(ue.value)):Math.max(1,oe.value))}L([()=>P.value,()=>P.value.length,()=>Le.value,()=>oe.value,()=>le.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const n=P.value.length,t=ce.value,o=l.indexKey,r=void 0!==o&&o!==t.key,i=n!==t.total,a=r||i;ce.value={key:o,total:n};const s=Ie.value,c=null!=(e=l.renderBatchDelay)?e:16,d=s.batchSize!==oe.value||s.initial!==le.value||s.delay!==c||s.enabled!==Le.value;Ie.value={batchSize:oe.value,initial:le.value,delay:c,enabled:Le.value},(a||d||!Le.value)&&vn(),(a||d)&&(ue.value=Math.max(1,oe.value||1)),a&&U.value&&We({immediate:!0});const u=He.value;if(!n)return ae.value=0,void rn(0);if(!Le.value)return ae.value=u,void rn(ae.value);const m=r||0===t.total;ae.value=m||d?Math.min(u,le.value):Math.min(ae.value,u);const h=Math.max(1,le.value||oe.value||n);ae.value<u?wn(h,{immediate:!g}):rn(ae.value)},{immediate:!0}),L(()=>U.value,e=>{if(!e)return ze(),void Ve();De(),We({immediate:!0})},{immediate:!0}),L([()=>P.value.length,()=>U.value],e=>d(null,[e],function*([e,n]){n&&e&&g&&(yield G(),We({immediate:!0}))}),{flush:"post"}),L(()=>c.value,()=>{U.value&&(De(),We({immediate:!0}))}),L(()=>P.value.length,()=>{U.value&&We({immediate:!0})}),L(()=>Te.value,e=>{if(e)for(const[n,t]of ge)cn(n,t);else{for(const e of he.values())e.destroy();he.clear();for(const e of Array.from(fe.keys()))gn(e);for(const e of Object.keys(me))delete me[e];for(const[e,n]of ge)n&&an(e,!0)}},{immediate:!1}),L([()=>l.viewportPriority,()=>P.value.length],([e,n])=>{!1!==e?h.value&&n<=200&&(h.value=!1):h.value=!1}),L(()=>ae.value,()=>{U.value&&We({immediate:!0})}),L([je,K,Ee,()=>P.value.length,U],()=>{!function(){const e=P.value.length;if(!U.value||0===e)return $e.start=0,void($e.end=e);const n=Math.min(K.value,e),t=Ee.value,o=Fe(je.value-t,0,Math.max(0,e-n));$e.start=o,$e.end=Math.min(e,o+n)}()},{immediate:!0}),L([()=>P.value.length,U,K,Ee,()=>$e.start,()=>$e.end],([e,n,t,o,r,l])=>{w.value&&y("virtualization",{nodes:e,virtualization:n,maxLiveNodes:t,buffer:o,focusIndex:je.value,scroll:n?(()=>{const e=_e.value||Re();return e?{reverse:Ae(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:r,end:l},rendered:ae.value})}),L(()=>He.value,(e,n)=>{Le.value&&("number"==typeof n&&e<=n||e>ae.value&&yn())}),S(()=>{vn();for(const e of he.values())e.destroy();he.clear();for(const e of Array.from(fe.keys()))gn(e);ze(),Ve()});const kn=D(()=>d(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),kt}})),xn=D(()=>d(null,null,function*(){try{return(yield import("./index5.js")).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),kt}})),bn=D(()=>d(null,null,function*(){try{return(yield import("./index6.js")).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering. To enable Infographic rendering, please install "@antv/infographic".',e),kt}})),Mn=B(()=>l.renderCodeBlocksAsPre?kt:kn),_n={text:Sn,paragraph:gt,heading:dt,code_block:kn,list:mt,list_item:ut,blockquote:ne,table:Bt,definition_list:se,footnote:it,footnote_reference:xe,footnote_anchor:ot,admonition:Dt,vmr_container:Et,hardbreak:st,link:Gn,image:fn,thematic_break:Lt,math_inline:En,math_block:jn,strong:Dn,emphasis:nt,strikethrough:Wn,highlight:Qn,insert:Yn,subscript:zn,superscript:Rn,emoji:de,checkbox:re,checkbox_input:re,inline_code:Pe,html_inline:Oe,reference:$n,html_block:ft},Cn=B(()=>(pe.value,ve(l.customId))),Bn=B(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),Tn={},Ln=B(()=>a({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,monacoOptions:l.codeBlockMonacoOptions,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},l.codeBlockProps||{})),In=B(()=>({typewriter:l.typewriter})),Nn=B(()=>Qe.value.map(e=>{const n=Hn(e.node);return s(a({},e),{component:An(e.node,n),bindings:On(e.node,n),isCodeBlock:"code_block"===e.node.type,indexKey:`${Bn.value}-${e.index}`})}));function Hn(e){var n;return"code_block"===(null==e?void 0:e.type)?String(null!=(n=e.language)?n:"").trim().toLowerCase():""}function An(e,n){if(!e)return St;const t=Cn.value,o=t[String(e.type)];if("code_block"===e.type){const r=null!=n?n:Hn(e);if("mermaid"===r)return t.mermaid||xn;if("infographic"===r)return t.infographic||bn;if(o)return o;return t.code_block||Mn.value}return o||_n[String(e.type)]||St}function On(e,n){const t=null!=n?n:Hn(e);return"mermaid"===t||"infographic"===t?Tn:"code_block"===e.type?Ln.value:In.value}function Pn(e){i("click",e)}function Vn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&i("mouseover",e)}function Kn(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&i("mouseout",e)}return(e,n)=>(v(),f("div",{ref_key:"containerRef",ref:c,class:E(["markstream-vue markdown-renderer",[{dark:l.isDark},{virtualized:U.value}]]),"data-custom-id":l.customId,onClick:Pn,onMouseover:Vn,onMouseout:Kn},[U.value?(v(),f("div",{key:0,class:"node-spacer",style:O({height:`${en.value}px`}),"aria-hidden":"true"},null,4)):H("",!0),(v(!0),f(x,null,b(Nn.value,e=>{var t,o;return v(),f("div",{key:e.index,ref_for:!0,ref:n=>cn(e.index,n),class:"node-slot","data-node-index":e.index,"data-node-type":e.node.type},[(o=e.index,Le.value&&o>=ae.value||Te.value&&!(o<le.value)&&!0!==me[o]?(v(),f("div",{key:1,class:"node-placeholder",style:O({height:`${null!=(t=Ue[e.index])?t:Ye.value}px`})},null,4)):(v(),f("div",{key:0,ref_for:!0,ref:n=>function(e,n){n?(Ne.set(e,n),queueMicrotask(()=>{!function(e,n){if(!Number.isFinite(n)||n<=0)return;const t=Ue[e];if(Ue[e]=n,t?Xe.total+=n-t:(Xe.total+=n,Xe.count++),ke.value>e){const o=be.value,r=Me.value;if(o.length&&r.length)if(t){const r=n-t;0!==r&&qe(o,e,r)}else qe(o,e,n),qe(r,e,1)}}(e,n.offsetHeight)})):Ne.delete(e)}(e.index,n),class:"node-content"},[e.isCodeBlock||!1===l.typewriter?(v(),V(W(e.component),F({key:1,node:e.node,loading:e.node.loading,"index-key":e.indexKey},{ref_for:!0},e.bindings,{"custom-id":l.customId,"is-dark":l.isDark,onCopy:n[2]||(n[2]=e=>i("copy",e)),onHandleArtifactClick:n[3]||(n[3]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(v(),V(R,{key:0,name:"typewriter",appear:""},{default:A(()=>[(v(),V(W(e.component),F({node:e.node,loading:e.node.loading,"index-key":e.indexKey},{ref_for:!0},e.bindings,{"custom-id":l.customId,"is-dark":l.isDark,onCopy:n[0]||(n[0]=e=>i("copy",e)),onHandleArtifactClick:n[1]||(n[1]=e=>i("handleArtifactClick",e))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024))],512)))],8,$t)}),128)),U.value?(v(),f("div",{key:1,class:"node-spacer",style:O({height:`${nn.value}px`}),"aria-hidden":"true"},null,4)):H("",!0)],42,jt))}}),[["__scopeId","data-v-617f487c"]]);Nt.install=e=>{var n,t;const o=null!=(t=null!=(n=Nt.__name)?n:Nt.name)?t:"NodeRenderer";e.component(o,Nt)};const Ht={key:0,class:"admonition-icon"},Rt={class:"admonition-title"},At=["aria-expanded","aria-controls","title"],Ot={key:0},zt={key:1},Pt=["id"],Dt=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:n}){var t;const o=e,r=n,l={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},i=B(()=>{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)}),a=T(!!o.node.collapsible&&!(null==(t=o.node.open)||t));function s(){o.node.collapsible&&(a.value=!a.value)}const c=`admonition-${Math.random().toString(36).slice(2,9)}`;return(n,t)=>(v(),f("div",{class:E(["admonition",[`admonition-${o.node.kind}`,o.isDark?"is-dark":""]])},[k("div",{id:c,class:"admonition-header"},[l[o.node.kind]?(v(),f("span",Ht,M(l[o.node.kind]),1)):H("",!0),k("span",Rt,M(i.value),1),o.node.collapsible?(v(),f("button",{key:1,class:"admonition-toggle","aria-expanded":!a.value,"aria-controls":`${c}-content`,title:a.value?"Expand":"Collapse",onClick:s},[a.value?(v(),f("span",Ot,"▶")):(v(),f("span",zt,"▼"))],8,At)):H("",!0)]),Z(k("div",{id:`${c}-content`,class:"admonition-content","aria-labelledby":c},[g([o.node.children],()=>w(y(Nt),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,onCopy:t[0]||(t[0]=e=>r("copy",e))},null,8,["index-key","nodes","custom-id","typewriter"]),t,1)],8,Pt),[[Y,!a.value]])],2))}}),[["__scopeId","data-v-5e95c2b7"]]);Dt.install=e=>{e.component(Dt.__name,Dt)};let Vt=!1,Wt=null,Kt=!1;function Ft(){return d(this,null,function*(){if(Wt)return Wt;if(Kt)return null;try{return Wt=yield import("stream-monaco"),yield function(e){return d(this,null,function*(){if(Vt)return;Vt=!0;const n=null==globalThis?void 0:globalThis.MonacoEnvironment;return!n||"function"!=typeof n.getWorker&&"function"!=typeof n.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(Wt),(yield function(e){return d(this,null,function*(){const n=null==e?void 0:e.getOrCreateHighlighter;if("function"!=typeof n)return!0;try{const e=yield n(["vitesse-dark","vitesse-light"],["plaintext","text","javascript"]);return e&&"function"==typeof e.codeToTokens&&e.codeToTokens("const a = 1",{lang:"javascript",theme:"vitesse-dark"}),!0}catch(t){return console.warn("[markstream-vue] Failed to warm up Shiki tokenizer; disabling stream-monaco for this session.",t),!1}})}(Wt))?Wt:(Wt=null,Kt=!0,null)}catch(e){return Kt=!0,null}})}let Ut=null;function Xt(e){Ut=null!=e?e:null}const qt={"":"",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 Gt(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=qt[t])?n:t}function Zt(e){const n=Gt(e);if(!n)return"plaintext";switch(n){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return n}}function Yt(e){if(Ut){const n=Ut(e);if(null!=n&&""!==n)return n}switch(Gt(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 Jt={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"},Qt={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)"}},eo={class:"flex items-center gap-x-2"},no=["innerHTML"],to={class:"text-sm font-medium font-mono"},oo={class:"flex items-center gap-x-2"},ro=["aria-pressed"],lo=["disabled"],io=["disabled"],ao=["disabled"],so=["aria-label"],co={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"},uo={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"},mo=["aria-pressed"],ho={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"},fo=["aria-label"],vo=["innerHTML"],go={class:"code-loading-placeholder"},wo=/* @__PURE__ */ee(/* @__PURE__ */p({__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,r=n,{t:l}=rn(),i=T(String(null!=(t=o.node.language)?t:"")),a=T(!1),s=T(!1),c=T(!1),u=T(null),m=T(null),h=T(""),p=T(!1);let g;const w=T(!0),b=T(0),_=T(14),C=T(_.value),j=B(()=>{const e=_.value,n=C.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof n&&Number.isFinite(n)&&n>0}),$=B(()=>{const e=i.value.trim().toLowerCase();return Jt[e]||e.charAt(0).toUpperCase()+e.slice(1)}),N=B(()=>Yt(i.value.trim().toLowerCase().split(":")[0])),R=B(()=>{const e=i.value.trim().toLowerCase();return o.isShowPreview&&("html"===e||"svg"===e)}),A=B(()=>{const e={},n=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},t=n(o.minWidth),r=n(o.maxWidth);return t&&(e.minWidth=t),r&&(e.maxWidth=r),e}),P=B(()=>({fontSize:`${C.value}px`}));function D(){return o.isDark?o.darkTheme:o.lightTheme}function V(e){if(null==g||g.disconnect(),g=void 0,!e)return h.value="",void(p.value=!1);var n;h.value=`<pre class="shiki shiki-fallback"><code>${n=e,n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code></pre>`,p.value=!1}function W(){h.value="",p.value=!0}function K(){var e;const n=m.value;return!!n&&(n.childNodes.length>0||Boolean(null==(e=n.textContent)?void 0:e.trim().length))}function F(){return d(this,null,function*(){if(yield G(),K())return void W();const e=m.value;e&&(null==g||g.disconnect(),g=new MutationObserver(()=>{K()&&(W(),null==g||g.disconnect(),g=void 0)}),g.observe(e,{childList:!0,subtree:!0}))})}let U,X,q,J;const Q=/* @__PURE__ */new Set,ee=/* @__PURE__ */new Set,ne=void 0!==import.meta&&Boolean(!1);function te(e,n){return d(this,null,function*(){if(!U)return;const t=function(e,n=!1){var t;const[o]=String(null!=e?e:"").split(":"),r=null!=(t=null==o?void 0:o.trim().toLowerCase())?t:"";return r?!J||J.has(r)?r:(n&&ne&&!Q.has(r)&&(Q.add(r),console.warn(`[MarkdownCodeBlockNode] Language "${r}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}(n,Boolean(e&&e.length));try{yield U.updateCode(e,t)}catch(o){"plaintext"!==t?(ne&&!ee.has(t)&&(ee.add(t),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${t}", retrying as plaintext.`,o)),yield U.updateCode(e,"plaintext")):ne&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o)}})}function oe(){return d(this,null,function*(){yield function(){return d(this,null,function*(){if(!X)try{const e=yield import("stream-markdown");X=e.createShikiStreamRenderer,q=e.registerHighlight;const n=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;J=n?new Set(n.map(e=>e.toLowerCase())):void 0,null==q||q({themes:o.themes})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}(),u.value&&m.value?(null==q||q({themes:o.themes}),!U&&X&&(U=X(m.value,{theme:D()}),p.value=!0),U?!1===o.stream&&o.loading?V(o.node.code):(V(o.node.code),yield te(o.node.code,i.value),yield F()):V(o.node.code)):V(o.node.code)})}function re(){const e=u.value;if(!e||s.value)return;const n=e.scrollTop;n<b.value?w.value=!1:function(e,n=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=n}(e)&&(w.value=!0),b.value=n}function le(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(o.node.code)),a.value=!0,r("copy",o.node.code),setTimeout(()=>{a.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function ie(e){return!e||e.disabled}function ae(e,n,t="top"){if(ie(e.currentTarget))return;const r=e,l=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0;en(e.currentTarget,n,t,!1,l,o.isDark)}function se(){nn()}function ce(e){if(ie(e.currentTarget))return;const n=a.value?l("common.copied")||"Copied":l("common.copy")||"Copy",t=e,r=null!=(null==t?void 0:t.clientX)&&null!=(null==t?void 0:t.clientY)?{x:t.clientX,y:t.clientY}:void 0;en(e.currentTarget,n,"top",!1,r,o.isDark)}function de(){s.value=!s.value;const e=u.value;e&&(s.value?(e.style.maxHeight="none",e.style["overflow-y"]="visible",e.style["overflow-x"]="auto"):(e.style.maxHeight="500px",e.style.overflow="auto",w.value=!0,G(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))}function ue(){c.value=!c.value}function me(){if(!R.value)return;const e=(i.value||o.node.language).toLowerCase(),n="html"===e?"HTML Preview":"SVG Preview";r("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:o.node.code,title:n})}return oe(),I(()=>{oe()}),S(()=>{null==g||g.disconnect(),g=void 0}),L(()=>o.themes,()=>d(null,null,function*(){q&&q({themes:o.themes})})),L(()=>o.loading,e=>{e||oe()}),L(()=>[o.node.code,o.node.language],e=>d(null,[e],function*([e,n]){n!==i.value&&(i.value=n.trim()),u.value&&m.value?(U||(V(e),yield oe()),U&&e&&(!1===o.stream&&o.loading||(V(e),yield te(e,n),yield F()))):V(e)})),L(()=>[o.darkTheme,o.lightTheme],()=>d(null,null,function*(){u.value&&m.value&&(U||(yield oe()),null==U||U.setTheme(D()))})),L(()=>o.node.code,()=>d(null,null,function*(){if(s.value||!w.value)return;yield G();const e=u.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(n,t)=>(v(),f("div",{style:O(A.value),class:E(["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?(v(),f("div",Qt,[z(n.$slots,"header-left",{},()=>[k("div",eo,[k("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:N.value},null,8,no),k("span",to,M($.value),1)])],!0),z(n.$slots,"header-right",{},()=>[k("div",oo,[k("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:ue,onMouseenter:t[0]||(t[0]=e=>ae(e,c.value?y(l)("common.expand")||"Expand":y(l)("common.collapse")||"Collapse")),onFocus:t[1]||(t[1]=e=>ae(e,c.value?y(l)("common.expand")||"Expand":y(l)("common.collapse")||"Collapse")),onMouseleave:se,onBlur:se},[(v(),f("svg",{style:O({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]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ro),o.showFontSizeButtons&&o.enableFontSizeControl?(v(),f(x,{key:0},[k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(C.value)&&C.value<=10,onClick:t[2]||(t[2]=e=>function(){const e=Math.max(10,C.value-1);C.value=e}()),onMouseenter:t[3]||(t[3]=e=>ae(e,y(l)("common.decrease")||"Decrease")),onFocus:t[4]||(t[4]=e=>ae(e,y(l)("common.decrease")||"Decrease")),onMouseleave:se,onBlur:se},[...t[18]||(t[18]=[k("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"},[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,lo),k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!j.value||C.value===_.value,onClick:t[5]||(t[5]=e=>{C.value=_.value}),onMouseenter:t[6]||(t[6]=e=>ae(e,y(l)("common.reset")||"Reset")),onFocus:t[7]||(t[7]=e=>ae(e,y(l)("common.reset")||"Reset")),onMouseleave:se,onBlur:se},[...t[19]||(t[19]=[k("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"},[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),k("path",{d:"M3 3v5h5"})])],-1)])],40,io),k("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(C.value)&&C.value>=36,onClick:t[8]||(t[8]=e=>function(){const e=Math.min(36,C.value+1);C.value=e}()),onMouseenter:t[9]||(t[9]=e=>ae(e,y(l)("common.increase")||"Increase")),onFocus:t[10]||(t[10]=e=>ae(e,y(l)("common.increase")||"Increase")),onMouseleave:se,onBlur:se},[...t[20]||(t[20]=[k("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"},[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,ao)],64)):H("",!0),o.showCopyButton?(v(),f("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":a.value?y(l)("common.copied")||"Copied":y(l)("common.copy")||"Copy",onClick:le,onMouseenter:t[11]||(t[11]=e=>ce(e)),onFocus:t[12]||(t[12]=e=>ce(e)),onMouseleave:se,onBlur:se},[a.value?(v(),f("svg",uo,[...t[22]||(t[22]=[k("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),f("svg",co,[...t[21]||(t[21]=[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),k("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,so)):H("",!0),o.showExpandButton?(v(),f("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:de,onMouseenter:t[13]||(t[13]=e=>ae(e,s.value?y(l)("common.collapse")||"Collapse":y(l)("common.expand")||"Expand")),onFocus:t[14]||(t[14]=e=>ae(e,s.value?y(l)("common.collapse")||"Collapse":y(l)("common.expand")||"Expand")),onMouseleave:se,onBlur:se},[s.value?(v(),f("svg",ho,[...t[23]||(t[23]=[k("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)])])):(v(),f("svg",po,[...t[24]||(t[24]=[k("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,mo)):H("",!0),R.value&&o.showPreviewButton?(v(),f("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":y(l)("common.preview")||"Preview",onClick:me,onMouseenter:t[15]||(t[15]=e=>ae(e,y(l)("common.preview")||"Preview")),onFocus:t[16]||(t[16]=e=>ae(e,y(l)("common.preview")||"Preview")),onMouseleave:se,onBlur:se},[...t[25]||(t[25]=[k("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"},[k("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[k("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"}),k("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,fo)):H("",!0)])],!0)])):H("",!0),Z(k("div",{ref_key:"codeBlockContent",ref:u,class:"code-block-content",style:O(P.value),onScroll:re},[k("div",{ref_key:"rendererTarget",ref:m,class:"code-block-render"},null,512),p.value?H("",!0):(v(),f("div",{key:0,class:"code-fallback-plain",innerHTML:h.value},null,8,vo))],36),[[Y,!(c.value||!e.stream&&e.loading)]]),Z(k("div",go,[z(n.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[t[26]||(t[26]=k("div",{class:"loading-skeleton"},[k("div",{class:"skeleton-line"}),k("div",{class:"skeleton-line"}),k("div",{class:"skeleton-line short"})],-1))],!0)],512),[[Y,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-9411928c"]]);wo.install=e=>{e.component(wo.__name,wo)};const yo=()=>import("mermaid");let ko=null,xo=yo;function bo(e){xo=e,ko=null}function Mo(e){bo(null!=e?e:yo)}function _o(){bo(null)}function Co(){return"function"==typeof xo}function Bo(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(a({},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 To(e){if(e)try{const n=null==e?void 0:e.initialize;e.initialize=t=>{const o=a({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){}}function Lo(){return d(this,null,function*(){if(ko)return ko;const e=function(){try{const e=globalThis;return Bo(null==e?void 0:e.mermaid)}catch(e){return null}}();if(e)return ko=e,To(ko),ko;const n=xo;if(!n)return null;let t;try{t=yield n()}catch(o){if(n===yo)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return t?(ko=Bo(t),To(ko),ko):null})}const Io=Math.min,So=Math.max,Eo=Math.round,jo=Math.floor,$o=e=>({x:e,y:e}),No={left:"right",right:"left",bottom:"top",top:"bottom"},Ho={start:"end",end:"start"};function Ro(e,n,t){return So(e,Io(n,t))}function Ao(e,n){return"function"==typeof e?e(n):e}function Oo(e){return e.split("-")[0]}function zo(e){return e.split("-")[1]}function Po(e){return"x"===e?"y":"x"}function Do(e){return"y"===e?"height":"width"}const Vo=/* @__PURE__ */new Set(["top","bottom"]);function Wo(e){return Vo.has(Oo(e))?"y":"x"}function Ko(e){return Po(Wo(e))}function Fo(e){return e.replace(/start|end/g,e=>Ho[e])}const Uo=["left","right"],Xo=["right","left"],qo=["top","bottom"],Go=["bottom","top"];function Zo(e){return e.replace(/left|right|bottom|top/g,e=>No[e])}function Yo(e){const{x:n,y:t,width:o,height:r}=e;return{width:o,height:r,top:t,left:n,right:n+o,bottom:t+r,x:n,y:t}}function Jo(e,n,t){let{reference:o,floating:r}=e;const l=Wo(n),i=Ko(n),a=Do(i),s=Oo(n),c="y"===l,d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,m=o[a]/2-r[a]/2;let h;switch(s){case"top":h={x:d,y:o.y-r.height};break;case"bottom":h={x:d,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:u};break;case"left":h={x:o.x-r.width,y:u};break;default:h={x:o.x,y:o.y}}switch(zo(n)){case"start":h[i]-=m*(t&&c?-1:1);break;case"end":h[i]+=m*(t&&c?-1:1)}return h}function Qo(e,n){return d(this,null,function*(){var t;void 0===n&&(n={});const{x:o,y:r,platform:l,rects:i,elements:s,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:m="floating",altBoundary:h=!1,padding:p=0}=Ao(n,e),f=function(e){return"number"!=typeof e?function(e){return a({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}(p),v=s[h?"floating"===m?"reference":"floating":m],g=Yo(yield l.getClippingRect({element:null==(t=yield null==l.isElement?void 0:l.isElement(v))||t?v:v.contextElement||(yield null==l.getDocumentElement?void 0:l.getDocumentElement(s.floating)),boundary:d,rootBoundary:u,strategy:c})),w="floating"===m?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,y=yield null==l.getOffsetParent?void 0:l.getOffsetParent(s.floating),k=(yield null==l.isElement?void 0:l.isElement(y))&&(yield null==l.getScale?void 0:l.getScale(y))||{x:1,y:1},x=Yo(l.convertOffsetParentRelativeRectToViewportRelativeRect?yield l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:y,strategy:c}):w);return{top:(g.top-x.top+f.top)/k.y,bottom:(x.bottom-g.bottom+f.bottom)/k.y,left:(g.left-x.left+f.left)/k.x,right:(x.right-g.right+f.right)/k.x}})}const er=/* @__PURE__ */new Set(["left","top"]);function nr(){return"undefined"!=typeof window}function tr(e){return lr(e)?(e.nodeName||"").toLowerCase():"#document"}function or(e){var n;return(null==e||null==(n=e.ownerDocument)?void 0:n.defaultView)||window}function rr(e){var n;return null==(n=(lr(e)?e.ownerDocument:e.document)||window.document)?void 0:n.documentElement}function lr(e){return!!nr()&&(e instanceof Node||e instanceof or(e).Node)}function ir(e){return!!nr()&&(e instanceof Element||e instanceof or(e).Element)}function ar(e){return!!nr()&&(e instanceof HTMLElement||e instanceof or(e).HTMLElement)}function sr(e){return!(!nr()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof or(e).ShadowRoot)}const cr=/* @__PURE__ */new Set(["inline","contents"]);function dr(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=br(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!cr.has(r)}const ur=/* @__PURE__ */new Set(["table","td","th"]);function mr(e){return ur.has(tr(e))}const hr=[":popover-open",":modal"];function pr(e){return hr.some(n=>{try{return e.matches(n)}catch(t){return!1}})}const fr=["transform","translate","scale","rotate","perspective"],vr=["transform","translate","scale","rotate","perspective","filter"],gr=["paint","layout","strict","content"];function wr(e){const n=yr(),t=ir(e)?br(e):e;return fr.some(e=>!!t[e]&&"none"!==t[e])||!!t.containerType&&"normal"!==t.containerType||!n&&!!t.backdropFilter&&"none"!==t.backdropFilter||!n&&!!t.filter&&"none"!==t.filter||vr.some(e=>(t.willChange||"").includes(e))||gr.some(e=>(t.contain||"").includes(e))}function yr(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const kr=/* @__PURE__ */new Set(["html","body","#document"]);function xr(e){return kr.has(tr(e))}function br(e){return or(e).getComputedStyle(e)}function Mr(e){return ir(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _r(e){if("html"===tr(e))return e;const n=e.assignedSlot||e.parentNode||sr(e)&&e.host||rr(e);return sr(n)?n.host:n}function Cr(e){const n=_r(e);return xr(n)?e.ownerDocument?e.ownerDocument.body:e.body:ar(n)&&dr(n)?n:Cr(n)}function Br(e,n,t){var o;void 0===n&&(n=[]),void 0===t&&(t=!0);const r=Cr(e),l=r===(null==(o=e.ownerDocument)?void 0:o.body),i=or(r);if(l){const e=Tr(i);return n.concat(i,i.visualViewport||[],dr(r)?r:[],e&&t?Br(e):[])}return n.concat(r,Br(r,[],t))}function Tr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Lr(e){const n=br(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=ar(e),l=r?e.offsetWidth:t,i=r?e.offsetHeight:o,a=Eo(t)!==l||Eo(o)!==i;return a&&(t=l,o=i),{width:t,height:o,$:a}}function Ir(e){return ir(e)?e:e.contextElement}function Sr(e){const n=Ir(e);if(!ar(n))return $o(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:l}=Lr(n);let i=(l?Eo(t.width):t.width)/o,a=(l?Eo(t.height):t.height)/r;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Er=/* @__PURE__ */$o(0);function jr(e){const n=or(e);return yr()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:Er}function $r(e,n,t,o){void 0===n&&(n=!1),void 0===t&&(t=!1);const r=e.getBoundingClientRect(),l=Ir(e);let i=$o(1);n&&(o?ir(o)&&(i=Sr(o)):i=Sr(e));const a=function(e,n,t){return void 0===n&&(n=!1),!(!t||n&&t!==or(e))&&n}(l,t,o)?jr(l):$o(0);let s=(r.left+a.x)/i.x,c=(r.top+a.y)/i.y,d=r.width/i.x,u=r.height/i.y;if(l){const e=or(l),n=o&&ir(o)?or(o):o;let t=e,r=Tr(t);for(;r&&o&&n!==t;){const e=Sr(r),n=r.getBoundingClientRect(),o=br(r),l=n.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,i=n.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,u*=e.y,s+=l,c+=i,t=or(r),r=Tr(t)}}return Yo({width:d,height:u,x:s,y:c})}function Nr(e,n){const t=Mr(e).scrollLeft;return n?n.left+t:$r(rr(e)).left+t}function Hr(e,n){const t=e.getBoundingClientRect();return{x:t.left+n.scrollLeft-Nr(e,t),y:t.top+n.scrollTop}}const Rr=/* @__PURE__ */new Set(["absolute","fixed"]);function Ar(e,n,t){let o;if("viewport"===n)o=function(e,n){const t=or(e),o=rr(e),r=t.visualViewport;let l=o.clientWidth,i=o.clientHeight,a=0,s=0;if(r){l=r.width,i=r.height;const e=yr();(!e||e&&"fixed"===n)&&(a=r.offsetLeft,s=r.offsetTop)}const c=Nr(o);if(c<=0){const e=o.ownerDocument,n=e.body,t=getComputedStyle(n),r="CSS1Compat"===e.compatMode&&parseFloat(t.marginLeft)+parseFloat(t.marginRight)||0,i=Math.abs(o.clientWidth-n.clientWidth-r);i<=25&&(l-=i)}else c<=25&&(l+=c);return{width:l,height:i,x:a,y:s}}(e,t);else if("document"===n)o=function(e){const n=rr(e),t=Mr(e),o=e.ownerDocument.body,r=So(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),l=So(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let i=-t.scrollLeft+Nr(e);const a=-t.scrollTop;return"rtl"===br(o).direction&&(i+=So(n.clientWidth,o.clientWidth)-r),{width:r,height:l,x:i,y:a}}(rr(e));else if(ir(n))o=function(e,n){const t=$r(e,!0,"fixed"===n),o=t.top+e.clientTop,r=t.left+e.clientLeft,l=ar(e)?Sr(e):$o(1);return{width:e.clientWidth*l.x,height:e.clientHeight*l.y,x:r*l.x,y:o*l.y}}(n,t);else{const t=jr(e);o={x:n.x-t.x,y:n.y-t.y,width:n.width,height:n.height}}return Yo(o)}function Or(e,n){const t=_r(e);return!(t===n||!ir(t)||xr(t))&&("fixed"===br(t).position||Or(t,n))}function zr(e,n,t){const o=ar(n),r=rr(n),l="fixed"===t,i=$r(e,!0,l,n);let a={scrollLeft:0,scrollTop:0};const s=$o(0);function c(){s.x=Nr(r)}if(o||!o&&!l)if(("body"!==tr(n)||dr(r))&&(a=Mr(n)),o){const e=$r(n,!0,l,n);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}else r&&c();l&&!o&&r&&c();const d=!r||o||l?$o(0):Hr(r,a);return{x:i.left+a.scrollLeft-s.x-d.x,y:i.top+a.scrollTop-s.y-d.y,width:i.width,height:i.height}}function Pr(e){return"static"===br(e).position}function Dr(e,n){if(!ar(e)||"fixed"===br(e).position)return null;if(n)return n(e);let t=e.offsetParent;return rr(e)===t&&(t=t.ownerDocument.body),t}function Vr(e,n){const t=or(e);if(pr(e))return t;if(!ar(e)){let n=_r(e);for(;n&&!xr(n);){if(ir(n)&&!Pr(n))return n;n=_r(n)}return t}let o=Dr(e,n);for(;o&&mr(o)&&Pr(o);)o=Dr(o,n);return o&&xr(o)&&Pr(o)&&!wr(o)?t:o||function(e){let n=_r(e);for(;ar(n)&&!xr(n);){if(wr(n))return n;if(pr(n))return null;n=_r(n)}return null}(e)||t}const Wr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const l="fixed"===r,i=rr(o),a=!!n&&pr(n.floating);if(o===i||a&&l)return t;let s={scrollLeft:0,scrollTop:0},c=$o(1);const d=$o(0),u=ar(o);if((u||!u&&!l)&&(("body"!==tr(o)||dr(i))&&(s=Mr(o)),ar(o))){const e=$r(o);c=Sr(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const m=!i||u||l?$o(0):Hr(i,s);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-s.scrollLeft*c.x+d.x+m.x,y:t.y*c.y-s.scrollTop*c.y+d.y+m.y}},getDocumentElement:rr,getClippingRect:function(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const l=[..."clippingAncestors"===t?pr(n)?[]:function(e,n){const t=n.get(e);if(t)return t;let o=Br(e,[],!1).filter(e=>ir(e)&&"body"!==tr(e)),r=null;const l="fixed"===br(e).position;let i=l?_r(e):e;for(;ir(i)&&!xr(i);){const n=br(i),t=wr(i);t||"fixed"!==n.position||(r=null),(l?!t&&!r:!t&&"static"===n.position&&r&&Rr.has(r.position)||dr(i)&&!t&&Or(e,i))?o=o.filter(e=>e!==i):r=n,i=_r(i)}return n.set(e,o),o}(n,this._c):[].concat(t),o],i=l[0],a=l.reduce((e,t)=>{const o=Ar(n,t,r);return e.top=So(o.top,e.top),e.right=Io(o.right,e.right),e.bottom=Io(o.bottom,e.bottom),e.left=So(o.left,e.left),e},Ar(n,i,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Vr,getElementRects:function(e){return d(this,null,function*(){const n=this.getOffsetParent||Vr,t=this.getDimensions,o=yield t(e.floating);return{reference:zr(e.reference,yield n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:n,height:t}=Lr(e);return{width:n,height:t}},getScale:Sr,isElement:ir,isRTL:function(e){return"rtl"===br(e).direction}};function Kr(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Fr(e,n,t,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:l=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:d=!1}=o,u=Ir(e),m=r||l?[...u?Br(u):[],...Br(n)]:[];m.forEach(e=>{r&&e.addEventListener("scroll",t,{passive:!0}),l&&e.addEventListener("resize",t)});const h=u&&c?function(e,n){let t,o=null;const r=rr(e);function l(){var e;clearTimeout(t),null==(e=o)||e.disconnect(),o=null}return function i(c,d){void 0===c&&(c=!1),void 0===d&&(d=1),l();const u=e.getBoundingClientRect(),{left:m,top:h,width:p,height:f}=u;if(c||n(),!p||!f)return;const v={rootMargin:-jo(h)+"px "+-jo(r.clientWidth-(m+p))+"px "+-jo(r.clientHeight-(h+f))+"px "+-jo(m)+"px",threshold:So(0,Io(1,d))||1};let g=!0;function w(n){const o=n[0].intersectionRatio;if(o!==d){if(!g)return i();o?i(!1,o):t=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||Kr(u,e.getBoundingClientRect())||i(),g=!1}try{o=new IntersectionObserver(w,s(a({},v),{root:r.ownerDocument}))}catch(y){o=new IntersectionObserver(w,v)}o.observe(e)}(!0),l}(u,t):null;let p,f=-1,v=null;i&&(v=new ResizeObserver(e=>{let[o]=e;o&&o.target===u&&v&&(v.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(n)})),t()}),u&&!d&&v.observe(u),v.observe(n));let g=d?$r(e):null;return d&&function n(){const o=$r(e);g&&!Kr(g,o)&&t(),g=o,p=requestAnimationFrame(n)}(),t(),()=>{var e;m.forEach(e=>{r&&e.removeEventListener("scroll",t),l&&e.removeEventListener("resize",t)}),null==h||h(),null==(e=v)||e.disconnect(),v=null,d&&cancelAnimationFrame(p)}}const Ur=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn(n){return d(this,null,function*(){const{x:t,y:o,placement:r,platform:l}=n,i=Ao(e,n),{mainAxis:d=!0,crossAxis:u=!1,limiter:m={fn:e=>{let{x:n,y:t}=e;return{x:n,y:t}}}}=i,h=c(i,["mainAxis","crossAxis","limiter"]),p={x:t,y:o},f=yield l.detectOverflow(n,h),v=Wo(Oo(r)),g=Po(v);let w=p[g],y=p[v];if(d){const e="y"===g?"bottom":"right";w=Ro(w+f["y"===g?"top":"left"],w,w-f[e])}if(u){const e="y"===v?"bottom":"right";y=Ro(y+f["y"===v?"top":"left"],y,y-f[e])}const k=m.fn(s(a({},n),{[g]:w,[v]:y}));return s(a({},k),{data:{x:k.x-t,y:k.y-o,enabled:{[g]:d,[v]:u}}})})}}},Xr=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn(n){return d(this,null,function*(){var t,o;const{placement:r,middlewareData:l,rects:i,initialPlacement:a,platform:s,elements:d}=n,u=Ao(e,n),{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0}=u,w=c(u,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if(null!=(t=l.arrow)&&t.alignmentOffset)return{};const y=Oo(r),k=Wo(a),x=Oo(a)===a,b=yield null==s.isRTL?void 0:s.isRTL(d.floating),M=p||(x||!g?[Zo(a)]:function(e){const n=Zo(e);return[Fo(e),n,Fo(n)]}(a)),_="none"!==v;!p&&_&&M.push(...function(e,n,t,o){const r=zo(e);let l=function(e,n,t){switch(e){case"top":case"bottom":return t?n?Xo:Uo:n?Uo:Xo;case"left":case"right":return n?qo:Go;default:return[]}}(Oo(e),"start"===t,o);return r&&(l=l.map(e=>e+"-"+r),n&&(l=l.concat(l.map(Fo)))),l}(a,g,v,b));const C=[a,...M],B=yield s.detectOverflow(n,w),T=[];let L=(null==(o=l.flip)?void 0:o.overflows)||[];if(m&&T.push(B[y]),h){const e=function(e,n,t){void 0===t&&(t=!1);const o=zo(e),r=Ko(e),l=Do(r);let i="x"===r?o===(t?"end":"start")?"right":"left":"start"===o?"bottom":"top";return n.reference[l]>n.floating[l]&&(i=Zo(i)),[i,Zo(i)]}(r,i,b);T.push(B[e[0]],B[e[1]])}if(L=[...L,{placement:r,overflows:T}],!T.every(e=>e<=0)){var I,S;const e=((null==(I=l.flip)?void 0:I.index)||0)+1,n=C[e];if(n&&("alignment"!==h||k===Wo(n)||L.every(e=>Wo(e.placement)!==k||e.overflows[0]>0)))return{data:{index:e,overflows:L},reset:{placement:n}};let t=null==(S=L.filter(e=>e.overflows[0]<=0).sort((e,n)=>e.overflows[1]-n.overflows[1])[0])?void 0:S.placement;if(!t)switch(f){case"bestFit":{var E;const e=null==(E=L.filter(e=>{if(_){const n=Wo(e.placement);return n===k||"y"===n}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,n)=>e+n,0)]).sort((e,n)=>e[1]-n[1])[0])?void 0:E[0];e&&(t=e);break}case"initialPlacement":t=a}if(r!==t)return{reset:{placement:t}}}return{}})}}},qr={class:"markstream-vue"},Gr=["id"],Zr=/* @__PURE__ */ee(/* @__PURE__ */p({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(e){const n=e,t=B(()=>{if(void 0!==n.isDark&&null!==n.isDark)return Boolean(n.isDark);if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0;if((null==window?void 0:window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(e){}return!1}),o=T(null),r=T({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=T(!1);let i=null;function c(){return d(this,null,function*(){var e,t;if(!n.anchorEl||!o.value)return;const l=[(u=null!=(e=n.offset)?e:8,void 0===u&&(u=0),{name:"offset",options:u,fn(e){return d(this,null,function*(){var n,t;const{x:o,y:r,placement:l,middlewareData:i}=e,c=yield function(e,n){return d(this,null,function*(){const{placement:t,platform:o,elements:r}=e,l=yield null==o.isRTL?void 0:o.isRTL(r.floating),i=Oo(t),a=zo(t),s="y"===Wo(t),c=er.has(i)?-1:1,d=l&&s?-1:1,u=Ao(n,e);let{mainAxis:m,crossAxis:h,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),s?{x:h*d,y:m*c}:{x:m*c,y:h*d}})}(e,u);return l===(null==(n=i.offset)?void 0:n.placement)&&null!=(t=i.arrow)&&t.alignmentOffset?{}:{x:o+c.x,y:r+c.y,data:s(a({},c),{placement:l})}})}}),Xr(),Ur({padding:8})],{x:i,y:c}=yield((e,n,t)=>{const o=/* @__PURE__ */new Map,r=a({platform:Wr},t),l=s(a({},r.platform),{_c:o});return((e,n,t)=>d(null,null,function*(){const{placement:o="bottom",strategy:r="absolute",middleware:l=[],platform:i}=t,c=l.filter(Boolean),d=yield null==i.isRTL?void 0:i.isRTL(n);let u=yield i.getElementRects({reference:e,floating:n,strategy:r}),{x:m,y:h}=Jo(u,o,d),p=o,f={},v=0;for(let t=0;t<c.length;t++){var g;const{name:l,fn:w}=c[t],{x:y,y:k,data:x,reset:b}=yield w({x:m,y:h,initialPlacement:o,placement:p,strategy:r,middlewareData:f,rects:u,platform:s(a({},i),{detectOverflow:null!=(g=i.detectOverflow)?g:Qo}),elements:{reference:e,floating:n}});m=null!=y?y:m,h=null!=k?k:h,f=s(a({},f),{[l]:a(a({},f[l]),x)}),b&&v<=50&&(v++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(u=!0===b.rects?yield i.getElementRects({reference:e,floating:n,strategy:r}):b.rects),({x:m,y:h}=Jo(u,p,d))),t=-1)}return{x:m,y:h,placement:p,strategy:r,middlewareData:f}}))(e,n,s(a({},r),{platform:l}))})(n.anchorEl,o.value,{placement:null!=(t=n.placement)?t:"top",middleware:l,strategy:"fixed"});var u;r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(c)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return L(()=>n.visible,e=>d(null,null,function*(){if(e)if(l.value=!1,yield G(),n.anchorEl&&o.value)try{const e=n.anchorEl.getBoundingClientRect();yield c();const t=r.value.transform;if(null!=n.originX&&null!=n.originY){const o=Math.abs(Number(n.originX)-e.left),i=Math.abs(Number(n.originY)-e.top);Math.hypot(o,i)>120?(r.value.transform=`translate3d(${Math.round(n.originX)}px, ${Math.round(n.originY)}px, 0)`,yield G(),l.value=!0,yield G(),r.value.transform=t):l.value=!0}else l.value=!0;i=Fr(n.anchorEl,o.value,c)}catch(t){yield c(),l.value=!0,i=Fr(n.anchorEl,o.value,c)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),L([()=>n.anchorEl,()=>n.placement,()=>n.content],()=>d(null,null,function*(){n.visible&&n.anchorEl&&o.value&&(yield G(),yield c())})),S(()=>{i&&i()}),(i,a)=>(v(),V(J,{to:"body"},[k("div",qr,[w(R,{name:"tooltip",appear:""},{default:A(()=>[Z(k("div",{id:n.id,ref_key:"tooltip",ref:o,style:O({position:"fixed",left:r.value.left,top:r.value.top,transform:r.value.transform}),class:E(["z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",[t.value?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"]]),role:"tooltip"},M(e.content),15,Gr),[[Y,e.visible&&l.value]])]),_:1})])]))}}),[["__scopeId","data-v-d524cc01"]]),Yr=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:Zr},Symbol.toStringTag,{value:"Module"}));function Jr(e){return JSON.stringify(e)}function Qr(e){var n;const t=null!=(n=e.mode)?n:"classic",o=e.katexUrl,r=e.mhchemUrl,l=Jr(a({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=Jr(o),s=r?Jr(r):'""';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(${i})\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 = ${l}\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(${i})\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 = ${l}\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 el(e){var n,t;const o=Qr(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const c="module"===(null!=(n=e.mode)?n:"classic")?s(a({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,d=new Worker(l,c);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(u){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(u){}}},source:o}}Zr.install=e=>{e.component(Zr.__name,Zr)};let nl=null,tl=null,ol=!1;const rl=/* @__PURE__ */new Map,ll=/* @__PURE__ */new Map;let il=5;const al=/* @__PURE__ */new Set;function sl(){if(rl.size<il&&al.size){const n=Array.from(al);al.clear();for(const t of n)try{t()}catch(e){}}}function cl(e){nl=e,tl=null,nl.onmessage=e=>{const{id:n,html:t,error:o}=e.data,r=rl.get(n);if(r)if(rl.delete(n),clearTimeout(r.timeoutId),sl(),o)r.reject(new Error(o));else{const{content:n,displayMode:o}=e.data;if(n){const e=`${o?"d":"i"}:${n}`;if(ll.set(e,t),ll.size>200){const e=ll.keys().next().value;ll.delete(e)}}r.resolve(t)}},nl.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[n,t]of rl.entries())clearTimeout(t.timeoutId),t.reject(new Error(`Worker error: ${e.message}`));rl.clear(),sl()}}function dl(){var e;nl&&(null==(e=nl.terminate)||e.call(nl)),nl=null,tl=null}function ul(e){ol=!!e,nl&&nl.postMessage({type:"init",debug:ol})}function ml(e,n=!0,t=2e3,o){return d(this,null,function*(){if(performance.now(),!Cn()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(tl)return Promise.reject(tl);const r=`${n?"d":"i"}:${e}`,l=ll.get(r);if(l)return Promise.resolve(l);const i=nl||(tl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),tl.name="WorkerInitError",tl.code="WORKER_INIT_ERROR",null);if(!i)return Promise.reject(tl);if(rl.size>=il){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=rl.size,e.max=il,Promise.reject(e)}return new Promise((r,l)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void l(e)}const a=Math.random().toString(36).slice(2),s=globalThis.setTimeout(()=>{rl.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",l(e),sl()},t);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(s),rl.has(a)&&rl.delete(a);const e=new Error("Aborted");e.name="AbortError",l(e),sl()},{once:!0});const c=r,d=l;rl.set(a,{resolve:e=>{c(e)},reject:e=>{d(e)},timeoutId:s}),i.postMessage({id:a,content:e,displayMode:n})})})}function hl(e,n=!0,t){const o=`${n?"d":"i"}:${e}`;if(ll.set(o,t),ll.size>200){const e=ll.keys().next().value;ll.delete(e)}}function pl(){return{inFlight:rl.size,max:il}}function fl(e){Number.isFinite(e)&&e>0&&(il=Math.floor(e))}const vl="WORKER_BUSY";function gl(){return rl.size>=il}function wl(e=2e3,n){return rl.size<il?Promise.resolve():new Promise((t,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),al.delete(i),t())};if(al.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,al.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>sl()),n){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),al.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};n.aborted?e():n.addEventListener("abort",e,{once:!0})}})}const yl={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function kl(e){null!=e.timeout&&(yl.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(yl.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(yl.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(yl.maxRetries=Math.max(0,Math.floor(e.maxRetries)))}function xl(){return a({},yl)}function bl(e){return d(this,arguments,function*(e,n=!0,t={}){var o,r,l,i;if(!Cn()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=t.timeout)?o:yl.timeout,s=null!=(r=t.waitTimeout)?r:yl.waitTimeout,c=null!=(l=t.backoffMs)?l:yl.backoffMs,d=null!=(i=t.maxRetries)?i:yl.maxRetries,u=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):yl.maxRetries,m=t.signal;let h=0;for(;;){if(null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield ml(e,n,a,m)}catch(p){if((null==p?void 0:p.code)!==vl||h>=u)throw p;if(h++,yield wl(s,m).catch(()=>{}),null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}c>0&&(yield new Promise(e=>globalThis.setTimeout(e,c*h)))}}})}function Ml(e){return JSON.stringify(e)}function _l(e){var n;const t=null!=(n=e.mode)?n:"module",o=Ml(e.mermaidUrl),r=`\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(${Ml(a({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${r}\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${r}\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 Cl(e){var n,t;const o=_l(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const c="module"===(null!=(n=e.mode)?n:"module")?s(a({},null!=(t=e.workerOptions)?t:{}),{type:"module"}):e.workerOptions,d=new Worker(l,c);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(u){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(u){}}},source:o}}let Bl=null,Tl=null;const Ll=/* @__PURE__ */new Map;let Il=5,Sl=!1;function El(e){Sl=!!e}function jl(e){Number.isFinite(e)&&e>0&&(Il=Math.floor(e))}function $l(){return{inFlight:Ll.size,max:Il}}const Nl="WORKER_BUSY",Hl="MERMAID_DISABLED";function Rl(e){Bl=e,Tl=null;const n=e;Bl.onmessage=e=>{if(Bl!==n)return;const{id:t,ok:o,result:r,error:l}=e.data,i=Ll.get(t);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Bl.onerror=e=>{var t,o;if(Bl===n)if(0!==Ll.size){try{Sl?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(r){}for(const[n,t]of Ll.entries())t.reject(new Error(`Worker error: ${e.message}`));Ll.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Bl.onmessageerror=e=>{var t,o;if(Bl===n)if(0!==Ll.size){try{Sl?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(r){}for(const[e,n]of Ll.entries())n.reject(new Error("Worker messageerror"));Ll.clear()}else null==(t=console.debug)||t.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}}function Al(){var e;if(Bl)try{for(const[e,n]of Ll.entries())n.reject(new Error("Worker cleared"));Ll.clear(),null==(e=Bl.terminate)||e.call(Bl)}catch(n){}Bl=null,Tl=null}function Ol(e,n,t=1400){if(!Co()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=Hl,Promise.reject(e)}if(Tl)return Promise.reject(Tl);const o=Bl||(Tl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Tl.name="WorkerInitError",Tl.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Tl);if(Ll.size>=Il){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Nl,e.inFlight=Ll.size,e.max=Il,Promise.reject(e)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const c=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),Ll.delete(i))},d={resolve:e=>{c(),r(e)},reject:e=>{c(),l(e)}};Ll.set(i,d);try{o.postMessage({id:i,action:e,payload:n})}catch(u){return Ll.delete(i),void l(u)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const n=Ll.get(i);n&&n.reject(e)},t)})}function zl(e,n,t=1400){return d(this,null,function*(){try{return yield Ol("canParse",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function Pl(e,n,t=1400){return d(this,null,function*(){try{return yield Ol("findPrefix",{code:e,theme:n},t)}catch(o){return Promise.reject(o)}})}function Dl(){if(Bl)try{for(const[e,n]of Ll.entries())n.reject(new Error("Worker terminated"));Ll.clear(),Bl.terminate()}finally{Bl=null}}const Vl=D(()=>import("./index4.js")),Wl=D(()=>import("./index3.js")),Kl=D(()=>import("./index2.js")),Fl=D(()=>import("./index5.js")),Ul=D(()=>import("./index6.js")),Xl={AdmonitionNode:Dt,BlockquoteNode:ne,CheckboxNode:re,CodeBlockNode:Vl,DefinitionListNode:se,EmojiNode:de,EmphasisNode:nt,FootnoteNode:it,FootnoteReferenceNode:xe,FootnoteAnchorNode:ot,HardBreakNode:st,HeadingNode:dt,HtmlBlockNode:ft,HtmlInlineNode:Oe,HighlightNode:Qn,ImageNode:fn,InfographicBlockNode:Ul,InlineCodeNode:Pe,PreCodeNode:kt,InsertNode:Yn,LinkNode:Gn,ListItemNode:ut,ListNode:mt,MathBlockNode:Wl,MathInlineNode:Kl,MermaidBlockNode:Fl,ParagraphNode:gt,StrikethroughNode:Wn,StrongNode:Dn,SubscriptNode:zn,SuperscriptNode:Rn,TableNode:Bt,TextNode:Sn,ThematicBreakNode:Lt,VmrContainerNode:Et,ReferenceNode:$n,MarkdownCodeBlockNode:wo},ql={install(e,n){Object.entries(Xl).forEach(([n,t])=>{e.component(n,t)}),(null==n?void 0:n.getLanguageIcon)&&Xt(n.getLanguageIcon),(null==n?void 0:n.mathOptions)&&h(n.mathOptions)}};export{Fl as $,Dt as A,ne as B,re as C,se as D,de as E,ot as F,ve as G,st as H,dt as I,Qn as J,ft as K,Oe as L,fn as M,Ul as N,Pe as O,Yn as P,Cn as Q,Co as R,Gn as S,ut as T,mt as U,wo as V,vl as W,Nt as X,Wl as Y,Kl as Z,ee as _,an as a,gt as a0,$n as a1,ge as a2,fe as a3,on as a4,bn as a5,bo as a6,Wn as a7,Dn as a8,zn as a9,Hl as aA,Rl as aB,Al as aC,Rn as aa,Bt as ab,Sn as ac,Lt as ad,Zr as ae,Et as af,ql as ag,Xt as ah,Qr as ai,el as aj,cl as ak,dl as al,ul as am,ml as an,pl as ao,fl as ap,gl as aq,wl as ar,kl as as,xl as at,_l as au,Cl as av,El as aw,jl as ax,$l as ay,Nl as az,Yt as b,kt as c,bl as d,Bn as e,hl as f,Ft as g,nn as h,Lo as i,zl as j,Pl as k,Jt as l,we as m,Gt as n,Vl as o,_n as p,_o as q,Zt as r,en as s,Dl as t,rn as u,nt as v,Mn as w,Mo as x,it as y,xe as z};
|