markstream-vue2 0.0.1

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.create;var e,t=Object.defineProperty,n=Object.defineProperties,o=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors),r=(Object.getOwnPropertyNames,Object.getOwnPropertySymbols),l=(Object.getPrototypeOf,Object.prototype.hasOwnProperty),i=Object.prototype.propertyIsEnumerable,a=(e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,s=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&a(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&a(e,n,t[n]);return e},u=(e,t)=>n(e,o(t)),d=(e,t,n)=>new Promise((o,r)=>{var l=e=>{try{a(n.next(e))}catch(t){r(t)}},i=e=>{try{a(n.throw(e))}catch(t){r(t)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(l,i);a((n=n.apply(e,t)).next())});const c=require("stream-markdown-parser"),p=require("vue");var m="undefined"!=typeof document?document.currentScript:null;function v(e,t,n,o,r,l,i,a){var s,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),o&&(u.functional=!0),l&&(u._scopeId="data-v-"+l),i?(s=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=s):r&&(s=a?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),s)if(u.functional){u._injectStyles=s;var d=u.render;u.render=function(e,t){return s.call(t),d(e,t)}}else{var c=u.beforeCreate;u.beforeCreate=c?[].concat(c,s):[s]}return{exports:e,options:u}}const h=v(p.defineComponent({__name:"BlockquoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},setup:e=>({__sfc:!0,props:e,NodeRenderer:Le})}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("blockquote",{staticClass:"blockquote",attrs:{dir:"auto",cite:e.node.cite}},[t(n.NodeRenderer,{attrs:{"index-key":`blockquote-${n.props.indexKey}`,nodes:n.props.node.children||[],"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)},[],!1,null,"6d8bbd17",null,null).exports,f=v(p.defineComponent({__name:"CheckboxNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"checkbox-node"},[t("input",{staticClass:"checkbox-input",attrs:{type:"checkbox",disabled:""},domProps:{checked:e.node.checked}})])},[],!1,null,"8dc6c46f",null,null).exports,g=v(p.defineComponent({__name:"DefinitionListNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup:e=>({__sfc:!0,props:e,NodeRenderer:Le})}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("dl",{staticClass:"definition-list"},[e._l(n.props.node.items,function(o,r){return[t("dt",{key:`definition-term-${n.props.indexKey}-${r}`,staticClass:"definition-term"},[t(n.NodeRenderer,{attrs:{"index-key":`definition-term-${n.props.indexKey}-${r}`,nodes:o.term,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1),t("dd",{key:`definition-desc-${n.props.indexKey}-${r}`,staticClass:"definition-desc"},[t(n.NodeRenderer,{attrs:{"index-key":`definition-desc-${n.props.indexKey}-${r}`,nodes:o.definition,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)]})],2)},[],!1,null,"b5d9dc8e",null,null).exports,w=v(p.defineComponent({__name:"EmojiNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"emoji-node"},[e._v(e._s(e.node.name))])},[],!1,null,"de55dc97",null,null).exports,y="__global__",x={};function k(e){return e?x[e]||x[y]||{}:x[y]||{}}const b=v(p.defineComponent({__name:"FootnoteReferenceNode",props:{node:null},setup(e){const t=e,n=`#footnote-${t.node.id}`;return{__sfc:!0,props:t,href:n,handleScroll:function(){if("undefined"==typeof document)return;const e=document.querySelector(n);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sup",{staticClass:"footnote-reference",attrs:{id:`fnref-${e.node.id}`},on:{click:n.handleScroll}},[t("span",{staticClass:"footnote-link cursor-pointer",attrs:{href:n.href,title:`查看脚注 ${e.node.id}`}},[e._v("["+e._s(e.node.id)+"]")])])},[],!1,null,"01af0fee",null,null).exports,C=v(p.defineComponent({__name:"HtmlInlineNode",props:{node:null},setup(e){const t=e,n=p.ref(null),o="undefined"!=typeof window;function r(){if(!o||!n.value)return;const e=n.value;e.innerHTML="";const r=document.createElement("template");r.innerHTML=t.node.content,e.appendChild(r.content.cloneNode(!0))}function l(){if(!n.value)return;const e=n.value;e.innerHTML="",e.textContent=t.node.content}return p.onMounted(()=>{t.node.loading&&!t.node.autoClosed?l():r()}),p.watch(()=>[t.node.content,t.node.loading,t.node.autoClosed],()=>{t.node.loading&&!t.node.autoClosed?l():r()}),p.onBeforeUnmount(()=>{n.value&&(n.value.innerHTML="")}),{__sfc:!0,props:t,containerRef:n,isClient:o,renderHtmlContent:r,renderLoadingContent:l}}}),function(){return(0,this._self._c)("span",{ref:"containerRef",staticClass:"html-inline-node",class:{"html-inline-node--loading":this._self._setupProxy.props.node.loading}})},[],!1,null,"e632756e",null,null).exports,_=v(p.defineComponent({__name:"InlineCodeNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("code",{staticClass:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-secondary whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},[e._v(e._s(e.node.code))])},[],!1,null,null,null,null).exports,M=p.ref(!1),B=p.ref(""),T=p.ref("top"),S=p.ref(null),L=p.ref(null),E=p.ref(null),R=p.ref(null),I=p.ref(null);let N=null,P=null;function H(){N&&(clearTimeout(N),N=null),P&&(clearTimeout(P),P=null)}let D=!1,j=null;function $(e,t,n="top",o=!1,r,l){if(!e)return;D||"undefined"!=typeof document&&(j||(j=Promise.resolve().then(()=>require("./Tooltip.js")).then(({default:e})=>{D=!0;const t=document.createElement("div");t.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(t),(new(p.extend({render(t){var n;return t(e,{props:{visible:M.value,anchorEl:S.value,content:B.value,placement:T.value,id:L.value,originX:E.value,originY:R.value,isDark:null!=(n=I.value)?n:void 0}})}}))).$mount(t)}).catch(e=>{j=null,D=!1,console.warn("[markstream-vue] Failed to load Tooltip component. Tooltips will be disabled.",e)}))),H();const i=()=>{var o,i;L.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,S.value=e,B.value=t,T.value=n,E.value=null!=(o=null==r?void 0:r.x)?o:null,R.value=null!=(i=null==r?void 0:r.y)?i:null,I.value="boolean"==typeof l?l:null,M.value=!0;try{e.setAttribute("aria-describedby",L.value)}catch(a){}};o?i():N=setTimeout(i,80)}function O(e=!1){H();const t=()=>{if(S.value&&L.value)try{S.value.removeAttribute("aria-describedby")}catch(e){}M.value=!1,S.value=null,L.value=null,E.value=null,R.value=null};e?t():P=setTimeout(t,120)}const z={"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 A(){try{const t=globalThis.$vueI18nUse||null;if(t&&"function"==typeof t)try{const e=t();if(e&&"function"==typeof e.t)return{t:e.t.bind(e)}}catch(e){}}catch(e){}return{t:e=>{var t;return null!=(t=z[e])?t: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 F=Symbol("ViewportPriority");function V(){const e=p.inject(F,void 0);if(e)return e;const t=new WeakMap;let n=null;return e=>{const o=p.ref(!1);let r,l=!1;const i=new Promise(e=>{r=()=>{l||(l=!0,e())}}),a=()=>{try{null==n||n.unobserve(e)}catch(o){}t.delete(e)},s=n||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(n=new IntersectionObserver(e=>{for(const r of e){const e=t.get(r.target);if(e&&(r.isIntersecting||r.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(o){}}null==n||n.unobserve(r.target),t.delete(r.target)}}},{root:null,rootMargin:"300px",threshold:0}),n));return s?(t.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 W=v(p.defineComponent({__name:"ImageNode",props:{node:null,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:t}){const n=e,o=p.ref(!1),r=p.ref(!1),l=p.ref(!1),i=p.ref(null),a=V();let s=null;const u=p.ref("undefined"==typeof window);"undefined"!=typeof window&&p.watch(()=>i.value,e=>{if(null==s||s.destroy(),s=null,!e)return void(u.value=!1);const t=a(e,{rootMargin:"400px"});s=t,u.value=t.isVisible.value,t.whenVisible.then(()=>{u.value=!0})},{immediate:!0}),p.onBeforeUnmount(()=>{null==s||s.destroy(),s=null});const d=p.computed(()=>r.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),c=p.computed(()=>!n.lazy||u.value),m=p.computed(()=>/\.svg(?:\?|$)/i.test(d.value)),{t:v}=A();return p.watch(d,()=>{o.value=!1,r.value=!1}),{__sfc:!0,props:n,emit:t,imageLoaded:o,hasError:r,fallbackTried:l,figureRef:i,registerVisibility:a,visibilityHandle:s,isVisible:u,displaySrc:d,canRenderImage:c,isSvg:m,handleImageError:function(){n.fallbackSrc&&!l.value?(l.value=!0,r.value=!0):(r.value=!0,t("error",n.node.src))},handleImageLoad:function(){o.value=!0,r.value=!1,t("load",d.value)},handleClick:function(e){e.preventDefault(),o.value&&!r.value&&t("click",[e,d.value])},t:v}}}),function(){var e,t,n,o,r,l=this,i=l._self._c,a=l._self._setupProxy;return i("figure",{ref:"figureRef",staticClass:"text-center my-8"},[i("div",{staticClass:"relative inline-block"},[i("transition",{attrs:{name:"img-switch",mode:"out-in"}},[l.node.loading||a.hasError||!a.canRenderImage?a.hasError?l.node.loading||a.props.fallbackSrc?l._e():i("div",{key:"error",staticClass:"px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},[l._t("error",function(){return[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"}},[i("path",{attrs:{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"}})]),i("span",{staticClass:"text-sm whitespace-nowrap"},[l._v(l._s(a.t("image.loadError")))])]},{node:a.props.node,displaySrc:a.displaySrc,imageLoaded:a.imageLoaded,hasError:a.hasError,fallbackSrc:a.props.fallbackSrc,lazy:a.props.lazy,isSvg:a.isSvg})],2):i("div",{key:"placeholder",staticClass:"placeholder-layer max-w-96 inline-flex items-center justify-center gap-2",style:a.isSvg?{minHeight:a.props.svgMinHeight,width:"100%"}:{minHeight:"6rem"}},[a.props.usePlaceholder?[l._t("placeholder",function(){return[i("div",{staticClass:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin",attrs:{"aria-hidden":"true"}}),i("span",{staticClass:"text-sm whitespace-nowrap"},[l._v(l._s(a.t("image.loading")))])]},{node:a.props.node,displaySrc:a.displaySrc,imageLoaded:a.imageLoaded,hasError:a.hasError,fallbackSrc:a.props.fallbackSrc,lazy:a.props.lazy,isSvg:a.isSvg})]:[i("span",{staticClass:"text-sm text-gray-500"},[l._v(l._s(l.node.raw))])]],2):i("img",{key:"image",staticClass:"max-w-96 h-auto rounded-lg transition-opacity duration-200 ease-in-out",class:{"opacity-0":!a.imageLoaded,"opacity-100":a.imageLoaded,"cursor-pointer":a.imageLoaded},style:a.isSvg?{minHeight:a.props.svgMinHeight,width:"100%",height:"auto",objectFit:"contain"}:void 0,attrs:{src:a.displaySrc,alt:String(null!=(t=null!=(e=a.props.node.alt)?e:a.props.node.title)?t:""),title:String(null!=(o=null!=(n=a.props.node.title)?n:a.props.node.alt)?o:""),loading:a.props.lazy?"lazy":"eager",decoding:"async",tabindex:a.imageLoaded?0:-1,"aria-label":null!=(r=a.props.node.alt)?r:a.t("image.preview")},on:{error:a.handleImageError,load:a.handleImageLoad,click:a.handleClick}})])],1),a.props.showCaption&&a.props.node.alt?i("figcaption",{staticClass:"mt-2 text-sm text-gray-500 italic"},[l._v(" "+l._s(a.props.node.alt)+" ")]):l._e()])},[],!1,null,"a5977223",null,null).exports;let K=null,U=!1,X=Z;function q(e){var t;const n=null!=(t=null==e?void 0:e.default)?t:e;return n&&"function"==typeof n.renderToString?n:null}function Y(){try{const e=globalThis;return q(null==e?void 0:e.katex)}catch(e){return null}}function Z(){return(()=>d(this,null,function*(){const e=Y();if(e)return e;const t=yield import("katex");try{yield import("katex/contrib/mhchem")}catch(n){}return q(t)}))()}function G(e){X=e,K=null,U=!1}function J(){return"function"==typeof X}function Q(){return d(this,null,function*(){var e;const t=Y();if(t)return K=t,K;if(K)return K;if(U)return null;const n=X;if(!n)return U=!0,null;try{const t=yield n();if(t)return K=null!=(e=q(t))?e:t,K}catch(o){}return U=!0,null})}const ee=p.shallowRef(!1);let te=null;function ne(){return te||(te=Q().then(e=>{ee.value=!!e}).catch(()=>{ee.value=!1})),p.readonly(ee)}const oe=v(p.defineComponent({__name:"TextNode",props:{node:null},emits:["copy"],setup:e=>({__sfc:!0,katexReady:ne()})}),function(){var e=this;return(0,e._self._c)("span",{staticClass:"whitespace-pre-wrap break-words text-node",class:[e._self._setupProxy.katexReady&&e.node.center?"text-node-center":""]},[e._v(" "+e._s(e.node.content)+" ")])},[],!1,null,"56f30838",null,null).exports;function re(e){return t=>{var n,o;return p.h(oe,u(s({},t),{node:u(s({},t.node),{content:null!=(o=t.node.raw)?o:e(String(null!=(n=t.node.content)?n:""))})}))}}function le(){return d(this,null,function*(){var e,t;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(t=null==(e=globalThis.process)?void 0:e.env)?void 0:t.NODE_ENV))return re(e=>`$${e}$`);try{if(yield Q())return(yield Promise.resolve().then(()=>require("./index.js"))).default}catch(n){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".',n)}return re(e=>`$${e}$`)})}function ie(){return d(this,null,function*(){try{if(yield Q())return(yield Promise.resolve().then(()=>require("./index2.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 re(e=>`$$${e}$$`)})}const ae=v(p.defineComponent({__name:"ReferenceNode",props:{node:null,messageId:null,threadId:null},emits:["click","mouseEnter","mouseLeave"],setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"reference-node cursor-pointer bg-accent text-xs rounded-md px-1.5 mx-0.5 hover:bg-secondary",attrs:{role:"button",tabindex:"0"},on:{click:function(t){return e.$emit("click",t,e.node.id,e.messageId,e.threadId)},mouseenter:function(t){return e.$emit("mouseEnter",t,e.node.id,e.messageId,e.threadId)},mouseleave:function(t){return e.$emit("mouseLeave",t,e.node.id,e.messageId,e.threadId)}}},[e._v(" "+e._s(e.node.id)+" ")])},[],!1,null,"b436f945",null,null).exports,se=v(p.defineComponent({__name:"SuperscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=k(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:oe,inline_code:_,link:pe,html_inline:C,strong:de,emphasis:he,footnote_reference:b,strikethrough:ce,highlight:ve,insert:me,subscript:ue,emoji:w,math_inline:le,reference:ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sup",{staticClass:"superscript-node"},[e._l(e.node.children,function(o,r){return[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{key:`${e.indexKey||"superscript"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"superscript"}-${r}`}}):t("span",{key:`${e.indexKey||"superscript"}-${r}`},[e._v(" "+e._s(o.content||o.raw)+" ")])]})],2)},[],!1,null,"3cc2c5de",null,null).exports,ue=v(p.defineComponent({__name:"SubscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=k(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:oe,inline_code:_,link:pe,html_inline:C,strong:de,emphasis:he,footnote_reference:b,strikethrough:ce,highlight:ve,insert:me,superscript:se,emoji:w,math_inline:le,reference:ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sub",{staticClass:"subscript-node"},[e._l(e.node.children,function(o,r){return[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{key:`${e.indexKey||"subscript"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"subscript"}-${r}`}}):t("span",{key:`${e.indexKey||"subscript"}-${r}`},[e._v(" "+e._s(o.content||o.raw)+" ")])]})],2)},[],!1,null,"a2b068c3",null,null).exports,de=v(p.defineComponent({__name:"StrongNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=k(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:oe,inline_code:_,link:pe,html_inline:C,emphasis:he,strikethrough:ce,highlight:ve,insert:me,subscript:ue,superscript:se,emoji:w,footnote_reference:b,math_inline:le,reference:ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("strong",{staticClass:"strong-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"strong"}-${r}`,tag:"component",attrs:{"index-key":`${e.indexKey||"strong"}-${r}`,node:o,"custom-id":n.props.customId}})}),1)},[],!1,null,"af3ce037",null,null).exports,ce=v(p.defineComponent({__name:"StrikethroughNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=k(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:oe,inline_code:_,link:pe,html_inline:C,strong:de,emphasis:he,highlight:ve,insert:me,subscript:ue,superscript:se,emoji:w,footnote_reference:b,math_inline:le,reference:ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("del",{staticClass:"strikethrough-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"strikethrough"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`}})}),1)},[],!1,null,"904d5bd1",null,null).exports,pe=v(p.defineComponent({__name:"LinkNode",props:{node:null,indexKey:null,customId:null,showTooltip:{type:Boolean,default:!0},color:null,underlineHeight:null,underlineBottom:null,animationDuration:null,animationOpacity:null,animationTiming:null,animationIteration:null},setup(e){const t=e,n=p.computed(()=>{var e,n,o,r,l,i;const a=void 0!==t.underlineBottom?"number"==typeof t.underlineBottom?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px";return{"--link-color":null!=(e=t.color)?e:"#0366d6","--underline-height":`${null!=(n=t.underlineHeight)?n:2}px`,"--underline-bottom":a,"--underline-opacity":String(null!=(o=t.animationOpacity)?o:.9),"--underline-duration":`${null!=(r=t.animationDuration)?r:.8}s`,"--underline-timing":null!=(l=t.animationTiming)?l:"linear","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),o={text:oe,strong:de,strikethrough:ce,emphasis:he,image:W,html_inline:C},r=p.useAttrs(),l=p.computed(()=>{var e,n;return String(null!=(n=null!=(e=t.node.title)?e:t.node.href)?n:"")});return{__sfc:!0,props:t,cssVars:n,nodeComponents:o,attrs:r,onAnchorEnter:function(e){var n,o,r;if(!t.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==(n=t.node)?void 0:n.title)||(null==(o=t.node)?void 0:o.href)||(null==(r=t.node)?void 0:r.text)||"";$(e.currentTarget,a,"top",!1,i)},onAnchorLeave:function(){t.showTooltip&&O()},title:l}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return e.node.loading?t("span",e._b({staticClass:"link-loading inline-flex items-baseline gap-1.5",style:n.cssVars,attrs:{"aria-hidden":e.node.loading?"false":"true"}},"span",n.attrs,!1),[t("span",{staticClass:"link-text-wrapper relative inline-flex"},[t("span",{staticClass:"leading-[normal] link-text"},[t("span",{staticClass:"leading-[normal] link-text"},[e._v(e._s(e.node.text))])]),t("span",{staticClass:"underline-anim",attrs:{"aria-hidden":"true"}})])]):t("a",e._b({staticClass:"link-node",style:n.cssVars,attrs:{href:e.node.href,title:e.showTooltip?"":n.title,"aria-label":`Link: ${n.title}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},on:{mouseenter:e=>n.onAnchorEnter(e),mouseleave:n.onAnchorLeave}},"a",n.attrs,!1),e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"emphasis"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"link-text"}-${r}`}})}),1)},[],!1,null,"c6e041bc",null,null).exports,me=v(p.defineComponent({__name:"InsertNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=k(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:oe,inline_code:_,link:pe,html_inline:C,strong:de,emphasis:he,strikethrough:ce,highlight:ve,subscript:ue,superscript:se,emoji:w,footnote_reference:b,math_inline:le,reference:ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("ins",{staticClass:"insert-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"insert"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"insert"}-${r}`}})}),1)},[],!1,null,"ab1ec9bc",null,null).exports,ve=v(p.defineComponent({__name:"HighlightNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=k(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:oe,inline_code:_,link:pe,html_inline:C,strong:de,emphasis:he,strikethrough:ce,insert:me,subscript:ue,superscript:se,emoji:w,footnote_reference:b,math_inline:le,reference:ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("mark",{staticClass:"highlight-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"highlight"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"highlight"}-${r}`}})}),1)},[],!1,null,"38e31bf6",null,null).exports,he=v(p.defineComponent({__name:"EmphasisNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=k(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:oe,inline_code:_,link:pe,html_inline:C,strong:de,strikethrough:ce,highlight:ve,insert:me,subscript:ue,superscript:se,emoji:w,footnote_reference:b,math_inline:le,reference:ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("em",{staticClass:"emphasis-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"emphasis"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`}})}),1)},[],!1,null,"8264674d",null,null).exports,fe=v(p.defineComponent({__name:"FootnoteAnchorNode",props:{node:null},setup(e){const t=e;return{__sfc:!0,props:t,scrollToReference:function(e){var n;if(e.preventDefault(),"undefined"==typeof document)return;const o=`fnref-${String(null!=(n=t.node.id)?n:"")}`,r=document.getElementById(o);r&&r.scrollIntoView({behavior:"smooth"})}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("a",{staticClass:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",attrs:{href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`},on:{click:n.scrollToReference}},[e._v(" ↩︎ ")])},[],!1,null,"4756ce0d",null,null).exports,ge=v(p.defineComponent({__name:"FootnoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup:e=>({__sfc:!0,props:e,NodeRenderer:Le})}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2",attrs:{id:`fnref--${e.node.id}`}},[t("div",{staticClass:"flex-1"},[t(n.NodeRenderer,{attrs:{"index-key":`footnote-${n.props.indexKey}`,nodes:n.props.node.children,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)])},[],!1,null,null,null,null).exports,we=v(p.defineComponent({__name:"HardBreakNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this._self._c;return this._self._setupProxy,e("br",{staticClass:"hard-break"})},[],!1,null,"50c58f70",null,null).exports,ye=v(p.defineComponent({__name:"HeadingNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=k(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:oe,inline_code:_,link:pe,image:W,strong:de,emphasis:he,strikethrough:ce,highlight:ve,insert:me,subscript:ue,superscript:se,emoji:w,checkbox:f,checkbox_input:f,footnote_reference:b,hardbreak:we,math_inline:le,reference:ae},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(`h${e.node.level}`,{tag:"component",staticClass:"heading-node",class:[`heading-${e.node.level}`],attrs:{dir:"auto"}},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"heading"}-${r}`,tag:"component",attrs:{"custom-id":n.props.customId,node:o,"index-key":`${e.indexKey||"heading"}-${r}`}})}),1)},[],!1,null,"ac93e8bf",null,null).exports,xe=v(p.defineComponent({__name:"ListItemNode",props:{item:null,indexKey:null,value:null,customId:null,typewriter:{type:Boolean}},setup(e){const t=e,n=p.computed(()=>null==t.value?{}:{value:t.value});return{__sfc:!0,props:t,liValueAttr:n,NodeRenderer:Le}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("li",e._b({staticClass:"list-item pl-1.5 my-2",attrs:{dir:"auto"}},"li",n.liValueAttr,!1),[t(n.NodeRenderer,{attrs:{"index-key":`list-item-${n.props.indexKey}`,nodes:n.props.item.children,"custom-id":n.props.customId,typewriter:n.props.typewriter,"batch-rendering":!1},on:{copy:function(t){return e.$emit("copy",t)}}})],1)},[],!1,null,"a690b83a",null,null).exports,ke=v(p.defineComponent({__name:"ListNode",props:{node:null,customId:null,indexKey:null,typewriter:{type:Boolean}},emits:["copy"],setup:e=>({__sfc:!0,ListItemNode:xe})}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(e.node.ordered?"ol":"ul",{tag:"component",staticClass:"list-node",class:{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}},e._l(e.node.items,function(o,r){var l;return t(n.ListItemNode,{key:`${e.indexKey||"list"}-${r}`,attrs:{item:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(l=e.node.start)?l:1)+r:void 0},on:{copy:function(t){return e.$emit("copy",t)}}})}),1)},[],!1,null,"d4344dd3",null,null).exports,be=v(p.defineComponent({__name:"ParagraphNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=k(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({inline_code:_,image:W,link:pe,hardbreak:we,emphasis:he,strong:de,strikethrough:ce,highlight:ve,insert:me,subscript:ue,superscript:se,html_inline:C,emoji:w,checkbox:f,math_inline:le,checkbox_input:f,reference:ae,footnote_anchor:fe,footnote_reference:b},n),katexReady:ne()}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("p",{staticClass:"paragraph-node",attrs:{dir:"auto"}},[e._l(e.node.children,function(o,r){return["text"!==o.type?t(n.nodeComponents[o.type],{key:`${e.indexKey||"paragraph"}-${r}`,tag:"component",attrs:{node:o,"index-key":`${e.indexKey}-${r}`,"custom-id":n.props.customId}}):t("span",{key:`${e.indexKey||"paragraph"}-${r}`,staticClass:"whitespace-pre-wrap break-words text-node",class:[n.katexReady&&o.center?"text-node-center":""]},[e._v(" "+e._s(o.content)+" ")])]})],2)},[],!1,null,"ab961ef3",null,null).exports,Ce=v(p.defineComponent({__name:"PreCodeNode",props:{node:null},setup(e){const t=e,n=p.computed(()=>{var e,n,o;const r=String(null!=(n=null==(e=t.node)?void 0:e.language)?n:"");return String(null!=(o=String(r).split(/\s+/g)[0])?o:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=p.computed(()=>`language-${n.value}`),r=p.computed(()=>{const e=n.value;return e?`Code block: ${e}`:"Code block"});return{__sfc:!0,props:t,normalizedLanguage:n,languageClass:o,ariaLabel:r}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("pre",{class:[n.languageClass],attrs:{"aria-busy":!0===e.node.loading,"aria-label":n.ariaLabel,"data-language":n.normalizedLanguage,tabindex:"0"}},[t("code",{attrs:{translate:"no"},domProps:{textContent:e._s(e.node.code)}})])},[],!1,null,null,null,null).exports,_e=v(p.defineComponent({__name:"TableNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=p.computed(()=>{var e,n,o,r;return null!=(r=null==(o=null==(n=null==(e=t.node)?void 0:e.header)?void 0:n.cells)?void 0:o.length)?r:0}),o=p.computed(()=>{const e=n.value||1,t=Math.floor(100/e);return Array.from({length:e}).map((n,o)=>o===e-1?100-t*(e-1)+"%":`${t}%`)}),r=p.computed(()=>{var e;return null!=(e=t.node.loading)&&e}),l=p.computed(()=>{var e;return null!=(e=t.node.rows)?e:[]});return{__sfc:!0,props:t,colCount:n,colWidths:o,isLoading:r,bodyRows:l,NodeRenderer:Le}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"table-node-wrapper"},[t("table",{staticClass:"w-full my-8 text-sm table-fixed table-node",class:{"table-node--loading":n.isLoading},attrs:{"aria-busy":n.isLoading}},[t("colgroup",e._l(n.colWidths,function(e,n){return t("col",{key:`col-${n}`,style:{width:e}})}),0),t("thead",{staticClass:"border-[var(--table-border,#cbd5e1)] border-solid"},[t("tr",{staticClass:"border-b border-solid"},e._l(e.node.header.cells,function(o,r){return t("th",{key:`header-${r}`,staticClass:"font-semibold p-[calc(4/7*1em)] overflow-x-auto",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.NodeRenderer,{attrs:{nodes:o.children,"index-key":`table-th-${n.props.indexKey}`,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),0)]),t("tbody",e._l(n.bodyRows,function(o,r){return t("tr",{key:`row-${r}`,staticClass:"border-[var(--table-border,#cbd5e1)] border-solid",class:[r<n.bodyRows.length-1?"border-b":""]},e._l(o.cells,function(o,l){return t("td",{key:`cell-${r}-${l}`,staticClass:"p-[calc(4/7*1em)] overflow-x-auto",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.NodeRenderer,{attrs:{nodes:o.children,"index-key":`table-td-${n.props.indexKey}`,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),0)}),0)]),t("transition",{attrs:{name:"table-node-fade"}},[n.isLoading?t("div",{staticClass:"table-node__loading",attrs:{role:"status","aria-live":"polite"}},[e._t("loading",function(){return[t("span",{staticClass:"table-node__spinner animate-spin",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"sr-only"},[e._v("Loading")])]},{isLoading:n.isLoading})],2):e._e()])],1)},[],!1,null,"b4186e85",null,null).exports,Me=v(p.defineComponent({__name:"ThematicBreakNode",setup:e=>({__sfc:!0})}),function(){var e=this._self._c;return this._self._setupProxy,e("hr",{staticClass:"hr-node"})},[],!1,null,"639cbad9",null,null).exports,Be=v(p.defineComponent({__name:"FallbackComponent",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"unknown-node"},[e._v(" "+e._s(e.node.raw)+" ")])},[],!1,null,"89aff01f",null,null).exports,Te=v(p.defineComponent({__name:"VmrContainerNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=p.computed(()=>`vmr-container vmr-container-${t.node.name}`),o=k(t.customId),r=s({text:oe,paragraph:be,heading:ye,inline_code:_,link:pe,image:W,strong:de,emphasis:he,strikethrough:ce,insert:me,subscript:ue,superscript:se,checkbox:f,checkbox_input:f,hardbreak:we,math_inline:le,reference:ae,list:ke,math_block:ie,table:_e},o);return{__sfc:!0,props:t,containerClass:n,overrides:o,nodeComponents:r,getNodeComponent:function(e){return r[e]||Be}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",e._b({class:n.containerClass},"div",e.node.attrs,!1),e._l(e.node.children,function(o,r){return t(n.getNodeComponent(o.type),{key:`${e.indexKey||"vmr-container"}-${r}`,tag:"component",attrs:{"custom-id":n.props.customId,node:o,"index-key":`${e.indexKey||"vmr-container"}-${r}`}})}),1)},[],!1,null,"841500ff",null,null).exports,Se=v(p.defineComponent({__name:"HtmlBlockNode",props:{node:null},setup(e){const t=e,n=p.computed(()=>{const e=t.node.attrs;if(e){if(Array.isArray(e)){const t={};for(const n of e){if(!n||n.length<2)continue;const[e,o]=n;null!=e&&(t[String(e)]=null==o?"":String(o))}return t}return e}}),o=p.ref(null),r=p.ref("undefined"==typeof window),l=p.ref(t.node.content),i=V();let a=null;const s=!!t.node.loading;return"undefined"!=typeof window?(p.watch(o,e=>{var n;if(null==(n=null==a?void 0:a.destroy)||n.call(a),a=null,!s)return r.value=!0,void(l.value=t.node.content);if(!e)return void(r.value=!1);const o=i(e,{rootMargin:"400px"});a=o,r.value=o.isVisible.value,o.whenVisible.then(()=>{r.value=!0})},{immediate:!0}),p.watch(()=>t.node.content,e=>{s&&!r.value||(l.value=e)})):r.value=!0,p.onBeforeUnmount(()=>{var e;null==(e=null==a?void 0:a.destroy)||e.call(a),a=null}),{__sfc:!0,props:t,boundAttrs:n,htmlRef:o,shouldRender:r,renderContent:l,registerVisibility:i,visibilityHandle:a,isDeferred:s}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",e._b({ref:"htmlRef",staticClass:"html-block-node"},"div",n.boundAttrs,!1),[n.shouldRender?t("div",{domProps:{innerHTML:e._s(n.renderContent)}}):t("div",{staticClass:"html-block-node__placeholder"},[e._t("placeholder",function(){return[t("span",{staticClass:"html-block-node__placeholder-bar"}),t("span",{staticClass:"html-block-node__placeholder-bar w-4/5"}),t("span",{staticClass:"html-block-node__placeholder-bar w-2/3"})]},{node:e.node})],2)])},[],!1,null,"e5cb9d3f",null,null).exports,Le=v(p.defineComponent({__name:"NodeRenderer",props:{content:null,nodes:null,final:{type:Boolean},parseOptions:null,customMarkdownIt:null,debugPerformance:{type:Boolean,default:!1},customHtmlTags:null,viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:null,renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockProps:null,themes:null,isDark:{type:Boolean},customId:null,indexKey:null,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:t}){var n,o,r;const l=e,i=p.ref(),a=p.ref(!1),v=/auto|scroll|overlay/i,y="undefined"!=typeof window,x=p.computed(()=>l.debugPerformance&&y&&"undefined"!=typeof console);function M(e,t){x.value&&console.info(`[markstream-vue][perf] ${e}`,t)}function B(e){if("undefined"==typeof window)return null;const t=null!=e?e:i.value;if(!t)return null;const n=t.ownerDocument||document,o=n.scrollingElement||n.documentElement;let r=t;for(;r&&r!==n.body&&r!==o;){const e=window.getComputedStyle(r),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(v.test(t)||v.test(n))return r;r=r.parentElement}return null}const T=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,S=c.getMarkdown(T),L=p.computed(()=>{const e=l.customHtmlTags;return e&&0!==e.length?c.getMarkdown(T,{customHtmlTags:e}):S}),E=p.computed(()=>{const e=L.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function R(e){const t=String(null!=e?e:"").trim();if(!t)return"";const n=t.match(/^[<\s/]*([A-Z][\w-]*)/i);return n?n[1].toLowerCase():""}const I=p.computed(()=>{var e,t,n,o;const r=null!=(e=l.parseOptions)?e:{},i=null!=(t=l.final)?t:r.final,a=[...null!=(n=l.customHtmlTags)?n:[],...null!=(o=r.customHtmlTags)?o:[]].map(R).filter(Boolean);return a.length?u(s({},r),{final:i,customHtmlTags:Array.from(new Set(a))}):null==i?r:u(s({},r),{final:i})}),N=p.computed(()=>{var e;if(null==(e=l.nodes)?void 0:e.length)return p.markRaw(l.nodes.slice());if(l.content){const e=x.value?performance.now():0,t=c.parseMarkdownToStructure(l.content,E.value,I.value);return x.value&&M("parse(sync)",{ms:Math.round(performance.now()-e),nodes:t.length,contentLength:l.content.length}),p.markRaw(t)}return[]}),P=p.computed(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),H=p.computed(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&N.value.length>P.value}),D=p.computed(()=>!1!==l.viewportPriority&&!a.value),j=function(e,t){const n="undefined"!=typeof window&&"undefined"!=typeof document,o="boolean"==typeof t?p.ref(t):t;let r=null,l=null;const i=new WeakMap,a=(t,a)=>{const u=p.ref(!1);let d,c=!1;const m=new Promise(e=>{d=()=>{c||(c=!0,e())}}),v=()=>{try{null==r||r.unobserve(t)}catch(e){}i.delete(t)};if(!n||!o.value)return u.value=!0,d(),{isVisible:u,whenVisible:m,destroy:v};!l&&a&&(l=s({},a));const h=function(t){var o,a,s;if(r||!n)return r;if("undefined"==typeof IntersectionObserver)return null;const u=null!=(o=null==e?void 0:e(null!=t?t:null))?o:null,d=l||{};return r=new IntersectionObserver(e=>{for(const n of e){const e=i.get(n.target);if(e&&(n.isIntersecting||n.intersectionRatio>0)){if(!e.visible.value){e.visible.value=!0;try{e.resolve()}catch(t){}}null==r||r.unobserve(n.target),i.delete(n.target)}}},{root:u,rootMargin:null!=(a=d.rootMargin)?a:"300px",threshold:null!=(s=d.threshold)?s:0}),r}(t);return h?(i.set(t,{resolve:d,visible:u}),h.observe(t),{isVisible:u,whenVisible:m,destroy:v}):(u.value=!0,d(),{isVisible:u,whenVisible:m,destroy:v})};return p.provide(F,a),a}(e=>{var t;return B(null!=(t=null!=e?e:i.value)?t:null)},D),$=y&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,O=y&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,z="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),A=y&&"function"==typeof window.requestIdleCallback,V=p.computed(()=>{var e;const t=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),K=p.computed(()=>{var e;const t=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:V.value);return Number.isFinite(t)?Math.max(0,t):V.value}),U=p.computed(()=>!1!==l.batchRendering&&V.value>0&&y&&!z),X=p.ref(0),q=p.ref({key:l.indexKey,total:0}),Y=p.ref(Math.max(1,V.value||1)),Z=p.reactive({}),G=new Map,J=new Map,Q=new Map,ee=p.ref(null);let te=null,ne=null;const re=p.reactive({start:0,end:0}),xe=p.computed(()=>{if(!H.value)return N.value.map((e,t)=>({node:e,index:t}));const e=N.value.length,t=Ye(re.start,0,e),n=Ye(re.end,t,e);return N.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),Le=p.computed(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!H.value&&!(N.value.length>900)&&D.value}),Re=p.computed(()=>{var e;return U.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),Ie=p.ref({batchSize:V.value,initial:K.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:Re.value}),Ne=p.computed(()=>!!j&&(Le.value||H.value)),Pe=p.computed(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),He=p.ref(0),De=new Map,je=p.getCurrentInstance();function $e(){var e,t,n,o;const r=null==je?void 0:je.proxy;if(!r||!r.$refs)return;const l=r.$refs,i=new Set;for(const a of xe.value){const r=null!=(e=l[`node-slot-${a.index}`])?e:null,s=null!=(t=l[`node-content-${a.index}`])?t:null;(null!=(n=Q.get(a.index))?n:null)!==r&&ut(a.index,r),(null!=(o=De.get(a.index))?o:null)!==s&&dt(a.index,s),i.add(a.index)}for(const a of Array.from(Q.keys()))i.has(a)||ut(a,null);for(const a of Array.from(De.keys()))i.has(a)||dt(a,null)}const Oe=p.computed(()=>{if(!H.value)return N.value.length;const e=Pe.value,t=Math.max(re.end+e,K.value),n=Math.min(N.value.length,t);return Math.max(X.value,n)});function ze(e){var t,n,o,r;const l=B(null!=(t=null!=e?e:i.value)?t:null);if(l)return l;const a=null!=(r=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(n=i.value)?void 0:n.ownerDocument)?r:"undefined"!=typeof document?document:null;return(null==a?void 0:a.scrollingElement)||(null==a?void 0:a.documentElement)||null}function Ae(e){if(!y)return!1;try{const t=window.getComputedStyle(e);return!!(t.display||"").toLowerCase().includes("flex")&&(t.flexDirection||"").toLowerCase().endsWith("reverse")}catch(t){return!1}}function Fe(e,t,n){var o,r,l,i,a,s;if(n)return null!=(i=null!=(l=null==(o=null==t?void 0:t.documentElement)?void 0:o.scrollTop)?l:null==(r=null==t?void 0:t.body)?void 0:r.scrollTop)?i:0;const u=e.scrollTop;if(!Ae(e))return u;const d=u<0?-u:u;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-d}function Ve(e,t){let n=e,o=0,r=0;for(;n&&n!==t&&r++<64;)o+=n.offsetTop||0,n=n.offsetParent;return o}function We(){te&&(te(),te=null),ee.value=null}function Ke(){if(!y||!H.value)return;const e=ze();if(!e||ee.value===e)return;We();const t=()=>Xe();e.addEventListener("scroll",t,{passive:!0}),ee.value=e,te=()=>{e.removeEventListener("scroll",t)}}function Ue(){var e,t,n;if(!ne)return;const o=null!=(n=null==(t=null==(e=i.value)?void 0:e.ownerDocument)?void 0:t.defaultView)?n:"undefined"!=typeof window?window:null;ne.viaTimeout?o?o.clearTimeout(ne.id):clearTimeout(ne.id):null==O||O(ne.id),ne=null}function Xe(e={}){var t,n,o;if(!H.value)return;if(!y)return void qe(!0);if(e.immediate)return Ue(),void qe(!0);if(ne)return;const r=()=>{ne=null,qe()};if($)ne={id:$(r),viaTimeout:!1};else{const e=null!=(o=null==(n=null==(t=i.value)?void 0:t.ownerDocument)?void 0:n.defaultView)?o:"undefined"!=typeof window?window:null,l=e?e.setTimeout(r,16):setTimeout(r,16);ne={id:l,viaTimeout:!0}}}function qe(e=!1){var t,n,o,r,l,a,s;if(!H.value)return;const u=ee.value||ze();if(!u)return;const d=u.ownerDocument||(null==(t=i.value)?void 0:t.ownerDocument)||document,c=(null==d?void 0:d.defaultView)||("undefined"!=typeof window?window:null),p=u===(null==d?void 0:d.documentElement)||u===(null==d?void 0:d.body),m=N.value.length;if(!p&&m>0&&Ae(u)){const t=u.clientHeight||0,n=u.scrollTop,o=n<0?-n:n,r=Ye(lt(Math.max(0,o)+.5*Math.max(0,t)),0,Math.max(0,m-1));return void((e||Math.abs(r-He.value)>1)&&(He.value=r))}const v=p?null:u.getBoundingClientRect(),h=p?0:v.top,f=p?null!=(o=null!=(n=null==c?void 0:c.innerHeight)?n:u.clientHeight)?o:0:v.bottom,g=Array.from(Q.entries()).sort((e,t)=>e[0]-t[0]);let w=null,y=null;for(const[i,k]of g){if(!k)continue;const e=k.getBoundingClientRect();e.bottom<=h||e.top>=f||(null==w&&(w=i),y=i)}if(null==w||null==y){const e=i.value;if(!e)return;const t=p?{top:0}:u.getBoundingClientRect(),n=Fe(u,d,p),o=p?(()=>{const n=e.getBoundingClientRect(),o=(p?0:t.top)-n.top;return Math.max(0,o)})():(()=>{const t=Ve(e,u);return Math.max(0,n-t)})(),m=p?null!=(s=null!=(a=null!=(l=null==c?void 0:c.innerHeight)?l:null==(r=null==d?void 0:d.documentElement)?void 0:r.clientHeight)?a:u.clientHeight)?s:0:u.clientHeight,v=rt(o+.5*Math.max(0,m));return void(He.value=Ye(v,0,Math.max(0,N.value.length-1)))}const x=Math.round((w+y)/2);!e&&Math.abs(x-He.value)<=1||(He.value=Ye(x,0,Math.max(0,N.value.length-1)))}function Ye(e,t,n){return Math.min(Math.max(e,t),n)}function Ze(){const e=N.value.length;if(!H.value||0===e)return re.start=0,void(re.end=e);const t=Math.min(P.value,e),n=Pe.value,o=Ye(He.value-n,0,Math.max(0,e-t));re.start=o,re.end=Math.min(e,o+t)}const Ge=p.reactive({}),Je=p.reactive({total:0,count:0});function Qe(e,t){if(!Number.isFinite(t)||t<=0)return;const n=Ge[e];Ge[e]=t,n?Je.total+=t-n:(Je.total+=t,Je.count++)}const et=p.computed(()=>Je.count>0?Math.max(12,Je.total/Je.count):32);function tt(e,t){var n;if(e>=t)return 0;let o=0;for(let r=e;r<t;r++)o+=null!=(n=Ge[r])?n:et.value;return o}const nt=p.computed(()=>H.value?tt(0,Math.min(re.start,N.value.length)):0),ot=p.computed(()=>{if(!H.value)return 0;const e=N.value.length;return tt(Math.min(re.end,e),e)});function rt(e){var t;if(e<=0)return 0;let n=e;const o=N.value;for(let r=0;r<o.length;r++){const e=null!=(t=Ge[r])?t:et.value;if(n<=e)return r;n-=e}return Math.max(0,o.length-1)}function lt(e){var t;const n=N.value;if(!n.length)return 0;if(e<=0)return Math.max(0,n.length-1);let o=e;for(let r=n.length-1;r>=0;r--){const e=null!=(t=Ge[r])?t:et.value;if(o<=e)return r;o-=e}return 0}function it(e){if(G.size&&H.value)for(const[t,n]of G)t>=e&&(n.destroy(),G.delete(t),Le.value&&delete Z[t],gt(t),Q.delete(t))}function at(e,t){Le.value&&(Z[e]=t),t&&(H.value?Xe():He.value=Ye(e,0,Math.max(0,N.value.length-1)))}function st(e){const t=G.get(e);t&&(t.destroy(),G.delete(e)),gt(e)}function ut(e,t){if(t?Q.set(e,t):Q.delete(e),t||gt(e),!Ne.value||!j)return st(e),void(t?at(e,!0):Le.value&&delete Z[e]);if(!H.value&&Le.value&&!a.value&&G.size>=640&&(yt("too-many-targets"),!Ne.value||!j))return st(e),void(t?at(e,!0):Le.value&&delete Z[e]);if(e<K.value&&!H.value)return st(e),void at(e,!0);if(!t)return st(e),void(Le.value&&delete Z[e]);st(e);const n=j(t,{rootMargin:"400px"});n&&(G.set(e,n),at(e,n.isVisible.value),Le.value&&wt(e),n.whenVisible.then(()=>{gt(e),at(e,!0)}).catch(()=>{}).finally(()=>{G.get(e)===n&&G.delete(e);try{n.destroy()}catch(t){}}),H.value&&Xe())}function dt(e,t){t?(De.set(e,t),queueMicrotask(()=>{Qe(e,t.offsetHeight)})):De.delete(e)}p.onMounted(()=>{y&&p.nextTick($e)}),p.watch(xe,()=>{y&&p.nextTick($e)}),p.watch(X,()=>{y&&p.nextTick($e)}),p.watch(H,()=>{y&&p.nextTick($e)});let ct=null,pt=null,mt=!1,vt=null,ht=null;function ft(){y&&(null!=ct&&(null==O||O(ct),ct=null),null!=pt&&(window.clearTimeout(pt),pt=null),null!=ht&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(ht),ht=null),mt=!1,vt=null)}function gt(e){if(!y)return;const t=J.get(e);null!=t&&(window.clearTimeout(t),J.delete(e))}function wt(e){if(!y||!Le.value)return;gt(e);const t=e%17*23,n=window.setTimeout(()=>{var t,n;if(J.delete(e),!Le.value)return;if(!0===Z[e])return;const o=Q.get(e);if(!o)return void delete Z[e];const r=ze(o),l=o.ownerDocument||document,i=l.defaultView||window,a=!r||r===l.documentElement||r===l.body,s=!a&&r?r.getBoundingClientRect():null,u=a?0:s.top,d=a?null!=(n=null!=(t=i.innerHeight)?t:null==r?void 0:r.clientHeight)?n:0:s.bottom,c=o.getBoundingClientRect();c.bottom>=u-500&&c.top<=d+500&&at(e,!0)},1800+t);J.set(e,n)}function yt(e){var t;if(!a.value){a.value=!0,void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:m&&"SCRIPT"===m.tagName.toUpperCase()&&m.src||new URL("exports.js",document.baseURI).href}&&(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV)&&"undefined"!=typeof console&&console.warn("[markstream-vue] viewportPriority auto-disabled:",e);for(const e of G.values())e.destroy();if(G.clear(),y)for(const e of J.values())window.clearTimeout(e);J.clear();for(const e of Object.keys(Z))delete Z[e]}}function xt(e,t={}){var n,o;if(!Re.value)return;const r=Oe.value;if(X.value>=r)return;const i=Math.max(1,e),a=e=>{var t;ct=null,pt=null,ht=null,mt=!1;const n=null!=vt?vt:i;vt=null;const o=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();X.value=Math.min(r,X.value+Math.max(1,e)),it(X.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return bt(n),n};let s=n;for(;(a(s),!(X.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(Y.value));X.value<r&&kt()};if(!y||t.immediate)return void a();const s=Math.max(0,null!=(n=l.renderBatchDelay)?n:16);if(vt=null!=vt?Math.max(vt,i):i,!mt){if(mt=!0,!z&&A&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(ht=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}$&&!z?ct=$(()=>{0!==s?pt=window.setTimeout(()=>a(),s):a()}):pt=window.setTimeout(()=>a(),s)}}function kt(){Re.value&&xt(U.value?Math.max(1,Math.round(Y.value)):Math.max(1,V.value))}function bt(e){var t;if(!Re.value)return;const n=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),o=Math.max(1,V.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*n?Y.value=Math.max(r,Math.floor(.7*Y.value)):e<.5*n&&Y.value<o&&(Y.value=Math.min(o,Math.ceil(1.2*Y.value)))}function Ct(){return d(this,null,function*(){try{return(yield Promise.resolve().then(()=>require("./index3.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),Ce}})}function _t(){return d(this,null,function*(){try{return(yield Promise.resolve().then(()=>require("./index4.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),Ce}})}p.watch([()=>N.value,()=>N.value.length,()=>Re.value,()=>V.value,()=>K.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const t=N.value.length,n=q.value,o=l.indexKey,r=void 0!==o&&o!==n.key,i=t!==n.total,a=r||i;q.value={key:o,total:t};const s=Ie.value,u=null!=(e=l.renderBatchDelay)?e:16,d=s.batchSize!==V.value||s.initial!==K.value||s.delay!==u||s.enabled!==Re.value;Ie.value={batchSize:V.value,initial:K.value,delay:u,enabled:Re.value},(a||d||!Re.value)&&ft(),(a||d)&&(Y.value=Math.max(1,V.value||1)),a&&H.value&&Xe({immediate:!0});const c=Oe.value;if(!t)return X.value=0,void it(0);if(!Re.value)return X.value=c,void it(X.value);const p=r||0===n.total;X.value=p||d?Math.min(c,K.value):Math.min(X.value,c);const m=Math.max(1,K.value||V.value||t);X.value<c?xt(m,{immediate:!y}):it(X.value)},{immediate:!0}),p.watch(()=>H.value,e=>{if(!e)return We(),void Ue();Ke(),Xe({immediate:!0})},{immediate:!0}),p.watch([()=>N.value.length,()=>H.value],e=>d(this,[e],function*([e,t]){t&&e&&y&&(yield p.nextTick(),Xe({immediate:!0}))}),{flush:"post"}),p.watch(()=>i.value,()=>{H.value&&(Ke(),Xe({immediate:!0}))}),p.watch(()=>N.value.length,()=>{H.value&&Xe({immediate:!0})}),p.watch(()=>Le.value,e=>{if(e)for(const[t,n]of Q)ut(t,n);else{for(const e of G.values())e.destroy();G.clear();for(const e of Array.from(J.keys()))gt(e);for(const e of Object.keys(Z))delete Z[e];for(const[e,t]of Q)t&&at(e,!0)}},{immediate:!1}),p.watch([()=>l.viewportPriority,()=>N.value.length],([e,t])=>{!1!==e?a.value&&t<=200&&(a.value=!1):a.value=!1}),p.watch(()=>X.value,()=>{H.value&&Xe({immediate:!0})}),p.watch([He,P,Pe,()=>N.value.length,H],()=>{Ze()},{immediate:!0}),p.watch([()=>N.value.length,H,P,Pe,()=>re.start,()=>re.end],([e,t,n,o,r,l])=>{x.value&&M("virtualization",{nodes:e,virtualization:t,maxLiveNodes:n,buffer:o,focusIndex:He.value,scroll:t?(()=>{const e=ee.value||ze();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:X.value})}),p.watch(()=>Oe.value,(e,t)=>{Re.value&&("number"==typeof t&&e<=t||e>X.value&&kt())}),p.onBeforeUnmount(()=>{ft();for(const e of G.values())e.destroy();G.clear();for(const e of Array.from(J.keys()))gt(e);We(),Ue()});const Mt=p.computed(()=>l.renderCodeBlocksAsPre?Ce:Ct),Bt={text:oe,paragraph:be,heading:ye,code_block:Ct,list:ke,blockquote:h,table:_e,definition_list:g,footnote:ge,footnote_reference:b,footnote_anchor:fe,admonition:Ee,vmr_container:Te,hardbreak:we,link:pe,image:W,thematic_break:Me,math_inline:le,math_block:ie,strong:de,emphasis:he,strikethrough:ce,highlight:ve,insert:me,subscript:ue,superscript:se,emoji:w,checkbox:f,checkbox_input:f,inline_code:_,html_inline:C,reference:ae,html_block:Se};return{__sfc:!0,props:l,emit:t,MAX_DEFERRED_NODE_COUNT:900,MAX_VIEWPORT_OBSERVER_TARGETS:640,VIEWPORT_PRIORITY_RECOVERY_COUNT:200,containerRef:i,viewportPriorityAutoDisabled:a,SCROLL_PARENT_OVERFLOW_RE:v,isClient:y,debugPerformanceEnabled:x,logPerf:M,resolveViewportRoot:B,instanceMsgId:T,defaultMd:S,mdBase:L,mdInstance:E,normalizeCustomTag:R,mergedParseOptions:I,parsedNodes:N,maxLiveNodesResolved:P,virtualizationEnabled:H,viewportPriorityEnabled:D,registerNodeVisibility:j,requestFrame:$,cancelFrame:O,isTestEnv:z,hasIdleCallback:A,resolvedBatchSize:V,resolvedInitialBatch:K,batchingEnabled:U,renderedCount:X,previousRenderContext:q,adaptiveBatchSize:Y,nodeVisibilityState:Z,nodeVisibilityHandles:G,nodeVisibilityFallbackTimers:J,nodeSlotElements:Q,scrollRootElement:ee,detachScrollHandler:te,pendingFocusSync:ne,liveRange:re,visibleNodes:xe,deferNodes:Le,incrementalRenderingActive:Re,previousBatchConfig:Ie,shouldObserveSlots:Ne,liveNodeBufferResolved:Pe,focusIndex:He,nodeContentElements:De,instance:je,syncNodeRefs:$e,desiredRenderedCount:Oe,resolveScrollContainer:ze,isReverseFlexScrollRoot:Ae,getNormalizedScrollTop:Fe,getOffsetTopWithinRoot:Ve,cleanupScrollListener:We,setupScrollListener:Ke,cancelScheduledFocusSync:Ue,scheduleFocusSync:Xe,syncFocusToScroll:qe,clamp:Ye,updateLiveRange:Ze,nodeHeights:Ge,heightStats:Je,recordNodeHeight:Qe,averageNodeHeight:et,estimateHeightRange:tt,topSpacerHeight:nt,bottomSpacerHeight:ot,estimateIndexForOffset:rt,estimateIndexForOffsetFromEnd:lt,cleanupNodeVisibility:it,markNodeVisible:at,shouldRenderNode:function(e){return!(Re.value&&e>=X.value)&&(!Le.value||e<K.value||!0===Z[e])},destroyNodeHandle:st,setNodeSlotElement:ut,setNodeContentRef:dt,batchRaf:ct,batchTimeout:pt,batchPending:mt,pendingIncrement:vt,batchIdle:ht,VIEWPORT_FALLBACK_DELAY:1800,VIEWPORT_FALLBACK_MARGIN_PX:500,cancelBatchTimers:ft,clearVisibilityFallback:gt,scheduleVisibilityFallback:wt,autoDisableViewportPriority:yt,scheduleBatch:xt,queueNextBatch:kt,adjustAdaptiveBatchSize:bt,CodeBlockNodeAsync:Ct,MermaidBlockNodeAsync:_t,codeBlockComponent:Mt,nodeComponents:Bt,getNodeComponent:function(e){var t;if(!e)return Be;const n=k(l.customId),o=n[String(e.type)];if("code_block"===e.type){if("mermaid"===String(null!=(t=e.language)?t:"").trim().toLowerCase())return n.mermaid||_t;if(o)return o;return n.code_block||Mt.value}return o||Bt[String(e.type)]||Be},getBindingsFor:function(e){var t;return"code_block"===(null==e?void 0:e.type)&&"mermaid"===String(null!=(t=e.language)?t:"").trim().toLowerCase()?{}:"code_block"===e.type?s({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,monacoOptions:l.codeBlockMonacoOptions,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},l.codeBlockProps||{}):{typewriter:l.typewriter}},handleContainerClick:function(e){t("click",e)},handleContainerMouseover:function(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&t("mouseover",e)},handleContainerMouseout:function(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&t("mouseout",e)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerRef",staticClass:"markstream-vue markdown-renderer",class:[{dark:n.props.isDark},{virtualized:n.virtualizationEnabled}],on:{click:n.handleContainerClick,mouseover:n.handleContainerMouseover,mouseout:n.handleContainerMouseout}},[n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.topSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e(),e._l(n.visibleNodes,function(o){var r;return t("div",{key:o.index,ref:`node-slot-${o.index}`,refInFor:!0,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[n.shouldRenderNode(o.index)?t("div",{ref:`node-content-${o.index}`,refInFor:!0,staticClass:"node-content"},["code_block"!==o.node.type&&!1!==n.props.typewriter?t("transition",{attrs:{name:"typewriter",appear:""}},[t(n.getNodeComponent(o.node),e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${o.index}`,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",n.getBindingsFor(o.node),!1))],1):t(n.getNodeComponent(o.node),e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":`${e.indexKey||"markdown-renderer"}-${o.index}`,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",n.getBindingsFor(o.node),!1))],1):t("div",{staticClass:"node-placeholder",style:{height:`${null!=(r=n.nodeHeights[o.index])?r:n.averageNodeHeight}px`}})])}),n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.bottomSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e()],2)},[],!1,null,"332a26b9",null,null).exports,Ee=v(p.defineComponent({__name:"AdmonitionNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e,{emit:t}){var n;const o=e,r=p.computed(()=>{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)}),l=p.ref(!!o.node.collapsible&&!(null==(n=o.node.open)||n)),i=`admonition-${Math.random().toString(36).slice(2,9)}`;return{__sfc:!0,props:o,emit:t,iconMap:{note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},displayTitle:r,collapsed:l,toggleCollapse:function(){o.node.collapsible&&(l.value=!l.value)},headerId:i,NodeRenderer:Le}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"admonition",class:[`admonition-${n.props.node.kind}`,n.props.isDark?"is-dark":""]},[t("div",{staticClass:"admonition-header",attrs:{id:n.headerId}},[n.iconMap[n.props.node.kind]?t("span",{staticClass:"admonition-icon"},[e._v(e._s(n.iconMap[n.props.node.kind]))]):e._e(),t("span",{staticClass:"admonition-title"},[e._v(e._s(n.displayTitle))]),n.props.node.collapsible?t("button",{staticClass:"admonition-toggle",attrs:{"aria-expanded":!n.collapsed,"aria-controls":`${n.headerId}-content`,title:n.collapsed?"Expand":"Collapse"},on:{click:n.toggleCollapse}},[n.collapsed?t("span",[e._v("▶")]):t("span",[e._v("▼")])]):e._e()]),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.collapsed,expression:"!collapsed"}],staticClass:"admonition-content",attrs:{id:`${n.headerId}-content`,"aria-labelledby":n.headerId}},[t(n.NodeRenderer,{attrs:{"index-key":`admonition-${e.indexKey}`,nodes:n.props.node.children,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(e){return n.emit("copy",e)}}})],1)])},[],!1,null,"ee240a2a",null,null).exports;let Re=!1,Ie=null,Ne=!1;function Pe(){return d(this,null,function*(){if(Ie)return Ie;if(Ne)return null;try{return Ie=yield import("stream-monaco"),yield function(e){return d(this,null,function*(){if(!Re)return Re=!0,e.preloadMonacoWorkers()})}(Ie),Ie}catch(e){return Ne=!0,null}})}let He=null;function De(e){He=null!=e?e:null}const je={"":"",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 $e(e){var t;const n=function(e){if(!e)return"";const t=e.trim();if(!t)return"";const[n]=t.split(/\s+/),[o]=n.split(":");return o.toLowerCase()}(e);return null!=(t=je[n])?t:n}function Oe(e){const t=$e(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function ze(e){if(He){const t=He(e);if(null!=t&&""!==t)return t}switch($e(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 Ae={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown","":"Plain Text",plain:"Plain Text"};function Fe(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}const Ve=v(p.defineComponent({__name:"Portal",props:{to:null},setup(e){const t=e,n=p.ref(null);function o(){return"undefined"==typeof document?null:t.to&&"body"!==t.to?document.querySelector(t.to):document.body}function r(){const e=n.value;if(!e)return;const t=o();t&&e.parentElement!==t&&t.appendChild(e)}return p.onMounted(()=>{r()}),p.watch(()=>t.to,()=>{r()}),p.onBeforeUnmount(()=>{}),{__sfc:!0,props:t,rootRef:n,resolveTarget:o,moveToTarget:r}}}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{ref:"rootRef",staticClass:"portal-root"},[e._t("default")],2)},[],!1,null,"26355139",null,null).exports,We=v(p.defineComponent({__name:"HtmlPreviewFrame",props:{code:null,isDark:{type:Boolean},onClose:null,title:null},setup(e){const t=e,{t:n}=A(),o=p.computed(()=>{const e=t.code||"",n=e.trim().toLowerCase();return n.startsWith("<!doctype")||n.startsWith("<html")||n.startsWith("<body")?e:`<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n <style>\n html, body {\n margin: 0;\n padding: 0;\n height: 100%;\n background-color: ${t.isDark?"#020617":"#ffffff"};\n color: ${t.isDark?"#e5e7eb":"#020617"};\n }\n body {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;\n }\n </style>\n </head>\n <body>\n ${e}\n </body>\n</html>`});function r(e){var n;"Escape"!==e.key&&"Esc"!==e.key||null==(n=t.onClose)||n.call(t)}return p.onMounted(()=>{"undefined"!=typeof window&&window.addEventListener("keydown",r)}),p.onUnmounted(()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",r)}),{__sfc:!0,props:t,t:n,srcdoc:o,handleKeydown:r,Portal:Ve}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue"},[t("div",{staticClass:"html-preview-frame__backdrop",class:{"html-preview-frame__backdrop--dark":n.props.isDark},on:{click:function(e){var t,o;null==(o=(t=n.props).onClose)||o.call(t)}}},[t("div",{staticClass:"html-preview-frame",class:{"html-preview-frame--dark":n.props.isDark},on:{click:function(e){e.stopPropagation()}}},[t("div",{staticClass:"html-preview-frame__header"},[t("div",{staticClass:"html-preview-frame__title"},[t("span",{staticClass:"html-preview-frame__dot"}),t("span",{staticClass:"html-preview-frame__label"},[e._v(e._s(n.props.title||n.t("common.preview")||"Preview"))])]),t("button",{staticClass:"html-preview-frame__close",class:{"html-preview-frame__close--dark":n.props.isDark},attrs:{type:"button"},on:{click:function(e){var t,o;null==(o=(t=n.props).onClose)||o.call(t)}}},[e._v(" × ")])]),t("iframe",{staticClass:"html-preview-frame__iframe",attrs:{sandbox:"allow-scripts allow-same-origin",srcdoc:n.srcdoc}})])])])])},[],!1,null,"6139b41c",null,null).exports,Ke=v(p.defineComponent({__name:"CodeBlockNode",props:{node:{type:Object,required:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{type:[Object,String],default:void 0},lightTheme:{type:[Object,String],default:void 0},isShowPreview:{type:Boolean,default:!0},monacoOptions:{type:Object,default:void 0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{type:[String,Number],default:void 0},maxWidth:{type:[String,Number],default:void 0},themes:{type:Array,default:void 0},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},customId:{type:String,default:void 0}},emits:["previewCode","copy"],setup(e,{emit:t}){var n,o;const r=e,l="__markstreamMonacoPassiveTouch__";function i(){var e;try{const t=window;if(t[l])return;const n=null==(e=window.Element)?void 0:e.prototype,o=null==n?void 0:n.addEventListener;if(!n||!o)return;n.addEventListener=function(e,t,n){return"touchstart"===e&&a(this,n)?o.call(this,e,t,c(n)):o.call(this,e,t,n)},t[l]=!0}catch(t){}}function a(e,t){if(!e)return!1;const n=e;return!("function"!=typeof n.closest||!n.closest(".monaco-editor, .monaco-diff-editor")||t&&"object"==typeof t&&"passive"in t)}function c(e){return null==e?{passive:!0}:"boolean"==typeof e?{capture:e,passive:!0}:"object"==typeof e?"passive"in e?e:u(s({},e),{passive:!0}):{passive:!0}}"undefined"!=typeof window&&i();const v=p.getCurrentInstance(),h=p.computed(()=>{var e,t,n,o,r,l,i,a,s,u;const d=null==v?void 0:v.proxy,c=null!=(e=null==d?void 0:d.$listeners)?e:{};if(c.previewCode||c["preview-code"])return!0;const p=null!=(i=null!=(l=null==(n=null==(t=null==d?void 0:d.$vnode)?void 0:t.data)?void 0:n.on)?l:null==(r=null==(o=null==d?void 0:d.$vnode)?void 0:o.componentOptions)?void 0:r.listeners)?i:{};if(p.previewCode||p["preview-code"])return!0;const m=null!=(u=null==(a=null==d?void 0:d.$vnode)?void 0:a.props)?u:null==(s=null==v?void 0:v.vnode)?void 0:s.props;return!(!m||!m.onPreviewCode&&!m.onPreviewcode)}),{t:f}=A(),g=p.ref(null),w=p.ref(null),y=p.ref(!1),x=p.ref($e(r.node.language)),k=p.computed(()=>Oe(x.value)),b=p.ref(!1),C=p.ref(!1),_=p.ref(!1),M=p.ref(!1),B=p.ref(null);let T=0;const S=V();let L=null;const E=p.ref("undefined"==typeof window);"undefined"!=typeof window&&p.watch(()=>w.value,e=>{if(null==L||L.destroy(),L=null,!e)return void(E.value=!1);const t=S(e,{rootMargin:"400px"});L=t,E.value=t.isVisible.value,t.whenVisible.then(()=>{E.value=!0})},{immediate:!0}),p.onBeforeUnmount(()=>{null==L||L.destroy(),L=null});let R=null,I=null,N=()=>{},P=()=>{},H=()=>null,D=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),j=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),z=()=>{},F=()=>{},W=null,K=()=>{var e;return String(null!=(e=r.node.language)?e:"plaintext")},U=()=>d(this,null,function*(){});const X=p.computed(()=>r.node.diff),q=p.ref(!1),Y=p.ref(!1),Z=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:m&&"SCRIPT"===m.tagName.toUpperCase()&&m.src||new URL("exports.js",document.baseURI).href}&&Boolean(null==(n={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:n.DEV);"undefined"!=typeof window&&(()=>{d(this,null,function*(){try{const e=yield Pe();if(!e)return Z&&console.warn("[markstream-vue] stream-monaco is not installed. Code blocks will use basic rendering. Install stream-monaco for enhanced code editor features."),void(q.value=!0);const t=e.useMonaco,n=e.detectLanguage;if("function"==typeof n&&(K=n),"function"==typeof t){const e=xe();if(e&&r.themes&&Array.isArray(r.themes)&&!r.themes.includes(e))throw new Error("Preferred theme not in provided themes array");const n=t(u(s({wordWrap:"on",wrappingIndent:"same",themes:r.themes,theme:e},r.monacoOptions||{}),{onThemeChange(){le()}}));R=n.createEditor||R,I=n.createDiffEditor||I,N=n.updateCode||N,P=n.updateDiff||P,H=n.getEditor||H,D=n.getEditorView||D,j=n.getDiffEditorView||j,z=n.cleanupEditor||z,F=n.safeClean||n.cleanupEditor||F,U=n.setTheme||U,M.value=!0,g.value&&(yield ge(g.value))}}catch(e){Z&&console.warn("[markstream-vue] Failed to initialize Monaco editor:",e),q.value=!0}})})();const G=p.ref("number"==typeof(null==(o=r.monacoOptions)?void 0:o.fontSize)?r.monacoOptions.fontSize:Number.NaN),J=p.ref(G.value),Q=p.computed(()=>{const e=G.value,t=J.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0});function ee(){try{const e=g.value;if(!e)return null;const t=e.querySelector(".view-lines .view-line");if(t){const e=Math.ceil(t.getBoundingClientRect().height);if(e>0)return e}}catch(e){}return null}function te(){var e,t,n,o,r;try{const l=X.value?null!=(n=null==(t=null==(e=j())?void 0:e.getModifiedEditor)?void 0:t.call(e))?n:j():D(),i=H(),a=null==(o=null==i?void 0:i.EditorOption)?void 0:o.fontInfo;if(l&&null!=a){const e=null==(r=l.getOption)?void 0:r.call(l,a),t=null==e?void 0:e.fontSize;if("number"==typeof t&&Number.isFinite(t)&&t>0)return t}}catch(l){}try{const e=g.value;if(e){const t=e.querySelector(".view-lines .view-line");if(t)try{if("undefined"!=typeof window&&"function"==typeof window.getComputedStyle){const e=window.getComputedStyle(t).fontSize,n=e&&e.match(/^(\d+(?:\.\d+)?)/);if(n)return Number.parseFloat(n[1])}}catch(l){}}}catch(l){}return null}function ne(e){var t,n;try{const o=H(),r=null==(t=null==o?void 0:o.EditorOption)?void 0:t.lineHeight;if(null!=r){const t=null==(n=null==e?void 0:e.getOption)?void 0:n.call(e,r);if("number"==typeof t&&t>0)return t}}catch(l){}const o=ee();if(o&&o>0)return o;const r=Number.isFinite(J.value)&&J.value>0?J.value:12;return Math.max(12,Math.round(1.35*r))}function oe(){var e;if(Number.isFinite(J.value)&&J.value>0&&Number.isFinite(G.value))return J.value;const t=te();return"number"==typeof(null==(e=r.monacoOptions)?void 0:e.fontSize)?(G.value=r.monacoOptions.fontSize,J.value=r.monacoOptions.fontSize,J.value):t&&t>0?(G.value=t,J.value=t,t):(G.value=12,J.value=12,12)}function re(){var e,t,n,o,r,l,i,a,s,u,d,c,p,m;try{const v=X.value?j():D();if(!v)return null;if(X.value&&(null==v?void 0:v.getOriginalEditor)&&(null==v?void 0:v.getModifiedEditor)){const p=null==(e=v.getOriginalEditor)?void 0:e.call(v),m=null==(t=v.getModifiedEditor)?void 0:t.call(v);null==(n=null==p?void 0:p.layout)||n.call(p),null==(o=null==m?void 0:m.layout)||o.call(m);const h=(null==(r=null==p?void 0:p.getContentHeight)?void 0:r.call(p))||0,f=(null==(l=null==m?void 0:m.getContentHeight)?void 0:l.call(m))||0,g=Math.max(h,f);if(g>0)return Math.ceil(g+1);const w=(null==(s=null==(a=null==(i=null==p?void 0:p.getModel)?void 0:i.call(p))?void 0:a.getLineCount)?void 0:s.call(a))||1,y=(null==(c=null==(d=null==(u=null==m?void 0:m.getModel)?void 0:u.call(m))?void 0:d.getLineCount)?void 0:c.call(d))||1,x=Math.max(w,y),k=Math.max(ne(p),ne(m));return Math.ceil(x*(k+1.5)+0+1)}if(null==v?void 0:v.getContentHeight){null==(p=null==v?void 0:v.layout)||p.call(v);const e=v.getContentHeight();if(e>0)return Math.ceil(e+1)}const h=null==(m=null==v?void 0:v.getModel)?void 0:m.call(v);let f=1;h&&"function"==typeof h.getLineCount&&(f=h.getLineCount());const g=ne(v);return Math.ceil(f*(g+1.5)+0+1)}catch(v){return null}}function le(){var e,t,n;const o=g.value,r=w.value;if(!o||!r)return;const l=o.querySelector(".monaco-editor")||o;let i=null;try{"undefined"!=typeof window&&"function"==typeof window.getComputedStyle&&(i=window.getComputedStyle(l))}catch(d){i=null}const a=String(null!=(e=null==i?void 0:i.getPropertyValue("--vscode-editor-foreground"))?e:""),s=String(null!=(t=null==i?void 0:i.getPropertyValue("--vscode-editor-background"))?t:""),u=String(null!=(n=null==i?void 0:i.getPropertyValue("--vscode-editor-hoverHighlightBackground"))?n:"");return a&&s?(r.style.setProperty("--vscode-editor-foreground",a.trim()),r.style.setProperty("--vscode-editor-background",s.trim()),r.style.setProperty("--vscode-editor-selectionBackground",u.trim()),!0):void 0}function ie(){try{const e=g.value;if(!e)return;const t=e.getBoundingClientRect(),n=window.scrollY+t.top,o=re();if(null!=o&&o>0){const r=t.height;e.style.height=`${Math.ceil(o)}px`,e.style.maxHeight="none";const l=Math.ceil(o)-r;0!==l&&n<window.scrollY&&window.scrollBy(0,l)}}catch(e){}}function ae(){var e;try{const t=g.value;if(!t)return;const n=t.getBoundingClientRect(),o=window.scrollY+n.top,r=n.height,l=se();if(T>0&&(T--,null!=B.value)){const e=Math.min(B.value,l);t.style.height=`${Math.ceil(e)}px`,t.style.maxHeight=`${Math.ceil(l)}px`,t.style.overflow="auto";const n=Math.ceil(e)-r;return void(0!==n&&o<window.scrollY&&window.scrollBy(0,n))}const i=re();if(null!=i&&i>0){const e=Math.min(i,l);t.style.height=`${Math.ceil(e)}px`,t.style.maxHeight=`${Math.ceil(l)}px`,t.style.overflow="auto";const n=Math.ceil(e)-r;return void(0!==n&&o<window.scrollY&&window.scrollBy(0,n))}if(null!=B.value){const e=Math.min(B.value,l);t.style.height=`${Math.ceil(e)}px`,t.style.maxHeight=`${Math.ceil(l)}px`,t.style.overflow="auto";const n=Math.ceil(e)-r;return void(0!==n&&o<window.scrollY&&window.scrollBy(0,n))}const a=Math.ceil((null==(e=t.getBoundingClientRect)?void 0:e.call(t).height)||0);if(a>0){const e=Math.min(a,l);t.style.height=`${Math.ceil(e)}px`,t.style.maxHeight=`${Math.ceil(l)}px`,t.style.overflow="auto";const n=Math.ceil(e)-r;return void(0!==n&&o<window.scrollY&&window.scrollBy(0,n))}const s=Number.parseFloat(t.style.height);if(!Number.isNaN(s)&&s>0){const e=Math.ceil(Math.min(s,l));t.style.height=`${e}px`;const n=e-r;0!==n&&o<window.scrollY&&window.scrollBy(0,n)}else{const e=Math.ceil(l);t.style.height=`${e}px`;const n=e-r;0!==n&&o<window.scrollY&&window.scrollBy(0,n)}t.style.maxHeight=`${Math.ceil(l)}px`,t.style.overflow="auto"}catch(t){}}function se(){var e,t;const n=null!=(t=null==(e=r.monacoOptions)?void 0:e.MAX_HEIGHT)?t:500;if("number"==typeof n)return n;const o=String(n).match(/^(\d+(?:\.\d+)?)/);return o?Number.parseFloat(o[1]):500}const ue=p.computed(()=>r.isShowPreview&&("html"===x.value||"svg"===x.value)),de=p.computed(()=>"mermaid"===x.value);p.watch(()=>r.node.language,e=>{x.value=$e(e)}),p.watch(()=>r.node.code,e=>d(this,null,function*(){var t,n;if(!1!==r.stream){if(x.value||(x.value=$e(K(e))),R&&!_.value&&g.value)try{yield ge(g.value)}catch(o){}X.value?P(String(null!=(t=r.node.originalCode)?t:""),String(null!=(n=r.node.updatedCode)?n:""),k.value):N(e,k.value),b.value&&Fe(()=>ie())}}));const ce=p.computed(()=>{const e=x.value;return e?Ae[e]||e.charAt(0).toUpperCase()+e.slice(1):Ae[""]||"Plain Text"}),pe=p.computed(()=>ze(x.value||"")),me=p.computed(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n=t(r.minWidth),o=t(r.maxWidth);return n&&(e.minWidth=n),o&&(e.maxWidth=o),e});function ve(e){return!e||e.disabled}function he(e){var t,n;try{if(X.value){const n=j();null==(t=null==n?void 0:n.updateOptions)||t.call(n,{automaticLayout:e})}else{const t=D();null==(n=null==t?void 0:t.updateOptions)||n.call(t,{automaticLayout:e})}}catch(o){}}function fe(e){return d(this,null,function*(){var t,n,o;if(!R)return;X.value?(F(),I?yield I(e,String(null!=(t=r.node.originalCode)?t:""),String(null!=(n=r.node.updatedCode)?n:""),k.value):yield R(e,r.node.code,k.value)):yield R(e,r.node.code,k.value);const l=X.value?j():D();if("number"==typeof(null==(o=r.monacoOptions)?void 0:o.fontSize))null==l||l.updateOptions({fontSize:r.monacoOptions.fontSize,automaticLayout:!1}),G.value=r.monacoOptions.fontSize,J.value=r.monacoOptions.fontSize;else{const e=te();e&&e>0?(G.value=e,J.value=e):(G.value=12,J.value=12)}b.value||C.value||ae(),!1===r.loading&&(yield p.nextTick(),Fe(()=>{b.value&&!C.value?ie():C.value||ae()}))})}function ge(e){if(!R)return null;if(W)return W;_.value=!0;const t=(()=>d(this,null,function*(){yield fe(e)}))();return W=t.finally(()=>{W=null}),W}p.watch(()=>J.value,(e,t)=>{const n=X.value?j():D();n&&"number"==typeof e&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),b.value&&!C.value&&ie())},{flush:"post",immediate:!1});const we=p.watch(()=>[g.value,de.value,X.value,r.stream,r.loading,M.value,E.value],e=>d(this,[e],function*([e,t,n,o,r,l,i]){if(!e||!R)return;if(!i)return;if(!1===o&&!1!==r)return;if(de.value)return z(),void we();const a=ge(e);a&&(yield a,we())})),ye=p.watch(()=>[r.darkTheme,r.lightTheme,_.value,E.value],()=>{if(_.value&&E.value)return de.value?ye():void ke()});function xe(){return r.isDark?r.darkTheme:r.lightTheme}function ke(){const e=xe();e&&U(e)}const be=p.watch(()=>[r.monacoOptions,E.value],()=>{var e,t;if(!R||!E.value)return;if(de.value)return be();const n=X.value?j():D(),o="number"==typeof(null==(e=r.monacoOptions)?void 0:e.fontSize)?r.monacoOptions.fontSize:Number.isFinite(J.value)?J.value:void 0;"number"==typeof o&&Number.isFinite(o)&&o>0&&(null==(t=null==n?void 0:n.updateOptions)||t.call(n,{fontSize:o})),b.value&&!C.value?ie():C.value||ae()},{deep:!0}),_e=p.watch(()=>[r.loading,E.value],e=>d(this,[e],function*([e,t]){t&&(de.value?p.nextTick(()=>{null==_e||_e()}):e||(yield p.nextTick(),Fe(()=>{C.value||(b.value?ie():ae()),_e()})))}),{immediate:!0,flush:"post"});return p.onUnmounted(()=>{z()}),{__sfc:!0,props:r,emits:t,MONACO_TOUCH_PATCH_FLAG:l,ensureMonacoPassiveTouchListeners:i,shouldForcePassiveForMonaco:a,withPassiveOptions:c,instance:v,hasPreviewListener:h,t:f,codeEditor:g,container:w,copyText:y,codeLanguage:x,monacoLanguage:k,isExpanded:b,isCollapsed:C,editorCreated:_,monacoReady:M,expandRafId:null,heightBeforeCollapse:B,resumeGuardFrames:T,registerVisibility:S,viewportHandle:L,viewportReady:E,createEditor:R,createDiffEditor:I,updateCode:N,updateDiffCode:P,getEditor:H,getEditorView:D,getDiffEditorView:j,cleanupEditor:z,safeClean:F,createEditorPromise:W,detectLanguage:K,setTheme:U,isDiff:X,usePreCodeRender:q,showInlinePreview:Y,isDevEnv:Z,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:G,codeFontSize:J,fontBaselineReady:Q,CONTENT_PADDING:0,LINE_EXTRA_PER_LINE:1.5,PIXEL_EPSILON:1,measureLineHeightFromDom:ee,readActualFontSizeFromEditor:te,getLineHeightSafe:ne,ensureFontBaseline:oe,increaseCodeFont:function(){const e=oe(),t=Math.min(36,e+1);J.value=t},decreaseCodeFont:function(){const e=oe(),t=Math.max(10,e-1);J.value=t},resetCodeFont:function(){oe(),Number.isFinite(G.value)&&(J.value=G.value)},computeContentHeight:re,syncEditorCssVars:le,resizeSyncHandler:null,updateExpandedHeight:ie,updateCollapsedHeight:ae,getMaxHeightValue:se,isPreviewable:ue,isMermaid:de,displayLanguage:ce,languageIcon:pe,containerStyle:me,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(r.node.code)),y.value=!0,t("copy",r.node.code),setTimeout(()=>{y.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})},shouldSkipEventTarget:ve,onBtnHover:function(e,t,n="top"){if(ve(e.currentTarget))return;const o=e,l=null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0;$(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){O()},onCopyHover:function(e){if(ve(e.currentTarget))return;const t=y.value?f("common.copied")||"Copied":f("common.copy")||"Copy",n=e,o=null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0;$(e.currentTarget,t,"top",!1,o,r.isDark)},toggleExpand:function(){b.value=!b.value;const e=X.value?j():D(),t=g.value;e&&t&&(b.value?(he(!0),t.style.maxHeight="none",t.style.overflow="visible",ie()):(he(!1),t.style.overflow="auto",ae()))},toggleHeaderCollapse:function(){var e,t,n;if(C.value=!C.value,C.value){if(g.value){const n=Math.ceil((null==(t=(e=g.value).getBoundingClientRect)?void 0:t.call(e).height)||0);n>0&&(B.value=n)}he(!1)}else{b.value&&he(!0),g.value&&null!=B.value&&(g.value.style.height=`${B.value}px`);const e=X.value?j():D();try{null==(n=null==e?void 0:e.layout)||n.call(e)}catch(o){}T=2,Fe(()=>{b.value?ie():ae()})}},previewCode:function(){if(!ue.value)return;const e=x.value;if(h.value){const n="html"===e?"text/html":"image/svg+xml",o="html"===e?f("artifacts.htmlPreviewTitle")||"HTML Preview":f("artifacts.svgPreviewTitle")||"SVG Preview";return void t("previewCode",{node:r.node,artifactType:n,artifactTitle:o,id:`temp-${e}-${Date.now()}`})}"html"===e&&(Y.value=!Y.value)},setAutomaticLayout:he,runEditorCreation:fe,ensureEditorCreation:ge,stopCreateEditorWatch:we,watchTheme:ye,getPreferredColorScheme:xe,themeUpdate:ke,watchMonacoOptions:be,stopLoadingWatch:_e,stopExpandAutoResize:function(){},PreCodeNode:Ce,HtmlPreviewFrame:We}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return n.usePreCodeRender?t(n.PreCodeNode,{attrs:{node:e.node,loading:n.props.loading}}):t("div",{ref:"container",staticClass:"code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":n.props.loading,"is-dark":n.props.isDark}],style:n.containerStyle},[n.props.showHeader?t("div",{staticClass:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",staticStyle:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},[e._t("header-left",function(){return[t("div",{staticClass:"flex items-center space-x-2 flex-1 overflow-hidden"},[t("span",{staticClass:"icon-slot h-4 w-4 flex-shrink-0",domProps:{innerHTML:e._s(n.languageIcon)}}),t("span",{staticClass:"text-sm font-medium font-mono truncate"},[e._v(e._s(n.displayLanguage))])])]}),e._t("header-right",function(){return[t("div",{staticClass:"flex items-center space-x-2"},[t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleHeaderCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]),n.props.showFontSizeButtons&&n.props.enableFontSizeControl?[t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize<=n.codeFontMin},on:{click:function(e){return n.decreaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},focus:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"}})])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!n.fontBaselineReady||n.codeFontSize===n.defaultCodeFontSize},on:{click:function(e){return n.resetCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},focus:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}}),t("path",{attrs:{d:"M3 3v5h5"}})])])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize>=n.codeFontMax},on:{click:function(e){return n.increaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},focus:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"}})])])]:e._e(),n.props.showCopyButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExpandButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isExpanded},on:{click:n.toggleExpand,mouseenter:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},focus:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isExpanded?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})])]):e._e(),n.isPreviewable&&n.props.showPreviewButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.preview")||"Preview"},on:{click:n.previewCode,mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24"}},[t("g",{attrs:{fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"}},[t("path",{attrs:{d:"M23.628 7.41c-.12-1.172-.08-3.583-.9-4.233c-1.921-1.51-6.143-1.11-8.815-1.19c-3.481-.15-7.193.14-10.625.24a.34.34 0 0 0 0 .67c3.472-.05 7.074-.29 10.575-.09c2.471.15 6.653-.14 8.254 1.16c.4.33.41 2.732.49 3.582a42 42 0 0 1 .08 9.005a13.8 13.8 0 0 1-.45 3.001c-2.42 1.4-19.69 2.381-20.72.55a21 21 0 0 1-.65-4.632a41.5 41.5 0 0 1 .12-7.964c.08 0 7.334.33 12.586.24c2.331 0 4.682-.13 6.764-.21a.33.33 0 0 0 0-.66c-7.714-.16-12.897-.43-19.31.05c.11-1.38.48-3.922.38-4.002a.3.3 0 0 0-.42 0c-.37.41-.29 1.77-.36 2.251s-.14 1.07-.2 1.6a45 45 0 0 0-.36 8.645a21.8 21.8 0 0 0 .66 5.002c1.46 2.702 17.248 1.461 20.95.43c1.45-.4 1.69-.8 1.871-1.95c.575-3.809.602-7.68.08-11.496"}}),t("path",{attrs:{d:"M4.528 5.237a.84.84 0 0 0-.21-1c-.77-.41-1.71.39-1 1.1a.83.83 0 0 0 1.21-.1m2.632-.25c.14-.14.19-.84-.2-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.2-.09m2.88 0a.83.83 0 0 0-.21-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.21-.09m-4.29 8.735c0 .08.23 2.471.31 2.561a.371.371 0 0 0 .63-.14c0-.09 0 0 .15-1.72a10 10 0 0 0-.11-2.232a5.3 5.3 0 0 1-.26-1.37a.3.3 0 0 0-.54-.24a6.8 6.8 0 0 0-.2 2.33c-1.281-.38-1.121.13-1.131-.42a15 15 0 0 0-.19-1.93c-.16-.17-.36-.17-.51.14a20 20 0 0 0-.43 3.471c.04.773.18 1.536.42 2.272c.26.4.7.22.7-.1c0-.09-.16-.09 0-1.862c.06-1.18-.23-.3 1.16-.76m5.033-2.552c.32-.07.41-.28.39-.37c0-.55-3.322-.34-3.462-.24s-.2.18-.18.28s0 .11 0 .16a3.8 3.8 0 0 0 1.591.361v.82a15 15 0 0 0-.13 3.132c0 .2-.09.94.17 1.16a.34.34 0 0 0 .48 0c.125-.35.196-.718.21-1.09a8 8 0 0 0 .14-3.232c0-.13.05-.7-.1-.89a8 8 0 0 0 .89-.09m5.544-.181a.69.69 0 0 0-.89-.44a2.8 2.8 0 0 0-1.252 1.001a2.3 2.3 0 0 0-.41-.83a1 1 0 0 0-1.6.27a7 7 0 0 0-.35 2.07c0 .571 0 2.642.06 2.762c.14 1.09 1 .51.63.13a17.6 17.6 0 0 1 .38-3.962c.32-1.18.32.2.39.51s.11 1.081.73 1.081s.48-.93 1.401-1.78q.075 1.345 0 2.69a15 15 0 0 0 0 1.811a.34.34 0 0 0 .68 0q.112-.861.11-1.73a16.7 16.7 0 0 0 .12-3.582m1.441-.201c-.05.16-.3 3.002-.31 3.202a6.3 6.3 0 0 0 .21 1.741c.33 1 1.21 1.07 2.291.82a3.7 3.7 0 0 0 1.14-.23c.21-.22.10-.59-.41-.64q-.817.096-1.64.07c-.44-.07-.34 0-.67-4.442q.015-.185 0-.37a.316.316 0 0 0-.23-.38a.316.316 0 0 0-.38.23"}})])])]):e._e()],2)]})],2):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!(n.isCollapsed||!e.stream&&e.loading),expression:"!isCollapsed && (stream ? true : !loading)"}],ref:"codeEditor",staticClass:"code-editor-container",class:[e.stream?"":"code-height-placeholder"]}),n.showInlinePreview&&!n.hasPreviewListener&&n.isPreviewable&&"html"===n.codeLanguage?t(n.HtmlPreviewFrame,{attrs:{code:e.node.code,"is-dark":n.props.isDark,"on-close":()=>n.showInlinePreview=!1}}):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.stream&&e.loading,expression:"!stream && loading"}],staticClass:"code-loading-placeholder"},[e._t("loading",function(){return[t("div",{staticClass:"loading-skeleton"},[t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line short"})])]},{loading:e.loading,stream:e.stream})],2),t("span",{staticClass:"sr-only",attrs:{"aria-live":"polite",role:"status"}},[e._v(e._s(n.copyText?n.t("common.copied")||"Copied":""))])],1)},[],!1,null,"0139dbde",null,null).exports,Ue=()=>import("mermaid");let Xe=null,qe=Ue;function Ye(e){qe=e,Xe=null}function Ze(){return"function"==typeof qe}function Ge(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&("function"==typeof t.render||"function"==typeof t.parse||"function"==typeof t.initialize))return t;if(t&&t.mermaidAPI&&("function"==typeof t.mermaidAPI.render||"function"==typeof t.mermaidAPI.parse)){const e=t.mermaidAPI;return u(s({},t),{render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:n=>"function"==typeof t.initialize?t.initialize(n):e.initialize?e.initialize(n):void 0})}return e.mermaid&&"function"==typeof e.mermaid.render?e.mermaid:t}function Je(e){if(e)try{const t=null==e?void 0:e.initialize;e.initialize=n=>{const o=s({suppressErrorRendering:!0},n||{});return"function"==typeof t?t.call(e,o):(null==e?void 0:e.mermaidAPI)&&"function"==typeof e.mermaidAPI.initialize?e.mermaidAPI.initialize(o):void 0}}catch(t){}}let Qe=null,et=null;const tt=new Map;let nt=5,ot=!1;const rt="WORKER_BUSY",lt="MERMAID_DISABLED";function it(e,t,n=1400){if(!Ze()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=lt,Promise.reject(e)}if(et)return Promise.reject(et);const o=Qe||(et=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),et.name="WorkerInitError",et.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(et);if(tt.size>=nt){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=rt,e.inFlight=tt.size,e.max=nt,Promise.reject(e)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const u=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),tt.delete(i))},d={resolve:e=>{u(),r(e)},reject:e=>{u(),l(e)}};tt.set(i,d);try{o.postMessage({id:i,action:e,payload:t})}catch(c){return tt.delete(i),void l(c)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=tt.get(i);t&&t.reject(e)},n)})}function at(e,t,n=1400){return d(this,null,function*(){try{return yield it("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function st(e,t,n=1400){return d(this,null,function*(){try{return yield it("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function ut(){if(Qe)try{for(const[e,t]of tt.entries())t.reject(new Error("Worker terminated"));tt.clear(),Qe.terminate()}finally{Qe=null}}const dt=v(p.defineComponent({__name:"MermaidBlockNode",props:{node:null,maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!1}},emits:["copy","export","openModal","toggleMode"],setup(e,{emit:t}){var n,o;const r=e,l={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},i=p.ref(!1),a=p.computed(()=>r.isStrict?"strict":"loose"),c=p.computed(()=>({startOnLoad:!1,securityLevel:a.value,dompurifyConfig:"strict"===a.value?l:void 0,flowchart:"strict"===a.value?{htmlLabels:!1}:void 0}));function v(e){return e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}const h=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],f=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function g(e){if(!e)return"";const t=e.trim();return f.test(t)?t:""}function w(e){const t=new Set(["script"]),n=[e,...Array.from(e.querySelectorAll("*"))];for(const o of n){if(t.has(o.tagName.toLowerCase())){o.remove();continue}const e=Array.from(o.attributes);for(const t of e){const e=t.name;if(/^on/i.test(e))o.removeAttribute(e);else{if("style"===e&&t.value){const n=t.value;if(h.some(e=>e.test(n))){o.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&t.value){const n=g(t.value);if(!n){o.removeAttribute(e);continue}n!==t.value&&o.setAttribute(e,n)}}}}}function y(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return null;if(!e)return null;const t=v(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return null;const o=n;return w(o),o}function x(e,t){if(!e)return"";try{e.replaceChildren()}catch(o){e.innerHTML=""}const n=y(t);return n?(e.appendChild(n),e.innerHTML):""}function k(e){if(e)try{e.replaceChildren()}catch(t){e.innerHTML=""}}function b(e,t){if(!e)return"";if("strict"===a.value)return x(e,t);try{e.replaceChildren()}catch(n){e.innerHTML=""}if(t)try{e.insertAdjacentHTML("afterbegin",t)}catch(n){e.innerHTML=t}return e.innerHTML}const{t:C}=A();function _(){return d(this,null,function*(){try{const e=yield function(){return d(this,null,function*(){if(Xe)return Xe;const e=function(){try{const e=globalThis;return Ge(null==e?void 0:e.mermaid)}catch(e){return null}}();if(e)return Xe=e,Je(Xe),Xe;const t=qe;if(!t)return null;let n;try{n=yield t()}catch(o){if(t===Ue)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return n?(Xe=Ge(n),Je(Xe),Xe):null})}();return i.value=!!e,e}catch(e){throw i.value=!1,e}})}"undefined"!=typeof window&&(()=>{d(this,null,function*(){var e;try{const t=yield _();if(!t)return;null==(e=null==t?void 0:t.initialize)||e.call(t,s({},c.value))}catch(t){i.value=!1,console.warn("[markstream-vue] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",t)}})})();const M=p.ref(!1),B=p.ref(!1),T=p.ref(),S=p.ref(),L=p.ref(),E=p.ref(null),R=V();let I=null;const N=p.ref("undefined"==typeof window),P=p.ref(),H=p.computed(()=>r.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function D(e,t=H.value){const n=t,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return n.trim().startsWith("%%{")?n:o+n}const j=p.ref(1),z=p.ref(0),F=p.ref(0),W=p.ref(!1),K=p.ref({x:0,y:0}),U=p.ref(!1),X=p.ref(!1),q=p.ref(!1),Y=p.ref(null),Z=p.ref(0),G=p.ref(!1);let J=null,Q=null,ee=0;const te=null!=(n=globalThis.requestIdleCallback)?n:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16),ne=Ke(()=>{te(()=>{ot()},{timeout:500})},300);function oe(){null!=Q&&(globalThis.clearTimeout(Q),Q=null)}function re(e=600){if("undefined"==typeof globalThis)return;const t=Math.max(0,e);oe(),Q=globalThis.setTimeout(()=>{Q=null,r.loading||q.value||!N.value?re(Math.min(1200,Math.max(300,1.2*t))):ne()},t)}const le=p.ref("360px");let ie=null;const ae=p.ref(!1),se=p.ref(!1),ue=p.ref({}),de=p.ref(null),ce=p.ref(""),pe=p.ref(0);let me=null;const ve=p.ref(!1),he=p.ref({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),fe=p.computed(()=>r.enableWheelZoom?{wheel:Ze}:{}),ge=p.computed(()=>{var e,t,n,o;return{worker:null!=(e=r.workerTimeoutMs)?e:1400,parse:null!=(t=r.parseTimeoutMs)?t:1800,render:null!=(n=r.renderTimeoutMs)?n:2500,fullRender:null!=(o=r.fullRenderTimeoutMs)?o:4e3}}),we=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let ye=null,xe=null,ke=!1,be=800,Ce=null,_e=0,Me=!0;function Be(e,t){const n=null==t?void 0:t.timeoutMs,o=null==t?void 0:t.signal;if(null==o?void 0:o.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let r=null,l=!1,i=null;return new Promise((t,a)=>{const s=()=>{null!=r&&clearTimeout(r),i&&o&&o.removeEventListener("abort",i)};n&&n>0&&(r=globalThis.setTimeout(()=>{l||(l=!0,s(),a(new Error("Operation timed out")))},n)),o&&(i=()=>{l||(l=!0,s(),a(new DOMException("Aborted","AbortError")))},o.addEventListener("abort",i)),e().then(e=>{l||(l=!0,s(),t(e))}).catch(e=>{l||(l=!0,s(),a(e))})})}function Te(e){if("undefined"==typeof document)return;if(!S.value)return;const t=document.createElement("div");t.className="text-red-500 p-4",t.textContent="Failed to render diagram: ";const n=document.createElement("span");n.textContent=e instanceof Error?e.message:"Unknown error",t.appendChild(n),k(S.value),S.value.appendChild(t),le.value="360px",ve.value=!0,rt()}function Se(e){const t="string"==typeof e?e:"string"==typeof(null==e?void 0:e.message)?e.message:"";return"string"==typeof t&&/timed out/i.test(t)}function Le(e){return!e||e.disabled}function Ee(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function Re(){return Me&&!U.value&&!ae.value&&!ve.value}function Ie(e){const t=e.split(/\r?\n/);for(;t.length>0;){const e=t[t.length-1].trimEnd();if(""!==e){if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;t.pop()}else t.pop()}return t.join("\n")}function Ne(e,t,n){return d(this,null,function*(){var o,r;const l=yield _();if(!l)return;const i=l,a=Ee(e,t);if("function"==typeof i.parse)return yield Be(()=>i.parse(a),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:ge.value.parse,signal:null==n?void 0:n.signal}),!0;const s=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield Be(()=>l.render(s,a),{timeoutMs:null!=(r=null==n?void 0:n.timeoutMs)?r:ge.value.render,signal:null==n?void 0:n.signal}),!0})}function Pe(e,t,n){return d(this,null,function*(){var o;try{return yield at(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:ge.value.worker)}catch(r){return yield Ne(e,t,n)}})}function He(e,t,n){return d(this,null,function*(){var o;try{if(yield Pe(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(l){if("AbortError"===(null==l?void 0:l.name))throw l}let r=Ie(e);if(r&&r.trim()&&r!==e)try{try{const l=yield st(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:ge.value.worker);l&&l.trim()&&(r=l)}catch(l){}if(yield Pe(r,t,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(l){if("AbortError"===(null==l?void 0:l.name))throw l}return{fullOk:!1,prefixOk:!1}})}"undefined"!=typeof window&&p.watch(()=>T.value,e=>{if(null==I||I.destroy(),I=null,!e)return void(N.value=!1);const t=R(e,{rootMargin:"400px"});I=t,N.value=t.isVisible.value,t.whenVisible.then(()=>{N.value=!0})},{immediate:!0}),p.onBeforeUnmount(()=>{null==I||I.destroy(),I=null});const De=p.computed(()=>U.value||q.value||B.value);function je(e){if(!T.value||!S.value)return;const t=S.value.querySelector("svg");if(!t)return;let n=0,o=0;const r=t.getAttribute("viewBox"),l=t.getAttribute("width"),i=t.getAttribute("height");if(r){const e=r.split(" ");4===e.length&&(n=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(n&&o||l&&i&&(n=Number.parseFloat(l),o=Number.parseFloat(i)),Number.isNaN(n)||Number.isNaN(o)||n<=0||o<=0)try{const e=t.getBBox();e&&e.width>0&&e.height>0&&(n=e.width,o=e.height)}catch(a){return void console.error("Failed to get SVG BBox:",a)}if(n>0&&o>0){const t=o/n;let r=(null!=e?e:T.value.clientWidth)*t;r>o&&(r=o),le.value=`${r}px`}}const $e=p.ref(!1),Oe=p.computed(()=>({transform:`translate(${z.value}px, ${F.value}px) scale(${j.value})`}));function ze(e){"Escape"===e.key&&$e.value&&We()}function Ae(){if($e.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",ze)}catch(e){}p.nextTick(()=>{if(T.value&&L.value){const e=T.value.cloneNode(!0);e.classList.add("fullscreen");const t=e.querySelector("[data-mermaid-wrapper]");t&&(E.value=t,t.style.transform=Oe.value.transform),k(L.value),L.value.appendChild(e)}})}function We(){if($e.value=!1,L.value&&k(L.value),E.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",ze)}catch(e){}}function Ke(e,t){let n=null;return(...o)=>{n&&clearTimeout(n),n=setTimeout(()=>e(...o),t)}}function Ye(){if(!U.value)return;if(!i.value)return;const e=H.value.length;e!==Z.value&&(G.value=!0,Z.value=e,J&&clearTimeout(J),J=setTimeout(()=>{G.value&&U.value&&H.value.trim()&&(G.value=!1,et("preview"))},500))}function Ze(e){if(r.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!T.value)return;const t=T.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,r=n-t.width/2,l=o-t.height/2,i=(r-z.value)/j.value,a=(l-F.value)/j.value,s=.01,u=-e.deltaY*s,d=Math.min(Math.max(j.value+u,.5),3);d!==j.value&&(z.value=r-i*d,F.value=l-a*d,j.value=d)}}function Qe(e,t=null){return d(this,null,function*(){try{const o=null!=t?t:(new XMLSerializer).serializeToString(e),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(r);if("undefined"!=typeof document){const e=document.createElement("a");e.href=l,e.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(n){}URL.revokeObjectURL(l)}}catch(o){console.error("Failed to export SVG:",o)}})}function et(e){return d(this,null,function*(){const t=P.value;if(!t)return X.value=!0,void(U.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",X.value=!0,U.value="source"===e,yield p.nextTick();const o=t.scrollHeight;t.style.transition="height 180ms ease",t.offsetHeight,t.style.height=`${o}px`;const r=()=>{t.style.transition="",t.style.height="",t.style.overflow="",t.removeEventListener("transitionend",l)};function l(){r()}t.addEventListener("transitionend",l),setTimeout(()=>r(),220)})}function tt(){return d(this,null,function*(){return q.value?Y.value:S.value||(yield p.nextTick(),S.value)?(q.value=!0,Y.value=(()=>d(this,null,function*(){var e,t;S.value&&(S.value.style.opacity="0");try{const t=yield _();if(!t)return;const n=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;ae.value||se.value||null==(e=t.initialize)||e.call(t,u(s({},c.value),{dompurifyConfig:s({},l)}));const o=D(r.isDark?"dark":"light"),i=yield Be(()=>t.render(n,o),{timeoutMs:ge.value.fullRender}),a=null==i?void 0:i.svg;if(S.value){const e=b(S.value,a);ae.value||se.value||(je(),ae.value=!0,he.value={zoom:j.value,translateX:z.value,translateY:F.value,containerHeight:le.value});const t=r.isDark?"dark":"light";e&&(ue.value[t]=e),se.value&&(se.value=!1),ve.value=!1,ee=0,oe()}}catch(n){const e=Se(n),o=ee+1;e&&o<=3?(ee=o,re(Math.min(1200,600*o)),void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:m&&"SCRIPT"===m.tagName.toUpperCase()&&m.src||new URL("exports.js",document.baseURI).href}&&(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV)&&console.warn("[markstream-vue] Mermaid render timed out, retry scheduled:",o)):(ee=0,oe(),console.error("Failed to render mermaid diagram:",n),!1===r.loading&&Te(n))}finally{yield p.nextTick(),S.value&&(S.value.style.opacity="1"),q.value=!1,Y.value=null}}))(),Y.value):void console.warn("Mermaid container not ready")})}function nt(e){return d(this,null,function*(){if(Re()&&(S.value||(yield p.nextTick(),S.value))&&!q.value){q.value=!0;try{const t=yield _();if(!t)return;const n=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,o=r.isDark?"dark":"light",l=Ie(e),i=Ee(l&&l.trim()?l:e,o);S.value&&(S.value.style.opacity="0");const a=yield Be(()=>t.render(n,i),{timeoutMs:ge.value.render}),s=null==a?void 0:a.svg;S.value&&s&&(b(S.value,s),je())}catch(t){}finally{yield p.nextTick(),S.value&&(S.value.style.opacity="1"),q.value=!1}}})}function ot(){return d(this,null,function*(){var e,t;const n=Date.now(),o=++pe.value;me&&me.abort(),me=new AbortController;const l=me.signal,i=r.isDark?"dark":"light",a=H.value,s=a.replace(/\s+/g,"");if(!a.trim())return S.value&&k(S.value),de.value=null,ce.value="",void(ve.value=!1);if(s===ce.value)return;try{const r=yield He(a,i,{signal:l,timeoutMs:ge.value.worker});if(r.fullOk)return yield tt(),void(pe.value===o&&(de.value=null!=(t=null==(e=S.value)?void 0:e.innerHTML)?t:null,ce.value=s,ve.value=!1));const u=_e&&n<=_e;if(r.prefixOk&&r.prefix&&Re()&&!u)return void(yield nt(r.prefix))}catch(d){if("AbortError"===(null==d?void 0:d.name))return}if(pe.value!==o)return;if(ve.value)return;const u=ue.value[i];u&&S.value&&b(S.value,u)})}function rt(){ke&&(ke=!1,be=800,Me=!1,Ce&&(Ce.abort(),Ce=null),ye&&(globalThis.clearTimeout(ye),ye=null),xe&&(we(xe),xe=null),_e=Date.now())}function lt(){if(rt(),me){try{me.abort()}catch(e){}me=null}if(Ce){try{Ce.abort()}catch(e){}Ce=null}ut(),oe(),ee=0}function it(e=800){ke&&(ye&&globalThis.clearTimeout(ye),ye=globalThis.setTimeout(()=>{xe=te(()=>d(this,null,function*(){if(!ke)return;if(U.value||ae.value)return void rt();const e=r.isDark?"dark":"light",t=H.value;if(t.trim()){Ce&&Ce.abort(),Ce=new AbortController;try{if((yield Pe(t,e,{signal:Ce.signal,timeoutMs:ge.value.worker}))&&(yield tt(),ae.value))return void rt()}catch(n){}be=Math.min(Math.floor(1.5*be),4e3),it(be)}else it(be)}),{timeout:500})},e))}function dt(){ke||U.value||ae.value||(ke=!0,_e=0,Me=!0,it(500))}p.watch(Oe,e=>{$e.value&&E.value&&(E.value.style.transform=e.transform)},{immediate:!0}),p.watch(()=>H.value,()=>{ae.value=!1,ue.value={},ne(),!U.value&&i.value&&dt(),Ye()}),p.watch(()=>r.isDark,()=>d(this,null,function*(){if(!ae.value)return;if(ve.value)return;const e=r.isDark?"dark":"light",t=ue.value[e];if(t)return void(S.value&&b(S.value,t));const n={zoom:j.value,translateX:z.value,translateY:F.value,containerHeight:le.value},o=1!==j.value||0!==z.value||0!==F.value;se.value=!0,o&&(j.value=1,z.value=0,F.value=0,yield p.nextTick()),yield tt(),o&&(yield p.nextTick(),j.value=n.zoom,z.value=n.translateX,F.value=n.translateY,le.value=n.containerHeight,he.value=n)})),p.watch(()=>U.value,e=>d(this,null,function*(){if(e)rt(),ae.value&&(he.value={zoom:j.value,translateX:z.value,translateY:F.value,containerHeight:le.value});else{if(ve.value)return;const e=r.isDark?"dark":"light";if(ae.value&&ue.value[e])return yield p.nextTick(),S.value&&b(S.value,ue.value[e]),j.value=he.value.zoom,z.value=he.value.translateX,F.value=he.value.translateY,void(le.value=he.value.containerHeight);if(yield p.nextTick(),!i.value)return;yield ot(),dt()}})),p.watch(()=>r.loading,(e,t)=>d(this,null,function*(){if(!0===t&&!1===e){const e=H.value.trim();if(!e)return lt();const t=r.isDark?"dark":"light",o=e.replace(/\s+/g,"");if(ae.value&&o===ce.value)return yield p.nextTick(),S.value&&!S.value.querySelector("svg")&&ue.value[t]&&b(S.value,ue.value[t]),void lt();try{yield Pe(e,t,{timeoutMs:ge.value.worker}),yield tt(),ce.value=o,ve.value=!1,lt()}catch(n){lt(),Te(n)}}})),p.watch(T,e=>{ie&&ie.disconnect(),!e||ae.value||se.value||(ie=new ResizeObserver(e=>{e&&e.length>0&&!ae.value&&!se.value&&Fe(()=>{je(e[0].contentRect.width)})}),ie.observe(e))},{immediate:!0}),p.onMounted(()=>d(this,null,function*(){yield p.nextTick(),X.value||(U.value=!i.value),N.value&&(ne(),Z.value=H.value.length)})),p.watch(()=>i.value,e=>{X.value||(U.value=!e)}),p.watch(()=>N.value,e=>{e&&(ae.value||(ne(),Z.value=H.value.length),r.loading||ae.value||ne())},{immediate:!1}),p.onUnmounted(()=>{J&&clearTimeout(J),ie&&ie.disconnect(),me&&(me.abort(),me=null),ut(),rt(),oe()}),p.watch(()=>B.value,e=>d(this,null,function*(){e?(rt(),me&&me.abort()):ae.value||(yield p.nextTick(),ne(),U.value||dt())}),{immediate:!1});const ct=p.computed(()=>r.isDark?"mermaid-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"mermaid-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700");return{__sfc:!0,props:r,emits:t,DOMPURIFY_CONFIG:l,mermaidAvailable:i,mermaidSecurityLevel:a,mermaidInitConfig:c,neutralizeScriptProtocols:v,DISALLOWED_STYLE_PATTERNS:h,SAFE_URL_PROTOCOLS:f,sanitizeUrl:g,scrubSvgElement:w,toSafeSvgElement:y,setSafeSvg:x,clearElement:k,renderSvgToTarget:b,t:C,resolveMermaidInstance:_,copyText:M,isCollapsed:B,mermaidContainer:T,mermaidContent:S,modalContent:L,modalCloneWrapper:E,registerViewport:R,viewportHandle:I,viewportReady:N,modeContainerRef:P,baseFixedCode:H,getCodeWithTheme:D,zoom:j,translateX:z,translateY:F,isDragging:W,dragStart:K,showSource:U,userToggledShowSource:X,isRendering:q,renderQueue:Y,RENDER_DEBOUNCE_DELAY:300,CONTENT_STABLE_DELAY:500,lastContentLength:Z,isContentGenerating:G,contentStableTimer:J,renderRetryTimer:Q,consecutiveRenderTimeouts:ee,MAX_RENDER_TIMEOUT_RETRIES:3,requestIdle:te,debouncedProgressiveRender:ne,clearRenderRetryTimer:oe,scheduleRenderRetry:re,containerHeight:le,resizeObserver:ie,hasRenderedOnce:ae,isThemeRendering:se,svgCache:ue,lastSvgSnapshot:de,lastRenderedCode:ce,renderToken:pe,currentWorkController:me,hasRenderError:ve,savedTransformState:he,wheelListeners:fe,timeouts:ge,cancelIdle:we,previewPollTimeoutId:ye,previewPollIdleId:xe,isPreviewPolling:ke,previewPollDelay:be,previewPollController:Ce,lastPreviewStopAt:_e,allowPartialPreview:Me,withTimeoutSignal:Be,renderErrorToContainer:Te,isTimeoutError:Se,shouldSkipEventTarget:Le,onBtnHover:function(e,t,n="top"){if(Le(e.currentTarget))return;const o=e,l=null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0;$(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){O()},onCopyHover:function(e){if(Le(e.currentTarget))return;const t=M.value?C("common.copied")||"Copied":C("common.copy")||"Copy",n=e,o=null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0;$(e.currentTarget,t,"top",!1,o,r.isDark)},applyThemeTo:Ee,canApplyPartialPreview:Re,getSafePrefixCandidate:Ie,canParseOnMain:Ne,canParseOffthread:Pe,canParseOrPrefix:He,isFullscreenDisabled:De,updateContainerHeight:je,isModalOpen:$e,transformStyle:Oe,handleKeydown:ze,openModal:Ae,closeModal:We,debounce:Ke,checkContentStability:Ye,zoomIn:function(){j.value<3&&(j.value+=.1)},zoomOut:function(){j.value>.5&&(j.value-=.1)},resetZoom:function(){j.value=1,z.value=0,F.value=0},startDrag:function(e){W.value=!0,e instanceof MouseEvent?K.value={x:e.clientX-z.value,y:e.clientY-F.value}:K.value={x:e.touches[0].clientX-z.value,y:e.touches[0].clientY-F.value}},onDrag:function(e){if(!W.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),z.value=t-K.value.x,F.value=n-K.value.y},stopDrag:function(){W.value=!1},handleWheel:Ze,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(H.value)),M.value=!0,t("copy",H.value),setTimeout(()=>{M.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},exportSvg:Qe,handleExportClick:function(){var e;const n=null==(e=S.value)?void 0:e.querySelector("svg");if(!n)return void console.error("SVG element not found");const o=(new XMLSerializer).serializeToString(n),r={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:o};t("export",r),r.defaultPrevented||Qe(n,o)},handleOpenModalClick:function(){var e,n;const o=null!=(n=null==(e=S.value)?void 0:e.querySelector("svg"))?n:null,r=o?(new XMLSerializer).serializeToString(o):null,l={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:o,svgString:r};t("openModal",l),l.defaultPrevented||Ae()},handleSwitchMode:function(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};t("toggleMode",e,n),n.defaultPrevented||et(e)},switchMode:et,initMermaid:tt,renderPartial:nt,progressiveRender:ot,stopPreviewPolling:rt,cleanupAfterLoadingSettled:lt,scheduleNextPreviewPoll:it,startPreviewPolling:dt,computedButtonStyle:ct,mermaidIconUrl:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij4KICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNjYTllZTYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEuNSAyLjVjMCA2IDIuMjUgNS43NSA0IDcgLjgzLjY3IDEuMTcgMiAxIDRoM2MtLjE3LTIgLjE3LTMuMzMgMS00IDEuNzUtMS4yNSA0LTEgNC03QzEyIDIuNSAxMCAzIDggNyA2IDMgNCAyLjUgMS41IDIuNSIgLz4KPC9zdmc+Cg==",Portal:Ve}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":n.props.loading}]},[n.props.showHeader?t("div",{staticClass:"mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",class:n.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[e.$slots["header-left"]?t("div",[e._t("header-left")],2):t("div",{staticClass:"flex items-center space-x-2 overflow-hidden"},[t("img",{staticClass:"w-4 h-4 my-0",attrs:{src:n.mermaidIconUrl,alt:"Mermaid"}}),t("span",{staticClass:"text-sm font-medium font-mono truncate",class:n.props.isDark?"text-gray-400":"text-gray-600"},[e._v("Mermaid")])]),e.$slots["header-center"]?t("div",[e._t("header-center")],2):n.props.showModeToggle&&n.mermaidAvailable?t("div",{staticClass:"flex items-center space-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>n.handleSwitchMode("preview"),mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center space-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{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"}}),t("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),t("span",[e._v(e._s(n.t("common.preview")||"Preview"))])])]),t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>n.handleSwitchMode("source"),mouseenter:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},focus:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center space-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"}})]),t("span",[e._v(e._s(n.t("common.source")||"Source"))])])])]):e._e(),e.$slots["header-right"]?t("div",[e._t("header-right")],2):t("div",{staticClass:"flex items-center space-x-1"},[n.props.showCollapseButton?t("button",{class:n.computedButtonStyle,attrs:{"aria-pressed":n.isCollapsed},on:{click:function(e){n.isCollapsed=!n.isCollapsed},mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showCopyButton?t("button",{class:n.computedButtonStyle,on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExportButton&&n.mermaidAvailable?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleExportClick,mouseenter:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},focus:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),t("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):e._e(),n.props.showFullscreenButton&&n.mermaidAvailable?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleOpenModalClick,mouseenter:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},focus:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isModalOpen?t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):e._e()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}],ref:"modeContainerRef"},[n.showSource?t("div",{staticClass:"p-4",class:n.props.isDark?"bg-gray-900":"bg-gray-50"},[t("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:n.props.isDark?"text-gray-300":"text-gray-700"},[e._v(e._s(n.baseFixedCode))])]):t("div",{staticClass:"relative"},[n.props.showZoomControls?t("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[t("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},focus:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},focus:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom,mouseenter:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},focus:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")])])]):e._e(),t("div",e._g({ref:"mermaidContainer",staticClass:"min-h-[360px] relative transition-all duration-100 overflow-hidden block",class:n.props.isDark?"bg-gray-900":"bg-gray-50",style:{height:n.containerHeight},on:{mousedown:n.startDrag,mousemove:n.onDrag,mouseup:n.stopDrag,mouseleave:n.stopDrag,"&touchstart":function(e){return n.startDrag.apply(null,arguments)},"&touchmove":function(e){return n.onDrag.apply(null,arguments)},"&touchend":function(e){return n.stopDrag.apply(null,arguments)}}},n.wheelListeners),[t("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":n.isDragging},style:n.transformStyle,attrs:{"data-mermaid-wrapper":""}},[t("div",{ref:"mermaidContent",staticClass:"_mermaid w-full text-center flex items-center justify-center min-h-full"})])]),t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue"},[t("transition",{attrs:{name:"mermaid-dialog",appear:""}},[n.isModalOpen?t("div",{staticClass:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",on:{click:function(e){return e.target!==e.currentTarget?null:n.closeModal.apply(null,arguments)}}},[t("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:n.props.isDark?"bg-gray-900":"bg-white"},[t("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")]),t("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.closeModal}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),t("div",e._g({ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",on:{mousedown:n.startDrag,mousemove:n.onDrag,mouseup:n.stopDrag,mouseleave:n.stopDrag,"&touchstart":function(e){return n.startDrag.apply(null,arguments)},"&touchmove":function(e){return n.onDrag.apply(null,arguments)},"&touchend":function(e){return n.stopDrag.apply(null,arguments)}}},n.wheelListeners))])]):e._e()])],1)])],1)])])},[],!1,null,"760b25b4",null,null).exports,ct=v(p.defineComponent({__name:"MarkdownCodeBlockNode",props:{node:{type:Object,required:!0},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{type:String,default:"vitesse-dark"},lightTheme:{type:String,default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{type:[String,Number],default:void 0},maxWidth:{type:[String,Number],default:void 0},themes:{type:Array,default:void 0},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:t}){var n,o;const r=e,{t:l}=A(),i=p.ref(String(null!=(n=r.node.language)?n:"")),a=p.ref(!1),s=p.ref(!1),u=p.ref(!1),c=p.ref(null),v=p.ref(null),h=p.ref(""),f=p.ref(!1);let g;const w=p.ref(!0),y=p.ref(0),x=p.ref(14),k=p.ref(x.value),b=p.computed(()=>{const e=x.value,t=k.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0}),C=p.computed(()=>{const e=i.value.trim().toLowerCase();return Ae[e]||e.charAt(0).toUpperCase()+e.slice(1)}),_=p.computed(()=>"mermaid"===i.value.trim().toLowerCase()),M=p.computed(()=>ze(i.value.trim().toLowerCase().split(":")[0])),B=p.computed(()=>{const e=i.value.trim().toLowerCase();return r.isShowPreview&&("html"===e||"svg"===e)}),T=p.computed(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},n=t(r.minWidth),o=t(r.maxWidth);return n&&(e.minWidth=n),o&&(e.maxWidth=o),e}),S=p.computed(()=>({fontSize:`${k.value}px`}));function L(){return r.isDark?r.darkTheme:r.lightTheme}function E(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function R(e){if(null==g||g.disconnect(),g=void 0,!e)return h.value="",void(f.value=!1);h.value=`<pre class="shiki shiki-fallback"><code>${E(e)}</code></pre>`,f.value=!1}function I(){h.value="",f.value=!0}function N(){var e;const t=v.value;return!!t&&(t.childNodes.length>0||Boolean(null==(e=t.textContent)?void 0:e.trim().length))}function P(){return d(this,null,function*(){if(yield p.nextTick(),N())return void I();const e=v.value;e&&(null==g||g.disconnect(),g=new MutationObserver(()=>{N()&&(I(),null==g||g.disconnect(),g=void 0)}),g.observe(e,{childList:!0,subtree:!0}))})}let H,D,j,z,F=()=>{};const V=new Set,W=new Set,K=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:m&&"SCRIPT"===m.tagName.toUpperCase()&&m.src||new URL("exports.js",document.baseURI).href}&&Boolean(null==(o={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:o.DEV);function U(e,t=!1){var n;const[o]=String(null!=e?e:"").split(":"),r=null!=(n=null==o?void 0:o.trim().toLowerCase())?n:"";return r?!z||z.has(r)?r:(t&&K&&!V.has(r)&&(V.add(r),console.warn(`[MarkdownCodeBlockNode] Language "${r}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"}function X(e,t){return d(this,null,function*(){if(!H)return;const n=U(t,Boolean(e&&e.length));try{yield H.updateCode(e,n)}catch(o){"plaintext"!==n?(K&&!W.has(n)&&(W.add(n),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${n}", retrying as plaintext.`,o)),yield H.updateCode(e,"plaintext")):K&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",o)}})}function q(){return d(this,null,function*(){if(!D)try{const e=yield import("stream-markdown");D=e.createShikiStreamRenderer,j=e.registerHighlight,F=e.disposeHighlighter;const t=Array.isArray(e.defaultLanguages)?e.defaultLanguages:void 0;z=t?new Set(t.map(e=>e.toLowerCase())):void 0,null==j||j({themes:r.themes})}catch(e){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",e)}})}function Y(){return d(this,null,function*(){if(_.value)return F(),null==H||H.dispose(),H=void 0,void(f.value=!1);yield q(),c.value&&v.value?(null==j||j({themes:r.themes}),!H&&D&&(H=D(v.value,{theme:L()}),f.value=!0),H?!1===r.stream&&r.loading?R(r.node.code):(R(r.node.code),yield X(r.node.code,i.value),yield P()):R(r.node.code)):R(r.node.code)})}Y(),p.onMounted(()=>{Y()}),p.watch(()=>r.themes,()=>d(this,null,function*(){j&&j({themes:r.themes})})),p.watch(()=>r.loading,e=>{e||Y()}),p.watch(()=>[r.node.code,r.node.language],e=>d(this,[e],function*([e,t]){if(t!==i.value&&(i.value=t.trim()),c.value&&v.value){if(_.value)return F(),void(null==H||H.dispose());H||(R(e),yield Y()),H&&e&&(!1===r.stream&&r.loading||(R(e),yield X(e,t),yield P()))}else R(e)}));const Z=p.watch(()=>[r.darkTheme,r.lightTheme],()=>d(this,null,function*(){if(c.value&&v.value){if(_.value)return F(),null==H||H.dispose(),Z();H||(yield Y()),null==H||H.setTheme(L())}}));function G(e,t=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function J(e){return!e||e.disabled}return p.watch(()=>r.node.code,()=>d(this,null,function*(){if(s.value||!w.value)return;yield p.nextTick();const e=c.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),{__sfc:!0,props:r,emits:t,t:l,codeLanguage:i,copyText:a,isExpanded:s,isCollapsed:u,codeBlockContent:c,rendererTarget:v,fallbackHtml:h,rendererReady:f,renderObserver:g,autoScrollEnabled:w,lastScrollTop:y,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:x,codeFontSize:k,fontBaselineReady:b,displayLanguage:C,isMermaid:_,languageIcon:M,isPreviewable:B,containerStyle:T,contentStyle:S,getPreferredColorScheme:L,escapeHtml:E,renderFallback:R,clearFallback:I,hasRendererContent:N,clearFallbackWhenRendererReady:P,renderer:H,createShikiRenderer:D,registerHighlight:j,disposeHighlighter:F,registeredHighlightLanguages:z,warnedMissingLanguages:V,warnedRendererErrors:W,isDevEnv:K,normalizeRendererLanguage:U,updateRendererWithFallback:X,ensureStreamMarkdownLoaded:q,initRenderer:Y,watchTheme:Z,isAtBottom:G,handleScroll:function(){const e=c.value;if(!e||s.value)return;const t=e.scrollTop;t<y.value?w.value=!1:G(e)&&(w.value=!0),y.value=t},copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(r.node.code)),a.value=!0,t("copy",r.node.code),setTimeout(()=>{a.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})},shouldSkipEventTarget:J,onBtnHover:function(e,t,n="top"){if(J(e.currentTarget))return;const o=e,l=null!=(null==o?void 0:o.clientX)&&null!=(null==o?void 0:o.clientY)?{x:o.clientX,y:o.clientY}:void 0;$(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){O()},onCopyHover:function(e){if(J(e.currentTarget))return;const t=a.value?l("common.copied")||"Copied":l("common.copy")||"Copy",n=e,o=null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0;$(e.currentTarget,t,"top",!1,o,r.isDark)},toggleExpand:function(){s.value=!s.value;const e=c.value;e&&(s.value?(e.style.maxHeight="none",e.style.overflow="visible"):(e.style.maxHeight="500px",e.style.overflow="auto",w.value=!0,p.nextTick(()=>{e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})))},toggleHeaderCollapse:function(){u.value=!u.value},increaseCodeFont:function(){const e=Math.min(36,k.value+1);k.value=e},decreaseCodeFont:function(){const e=Math.max(10,k.value-1);k.value=e},resetCodeFont:function(){k.value=x.value},previewCode:function(){if(!B.value)return;const e=(i.value||r.node.language).toLowerCase(),n="html"===e?"HTML Preview":"SVG Preview";t("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:r.node.code,title:n})},MermaidBlockNode:dt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return n.isMermaid?t(n.MermaidBlockNode,{attrs:{node:e.node,"is-dark":n.props.isDark,loading:n.props.loading}}):t("div",{staticClass:"code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",n.props.isDark?"is-dark":""],style:n.containerStyle},[n.props.showHeader?t("div",{staticClass:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",staticStyle:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},[e._t("header-left",function(){return[t("div",{staticClass:"flex items-center space-x-2"},[t("span",{staticClass:"icon-slot h-4 w-4 flex-shrink-0",domProps:{innerHTML:e._s(n.languageIcon)}}),t("span",{staticClass:"text-sm font-medium font-mono"},[e._v(e._s(n.displayLanguage))])])]}),e._t("header-right",function(){return[t("div",{staticClass:"flex items-center space-x-2"},[t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleHeaderCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]),n.props.showFontSizeButtons&&n.props.enableFontSizeControl?[t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize<=n.codeFontMin},on:{click:function(e){return n.decreaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},focus:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"}})])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!n.fontBaselineReady||n.codeFontSize===n.defaultCodeFontSize},on:{click:function(e){return n.resetCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},focus:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}}),t("path",{attrs:{d:"M3 3v5h5"}})])])]),t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize>=n.codeFontMax},on:{click:function(e){return n.increaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},focus:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"}})])])]:e._e(),n.props.showCopyButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExpandButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isExpanded},on:{click:n.toggleExpand,mouseenter:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},focus:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isExpanded?t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})]):t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})])]):e._e(),n.isPreviewable&&n.props.showPreviewButton?t("button",{staticClass:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.preview")||"Preview"},on:{click:n.previewCode,mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{"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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{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"}}),t("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])])]):e._e()],2)]})],2):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!(n.isCollapsed||!e.stream&&e.loading),expression:"!isCollapsed && (stream ? true : !loading)"}],ref:"codeBlockContent",staticClass:"code-block-content",style:n.contentStyle,on:{scroll:n.handleScroll}},[t("div",{ref:"rendererTarget",staticClass:"code-block-render"}),n.rendererReady?e._e():t("div",{staticClass:"code-fallback-plain",domProps:{innerHTML:e._s(n.fallbackHtml)}})]),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.stream&&e.loading,expression:"!stream && loading"}],staticClass:"code-loading-placeholder"},[e._t("loading",function(){return[t("div",{staticClass:"loading-skeleton"},[t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line short"})])]},{loading:e.loading,stream:e.stream})],2)])},[],!1,null,"b4a39860",null,null).exports;let pt=null,mt=null,vt=!1;const ht=new Map,ft=new Map;let gt=5;const wt=new Set;function yt(){if(ht.size<gt&&wt.size){const t=Array.from(wt);wt.clear();for(const n of t)try{n()}catch(e){}}}let xt=null;const kt=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:m&&"SCRIPT"===m.tagName.toUpperCase()&&m.src||new URL("exports.js",document.baseURI).href}&&Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV);try{"undefined"!=typeof window&&kt&&Promise.resolve().then(()=>require("./performance-monitor.js")).then(e=>{xt=e.perfMonitor})}catch(Dt){}function bt(e,t=!0,n=2e3,o){return d(this,null,function*(){const r=performance.now();if(!J()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(mt)return Promise.reject(mt);const l=`${t?"d":"i"}:${e}`,i=ft.get(l);if(i)return xt&&xt.recordRender({type:"cache-hit",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!0}),Promise.resolve(i);const a=pt||(mt=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),mt.name="WorkerInitError",mt.code="WORKER_INIT_ERROR",null);if(!a)return Promise.reject(mt);if(ht.size>=gt){const t=new Error("Worker busy");return t.name="WorkerBusy",t.code="WORKER_BUSY",t.busy=!0,t.inFlight=ht.size,t.max=gt,xt&&xt.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(t)}return new Promise((l,i)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void i(e)}const s=Math.random().toString(36).slice(2),u=globalThis.setTimeout(()=>{ht.delete(s);const t=new Error("Worker render timed out");t.name="WorkerTimeout",t.code="WORKER_TIMEOUT",xt&&xt.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!1,error:"timeout"}),i(t),yt()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(u),ht.has(s)&&ht.delete(s);const e=new Error("Aborted");e.name="AbortError",i(e),yt()},{once:!0});const d=l,c=i;ht.set(s,{resolve:t=>{xt&&xt.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!0}),d(t)},reject:t=>{xt&&xt.recordRender({type:"worker",duration:performance.now()-r,formulaLength:e.length,timestamp:Date.now(),success:!1,error:(null==t?void 0:t.message)||String(t)}),c(t)},timeoutId:u}),a.postMessage({id:s,content:e,displayMode:t})})})}function Ct(e,t=!0,n){const o=`${t?"d":"i"}:${e}`;if(ft.set(o,n),ft.size>200){const e=ft.keys().next().value;ft.delete(e)}}const _t="WORKER_BUSY";function Mt(e=2e3,t){return ht.size<gt?Promise.resolve():new Promise((n,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),wt.delete(i),n())};if(wt.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,wt.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>yt()),t){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),wt.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const Bt={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Tt(e){return d(this,arguments,function*(e,t=!0,n={}){var o,r,l,i;if(!J()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=n.timeout)?o:Bt.timeout,s=null!=(r=n.waitTimeout)?r:Bt.waitTimeout,u=null!=(l=n.backoffMs)?l:Bt.backoffMs,d=null!=(i=n.maxRetries)?i:Bt.maxRetries,c=n.signal;let p=0;for(;;){if(null==c?void 0:c.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield bt(e,t,a,c)}catch(m){if((null==m?void 0:m.code)!==_t||p>=d)throw m;if(p++,yield Mt(s,c).catch(()=>{}),null==c?void 0:c.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*p)))}}})}const St=v(p.defineComponent({__name:"MathBlockNode",props:{node:null},setup(e){const t=e,n=p.ref(null),o=p.ref(null);let r=!1,l=0,i=!1,a=null;const s=V();let u=null;const c=p.ref(!0);function m(){return d(this,null,function*(){if(!o.value||i)return;if(!t.node.content)return c.value=!1,o.value.textContent=t.node.raw,void(r=!0);if(!r)try{!u&&n.value&&(u=s(n.value)),yield null==u?void 0:u.whenVisible}catch(Dt){}a&&(a.abort(),a=null);const e=++l,p=new AbortController;a=p,Tt(t.node.content,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:p.signal}).then(t=>{i||e!==l||o.value&&(o.value.innerHTML=t,r=!0,c.value=!1)}).catch(n=>d(this,null,function*(){if(i||e!==l)return;if(!o.value)return;const a=(null==n?void 0:n.code)||(null==n?void 0:n.name),s="KATEX_DISABLED"===a;if("WORKER_INIT_ERROR"===a||(null==n?void 0:n.fallbackToRenderer)||a===_t||"WORKER_TIMEOUT"===a){const e=yield Q();if(e){try{const n=e.renderToString(t.node.content,{throwOnError:t.node.loading,displayMode:!0});o.value.innerHTML=n,r=!0,c.value=!1,Ct(t.node.content,!0,n)}catch(Dt){}return}}if(s)return c.value=!1,void(o.value.textContent=t.node.raw);r||(c.value=!0),t.node.loading||(c.value=!1,o.value.textContent=t.node.raw)}))})}return p.watch(()=>t.node.content,()=>{m()}),p.onMounted(()=>{m()}),p.onBeforeUnmount(()=>{var e;i=!0,a&&(a.abort(),a=null),null==(e=null==u?void 0:u.destroy)||e.call(u),u=null}),{__sfc:!0,props:t,containerEl:n,mathBlockElement:o,hasRenderedOnce:r,currentRenderId:l,isUnmounted:i,currentAbortController:a,registerVisibility:s,visibilityHandle:u,renderingLoading:c,renderMath:m}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerEl",staticClass:"math-block text-center overflow-x-auto relative min-h-[40px]"},[t("transition",{attrs:{name:"math-fade"}},[n.renderingLoading?t("div",{staticClass:"math-loading-overlay"},[t("div",{staticClass:"math-loading-spinner"})]):e._e()]),t("div",{ref:"mathBlockElement",class:{"math-rendering":n.renderingLoading}})],1)},[],!1,null,"83ce9de4",null,null).exports,Lt=v(p.defineComponent({__name:"MathInlineNode",props:{node:null},setup(e){const t=e,n=p.ref(null),o=p.ref(null);let r=!1,l=0,i=!1,a=null;const s=p.ref(!0),u=V();let c=null;function m(){return d(this,null,function*(){if(!o.value||i)return;if(!t.node.content)return s.value=!1,o.value.textContent=t.node.raw,void(r=!0);a&&(a.abort(),a=null);const e=++l,p=new AbortController;if(a=p,!r)try{!c&&n.value&&(c=u(n.value)),yield null==c?void 0:c.whenVisible}catch(Dt){}Tt(t.node.content,!1,{timeout:1500,waitTimeout:0,maxRetries:0,signal:p.signal}).then(t=>{i||e!==l||o.value&&(o.value.innerHTML=t,s.value=!1,r=!0)}).catch(n=>d(this,null,function*(){if(i||e!==l)return;if(!o.value)return;const a=(null==n?void 0:n.code)||(null==n?void 0:n.name),u="KATEX_DISABLED"===a;if("WORKER_INIT_ERROR"===a||(null==n?void 0:n.fallbackToRenderer)||a===_t||"WORKER_TIMEOUT"===a){const e=yield Q();if(e){try{const n=e.renderToString(t.node.content,{throwOnError:t.node.loading,displayMode:!1});s.value=!1,o.value.innerHTML=n,r=!0,Ct(t.node.content,!1,n)}catch(Dt){}return}}if(u)return s.value=!1,void(o.value.textContent=t.node.raw);r||(s.value=!u),t.node.loading?u&&(o.value.textContent=t.node.raw):(s.value=!1,o.value.textContent=t.node.raw)}))})}return p.watch(()=>t.node.content,()=>{m()}),p.onMounted(()=>{m()}),p.onBeforeUnmount(()=>{var e;i=!0,a&&(a.abort(),a=null),null==(e=null==c?void 0:c.destroy)||e.call(c),c=null}),{__sfc:!0,props:t,containerEl:n,mathElement:o,hasRenderedOnce:r,currentRenderId:l,isUnmounted:i,currentAbortController:a,renderingLoading:s,registerVisibility:u,visibilityHandle:c,renderMath:m}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{ref:"containerEl",staticClass:"math-inline-wrapper"},[t("span",{directives:[{name:"show",rawName:"v-show",value:!n.renderingLoading,expression:"!renderingLoading"}],ref:"mathElement",staticClass:"math-inline"}),n.renderingLoading?t("transition",{attrs:{name:"table-node-fade"}},[t("span",{staticClass:"math-inline__loading",attrs:{role:"status","aria-live":"polite"}},[e._t("loading",function(){return[t("span",{staticClass:"math-inline__spinner animate-spin",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"sr-only"},[e._v("Loading")])]},{isLoading:n.renderingLoading})],2)]):e._e()],1)},[],!1,null,"65c5e97c",null,null).exports;function Et(e){return JSON.stringify(e)}function Rt(e){var t;const n=null!=(t=e.mode)?t:"classic",o=e.katexUrl,r=e.mhchemUrl,l=Et(s({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=Et(o),a=r?Et(r):'""';return"module"===n?`\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 = ${a}\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 = ${a}\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 It(e){return JSON.stringify(e)}function Nt(e){var t;const n=null!=(t=e.mode)?t:"module",o=It(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(${It(s({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"===n?`\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()}const Pt={AdmonitionNode:Ee,BlockquoteNode:h,CheckboxNode:f,CodeBlockNode:Ke,DefinitionListNode:g,EmojiNode:w,FootnoteNode:ge,FootnoteReferenceNode:b,FootnoteAnchorNode:fe,HardBreakNode:we,HeadingNode:ye,HtmlInlineNode:C,HighlightNode:ve,ImageNode:W,InlineCodeNode:_,PreCodeNode:Ce,InsertNode:me,LinkNode:pe,ListItemNode:xe,ListNode:ke,MarkdownCodeBlockNode:ct,MathBlockNode:St,MathInlineNode:Lt,MermaidBlockNode:dt,ParagraphNode:be,StrikethroughNode:ce,StrongNode:de,SubscriptNode:ue,SuperscriptNode:se,TableNode:_e,TextNode:oe,ThematicBreakNode:Me,ReferenceNode:ae},Ht={install(e,t){Object.entries(Pt).forEach(([t,n])=>{e.component(t,n)}),e.component("MarkdownRender",Le),e.component("NodeRenderer",Le),(null==t?void 0:t.getLanguageIcon)&&De(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&c.setDefaultMathOptions(t.mathOptions)}};exports.AdmonitionNode=Ee,exports.BlockquoteNode=h,exports.CheckboxNode=f,exports.CodeBlockNode=Ke,exports.DefinitionListNode=g,exports.EmojiNode=w,exports.FootnoteAnchorNode=fe,exports.FootnoteNode=ge,exports.FootnoteReferenceNode=b,exports.HardBreakNode=we,exports.HeadingNode=ye,exports.HighlightNode=ve,exports.HtmlInlineNode=C,exports.ImageNode=W,exports.InlineCodeNode=_,exports.InsertNode=me,exports.LinkNode=pe,exports.ListItemNode=xe,exports.ListNode=ke,exports.MERMAID_DISABLED_CODE=lt,exports.MERMAID_WORKER_BUSY_CODE=rt,exports.MarkdownCodeBlockNode=ct,exports.MathBlockNode=St,exports.MathInlineNode=Lt,exports.MermaidBlockNode=dt,exports.NodeRenderer=Le,exports.ParagraphNode=be,exports.Portal=Ve,exports.PreCodeNode=Ce,exports.ReferenceNode=ae,exports.StrikethroughNode=ce,exports.StrongNode=de,exports.SubscriptNode=ue,exports.SuperscriptNode=se,exports.TableNode=_e,exports.TextNode=oe,exports.ThematicBreakNode=Me,exports.VueRendererMarkdown=Ht,exports.WORKER_BUSY_CODE=_t,exports.buildKaTeXCDNWorkerSource=Rt,exports.buildMermaidCDNWorkerSource=Nt,exports.canParseOffthread=at,exports.clearGlobalCustomComponents=function(){delete x[y]},exports.clearKaTeXWorker=function(){var e;pt&&(null==(e=pt.terminate)||e.call(pt)),pt=null,mt=null},exports.clearMermaidWorker=function(){var e;if(Qe)try{for(const[e,t]of tt.entries())t.reject(new Error("Worker cleared"));tt.clear(),null==(e=Qe.terminate)||e.call(Qe)}catch(Dt){}Qe=null,et=null},exports.createKaTeXWorkerFromCDN=function(e){var t,n;const o=Rt(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 a="module"===(null!=(t=e.mode)?t:"classic")?u(s({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,d=new Worker(l,a);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(Dt){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(Dt){}}},source:o}},exports.createMermaidWorkerFromCDN=function(e){var t,n;const o=Nt(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 a="module"===(null!=(t=e.mode)?t:"module")?u(s({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,d=new Worker(l,a);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(Dt){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(Dt){}}},source:o}},exports.disableKatex=function(){G(null)},exports.disableMermaid=function(){Ye(null)},exports.enableKatex=function(e){G(null!=e?e:Z)},exports.enableMermaid=function(e){Ye(null!=e?e:Ue)},exports.findPrefixOffthread=st,exports.getCustomNodeComponents=k,exports.getKaTeXBackpressureDefaults=function(){return s({},Bt)},exports.getKaTeXWorkerLoad=function(){return{inFlight:ht.size,max:gt}},exports.getLanguageIcon=ze,exports.getMermaidWorkerLoad=function(){return{inFlight:tt.size,max:nt}},exports.getUseMonaco=Pe,exports.isKaTeXWorkerBusy=function(){return ht.size>=gt},exports.isKatexEnabled=J,exports.isMermaidEnabled=Ze,exports.languageMap=Ae,exports.normalizeComponent=v,exports.normalizeLanguageIdentifier=$e,exports.removeCustomComponents=function(e){if(e===y)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete x[e]},exports.renderKaTeXInWorker=bt,exports.renderKaTeXWithBackpressure=Tt,exports.resolveMonacoLanguageId=Oe,exports.setCustomComponents=function(e,t){"string"==typeof e?x[e]=t||{}:x[y]=e||{}},exports.setDefaultI18nMap=function(e){Object.assign(z,e)},exports.setKaTeXBackpressureDefaults=function(e){null!=e.timeout&&(Bt.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Bt.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Bt.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Bt.maxRetries=Math.max(0,Math.floor(e.maxRetries)))},exports.setKaTeXCache=Ct,exports.setKaTeXWorker=function(e){pt=e,mt=null,pt.onmessage=e=>{const{id:t,html:n,error:o}=e.data,r=ht.get(t);if(r)if(ht.delete(t),clearTimeout(r.timeoutId),yt(),o)r.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(ft.set(e,n),ft.size>200){const e=ft.keys().next().value;ft.delete(e)}}r.resolve(n)}},pt.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of ht.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));ht.clear(),yt()}},exports.setKaTeXWorkerDebug=function(e){vt=!!e,pt&&pt.postMessage({type:"init",debug:vt})},exports.setKaTeXWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(gt=Math.floor(e))},exports.setKatexLoader=G,exports.setLanguageIconResolver=De,exports.setMermaidLoader=Ye,exports.setMermaidWorker=function(e){Qe=e,et=null;const t=e;Qe.onmessage=e=>{if(Qe!==t)return;const{id:n,ok:o,result:r,error:l}=e.data,i=tt.get(n);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Qe.onerror=e=>{var n,o;if(Qe===t)if(0!==tt.size){try{ot?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[t,n]of tt.entries())n.reject(new Error(`Worker error: ${e.message}`));tt.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Qe.onmessageerror=e=>{var n,o;if(Qe===t)if(0!==tt.size){try{ot?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(Dt){}for(const[e,t]of tt.entries())t.reject(new Error("Worker messageerror"));tt.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}},exports.setMermaidWorkerClientDebug=function(e){ot=!!e},exports.setMermaidWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(nt=Math.floor(e))},exports.terminateWorker=ut,exports.waitForKaTeXWorkerSlot=Mt;