markstream-vue2 0.0.46-beta.1 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +249 -23
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/tailwind.ts +1 -1
- package/dist/types/components/PreCodeNode/PreCodeNode.vue.d.ts +2 -0
- package/dist/types/types/component-props.d.ts +2 -0
- package/package.json +3 -3
- package/dist/chunks/cssMode-2f534f78.cjs +0 -1
- package/dist/chunks/cssMode-3f97e3da.js +0 -206
- package/dist/chunks/htmlMode-341fd8a0.cjs +0 -1
- package/dist/chunks/htmlMode-980b2a3d.js +0 -222
- package/dist/chunks/index.legacy-1f634d9d.js +0 -199274
- package/dist/chunks/index.legacy-b598deaf.cjs +0 -1
- package/dist/chunks/jsonMode-9ba44ad3.js +0 -921
- package/dist/chunks/jsonMode-d32122b2.cjs +0 -1
- package/dist/chunks/lspLanguageFeatures-7b72a0c0.cjs +0 -1
- package/dist/chunks/lspLanguageFeatures-8d6ce48e.js +0 -1842
- package/dist/chunks/tsMode-eb76a00c.js +0 -1337
- package/dist/chunks/tsMode-fbe6879d.cjs +0 -1
- package/dist/chunks/workers-ac3ab4dd.cjs +0 -1
- package/dist/chunks/workers-c9c93e2c.js +0 -71
- package/dist/workers/css.worker.js +0 -1
- package/dist/workers/html.worker.js +0 -1
- package/dist/workers/json.worker.js +0 -1
- package/dist/workers/ts.worker.js +0 -6
package/dist/index.cjs
CHANGED
|
@@ -1 +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=Math.pow,s=(e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,u=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&s(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&s(e,n,t[n]);return e},c=(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())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("stream-markdown-parser"),p=require("vue-demi"),f=require("markstream-core"),v=require("@floating-ui/dom");var h="undefined"!=typeof document?document.currentScript:null;function g(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const y=g(p);function w(e,t){if(null==e)return!1;const n=typeof e;return("object"===n||"function"===n)&&t in e}function x(e){return function(e){const t=function(e){const t="string"==typeof e?e:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}(e);return null!=t&&t<7}(function(e){var t,n,o,r,l,i,a,s,u;const c=null==(n=null==(t=null==e?void 0:e.$options)?void 0:t._base)?void 0:n.version;if("string"==typeof c&&c)return c;const d=null==(l=null==(r=null==(o=null==e?void 0:e.$root)?void 0:o.$options)?void 0:r._base)?void 0:l.version;if("string"==typeof d&&d)return d;if(w(e,"$")){const t=null==(s=null==(a=null==(i=e.$)?void 0:i.appContext)?void 0:a.app)?void 0:s.version;if("string"==typeof t&&t)return t}if(w(e,"constructor")){const t=null==(u=e.constructor)?void 0:u.version;if("string"==typeof t&&t)return t}if(w(e,"version")){const t=e.version;if("string"==typeof t&&t)return t}return""}(e))}function k(e){return e.slice(2).replace(/^[A-Z]/,e=>e.toLowerCase()).replace(/([A-Z])/g,"-$1").toLowerCase()}function M(e){if(w(e,"$listeners")){const t=e.$listeners;if(t&&"object"==typeof t)return t}if(!w(e,"$attrs"))return{};const t=e.$attrs;if(!t||"object"!=typeof t)return{};const n={};for(const[o,r]of Object.entries(t))/^on[A-Z]/.test(o)&&("function"==typeof r||Array.isArray(r)&&r.every(e=>"function"==typeof e))&&(n[k(o)]=r);return n}function b(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 c=u.render;u.render=function(e,t){return s.call(t),c(e,t)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,s):[s]}return{exports:e,options:u}}const C=b(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,T=b(p.defineComponent({__name:"DefinitionListNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>x(null==n?void 0:n.proxy)?Rt:Qt),r=p.computed(()=>t.node.items.flatMap((e,n)=>[{key:`definition-term-${t.indexKey}-${n}`,tag:"dt",className:"definition-term",nodes:e.term},{key:`definition-desc-${t.indexKey}-${n}`,tag:"dd",className:"definition-desc",nodes:e.definition}]));return{__sfc:!0,props:t,instance:n,nestedRenderer:o,definitionEntries:r}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("dl",{staticClass:"definition-list"},e._l(n.definitionEntries,function(o){return t(o.tag,{key:o.key,tag:"component",class:o.className},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":o.key,nodes:o.nodes,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),1)},[],!1,null,"b089ea12",null,null).exports,N=b(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,_="__global__",D="__MARKSTREAM_VUE2_CUSTOM_COMPONENTS_STORE__",S=(()=>{const e=globalThis;if(e[D])return e[D];const t={scopedCustomComponents:{},revision:p.shallowRef(0)};return e[D]=t,t})(),I=S.revision;function j(e){const t=S.scopedCustomComponents[_]||{};if(!e)return t;const n=S.scopedCustomComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?u(u({},t),n):t:n}const E=b(p.defineComponent({__name:"FootnoteReferenceNode",props:{node:null},setup(e){const t=e,n=`#fnref--${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,"4da20e16",null,null).exports,L=function(){var e,t,n;const o=y,r=e=>"function"==typeof e&&"function"==typeof e.extend,l=[o,null==o?void 0:o.default,null==(e=null==o?void 0:o.default)?void 0:e.default,null==(n=null!=(t=null==o?void 0:o.default)?t:o)?void 0:n.default,null==o?void 0:o.Vue2,null==o?void 0:o.Vue];for(const a of l){const e=r(a)?a:r(null==a?void 0:a.default)?a.default:null;if(e)try{const t=new e;if("function"==typeof t.$createElement)return t.$createElement.bind(t)}catch(i){}}return null}();function B(e,t,n,o){if(e)return e(t,n,o);try{return p.h(t,n,o)}catch(r){}try{return p.h(t,n,o)}catch(r){}return L?L(t,n,o):null}const A=(()=>{var e;try{return Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV)}catch(t){}return!1})();function O(e){A&&console.warn(e)}function z(e){return m.sanitizeHtmlAttrs(e)}function P(e,t,n=!1){const o=Object.entries(null!=t?t:{}),r=o.length>0?o.map(([e,t])=>""===t?` ${e}`:` ${e}="${t}"`).join(""):"";return n?`<${e}${r} />`:`<${e}${r}>`}function R(e,t){Array.isArray(t)?e.push(...t):null!=t&&e.push(t)}function H(e,t,n,o,a,s="safe",u=!1){const c=function(e,t){return m.isCustomHtmlComponentTag(e,t)}(e,o);if(m.BLOCKED_HTML_TAGS.has(e.toLowerCase())||!c&&m.isHtmlTagHardBlocked(e,s))return null;if(!c&&m.isHtmlTagBlocked(e,s))return u?[P(e,t,!0)]:[P(e,t),...n,`</${e}>`];const d=m.sanitizeHtmlAttrs(t,s,e);if(c){const t=o[e]||o[e.toLowerCase()],r=function(e){return m.convertHtmlAttrsToProps(e)}(d);return B(a,t,r,n.length>0?n:void 0)}{const t=d,{innerHTML:o}=t;return B(a,e,((e,t)=>{var n={};for(var o in e)l.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&r)for(var o of r(e))t.indexOf(o)<0&&i.call(e,o)&&(n[o]=e[o]);return n})(t,["innerHTML"]),n.length>0?n:void 0)}}function $(e,t){return m.hasCustomHtmlComponents(e,t)}function U(e,t,n,o="safe"){if(!e)return[];try{const r=function(e,t,n,o="safe"){const r=[],l=[];for(const i of e)if("text"===i.type)(r.length>0?r[r.length-1].children:l).push(i.content);else if("self_closing"===i.type){const e=H(i.tagName,i.attrs||{},[],t,n,o,!0);R(r.length>0?r[r.length-1].children:l,e)}else if("tag_open"===i.type)r.push({tagName:i.tagName,children:[],attrs:i.attrs});else if("tag_close"===i.type){const e=i.tagName.toLowerCase();let a=-1;for(let t=r.length-1;t>=0;t--)if(r[t].tagName.toLowerCase()===e){a=t;break}if(-1!==a)for(;r.length>a;){const i=r.pop(),s=H(i.tagName,i.attrs||{},i.children,t,n,o);r.length>0?R(r[r.length-1].children,s):R(l,s),i.tagName.toLowerCase()!==e&&r.length>a&&O(`Auto-closing unclosed tag: <${i.tagName}>`)}else O(`Ignoring closing tag with no matching opening tag: </${i.tagName}>`)}for(;r.length>0;){const e=r.pop();R(l,H(e.tagName,e.attrs||{},e.children,t,n,o)),O(`Auto-closing unclosed tag: <${e.tagName}>`)}return l}(m.tokenizeHtml(e),t,n,o);return r}catch(l){return r=l,A&&console.error("Failed to parse HTML to VNodes:",r),null}var r}const F=b(p.defineComponent({__name:"HtmlInlineNode",props:{node:null,customId:null,htmlPolicy:null},setup(e){const t=e,n=p.inject("markstreamHtmlPolicy",void 0),o=p.computed(()=>{var e,o;return null!=(o=null!=(e=t.htmlPolicy)?e:null==n?void 0:n.value)?o:"safe"}),r=p.computed(()=>j(t.customId)),l=p.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0},htmlPolicy:{type:String,default:"safe"}},render(){return U(this.content,this.customComponents,void 0,this.htmlPolicy)||[]}}),i=p.computed(()=>{const e=t.node.content;return e?"escape"===o.value?{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:t.node.loading&&!t.node.autoClosed?{mode:"text",content:e}:$(e,r.value)?{mode:"dynamic",content:e}:{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:{mode:"html",content:""}});return{__sfc:!0,props:t,inheritedHtmlPolicy:n,resolvedHtmlPolicy:o,customComponents:r,DynamicRenderer:l,renderMode:i}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return"dynamic"===n.renderMode.mode?t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading}},[t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents,"html-policy":n.resolvedHtmlPolicy}})],1):"text"===n.renderMode.mode?t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading}},[e._v(e._s(n.renderMode.content))]):t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading},domProps:{innerHTML:e._s(n.renderMode.content)}})},[],!1,null,"e6ed4c9f",null,null).exports,Y=b(p.defineComponent({__name:"InlineCodeNode",props:{node:null},setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>{var e,t;return null!=(t=null==(e=null==n?void 0:n.proxy)?void 0:e.$attrs)?t:{}}),r=p.inject("markstreamFade",void 0),l=p.inject("markstreamTextStreamState",void 0),i=p.computed(()=>{const e=o.value.fade;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),a=p.computed(()=>"boolean"==typeof i.value?i.value:"boolean"!=typeof(null==r?void 0:r.value)||r.value),s=p.computed(()=>{var e;const t=null!=(e=o.value["index-key"])?e:o.value.indexKey;return null==t||""===t?"":String(t)}),u=p.ref(t.node.code),c=p.ref(""),d=p.ref(0);function m(){return u.value+c.value}function v(e){u.value=e,c.value=""}p.watch([()=>t.node.code,s,a],([e])=>{const t=String(null!=e?e:""),n=m(),o=s.value,r=o?null==l?void 0:l.get(o):void 0,i=null!=r?r:n,p=f.resolveStreamingTextState({nextContent:t,previousContent:i,typewriterEnabled:a.value});u.value=p.settledContent,c.value=p.streamedDelta,p.appended&&(d.value+=1),o&&(null==l||l.set(o,t))},{immediate:!0}),p.watch(a,e=>{e||v(m())});const h=p.computed(()=>d.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return{__sfc:!0,props:t,instance:n,attrs:o,inheritedFade:r,inheritedTextStreamState:l,explicitFade:i,fadeEnabled:a,streamStateKey:s,settledCode:u,streamedDelta:c,streamFadeVersion:d,getRenderedContent:m,setFullContent:v,settleStreamedDelta:function(){c.value&&(u.value=m(),c.value="")},streamedDeltaClass:h}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("code",{staticClass:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},[n.settledCode?t("span",[e._v(e._s(n.settledCode))]):e._e(),n.streamedDelta?t("span",{staticClass:"inline-code-stream-delta",class:[n.streamedDeltaClass],on:{animationend:n.settleStreamedDelta}},[e._v(" "+e._s(n.streamedDelta)+" ")]):e._e()])},[],!1,null,"820dbd10",null,null).exports,W=p.ref(!1),K=p.ref(""),V=p.ref("top"),Q=p.ref(null),X=p.ref(null),q=p.ref(null),Z=p.ref(null),G=p.ref(null);let J=null,ee=null;function te(){J&&(clearTimeout(J),J=null),ee&&(clearTimeout(ee),ee=null)}let ne=!1,oe=null;function re(){return ne||"undefined"==typeof document?Promise.resolve():oe||(oe=Promise.resolve().then(()=>uo).then(e=>{var t;ne=!0;const n=null!=(t=null==e?void 0:e.default)?t:e,o=document.createElement("div");o.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(o);const r=function(){var e,t,n,o;const r=y,l=e=>"function"==typeof e&&"function"==typeof e.extend,i=[r,null==r?void 0:r.default,null==(e=null==r?void 0:r.default)?void 0:e.default,null==(n=null!=(t=null==r?void 0:r.default)?t:r)?void 0:n.default,null==r?void 0:r.Vue2,null==r?void 0:r.Vue];for(const a of i){if(l(a))return a;if(l(null==a?void 0:a.default))return a.default}return null!=(o=null==r?void 0:r.default)?o:r}();(new(r.extend({render(e){var t;return e(n,{props:{visible:W.value,anchorEl:Q.value,content:K.value,placement:V.value,id:X.value,originX:q.value,originY:Z.value,isDark:null!=(t=G.value)?t:void 0}})}}))).$mount(o)}).catch(e=>{oe=null,ne=!1,console.warn("[markstream-vue2] Failed to load Tooltip component. Tooltips will be disabled.",e)}),oe)}function le(e,t,n="top",o=!1,r,l){if(!e)return;re(),te();const i=()=>{var o,i;X.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Q.value=e,K.value=t,V.value=n,q.value=null!=(o=null==r?void 0:r.x)?o:null,Z.value=null!=(i=null==r?void 0:r.y)?i:null,G.value="boolean"==typeof l?l:null,W.value=!0;try{e.setAttribute("aria-describedby",X.value)}catch(a){}};o?i():J=setTimeout(i,80)}function ie(e=!1){te();const t=()=>{if(Q.value&&X.value)try{Q.value.removeAttribute("aria-describedby")}catch(e){}W.value=!1,Q.value=null,X.value=null,q.value=null,Z.value=null};e?t():ee=setTimeout(t,120)}const ae={"common.copy":"Copy","common.copied":"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.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},se=e=>{var t;return null!=(t=ae[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)};function ue(){try{const n=globalThis.$vueI18nUse||null;if(n&&"function"==typeof n)try{const t=n();if(t&&"function"==typeof t.t)return e={t:t.t.bind(t),te:"function"==typeof t.te?t.te.bind(t):void 0},{t(t){if(e.te&&ae[t]&&!e.te(t))return se(t);const n=e.t(t);return n===t&&ae[t]?se(t):n}}}catch(t){}}catch(t){}var e;return{t:se}}const ce=b(p.defineComponent({__name:"ImageNode",props:{node:null,fallbackSrc:{default:""},lazy:{type:Boolean,default:!0},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(""),i=p.ref("primary"),a=p.computed(()=>m.sanitizeImageSrc(n.node.src)),s=p.computed(()=>m.sanitizeImageSrc(n.fallbackSrc)),u=p.computed(()=>l.value),c=p.computed(()=>!n.node.loading&&"failed"!==i.value&&l.value.length>0),d=p.computed(()=>!n.node.loading&&"failed"===i.value),{t:f}=ue();return p.watch([a,s,()=>n.node.loading],()=>(o.value=!1,r.value=!1,n.node.loading||a.value?(l.value=a.value,void(i.value="primary")):s.value?(l.value=s.value,void(i.value="fallback")):(l.value="",i.value="failed",void(r.value=!0))),{immediate:!0}),{__sfc:!0,props:n,emit:t,imageLoaded:o,hasError:r,activeSrc:l,imageStage:i,safeNodeSrc:a,safeFallbackSrc:s,displaySrc:u,showImage:c,showError:d,handleImageError:function(){if("primary"===i.value&&s.value&&s.value!==l.value)return i.value="fallback",l.value=s.value,o.value=!1,void(r.value=!1);i.value="failed",r.value=!0,t("error",l.value)},handleImageLoad:function(){o.value=!0,r.value=!1,t("load",u.value)},handleClick:function(e){e.preventDefault(),o.value&&!r.value&&t("click",[e,u.value])},t:f}}}),function(){var e,t,n,o,r,l=this,i=l._self._c,a=l._self._setupProxy;return i("transition",{attrs:{name:"img-switch",mode:"out-in"}},[a.showImage?i("img",{key:"image",staticClass:"image-node__img h-auto rounded-lg transition-opacity duration-200 ease-in-out image-node__img--inline",class:{"opacity-0":!a.imageLoaded,"opacity-100":a.imageLoaded,"cursor-pointer":a.imageLoaded},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}}):l.node.loading&&!a.hasError?i("span",{key:"placeholder",staticClass:"placeholder-layer placeholder-layer--inline inline-flex items-center justify-center gap-2"},[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})]:[i("span",{staticClass:"text-sm text-gray-500"},[l._v(l._s(l.node.raw))])]],2):a.showError?i("span",{key:"error",staticClass:"image-node__error image-node__error--inline 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})],2):l._e()])},[],!1,null,"05ffe4c4",null,null).exports;let de=null,me=!1,pe=he;function fe(e){var t;const n=null!=(t=null==e?void 0:e.default)?t:e;return n&&"function"==typeof n.renderToString?n:null}function ve(){try{const e=globalThis;return fe(null==e?void 0:e.katex)}catch(e){return null}}function he(){return(()=>d(this,null,function*(){const e=ve();if(e)return e;const t=yield import("katex");try{yield Promise.resolve().then(()=>require("./chunks/mhchem-4785e7bc.cjs"))}catch(n){}return fe(t)}))()}function ge(e){pe=e,de=null,me=!1}function ye(){return"function"==typeof pe}function we(){return d(this,null,function*(){var e;const t=ve();if(t)return de=t,de;if(de)return de;if(me)return null;const n=pe;if(!n)return me=!0,null;try{const t=yield n();if(t)return de=null!=(e=fe(t))?e:t,de}catch(o){}return me=!0,null})}const xe=p.shallowRef(!1);let ke=null;const Me=b(p.defineComponent({__name:"TextNode",props:{node:null},emits:["copy"],setup(e){const t=e,n=(ke||(ke=we().then(e=>{xe.value=!!e}).catch(()=>{xe.value=!1})),p.readonly(xe)),o=p.getCurrentInstance(),r=p.computed(()=>{var e,t;return null!=(t=null==(e=null==o?void 0:o.proxy)?void 0:e.$attrs)?t:{}}),l=p.inject("markstreamFade",void 0),i=p.inject("markstreamTextStreamState",void 0),a=p.inject("markstreamStreamVersion",void 0),s=p.computed(()=>{const e=r.value.fade;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),u=p.computed(()=>"boolean"==typeof s.value?s.value:"boolean"!=typeof(null==l?void 0:l.value)||l.value),c=p.computed(()=>{var e;const t=null!=(e=r.value["index-key"])?e:r.value.indexKey;return null==t||""===t?"":String(t)}),d=p.ref(t.node.content),m=p.ref(""),v=p.ref(0);function h(){return d.value+m.value}function g(e){d.value=e,m.value=""}function y(){m.value&&(d.value=h(),m.value="")}p.watch([()=>t.node.content,c,u,()=>null==a?void 0:a.value],([e])=>{const t=String(null!=e?e:""),n=h(),o=c.value,r=o?null==i?void 0:i.get(o):void 0,l=null!=r?r:n;if(!u.value)return g(t),void(o&&(null==i||i.set(o,t)));if(t===l)return m.value?y():n!==t&&g(t),void(o&&(null==i||i.set(o,t)));const a=f.resolveStreamingTextState({nextContent:t,previousContent:l,typewriterEnabled:u.value});d.value=a.settledContent,m.value=a.streamedDelta,a.appended&&(v.value+=1),o&&(null==i||i.set(o,t))},{immediate:!0}),p.watch(u,e=>{e||g(h())});const w=p.computed(()=>v.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return{__sfc:!0,props:t,katexReady:n,instance:o,attrs:r,inheritedFade:l,inheritedTextStreamState:i,inheritedStreamVersion:a,explicitFade:s,fadeEnabled:u,streamStateKey:c,settledContent:d,streamedDelta:m,streamFadeVersion:v,getRenderedContent:h,setFullContent:g,settleStreamedDelta:y,streamedDeltaClass:w}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{staticClass:"whitespace-pre-wrap break-words text-node",class:[n.katexReady&&e.node.center?"text-node-center":""]},[n.settledContent?t("span",[e._v(e._s(n.settledContent))]):e._e(),n.streamedDelta?t("span",{staticClass:"text-node-stream-delta",class:[n.streamedDeltaClass],on:{animationend:n.settleStreamedDelta}},[e._v(" "+e._s(n.streamedDelta)+" ")]):e._e()])},[],!1,null,"e8e0f51e",null,null).exports;function be(e){return t=>{var n,o;return p.h(Me,c(u({},t),{node:c(u({},t.node),{content:null!=(o=t.node.raw)?o:e(String(null!=(n=t.node.content)?n:""))})}))}}function Ce(){return d(this,null,function*(){var e,t,n;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 be(e=>`$${e}$`);try{if(yield we()){const e=yield Promise.resolve().then(()=>require("./chunks/index-11432088.cjs"));return null!=(n=e.default)?n:e}}catch(o){console.warn('[markstream-vue2] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',o)}return be(e=>`$${e}$`)})}function Te(){return d(this,null,function*(){var e;try{if(yield we()){const t=yield Promise.resolve().then(()=>require("./chunks/index-fb457079.cjs"));return null!=(e=t.default)?e:t}}catch(t){console.warn('[markstream-vue2] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return be(e=>`$$${e}$$`)})}const Ne=b(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-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--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,null,null,null).exports,_e=b(p.defineComponent({__name:"SuperscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,emphasis:Be,footnote_reference:E,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,emoji:N,math_inline:Ce,reference:Ne},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 t("span",{key:`${e.indexKey||"superscript"}-${r}`,staticClass:"superscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"superscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"ef2512b4",null,null).exports,De=b(p.defineComponent({__name:"SubscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,emphasis:Be,footnote_reference:E,strikethrough:Ie,highlight:Le,insert:Ee,superscript:_e,emoji:N,math_inline:Ce,reference:Ne},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 t("span",{key:`${e.indexKey||"subscript"}-${r}`,staticClass:"subscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"subscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"3d49d031",null,null).exports,Se=b(p.defineComponent({__name:"StrongNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,emphasis:Be,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,footnote_reference:E,math_inline:Ce,reference:Ne},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,Ie=b(p.defineComponent({__name:"StrikethroughNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,emphasis:Be,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,footnote_reference:E,math_inline:Ce,reference:Ne},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,je=b(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={x:0,y:0,hasValue:!1};let o=0,r=null;function l(){if(r||"undefined"==typeof window)return;const e=e=>{"number"==typeof e.clientX&&"number"==typeof e.clientY&&(n.x=e.clientX,n.y=e.clientY,n.hasValue=!0)};window.addEventListener("pointermove",e,!0),window.addEventListener("mousemove",e,!0),r=()=>{window.removeEventListener("pointermove",e,!0),window.removeEventListener("mousemove",e,!0)}}function i(){l(),o+=1}function a(){o=Math.max(0,o-1),!o&&r&&(r(),r=null)}const s=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",s=null!=(e=t.animationOpacity)?e:.35,u=Math.max(.12,Math.min(.5*s,s));return{"--link-color":null!=(n=t.color)?n:"#0366d6","--underline-height":`${null!=(o=t.underlineHeight)?o:2}px`,"--underline-bottom":a,"--underline-opacity":String(s),"--underline-rest-opacity":String(u),"--underline-duration":`${null!=(r=t.animationDuration)?r:1.6}s`,"--underline-timing":null!=(l=t.animationTiming)?l:"ease-in-out","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),c={text:Me,strong:Se,strikethrough:Ie,emphasis:Be,image:ce,html_inline:F},d=p.useAttrs(),f=p.computed(()=>{var e,n;const o=null==(e=t.node)?void 0:e.attrs;if(!o||"object"!=typeof o)return{};const r={};if(Array.isArray(o))for(const t of o)Array.isArray(t)&&t[0]&&(r[String(t[0])]=String(null!=(n=t[1])?n:""));else for(const[t,l]of Object.entries(o))t&&null!=l&&!1!==l&&(r[t]=!0===l?"":String(l));return z(r)}),v=p.ref(null),h=p.ref(!1),g=p.computed(()=>{const e=u(u({},d),f.value);return delete e.title,delete e.href,delete e.target,delete e.rel,e}),y=p.computed(()=>{var e,n;return z({href:String(null!=(n=null==(e=t.node)?void 0:e.href)?n:"")}).href}),w=p.computed(()=>m.shouldOpenLinkInNewTab(y.value));function x(){var e,n;return(null==(e=t.node)?void 0:e.title)||y.value||(null==(n=t.node)?void 0:n.text)||""}function k(e){if(!e||!n.hasValue)return!1;const t=e.getBoundingClientRect();return n.x>=t.left&&n.x<=t.right&&n.y>=t.top&&n.y<=t.bottom}function M(){t.showTooltip&&v.value&&k(v.value)&&(h.value=!0,le(v.value,x(),"top",!0,{x:n.x,y:n.y}))}const b=p.computed(()=>{var e,n;const o=null==(e=t.node)?void 0:e.title;return"string"==typeof o&&o.trim().length>0?o:String(null!=(n=y.value)?n:"")});return p.onMounted(()=>{i(),t.showTooltip&&re(),p.nextTick(()=>{M()})}),p.onUpdated(()=>{M()}),p.onBeforeUnmount(()=>{a(),h.value&&(h.value=!1,ie(!0))}),{__sfc:!0,props:t,lastPointerPosition:n,pointerTrackerRefCount:o,pointerTrackerCleanup:r,ensurePointerTracker:l,retainPointerTracker:i,releasePointerTracker:a,cssVars:s,nodeComponents:c,attrs:d,nodeAttrs:f,anchorEl:v,isHovering:h,anchorAttrs:g,safeHref:y,openInNewTab:w,getTooltipText:x,isPointerInsideAnchor:k,syncTooltipForHoveredAnchor:M,onAnchorEnter:function(e){if(!t.showTooltip)return;h.value=!0;const 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;le(v.value||e.currentTarget,x(),"top",!0,o)},onAnchorLeave:function(){t.showTooltip&&(h.value=!1,ie())},title:b,TextNode:Me}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return n.node.loading?o("span",n._b({staticClass:"link-loading inline-flex items-baseline gap-1.5",style:r.cssVars,attrs:{"aria-hidden":n.node.loading?"false":"true"}},"span",r.attrs,!1),[o("span",{staticClass:"link-text-wrapper relative inline-flex"},[o("span",{staticClass:"leading-[normal] link-text"},[o(r.TextNode,{staticClass:"leading-[normal] link-text",attrs:{node:{type:"text",content:String(null!=(e=n.node.text)?e:""),raw:String(null!=(t=n.node.text)?t:"")},"index-key":`${n.indexKey||"link-text"}-loading`}})],1),o("span",{staticClass:"link-loading-indicator",attrs:{"aria-hidden":"true"}})])]):o("a",n._b({ref:"anchorEl",staticClass:"link-node",style:r.cssVars,attrs:{href:r.safeHref,title:n.showTooltip?"":r.title,"aria-label":`Link: ${r.title}`,"aria-hidden":n.node.loading?"true":"false",target:r.openInNewTab?"_blank":void 0,rel:r.openInNewTab?"noopener noreferrer":void 0},on:{mouseenter:e=>r.onAnchorEnter(e),mouseleave:r.onAnchorLeave}},"a",r.anchorAttrs,!1),n._l(n.node.children,function(e,t){return o(r.nodeComponents[e.type],{key:`${n.indexKey||"emphasis"}-${t}`,tag:"component",attrs:{node:e,"custom-id":r.props.customId,"index-key":`${n.indexKey||"link-text"}-${t}`}})}),1)},[],!1,null,"636cac94",null,null).exports,Ee=b(p.defineComponent({__name:"InsertNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,emphasis:Be,strikethrough:Ie,highlight:Le,subscript:De,superscript:_e,emoji:N,footnote_reference:E,math_inline:Ce,reference:Ne},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,Le=b(p.defineComponent({__name:"HighlightNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,emphasis:Be,strikethrough:Ie,insert:Ee,subscript:De,superscript:_e,emoji:N,footnote_reference:E,math_inline:Ce,reference:Ne},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,Be=b(p.defineComponent({__name:"EmphasisNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,footnote_reference:E,math_inline:Ce,reference:Ne},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,Ae=b(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 hover:underline cursor-pointer",attrs:{href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`},on:{click:n.scrollToReference}},[e._v(" ↩︎ ")])},[],!1,null,"4a90fe82",null,null).exports,Oe=b(p.defineComponent({__name:"FootnoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>x(null==n?void 0:n.proxy)?Rt:Qt);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2",attrs:{id:`fnref--${e.node.id}`}},[t("div",{staticClass:"flex-1"},[t(n.nestedRenderer,{tag:"component",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,ze=b(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,Pe=b(p.defineComponent({__name:"HeadingNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,image:ce,strong:Se,emphasis:Be,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,checkbox:C,checkbox_input:C,footnote_reference:E,hardbreak:ze,math_inline:Ce,reference:Ne},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(`h${e.node.level}`,e._b({tag:"component",staticClass:"heading-node",class:[`heading-${e.node.level}`],attrs:{dir:"auto"}},"component",e.node.attrs,!1),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,"ffb7cf51",null,null).exports,Re=b(p.defineComponent({__name:"ListItemNode",props:{node:null,item:null,indexKey:null,value:null,customId:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},setup(e){const t=e,n=p.computed(()=>{var e;return null!=(e=t.node)?e:t.item}),o=p.computed(()=>null==t.value?{}:{value:t.value}),r=p.getCurrentInstance(),l=p.computed(()=>x(null==r?void 0:r.proxy)?Rt:Qt);return{__sfc:!0,props:t,itemNode:n,liValueAttr:o,instance:r,nestedRenderer:l}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return o("li",n._b({staticClass:"list-item pl-1.5 my-2",attrs:{dir:"auto"}},"li",r.liValueAttr,!1),[o(r.nestedRenderer,n._b({tag:"component",attrs:{"index-key":`list-item-${r.props.indexKey}`,nodes:null!=(t=null==(e=r.itemNode)?void 0:e.children)?t:[],"custom-id":r.props.customId,typewriter:r.props.typewriter,"batch-rendering":!1},on:{copy:function(e){return n.$emit("copy",e)}}},"component",{showTooltips:r.props.showTooltips},!1))],1)},[],!1,null,"5c58ad56",null,null).exports,He=b(p.defineComponent({__name:"ListNode",props:{node:null,customId:null,indexKey:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const{node:t,customId:n,indexKey:o,typewriter:r,showTooltips:l}=e;return{__sfc:!0,listItemComponent:p.computed(()=>(I.value,j(n).list_item||Re))}}}),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.listItemComponent,e._b({key:`${e.indexKey||"list"}-${r}`,tag:"component",attrs:{node: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)}}},"component",{showTooltips:e.showTooltips},!1))}),1)},[],!1,null,"91e6dafc",null,null).exports,$e=Symbol("ViewportPriority");function Ue(e,t){var n,o;const r="undefined"!=typeof window&&"undefined"!=typeof document,l="boolean"==typeof t?p.ref(t):t,i=r?null!=(n=window.requestIdleCallback)?n:e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16):null,a=r?null!=(o=window.cancelIdleCallback)?o:e=>window.clearTimeout(e):null;let s=null,u=null;const c=new Map,d=new Set;let m=null;function f(){if(!c.size){try{null==s||s.disconnect()}catch(e){}s=null,u=null,d.size||function(){if(null!=m){try{null==a||a(m)}catch(e){}m=null}}()}}function v(e){const t=c.get(e);if(t){if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch(n){}}try{null==s||s.unobserve(e)}catch(n){}c.delete(e),d.delete(e),f()}}function h(){i&&null==m&&d.size&&(m=i(()=>{m=null;const e=d.values().next().value;e&&(d.delete(e),v(e),d.size&&h())},{timeout:1200}))}const g=(t,n)=>{const o=p.ref(!1);let i,a=!1;const m=new Promise(e=>{i=()=>{a||(a=!0,e())}}),g=()=>{try{null==s||s.unobserve(t)}catch(e){}c.delete(t),d.delete(t),f()};if(!r||!l.value)return o.value=!0,i(),{isVisible:o,whenVisible:m,destroy:g};const y=function(t,n){if(!r)return s;if("undefined"==typeof IntersectionObserver)return null;const o=function(t,n){var o,r,l;return{root:null!=(o=null==e?void 0:e(null!=t?t:null))?o:null,rootMargin:null!=(r=null==n?void 0:n.rootMargin)?r:"300px",threshold:null!=(l=null==n?void 0:n.threshold)?l:0}}(t,n);if(s&&(i=o,(l=u)&&l.root===i.root&&l.rootMargin===i.rootMargin&&l.threshold===i.threshold))return s;var l,i;if(s)try{s.disconnect()}catch(a){}s=new IntersectionObserver(e=>{for(const t of e)(t.isIntersecting||t.intersectionRatio>0)&&v(t.target)},{root:o.root,rootMargin:o.rootMargin,threshold:o.threshold}),u=o;for(const e of c.keys())s.observe(e);return s}(t,n);return y?(c.set(t,{resolve:i,visible:o}),y.observe(t),d.add(t),h(),{isVisible:o,whenVisible:m,destroy:g}):(o.value=!0,i(),{isVisible:o,whenVisible:m,destroy:g})};return p.provide($e,g),g}function Fe(){var e,t;const n=p.inject($e,void 0);if(n)return n;const o=new WeakMap;let r=null;const l=new Set;let i=null;const a="undefined"!=typeof window?null!=(e=window.requestIdleCallback)?e:e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16):null,s="undefined"!=typeof window?null!=(t=window.cancelIdleCallback)?t:e=>window.clearTimeout(e):null,u=()=>{if(null!=i){try{null==s||s(i)}catch(e){}i=null}},c=e=>{const t=o.get(e);if(t){if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch(n){}}try{null==r||r.unobserve(e)}catch(n){}o.delete(e),l.delete(e),l.size||u()}},d=()=>{a&&null==i&&l.size&&(i=a(()=>{i=null;const e=l.values().next().value;e&&(l.delete(e),c(e),l.size&&d())},{timeout:1200}))};return e=>{const t=p.ref(!1);let n,i=!1;const a=new Promise(e=>{n=()=>{i||(i=!0,e())}}),s=()=>{try{null==r||r.unobserve(e)}catch(t){}o.delete(e),l.delete(e),l.size||u()},m=r||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(r=new IntersectionObserver(e=>{for(const t of e)(t.isIntersecting||t.intersectionRatio>0)&&c(t.target)},{root:null,rootMargin:"300px",threshold:0}),r));return m?(o.set(e,{resolve:n,visible:t}),m.observe(e),l.add(e),d(),{isVisible:t,whenVisible:a,destroy:s}):(t.value=!0,n(),{isVisible:t,whenVisible:a,destroy:s})}}const Ye=new Map,We=new Set(["admonition","blockquote","checkbox","checkbox_input","code_block","definition_item","definition_list","emoji","emphasis","footnote","footnote_reference","footnote_anchor","hardbreak","heading","highlight","html_block","html_inline","image","inline_code","insert","link","list","list_item","math_block","math_inline","paragraph","reference","strikethrough","strong","subscript","superscript","table","table_cell","table_row","text","thematic_break"]);function Ke(e,t={}){return Qe(e,Ve(t))}function Ve(e){var t;const n=m.normalizeCustomHtmlTags(e.customHtmlTags),o=`${e.cacheKey||"markstream-vue2-nested-html"}::${n.join(",")}`;let r=Ye.get(o);return r||(r=m.getMarkdown(o,{customHtmlTags:n}),Ye.set(o,r)),{markdown:r,options:{allowHtml:!1!==e.allowHtml,htmlPolicy:null!=(t=e.htmlPolicy)?t:"safe",customNodeTag:m.normalizeCustomHtmlTagName(e.customNodeTag)||"div",customNodeClass:e.customNodeClass}}}function Qe(e,t){return(Array.isArray(e)?e:[]).map(e=>Xe(e,t)).join("")}function Xe(e,t){if(!e||"object"!=typeof e)return"";switch(e.type){case"text":return at(rt(e.content));case"paragraph":return`<p>${Qe(ot(e.children),t)}</p>`;case"strong":return`<strong>${Qe(ot(e.children),t)}</strong>`;case"emphasis":return`<em>${Qe(ot(e.children),t)}</em>`;case"strikethrough":return`<del>${Qe(ot(e.children),t)}</del>`;case"highlight":return`<mark>${Qe(ot(e.children),t)}</mark>`;case"insert":return`<ins>${Qe(ot(e.children),t)}</ins>`;case"subscript":return`<sub>${Qe(ot(e.children),t)}</sub>`;case"superscript":return`<sup>${Qe(ot(e.children),t)}</sup>`;case"inline_code":return`<code>${at(rt(e.code))}</code>`;case"hardbreak":return"<br>";case"link":return function(e,t){const n=rt(e.href),o=rt(e.title),r=ot(e.children).length>0?Qe(ot(e.children),t):at(rt(e.text||n)),l=o?` title="${st(o)}"`:"",i=n&&!m.isUnsafeHtmlUrl(n)?n:"";return`<a${i?` href="${st(i)}"`:""}${l}${m.shouldOpenLinkInNewTab(i)?' target="_blank" rel="noreferrer noopener"':""}>${r}</a>`}(e,t);case"image":return function(e){const t=m.sanitizeImageSrc(e.src);if(!t)return"";const n=rt(e.alt),o=rt(e.title),r=o?` title="${st(o)}"`:"";return`<img src="${st(t)}" alt="${st(n)}"${r}>`}(e);case"list":return function(e,t){const n=e.ordered?"ol":"ul";return`<${n}${e.ordered&&Number.isFinite(e.start)?` start="${Number(e.start)}"`:""}>${Qe(ot(e.items),t)}</${n}>`}(e,t);case"list_item":return`<li>${Qe(ot(e.children),t)}</li>`;case"blockquote":return`<blockquote>${Qe(ot(e.children),t)}</blockquote>`;case"heading":return function(e,t){const n=function(e){const t=Math.trunc(Number(e)||1);return Math.min(6,Math.max(1,t))}(e.level);return`<h${n}>${Qe(ot(e.children),t)}</h${n}>`}(e,t);case"code_block":return function(e){const t=it(rt(e.language));return`<pre><code${t?` class="language-${t}"`:""}>${at(rt(e.code))}</code></pre>`}(e);case"thematic_break":return"<hr>";case"table":return function(e,t){const n=e.header?qe(e.header,t,!0):"",o=Qe(ot(e.rows),t);return`<table>${n?`<thead>${n}</thead>`:""}${o?`<tbody>${o}</tbody>`:""}</table>`}(e,t);case"table_row":return qe(e,t);case"table_cell":return Ze(e,t);case"definition_list":return function(e,t){return`<dl>${ot(e.items).map(e=>Ge(e,t)).join("")}</dl>`}(e,t);case"definition_item":return Ge(e,t);case"footnote":return function(e,t){return`<div id="fnref--${st(rt(e.id))}" class="footnote-node markstream-nested-footnote"><div class="footnote-node__content">${Qe(ot(e.children),t)}</div></div>`}(e,t);case"footnote_reference":return function(e){const t=at(rt(e.id)),n=st(rt(e.id));return`<sup id="fnref-${n}" class="footnote-reference markstream-nested-footnote-ref"><span href="#fnref--${n}" title="查看脚注 ${n}" class="footnote-link cursor-pointer">[${t}]</span></sup>`}(e);case"footnote_anchor":return function(e){const t=st(rt(e.id));return`<a class="footnote-anchor" href="#fnref-${t}" title="返回引用 ${t}" aria-label="返回引用 ${t}">↩︎</a>`}(e);case"admonition":return function(e,t){const n=it(rt(e.kind||"note"))||"note";var o;return`<div class="markstream-nested-admonition markstream-nested-admonition--${n}"><div class="markstream-nested-admonition__title">${at(rt(e.title)||((o=n)?`${o[0].toUpperCase()}${o.slice(1)}`:""))}</div><div class="markstream-nested-admonition__content">${Qe(ot(e.children),t)}</div></div>`}(e,t);case"checkbox":case"checkbox_input":return`<input type="checkbox" disabled${e.checked?" checked":""}>`;case"emoji":return at(rt(e.raw||e.markup||e.content||e.name));case"math_inline":return`<span class="markstream-nested-math" data-display="inline">${at(rt(e.content||e.markup||e.raw))}</span>`;case"math_block":return`<pre class="markstream-nested-math-block"><code>${at(rt(e.content||e.markup||e.raw))}</code></pre>`;case"reference":return`<sup class="markstream-nested-reference">[${at(rt(e.id))}]</sup>`;case"html_inline":case"html_block":return function(e,t){const n=rt(e.content)||rt(e.raw),o=rt(e.tag).trim().toLowerCase(),r=ot(e.children);return t.options.allowHtml?"escape"===t.options.htmlPolicy||e.loading&&!e.autoClosed?at(n):o&&r.length>0&&!m.NON_STRUCTURING_HTML_TAGS.has(o)&&!m.isHtmlTagBlocked(o,t.options.htmlPolicy)?`<${o}${nt(e.attrs)}>${Qe(r,t)}</${o}>`:m.sanitizeHtmlContent(n,t.options.htmlPolicy):at(n)}(e,t);default:return function(e,t){const n=rt(e.tag||e.type);if(!n||We.has(n))return at(rt(e.content||e.raw));const o=["markstream-nested-custom",`markstream-nested-custom--${it(n)||"node"}`,et(e,t.options.customNodeClass)].filter(Boolean).join(" "),r=nt(e.attrs,o),l=function(e,t){const n=ot(e.children);if(n.length>0)return Qe(n,t);const o=rt(e.content);return o?Je(o,t):at(rt(e.raw))}(e,t),i=t.options.customNodeTag;return`<${i}${r} data-markstream-custom-tag="${st(n)}">${l}</${i}>`}(e,t)}}function qe(e,t,n=!1){return`<tr>${ot(e.cells).map(e=>Ze(e,t,n)).join("")}</tr>`}function Ze(e,t,n=!1){const o=n||e.header?"th":"td",r=rt(e.align);return`<${o}${r?` style="text-align:${st(r)}"`:""}>${Qe(ot(e.children),t)}</${o}>`}function Ge(e,t){return`<dt>${Qe(ot(e.term),t)}</dt><dd>${Qe(ot(e.definition),t)}</dd>`}function Je(e,t){return e?t.markdown.render(e):""}function et(e,t){return t?tt("function"==typeof t?t(e):t):""}function tt(e){return Array.isArray(e)?e.map(e=>tt(e)).filter(Boolean).join(" "):"string"==typeof e?e.trim():""}function nt(e,t=""){const n=function(e){if(!e)return[];if(Array.isArray(e)){if(0===e.length)return[];const t=e[0];return Array.isArray(t)?e.map(([e,t])=>[String(e),t]):e.map(e=>[String(e.name),e.value])}return Object.entries(e).map(([e,t])=>[e,t])}(e),o=[],r=[t];for(const[i,a]of n){const e=String(i).trim(),t=e.toLowerCase();e&<(e)&&(m.DANGEROUS_HTML_ATTRS.has(t)||!0!==a&&m.URL_HTML_ATTRS.has(t)&&a&&m.isUnsafeHtmlUrl(String(a),{attrName:t})||("class"!==t?!0===a?o.push(` ${e}`):o.push(` ${e}="${st(String(a))}"`):r.push(String(a))))}const l=r.map(e=>e.trim()).filter(Boolean).join(" ");return l&&o.unshift(` class="${st(l)}"`),o.join("")}function ot(e){return Array.isArray(e)?e.filter(e=>!!e&&"object"==typeof e):[]}function rt(e){return"string"==typeof e?e:null==e?"":String(e)}function lt(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function it(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function at(e){return rt(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function st(e){return at(e).replace(/`/g,"`")}const ut=b(p.defineComponent({__name:"HtmlBlockNode",props:{node:null,customId:null,htmlPolicy:null},setup(e){const t=e,n=p.inject("markstreamHtmlPolicy",void 0),o=p.computed(()=>{var e,o;return null!=(o=null!=(e=t.htmlPolicy)?e:null==n?void 0:n.value)?o:"safe"}),r=p.computed(()=>{const e=m.sanitizeHtmlTokenAttrs(t.node.attrs,o.value);if(!e)return;const n=m.tokenAttrsToRecord(e);return Object.keys(n).length>0?n:void 0}),l=p.computed(()=>{const e=String(t.node.tag||"").trim(),n=m.sanitizeHtmlTokenAttrs(t.node.attrs,o.value,e);if(!n)return;const r=m.tokenAttrsToRecord(n);return Object.keys(r).length>0?r:void 0}),i=p.computed(()=>j(t.customId)),a=p.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0},htmlPolicy:{type:String,default:"safe"}},render(){return U(this.content,this.customComponents,void 0,this.htmlPolicy)||[]}}),s=p.computed(()=>Array.isArray(t.node.children)?t.node.children:[]),u=p.computed(()=>String(t.node.tag||"div")),c=p.computed(()=>{const e=u.value.trim().toLowerCase();return m.NON_STRUCTURING_HTML_TAGS.has(e)||m.isHtmlTagBlocked(e,o.value)}),d=p.computed(()=>0===s.value.length||!t.node.tag||c.value?"":Ke(s.value,{htmlPolicy:o.value})),f=p.computed(()=>{if(s.value.length>0&&t.node.tag&&!c.value)return{mode:"structured"};const e=t.node.content;return e?"escape"===o.value?{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:$(e,i.value)?{mode:"dynamic",content:e}:{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:{mode:"html",content:""}}),v=p.ref(null),h=p.ref("undefined"==typeof window),g=p.ref(t.node.content),y=Fe();let w=null;const x=!!t.node.loading;return"undefined"!=typeof window?(p.watch(v,e=>{var n;if(null==(n=null==w?void 0:w.destroy)||n.call(w),w=null,!x)return h.value=!0,void(g.value=t.node.content);if(!e)return void(h.value=!1);const o=y(e,{rootMargin:"400px"});w=o,h.value=o.isVisible.value,o.whenVisible.then(()=>{h.value=!0})},{immediate:!0}),p.watch(()=>t.node.content,e=>{x&&!h.value||(g.value=e)})):h.value=!0,p.onBeforeUnmount(()=>{var e;null==(e=null==w?void 0:w.destroy)||e.call(w),w=null}),{__sfc:!0,props:t,inheritedHtmlPolicy:n,resolvedHtmlPolicy:o,boundAttrs:r,structuredBoundAttrs:l,customComponents:i,DynamicRenderer:a,structuredChildren:s,structuredTag:u,isBlockedStructuredTag:c,structuredHtml:d,renderMode:f,htmlRef:v,shouldRender:h,renderContent:g,registerVisibility:y,visibilityHandle:w,isDeferred:x}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return"structured"===n.renderMode.mode&&n.shouldRender?t(n.structuredTag,e._b({ref:"htmlRef",tag:"component",staticClass:"html-block-node",domProps:{innerHTML:e._s(n.structuredHtml)}},"component",n.structuredBoundAttrs,!1)):"structured"===n.renderMode.mode?t(n.structuredTag,e._b({ref:"htmlRef",tag:"component",staticClass:"html-block-node"},"component",n.structuredBoundAttrs,!1),[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)]):t("div",{ref:"htmlRef",staticClass:"html-block-node"},[n.shouldRender?["dynamic"===n.renderMode.mode?t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents,"html-policy":n.resolvedHtmlPolicy}}):t("div",e._b({domProps:{innerHTML:e._s(n.renderMode.content)}},"div",n.boundAttrs,!1))]: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)],2)},[],!1,null,"83cd7b66",null,null).exports,ct=b(p.defineComponent({__name:"ParagraphNode",props:{node:null,customId:null,indexKey:null,customHtmlTags:null},setup(e){const t=e,n=j(t.customId);function o(e){var t;return"text"===e.type&&""===String(null!=(t=e.content)?t:"").trim()}function r(e){return"link"===e.type&&Array.isArray(e.children)?e.children.filter(e=>!o(e)):[]}function l(e){var t;const n=r(e);return 1===n.length&&"image"===(null==(t=n[0])?void 0:t.type)}const i=p.computed(()=>t.node.children.filter(e=>!o(e))),a=p.computed(()=>i.value.length>0&&i.value.every(e=>"image"===e.type||l(e))),s=p.computed(()=>new Set(m.normalizeCustomHtmlTags(t.customHtmlTags))),d=p.computed(()=>{if(!a.value||i.value.length<=1)return t.node.children;const e=[];for(let n=0;n<t.node.children.length;n++){const r=t.node.children[n];if(!o(r)){e.push(r);continue}const l=e.length>0,i=t.node.children.slice(n+1).some(e=>!o(e));l&&i&&e.push(c(u({},r),{content:" ",raw:" "}))}return e}),f=u({inline_code:Y,image:ce,link:je,hardbreak:ze,emphasis:Be,strong:Se,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,html_inline:F,html_block:ut,emoji:N,checkbox:C,math_inline:Ce,checkbox_input:C,reference:Ne,footnote_anchor:Ae,footnote_reference:E,text:Me},n);return{__sfc:!0,props:t,overrides:n,isWhitespaceText:o,getTextContent:function(e){var t;return String(null!=(t=e.content)?t:"")},getMeaningfulLinkChildren:r,isImageOnlyLink:l,meaningfulChildren:i,isMediaOnlyParagraph:a,customHtmlTagsSet:s,renderedChildren:d,getChildProps:function(e,n){var o;return{node:e,"index-key":`${null!=(o=t.indexKey)?o:"paragraph"}-${n}`,"custom-id":t.customId,"custom-html-tags":t.customHtmlTags}},nodeComponents:f,processChild:function(e){var t,n,o,r;if("html_block"===e.type||"html_inline"===e.type){const l=String(null!=(t=e.tag)?t:"").trim().toLowerCase()||m.getHtmlTagFromContent(e.content);if(l&&!s.value.has(l)&&m.shouldRenderUnknownHtmlTagAsText(null!=(n=e.content)?n:e.raw,l)){const t=String(null!=(r=null!=(o=e.content)?o:e.raw)?r:"");return{child:{type:"text",content:t,raw:t},component:Me}}}return{child:e,component:f[e.type]}}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("p",{staticClass:"paragraph-node",attrs:{dir:"auto"}},[e._l(n.renderedChildren,function(o,r){return[n.isMediaOnlyParagraph&&n.isWhitespaceText(o)?[e._v(" "+e._s(n.getTextContent(o))+" ")]:t(n.processChild(o).component,e._b({key:`${e.indexKey||"paragraph"}-${r}`,tag:"component"},"component",n.getChildProps(n.processChild(o).child,r),!1))]})],2)},[],!1,null,"3275cbf4",null,null).exports,dt=b(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,mt=b(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;return null!=(e=t.node.loading)&&e}),o=p.computed(()=>{var e;return null!=(e=t.node.rows)?e:[]}),r=p.ref(null),l=p.ref([]),i=p.getCurrentInstance(),a=p.computed(()=>x(null==i?void 0:i.proxy)?Rt:Qt);let s=null;const u=p.computed(()=>l.value.map(e=>e>0?{width:`${e}px`}:void 0)),c=p.computed(()=>l.value.length>0);function d(){var e;const t=null==(e=r.value)?void 0:e.querySelectorAll("thead th");return Array.from(null!=t?t:[],e=>Math.round(e.getBoundingClientRect().width))}function m(e){if(!s)return;e.preventDefault();const t=s.startWidth+s.nextStartWidth,n=Math.min(48,Math.floor(t/2)),o=Math.max(n,Math.min(t-n,Math.round(s.startWidth+e.clientX-s.startX))),r=[...s.widths];r[s.index]=o,r[s.index+1]=t-o,l.value=r}function f(){s&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),s=null)}return p.watch(()=>t.node.header.cells.length,()=>{f(),l.value=[]}),p.onBeforeUnmount(f),{__sfc:!0,props:t,isLoading:n,bodyRows:o,tableRef:r,columnWidths:l,instance:i,nestedRenderer:a,MIN_COLUMN_WIDTH:48,resizeState:s,columnStyles:u,hasColumnWidths:c,measureHeaderWidths:d,onColumnResizeMove:m,stopColumnResize:f,startColumnResize:function(e,t){if(0!==t.button)return;const n=d(),o=n[e],r=n[e+1];o&&r&&(t.preventDefault(),s={index:e,startX:t.clientX,startWidth:o,nextStartWidth:r,widths:n},l.value=n,window.addEventListener("pointermove",m),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f))}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"table-node-wrapper"},[t("table",{ref:"tableRef",staticClass:"my-8 text-sm table-node",class:{"table-node--loading":n.isLoading},attrs:{"aria-busy":n.isLoading}},[n.hasColumnWidths?t("colgroup",e._l(e.node.header.cells,function(e,o){return t("col",{key:`col-${o}`,style:n.columnStyles[o]})}),0):e._e(),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)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",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)}}}),r<e.node.header.cells.length-1?t("button",{staticClass:"table-node__resize-handle",attrs:{type:"button","aria-label":`Resize columns ${r+1} and ${r+2}`},on:{pointerdown:function(e){return n.startColumnResize(r,e)}}}):e._e()],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)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",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,"11208a21",null,null).exports,pt=b(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,ft=b(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,vt=b(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=j(t.customId),r=u({text:Me,paragraph:ct,heading:Pe,inline_code:Y,link:je,image:ce,strong:Se,emphasis:Be,strikethrough:Ie,insert:Ee,subscript:De,superscript:_e,checkbox:C,checkbox_input:C,hardbreak:ze,math_inline:Ce,reference:Ne,list:He,math_block:Te,table:mt},o);return{__sfc:!0,props:t,containerClass:n,overrides:o,nodeComponents:r,getNodeComponent:function(e){return r[e]||ft}}}}),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,"3cd2aff2",null,null).exports;let ht=!1,gt=null,yt=!1;function wt(){return d(this,null,function*(){var e;if(gt)return gt;if(yt)return null;try{const t=yield Promise.resolve().then(()=>require("./chunks/index.legacy-b598deaf.cjs")).then(e=>e.index_legacy);return gt=null!=(e=null==t?void 0:t.default)?e:t,yield function(e){return d(this,null,function*(){if(ht)return;ht=!0;const t=null==globalThis?void 0:globalThis.MonacoEnvironment;return!t||"function"!=typeof t.getWorker&&"function"!=typeof t.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(gt),(yield function(e){return d(this,null,function*(){const t=null==e?void 0:e.getOrCreateHighlighter;if("function"!=typeof t)return!0;try{const e=yield t(["vitesse-dark","vitesse-light"],["plaintext","text","javascript"]);return e&&"function"==typeof e.codeToTokens&&e.codeToTokens("const a = 1",{lang:"javascript",theme:"vitesse-dark"}),!0}catch(n){return console.warn("[markstream-vue2] Failed to warm up Shiki tokenizer; disabling stream-monaco for this session.",n),!1}})}(gt))?gt:(gt=null,yt=!0,null)}catch(t){return yt=!0,null}})}const xt='<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',kt='<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',Mt='<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';let bt=null,Ct=null,Tt=null;const Nt=p.ref(0),_t={"":Mt,plain:Mt,text:Mt,javascript:'<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',typescript:'<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',jsx:'<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',tsx:'<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',html:'<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',css:'<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',scss:'<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',json:'<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',python:'<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',ruby:'<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',go:'<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',java:'<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',kotlin:'<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',c:'<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',cpp:'<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',cs:xt,csharp:xt,php:'<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',shell:kt,powershell:kt,sql:'<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',yaml:'<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',markdown:'<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',xml:'<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',rust:'<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',vue:'<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',mermaid:'<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',svg:'<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'},Dt={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin",d:"dlang",vbnet:"vb.net"};function St(){return d(this,null,function*(){return Ct||(Tt||(Tt=Promise.resolve().then(()=>require("./chunks/languageIconExtended-4baf8bdb.cjs")).then(e=>(Ct=e.EXTENDED_LANGUAGE_ICON_MAP,Nt.value++,Ct)).catch(()=>null)),Tt)})}function It(e){bt=null!=e?e:null}function jt(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=Dt[n])?t:n}function Et(e){const t=jt(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Lt(e){if(bt){const t=bt(e);if(null!=t&&""!==t)return t}const t=jt(e),n=_t[t];if(n)return n;return(null==Ct?void 0:Ct[t])||(St(),'<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 Bt={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#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"},At=new Map;function Ot(e,t={}){if(Array.isArray(e.nodes))return e.nodes.slice();const n=e.node;if(n){const e=(o=n.children,Array.isArray(o)?o:[]);if(e.length>0)return e.slice()}var o;const r=function(e){var t;return"string"==typeof e.content?e.content:"string"==typeof(null==(t=e.node)?void 0:t.content)?e.node.content:""}(e);if(!r)return[];const l=function(e,t){var n,o;const r=null!=(n=t.parseOptions)?n:{},l=null!=(o=t.final)?o:(a=e.node)&&"object"==typeof a&&"boolean"==typeof a.loading?!a.loading:void 0,i=m.mergeCustomHtmlTags(t.customHtmlTags,r.customHtmlTags);var a;return null==l&&0===i.length?r:u(u(u({},r),null==l?{}:{final:l}),0===i.length?{}:{customHtmlTags:i})}(e,t),i=function(e){var t;const n=m.mergeCustomHtmlTags(e.customHtmlTags,null==(t=e.parseOptions)?void 0:t.customHtmlTags),o=`${e.cacheKey||"markstream-vue2-nested-nodes"}::${n.join(",")}`;let r=At.get(o);return r||(r=m.getMarkdown(o,{customHtmlTags:n}),At.set(o,r)),e.customMarkdownIt?e.customMarkdownIt(r):r}(t);return m.parseMarkdownToStructure(r,i,l)}const zt=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function Pt(e,t={}){var n;const o={},r=new Set(null!=(n=t.omit)?n:[]);if(!e||"object"!=typeof e)return o;const l=Object.getOwnPropertyDescriptors(e);for(const[i,a]of Object.entries(l))zt.has(i)||r.has(i)||a.enumerable&&"value"in a&&(o[i]=a.value);return o}const Rt=b(p.defineComponent({__name:"LegacyNodesRenderer",props:{nodes:null,customId:null,indexKey:null,typewriter:{type:Boolean,default:!1},fade:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:null,codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockProps:null,renderCodeBlocksAsPre:{type:Boolean},themes:null,langs:null,isDark:{type:Boolean},customHtmlTags:null,htmlPolicy:null},emits:["copy","handleArtifactClick","click"],setup(e,{emit:t}){const n=e;p.provide("markstreamTypewriter",p.computed(()=>!0===n.typewriter)),p.provide("markstreamFade",p.computed(()=>!1!==n.fade));const o={text:Me,paragraph:ct,heading:Pe,code_block:dt,list:He,list_item:Re,blockquote:Ht,table:mt,definition_list:T,footnote:Oe,footnote_reference:E,footnote_anchor:Ae,admonition:Xt,vmr_container:vt,hardbreak:ze,link:je,image:ce,thematic_break:pt,math_inline:Ce,math_block:Te,strong:Se,emphasis:Be,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,checkbox:C,checkbox_input:C,inline_code:Y,html_inline:F,html_block:ut,reference:Ne},r=p.computed(()=>(I.value,j(n.customId))),l=p.computed(()=>null!=n.indexKey?String(n.indexKey):"legacy-renderer"),i=p.computed(()=>Pt(n.codeBlockProps)),a=p.computed(()=>Pt(n.codeBlockProps,{omit:["langs"]})),s=p.computed(()=>u({stream:n.codeBlockStream,darkTheme:n.codeBlockDarkTheme,lightTheme:n.codeBlockLightTheme,monacoOptions:n.codeBlockMonacoOptions,themes:n.themes,minWidth:n.codeBlockMinWidth,maxWidth:n.codeBlockMaxWidth},a.value)),d=p.computed(()=>u(c(u({},s.value),{langs:n.langs}),i.value)),v=p.computed(()=>{var e;return{typewriter:n.typewriter,fade:n.fade,htmlPolicy:null!=(e=n.htmlPolicy)?e:"safe"}}),h=p.computed(()=>u(u({},v.value),"boolean"==typeof n.showTooltips?{showTooltip:n.showTooltips}:{})),g=p.computed(()=>u(u({},v.value),"boolean"==typeof n.showTooltips?{showTooltips:n.showTooltips}:{})),y=p.computed(()=>new Set(m.normalizeCustomHtmlTags(n.customHtmlTags))),w=p.computed(()=>(Array.isArray(n.nodes)?n.nodes:[]).map((e,t)=>{var n,i,a,s;let d=e;const p=String((null==e?void 0:e.type)||"unknown"),f=x(d);let v=M(d,f);if(("html_block"===d.type||"html_inline"===d.type)&&v===o[d.type]){const e=String(null!=(n=d.tag)?n:"").trim().toLowerCase()||m.getHtmlTagFromContent(d.content);if(e)if(y.value.has(e)){const t=r.value[e];t&&(v=t,d=c(u({},d),{type:e,tag:e,content:m.stripCustomHtmlWrapper(d.content,e)}))}else if(m.shouldRenderUnknownHtmlTagAsText(null!=(i=d.content)?i:d.raw,e)){const e=String(null!=(s=null!=(a=d.content)?a:d.raw)?s:"");"html_inline"===d.type?(v=Me,d={type:"text",content:e,raw:e}):(v=ct,d={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return{index:t,indexKey:`${l.value}-${t}`,renderKey:"code_block"===p?`${l.value}-${t}-${p}`:`${l.value}-${t}-${p}-${String((null==e?void 0:e.raw)||"").length}`,node:d,isCodeBlock:"code_block"===(null==d?void 0:d.type),component:v,bindings:D(d,f,v)}}));function x(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function k(e,t){const n=t.trim().toLowerCase();if(n)for(const o of[n,jt(n),f.normalizeShikiLanguage(n)]){const t=o&&e[o];if(t)return t}}function M(e,t){if(!e)return ft;const l=r.value,i=l[String(e.type)];if("code_block"===e.type){const o=null!=t?t:x(e),r=o?k(l,o):void 0;return r||("mermaid"===o?l.mermaid||dt:"infographic"===o?l.infographic||dt:"d2"===o||"d2lang"===o?l.d2||dt:i||(l.code_block||(n.renderCodeBlocksAsPre,dt)))}return i||o[String(e.type)]||ft}function b(e){return Boolean(e&&e===r.value.code_block)}function _(e,t){return Boolean(e&&t&&e===k(r.value,t))}function D(e,t,n){const o=null!=t?t:x(e);return"code_block"===e.type&&_(n,o)?"mermaid"===o||"infographic"===o||"d2"===o||"d2lang"===o?{}:d.value:"code_block"===e.type&&b(n)?d.value:"mermaid"===o||"infographic"===o||"d2"===o||"d2lang"===o?{}:"link"===e.type?h.value:"list"===e.type?g.value:"code_block"===e.type?s.value:v.value}return{__sfc:!0,props:n,emit:t,handleCopy:function(e){t("copy",e)},handleArtifactClick:function(e){t("handleArtifactClick",e)},nodeComponents:o,customComponentsMap:r,indexPrefix:l,codeBlockExtraProps:i,builtinCodeBlockExtraProps:a,codeBlockBindings:s,customCodeBlockBindings:d,nonCodeBindings:v,linkBindings:h,listBindings:g,effectiveCustomHtmlTagsSet:y,renderedItems:w,getCodeBlockLanguage:x,getCustomCodeLanguageComponent:k,getNodeComponent:M,isCustomCodeBlockComponent:b,isCustomLanguageCodeBlockComponent:_,getBindingsFor:D,handleClick:function(e){t("click",e)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"markstream-vue2 markdown-renderer legacy-nodes-renderer",class:{dark:n.props.isDark},on:{click:n.handleClick}},e._l(n.renderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[t(o.component,e._b({key:`${o.renderKey}-component`,tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:n.handleCopy,"handle-artifact-click":n.handleArtifactClick}},"component",o.bindings,!1))],1)])}),0)},[],!1,null,null,null,null).exports,Ht=b(p.defineComponent({__name:"BlockquoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>x(null==n?void 0:n.proxy)?Rt:Qt);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),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.nestedRenderer,{tag:"component",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,"0bfb818f",null,null).exports;function $t(e={}){const t=p.ref(""),n=p.ref(""),o=p.ref(!1),r=f.createSmoothMarkdownStream(e),l=()=>{const e=r.getSnapshot();t.value=e.source,n.value=e.visible,o.value=e.done},i=r.subscribe(l);l();const a=p.computed(()=>Math.max(0,t.value.length-n.value.length)),s=p.computed(()=>0===a.value),u=p.computed(()=>o.value&&s.value);return p.getCurrentScope()&&p.onScopeDispose(()=>{i(),r.destroy()}),{source:t,visible:n,done:o,final:u,caughtUp:s,pendingChars:a,enqueue:e=>r.enqueue(e),finish:e=>r.finish(e),flush:()=>r.flush(),reset:e=>r.reset(e),pause:()=>r.pause(),resume:()=>r.resume()}}function Ut(e){const t="number"==typeof e?e:Number.parseFloat(String(null!=e?e:""));return Number.isFinite(t)&&t>0?t:null}function Ft(e){const t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith("%%")),n=Math.max(1,t.length),o=function(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const o=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==o?void 0:o[1])?void 0:t.toLowerCase())||""}return""}(e);return"gantt"===o?220+28*n:"sequencediagram"===o?180+26*n:"classdiagram"===o||"statediagram"===o||"erdiagram"===o?180+24*n:"flowchart"===o||"graph"===o?170+28*n:200+22*n}function Yt(e){const t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}function Wt(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}function Kt(e,t=360,n=500){return Wt(e,t,n)}function Vt(e,t=360,n=500){return Wt(e,t,n)}const Qt=b(p.defineComponent({__name:"NodeRenderer",props:{content:null,nodes:null,final:{type:Boolean},parseOptions:null,customMarkdownIt:null,debugPerformance:{type:Boolean,default:!1},customHtmlTags:null,htmlPolicy:null,viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:null,renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockProps:null,mermaidProps:null,d2Props:null,infographicProps:null,showTooltips:{type:Boolean,default:!0},themes:null,langs:null,isDark:{type:Boolean},customId:null,indexKey:null,typewriter:{type:Boolean,default:!1},fade:{type:Boolean,default:!0},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:null,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),s=/auto|scroll|overlay/i,v="undefined"!=typeof window,g=p.getCurrentInstance(),y=p.computed(()=>l.debugPerformance&&v&&"undefined"!=typeof console),w=p.computed(()=>{var e,t;return null!=(t=null==(e=null==g?void 0:g.proxy)?void 0:e.$attrs)?t:{}}),k=new Map,M=p.ref(0),b=$t(l.smoothStreamingOptions),_=p.computed(()=>{var e;if("boolean"==typeof l.showTooltips)return l.showTooltips;const t=null!=(e=w.value.showTooltips)?e:w.value["show-tooltips"];return""===t||!0===t||"true"===t||!1!==t&&"false"!==t&&void 0}),D=p.inject("markstreamHtmlPolicy",void 0),S=p.inject("markstreamSmoothStreaming",void 0),L=p.computed(()=>{var e,t;return null!=(t=null!=(e=l.htmlPolicy)?e:null==D?void 0:D.value)?t:"safe"});p.provide("markstreamShowTooltips",_),p.provide("markstreamHtmlPolicy",L),p.provide("markstreamTypewriter",p.computed(()=>!0===l.typewriter)),p.provide("markstreamFade",p.computed(()=>!1!==l.fade)),p.provide("markstreamTextStreamState",k),p.provide("markstreamStreamVersion",M);const B=p.computed(()=>{var e,t;return!1!==l.smoothStreaming&&!(null==(e=l.nodes)?void 0:e.length)&&(!0===l.smoothStreaming||!(null==S?void 0:S.value))&&(!0===l.smoothStreaming||!0===l.typewriter||(null!=(t=l.maxLiveNodes)?t:0)<=0)}),A=p.ref(!v||!0===l.smoothStreaming);p.onMounted(()=>{A.value=!0});const O=p.computed(()=>A.value&&B.value);p.provide("markstreamSmoothStreaming",O);const z=p.computed(()=>{var e;return O.value?b.visible.value:null!=(e=l.content)?e:""}),P=p.computed(()=>{var e;return null!=(e=l.content)?e:""}),R=p.computed(()=>{var e;return Boolean(null==(e=l.nodes)?void 0:e.length)||b.source.value===P.value}),H=p.computed(()=>{var e,t;const n=null!=(e=l.parseOptions)?e:{};return null!=(t=l.final)?t:n.final}),$=p.computed(()=>{const e=H.value;return O.value&&null!=e?Boolean(e&&R.value&&b.caughtUp.value):e}),U=p.computed(()=>{var e;return(null==(e=l.nodes)?void 0:e.length)?l.nodes:z.value});function W(e,t){y.value&&console.info(`[markstream-vue2][perf] ${e}`,t)}function K(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(s.test(t)||s.test(n))return r;r=r.parentElement}return null}p.watch([()=>l.content,()=>l.nodes,O,H],([e,t,n,o])=>{if(null==t?void 0:t.length)return void b.reset("");const r=null!=e?e:"";if(!n)return b.reset(r),void(o&&b.finish({flush:!0}));const l=b.source.value;r?r===l||(r.startsWith(l)?b.enqueue(r.slice(l.length)):b.reset(r)):b.reset(""),o&&b.finish()},{immediate:!0}),p.watch(U,()=>{M.value+=1},{immediate:!0});const V=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Q=m.getMarkdown(V),X=new Map,q=p.markRaw([]),Z=p.computed(()=>(I.value,j(l.customId))),G=p.computed(()=>{var e;return m.mergeCustomHtmlTags(l.customHtmlTags,null==(e=l.parseOptions)?void 0:e.customHtmlTags)}),J=p.computed(()=>{const{key:e,tags:t}=m.resolveCustomHtmlTags(G.value);if(!e)return Q;const n=X.get(e);if(n)return n;const o=m.getMarkdown(V,{customHtmlTags:t});return X.set(e,o),o}),ee=p.computed(()=>{const e=J.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function te(e){if(Array.isArray(e))return Object.freeze(e.map(e=>te(e)));if(!e||"object"!=typeof e)return e;const t={};for(const[n,o]of Object.entries(e))t[n]=te(o);return Object.freeze(t)}function ne(e){return e.map(e=>te(e))}const oe=p.computed(()=>{var e;const t=null!=(e=l.parseOptions)?e:{},n=$.value,o=G.value,r=null!=n,i=o.length>0;return r||i?u(u(u({},t),r?{final:n}:{}),i?{customHtmlTags:o}:{}):t}),re=p.computed(()=>{var e;const t=null!=(e=oe.value.customHtmlTags)?e:[];return new Set(t.map(e=>String(e).trim().toLowerCase()).filter(Boolean))}),le=p.computed(()=>{var e;if(x(null==g?void 0:g.proxy)&&!l.content&&Array.isArray(l.nodes))return q;if(null==(e=l.nodes)?void 0:e.length)return p.markRaw(ne(l.nodes));const t=z.value;if(t){const e=y.value?performance.now():0,n=m.parseMarkdownToStructure(t,ee.value,oe.value);return y.value&&W("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:t.length}),p.markRaw(ne(n))}return[]}),ie=p.computed(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),ae=p.computed(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&le.value.length>ie.value}),se=p.computed(()=>!1!==l.viewportPriority&&!a.value),ue=Ue(e=>{var t;return K(null!=(t=null!=e?e:i.value)?t:null)},se),de=v&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,me=v&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,pe="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),fe=v&&"function"==typeof window.requestIdleCallback,ve=p.computed(()=>{var e;const t=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),he=p.computed(()=>{var e;const t=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:ve.value);return Number.isFinite(t)?Math.max(0,t):ve.value}),ge=p.computed(()=>!1!==l.batchRendering&&ve.value>0&&v&&!pe),ye=p.ref(0),we=p.ref({key:l.indexKey,total:0}),xe=p.ref(Math.max(1,ve.value||1)),ke=p.reactive({}),be=new Map,$e=new Map,Fe=new Map,Ye=new WeakMap,We=p.ref(0),Ke=p.computed(()=>(We.value,Array.from(Fe.entries()).sort((e,t)=>e[0]-t[0]))),Ve=p.ref(null);let Qe=null,Xe=null;const qe=p.reactive({start:0,end:0}),Ze=p.computed(()=>{if(!ae.value)return le.value.map((e,t)=>({node:e,index:t}));const e=le.value.length,t=_t(qe.start,0,e),n=_t(qe.end,t,e);return le.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),Ge=p.computed(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!ae.value&&!(le.value.length>900)&&se.value}),Je=p.computed(()=>{var e;return ge.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),et=p.ref({batchSize:ve.value,initial:he.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:Je.value}),tt=p.computed(()=>!!ue&&(Ge.value||ae.value)),nt=p.computed(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),ot=p.ref(0),rt=new Map,lt=p.computed(()=>x(null==g?void 0:g.proxy)),it=p.computed(()=>lt.value&&!l.content&&Array.isArray(l.nodes)),at=p.computed(()=>it.value?p.markRaw(ne(l.nodes||[])):q);function st(){var e,t;const n=null==g?void 0:g.proxy;if(!n||!n.$refs)return;const o=n.$refs,r=new Set;for(const l of Ze.value){const n=ht(o[`node-slot-${l.index}`]),i=ht(o[`node-content-${l.index}`]);(null!=(e=Fe.get(l.index))?e:null)!==n&&sn(l.index,n),(null!=(t=rt.get(l.index))?t:null)!==i&&cn(l.index,i),r.add(l.index)}for(const l of Array.from(Fe.keys()))r.has(l)||sn(l,null);for(const l of Array.from(rt.keys()))r.has(l)||cn(l,null)}function ht(e){if(Array.isArray(e)){for(const t of e)if(t)return t;return null}return null!=e?e:null}const gt=p.computed(()=>{if(!ae.value)return le.value.length;const e=nt.value,t=Math.max(qe.end+e,he.value),n=Math.min(le.value.length,t);return Math.max(ye.value,n)});function yt(e){var t,n,o,r;const l=K(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 wt(e){if(!v)return!1;try{const t=window.getComputedStyle(e);return!!(t.display||"").toLowerCase().includes("flex")&&(t.flexDirection||"").toLowerCase().endsWith("reverse")}catch(t){return!1}}function xt(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(!wt(e))return u;const c=u<0?-u:u;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-c}function kt(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 Mt(){Qe&&(Qe(),Qe=null),Ve.value=null}function bt(){if(!v||!ae.value)return;const e=yt();if(!e||Ve.value===e)return;Mt();const t=()=>Tt();e.addEventListener("scroll",t,{passive:!0}),Ve.value=e,Qe=()=>{e.removeEventListener("scroll",t)}}function Ct(){var e,t,n;if(!Xe)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;Xe.viaTimeout?o?o.clearTimeout(Xe.id):clearTimeout(Xe.id):null==me||me(Xe.id),Xe=null}function Tt(e={}){var t,n,o;if(!ae.value)return;if(!v)return void Nt(!0);if(e.immediate)return Ct(),void Nt(!0);if(Xe)return;const r=()=>{Xe=null,Nt()};if(de)Xe={id:de(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);Xe={id:l,viaTimeout:!0}}}function Nt(e=!1){var t,n,o,r,l,a,s;if(!ae.value)return;const u=Ve.value||yt();if(!u)return;const c=u.ownerDocument||(null==(t=i.value)?void 0:t.ownerDocument)||document,d=(null==c?void 0:c.defaultView)||("undefined"!=typeof window?window:null),m=u===(null==c?void 0:c.documentElement)||u===(null==c?void 0:c.body),p=le.value.length;if(!m&&p>0&&wt(u)){const t=u.clientHeight||0,n=u.scrollTop,o=n<0?-n:n,r=_t(on(Math.max(0,o)+.5*Math.max(0,t)),0,Math.max(0,p-1));return void((e||Math.abs(r-ot.value)>1)&&(ot.value=r))}const f=m?null:u.getBoundingClientRect(),v=m?0:f.top,h=m?null!=(o=null!=(n=null==d?void 0:d.innerHeight)?n:u.clientHeight)?o:0:f.bottom,g=Ke.value;let y=null,w=null;for(const[i,k]of g){if(!k)continue;const e=k.getBoundingClientRect();e.bottom<=v||e.top>=h||(null==y&&(y=i),w=i)}if(null==y||null==w){const e=i.value;if(!e)return;const t=m?{top:0}:u.getBoundingClientRect(),n=xt(u,c,m),o=m?(()=>{const n=e.getBoundingClientRect(),o=(m?0:t.top)-n.top;return Math.max(0,o)})():(()=>{const t=kt(e,u);return Math.max(0,n-t)})(),p=m?null!=(s=null!=(a=null!=(l=null==d?void 0:d.innerHeight)?l:null==(r=null==c?void 0:c.documentElement)?void 0:r.clientHeight)?a:u.clientHeight)?s:0:u.clientHeight,f=nn(o+.5*Math.max(0,p));return void(ot.value=_t(f,0,Math.max(0,le.value.length-1)))}const x=Math.round((y+w)/2);!e&&Math.abs(x-ot.value)<=1||(ot.value=_t(x,0,Math.max(0,le.value.length-1)))}function _t(e,t,n){return Math.min(Math.max(e,t),n)}function Dt(){const e=le.value.length;if(!ae.value||0===e)return qe.start=0,void(qe.end=e);const t=Math.min(ie.value,e),n=nt.value,o=_t(ot.value-n,0,Math.max(0,e-t));qe.start=o,qe.end=Math.min(e,o+t)}const St=p.reactive({}),It=p.reactive({total:0,count:0}),Et=p.ref(0),Lt=p.ref([]),Bt=p.ref([]);function At(){for(const e of Object.keys(St))delete St[Number(e)];It.total=0,It.count=0,Et.value=0,Lt.value=[],Bt.value=[]}function Ot(e){if(e<=0)return void At();let t=0,n=0;for(const[o,r]of Object.entries(St)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0?delete St[l]:(t+=i,n++)}It.total=t,It.count=n}function zt(e,t,n){for(let o=t+1;o<e.length;o+=o&-o)e[o]+=n}function Wt(e,t){let n=0;for(let o=t+1;o>0;o-=o&-o)n+=e[o];return n}function Qt(e,t,n){if(n<=t)return 0;const o=Wt(e,n-1);return t<=0?o:o-Wt(e,t-1)}function qt(e){Et.value=e;const t=new Array(e+1).fill(0),n=new Array(e+1).fill(0);for(const[o,r]of Object.entries(St)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(zt(t,l,i),zt(n,l,1))}Lt.value=t,Bt.value=n}function Zt(e,t){if(!Number.isFinite(t)||t<=0)return;const n=St[e];if(St[e]=t,n?It.total+=t-n:(It.total+=t,It.count++),Et.value>e){const o=Lt.value,r=Bt.value;if(o.length&&r.length)if(n){const r=t-n;0!==r&&zt(o,e,r)}else zt(o,e,t),zt(r,e,1)}}const Gt=p.computed(()=>It.count>0?Math.max(12,It.total/It.count):32);function Jt(e,t){var n,o;if(e>=t)return 0;if(Et.value!==le.value.length){let o=0;for(let r=e;r<t;r++)o+=null!=(n=St[r])?n:Gt.value;return o}const r=Lt.value,l=Bt.value;if(!r.length||!l.length){let n=0;for(let r=e;r<t;r++)n+=null!=(o=St[r])?o:Gt.value;return n}return Qt(r,e,t)+(t-e-Qt(l,e,t))*Gt.value}p.watch(()=>le.value.length,e=>{e<=0?At():(e<Et.value&&Ot(e),e!==Et.value&&qt(e))},{immediate:!0});const en=p.computed(()=>ae.value?Jt(0,Math.min(qe.start,le.value.length)):0),tn=p.computed(()=>{if(!ae.value)return 0;const e=le.value.length;return Jt(Math.min(qe.end,e),e)});function nn(e){var t;if(e<=0)return 0;const n=le.value;if(Et.value===n.length&&Lt.value.length&&Bt.value.length){const t=Gt.value,o=Lt.value,r=Bt.value,l=e=>e<=0?0:Wt(o,e-1)+(e-Wt(r,e-1))*t;let i=0,a=n.length-1,s=n.length-1;for(;i<=a;){const t=i+a>>1;l(t+1)>=e?(s=t,a=t-1):i=t+1}return s}let o=e;for(let r=0;r<n.length;r++){const e=null!=(t=St[r])?t:Gt.value;if(o<=e)return r;o-=e}return Math.max(0,n.length-1)}function on(e){var t;const n=le.value;if(!n.length)return 0;if(e<=0)return Math.max(0,n.length-1);if(Et.value===n.length){const t=Jt(0,n.length);return nn(Math.max(0,t-e))}let o=e;for(let r=n.length-1;r>=0;r--){const e=null!=(t=St[r])?t:Gt.value;if(o<=e)return r;o-=e}return 0}function rn(e){if(!be.size)return;if(!ae.value)return;let t=!1;for(const[n,o]of be)n>=e&&(o.destroy(),be.delete(n),Ge.value&&delete ke[n],yn(n),Fe.delete(n)&&(t=!0));t&&un()}function ln(e,t){Ge.value&&(ke[e]=t),t&&(ae.value?Tt():ot.value=_t(e,0,Math.max(0,le.value.length-1)))}function an(e){const t=be.get(e);t&&(t.destroy(),be.delete(e)),yn(e)}function sn(e,t){let n=!1;if(t){const o=Fe.get(e);Fe.set(e,t),o!==t&&(n=!0)}else Fe.delete(e)&&(n=!0);if(n&&un(),t||yn(e),!tt.value||!ue)return an(e),void(t?ln(e,!0):Ge.value&&delete ke[e]);if(!ae.value&&Ge.value&&!a.value&&be.size>=640&&(xn("too-many-targets"),!tt.value||!ue))return an(e),void(t?ln(e,!0):Ge.value&&delete ke[e]);if(e<he.value&&!ae.value)return an(e),void ln(e,!0);if(!t)return an(e),void(Ge.value&&delete ke[e]);an(e);const o=ue(t,{rootMargin:"400px"});o&&(be.set(e,o),ln(e,o.isVisible.value),Ge.value&&wn(e),o.whenVisible.then(()=>{yn(e),ln(e,!0)}).catch(()=>{}).finally(()=>{be.get(e)===o&&be.delete(e);try{o.destroy()}catch(t){}}),ae.value&&Tt())}function un(){We.value+=1}function cn(e,t){t?(rt.set(e,t),queueMicrotask(()=>{Zt(e,t.offsetHeight)})):rt.delete(e)}p.onMounted(()=>{v&&p.nextTick(st)}),p.watch(Ze,()=>{v&&p.nextTick(st)}),p.watch(ye,()=>{v&&p.nextTick(st)}),p.watch(ae,()=>{v&&p.nextTick(st)});let dn=null,mn=null,fn=!1,vn=null,hn=null;function gn(){v&&(null!=dn&&(null==me||me(dn),dn=null),null!=mn&&(window.clearTimeout(mn),mn=null),null!=hn&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(hn),hn=null),fn=!1,vn=null)}function yn(e){if(!v)return;const t=$e.get(e);null!=t&&(window.clearTimeout(t),$e.delete(e))}function wn(e){if(!v||!Ge.value)return;yn(e);const t=e%17*23,n=window.setTimeout(()=>{var t,n;if($e.delete(e),!Ge.value)return;if(!0===ke[e])return;const o=Fe.get(e);if(!o)return void delete ke[e];const r=yt(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,c=a?null!=(n=null!=(t=i.innerHeight)?t:null==r?void 0:r.clientHeight)?n:0:s.bottom,d=o.getBoundingClientRect();d.bottom>=u-500&&d.top<=c+500&&ln(e,!0)},1800+t);$e.set(e,n)}function xn(e){var t;if(!a.value){a.value=!0,void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",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-vue2] viewportPriority auto-disabled:",e);for(const e of be.values())e.destroy();if(be.clear(),v)for(const e of $e.values())window.clearTimeout(e);$e.clear();for(const e of Object.keys(ke))delete ke[e]}}function kn(e,t={}){var n,o;if(!Je.value)return;const r=gt.value;if(ye.value>=r)return;const i=Math.max(1,e),a=e=>{var t;dn=null,mn=null,hn=null,fn=!1;const n=null!=vn?vn:i;vn=null;const o=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();ye.value=Math.min(r,ye.value+Math.max(1,e)),rn(ye.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return bn(n),n};let s=n;for(;(a(s),!(ye.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(xe.value));ye.value<r&&Mn()};if(!v||t.immediate)return void a();const s=Math.max(0,null!=(n=l.renderBatchDelay)?n:16);if(vn=null!=vn?Math.max(vn,i):i,!fn){if(fn=!0,!pe&&fe&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(hn=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}de&&!pe?dn=de(()=>{0!==s?mn=window.setTimeout(()=>a(),s):a()}):mn=window.setTimeout(()=>a(),s)}}function Mn(){Je.value&&kn(ge.value?Math.max(1,Math.round(xe.value)):Math.max(1,ve.value))}function bn(e){var t;if(!Je.value)return;const n=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),o=Math.max(1,ve.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*n?xe.value=Math.max(r,Math.floor(.7*xe.value)):e<.5*n&&xe.value<o&&(xe.value=Math.min(o,Math.ceil(1.2*xe.value)))}function Cn(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./chunks/index-a4867ea2.cjs"));return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] 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".',t),dt}})}p.watch([()=>le.value,()=>le.value.length,()=>Je.value,()=>ve.value,()=>he.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const t=le.value.length,n=we.value,o=l.indexKey,r=void 0!==o&&o!==n.key,i=t!==n.total,a=r||i;we.value={key:o,total:t};const s=et.value,u=null!=(e=l.renderBatchDelay)?e:16,c=s.batchSize!==ve.value||s.initial!==he.value||s.delay!==u||s.enabled!==Je.value;et.value={batchSize:ve.value,initial:he.value,delay:u,enabled:Je.value},(a||c||!Je.value)&&gn(),(a||c)&&(xe.value=Math.max(1,ve.value||1)),a&&ae.value&&Tt({immediate:!0});const d=gt.value;if(!t)return 0!==ye.value&&(ye.value=0),void rn(0);if(!Je.value)return ye.value!==d&&(ye.value=d),void rn(ye.value);if(r||0===n.total||c){const e=Math.min(d,he.value);ye.value!==e&&(ye.value=e)}else{const e=Math.min(ye.value,d);ye.value!==e&&(ye.value=e)}const m=Math.max(1,he.value||ve.value||t);ye.value<d?kn(m,{immediate:!v}):rn(ye.value)},{immediate:!0}),p.watch(()=>ae.value,e=>{if(!e)return Mt(),void Ct();bt(),Tt({immediate:!0})},{immediate:!0}),p.watch([()=>le.value.length,()=>ae.value],e=>d(this,[e],function*([e,t]){t&&e&&v&&(yield p.nextTick(),Tt({immediate:!0}))}),{flush:"post"}),p.watch(()=>i.value,()=>{ae.value&&(bt(),Tt({immediate:!0}))}),p.watch(()=>le.value.length,()=>{ae.value&&Tt({immediate:!0})}),p.watch(()=>Ge.value,e=>{if(e)for(const[t,n]of Fe)sn(t,n);else{for(const e of be.values())e.destroy();be.clear();for(const e of Array.from($e.keys()))yn(e);for(const e of Object.keys(ke))delete ke[e];for(const[e,t]of Fe)t&&ln(e,!0)}},{immediate:!1}),p.watch([()=>l.viewportPriority,()=>le.value.length],([e,t])=>{!1!==e?a.value&&t<=200&&(a.value=!1):a.value=!1}),p.watch(()=>ye.value,()=>{ae.value&&Tt({immediate:!0})}),p.watch([ot,ie,nt,()=>le.value.length,ae],()=>{Dt()},{immediate:!0}),p.watch([()=>le.value.length,ae,ie,nt,()=>qe.start,()=>qe.end],([e,t,n,o,r,l])=>{y.value&&W("virtualization",{nodes:e,virtualization:t,maxLiveNodes:n,buffer:o,focusIndex:ot.value,scroll:t?(()=>{const e=Ve.value||yt();return e?{reverse:wt(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:ye.value})}),p.watch(()=>gt.value,(e,t)=>{Je.value&&("number"==typeof t&&e<=t||e>ye.value&&Mn())}),p.onBeforeUnmount(()=>{gn();for(const e of be.values())e.destroy();be.clear();for(const e of Array.from($e.keys()))yn(e);Mt(),Ct(),xo()});const Tn={name:"MermaidBlockNodeLoading",props:{estimatedPreviewHeightPx:Number,isDark:Boolean,showHeader:{type:Boolean,default:!0}},render(e){var t;const n="function"==typeof e?e:p.h,o="function"==typeof e?{attrs:{"data-markstream-mermaid":"1","data-markstream-mode":"pending"}}:{"data-markstream-mermaid":"1","data-markstream-mode":"pending"},r=`${null!=(t=Ut(this.estimatedPreviewHeightPx))?t:360}px`;return n("div",c(u({},o),{class:["my-4 rounded-lg border overflow-hidden shadow-sm",this.isDark?"border-gray-700/30":"border-gray-200"]}),[!1===this.showHeader?null:n("div",{class:["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",this.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"]},[n("div",{class:"flex items-center gap-x-2 overflow-hidden"},[n("span",{class:this.isDark?"text-sm font-medium font-mono truncate text-gray-400":"text-sm font-medium font-mono truncate text-gray-600"},"Mermaid")])]),n("div",{class:["mermaid-preview-area min-h-[360px] relative overflow-hidden block",this.isDark?"bg-gray-900":"bg-gray-50"],style:{height:r}})])}},Nn=p.ref(null);let _n=null;function Dn(){Nn.value||_n||(_n=Promise.resolve().then(()=>require("./chunks/index-6013a5b2.cjs")).then(e=>{var t;return null!=(t=e.default)?t:e}).then(e=>{Nn.value=e}).catch(e=>{console.warn('[markstream-vue2] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',e),Nn.value=dt}))}function Sn(){return Dn(),Nn.value||Tn}const In={name:"InfographicBlockNodeLoading",props:{estimatedPreviewHeightPx:Number,isDark:Boolean,showHeader:{type:Boolean,default:!0}},render(e){var t;const n="function"==typeof e?e:p.h,o="function"==typeof e?{attrs:{"data-markstream-infographic":"1","data-markstream-mode":"pending"}}:{"data-markstream-infographic":"1","data-markstream-mode":"pending"},r=`${null!=(t=Ut(this.estimatedPreviewHeightPx))?t:360}px`;return n("div",c(u({},o),{class:["my-4 rounded-lg border overflow-hidden shadow-sm",this.isDark?"border-gray-700/30":"border-gray-200"]}),[!1===this.showHeader?null:n("div",{class:["infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",this.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"]},[n("div",{class:"flex items-center gap-x-2 overflow-hidden"},[n("span",{class:this.isDark?"text-sm font-medium font-mono truncate text-gray-400":"text-sm font-medium font-mono truncate text-gray-600"},"Infographic")])]),n("div",{class:["infographic-preview min-h-[360px] relative overflow-hidden block",this.isDark?"bg-gray-900":"bg-gray-50"],style:{height:r}})])}},jn=p.ref(null);let En=null;function Ln(){jn.value||En||(En=Promise.resolve().then(()=>require("./chunks/index-e0125777.cjs")).then(e=>{var t;return null!=(t=e.default)?t:e}).then(e=>{jn.value=e}).catch(e=>{console.warn("[markstream-vue2] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering.",e),jn.value=dt}))}function Bn(){return Ln(),jn.value||In}function An(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>pn);return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',t),dt}})}const On=p.computed(()=>l.renderCodeBlocksAsPre?dt:Cn),zn={text:Me,paragraph:ct,heading:Pe,code_block:Cn,list:He,list_item:Re,blockquote:Ht,table:mt,definition_list:T,footnote:Oe,footnote_reference:E,footnote_anchor:Ae,admonition:Xt,vmr_container:vt,hardbreak:ze,link:je,image:ce,thematic_break:pt,math_inline:Ce,math_block:Te,strong:Se,emphasis:Be,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,checkbox:C,checkbox_input:C,inline_code:Y,html_inline:F,reference:Ne,html_block:ut},Pn=p.computed(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),Rn=p.computed(()=>Pt(l.codeBlockProps)),Hn=p.computed(()=>Pt(l.codeBlockProps,{omit:["langs"]})),$n=p.computed(()=>u(u({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,monacoOptions:l.codeBlockMonacoOptions,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{}),Hn.value)),Un=p.computed(()=>u(c(u({},$n.value),{langs:l.langs}),Rn.value)),Fn=p.computed(()=>u({},l.mermaidProps||{})),Yn=p.computed(()=>u({},l.d2Props||{})),Wn=p.computed(()=>u({},l.infographicProps||{})),Kn=p.computed(()=>({typewriter:l.typewriter,fade:l.fade,customHtmlTags:oe.value.customHtmlTags,htmlPolicy:L.value})),Vn=p.computed(()=>u(u({},Kn.value),"boolean"==typeof l.showTooltips?{showTooltip:l.showTooltips}:{})),Qn=p.computed(()=>u(u({},Kn.value),"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{})),Xn=p.computed(()=>at.value.map((e,t)=>{var n,o,r,l;const i=Jn(e);let a=e,s=lo(e,i);if(("html_block"===e.type||"html_inline"===e.type)&&s===zn[e.type]){const t=String(null!=(n=e.tag)?n:"").trim().toLowerCase()||m.getHtmlTagFromContent(e.content);if(t)if(re.value.has(t)){const n=Z.value[t];n&&(s=n,a=c(u({},e),{type:t,tag:t,content:m.stripCustomHtmlWrapper(e.content,t)}))}else if(m.shouldRenderUnknownHtmlTagAsText(null!=(o=e.content)?o:e.raw,t)){const t=String(null!=(l=null!=(r=e.content)?r:e.raw)?l:"");"html_inline"===e.type?(s=Me,a={type:"text",content:t,raw:t}):(s=ct,a={type:"paragraph",children:[{type:"text",content:t,raw:t}],raw:t})}}return{node:a,component:s,bindings:so(a,i,s),isCodeBlock:"code_block"===a.type,index:t,indexKey:`${Pn.value}-${t}`,renderKey:no(a,t)}})),qn=p.computed(()=>!(!lt.value||!l.content)&&le.value.some(e=>to(e))),Zn=p.computed(()=>Ze.value.map(e=>{var t,n,o,r;let l=Gn(e.node);const i=Jn(l);let a=lo(l,i);if(("html_block"===l.type||"html_inline"===l.type)&&a===zn[l.type]){const e=String(null!=(t=l.tag)?t:"").trim().toLowerCase()||m.getHtmlTagFromContent(l.content);if(e)if(re.value.has(e)){const t=Z.value[e];t&&(a=t,l=c(u({},l),{type:e,tag:e,content:m.stripCustomHtmlWrapper(l.content,e)}))}else if(m.shouldRenderUnknownHtmlTagAsText(null!=(n=l.content)?n:l.raw,e)){const e=String(null!=(r=null!=(o=l.content)?o:l.raw)?r:"");"html_inline"===l.type?(a=Me,l={type:"text",content:e,raw:e}):(a=ct,l={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return c(u({},e),{node:l,component:a,bindings:so(l,i,a),isCodeBlock:"code_block"===l.type,indexKey:`${Pn.value}-${e.index}`,renderKey:no(l,e.index)})}));function Gn(e){var t,n,o,r,l,i,a;if("code_block"!==e.type)return e;const s=e,c=[String(null!=(t=s.language)?t:""),String(null!=(n=s.loading)?n:""),String(null!=(o=s.diff)?o:""),String(null!=(r=s.code)?r:""),String(null!=(l=s.originalCode)?l:""),String(null!=(i=s.updatedCode)?i:""),String(null!=(a=s.raw)?a:"")].join("\0"),d=Ye.get(s);if(d&&d.signature===c)return d.node;const m=u({},s);return Ye.set(s,{signature:c,node:m}),m}function Jn(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function eo(e,t){const n=t.trim().toLowerCase();if(n)for(const o of[n,jt(n),f.normalizeShikiLanguage(n)]){const t=o&&e[o];if(t)return t}}function to(e){if(!e)return!1;const t=String(e.type||"");return!!["blockquote","list","list_item","table","definition_list","footnote","admonition"].includes(t)||Array.isArray(e.items)||Array.isArray(e.rows)||Array.isArray(e.children)&&!1===["paragraph","heading","text"].includes(t)}function no(e,t){const n=`${Pn.value}-${t}`;if(!e)return n;const o=String(e.type||"unknown");if("code_block"===o)return n;const r=!0===e.loading,l="string"==typeof e.raw?e.raw.length:0,i="string"==typeof e.content?e.content.length:0,a=Array.isArray(e.children)?e.children.length:0,s=Array.isArray(e.items)?e.items.length:0,u=Array.isArray(e.rows)?e.rows.length:0;return(lt.value||r)&&(r||a>0||s>0||u>0)?`${n}-${o}-${r?"l":"r"}-${l}-${i}-${a}-${s}-${u}`:n}function oo(e){var t,n;const o=u({},Fn.value);return null==Ut(o.estimatedPreviewHeightPx)&&(o.estimatedPreviewHeightPx=Kt(Ft(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===o.maxHeight?null:null!=(n=Ut(o.maxHeight))?n:void 0)),o}function ro(e){var t,n;const o=u({},Wn.value);return null==Ut(o.estimatedPreviewHeightPx)&&(o.estimatedPreviewHeightPx=Vt(Yt(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===o.maxHeight?null:null!=(n=Ut(o.maxHeight))?n:void 0)),o}function lo(e,t){if(!e)return ft;const n=Z.value,o=n[String(e.type)];if("code_block"===e.type){const r=null!=t?t:Jn(e),l=r?eo(n,r):void 0;if(l)return l;if("mermaid"===r)return n.mermaid||Sn();if("infographic"===r)return n.infographic||Bn();if("d2"===r||"d2lang"===r)return n.d2||An;if(o)return o;return n.code_block||On.value}return o||zn[String(e.type)]||ft}function io(e){return Boolean(e&&e===Z.value.code_block)}function ao(e,t){return Boolean(e&&t&&e===eo(Z.value,t))}function so(e,t,n){const o=null!=t?t:Jn(e);return"code_block"===e.type&&ao(n,o)?"mermaid"===o?oo(e):"infographic"===o?ro(e):"d2"===o||"d2lang"===o?Yn.value:Un.value:"code_block"===e.type&&io(n)?Un.value:"mermaid"===o?oo(e):"infographic"===o?ro(e):"d2"===o||"d2lang"===o?Yn.value:"link"===e.type?Vn.value:"list"===e.type?Qn.value:"code_block"===e.type?$n.value:Kn.value}const uo=p.computed(()=>Array.isArray(l.nodes)&&l.nodes.length>0),co=p.ref(null),mo=p.ref(!1);let po,fo=0;const vo=new Set(["code_block","admonition","table","math_block","html_block","image"]);function ho(e){if(!e||"object"!=typeof e)return!1;const t=e.type;return"string"==typeof t&&vo.has(t)}function go(){return!ho(le.value[le.value.length-1])}function yo(e){var t,n;if(!e||"object"!=typeof e)return 0;const o=e,r=null!=(n=null!=(t=o.raw)?t:o.content)?n:o.code;if("string"==typeof r)return r.length;const l=o.children;if(Array.isArray(l))return l.reduce((e,t)=>e+yo(t),0);const i=o.items;return Array.isArray(i)?i.reduce((e,t)=>e+yo(t),0):0}function wo(){var e;return(null==(e=l.nodes)?void 0:e.length)?l.nodes.reduce((e,t)=>e+yo(t),0):P.value.length}function xo(){po&&(clearTimeout(po),po=void 0)}function ko(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){var t;if(!(null!=(t=e.textContent)?t:"").trim())return NodeFilter.FILTER_REJECT;const n=e.parentElement;return n?n.closest('.typewriter-cursor, .height-estimation-probes, [data-node-type="code_block"], [data-node-type="admonition"], [data-node-type="table"], [data-node-type="math_block"], [data-node-type="html_block"], [data-node-type="image"], script, style')?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let n=null,o=t.nextNode();for(;o;)n=o,o=t.nextNode();return n}function Mo(){var e,t;if("undefined"==typeof window||!mo.value||!i.value||!co.value)return;const n=i.value,o=co.value,r=ko(n),l=n.getBoundingClientRect();let a=0,s=0,u=20;if(null==r?void 0:r.textContent){const o=document.createRange(),i=r.textContent.length;o.setStart(r,Math.max(0,i-1)),o.setEnd(r,i);const c="function"==typeof o.getClientRects?o.getClientRects():void 0,d=null!=(t=null==c?void 0:c[c.length-1])?t:null==(e=r.parentElement)?void 0:e.getBoundingClientRect();d&&(a=d.right-l.left+n.scrollLeft,s=d.top-l.top+n.scrollTop,u=d.height||u),o.detach()}o.style.transform=`translate(${Math.max(0,a)}px, ${Math.max(0,s)}px)`,o.style.height=`${u}px`}return p.watch([z,P,()=>l.nodes,()=>l.typewriter,$],()=>d(this,null,function*(){if("undefined"==typeof window||uo.value)return;if($.value)return mo.value=!1,void xo();const e=wo(),t=go();if(!1===l.typewriter||!t||e<=fo)return!1!==l.typewriter&&t||(mo.value=!1),void(fo=e);fo=e,mo.value=!0,xo(),yield p.nextTick(),Mo(),po=setTimeout(()=>{mo.value=!1},3e3)}),{flush:"post",immediate:!0}),p.watch(mo,e=>d(this,null,function*(){e&&(yield p.nextTick(),Mo())}),{flush:"post"}),{__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:s,isClient:v,instance:g,debugPerformanceEnabled:y,attrs:w,textStreamState:k,streamRenderVersion:M,smoothStream:b,resolvedShowTooltips:_,inheritedHtmlPolicy:D,inheritedSmoothStreaming:S,resolvedHtmlPolicy:L,smoothStreamingEligible:B,hasMountedForSmoothStreaming:A,smoothStreamingEnabled:O,renderContent:z,rawContent:P,smoothSourceSynced:R,requestedFinal:H,effectiveFinal:$,renderVersionSource:U,logPerf:W,resolveViewportRoot:K,instanceMsgId:V,defaultMd:Q,customTagCache:X,EMPTY_PARSED_NODES:q,customComponentsMap:Z,effectiveCustomHtmlTags:G,mdBase:J,mdInstance:ee,cloneNodeValue:te,cloneParsedNodeList:ne,mergedParseOptions:oe,effectiveCustomHtmlTagsSet:re,parsedNodes:le,maxLiveNodesResolved:ie,virtualizationEnabled:ae,viewportPriorityEnabled:se,registerNodeVisibility:ue,requestFrame:de,cancelFrame:me,isTestEnv:pe,hasIdleCallback:fe,resolvedBatchSize:ve,resolvedInitialBatch:he,batchingEnabled:ge,renderedCount:ye,previousRenderContext:we,adaptiveBatchSize:xe,nodeVisibilityState:ke,nodeVisibilityHandles:be,nodeVisibilityFallbackTimers:$e,nodeSlotElements:Fe,codeBlockRenderCache:Ye,nodeSlotVersion:We,sortedNodeSlots:Ke,scrollRootElement:Ve,detachScrollHandler:Qe,pendingFocusSync:Xe,liveRange:qe,visibleNodes:Ze,deferNodes:Ge,incrementalRenderingActive:Je,previousBatchConfig:et,shouldObserveSlots:tt,liveNodeBufferResolved:nt,focusIndex:ot,nodeContentElements:rt,legacyVue26:lt,legacyNodesMode:it,legacyNodeItems:at,syncNodeRefs:st,resolveTemplateRef:ht,desiredRenderedCount:gt,resolveScrollContainer:yt,isReverseFlexScrollRoot:wt,getNormalizedScrollTop:xt,getOffsetTopWithinRoot:kt,cleanupScrollListener:Mt,setupScrollListener:bt,cancelScheduledFocusSync:Ct,scheduleFocusSync:Tt,syncFocusToScroll:Nt,clamp:_t,updateLiveRange:Dt,nodeHeights:St,heightStats:It,heightTreeSize:Et,heightSumTree:Lt,heightKnownTree:Bt,resetHeightMeasurements:At,pruneHeightMeasurements:Ot,fenwickUpdate:zt,fenwickQuery:Wt,fenwickRangeSum:Qt,rebuildHeightTrees:qt,recordNodeHeight:Zt,averageNodeHeight:Gt,estimateHeightRange:Jt,topSpacerHeight:en,bottomSpacerHeight:tn,estimateIndexForOffset:nn,estimateIndexForOffsetFromEnd:on,cleanupNodeVisibility:rn,markNodeVisible:ln,shouldRenderNode:function(e){return!(Je.value&&e>=ye.value)&&(!Ge.value||e<he.value||!0===ke[e])},destroyNodeHandle:an,setNodeSlotElement:sn,bumpNodeSlotVersion:un,setNodeContentRef:cn,batchRaf:dn,batchTimeout:mn,batchPending:fn,pendingIncrement:vn,batchIdle:hn,VIEWPORT_FALLBACK_DELAY:1800,VIEWPORT_FALLBACK_MARGIN_PX:500,cancelBatchTimers:gn,clearVisibilityFallback:yn,scheduleVisibilityFallback:wn,autoDisableViewportPriority:xn,scheduleBatch:kn,queueNextBatch:Mn,adjustAdaptiveBatchSize:bn,CodeBlockNodeAsync:Cn,MermaidBlockNodeLoading:Tn,mermaidBlockNodeComponent:Nn,mermaidBlockNodeImport:_n,loadMermaidBlockNode:Dn,resolveMermaidBlockNodeComponent:Sn,InfographicBlockNodeLoading:In,infographicBlockNodeComponent:jn,infographicBlockNodeImport:En,loadInfographicBlockNode:Ln,resolveInfographicBlockNodeComponent:Bn,D2BlockNodeAsync:An,codeBlockComponent:On,nodeComponents:zn,indexPrefix:Pn,codeBlockExtraProps:Rn,builtinCodeBlockExtraProps:Hn,codeBlockBindings:$n,customCodeBlockBindings:Un,mermaidBindings:Fn,d2Bindings:Yn,infographicBindings:Wn,nonCodeBindings:Kn,linkBindings:Vn,listBindings:Qn,legacyRenderedItems:Xn,legacyStructuredContentMode:qn,renderedItems:Zn,getCodeBlockRenderNode:Gn,getCodeBlockLanguage:Jn,getCustomCodeLanguageComponent:eo,isLegacyStructuredNode:to,getRenderKey:no,getMermaidBindingsFor:oo,getInfographicBindingsFor:ro,getNodeComponent:lo,isCustomCodeBlockComponent:io,isCustomLanguageCodeBlockComponent:ao,getBindingsFor:so,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)},hasExplicitNodes:uo,typewriterCursorRef:co,showTypewriterCursor:mo,typewriterCursorTimeout:po,lastTypewriterContentLength:fo,TYPEWRITER_CURSOR_EXCLUDED_NODE_TYPES:vo,shouldSkipTypewriterCursorForNode:ho,shouldShowTypewriterCursorForCurrentNodes:go,getNodeTextLength:yo,getTypewriterContentLength:wo,clearTypewriterCursorTimeout:xo,getLastTextNode:ko,updateTypewriterCursorPosition:Mo,LegacyNodesRenderer:Rt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerRef",staticClass:"markstream-vue2 markdown-renderer",class:[{dark:n.props.isDark},{virtualized:n.virtualizationEnabled}],attrs:{"data-custom-id":n.props.customId},on:{click:n.handleContainerClick,mouseover:n.handleContainerMouseover,mouseout:n.handleContainerMouseout}},[n.legacyNodesMode?e._l(n.legacyRenderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[o.isCodeBlock||!1===n.props.fade?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"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",o.bindings,!1)):t("transition",{attrs:{name:"fade",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"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",o.bindings,!1))],1)],1)])}):n.legacyStructuredContentMode?t(n.LegacyNodesRenderer,{attrs:{nodes:n.parsedNodes,"custom-id":n.props.customId,"index-key":n.props.indexKey,typewriter:n.props.typewriter,fade:n.props.fade,"show-tooltips":n.props.showTooltips,"code-block-stream":n.props.codeBlockStream,"code-block-dark-theme":n.props.codeBlockDarkTheme,"code-block-light-theme":n.props.codeBlockLightTheme,"code-block-monaco-options":n.props.codeBlockMonacoOptions,"render-code-blocks-as-pre":n.props.renderCodeBlocksAsPre,"code-block-min-width":n.props.codeBlockMinWidth,"code-block-max-width":n.props.codeBlockMaxWidth,"code-block-props":n.props.codeBlockProps,themes:n.props.themes,langs:n.props.langs,"is-dark":n.props.isDark,"custom-html-tags":n.mergedParseOptions.customHtmlTags,"html-policy":n.resolvedHtmlPolicy},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}}):[n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.topSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e(),e._l(n.renderedItems,function(o){var r;return t("div",{key:o.renderKey,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"},[o.isCodeBlock||!1===n.props.fade?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"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",o.bindings,!1)):t("transition",{attrs:{name:"fade",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"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",o.bindings,!1))],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()],n.showTypewriterCursor?t("span",{ref:"typewriterCursorRef",staticClass:"typewriter-cursor",attrs:{"aria-hidden":"true"}}):e._e()],2)},[],!1,null,"6b8b1370",null,null).exports,Xt=b(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)}`,a=p.getCurrentInstance(),s=p.computed(()=>x(null==a?void 0:a.proxy)?Rt:Qt);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,instance:a,nestedRenderer:s}}}),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.nestedRenderer,{tag:"component",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,"f9c1d6b9",null,null).exports;function qt(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}const Zt=b(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,"5b7455c5",null,null).exports,Gt=b(p.defineComponent({__name:"HtmlPreviewFrame",props:{code:null,isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:null,onClose:null,title:null},setup(e){var t;const n=e,o=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV);let r=null;function l(e){return new Set(e.trim().toLowerCase().split(/\s+/).filter(Boolean))}function i(e){if(!o||"undefined"==typeof console||r===e)return;const t=l(e);t.has("allow-scripts")&&t.has("allow-same-origin")&&(r=e,console.warn("[markstream-vue2] htmlPreviewSandbox contains both allow-scripts and allow-same-origin. Use this only for fully trusted content served from an isolated origin."))}function a(e,t){return"string"==typeof e?(i(e),e):void 0!==e?"":!0===t?"allow-scripts":""}const{t:s}=ue(),u=p.computed(()=>{const e=n.code||"",t=e.trim().toLowerCase();return t.startsWith("<!doctype")||t.startsWith("<html")||t.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: ${n.isDark?"#020617":"#ffffff"};\n color: ${n.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>`}),c=p.computed(()=>a(n.htmlPreviewSandbox,n.htmlPreviewAllowScripts));function d(e){var t;"Escape"!==e.key&&"Esc"!==e.key||null==(t=n.onClose)||t.call(n)}return p.onMounted(()=>{"undefined"!=typeof window&&window.addEventListener("keydown",d)}),p.onUnmounted(()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",d)}),{__sfc:!0,props:n,isDevEnv:o,lastWarnedDangerousSandbox:r,normalizeSandboxTokens:l,warnDangerousHtmlPreviewSandbox:i,resolveHtmlPreviewSandboxValue:a,t:s,srcdoc:u,sandboxValue:c,handleKeydown:d,Portal:Zt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[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:n.sandboxValue,referrerpolicy:"no-referrer",srcdoc:n.srcdoc}})])])])])},[],!1,null,"56f5a269",null,null).exports;let Jt=null,en=null,tn=null,nn=null,on=null;const rn=new WeakMap;let ln=0;const an=b(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},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:void 0},htmlPreviewAllowScripts:{type:Boolean,default:void 0},htmlPreviewSandbox:{type:String,default:void 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,s(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 s(e){return null==e?{passive:!0}:"boolean"==typeof e?{capture:e,passive:!0}:"object"==typeof e?"passive"in e?e:c(u({},e),{passive:!0}):{passive:!0}}"undefined"!=typeof window&&i();const m=p.getCurrentInstance(),f=p.computed(()=>{var e,t,n,o,r,l,i,a,s,u;const c=null==m?void 0:m.proxy,d=null!=(e=null==c?void 0:c.$listeners)?e:{};if(d.previewCode||d["preview-code"])return!0;const p=null!=(i=null!=(l=null==(n=null==(t=null==c?void 0:c.$vnode)?void 0:t.data)?void 0:n.on)?l:null==(r=null==(o=null==c?void 0:c.$vnode)?void 0:o.componentOptions)?void 0:r.listeners)?i:{};if(p.previewCode||p["preview-code"])return!0;const f=null!=(u=null==(a=null==c?void 0:c.$vnode)?void 0:a.props)?u:null==(s=null==m?void 0:m.vnode)?void 0:s.props;return!(!f||!f.onPreviewCode&&!f.onPreviewcode)}),{t:v}=ue(),g=p.ref(null),y=p.ref(null),w=p.ref(!1),x=p.ref(jt(r.node.language)),k=p.computed(()=>Et(x.value)),M=p.computed(()=>"plaintext"===k.value),b=p.ref(!1),C=p.ref(!1),T=p.ref(!1),N=p.ref(!1),_=p.ref(null);let D=0;const S=Fe();let I=null;const j=p.ref("undefined"==typeof window);"undefined"!=typeof window&&p.watch(()=>y.value,e=>{if(null==I||I.destroy(),I=null,!e)return void(j.value=!1);const t=S(e,{rootMargin:"400px"});I=t,j.value=t.isVisible.value,t.whenVisible.then(()=>{j.value=!0})},{immediate:!0}),p.onBeforeUnmount(()=>{null==I||I.destroy(),I=null});let E=null,L=null,B=()=>{},A=()=>{},O=()=>null,z=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),P=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),R=()=>{},H=()=>{},$=()=>{},U=null,F=()=>{var e;return String(null!=(e=r.node.language)?e:"plaintext")},Y=()=>d(this,null,function*(){}),W=null;const K=[];let V=null;const Q=p.computed(()=>r.node.diff),X=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function q(e){var t;if("boolean"==typeof e)return e;if(e&&"object"==typeof e){const n=e;return c(u(u({},X),n),{enabled:null==(t=n.enabled)||t})}return u({},X)}const Z=p.computed(()=>{var e;const t=r.monacoOptions?u({},r.monacoOptions):{};if(!Q.value)return t;const n=void 0===t.diffHideUnchangedRegions?u({},X):q(t.diffHideUnchangedRegions),o=void 0===t.hideUnchangedRegions?void 0:q(t.hideUnchangedRegions),l=null!=(e=t.diffUnchangedRegionStyle)?e:"line-info";return c(u(u(u({},{maxComputationTime:0,diffAlgorithm:"legacy",ignoreTrimWhitespace:!1,renderIndicators:!0,diffUpdateThrottleMs:120,renderLineHighlight:"none",renderLineHighlightOnlyWhenFocus:!0,selectionHighlight:!1,occurrencesHighlight:"off",matchBrackets:"never",lineDecorationsWidth:12,lineNumbersMinChars:2,glyphMargin:!1,fontSize:13,lineHeight:30,renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,padding:{top:10,bottom:"line-info"===l||"line-info-basic"===l||"metadata"===l?22:14},diffHideUnchangedRegions:n,diffLineStyle:"background",diffAppearance:"auto",diffUnchangedRegionStyle:l,diffHunkActionsOnHover:!0,diffHunkHoverHideDelayMs:160}),t),void 0===o?{}:{hideUnchangedRegions:o}),{diffHideUnchangedRegions:n})}),G=p.computed(()=>Q.value?"diff":"single"),J=p.ref(G.value),ee=p.ref(!1),te=p.ref(!1),ne=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",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 wt();if(!e)return ne&&console.warn("[markstream-vue2] stream-monaco is not installed. Code blocks will use basic rendering. Install stream-monaco for enhanced code editor features."),void(ee.value=!0);const t=e.useMonaco,n=e.detectLanguage;if("function"==typeof n&&(F=n),"function"==typeof t){const e=$e();if(e&&r.themes&&Array.isArray(r.themes)&&!r.themes.includes(e))throw new Error("Preferred theme not in provided themes array");W=Qe();const n=t(W);E=n.createEditor||E,L=n.createDiffEditor||L,B=n.updateCode||B,A=n.updateDiff||A,O=n.getEditor||O,z=n.getEditorView||z,P=n.getDiffEditorView||P,R=n.cleanupEditor||R,H=n.safeClean||n.cleanupEditor||H,$=n.refreshDiffPresentation||$,Y=n.setTheme||Y,N.value=!0,g.value&&(yield ze(g.value))}}catch(e){ne&&console.warn("[markstream-vue2] Failed to initialize Monaco editor:",e),ee.value=!0}})})();const oe=p.ref("number"==typeof(null==(o=Z.value)?void 0:o.fontSize)?Z.value.fontSize:Number.NaN),re=p.ref(oe.value),ae=p.computed(()=>{const e=oe.value,t=re.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0});function se(){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 ce(){var e,t,n,o,r;try{const l=Q.value?null!=(n=null==(t=null==(e=P())?void 0:e.getModifiedEditor)?void 0:t.call(e))?n:P():z(),i=O(),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 de(e){var t,n;try{const o=O(),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=se();if(o&&o>0)return o;const r=Number.isFinite(re.value)&&re.value>0?re.value:12;return Math.max(12,Math.round(1.35*r))}function me(){var e;if(Number.isFinite(re.value)&&re.value>0&&Number.isFinite(oe.value))return re.value;const t=ce();return"number"==typeof(null==(e=Z.value)?void 0:e.fontSize)?(oe.value=Z.value.fontSize,re.value=Z.value.fontSize,re.value):t&&t>0?(oe.value=t,re.value=t,t):(oe.value=12,re.value=12,12)}function pe(){var e,t,n,o,r,l,i,a,s,u,c,d,m,p;try{const f=Q.value?P():z();if(!f)return null;if(Q.value&&(null==f?void 0:f.getOriginalEditor)&&(null==f?void 0:f.getModifiedEditor)){const m=null==(e=f.getOriginalEditor)?void 0:e.call(f),p=null==(t=f.getModifiedEditor)?void 0:t.call(f);null==(n=null==m?void 0:m.layout)||n.call(m),null==(o=null==p?void 0:p.layout)||o.call(p);const v=(null==(r=null==m?void 0:m.getContentHeight)?void 0:r.call(m))||0,h=(null==(l=null==p?void 0:p.getContentHeight)?void 0:l.call(p))||0,g=Math.max(v,h);if(g>0)return Math.ceil(g+1);const y=(null==(s=null==(a=null==(i=null==m?void 0:m.getModel)?void 0:i.call(m))?void 0:a.getLineCount)?void 0:s.call(a))||1,w=(null==(d=null==(c=null==(u=null==p?void 0:p.getModel)?void 0:u.call(p))?void 0:c.getLineCount)?void 0:d.call(c))||1,x=Math.max(y,w),k=Math.max(de(m),de(p));return Math.ceil(x*(k+1.5)+0+1)}if(null==f?void 0:f.getContentHeight){null==(m=null==f?void 0:f.layout)||m.call(f);const e=f.getContentHeight();if(e>0)return Math.ceil(e+1)}const v=null==(p=null==f?void 0:f.getModel)?void 0:p.call(f);let h=1;v&&"function"==typeof v.getLineCount&&(h=v.getLineCount());const g=de(f);return Math.ceil(h*(g+1.5)+0+1)}catch(f){return null}}function fe(e){const t=String(null!=e?e:"").match(/\d+(?:\.\d+)?/g);if(!t||t.length<3)return null;const[n,o,r]=t.slice(0,3).map(Number);return.2126*n+.7152*o+.0722*r}function ve(e,t,n){if(!M.value)return!1;const o=fe(e),r=fe(t);return n?null!=o&&o>170||null!=r&&r<110:null!=o&&o<85||null!=r&&r>190}function he(){var e,t,n,o,r,l,i,a;const s=g.value,u=y.value;if(!s||!u)return;if(Q.value)return u.style.removeProperty("--vscode-editor-foreground"),u.style.removeProperty("--vscode-editor-background"),void u.style.removeProperty("--vscode-editor-selectionBackground");const c=s.querySelector(".monaco-editor")||s,d=c.querySelector(".monaco-editor-background")||c,m=c.querySelector(".view-lines")||c;let p=null,f=null,v=null;try{"undefined"!=typeof window&&"function"==typeof window.getComputedStyle&&(p=window.getComputedStyle(c),f=d===c?p:window.getComputedStyle(d),v=m===c?p:window.getComputedStyle(m))}catch(b){p=null,f=null,v=null}const h=String(null!=(e=null==p?void 0:p.getPropertyValue("--vscode-editor-foreground"))?e:"").trim(),w=String(null!=(t=null==p?void 0:p.getPropertyValue("--vscode-editor-background"))?t:"").trim(),x=String(null!=(o=null!=(n=null==p?void 0:p.getPropertyValue("--vscode-editor-selectionBackground"))?n:null==p?void 0:p.getPropertyValue("--vscode-editor-hoverHighlightBackground"))?o:"").trim(),k=h||String(null!=(l=null!=(r=null==v?void 0:v.color)?r:null==p?void 0:p.color)?l:"").trim(),M=w||String(null!=(a=null!=(i=null==f?void 0:f.backgroundColor)?i:null==p?void 0:p.backgroundColor)?a:"").trim();if(ve(M,k,u.classList.contains("is-dark")))return u.style.removeProperty("--vscode-editor-foreground"),u.style.removeProperty("--vscode-editor-background"),void u.style.removeProperty("--vscode-editor-selectionBackground");k&&u.style.setProperty("--vscode-editor-foreground",k),M&&u.style.setProperty("--vscode-editor-background",M),x&&u.style.setProperty("--vscode-editor-selectionBackground",x)}const ge=/auto|scroll|overlay/i;function ye(e){var t,n;if("undefined"==typeof window)return null;const o=null!=(t=null==e?void 0:e.ownerDocument)?t:document,r=o.scrollingElement||o.documentElement||o.body;let l=null!=(n=null==e?void 0:e.parentElement)?n:null;for(;l&&l!==o.body&&l!==r;){const e=window.getComputedStyle(l),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(ge.test(t)||ge.test(n))return l;l=l.parentElement}return r}function we(e,t,n){var o;if("undefined"==typeof window)return;const r=Math.ceil(t),l=Math.ceil(n)-r;if(!l)return;const i=ye(e);if(!i)return;const a=null!=(o=e.ownerDocument)?o:document,s=i===a.body||i===a.documentElement||i===a.scrollingElement,u=s?0:i.getBoundingClientRect().top;e.getBoundingClientRect().top-u>=0||(s&&"function"==typeof window.scrollBy?window.scrollBy(0,l):i.scrollTop+=l)}function xe(){try{const e=g.value;if(!e)return;const t=e.getBoundingClientRect().height,n=pe();if(null!=n&&n>0){const o=Math.ceil(n);e.style.minHeight="0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",we(e,t,o)}}catch(e){}}function ke(){for(var e;K.length>0;)try{null==(e=K.pop())||e()}catch(t){}}function Me(){if(ke(),!Q.value)return;const e=g.value;if(!e)return;const t=e.querySelector(".monaco-diff-editor");if(!t||t.classList.contains("side-by-side"))return;const n=Array.from(t.querySelectorAll(".editor.original .diff-hidden-lines")),o=Array.from(t.querySelectorAll(".editor.modified .diff-hidden-lines")),r=Math.min(n.length,o.length);for(let l=0;l<r;l++){const e=n[l],t=o[l].querySelector("a"),r=e.querySelector(".center > div:first-child");if(!t||!r)continue;const i=document.createElement("button");i.type="button",i.className="markstream-inline-fold-proxy";const a=t.getAttribute("title")||"Show Unchanged Region";i.title=a,i.setAttribute("aria-label",a);const s=t.querySelector(".codicon"),u=document.createElement("span");u.className=(null==s?void 0:s.className)||"codicon codicon-unfold",i.append(u);const c=e=>{e.preventDefault(),e.stopPropagation()},d=e=>{e.preventDefault(),e.stopPropagation(),t.click()},m=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),t.click())};i.addEventListener("mousedown",c),i.addEventListener("click",d),i.addEventListener("keydown",m),r.replaceChildren(i),K.push(()=>{i.removeEventListener("mousedown",c),i.removeEventListener("click",d),i.removeEventListener("keydown",m),r.contains(i)&&r.replaceChildren()})}}function be(){null==V&&(V=qt(()=>{V=null,qt(()=>{Ce(),Me(),C.value||(b.value?xe():Ne(),qt(()=>{Ce(),Me()}))})}))}function Ce(){if(!Q.value)return;const e=g.value;if(!e)return;const t=Array.from(e.querySelectorAll(".stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal"));for(const n of t){if(!(n instanceof HTMLButtonElement))continue;const e="up"===n.dataset.direction?"up":"down",t=document.createElement("span");t.className=`codicon codicon-chevron-${e}`,n.replaceChildren(t)}}function Te(e,t,n){const o=Math.min(t,n),r=t>n+1;return e.style.minHeight="0px",e.style.height=`${Math.ceil(o)}px`,e.style.maxHeight=`${Math.ceil(n)}px`,e.style.overflow=r?"auto":"hidden",Math.ceil(o)}function Ne(){var e;try{const t=g.value;if(!t)return;const n=t.getBoundingClientRect().height,o=_e();if(D>0&&(D--,null!=_.value))return void we(t,n,Te(t,_.value,o));const r=pe();if(null!=r&&r>0)return void we(t,n,Te(t,r,o));if(null!=_.value)return void we(t,n,Te(t,_.value,o));const l=Math.ceil((null==(e=t.getBoundingClientRect)?void 0:e.call(t).height)||0);if(l>0)return void we(t,n,Te(t,l,o));const i=Number.parseFloat(t.style.height);!Number.isNaN(i)&&i>0?we(t,n,Te(t,i,o)):we(t,n,Te(t,o,o))}catch(t){}}function _e(){var e,t;const n=null!=(t=null==(e=Z.value)?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 De=p.computed(()=>r.isShowPreview&&("html"===x.value||"svg"===x.value));p.watch(()=>r.node.language,e=>{x.value=jt(e)}),p.watch(()=>[r.node.originalCode,r.node.updatedCode,k.value,Q.value],e=>d(this,[e],function*([e,t,n,o]){if(!1!==r.stream&&o){if(E&&!T.value&&g.value)try{yield ze(g.value)}catch(l){}A(String(null!=e?e:""),String(null!=t?t:""),k.value),be()}})),p.watch(()=>r.node.code,e=>d(this,null,function*(){if(!1!==r.stream&&(x.value||(x.value=jt(F(e))),!Q.value)){if(E&&!T.value&&g.value)try{yield ze(g.value)}catch(t){}B(e,k.value),b.value&&be()}}));const Se=p.computed(()=>{const e=x.value;return e?Bt[e]||e.charAt(0).toUpperCase()+e.slice(1):Bt[""]||"Plain Text"}),Ie=p.computed(()=>(Nt.value,Lt(x.value||""))),je=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),Q.value?(e.color="var(--markstream-diff-shell-fg)",e.borderColor="var(--markstream-diff-shell-border)"):(e.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",e.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg))",e.borderColor="var(--markstream-code-border-color)"),e}),Ee=p.computed(()=>{if(!Q.value)return{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg))"}}),Le=p.computed(()=>!1!==r.showTooltips);function Be(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}function Ae(e){var t,n;try{if(Q.value){const n=P();null==(t=null==n?void 0:n.updateOptions)||t.call(n,{automaticLayout:e})}else{const t=z();null==(n=null==t?void 0:t.updateOptions)||n.call(t,{automaticLayout:e})}}catch(o){}}function Oe(e){return d(this,null,function*(){var t,n,o;if(!E)return;Xe(),Q.value?(H(),L?yield L(e,String(null!=(t=r.node.originalCode)?t:""),String(null!=(n=r.node.updatedCode)?n:""),k.value):yield E(e,r.node.code,k.value)):yield E(e,r.node.code,k.value);const l=Q.value?P():z();if("number"==typeof(null==(o=Z.value)?void 0:o.fontSize))null==l||l.updateOptions({fontSize:Z.value.fontSize,automaticLayout:!1}),oe.value=Z.value.fontSize,re.value=Z.value.fontSize;else{const e=ce();e&&e>0?(oe.value=e,re.value=e):(oe.value=12,re.value=12)}b.value||C.value||be(),!1===r.loading&&(yield p.nextTick(),qt(()=>{be()}))})}function ze(e){if(!E)return null;if(U)return U;T.value=!0;const t=(()=>d(this,null,function*(){yield Oe(e)}))();return U=t.finally(()=>{U=null}),U}p.watch(Le,e=>{e||ie()}),p.watch(()=>re.value,(e,t)=>{const n=Q.value?P():z();n&&"number"==typeof e&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),b.value&&!C.value&&be())},{flush:"post",immediate:!1});const Pe=p.watch(()=>[g.value,Q.value,r.stream,r.loading,N.value,j.value],e=>d(this,[e],function*([e,t,n,o,r,l]){if(!e||!E)return;if(!l)return;if(!1===n&&!1!==o)return;const i=ze(e);i&&(yield i,Pe())}));function Re(){return r.isDark?r.darkTheme:r.lightTheme}function He(e){return"string"==typeof e?e:e&&"object"==typeof e&&"name"in e?String(e.name):null}function $e(){var e;const t=Re(),n=null==(e=Z.value)?void 0:e.theme,o=null!=t?t:n,l=Array.isArray(r.themes)?r.themes:[];if(!l.length||null==o)return o;const i=He(o),a=l.map(e=>He(e)).filter(e=>!!e);if(!i||a.includes(i))return o;const s=He(n);return null!=n&&s&&a.includes(s)?n:l[0]}function Ue(){Xe();const e=$e(),t=()=>{Q.value&&$(),qt(()=>{he(),be()})};e?function(e,t){const n=function(e){if(null==e)return null;if("string"==typeof e)return e;if("object"==typeof e&&e&&"name"in e)return String(e.name);if("object"==typeof e){const n=rn.get(e);if(n)return n;try{const t=JSON.stringify(e);if(t)return rn.set(e,t),t}catch(t){}const o="__theme_"+ ++ln;return rn.set(e,o),o}return String(e)}(t);return n?(on=e,Jt||nn!==n?(en=t,tn=n,Jt||(Jt=(()=>d(this,null,function*(){for(;tn&&null!=en;){const n=en,o=tn;if(en=null,tn=null,nn!==o)try{yield(null!=on?on:e)(n),nn=o}catch(t){}}}))().finally(()=>{Jt=null}),Jt)):Promise.resolve()):Promise.resolve()}(Y,e).then(t).catch(()=>{}):t()}function Ye(e){var t;const n=(null!=(t=He(e))?t:"").toLowerCase();return n?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(e=>n.includes(e))&&!["light","latte","dawn","lotus"].some(e=>n.includes(e)):!!r.isDark}p.watch(G,(e,t)=>d(this,null,function*(){if(e!==t&&(J.value=e,E&&g.value&&T.value&&(!1!==r.stream||!1===r.loading)&&j.value))try{T.value=!1,U=null,ke(),H(),yield p.nextTick(),yield ze(g.value)}catch(n){T.value=!1}}));const We=p.computed(()=>Ye($e())),Ke=p.computed(()=>{var e;if(!Q.value)return We.value?"dark":"light";const t=null==(e=Z.value)?void 0:e.diffAppearance;return"light"===t||"dark"===t?t:r.isDark?"dark":"light"}),Ve=p.computed(()=>Q.value?"dark"===Ke.value:We.value);function Qe(){return c(u(c(u({wordWrap:"on",wrappingIndent:"same",themes:r.themes},Z.value||{}),{theme:$e()}),Q.value?{diffAppearance:Ke.value}:{}),{onThemeChange(){he()}})}function Xe(){const e=Qe();if(!W)return W=e,W;for(const t of Object.keys(W))t in e||delete W[t];return Object.assign(W,e),W}const qe=p.computed(()=>{var e,t,n,o,r,l,i,a,s,u,c,d,m,p;return JSON.stringify({diffLineStyle:null!=(t=null==(e=Z.value)?void 0:e.diffLineStyle)?t:"background",diffUnchangedRegionStyle:null!=(o=null==(n=Z.value)?void 0:n.diffUnchangedRegionStyle)?o:"line-info",diffHideUnchangedRegions:null==(l=null==(r=Z.value)?void 0:r.diffHideUnchangedRegions)||l,renderSideBySide:null==(a=null==(i=Z.value)?void 0:i.renderSideBySide)||a,enableSplitViewResizing:null==(u=null==(s=Z.value)?void 0:s.enableSplitViewResizing)||u,ignoreTrimWhitespace:null==(d=null==(c=Z.value)?void 0:c.ignoreTrimWhitespace)||d,originalEditable:null!=(p=null==(m=Z.value)?void 0:m.originalEditable)&&p})});p.watch(()=>[r.monacoOptions,j.value],()=>{var e,t;if(Xe(),!E||!j.value)return;const n=Q.value?P():z(),o="number"==typeof(null==(e=Z.value)?void 0:e.fontSize)?Z.value.fontSize:Number.isFinite(re.value)?re.value:void 0;"number"==typeof o&&Number.isFinite(o)&&o>0&&(null==(t=null==n?void 0:n.updateOptions)||t.call(n,{fontSize:o})),be()},{deep:!0}),p.watch(()=>{var e,t;return[r.isDark,r.darkTheme,r.lightTheme,r.themes,null==(e=Z.value)?void 0:e.theme,null==(t=Z.value)?void 0:t.diffAppearance,N.value,T.value,j.value]},()=>{N.value&&Ue()},{flush:"post"}),p.watch(()=>[qe.value,N.value,j.value],(e,t)=>d(this,[e,t],function*([e,t,n],[o]){if(Xe(),Q.value&&t&&n&&E&&g.value&&T.value&&e!==o&&(!1!==r.stream||!1===r.loading))try{T.value=!1,U=null,ke(),H(),yield p.nextTick(),yield ze(g.value)}catch(l){T.value=!1}}),{flush:"post"});const Ze=p.watch(()=>[r.loading,j.value],e=>d(this,[e],function*([e,t]){t&&(e||(yield p.nextTick(),qt(()=>{C.value||(b.value?xe():Ne()),Ze()})))}),{immediate:!0,flush:"post"});return p.onUnmounted(()=>{ke(),null!=V&&(function(e){try{if(null==e)return;if("undefined"!=typeof globalThis&&"function"==typeof globalThis.cancelAnimationFrame)return void globalThis.cancelAnimationFrame(e)}catch(t){}try{globalThis.clearTimeout(e)}catch(t){}}(V),V=null),R()}),{__sfc:!0,props:r,emits:t,MONACO_TOUCH_PATCH_FLAG:l,ensureMonacoPassiveTouchListeners:i,shouldForcePassiveForMonaco:a,withPassiveOptions:s,instance:m,hasPreviewListener:f,t:v,codeEditor:g,container:y,copyText:w,codeLanguage:x,monacoLanguage:k,isPlainTextLanguage:M,isExpanded:b,isCollapsed:C,editorCreated:T,monacoReady:N,expandRafId:null,heightBeforeCollapse:_,resumeGuardFrames:D,registerVisibility:S,viewportHandle:I,viewportReady:j,createEditor:E,createDiffEditor:L,updateCode:B,updateDiffCode:A,getEditor:O,getEditorView:z,getDiffEditorView:P,cleanupEditor:R,safeClean:H,refreshDiffPresentation:$,createEditorPromise:U,detectLanguage:F,setTheme:Y,runtimeMonacoOptions:W,inlineFoldProxyCleanups:K,deferredEditorVisualSyncRafId:V,isDiff:Q,defaultDiffHideUnchangedRegions:X,resolveDiffHideUnchangedRegionsOption:q,resolvedMonacoOptions:Z,desiredEditorKind:G,currentEditorKind:J,usePreCodeRender:ee,showInlinePreview:te,isDevEnv:ne,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:oe,codeFontSize:re,fontBaselineReady:ae,CONTENT_PADDING:0,LINE_EXTRA_PER_LINE:1.5,PIXEL_EPSILON:1,measureLineHeightFromDom:se,readActualFontSizeFromEditor:ce,getLineHeightSafe:de,ensureFontBaseline:me,increaseCodeFont:function(){const e=me(),t=Math.min(36,e+1);re.value=t},decreaseCodeFont:function(){const e=me(),t=Math.max(10,e-1);re.value=t},resetCodeFont:function(){me(),Number.isFinite(oe.value)&&(re.value=oe.value)},computeContentHeight:pe,getColorLuminance:fe,shouldPreferPlainTextFallbackSurface:ve,syncEditorCssVars:he,resizeSyncHandler:null,SCROLL_PARENT_OVERFLOW_RE:ge,resolveScrollRootElement:ye,adjustScrollAfterHeightChange:we,updateExpandedHeight:xe,clearInlineFoldProxies:ke,syncInlineFoldProxies:Me,scheduleEditorVisualSync:be,syncDiffRevealButtons:Ce,applyCollapsedContainerHeight:Te,updateCollapsedHeight:Ne,getMaxHeightValue:_e,isPreviewable:De,displayLanguage:Se,languageIcon:Ie,containerStyle:je,headerStyle:Ee,tooltipsEnabled:Le,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)),w.value=!0,t("copy",r.node.code),setTimeout(()=>{w.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})},resolveTooltipTarget:Be,onBtnHover:function(e,t,n="top"){if(!Le.value)return;const o=Be(e);if(!o)return;const l=e;le(o,t,n,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,r.isDark)},onBtnLeave:function(){Le.value&&ie()},onCopyHover:function(e){if(!Le.value)return;const t=Be(e);if(!t)return;const n=e;le(t,w.value?v("common.copied")||"Copied":v("common.copy")||"Copy","top",!1,null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0,r.isDark)},toggleExpand:function(e){if(b.value=!b.value,e&&Le.value){const t=Be(e);t&&le(t,b.value?v("common.collapse")||"Collapse":v("common.expand")||"Expand","top",!1,void 0,r.isDark)}const t=Q.value?P():z(),n=g.value;t&&n&&(b.value?(Ae(!0),n.style.maxHeight="none",n.style.overflow="visible",xe()):(Ae(!1),n.style.overflow="auto",Ne()))},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&&(_.value=n)}Ae(!1)}else{b.value&&Ae(!0),g.value&&null!=_.value&&(g.value.style.height=`${_.value}px`);const e=Q.value?P():z();try{null==(n=null==e?void 0:e.layout)||n.call(e)}catch(o){}D=2,be()}},previewCode:function(){if(!De.value)return;const e=x.value;if(f.value){const n="html"===e?"text/html":"image/svg+xml",o="html"===e?v("artifacts.htmlPreviewTitle")||"HTML Preview":v("artifacts.svgPreviewTitle")||"SVG Preview";return void t("previewCode",{node:r.node,artifactType:n,artifactTitle:o,id:`temp-${e}-${Date.now()}`})}"html"===e&&(te.value=!te.value)},setAutomaticLayout:Ae,runEditorCreation:Oe,ensureEditorCreation:ze,stopCreateEditorWatch:Pe,getPreferredColorScheme:Re,getThemeName:He,resolveRequestedTheme:$e,themeUpdate:Ue,themeLooksDark:Ye,resolvedChromeIsDark:We,effectiveDiffAppearance:Ke,resolvedSurfaceIsDark:Ve,buildRuntimeMonacoOptions:Qe,syncRuntimeMonacoOptions:Xe,monacoStructuralSignature:qe,stopLoadingWatch:Ze,stopExpandAutoResize:function(){},PreCodeNode:dt,HtmlPreviewFrame:Gt}}}),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.resolvedSurfaceIsDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":n.props.loading,"is-dark":n.resolvedSurfaceIsDark,"is-diff":n.isDiff,"is-plain-text":n.isPlainTextLanguage}],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",style:n.headerStyle},[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"},[n.props.showCollapseButton?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"}})])]):e._e(),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:function(e){return n.toggleExpand(e)},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:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):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"}})])]):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)"}],staticClass:"code-editor-layer"},[t("div",{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,"html-preview-allow-scripts":n.props.htmlPreviewAllowScripts,"html-preview-sandbox":n.props.htmlPreviewSandbox,"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,"f73cb5ae",null,null).exports,sn=()=>import("@terrastruct/d2");let un=null,cn=sn;function dn(e){cn=e,un=null}const mn=b(p.defineComponent({__name:"D2BlockNode",props:{node:null,maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:null,darkThemeId:null,showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(e){const t=e,{t:n}=ue(),o=p.ref(!1),r=p.ref(!1),l=p.ref(!1),i=p.ref(!1),a=p.ref(null),s=p.ref(!1),c=p.ref(""),m=p.ref(0),f=p.ref(null),v=p.ref(null),h=p.computed(()=>{var e;return null!=(e=t.node.code)?e:""}),g=p.computed(()=>l.value||!i.value||!c.value),y=p.computed(()=>!!c.value),w=p.computed(()=>{if(g.value&&v.value)return{minHeight:`${v.value}px`}}),x=p.computed(()=>{if(t.maxHeight)return{maxHeight:"number"==typeof t.maxHeight?`${t.maxHeight}px`:String(t.maxHeight)}}),k="undefined"!=typeof window;let M=null,b=!1,C=!1,T=0,N=null,_=!1,D=null;const S={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function I(e){return!e||e.disabled}const j=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],E=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function L(e){return e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function B(e){if(!e)return"";const t=e.trim();return E.test(t)?t:""}function A(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(j.some(e=>e.test(n))){o.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&t.value){const n=B(t.value);if(!n){o.removeAttribute(e);continue}n!==t.value&&o.setAttribute(e,n)}}}}}function O(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return"";if(!e)return"";const t=L(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return"";const o=n;return A(o),o.classList.add("markstream-d2-root-svg"),o.outerHTML}function z(e){const t=O(e);c.value=t||""}function P(){c.value=""}function R(e){return e?"string"==typeof e?e:"string"==typeof e.svg?e.svg:"string"==typeof e.data?e.data:"":""}function H(){return d(this,null,function*(){if(M)return M;const e=yield function(){return d(this,null,function*(){if(un)return un;const e=cn;if(!e)return null;let t;try{t=yield e()}catch(n){if(e===sn)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw n}return t?(un=function(e){var t;if(!e)return e;if(e.D2&&"function"==typeof e.D2)return e.D2;if(e.default&&e.default.D2&&"function"==typeof e.default.D2)return e.default.D2;const n=null!=(t=e.default)?t:e;return"function"==typeof n?n:(null==n?void 0:n.D2)&&"function"==typeof n.D2?n.D2:n}(t),un):null})}();if(!e)return null;if("function"==typeof e){const t=new e;return t&&"function"==typeof t.compile?M=t:"function"==typeof e.compile&&(M=e),M}return(null==e?void 0:e.D2)&&"function"==typeof e.D2?(M=new e.D2,M):("function"==typeof e.compile&&(M=e),M)})}function $(){return d(this,null,function*(){var e,n,o,r,c;if(!k||C)return;if(t.loading&&!t.progressiveRender)return;const d=h.value;if(!d)return P(),void(a.value=null);const p=++m.value;s.value=!0,a.value=null;try{const s=yield H();if(!s)return i.value=!1,l.value=!0,P(),void(a.value="D2 is not available.");if("function"!=typeof s.compile||"function"!=typeof s.render)throw new TypeError("D2 instance is missing compile/render methods.");i.value=!0;const f=yield s.compile(d);if(p!==m.value)return;const v=null!=(e=null==f?void 0:f.diagram)?e:f,h=null!=(o=null!=(n=null==f?void 0:f.renderOptions)?n:null==f?void 0:f.options)?o:{},g=null!=(r=t.themeId)?r:h.themeID,y=null!=(c=t.darkThemeId)?c:h.darkThemeID,w=u({},h);if(w.themeID=t.isDark&&null!=y?y:g,w.darkThemeID=null,w.darkThemeOverrides=null,t.isDark){const e=h.themeOverrides&&"object"==typeof h.themeOverrides?h.themeOverrides:null;w.themeOverrides=u(u({},S),e||{})}const x=yield s.render(v,w);if(p!==m.value)return;const k=R(x);if(!k)throw new Error("D2 render returned empty output.");z(k),t.loading&&(l.value=!1),a.value=null}catch(f){if(p!==m.value)return;const e=(null==f?void 0:f.message)?String(f.message):"D2 render failed.";t.loading||(a.value=e),e.includes("@terrastruct/d2")&&(i.value=!1,l.value=!0)}finally{p===m.value&&(s.value=!1,_&&(_=!1,U()))}})}function U(e=!1){if(b)return;if(!k)return;if(C)return;if(s.value)return void(_=!0);const n=Math.max(120,Number(t.progressiveIntervalMs)||0),o=Date.now()-T;if(!e&&o<n)return _=!0,void(null==N&&(N=window.setTimeout(()=>{N=null,_&&(_=!1,U(!0))},Math.max(0,n-o))));b=!0;const r=()=>{b=!1,T=Date.now(),$()};"undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(r):setTimeout(r,0)}function F(){const e=f.value;if(!e)return;const t=e.getBoundingClientRect().height;t>0&&(v.value=t)}return p.watch(()=>[t.node.code,t.loading,t.isDark],()=>{U()},{immediate:!0}),p.watch(()=>t.loading,(e,t)=>{t&&!e&&U(!0)}),p.watch(()=>[g.value,c.value,h.value],()=>{p.nextTick(()=>{F()})}),p.onMounted(()=>{U(),p.nextTick(()=>{F()}),"undefined"!=typeof ResizeObserver&&(D=new ResizeObserver(()=>{F()}),f.value&&D.observe(f.value))}),p.onBeforeUnmount(()=>{C=!0,null!=N&&(clearTimeout(N),N=null),null==D||D.disconnect(),D=null}),{__sfc:!0,props:t,t:n,copyText:o,isCollapsed:r,showSource:l,d2Available:i,renderError:a,isRendering:s,svgMarkup:c,renderToken:m,bodyRef:f,bodyMinHeight:v,baseCode:h,showSourceFallback:g,hasPreview:y,bodyStyle:w,renderStyle:x,isClient:k,d2Instance:M,scheduled:b,unmounted:C,lastRenderAt:T,throttleTimer:N,pendingRender:_,bodyObserver:D,DARK_THEME_OVERRIDES:S,shouldSkipEventTarget:I,onBtnHover:function(e,n,o="top"){if(I(e.currentTarget))return;const r=e,l=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0;le(e.currentTarget,n,o,!1,l,t.isDark)},onBtnLeave:function(){ie()},onCopyHover:function(e){if(I(e.currentTarget))return;const r=o.value?n("common.copied")||"Copied":n("common.copy")||"Copy",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;le(e.currentTarget,r,"top",!1,i,t.isDark)},copy:function(){return d(this,null,function*(){try{const e=h.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),o.value=!0,setTimeout(()=>{o.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})},toggleCollapse:function(){r.value=!r.value},handleSwitchMode:function(e){l.value="source"===e},DISALLOWED_STYLE_PATTERNS:j,SAFE_URL_PROTOCOLS:E,neutralizeScriptProtocols:L,sanitizeUrl:B,scrubSvgElement:A,toSafeSvgMarkup:O,setSvg:z,clearSvg:P,extractSvg:R,ensureD2Instance:H,renderDiagram:$,scheduleRender:U,exportSvg:function(){if(c.value)try{const e=new Blob([c.value],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e);if("undefined"!=typeof document){const e=document.createElement("a");e.href=t,e.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(e),e.click(),document.body.removeChild(e)}URL.revokeObjectURL(t)}catch(e){console.error("Failed to export SVG:",e)}},updateBodyMinHeight:F}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"d2-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:n.props.isDark?"border-gray-700/30 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900"},[n.props.showHeader?t("div",{staticClass:"d2-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._m(0),t("div",{staticClass:"flex items-center gap-x-2"},[n.props.showModeToggle?t("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"":"is-active",attrs:{type:"button"},on:{click:function(e){return 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}},[e._v(" "+e._s(n.t("common.preview")||"Preview")+" ")]),t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"is-active":"",attrs:{type:"button"},on:{click:function(e){return 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}},[e._v(" "+e._s(n.t("common.source")||"Source")+" ")])]):e._e(),n.props.showCopyButton?t("button",{staticClass:"d2-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","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","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.svgMarkup?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.export")||"Export"},on:{click:n.exportSvg,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","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:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"}})])]):e._e(),n.props.showCollapseButton?t("button",{staticClass:"d2-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.toggleCollapse,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","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()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}],ref:"bodyRef",staticClass:"d2-block-body",style:n.bodyStyle},[n.props.loading&&!n.hasPreview?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",[n.showSourceFallback?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",{staticClass:"d2-render",style:n.renderStyle},[t("div",{staticClass:"d2-svg",domProps:{innerHTML:e._s(n.svgMarkup)}}),n.renderError?t("p",{staticClass:"d2-error px-4 pb-3 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()])])])])},[function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"flex items-center gap-x-2"},[t("span",{staticClass:"text-sm font-medium font-mono"},[e._v("D2")])])}],!1,null,"fdf24c90",null,null).exports;mn.install=e=>{e.component(mn.__name,mn)};const pn=Object.freeze(Object.defineProperty({__proto__:null,default:mn},Symbol.toStringTag,{value:"Module"}));let fn=null,vn=null;const hn=b(p.defineComponent({__name:"InfographicBlockNode",props:{node:null,maxHeight:{default:"500px"},estimatedPreviewHeightPx:null,loading:{type:Boolean,default:!0},isDark:{type:Boolean},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}},emits:["copy","export","openModal"],setup(e,{emit:t}){const n=e,{t:o}=ue(),r=p.ref(!1),l=p.ref(!1),i=p.ref(),a=p.ref(!1),s=p.ref(!1),u=p.ref(),c=p.ref(null),m=p.computed(()=>n.node.code),f=p.computed(()=>n.maxHeight&&"none"!==n.maxHeight?Ut(n.maxHeight):null),v=p.computed(()=>{var e;return Vt(null!=(e=Ut(n.estimatedPreviewHeightPx))?e:Yt(m.value),void 0,f.value)}),h=p.ref(`${v.value}px`);function g(e){if(!n.maxHeight||"none"===n.maxHeight)return`${Math.max(e,v.value)}px`;const t=f.value;return null==t?`${Math.max(e,v.value)}px`:`${Math.max(Math.min(e,t),v.value)}px`}function y(){if(!i.value)return;const e=i.value.scrollHeight;e>0&&(h.value=g(e))}const w=p.ref(1),x=p.ref(0),k=p.ref(0),M=p.ref(!1),b=p.ref({x:0,y:0});function C(e){return!e||e.disabled}function T(e){return d(this,null,function*(){try{const n=(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`infographic-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(t){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function N(e){"Escape"===e.key&&s.value&&D()}function _(){if(s.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",N)}catch(e){}p.nextTick(()=>{if(i.value&&u.value){u.value.innerHTML="";const e=document.createElement("div");e.style.transition="transform 0.1s ease",e.style.transformOrigin="center center",e.style.width="100%",e.style.height="100%",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center";const t=i.value.cloneNode(!0);t.classList.add("fullscreen"),t.style.height="auto",e.appendChild(t),u.value.appendChild(e),c.value=e,e.style.transform=`translate(${x.value}px, ${k.value}px) scale(${w.value})`}})}function D(){if(s.value=!1,u.value&&(u.value.innerHTML=""),c.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",N)}catch(e){}}p.watch(v,e=>{if(a.value||l.value)return;const t=Ut(h.value);(null==t||t<e)&&(h.value=`${e}px`)});let S=null;function I(){return d(this,null,function*(){var e;if(i.value)try{const t=yield function(){return d(this,null,function*(){return vn||fn||(fn=import("@antv/infographic").then(e=>{const t=e&&e.default?e.default:e;let n=t;return"function"==typeof t&&t.prototype&&t.prototype.render?n=t:e.Infographic?n=e.Infographic:t&&t.Infographic&&(n=t.Infographic),vn=n,n}).catch(e=>(console.warn("Failed to load @antv/infographic",e),null)),fn)})}();if(!t)return void console.warn("Infographic library failed to load.");S&&(null==(e=S.destroy)||e.call(S),S=null),i.value.innerHTML="",S=new t({container:i.value,width:"100%",height:"100%"}),S.render(m.value),p.nextTick(()=>{y()})}catch(t){console.error("Failed to render infographic:",t),i.value&&(i.value.innerHTML=`<div class="text-red-500 p-4">Failed to render infographic: ${t instanceof Error?t.message:"Unknown error"}</div>`)}})}p.watch(()=>m.value,()=>{a.value||l.value||p.nextTick(()=>{I()})}),p.watch(()=>a.value,e=>{e||l.value||p.nextTick(()=>{I()})}),p.watch(()=>l.value,e=>{e||a.value||p.nextTick(()=>{I()})}),p.watch(()=>n.maxHeight,()=>{a.value||l.value||p.nextTick(()=>{I()})}),p.onMounted(()=>{a.value||l.value||p.nextTick(()=>{I()})}),p.onBeforeUnmount(()=>{var e;if(S&&(null==(e=S.destroy)||e.call(S),S=null),"undefined"!=typeof window)try{window.removeEventListener("keydown",N)}catch(t){}});const j=p.computed(()=>n.isDark?"infographic-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"infographic-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700"),E=p.computed(()=>a.value||l.value),L=p.computed(()=>({transform:`translate(${x.value}px, ${k.value}px) scale(${w.value})`}));return p.watch(L,e=>{s.value&&c.value&&(c.value.style.transform=e.transform)}),{__sfc:!0,props:n,_emits:t,t:o,copyText:r,isCollapsed:l,infographicContainer:i,showSource:a,isModalOpen:s,modalContent:u,modalCloneWrapper:c,baseCode:m,maxPreviewHeight:f,estimatedPreviewHeight:v,containerHeight:h,resolveContainerHeight:g,updateContainerHeight:y,zoom:w,translateX:x,translateY:k,isDragging:M,dragStart:b,shouldSkipEventTarget:C,onBtnHover:function(e,t,o="top"){if(C(e.currentTarget))return;const r=e,l=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0;le(e.currentTarget,t,o,!1,l,n.isDark)},onBtnLeave:function(){ie()},onCopyHover:function(e){if(C(e.currentTarget))return;const t=r.value?o("common.copied")||"Copied":o("common.copy")||"Copy",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;le(e.currentTarget,t,"top",!1,i,n.isDark)},copy:function(){return d(this,null,function*(){try{const e=m.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),r.value=!0,setTimeout(()=>{r.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},handleSwitchMode:function(e){a.value="source"===e},handleExportClick:function(){var e;const t=null==(e=i.value)?void 0:e.querySelector("svg");t?T(t):console.error("SVG element not found")},exportSvg:T,handleKeydown:N,openModal:_,closeModal:D,handleOpenModalClick:function(){_()},zoomIn:function(){w.value<3&&(w.value+=.1)},zoomOut:function(){w.value>.5&&(w.value-=.1)},resetZoom:function(){w.value=1,x.value=0,k.value=0},startDrag:function(e){M.value=!0,e instanceof MouseEvent?b.value={x:e.clientX-x.value,y:e.clientY-k.value}:b.value={x:e.touches[0].clientX-x.value,y:e.touches[0].clientY-k.value}},onDrag:function(e){if(!M.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),x.value=t-b.value.x,k.value=n-b.value.y},stopDrag:function(){M.value=!1},infographicInstance:S,renderInfographic:I,computedButtonStyle:j,isFullscreenDisabled:E,transformStyle:L,infographicIconUrl:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUuNTIiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyOTEgMzAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnPjxwYXRoIGQ9Ik0xNDAuOTA0IDIzOS4zNzZDMTI4LjgzIDIzOS42ODMgMTE5LjY3NSAyMzkuMjk5IDExNS40NDggMjQzLjg0M0MxMTAuOTAyIDI0OC4wNyAxMTEuMjg4IDI1Ny4yMjcgMTEwLjk3OSAyNjkuMzAyQzExMS4xMTggMjc0LjY3NSAxMTEuMTE4IDI3OS40NzggMTExLjQ3MiAyODMuNTJDMTExLjY2MiAyODUuNjM4IDExMS45NSAyODcuNTQ3IDExMi40MDYgMjg5LjIyNEMxMTIuNDExIDI4OS4yNDMgMTEyLjQxNiAyODkuMjU5IDExMi40MjIgMjg5LjI4QzExMi40NjIgMjg5LjQxOSAxMTIuNDk2IDI4OS41NTggMTEyLjUzOSAyODkuNjkxQzExMy4xNjggMjkxLjc4NyAxMTQuMDg4IDI5My40OTEgMTE1LjQ0NiAyOTQuNzU4QzExNi42NjIgMjk2LjA2NCAxMTguMjgzIDI5Ni45NjMgMTIwLjI2NCAyOTcuNjlDMTIwLjM2IDI5Ny42MTQgMTIwLjQ2NCAyOTcuNjQ2IDEyMC41NTUgMjk3LjY3NUMxMjAuNTYgMjk3LjY4IDEyMC41NiAyOTcuNjggMTIwLjU2NiAyOTcuNjhDMTIwLjg0OCAyOTcuNzY4IDEyMS4xNDIgMjk3Ljg0NiAxMjEuNDQzIDI5Ny45MjNDMTIxLjQ1NCAyOTcuOTIzIDEyMS40NjQgMjk3LjkyOCAxMjEuNDc4IDI5Ny45MzRDMTIyLjg3NSAyOTguMjcyIDEyNC40MjQgMjk4LjUwNyAxMjYuMTEgMjk4LjY3OEMxMjYuMzI2IDI5OC42OTYgMTI2LjU0MiAyOTguNzE4IDEyNi43NjMgMjk4LjczOUMxMzAuNzkgMjk5LjA4NiAxMzUuNTU4IDI5OS4wODggMTQwLjkwNCAyOTkuMjIyQzE1Mi45NzQgMjk4LjkxMiAxNjIuMTI4IDI5OS4zMDIgMTY2LjM2IDI5NC43NThDMTcwLjkwNCAyOTAuNTI2IDE3MC41MTUgMjgxLjM3MSAxNzAuODI0IDI2OS4zMDJDMTcwLjUxNSAyNTcuMjI3IDE3MC45MDcgMjQ4LjA3IDE2Ni4zNiAyNDMuODQzQzE2Mi4xMzEgMjM5LjI5OSAxNTIuOTc0IDIzOS42ODMgMTQwLjkwNCAyMzkuMzc2WiIgZmlsbD0iI0ZGNjM3NiI+PC9wYXRoPjxwYXRoIGQ9Ik0yMS4yMTU1IDEyOC4zOThDMTIuNjU1NSAxMjguNjE2IDYuMTY0ODQgMTI4LjMzOSAzLjE2NzUxIDEzMS41NkMtMC4wNTM4MjIyIDEzNC41NiAwLjIxODE3OCAxNDEuMDU0IC0wLjAwMDQ4ODI4MSAxNDkuNjA4QzAuMjE4MTc4IDE1OC4xNjggLTAuMDUzODIyMiAxNjQuNjU5IDMuMTY3NTEgMTY3LjY1NkM2LjE2NDg0IDE3MC44NzggMTIuNjU1NSAxNzAuNjA2IDIxLjIxNTUgMTcwLjgyNEMyNS4wMjYyIDE3MC43MjYgMjguNDI4OCAxNzAuNzI2IDMxLjI5NTUgMTcwLjQ3NUMzMi43OTY4IDE3MC4zNDIgMzQuMTQ4OCAxNzAuMTM2IDM1LjMzODIgMTY5LjgxNEMzNS4zNTQyIDE2OS44MTEgMzUuMzY0OCAxNjkuODA2IDM1LjM3ODIgMTY5LjgwM0MzNS40NzY4IDE2OS43NzQgMzUuNTc1NSAxNjkuNzQ3IDM1LjY2ODggMTY5LjcxOEMzNy4xNTY4IDE2OS4yNzIgMzguMzY0OCAxNjguNjIyIDM5LjI2MzUgMTY3LjY1NkM0MC4xOTE1IDE2Ni43OTUgNDAuODI2MiAxNjUuNjQ2IDQxLjI3MTUgMTY0LjI0M0M0MS4yODc1IDE2NC4xNzQgNDEuMzExNSAxNjQuMTAyIDQxLjMzMjggMTY0LjAzNUM0MS4zMzI4IDE2NC4wMzUgNDEuMzM1NSAxNjQuMDMyIDQxLjMzNTUgMTY0LjAyN0M0MS4zOTY4IDE2My44MjcgNDEuNDUyOSAxNjMuNjIyIDQxLjUwNjIgMTYzLjQwNkM0MS41MDYyIDE2My4zOTggNDEuNTExNSAxNjMuMzkyIDQxLjUxNDIgMTYzLjM4MkM0MS43NTQyIDE2Mi4zOTIgNDEuOTIyMiAxNjEuMjk0IDQyLjA0MjIgMTYwLjA5NkM0Mi4wNTU1IDE1OS45NDQgNDIuMDcxNSAxNTkuNzkyIDQyLjA4NDggMTU5LjYzNUM0Mi4zMzI4IDE1Ni43NzkgNDIuMzMyOCAxNTMuMzk4IDQyLjQyNjIgMTQ5LjYwOEM0Mi4yMDc1IDE0MS4wNTQgNDIuNDg0OCAxMzQuNTYgMzkuMjYzNSAxMzEuNTZDMzYuMjYzNSAxMjguMzM5IDI5Ljc3MjggMTI4LjYxNiAyMS4yMTU1IDEyOC4zOThaIiBmaWxsPSIjRkZDQ0NDIj48L3BhdGg+PHBhdGggZD0iTTgxLjA1OTUgMTg0LjE3MUM3MC44NTY4IDE4NC40MzMgNjMuMTIwOCAxODQuMTAyIDU5LjU0NzUgMTg3Ljk0MkM1NS43MDc1IDE5MS41MTggNTYuMDMyOCAxOTkuMjU0IDU1Ljc3NDIgMjA5LjQ1NEM1Ni4wMzI4IDIxOS42NTcgNTUuNzA3NSAyMjcuMzkzIDU5LjU0NzUgMjMwLjk2M0M2My4xMjA4IDIzNC44MDMgNzAuODU2OCAyMzQuNDc4IDgxLjA1OTUgMjM0LjczOUM4NS42MDA4IDIzNC42MjIgODkuNjU5NSAyMzQuNjIyIDkzLjA3MjggMjM0LjMyM0M5NC44NjQ4IDIzNC4xNjMgOTYuNDc1NSAyMzMuOTIxIDk3Ljg5NDIgMjMzLjUzNEM5Ny45MTAyIDIzMy41MjkgOTcuOTIzNSAyMzMuNTI2IDk3Ljk0MjIgMjMzLjUyMUM5OC4wNTY4IDIzMy40ODYgOTguMTc0MiAyMzMuNDU3IDk4LjI4ODggMjMzLjQyMkMxMDAuMDYgMjMyLjg4OSAxMDEuNSAyMzIuMTEzIDEwMi41NjkgMjMwLjk2M0MxMDMuNjc2IDIyOS45MzcgMTA0LjQzMyAyMjguNTY2IDEwNC45NjQgMjI2Ljg5NEMxMDQuOTg1IDIyNi44MTEgMTA1LjAxMiAyMjYuNzI2IDEwNS4wMzYgMjI2LjY0NkMxMDUuMDQxIDIyNi42NDMgMTA1LjA0MSAyMjYuNjQzIDEwNS4wNDEgMjI2LjYzOEMxMDUuMTE2IDIyNi40MDEgMTA1LjE4IDIyNi4xNTMgMTA1LjI0NCAyMjUuODk3QzEwNS4yNDQgMjI1Ljg4OSAxMDUuMjQ5IDIyNS44ODEgMTA1LjI1NCAyMjUuODY3QzEwNS41NCAyMjQuNjg5IDEwNS43NCAyMjMuMzc5IDEwNS44ODEgMjIxLjk1M0MxMDUuOSAyMjEuNzcxIDEwNS45MTYgMjIxLjU5IDEwNS45MzQgMjIxLjQwM0MxMDYuMjI4IDIxOC4wMDEgMTA2LjIyOCAyMTMuOTY5IDEwNi4zNDIgMjA5LjQ1NEMxMDYuMDgxIDE5OS4yNTQgMTA2LjQxMiAxOTEuNTE4IDEwMi41NzIgMTg3Ljk0MkM5OC45OTU1IDE4NC4xMDIgOTEuMjU2OCAxODQuNDMzIDgxLjA1OTUgMTg0LjE3MVoiIGZpbGw9IiNGRjkzOUYiPjwvcGF0aD48cGF0aCBkPSJNMjYwLjU5MSAxNTEuODdDMjE1LjY1MiAxNTEuODcgMjAzLjAyIDE2NC41MjMgMjAzLjAyIDIwOS40NjJIMTk4LjQ3NkMxOTguNDc2IDE2NC41MjMgMTg1LjgzNiAxNTEuODgxIDE0MC44OTUgMTUxLjg4MVYxNDcuMzM3QzE4NS44MzYgMTQ3LjMzNyAxOTguNDg3IDEzNC43MDUgMTk4LjQ4NyA4OS43NjU5SDIwMy4wMkMyMDMuMDIgMTM0LjcwNSAyMTUuNjUyIDE0Ny4zMzcgMjYwLjU5MSAxNDcuMzM3VjE1MS44N1pNMjg2LjA1MiAxMjQuMTU4QzI4MS44MiAxMTkuNjE0IDI3Mi42NiAxMjAuMDAxIDI2MC41OTEgMTE5LjY4OUMyNDguNTIxIDExOS4zODUgMjM5LjM2MSAxMTkuNzcxIDIzNS4xMjkgMTE1LjIyN0MyMzAuNTg1IDExMC45OTUgMjMwLjk4MyAxMDEuODQ2IDIzMC42NzEgODkuNzY1OUMyMzAuNTEzIDgzLjczMTIgMjMwLjUzNSA3OC40MjcyIDIzMC4wMjMgNzQuMTAxOUMyMjkuNTEzIDY5Ljc2NTkgMjI4LjQ4MSA2Ni40MjE5IDIyNi4yMDkgNjQuMzA0NkMyMjEuOTY3IDU5Ljc2MDYgMjEyLjgxNyA2MC4xNDcyIDIwMC43NDggNTkuODQ1OUMxODguNjgxIDYwLjE0NzIgMTc5LjUxOSA1OS43NjA2IDE3NS4yODcgNjQuMzA0NkMxNzAuNzUzIDY4LjUzNjYgMTcxLjEyOSA3Ny42OTY2IDE3MC44MjggODkuNzY1OUMxNzAuNTE2IDEwMS44MzUgMTcwLjkgMTEwLjk5NSAxNjYuMzU2IDExNS4yMjdDMTYyLjEyNCAxMTkuNzcxIDE1Mi45ODUgMTE5LjM3NCAxNDAuOTA1IDExOS42ODlDMTM4Ljg3MyAxMTkuNzM5IDEzNi45MjQgMTE5Ljc3MSAxMzUuMDcxIDExOS44MTFDMTE5LjMxMyAxMTguNjk3IDEwNi4zMzcgMTEyLjMxOCAxMDYuMzM3IDg5Ljc2NTlDMTA2LjIxMiA4NC42Njk5IDEwNi4yMzMgODAuMTc5MiAxMDUuODA3IDc2LjUyMDZDMTA1LjM2NyA3Mi44NzI2IDEwNC40OTIgNzAuMDM3OSAxMDIuNTc1IDY4LjI1NjZDOTkuMDAxMyA2NC40MTEyIDkxLjI1NzMgNjQuNzQ0NiA4MS4wNjUzIDY0LjQ4MzJDNzAuODYgNjQuNzQ0NiA2My4xMTg2IDY0LjQxMTIgNTkuNTUzMyA2OC4yNTY2QzU1LjcwOCA3MS44Mjk5IDU2LjAzMDYgNzkuNTYzMiA1NS43NjkzIDg5Ljc2NTlDNTYuMDMwNiA5OS45Njg2IDU1LjcwOCAxMDcuNzAyIDU5LjU1MzMgMTExLjI3OEM2My4xMTg2IDExNS4xMTMgNzAuODYgMTE0Ljc5IDgxLjA2NTMgMTE1LjA0OUMxMDMuNjE3IDExNS4wNDkgMTA5Ljk5NiAxMjguMDM1IDExMS4xIDE0My44MDNDMTExLjA2OCAxNDUuNjU5IDExMS4wMjggMTQ3LjU4NyAxMTAuOTc1IDE0OS42MTlDMTExLjEyMSAxNTQuOTg3IDExMS4xMjEgMTU5Ljc5IDExMS40NzYgMTYzLjgzNUMxMTEuNjYzIDE2NS45NSAxMTEuOTQ1IDE2Ny44NTcgMTEyLjQwNCAxNjkuNTM0QzExMi40MTIgMTY5LjU1NSAxMTIuNDEyIDE2OS41NjYgMTEyLjQyMyAxNjkuNTk4QzExMi40NjUgMTY5LjczNCAxMTIuNDk3IDE2OS44NjcgMTEyLjUzNyAxNzAuMDAzQzExMy4xNjQgMTcyLjA5OSAxMTQuMDkyIDE3My44MDkgMTE1LjQ0NyAxNzUuMDdDMTE2LjY2NSAxNzYuMzcxIDExOC4yODEgMTc3LjI3OCAxMjAuMjcxIDE3Ny45MDVDMTIwLjM2NCAxNzcuOTM0IDEyMC40NiAxNzcuOTU1IDEyMC41NjQgMTc3Ljk4N0MxMjAuODU1IDE3OC4wODEgMTIxLjE0NSAxNzguMTUzIDEyMS40MzkgMTc4LjIzOEMxMjEuNDYgMTc4LjIzOCAxMjEuNDcxIDE3OC4yMzggMTIxLjQ3OSAxNzguMjQ5QzEyMi44NzYgMTc4LjU4MiAxMjQuNDIgMTc4LjgyMiAxMjYuMTA4IDE3OC45ODdDMTI2LjMyNyAxNzkuMDA5IDEyNi41NDUgMTc5LjAzIDEyNi43NjQgMTc5LjA1MUMxMzAuNzg4IDE3OS4zOTUgMTM1LjU1OSAxNzkuMzk1IDE0MC45MDUgMTc5LjUyOUMxNTIuOTc1IDE3OS44NDMgMTYyLjEyNCAxNzkuNDU3IDE2Ni4zNTYgMTg0LjAwMUMxNzAuOSAxODguMjMzIDE3MC41MTYgMTk3LjM3MSAxNzAuODI4IDIwOS40NTFDMTcxLjEyOSAyMjEuNTI5IDE3MC43NDMgMjMwLjY4MSAxNzUuMjg3IDIzNC45MUMxNzkuNTE5IDIzOS40NTQgMTg4LjY4MSAyMzkuMDcgMjAwLjc0OCAyMzkuMzcxQzIwNi4xMjcgMjM5LjIzNSAyMTAuOTIxIDIzOS4yMzUgMjE0Ljk3NSAyMzguODgxQzIxNy4wNzkgMjM4LjY5NCAyMTguOTg1IDIzOC40MDMgMjIwLjY3NiAyMzcuOTU1QzIyMC42OTUgMjM3Ljk0NSAyMjAuNzA1IDIzNy45MzQgMjIwLjcyNyAyMzcuOTM0QzIyMC44NzMgMjM3Ljg5MSAyMjAuOTk5IDIzNy44NTkgMjIxLjEzNSAyMzcuODE5QzIyMy4yMjggMjM3LjE5MyAyMjQuOTM3IDIzNi4yNjUgMjI2LjIwOSAyMzQuOTFDMjI3LjUxMSAyMzMuNjkxIDIyOC40MDkgMjMyLjA2NSAyMjkuMDQ0IDIzMC4wOTdDMjI5LjA2NSAyMzAuMDAzIDIyOS4wOTUgMjI5Ljg5OSAyMjkuMTI3IDIyOS44MDNWMjI5Ljc5M0MyMjkuMjIgMjI5LjUxMyAyMjkuMjk1IDIyOS4yMjIgMjI5LjM2NyAyMjguOTE4QzIyOS4zNjcgMjI4Ljg5NyAyMjkuMzc3IDIyOC44OTcgMjI5LjM3NyAyMjguODc4QzIyOS43MjEgMjI3LjQ4MSAyMjkuOTUxIDIyNS45MzcgMjMwLjEyNyAyMjQuMjQ5QzIzMC4xMzcgMjI0LjAzIDIzMC4xNjkgMjIzLjgxMSAyMzAuMTkxIDIyMy41OTNDMjMwLjUzNSAyMTkuNTcxIDIzMC41MzUgMjE0Ljc5OCAyMzAuNjcxIDIwOS40NTFDMjMwLjk3MiAxOTcuMzcxIDIzMC41ODUgMTg4LjIzMyAyMzUuMTI5IDE4NC4wMDFDMjM5LjM2MSAxNzkuNDU3IDI0OC41MTEgMTc5Ljg0MyAyNjAuNTkxIDE3OS41MjlDMjcyLjY2IDE3OS4yMjcgMjgxLjgyIDE3OS42MTQgMjg2LjA1MiAxNzUuMDdDMjkwLjU5NiAxNzAuODM4IDI5MC4yMDkgMTYxLjY4OSAyOTAuNTExIDE0OS42MTlDMjkwLjIwOSAxMzcuNTM5IDI5MC41OTYgMTI4LjM3OSAyODYuMDUyIDEyNC4xNThaIiBmaWxsPSIjRkYzNTZBIj48L3BhdGg+PHBhdGggZD0iTTExMi40MDUgNDkuODQ4QzExMi40MTEgNDkuODY5NCAxMTIuNDE2IDQ5Ljg4MjcgMTEyLjQyMSA0OS45MDRDMTEyLjQ2MSA1MC4wNDI3IDExMi40OTkgNTAuMTgxNCAxMTIuNTM5IDUwLjMxNDdDMTEzLjE3MSA1Mi40MTM0IDExNC4wODggNTQuMTE0NyAxMTUuNDQ4IDU1LjM4NEMxMTYuNjYxIDU2LjY5MDcgMTE4LjI4MyA1Ny41ODk0IDEyMC4yNjQgNTguMjEzNEMxMjAuMzYgNTguMjQgMTIwLjQ2NCA1OC4yNjk0IDEyMC41NTUgNTguMzAxNEMxMjAuNTYgNTguMzA2NyAxMjAuNTYgNTguMzA2NyAxMjAuNTY1IDU4LjMwNjdDMTIwLjg0OCA1OC4zOTQ3IDEyMS4xNDEgNTguNDY5NCAxMjEuNDQzIDU4LjU0NjdDMTIxLjQ1MyA1OC41NDY3IDEyMS40NjQgNTguNTUyIDEyMS40OCA1OC41NTc0QzEyMi44NzUgNTguODk2IDEyNC40MjQgNTkuMTMzNCAxMjYuMTEyIDU5LjMwMTRDMTI2LjMyNSA1OS4zMjI3IDEyNi41NDEgNTkuMzQxNCAxMjYuNzYzIDU5LjM2MjdDMTMwLjc4OSA1OS43MTIgMTM1LjU2IDU5LjcxMiAxNDAuOTA0IDU5Ljg0NTRDMTUyLjk3MyA1OS41Mzg3IDE2Mi4xMjggNTkuOTI4IDE2Ni4zNiA1NS4zODRDMTcwLjkwNyA1MS4xNTIgMTcwLjUxNSA0MS45OTQ3IDE3MC44MjQgMjkuOTI1NEMxNzAuNTE3IDE3Ljg1MDcgMTcwLjkwNyA4LjY5NjAyIDE2Ni4zNjMgNC40NjkzNUMxNjIuMTMxIC0wLjA3NDY1MTEgMTUyLjk3MyAwLjMwOTM0OSAxNDAuOTA0IDEuNTI1ODhlLTA1QzEyOC44MjkgMC4zMDkzNDkgMTE5LjY3NSAtMC4wNzQ2NTExIDExNS40NDggNC40NjkzNUMxMTAuOTA0IDguNjk2MDIgMTExLjI4OCAxNy44NTA3IDExMC45NzkgMjkuOTI1NEMxMTEuMTE3IDM1LjMwMTQgMTExLjExNyA0MC4xMDE0IDExMS40NzIgNDQuMTQ0QzExMS42NjEgNDYuMjYxNCAxMTEuOTQ5IDQ4LjE3MDcgMTEyLjQwNSA0OS44NDhaIiBmaWxsPSIjRkY2Mzc2Ij48L3BhdGg+PC9nPjwvc3ZnPgo=",Portal:Zt}}}),function(){var e,t=this,n=t._self._c,o=t._self._setupProxy;return n("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[o.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":o.props.loading}],attrs:{"data-markstream-infographic":"1","data-markstream-mode":o.showSource?"source":o.infographicInstance?"preview":"pending"}},[o.props.showHeader?n("div",{staticClass:"infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",class:o.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[t.$slots["header-left"]?n("div",[t._t("header-left")],2):n("div",{staticClass:"flex items-center gap-x-2 overflow-hidden"},[n("img",{staticClass:"w-4 h-4 my-0",attrs:{src:o.infographicIconUrl,alt:"Infographic"}}),n("span",{staticClass:"text-sm font-medium font-mono truncate",class:o.props.isDark?"text-gray-400":"text-gray-600"},[t._v("Infographic")])]),t.$slots["header-center"]?n("div",[t._t("header-center")],2):o.props.showModeToggle?n("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:o.props.isDark?"bg-gray-700":"bg-gray-100"},[n("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[o.showSource?o.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":o.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>o.handleSwitchMode("preview"),mouseenter:function(e){o.onBtnHover(e,o.t("common.preview")||"Preview")},focus:function(e){o.onBtnHover(e,o.t("common.preview")||"Preview")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("div",{staticClass:"flex items-center gap-x-1"},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("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"}}),n("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),n("span",[t._v(t._s(o.t("common.preview")||"Preview"))])])]),n("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[o.showSource?o.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":o.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>o.handleSwitchMode("source"),mouseenter:function(e){o.onBtnHover(e,o.t("common.source")||"Source")},focus:function(e){o.onBtnHover(e,o.t("common.source")||"Source")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("div",{staticClass:"flex items-center gap-x-1"},[n("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"}},[n("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"}})]),n("span",[t._v(t._s(o.t("common.source")||"Source"))])])])]):t._e(),t.$slots["header-right"]?n("div",[t._t("header-right")],2):n("div",{staticClass:"flex items-center gap-x-1"},[o.props.showCollapseButton?n("button",{class:o.computedButtonStyle,attrs:{"aria-pressed":o.isCollapsed},on:{click:function(e){o.isCollapsed=!o.isCollapsed},mouseenter:function(e){o.onBtnHover(e,o.isCollapsed?o.t("common.expand")||"Expand":o.t("common.collapse")||"Collapse")},focus:function(e){o.onBtnHover(e,o.isCollapsed?o.t("common.expand")||"Expand":o.t("common.collapse")||"Collapse")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("svg",{staticClass:"w-3 h-3",style:{rotate:o.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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):t._e(),o.props.showCopyButton?n("button",{class:o.computedButtonStyle,on:{click:o.copy,mouseenter:function(e){return o.onCopyHover(e)},focus:function(e){return o.onCopyHover(e)},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[o.copyText?n("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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),n("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):t._e(),o.props.showExportButton?n("button",{class:`${o.computedButtonStyle} ${o.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:o.isFullscreenDisabled},on:{click:o.handleExportClick,mouseenter:function(e){o.onBtnHover(e,o.t("common.export")||"Export")},focus:function(e){o.onBtnHover(e,o.t("common.export")||"Export")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),n("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):t._e(),o.props.showFullscreenButton?n("button",{class:`${o.computedButtonStyle} ${o.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:o.isFullscreenDisabled},on:{click:o.handleOpenModalClick,mouseenter:function(e){o.onBtnHover(e,o.isModalOpen?o.t("common.minimize")||"Minimize":o.t("common.open")||"Open")},focus:function(e){o.onBtnHover(e,o.isModalOpen?o.t("common.minimize")||"Minimize":o.t("common.open")||"Open")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[o.isModalOpen?n("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"}},[n("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"}})]):n("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"}},[n("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._e()])]):t._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:!o.isCollapsed,expression:"!isCollapsed"}]},[o.showSource?n("div",{staticClass:"p-4",class:o.props.isDark?"bg-gray-900":"bg-gray-50"},[n("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:o.props.isDark?"text-gray-300":"text-gray-700"},[t._v(t._s(o.baseCode))])]):n("div",{staticClass:"relative"},[o.props.showZoomControls?n("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[n("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomIn,mouseenter:function(e){o.onBtnHover(e,o.t("common.zoomIn")||"Zoom in")},focus:function(e){o.onBtnHover(e,o.t("common.zoomIn")||"Zoom in")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomOut,mouseenter:function(e){o.onBtnHover(e,o.t("common.zoomOut")||"Zoom out")},focus:function(e){o.onBtnHover(e,o.t("common.zoomOut")||"Zoom out")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.resetZoom,mouseenter:function(e){o.onBtnHover(e,o.t("common.resetZoom")||"Reset zoom")},focus:function(e){o.onBtnHover(e,o.t("common.resetZoom")||"Reset zoom")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[t._v(" "+t._s(Math.round(100*o.zoom))+"% ")])])]):t._e(),n("div",{staticClass:"infographic-preview min-h-[360px] relative transition-all duration-100 overflow-hidden block",class:o.props.isDark?"bg-gray-900":"bg-gray-50",style:{height:o.containerHeight,maxHeight:null!=(e=o.props.maxHeight)?e:void 0},on:{mousedown:o.startDrag,mousemove:o.onDrag,mouseup:o.stopDrag,mouseleave:o.stopDrag,"&touchstart":function(e){return o.startDrag.apply(null,arguments)},"&touchmove":function(e){return o.onDrag.apply(null,arguments)},"&touchend":function(e){return o.stopDrag.apply(null,arguments)}}},[n("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":o.isDragging},style:o.transformStyle},[n("div",{ref:"infographicContainer",staticClass:"w-full text-center flex items-center justify-center min-h-full"})])])])]),n(o.Portal,{attrs:{to:"body"}},[n("div",{staticClass:"markstream-vue"},[n("transition",{attrs:{name:"infographic-dialog",appear:""}},[o.isModalOpen?n("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:o.closeModal.apply(null,arguments)}}},[n("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:o.props.isDark?"bg-gray-900":"bg-white"},[n("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomIn}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomOut}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.resetZoom}},[t._v(" "+t._s(Math.round(100*o.zoom))+"% ")]),n("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.closeModal}},[n("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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),n("div",{ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",class:{"cursor-grab":!o.isDragging,"cursor-grabbing":o.isDragging},on:{mousedown:o.startDrag,mousemove:o.onDrag,mouseup:o.stopDrag,mouseleave:o.stopDrag,"&touchstart":function(e){return o.startDrag.apply(null,arguments)},"&touchmove":function(e){return o.onDrag.apply(null,arguments)},"&touchend":function(e){return o.stopDrag.apply(null,arguments)}}})])]):t._e()])],1)])],1)},[],!1,null,"4fbaa9a8",null,null).exports,gn=b(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},langs:{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},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:void 0}},emits:["previewCode","copy"],setup(e,{emit:t}){const n=e,{t:o}=ue(),r=p.ref(jt(n.node.language)),l=p.ref(!1),i=p.ref(!1),s=p.ref(!1),c=p.ref(null),m=p.ref(null),v=p.ref(null),h=p.ref(""),g=p.ref(!1),y=p.ref(!1);let w,x="",k=0,M=null;const b=p.ref(!0),C=p.ref(0),T=p.ref(14),N=p.ref(T.value),_=p.computed(()=>{const e=T.value,t=N.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0}),D=p.computed(()=>{const e=r.value.trim().toLowerCase();return e?Bt[e]||e.charAt(0).toUpperCase()+e.slice(1):Bt[""]||"Plain Text"}),S=p.computed(()=>(Nt.value,Lt(r.value.trim().toLowerCase().split(":")[0]))),I=p.computed(()=>{const e=r.value.trim().toLowerCase();return n.isShowPreview&&("html"===e||"svg"===e)}),j=p.computed(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},o=t(n.minWidth),r=t(n.maxWidth);return o&&(e.minWidth=o),r&&(e.maxWidth=r),e}),E=p.computed(()=>({fontSize:`${N.value}px`})),L=p.computed(()=>!1!==n.showTooltips);function B(){return n.isDark?n.darkTheme:n.lightTheme}function A(){return n.themes}function O(e){const t=e.match(/\d+(\.\d+)?/g);return!t||t.length<3?null:t.slice(0,3).map(Number)}function z(e){const t=O(e);if(!t)return null;const n=t.map(e=>{const t=e/255;return t<=.03928?t/12.92:a((t+.055)/1.055,2.4)});return.2126*n[0]+.7152*n[1]+.0722*n[2]}function P(e,t){const n=z(e),o=z(t);return null==n||null==o?null:(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function R(e){const t=O(e);if(!t)return n.isDark;const[o,r,l]=t;return.2126*o+.7152*r+.0722*l<140}function H(){var e;if("undefined"==typeof window||"function"!=typeof window.getComputedStyle)return;const t=c.value,o=v.value;if(!t||!o)return;const r=o.querySelector(".shiki")||o.querySelector("pre");if(!r)return;const l=window.getComputedStyle(r),i=r.querySelector("code")||r,a=window.getComputedStyle(i),s=String(l.backgroundColor||"").trim(),u=String(a.color||l.color||"").trim();s&&t.style.setProperty("--vscode-editor-background",s);const d=s?R(s):n.isDark,m=d?"rgb(229, 231, 235)":"rgb(17, 24, 39)",p=s&&u&&(null!=(e=P(u,s))?e:0)>=3?u:m;t.style.setProperty("--vscode-editor-foreground",p),t.style.setProperty("--markstream-code-fallback-selection-bg",d?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.06)"),t.style.setProperty("--vscode-editor-selectionBackground","var(--markstream-code-fallback-selection-bg)")}function $(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function U(e,t=!1){var n;M=null,X();const o=null==(n=m.value)?void 0:n.querySelector(".code-fallback-plain");return null==o||o.style.removeProperty("display"),e?!t&&y.value?(h.value="",void(g.value=!0)):(h.value=`<pre class="shiki shiki-fallback"><code>${$(e)}</code></pre>`,void(g.value=!1)):(W(),h.value="",g.value=!1,y.value=!1,void(x=""))}function F(){var e;h.value="",g.value=!0,y.value=!0;const t=null==(e=m.value)?void 0:e.querySelector(".code-fallback-plain");t&&(t.style.display="none"),p.nextTick().then(()=>d(this,null,function*(){yield p.nextTick(),!h.value&&g.value&&(g.value=!1,g.value=!0),H()}))}function Y(){M=null,X(),y.value&&(h.value="",g.value=!0)}function W(){v.value&&(v.value.innerHTML="")}function K(){var e;const t=v.value;return!!t&&(t.childNodes.length>0||Boolean(null==(e=t.textContent)?void 0:e.trim().length))}function V(e,t,n){return`${null!=e?e:""}\0${t}\0${n}`}function Q(e){x=e,F()}function X(e){null==e||e.disconnect(),e&&w!==e||(w=void 0)}function q(e,t){X();const n=v.value;if(!n||"undefined"==typeof MutationObserver)return;M=null;const o=new MutationObserver(()=>{k+=1;const n=M;if(n)return ke(e)?void(k!==t&&K()&&(M=null,X(o),Q(n))):(M=null,void X(o))});w=o,o.observe(n,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}function Z(e,t,n,o){return d(this,null,function*(){var r;if(M=n,yield p.nextTick(),!ke(e))return;const l=K(),i=k!==t,a=void 0!==o&&(null==(r=v.value)?void 0:r.innerHTML)!==o;l&&(!x||i||a||x===n)&&(M=null,X(),Q(n))})}let G,J,ee,te,ne,oe=null,re=!1,ae=null,se="",ce=0,de=0,me=!1;const pe=new Set,fe=new Set,ve=new Set,he=!1;let ge=null,ye=!1,we=!1;function xe(){return de+=1,de}function ke(e=de){return!me&&e===de}function Me(e={}){const t=G;G=void 0,oe=null,J=void 0,x="",M=null,fe.clear();try{null==t||t.dispose()}catch(n){}finally{W(),g.value=!1,e.resetStableRender&&(y.value=!1)}}function be(){return d(this,null,function*(){if(!G)return;const e=_e();J!==e&&(yield G.setTheme(e),J=e)})}function Ce(){const e=_e();G&&e!==J&&!re&&(re=!0,p.nextTick(()=>{re=!1,He()}))}function Te(){if(ee||"undefined"==typeof MutationObserver)return;const e=c.value;e&&(ee=new MutationObserver(()=>{Ce()}),ee.observe(e,{attributes:!0,attributeFilter:["data-markstream-code-theme"]}))}function Ne(){null==ee||ee.disconnect(),ee=void 0}function _e(){var e;return(null==(e=c.value)?void 0:e.getAttribute("data-markstream-code-theme"))||B()}const De=p.computed(()=>f.getHighlightRegistrationKey(A(),n.langs));function Se(){return{hasRegisterHighlight:Boolean(ne),hasCreateRenderer:Boolean(te)}}function Ie(e,t){var n;const o=Se(),r=f.getRuntimeShikiRegistrationConfig(e,t,o);return(null==(n=r.rendererOptions.langs)?void 0:n.length)&&ve.has(r.key)?f.getRuntimeShikiRegistrationConfig(e,void 0,o):r}function je(){const e=Ie(A(),n.langs);return Boolean(G&&oe!==e.key)}function Ee(e){return f.normalizeShikiLanguage(e)||"plaintext"}function Le(e,t){return d(this,arguments,function*(e,t,n=de){if(!G||!ke(n))return;const o=Ee(t),r=t=>d(this,null,function*(){if(G&&ke(n)){"plaintext"!==o&&t&&fe.add(o);try{return yield G.updateCode(e,"plaintext"),ke(n)?"plaintext":void 0}catch(r){return void ke(n)}}});if("plaintext"!==o&&fe.has(o))return r();try{return yield G.updateCode(e,o),ke(n)?o:void 0}catch(l){if(!ke(n))return;return"plaintext"!==o?r(l):void 0}})}function Be(e,t){return d(this,null,function*(){if(!ne)return"ready";if(se!==t)return"stale";if(ae===t)return"ready";const n=++ce;try{yield f.registerHighlightOnce(ne,e,t)}catch(o){return n!==ce||se!==t?"stale":"failed"}return n!==ce||se!==t?"stale":(ae=t,"ready")})}function Ae(e,t){return d(this,null,function*(){const n=yield Be(e,t);return"failed"!==n?n:se!==t?"stale":Be(e,t)})}function Oe(){return d(this,null,function*(){if(!te&&!ye)return ge||(ge=(()=>d(this,null,function*(){try{const e=yield import("stream-markdown"),t=e.createShikiStreamRenderer;if("function"!=typeof t)throw new TypeError("stream-markdown.createShikiStreamRenderer is not available");te=t;const n=e.registerHighlight;ne="function"==typeof n?n:void 0,ye=!1,we=!1}catch(e){ye=!0}finally{ge=null}}))(),ge)})}function ze(e){return d(this,null,function*(){var t,o;if(!ke(e))return;if(yield Oe(),!ke(e))return;if(!m.value||!v.value)return void U(n.node.code,!0);let r=Ie(A(),n.langs);r.ignoredLangs;let l=r.rendererOptions,i=r.key;se=i;let a=Boolean(G&&oe!==i);a&&U(n.node.code,!y.value);let s=yield Ae(r.registerOptions,i);if("failed"===s&&(null==(t=l.langs)?void 0:t.length)&&(ve.add(i),r=f.getRuntimeShikiRegistrationConfig(A(),void 0,Se()),l=r.rendererOptions,i=r.key,se=i,s=yield Ae(r.registerOptions,i)),!ke(e)||"stale"===s)return;if(a=Boolean(G&&oe!==i),"failed"===s)return void(a&&G&&K()?F():U(n.node.code,!0));if(a&&Me({resetStableRender:!0}),!G&&te){const e=_e();G=te(v.value,u({theme:e},l)),J=e,oe=i,g.value=!0}if(!G)return void U(n.node.code,!0);if(!1===n.stream&&n.loading)return void U(n.node.code,!y.value);U(n.node.code,!y.value);const c=k,d=null==(o=v.value)?void 0:o.innerHTML;q(e,c);const p=yield Le(n.node.code,n.node.language,e);return ke(e)?p?void(y.value?Y():yield Z(e,c,V(i,p,n.node.code),d)):(M=null,X(),void Y()):void 0})}function Pe(){return d(this,arguments,function*(e=xe()){try{yield ze(e)}catch(t){if(!ke(e))return;U(n.node.code,!y.value)}})}function Re(){me=!0,de+=1,null==w||w.disconnect(),w=void 0,Ne(),M=null,Me({resetStableRender:!0})}function He(){return d(this,null,function*(){m.value&&v.value&&(G||(yield Pe()),yield be(),H())})}function $e(e,t=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function Ue(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}return U(n.node.code,!0),p.getCurrentInstance()?(p.onMounted(()=>{Te(),Pe()}),p.onBeforeUnmount(Re)):p.nextTick(()=>d(this,null,function*(){yield p.nextTick(),Te(),yield Pe(),!x&&K()&&Q(V(null!=oe?oe:De.value,Ee(n.node.language),n.node.code))})),p.watch(De,()=>d(this,null,function*(){yield Pe()})),p.watch(()=>n.loading,e=>{e||Pe()}),p.watch(L,e=>{e||ie()}),p.watch(()=>[n.node.code,n.node.language],e=>d(this,[e],function*([e,t]){var o;const l=xe(),i=jt(t);if(i!==r.value&&(r.value=i),!m.value||!v.value)return void U(e,!0);if(!e)return void U("");if(!G||je())return U(e,!y.value),void(yield Pe(l));if(!ke(l))return;if(!G)return;if(!1===n.stream&&n.loading)return;U(e,!y.value);const a=k,s=null==(o=v.value)?void 0:o.innerHTML;q(l,a);const u=yield Le(e,t,l);return ke(l)?u?void(y.value?Y():yield Z(l,a,V(null!=oe?oe:De.value,u,e),s)):(M=null,X(),void Y()):void 0})),p.watch(()=>n.node.code,()=>d(this,null,function*(){if(i.value||!b.value)return;yield p.nextTick();const e=m.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),{__sfc:!0,props:n,emits:t,t:o,codeLanguage:r,copyText:l,isExpanded:i,isCollapsed:s,container:c,codeBlockContent:m,rendererTarget:v,fallbackHtml:h,rendererReady:g,hasStableRender:y,renderObserver:w,lastCommittedRenderSignature:x,rendererMutationVersion:k,pendingRenderSignature:M,autoScrollEnabled:b,lastScrollTop:C,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:T,codeFontSize:N,fontBaselineReady:_,displayLanguage:D,languageIcon:S,isPreviewable:I,containerStyle:j,contentStyle:E,tooltipsEnabled:L,getPreferredColorScheme:B,getResolvedThemes:A,getColorChannels:O,getRelativeLuminance:z,getContrastRatio:P,isDarkBackgroundColor:R,syncRenderedCssVars:H,escapeHtml:$,renderFallback:U,clearFallback:F,keepLastSuccessfulRender:Y,clearRendererTarget:W,hasRendererContent:K,getRenderSignature:V,markRendererCommitted:Q,disconnectReadyObserver:X,startRendererReadyObserver:q,clearFallbackWhenRendererReady:Z,renderer:G,rendererConfigKey:oe,rendererTheme:J,rendererThemeSyncQueued:re,rendererThemeObserver:ee,createShikiRenderer:te,registerHighlight:ne,registeredHighlightKey:ae,latestHighlightRegistrationKey:se,highlightRegistrationSeq:ce,renderEpoch:de,disposed:me,warnedRendererErrors:pe,failedRendererLanguages:fe,failedHighlightRegistrationKeys:ve,isDevEnv:he,warnedMissingRegisterHighlightForLangs:!1,streamMarkdownLoadPromise:ge,streamMarkdownLoadFailed:ye,warnedStreamMarkdownUnavailable:we,nextRenderEpoch:xe,isCurrentRenderEpoch:ke,disposeCurrentRenderer:Me,syncRendererTheme:be,queueRendererThemeChange:Ce,startRendererThemeObserver:Te,disconnectRendererThemeObserver:Ne,getRenderedColorScheme:_e,highlightRegistrationKey:De,getShikiRuntimeCapabilities:Se,getRuntimeConfigWithFailedLangsFallback:Ie,rendererNeedsReconfigure:je,normalizeRendererLanguage:Ee,updateRendererWithFallback:Le,ensureHighlightRegistered:Be,waitForCurrentHighlightRegistration:Ae,ensureStreamMarkdownLoaded:Oe,initRenderer:ze,safeInitRenderer:Pe,cleanupRenderer:Re,handleRendererThemeChange:He,isAtBottom:$e,handleScroll:function(){const e=m.value;if(!e||i.value)return;const t=e.scrollTop;t<C.value?b.value=!1:$e(e)&&(b.value=!0),C.value=t},copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(n.node.code)),l.value=!0,t("copy",n.node.code),setTimeout(()=>{l.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})},resolveTooltipTarget:Ue,onBtnHover:function(e,t,o="top"){if(!L.value)return;const r=Ue(e);if(!r)return;const l=e;le(r,t,o,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,n.isDark)},onBtnLeave:function(){L.value&&ie()},onCopyHover:function(e){if(!L.value)return;const t=Ue(e);if(!t)return;const r=e;le(t,l.value?o("common.copied")||"Copied":o("common.copy")||"Copy","top",!1,null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0,n.isDark)},toggleExpand:function(e){if(i.value=!i.value,e&&L.value){const t=Ue(e);t&&le(t,i.value?o("common.collapse")||"Collapse":o("common.expand")||"Expand","top",!1,void 0,n.isDark)}const t=m.value;t&&(i.value?(t.style.maxHeight="none",t.style["overflow-y"]="visible",t.style["overflow-x"]="auto"):(t.style.maxHeight="500px",t.style.overflow="auto",b.value=!0,p.nextTick(()=>{t.scrollHeight>t.clientHeight&&(t.scrollTop=t.scrollHeight)})))},toggleHeaderCollapse:function(){s.value=!s.value},increaseCodeFont:function(){const e=Math.min(36,N.value+1);N.value=e},decreaseCodeFont:function(){const e=Math.max(10,N.value-1);N.value=e},resetCodeFont:function(){N.value=T.value},previewCode:function(){if(!I.value)return;const e=jt(r.value||n.node.language).toLowerCase(),o="html"===e?"HTML Preview":"SVG Preview";t("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:n.node.code,title:o})}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return 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",n.props.isDark?"is-dark":""],style:c(u({},n.containerStyle),{backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg))",color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))"}),attrs:{"data-markstream-code-theme":n.props.isDark?n.props.darkTheme:n.props.lightTheme}},[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, var(--markstream-code-fallback-fg))","background-color":"var(--vscode-editor-background, var(--markstream-code-fallback-bg))"}},[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"},[n.props.showCollapseButton?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"}})])]):e._e(),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:function(e){return n.toggleExpand(e)},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:"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(),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&&n.fallbackHtml?t("div",{staticClass:"code-fallback-plain",domProps:{innerHTML:e._s(n.fallbackHtml)}}):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[e._m(0)]},{loading:e.loading,stream:e.stream})],2)])},[function(){var e=this._self._c;return this._self._setupProxy,e("div",{staticClass:"loading-skeleton"},[e("div",{staticClass:"skeleton-line"}),e("div",{staticClass:"skeleton-line"}),e("div",{staticClass:"skeleton-line short"})])}],!1,null,"fbed7233",null,null).exports,yn=b(p.defineComponent({name:"MarkdownRender",components:{LegacyNodesRenderer:Rt,NodeRenderer:Qt},props:{content:String,nodes:Array,final:Boolean,parseOptions:Object,customMarkdownIt:Function,debugPerformance:Boolean,customHtmlTags:Array,viewportPriority:Boolean,codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:Object,renderCodeBlocksAsPre:Boolean,codeBlockMinWidth:[String,Number],codeBlockMaxWidth:[String,Number],codeBlockProps:Object,showTooltips:Boolean,themes:Array,langs:Array,isDark:Boolean,customId:[String,Number],indexKey:[String,Number],typewriter:Boolean,fade:{type:Boolean,default:!0},batchRendering:Boolean,initialRenderBatchSize:Number,renderBatchSize:Number,renderBatchDelay:Number,renderBatchBudgetMs:Number,renderBatchIdleTimeoutMs:Number,deferNodesUntilVisible:Boolean,maxLiveNodes:Number,liveNodeBuffer:Number},data(){return{instanceMsgId:this.customId?`renderer-${this.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`}},computed:{legacyVue26(){return x(this)},mergedParseOptions(){var e,t;const n=null!=(e=this.parseOptions)?e:{},o=null!=(t=this.final)?t:n.final,r=m.mergeCustomHtmlTags(this.customHtmlTags,n.customHtmlTags),l=null!=o,i=r.length>0;return l||i?u(u(u({},n),l?{final:o}:{}),i?{customHtmlTags:r}:{}):n},parsedLegacyNodes(){var e;if(Array.isArray(this.nodes)&&this.nodes.length>0)return this.nodes;if(!this.content)return[];const{key:t,tags:n}=m.resolveCustomHtmlTags(null==(e=this.mergedParseOptions)?void 0:e.customHtmlTags),o=m.getMarkdown(t?`${this.instanceMsgId}:${t}`:this.instanceMsgId,{customHtmlTags:n}),r=this.customMarkdownIt?this.customMarkdownIt(o):o;return m.parseMarkdownToStructure(this.content,r,this.mergedParseOptions)},forwardedProps(){return{content:this.content,nodes:this.nodes,final:this.final,parseOptions:this.parseOptions,customMarkdownIt:this.customMarkdownIt,debugPerformance:this.debugPerformance,customHtmlTags:this.customHtmlTags,viewportPriority:this.viewportPriority,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,codeBlockMonacoOptions:this.codeBlockMonacoOptions,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockProps:this.codeBlockProps,showTooltips:this.showTooltips,themes:this.themes,langs:this.langs,isDark:this.isDark,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,fade:this.fade,batchRendering:this.batchRendering,initialRenderBatchSize:this.initialRenderBatchSize,renderBatchSize:this.renderBatchSize,renderBatchDelay:this.renderBatchDelay,renderBatchBudgetMs:this.renderBatchBudgetMs,renderBatchIdleTimeoutMs:this.renderBatchIdleTimeoutMs,deferNodesUntilVisible:this.deferNodesUntilVisible,maxLiveNodes:this.maxLiveNodes,liveNodeBuffer:this.liveNodeBuffer}}},render(e){const t=M(this);return this.legacyVue26?e(Rt,u({props:{nodes:this.parsedLegacyNodes,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,fade:this.fade,showTooltips:this.showTooltips,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,codeBlockMonacoOptions:this.codeBlockMonacoOptions,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockProps:this.codeBlockProps,themes:this.themes,langs:this.langs,isDark:this.isDark}},Object.keys(t).length>0?{on:t}:{})):e(Qt,u({props:this.forwardedProps},Object.keys(t).length>0?{on:t}:{}))}}),null,null,!1,null,null,null,null).exports,wn=new Map;function xn(e,t){if(wn.delete(e),wn.set(e,t),wn.size>200){const e=wn.keys().next().value;e&&wn.delete(e)}}function kn(e){if(!e)return null;const t=wn.get(e)||null;return t&&xn(e,t),t}function Mn(e,t){e&&t&&xn(e,{html:t})}function bn(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Cn=null,Tn=null,Nn=!1;const _n=new Map,Dn=new Map;let Sn=5;const In=new Set;function jn(){if(_n.size<Sn&&In.size){const t=Array.from(In);In.clear();for(const n of t)try{n()}catch(e){}}}let En=null;const Ln=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV);try{"undefined"!=typeof window&&Ln&&Promise.resolve().then(()=>require("./chunks/performance-monitor-698d0e66.cjs")).then(e=>{En=e.perfMonitor})}catch(yo){}function Bn(e,t=!0,n=2e3,o){return d(this,null,function*(){const r=performance.now(),l=bn(e);if(!ye()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(Tn)return Promise.reject(Tn);const i=`${t?"d":"i"}:${l}`,a=Dn.get(i);if(a)return En&&En.recordRender({type:"cache-hit",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!0}),Promise.resolve(a);const s=Cn||(Tn=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Tn.name="WorkerInitError",Tn.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Tn);if(_n.size>=Sn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=_n.size,e.max=Sn,En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(e)}return new Promise((e,i)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void i(e)}const a=Math.random().toString(36).slice(2),u=globalThis.setTimeout(()=>{_n.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:"timeout"}),i(e),jn()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(u),_n.has(a)&&_n.delete(a);const e=new Error("Aborted");e.name="AbortError",i(e),jn()},{once:!0});const c=e,d=i;_n.set(a,{resolve:e=>{En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!0}),c(e)},reject:e=>{En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:(null==e?void 0:e.message)||String(e)}),d(e)},timeoutId:u}),s.postMessage({id:a,content:l,displayMode:t})})})}function An(e,t=!0,n){const o=`${t?"d":"i"}:${bn(e)}`;if(Dn.set(o,n),Dn.size>200){const e=Dn.keys().next().value;Dn.delete(e)}}const On="WORKER_BUSY";function zn(e=2e3,t){return _n.size<Sn?Promise.resolve():new Promise((n,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),In.delete(i),n())};if(In.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,In.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>jn()),t){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),In.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const Pn={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Rn(e){return d(this,arguments,function*(e,t=!0,n={}){var o,r,l,i;if(!ye()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=n.timeout)?o:Pn.timeout,s=null!=(r=n.waitTimeout)?r:Pn.waitTimeout,u=null!=(l=n.backoffMs)?l:Pn.backoffMs,c=null!=(i=n.maxRetries)?i:Pn.maxRetries,d=Number.isFinite(c)?Math.max(0,Math.min(Math.floor(c),8)):Pn.maxRetries,m=n.signal;let p=0;for(;;){if(null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield Bn(e,t,a,m)}catch(f){if((null==f?void 0:f.code)!==On||p>=d)throw f;if(p++,yield zn(s,m).catch(()=>{}),null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*p)))}}})}const Hn=b(p.defineComponent({__name:"MathBlockNode",props:{node:null,indexKey:null},setup(e){const t=e,n=p.computed(()=>bn(t.node.content)),o=p.ref(null),r=Fe();let l=null,i=0,a=!1,s=null;const u=p.computed(()=>null==t.indexKey?null:`block:${String(t.indexKey)}`),c=kn(u.value),m=p.ref((null==c?void 0:c.html)||""),f=p.ref(""),v=p.ref(!(null==c?void 0:c.html));let h=Boolean(null==c?void 0:c.html);function g(){return d(this,null,function*(){const e=yield we();if(!e)return!1;try{const o=e.renderToString(n.value,{throwOnError:t.node.loading,displayMode:!0});return y(o),An(n.value,!0,o),!0}catch(yo){return!1}})}function y(e){m.value=e,f.value="",v.value=!1,h=!0,Mn(u.value,e)}function w(){m.value="",f.value=t.node.raw,v.value=!1}function x(){return d(this,null,function*(){if(a)return;if(!t.node.content)return w(),void(h=!0);const e=kn(u.value);if((null==e?void 0:e.html)&&!m.value&&(m.value=e.html,h=!0,v.value=!1),!h){v.value=!0;try{!l&&o.value&&(l=r(o.value)),yield null==l?void 0:l.whenVisible}catch(yo){}}s&&(s.abort(),s=null);const c=++i,d=new AbortController;s=d;try{const e=yield Rn(n.value,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:d.signal});if(a||c!==i)return;y(e)}catch(p){if(a||c!==i)return;if("AbortError"===(null==p?void 0:p.name))return;const e=(null==p?void 0:p.code)||(null==p?void 0:p.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==p?void 0:p.fallbackToRenderer)||e===On||"WORKER_TIMEOUT"===e)&&(yield g()))return;if(h||m.value)return;n||!t.node.loading?w():v.value=!0}})}return p.watch(()=>[t.node.content,t.node.loading,t.node.raw,t.indexKey],()=>x()),p.onMounted(()=>{x()}),p.onBeforeUnmount(()=>{var e;a=!0,s&&(s.abort(),s=null),null==(e=null==l?void 0:l.destroy)||e.call(l),l=null}),{__sfc:!0,props:t,mathContent:n,containerEl:o,registerVisibility:r,visibilityHandle:l,currentRenderId:i,isUnmounted:a,currentAbortController:s,cacheKey:u,initialCached:c,renderedHtml:m,fallbackText:f,renderingLoading:v,hasRenderedOnce:h,renderWithMainThreadFallback:g,applySuccessfulRender:y,applyRawFallback:w,renderMath:x}}}),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]"},[n.renderedHtml?t("div",{staticClass:"math-block__content",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("div",{staticClass:"math-block__fallback"},[e._v(" "+e._s(n.fallbackText)+" ")]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():t("div",{staticClass:"math-loading-overlay"},[t("div",{staticClass:"math-loading-spinner"})])])},[],!1,null,"50fb5666",null,null).exports,$n=b(p.defineComponent({__name:"MathInlineNode",props:{node:null,indexKey:null},setup(e){const t=e,n=p.ref(null),o=Fe();let r=null,l=0,i=!1,a=null;const s=p.computed(()=>"$$"===t.node.markup),u=p.computed(()=>bn(t.node.content)),c=p.computed(()=>null==t.indexKey?null:`inline:${String(t.indexKey)}`),m=kn(c.value),f=p.ref((null==m?void 0:m.html)||""),v=p.ref(""),h=p.ref(!(null==m?void 0:m.html));let g=Boolean(null==m?void 0:m.html);function y(){return d(this,null,function*(){const e=yield we();if(!e)return!1;try{const n=e.renderToString(u.value,{throwOnError:t.node.loading,displayMode:s.value});return w(n),An(u.value,s.value,n),!0}catch(yo){return!1}})}function w(e){f.value=e,v.value="",h.value=!1,g=!0,Mn(c.value,e)}function x(){f.value="",v.value=t.node.raw,h.value=!1}function k(){return d(this,null,function*(){if(i)return;if(!t.node.content)return x(),void(g=!0);const e=kn(c.value);(null==e?void 0:e.html)&&!f.value&&(f.value=e.html,g=!0,h.value=!1),a&&(a.abort(),a=null);const d=++l,m=new AbortController;if(a=m,!g){h.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(yo){}}try{const e=yield Rn(u.value,s.value,{timeout:1500,waitTimeout:0,maxRetries:0,signal:m.signal});if(i||d!==l)return;w(e)}catch(p){if(i||d!==l)return;if("AbortError"===(null==p?void 0:p.name))return;const e=(null==p?void 0:p.code)||(null==p?void 0:p.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==p?void 0:p.fallbackToRenderer)||e===On||"WORKER_TIMEOUT"===e)&&(yield y()))return;if(g||f.value)return;n||!t.node.loading?x():h.value=!0}})}return p.watch(()=>[t.node.content,t.node.loading,t.node.markup,t.node.raw,t.indexKey],()=>k()),p.onMounted(()=>{k()}),p.onBeforeUnmount(()=>{var e;i=!0,a&&(a.abort(),a=null),null==(e=null==r?void 0:r.destroy)||e.call(r),r=null}),{__sfc:!0,props:t,containerEl:n,registerVisibility:o,visibilityHandle:r,currentRenderId:l,isUnmounted:i,currentAbortController:a,displayMode:s,mathContent:u,cacheKey:c,initialCached:m,renderedHtml:f,fallbackText:v,renderingLoading:h,hasRenderedOnce:g,renderWithMainThreadFallback:y,applySuccessfulRender:w,applyRawFallback:x,renderMath:k}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{ref:"containerEl",staticClass:"math-inline-wrapper"},[n.renderedHtml?t("span",{staticClass:"math-inline",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("span",{staticClass:"math-inline math-inline--fallback"},[e._v(e._s(n.fallbackText))]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():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)])},[],!1,null,"d2f0cfa6",null,null).exports,Un=()=>import("mermaid");let Fn=null,Yn=Un;function Wn(e){Yn=e,Fn=null}function Kn(){return"function"==typeof Yn}function Vn(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 c(u({},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 Qn(e){if(e)try{const t=null==e?void 0:e.initialize;e.initialize=n=>{const o=u({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(yo){}}let Xn=null,qn=null;const Zn=new Map;let Gn=5,Jn=!1;const eo="WORKER_BUSY",to="MERMAID_DISABLED";function no(e,t,n=1400){if(!Kn()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=to,Promise.reject(e)}if(qn)return Promise.reject(qn);const o=Xn||(qn=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),qn.name="WorkerInitError",qn.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(qn);if(Zn.size>=Gn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=eo,e.inFlight=Zn.size,e.max=Gn,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),Zn.delete(i))},c={resolve:e=>{u(),r(e)},reject:e=>{u(),l(e)}};Zn.set(i,c);try{o.postMessage({id:i,action:e,payload:t})}catch(d){return Zn.delete(i),void l(d)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=Zn.get(i);t&&t.reject(e)},n)})}function oo(e,t,n=1400){return d(this,null,function*(){try{return yield no("canParse",{code:e,theme:t},n)}catch(yo){return Promise.reject(yo)}})}function ro(e,t,n=1400){return d(this,null,function*(){try{return yield no("findPrefix",{code:e,theme:t},n)}catch(yo){return Promise.reject(yo)}})}function lo(){if(Xn)try{for(const[e,t]of Zn.entries())t.reject(new Error("Worker terminated"));Zn.clear(),Xn.terminate()}finally{Xn=null}}const io=b(p.defineComponent({__name:"MermaidBlockNode",props:{node:null,maxHeight:{default:"500px"},estimatedPreviewHeightPx:null,loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},renderDebounceMs:{default:300},contentStableDelayMs:{default:500},previewPollDelayMs:{default:800},previewPollMaxDelayMs:{default:4e3},previewPollMaxAttempts:{default:12},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:!0},enableMermaidInteractions:{type:Boolean,default:!1},onRenderError:null},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"),s=p.computed(()=>({startOnLoad:!1,securityLevel:a.value,dompurifyConfig:"strict"===a.value?l:void 0,flowchart:"strict"===a.value?{htmlLabels:!1}:void 0}));function f(e,t){if(!e)return null;const n=m.toSafeSvgElement(t);return n?(v(e),e.appendChild(n),{svg:e.innerHTML,bindTarget:e}):null}function v(e){if(e)try{e.replaceChildren()}catch(yo){e.innerHTML=""}}function g(e,t,n={}){if(!e)return null;const o=f(e,t);return o||n.keepPreviousOnFailure||v(e),o}let y=null;function w(e){if(r.enableMermaidInteractions&&(null==e?void 0:e.querySelector("svg")))try{null==y||y(e)}catch(yo){}}const{t:x}=ue();function k(){return d(this,null,function*(){try{const e=yield function(){return d(this,null,function*(){if(Fn)return Fn;const e=function(){try{const e=globalThis;return Vn(null==e?void 0:e.mermaid)}catch(yo){return null}}();if(e)return Fn=e,Qn(Fn),Fn;const t=Yn;if(!t)return null;let n;try{n=yield t()}catch(o){if(t===Un)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return n?(Fn=Vn(n),Qn(Fn),Fn):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 k();if(!t)return;null==(e=null==t?void 0:t.initialize)||e.call(t,u({},s.value))}catch(t){i.value=!1,console.warn("[markstream-vue2] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",t)}})})();const M=p.ref(!1),b=p.ref(!1),C=p.ref(),T=p.ref(),N=p.ref(),_=p.ref(null),D=Fe();let S=null;const I=p.ref("undefined"==typeof window),j=p.ref(),E=p.computed(()=>r.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),L=p.computed(()=>r.maxHeight&&"none"!==r.maxHeight?Ut(r.maxHeight):null),B=p.computed(()=>{var e;return Kt(null!=(e=Ut(r.estimatedPreviewHeightPx))?e:Ft(E.value),void 0,L.value)});function A(e,t=E.value){const n=t,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return n.trim().startsWith("%%{")?n:o+n}function O(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const o=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==o?void 0:o[1])?void 0:t.toLowerCase())||""}return""}const z=p.ref(1),P=p.ref(0),R=p.ref(0),H=p.ref(!1),$=p.ref({x:0,y:0}),U=p.ref("undefined"==typeof window),F=p.ref(!1),Y=p.ref(!1),W=p.ref(null),K=p.ref(0),V=p.ref(!1),Q=p.computed(()=>{var e;return Math.max(0,null!=(e=r.renderDebounceMs)?e:300)}),X=p.computed(()=>{var e;return Math.max(0,null!=(e=r.contentStableDelayMs)?e:500)}),q=p.computed(()=>{var e;return Math.max(120,null!=(e=r.previewPollDelayMs)?e:800)}),Z=p.computed(()=>{var e;return Math.max(q.value,null!=(e=r.previewPollMaxDelayMs)?e:4e3)}),G=p.computed(()=>{var e;return Math.max(1,Math.trunc(null!=(e=r.previewPollMaxAttempts)?e:12))});let J=null,ee=null,te=null,ne=0;const oe=null!=(n=globalThis.requestIdleCallback)?n:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16);function re(){return I.value&&!b.value}function ae(){null!=te&&(globalThis.clearTimeout(te),te=null)}function se(){ae(),te=globalThis.setTimeout(()=>{te=null,re()&&oe(()=>{re()&&st()},{timeout:500})},Q.value)}function ce(){null!=ee&&(globalThis.clearTimeout(ee),ee=null)}function de(e=600){if("undefined"==typeof globalThis)return;const t=Math.max(0,e);ce(),ee=globalThis.setTimeout(()=>{ee=null,r.loading||Y.value||!re()?de(Math.min(1200,Math.max(300,1.2*t))):se()},t)}const me=p.ref(`${B.value}px`);let pe=null;p.watch(B,e=>{if(U.value||b.value)return;const t=Ut(me.value);(null==t||t<e)&&(me.value=`${e}px`)});const fe=p.ref(!1),ve=p.ref(!1),he=p.ref({}),ge=p.ref(null),ye=p.ref(""),we=p.ref(0);let xe=null;const ke=p.ref(!1),Me=p.ref({zoom:1,translateX:0,translateY:0,containerHeight:`${B.value}px`}),be=p.computed(()=>r.enableWheelZoom?{wheel:ot}:{}),Ce=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}}),Te=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let Ne=null,_e=null,De=!1,Se=q.value,Ie=null,je=0,Ee=!0,Le=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 Ae(e){if("undefined"==typeof document)return;if(!T.value)return;if("function"==typeof r.onRenderError&&!0===r.onRenderError(e,E.value,T.value))return ke.value=!0,void ut();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),v(T.value),T.value.appendChild(t),me.value=`${B.value}px`,ke.value=!0,ut()}function Oe(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 ze(e){return!e||e.disabled}function Pe(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function Re(){return Ee&&!U.value&&!fe.value&&!ke.value}function He(e){const t=e.trim();return!(!t||t.startsWith("%%"))&&!/^(?:gantt|title|dateformat|axisformat|tickinterval|excludes|section|todaymarker|topaxis|weekday|weekend|acctitle|accdescr|accdescrmultiline)\b/i.test(t)&&t.includes(":")}function $e(e){var t;const n=e.split(/\r?\n/);for(!/\r?\n$/.test(e)&&n.length>0&&n.pop();n.length>0;){const e=null==(t=n[n.length-1])?void 0:t.trim();if(e&&!e.startsWith("%%")){if(He(e))break;n.pop()}else n.pop()}return n.some(He)?n.join("\n"):""}function Ue(e){if("gantt"===O(e))return $e(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 Ye(e,t,n){return d(this,null,function*(){var o,r;const l=yield k();if(!l)return;const i=l,a=Pe(e,t);if("function"==typeof i.parse)return yield Be(()=>i.parse(a),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:Ce.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:Ce.value.render,signal:null==n?void 0:n.signal}),!0})}function We(e,t,n){return d(this,null,function*(){var o;try{return yield oo(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:Ce.value.worker)}catch(yo){return yield Ye(e,t,n)}})}function Ke(e,t,n){return d(this,null,function*(){var o;if("gantt"===O(e)){const o=Ue(e);if(!o.trim())return{fullOk:!1,prefixOk:!1};try{if(yield We(o,t,n))return o===e?{fullOk:!0,prefixOk:!1}:{fullOk:!1,prefixOk:!0,prefix:o}}catch(yo){if("AbortError"===(null==yo?void 0:yo.name))throw yo}return{fullOk:!1,prefixOk:!1}}try{if(yield We(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(yo){if("AbortError"===(null==yo?void 0:yo.name))throw yo}let r=Ue(e);if(r&&r.trim()&&r!==e)try{try{const l=yield ro(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:Ce.value.worker);l&&l.trim()&&(r=l)}catch(yo){}if(yield We(r,t,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(yo){if("AbortError"===(null==yo?void 0:yo.name))throw yo}return{fullOk:!1,prefixOk:!1}})}"undefined"!=typeof window&&p.watch(()=>C.value,e=>{if(null==S||S.destroy(),S=null,!e)return void(I.value=!1);const t=D(e,{rootMargin:"400px"});S=t,I.value=t.isVisible.value,t.whenVisible.then(()=>{I.value=!0})},{immediate:!0}),p.onBeforeUnmount(()=>{null==S||S.destroy(),S=null,ae()});const Ve=p.computed(()=>U.value||Y.value||b.value);function Qe(){return L.value}function Xe(e){if(!C.value||!T.value)return;const t=T.value.querySelector("svg");if(!t)return;let n=0,o=0;const l=t.getAttribute("viewBox"),i=t.getAttribute("width"),a=t.getAttribute("height");if(l){const e=l.split(" ");4===e.length&&(n=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(n&&o||i&&a&&(n=Number.parseFloat(i),o=Number.parseFloat(a)),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(yo){return void console.error("Failed to get SVG BBox:",yo)}if(n>0&&o>0){const t=o/n,l=null!=e?e:C.value.clientWidth,i=Qe(),a=l*t,s=null==i?a:Math.min(a,i);me.value=`${"none"===r.maxHeight?s:Math.max(s,B.value)}px`}}const qe=p.ref(!1),Ze=p.computed(()=>({transform:`translate(${P.value}px, ${R.value}px) scale(${z.value})`}));function Ge(e){"Escape"===e.key&&qe.value&&tt()}function Je(){var e;if(!C.value||!N.value)return!1;if("1"===(null==(e=N.value.firstElementChild)?void 0:e.getAttribute("data-mermaid-modal-clone")))return!0;const t=C.value.cloneNode(!0);t.dataset.mermaidModalClone="1",t.classList.add("fullscreen"),t.style.height="100%",t.style.maxHeight="100%";const n=t.querySelector("[data-mermaid-wrapper]");return n&&(_.value=n,n.style.transform=Ze.value.transform),v(N.value),N.value.appendChild(t),w(t),!0}function et(){if(qe.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(yo){}if("undefined"!=typeof window)try{window.addEventListener("keydown",Ge)}catch(yo){}p.nextTick(()=>{Je()||p.nextTick(Je)})}function tt(){if(qe.value=!1,N.value&&v(N.value),_.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(yo){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",Ge)}catch(yo){}}function nt(){if(!U.value)return;if(!i.value)return;const e=E.value.length;e!==K.value&&(V.value=!0,K.value=e,J&&clearTimeout(J),J=setTimeout(()=>{V.value&&U.value&&E.value.trim()&&(V.value=!1,lt("preview"))},X.value))}function ot(e){if(r.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!C.value)return;const t=C.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,r=n-t.width/2,l=o-t.height/2,i=(r-P.value)/z.value,a=(l-R.value)/z.value,s=.01,u=-e.deltaY*s,c=Math.min(Math.max(z.value+u,.5),3);c!==z.value&&(P.value=r-i*c,R.value=l-a*c,z.value=c)}}function rt(e,t=null){return d(this,null,function*(){try{const n=null!=t?t:(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(yo){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function lt(e){return d(this,null,function*(){const t=j.value;if(!t)return F.value=!0,void(U.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",F.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 it(){return d(this,null,function*(){return Y.value?W.value:T.value||(yield p.nextTick(),T.value)?(Y.value=!0,W.value=(()=>d(this,null,function*(){var e,t,n;try{const n=yield k();if(!n)return;const o=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;fe.value||ve.value||null==(e=n.initialize)||e.call(n,c(u({},s.value),{dompurifyConfig:u({},l)}));const i=A(r.isDark?"dark":"light"),a=yield Be(()=>n.render(o,i),{timeoutMs:Ce.value.fullRender}),d=null==a?void 0:a.svg;if(T.value){const e=g(T.value,d);if(!e)return ve.value&&(ve.value=!1),!1;const n=null!=(t=null==a?void 0:a.bindFunctions)?t:null;y=n,w(e.bindTarget),fe.value||ve.value||(Xe(),fe.value=!0,Me.value={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:me.value});const o=r.isDark?"dark":"light";e&&(he.value[o]={svg:e.svg,bindFunctions:n}),ve.value&&(ve.value=!1),ke.value=!1,ne=0,ce()}return!0}catch(o){const e=Oe(o),t=ne+1;return e&&t<=3?(ne=t,de(Math.min(1200,600*t)),void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&(null==(n={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:n.DEV)&&console.warn("[markstream-vue2] Mermaid render timed out, retry scheduled:",t)):(ne=0,ce(),!1===r.loading&&console.error("Failed to render mermaid diagram:",o),!1===r.loading&&Ae(o)),!1}finally{Y.value=!1,W.value=null}}))(),W.value):void console.warn("Mermaid container not ready")})}function at(e){return d(this,null,function*(){var t;if(Re()&&(T.value||(yield p.nextTick(),T.value))&&!Y.value){Y.value=!0;try{const n=yield k();if(!n)return;const o=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,l=r.isDark?"dark":"light",i=Ue(e),a=Pe(i&&i.trim()?i:e,l),s=yield Be(()=>n.render(o,a),{timeoutMs:Ce.value.render}),u=null==s?void 0:s.svg;if(T.value&&u){const e=g(T.value,u,{keepPreviousOnFailure:!0});e&&(y=null!=(t=null==s?void 0:s.bindFunctions)?t:null,w(e.bindTarget),Xe())}}catch(yo){}finally{Y.value=!1}}})}function st(){return d(this,null,function*(){var e,t,n;const o=Date.now(),l=++we.value;xe&&xe.abort(),xe=new AbortController;const i=xe.signal,a=r.isDark?"dark":"light",s=E.value,u=s.replace(/\s+/g,"");if(!s.trim())return T.value&&v(T.value),ge.value=null,ye.value="",void(ke.value=!1);if(u===ye.value)return;try{const n=yield Ke(s,a,{signal:i,timeoutMs:Ce.value.worker});if(n.fullOk){if(!(yield it()))return;return void(we.value===l&&(ge.value=null!=(t=null==(e=T.value)?void 0:e.innerHTML)?t:null,ye.value=u,ke.value=!1))}const r=je&&o<=je;if(n.prefixOk&&n.prefix&&Re()&&!r)return void(yield at(n.prefix))}catch(yo){if("AbortError"===(null==yo?void 0:yo.name))return}if(we.value!==l)return;if(ke.value)return;const c=he.value[a];if(c&&T.value){const e=g(T.value,c.svg);e&&(y=null!=(n=c.bindFunctions)?n:null,w(e.bindTarget))}})}function ut(){De&&(De=!1,Se=q.value,Ee=!1,Ie&&(Ie.abort(),Ie=null),Ne&&(globalThis.clearTimeout(Ne),Ne=null),_e&&(Te(_e),_e=null),je=Date.now())}function ct(){if(ut(),ae(),xe){try{xe.abort()}catch(yo){}xe=null}if(Ie){try{Ie.abort()}catch(yo){}Ie=null}lo(),ce(),ne=0}function dt(e=q.value){De&&(Le>=G.value?ut():(Ne&&globalThis.clearTimeout(Ne),Ne=globalThis.setTimeout(()=>{_e=oe(()=>d(this,null,function*(){if(!De)return;if(!re())return void ut();if(U.value||fe.value)return void ut();const e=r.isDark?"dark":"light",t=E.value;if(!t.trim())return!1===r.loading?void ut():void dt(Se);if(Le++,Le>G.value)ut();else{Ie&&Ie.abort(),Ie=new AbortController;try{const n=yield Ke(t,e,{signal:Ie.signal,timeoutMs:Ce.value.worker});if(n.fullOk){if((yield it())&&fe.value)return void ut()}else n.prefixOk&&n.prefix&&Re()&&(yield at(n.prefix))}catch(yo){}Se=Math.min(Math.floor(1.5*Se),Z.value),dt(Se)}}),{timeout:500})},e)))}function mt(){De||i.value&&re()&&(U.value||fe.value||(De=!0,je=0,Ee=!0,Le=0,Se=q.value,dt(Se)))}p.watch(N,e=>{qe.value&&e&&Je()}),p.watch(Ze,e=>{qe.value&&_.value&&(_.value.style.transform=e.transform)},{immediate:!0}),p.watch(()=>E.value,()=>{fe.value=!1,he.value={},re()&&se(),!U.value&&i.value&&re()?mt():ut(),nt()}),p.watch(()=>r.isDark,()=>d(this,null,function*(){var e;if(!fe.value)return;if(ke.value)return;const t=r.isDark?"dark":"light",n=he.value[t];if(n){if(T.value){const t=g(T.value,n.svg);t&&(y=null!=(e=n.bindFunctions)?e:null,w(t.bindTarget))}return}const o={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:me.value},l=1!==z.value||0!==P.value||0!==R.value;ve.value=!0,l&&(z.value=1,P.value=0,R.value=0,yield p.nextTick()),(yield it())&&l&&(yield p.nextTick(),z.value=o.zoom,P.value=o.translateX,R.value=o.translateY,me.value=o.containerHeight,Me.value=o)})),p.watch(()=>U.value,e=>d(this,null,function*(){var t;if(e)ut(),fe.value&&(Me.value={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:me.value});else{if(ke.value)return;const e=r.isDark?"dark":"light";if(fe.value&&he.value[e]){if(yield p.nextTick(),T.value){const n=he.value[e],o=g(T.value,n.svg);o&&(y=null!=(t=n.bindFunctions)?t:null,w(o.bindTarget))}return z.value=Me.value.zoom,P.value=Me.value.translateX,R.value=Me.value.translateY,void(me.value=Me.value.containerHeight)}if(yield p.nextTick(),!i.value||!re())return;mt(),yield st()}})),p.watch(()=>r.loading,(e,t)=>d(this,null,function*(){var n;if(!0===t&&!1===e){const e=E.value.trim();if(!e)return ct();const t=r.isDark?"dark":"light",l=e.replace(/\s+/g,"");if(fe.value&&l===ye.value){if(yield p.nextTick(),T.value&&!T.value.querySelector("svg")&&he.value[t]){const e=he.value[t],o=g(T.value,e.svg);o&&(y=null!=(n=e.bindFunctions)?n:null,w(o.bindTarget))}return void ct()}try{if(yield We(e,t,{timeoutMs:Ce.value.worker}),!(yield it()))return;ye.value=l,ke.value=!1,ct()}catch(o){ct(),Ae(o)}}})),p.watch(C,e=>{pe&&pe.disconnect(),e&&(pe=new ResizeObserver(e=>{e&&e.length>0&&!U.value&&!b.value&&qt(()=>{Xe(e[0].contentRect.width)})}),pe.observe(e))},{immediate:!0}),p.onMounted(()=>d(this,null,function*(){yield p.nextTick(),F.value||(U.value=!i.value),re()&&(se(),K.value=E.value.length)})),p.watch(()=>i.value,e=>{F.value||(U.value=!e)}),p.watch(()=>I.value,e=>{e&&(fe.value||(se(),K.value=E.value.length),r.loading||fe.value||se(),!U.value&&i.value&&mt())},{immediate:!1}),p.watch(()=>r.maxHeight,()=>{p.nextTick(()=>{Xe()})}),p.onUnmounted(()=>{J&&clearTimeout(J),ae(),pe&&pe.disconnect(),xe&&(xe.abort(),xe=null),lo(),ut(),ce()}),p.watch(()=>b.value,e=>d(this,null,function*(){e?(ut(),xe&&xe.abort()):re()&&!fe.value&&(yield p.nextTick(),se(),U.value||mt())}),{immediate:!1});const pt=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:s,setSafeSvg:f,clearElement:v,renderSvgToTarget:g,lastMermaidBindFunctions:y,bindMermaidInteractions:w,t:x,resolveMermaidInstance:k,copyText:M,isCollapsed:b,mermaidContainer:C,mermaidContent:T,modalContent:N,modalCloneWrapper:_,registerViewport:D,viewportHandle:S,viewportReady:I,modeContainerRef:j,baseFixedCode:E,maxPreviewHeight:L,estimatedPreviewHeight:B,getCodeWithTheme:A,getMermaidDiagramKind:O,zoom:z,translateX:P,translateY:R,isDragging:H,dragStart:$,showSource:U,userToggledShowSource:F,isRendering:Y,renderQueue:W,lastContentLength:K,isContentGenerating:V,renderDebounceDelay:Q,contentStableDelay:X,previewPollInitialDelay:q,previewPollMaxDelay:Z,previewPollMaxAttempts:G,contentStableTimer:J,renderRetryTimer:ee,progressiveRenderDebounceTimer:te,consecutiveRenderTimeouts:ne,MAX_RENDER_TIMEOUT_RETRIES:3,requestIdle:oe,canScheduleViewportWork:re,clearProgressiveRenderDebounceTimer:ae,debouncedProgressiveRender:se,clearRenderRetryTimer:ce,scheduleRenderRetry:de,containerHeight:me,resizeObserver:pe,hasRenderedOnce:fe,isThemeRendering:ve,svgCache:he,lastSvgSnapshot:ge,lastRenderedCode:ye,renderToken:we,currentWorkController:xe,hasRenderError:ke,savedTransformState:Me,wheelListeners:be,timeouts:Ce,cancelIdle:Te,previewPollTimeoutId:Ne,previewPollIdleId:_e,isPreviewPolling:De,previewPollDelay:Se,previewPollController:Ie,lastPreviewStopAt:je,allowPartialPreview:Ee,previewPollAttempts:Le,withTimeoutSignal:Be,renderErrorToContainer:Ae,isTimeoutError:Oe,shouldSkipEventTarget:ze,onBtnHover:function(e,t,n="top"){if(ze(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;le(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){ie()},onCopyHover:function(e){if(ze(e.currentTarget))return;const t=M.value?x("common.copied")||"Copied":x("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;le(e.currentTarget,t,"top",!1,o,r.isDark)},applyThemeTo:Pe,canApplyPartialPreview:Re,isGanttTaskLine:He,getSafeGanttPreviewCandidate:$e,getSafePrefixCandidate:Ue,canParseOnMain:Ye,canParseOffthread:We,canParseOrPrefix:Ke,isFullscreenDisabled:Ve,resolveMaxContainerHeight:Qe,updateContainerHeight:Xe,isModalOpen:qe,transformStyle:Ze,handleKeydown:Ge,mountModalClone:Je,openModal:et,closeModal:tt,checkContentStability:nt,zoomIn:function(){z.value<3&&(z.value+=.1)},zoomOut:function(){z.value>.5&&(z.value-=.1)},resetZoom:function(){z.value=1,P.value=0,R.value=0},startDrag:function(e){H.value=!0,e instanceof MouseEvent?$.value={x:e.clientX-P.value,y:e.clientY-R.value}:$.value={x:e.touches[0].clientX-P.value,y:e.touches[0].clientY-R.value}},onDrag:function(e){if(!H.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),P.value=t-$.value.x,R.value=n-$.value.y},stopDrag:function(){H.value=!1},handleWheel:ot,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(E.value)),M.value=!0,t("copy",E.value),setTimeout(()=>{M.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},exportSvg:rt,handleExportClick:function(){var e;const n=null==(e=T.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||rt(n,o)},handleOpenModalClick:function(){var e,n;const o=null!=(n=null==(e=T.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||et()},handleSwitchMode:function(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};t("toggleMode",e,n),n.defaultPrevented||lt(e)},switchMode:lt,initMermaid:it,renderPartial:at,progressiveRender:st,stopPreviewPolling:ut,cleanupAfterLoadingSettled:ct,scheduleNextPreviewPoll:dt,startPreviewPolling:mt,computedButtonStyle:pt,mermaidIconUrl:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij4KICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNjYTllZTYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEuNSAyLjVjMCA2IDIuMjUgNS43NSA0IDcgLjgzLjY3IDEuMTcgMiAxIDRoM2MtLjE3LTIgLjE3LTMuMzMgMS00IDEuNzUtMS4yNSA0LTEgNC03QzEyIDIuNSAxMCAzIDggNyA2IDMgNCAyLjUgMS41IDIuNSIgLz4KPC9zdmc+Cg==",Portal:Zt}}}),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}],attrs:{"data-markstream-mermaid":"1","data-markstream-mode":n.showSource?"source":n.hasRenderedOnce?"preview":"pending"}},[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 overflow-hidden block transition-[height] duration-150 ease-out",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-vue2"},[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,"5b401883",null,null).exports,ao=b(p.defineComponent({name:"NestedRenderer",components:{MarkdownRender:yn},inheritAttrs:!1,props:{node:Object,nodes:Array,content:String,loading:Boolean,final:Boolean,cacheKey:String,parseOptions:Object,customHtmlTags:Array,customMarkdownIt:Function},setup(e){const t=p.getCurrentInstance(),n=p.computed(()=>{var t;return null!=e.final?e.final:"boolean"==typeof e.loading?!e.loading:"boolean"==typeof(null==(t=e.node)?void 0:t.loading)?!e.node.loading:void 0}),o=p.computed(()=>Ot({node:e.node,nodes:e.nodes,content:e.content},{cacheKey:e.cacheKey,final:n.value,parseOptions:e.parseOptions,customHtmlTags:e.customHtmlTags,customMarkdownIt:e.customMarkdownIt}));return{forwardedListeners:p.computed(()=>M(null==t?void 0:t.proxy)),resolvedFinal:n,resolvedNodes:o}}}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("MarkdownRender",e._g(e._b({attrs:{nodes:e.resolvedNodes,final:e.resolvedFinal,"custom-html-tags":e.customHtmlTags}},"MarkdownRender",e.$attrs,!1),e.forwardedListeners))},[],!1,null,null,null,null).exports,so=b(p.defineComponent({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:null,content:null,placement:null,offset:null,originX:null,originY:null,id:null,isDark:{type:[Boolean,null]}},setup(e){const t=e,n=p.computed(()=>{if(void 0!==t.isDark&&null!==t.isDark)return Boolean(t.isDark);if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0;if((null==window?void 0:window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(yo){}return!1}),o=p.ref(null),r=p.ref({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=p.ref(!1);let i=null;function a(){return d(this,null,function*(){var e,n;if(!t.anchorEl||!o.value)return;const l=[v.offset(null!=(e=t.offset)?e:8),v.flip(),v.shift({padding:8})],{x:i,y:a}=yield v.computePosition(t.anchorEl,o.value,{placement:null!=(n=t.placement)?n:"top",middleware:l,strategy:"fixed"});r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(a)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return p.watch(()=>t.visible,e=>d(this,null,function*(){if(e)if(l.value=!1,yield p.nextTick(),t.anchorEl&&o.value)try{const e=t.anchorEl.getBoundingClientRect();yield a();const n=r.value.transform;if(null!=t.originX&&null!=t.originY){const o=Math.abs(Number(t.originX)-e.left),i=Math.abs(Number(t.originY)-e.top);Math.hypot(o,i)>120?(r.value.transform=`translate3d(${Math.round(t.originX)}px, ${Math.round(t.originY)}px, 0)`,yield p.nextTick(),l.value=!0,yield p.nextTick(),r.value.transform=n):l.value=!0}else l.value=!0;i=v.autoUpdate(t.anchorEl,o.value,a)}catch(yo){yield a(),l.value=!0,i=v.autoUpdate(t.anchorEl,o.value,a)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),p.watch([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>d(this,null,function*(){t.visible&&t.anchorEl&&o.value&&(yield p.nextTick(),yield a())})),p.onBeforeUnmount(()=>{i&&i()}),{__sfc:!0,props:t,isDarkEffective:n,tooltip:o,style:r,ready:l,cleanupAutoUpdate:i,updatePosition:a,Portal:Zt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("transition",{attrs:{name:"tooltip",appear:""}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.visible&&n.ready,expression:"visible && ready"}],ref:"tooltip",staticClass:"z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",class:[n.isDarkEffective?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"],style:{position:"fixed",left:n.style.left,top:n.style.top,transform:n.style.transform},attrs:{id:n.props.id,role:"tooltip"}},[e._v(" "+e._s(e.content)+" ")])])],1)])},[],!1,null,"703da293",null,null).exports,uo=Object.freeze(Object.defineProperty({__proto__:null,default:so},Symbol.toStringTag,{value:"Module"}));function co(e){return JSON.stringify(e)}function mo(e){var t;const n=null!=(t=e.mode)?t:"classic",o=e.katexUrl,r=e.mhchemUrl,l=co(u({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=co(o),a=r?co(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 po(e){return JSON.stringify(e)}function fo(e){var t;const n=null!=(t=e.mode)?t:"module",o=po(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(${po(u({startOnLoad:!1,securityLevel:"strict",flowchart:{htmlLabels:!1}},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()}function vo(e){const t="string"==typeof(null==e?void 0:e.version)?e.version:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}const ho={AdmonitionNode:Xt,BlockquoteNode:Ht,CheckboxNode:C,CodeBlockNode:an,DefinitionListNode:T,EmojiNode:N,EmphasisNode:Be,FootnoteNode:Oe,FootnoteReferenceNode:E,FootnoteAnchorNode:Ae,HardBreakNode:ze,HeadingNode:Pe,HtmlBlockNode:ut,HtmlInlineNode:F,HighlightNode:Le,ImageNode:ce,D2BlockNode:mn,InlineCodeNode:Y,PreCodeNode:dt,InsertNode:Ee,LinkNode:je,ListItemNode:Re,ListNode:He,MarkdownCodeBlockNode:gn,MathBlockNode:Hn,MathInlineNode:$n,MermaidBlockNode:io,NestedRenderer:ao,InfographicBlockNode:hn,ParagraphNode:ct,StrikethroughNode:Ie,StrongNode:Se,SubscriptNode:De,SuperscriptNode:_e,TableNode:mt,TextNode:Me,ThematicBreakNode:pt,VmrContainerNode:vt,ReferenceNode:Ne},go={install(e,t){!function(e){const t=vo(e);if(!(null==t||t>=7||(null==e?void 0:e.__composition_api_installed__)||(null==e?void 0:e.__compositionApiInstalled)))throw new Error("[markstream-vue2] Vue 2.6.x requires @vue/composition-api. Install it and call Vue.use(VueCompositionAPI) before using markstream-vue2.")}(e),function(e){const t=vo(e);if(null==t||t>=7)return;if(null==e?void 0:e.__markstreamVue2SetupProxyPatched)return;e.__markstreamVue2SetupProxyPatched=!0;const n=e.prototype;Object.prototype.hasOwnProperty.call(n,"_setupProxy")||Object.defineProperty(n,"_setupProxy",{configurable:!0,get(){return this},set(e){Object.defineProperty(this,"_setupProxy",{value:e,configurable:!0,writable:!0})}}),e.mixin({beforeCreate(){if(!this._setupProxy)try{this._setupProxy=this}catch(yo){}}})}(e),Object.entries(ho).forEach(([t,n])=>{e.component(t,n)}),e.component("MarkdownRender",yn),e.component("NodeRenderer",yn),(null==t?void 0:t.getLanguageIcon)&&It(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&m.setDefaultMathOptions(t.mathOptions)}};Object.defineProperty(exports,"KATEX_COMMANDS",{enumerable:!0,get:()=>m.KATEX_COMMANDS}),Object.defineProperty(exports,"normalizeStandaloneBackslashT",{enumerable:!0,get:()=>m.normalizeStandaloneBackslashT}),Object.defineProperty(exports,"setDefaultMathOptions",{enumerable:!0,get:()=>m.setDefaultMathOptions}),exports.AdmonitionNode=Xt,exports.BlockquoteNode=Ht,exports.CheckboxNode=C,exports.CodeBlockNode=an,exports.D2BlockNode=mn,exports.DefinitionListNode=T,exports.EmojiNode=N,exports.EmphasisNode=Be,exports.FootnoteAnchorNode=Ae,exports.FootnoteNode=Oe,exports.FootnoteReferenceNode=E,exports.HardBreakNode=ze,exports.HeadingNode=Pe,exports.HighlightNode=Le,exports.HtmlBlockNode=ut,exports.HtmlInlineNode=F,exports.ImageNode=ce,exports.InfographicBlockNode=hn,exports.InlineCodeNode=Y,exports.InsertNode=Ee,exports.LinkNode=je,exports.ListItemNode=Re,exports.ListNode=He,exports.MERMAID_DISABLED_CODE=to,exports.MERMAID_WORKER_BUSY_CODE=eo,exports.MarkdownCodeBlockNode=gn,exports.MarkdownRender=yn,exports.MathBlockNode=Hn,exports.MathInlineNode=$n,exports.MermaidBlockNode=io,exports.NestedRenderer=ao,exports.ParagraphNode=ct,exports.PreCodeNode=dt,exports.ReferenceNode=Ne,exports.StrikethroughNode=Ie,exports.StrongNode=Se,exports.SubscriptNode=De,exports.SuperscriptNode=_e,exports.TableNode=mt,exports.TextNode=Me,exports.ThematicBreakNode=pt,exports.Tooltip=so,exports.VmrContainerNode=vt,exports.VueRendererMarkdown=go,exports.WORKER_BUSY_CODE=On,exports.buildKaTeXCDNWorkerSource=mo,exports.buildMermaidCDNWorkerSource=fo,exports.canParseOffthread=oo,exports.clearGlobalCustomComponents=function(){delete S.scopedCustomComponents[_],I.value++},exports.clearKaTeXWorker=function(){var e;Cn&&(null==(e=Cn.terminate)||e.call(Cn)),Cn=null,Tn=null},exports.clearMermaidWorker=function(){var e;if(Xn)try{for(const[e,t]of Zn.entries())t.reject(new Error("Worker cleared"));Zn.clear(),null==(e=Xn.terminate)||e.call(Xn)}catch(yo){}Xn=null,qn=null},exports.createKaTeXWorkerFromCDN=function(e){var t,n;const o=mo(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")?c(u({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,s=new Worker(l,a);if(e.debug)try{s.postMessage({type:"init",debug:!0})}catch(yo){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(yo){}}},source:o}},exports.createMermaidWorkerFromCDN=function(e){var t,n;const o=fo(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")?c(u({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,s=new Worker(l,a);if(e.debug)try{s.postMessage({type:"init",debug:!0})}catch(yo){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(yo){}}},source:o}},exports.default=yn,exports.disableD2=function(){dn(null)},exports.disableKatex=function(){ge(null)},exports.disableMermaid=function(){Wn(null)},exports.enableD2=function(e){dn(null!=e?e:sn)},exports.enableKatex=function(e){ge(null!=e?e:he)},exports.enableMermaid=function(e){Wn(null!=e?e:Un)},exports.findPrefixOffthread=ro,exports.getCustomNodeComponents=j,exports.getKaTeXBackpressureDefaults=function(){return u({},Pn)},exports.getKaTeXWorkerLoad=function(){return{inFlight:_n.size,max:Sn}},exports.getLanguageIcon=Lt,exports.getMermaidWorkerLoad=function(){return{inFlight:Zn.size,max:Gn}},exports.getUseMonaco=wt,exports.isD2Enabled=function(){return"function"==typeof cn},exports.isKaTeXWorkerBusy=function(){return _n.size>=Sn},exports.isKatexEnabled=ye,exports.isMermaidEnabled=Kn,exports.languageIconsRevision=Nt,exports.languageMap=Bt,exports.normalizeLanguageIdentifier=jt,exports.parseNestedMarkdownToNodes=Ot,exports.preloadExtendedLanguageIcons=function(){return d(this,null,function*(){yield St()})},exports.removeCustomComponents=function(e){if(e===_)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete S.scopedCustomComponents[e],I.value++},exports.renderKaTeXInWorker=Bn,exports.renderKaTeXWithBackpressure=Rn,exports.renderMarkdownNodeToHtml=function(e,t={}){return Xe(e,Ve(t))},exports.renderMarkdownNodesToHtml=Ke,exports.renderNestedMarkdownToHtml=function(e,t={}){return function(e,t){if(Array.isArray(e.nodes)&&e.nodes.length>0)return Qe(e.nodes,t);const n=e.node;if(n){const e=ot(n.children);if(e.length>0)return Qe(e,t);const o=rt(n.content);if(o)return Je(o,t);if(null!=n.raw)return at(rt(n.raw))}return e.content?Je(rt(e.content),t):""}(e,Ve(t))},exports.resolveMonacoLanguageId=Et,exports.setCustomComponents=function(e,t){"string"==typeof e?S.scopedCustomComponents[e]=t||{}:S.scopedCustomComponents[_]=e||{},I.value++},exports.setD2Loader=dn,exports.setDefaultI18nMap=function(e){Object.assign(ae,e)},exports.setKaTeXBackpressureDefaults=function(e){null!=e.timeout&&(Pn.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Pn.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Pn.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Pn.maxRetries=Math.max(0,Math.floor(e.maxRetries)))},exports.setKaTeXCache=An,exports.setKaTeXWorker=function(e){Cn=e,Tn=null,Cn.onmessage=e=>{const{id:t,html:n,error:o}=e.data,r=_n.get(t);if(r)if(_n.delete(t),clearTimeout(r.timeoutId),jn(),o)r.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(Dn.set(e,n),Dn.size>200){const e=Dn.keys().next().value;Dn.delete(e)}}r.resolve(n)}},Cn.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of _n.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));_n.clear(),jn()}},exports.setKaTeXWorkerDebug=function(e){Nn=!!e,Cn&&Cn.postMessage({type:"init",debug:Nn})},exports.setKaTeXWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Sn=Math.floor(e))},exports.setKatexLoader=ge,exports.setLanguageIconResolver=It,exports.setMermaidLoader=Wn,exports.setMermaidWorker=function(e){Xn=e,qn=null;const t=e;Xn.onmessage=e=>{if(Xn!==t)return;const{id:n,ok:o,result:r,error:l}=e.data,i=Zn.get(n);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Xn.onerror=e=>{var n,o;if(Xn===t)if(0!==Zn.size){try{Jn?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 Zn.entries())n.reject(new Error(`Worker error: ${e.message}`));Zn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Xn.onmessageerror=e=>{var n,o;if(Xn===t)if(0!==Zn.size){try{Jn?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(yo){}for(const[e,t]of Zn.entries())t.reject(new Error("Worker messageerror"));Zn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}},exports.setMermaidWorkerClientDebug=function(e){Jn=!!e},exports.setMermaidWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Gn=Math.floor(e))},exports.terminateWorker=lo,exports.useSmoothMarkdownStream=$t,exports.waitForKaTeXWorkerSlot=zn,Object.keys(m).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>m[e]})});
|
|
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=Math.pow,s=(e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,u=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&s(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&s(e,n,t[n]);return e},c=(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())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("stream-markdown-parser"),p=require("vue-demi"),f=require("markstream-core"),v=require("@floating-ui/dom");var h="undefined"!=typeof document?document.currentScript:null;function g(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const y=g(p);function w(e,t){if(null==e)return!1;const n=typeof e;return("object"===n||"function"===n)&&t in e}function x(e){return function(e){const t=function(e){const t="string"==typeof e?e:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}(e);return null!=t&&t<7}(function(e){var t,n,o,r,l,i,a,s,u;const c=null==(n=null==(t=null==e?void 0:e.$options)?void 0:t._base)?void 0:n.version;if("string"==typeof c&&c)return c;const d=null==(l=null==(r=null==(o=null==e?void 0:e.$root)?void 0:o.$options)?void 0:r._base)?void 0:l.version;if("string"==typeof d&&d)return d;if(w(e,"$")){const t=null==(s=null==(a=null==(i=e.$)?void 0:i.appContext)?void 0:a.app)?void 0:s.version;if("string"==typeof t&&t)return t}if(w(e,"constructor")){const t=null==(u=e.constructor)?void 0:u.version;if("string"==typeof t&&t)return t}if(w(e,"version")){const t=e.version;if("string"==typeof t&&t)return t}return""}(e))}function k(e){return e.slice(2).replace(/^[A-Z]/,e=>e.toLowerCase()).replace(/([A-Z])/g,"-$1").toLowerCase()}function M(e){if(w(e,"$listeners")){const t=e.$listeners;if(t&&"object"==typeof t)return t}if(!w(e,"$attrs"))return{};const t=e.$attrs;if(!t||"object"!=typeof t)return{};const n={};for(const[o,r]of Object.entries(t))/^on[A-Z]/.test(o)&&("function"==typeof r||Array.isArray(r)&&r.every(e=>"function"==typeof e))&&(n[k(o)]=r);return n}function b(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 c=u.render;u.render=function(e,t){return s.call(t),c(e,t)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,s):[s]}return{exports:e,options:u}}const C=b(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,T=b(p.defineComponent({__name:"DefinitionListNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>x(null==n?void 0:n.proxy)?Rt:Qt),r=p.computed(()=>t.node.items.flatMap((e,n)=>[{key:`definition-term-${t.indexKey}-${n}`,tag:"dt",className:"definition-term",nodes:e.term},{key:`definition-desc-${t.indexKey}-${n}`,tag:"dd",className:"definition-desc",nodes:e.definition}]));return{__sfc:!0,props:t,instance:n,nestedRenderer:o,definitionEntries:r}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("dl",{staticClass:"definition-list"},e._l(n.definitionEntries,function(o){return t(o.tag,{key:o.key,tag:"component",class:o.className},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":o.key,nodes:o.nodes,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),1)},[],!1,null,"b089ea12",null,null).exports,N=b(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,_="__global__",D="__MARKSTREAM_VUE2_CUSTOM_COMPONENTS_STORE__",S=(()=>{const e=globalThis;if(e[D])return e[D];const t={scopedCustomComponents:{},revision:p.shallowRef(0)};return e[D]=t,t})(),I=S.revision;function j(e){const t=S.scopedCustomComponents[_]||{};if(!e)return t;const n=S.scopedCustomComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?u(u({},t),n):t:n}const E=b(p.defineComponent({__name:"FootnoteReferenceNode",props:{node:null},setup(e){const t=e,n=`#fnref--${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,"4da20e16",null,null).exports,L=function(){var e,t,n;const o=y,r=e=>"function"==typeof e&&"function"==typeof e.extend,l=[o,null==o?void 0:o.default,null==(e=null==o?void 0:o.default)?void 0:e.default,null==(n=null!=(t=null==o?void 0:o.default)?t:o)?void 0:n.default,null==o?void 0:o.Vue2,null==o?void 0:o.Vue];for(const a of l){const e=r(a)?a:r(null==a?void 0:a.default)?a.default:null;if(e)try{const t=new e;if("function"==typeof t.$createElement)return t.$createElement.bind(t)}catch(i){}}return null}();function B(e,t,n,o){if(e)return e(t,n,o);try{return p.h(t,n,o)}catch(r){}try{return p.h(t,n,o)}catch(r){}return L?L(t,n,o):null}const A=(()=>{var e;try{return Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV)}catch(t){}return!1})();function O(e){A&&console.warn(e)}function z(e){return m.sanitizeHtmlAttrs(e)}function P(e,t,n=!1){const o=Object.entries(null!=t?t:{}),r=o.length>0?o.map(([e,t])=>""===t?` ${e}`:` ${e}="${t}"`).join(""):"";return n?`<${e}${r} />`:`<${e}${r}>`}function R(e,t){Array.isArray(t)?e.push(...t):null!=t&&e.push(t)}function H(e,t,n,o,a,s="safe",u=!1){const c=function(e,t){return m.isCustomHtmlComponentTag(e,t)}(e,o);if(m.BLOCKED_HTML_TAGS.has(e.toLowerCase())||!c&&m.isHtmlTagHardBlocked(e,s))return null;if(!c&&m.isHtmlTagBlocked(e,s))return u?[P(e,t,!0)]:[P(e,t),...n,`</${e}>`];const d=m.sanitizeHtmlAttrs(t,s,e);if(c){const t=o[e]||o[e.toLowerCase()],r=function(e){return m.convertHtmlAttrsToProps(e)}(d);return B(a,t,r,n.length>0?n:void 0)}{const t=d,{innerHTML:o}=t;return B(a,e,((e,t)=>{var n={};for(var o in e)l.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&r)for(var o of r(e))t.indexOf(o)<0&&i.call(e,o)&&(n[o]=e[o]);return n})(t,["innerHTML"]),n.length>0?n:void 0)}}function $(e,t){return m.hasCustomHtmlComponents(e,t)}function U(e,t,n,o="safe"){if(!e)return[];try{const r=function(e,t,n,o="safe"){const r=[],l=[];for(const i of e)if("text"===i.type)(r.length>0?r[r.length-1].children:l).push(i.content);else if("self_closing"===i.type){const e=H(i.tagName,i.attrs||{},[],t,n,o,!0);R(r.length>0?r[r.length-1].children:l,e)}else if("tag_open"===i.type)r.push({tagName:i.tagName,children:[],attrs:i.attrs});else if("tag_close"===i.type){const e=i.tagName.toLowerCase();let a=-1;for(let t=r.length-1;t>=0;t--)if(r[t].tagName.toLowerCase()===e){a=t;break}if(-1!==a)for(;r.length>a;){const i=r.pop(),s=H(i.tagName,i.attrs||{},i.children,t,n,o);r.length>0?R(r[r.length-1].children,s):R(l,s),i.tagName.toLowerCase()!==e&&r.length>a&&O(`Auto-closing unclosed tag: <${i.tagName}>`)}else O(`Ignoring closing tag with no matching opening tag: </${i.tagName}>`)}for(;r.length>0;){const e=r.pop();R(l,H(e.tagName,e.attrs||{},e.children,t,n,o)),O(`Auto-closing unclosed tag: <${e.tagName}>`)}return l}(m.tokenizeHtml(e),t,n,o);return r}catch(l){return r=l,A&&console.error("Failed to parse HTML to VNodes:",r),null}var r}const F=b(p.defineComponent({__name:"HtmlInlineNode",props:{node:null,customId:null,htmlPolicy:null},setup(e){const t=e,n=p.inject("markstreamHtmlPolicy",void 0),o=p.computed(()=>{var e,o;return null!=(o=null!=(e=t.htmlPolicy)?e:null==n?void 0:n.value)?o:"safe"}),r=p.computed(()=>j(t.customId)),l=p.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0},htmlPolicy:{type:String,default:"safe"}},render(){return U(this.content,this.customComponents,void 0,this.htmlPolicy)||[]}}),i=p.computed(()=>{const e=t.node.content;return e?"escape"===o.value?{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:t.node.loading&&!t.node.autoClosed?{mode:"text",content:e}:$(e,r.value)?{mode:"dynamic",content:e}:{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:{mode:"html",content:""}});return{__sfc:!0,props:t,inheritedHtmlPolicy:n,resolvedHtmlPolicy:o,customComponents:r,DynamicRenderer:l,renderMode:i}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return"dynamic"===n.renderMode.mode?t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading}},[t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents,"html-policy":n.resolvedHtmlPolicy}})],1):"text"===n.renderMode.mode?t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading}},[e._v(e._s(n.renderMode.content))]):t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading},domProps:{innerHTML:e._s(n.renderMode.content)}})},[],!1,null,"e6ed4c9f",null,null).exports,Y=b(p.defineComponent({__name:"InlineCodeNode",props:{node:null},setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>{var e,t;return null!=(t=null==(e=null==n?void 0:n.proxy)?void 0:e.$attrs)?t:{}}),r=p.inject("markstreamFade",void 0),l=p.inject("markstreamTextStreamState",void 0),i=p.computed(()=>{const e=o.value.fade;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),a=p.computed(()=>"boolean"==typeof i.value?i.value:"boolean"!=typeof(null==r?void 0:r.value)||r.value),s=p.computed(()=>{var e;const t=null!=(e=o.value["index-key"])?e:o.value.indexKey;return null==t||""===t?"":String(t)}),u=p.ref(t.node.code),c=p.ref(""),d=p.ref(0);function m(){return u.value+c.value}function v(e){u.value=e,c.value=""}p.watch([()=>t.node.code,s,a],([e])=>{const t=String(null!=e?e:""),n=m(),o=s.value,r=o?null==l?void 0:l.get(o):void 0,i=null!=r?r:n,p=f.resolveStreamingTextState({nextContent:t,previousContent:i,typewriterEnabled:a.value});u.value=p.settledContent,c.value=p.streamedDelta,p.appended&&(d.value+=1),o&&(null==l||l.set(o,t))},{immediate:!0}),p.watch(a,e=>{e||v(m())});const h=p.computed(()=>d.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return{__sfc:!0,props:t,instance:n,attrs:o,inheritedFade:r,inheritedTextStreamState:l,explicitFade:i,fadeEnabled:a,streamStateKey:s,settledCode:u,streamedDelta:c,streamFadeVersion:d,getRenderedContent:m,setFullContent:v,settleStreamedDelta:function(){c.value&&(u.value=m(),c.value="")},streamedDeltaClass:h}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("code",{staticClass:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},[n.settledCode?t("span",[e._v(e._s(n.settledCode))]):e._e(),n.streamedDelta?t("span",{staticClass:"inline-code-stream-delta",class:[n.streamedDeltaClass],on:{animationend:n.settleStreamedDelta}},[e._v(" "+e._s(n.streamedDelta)+" ")]):e._e()])},[],!1,null,"820dbd10",null,null).exports,W=p.ref(!1),K=p.ref(""),V=p.ref("top"),Q=p.ref(null),X=p.ref(null),q=p.ref(null),Z=p.ref(null),G=p.ref(null);let J=null,ee=null;function te(){J&&(clearTimeout(J),J=null),ee&&(clearTimeout(ee),ee=null)}let ne=!1,oe=null;function re(){return ne||"undefined"==typeof document?Promise.resolve():oe||(oe=Promise.resolve().then(()=>uo).then(e=>{var t;ne=!0;const n=null!=(t=null==e?void 0:e.default)?t:e,o=document.createElement("div");o.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(o);const r=function(){var e,t,n,o;const r=y,l=e=>"function"==typeof e&&"function"==typeof e.extend,i=[r,null==r?void 0:r.default,null==(e=null==r?void 0:r.default)?void 0:e.default,null==(n=null!=(t=null==r?void 0:r.default)?t:r)?void 0:n.default,null==r?void 0:r.Vue2,null==r?void 0:r.Vue];for(const a of i){if(l(a))return a;if(l(null==a?void 0:a.default))return a.default}return null!=(o=null==r?void 0:r.default)?o:r}();(new(r.extend({render(e){var t;return e(n,{props:{visible:W.value,anchorEl:Q.value,content:K.value,placement:V.value,id:X.value,originX:q.value,originY:Z.value,isDark:null!=(t=G.value)?t:void 0}})}}))).$mount(o)}).catch(e=>{oe=null,ne=!1,console.warn("[markstream-vue2] Failed to load Tooltip component. Tooltips will be disabled.",e)}),oe)}function le(e,t,n="top",o=!1,r,l){if(!e)return;re(),te();const i=()=>{var o,i;X.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Q.value=e,K.value=t,V.value=n,q.value=null!=(o=null==r?void 0:r.x)?o:null,Z.value=null!=(i=null==r?void 0:r.y)?i:null,G.value="boolean"==typeof l?l:null,W.value=!0;try{e.setAttribute("aria-describedby",X.value)}catch(a){}};o?i():J=setTimeout(i,80)}function ie(e=!1){te();const t=()=>{if(Q.value&&X.value)try{Q.value.removeAttribute("aria-describedby")}catch(e){}W.value=!1,Q.value=null,X.value=null,q.value=null,Z.value=null};e?t():ee=setTimeout(t,120)}const ae={"common.copy":"Copy","common.copied":"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.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},se=e=>{var t;return null!=(t=ae[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)};function ue(){try{const n=globalThis.$vueI18nUse||null;if(n&&"function"==typeof n)try{const t=n();if(t&&"function"==typeof t.t)return e={t:t.t.bind(t),te:"function"==typeof t.te?t.te.bind(t):void 0},{t(t){if(e.te&&ae[t]&&!e.te(t))return se(t);const n=e.t(t);return n===t&&ae[t]?se(t):n}}}catch(t){}}catch(t){}var e;return{t:se}}const ce=b(p.defineComponent({__name:"ImageNode",props:{node:null,fallbackSrc:{default:""},lazy:{type:Boolean,default:!0},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(""),i=p.ref("primary"),a=p.computed(()=>m.sanitizeImageSrc(n.node.src)),s=p.computed(()=>m.sanitizeImageSrc(n.fallbackSrc)),u=p.computed(()=>l.value),c=p.computed(()=>!n.node.loading&&"failed"!==i.value&&l.value.length>0),d=p.computed(()=>!n.node.loading&&"failed"===i.value),{t:f}=ue();return p.watch([a,s,()=>n.node.loading],()=>(o.value=!1,r.value=!1,n.node.loading||a.value?(l.value=a.value,void(i.value="primary")):s.value?(l.value=s.value,void(i.value="fallback")):(l.value="",i.value="failed",void(r.value=!0))),{immediate:!0}),{__sfc:!0,props:n,emit:t,imageLoaded:o,hasError:r,activeSrc:l,imageStage:i,safeNodeSrc:a,safeFallbackSrc:s,displaySrc:u,showImage:c,showError:d,handleImageError:function(){if("primary"===i.value&&s.value&&s.value!==l.value)return i.value="fallback",l.value=s.value,o.value=!1,void(r.value=!1);i.value="failed",r.value=!0,t("error",l.value)},handleImageLoad:function(){o.value=!0,r.value=!1,t("load",u.value)},handleClick:function(e){e.preventDefault(),o.value&&!r.value&&t("click",[e,u.value])},t:f}}}),function(){var e,t,n,o,r,l=this,i=l._self._c,a=l._self._setupProxy;return i("transition",{attrs:{name:"img-switch",mode:"out-in"}},[a.showImage?i("img",{key:"image",staticClass:"image-node__img h-auto rounded-lg transition-opacity duration-200 ease-in-out image-node__img--inline",class:{"opacity-0":!a.imageLoaded,"opacity-100":a.imageLoaded,"cursor-pointer":a.imageLoaded},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}}):l.node.loading&&!a.hasError?i("span",{key:"placeholder",staticClass:"placeholder-layer placeholder-layer--inline inline-flex items-center justify-center gap-2"},[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})]:[i("span",{staticClass:"text-sm text-gray-500"},[l._v(l._s(l.node.raw))])]],2):a.showError?i("span",{key:"error",staticClass:"image-node__error image-node__error--inline 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})],2):l._e()])},[],!1,null,"05ffe4c4",null,null).exports;let de=null,me=!1,pe=he;function fe(e){var t;const n=null!=(t=null==e?void 0:e.default)?t:e;return n&&"function"==typeof n.renderToString?n:null}function ve(){try{const e=globalThis;return fe(null==e?void 0:e.katex)}catch(e){return null}}function he(){return(()=>d(this,null,function*(){const e=ve();if(e)return e;const t=yield import("katex");try{yield Promise.resolve().then(()=>require("./chunks/mhchem-4785e7bc.cjs"))}catch(n){}return fe(t)}))()}function ge(e){pe=e,de=null,me=!1}function ye(){return"function"==typeof pe}function we(){return d(this,null,function*(){var e;const t=ve();if(t)return de=t,de;if(de)return de;if(me)return null;const n=pe;if(!n)return me=!0,null;try{const t=yield n();if(t)return de=null!=(e=fe(t))?e:t,de}catch(o){}return me=!0,null})}const xe=p.shallowRef(!1);let ke=null;const Me=b(p.defineComponent({__name:"TextNode",props:{node:null},emits:["copy"],setup(e){const t=e,n=(ke||(ke=we().then(e=>{xe.value=!!e}).catch(()=>{xe.value=!1})),p.readonly(xe)),o=p.getCurrentInstance(),r=p.computed(()=>{var e,t;return null!=(t=null==(e=null==o?void 0:o.proxy)?void 0:e.$attrs)?t:{}}),l=p.inject("markstreamFade",void 0),i=p.inject("markstreamTextStreamState",void 0),a=p.inject("markstreamStreamVersion",void 0),s=p.computed(()=>{const e=r.value.fade;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),u=p.computed(()=>"boolean"==typeof s.value?s.value:"boolean"!=typeof(null==l?void 0:l.value)||l.value),c=p.computed(()=>{var e;const t=null!=(e=r.value["index-key"])?e:r.value.indexKey;return null==t||""===t?"":String(t)}),d=p.ref(t.node.content),m=p.ref(""),v=p.ref(0);function h(){return d.value+m.value}function g(e){d.value=e,m.value=""}function y(){m.value&&(d.value=h(),m.value="")}p.watch([()=>t.node.content,c,u,()=>null==a?void 0:a.value],([e])=>{const t=String(null!=e?e:""),n=h(),o=c.value,r=o?null==i?void 0:i.get(o):void 0,l=null!=r?r:n;if(!u.value)return g(t),void(o&&(null==i||i.set(o,t)));if(t===l)return m.value?y():n!==t&&g(t),void(o&&(null==i||i.set(o,t)));const a=f.resolveStreamingTextState({nextContent:t,previousContent:l,typewriterEnabled:u.value});d.value=a.settledContent,m.value=a.streamedDelta,a.appended&&(v.value+=1),o&&(null==i||i.set(o,t))},{immediate:!0}),p.watch(u,e=>{e||g(h())});const w=p.computed(()=>v.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return{__sfc:!0,props:t,katexReady:n,instance:o,attrs:r,inheritedFade:l,inheritedTextStreamState:i,inheritedStreamVersion:a,explicitFade:s,fadeEnabled:u,streamStateKey:c,settledContent:d,streamedDelta:m,streamFadeVersion:v,getRenderedContent:h,setFullContent:g,settleStreamedDelta:y,streamedDeltaClass:w}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{staticClass:"whitespace-pre-wrap break-words text-node",class:[n.katexReady&&e.node.center?"text-node-center":""]},[n.settledContent?t("span",[e._v(e._s(n.settledContent))]):e._e(),n.streamedDelta?t("span",{staticClass:"text-node-stream-delta",class:[n.streamedDeltaClass],on:{animationend:n.settleStreamedDelta}},[e._v(" "+e._s(n.streamedDelta)+" ")]):e._e()])},[],!1,null,"e8e0f51e",null,null).exports;function be(e){return t=>{var n,o;return p.h(Me,c(u({},t),{node:c(u({},t.node),{content:null!=(o=t.node.raw)?o:e(String(null!=(n=t.node.content)?n:""))})}))}}function Ce(){return d(this,null,function*(){var e,t,n;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 be(e=>`$${e}$`);try{if(yield we()){const e=yield Promise.resolve().then(()=>require("./chunks/index-11432088.cjs"));return null!=(n=e.default)?n:e}}catch(o){console.warn('[markstream-vue2] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',o)}return be(e=>`$${e}$`)})}function Te(){return d(this,null,function*(){var e;try{if(yield we()){const t=yield Promise.resolve().then(()=>require("./chunks/index-fb457079.cjs"));return null!=(e=t.default)?e:t}}catch(t){console.warn('[markstream-vue2] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return be(e=>`$$${e}$$`)})}const Ne=b(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-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--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,null,null,null).exports,_e=b(p.defineComponent({__name:"SuperscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,emphasis:Be,footnote_reference:E,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,emoji:N,math_inline:Ce,reference:Ne},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 t("span",{key:`${e.indexKey||"superscript"}-${r}`,staticClass:"superscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"superscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"ef2512b4",null,null).exports,De=b(p.defineComponent({__name:"SubscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,emphasis:Be,footnote_reference:E,strikethrough:Ie,highlight:Le,insert:Ee,superscript:_e,emoji:N,math_inline:Ce,reference:Ne},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 t("span",{key:`${e.indexKey||"subscript"}-${r}`,staticClass:"subscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"subscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"3d49d031",null,null).exports,Se=b(p.defineComponent({__name:"StrongNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,emphasis:Be,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,footnote_reference:E,math_inline:Ce,reference:Ne},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,Ie=b(p.defineComponent({__name:"StrikethroughNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,emphasis:Be,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,footnote_reference:E,math_inline:Ce,reference:Ne},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,je=b(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={x:0,y:0,hasValue:!1};let o=0,r=null;function l(){if(r||"undefined"==typeof window)return;const e=e=>{"number"==typeof e.clientX&&"number"==typeof e.clientY&&(n.x=e.clientX,n.y=e.clientY,n.hasValue=!0)};window.addEventListener("pointermove",e,!0),window.addEventListener("mousemove",e,!0),r=()=>{window.removeEventListener("pointermove",e,!0),window.removeEventListener("mousemove",e,!0)}}function i(){l(),o+=1}function a(){o=Math.max(0,o-1),!o&&r&&(r(),r=null)}const s=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",s=null!=(e=t.animationOpacity)?e:.35,u=Math.max(.12,Math.min(.5*s,s));return{"--link-color":null!=(n=t.color)?n:"#0366d6","--underline-height":`${null!=(o=t.underlineHeight)?o:2}px`,"--underline-bottom":a,"--underline-opacity":String(s),"--underline-rest-opacity":String(u),"--underline-duration":`${null!=(r=t.animationDuration)?r:1.6}s`,"--underline-timing":null!=(l=t.animationTiming)?l:"ease-in-out","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),c={text:Me,strong:Se,strikethrough:Ie,emphasis:Be,image:ce,html_inline:F},d=p.useAttrs(),f=p.computed(()=>{var e,n;const o=null==(e=t.node)?void 0:e.attrs;if(!o||"object"!=typeof o)return{};const r={};if(Array.isArray(o))for(const t of o)Array.isArray(t)&&t[0]&&(r[String(t[0])]=String(null!=(n=t[1])?n:""));else for(const[t,l]of Object.entries(o))t&&null!=l&&!1!==l&&(r[t]=!0===l?"":String(l));return z(r)}),v=p.ref(null),h=p.ref(!1),g=p.computed(()=>{const e=u(u({},d),f.value);return delete e.title,delete e.href,delete e.target,delete e.rel,e}),y=p.computed(()=>{var e,n;return z({href:String(null!=(n=null==(e=t.node)?void 0:e.href)?n:"")}).href}),w=p.computed(()=>m.shouldOpenLinkInNewTab(y.value));function x(){var e,n;return(null==(e=t.node)?void 0:e.title)||y.value||(null==(n=t.node)?void 0:n.text)||""}function k(e){if(!e||!n.hasValue)return!1;const t=e.getBoundingClientRect();return n.x>=t.left&&n.x<=t.right&&n.y>=t.top&&n.y<=t.bottom}function M(){t.showTooltip&&v.value&&k(v.value)&&(h.value=!0,le(v.value,x(),"top",!0,{x:n.x,y:n.y}))}const b=p.computed(()=>{var e,n;const o=null==(e=t.node)?void 0:e.title;return"string"==typeof o&&o.trim().length>0?o:String(null!=(n=y.value)?n:"")});return p.onMounted(()=>{i(),t.showTooltip&&re(),p.nextTick(()=>{M()})}),p.onUpdated(()=>{M()}),p.onBeforeUnmount(()=>{a(),h.value&&(h.value=!1,ie(!0))}),{__sfc:!0,props:t,lastPointerPosition:n,pointerTrackerRefCount:o,pointerTrackerCleanup:r,ensurePointerTracker:l,retainPointerTracker:i,releasePointerTracker:a,cssVars:s,nodeComponents:c,attrs:d,nodeAttrs:f,anchorEl:v,isHovering:h,anchorAttrs:g,safeHref:y,openInNewTab:w,getTooltipText:x,isPointerInsideAnchor:k,syncTooltipForHoveredAnchor:M,onAnchorEnter:function(e){if(!t.showTooltip)return;h.value=!0;const 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;le(v.value||e.currentTarget,x(),"top",!0,o)},onAnchorLeave:function(){t.showTooltip&&(h.value=!1,ie())},title:b,TextNode:Me}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return n.node.loading?o("span",n._b({staticClass:"link-loading inline-flex items-baseline gap-1.5",style:r.cssVars,attrs:{"aria-hidden":n.node.loading?"false":"true"}},"span",r.attrs,!1),[o("span",{staticClass:"link-text-wrapper relative inline-flex"},[o("span",{staticClass:"leading-[normal] link-text"},[o(r.TextNode,{staticClass:"leading-[normal] link-text",attrs:{node:{type:"text",content:String(null!=(e=n.node.text)?e:""),raw:String(null!=(t=n.node.text)?t:"")},"index-key":`${n.indexKey||"link-text"}-loading`}})],1),o("span",{staticClass:"link-loading-indicator",attrs:{"aria-hidden":"true"}})])]):o("a",n._b({ref:"anchorEl",staticClass:"link-node",style:r.cssVars,attrs:{href:r.safeHref,title:n.showTooltip?"":r.title,"aria-label":`Link: ${r.title}`,"aria-hidden":n.node.loading?"true":"false",target:r.openInNewTab?"_blank":void 0,rel:r.openInNewTab?"noopener noreferrer":void 0},on:{mouseenter:e=>r.onAnchorEnter(e),mouseleave:r.onAnchorLeave}},"a",r.anchorAttrs,!1),n._l(n.node.children,function(e,t){return o(r.nodeComponents[e.type],{key:`${n.indexKey||"emphasis"}-${t}`,tag:"component",attrs:{node:e,"custom-id":r.props.customId,"index-key":`${n.indexKey||"link-text"}-${t}`}})}),1)},[],!1,null,"636cac94",null,null).exports,Ee=b(p.defineComponent({__name:"InsertNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,emphasis:Be,strikethrough:Ie,highlight:Le,subscript:De,superscript:_e,emoji:N,footnote_reference:E,math_inline:Ce,reference:Ne},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,Le=b(p.defineComponent({__name:"HighlightNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,emphasis:Be,strikethrough:Ie,insert:Ee,subscript:De,superscript:_e,emoji:N,footnote_reference:E,math_inline:Ce,reference:Ne},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,Be=b(p.defineComponent({__name:"EmphasisNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,html_inline:F,strong:Se,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,footnote_reference:E,math_inline:Ce,reference:Ne},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,Ae=b(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 hover:underline cursor-pointer",attrs:{href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`},on:{click:n.scrollToReference}},[e._v(" ↩︎ ")])},[],!1,null,"4a90fe82",null,null).exports,Oe=b(p.defineComponent({__name:"FootnoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>x(null==n?void 0:n.proxy)?Rt:Qt);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2",attrs:{id:`fnref--${e.node.id}`}},[t("div",{staticClass:"flex-1"},[t(n.nestedRenderer,{tag:"component",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,ze=b(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,Pe=b(p.defineComponent({__name:"HeadingNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=j(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:u({text:Me,inline_code:Y,link:je,image:ce,strong:Se,emphasis:Be,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,checkbox:C,checkbox_input:C,footnote_reference:E,hardbreak:ze,math_inline:Ce,reference:Ne},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(`h${e.node.level}`,e._b({tag:"component",staticClass:"heading-node",class:[`heading-${e.node.level}`],attrs:{dir:"auto"}},"component",e.node.attrs,!1),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,"ffb7cf51",null,null).exports,Re=b(p.defineComponent({__name:"ListItemNode",props:{node:null,item:null,indexKey:null,value:null,customId:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},setup(e){const t=e,n=p.computed(()=>{var e;return null!=(e=t.node)?e:t.item}),o=p.computed(()=>null==t.value?{}:{value:t.value}),r=p.getCurrentInstance(),l=p.computed(()=>x(null==r?void 0:r.proxy)?Rt:Qt);return{__sfc:!0,props:t,itemNode:n,liValueAttr:o,instance:r,nestedRenderer:l}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return o("li",n._b({staticClass:"list-item pl-1.5 my-2",attrs:{dir:"auto"}},"li",r.liValueAttr,!1),[o(r.nestedRenderer,n._b({tag:"component",attrs:{"index-key":`list-item-${r.props.indexKey}`,nodes:null!=(t=null==(e=r.itemNode)?void 0:e.children)?t:[],"custom-id":r.props.customId,typewriter:r.props.typewriter,"batch-rendering":!1},on:{copy:function(e){return n.$emit("copy",e)}}},"component",{showTooltips:r.props.showTooltips},!1))],1)},[],!1,null,"5c58ad56",null,null).exports,He=b(p.defineComponent({__name:"ListNode",props:{node:null,customId:null,indexKey:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const{node:t,customId:n,indexKey:o,typewriter:r,showTooltips:l}=e;return{__sfc:!0,listItemComponent:p.computed(()=>(I.value,j(n).list_item||Re))}}}),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.listItemComponent,e._b({key:`${e.indexKey||"list"}-${r}`,tag:"component",attrs:{node: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)}}},"component",{showTooltips:e.showTooltips},!1))}),1)},[],!1,null,"91e6dafc",null,null).exports,$e=Symbol("ViewportPriority");function Ue(e,t){var n,o;const r="undefined"!=typeof window&&"undefined"!=typeof document,l="boolean"==typeof t?p.ref(t):t,i=r?null!=(n=window.requestIdleCallback)?n:e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16):null,a=r?null!=(o=window.cancelIdleCallback)?o:e=>window.clearTimeout(e):null;let s=null,u=null;const c=new Map,d=new Set;let m=null;function f(){if(!c.size){try{null==s||s.disconnect()}catch(e){}s=null,u=null,d.size||function(){if(null!=m){try{null==a||a(m)}catch(e){}m=null}}()}}function v(e){const t=c.get(e);if(t){if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch(n){}}try{null==s||s.unobserve(e)}catch(n){}c.delete(e),d.delete(e),f()}}function h(){i&&null==m&&d.size&&(m=i(()=>{m=null;const e=d.values().next().value;e&&(d.delete(e),v(e),d.size&&h())},{timeout:1200}))}const g=(t,n)=>{const o=p.ref(!1);let i,a=!1;const m=new Promise(e=>{i=()=>{a||(a=!0,e())}}),g=()=>{try{null==s||s.unobserve(t)}catch(e){}c.delete(t),d.delete(t),f()};if(!r||!l.value)return o.value=!0,i(),{isVisible:o,whenVisible:m,destroy:g};const y=function(t,n){if(!r)return s;if("undefined"==typeof IntersectionObserver)return null;const o=function(t,n){var o,r,l;return{root:null!=(o=null==e?void 0:e(null!=t?t:null))?o:null,rootMargin:null!=(r=null==n?void 0:n.rootMargin)?r:"300px",threshold:null!=(l=null==n?void 0:n.threshold)?l:0}}(t,n);if(s&&(i=o,(l=u)&&l.root===i.root&&l.rootMargin===i.rootMargin&&l.threshold===i.threshold))return s;var l,i;if(s)try{s.disconnect()}catch(a){}s=new IntersectionObserver(e=>{for(const t of e)(t.isIntersecting||t.intersectionRatio>0)&&v(t.target)},{root:o.root,rootMargin:o.rootMargin,threshold:o.threshold}),u=o;for(const e of c.keys())s.observe(e);return s}(t,n);return y?(c.set(t,{resolve:i,visible:o}),y.observe(t),d.add(t),h(),{isVisible:o,whenVisible:m,destroy:g}):(o.value=!0,i(),{isVisible:o,whenVisible:m,destroy:g})};return p.provide($e,g),g}function Fe(){var e,t;const n=p.inject($e,void 0);if(n)return n;const o=new WeakMap;let r=null;const l=new Set;let i=null;const a="undefined"!=typeof window?null!=(e=window.requestIdleCallback)?e:e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16):null,s="undefined"!=typeof window?null!=(t=window.cancelIdleCallback)?t:e=>window.clearTimeout(e):null,u=()=>{if(null!=i){try{null==s||s(i)}catch(e){}i=null}},c=e=>{const t=o.get(e);if(t){if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch(n){}}try{null==r||r.unobserve(e)}catch(n){}o.delete(e),l.delete(e),l.size||u()}},d=()=>{a&&null==i&&l.size&&(i=a(()=>{i=null;const e=l.values().next().value;e&&(l.delete(e),c(e),l.size&&d())},{timeout:1200}))};return e=>{const t=p.ref(!1);let n,i=!1;const a=new Promise(e=>{n=()=>{i||(i=!0,e())}}),s=()=>{try{null==r||r.unobserve(e)}catch(t){}o.delete(e),l.delete(e),l.size||u()},m=r||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(r=new IntersectionObserver(e=>{for(const t of e)(t.isIntersecting||t.intersectionRatio>0)&&c(t.target)},{root:null,rootMargin:"300px",threshold:0}),r));return m?(o.set(e,{resolve:n,visible:t}),m.observe(e),l.add(e),d(),{isVisible:t,whenVisible:a,destroy:s}):(t.value=!0,n(),{isVisible:t,whenVisible:a,destroy:s})}}const Ye=new Map,We=new Set(["admonition","blockquote","checkbox","checkbox_input","code_block","definition_item","definition_list","emoji","emphasis","footnote","footnote_reference","footnote_anchor","hardbreak","heading","highlight","html_block","html_inline","image","inline_code","insert","link","list","list_item","math_block","math_inline","paragraph","reference","strikethrough","strong","subscript","superscript","table","table_cell","table_row","text","thematic_break"]);function Ke(e,t={}){return Qe(e,Ve(t))}function Ve(e){var t;const n=m.normalizeCustomHtmlTags(e.customHtmlTags),o=`${e.cacheKey||"markstream-vue2-nested-html"}::${n.join(",")}`;let r=Ye.get(o);return r||(r=m.getMarkdown(o,{customHtmlTags:n}),Ye.set(o,r)),{markdown:r,options:{allowHtml:!1!==e.allowHtml,htmlPolicy:null!=(t=e.htmlPolicy)?t:"safe",customNodeTag:m.normalizeCustomHtmlTagName(e.customNodeTag)||"div",customNodeClass:e.customNodeClass}}}function Qe(e,t){return(Array.isArray(e)?e:[]).map(e=>Xe(e,t)).join("")}function Xe(e,t){if(!e||"object"!=typeof e)return"";switch(e.type){case"text":return at(rt(e.content));case"paragraph":return`<p>${Qe(ot(e.children),t)}</p>`;case"strong":return`<strong>${Qe(ot(e.children),t)}</strong>`;case"emphasis":return`<em>${Qe(ot(e.children),t)}</em>`;case"strikethrough":return`<del>${Qe(ot(e.children),t)}</del>`;case"highlight":return`<mark>${Qe(ot(e.children),t)}</mark>`;case"insert":return`<ins>${Qe(ot(e.children),t)}</ins>`;case"subscript":return`<sub>${Qe(ot(e.children),t)}</sub>`;case"superscript":return`<sup>${Qe(ot(e.children),t)}</sup>`;case"inline_code":return`<code>${at(rt(e.code))}</code>`;case"hardbreak":return"<br>";case"link":return function(e,t){const n=rt(e.href),o=rt(e.title),r=ot(e.children).length>0?Qe(ot(e.children),t):at(rt(e.text||n)),l=o?` title="${st(o)}"`:"",i=n&&!m.isUnsafeHtmlUrl(n)?n:"";return`<a${i?` href="${st(i)}"`:""}${l}${m.shouldOpenLinkInNewTab(i)?' target="_blank" rel="noreferrer noopener"':""}>${r}</a>`}(e,t);case"image":return function(e){const t=m.sanitizeImageSrc(e.src);if(!t)return"";const n=rt(e.alt),o=rt(e.title),r=o?` title="${st(o)}"`:"";return`<img src="${st(t)}" alt="${st(n)}"${r}>`}(e);case"list":return function(e,t){const n=e.ordered?"ol":"ul";return`<${n}${e.ordered&&Number.isFinite(e.start)?` start="${Number(e.start)}"`:""}>${Qe(ot(e.items),t)}</${n}>`}(e,t);case"list_item":return`<li>${Qe(ot(e.children),t)}</li>`;case"blockquote":return`<blockquote>${Qe(ot(e.children),t)}</blockquote>`;case"heading":return function(e,t){const n=function(e){const t=Math.trunc(Number(e)||1);return Math.min(6,Math.max(1,t))}(e.level);return`<h${n}>${Qe(ot(e.children),t)}</h${n}>`}(e,t);case"code_block":return function(e){const t=it(rt(e.language));return`<pre><code${t?` class="language-${t}"`:""}>${at(rt(e.code))}</code></pre>`}(e);case"thematic_break":return"<hr>";case"table":return function(e,t){const n=e.header?qe(e.header,t,!0):"",o=Qe(ot(e.rows),t);return`<table>${n?`<thead>${n}</thead>`:""}${o?`<tbody>${o}</tbody>`:""}</table>`}(e,t);case"table_row":return qe(e,t);case"table_cell":return Ze(e,t);case"definition_list":return function(e,t){return`<dl>${ot(e.items).map(e=>Ge(e,t)).join("")}</dl>`}(e,t);case"definition_item":return Ge(e,t);case"footnote":return function(e,t){return`<div id="fnref--${st(rt(e.id))}" class="footnote-node markstream-nested-footnote"><div class="footnote-node__content">${Qe(ot(e.children),t)}</div></div>`}(e,t);case"footnote_reference":return function(e){const t=at(rt(e.id)),n=st(rt(e.id));return`<sup id="fnref-${n}" class="footnote-reference markstream-nested-footnote-ref"><span href="#fnref--${n}" title="查看脚注 ${n}" class="footnote-link cursor-pointer">[${t}]</span></sup>`}(e);case"footnote_anchor":return function(e){const t=st(rt(e.id));return`<a class="footnote-anchor" href="#fnref-${t}" title="返回引用 ${t}" aria-label="返回引用 ${t}">↩︎</a>`}(e);case"admonition":return function(e,t){const n=it(rt(e.kind||"note"))||"note";var o;return`<div class="markstream-nested-admonition markstream-nested-admonition--${n}"><div class="markstream-nested-admonition__title">${at(rt(e.title)||((o=n)?`${o[0].toUpperCase()}${o.slice(1)}`:""))}</div><div class="markstream-nested-admonition__content">${Qe(ot(e.children),t)}</div></div>`}(e,t);case"checkbox":case"checkbox_input":return`<input type="checkbox" disabled${e.checked?" checked":""}>`;case"emoji":return at(rt(e.raw||e.markup||e.content||e.name));case"math_inline":return`<span class="markstream-nested-math" data-display="inline">${at(rt(e.content||e.markup||e.raw))}</span>`;case"math_block":return`<pre class="markstream-nested-math-block"><code>${at(rt(e.content||e.markup||e.raw))}</code></pre>`;case"reference":return`<sup class="markstream-nested-reference">[${at(rt(e.id))}]</sup>`;case"html_inline":case"html_block":return function(e,t){const n=rt(e.content)||rt(e.raw),o=rt(e.tag).trim().toLowerCase(),r=ot(e.children);return t.options.allowHtml?"escape"===t.options.htmlPolicy||e.loading&&!e.autoClosed?at(n):o&&r.length>0&&!m.NON_STRUCTURING_HTML_TAGS.has(o)&&!m.isHtmlTagBlocked(o,t.options.htmlPolicy)?`<${o}${nt(e.attrs)}>${Qe(r,t)}</${o}>`:m.sanitizeHtmlContent(n,t.options.htmlPolicy):at(n)}(e,t);default:return function(e,t){const n=rt(e.tag||e.type);if(!n||We.has(n))return at(rt(e.content||e.raw));const o=["markstream-nested-custom",`markstream-nested-custom--${it(n)||"node"}`,et(e,t.options.customNodeClass)].filter(Boolean).join(" "),r=nt(e.attrs,o),l=function(e,t){const n=ot(e.children);if(n.length>0)return Qe(n,t);const o=rt(e.content);return o?Je(o,t):at(rt(e.raw))}(e,t),i=t.options.customNodeTag;return`<${i}${r} data-markstream-custom-tag="${st(n)}">${l}</${i}>`}(e,t)}}function qe(e,t,n=!1){return`<tr>${ot(e.cells).map(e=>Ze(e,t,n)).join("")}</tr>`}function Ze(e,t,n=!1){const o=n||e.header?"th":"td",r=rt(e.align);return`<${o}${r?` style="text-align:${st(r)}"`:""}>${Qe(ot(e.children),t)}</${o}>`}function Ge(e,t){return`<dt>${Qe(ot(e.term),t)}</dt><dd>${Qe(ot(e.definition),t)}</dd>`}function Je(e,t){return e?t.markdown.render(e):""}function et(e,t){return t?tt("function"==typeof t?t(e):t):""}function tt(e){return Array.isArray(e)?e.map(e=>tt(e)).filter(Boolean).join(" "):"string"==typeof e?e.trim():""}function nt(e,t=""){const n=function(e){if(!e)return[];if(Array.isArray(e)){if(0===e.length)return[];const t=e[0];return Array.isArray(t)?e.map(([e,t])=>[String(e),t]):e.map(e=>[String(e.name),e.value])}return Object.entries(e).map(([e,t])=>[e,t])}(e),o=[],r=[t];for(const[i,a]of n){const e=String(i).trim(),t=e.toLowerCase();e&<(e)&&(m.DANGEROUS_HTML_ATTRS.has(t)||!0!==a&&m.URL_HTML_ATTRS.has(t)&&a&&m.isUnsafeHtmlUrl(String(a),{attrName:t})||("class"!==t?!0===a?o.push(` ${e}`):o.push(` ${e}="${st(String(a))}"`):r.push(String(a))))}const l=r.map(e=>e.trim()).filter(Boolean).join(" ");return l&&o.unshift(` class="${st(l)}"`),o.join("")}function ot(e){return Array.isArray(e)?e.filter(e=>!!e&&"object"==typeof e):[]}function rt(e){return"string"==typeof e?e:null==e?"":String(e)}function lt(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function it(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function at(e){return rt(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function st(e){return at(e).replace(/`/g,"`")}const ut=b(p.defineComponent({__name:"HtmlBlockNode",props:{node:null,customId:null,htmlPolicy:null},setup(e){const t=e,n=p.inject("markstreamHtmlPolicy",void 0),o=p.computed(()=>{var e,o;return null!=(o=null!=(e=t.htmlPolicy)?e:null==n?void 0:n.value)?o:"safe"}),r=p.computed(()=>{const e=m.sanitizeHtmlTokenAttrs(t.node.attrs,o.value);if(!e)return;const n=m.tokenAttrsToRecord(e);return Object.keys(n).length>0?n:void 0}),l=p.computed(()=>{const e=String(t.node.tag||"").trim(),n=m.sanitizeHtmlTokenAttrs(t.node.attrs,o.value,e);if(!n)return;const r=m.tokenAttrsToRecord(n);return Object.keys(r).length>0?r:void 0}),i=p.computed(()=>j(t.customId)),a=p.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0},htmlPolicy:{type:String,default:"safe"}},render(){return U(this.content,this.customComponents,void 0,this.htmlPolicy)||[]}}),s=p.computed(()=>Array.isArray(t.node.children)?t.node.children:[]),u=p.computed(()=>String(t.node.tag||"div")),c=p.computed(()=>{const e=u.value.trim().toLowerCase();return m.NON_STRUCTURING_HTML_TAGS.has(e)||m.isHtmlTagBlocked(e,o.value)}),d=p.computed(()=>0===s.value.length||!t.node.tag||c.value?"":Ke(s.value,{htmlPolicy:o.value})),f=p.computed(()=>{if(s.value.length>0&&t.node.tag&&!c.value)return{mode:"structured"};const e=t.node.content;return e?"escape"===o.value?{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:$(e,i.value)?{mode:"dynamic",content:e}:{mode:"html",content:m.sanitizeHtmlContent(e,o.value)}:{mode:"html",content:""}}),v=p.ref(null),h=p.ref("undefined"==typeof window),g=p.ref(t.node.content),y=Fe();let w=null;const x=!!t.node.loading;return"undefined"!=typeof window?(p.watch(v,e=>{var n;if(null==(n=null==w?void 0:w.destroy)||n.call(w),w=null,!x)return h.value=!0,void(g.value=t.node.content);if(!e)return void(h.value=!1);const o=y(e,{rootMargin:"400px"});w=o,h.value=o.isVisible.value,o.whenVisible.then(()=>{h.value=!0})},{immediate:!0}),p.watch(()=>t.node.content,e=>{x&&!h.value||(g.value=e)})):h.value=!0,p.onBeforeUnmount(()=>{var e;null==(e=null==w?void 0:w.destroy)||e.call(w),w=null}),{__sfc:!0,props:t,inheritedHtmlPolicy:n,resolvedHtmlPolicy:o,boundAttrs:r,structuredBoundAttrs:l,customComponents:i,DynamicRenderer:a,structuredChildren:s,structuredTag:u,isBlockedStructuredTag:c,structuredHtml:d,renderMode:f,htmlRef:v,shouldRender:h,renderContent:g,registerVisibility:y,visibilityHandle:w,isDeferred:x}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return"structured"===n.renderMode.mode&&n.shouldRender?t(n.structuredTag,e._b({ref:"htmlRef",tag:"component",staticClass:"html-block-node",domProps:{innerHTML:e._s(n.structuredHtml)}},"component",n.structuredBoundAttrs,!1)):"structured"===n.renderMode.mode?t(n.structuredTag,e._b({ref:"htmlRef",tag:"component",staticClass:"html-block-node"},"component",n.structuredBoundAttrs,!1),[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)]):t("div",{ref:"htmlRef",staticClass:"html-block-node"},[n.shouldRender?["dynamic"===n.renderMode.mode?t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents,"html-policy":n.resolvedHtmlPolicy}}):t("div",e._b({domProps:{innerHTML:e._s(n.renderMode.content)}},"div",n.boundAttrs,!1))]: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)],2)},[],!1,null,"83cd7b66",null,null).exports,ct=b(p.defineComponent({__name:"ParagraphNode",props:{node:null,customId:null,indexKey:null,customHtmlTags:null},setup(e){const t=e,n=j(t.customId);function o(e){var t;return"text"===e.type&&""===String(null!=(t=e.content)?t:"").trim()}function r(e){return"link"===e.type&&Array.isArray(e.children)?e.children.filter(e=>!o(e)):[]}function l(e){var t;const n=r(e);return 1===n.length&&"image"===(null==(t=n[0])?void 0:t.type)}const i=p.computed(()=>t.node.children.filter(e=>!o(e))),a=p.computed(()=>i.value.length>0&&i.value.every(e=>"image"===e.type||l(e))),s=p.computed(()=>new Set(m.normalizeCustomHtmlTags(t.customHtmlTags))),d=p.computed(()=>{if(!a.value||i.value.length<=1)return t.node.children;const e=[];for(let n=0;n<t.node.children.length;n++){const r=t.node.children[n];if(!o(r)){e.push(r);continue}const l=e.length>0,i=t.node.children.slice(n+1).some(e=>!o(e));l&&i&&e.push(c(u({},r),{content:" ",raw:" "}))}return e}),f=u({inline_code:Y,image:ce,link:je,hardbreak:ze,emphasis:Be,strong:Se,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,html_inline:F,html_block:ut,emoji:N,checkbox:C,math_inline:Ce,checkbox_input:C,reference:Ne,footnote_anchor:Ae,footnote_reference:E,text:Me},n);return{__sfc:!0,props:t,overrides:n,isWhitespaceText:o,getTextContent:function(e){var t;return String(null!=(t=e.content)?t:"")},getMeaningfulLinkChildren:r,isImageOnlyLink:l,meaningfulChildren:i,isMediaOnlyParagraph:a,customHtmlTagsSet:s,renderedChildren:d,getChildProps:function(e,n){var o;return{node:e,"index-key":`${null!=(o=t.indexKey)?o:"paragraph"}-${n}`,"custom-id":t.customId,"custom-html-tags":t.customHtmlTags}},nodeComponents:f,processChild:function(e){var t,n,o,r;if("html_block"===e.type||"html_inline"===e.type){const l=String(null!=(t=e.tag)?t:"").trim().toLowerCase()||m.getHtmlTagFromContent(e.content);if(l&&!s.value.has(l)&&m.shouldRenderUnknownHtmlTagAsText(null!=(n=e.content)?n:e.raw,l)){const t=String(null!=(r=null!=(o=e.content)?o:e.raw)?r:"");return{child:{type:"text",content:t,raw:t},component:Me}}}return{child:e,component:f[e.type]}}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("p",{staticClass:"paragraph-node",attrs:{dir:"auto"}},[e._l(n.renderedChildren,function(o,r){return[n.isMediaOnlyParagraph&&n.isWhitespaceText(o)?[e._v(" "+e._s(n.getTextContent(o))+" ")]:t(n.processChild(o).component,e._b({key:`${e.indexKey||"paragraph"}-${r}`,tag:"component"},"component",n.getChildProps(n.processChild(o).child,r),!1))]})],2)},[],!1,null,"3275cbf4",null,null).exports,dt=b(p.defineComponent({__name:"PreCodeNode",props:{node:null,showLineNumbers:{type:Boolean},diffInline:{type:Boolean}},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:"").split(":")[0].toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=p.computed(()=>`language-${n.value}`),r=p.computed(()=>{var e;return!0===t.showLineNumbers&&!0===(null==(e=t.node)?void 0:e.diff)}),l=p.computed(()=>r.value&&!0===t.diffInline),i=p.computed(()=>{var e,n,o,r,l,i;if(!0===(null==(e=t.node)?void 0:e.diff))return String(null!=(o=null==(n=t.node)?void 0:n.code)?o:"");const a=String(null!=(l=null==(r=t.node)?void 0:r.code)?l:"");return!0===(null==(i=t.node)?void 0:i.loading)?a:a.replace(/\r\n$|\n$|\r$/,"")}),a=p.computed(()=>{const e=n.value;return e?`Code block: ${e}`:"Code block"});function s(e){return String(null!=e?e:"").split(/\r\n|\n|\r/)}function u(e){return e.startsWith("-")&&!e.startsWith("---")}function c(e){return e.startsWith("+")&&!e.startsWith("+++")}function d(e,t,n,o){return{code:e,kind:0===String(null!=e?e:"").trim().length&&"hunk"!==t?"context":t,key:n,number:o}}function m(e=!1){var n,o,r,l,i,a,m;const p=s(null==(n=t.node)?void 0:n.code);if(!p.some(e=>u(e)||c(e))&&(null!=(null==(o=t.node)?void 0:o.originalCode)||null!=(null==(r=t.node)?void 0:r.updatedCode))){const n=s(null==(l=t.node)?void 0:l.originalCode),o=s(null==(i=t.node)?void 0:i.updatedCode);if(e){const e=Math.max(n.length,o.length),t=[];for(let r=0;r<e;r+=1){const e=null!=(a=n[r])?a:"",l=null!=(m=o[r])?m:"";e===l?t.push(d(l,"context",`inline-context-${r}`,r+1)):(r<n.length&&t.push(d(e,"removed",`inline-removed-${r}`,r+1)),r<o.length&&t.push(d(l,"added",`inline-added-${r}`,r+1)))}return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:t}]}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:n.map((e,t)=>d(e,o[t]===e?"context":"removed",`original-${t}`,t+1))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:o.map((e,t)=>d(e,n[t]===e?"context":"added",`modified-${t}`,t+1))}]}if(e){let e=1,t=1;return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:p.map((n,o)=>{if(n.startsWith("@@"))return d(n,"hunk",`inline-hunk-${o}`,"");if(u(n))return d(n.slice(1),"removed",`inline-removed-${o}`,e++);if(c(n))return d(n.slice(1),"added",`inline-added-${o}`,t++);const r=n.startsWith(" ")?n.slice(1):n;return e+=1,d(r,"context",`inline-context-${o}`,t++)})}]}const f=[],v=[];let h=1,g=1;for(const[t,s]of p.entries())if(s.startsWith("@@"))f.push(d(s,"hunk",`original-hunk-${t}`,"")),v.push(d(s,"hunk",`modified-hunk-${t}`,""));else if(u(s))f.push(d(s.slice(1),"removed",`original-removed-${t}`,h++));else if(c(s))v.push(d(s.slice(1),"added",`modified-added-${t}`,g++));else{const e=s.startsWith(" ")?s.slice(1):s;f.push(d(e,"context",`original-context-${t}`,h++)),v.push(d(e,"context",`modified-context-${t}`,g++))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:f},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:v}]}const f=p.computed(()=>r.value?m(l.value):[]);return{__sfc:!0,props:t,normalizedLanguage:n,languageClass:o,isDiffPreview:r,isInlineDiffPreview:l,displayCode:i,ariaLabel:a,splitLines:s,isRemovedDiffLine:u,isAddedDiffLine:c,toDiffLine:d,buildDiffPanes:m,diffPreviewPanes:f}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("pre",{class:[n.languageClass,{"markstream-pre--line-numbers":n.props.showLineNumbers,"markstream-pre--diff-preview":n.isDiffPreview,"markstream-pre--diff-inline":n.isInlineDiffPreview}],attrs:{"aria-busy":!0===e.node.loading,"aria-label":n.ariaLabel,"data-language":n.normalizedLanguage,"data-markstream-line-numbers":n.props.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"}},[n.isDiffPreview?t("code",{staticClass:"markstream-pre__diff-code",attrs:{translate:"no"}},e._l(n.diffPreviewPanes,function(n){return t("span",{key:n.key,staticClass:"markstream-pre__diff-pane",class:n.className},e._l(n.lines,function(n){return t("span",{key:n.key,staticClass:"markstream-pre__diff-line",class:[`markstream-pre__diff-line--${n.kind}`,{"markstream-pre__diff-line--empty":!n.code.trim()}]},[t("span",{staticClass:"markstream-pre__diff-rail",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"markstream-pre__diff-number",attrs:{"aria-hidden":"true"}},[e._v(e._s(n.number))]),t("span",{staticClass:"markstream-pre__diff-content"},[t("span",{staticClass:"markstream-pre__diff-content-inner"},[e._v(e._s(n.code))])])])}),0)}),0):t("code",{attrs:{translate:"no"},domProps:{textContent:e._s(n.displayCode)}})])},[],!1,null,null,null,null).exports,mt=b(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;return null!=(e=t.node.loading)&&e}),o=p.computed(()=>{var e;return null!=(e=t.node.rows)?e:[]}),r=p.ref(null),l=p.ref([]),i=p.getCurrentInstance(),a=p.computed(()=>x(null==i?void 0:i.proxy)?Rt:Qt);let s=null;const u=p.computed(()=>l.value.map(e=>e>0?{width:`${e}px`}:void 0)),c=p.computed(()=>l.value.length>0);function d(){var e;const t=null==(e=r.value)?void 0:e.querySelectorAll("thead th");return Array.from(null!=t?t:[],e=>Math.round(e.getBoundingClientRect().width))}function m(e){if(!s)return;e.preventDefault();const t=s.startWidth+s.nextStartWidth,n=Math.min(48,Math.floor(t/2)),o=Math.max(n,Math.min(t-n,Math.round(s.startWidth+e.clientX-s.startX))),r=[...s.widths];r[s.index]=o,r[s.index+1]=t-o,l.value=r}function f(){s&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),s=null)}return p.watch(()=>t.node.header.cells.length,()=>{f(),l.value=[]}),p.onBeforeUnmount(f),{__sfc:!0,props:t,isLoading:n,bodyRows:o,tableRef:r,columnWidths:l,instance:i,nestedRenderer:a,MIN_COLUMN_WIDTH:48,resizeState:s,columnStyles:u,hasColumnWidths:c,measureHeaderWidths:d,onColumnResizeMove:m,stopColumnResize:f,startColumnResize:function(e,t){if(0!==t.button)return;const n=d(),o=n[e],r=n[e+1];o&&r&&(t.preventDefault(),s={index:e,startX:t.clientX,startWidth:o,nextStartWidth:r,widths:n},l.value=n,window.addEventListener("pointermove",m),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f))}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"table-node-wrapper"},[t("table",{ref:"tableRef",staticClass:"my-8 text-sm table-node",class:{"table-node--loading":n.isLoading},attrs:{"aria-busy":n.isLoading}},[n.hasColumnWidths?t("colgroup",e._l(e.node.header.cells,function(e,o){return t("col",{key:`col-${o}`,style:n.columnStyles[o]})}),0):e._e(),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)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",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)}}}),r<e.node.header.cells.length-1?t("button",{staticClass:"table-node__resize-handle",attrs:{type:"button","aria-label":`Resize columns ${r+1} and ${r+2}`},on:{pointerdown:function(e){return n.startColumnResize(r,e)}}}):e._e()],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)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",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,"11208a21",null,null).exports,pt=b(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,ft=b(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,vt=b(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=j(t.customId),r=u({text:Me,paragraph:ct,heading:Pe,inline_code:Y,link:je,image:ce,strong:Se,emphasis:Be,strikethrough:Ie,insert:Ee,subscript:De,superscript:_e,checkbox:C,checkbox_input:C,hardbreak:ze,math_inline:Ce,reference:Ne,list:He,math_block:Te,table:mt},o);return{__sfc:!0,props:t,containerClass:n,overrides:o,nodeComponents:r,getNodeComponent:function(e){return r[e]||ft}}}}),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,"3cd2aff2",null,null).exports;let ht=!1,gt=null,yt=!1;function wt(){return d(this,null,function*(){var e;if(gt)return gt;if(yt)return null;try{const t=yield import("stream-monaco/legacy");return gt=null!=(e=null==t?void 0:t.default)?e:t,yield function(e){return d(this,null,function*(){if(ht)return;ht=!0;const t=null==globalThis?void 0:globalThis.MonacoEnvironment;return!t||"function"!=typeof t.getWorker&&"function"!=typeof t.getWorkerUrl?e.preloadMonacoWorkers():void 0})}(gt),(yield function(e){return d(this,null,function*(){const t=null==e?void 0:e.getOrCreateHighlighter;if("function"!=typeof t)return!0;try{const e=yield t(["vitesse-dark","vitesse-light"],["plaintext","text","javascript"]);return e&&"function"==typeof e.codeToTokens&&e.codeToTokens("const a = 1",{lang:"javascript",theme:"vitesse-dark"}),!0}catch(n){return console.warn("[markstream-vue2] Failed to warm up Shiki tokenizer; disabling stream-monaco for this session.",n),!1}})}(gt))?gt:(gt=null,yt=!0,null)}catch(t){return yt=!0,null}})}const xt='<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',kt='<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',Mt='<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';let bt=null,Ct=null,Tt=null;const Nt=p.ref(0),_t={"":Mt,plain:Mt,text:Mt,javascript:'<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',typescript:'<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',jsx:'<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',tsx:'<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',html:'<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',css:'<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',scss:'<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',json:'<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',python:'<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',ruby:'<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',go:'<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',java:'<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',kotlin:'<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',c:'<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',cpp:'<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',cs:xt,csharp:xt,php:'<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',shell:kt,powershell:kt,sql:'<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',yaml:'<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',markdown:'<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',xml:'<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',rust:'<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',vue:'<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',mermaid:'<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',svg:'<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'},Dt={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin",d:"dlang",vbnet:"vb.net"};function St(){return d(this,null,function*(){return Ct||(Tt||(Tt=Promise.resolve().then(()=>require("./chunks/languageIconExtended-4baf8bdb.cjs")).then(e=>(Ct=e.EXTENDED_LANGUAGE_ICON_MAP,Nt.value++,Ct)).catch(()=>null)),Tt)})}function It(e){bt=null!=e?e:null}function jt(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=Dt[n])?t:n}function Et(e){const t=jt(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Lt(e){if(bt){const t=bt(e);if(null!=t&&""!==t)return t}const t=jt(e),n=_t[t];if(n)return n;return(null==Ct?void 0:Ct[t])||(St(),'<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 Bt={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#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"},At=new Map;function Ot(e,t={}){if(Array.isArray(e.nodes))return e.nodes.slice();const n=e.node;if(n){const e=(o=n.children,Array.isArray(o)?o:[]);if(e.length>0)return e.slice()}var o;const r=function(e){var t;return"string"==typeof e.content?e.content:"string"==typeof(null==(t=e.node)?void 0:t.content)?e.node.content:""}(e);if(!r)return[];const l=function(e,t){var n,o;const r=null!=(n=t.parseOptions)?n:{},l=null!=(o=t.final)?o:(a=e.node)&&"object"==typeof a&&"boolean"==typeof a.loading?!a.loading:void 0,i=m.mergeCustomHtmlTags(t.customHtmlTags,r.customHtmlTags);var a;return null==l&&0===i.length?r:u(u(u({},r),null==l?{}:{final:l}),0===i.length?{}:{customHtmlTags:i})}(e,t),i=function(e){var t;const n=m.mergeCustomHtmlTags(e.customHtmlTags,null==(t=e.parseOptions)?void 0:t.customHtmlTags),o=`${e.cacheKey||"markstream-vue2-nested-nodes"}::${n.join(",")}`;let r=At.get(o);return r||(r=m.getMarkdown(o,{customHtmlTags:n}),At.set(o,r)),e.customMarkdownIt?e.customMarkdownIt(r):r}(t);return m.parseMarkdownToStructure(r,i,l)}const zt=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function Pt(e,t={}){var n;const o={},r=new Set(null!=(n=t.omit)?n:[]);if(!e||"object"!=typeof e)return o;const l=Object.getOwnPropertyDescriptors(e);for(const[i,a]of Object.entries(l))zt.has(i)||r.has(i)||a.enumerable&&"value"in a&&(o[i]=a.value);return o}const Rt=b(p.defineComponent({__name:"LegacyNodesRenderer",props:{nodes:null,customId:null,indexKey:null,typewriter:{type:Boolean,default:!1},fade:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:null,codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockProps:null,renderCodeBlocksAsPre:{type:Boolean},themes:null,langs:null,isDark:{type:Boolean},customHtmlTags:null,htmlPolicy:null},emits:["copy","handleArtifactClick","click"],setup(e,{emit:t}){const n=e;p.provide("markstreamTypewriter",p.computed(()=>!0===n.typewriter)),p.provide("markstreamFade",p.computed(()=>!1!==n.fade));const o={text:Me,paragraph:ct,heading:Pe,code_block:dt,list:He,list_item:Re,blockquote:Ht,table:mt,definition_list:T,footnote:Oe,footnote_reference:E,footnote_anchor:Ae,admonition:Xt,vmr_container:vt,hardbreak:ze,link:je,image:ce,thematic_break:pt,math_inline:Ce,math_block:Te,strong:Se,emphasis:Be,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,checkbox:C,checkbox_input:C,inline_code:Y,html_inline:F,html_block:ut,reference:Ne},r=p.computed(()=>(I.value,j(n.customId))),l=p.computed(()=>null!=n.indexKey?String(n.indexKey):"legacy-renderer"),i=p.computed(()=>Pt(n.codeBlockProps)),a=p.computed(()=>Pt(n.codeBlockProps,{omit:["langs"]})),s=p.computed(()=>u({stream:n.codeBlockStream,darkTheme:n.codeBlockDarkTheme,lightTheme:n.codeBlockLightTheme,monacoOptions:n.codeBlockMonacoOptions,themes:n.themes,minWidth:n.codeBlockMinWidth,maxWidth:n.codeBlockMaxWidth},a.value)),d=p.computed(()=>u(c(u({},s.value),{langs:n.langs}),i.value)),v=p.computed(()=>{var e;return{typewriter:n.typewriter,fade:n.fade,htmlPolicy:null!=(e=n.htmlPolicy)?e:"safe"}}),h=p.computed(()=>u(u({},v.value),"boolean"==typeof n.showTooltips?{showTooltip:n.showTooltips}:{})),g=p.computed(()=>u(u({},v.value),"boolean"==typeof n.showTooltips?{showTooltips:n.showTooltips}:{})),y=p.computed(()=>new Set(m.normalizeCustomHtmlTags(n.customHtmlTags))),w=p.computed(()=>(Array.isArray(n.nodes)?n.nodes:[]).map((e,t)=>{var n,i,a,s;let d=e;const p=String((null==e?void 0:e.type)||"unknown"),f=x(d);let v=M(d,f);if(("html_block"===d.type||"html_inline"===d.type)&&v===o[d.type]){const e=String(null!=(n=d.tag)?n:"").trim().toLowerCase()||m.getHtmlTagFromContent(d.content);if(e)if(y.value.has(e)){const t=r.value[e];t&&(v=t,d=c(u({},d),{type:e,tag:e,content:m.stripCustomHtmlWrapper(d.content,e)}))}else if(m.shouldRenderUnknownHtmlTagAsText(null!=(i=d.content)?i:d.raw,e)){const e=String(null!=(s=null!=(a=d.content)?a:d.raw)?s:"");"html_inline"===d.type?(v=Me,d={type:"text",content:e,raw:e}):(v=ct,d={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return{index:t,indexKey:`${l.value}-${t}`,renderKey:"code_block"===p?`${l.value}-${t}-${p}`:`${l.value}-${t}-${p}-${String((null==e?void 0:e.raw)||"").length}`,node:d,isCodeBlock:"code_block"===(null==d?void 0:d.type),component:v,bindings:D(d,f,v)}}));function x(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function k(e,t){const n=t.trim().toLowerCase();if(n)for(const o of[n,jt(n),f.normalizeShikiLanguage(n)]){const t=o&&e[o];if(t)return t}}function M(e,t){if(!e)return ft;const l=r.value,i=l[String(e.type)];if("code_block"===e.type){const o=null!=t?t:x(e),r=o?k(l,o):void 0;return r||("mermaid"===o?l.mermaid||dt:"infographic"===o?l.infographic||dt:"d2"===o||"d2lang"===o?l.d2||dt:i||(l.code_block||(n.renderCodeBlocksAsPre,dt)))}return i||o[String(e.type)]||ft}function b(e){return Boolean(e&&e===r.value.code_block)}function _(e,t){return Boolean(e&&t&&e===k(r.value,t))}function D(e,t,n){const o=null!=t?t:x(e);return"code_block"===e.type&&_(n,o)?"mermaid"===o||"infographic"===o||"d2"===o||"d2lang"===o?{}:d.value:"code_block"===e.type&&b(n)?d.value:"mermaid"===o||"infographic"===o||"d2"===o||"d2lang"===o?{}:"link"===e.type?h.value:"list"===e.type?g.value:"code_block"===e.type?s.value:v.value}return{__sfc:!0,props:n,emit:t,handleCopy:function(e){t("copy",e)},handleArtifactClick:function(e){t("handleArtifactClick",e)},nodeComponents:o,customComponentsMap:r,indexPrefix:l,codeBlockExtraProps:i,builtinCodeBlockExtraProps:a,codeBlockBindings:s,customCodeBlockBindings:d,nonCodeBindings:v,linkBindings:h,listBindings:g,effectiveCustomHtmlTagsSet:y,renderedItems:w,getCodeBlockLanguage:x,getCustomCodeLanguageComponent:k,getNodeComponent:M,isCustomCodeBlockComponent:b,isCustomLanguageCodeBlockComponent:_,getBindingsFor:D,handleClick:function(e){t("click",e)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"markstream-vue2 markdown-renderer legacy-nodes-renderer",class:{dark:n.props.isDark},on:{click:n.handleClick}},e._l(n.renderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[t(o.component,e._b({key:`${o.renderKey}-component`,tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:n.handleCopy,"handle-artifact-click":n.handleArtifactClick}},"component",o.bindings,!1))],1)])}),0)},[],!1,null,null,null,null).exports,Ht=b(p.defineComponent({__name:"BlockquoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=p.getCurrentInstance(),o=p.computed(()=>x(null==n?void 0:n.proxy)?Rt:Qt);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),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.nestedRenderer,{tag:"component",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,"0bfb818f",null,null).exports;function $t(e={}){const t=p.ref(""),n=p.ref(""),o=p.ref(!1),r=f.createSmoothMarkdownStream(e),l=()=>{const e=r.getSnapshot();t.value=e.source,n.value=e.visible,o.value=e.done},i=r.subscribe(l);l();const a=p.computed(()=>Math.max(0,t.value.length-n.value.length)),s=p.computed(()=>0===a.value),u=p.computed(()=>o.value&&s.value);return p.getCurrentScope()&&p.onScopeDispose(()=>{i(),r.destroy()}),{source:t,visible:n,done:o,final:u,caughtUp:s,pendingChars:a,enqueue:e=>r.enqueue(e),finish:e=>r.finish(e),flush:()=>r.flush(),reset:e=>r.reset(e),pause:()=>r.pause(),resume:()=>r.resume()}}function Ut(e){const t="number"==typeof e?e:Number.parseFloat(String(null!=e?e:""));return Number.isFinite(t)&&t>0?t:null}function Ft(e){const t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith("%%")),n=Math.max(1,t.length),o=function(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const o=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==o?void 0:o[1])?void 0:t.toLowerCase())||""}return""}(e);return"gantt"===o?220+28*n:"sequencediagram"===o?180+26*n:"classdiagram"===o||"statediagram"===o||"erdiagram"===o?180+24*n:"flowchart"===o||"graph"===o?170+28*n:200+22*n}function Yt(e){const t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}function Wt(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}function Kt(e,t=360,n=500){return Wt(e,t,n)}function Vt(e,t=360,n=500){return Wt(e,t,n)}const Qt=b(p.defineComponent({__name:"NodeRenderer",props:{content:null,nodes:null,final:{type:Boolean},parseOptions:null,customMarkdownIt:null,debugPerformance:{type:Boolean,default:!1},customHtmlTags:null,htmlPolicy:null,viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:null,renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockProps:null,mermaidProps:null,d2Props:null,infographicProps:null,showTooltips:{type:Boolean,default:!0},themes:null,langs:null,isDark:{type:Boolean},customId:null,indexKey:null,typewriter:{type:Boolean,default:!1},fade:{type:Boolean,default:!0},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:null,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),s=/auto|scroll|overlay/i,v="undefined"!=typeof window,g=p.getCurrentInstance(),y=p.computed(()=>l.debugPerformance&&v&&"undefined"!=typeof console),w=p.computed(()=>{var e,t;return null!=(t=null==(e=null==g?void 0:g.proxy)?void 0:e.$attrs)?t:{}}),k=new Map,M=p.ref(0),b=$t(l.smoothStreamingOptions),_=p.computed(()=>{var e;if("boolean"==typeof l.showTooltips)return l.showTooltips;const t=null!=(e=w.value.showTooltips)?e:w.value["show-tooltips"];return""===t||!0===t||"true"===t||!1!==t&&"false"!==t&&void 0}),D=p.inject("markstreamHtmlPolicy",void 0),S=p.inject("markstreamSmoothStreaming",void 0),L=p.computed(()=>{var e,t;return null!=(t=null!=(e=l.htmlPolicy)?e:null==D?void 0:D.value)?t:"safe"});p.provide("markstreamShowTooltips",_),p.provide("markstreamHtmlPolicy",L),p.provide("markstreamTypewriter",p.computed(()=>!0===l.typewriter)),p.provide("markstreamFade",p.computed(()=>!1!==l.fade)),p.provide("markstreamTextStreamState",k),p.provide("markstreamStreamVersion",M);const B=p.computed(()=>{var e,t;return!1!==l.smoothStreaming&&!(null==(e=l.nodes)?void 0:e.length)&&(!0===l.smoothStreaming||!(null==S?void 0:S.value))&&(!0===l.smoothStreaming||!0===l.typewriter||(null!=(t=l.maxLiveNodes)?t:0)<=0)}),A=p.ref(!v||!0===l.smoothStreaming);p.onMounted(()=>{A.value=!0});const O=p.computed(()=>A.value&&B.value);p.provide("markstreamSmoothStreaming",O);const z=p.computed(()=>{var e;return O.value?b.visible.value:null!=(e=l.content)?e:""}),P=p.computed(()=>{var e;return null!=(e=l.content)?e:""}),R=p.computed(()=>{var e;return Boolean(null==(e=l.nodes)?void 0:e.length)||b.source.value===P.value}),H=p.computed(()=>{var e,t;const n=null!=(e=l.parseOptions)?e:{};return null!=(t=l.final)?t:n.final}),$=p.computed(()=>{const e=H.value;return O.value&&null!=e?Boolean(e&&R.value&&b.caughtUp.value):e}),U=p.computed(()=>{var e;return(null==(e=l.nodes)?void 0:e.length)?l.nodes:z.value});function W(e,t){y.value&&console.info(`[markstream-vue2][perf] ${e}`,t)}function K(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(s.test(t)||s.test(n))return r;r=r.parentElement}return null}p.watch([()=>l.content,()=>l.nodes,O,H],([e,t,n,o])=>{if(null==t?void 0:t.length)return void b.reset("");const r=null!=e?e:"";if(!n)return b.reset(r),void(o&&b.finish({flush:!0}));const l=b.source.value;r?r===l||(r.startsWith(l)?b.enqueue(r.slice(l.length)):b.reset(r)):b.reset(""),o&&b.finish()},{immediate:!0}),p.watch(U,()=>{M.value+=1},{immediate:!0});const V=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Q=m.getMarkdown(V),X=new Map,q=p.markRaw([]),Z=p.computed(()=>(I.value,j(l.customId))),G=p.computed(()=>{var e;return m.mergeCustomHtmlTags(l.customHtmlTags,null==(e=l.parseOptions)?void 0:e.customHtmlTags)}),J=p.computed(()=>{const{key:e,tags:t}=m.resolveCustomHtmlTags(G.value);if(!e)return Q;const n=X.get(e);if(n)return n;const o=m.getMarkdown(V,{customHtmlTags:t});return X.set(e,o),o}),ee=p.computed(()=>{const e=J.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function te(e){if(Array.isArray(e))return Object.freeze(e.map(e=>te(e)));if(!e||"object"!=typeof e)return e;const t={};for(const[n,o]of Object.entries(e))t[n]=te(o);return Object.freeze(t)}function ne(e){return e.map(e=>te(e))}const oe=p.computed(()=>{var e;const t=null!=(e=l.parseOptions)?e:{},n=$.value,o=G.value,r=null!=n,i=o.length>0;return r||i?u(u(u({},t),r?{final:n}:{}),i?{customHtmlTags:o}:{}):t}),re=p.computed(()=>{var e;const t=null!=(e=oe.value.customHtmlTags)?e:[];return new Set(t.map(e=>String(e).trim().toLowerCase()).filter(Boolean))}),le=p.computed(()=>{var e;if(x(null==g?void 0:g.proxy)&&!l.content&&Array.isArray(l.nodes))return q;if(null==(e=l.nodes)?void 0:e.length)return p.markRaw(ne(l.nodes));const t=z.value;if(t){const e=y.value?performance.now():0,n=m.parseMarkdownToStructure(t,ee.value,oe.value);return y.value&&W("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:t.length}),p.markRaw(ne(n))}return[]}),ie=p.computed(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),ae=p.computed(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&le.value.length>ie.value}),se=p.computed(()=>!1!==l.viewportPriority&&!a.value),ue=Ue(e=>{var t;return K(null!=(t=null!=e?e:i.value)?t:null)},se),de=v&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,me=v&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,pe="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),fe=v&&"function"==typeof window.requestIdleCallback,ve=p.computed(()=>{var e;const t=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),he=p.computed(()=>{var e;const t=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:ve.value);return Number.isFinite(t)?Math.max(0,t):ve.value}),ge=p.computed(()=>!1!==l.batchRendering&&ve.value>0&&v&&!pe),ye=p.ref(0),we=p.ref({key:l.indexKey,total:0}),xe=p.ref(Math.max(1,ve.value||1)),ke=p.reactive({}),be=new Map,$e=new Map,Fe=new Map,Ye=new WeakMap,We=p.ref(0),Ke=p.computed(()=>(We.value,Array.from(Fe.entries()).sort((e,t)=>e[0]-t[0]))),Ve=p.ref(null);let Qe=null,Xe=null;const qe=p.reactive({start:0,end:0}),Ze=p.computed(()=>{if(!ae.value)return le.value.map((e,t)=>({node:e,index:t}));const e=le.value.length,t=_t(qe.start,0,e),n=_t(qe.end,t,e);return le.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),Ge=p.computed(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!ae.value&&!(le.value.length>900)&&se.value}),Je=p.computed(()=>{var e;return ge.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),et=p.ref({batchSize:ve.value,initial:he.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:Je.value}),tt=p.computed(()=>!!ue&&(Ge.value||ae.value)),nt=p.computed(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),ot=p.ref(0),rt=new Map,lt=p.computed(()=>x(null==g?void 0:g.proxy)),it=p.computed(()=>lt.value&&!l.content&&Array.isArray(l.nodes)),at=p.computed(()=>it.value?p.markRaw(ne(l.nodes||[])):q);function st(){var e,t;const n=null==g?void 0:g.proxy;if(!n||!n.$refs)return;const o=n.$refs,r=new Set;for(const l of Ze.value){const n=ht(o[`node-slot-${l.index}`]),i=ht(o[`node-content-${l.index}`]);(null!=(e=Fe.get(l.index))?e:null)!==n&&sn(l.index,n),(null!=(t=rt.get(l.index))?t:null)!==i&&cn(l.index,i),r.add(l.index)}for(const l of Array.from(Fe.keys()))r.has(l)||sn(l,null);for(const l of Array.from(rt.keys()))r.has(l)||cn(l,null)}function ht(e){if(Array.isArray(e)){for(const t of e)if(t)return t;return null}return null!=e?e:null}const gt=p.computed(()=>{if(!ae.value)return le.value.length;const e=nt.value,t=Math.max(qe.end+e,he.value),n=Math.min(le.value.length,t);return Math.max(ye.value,n)});function yt(e){var t,n,o,r;const l=K(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 wt(e){if(!v)return!1;try{const t=window.getComputedStyle(e);return!!(t.display||"").toLowerCase().includes("flex")&&(t.flexDirection||"").toLowerCase().endsWith("reverse")}catch(t){return!1}}function xt(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(!wt(e))return u;const c=u<0?-u:u;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-c}function kt(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 Mt(){Qe&&(Qe(),Qe=null),Ve.value=null}function bt(){if(!v||!ae.value)return;const e=yt();if(!e||Ve.value===e)return;Mt();const t=()=>Tt();e.addEventListener("scroll",t,{passive:!0}),Ve.value=e,Qe=()=>{e.removeEventListener("scroll",t)}}function Ct(){var e,t,n;if(!Xe)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;Xe.viaTimeout?o?o.clearTimeout(Xe.id):clearTimeout(Xe.id):null==me||me(Xe.id),Xe=null}function Tt(e={}){var t,n,o;if(!ae.value)return;if(!v)return void Nt(!0);if(e.immediate)return Ct(),void Nt(!0);if(Xe)return;const r=()=>{Xe=null,Nt()};if(de)Xe={id:de(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);Xe={id:l,viaTimeout:!0}}}function Nt(e=!1){var t,n,o,r,l,a,s;if(!ae.value)return;const u=Ve.value||yt();if(!u)return;const c=u.ownerDocument||(null==(t=i.value)?void 0:t.ownerDocument)||document,d=(null==c?void 0:c.defaultView)||("undefined"!=typeof window?window:null),m=u===(null==c?void 0:c.documentElement)||u===(null==c?void 0:c.body),p=le.value.length;if(!m&&p>0&&wt(u)){const t=u.clientHeight||0,n=u.scrollTop,o=n<0?-n:n,r=_t(on(Math.max(0,o)+.5*Math.max(0,t)),0,Math.max(0,p-1));return void((e||Math.abs(r-ot.value)>1)&&(ot.value=r))}const f=m?null:u.getBoundingClientRect(),v=m?0:f.top,h=m?null!=(o=null!=(n=null==d?void 0:d.innerHeight)?n:u.clientHeight)?o:0:f.bottom,g=Ke.value;let y=null,w=null;for(const[i,k]of g){if(!k)continue;const e=k.getBoundingClientRect();e.bottom<=v||e.top>=h||(null==y&&(y=i),w=i)}if(null==y||null==w){const e=i.value;if(!e)return;const t=m?{top:0}:u.getBoundingClientRect(),n=xt(u,c,m),o=m?(()=>{const n=e.getBoundingClientRect(),o=(m?0:t.top)-n.top;return Math.max(0,o)})():(()=>{const t=kt(e,u);return Math.max(0,n-t)})(),p=m?null!=(s=null!=(a=null!=(l=null==d?void 0:d.innerHeight)?l:null==(r=null==c?void 0:c.documentElement)?void 0:r.clientHeight)?a:u.clientHeight)?s:0:u.clientHeight,f=nn(o+.5*Math.max(0,p));return void(ot.value=_t(f,0,Math.max(0,le.value.length-1)))}const x=Math.round((y+w)/2);!e&&Math.abs(x-ot.value)<=1||(ot.value=_t(x,0,Math.max(0,le.value.length-1)))}function _t(e,t,n){return Math.min(Math.max(e,t),n)}function Dt(){const e=le.value.length;if(!ae.value||0===e)return qe.start=0,void(qe.end=e);const t=Math.min(ie.value,e),n=nt.value,o=_t(ot.value-n,0,Math.max(0,e-t));qe.start=o,qe.end=Math.min(e,o+t)}const St=p.reactive({}),It=p.reactive({total:0,count:0}),Et=p.ref(0),Lt=p.ref([]),Bt=p.ref([]);function At(){for(const e of Object.keys(St))delete St[Number(e)];It.total=0,It.count=0,Et.value=0,Lt.value=[],Bt.value=[]}function Ot(e){if(e<=0)return void At();let t=0,n=0;for(const[o,r]of Object.entries(St)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0?delete St[l]:(t+=i,n++)}It.total=t,It.count=n}function zt(e,t,n){for(let o=t+1;o<e.length;o+=o&-o)e[o]+=n}function Wt(e,t){let n=0;for(let o=t+1;o>0;o-=o&-o)n+=e[o];return n}function Qt(e,t,n){if(n<=t)return 0;const o=Wt(e,n-1);return t<=0?o:o-Wt(e,t-1)}function qt(e){Et.value=e;const t=new Array(e+1).fill(0),n=new Array(e+1).fill(0);for(const[o,r]of Object.entries(St)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(zt(t,l,i),zt(n,l,1))}Lt.value=t,Bt.value=n}function Zt(e,t){if(!Number.isFinite(t)||t<=0)return;const n=St[e];if(St[e]=t,n?It.total+=t-n:(It.total+=t,It.count++),Et.value>e){const o=Lt.value,r=Bt.value;if(o.length&&r.length)if(n){const r=t-n;0!==r&&zt(o,e,r)}else zt(o,e,t),zt(r,e,1)}}const Gt=p.computed(()=>It.count>0?Math.max(12,It.total/It.count):32);function Jt(e,t){var n,o;if(e>=t)return 0;if(Et.value!==le.value.length){let o=0;for(let r=e;r<t;r++)o+=null!=(n=St[r])?n:Gt.value;return o}const r=Lt.value,l=Bt.value;if(!r.length||!l.length){let n=0;for(let r=e;r<t;r++)n+=null!=(o=St[r])?o:Gt.value;return n}return Qt(r,e,t)+(t-e-Qt(l,e,t))*Gt.value}p.watch(()=>le.value.length,e=>{e<=0?At():(e<Et.value&&Ot(e),e!==Et.value&&qt(e))},{immediate:!0});const en=p.computed(()=>ae.value?Jt(0,Math.min(qe.start,le.value.length)):0),tn=p.computed(()=>{if(!ae.value)return 0;const e=le.value.length;return Jt(Math.min(qe.end,e),e)});function nn(e){var t;if(e<=0)return 0;const n=le.value;if(Et.value===n.length&&Lt.value.length&&Bt.value.length){const t=Gt.value,o=Lt.value,r=Bt.value,l=e=>e<=0?0:Wt(o,e-1)+(e-Wt(r,e-1))*t;let i=0,a=n.length-1,s=n.length-1;for(;i<=a;){const t=i+a>>1;l(t+1)>=e?(s=t,a=t-1):i=t+1}return s}let o=e;for(let r=0;r<n.length;r++){const e=null!=(t=St[r])?t:Gt.value;if(o<=e)return r;o-=e}return Math.max(0,n.length-1)}function on(e){var t;const n=le.value;if(!n.length)return 0;if(e<=0)return Math.max(0,n.length-1);if(Et.value===n.length){const t=Jt(0,n.length);return nn(Math.max(0,t-e))}let o=e;for(let r=n.length-1;r>=0;r--){const e=null!=(t=St[r])?t:Gt.value;if(o<=e)return r;o-=e}return 0}function rn(e){if(!be.size)return;if(!ae.value)return;let t=!1;for(const[n,o]of be)n>=e&&(o.destroy(),be.delete(n),Ge.value&&delete ke[n],yn(n),Fe.delete(n)&&(t=!0));t&&un()}function ln(e,t){Ge.value&&(ke[e]=t),t&&(ae.value?Tt():ot.value=_t(e,0,Math.max(0,le.value.length-1)))}function an(e){const t=be.get(e);t&&(t.destroy(),be.delete(e)),yn(e)}function sn(e,t){let n=!1;if(t){const o=Fe.get(e);Fe.set(e,t),o!==t&&(n=!0)}else Fe.delete(e)&&(n=!0);if(n&&un(),t||yn(e),!tt.value||!ue)return an(e),void(t?ln(e,!0):Ge.value&&delete ke[e]);if(!ae.value&&Ge.value&&!a.value&&be.size>=640&&(xn("too-many-targets"),!tt.value||!ue))return an(e),void(t?ln(e,!0):Ge.value&&delete ke[e]);if(e<he.value&&!ae.value)return an(e),void ln(e,!0);if(!t)return an(e),void(Ge.value&&delete ke[e]);an(e);const o=ue(t,{rootMargin:"400px"});o&&(be.set(e,o),ln(e,o.isVisible.value),Ge.value&&wn(e),o.whenVisible.then(()=>{yn(e),ln(e,!0)}).catch(()=>{}).finally(()=>{be.get(e)===o&&be.delete(e);try{o.destroy()}catch(t){}}),ae.value&&Tt())}function un(){We.value+=1}function cn(e,t){t?(rt.set(e,t),queueMicrotask(()=>{Zt(e,t.offsetHeight)})):rt.delete(e)}p.onMounted(()=>{v&&p.nextTick(st)}),p.watch(Ze,()=>{v&&p.nextTick(st)}),p.watch(ye,()=>{v&&p.nextTick(st)}),p.watch(ae,()=>{v&&p.nextTick(st)});let dn=null,mn=null,fn=!1,vn=null,hn=null;function gn(){v&&(null!=dn&&(null==me||me(dn),dn=null),null!=mn&&(window.clearTimeout(mn),mn=null),null!=hn&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(hn),hn=null),fn=!1,vn=null)}function yn(e){if(!v)return;const t=$e.get(e);null!=t&&(window.clearTimeout(t),$e.delete(e))}function wn(e){if(!v||!Ge.value)return;yn(e);const t=e%17*23,n=window.setTimeout(()=>{var t,n;if($e.delete(e),!Ge.value)return;if(!0===ke[e])return;const o=Fe.get(e);if(!o)return void delete ke[e];const r=yt(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,c=a?null!=(n=null!=(t=i.innerHeight)?t:null==r?void 0:r.clientHeight)?n:0:s.bottom,d=o.getBoundingClientRect();d.bottom>=u-500&&d.top<=c+500&&ln(e,!0)},1800+t);$e.set(e,n)}function xn(e){var t;if(!a.value){a.value=!0,void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",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-vue2] viewportPriority auto-disabled:",e);for(const e of be.values())e.destroy();if(be.clear(),v)for(const e of $e.values())window.clearTimeout(e);$e.clear();for(const e of Object.keys(ke))delete ke[e]}}function kn(e,t={}){var n,o;if(!Je.value)return;const r=gt.value;if(ye.value>=r)return;const i=Math.max(1,e),a=e=>{var t;dn=null,mn=null,hn=null,fn=!1;const n=null!=vn?vn:i;vn=null;const o=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();ye.value=Math.min(r,ye.value+Math.max(1,e)),rn(ye.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return bn(n),n};let s=n;for(;(a(s),!(ye.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(xe.value));ye.value<r&&Mn()};if(!v||t.immediate)return void a();const s=Math.max(0,null!=(n=l.renderBatchDelay)?n:16);if(vn=null!=vn?Math.max(vn,i):i,!fn){if(fn=!0,!pe&&fe&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(hn=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}de&&!pe?dn=de(()=>{0!==s?mn=window.setTimeout(()=>a(),s):a()}):mn=window.setTimeout(()=>a(),s)}}function Mn(){Je.value&&kn(ge.value?Math.max(1,Math.round(xe.value)):Math.max(1,ve.value))}function bn(e){var t;if(!Je.value)return;const n=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),o=Math.max(1,ve.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*n?xe.value=Math.max(r,Math.floor(.7*xe.value)):e<.5*n&&xe.value<o&&(xe.value=Math.min(o,Math.ceil(1.2*xe.value)))}function Cn(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>require("./chunks/index-a4867ea2.cjs"));return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] 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".',t),dt}})}p.watch([()=>le.value,()=>le.value.length,()=>Je.value,()=>ve.value,()=>he.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const t=le.value.length,n=we.value,o=l.indexKey,r=void 0!==o&&o!==n.key,i=t!==n.total,a=r||i;we.value={key:o,total:t};const s=et.value,u=null!=(e=l.renderBatchDelay)?e:16,c=s.batchSize!==ve.value||s.initial!==he.value||s.delay!==u||s.enabled!==Je.value;et.value={batchSize:ve.value,initial:he.value,delay:u,enabled:Je.value},(a||c||!Je.value)&&gn(),(a||c)&&(xe.value=Math.max(1,ve.value||1)),a&&ae.value&&Tt({immediate:!0});const d=gt.value;if(!t)return 0!==ye.value&&(ye.value=0),void rn(0);if(!Je.value)return ye.value!==d&&(ye.value=d),void rn(ye.value);if(r||0===n.total||c){const e=Math.min(d,he.value);ye.value!==e&&(ye.value=e)}else{const e=Math.min(ye.value,d);ye.value!==e&&(ye.value=e)}const m=Math.max(1,he.value||ve.value||t);ye.value<d?kn(m,{immediate:!v}):rn(ye.value)},{immediate:!0}),p.watch(()=>ae.value,e=>{if(!e)return Mt(),void Ct();bt(),Tt({immediate:!0})},{immediate:!0}),p.watch([()=>le.value.length,()=>ae.value],e=>d(this,[e],function*([e,t]){t&&e&&v&&(yield p.nextTick(),Tt({immediate:!0}))}),{flush:"post"}),p.watch(()=>i.value,()=>{ae.value&&(bt(),Tt({immediate:!0}))}),p.watch(()=>le.value.length,()=>{ae.value&&Tt({immediate:!0})}),p.watch(()=>Ge.value,e=>{if(e)for(const[t,n]of Fe)sn(t,n);else{for(const e of be.values())e.destroy();be.clear();for(const e of Array.from($e.keys()))yn(e);for(const e of Object.keys(ke))delete ke[e];for(const[e,t]of Fe)t&&ln(e,!0)}},{immediate:!1}),p.watch([()=>l.viewportPriority,()=>le.value.length],([e,t])=>{!1!==e?a.value&&t<=200&&(a.value=!1):a.value=!1}),p.watch(()=>ye.value,()=>{ae.value&&Tt({immediate:!0})}),p.watch([ot,ie,nt,()=>le.value.length,ae],()=>{Dt()},{immediate:!0}),p.watch([()=>le.value.length,ae,ie,nt,()=>qe.start,()=>qe.end],([e,t,n,o,r,l])=>{y.value&&W("virtualization",{nodes:e,virtualization:t,maxLiveNodes:n,buffer:o,focusIndex:ot.value,scroll:t?(()=>{const e=Ve.value||yt();return e?{reverse:wt(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:ye.value})}),p.watch(()=>gt.value,(e,t)=>{Je.value&&("number"==typeof t&&e<=t||e>ye.value&&Mn())}),p.onBeforeUnmount(()=>{gn();for(const e of be.values())e.destroy();be.clear();for(const e of Array.from($e.keys()))yn(e);Mt(),Ct(),xo()});const Tn={name:"MermaidBlockNodeLoading",props:{estimatedPreviewHeightPx:Number,isDark:Boolean,showHeader:{type:Boolean,default:!0}},render(e){var t;const n="function"==typeof e?e:p.h,o="function"==typeof e?{attrs:{"data-markstream-mermaid":"1","data-markstream-mode":"pending"}}:{"data-markstream-mermaid":"1","data-markstream-mode":"pending"},r=`${null!=(t=Ut(this.estimatedPreviewHeightPx))?t:360}px`;return n("div",c(u({},o),{class:["my-4 rounded-lg border overflow-hidden shadow-sm",this.isDark?"border-gray-700/30":"border-gray-200"]}),[!1===this.showHeader?null:n("div",{class:["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",this.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"]},[n("div",{class:"flex items-center gap-x-2 overflow-hidden"},[n("span",{class:this.isDark?"text-sm font-medium font-mono truncate text-gray-400":"text-sm font-medium font-mono truncate text-gray-600"},"Mermaid")])]),n("div",{class:["mermaid-preview-area min-h-[360px] relative overflow-hidden block",this.isDark?"bg-gray-900":"bg-gray-50"],style:{height:r}})])}},Nn=p.ref(null);let _n=null;function Dn(){Nn.value||_n||(_n=Promise.resolve().then(()=>require("./chunks/index-6013a5b2.cjs")).then(e=>{var t;return null!=(t=e.default)?t:e}).then(e=>{Nn.value=e}).catch(e=>{console.warn('[markstream-vue2] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',e),Nn.value=dt}))}function Sn(){return Dn(),Nn.value||Tn}const In={name:"InfographicBlockNodeLoading",props:{estimatedPreviewHeightPx:Number,isDark:Boolean,showHeader:{type:Boolean,default:!0}},render(e){var t;const n="function"==typeof e?e:p.h,o="function"==typeof e?{attrs:{"data-markstream-infographic":"1","data-markstream-mode":"pending"}}:{"data-markstream-infographic":"1","data-markstream-mode":"pending"},r=`${null!=(t=Ut(this.estimatedPreviewHeightPx))?t:360}px`;return n("div",c(u({},o),{class:["my-4 rounded-lg border overflow-hidden shadow-sm",this.isDark?"border-gray-700/30":"border-gray-200"]}),[!1===this.showHeader?null:n("div",{class:["infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",this.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"]},[n("div",{class:"flex items-center gap-x-2 overflow-hidden"},[n("span",{class:this.isDark?"text-sm font-medium font-mono truncate text-gray-400":"text-sm font-medium font-mono truncate text-gray-600"},"Infographic")])]),n("div",{class:["infographic-preview min-h-[360px] relative overflow-hidden block",this.isDark?"bg-gray-900":"bg-gray-50"],style:{height:r}})])}},jn=p.ref(null);let En=null;function Ln(){jn.value||En||(En=Promise.resolve().then(()=>require("./chunks/index-e0125777.cjs")).then(e=>{var t;return null!=(t=e.default)?t:e}).then(e=>{jn.value=e}).catch(e=>{console.warn("[markstream-vue2] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering.",e),jn.value=dt}))}function Bn(){return Ln(),jn.value||In}function An(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>pn);return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',t),dt}})}const On=p.computed(()=>l.renderCodeBlocksAsPre?dt:Cn),zn={text:Me,paragraph:ct,heading:Pe,code_block:Cn,list:He,list_item:Re,blockquote:Ht,table:mt,definition_list:T,footnote:Oe,footnote_reference:E,footnote_anchor:Ae,admonition:Xt,vmr_container:vt,hardbreak:ze,link:je,image:ce,thematic_break:pt,math_inline:Ce,math_block:Te,strong:Se,emphasis:Be,strikethrough:Ie,highlight:Le,insert:Ee,subscript:De,superscript:_e,emoji:N,checkbox:C,checkbox_input:C,inline_code:Y,html_inline:F,reference:Ne,html_block:ut},Pn=p.computed(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),Rn=p.computed(()=>Pt(l.codeBlockProps)),Hn=p.computed(()=>Pt(l.codeBlockProps,{omit:["langs"]})),$n=p.computed(()=>u(u({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,monacoOptions:l.codeBlockMonacoOptions,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{}),Hn.value)),Un=p.computed(()=>u(c(u({},$n.value),{langs:l.langs}),Rn.value)),Fn=p.computed(()=>u({},l.mermaidProps||{})),Yn=p.computed(()=>u({},l.d2Props||{})),Wn=p.computed(()=>u({},l.infographicProps||{})),Kn=p.computed(()=>({typewriter:l.typewriter,fade:l.fade,customHtmlTags:oe.value.customHtmlTags,htmlPolicy:L.value})),Vn=p.computed(()=>u(u({},Kn.value),"boolean"==typeof l.showTooltips?{showTooltip:l.showTooltips}:{})),Qn=p.computed(()=>u(u({},Kn.value),"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{})),Xn=p.computed(()=>at.value.map((e,t)=>{var n,o,r,l;const i=Jn(e);let a=e,s=lo(e,i);if(("html_block"===e.type||"html_inline"===e.type)&&s===zn[e.type]){const t=String(null!=(n=e.tag)?n:"").trim().toLowerCase()||m.getHtmlTagFromContent(e.content);if(t)if(re.value.has(t)){const n=Z.value[t];n&&(s=n,a=c(u({},e),{type:t,tag:t,content:m.stripCustomHtmlWrapper(e.content,t)}))}else if(m.shouldRenderUnknownHtmlTagAsText(null!=(o=e.content)?o:e.raw,t)){const t=String(null!=(l=null!=(r=e.content)?r:e.raw)?l:"");"html_inline"===e.type?(s=Me,a={type:"text",content:t,raw:t}):(s=ct,a={type:"paragraph",children:[{type:"text",content:t,raw:t}],raw:t})}}return{node:a,component:s,bindings:so(a,i,s),isCodeBlock:"code_block"===a.type,index:t,indexKey:`${Pn.value}-${t}`,renderKey:no(a,t)}})),qn=p.computed(()=>!(!lt.value||!l.content)&&le.value.some(e=>to(e))),Zn=p.computed(()=>Ze.value.map(e=>{var t,n,o,r;let l=Gn(e.node);const i=Jn(l);let a=lo(l,i);if(("html_block"===l.type||"html_inline"===l.type)&&a===zn[l.type]){const e=String(null!=(t=l.tag)?t:"").trim().toLowerCase()||m.getHtmlTagFromContent(l.content);if(e)if(re.value.has(e)){const t=Z.value[e];t&&(a=t,l=c(u({},l),{type:e,tag:e,content:m.stripCustomHtmlWrapper(l.content,e)}))}else if(m.shouldRenderUnknownHtmlTagAsText(null!=(n=l.content)?n:l.raw,e)){const e=String(null!=(r=null!=(o=l.content)?o:l.raw)?r:"");"html_inline"===l.type?(a=Me,l={type:"text",content:e,raw:e}):(a=ct,l={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return c(u({},e),{node:l,component:a,bindings:so(l,i,a),isCodeBlock:"code_block"===l.type,indexKey:`${Pn.value}-${e.index}`,renderKey:no(l,e.index)})}));function Gn(e){var t,n,o,r,l,i,a;if("code_block"!==e.type)return e;const s=e,c=[String(null!=(t=s.language)?t:""),String(null!=(n=s.loading)?n:""),String(null!=(o=s.diff)?o:""),String(null!=(r=s.code)?r:""),String(null!=(l=s.originalCode)?l:""),String(null!=(i=s.updatedCode)?i:""),String(null!=(a=s.raw)?a:"")].join("\0"),d=Ye.get(s);if(d&&d.signature===c)return d.node;const m=u({},s);return Ye.set(s,{signature:c,node:m}),m}function Jn(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function eo(e,t){const n=t.trim().toLowerCase();if(n)for(const o of[n,jt(n),f.normalizeShikiLanguage(n)]){const t=o&&e[o];if(t)return t}}function to(e){if(!e)return!1;const t=String(e.type||"");return!!["blockquote","list","list_item","table","definition_list","footnote","admonition"].includes(t)||Array.isArray(e.items)||Array.isArray(e.rows)||Array.isArray(e.children)&&!1===["paragraph","heading","text"].includes(t)}function no(e,t){const n=`${Pn.value}-${t}`;if(!e)return n;const o=String(e.type||"unknown");if("code_block"===o)return n;const r=!0===e.loading,l="string"==typeof e.raw?e.raw.length:0,i="string"==typeof e.content?e.content.length:0,a=Array.isArray(e.children)?e.children.length:0,s=Array.isArray(e.items)?e.items.length:0,u=Array.isArray(e.rows)?e.rows.length:0;return(lt.value||r)&&(r||a>0||s>0||u>0)?`${n}-${o}-${r?"l":"r"}-${l}-${i}-${a}-${s}-${u}`:n}function oo(e){var t,n;const o=u({},Fn.value);return null==Ut(o.estimatedPreviewHeightPx)&&(o.estimatedPreviewHeightPx=Kt(Ft(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===o.maxHeight?null:null!=(n=Ut(o.maxHeight))?n:void 0)),o}function ro(e){var t,n;const o=u({},Wn.value);return null==Ut(o.estimatedPreviewHeightPx)&&(o.estimatedPreviewHeightPx=Vt(Yt(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===o.maxHeight?null:null!=(n=Ut(o.maxHeight))?n:void 0)),o}function lo(e,t){if(!e)return ft;const n=Z.value,o=n[String(e.type)];if("code_block"===e.type){const r=null!=t?t:Jn(e),l=r?eo(n,r):void 0;if(l)return l;if("mermaid"===r)return n.mermaid||Sn();if("infographic"===r)return n.infographic||Bn();if("d2"===r||"d2lang"===r)return n.d2||An;if(o)return o;return n.code_block||On.value}return o||zn[String(e.type)]||ft}function io(e){return Boolean(e&&e===Z.value.code_block)}function ao(e,t){return Boolean(e&&t&&e===eo(Z.value,t))}function so(e,t,n){const o=null!=t?t:Jn(e);return"code_block"===e.type&&ao(n,o)?"mermaid"===o?oo(e):"infographic"===o?ro(e):"d2"===o||"d2lang"===o?Yn.value:Un.value:"code_block"===e.type&&io(n)?Un.value:"mermaid"===o?oo(e):"infographic"===o?ro(e):"d2"===o||"d2lang"===o?Yn.value:"link"===e.type?Vn.value:"list"===e.type?Qn.value:"code_block"===e.type?$n.value:Kn.value}const uo=p.computed(()=>Array.isArray(l.nodes)&&l.nodes.length>0),co=p.ref(null),mo=p.ref(!1);let po,fo=0;const vo=new Set(["code_block","admonition","table","math_block","html_block","image"]);function ho(e){if(!e||"object"!=typeof e)return!1;const t=e.type;return"string"==typeof t&&vo.has(t)}function go(){return!ho(le.value[le.value.length-1])}function yo(e){var t,n;if(!e||"object"!=typeof e)return 0;const o=e,r=null!=(n=null!=(t=o.raw)?t:o.content)?n:o.code;if("string"==typeof r)return r.length;const l=o.children;if(Array.isArray(l))return l.reduce((e,t)=>e+yo(t),0);const i=o.items;return Array.isArray(i)?i.reduce((e,t)=>e+yo(t),0):0}function wo(){var e;return(null==(e=l.nodes)?void 0:e.length)?l.nodes.reduce((e,t)=>e+yo(t),0):P.value.length}function xo(){po&&(clearTimeout(po),po=void 0)}function ko(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){var t;if(!(null!=(t=e.textContent)?t:"").trim())return NodeFilter.FILTER_REJECT;const n=e.parentElement;return n?n.closest('.typewriter-cursor, .height-estimation-probes, [data-node-type="code_block"], [data-node-type="admonition"], [data-node-type="table"], [data-node-type="math_block"], [data-node-type="html_block"], [data-node-type="image"], script, style')?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let n=null,o=t.nextNode();for(;o;)n=o,o=t.nextNode();return n}function Mo(){var e,t;if("undefined"==typeof window||!mo.value||!i.value||!co.value)return;const n=i.value,o=co.value,r=ko(n),l=n.getBoundingClientRect();let a=0,s=0,u=20;if(null==r?void 0:r.textContent){const o=document.createRange(),i=r.textContent.length;o.setStart(r,Math.max(0,i-1)),o.setEnd(r,i);const c="function"==typeof o.getClientRects?o.getClientRects():void 0,d=null!=(t=null==c?void 0:c[c.length-1])?t:null==(e=r.parentElement)?void 0:e.getBoundingClientRect();d&&(a=d.right-l.left+n.scrollLeft,s=d.top-l.top+n.scrollTop,u=d.height||u),o.detach()}o.style.transform=`translate(${Math.max(0,a)}px, ${Math.max(0,s)}px)`,o.style.height=`${u}px`}return p.watch([z,P,()=>l.nodes,()=>l.typewriter,$],()=>d(this,null,function*(){if("undefined"==typeof window||uo.value)return;if($.value)return mo.value=!1,void xo();const e=wo(),t=go();if(!1===l.typewriter||!t||e<=fo)return!1!==l.typewriter&&t||(mo.value=!1),void(fo=e);fo=e,mo.value=!0,xo(),yield p.nextTick(),Mo(),po=setTimeout(()=>{mo.value=!1},3e3)}),{flush:"post",immediate:!0}),p.watch(mo,e=>d(this,null,function*(){e&&(yield p.nextTick(),Mo())}),{flush:"post"}),{__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:s,isClient:v,instance:g,debugPerformanceEnabled:y,attrs:w,textStreamState:k,streamRenderVersion:M,smoothStream:b,resolvedShowTooltips:_,inheritedHtmlPolicy:D,inheritedSmoothStreaming:S,resolvedHtmlPolicy:L,smoothStreamingEligible:B,hasMountedForSmoothStreaming:A,smoothStreamingEnabled:O,renderContent:z,rawContent:P,smoothSourceSynced:R,requestedFinal:H,effectiveFinal:$,renderVersionSource:U,logPerf:W,resolveViewportRoot:K,instanceMsgId:V,defaultMd:Q,customTagCache:X,EMPTY_PARSED_NODES:q,customComponentsMap:Z,effectiveCustomHtmlTags:G,mdBase:J,mdInstance:ee,cloneNodeValue:te,cloneParsedNodeList:ne,mergedParseOptions:oe,effectiveCustomHtmlTagsSet:re,parsedNodes:le,maxLiveNodesResolved:ie,virtualizationEnabled:ae,viewportPriorityEnabled:se,registerNodeVisibility:ue,requestFrame:de,cancelFrame:me,isTestEnv:pe,hasIdleCallback:fe,resolvedBatchSize:ve,resolvedInitialBatch:he,batchingEnabled:ge,renderedCount:ye,previousRenderContext:we,adaptiveBatchSize:xe,nodeVisibilityState:ke,nodeVisibilityHandles:be,nodeVisibilityFallbackTimers:$e,nodeSlotElements:Fe,codeBlockRenderCache:Ye,nodeSlotVersion:We,sortedNodeSlots:Ke,scrollRootElement:Ve,detachScrollHandler:Qe,pendingFocusSync:Xe,liveRange:qe,visibleNodes:Ze,deferNodes:Ge,incrementalRenderingActive:Je,previousBatchConfig:et,shouldObserveSlots:tt,liveNodeBufferResolved:nt,focusIndex:ot,nodeContentElements:rt,legacyVue26:lt,legacyNodesMode:it,legacyNodeItems:at,syncNodeRefs:st,resolveTemplateRef:ht,desiredRenderedCount:gt,resolveScrollContainer:yt,isReverseFlexScrollRoot:wt,getNormalizedScrollTop:xt,getOffsetTopWithinRoot:kt,cleanupScrollListener:Mt,setupScrollListener:bt,cancelScheduledFocusSync:Ct,scheduleFocusSync:Tt,syncFocusToScroll:Nt,clamp:_t,updateLiveRange:Dt,nodeHeights:St,heightStats:It,heightTreeSize:Et,heightSumTree:Lt,heightKnownTree:Bt,resetHeightMeasurements:At,pruneHeightMeasurements:Ot,fenwickUpdate:zt,fenwickQuery:Wt,fenwickRangeSum:Qt,rebuildHeightTrees:qt,recordNodeHeight:Zt,averageNodeHeight:Gt,estimateHeightRange:Jt,topSpacerHeight:en,bottomSpacerHeight:tn,estimateIndexForOffset:nn,estimateIndexForOffsetFromEnd:on,cleanupNodeVisibility:rn,markNodeVisible:ln,shouldRenderNode:function(e){return!(Je.value&&e>=ye.value)&&(!Ge.value||e<he.value||!0===ke[e])},destroyNodeHandle:an,setNodeSlotElement:sn,bumpNodeSlotVersion:un,setNodeContentRef:cn,batchRaf:dn,batchTimeout:mn,batchPending:fn,pendingIncrement:vn,batchIdle:hn,VIEWPORT_FALLBACK_DELAY:1800,VIEWPORT_FALLBACK_MARGIN_PX:500,cancelBatchTimers:gn,clearVisibilityFallback:yn,scheduleVisibilityFallback:wn,autoDisableViewportPriority:xn,scheduleBatch:kn,queueNextBatch:Mn,adjustAdaptiveBatchSize:bn,CodeBlockNodeAsync:Cn,MermaidBlockNodeLoading:Tn,mermaidBlockNodeComponent:Nn,mermaidBlockNodeImport:_n,loadMermaidBlockNode:Dn,resolveMermaidBlockNodeComponent:Sn,InfographicBlockNodeLoading:In,infographicBlockNodeComponent:jn,infographicBlockNodeImport:En,loadInfographicBlockNode:Ln,resolveInfographicBlockNodeComponent:Bn,D2BlockNodeAsync:An,codeBlockComponent:On,nodeComponents:zn,indexPrefix:Pn,codeBlockExtraProps:Rn,builtinCodeBlockExtraProps:Hn,codeBlockBindings:$n,customCodeBlockBindings:Un,mermaidBindings:Fn,d2Bindings:Yn,infographicBindings:Wn,nonCodeBindings:Kn,linkBindings:Vn,listBindings:Qn,legacyRenderedItems:Xn,legacyStructuredContentMode:qn,renderedItems:Zn,getCodeBlockRenderNode:Gn,getCodeBlockLanguage:Jn,getCustomCodeLanguageComponent:eo,isLegacyStructuredNode:to,getRenderKey:no,getMermaidBindingsFor:oo,getInfographicBindingsFor:ro,getNodeComponent:lo,isCustomCodeBlockComponent:io,isCustomLanguageCodeBlockComponent:ao,getBindingsFor:so,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)},hasExplicitNodes:uo,typewriterCursorRef:co,showTypewriterCursor:mo,typewriterCursorTimeout:po,lastTypewriterContentLength:fo,TYPEWRITER_CURSOR_EXCLUDED_NODE_TYPES:vo,shouldSkipTypewriterCursorForNode:ho,shouldShowTypewriterCursorForCurrentNodes:go,getNodeTextLength:yo,getTypewriterContentLength:wo,clearTypewriterCursorTimeout:xo,getLastTextNode:ko,updateTypewriterCursorPosition:Mo,LegacyNodesRenderer:Rt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerRef",staticClass:"markstream-vue2 markdown-renderer",class:[{dark:n.props.isDark},{virtualized:n.virtualizationEnabled}],attrs:{"data-custom-id":n.props.customId},on:{click:n.handleContainerClick,mouseover:n.handleContainerMouseover,mouseout:n.handleContainerMouseout}},[n.legacyNodesMode?e._l(n.legacyRenderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[o.isCodeBlock||!1===n.props.fade?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"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",o.bindings,!1)):t("transition",{attrs:{name:"fade",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"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",o.bindings,!1))],1)],1)])}):n.legacyStructuredContentMode?t(n.LegacyNodesRenderer,{attrs:{nodes:n.parsedNodes,"custom-id":n.props.customId,"index-key":n.props.indexKey,typewriter:n.props.typewriter,fade:n.props.fade,"show-tooltips":n.props.showTooltips,"code-block-stream":n.props.codeBlockStream,"code-block-dark-theme":n.props.codeBlockDarkTheme,"code-block-light-theme":n.props.codeBlockLightTheme,"code-block-monaco-options":n.props.codeBlockMonacoOptions,"render-code-blocks-as-pre":n.props.renderCodeBlocksAsPre,"code-block-min-width":n.props.codeBlockMinWidth,"code-block-max-width":n.props.codeBlockMaxWidth,"code-block-props":n.props.codeBlockProps,themes:n.props.themes,langs:n.props.langs,"is-dark":n.props.isDark,"custom-html-tags":n.mergedParseOptions.customHtmlTags,"html-policy":n.resolvedHtmlPolicy},on:{copy:function(e){return n.emit("copy",e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}}):[n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.topSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e(),e._l(n.renderedItems,function(o){var r;return t("div",{key:o.renderKey,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"},[o.isCodeBlock||!1===n.props.fade?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"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",o.bindings,!1)):t("transition",{attrs:{name:"fade",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"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",o.bindings,!1))],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()],n.showTypewriterCursor?t("span",{ref:"typewriterCursorRef",staticClass:"typewriter-cursor",attrs:{"aria-hidden":"true"}}):e._e()],2)},[],!1,null,"6b8b1370",null,null).exports,Xt=b(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)}`,a=p.getCurrentInstance(),s=p.computed(()=>x(null==a?void 0:a.proxy)?Rt:Qt);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,instance:a,nestedRenderer:s}}}),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.nestedRenderer,{tag:"component",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,"f9c1d6b9",null,null).exports;function qt(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}const Zt=b(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,"5b7455c5",null,null).exports,Gt=b(p.defineComponent({__name:"HtmlPreviewFrame",props:{code:null,isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:null,onClose:null,title:null},setup(e){var t;const n=e,o=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV);let r=null;function l(e){return new Set(e.trim().toLowerCase().split(/\s+/).filter(Boolean))}function i(e){if(!o||"undefined"==typeof console||r===e)return;const t=l(e);t.has("allow-scripts")&&t.has("allow-same-origin")&&(r=e,console.warn("[markstream-vue2] htmlPreviewSandbox contains both allow-scripts and allow-same-origin. Use this only for fully trusted content served from an isolated origin."))}function a(e,t){return"string"==typeof e?(i(e),e):void 0!==e?"":!0===t?"allow-scripts":""}const{t:s}=ue(),u=p.computed(()=>{const e=n.code||"",t=e.trim().toLowerCase();return t.startsWith("<!doctype")||t.startsWith("<html")||t.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: ${n.isDark?"#020617":"#ffffff"};\n color: ${n.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>`}),c=p.computed(()=>a(n.htmlPreviewSandbox,n.htmlPreviewAllowScripts));function d(e){var t;"Escape"!==e.key&&"Esc"!==e.key||null==(t=n.onClose)||t.call(n)}return p.onMounted(()=>{"undefined"!=typeof window&&window.addEventListener("keydown",d)}),p.onUnmounted(()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",d)}),{__sfc:!0,props:n,isDevEnv:o,lastWarnedDangerousSandbox:r,normalizeSandboxTokens:l,warnDangerousHtmlPreviewSandbox:i,resolveHtmlPreviewSandboxValue:a,t:s,srcdoc:u,sandboxValue:c,handleKeydown:d,Portal:Zt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[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:n.sandboxValue,referrerpolicy:"no-referrer",srcdoc:n.srcdoc}})])])])])},[],!1,null,"56f5a269",null,null).exports;let Jt=null,en=null,tn=null,nn=null,on=null;const rn=new WeakMap;let ln=0;const an=b(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},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:void 0},htmlPreviewAllowScripts:{type:Boolean,default:void 0},htmlPreviewSandbox:{type:String,default:void 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,s(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 s(e){return null==e?{passive:!0}:"boolean"==typeof e?{capture:e,passive:!0}:"object"==typeof e?"passive"in e?e:c(u({},e),{passive:!0}):{passive:!0}}"undefined"!=typeof window&&i();const m=p.getCurrentInstance(),f=p.computed(()=>{var e,t,n,o,r,l,i,a,s,u;const c=null==m?void 0:m.proxy,d=null!=(e=null==c?void 0:c.$listeners)?e:{};if(d.previewCode||d["preview-code"])return!0;const p=null!=(i=null!=(l=null==(n=null==(t=null==c?void 0:c.$vnode)?void 0:t.data)?void 0:n.on)?l:null==(r=null==(o=null==c?void 0:c.$vnode)?void 0:o.componentOptions)?void 0:r.listeners)?i:{};if(p.previewCode||p["preview-code"])return!0;const f=null!=(u=null==(a=null==c?void 0:c.$vnode)?void 0:a.props)?u:null==(s=null==m?void 0:m.vnode)?void 0:s.props;return!(!f||!f.onPreviewCode&&!f.onPreviewcode)}),{t:v}=ue(),g=p.ref(null),y=p.ref(null),w=p.ref(!1),x=p.ref(jt(r.node.language)),k=p.computed(()=>Et(x.value)),M=p.computed(()=>"plaintext"===k.value),b=p.ref(!1),C=p.ref(!1),T=p.ref(!1),N=p.ref(!1),_=p.ref(!1),D=p.ref(null);let S=0;const I=Fe();let j=null;const E=p.ref("undefined"==typeof window);"undefined"!=typeof window&&p.watch(()=>y.value,e=>{if(null==j||j.destroy(),j=null,!e)return void(E.value=!1);const t=I(e,{rootMargin:"400px"});j=t,E.value=t.isVisible.value,t.whenVisible.then(()=>{E.value=!0})},{immediate:!0}),p.onBeforeUnmount(()=>{null==j||j.destroy(),j=null});let L=null,B=null,A=()=>{},O=()=>{},z=()=>null,P=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),R=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),H=()=>{},$=()=>{},U=()=>{},F=null,Y=()=>{var e;return String(null!=(e=r.node.language)?e:"plaintext")},W=()=>d(this,null,function*(){}),K=null;const V=[];let Q=null;const X=p.computed(()=>r.node.diff),q=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function Z(e){return"number"==typeof e&&Number.isFinite(e)&&e>0?e:void 0}function G(e){var t,n;if(!e||"object"!=typeof e)return{top:0,bottom:0};const o=e;return{top:null!=(t=Z(o.top))?t:0,bottom:null!=(n=Z(o.bottom))?n:0}}function J(e){var t;if("boolean"==typeof e)return e;if(e&&"object"==typeof e){const n=e;return c(u(u({},q),n),{enabled:null==(t=n.enabled)||t})}return u({},q)}const ee=p.computed(()=>{var e,t;const n=r.monacoOptions?u({},r.monacoOptions):{};if(!X.value)return n;const o=void 0===n.diffHideUnchangedRegions?u({},q):J(n.diffHideUnchangedRegions),l=void 0===n.hideUnchangedRegions?void 0:J(n.hideUnchangedRegions),i=null!=(e=n.diffUnchangedRegionStyle)?e:"line-info",a={maxComputationTime:0,diffAlgorithm:"legacy",ignoreTrimWhitespace:!1,renderIndicators:!0,diffUpdateThrottleMs:120,renderLineHighlight:"none",renderLineHighlightOnlyWhenFocus:!0,selectionHighlight:!1,occurrencesHighlight:"off",matchBrackets:"never",lineDecorationsWidth:4,lineNumbersMinChars:2,glyphMargin:!1,minimap:{enabled:!1},renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,diffHideUnchangedRegions:o,useInlineViewWhenSpaceIsLimited:null!=(t=n.useInlineViewWhenSpaceIsLimited)&&t,diffLineStyle:"background",diffAppearance:"auto",diffUnchangedRegionStyle:i,diffHunkActionsOnHover:!1,diffHunkHoverHideDelayMs:160};return c(u(u(u({},a),n),void 0===l?{}:{hideUnchangedRegions:l}),{diffHideUnchangedRegions:o})}),te=p.computed(()=>X.value?"diff":"single"),ne=p.ref(te.value),oe=p.ref(!1),re=p.ref(!1),ae=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",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 wt();if(!e)return ae&&console.warn("[markstream-vue2] stream-monaco is not installed. Code blocks will use basic rendering. Install stream-monaco for enhanced code editor features."),void(oe.value=!0);const t=e.useMonaco,n=e.detectLanguage;if("function"==typeof n&&(Y=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");K=rt();const n=t(K);L=n.createEditor||L,B=n.createDiffEditor||B,A=n.updateCode||A,O=n.updateDiff||O,z=n.getEditor||z,P=n.getEditorView||P,R=n.getDiffEditorView||R,H=n.cleanupEditor||H,$=n.safeClean||n.cleanupEditor||$,U=n.refreshDiffPresentation||U,W=n.setTheme||W,_.value=!0,g.value&&(yield He(g.value))}}catch(e){ae&&console.warn("[markstream-vue2] Failed to initialize Monaco editor:",e),oe.value=!0}})})();const se=p.ref("number"==typeof(null==(o=ee.value)?void 0:o.fontSize)?ee.value.fontSize:12),ce=p.ref(se.value),de=p.computed(()=>{const e=se.value,t=ce.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0});function me(){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 pe(){var e,t,n,o,r;try{const l=X.value?null!=(n=null==(t=null==(e=R())?void 0:e.getModifiedEditor)?void 0:t.call(e))?n:R():P(),i=z(),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 fe(e){var t,n;try{const o=z(),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=me();if(o&&o>0)return o;const r=Number.isFinite(ce.value)&&ce.value>0?ce.value:12;return Math.max(12,Math.round(1.35*r))}function ve(){var e;if(Number.isFinite(ce.value)&&ce.value>0&&Number.isFinite(se.value))return ce.value;const t=pe();return"number"==typeof(null==(e=ee.value)?void 0:e.fontSize)?(se.value=ee.value.fontSize,ce.value=ee.value.fontSize,ce.value):t&&t>0?(se.value=t,ce.value=t,t):(se.value=12,ce.value=12,12)}function he(){var e,t,n,o,r,l,i,a,s,u,c,d,m,p;try{const f=X.value?R():P();if(!f)return null;if(X.value&&(null==f?void 0:f.getOriginalEditor)&&(null==f?void 0:f.getModifiedEditor)){const m=null==(e=f.getOriginalEditor)?void 0:e.call(f),p=null==(t=f.getModifiedEditor)?void 0:t.call(f);null==(n=null==m?void 0:m.layout)||n.call(m),null==(o=null==p?void 0:p.layout)||o.call(p);const v=(null==(r=null==m?void 0:m.getContentHeight)?void 0:r.call(m))||0,h=(null==(l=null==p?void 0:p.getContentHeight)?void 0:l.call(p))||0,g=Math.max(v,h);if(g>0)return Math.ceil(g+1);const y=(null==(s=null==(a=null==(i=null==m?void 0:m.getModel)?void 0:i.call(m))?void 0:a.getLineCount)?void 0:s.call(a))||1,w=(null==(d=null==(c=null==(u=null==p?void 0:p.getModel)?void 0:u.call(p))?void 0:c.getLineCount)?void 0:d.call(c))||1,x=Math.max(y,w),k=Math.max(fe(m),fe(p));return Math.ceil(x*(k+1.5)+0+1)}if(null==f?void 0:f.getContentHeight){null==(m=null==f?void 0:f.layout)||m.call(f);const e=f.getContentHeight();if(e>0)return Math.ceil(e+1)}const v=null==(p=null==f?void 0:f.getModel)?void 0:p.call(f);let h=1;v&&"function"==typeof v.getLineCount&&(h=v.getLineCount());const g=fe(f);return Math.ceil(h*(g+1.5)+0+1)}catch(f){return null}}function ge(e){const t=String(null!=e?e:"").match(/\d+(?:\.\d+)?/g);if(!t||t.length<3)return null;const[n,o,r]=t.slice(0,3).map(Number);return.2126*n+.7152*o+.0722*r}function ye(e,t,n){if(!M.value)return!1;const o=ge(e),r=ge(t);return n?null!=o&&o>170||null!=r&&r<110:null!=o&&o<85||null!=r&&r>190}function we(){var e,t,n,o,r,l,i,a;const s=g.value,u=y.value;if(!s||!u)return;if(X.value)return u.style.removeProperty("--vscode-editor-foreground"),u.style.removeProperty("--vscode-editor-background"),void u.style.removeProperty("--vscode-editor-selectionBackground");const c=s.querySelector(".monaco-editor")||s,d=c.querySelector(".monaco-editor-background")||c,m=c.querySelector(".view-lines")||c;let p=null,f=null,v=null;try{"undefined"!=typeof window&&"function"==typeof window.getComputedStyle&&(p=window.getComputedStyle(c),f=d===c?p:window.getComputedStyle(d),v=m===c?p:window.getComputedStyle(m))}catch(b){p=null,f=null,v=null}const h=String(null!=(e=null==p?void 0:p.getPropertyValue("--vscode-editor-foreground"))?e:"").trim(),w=String(null!=(t=null==p?void 0:p.getPropertyValue("--vscode-editor-background"))?t:"").trim(),x=String(null!=(o=null!=(n=null==p?void 0:p.getPropertyValue("--vscode-editor-selectionBackground"))?n:null==p?void 0:p.getPropertyValue("--vscode-editor-hoverHighlightBackground"))?o:"").trim(),k=h||String(null!=(l=null!=(r=null==v?void 0:v.color)?r:null==p?void 0:p.color)?l:"").trim(),M=w||String(null!=(a=null!=(i=null==f?void 0:f.backgroundColor)?i:null==p?void 0:p.backgroundColor)?a:"").trim();if(ye(M,k,u.classList.contains("is-dark")))return u.style.removeProperty("--vscode-editor-foreground"),u.style.removeProperty("--vscode-editor-background"),void u.style.removeProperty("--vscode-editor-selectionBackground");k&&u.style.setProperty("--vscode-editor-foreground",k),M&&u.style.setProperty("--vscode-editor-background",M),x&&u.style.setProperty("--vscode-editor-selectionBackground",x)}const xe=/auto|scroll|overlay/i;function ke(e){var t,n;if("undefined"==typeof window)return null;const o=null!=(t=null==e?void 0:e.ownerDocument)?t:document,r=o.scrollingElement||o.documentElement||o.body;let l=null!=(n=null==e?void 0:e.parentElement)?n:null;for(;l&&l!==o.body&&l!==r;){const e=window.getComputedStyle(l),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(xe.test(t)||xe.test(n))return l;l=l.parentElement}return r}function Me(e,t,n){var o;if("undefined"==typeof window)return;const r=Math.ceil(t),l=Math.ceil(n)-r;if(!l)return;const i=ke(e);if(!i)return;const a=null!=(o=e.ownerDocument)?o:document,s=i===a.body||i===a.documentElement||i===a.scrollingElement,u=s?0:i.getBoundingClientRect().top;e.getBoundingClientRect().top-u>=0||(s&&"function"==typeof window.scrollBy?window.scrollBy(0,l):i.scrollTop+=l)}function be(){try{const e=g.value;if(!e)return;const t=e.getBoundingClientRect().height,n=he();if(null!=n&&n>0){const o=Math.ceil(n);e.style.minHeight="0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",Me(e,t,o)}}catch(e){}}function Ce(){for(var e;V.length>0;)try{null==(e=V.pop())||e()}catch(t){}}function Te(){if(Ce(),!X.value)return;const e=g.value;if(!e)return;const t=e.querySelector(".monaco-diff-editor");if(!t||t.classList.contains("side-by-side"))return;const n=Array.from(t.querySelectorAll(".editor.original .diff-hidden-lines")),o=Array.from(t.querySelectorAll(".editor.modified .diff-hidden-lines")),r=Math.min(n.length,o.length);for(let l=0;l<r;l++){const e=n[l],t=o[l].querySelector("a"),r=e.querySelector(".center > div:first-child");if(!t||!r)continue;const i=document.createElement("button");i.type="button",i.className="markstream-inline-fold-proxy";const a=t.getAttribute("title")||"Show Unchanged Region";i.title=a,i.setAttribute("aria-label",a);const s=t.querySelector(".codicon"),u=document.createElement("span");u.className=(null==s?void 0:s.className)||"codicon codicon-unfold",i.append(u);const c=e=>{e.preventDefault(),e.stopPropagation()},d=e=>{e.preventDefault(),e.stopPropagation(),t.click()},m=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),t.click())};i.addEventListener("mousedown",c),i.addEventListener("click",d),i.addEventListener("keydown",m),r.replaceChildren(i),V.push(()=>{i.removeEventListener("mousedown",c),i.removeEventListener("click",d),i.removeEventListener("keydown",m),r.contains(i)&&r.replaceChildren()})}}function Ne(){null==Q&&(Q=qt(()=>{Q=null,qt(()=>{_e(),Te(),C.value||(b.value?be():Se(),qt(()=>{_e(),Te()}))})}))}function _e(){if(!X.value)return;const e=g.value;if(!e)return;const t=Array.from(e.querySelectorAll(".stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal"));for(const n of t){if(!(n instanceof HTMLButtonElement))continue;const e="up"===n.dataset.direction?"up":"down",t=document.createElement("span");t.className=`codicon codicon-chevron-${e}`,n.replaceChildren(t)}}function De(e,t,n){const o=Math.min(t,n),r=t>n+1;return e.style.minHeight="0px",e.style.height=`${Math.ceil(o)}px`,e.style.maxHeight=`${Math.ceil(n)}px`,e.style.overflow=r?"auto":"hidden",Math.ceil(o)}function Se(){var e;try{const t=g.value;if(!t)return;const n=t.getBoundingClientRect().height,o=Ie();if(S>0&&(S--,null!=D.value))return void Me(t,n,De(t,D.value,o));const r=he();if(null!=r&&r>0)return void Me(t,n,De(t,r,o));if(null!=D.value)return void Me(t,n,De(t,D.value,o));const l=Math.ceil((null==(e=t.getBoundingClientRect)?void 0:e.call(t).height)||0);if(l>0)return void Me(t,n,De(t,l,o));const i=Number.parseFloat(t.style.height);!Number.isNaN(i)&&i>0?Me(t,n,De(t,i,o)):Me(t,n,De(t,o,o))}catch(t){}}function Ie(){var e,t;const n=null!=(t=null==(e=ee.value)?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 je=p.computed(()=>r.isShowPreview&&("html"===x.value||"svg"===x.value));p.watch(()=>r.node.language,e=>{x.value=jt(e)}),p.watch(()=>[r.node.originalCode,r.node.updatedCode,k.value,X.value],e=>d(this,[e],function*([e,t,n,o]){if(!1!==r.stream&&o){if(L&&!T.value&&g.value)try{yield He(g.value)}catch(l){}O(String(null!=e?e:""),String(null!=t?t:""),k.value),Ne()}})),p.watch(()=>r.node.code,e=>d(this,null,function*(){if(!1!==r.stream&&(x.value||(x.value=jt(Y(e))),!X.value)){if(L&&!T.value&&g.value)try{yield He(g.value)}catch(t){}A(e,k.value),b.value&&Ne()}}));const Ee=p.computed(()=>{const e=x.value;return e?Bt[e]||e.charAt(0).toUpperCase()+e.slice(1):Bt[""]||"Plain Text"}),Le=p.computed(()=>(Nt.value,Lt(x.value||""))),Be=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),X.value?(e.color="var(--markstream-diff-shell-fg)",e.borderColor="var(--markstream-diff-shell-border)"):(e.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",e.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg))",e.borderColor="var(--markstream-code-border-color)"),e}),Ae=p.computed(()=>{if(!X.value)return{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg))"}}),Oe=p.computed(()=>!1!==r.showTooltips);function ze(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}function Pe(e){var t,n;try{if(X.value){const n=R();null==(t=null==n?void 0:n.updateOptions)||t.call(n,{automaticLayout:e})}else{const t=P();null==(n=null==t?void 0:t.updateOptions)||n.call(t,{automaticLayout:e})}}catch(o){}}function Re(e){return d(this,null,function*(){var t,n,o;if(!L)return;lt(),X.value?($(),B?yield B(e,String(null!=(t=r.node.originalCode)?t:""),String(null!=(n=r.node.updatedCode)?n:""),k.value):yield L(e,r.node.code,k.value)):yield L(e,r.node.code,k.value);const l=X.value?R():P();if("number"==typeof(null==(o=ee.value)?void 0:o.fontSize))null==l||l.updateOptions({fontSize:ee.value.fontSize,automaticLayout:!1}),se.value=ee.value.fontSize,ce.value=ee.value.fontSize;else{const e=pe();e&&e>0?(se.value=e,ce.value=e):(se.value=12,ce.value=12)}b.value||C.value||Ne(),!1===r.loading&&(yield p.nextTick(),qt(()=>{Ne()})),N.value=!0})}function He(e){if(!L)return null;if(F)return F;T.value=!0,N.value=!1;const t=(()=>d(this,null,function*(){yield Re(e)}))();return F=t.finally(()=>{F=null}),F}p.watch(Oe,e=>{e||ie()}),p.watch(()=>ce.value,(e,t)=>{const n=X.value?R():P();n&&"number"==typeof e&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),b.value&&!C.value&&Ne())},{flush:"post",immediate:!1});const $e=p.watch(()=>[g.value,X.value,r.stream,r.loading,_.value,E.value],e=>d(this,[e],function*([e,t,n,o,r,l]){if(!e||!L)return;if(!l)return;if(!1===n&&!1!==o)return;const i=He(e);i&&(yield i,$e())}));function Ue(){return r.isDark?r.darkTheme:r.lightTheme}function Ye(e){return"string"==typeof e?e:e&&"object"==typeof e&&"name"in e?String(e.name):null}function We(e,t){const n=Ye(t);return e.some(e=>e===t||n&&Ye(e)===n)}function Ke(e,t){if("string"!=typeof t)return;const n=jt(t),o=Et(n);for(const r of[n,o])r&&!e.includes(r)&&e.push(r)}p.watch(te,(e,t)=>d(this,null,function*(){if(e!==t&&(ne.value=e,L&&g.value&&T.value&&(!1!==r.stream||!1===r.loading)&&E.value))try{T.value=!1,F=null,Ce(),$(),yield p.nextTick(),yield He(g.value)}catch(n){T.value=!1}}));const Ve=p.computed(()=>{const e=Array.isArray(r.themes)?[...r.themes]:[];for(const t of[r.darkTheme,r.lightTheme])null==t||We(e,t)||e.push(t);return e.length?e:void 0}),Qe=p.computed(()=>{var e;const t=[],n=null==(e=ee.value)?void 0:e.languages;if(Array.isArray(n))for(const o of n)Ke(t,o);return Ke(t,r.node.language),Ke(t,x.value),Ke(t,k.value),Ke(t,"plaintext"),t});function Xe(){var e,t;const n=Ue(),o=null==(e=ee.value)?void 0:e.theme,r=null!=n?n:o,l=null!=(t=Ve.value)?t:[];if(!l.length||null==r)return r;const i=Ye(r),a=l.map(e=>Ye(e)).filter(e=>!!e);if(!i||a.includes(i))return r;const s=Ye(o);return null!=o&&s&&a.includes(s)?o:l[0]}function qe(){lt();const e=Xe(),t=()=>{X.value&&U(),qt(()=>{we(),Ne()})};e?function(e,t){const n=function(e){if(null==e)return null;if("string"==typeof e)return e;if("object"==typeof e&&e&&"name"in e)return String(e.name);if("object"==typeof e){const n=rn.get(e);if(n)return n;try{const t=JSON.stringify(e);if(t)return rn.set(e,t),t}catch(t){}const o="__theme_"+ ++ln;return rn.set(e,o),o}return String(e)}(t);return n?(on=e,Jt||nn!==n?(en=t,tn=n,Jt||(Jt=(()=>d(this,null,function*(){for(;tn&&null!=en;){const n=en,o=tn;if(en=null,tn=null,nn!==o)try{yield(null!=on?on:e)(n),nn=o}catch(t){}}}))().finally(()=>{Jt=null}),Jt)):Promise.resolve()):Promise.resolve()}(W,e).then(t).catch(()=>{}):t()}function Ze(e){var t;const n=(null!=(t=Ye(e))?t:"").toLowerCase();return n?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(e=>n.includes(e))&&!["light","latte","dawn","lotus"].some(e=>n.includes(e)):!!r.isDark}const Ge=p.computed(()=>Ze(Xe())),Je=p.computed(()=>{var e;if(!X.value)return Ge.value?"dark":"light";const t=null==(e=ee.value)?void 0:e.diffAppearance;return"light"===t||"dark"===t?t:r.isDark?"dark":"light"}),et=p.computed(()=>X.value?"dark"===Je.value:Ge.value),tt=p.computed(()=>{var e,t,n;const o=ee.value,r=Number.isFinite(ce.value)&&ce.value>0?ce.value:12,l=null!=(e=Z(null==o?void 0:o.fontSize))?e:r,i=null!=(t=Z(null==o?void 0:o.lineHeight))?t:12===l?18:Math.max(12,Math.round(1.5*l)),a="string"==typeof(null==o?void 0:o.fontFamily)&&o.fontFamily.trim()?o.fontFamily.trim():void 0,s=G(null==o?void 0:o.padding),u=null!=(n=Z(null==o?void 0:o.tabSize))?n:4;return{fontFamily:a,fontSize:l,lineHeight:i,paddingBottom:s.bottom,paddingTop:s.top,tabSize:u}}),nt=p.computed(()=>{var e;return!!X.value&&!1===(null==(e=ee.value)?void 0:e.renderSideBySide)}),ot=p.computed(()=>{const e=tt.value,t={"--markstream-code-padding-left":"62px","--markstream-pre-diff-line-height":`${e.lineHeight}px`,"--markstream-pre-line-number-top":`${e.paddingTop}px`,"--markstream-pre-line-number-width":"36px","--markstream-pre-line-number-gap":"0px",fontSize:`${e.fontSize}px`,lineHeight:`${e.lineHeight}px`,paddingBottom:`${e.paddingBottom}px`,paddingTop:`${e.paddingTop}px`,tabSize:e.tabSize};return e.fontFamily&&(t.fontFamily=e.fontFamily),t});function rt(){const e=c(u(c(u({wordWrap:"on",wrappingIndent:"same"},ee.value||{}),{themes:Ve.value,languages:Qe.value,theme:Xe()}),X.value?{diffAppearance:Je.value}:{}),{onThemeChange(){we()}});if(X.value){const t=tt.value;null!=e.fontSize||(e.fontSize=t.fontSize),null!=e.lineHeight||(e.lineHeight=t.lineHeight),null!=e.padding||(e.padding={top:t.paddingTop,bottom:t.paddingBottom}),null!=e.tabSize||(e.tabSize=t.tabSize),t.fontFamily&&(null!=e.fontFamily||(e.fontFamily=t.fontFamily))}return e}function lt(){const e=rt();if(!K)return K=e,K;for(const t of Object.keys(K))t in e||delete K[t];return Object.assign(K,e),K}const it=p.computed(()=>{var e,t,n,o,r,l,i,a,s,u,c,d,m,p;return JSON.stringify({diffLineStyle:null!=(t=null==(e=ee.value)?void 0:e.diffLineStyle)?t:"background",diffUnchangedRegionStyle:null!=(o=null==(n=ee.value)?void 0:n.diffUnchangedRegionStyle)?o:"line-info",diffHideUnchangedRegions:null==(l=null==(r=ee.value)?void 0:r.diffHideUnchangedRegions)||l,renderSideBySide:null==(a=null==(i=ee.value)?void 0:i.renderSideBySide)||a,enableSplitViewResizing:null==(u=null==(s=ee.value)?void 0:s.enableSplitViewResizing)||u,ignoreTrimWhitespace:null==(d=null==(c=ee.value)?void 0:c.ignoreTrimWhitespace)||d,originalEditable:null!=(p=null==(m=ee.value)?void 0:m.originalEditable)&&p})});p.watch(()=>[r.monacoOptions,E.value],()=>{var e,t;if(lt(),!L||!E.value)return;const n=X.value?R():P(),o="number"==typeof(null==(e=ee.value)?void 0:e.fontSize)?ee.value.fontSize:Number.isFinite(ce.value)?ce.value:void 0;"number"==typeof o&&Number.isFinite(o)&&o>0&&(null==(t=null==n?void 0:n.updateOptions)||t.call(n,{fontSize:o})),Ne()},{deep:!0}),p.watch(()=>{var e,t;return[r.isDark,r.darkTheme,r.lightTheme,r.themes,null==(e=ee.value)?void 0:e.theme,null==(t=ee.value)?void 0:t.diffAppearance,_.value,T.value,E.value]},()=>{_.value&&qe()},{flush:"post"}),p.watch(()=>[it.value,_.value,E.value],(e,t)=>d(this,[e,t],function*([e,t,n],[o]){if(lt(),X.value&&t&&n&&L&&g.value&&T.value&&e!==o&&(!1!==r.stream||!1===r.loading))try{T.value=!1,F=null,Ce(),$(),yield p.nextTick(),yield He(g.value)}catch(l){T.value=!1}}),{flush:"post"});const at=p.watch(()=>[r.loading,E.value],e=>d(this,[e],function*([e,t]){t&&(e||(yield p.nextTick(),qt(()=>{C.value||(b.value?be():Se()),at()})))}),{immediate:!0,flush:"post"});return p.onUnmounted(()=>{Ce(),null!=Q&&(function(e){try{if(null==e)return;if("undefined"!=typeof globalThis&&"function"==typeof globalThis.cancelAnimationFrame)return void globalThis.cancelAnimationFrame(e)}catch(t){}try{globalThis.clearTimeout(e)}catch(t){}}(Q),Q=null),H()}),{__sfc:!0,props:r,emits:t,MONACO_TOUCH_PATCH_FLAG:l,ensureMonacoPassiveTouchListeners:i,shouldForcePassiveForMonaco:a,withPassiveOptions:s,instance:m,hasPreviewListener:f,t:v,codeEditor:g,container:y,copyText:w,codeLanguage:x,monacoLanguage:k,isPlainTextLanguage:M,isExpanded:b,isCollapsed:C,editorCreated:T,editorReady:N,monacoReady:_,expandRafId:null,heightBeforeCollapse:D,resumeGuardFrames:S,registerVisibility:I,viewportHandle:j,viewportReady:E,createEditor:L,createDiffEditor:B,updateCode:A,updateDiffCode:O,getEditor:z,getEditorView:P,getDiffEditorView:R,cleanupEditor:H,safeClean:$,refreshDiffPresentation:U,createEditorPromise:F,detectLanguage:Y,setTheme:W,runtimeMonacoOptions:K,inlineFoldProxyCleanups:V,deferredEditorVisualSyncRafId:Q,isDiff:X,defaultDiffHideUnchangedRegions:q,defaultPreFallbackFontSize:12,defaultPreFallbackLineHeight:18,readPositiveNumber:Z,readMonacoPadding:G,resolveDiffHideUnchangedRegionsOption:J,resolvedMonacoOptions:ee,desiredEditorKind:te,currentEditorKind:ne,usePreCodeRender:oe,showInlinePreview:re,isDevEnv:ae,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:se,codeFontSize:ce,fontBaselineReady:de,CONTENT_PADDING:0,LINE_EXTRA_PER_LINE:1.5,PIXEL_EPSILON:1,measureLineHeightFromDom:me,readActualFontSizeFromEditor:pe,getLineHeightSafe:fe,ensureFontBaseline:ve,increaseCodeFont:function(){const e=ve(),t=Math.min(36,e+1);ce.value=t},decreaseCodeFont:function(){const e=ve(),t=Math.max(10,e-1);ce.value=t},resetCodeFont:function(){ve(),Number.isFinite(se.value)&&(ce.value=se.value)},computeContentHeight:he,getColorLuminance:ge,shouldPreferPlainTextFallbackSurface:ye,syncEditorCssVars:we,resizeSyncHandler:null,SCROLL_PARENT_OVERFLOW_RE:xe,resolveScrollRootElement:ke,adjustScrollAfterHeightChange:Me,updateExpandedHeight:be,clearInlineFoldProxies:Ce,syncInlineFoldProxies:Te,scheduleEditorVisualSync:Ne,syncDiffRevealButtons:_e,applyCollapsedContainerHeight:De,updateCollapsedHeight:Se,getMaxHeightValue:Ie,isPreviewable:je,displayLanguage:Ee,languageIcon:Le,containerStyle:Be,headerStyle:Ae,tooltipsEnabled:Oe,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)),w.value=!0,t("copy",r.node.code),setTimeout(()=>{w.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})},resolveTooltipTarget:ze,onBtnHover:function(e,t,n="top"){if(!Oe.value)return;const o=ze(e);if(!o)return;const l=e;le(o,t,n,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,r.isDark)},onBtnLeave:function(){Oe.value&&ie()},onCopyHover:function(e){if(!Oe.value)return;const t=ze(e);if(!t)return;const n=e;le(t,w.value?v("common.copied")||"Copied":v("common.copy")||"Copy","top",!1,null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0,r.isDark)},toggleExpand:function(e){if(b.value=!b.value,e&&Oe.value){const t=ze(e);t&&le(t,b.value?v("common.collapse")||"Collapse":v("common.expand")||"Expand","top",!1,void 0,r.isDark)}const t=X.value?R():P(),n=g.value;t&&n&&(b.value?(Pe(!0),n.style.maxHeight="none",n.style.overflow="visible",be()):(Pe(!1),n.style.overflow="auto",Se()))},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&&(D.value=n)}Pe(!1)}else{b.value&&Pe(!0),g.value&&null!=D.value&&(g.value.style.height=`${D.value}px`);const e=X.value?R():P();try{null==(n=null==e?void 0:e.layout)||n.call(e)}catch(o){}S=2,Ne()}},previewCode:function(){if(!je.value)return;const e=x.value;if(f.value){const n="html"===e?"text/html":"image/svg+xml",o="html"===e?v("artifacts.htmlPreviewTitle")||"HTML Preview":v("artifacts.svgPreviewTitle")||"SVG Preview";return void t("previewCode",{node:r.node,artifactType:n,artifactTitle:o,id:`temp-${e}-${Date.now()}`})}"html"===e&&(re.value=!re.value)},setAutomaticLayout:Pe,runEditorCreation:Re,ensureEditorCreation:He,stopCreateEditorWatch:$e,getPreferredColorScheme:Ue,getThemeName:Ye,hasTheme:We,addRuntimeLanguage:Ke,runtimeMonacoThemes:Ve,runtimeMonacoLanguages:Qe,resolveRequestedTheme:Xe,themeUpdate:qe,themeLooksDark:Ze,resolvedChromeIsDark:Ge,effectiveDiffAppearance:Je,resolvedSurfaceIsDark:et,preFallbackMetrics:tt,preFallbackDiffInline:nt,preFallbackStyle:ot,buildRuntimeMonacoOptions:rt,syncRuntimeMonacoOptions:lt,monacoStructuralSignature:it,stopLoadingWatch:at,stopExpandAutoResize:function(){},PreCodeNode:dt,HtmlPreviewFrame:Gt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return n.usePreCodeRender?t(n.PreCodeNode,{staticClass:"code-pre-fallback",style:n.preFallbackStyle,attrs:{node:e.node,"show-line-numbers":n.isDiff,"diff-inline":n.preFallbackDiffInline}}):t("div",{ref:"container",staticClass:"code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.resolvedSurfaceIsDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":n.props.loading,"is-dark":n.resolvedSurfaceIsDark,"is-diff":n.isDiff,"is-plain-text":n.isPlainTextLanguage}],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",style:n.headerStyle},[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"},[n.props.showCollapseButton?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"}})])]):e._e(),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:function(e){return n.toggleExpand(e)},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:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):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"}})])]):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)"}],staticClass:"code-editor-layer"},[t("div",{ref:"codeEditor",staticClass:"code-editor-container",class:[e.stream?"":"code-height-placeholder"],style:{visibility:n.editorReady?"visible":"hidden"},attrs:{"aria-hidden":n.editorReady?void 0:"true"}}),n.editorReady?e._e():t("div",{staticClass:"code-editor-fallback-surface"},[t(n.PreCodeNode,{staticClass:"code-pre-fallback",style:n.preFallbackStyle,attrs:{node:e.node,"show-line-numbers":n.isDiff,"diff-inline":n.preFallbackDiffInline}})],1)]),n.showInlinePreview&&!n.hasPreviewListener&&n.isPreviewable&&"html"===n.codeLanguage?t(n.HtmlPreviewFrame,{attrs:{code:e.node.code,"html-preview-allow-scripts":n.props.htmlPreviewAllowScripts,"html-preview-sandbox":n.props.htmlPreviewSandbox,"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,"b3974933",null,null).exports,sn=()=>import("@terrastruct/d2");let un=null,cn=sn;function dn(e){cn=e,un=null}const mn=b(p.defineComponent({__name:"D2BlockNode",props:{node:null,maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:null,darkThemeId:null,showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(e){const t=e,{t:n}=ue(),o=p.ref(!1),r=p.ref(!1),l=p.ref(!1),i=p.ref(!1),a=p.ref(null),s=p.ref(!1),c=p.ref(""),m=p.ref(0),f=p.ref(null),v=p.ref(null),h=p.computed(()=>{var e;return null!=(e=t.node.code)?e:""}),g=p.computed(()=>l.value||!i.value||!c.value),y=p.computed(()=>!!c.value),w=p.computed(()=>{if(g.value&&v.value)return{minHeight:`${v.value}px`}}),x=p.computed(()=>{if(t.maxHeight)return{maxHeight:"number"==typeof t.maxHeight?`${t.maxHeight}px`:String(t.maxHeight)}}),k="undefined"!=typeof window;let M=null,b=!1,C=!1,T=0,N=null,_=!1,D=null;const S={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function I(e){return!e||e.disabled}const j=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],E=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function L(e){return e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function B(e){if(!e)return"";const t=e.trim();return E.test(t)?t:""}function A(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(j.some(e=>e.test(n))){o.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&t.value){const n=B(t.value);if(!n){o.removeAttribute(e);continue}n!==t.value&&o.setAttribute(e,n)}}}}}function O(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return"";if(!e)return"";const t=L(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return"";const o=n;return A(o),o.classList.add("markstream-d2-root-svg"),o.outerHTML}function z(e){const t=O(e);c.value=t||""}function P(){c.value=""}function R(e){return e?"string"==typeof e?e:"string"==typeof e.svg?e.svg:"string"==typeof e.data?e.data:"":""}function H(){return d(this,null,function*(){if(M)return M;const e=yield function(){return d(this,null,function*(){if(un)return un;const e=cn;if(!e)return null;let t;try{t=yield e()}catch(n){if(e===sn)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw n}return t?(un=function(e){var t;if(!e)return e;if(e.D2&&"function"==typeof e.D2)return e.D2;if(e.default&&e.default.D2&&"function"==typeof e.default.D2)return e.default.D2;const n=null!=(t=e.default)?t:e;return"function"==typeof n?n:(null==n?void 0:n.D2)&&"function"==typeof n.D2?n.D2:n}(t),un):null})}();if(!e)return null;if("function"==typeof e){const t=new e;return t&&"function"==typeof t.compile?M=t:"function"==typeof e.compile&&(M=e),M}return(null==e?void 0:e.D2)&&"function"==typeof e.D2?(M=new e.D2,M):("function"==typeof e.compile&&(M=e),M)})}function $(){return d(this,null,function*(){var e,n,o,r,c;if(!k||C)return;if(t.loading&&!t.progressiveRender)return;const d=h.value;if(!d)return P(),void(a.value=null);const p=++m.value;s.value=!0,a.value=null;try{const s=yield H();if(!s)return i.value=!1,l.value=!0,P(),void(a.value="D2 is not available.");if("function"!=typeof s.compile||"function"!=typeof s.render)throw new TypeError("D2 instance is missing compile/render methods.");i.value=!0;const f=yield s.compile(d);if(p!==m.value)return;const v=null!=(e=null==f?void 0:f.diagram)?e:f,h=null!=(o=null!=(n=null==f?void 0:f.renderOptions)?n:null==f?void 0:f.options)?o:{},g=null!=(r=t.themeId)?r:h.themeID,y=null!=(c=t.darkThemeId)?c:h.darkThemeID,w=u({},h);if(w.themeID=t.isDark&&null!=y?y:g,w.darkThemeID=null,w.darkThemeOverrides=null,t.isDark){const e=h.themeOverrides&&"object"==typeof h.themeOverrides?h.themeOverrides:null;w.themeOverrides=u(u({},S),e||{})}const x=yield s.render(v,w);if(p!==m.value)return;const k=R(x);if(!k)throw new Error("D2 render returned empty output.");z(k),t.loading&&(l.value=!1),a.value=null}catch(f){if(p!==m.value)return;const e=(null==f?void 0:f.message)?String(f.message):"D2 render failed.";t.loading||(a.value=e),e.includes("@terrastruct/d2")&&(i.value=!1,l.value=!0)}finally{p===m.value&&(s.value=!1,_&&(_=!1,U()))}})}function U(e=!1){if(b)return;if(!k)return;if(C)return;if(s.value)return void(_=!0);const n=Math.max(120,Number(t.progressiveIntervalMs)||0),o=Date.now()-T;if(!e&&o<n)return _=!0,void(null==N&&(N=window.setTimeout(()=>{N=null,_&&(_=!1,U(!0))},Math.max(0,n-o))));b=!0;const r=()=>{b=!1,T=Date.now(),$()};"undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(r):setTimeout(r,0)}function F(){const e=f.value;if(!e)return;const t=e.getBoundingClientRect().height;t>0&&(v.value=t)}return p.watch(()=>[t.node.code,t.loading,t.isDark],()=>{U()},{immediate:!0}),p.watch(()=>t.loading,(e,t)=>{t&&!e&&U(!0)}),p.watch(()=>[g.value,c.value,h.value],()=>{p.nextTick(()=>{F()})}),p.onMounted(()=>{U(),p.nextTick(()=>{F()}),"undefined"!=typeof ResizeObserver&&(D=new ResizeObserver(()=>{F()}),f.value&&D.observe(f.value))}),p.onBeforeUnmount(()=>{C=!0,null!=N&&(clearTimeout(N),N=null),null==D||D.disconnect(),D=null}),{__sfc:!0,props:t,t:n,copyText:o,isCollapsed:r,showSource:l,d2Available:i,renderError:a,isRendering:s,svgMarkup:c,renderToken:m,bodyRef:f,bodyMinHeight:v,baseCode:h,showSourceFallback:g,hasPreview:y,bodyStyle:w,renderStyle:x,isClient:k,d2Instance:M,scheduled:b,unmounted:C,lastRenderAt:T,throttleTimer:N,pendingRender:_,bodyObserver:D,DARK_THEME_OVERRIDES:S,shouldSkipEventTarget:I,onBtnHover:function(e,n,o="top"){if(I(e.currentTarget))return;const r=e,l=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0;le(e.currentTarget,n,o,!1,l,t.isDark)},onBtnLeave:function(){ie()},onCopyHover:function(e){if(I(e.currentTarget))return;const r=o.value?n("common.copied")||"Copied":n("common.copy")||"Copy",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;le(e.currentTarget,r,"top",!1,i,t.isDark)},copy:function(){return d(this,null,function*(){try{const e=h.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),o.value=!0,setTimeout(()=>{o.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})},toggleCollapse:function(){r.value=!r.value},handleSwitchMode:function(e){l.value="source"===e},DISALLOWED_STYLE_PATTERNS:j,SAFE_URL_PROTOCOLS:E,neutralizeScriptProtocols:L,sanitizeUrl:B,scrubSvgElement:A,toSafeSvgMarkup:O,setSvg:z,clearSvg:P,extractSvg:R,ensureD2Instance:H,renderDiagram:$,scheduleRender:U,exportSvg:function(){if(c.value)try{const e=new Blob([c.value],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e);if("undefined"!=typeof document){const e=document.createElement("a");e.href=t,e.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(e),e.click(),document.body.removeChild(e)}URL.revokeObjectURL(t)}catch(e){console.error("Failed to export SVG:",e)}},updateBodyMinHeight:F}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"d2-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:n.props.isDark?"border-gray-700/30 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900"},[n.props.showHeader?t("div",{staticClass:"d2-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._m(0),t("div",{staticClass:"flex items-center gap-x-2"},[n.props.showModeToggle?t("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"":"is-active",attrs:{type:"button"},on:{click:function(e){return 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}},[e._v(" "+e._s(n.t("common.preview")||"Preview")+" ")]),t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"is-active":"",attrs:{type:"button"},on:{click:function(e){return 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}},[e._v(" "+e._s(n.t("common.source")||"Source")+" ")])]):e._e(),n.props.showCopyButton?t("button",{staticClass:"d2-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","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","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.svgMarkup?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.export")||"Export"},on:{click:n.exportSvg,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","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:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"}})])]):e._e(),n.props.showCollapseButton?t("button",{staticClass:"d2-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.toggleCollapse,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","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()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}],ref:"bodyRef",staticClass:"d2-block-body",style:n.bodyStyle},[n.props.loading&&!n.hasPreview?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",[n.showSourceFallback?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",{staticClass:"d2-render",style:n.renderStyle},[t("div",{staticClass:"d2-svg",domProps:{innerHTML:e._s(n.svgMarkup)}}),n.renderError?t("p",{staticClass:"d2-error px-4 pb-3 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()])])])])},[function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"flex items-center gap-x-2"},[t("span",{staticClass:"text-sm font-medium font-mono"},[e._v("D2")])])}],!1,null,"fdf24c90",null,null).exports;mn.install=e=>{e.component(mn.__name,mn)};const pn=Object.freeze(Object.defineProperty({__proto__:null,default:mn},Symbol.toStringTag,{value:"Module"}));let fn=null,vn=null;const hn=b(p.defineComponent({__name:"InfographicBlockNode",props:{node:null,maxHeight:{default:"500px"},estimatedPreviewHeightPx:null,loading:{type:Boolean,default:!0},isDark:{type:Boolean},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}},emits:["copy","export","openModal"],setup(e,{emit:t}){const n=e,{t:o}=ue(),r=p.ref(!1),l=p.ref(!1),i=p.ref(),a=p.ref(!1),s=p.ref(!1),u=p.ref(),c=p.ref(null),m=p.computed(()=>n.node.code),f=p.computed(()=>n.maxHeight&&"none"!==n.maxHeight?Ut(n.maxHeight):null),v=p.computed(()=>{var e;return Vt(null!=(e=Ut(n.estimatedPreviewHeightPx))?e:Yt(m.value),void 0,f.value)}),h=p.ref(`${v.value}px`);function g(e){if(!n.maxHeight||"none"===n.maxHeight)return`${Math.max(e,v.value)}px`;const t=f.value;return null==t?`${Math.max(e,v.value)}px`:`${Math.max(Math.min(e,t),v.value)}px`}function y(){if(!i.value)return;const e=i.value.scrollHeight;e>0&&(h.value=g(e))}const w=p.ref(1),x=p.ref(0),k=p.ref(0),M=p.ref(!1),b=p.ref({x:0,y:0});function C(e){return!e||e.disabled}function T(e){return d(this,null,function*(){try{const n=(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`infographic-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(t){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function N(e){"Escape"===e.key&&s.value&&D()}function _(){if(s.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",N)}catch(e){}p.nextTick(()=>{if(i.value&&u.value){u.value.innerHTML="";const e=document.createElement("div");e.style.transition="transform 0.1s ease",e.style.transformOrigin="center center",e.style.width="100%",e.style.height="100%",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center";const t=i.value.cloneNode(!0);t.classList.add("fullscreen"),t.style.height="auto",e.appendChild(t),u.value.appendChild(e),c.value=e,e.style.transform=`translate(${x.value}px, ${k.value}px) scale(${w.value})`}})}function D(){if(s.value=!1,u.value&&(u.value.innerHTML=""),c.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",N)}catch(e){}}p.watch(v,e=>{if(a.value||l.value)return;const t=Ut(h.value);(null==t||t<e)&&(h.value=`${e}px`)});let S=null;function I(){return d(this,null,function*(){var e;if(i.value)try{const t=yield function(){return d(this,null,function*(){return vn||fn||(fn=import("@antv/infographic").then(e=>{const t=e&&e.default?e.default:e;let n=t;return"function"==typeof t&&t.prototype&&t.prototype.render?n=t:e.Infographic?n=e.Infographic:t&&t.Infographic&&(n=t.Infographic),vn=n,n}).catch(e=>(console.warn("Failed to load @antv/infographic",e),null)),fn)})}();if(!t)return void console.warn("Infographic library failed to load.");S&&(null==(e=S.destroy)||e.call(S),S=null),i.value.innerHTML="",S=new t({container:i.value,width:"100%",height:"100%"}),S.render(m.value),p.nextTick(()=>{y()})}catch(t){console.error("Failed to render infographic:",t),i.value&&(i.value.innerHTML=`<div class="text-red-500 p-4">Failed to render infographic: ${t instanceof Error?t.message:"Unknown error"}</div>`)}})}p.watch(()=>m.value,()=>{a.value||l.value||p.nextTick(()=>{I()})}),p.watch(()=>a.value,e=>{e||l.value||p.nextTick(()=>{I()})}),p.watch(()=>l.value,e=>{e||a.value||p.nextTick(()=>{I()})}),p.watch(()=>n.maxHeight,()=>{a.value||l.value||p.nextTick(()=>{I()})}),p.onMounted(()=>{a.value||l.value||p.nextTick(()=>{I()})}),p.onBeforeUnmount(()=>{var e;if(S&&(null==(e=S.destroy)||e.call(S),S=null),"undefined"!=typeof window)try{window.removeEventListener("keydown",N)}catch(t){}});const j=p.computed(()=>n.isDark?"infographic-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"infographic-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700"),E=p.computed(()=>a.value||l.value),L=p.computed(()=>({transform:`translate(${x.value}px, ${k.value}px) scale(${w.value})`}));return p.watch(L,e=>{s.value&&c.value&&(c.value.style.transform=e.transform)}),{__sfc:!0,props:n,_emits:t,t:o,copyText:r,isCollapsed:l,infographicContainer:i,showSource:a,isModalOpen:s,modalContent:u,modalCloneWrapper:c,baseCode:m,maxPreviewHeight:f,estimatedPreviewHeight:v,containerHeight:h,resolveContainerHeight:g,updateContainerHeight:y,zoom:w,translateX:x,translateY:k,isDragging:M,dragStart:b,shouldSkipEventTarget:C,onBtnHover:function(e,t,o="top"){if(C(e.currentTarget))return;const r=e,l=null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0;le(e.currentTarget,t,o,!1,l,n.isDark)},onBtnLeave:function(){ie()},onCopyHover:function(e){if(C(e.currentTarget))return;const t=r.value?o("common.copied")||"Copied":o("common.copy")||"Copy",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;le(e.currentTarget,t,"top",!1,i,n.isDark)},copy:function(){return d(this,null,function*(){try{const e=m.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),r.value=!0,setTimeout(()=>{r.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},handleSwitchMode:function(e){a.value="source"===e},handleExportClick:function(){var e;const t=null==(e=i.value)?void 0:e.querySelector("svg");t?T(t):console.error("SVG element not found")},exportSvg:T,handleKeydown:N,openModal:_,closeModal:D,handleOpenModalClick:function(){_()},zoomIn:function(){w.value<3&&(w.value+=.1)},zoomOut:function(){w.value>.5&&(w.value-=.1)},resetZoom:function(){w.value=1,x.value=0,k.value=0},startDrag:function(e){M.value=!0,e instanceof MouseEvent?b.value={x:e.clientX-x.value,y:e.clientY-k.value}:b.value={x:e.touches[0].clientX-x.value,y:e.touches[0].clientY-k.value}},onDrag:function(e){if(!M.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),x.value=t-b.value.x,k.value=n-b.value.y},stopDrag:function(){M.value=!1},infographicInstance:S,renderInfographic:I,computedButtonStyle:j,isFullscreenDisabled:E,transformStyle:L,infographicIconUrl:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUuNTIiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyOTEgMzAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnPjxwYXRoIGQ9Ik0xNDAuOTA0IDIzOS4zNzZDMTI4LjgzIDIzOS42ODMgMTE5LjY3NSAyMzkuMjk5IDExNS40NDggMjQzLjg0M0MxMTAuOTAyIDI0OC4wNyAxMTEuMjg4IDI1Ny4yMjcgMTEwLjk3OSAyNjkuMzAyQzExMS4xMTggMjc0LjY3NSAxMTEuMTE4IDI3OS40NzggMTExLjQ3MiAyODMuNTJDMTExLjY2MiAyODUuNjM4IDExMS45NSAyODcuNTQ3IDExMi40MDYgMjg5LjIyNEMxMTIuNDExIDI4OS4yNDMgMTEyLjQxNiAyODkuMjU5IDExMi40MjIgMjg5LjI4QzExMi40NjIgMjg5LjQxOSAxMTIuNDk2IDI4OS41NTggMTEyLjUzOSAyODkuNjkxQzExMy4xNjggMjkxLjc4NyAxMTQuMDg4IDI5My40OTEgMTE1LjQ0NiAyOTQuNzU4QzExNi42NjIgMjk2LjA2NCAxMTguMjgzIDI5Ni45NjMgMTIwLjI2NCAyOTcuNjlDMTIwLjM2IDI5Ny42MTQgMTIwLjQ2NCAyOTcuNjQ2IDEyMC41NTUgMjk3LjY3NUMxMjAuNTYgMjk3LjY4IDEyMC41NiAyOTcuNjggMTIwLjU2NiAyOTcuNjhDMTIwLjg0OCAyOTcuNzY4IDEyMS4xNDIgMjk3Ljg0NiAxMjEuNDQzIDI5Ny45MjNDMTIxLjQ1NCAyOTcuOTIzIDEyMS40NjQgMjk3LjkyOCAxMjEuNDc4IDI5Ny45MzRDMTIyLjg3NSAyOTguMjcyIDEyNC40MjQgMjk4LjUwNyAxMjYuMTEgMjk4LjY3OEMxMjYuMzI2IDI5OC42OTYgMTI2LjU0MiAyOTguNzE4IDEyNi43NjMgMjk4LjczOUMxMzAuNzkgMjk5LjA4NiAxMzUuNTU4IDI5OS4wODggMTQwLjkwNCAyOTkuMjIyQzE1Mi45NzQgMjk4LjkxMiAxNjIuMTI4IDI5OS4zMDIgMTY2LjM2IDI5NC43NThDMTcwLjkwNCAyOTAuNTI2IDE3MC41MTUgMjgxLjM3MSAxNzAuODI0IDI2OS4zMDJDMTcwLjUxNSAyNTcuMjI3IDE3MC45MDcgMjQ4LjA3IDE2Ni4zNiAyNDMuODQzQzE2Mi4xMzEgMjM5LjI5OSAxNTIuOTc0IDIzOS42ODMgMTQwLjkwNCAyMzkuMzc2WiIgZmlsbD0iI0ZGNjM3NiI+PC9wYXRoPjxwYXRoIGQ9Ik0yMS4yMTU1IDEyOC4zOThDMTIuNjU1NSAxMjguNjE2IDYuMTY0ODQgMTI4LjMzOSAzLjE2NzUxIDEzMS41NkMtMC4wNTM4MjIyIDEzNC41NiAwLjIxODE3OCAxNDEuMDU0IC0wLjAwMDQ4ODI4MSAxNDkuNjA4QzAuMjE4MTc4IDE1OC4xNjggLTAuMDUzODIyMiAxNjQuNjU5IDMuMTY3NTEgMTY3LjY1NkM2LjE2NDg0IDE3MC44NzggMTIuNjU1NSAxNzAuNjA2IDIxLjIxNTUgMTcwLjgyNEMyNS4wMjYyIDE3MC43MjYgMjguNDI4OCAxNzAuNzI2IDMxLjI5NTUgMTcwLjQ3NUMzMi43OTY4IDE3MC4zNDIgMzQuMTQ4OCAxNzAuMTM2IDM1LjMzODIgMTY5LjgxNEMzNS4zNTQyIDE2OS44MTEgMzUuMzY0OCAxNjkuODA2IDM1LjM3ODIgMTY5LjgwM0MzNS40NzY4IDE2OS43NzQgMzUuNTc1NSAxNjkuNzQ3IDM1LjY2ODggMTY5LjcxOEMzNy4xNTY4IDE2OS4yNzIgMzguMzY0OCAxNjguNjIyIDM5LjI2MzUgMTY3LjY1NkM0MC4xOTE1IDE2Ni43OTUgNDAuODI2MiAxNjUuNjQ2IDQxLjI3MTUgMTY0LjI0M0M0MS4yODc1IDE2NC4xNzQgNDEuMzExNSAxNjQuMTAyIDQxLjMzMjggMTY0LjAzNUM0MS4zMzI4IDE2NC4wMzUgNDEuMzM1NSAxNjQuMDMyIDQxLjMzNTUgMTY0LjAyN0M0MS4zOTY4IDE2My44MjcgNDEuNDUyOSAxNjMuNjIyIDQxLjUwNjIgMTYzLjQwNkM0MS41MDYyIDE2My4zOTggNDEuNTExNSAxNjMuMzkyIDQxLjUxNDIgMTYzLjM4MkM0MS43NTQyIDE2Mi4zOTIgNDEuOTIyMiAxNjEuMjk0IDQyLjA0MjIgMTYwLjA5NkM0Mi4wNTU1IDE1OS45NDQgNDIuMDcxNSAxNTkuNzkyIDQyLjA4NDggMTU5LjYzNUM0Mi4zMzI4IDE1Ni43NzkgNDIuMzMyOCAxNTMuMzk4IDQyLjQyNjIgMTQ5LjYwOEM0Mi4yMDc1IDE0MS4wNTQgNDIuNDg0OCAxMzQuNTYgMzkuMjYzNSAxMzEuNTZDMzYuMjYzNSAxMjguMzM5IDI5Ljc3MjggMTI4LjYxNiAyMS4yMTU1IDEyOC4zOThaIiBmaWxsPSIjRkZDQ0NDIj48L3BhdGg+PHBhdGggZD0iTTgxLjA1OTUgMTg0LjE3MUM3MC44NTY4IDE4NC40MzMgNjMuMTIwOCAxODQuMTAyIDU5LjU0NzUgMTg3Ljk0MkM1NS43MDc1IDE5MS41MTggNTYuMDMyOCAxOTkuMjU0IDU1Ljc3NDIgMjA5LjQ1NEM1Ni4wMzI4IDIxOS42NTcgNTUuNzA3NSAyMjcuMzkzIDU5LjU0NzUgMjMwLjk2M0M2My4xMjA4IDIzNC44MDMgNzAuODU2OCAyMzQuNDc4IDgxLjA1OTUgMjM0LjczOUM4NS42MDA4IDIzNC42MjIgODkuNjU5NSAyMzQuNjIyIDkzLjA3MjggMjM0LjMyM0M5NC44NjQ4IDIzNC4xNjMgOTYuNDc1NSAyMzMuOTIxIDk3Ljg5NDIgMjMzLjUzNEM5Ny45MTAyIDIzMy41MjkgOTcuOTIzNSAyMzMuNTI2IDk3Ljk0MjIgMjMzLjUyMUM5OC4wNTY4IDIzMy40ODYgOTguMTc0MiAyMzMuNDU3IDk4LjI4ODggMjMzLjQyMkMxMDAuMDYgMjMyLjg4OSAxMDEuNSAyMzIuMTEzIDEwMi41NjkgMjMwLjk2M0MxMDMuNjc2IDIyOS45MzcgMTA0LjQzMyAyMjguNTY2IDEwNC45NjQgMjI2Ljg5NEMxMDQuOTg1IDIyNi44MTEgMTA1LjAxMiAyMjYuNzI2IDEwNS4wMzYgMjI2LjY0NkMxMDUuMDQxIDIyNi42NDMgMTA1LjA0MSAyMjYuNjQzIDEwNS4wNDEgMjI2LjYzOEMxMDUuMTE2IDIyNi40MDEgMTA1LjE4IDIyNi4xNTMgMTA1LjI0NCAyMjUuODk3QzEwNS4yNDQgMjI1Ljg4OSAxMDUuMjQ5IDIyNS44ODEgMTA1LjI1NCAyMjUuODY3QzEwNS41NCAyMjQuNjg5IDEwNS43NCAyMjMuMzc5IDEwNS44ODEgMjIxLjk1M0MxMDUuOSAyMjEuNzcxIDEwNS45MTYgMjIxLjU5IDEwNS45MzQgMjIxLjQwM0MxMDYuMjI4IDIxOC4wMDEgMTA2LjIyOCAyMTMuOTY5IDEwNi4zNDIgMjA5LjQ1NEMxMDYuMDgxIDE5OS4yNTQgMTA2LjQxMiAxOTEuNTE4IDEwMi41NzIgMTg3Ljk0MkM5OC45OTU1IDE4NC4xMDIgOTEuMjU2OCAxODQuNDMzIDgxLjA1OTUgMTg0LjE3MVoiIGZpbGw9IiNGRjkzOUYiPjwvcGF0aD48cGF0aCBkPSJNMjYwLjU5MSAxNTEuODdDMjE1LjY1MiAxNTEuODcgMjAzLjAyIDE2NC41MjMgMjAzLjAyIDIwOS40NjJIMTk4LjQ3NkMxOTguNDc2IDE2NC41MjMgMTg1LjgzNiAxNTEuODgxIDE0MC44OTUgMTUxLjg4MVYxNDcuMzM3QzE4NS44MzYgMTQ3LjMzNyAxOTguNDg3IDEzNC43MDUgMTk4LjQ4NyA4OS43NjU5SDIwMy4wMkMyMDMuMDIgMTM0LjcwNSAyMTUuNjUyIDE0Ny4zMzcgMjYwLjU5MSAxNDcuMzM3VjE1MS44N1pNMjg2LjA1MiAxMjQuMTU4QzI4MS44MiAxMTkuNjE0IDI3Mi42NiAxMjAuMDAxIDI2MC41OTEgMTE5LjY4OUMyNDguNTIxIDExOS4zODUgMjM5LjM2MSAxMTkuNzcxIDIzNS4xMjkgMTE1LjIyN0MyMzAuNTg1IDExMC45OTUgMjMwLjk4MyAxMDEuODQ2IDIzMC42NzEgODkuNzY1OUMyMzAuNTEzIDgzLjczMTIgMjMwLjUzNSA3OC40MjcyIDIzMC4wMjMgNzQuMTAxOUMyMjkuNTEzIDY5Ljc2NTkgMjI4LjQ4MSA2Ni40MjE5IDIyNi4yMDkgNjQuMzA0NkMyMjEuOTY3IDU5Ljc2MDYgMjEyLjgxNyA2MC4xNDcyIDIwMC43NDggNTkuODQ1OUMxODguNjgxIDYwLjE0NzIgMTc5LjUxOSA1OS43NjA2IDE3NS4yODcgNjQuMzA0NkMxNzAuNzUzIDY4LjUzNjYgMTcxLjEyOSA3Ny42OTY2IDE3MC44MjggODkuNzY1OUMxNzAuNTE2IDEwMS44MzUgMTcwLjkgMTEwLjk5NSAxNjYuMzU2IDExNS4yMjdDMTYyLjEyNCAxMTkuNzcxIDE1Mi45ODUgMTE5LjM3NCAxNDAuOTA1IDExOS42ODlDMTM4Ljg3MyAxMTkuNzM5IDEzNi45MjQgMTE5Ljc3MSAxMzUuMDcxIDExOS44MTFDMTE5LjMxMyAxMTguNjk3IDEwNi4zMzcgMTEyLjMxOCAxMDYuMzM3IDg5Ljc2NTlDMTA2LjIxMiA4NC42Njk5IDEwNi4yMzMgODAuMTc5MiAxMDUuODA3IDc2LjUyMDZDMTA1LjM2NyA3Mi44NzI2IDEwNC40OTIgNzAuMDM3OSAxMDIuNTc1IDY4LjI1NjZDOTkuMDAxMyA2NC40MTEyIDkxLjI1NzMgNjQuNzQ0NiA4MS4wNjUzIDY0LjQ4MzJDNzAuODYgNjQuNzQ0NiA2My4xMTg2IDY0LjQxMTIgNTkuNTUzMyA2OC4yNTY2QzU1LjcwOCA3MS44Mjk5IDU2LjAzMDYgNzkuNTYzMiA1NS43NjkzIDg5Ljc2NTlDNTYuMDMwNiA5OS45Njg2IDU1LjcwOCAxMDcuNzAyIDU5LjU1MzMgMTExLjI3OEM2My4xMTg2IDExNS4xMTMgNzAuODYgMTE0Ljc5IDgxLjA2NTMgMTE1LjA0OUMxMDMuNjE3IDExNS4wNDkgMTA5Ljk5NiAxMjguMDM1IDExMS4xIDE0My44MDNDMTExLjA2OCAxNDUuNjU5IDExMS4wMjggMTQ3LjU4NyAxMTAuOTc1IDE0OS42MTlDMTExLjEyMSAxNTQuOTg3IDExMS4xMjEgMTU5Ljc5IDExMS40NzYgMTYzLjgzNUMxMTEuNjYzIDE2NS45NSAxMTEuOTQ1IDE2Ny44NTcgMTEyLjQwNCAxNjkuNTM0QzExMi40MTIgMTY5LjU1NSAxMTIuNDEyIDE2OS41NjYgMTEyLjQyMyAxNjkuNTk4QzExMi40NjUgMTY5LjczNCAxMTIuNDk3IDE2OS44NjcgMTEyLjUzNyAxNzAuMDAzQzExMy4xNjQgMTcyLjA5OSAxMTQuMDkyIDE3My44MDkgMTE1LjQ0NyAxNzUuMDdDMTE2LjY2NSAxNzYuMzcxIDExOC4yODEgMTc3LjI3OCAxMjAuMjcxIDE3Ny45MDVDMTIwLjM2NCAxNzcuOTM0IDEyMC40NiAxNzcuOTU1IDEyMC41NjQgMTc3Ljk4N0MxMjAuODU1IDE3OC4wODEgMTIxLjE0NSAxNzguMTUzIDEyMS40MzkgMTc4LjIzOEMxMjEuNDYgMTc4LjIzOCAxMjEuNDcxIDE3OC4yMzggMTIxLjQ3OSAxNzguMjQ5QzEyMi44NzYgMTc4LjU4MiAxMjQuNDIgMTc4LjgyMiAxMjYuMTA4IDE3OC45ODdDMTI2LjMyNyAxNzkuMDA5IDEyNi41NDUgMTc5LjAzIDEyNi43NjQgMTc5LjA1MUMxMzAuNzg4IDE3OS4zOTUgMTM1LjU1OSAxNzkuMzk1IDE0MC45MDUgMTc5LjUyOUMxNTIuOTc1IDE3OS44NDMgMTYyLjEyNCAxNzkuNDU3IDE2Ni4zNTYgMTg0LjAwMUMxNzAuOSAxODguMjMzIDE3MC41MTYgMTk3LjM3MSAxNzAuODI4IDIwOS40NTFDMTcxLjEyOSAyMjEuNTI5IDE3MC43NDMgMjMwLjY4MSAxNzUuMjg3IDIzNC45MUMxNzkuNTE5IDIzOS40NTQgMTg4LjY4MSAyMzkuMDcgMjAwLjc0OCAyMzkuMzcxQzIwNi4xMjcgMjM5LjIzNSAyMTAuOTIxIDIzOS4yMzUgMjE0Ljk3NSAyMzguODgxQzIxNy4wNzkgMjM4LjY5NCAyMTguOTg1IDIzOC40MDMgMjIwLjY3NiAyMzcuOTU1QzIyMC42OTUgMjM3Ljk0NSAyMjAuNzA1IDIzNy45MzQgMjIwLjcyNyAyMzcuOTM0QzIyMC44NzMgMjM3Ljg5MSAyMjAuOTk5IDIzNy44NTkgMjIxLjEzNSAyMzcuODE5QzIyMy4yMjggMjM3LjE5MyAyMjQuOTM3IDIzNi4yNjUgMjI2LjIwOSAyMzQuOTFDMjI3LjUxMSAyMzMuNjkxIDIyOC40MDkgMjMyLjA2NSAyMjkuMDQ0IDIzMC4wOTdDMjI5LjA2NSAyMzAuMDAzIDIyOS4wOTUgMjI5Ljg5OSAyMjkuMTI3IDIyOS44MDNWMjI5Ljc5M0MyMjkuMjIgMjI5LjUxMyAyMjkuMjk1IDIyOS4yMjIgMjI5LjM2NyAyMjguOTE4QzIyOS4zNjcgMjI4Ljg5NyAyMjkuMzc3IDIyOC44OTcgMjI5LjM3NyAyMjguODc4QzIyOS43MjEgMjI3LjQ4MSAyMjkuOTUxIDIyNS45MzcgMjMwLjEyNyAyMjQuMjQ5QzIzMC4xMzcgMjI0LjAzIDIzMC4xNjkgMjIzLjgxMSAyMzAuMTkxIDIyMy41OTNDMjMwLjUzNSAyMTkuNTcxIDIzMC41MzUgMjE0Ljc5OCAyMzAuNjcxIDIwOS40NTFDMjMwLjk3MiAxOTcuMzcxIDIzMC41ODUgMTg4LjIzMyAyMzUuMTI5IDE4NC4wMDFDMjM5LjM2MSAxNzkuNDU3IDI0OC41MTEgMTc5Ljg0MyAyNjAuNTkxIDE3OS41MjlDMjcyLjY2IDE3OS4yMjcgMjgxLjgyIDE3OS42MTQgMjg2LjA1MiAxNzUuMDdDMjkwLjU5NiAxNzAuODM4IDI5MC4yMDkgMTYxLjY4OSAyOTAuNTExIDE0OS42MTlDMjkwLjIwOSAxMzcuNTM5IDI5MC41OTYgMTI4LjM3OSAyODYuMDUyIDEyNC4xNThaIiBmaWxsPSIjRkYzNTZBIj48L3BhdGg+PHBhdGggZD0iTTExMi40MDUgNDkuODQ4QzExMi40MTEgNDkuODY5NCAxMTIuNDE2IDQ5Ljg4MjcgMTEyLjQyMSA0OS45MDRDMTEyLjQ2MSA1MC4wNDI3IDExMi40OTkgNTAuMTgxNCAxMTIuNTM5IDUwLjMxNDdDMTEzLjE3MSA1Mi40MTM0IDExNC4wODggNTQuMTE0NyAxMTUuNDQ4IDU1LjM4NEMxMTYuNjYxIDU2LjY5MDcgMTE4LjI4MyA1Ny41ODk0IDEyMC4yNjQgNTguMjEzNEMxMjAuMzYgNTguMjQgMTIwLjQ2NCA1OC4yNjk0IDEyMC41NTUgNTguMzAxNEMxMjAuNTYgNTguMzA2NyAxMjAuNTYgNTguMzA2NyAxMjAuNTY1IDU4LjMwNjdDMTIwLjg0OCA1OC4zOTQ3IDEyMS4xNDEgNTguNDY5NCAxMjEuNDQzIDU4LjU0NjdDMTIxLjQ1MyA1OC41NDY3IDEyMS40NjQgNTguNTUyIDEyMS40OCA1OC41NTc0QzEyMi44NzUgNTguODk2IDEyNC40MjQgNTkuMTMzNCAxMjYuMTEyIDU5LjMwMTRDMTI2LjMyNSA1OS4zMjI3IDEyNi41NDEgNTkuMzQxNCAxMjYuNzYzIDU5LjM2MjdDMTMwLjc4OSA1OS43MTIgMTM1LjU2IDU5LjcxMiAxNDAuOTA0IDU5Ljg0NTRDMTUyLjk3MyA1OS41Mzg3IDE2Mi4xMjggNTkuOTI4IDE2Ni4zNiA1NS4zODRDMTcwLjkwNyA1MS4xNTIgMTcwLjUxNSA0MS45OTQ3IDE3MC44MjQgMjkuOTI1NEMxNzAuNTE3IDE3Ljg1MDcgMTcwLjkwNyA4LjY5NjAyIDE2Ni4zNjMgNC40NjkzNUMxNjIuMTMxIC0wLjA3NDY1MTEgMTUyLjk3MyAwLjMwOTM0OSAxNDAuOTA0IDEuNTI1ODhlLTA1QzEyOC44MjkgMC4zMDkzNDkgMTE5LjY3NSAtMC4wNzQ2NTExIDExNS40NDggNC40NjkzNUMxMTAuOTA0IDguNjk2MDIgMTExLjI4OCAxNy44NTA3IDExMC45NzkgMjkuOTI1NEMxMTEuMTE3IDM1LjMwMTQgMTExLjExNyA0MC4xMDE0IDExMS40NzIgNDQuMTQ0QzExMS42NjEgNDYuMjYxNCAxMTEuOTQ5IDQ4LjE3MDcgMTEyLjQwNSA0OS44NDhaIiBmaWxsPSIjRkY2Mzc2Ij48L3BhdGg+PC9nPjwvc3ZnPgo=",Portal:Zt}}}),function(){var e,t=this,n=t._self._c,o=t._self._setupProxy;return n("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[o.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":o.props.loading}],attrs:{"data-markstream-infographic":"1","data-markstream-mode":o.showSource?"source":o.infographicInstance?"preview":"pending"}},[o.props.showHeader?n("div",{staticClass:"infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",class:o.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[t.$slots["header-left"]?n("div",[t._t("header-left")],2):n("div",{staticClass:"flex items-center gap-x-2 overflow-hidden"},[n("img",{staticClass:"w-4 h-4 my-0",attrs:{src:o.infographicIconUrl,alt:"Infographic"}}),n("span",{staticClass:"text-sm font-medium font-mono truncate",class:o.props.isDark?"text-gray-400":"text-gray-600"},[t._v("Infographic")])]),t.$slots["header-center"]?n("div",[t._t("header-center")],2):o.props.showModeToggle?n("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:o.props.isDark?"bg-gray-700":"bg-gray-100"},[n("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[o.showSource?o.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":o.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>o.handleSwitchMode("preview"),mouseenter:function(e){o.onBtnHover(e,o.t("common.preview")||"Preview")},focus:function(e){o.onBtnHover(e,o.t("common.preview")||"Preview")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("div",{staticClass:"flex items-center gap-x-1"},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("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"}}),n("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),n("span",[t._v(t._s(o.t("common.preview")||"Preview"))])])]),n("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[o.showSource?o.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":o.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>o.handleSwitchMode("source"),mouseenter:function(e){o.onBtnHover(e,o.t("common.source")||"Source")},focus:function(e){o.onBtnHover(e,o.t("common.source")||"Source")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("div",{staticClass:"flex items-center gap-x-1"},[n("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"}},[n("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"}})]),n("span",[t._v(t._s(o.t("common.source")||"Source"))])])])]):t._e(),t.$slots["header-right"]?n("div",[t._t("header-right")],2):n("div",{staticClass:"flex items-center gap-x-1"},[o.props.showCollapseButton?n("button",{class:o.computedButtonStyle,attrs:{"aria-pressed":o.isCollapsed},on:{click:function(e){o.isCollapsed=!o.isCollapsed},mouseenter:function(e){o.onBtnHover(e,o.isCollapsed?o.t("common.expand")||"Expand":o.t("common.collapse")||"Collapse")},focus:function(e){o.onBtnHover(e,o.isCollapsed?o.t("common.expand")||"Expand":o.t("common.collapse")||"Collapse")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("svg",{staticClass:"w-3 h-3",style:{rotate:o.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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):t._e(),o.props.showCopyButton?n("button",{class:o.computedButtonStyle,on:{click:o.copy,mouseenter:function(e){return o.onCopyHover(e)},focus:function(e){return o.onCopyHover(e)},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[o.copyText?n("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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),n("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):t._e(),o.props.showExportButton?n("button",{class:`${o.computedButtonStyle} ${o.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:o.isFullscreenDisabled},on:{click:o.handleExportClick,mouseenter:function(e){o.onBtnHover(e,o.t("common.export")||"Export")},focus:function(e){o.onBtnHover(e,o.t("common.export")||"Export")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),n("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):t._e(),o.props.showFullscreenButton?n("button",{class:`${o.computedButtonStyle} ${o.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:o.isFullscreenDisabled},on:{click:o.handleOpenModalClick,mouseenter:function(e){o.onBtnHover(e,o.isModalOpen?o.t("common.minimize")||"Minimize":o.t("common.open")||"Open")},focus:function(e){o.onBtnHover(e,o.isModalOpen?o.t("common.minimize")||"Minimize":o.t("common.open")||"Open")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[o.isModalOpen?n("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"}},[n("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"}})]):n("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"}},[n("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._e()])]):t._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:!o.isCollapsed,expression:"!isCollapsed"}]},[o.showSource?n("div",{staticClass:"p-4",class:o.props.isDark?"bg-gray-900":"bg-gray-50"},[n("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:o.props.isDark?"text-gray-300":"text-gray-700"},[t._v(t._s(o.baseCode))])]):n("div",{staticClass:"relative"},[o.props.showZoomControls?n("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[n("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomIn,mouseenter:function(e){o.onBtnHover(e,o.t("common.zoomIn")||"Zoom in")},focus:function(e){o.onBtnHover(e,o.t("common.zoomIn")||"Zoom in")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomOut,mouseenter:function(e){o.onBtnHover(e,o.t("common.zoomOut")||"Zoom out")},focus:function(e){o.onBtnHover(e,o.t("common.zoomOut")||"Zoom out")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.resetZoom,mouseenter:function(e){o.onBtnHover(e,o.t("common.resetZoom")||"Reset zoom")},focus:function(e){o.onBtnHover(e,o.t("common.resetZoom")||"Reset zoom")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[t._v(" "+t._s(Math.round(100*o.zoom))+"% ")])])]):t._e(),n("div",{staticClass:"infographic-preview min-h-[360px] relative transition-all duration-100 overflow-hidden block",class:o.props.isDark?"bg-gray-900":"bg-gray-50",style:{height:o.containerHeight,maxHeight:null!=(e=o.props.maxHeight)?e:void 0},on:{mousedown:o.startDrag,mousemove:o.onDrag,mouseup:o.stopDrag,mouseleave:o.stopDrag,"&touchstart":function(e){return o.startDrag.apply(null,arguments)},"&touchmove":function(e){return o.onDrag.apply(null,arguments)},"&touchend":function(e){return o.stopDrag.apply(null,arguments)}}},[n("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":o.isDragging},style:o.transformStyle},[n("div",{ref:"infographicContainer",staticClass:"w-full text-center flex items-center justify-center min-h-full"})])])])]),n(o.Portal,{attrs:{to:"body"}},[n("div",{staticClass:"markstream-vue"},[n("transition",{attrs:{name:"infographic-dialog",appear:""}},[o.isModalOpen?n("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:o.closeModal.apply(null,arguments)}}},[n("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:o.props.isDark?"bg-gray-900":"bg-white"},[n("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomIn}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomOut}},[n("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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.resetZoom}},[t._v(" "+t._s(Math.round(100*o.zoom))+"% ")]),n("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.closeModal}},[n("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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),n("div",{ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",class:{"cursor-grab":!o.isDragging,"cursor-grabbing":o.isDragging},on:{mousedown:o.startDrag,mousemove:o.onDrag,mouseup:o.stopDrag,mouseleave:o.stopDrag,"&touchstart":function(e){return o.startDrag.apply(null,arguments)},"&touchmove":function(e){return o.onDrag.apply(null,arguments)},"&touchend":function(e){return o.stopDrag.apply(null,arguments)}}})])]):t._e()])],1)])],1)},[],!1,null,"4fbaa9a8",null,null).exports,gn=b(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},langs:{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},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:void 0}},emits:["previewCode","copy"],setup(e,{emit:t}){const n=e,{t:o}=ue(),r=p.ref(jt(n.node.language)),l=p.ref(!1),i=p.ref(!1),s=p.ref(!1),c=p.ref(null),m=p.ref(null),v=p.ref(null),h=p.ref(""),g=p.ref(!1),y=p.ref(!1);let w,x="",k=0,M=null;const b=p.ref(!0),C=p.ref(0),T=p.ref(14),N=p.ref(T.value),_=p.computed(()=>{const e=T.value,t=N.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0}),D=p.computed(()=>{const e=r.value.trim().toLowerCase();return e?Bt[e]||e.charAt(0).toUpperCase()+e.slice(1):Bt[""]||"Plain Text"}),S=p.computed(()=>(Nt.value,Lt(r.value.trim().toLowerCase().split(":")[0]))),I=p.computed(()=>{const e=r.value.trim().toLowerCase();return n.isShowPreview&&("html"===e||"svg"===e)}),j=p.computed(()=>{const e={},t=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},o=t(n.minWidth),r=t(n.maxWidth);return o&&(e.minWidth=o),r&&(e.maxWidth=r),e}),E=p.computed(()=>({fontSize:`${N.value}px`})),L=p.computed(()=>!1!==n.showTooltips);function B(){return n.isDark?n.darkTheme:n.lightTheme}function A(){return n.themes}function O(e){const t=e.match(/\d+(\.\d+)?/g);return!t||t.length<3?null:t.slice(0,3).map(Number)}function z(e){const t=O(e);if(!t)return null;const n=t.map(e=>{const t=e/255;return t<=.03928?t/12.92:a((t+.055)/1.055,2.4)});return.2126*n[0]+.7152*n[1]+.0722*n[2]}function P(e,t){const n=z(e),o=z(t);return null==n||null==o?null:(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function R(e){const t=O(e);if(!t)return n.isDark;const[o,r,l]=t;return.2126*o+.7152*r+.0722*l<140}function H(){var e;if("undefined"==typeof window||"function"!=typeof window.getComputedStyle)return;const t=c.value,o=v.value;if(!t||!o)return;const r=o.querySelector(".shiki")||o.querySelector("pre");if(!r)return;const l=window.getComputedStyle(r),i=r.querySelector("code")||r,a=window.getComputedStyle(i),s=String(l.backgroundColor||"").trim(),u=String(a.color||l.color||"").trim();s&&t.style.setProperty("--vscode-editor-background",s);const d=s?R(s):n.isDark,m=d?"rgb(229, 231, 235)":"rgb(17, 24, 39)",p=s&&u&&(null!=(e=P(u,s))?e:0)>=3?u:m;t.style.setProperty("--vscode-editor-foreground",p),t.style.setProperty("--markstream-code-fallback-selection-bg",d?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.06)"),t.style.setProperty("--vscode-editor-selectionBackground","var(--markstream-code-fallback-selection-bg)")}function $(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function U(e,t=!1){var n;M=null,X();const o=null==(n=m.value)?void 0:n.querySelector(".code-fallback-plain");return null==o||o.style.removeProperty("display"),e?!t&&y.value?(h.value="",void(g.value=!0)):(h.value=`<pre class="shiki shiki-fallback"><code>${$(e)}</code></pre>`,void(g.value=!1)):(W(),h.value="",g.value=!1,y.value=!1,void(x=""))}function F(){var e;h.value="",g.value=!0,y.value=!0;const t=null==(e=m.value)?void 0:e.querySelector(".code-fallback-plain");t&&(t.style.display="none"),p.nextTick().then(()=>d(this,null,function*(){yield p.nextTick(),!h.value&&g.value&&(g.value=!1,g.value=!0),H()}))}function Y(){M=null,X(),y.value&&(h.value="",g.value=!0)}function W(){v.value&&(v.value.innerHTML="")}function K(){var e;const t=v.value;return!!t&&(t.childNodes.length>0||Boolean(null==(e=t.textContent)?void 0:e.trim().length))}function V(e,t,n){return`${null!=e?e:""}\0${t}\0${n}`}function Q(e){x=e,F()}function X(e){null==e||e.disconnect(),e&&w!==e||(w=void 0)}function q(e,t){X();const n=v.value;if(!n||"undefined"==typeof MutationObserver)return;M=null;const o=new MutationObserver(()=>{k+=1;const n=M;if(n)return ke(e)?void(k!==t&&K()&&(M=null,X(o),Q(n))):(M=null,void X(o))});w=o,o.observe(n,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}function Z(e,t,n,o){return d(this,null,function*(){var r;if(M=n,yield p.nextTick(),!ke(e))return;const l=K(),i=k!==t,a=void 0!==o&&(null==(r=v.value)?void 0:r.innerHTML)!==o;l&&(!x||i||a||x===n)&&(M=null,X(),Q(n))})}let G,J,ee,te,ne,oe=null,re=!1,ae=null,se="",ce=0,de=0,me=!1;const pe=new Set,fe=new Set,ve=new Set,he=!1;let ge=null,ye=!1,we=!1;function xe(){return de+=1,de}function ke(e=de){return!me&&e===de}function Me(e={}){const t=G;G=void 0,oe=null,J=void 0,x="",M=null,fe.clear();try{null==t||t.dispose()}catch(n){}finally{W(),g.value=!1,e.resetStableRender&&(y.value=!1)}}function be(){return d(this,null,function*(){if(!G)return;const e=_e();J!==e&&(yield G.setTheme(e),J=e)})}function Ce(){const e=_e();G&&e!==J&&!re&&(re=!0,p.nextTick(()=>{re=!1,He()}))}function Te(){if(ee||"undefined"==typeof MutationObserver)return;const e=c.value;e&&(ee=new MutationObserver(()=>{Ce()}),ee.observe(e,{attributes:!0,attributeFilter:["data-markstream-code-theme"]}))}function Ne(){null==ee||ee.disconnect(),ee=void 0}function _e(){var e;return(null==(e=c.value)?void 0:e.getAttribute("data-markstream-code-theme"))||B()}const De=p.computed(()=>f.getHighlightRegistrationKey(A(),n.langs));function Se(){return{hasRegisterHighlight:Boolean(ne),hasCreateRenderer:Boolean(te)}}function Ie(e,t){var n;const o=Se(),r=f.getRuntimeShikiRegistrationConfig(e,t,o);return(null==(n=r.rendererOptions.langs)?void 0:n.length)&&ve.has(r.key)?f.getRuntimeShikiRegistrationConfig(e,void 0,o):r}function je(){const e=Ie(A(),n.langs);return Boolean(G&&oe!==e.key)}function Ee(e){return f.normalizeShikiLanguage(e)||"plaintext"}function Le(e,t){return d(this,arguments,function*(e,t,n=de){if(!G||!ke(n))return;const o=Ee(t),r=t=>d(this,null,function*(){if(G&&ke(n)){"plaintext"!==o&&t&&fe.add(o);try{return yield G.updateCode(e,"plaintext"),ke(n)?"plaintext":void 0}catch(r){return void ke(n)}}});if("plaintext"!==o&&fe.has(o))return r();try{return yield G.updateCode(e,o),ke(n)?o:void 0}catch(l){if(!ke(n))return;return"plaintext"!==o?r(l):void 0}})}function Be(e,t){return d(this,null,function*(){if(!ne)return"ready";if(se!==t)return"stale";if(ae===t)return"ready";const n=++ce;try{yield f.registerHighlightOnce(ne,e,t)}catch(o){return n!==ce||se!==t?"stale":"failed"}return n!==ce||se!==t?"stale":(ae=t,"ready")})}function Ae(e,t){return d(this,null,function*(){const n=yield Be(e,t);return"failed"!==n?n:se!==t?"stale":Be(e,t)})}function Oe(){return d(this,null,function*(){if(!te&&!ye)return ge||(ge=(()=>d(this,null,function*(){try{const e=yield import("stream-markdown"),t=e.createShikiStreamRenderer;if("function"!=typeof t)throw new TypeError("stream-markdown.createShikiStreamRenderer is not available");te=t;const n=e.registerHighlight;ne="function"==typeof n?n:void 0,ye=!1,we=!1}catch(e){ye=!0}finally{ge=null}}))(),ge)})}function ze(e){return d(this,null,function*(){var t,o;if(!ke(e))return;if(yield Oe(),!ke(e))return;if(!m.value||!v.value)return void U(n.node.code,!0);let r=Ie(A(),n.langs);r.ignoredLangs;let l=r.rendererOptions,i=r.key;se=i;let a=Boolean(G&&oe!==i);a&&U(n.node.code,!y.value);let s=yield Ae(r.registerOptions,i);if("failed"===s&&(null==(t=l.langs)?void 0:t.length)&&(ve.add(i),r=f.getRuntimeShikiRegistrationConfig(A(),void 0,Se()),l=r.rendererOptions,i=r.key,se=i,s=yield Ae(r.registerOptions,i)),!ke(e)||"stale"===s)return;if(a=Boolean(G&&oe!==i),"failed"===s)return void(a&&G&&K()?F():U(n.node.code,!0));if(a&&Me({resetStableRender:!0}),!G&&te){const e=_e();G=te(v.value,u({theme:e},l)),J=e,oe=i,g.value=!0}if(!G)return void U(n.node.code,!0);if(!1===n.stream&&n.loading)return void U(n.node.code,!y.value);U(n.node.code,!y.value);const c=k,d=null==(o=v.value)?void 0:o.innerHTML;q(e,c);const p=yield Le(n.node.code,n.node.language,e);return ke(e)?p?void(y.value?Y():yield Z(e,c,V(i,p,n.node.code),d)):(M=null,X(),void Y()):void 0})}function Pe(){return d(this,arguments,function*(e=xe()){try{yield ze(e)}catch(t){if(!ke(e))return;U(n.node.code,!y.value)}})}function Re(){me=!0,de+=1,null==w||w.disconnect(),w=void 0,Ne(),M=null,Me({resetStableRender:!0})}function He(){return d(this,null,function*(){m.value&&v.value&&(G||(yield Pe()),yield be(),H())})}function $e(e,t=50){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function Ue(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}return U(n.node.code,!0),p.getCurrentInstance()?(p.onMounted(()=>{Te(),Pe()}),p.onBeforeUnmount(Re)):p.nextTick(()=>d(this,null,function*(){yield p.nextTick(),Te(),yield Pe(),!x&&K()&&Q(V(null!=oe?oe:De.value,Ee(n.node.language),n.node.code))})),p.watch(De,()=>d(this,null,function*(){yield Pe()})),p.watch(()=>n.loading,e=>{e||Pe()}),p.watch(L,e=>{e||ie()}),p.watch(()=>[n.node.code,n.node.language],e=>d(this,[e],function*([e,t]){var o;const l=xe(),i=jt(t);if(i!==r.value&&(r.value=i),!m.value||!v.value)return void U(e,!0);if(!e)return void U("");if(!G||je())return U(e,!y.value),void(yield Pe(l));if(!ke(l))return;if(!G)return;if(!1===n.stream&&n.loading)return;U(e,!y.value);const a=k,s=null==(o=v.value)?void 0:o.innerHTML;q(l,a);const u=yield Le(e,t,l);return ke(l)?u?void(y.value?Y():yield Z(l,a,V(null!=oe?oe:De.value,u,e),s)):(M=null,X(),void Y()):void 0})),p.watch(()=>n.node.code,()=>d(this,null,function*(){if(i.value||!b.value)return;yield p.nextTick();const e=m.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),{__sfc:!0,props:n,emits:t,t:o,codeLanguage:r,copyText:l,isExpanded:i,isCollapsed:s,container:c,codeBlockContent:m,rendererTarget:v,fallbackHtml:h,rendererReady:g,hasStableRender:y,renderObserver:w,lastCommittedRenderSignature:x,rendererMutationVersion:k,pendingRenderSignature:M,autoScrollEnabled:b,lastScrollTop:C,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:T,codeFontSize:N,fontBaselineReady:_,displayLanguage:D,languageIcon:S,isPreviewable:I,containerStyle:j,contentStyle:E,tooltipsEnabled:L,getPreferredColorScheme:B,getResolvedThemes:A,getColorChannels:O,getRelativeLuminance:z,getContrastRatio:P,isDarkBackgroundColor:R,syncRenderedCssVars:H,escapeHtml:$,renderFallback:U,clearFallback:F,keepLastSuccessfulRender:Y,clearRendererTarget:W,hasRendererContent:K,getRenderSignature:V,markRendererCommitted:Q,disconnectReadyObserver:X,startRendererReadyObserver:q,clearFallbackWhenRendererReady:Z,renderer:G,rendererConfigKey:oe,rendererTheme:J,rendererThemeSyncQueued:re,rendererThemeObserver:ee,createShikiRenderer:te,registerHighlight:ne,registeredHighlightKey:ae,latestHighlightRegistrationKey:se,highlightRegistrationSeq:ce,renderEpoch:de,disposed:me,warnedRendererErrors:pe,failedRendererLanguages:fe,failedHighlightRegistrationKeys:ve,isDevEnv:he,warnedMissingRegisterHighlightForLangs:!1,streamMarkdownLoadPromise:ge,streamMarkdownLoadFailed:ye,warnedStreamMarkdownUnavailable:we,nextRenderEpoch:xe,isCurrentRenderEpoch:ke,disposeCurrentRenderer:Me,syncRendererTheme:be,queueRendererThemeChange:Ce,startRendererThemeObserver:Te,disconnectRendererThemeObserver:Ne,getRenderedColorScheme:_e,highlightRegistrationKey:De,getShikiRuntimeCapabilities:Se,getRuntimeConfigWithFailedLangsFallback:Ie,rendererNeedsReconfigure:je,normalizeRendererLanguage:Ee,updateRendererWithFallback:Le,ensureHighlightRegistered:Be,waitForCurrentHighlightRegistration:Ae,ensureStreamMarkdownLoaded:Oe,initRenderer:ze,safeInitRenderer:Pe,cleanupRenderer:Re,handleRendererThemeChange:He,isAtBottom:$e,handleScroll:function(){const e=m.value;if(!e||i.value)return;const t=e.scrollTop;t<C.value?b.value=!1:$e(e)&&(b.value=!0),C.value=t},copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(n.node.code)),l.value=!0,t("copy",n.node.code),setTimeout(()=>{l.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})},resolveTooltipTarget:Ue,onBtnHover:function(e,t,o="top"){if(!L.value)return;const r=Ue(e);if(!r)return;const l=e;le(r,t,o,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,n.isDark)},onBtnLeave:function(){L.value&&ie()},onCopyHover:function(e){if(!L.value)return;const t=Ue(e);if(!t)return;const r=e;le(t,l.value?o("common.copied")||"Copied":o("common.copy")||"Copy","top",!1,null!=(null==r?void 0:r.clientX)&&null!=(null==r?void 0:r.clientY)?{x:r.clientX,y:r.clientY}:void 0,n.isDark)},toggleExpand:function(e){if(i.value=!i.value,e&&L.value){const t=Ue(e);t&&le(t,i.value?o("common.collapse")||"Collapse":o("common.expand")||"Expand","top",!1,void 0,n.isDark)}const t=m.value;t&&(i.value?(t.style.maxHeight="none",t.style["overflow-y"]="visible",t.style["overflow-x"]="auto"):(t.style.maxHeight="500px",t.style.overflow="auto",b.value=!0,p.nextTick(()=>{t.scrollHeight>t.clientHeight&&(t.scrollTop=t.scrollHeight)})))},toggleHeaderCollapse:function(){s.value=!s.value},increaseCodeFont:function(){const e=Math.min(36,N.value+1);N.value=e},decreaseCodeFont:function(){const e=Math.max(10,N.value-1);N.value=e},resetCodeFont:function(){N.value=T.value},previewCode:function(){if(!I.value)return;const e=jt(r.value||n.node.language).toLowerCase(),o="html"===e?"HTML Preview":"SVG Preview";t("previewCode",{type:"html"===e?"text/html":"image/svg+xml",content:n.node.code,title:o})}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return 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",n.props.isDark?"is-dark":""],style:c(u({},n.containerStyle),{backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg))",color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))"}),attrs:{"data-markstream-code-theme":n.props.isDark?n.props.darkTheme:n.props.lightTheme}},[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, var(--markstream-code-fallback-fg))","background-color":"var(--vscode-editor-background, var(--markstream-code-fallback-bg))"}},[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"},[n.props.showCollapseButton?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"}})])]):e._e(),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:function(e){return n.toggleExpand(e)},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:"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(),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&&n.fallbackHtml?t("div",{staticClass:"code-fallback-plain",domProps:{innerHTML:e._s(n.fallbackHtml)}}):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[e._m(0)]},{loading:e.loading,stream:e.stream})],2)])},[function(){var e=this._self._c;return this._self._setupProxy,e("div",{staticClass:"loading-skeleton"},[e("div",{staticClass:"skeleton-line"}),e("div",{staticClass:"skeleton-line"}),e("div",{staticClass:"skeleton-line short"})])}],!1,null,"fbed7233",null,null).exports,yn=b(p.defineComponent({name:"MarkdownRender",components:{LegacyNodesRenderer:Rt,NodeRenderer:Qt},props:{content:String,nodes:Array,final:Boolean,parseOptions:Object,customMarkdownIt:Function,debugPerformance:Boolean,customHtmlTags:Array,viewportPriority:Boolean,codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMonacoOptions:Object,renderCodeBlocksAsPre:Boolean,codeBlockMinWidth:[String,Number],codeBlockMaxWidth:[String,Number],codeBlockProps:Object,showTooltips:Boolean,themes:Array,langs:Array,isDark:Boolean,customId:[String,Number],indexKey:[String,Number],typewriter:Boolean,fade:{type:Boolean,default:!0},batchRendering:Boolean,initialRenderBatchSize:Number,renderBatchSize:Number,renderBatchDelay:Number,renderBatchBudgetMs:Number,renderBatchIdleTimeoutMs:Number,deferNodesUntilVisible:Boolean,maxLiveNodes:Number,liveNodeBuffer:Number},data(){return{instanceMsgId:this.customId?`renderer-${this.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`}},computed:{legacyVue26(){return x(this)},mergedParseOptions(){var e,t;const n=null!=(e=this.parseOptions)?e:{},o=null!=(t=this.final)?t:n.final,r=m.mergeCustomHtmlTags(this.customHtmlTags,n.customHtmlTags),l=null!=o,i=r.length>0;return l||i?u(u(u({},n),l?{final:o}:{}),i?{customHtmlTags:r}:{}):n},parsedLegacyNodes(){var e;if(Array.isArray(this.nodes)&&this.nodes.length>0)return this.nodes;if(!this.content)return[];const{key:t,tags:n}=m.resolveCustomHtmlTags(null==(e=this.mergedParseOptions)?void 0:e.customHtmlTags),o=m.getMarkdown(t?`${this.instanceMsgId}:${t}`:this.instanceMsgId,{customHtmlTags:n}),r=this.customMarkdownIt?this.customMarkdownIt(o):o;return m.parseMarkdownToStructure(this.content,r,this.mergedParseOptions)},forwardedProps(){return{content:this.content,nodes:this.nodes,final:this.final,parseOptions:this.parseOptions,customMarkdownIt:this.customMarkdownIt,debugPerformance:this.debugPerformance,customHtmlTags:this.customHtmlTags,viewportPriority:this.viewportPriority,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,codeBlockMonacoOptions:this.codeBlockMonacoOptions,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockProps:this.codeBlockProps,showTooltips:this.showTooltips,themes:this.themes,langs:this.langs,isDark:this.isDark,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,fade:this.fade,batchRendering:this.batchRendering,initialRenderBatchSize:this.initialRenderBatchSize,renderBatchSize:this.renderBatchSize,renderBatchDelay:this.renderBatchDelay,renderBatchBudgetMs:this.renderBatchBudgetMs,renderBatchIdleTimeoutMs:this.renderBatchIdleTimeoutMs,deferNodesUntilVisible:this.deferNodesUntilVisible,maxLiveNodes:this.maxLiveNodes,liveNodeBuffer:this.liveNodeBuffer}}},render(e){const t=M(this);return this.legacyVue26?e(Rt,u({props:{nodes:this.parsedLegacyNodes,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,fade:this.fade,showTooltips:this.showTooltips,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,codeBlockMonacoOptions:this.codeBlockMonacoOptions,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockProps:this.codeBlockProps,themes:this.themes,langs:this.langs,isDark:this.isDark}},Object.keys(t).length>0?{on:t}:{})):e(Qt,u({props:this.forwardedProps},Object.keys(t).length>0?{on:t}:{}))}}),null,null,!1,null,null,null,null).exports,wn=new Map;function xn(e,t){if(wn.delete(e),wn.set(e,t),wn.size>200){const e=wn.keys().next().value;e&&wn.delete(e)}}function kn(e){if(!e)return null;const t=wn.get(e)||null;return t&&xn(e,t),t}function Mn(e,t){e&&t&&xn(e,{html:t})}function bn(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Cn=null,Tn=null,Nn=!1;const _n=new Map,Dn=new Map;let Sn=5;const In=new Set;function jn(){if(_n.size<Sn&&In.size){const t=Array.from(In);In.clear();for(const n of t)try{n()}catch(e){}}}let En=null;const Ln=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV);try{"undefined"!=typeof window&&Ln&&Promise.resolve().then(()=>require("./chunks/performance-monitor-698d0e66.cjs")).then(e=>{En=e.perfMonitor})}catch(yo){}function Bn(e,t=!0,n=2e3,o){return d(this,null,function*(){const r=performance.now(),l=bn(e);if(!ye()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(Tn)return Promise.reject(Tn);const i=`${t?"d":"i"}:${l}`,a=Dn.get(i);if(a)return En&&En.recordRender({type:"cache-hit",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!0}),Promise.resolve(a);const s=Cn||(Tn=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Tn.name="WorkerInitError",Tn.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Tn);if(_n.size>=Sn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=_n.size,e.max=Sn,En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(e)}return new Promise((e,i)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void i(e)}const a=Math.random().toString(36).slice(2),u=globalThis.setTimeout(()=>{_n.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:"timeout"}),i(e),jn()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(u),_n.has(a)&&_n.delete(a);const e=new Error("Aborted");e.name="AbortError",i(e),jn()},{once:!0});const c=e,d=i;_n.set(a,{resolve:e=>{En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!0}),c(e)},reject:e=>{En&&En.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:(null==e?void 0:e.message)||String(e)}),d(e)},timeoutId:u}),s.postMessage({id:a,content:l,displayMode:t})})})}function An(e,t=!0,n){const o=`${t?"d":"i"}:${bn(e)}`;if(Dn.set(o,n),Dn.size>200){const e=Dn.keys().next().value;Dn.delete(e)}}const On="WORKER_BUSY";function zn(e=2e3,t){return _n.size<Sn?Promise.resolve():new Promise((n,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),In.delete(i),n())};if(In.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,In.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>jn()),t){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),In.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const Pn={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Rn(e){return d(this,arguments,function*(e,t=!0,n={}){var o,r,l,i;if(!ye()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=n.timeout)?o:Pn.timeout,s=null!=(r=n.waitTimeout)?r:Pn.waitTimeout,u=null!=(l=n.backoffMs)?l:Pn.backoffMs,c=null!=(i=n.maxRetries)?i:Pn.maxRetries,d=Number.isFinite(c)?Math.max(0,Math.min(Math.floor(c),8)):Pn.maxRetries,m=n.signal;let p=0;for(;;){if(null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield Bn(e,t,a,m)}catch(f){if((null==f?void 0:f.code)!==On||p>=d)throw f;if(p++,yield zn(s,m).catch(()=>{}),null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*p)))}}})}const Hn=b(p.defineComponent({__name:"MathBlockNode",props:{node:null,indexKey:null},setup(e){const t=e,n=p.computed(()=>bn(t.node.content)),o=p.ref(null),r=Fe();let l=null,i=0,a=!1,s=null;const u=p.computed(()=>null==t.indexKey?null:`block:${String(t.indexKey)}`),c=kn(u.value),m=p.ref((null==c?void 0:c.html)||""),f=p.ref(""),v=p.ref(!(null==c?void 0:c.html));let h=Boolean(null==c?void 0:c.html);function g(){return d(this,null,function*(){const e=yield we();if(!e)return!1;try{const o=e.renderToString(n.value,{throwOnError:t.node.loading,displayMode:!0});return y(o),An(n.value,!0,o),!0}catch(yo){return!1}})}function y(e){m.value=e,f.value="",v.value=!1,h=!0,Mn(u.value,e)}function w(){m.value="",f.value=t.node.raw,v.value=!1}function x(){return d(this,null,function*(){if(a)return;if(!t.node.content)return w(),void(h=!0);const e=kn(u.value);if((null==e?void 0:e.html)&&!m.value&&(m.value=e.html,h=!0,v.value=!1),!h){v.value=!0;try{!l&&o.value&&(l=r(o.value)),yield null==l?void 0:l.whenVisible}catch(yo){}}s&&(s.abort(),s=null);const c=++i,d=new AbortController;s=d;try{const e=yield Rn(n.value,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:d.signal});if(a||c!==i)return;y(e)}catch(p){if(a||c!==i)return;if("AbortError"===(null==p?void 0:p.name))return;const e=(null==p?void 0:p.code)||(null==p?void 0:p.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==p?void 0:p.fallbackToRenderer)||e===On||"WORKER_TIMEOUT"===e)&&(yield g()))return;if(h||m.value)return;n||!t.node.loading?w():v.value=!0}})}return p.watch(()=>[t.node.content,t.node.loading,t.node.raw,t.indexKey],()=>x()),p.onMounted(()=>{x()}),p.onBeforeUnmount(()=>{var e;a=!0,s&&(s.abort(),s=null),null==(e=null==l?void 0:l.destroy)||e.call(l),l=null}),{__sfc:!0,props:t,mathContent:n,containerEl:o,registerVisibility:r,visibilityHandle:l,currentRenderId:i,isUnmounted:a,currentAbortController:s,cacheKey:u,initialCached:c,renderedHtml:m,fallbackText:f,renderingLoading:v,hasRenderedOnce:h,renderWithMainThreadFallback:g,applySuccessfulRender:y,applyRawFallback:w,renderMath:x}}}),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]"},[n.renderedHtml?t("div",{staticClass:"math-block__content",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("div",{staticClass:"math-block__fallback"},[e._v(" "+e._s(n.fallbackText)+" ")]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():t("div",{staticClass:"math-loading-overlay"},[t("div",{staticClass:"math-loading-spinner"})])])},[],!1,null,"50fb5666",null,null).exports,$n=b(p.defineComponent({__name:"MathInlineNode",props:{node:null,indexKey:null},setup(e){const t=e,n=p.ref(null),o=Fe();let r=null,l=0,i=!1,a=null;const s=p.computed(()=>"$$"===t.node.markup),u=p.computed(()=>bn(t.node.content)),c=p.computed(()=>null==t.indexKey?null:`inline:${String(t.indexKey)}`),m=kn(c.value),f=p.ref((null==m?void 0:m.html)||""),v=p.ref(""),h=p.ref(!(null==m?void 0:m.html));let g=Boolean(null==m?void 0:m.html);function y(){return d(this,null,function*(){const e=yield we();if(!e)return!1;try{const n=e.renderToString(u.value,{throwOnError:t.node.loading,displayMode:s.value});return w(n),An(u.value,s.value,n),!0}catch(yo){return!1}})}function w(e){f.value=e,v.value="",h.value=!1,g=!0,Mn(c.value,e)}function x(){f.value="",v.value=t.node.raw,h.value=!1}function k(){return d(this,null,function*(){if(i)return;if(!t.node.content)return x(),void(g=!0);const e=kn(c.value);(null==e?void 0:e.html)&&!f.value&&(f.value=e.html,g=!0,h.value=!1),a&&(a.abort(),a=null);const d=++l,m=new AbortController;if(a=m,!g){h.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(yo){}}try{const e=yield Rn(u.value,s.value,{timeout:1500,waitTimeout:0,maxRetries:0,signal:m.signal});if(i||d!==l)return;w(e)}catch(p){if(i||d!==l)return;if("AbortError"===(null==p?void 0:p.name))return;const e=(null==p?void 0:p.code)||(null==p?void 0:p.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==p?void 0:p.fallbackToRenderer)||e===On||"WORKER_TIMEOUT"===e)&&(yield y()))return;if(g||f.value)return;n||!t.node.loading?x():h.value=!0}})}return p.watch(()=>[t.node.content,t.node.loading,t.node.markup,t.node.raw,t.indexKey],()=>k()),p.onMounted(()=>{k()}),p.onBeforeUnmount(()=>{var e;i=!0,a&&(a.abort(),a=null),null==(e=null==r?void 0:r.destroy)||e.call(r),r=null}),{__sfc:!0,props:t,containerEl:n,registerVisibility:o,visibilityHandle:r,currentRenderId:l,isUnmounted:i,currentAbortController:a,displayMode:s,mathContent:u,cacheKey:c,initialCached:m,renderedHtml:f,fallbackText:v,renderingLoading:h,hasRenderedOnce:g,renderWithMainThreadFallback:y,applySuccessfulRender:w,applyRawFallback:x,renderMath:k}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{ref:"containerEl",staticClass:"math-inline-wrapper"},[n.renderedHtml?t("span",{staticClass:"math-inline",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("span",{staticClass:"math-inline math-inline--fallback"},[e._v(e._s(n.fallbackText))]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():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)])},[],!1,null,"d2f0cfa6",null,null).exports,Un=()=>import("mermaid");let Fn=null,Yn=Un;function Wn(e){Yn=e,Fn=null}function Kn(){return"function"==typeof Yn}function Vn(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 c(u({},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 Qn(e){if(e)try{const t=null==e?void 0:e.initialize;e.initialize=n=>{const o=u({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(yo){}}let Xn=null,qn=null;const Zn=new Map;let Gn=5,Jn=!1;const eo="WORKER_BUSY",to="MERMAID_DISABLED";function no(e,t,n=1400){if(!Kn()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=to,Promise.reject(e)}if(qn)return Promise.reject(qn);const o=Xn||(qn=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),qn.name="WorkerInitError",qn.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(qn);if(Zn.size>=Gn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=eo,e.inFlight=Zn.size,e.max=Gn,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),Zn.delete(i))},c={resolve:e=>{u(),r(e)},reject:e=>{u(),l(e)}};Zn.set(i,c);try{o.postMessage({id:i,action:e,payload:t})}catch(d){return Zn.delete(i),void l(d)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=Zn.get(i);t&&t.reject(e)},n)})}function oo(e,t,n=1400){return d(this,null,function*(){try{return yield no("canParse",{code:e,theme:t},n)}catch(yo){return Promise.reject(yo)}})}function ro(e,t,n=1400){return d(this,null,function*(){try{return yield no("findPrefix",{code:e,theme:t},n)}catch(yo){return Promise.reject(yo)}})}function lo(){if(Xn)try{for(const[e,t]of Zn.entries())t.reject(new Error("Worker terminated"));Zn.clear(),Xn.terminate()}finally{Xn=null}}const io=b(p.defineComponent({__name:"MermaidBlockNode",props:{node:null,maxHeight:{default:"500px"},estimatedPreviewHeightPx:null,loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},renderDebounceMs:{default:300},contentStableDelayMs:{default:500},previewPollDelayMs:{default:800},previewPollMaxDelayMs:{default:4e3},previewPollMaxAttempts:{default:12},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:!0},enableMermaidInteractions:{type:Boolean,default:!1},onRenderError:null},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"),s=p.computed(()=>({startOnLoad:!1,securityLevel:a.value,dompurifyConfig:"strict"===a.value?l:void 0,flowchart:"strict"===a.value?{htmlLabels:!1}:void 0}));function f(e,t){if(!e)return null;const n=m.toSafeSvgElement(t);return n?(v(e),e.appendChild(n),{svg:e.innerHTML,bindTarget:e}):null}function v(e){if(e)try{e.replaceChildren()}catch(yo){e.innerHTML=""}}function g(e,t,n={}){if(!e)return null;const o=f(e,t);return o||n.keepPreviousOnFailure||v(e),o}let y=null;function w(e){if(r.enableMermaidInteractions&&(null==e?void 0:e.querySelector("svg")))try{null==y||y(e)}catch(yo){}}const{t:x}=ue();function k(){return d(this,null,function*(){try{const e=yield function(){return d(this,null,function*(){if(Fn)return Fn;const e=function(){try{const e=globalThis;return Vn(null==e?void 0:e.mermaid)}catch(yo){return null}}();if(e)return Fn=e,Qn(Fn),Fn;const t=Yn;if(!t)return null;let n;try{n=yield t()}catch(o){if(t===Un)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return n?(Fn=Vn(n),Qn(Fn),Fn):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 k();if(!t)return;null==(e=null==t?void 0:t.initialize)||e.call(t,u({},s.value))}catch(t){i.value=!1,console.warn("[markstream-vue2] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",t)}})})();const M=p.ref(!1),b=p.ref(!1),C=p.ref(),T=p.ref(),N=p.ref(),_=p.ref(null),D=Fe();let S=null;const I=p.ref("undefined"==typeof window),j=p.ref(),E=p.computed(()=>r.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),L=p.computed(()=>r.maxHeight&&"none"!==r.maxHeight?Ut(r.maxHeight):null),B=p.computed(()=>{var e;return Kt(null!=(e=Ut(r.estimatedPreviewHeightPx))?e:Ft(E.value),void 0,L.value)});function A(e,t=E.value){const n=t,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return n.trim().startsWith("%%{")?n:o+n}function O(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const o=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==o?void 0:o[1])?void 0:t.toLowerCase())||""}return""}const z=p.ref(1),P=p.ref(0),R=p.ref(0),H=p.ref(!1),$=p.ref({x:0,y:0}),U=p.ref("undefined"==typeof window),F=p.ref(!1),Y=p.ref(!1),W=p.ref(null),K=p.ref(0),V=p.ref(!1),Q=p.computed(()=>{var e;return Math.max(0,null!=(e=r.renderDebounceMs)?e:300)}),X=p.computed(()=>{var e;return Math.max(0,null!=(e=r.contentStableDelayMs)?e:500)}),q=p.computed(()=>{var e;return Math.max(120,null!=(e=r.previewPollDelayMs)?e:800)}),Z=p.computed(()=>{var e;return Math.max(q.value,null!=(e=r.previewPollMaxDelayMs)?e:4e3)}),G=p.computed(()=>{var e;return Math.max(1,Math.trunc(null!=(e=r.previewPollMaxAttempts)?e:12))});let J=null,ee=null,te=null,ne=0;const oe=null!=(n=globalThis.requestIdleCallback)?n:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16);function re(){return I.value&&!b.value}function ae(){null!=te&&(globalThis.clearTimeout(te),te=null)}function se(){ae(),te=globalThis.setTimeout(()=>{te=null,re()&&oe(()=>{re()&&st()},{timeout:500})},Q.value)}function ce(){null!=ee&&(globalThis.clearTimeout(ee),ee=null)}function de(e=600){if("undefined"==typeof globalThis)return;const t=Math.max(0,e);ce(),ee=globalThis.setTimeout(()=>{ee=null,r.loading||Y.value||!re()?de(Math.min(1200,Math.max(300,1.2*t))):se()},t)}const me=p.ref(`${B.value}px`);let pe=null;p.watch(B,e=>{if(U.value||b.value)return;const t=Ut(me.value);(null==t||t<e)&&(me.value=`${e}px`)});const fe=p.ref(!1),ve=p.ref(!1),he=p.ref({}),ge=p.ref(null),ye=p.ref(""),we=p.ref(0);let xe=null;const ke=p.ref(!1),Me=p.ref({zoom:1,translateX:0,translateY:0,containerHeight:`${B.value}px`}),be=p.computed(()=>r.enableWheelZoom?{wheel:ot}:{}),Ce=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}}),Te=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let Ne=null,_e=null,De=!1,Se=q.value,Ie=null,je=0,Ee=!0,Le=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 Ae(e){if("undefined"==typeof document)return;if(!T.value)return;if("function"==typeof r.onRenderError&&!0===r.onRenderError(e,E.value,T.value))return ke.value=!0,void ut();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),v(T.value),T.value.appendChild(t),me.value=`${B.value}px`,ke.value=!0,ut()}function Oe(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 ze(e){return!e||e.disabled}function Pe(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function Re(){return Ee&&!U.value&&!fe.value&&!ke.value}function He(e){const t=e.trim();return!(!t||t.startsWith("%%"))&&!/^(?:gantt|title|dateformat|axisformat|tickinterval|excludes|section|todaymarker|topaxis|weekday|weekend|acctitle|accdescr|accdescrmultiline)\b/i.test(t)&&t.includes(":")}function $e(e){var t;const n=e.split(/\r?\n/);for(!/\r?\n$/.test(e)&&n.length>0&&n.pop();n.length>0;){const e=null==(t=n[n.length-1])?void 0:t.trim();if(e&&!e.startsWith("%%")){if(He(e))break;n.pop()}else n.pop()}return n.some(He)?n.join("\n"):""}function Ue(e){if("gantt"===O(e))return $e(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 Ye(e,t,n){return d(this,null,function*(){var o,r;const l=yield k();if(!l)return;const i=l,a=Pe(e,t);if("function"==typeof i.parse)return yield Be(()=>i.parse(a),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:Ce.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:Ce.value.render,signal:null==n?void 0:n.signal}),!0})}function We(e,t,n){return d(this,null,function*(){var o;try{return yield oo(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:Ce.value.worker)}catch(yo){return yield Ye(e,t,n)}})}function Ke(e,t,n){return d(this,null,function*(){var o;if("gantt"===O(e)){const o=Ue(e);if(!o.trim())return{fullOk:!1,prefixOk:!1};try{if(yield We(o,t,n))return o===e?{fullOk:!0,prefixOk:!1}:{fullOk:!1,prefixOk:!0,prefix:o}}catch(yo){if("AbortError"===(null==yo?void 0:yo.name))throw yo}return{fullOk:!1,prefixOk:!1}}try{if(yield We(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(yo){if("AbortError"===(null==yo?void 0:yo.name))throw yo}let r=Ue(e);if(r&&r.trim()&&r!==e)try{try{const l=yield ro(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:Ce.value.worker);l&&l.trim()&&(r=l)}catch(yo){}if(yield We(r,t,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(yo){if("AbortError"===(null==yo?void 0:yo.name))throw yo}return{fullOk:!1,prefixOk:!1}})}"undefined"!=typeof window&&p.watch(()=>C.value,e=>{if(null==S||S.destroy(),S=null,!e)return void(I.value=!1);const t=D(e,{rootMargin:"400px"});S=t,I.value=t.isVisible.value,t.whenVisible.then(()=>{I.value=!0})},{immediate:!0}),p.onBeforeUnmount(()=>{null==S||S.destroy(),S=null,ae()});const Ve=p.computed(()=>U.value||Y.value||b.value);function Qe(){return L.value}function Xe(e){if(!C.value||!T.value)return;const t=T.value.querySelector("svg");if(!t)return;let n=0,o=0;const l=t.getAttribute("viewBox"),i=t.getAttribute("width"),a=t.getAttribute("height");if(l){const e=l.split(" ");4===e.length&&(n=Number.parseFloat(e[2]),o=Number.parseFloat(e[3]))}if(n&&o||i&&a&&(n=Number.parseFloat(i),o=Number.parseFloat(a)),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(yo){return void console.error("Failed to get SVG BBox:",yo)}if(n>0&&o>0){const t=o/n,l=null!=e?e:C.value.clientWidth,i=Qe(),a=l*t,s=null==i?a:Math.min(a,i);me.value=`${"none"===r.maxHeight?s:Math.max(s,B.value)}px`}}const qe=p.ref(!1),Ze=p.computed(()=>({transform:`translate(${P.value}px, ${R.value}px) scale(${z.value})`}));function Ge(e){"Escape"===e.key&&qe.value&&tt()}function Je(){var e;if(!C.value||!N.value)return!1;if("1"===(null==(e=N.value.firstElementChild)?void 0:e.getAttribute("data-mermaid-modal-clone")))return!0;const t=C.value.cloneNode(!0);t.dataset.mermaidModalClone="1",t.classList.add("fullscreen"),t.style.height="100%",t.style.maxHeight="100%";const n=t.querySelector("[data-mermaid-wrapper]");return n&&(_.value=n,n.style.transform=Ze.value.transform),v(N.value),N.value.appendChild(t),w(t),!0}function et(){if(qe.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(yo){}if("undefined"!=typeof window)try{window.addEventListener("keydown",Ge)}catch(yo){}p.nextTick(()=>{Je()||p.nextTick(Je)})}function tt(){if(qe.value=!1,N.value&&v(N.value),_.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(yo){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",Ge)}catch(yo){}}function nt(){if(!U.value)return;if(!i.value)return;const e=E.value.length;e!==K.value&&(V.value=!0,K.value=e,J&&clearTimeout(J),J=setTimeout(()=>{V.value&&U.value&&E.value.trim()&&(V.value=!1,lt("preview"))},X.value))}function ot(e){if(r.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!C.value)return;const t=C.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,r=n-t.width/2,l=o-t.height/2,i=(r-P.value)/z.value,a=(l-R.value)/z.value,s=.01,u=-e.deltaY*s,c=Math.min(Math.max(z.value+u,.5),3);c!==z.value&&(P.value=r-i*c,R.value=l-a*c,z.value=c)}}function rt(e,t=null){return d(this,null,function*(){try{const n=null!=t?t:(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(yo){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function lt(e){return d(this,null,function*(){const t=j.value;if(!t)return F.value=!0,void(U.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",F.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 it(){return d(this,null,function*(){return Y.value?W.value:T.value||(yield p.nextTick(),T.value)?(Y.value=!0,W.value=(()=>d(this,null,function*(){var e,t,n;try{const n=yield k();if(!n)return;const o=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;fe.value||ve.value||null==(e=n.initialize)||e.call(n,c(u({},s.value),{dompurifyConfig:u({},l)}));const i=A(r.isDark?"dark":"light"),a=yield Be(()=>n.render(o,i),{timeoutMs:Ce.value.fullRender}),d=null==a?void 0:a.svg;if(T.value){const e=g(T.value,d);if(!e)return ve.value&&(ve.value=!1),!1;const n=null!=(t=null==a?void 0:a.bindFunctions)?t:null;y=n,w(e.bindTarget),fe.value||ve.value||(Xe(),fe.value=!0,Me.value={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:me.value});const o=r.isDark?"dark":"light";e&&(he.value[o]={svg:e.svg,bindFunctions:n}),ve.value&&(ve.value=!1),ke.value=!1,ne=0,ce()}return!0}catch(o){const e=Oe(o),t=ne+1;return e&&t<=3?(ne=t,de(Math.min(1200,600*t)),void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:h&&"SCRIPT"===h.tagName.toUpperCase()&&h.src||new URL("index.cjs",document.baseURI).href}&&(null==(n={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:n.DEV)&&console.warn("[markstream-vue2] Mermaid render timed out, retry scheduled:",t)):(ne=0,ce(),!1===r.loading&&console.error("Failed to render mermaid diagram:",o),!1===r.loading&&Ae(o)),!1}finally{Y.value=!1,W.value=null}}))(),W.value):void console.warn("Mermaid container not ready")})}function at(e){return d(this,null,function*(){var t;if(Re()&&(T.value||(yield p.nextTick(),T.value))&&!Y.value){Y.value=!0;try{const n=yield k();if(!n)return;const o=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,l=r.isDark?"dark":"light",i=Ue(e),a=Pe(i&&i.trim()?i:e,l),s=yield Be(()=>n.render(o,a),{timeoutMs:Ce.value.render}),u=null==s?void 0:s.svg;if(T.value&&u){const e=g(T.value,u,{keepPreviousOnFailure:!0});e&&(y=null!=(t=null==s?void 0:s.bindFunctions)?t:null,w(e.bindTarget),Xe())}}catch(yo){}finally{Y.value=!1}}})}function st(){return d(this,null,function*(){var e,t,n;const o=Date.now(),l=++we.value;xe&&xe.abort(),xe=new AbortController;const i=xe.signal,a=r.isDark?"dark":"light",s=E.value,u=s.replace(/\s+/g,"");if(!s.trim())return T.value&&v(T.value),ge.value=null,ye.value="",void(ke.value=!1);if(u===ye.value)return;try{const n=yield Ke(s,a,{signal:i,timeoutMs:Ce.value.worker});if(n.fullOk){if(!(yield it()))return;return void(we.value===l&&(ge.value=null!=(t=null==(e=T.value)?void 0:e.innerHTML)?t:null,ye.value=u,ke.value=!1))}const r=je&&o<=je;if(n.prefixOk&&n.prefix&&Re()&&!r)return void(yield at(n.prefix))}catch(yo){if("AbortError"===(null==yo?void 0:yo.name))return}if(we.value!==l)return;if(ke.value)return;const c=he.value[a];if(c&&T.value){const e=g(T.value,c.svg);e&&(y=null!=(n=c.bindFunctions)?n:null,w(e.bindTarget))}})}function ut(){De&&(De=!1,Se=q.value,Ee=!1,Ie&&(Ie.abort(),Ie=null),Ne&&(globalThis.clearTimeout(Ne),Ne=null),_e&&(Te(_e),_e=null),je=Date.now())}function ct(){if(ut(),ae(),xe){try{xe.abort()}catch(yo){}xe=null}if(Ie){try{Ie.abort()}catch(yo){}Ie=null}lo(),ce(),ne=0}function dt(e=q.value){De&&(Le>=G.value?ut():(Ne&&globalThis.clearTimeout(Ne),Ne=globalThis.setTimeout(()=>{_e=oe(()=>d(this,null,function*(){if(!De)return;if(!re())return void ut();if(U.value||fe.value)return void ut();const e=r.isDark?"dark":"light",t=E.value;if(!t.trim())return!1===r.loading?void ut():void dt(Se);if(Le++,Le>G.value)ut();else{Ie&&Ie.abort(),Ie=new AbortController;try{const n=yield Ke(t,e,{signal:Ie.signal,timeoutMs:Ce.value.worker});if(n.fullOk){if((yield it())&&fe.value)return void ut()}else n.prefixOk&&n.prefix&&Re()&&(yield at(n.prefix))}catch(yo){}Se=Math.min(Math.floor(1.5*Se),Z.value),dt(Se)}}),{timeout:500})},e)))}function mt(){De||i.value&&re()&&(U.value||fe.value||(De=!0,je=0,Ee=!0,Le=0,Se=q.value,dt(Se)))}p.watch(N,e=>{qe.value&&e&&Je()}),p.watch(Ze,e=>{qe.value&&_.value&&(_.value.style.transform=e.transform)},{immediate:!0}),p.watch(()=>E.value,()=>{fe.value=!1,he.value={},re()&&se(),!U.value&&i.value&&re()?mt():ut(),nt()}),p.watch(()=>r.isDark,()=>d(this,null,function*(){var e;if(!fe.value)return;if(ke.value)return;const t=r.isDark?"dark":"light",n=he.value[t];if(n){if(T.value){const t=g(T.value,n.svg);t&&(y=null!=(e=n.bindFunctions)?e:null,w(t.bindTarget))}return}const o={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:me.value},l=1!==z.value||0!==P.value||0!==R.value;ve.value=!0,l&&(z.value=1,P.value=0,R.value=0,yield p.nextTick()),(yield it())&&l&&(yield p.nextTick(),z.value=o.zoom,P.value=o.translateX,R.value=o.translateY,me.value=o.containerHeight,Me.value=o)})),p.watch(()=>U.value,e=>d(this,null,function*(){var t;if(e)ut(),fe.value&&(Me.value={zoom:z.value,translateX:P.value,translateY:R.value,containerHeight:me.value});else{if(ke.value)return;const e=r.isDark?"dark":"light";if(fe.value&&he.value[e]){if(yield p.nextTick(),T.value){const n=he.value[e],o=g(T.value,n.svg);o&&(y=null!=(t=n.bindFunctions)?t:null,w(o.bindTarget))}return z.value=Me.value.zoom,P.value=Me.value.translateX,R.value=Me.value.translateY,void(me.value=Me.value.containerHeight)}if(yield p.nextTick(),!i.value||!re())return;mt(),yield st()}})),p.watch(()=>r.loading,(e,t)=>d(this,null,function*(){var n;if(!0===t&&!1===e){const e=E.value.trim();if(!e)return ct();const t=r.isDark?"dark":"light",l=e.replace(/\s+/g,"");if(fe.value&&l===ye.value){if(yield p.nextTick(),T.value&&!T.value.querySelector("svg")&&he.value[t]){const e=he.value[t],o=g(T.value,e.svg);o&&(y=null!=(n=e.bindFunctions)?n:null,w(o.bindTarget))}return void ct()}try{if(yield We(e,t,{timeoutMs:Ce.value.worker}),!(yield it()))return;ye.value=l,ke.value=!1,ct()}catch(o){ct(),Ae(o)}}})),p.watch(C,e=>{pe&&pe.disconnect(),e&&(pe=new ResizeObserver(e=>{e&&e.length>0&&!U.value&&!b.value&&qt(()=>{Xe(e[0].contentRect.width)})}),pe.observe(e))},{immediate:!0}),p.onMounted(()=>d(this,null,function*(){yield p.nextTick(),F.value||(U.value=!i.value),re()&&(se(),K.value=E.value.length)})),p.watch(()=>i.value,e=>{F.value||(U.value=!e)}),p.watch(()=>I.value,e=>{e&&(fe.value||(se(),K.value=E.value.length),r.loading||fe.value||se(),!U.value&&i.value&&mt())},{immediate:!1}),p.watch(()=>r.maxHeight,()=>{p.nextTick(()=>{Xe()})}),p.onUnmounted(()=>{J&&clearTimeout(J),ae(),pe&&pe.disconnect(),xe&&(xe.abort(),xe=null),lo(),ut(),ce()}),p.watch(()=>b.value,e=>d(this,null,function*(){e?(ut(),xe&&xe.abort()):re()&&!fe.value&&(yield p.nextTick(),se(),U.value||mt())}),{immediate:!1});const pt=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:s,setSafeSvg:f,clearElement:v,renderSvgToTarget:g,lastMermaidBindFunctions:y,bindMermaidInteractions:w,t:x,resolveMermaidInstance:k,copyText:M,isCollapsed:b,mermaidContainer:C,mermaidContent:T,modalContent:N,modalCloneWrapper:_,registerViewport:D,viewportHandle:S,viewportReady:I,modeContainerRef:j,baseFixedCode:E,maxPreviewHeight:L,estimatedPreviewHeight:B,getCodeWithTheme:A,getMermaidDiagramKind:O,zoom:z,translateX:P,translateY:R,isDragging:H,dragStart:$,showSource:U,userToggledShowSource:F,isRendering:Y,renderQueue:W,lastContentLength:K,isContentGenerating:V,renderDebounceDelay:Q,contentStableDelay:X,previewPollInitialDelay:q,previewPollMaxDelay:Z,previewPollMaxAttempts:G,contentStableTimer:J,renderRetryTimer:ee,progressiveRenderDebounceTimer:te,consecutiveRenderTimeouts:ne,MAX_RENDER_TIMEOUT_RETRIES:3,requestIdle:oe,canScheduleViewportWork:re,clearProgressiveRenderDebounceTimer:ae,debouncedProgressiveRender:se,clearRenderRetryTimer:ce,scheduleRenderRetry:de,containerHeight:me,resizeObserver:pe,hasRenderedOnce:fe,isThemeRendering:ve,svgCache:he,lastSvgSnapshot:ge,lastRenderedCode:ye,renderToken:we,currentWorkController:xe,hasRenderError:ke,savedTransformState:Me,wheelListeners:be,timeouts:Ce,cancelIdle:Te,previewPollTimeoutId:Ne,previewPollIdleId:_e,isPreviewPolling:De,previewPollDelay:Se,previewPollController:Ie,lastPreviewStopAt:je,allowPartialPreview:Ee,previewPollAttempts:Le,withTimeoutSignal:Be,renderErrorToContainer:Ae,isTimeoutError:Oe,shouldSkipEventTarget:ze,onBtnHover:function(e,t,n="top"){if(ze(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;le(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){ie()},onCopyHover:function(e){if(ze(e.currentTarget))return;const t=M.value?x("common.copied")||"Copied":x("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;le(e.currentTarget,t,"top",!1,o,r.isDark)},applyThemeTo:Pe,canApplyPartialPreview:Re,isGanttTaskLine:He,getSafeGanttPreviewCandidate:$e,getSafePrefixCandidate:Ue,canParseOnMain:Ye,canParseOffthread:We,canParseOrPrefix:Ke,isFullscreenDisabled:Ve,resolveMaxContainerHeight:Qe,updateContainerHeight:Xe,isModalOpen:qe,transformStyle:Ze,handleKeydown:Ge,mountModalClone:Je,openModal:et,closeModal:tt,checkContentStability:nt,zoomIn:function(){z.value<3&&(z.value+=.1)},zoomOut:function(){z.value>.5&&(z.value-=.1)},resetZoom:function(){z.value=1,P.value=0,R.value=0},startDrag:function(e){H.value=!0,e instanceof MouseEvent?$.value={x:e.clientX-P.value,y:e.clientY-R.value}:$.value={x:e.touches[0].clientX-P.value,y:e.touches[0].clientY-R.value}},onDrag:function(e){if(!H.value)return;let t,n;e instanceof MouseEvent?(t=e.clientX,n=e.clientY):(t=e.touches[0].clientX,n=e.touches[0].clientY),P.value=t-$.value.x,R.value=n-$.value.y},stopDrag:function(){H.value=!1},handleWheel:ot,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(E.value)),M.value=!0,t("copy",E.value),setTimeout(()=>{M.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},exportSvg:rt,handleExportClick:function(){var e;const n=null==(e=T.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||rt(n,o)},handleOpenModalClick:function(){var e,n;const o=null!=(n=null==(e=T.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||et()},handleSwitchMode:function(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};t("toggleMode",e,n),n.defaultPrevented||lt(e)},switchMode:lt,initMermaid:it,renderPartial:at,progressiveRender:st,stopPreviewPolling:ut,cleanupAfterLoadingSettled:ct,scheduleNextPreviewPoll:dt,startPreviewPolling:mt,computedButtonStyle:pt,mermaidIconUrl:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij4KICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNjYTllZTYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEuNSAyLjVjMCA2IDIuMjUgNS43NSA0IDcgLjgzLjY3IDEuMTcgMiAxIDRoM2MtLjE3LTIgLjE3LTMuMzMgMS00IDEuNzUtMS4yNSA0LTEgNC03QzEyIDIuNSAxMCAzIDggNyA2IDMgNCAyLjUgMS41IDIuNSIgLz4KPC9zdmc+Cg==",Portal:Zt}}}),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}],attrs:{"data-markstream-mermaid":"1","data-markstream-mode":n.showSource?"source":n.hasRenderedOnce?"preview":"pending"}},[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 overflow-hidden block transition-[height] duration-150 ease-out",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-vue2"},[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,"5b401883",null,null).exports,ao=b(p.defineComponent({name:"NestedRenderer",components:{MarkdownRender:yn},inheritAttrs:!1,props:{node:Object,nodes:Array,content:String,loading:Boolean,final:Boolean,cacheKey:String,parseOptions:Object,customHtmlTags:Array,customMarkdownIt:Function},setup(e){const t=p.getCurrentInstance(),n=p.computed(()=>{var t;return null!=e.final?e.final:"boolean"==typeof e.loading?!e.loading:"boolean"==typeof(null==(t=e.node)?void 0:t.loading)?!e.node.loading:void 0}),o=p.computed(()=>Ot({node:e.node,nodes:e.nodes,content:e.content},{cacheKey:e.cacheKey,final:n.value,parseOptions:e.parseOptions,customHtmlTags:e.customHtmlTags,customMarkdownIt:e.customMarkdownIt}));return{forwardedListeners:p.computed(()=>M(null==t?void 0:t.proxy)),resolvedFinal:n,resolvedNodes:o}}}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("MarkdownRender",e._g(e._b({attrs:{nodes:e.resolvedNodes,final:e.resolvedFinal,"custom-html-tags":e.customHtmlTags}},"MarkdownRender",e.$attrs,!1),e.forwardedListeners))},[],!1,null,null,null,null).exports,so=b(p.defineComponent({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:null,content:null,placement:null,offset:null,originX:null,originY:null,id:null,isDark:{type:[Boolean,null]}},setup(e){const t=e,n=p.computed(()=>{if(void 0!==t.isDark&&null!==t.isDark)return Boolean(t.isDark);if("undefined"!=typeof document)try{if(document.documentElement.classList.contains("dark"))return!0;if((null==window?void 0:window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch(yo){}return!1}),o=p.ref(null),r=p.ref({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=p.ref(!1);let i=null;function a(){return d(this,null,function*(){var e,n;if(!t.anchorEl||!o.value)return;const l=[v.offset(null!=(e=t.offset)?e:8),v.flip(),v.shift({padding:8})],{x:i,y:a}=yield v.computePosition(t.anchorEl,o.value,{placement:null!=(n=t.placement)?n:"top",middleware:l,strategy:"fixed"});r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(a)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return p.watch(()=>t.visible,e=>d(this,null,function*(){if(e)if(l.value=!1,yield p.nextTick(),t.anchorEl&&o.value)try{const e=t.anchorEl.getBoundingClientRect();yield a();const n=r.value.transform;if(null!=t.originX&&null!=t.originY){const o=Math.abs(Number(t.originX)-e.left),i=Math.abs(Number(t.originY)-e.top);Math.hypot(o,i)>120?(r.value.transform=`translate3d(${Math.round(t.originX)}px, ${Math.round(t.originY)}px, 0)`,yield p.nextTick(),l.value=!0,yield p.nextTick(),r.value.transform=n):l.value=!0}else l.value=!0;i=v.autoUpdate(t.anchorEl,o.value,a)}catch(yo){yield a(),l.value=!0,i=v.autoUpdate(t.anchorEl,o.value,a)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),p.watch([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>d(this,null,function*(){t.visible&&t.anchorEl&&o.value&&(yield p.nextTick(),yield a())})),p.onBeforeUnmount(()=>{i&&i()}),{__sfc:!0,props:t,isDarkEffective:n,tooltip:o,style:r,ready:l,cleanupAutoUpdate:i,updatePosition:a,Portal:Zt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("transition",{attrs:{name:"tooltip",appear:""}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.visible&&n.ready,expression:"visible && ready"}],ref:"tooltip",staticClass:"z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",class:[n.isDarkEffective?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"],style:{position:"fixed",left:n.style.left,top:n.style.top,transform:n.style.transform},attrs:{id:n.props.id,role:"tooltip"}},[e._v(" "+e._s(e.content)+" ")])])],1)])},[],!1,null,"703da293",null,null).exports,uo=Object.freeze(Object.defineProperty({__proto__:null,default:so},Symbol.toStringTag,{value:"Module"}));function co(e){return JSON.stringify(e)}function mo(e){var t;const n=null!=(t=e.mode)?t:"classic",o=e.katexUrl,r=e.mhchemUrl,l=co(u({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=co(o),a=r?co(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 po(e){return JSON.stringify(e)}function fo(e){var t;const n=null!=(t=e.mode)?t:"module",o=po(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(${po(u({startOnLoad:!1,securityLevel:"strict",flowchart:{htmlLabels:!1}},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()}function vo(e){const t="string"==typeof(null==e?void 0:e.version)?e.version:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}const ho={AdmonitionNode:Xt,BlockquoteNode:Ht,CheckboxNode:C,CodeBlockNode:an,DefinitionListNode:T,EmojiNode:N,EmphasisNode:Be,FootnoteNode:Oe,FootnoteReferenceNode:E,FootnoteAnchorNode:Ae,HardBreakNode:ze,HeadingNode:Pe,HtmlBlockNode:ut,HtmlInlineNode:F,HighlightNode:Le,ImageNode:ce,D2BlockNode:mn,InlineCodeNode:Y,PreCodeNode:dt,InsertNode:Ee,LinkNode:je,ListItemNode:Re,ListNode:He,MarkdownCodeBlockNode:gn,MathBlockNode:Hn,MathInlineNode:$n,MermaidBlockNode:io,NestedRenderer:ao,InfographicBlockNode:hn,ParagraphNode:ct,StrikethroughNode:Ie,StrongNode:Se,SubscriptNode:De,SuperscriptNode:_e,TableNode:mt,TextNode:Me,ThematicBreakNode:pt,VmrContainerNode:vt,ReferenceNode:Ne},go={install(e,t){!function(e){const t=vo(e);if(!(null==t||t>=7||(null==e?void 0:e.__composition_api_installed__)||(null==e?void 0:e.__compositionApiInstalled)))throw new Error("[markstream-vue2] Vue 2.6.x requires @vue/composition-api. Install it and call Vue.use(VueCompositionAPI) before using markstream-vue2.")}(e),function(e){const t=vo(e);if(null==t||t>=7)return;if(null==e?void 0:e.__markstreamVue2SetupProxyPatched)return;e.__markstreamVue2SetupProxyPatched=!0;const n=e.prototype;Object.prototype.hasOwnProperty.call(n,"_setupProxy")||Object.defineProperty(n,"_setupProxy",{configurable:!0,get(){return this},set(e){Object.defineProperty(this,"_setupProxy",{value:e,configurable:!0,writable:!0})}}),e.mixin({beforeCreate(){if(!this._setupProxy)try{this._setupProxy=this}catch(yo){}}})}(e),Object.entries(ho).forEach(([t,n])=>{e.component(t,n)}),e.component("MarkdownRender",yn),e.component("NodeRenderer",yn),(null==t?void 0:t.getLanguageIcon)&&It(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&m.setDefaultMathOptions(t.mathOptions)}};Object.defineProperty(exports,"KATEX_COMMANDS",{enumerable:!0,get:()=>m.KATEX_COMMANDS}),Object.defineProperty(exports,"normalizeStandaloneBackslashT",{enumerable:!0,get:()=>m.normalizeStandaloneBackslashT}),Object.defineProperty(exports,"setDefaultMathOptions",{enumerable:!0,get:()=>m.setDefaultMathOptions}),exports.AdmonitionNode=Xt,exports.BlockquoteNode=Ht,exports.CheckboxNode=C,exports.CodeBlockNode=an,exports.D2BlockNode=mn,exports.DefinitionListNode=T,exports.EmojiNode=N,exports.EmphasisNode=Be,exports.FootnoteAnchorNode=Ae,exports.FootnoteNode=Oe,exports.FootnoteReferenceNode=E,exports.HardBreakNode=ze,exports.HeadingNode=Pe,exports.HighlightNode=Le,exports.HtmlBlockNode=ut,exports.HtmlInlineNode=F,exports.ImageNode=ce,exports.InfographicBlockNode=hn,exports.InlineCodeNode=Y,exports.InsertNode=Ee,exports.LinkNode=je,exports.ListItemNode=Re,exports.ListNode=He,exports.MERMAID_DISABLED_CODE=to,exports.MERMAID_WORKER_BUSY_CODE=eo,exports.MarkdownCodeBlockNode=gn,exports.MarkdownRender=yn,exports.MathBlockNode=Hn,exports.MathInlineNode=$n,exports.MermaidBlockNode=io,exports.NestedRenderer=ao,exports.ParagraphNode=ct,exports.PreCodeNode=dt,exports.ReferenceNode=Ne,exports.StrikethroughNode=Ie,exports.StrongNode=Se,exports.SubscriptNode=De,exports.SuperscriptNode=_e,exports.TableNode=mt,exports.TextNode=Me,exports.ThematicBreakNode=pt,exports.Tooltip=so,exports.VmrContainerNode=vt,exports.VueRendererMarkdown=go,exports.WORKER_BUSY_CODE=On,exports.buildKaTeXCDNWorkerSource=mo,exports.buildMermaidCDNWorkerSource=fo,exports.canParseOffthread=oo,exports.clearGlobalCustomComponents=function(){delete S.scopedCustomComponents[_],I.value++},exports.clearKaTeXWorker=function(){var e;Cn&&(null==(e=Cn.terminate)||e.call(Cn)),Cn=null,Tn=null},exports.clearMermaidWorker=function(){var e;if(Xn)try{for(const[e,t]of Zn.entries())t.reject(new Error("Worker cleared"));Zn.clear(),null==(e=Xn.terminate)||e.call(Xn)}catch(yo){}Xn=null,qn=null},exports.createKaTeXWorkerFromCDN=function(e){var t,n;const o=mo(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")?c(u({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,s=new Worker(l,a);if(e.debug)try{s.postMessage({type:"init",debug:!0})}catch(yo){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(yo){}}},source:o}},exports.createMermaidWorkerFromCDN=function(e){var t,n;const o=fo(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")?c(u({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,s=new Worker(l,a);if(e.debug)try{s.postMessage({type:"init",debug:!0})}catch(yo){}return{worker:s,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(yo){}}},source:o}},exports.default=yn,exports.disableD2=function(){dn(null)},exports.disableKatex=function(){ge(null)},exports.disableMermaid=function(){Wn(null)},exports.enableD2=function(e){dn(null!=e?e:sn)},exports.enableKatex=function(e){ge(null!=e?e:he)},exports.enableMermaid=function(e){Wn(null!=e?e:Un)},exports.findPrefixOffthread=ro,exports.getCustomNodeComponents=j,exports.getKaTeXBackpressureDefaults=function(){return u({},Pn)},exports.getKaTeXWorkerLoad=function(){return{inFlight:_n.size,max:Sn}},exports.getLanguageIcon=Lt,exports.getMermaidWorkerLoad=function(){return{inFlight:Zn.size,max:Gn}},exports.getUseMonaco=wt,exports.isD2Enabled=function(){return"function"==typeof cn},exports.isKaTeXWorkerBusy=function(){return _n.size>=Sn},exports.isKatexEnabled=ye,exports.isMermaidEnabled=Kn,exports.languageIconsRevision=Nt,exports.languageMap=Bt,exports.normalizeLanguageIdentifier=jt,exports.parseNestedMarkdownToNodes=Ot,exports.preloadExtendedLanguageIcons=function(){return d(this,null,function*(){yield St()})},exports.removeCustomComponents=function(e){if(e===_)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete S.scopedCustomComponents[e],I.value++},exports.renderKaTeXInWorker=Bn,exports.renderKaTeXWithBackpressure=Rn,exports.renderMarkdownNodeToHtml=function(e,t={}){return Xe(e,Ve(t))},exports.renderMarkdownNodesToHtml=Ke,exports.renderNestedMarkdownToHtml=function(e,t={}){return function(e,t){if(Array.isArray(e.nodes)&&e.nodes.length>0)return Qe(e.nodes,t);const n=e.node;if(n){const e=ot(n.children);if(e.length>0)return Qe(e,t);const o=rt(n.content);if(o)return Je(o,t);if(null!=n.raw)return at(rt(n.raw))}return e.content?Je(rt(e.content),t):""}(e,Ve(t))},exports.resolveMonacoLanguageId=Et,exports.setCustomComponents=function(e,t){"string"==typeof e?S.scopedCustomComponents[e]=t||{}:S.scopedCustomComponents[_]=e||{},I.value++},exports.setD2Loader=dn,exports.setDefaultI18nMap=function(e){Object.assign(ae,e)},exports.setKaTeXBackpressureDefaults=function(e){null!=e.timeout&&(Pn.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Pn.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Pn.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Pn.maxRetries=Math.max(0,Math.floor(e.maxRetries)))},exports.setKaTeXCache=An,exports.setKaTeXWorker=function(e){Cn=e,Tn=null,Cn.onmessage=e=>{const{id:t,html:n,error:o}=e.data,r=_n.get(t);if(r)if(_n.delete(t),clearTimeout(r.timeoutId),jn(),o)r.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(Dn.set(e,n),Dn.size>200){const e=Dn.keys().next().value;Dn.delete(e)}}r.resolve(n)}},Cn.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of _n.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));_n.clear(),jn()}},exports.setKaTeXWorkerDebug=function(e){Nn=!!e,Cn&&Cn.postMessage({type:"init",debug:Nn})},exports.setKaTeXWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Sn=Math.floor(e))},exports.setKatexLoader=ge,exports.setLanguageIconResolver=It,exports.setMermaidLoader=Wn,exports.setMermaidWorker=function(e){Xn=e,qn=null;const t=e;Xn.onmessage=e=>{if(Xn!==t)return;const{id:n,ok:o,result:r,error:l}=e.data,i=Zn.get(n);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Xn.onerror=e=>{var n,o;if(Xn===t)if(0!==Zn.size){try{Jn?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 Zn.entries())n.reject(new Error(`Worker error: ${e.message}`));Zn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Xn.onmessageerror=e=>{var n,o;if(Xn===t)if(0!==Zn.size){try{Jn?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(yo){}for(const[e,t]of Zn.entries())t.reject(new Error("Worker messageerror"));Zn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}},exports.setMermaidWorkerClientDebug=function(e){Jn=!!e},exports.setMermaidWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Gn=Math.floor(e))},exports.terminateWorker=lo,exports.useSmoothMarkdownStream=$t,exports.waitForKaTeXWorkerSlot=zn,Object.keys(m).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>m[e]})});
|