litepaseo 0.14.2 → 0.14.3
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/CHANGELOG.md +6 -0
- package/dist/server/cli.mjs +2 -2
- package/dist/server/{worker-Bncuyaw7.mjs → worker-BTFquFtd.mjs} +5 -0
- package/dist/web/assets/{AddProjectDialog-Bftvd3Yz.js → AddProjectDialog-B-r008IH.js} +1 -1
- package/dist/web/assets/AddProjectDialog-B-r008IH.js.br +0 -0
- package/dist/web/assets/AddProjectDialog-B-r008IH.js.gz +0 -0
- package/dist/web/assets/{ArchivedWorkspaces-DAtKiAKb.js → ArchivedWorkspaces-CE0ZiFNN.js} +1 -1
- package/dist/web/assets/ArchivedWorkspaces-CE0ZiFNN.js.br +0 -0
- package/dist/web/assets/ArchivedWorkspaces-CE0ZiFNN.js.gz +0 -0
- package/dist/web/assets/{ChangesPanel-LDYyiOkA.js → ChangesPanel-2dFqPKh-.js} +1 -1
- package/dist/web/assets/ChangesPanel-2dFqPKh-.js.br +0 -0
- package/dist/web/assets/ChangesPanel-2dFqPKh-.js.gz +0 -0
- package/dist/web/assets/{CodeBlockNode-Ubb_GmEN.js → CodeBlockNode-CCsuwj3e.js} +1 -1
- package/dist/web/assets/CodeBlockNode-CCsuwj3e.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-CCsuwj3e.js.gz +0 -0
- package/dist/web/assets/{CommandCenter-C9e_MHP7.js → CommandCenter-BVWL6A1k.js} +1 -1
- package/dist/web/assets/CommandCenter-BVWL6A1k.js.br +0 -0
- package/dist/web/assets/CommandCenter-BVWL6A1k.js.gz +0 -0
- package/dist/web/assets/{ConversationSearch-BVkg07Q4.js → ConversationSearch-DnimOmMN.js} +1 -1
- package/dist/web/assets/ConversationSearch-DnimOmMN.js.br +0 -0
- package/dist/web/assets/ConversationSearch-DnimOmMN.js.gz +0 -0
- package/dist/web/assets/{FileViewer-IobGwtBO.js → FileViewer-lhTEo-fK.js} +1 -1
- package/dist/web/assets/FileViewer-lhTEo-fK.js.br +0 -0
- package/dist/web/assets/FileViewer-lhTEo-fK.js.gz +0 -0
- package/dist/web/assets/{FilesPanel-DRE6I9Zu.js → FilesPanel-D3anmEzt.js} +1 -1
- package/dist/web/assets/FilesPanel-D3anmEzt.js.br +0 -0
- package/dist/web/assets/FilesPanel-D3anmEzt.js.gz +0 -0
- package/dist/web/assets/{HostSettings-DUReTPzX.js → HostSettings-CwRQdQMg.js} +1 -1
- package/dist/web/assets/HostSettings-CwRQdQMg.js.br +0 -0
- package/dist/web/assets/HostSettings-CwRQdQMg.js.gz +0 -0
- package/dist/web/assets/{ImportSessionDialog-Bg9XZ_ab.js → ImportSessionDialog-B7yNNHSp.js} +1 -1
- package/dist/web/assets/ImportSessionDialog-B7yNNHSp.js.br +0 -0
- package/dist/web/assets/ImportSessionDialog-B7yNNHSp.js.gz +0 -0
- package/dist/web/assets/{KanbanPage-lKwsQfA_.js → KanbanPage-BxpwweZd.js} +1 -1
- package/dist/web/assets/KanbanPage-BxpwweZd.js.br +0 -0
- package/dist/web/assets/KanbanPage-BxpwweZd.js.gz +0 -0
- package/dist/web/assets/{LabelsDialog-DgPisIev.js → LabelsDialog-CnVEGFiE.js} +1 -1
- package/dist/web/assets/LabelsDialog-CnVEGFiE.js.br +0 -0
- package/dist/web/assets/LabelsDialog-CnVEGFiE.js.gz +0 -0
- package/dist/web/assets/{MarkdownMessage-4Jj7wE3O.js → MarkdownMessage--VLk0ibg.js} +5 -5
- package/dist/web/assets/MarkdownMessage--VLk0ibg.js.br +0 -0
- package/dist/web/assets/MarkdownMessage--VLk0ibg.js.gz +0 -0
- package/dist/web/assets/{PreCodeBlock-CPJuGkN0.js → PreCodeBlock-CTyy9U9T.js} +1 -1
- package/dist/web/assets/{PreCodeBlock.vue_vue_type_style_index_0_lang-DyY0Ilsi.js → PreCodeBlock.vue_vue_type_style_index_0_lang-DK6DBQ5b.js} +1 -1
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-DK6DBQ5b.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-DK6DBQ5b.js.gz +0 -0
- package/dist/web/assets/{SubagentsPanel-COknYf0L.js → SubagentsPanel-DFNQpfOj.js} +1 -1
- package/dist/web/assets/SubagentsPanel-DFNQpfOj.js.br +0 -0
- package/dist/web/assets/SubagentsPanel-DFNQpfOj.js.gz +0 -0
- package/dist/web/assets/{TerminalPanel-Dbx2lKSi.js → TerminalPanel-CQ1613aI.js} +1 -1
- package/dist/web/assets/TerminalPanel-CQ1613aI.js.br +0 -0
- package/dist/web/assets/TerminalPanel-CQ1613aI.js.gz +0 -0
- package/dist/web/assets/{Tooltip-DtQZvsaN.js → Tooltip-CN-JPsWb.js} +1 -1
- package/dist/web/assets/Tooltip-CN-JPsWb.js.br +0 -0
- package/dist/web/assets/Tooltip-CN-JPsWb.js.gz +0 -0
- package/dist/web/assets/index-DqH6slDK.js +45 -0
- package/dist/web/assets/index-DqH6slDK.js.br +0 -0
- package/dist/web/assets/index-DqH6slDK.js.gz +0 -0
- package/dist/web/assets/index-hKmVNfdU.css +1 -0
- package/dist/web/assets/index-hKmVNfdU.css.br +0 -0
- package/dist/web/assets/index-hKmVNfdU.css.gz +0 -0
- package/dist/web/assets/{index10-BTkpIIYS.js → index10-ExQJARIx.js} +1 -1
- package/dist/web/assets/index10-ExQJARIx.js.br +0 -0
- package/dist/web/assets/index10-ExQJARIx.js.gz +0 -0
- package/dist/web/assets/index3-BJdA_lu3.js +1 -0
- package/dist/web/assets/index4-BILJ5L4s.js +1 -0
- package/dist/web/assets/{index5-CkCxVfaP.js → index5-CQngjG8A.js} +1 -1
- package/dist/web/assets/index5-CQngjG8A.js.br +0 -0
- package/dist/web/assets/index5-CQngjG8A.js.gz +0 -0
- package/dist/web/assets/{index6-SCztOIu6.js → index6-BKvbo_v2.js} +1 -1
- package/dist/web/assets/index6-BKvbo_v2.js.br +0 -0
- package/dist/web/assets/index6-BKvbo_v2.js.gz +0 -0
- package/dist/web/assets/{index7-HKApXTNK.js → index7-DFuP_VHe.js} +1 -1
- package/dist/web/assets/index7-DFuP_VHe.js.br +0 -0
- package/dist/web/assets/index7-DFuP_VHe.js.gz +0 -0
- package/dist/web/assets/{index8-CCdHj2vL.js → index8-4EOYGS9L.js} +1 -1
- package/dist/web/assets/index8-4EOYGS9L.js.br +0 -0
- package/dist/web/assets/index8-4EOYGS9L.js.gz +0 -0
- package/dist/web/assets/{index9-rtEtkGH0.js → index9-BTjkNo53.js} +1 -1
- package/dist/web/assets/index9-BTjkNo53.js.br +0 -0
- package/dist/web/assets/{index9-rtEtkGH0.js.gz → index9-BTjkNo53.js.gz} +0 -0
- package/dist/web/index.html +2 -2
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/package.json +1 -1
- package/dist/web/assets/AddProjectDialog-Bftvd3Yz.js.br +0 -0
- package/dist/web/assets/AddProjectDialog-Bftvd3Yz.js.gz +0 -0
- package/dist/web/assets/ArchivedWorkspaces-DAtKiAKb.js.br +0 -0
- package/dist/web/assets/ArchivedWorkspaces-DAtKiAKb.js.gz +0 -0
- package/dist/web/assets/ChangesPanel-LDYyiOkA.js.br +0 -0
- package/dist/web/assets/ChangesPanel-LDYyiOkA.js.gz +0 -0
- package/dist/web/assets/CodeBlockNode-Ubb_GmEN.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-Ubb_GmEN.js.gz +0 -0
- package/dist/web/assets/CommandCenter-C9e_MHP7.js.br +0 -0
- package/dist/web/assets/CommandCenter-C9e_MHP7.js.gz +0 -0
- package/dist/web/assets/ConversationSearch-BVkg07Q4.js.br +0 -0
- package/dist/web/assets/ConversationSearch-BVkg07Q4.js.gz +0 -0
- package/dist/web/assets/FileViewer-IobGwtBO.js.br +0 -0
- package/dist/web/assets/FileViewer-IobGwtBO.js.gz +0 -0
- package/dist/web/assets/FilesPanel-DRE6I9Zu.js.br +0 -0
- package/dist/web/assets/FilesPanel-DRE6I9Zu.js.gz +0 -0
- package/dist/web/assets/HostSettings-DUReTPzX.js.br +0 -0
- package/dist/web/assets/HostSettings-DUReTPzX.js.gz +0 -0
- package/dist/web/assets/ImportSessionDialog-Bg9XZ_ab.js.br +0 -0
- package/dist/web/assets/ImportSessionDialog-Bg9XZ_ab.js.gz +0 -0
- package/dist/web/assets/KanbanPage-lKwsQfA_.js.br +0 -0
- package/dist/web/assets/KanbanPage-lKwsQfA_.js.gz +0 -0
- package/dist/web/assets/LabelsDialog-DgPisIev.js.br +0 -0
- package/dist/web/assets/LabelsDialog-DgPisIev.js.gz +0 -0
- package/dist/web/assets/MarkdownMessage-4Jj7wE3O.js.br +0 -0
- package/dist/web/assets/MarkdownMessage-4Jj7wE3O.js.gz +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-DyY0Ilsi.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-DyY0Ilsi.js.gz +0 -0
- package/dist/web/assets/SubagentsPanel-COknYf0L.js.br +0 -0
- package/dist/web/assets/SubagentsPanel-COknYf0L.js.gz +0 -0
- package/dist/web/assets/TerminalPanel-Dbx2lKSi.js.br +0 -0
- package/dist/web/assets/TerminalPanel-Dbx2lKSi.js.gz +0 -0
- package/dist/web/assets/Tooltip-DtQZvsaN.js.br +0 -0
- package/dist/web/assets/Tooltip-DtQZvsaN.js.gz +0 -0
- package/dist/web/assets/index--Uzu2A_h.js +0 -45
- package/dist/web/assets/index--Uzu2A_h.js.br +0 -0
- package/dist/web/assets/index--Uzu2A_h.js.gz +0 -0
- package/dist/web/assets/index-5kxjCia8.css +0 -1
- package/dist/web/assets/index-5kxjCia8.css.br +0 -0
- package/dist/web/assets/index-5kxjCia8.css.gz +0 -0
- package/dist/web/assets/index10-BTkpIIYS.js.br +0 -0
- package/dist/web/assets/index10-BTkpIIYS.js.gz +0 -0
- package/dist/web/assets/index3-BSWvERvY.js +0 -1
- package/dist/web/assets/index4-D6dsLD5o.js +0 -1
- package/dist/web/assets/index5-CkCxVfaP.js.br +0 -0
- package/dist/web/assets/index5-CkCxVfaP.js.gz +0 -0
- package/dist/web/assets/index6-SCztOIu6.js.br +0 -0
- package/dist/web/assets/index6-SCztOIu6.js.gz +0 -0
- package/dist/web/assets/index7-HKApXTNK.js.br +0 -0
- package/dist/web/assets/index7-HKApXTNK.js.gz +0 -0
- package/dist/web/assets/index8-CCdHj2vL.js.br +0 -0
- package/dist/web/assets/index8-CCdHj2vL.js.gz +0 -0
- package/dist/web/assets/index9-rtEtkGH0.js.br +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vue.runtime.esm-bundler-Dph2MMo9.js","assets/rolldown-runtime-XKyaHtl9.js","assets/Tooltip-
|
|
2
|
-
import{$ as e,B as t,C as n,D as r,E as i,G as a,H as o,I as s,M as c,O as l,P as u,Q as d,S as f,T as p,U as m,V as h,W as g,X as _,Y as v,Z as y,_ as b,at as x,ct as S,dt as C,f as w,g as T,h as E,it as D,j as O,k,l as A,lt as j,n as M,nt as N,ot as P,q as ee,rt as te,st as F,tt as ne,ut as I,v as L,w as R,y as z,z as B}from"./vue.runtime.esm-bundler-Dph2MMo9.js";import{a as V,l as re}from"./index
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vue.runtime.esm-bundler-Dph2MMo9.js","assets/rolldown-runtime-XKyaHtl9.js","assets/Tooltip-CN-JPsWb.js","assets/index-DqH6slDK.js","assets/index-hKmVNfdU.css","assets/PreCodeBlock-CTyy9U9T.js","assets/PreCodeBlock.vue_vue_type_style_index_0_lang-DK6DBQ5b.js","assets/CodeBlockNode-CCsuwj3e.js","assets/safeRaf-BDp3SJMs.js","assets/index6-BKvbo_v2.js","assets/index5-CQngjG8A.js","assets/index10-ExQJARIx.js","assets/index8-4EOYGS9L.js","assets/index9-BTjkNo53.js","assets/index3-BJdA_lu3.js","assets/index4-BILJ5L4s.js","assets/index7-DFuP_VHe.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,B as t,C as n,D as r,E as i,G as a,H as o,I as s,M as c,O as l,P as u,Q as d,S as f,T as p,U as m,V as h,W as g,X as _,Y as v,Z as y,_ as b,at as x,ct as S,dt as C,f as w,g as T,h as E,it as D,j as O,k,l as A,lt as j,n as M,nt as N,ot as P,q as ee,rt as te,st as F,tt as ne,ut as I,v as L,w as R,y as z,z as B}from"./vue.runtime.esm-bundler-Dph2MMo9.js";import{a as V,l as re}from"./index-DqH6slDK.js";import{n as ie,t as ae}from"./highlight-FO7Ekoql.js";function oe(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function se(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){oe(a,r,i,o,s,`next`,e)}function s(e){oe(a,r,i,o,s,`throw`,e)}o(void 0)})}}var ce=()=>`accept`,le={mounted:`CodeBlockNode is not mounted`,enhancedRuntime:`The enhanced code-block runtime is unavailable; install stream-diffs and keep it loaded before editing`,loading:`Wait for the code block to finish streaming before editing`,notReady:`The code block surface is not ready`,missingEdits:`The code block surface is not ready for edits`,unsupported:`The installed stream-diffs version does not expose editing; upgrade stream-diffs`};function ue(e){return String(e??``).replace(/\r\n$|\n$|\r$/,``)}function de(e,t){var n,r,i,a,o;let s=e==null||(n=e.getNativeInstance)==null?void 0:n.call(e);return ue((e==null||(r=e.getEditingFile)==null||(r=r.call(e))==null?void 0:r.contents)??(s==null||(i=s.file)==null?void 0:i.contents)??(s==null||(a=s.fileDiff)==null||(a=a.additionLines)==null?void 0:a.join(``))??(e==null||(o=e.getResolvedFile)==null||(o=o.call(e))==null?void 0:o.contents)??t)}function fe(e){return pe.apply(this,arguments)}function pe(){return pe=se(function*(e){e.isReadyToEdit?.call(e)===!1&&e.prepareForEditing&&(yield e.prepareForEditing())}),pe.apply(this,arguments)}function me(e){return he.apply(this,arguments)}function he(){return he=se(function*(e){if(e.isUnmounted?.call(e))throw Error(le.mounted);if(e.isFallback?.call(e))throw Error(le.enhancedRuntime);if(e.isLoading?.call(e)||(yield e.ensureSurface?.call(e)),e.isUnmounted?.call(e))throw Error(le.mounted);if(e.isFallback?.call(e))throw Error(le.enhancedRuntime);if(e.isLoading?.call(e))throw Error(le.loading);let t=e.getSurface();if(!t)throw Error(le.notReady);return yield fe(t),t}),he.apply(this,arguments)}function ge(e){return{getSurface:e.getSurface,isReadyToEdit:()=>{var t,n;return!!((t=e.getSurface())!=null&&(n=t.isReadyToEdit)!=null&&n.call(t))},isEditing:()=>{var t,n;return!!((t=e.getSurface())!=null&&(n=t.isEditing)!=null&&n.call(t))},startEditing(t,n){return se(function*(){let r=yield me(e);if(!r.startEditing)throw Error(le.unsupported);return r.startEditing(t,n)})()},stopEditing(t){var n,r;(n=e.getSurface())==null||(r=n.stopEditing)==null||r.call(n,t)},getEditor:()=>{var t,n;return((t=e.getSurface())==null||(n=t.getEditor)==null?void 0:n.call(t))??null},getEditingText:()=>{var t,n;return((t=e.getSurface())==null||(n=t.getEditingText)==null?void 0:n.call(t))??null},undo:()=>{var t,n;return(t=e.getSurface())==null||(n=t.undo)==null?void 0:n.call(t)},redo:()=>{var t,n;return(t=e.getSurface())==null||(n=t.redo)==null?void 0:n.call(t)},canUndo:()=>{var t,n;return!!((t=e.getSurface())!=null&&(n=t.canUndo)!=null&&n.call(t))},canRedo:()=>{var t,n;return!!((t=e.getSurface())!=null&&(n=t.canRedo)!=null&&n.call(t))},applyEdits(t,n){let r=e.getSurface();if(!r)throw Error(le.missingEdits);if(!r.applyEdits)throw Error(le.unsupported);r.applyEdits(t,n)},focusEditor:t=>{var n,r;return(n=e.getSurface())==null||(r=n.focusEditor)==null?void 0:r.call(n,t)},blurEditor:()=>{var t,n;return(t=e.getSurface())==null||(n=t.blurEditor)==null?void 0:n.call(t)},revealLine:(t,n)=>{var r,i;return((r=e.getSurface())==null||(i=r.revealLine)==null?void 0:i.call(r,t,n))??!1},expandLine:t=>{var n,r;return(n=e.getSurface())==null||(r=n.expandLine)==null?void 0:r.call(n,t)},expandHunk:(t,n,r)=>{var i,a;return(i=e.getSurface())==null||(a=i.expandHunk)==null?void 0:a.call(i,t,n,r)},setEditorActiveLine:(t,n)=>{var r,i;return(r=e.getSurface())==null||(i=r.setEditorActiveLine)==null?void 0:i.call(r,t,n)},getCodeScrollLeft:()=>{var t,n;return((t=e.getSurface())==null||(n=t.getCodeScrollLeft)==null?void 0:n.call(t))??0},setCodeScrollLeft:t=>{var n,r;return(n=e.getSurface())==null||(r=n.setCodeScrollLeft)==null?void 0:r.call(n,t)},getCode:()=>de(e.getSurface(),e.getDisplayCode())}}function _e(e){let t=e;return typeof t.onEditComplete!=`function`&&(t.onEditComplete=ce),e}function ve(e){var t;if(typeof e==`boolean`)return e;let n=e;if(n?.expandUnchanged===!0)return!1;let r=Number(n==null||(t=n.parseDiffOptions)==null?void 0:t.context),i=Number(n?.collapsedContextThreshold);return{enabled:!0,contextLineCount:isFinite(r)&&r>=0?Math.floor(r):2,minimumLineCount:isFinite(i)&&i>=0?Math.floor(i)+1:6,revealLineCount:5}}function ye(e){return e.diffStyle===`unified`}function be(e){let t=String(e??``).split(/\r?\n/,1)[0]?.trim()??``;if(t.length<3)return``;let n=t[0];if(n!=="`"&&n!==`~`||t[1]!==n||t[2]!==n)return``;let r=3;for(;t[r]===n;)r+=1;return t.slice(r).trim()}function H(e){return(String(e??``).trim().split(/\s+/,1)[0]??``)===`diff`}function xe(e){return e.diff===!0||H(e.language)||H(be(String(e.raw??``)))}function Se(e){let t=be(e);if(!t)return``;let n=t.split(/\s+/).filter(Boolean);if(!n.length)return``;let r=n[0]===`diff`?n.slice(1):n;for(let e of r){let t=e.includes(`:`)?e.slice(e.indexOf(`:`)+1):e;if(t&&/[./\\-]/.test(t))return t}return``}function Ce(e,t,n){let r=Se(e);return{title:r||t,caption:r?n?`Diff / ${t}`:t:``}}function U(e){let t=String(e??``).replace(/\r\n$|\n$|\r$/,``);return t?t.split(/\r\n|\n|\r/):[]}var we=``,Te=``,Ee=null;function De(e,t){if(Ee&&we===e&&Te===t)return Ee;let n=U(e),r=U(t),i=0,a=n.length-1,o=r.length-1;for(;i<=a&&i<=o&&n[i]===r[i];)i++;for(;a>=i&&o>=i&&n[a]===r[o];)a--,o--;let s=Math.max(0,a-i+1),c=Math.max(0,o-i+1),l;if(s===0||c===0)l={removed:s,added:c};else if((s+1)*(c+1)<=15e5){let e=new Map,t=new Uint32Array(c);for(let n=0;n<c;n++){let a=r[i+n],o=e.get(a);o===void 0&&(o=e.size+1,e.set(a,o)),t[n]=o}let a=new Uint32Array(s);for(let t=0;t<s;t++)a[t]=e.get(n[i+t])??0;let o=c+1,u=new Uint32Array(o),d=new Uint32Array(o);for(let e=s-1;e>=0;e--){d[c]=0;for(let n=c-1;n>=0;n--)d[n]=a[e]===t[n]?u[n+1]+1:Math.max(u[n],d[n+1]);let n=u;u=d,d=n}let f=u[0];l={removed:s-f,added:c-f}}else l={removed:s,added:c};return we=e,Te=t,Ee=l,l}function Oe(e){return`
|
|
3
3
|
[data-file] [data-line],
|
|
4
4
|
[data-diff] [data-line] {
|
|
5
5
|
white-space: ${e===`wrap`?`pre-wrap`:`pre`} !important;
|
|
@@ -180,16 +180,16 @@ ${t}`.trim()}var je=new WeakSet;function Me(e){if(!e||typeof e!=`object`||je.has
|
|
|
180
180
|
<button class="copy-button" data-code="${s}">${d}</button>
|
|
181
181
|
</div>
|
|
182
182
|
<div class="code-editor"></div>
|
|
183
|
-
</div>`};let c=/^\[(\d+)\]/,l=/^\[([^\]\n]+)\]/,u=e=>{if(!e.startsWith(`[`))return!1;let t=l.exec(e);if(!t)return e!==`[`&&!/^\[\d+$/.test(e);let n=String(t[1]??``);return!e.slice(t[0].length).startsWith(`(`)&&!/^\d+$/.test(n)};n.inline.ruler.before(`escape`,`reference`,(e,t)=>{let n=e;if(n.src[n.pos]!==`[`)return!1;let r=c.exec(n.src.slice(n.pos));if(!r)return!1;let i=n.src.slice(Math.max(0,n.pos-120),n.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(i))return!1;let a=n.src.slice(n.pos+r[0].length);if(a.startsWith(`](`)||a.startsWith(`(`)||u(a))return!1;if(!t){let e=r[1],t=n.push(`reference`,`span`,0);t.content=e,t.markup=r[0],t.raw=r[0]}return n.pos+=r[0].length,!0}),n.renderer.rules.reference=(e,t)=>{let n=String(e[t].content??``);return`<span class="reference-link" data-reference-id="${n}" role="button" tabindex="0" title="Click to view reference">${n}</span>`};let d=n.use.bind(n);return n.use=((...e)=>(r.__markstreamHasCustomParserExtensions=!0,d(...e))),n}var Sw=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Cw=Symbol.for(`markstream-vue:node-lifecycle`),ww=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>`,Tw=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>`,Ew={id:`material`,core:{"":Tw,plain:`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>`,text:Tw,javascript:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>`,typescript:`<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>`,jsx:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>`,tsx:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>`,html:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>`,css:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>`,scss:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>`,json:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>`,python:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>`,ruby:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>`,go:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>`,java:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>`,kotlin:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>`,c:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>`,cpp:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>`,cs:ww,csharp:ww,php:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>`,shell:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>`,powershell:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>`,sql:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>`,yaml:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>`,markdown:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>`,xml:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>`,rust:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>`,vue:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>`,mermaid:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>`},fallback:`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>`,loadExtended:()=>V(()=>import(`./extended-BP0HZdSW.js`).then(e=>e.materialExtendedMap),[])},Dw=new Map,Ow=`material`,kw=new Map,Aw=new Map,jw=null;function Mw(e){Dw.set(e.id,e)}function Nw(e){let t=Dw.get(Ow);if(!t)return;let n=t.core[e];if(n)return n;let r=kw.get(t.id);if(r){let t=r[e];if(t)return t}t.loadExtended&&!kw.has(t.id)&&Fw(t)}function Pw(){return Dw.get(Ow)?.fallback??``}function Fw(e){return Sw(this,null,function*(){if(kw.has(e.id))return kw.get(e.id)??null;let t=Aw.get(e.id);return t||(t=(e.loadExtended?.call(e)??Promise.resolve(null)).then(t=>(kw.set(e.id,t),jw?.(),t)).catch(()=>(kw.set(e.id,null),null)),Aw.set(e.id,t)),t})}var Iw=x(0);jw=()=>{Iw.value++},Mw(Ew);var Lw={"":``,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`};function Rw(e){let t=function(e){if(!e)return``;let t=e.trim();if(!t)return``;let[n]=t.split(/\s+/),[r]=n.split(`:`);return r.toLowerCase()}(e);return Lw[t]??t}function zw(e){let t=Rw(e);if(!t)return`plaintext`;switch(t){case`plain`:return`plaintext`;case`shell`:return`zsh`;case`objectivec`:return`objective-c`;case`objectivecpp`:return`objective-cpp`;default:return t}}function Bw(e){return Nw(Rw(e))||Pw()}var Vw={js:`JavaScript`,javascript:`JavaScript`,ts:`TypeScript`,typescript:`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`};function Hw(){}var Uw=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Ww=null,Gw=!1,Kw=null,qw=Xw;function Jw(e){let t=e?.default??e;return t&&typeof t.renderToString==`function`?t:null}function Yw(){try{return Jw(globalThis?.katex)}catch{return null}}function Xw(){return Uw(null,null,function*(){let e=Yw();if(e)return e;let t=yield V(()=>import(`./__vite-optional-peer-dep_katex_markstream-vue-Bg9-FXxr.js`),[]);try{yield V(()=>import(`./mhchem_markstream-vue-tp86PqxG.js`),[])}catch{}return Jw(t)})}function Zw(e){let t=Promise.resolve(e).then(e=>Kw===t&&e?(Ww=Jw(e)??e,Ww):null).catch(()=>null).finally(()=>{Kw===t&&(Kw=null)});return Kw=t,Gw=!0,t}function Qw(e){qw=e,Ww=null,Gw=!1,Kw=null}function $w(){Qw(null)}function eT(){return typeof qw==`function`}function tT(){let e=qw;if(!e||e===Xw)return null;if(Ww)return Ww;let t=Yw();if(t)return Ww=t,Ww;if(Gw)return null;try{let t=e();return t?typeof t?.then==`function`?(Zw(t),null):(Ww=Jw(t)??t,Ww):null}catch{return null}}function nT(){return Uw(this,null,function*(){let e=Yw();if(e)return Ww=e,Ww;if(Ww)return Ww;if(Kw)return Kw;if(Gw)return null;let t=qw;if(!t)return Gw=!0,null;try{let e=t();if(typeof e?.then==`function`)return Zw(e);if(e)return Ww=Jw(e)??e,Gw=!0,Ww}catch{}return Gw=!0,null})}function rT(e){return e?e.replace(/·/g,`⋅`).replace(/℃/g,`°C`):``}var iT=null,aT=null,oT=new Map,sT=new Map,cT=5,lT=new Set;function uT(){if(oT.size<cT&&lT.size){let e=cT-oT.size;for(let t of Array.from(lT)){if(e<=0)break;lT.delete(t),e--;try{t()}catch{}}}}function dT(e,t=!0,n=2e3,r){return Uw(this,null,function*(){performance.now();let i=rT(e);if(!eT()){let e=Error(`KaTeX rendering disabled`);return e.name=`KaTeXDisabled`,e.code=`KATEX_DISABLED`,Promise.reject(e)}if(aT)return Promise.reject(aT);let a=`${t?`d`:`i`}:${i}`,o=sT.get(a);if(o)return uT(),Promise.resolve(o);let s=iT||(aT=Error(`[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker().`),aT.name=`WorkerInitError`,aT.code=`WORKER_INIT_ERROR`,null);if(!s)return Promise.reject(aT);if(oT.size>=cT){let e=Error(`Worker busy`);return e.name=`WorkerBusy`,e.code=`WORKER_BUSY`,e.busy=!0,e.inFlight=oT.size,e.max=cT,Promise.reject(e)}return new Promise((e,a)=>{if(r?.aborted){let e=Error(`Aborted`);e.name=`AbortError`,a(e);return}let o=Math.random().toString(36).slice(2),c=null,l=globalThis.setTimeout(()=>{let e=oT.get(o);if(!e)return;oT.delete(o),e.cleanup();let t=Error(`Worker render timed out`);t.name=`WorkerTimeout`,t.code=`WORKER_TIMEOUT`,e.aborted||e.reject(t),uT()},n);c=()=>{let e=oT.get(o);if(!e||e.aborted)return;e.aborted=!0,e.cleanup();let t=Error(`Aborted`);t.name=`AbortError`,a(t)},r&&r.addEventListener(`abort`,c,{once:!0});let u=e,d=a;oT.set(o,{resolve:e=>{u(e)},reject:e=>{d(e)},timeoutId:l,aborted:!1,cleanup:()=>{r&&c&&r.removeEventListener(`abort`,c),c=null}});try{s.postMessage({id:o,content:i,displayMode:t})}catch(e){let t=oT.get(o);oT.delete(o),clearTimeout(l),t?.cleanup(),t?.reject(e),uT()}})})}function fT(e,t=!0,n){let r=`${t?`d`:`i`}:${rT(e)}`;if(sT.set(r,n),sT.size>200){let e=sT.keys().next().value;sT.delete(e)}}var pT=`WORKER_BUSY`;function mT(e=2e3,t){return oT.size<cT?Promise.resolve():new Promise((n,r)=>{let i,a=!1,o=null,s=()=>{},c=()=>{i&&globalThis.clearTimeout(i),lT.delete(s),t&&o&&t.removeEventListener(`abort`,o),o=null};s=()=>{a||(a=!0,c(),n())},lT.add(s),i=globalThis.setTimeout(()=>{if(a)return;a=!0,c();let e=Error(`Wait for worker slot timed out`);e.name=`WorkerBusyTimeout`,e.code=`WORKER_BUSY_TIMEOUT`,r(e)},e),queueMicrotask(()=>uT()),t&&(o=()=>{if(a)return;a=!0,c();let e=Error(`Aborted`);e.name=`AbortError`,r(e)},t.aborted?o():t.addEventListener(`abort`,o,{once:!0}))})}var hT={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function gT(e){return Uw(this,arguments,function*(e,t=!0,n={}){if(!eT()){let e=Error(`KaTeX rendering disabled`);throw e.name=`KaTeXDisabled`,e.code=`KATEX_DISABLED`,e}let r=n.timeout??hT.timeout,i=n.waitTimeout??hT.waitTimeout,a=n.backoffMs??hT.backoffMs,o=n.maxRetries??hT.maxRetries,s=Number.isFinite(o)?Math.max(0,Math.min(Math.floor(o),8)):hT.maxRetries,c=n.signal,l=0;for(;;){if(c?.aborted){let e=Error(`Aborted`);throw e.name=`AbortError`,e}try{return yield dT(e,t,r,c)}catch(e){if(e?.code!==`WORKER_BUSY`||l>=s)throw e;if(l++,yield mT(i,c).catch(()=>{}),c?.aborted){let e=Error(`Aborted`);throw e.name=`AbortError`,e}a>0&&(yield new Promise(e=>globalThis.setTimeout(e,a*l)))}}})}function _T(e){let t=typeof e==`number`?e:Number.parseFloat(String(e??``));return Number.isFinite(t)&&t>0?t:null}function vT(e){for(let t of e.split(/\r?\n/)){let e=t.trim();if(e&&!e.startsWith(`%%`))return(e.match(/^([A-Z][\w-]*)\b/i)?.[1])?.toLowerCase()||``}return``}function yT(e){let t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`%%`)),n=Math.max(1,t.length),r=vT(e);return r===`gantt`?220+28*n:r===`sequencediagram`?180+26*n:r===`classdiagram`||r===`statediagram`||r===`erdiagram`?180+24*n:r===`flowchart`||r===`graph`?170+28*n:200+22*n}function bT(e){let t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}function xT(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function ST(e,t=360,n=500){return xT(e,t,n)}function CT(e,t=120,n=500){return xT(e,t,n)}function wT(e,t=360,n=500){return xT(e,t,n)}function TT(e,t=240,n=500){return xT(e,t,n)}var ET=new Set([`direction`,`label`,`shape`,`icon`,`near`,`link`,`tooltip`,`width`,`height`,`grid-rows`,`grid-columns`,`grid-gap`,`vertical-gap`,`horizontal-gap`,`class`,`constraint`,`source-arrowhead`,`target-arrowhead`]),DT=new Set([`vars`,`classes`,`style`,`layers`,`scenarios`,`steps`]);function OT(e){let t=0,n=!1;for(let r=0;r<e.length;r++){let i=e[r];i!==`"`&&i!==`'`?n||(i===`{`?t+=1:i===`}`&&--t):n=!n}return t}function kT(e){let t=0,n=0,r=0;for(let i of e.split(/\r?\n/)){let e=i.trim();if(r>0){r=Math.max(0,r+OT(e));continue}if(!e||e.startsWith(`#`)||e.startsWith(`...`)||/^[}\]]+$/.test(e))continue;let a=e.match(/^([A-Z_][\w-]*)\s*:(.*)$/i);if(a){let e=a[1].toLowerCase();if(DT.has(e)){t+=1,r=Math.max(0,OT(a[2]));continue}if(ET.has(e)){t+=1;continue}}n+=1,t+=1}return xT(120+46*Math.max(1,n)+8*Math.max(0,t-n),240,500)}var AT=Object.defineProperty,jT=Object.defineProperties,MT=Object.getOwnPropertyDescriptors,NT=Object.getOwnPropertySymbols,PT=Object.prototype.hasOwnProperty,FT=Object.prototype.propertyIsEnumerable,IT=(e,t,n)=>t in e?AT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LT=(e,t)=>{for(var n in t||={})PT.call(t,n)&&IT(e,n,t[n]);if(NT)for(var n of NT(t))FT.call(t,n)&&IT(e,n,t[n]);return e},RT=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),zT=()=>V(()=>import(`./__vite-optional-peer-dep_mermaid_markstream-vue-cPZl55sA.js`),[]),BT=null,VT=zT,HT=null,UT=!1,WT=!1,GT=0;function KT(e){VT=e,GT++,BT=null,HT=null,UT=!1,WT=!1}function qT(){KT(null)}function JT(){return typeof VT==`function`}function YT(e){if(!e)return e;let t=e&&e.default?e.default:e;if(t&&(typeof t.render==`function`||typeof t.parse==`function`||typeof t.initialize==`function`))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render==`function`||typeof t.mermaidAPI.parse==`function`)){let e=t.mermaidAPI;return n=LT({},t),r={render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:n=>typeof t.initialize==`function`?t.initialize(n):e.initialize?e.initialize(n):void 0},jT(n,MT(r))}var n,r;return e.mermaid&&typeof e.mermaid.render==`function`?e.mermaid:t}function XT(e){if(e)try{let t=e?.initialize;e.initialize=n=>{let r=LT({suppressErrorRendering:!0},n||{});return typeof t==`function`?t.call(e,r):e?.mermaidAPI&&typeof e.mermaidAPI.initialize==`function`?e.mermaidAPI.initialize(r):void 0}}catch{}}function ZT(){return RT(this,null,function*(){if(BT)return BT;let e=function(){try{return YT(globalThis?.mermaid)}catch{return null}}();if(e)return BT=e,XT(BT),BT;let t=VT,n=GT;return t?t===zT&&UT?null:HT||(HT=RT(null,null,function*(){let e;try{e=yield t()}catch(e){if(t===zT)return n===GT&&t===VT&&(UT=!0,function(e){WT||(WT=!0,console.warn(`[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.`,e))}(e)),null;throw e}finally{n===GT&&t===VT&&(HT=null)}return n!==GT||t!==VT?null:e?(BT=YT(e),XT(BT),BT):null}),HT):null})}var QT=null,$T=null,eE=new Map,tE=new Map,nE=5,rE=`MERMAID_DISABLED`;function iE(e,t,n,r){if(!JT()){let e=Error(`Mermaid rendering disabled`);return e.name=`MermaidDisabled`,e.code=rE,Promise.reject(e)}let i=`${e}\0${t.theme}\0${n}\0${t.code}`,a=tE.get(i);return a||(a=function(e,t,n=1400){if(!JT()){let e=Error(`Mermaid rendering disabled`);return e.name=`MermaidDisabled`,e.code=`MERMAID_DISABLED`,Promise.reject(e)}if($T)return Promise.reject($T);let r=QT||($T=Error(`[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker().`),$T.name=`WorkerInitError`,$T.code=`WORKER_INIT_ERROR`,null);if(!r)return Promise.reject($T);if(eE.size>=nE){let e=Error(`Worker busy`);return e.name=`WorkerBusy`,e.code=`WORKER_BUSY`,e.inFlight=eE.size,e.max=nE,Promise.reject(e)}return new Promise((i,a)=>{let o=Math.random().toString(36).slice(2),s,c=!1,l=()=>{c||(c=!0,s!=null&&globalThis.clearTimeout(s),eE.delete(o))};eE.set(o,{resolve:e=>{l(),i(e)},reject:e=>{l(),a(e)}});try{r.postMessage({id:o,action:e,payload:t})}catch(e){eE.delete(o),a(e);return}s=globalThis.setTimeout(()=>{let e=Error(`Worker call timed out`);e.name=`WorkerTimeout`,e.code=`WORKER_TIMEOUT`;let t=eE.get(o);t&&t.reject(e)},n)})}(e,t,n),tE.set(i,a),a.then(()=>{tE.get(i)===a&&tE.delete(i)},()=>{tE.get(i)===a&&tE.delete(i)})),function(e,t){if(!t)return e;if(t.aborted){let e=Error(`Aborted`);return e.name=`AbortError`,Promise.reject(e)}return new Promise((n,r)=>{let i=()=>{},a=()=>t.removeEventListener(`abort`,i);i=()=>{a();let e=Error(`Aborted`);e.name=`AbortError`,r(e)},t.addEventListener(`abort`,i,{once:!0}),e.then(e=>{a(),n(e)},e=>{a(),r(e)})})}(a,r)}function aE(e,t,n=1400,r){return iE(`canParse`,{code:e,theme:t},n,r)}function oE(e,t,n=1400,r){return iE(`findPrefix`,{code:e,theme:t},n,r)}var sE=Object.defineProperty,cE=Object.defineProperties,lE=Object.getOwnPropertyDescriptors,uE=Object.getOwnPropertySymbols,dE=Object.prototype.hasOwnProperty,fE=Object.prototype.propertyIsEnumerable,pE=(e,t,n)=>t in e?sE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z=(e,t)=>{for(var n in t||={})dE.call(t,n)&&pE(e,n,t[n]);if(uE)for(var n of uE(t))fE.call(t,n)&&pE(e,n,t[n]);return e},Q=(e,t)=>cE(e,lE(t)),mE=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),hE=`__global__`,gE=`__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__`,_E=(()=>{let e=globalThis;if(e[gE])return e[gE];let t={scopedCustomComponents:{},revision:x(0)};return e[gE]=t,t})(),vE=_E.revision,yE=Symbol(`markstreamCustomComponents`),bE=new Set(`text.paragraph.heading.code_block.list.list_item.blockquote.table.table_row.table_cell.definition_list.definition_item.footnote.footnote_reference.footnote_anchor.admonition.hardbreak.link.image.thematic_break.math_inline.math_block.strong.emphasis.strikethrough.highlight.insert.subscript.superscript.emoji.checkbox.checkbox_input.inline_code.html_inline.html_block.reference.mermaid.infographic.d2.vmr_container`.split(`.`));function xE(e){return bE.has(String(e).trim().toLowerCase())}function SE(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[_\s]+/g,`-`).toLowerCase()}function CE(e={}){let t={};for(let[n,r]of Object.entries(e))if(r!=null){t[n]=r;for(let e of new Set([vf(n),vf(SE(n))]))!e||xE(e)||Object.prototype.hasOwnProperty.call(t,e)||(t[e]=r)}return t}function wE(e,t){typeof e==`string`?_E.scopedCustomComponents[e]=CE(t||{}):_E.scopedCustomComponents[hE]=CE(e||{}),vE.value++}function TE(e){let t=k(yE,null);return E(()=>(vE.value,function(e,t={}){return vE.value,Z(Z(Z({},CE(_E.scopedCustomComponents[hE]||{})),CE(t)),CE(function(e){return e&&_E.scopedCustomComponents[e]||{}}(e)))}(e?.(),t?.value??{})))}var EE=[`aria-label`],DE={key:0,xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,class:`checkbox-icon checkbox-unchecked`},OE={key:1,xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,class:`checkbox-icon checkbox-checked`},$=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},kE=$(p({__name:`CheckboxNode`,props:{node:{}},setup:e=>(t,n)=>(B(),z(`span`,{class:`checkbox-node`,role:`img`,"aria-label":e.node.checked?`checked`:`unchecked`},[e.node.checked?(B(),z(`svg`,OE,[...n[1]||=[T(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`4`,fill:`currentColor`},null,-1),T(`path`,{d:`M9 12l2 2 4-4`,stroke:`hsl(var(--ms-background))`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)]])):(B(),z(`svg`,DE,[...n[0]||=[T(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`4`,stroke:`currentColor`,"stroke-width":`2`},null,-1)]]))],8,EE))}),[[`__scopeId`,`data-v-be21ab83`]]);kE.install=e=>{e.component(kE.__name,kE)};var AE={class:`emoji-node`},jE=$(p({__name:`EmojiNode`,props:{node:{}},setup:e=>(t,n)=>(B(),z(`span`,AE,C(e.node.name),1))}),[[`__scopeId`,`data-v-de55dc97`]]);jE.install=e=>{e.component(jE.__name,jE)};var ME=`.markdown-renderer`;function NE(e,t){if(typeof document>`u`||typeof Element>`u`)return null;let n=function(e){return`[id="${e.replace(/["\\]/g,`\\$&`)}"]`}(t),r=e instanceof Element?e.closest(ME):null;for(;r;){let e=r.querySelector(n);if(e)return e;r=r.parentElement?.closest(ME)??null}return document.querySelector(n)}var PE=[`id`],FE=[`title`],IE=$(p({__name:`FootnoteReferenceNode`,props:{node:{}},setup(e){let t=e,n=`#fnref--${t.node.id}`;function r(e){if(typeof document>`u`)return;let r=NE(e.currentTarget,`fnref--${t.node.id}`);r?r.scrollIntoView({behavior:`smooth`}):console.warn(`Element with href: ${n} not found`)}return(t,i)=>(B(),z(`sup`,{id:`fnref-${e.node.id}`,class:`footnote-reference`,onClick:r},[T(`span`,{href:n,title:`查看脚注 ${e.node.id}`,class:`footnote-link cursor-pointer`},`[`+C(e.node.id)+`]`,9,FE)],8,PE))}}),[[`__scopeId`,`data-v-d1baf613`]]);IE.install=e=>{e.component(IE.__name,IE)};var LE=(()=>{try{return!1}catch{}return!1})();function RE(e){LE&&console.warn(e)}function zE(e,t){return LC(e,t)}function BE(e,t=`safe`,n){return RC(e,t,n)}function VE(e){return HC(e)}function HE(e){return!0===e?``:!1===e?`false`:e==null?null:String(e)}function UE(e,t=`safe`){let n=String(e.tag||e.type||``).trim(),r=BC((i=e.attrs)?Array.isArray(i)?i.every(Array.isArray)?i.map(([e,t])=>[String(e),HE(t)]):i.filter(e=>e&&typeof e==`object`&&!Array.isArray(e)&&`name`in e).map(e=>[String(e.name),HE(e.value)]):Object.entries(i).map(([e,t])=>[e,HE(t)]):null,t,n);var i;if(!r)return;let a=VE(zC(r));return Object.keys(a).length>0?a:void 0}function WE(e,t,n=!1){let r=Object.entries(t??{}),i=r.length>0?r.map(([e,t])=>t===``?` ${e}`:` ${e}="${t}"`).join(``):``;return n?`<${e}${i} />`:`<${e}${i}>`}function GE(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function KE(e,t,n,r,i,a,o=!1){let s=zE(e,r);if(Wd.has(e.toLowerCase())||!s&&kC(e,a))return null;if(!s&&OC(e,a))return o?[WE(e,t,!0)]:[WE(e,t),...n,`</${e}>`];let c=RC(t,a,e),u=c.key,d=u!=null&&u!==``?u:i;if(s){let t=r[e]||r[e.toLowerCase()],i=VE(c);return l(t,Q(Z({},i),{key:d}),n.length>0?n:void 0)}return l(e,Q(Z({},c),{innerHTML:void 0,key:d}),n.length>0?n:void 0)}function qE(e,t,n=`safe`,r=!1){var i;try{if(!r&&Object.keys(t).length===0)return{ok:!0,hasCustomComponents:!1,nodes:null};let i=WC(e),a=!1;for(let e of i)if((e.type===`tag_open`||e.type===`self_closing`)&&zE(e.tagName??``,t)){a=!0;break}let o=r||a?function(e,t,n=`safe`){let r=0,i=[],a=[];for(let o of e)if(o.type===`text`)(i.length>0?i[i.length-1].children:a).push(o.content);else if(o.type===`self_closing`){let e=KE(o.tagName,o.attrs||{},[],t,`ms-html-`+r++,n,!0);GE(i.length>0?i[i.length-1].children:a,e)}else if(o.type===`tag_open`)i.push({tagName:o.tagName,children:[],attrs:o.attrs,autoKey:`ms-html-`+r++});else if(o.type===`tag_close`){let e=o.tagName.toLowerCase(),r=-1;for(let t=i.length-1;t>=0;t--)if(i[t].tagName.toLowerCase()===e){r=t;break}if(r!==-1)for(;i.length>r;){let o=i.pop(),s=KE(o.tagName,o.attrs||{},o.children,t,o.autoKey,n);i.length>0?GE(i[i.length-1].children,s):GE(a,s),o.tagName.toLowerCase()!==e&&i.length>r&&RE(`Auto-closing unclosed tag: <${o.tagName}>`)}else RE(`Ignoring closing tag with no matching opening tag: </${o.tagName}>`)}for(;i.length>0;){let e=i.pop(),r=KE(e.tagName,e.attrs||{},e.children,t,e.autoKey,n);i.length>0?GE(i[i.length-1].children,r):GE(a,r),RE(`Auto-closing unclosed tag: <${e.tagName}>`)}return a}(i,t,n):null;return{ok:!0,hasCustomComponents:a,nodes:o}}catch(e){return i=e,LE&&console.error(`Failed to parse HTML to VNodes:`,i),{ok:!1,hasCustomComponents:!1,nodes:null}}}var JE=[`innerHTML`],YE=$(p({__name:`HtmlInlineNode`,props:{node:{},customId:{},htmlPolicy:{}},setup(e){let t=e,r=k(`markstreamHtmlPolicy`,void 0),i=E(()=>t.htmlPolicy??r?.value??`safe`),a=TE(()=>t.customId),o=p({name:`DynamicRenderer`,props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),s=E(()=>{let e=t.node.content;if(!e)return{mode:`html`,content:``};if(i.value===`escape`)return{mode:`html`,content:qC(e,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:`text`,content:e};let n=!0===t.node.loading&&!0===t.node.autoClosed,r=qE(e,a.value,i.value,n);return r.ok&&(n||r.hasCustomComponents)?{mode:`dynamic`,nodes:r.nodes}:{mode:`html`,content:qC(e,i.value)}});return(e,r)=>s.value.mode===`dynamic`?(B(),z(`span`,{key:0,class:S([`html-inline-node`,{"html-inline-node--loading":t.node.loading}])},[n(F(o),{nodes:s.value.nodes},null,8,[`nodes`])],2)):s.value.mode===`text`?(B(),z(`span`,{key:1,class:S([`html-inline-node`,{"html-inline-node--loading":t.node.loading}])},C(s.value.content),3)):(B(),z(`span`,{key:2,class:S([`html-inline-node`,{"html-inline-node--loading":t.node.loading}]),innerHTML:s.value.content},null,10,JE))}}),[[`__scopeId`,`data-v-fbbbc497`]]);function XE(e){let t=rn(e),n=D(e),r=x(t.getSnapshot().segments),i=new Set,a=0;function o(){a&&cancelAnimationFrame(a),a=0,i.clear()}function s(){let e=t.getSnapshot();n.value=e.settledContent,r.value=e.segments}return N(o),{settledContent:n,segments:r,update:function(e,n,r){r||o();let i=typeof document>`u`||document.visibilityState!==`hidden`;t.update(e,n,r&&i),s()},finish:function(e,n=!1){t.finish(e,n),s()},queueFinish:function(e,n){i.add(e),a||=requestAnimationFrame(()=>{a=0;for(let e of i)t.finish(e,!0);i.clear(),n!=null&&n()||t.settleFinished(),s()})},finishAll:function(e=!1){o(),t.finishAll(e),s()},settleFinished:function(){t.settleFinished(),s()}}}YE.install=e=>{e.component(YE.__name,YE)};var ZE={class:`inline-code`},QE={key:0},$E=[`onAnimationend`],eD=$(p({__name:`InlineCodeNode`,props:{node:{}},setup(e){let t=e,n=ee(),r=k(`markstreamFade`,void 0),i=k(`markstreamTextFinal`,void 0),a=k(`markstreamFinalCleanup`,void 0),s=!0;N(()=>{s=!1});let c=k(`markstreamTextStreamState`,void 0),l=E(()=>{let e=n.fade;return e===``||!0===e||e===`true`||!1!==e&&e!==`false`&&void 0}),u=E(()=>typeof l.value==`boolean`?l.value:typeof r?.value!=`boolean`||r.value),d=E(()=>String(t.node.code??``)),p=E(()=>!u.value),m=E(()=>{let e=n[`index-key`]??n.indexKey;return e==null||e===``?``:String(e)}),{settledContent:h,segments:g,update:_,finish:y,queueFinish:b,finishAll:x}=XE(t.node.code);return v([()=>t.node.code,m,u,()=>g.value.length>0&&!0===i?.value],([e])=>{let t=String(e??``);if(!0===i?.value&&a&&g.value.length&&t===h.value+g.value.map(e=>e.content).join(``)){let e=g.value.find(e=>!e.finished);e&&(x(!0),a(()=>{s&&y(e.id)}));return}let n=m.value;_(t,n?c?.get(n):void 0,u.value&&!0!==i?.value),n&&c?.set(n,t)},{immediate:!0}),(e,t)=>(B(),z(`code`,ZE,[p.value?(B(),z(w,{key:0},[f(C(d.value),1)],64)):(B(),z(w,{key:1},[F(h)?(B(),z(`span`,QE,C(F(h)),1)):L(``,!0),(B(!0),z(w,null,o(F(g),e=>(B(),z(`span`,{key:e.id,class:S(e.finished||!0===F(i)?.value?`inline-code-stream-final`:`inline-code-stream-delta`),onAnimationend:t=>F(b)(e.id)},C(e.content),43,$E))),128))],64))]))}}),[[`__scopeId`,`data-v-8afc29be`]]);eD.install=e=>{e.component(eD.__name,eD)};var tD=D(!1),nD=D(``),rD=D(`top`),iD=D(null),aD=D(null),oD=D(null),sD=D(null),cD=D(null),lD=null,uD=null,dD=0;function fD(){lD&&=(clearTimeout(lD),null),uD&&=(clearTimeout(uD),null)}var pD=!1,mD=null,hD=!1;function gD(e,t,n=`top`,r=!1,i,a){if(!e)return;let o=++dD;fD();let s=()=>mE(null,null,function*(){if(yield function(){return mE(this,null,function*(){if(!pD&&!hD&&typeof document<`u`){mD??=mE(null,null,function*(){let[{createApp:e,h:t},{default:n}]=yield Promise.all([V(()=>import(`./vue.runtime.esm-bundler-Dph2MMo9.js`).then(e=>e.t),__vite__mapDeps([0,1])),V(()=>import(`./Tooltip-DtQZvsaN.js`),__vite__mapDeps([2,0,1,3,4]))]),r=document.createElement(`div`);r.setAttribute(`data-singleton-tooltip`,`1`),document.body.appendChild(r),e({setup:()=>()=>t(n,{visible:tD.value,"anchor-el":iD.value,content:nD.value,placement:rD.value,id:aD.value,originX:oD.value,originY:sD.value,isDark:cD.value??void 0})}).mount(r),pD=!0});try{yield mD}catch(e){pD=!1,mD=null,hD=!0,console.warn(`[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.`,e)}}})}(),pD&&o===dD){aD.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,iD.value=e,nD.value=t,rD.value=n,oD.value=i?.x??null,sD.value=i?.y??null,cD.value=typeof a==`boolean`?a:null,tD.value=!0;try{e.setAttribute(`aria-describedby`,aD.value)}catch{}}});return r?s():lD=setTimeout(s,80),()=>{o===dD&&_D(!0)}}function _D(e=!1){dD+=1,fD();let t=()=>{if(iD.value&&aD.value)try{iD.value.removeAttribute(`aria-describedby`)}catch{}tD.value=!1,iD.value=null,aD.value=null,oD.value=null,sD.value=null};e?t():uD=setTimeout(t,120)}var vD={"common.copy":`Copy`,"common.selectCopy":`全选(复制)`,"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...`},yD=Symbol(`markstreamI18nFallback`);function bD(e,t){return t?.[e]??vD[e]}var xD=(e,t)=>bD(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 SD(e,t){return{t(n){let r=bD(n,t);if(e.te&&r!=null&&!e.te(n))return xD(n,t);let i=e.t(n);return i===n&&r!=null?xD(n,t):i}}}function CD(){let e=function(){try{let e=i(),t=yD,n=e?.provides,r=e?.appContext?.provides;return n?.[t]??r?.[t]??null}catch{}return null}(),t=function(){try{let e=i(),t=e?.proxy,n=t?.$t;if(typeof n==`function`){let e=t?.$te;return{t:n.bind(t),te:typeof e==`function`?e.bind(t):void 0}}let r=e?.appContext?.config?.globalProperties,a=r?.$t;if(typeof a==`function`){let e=r?.$te;return{t:a.bind(r),te:typeof e==`function`?e.bind(r):void 0}}}catch{}return null}();if(t)return SD(t,e);try{let t=globalThis.$vueI18nUse||null;if(t&&typeof t==`function`)try{let n=t();if(n&&typeof n.t==`function`)return SD({t:n.t.bind(n),te:typeof n.te==`function`?n.te.bind(n):void 0},e)}catch{}}catch{}return{t:t=>xD(t,e)}}var wD=Symbol(`ViewportPriority`),TD=Symbol(`ViewportPriorityOptions`),ED=Symbol(`OffscreenHeavyNodeDeferral`),DD=E(()=>!1),OD=`400px`;function kD(){return k(TD,void 0)}function AD(){return k(ED,DD)}function jD(e,n){let r=typeof window<`u`&&typeof document<`u`,i=typeof n==`boolean`?D(n):n,a=r?window.requestIdleCallback??(e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16)):null,o=r?window.cancelIdleCallback??(e=>window.clearTimeout(e)):null,s=new WeakMap,c=1,l=new Map,u=new Map,d=new Set,f=null,p=null;function m(e){if(!e)return`viewport`;let t=s.get(e);return t||(t=c++,s.set(e,t)),String(t)}function g(){if(f!=null){try{o?.(f)}catch{}f=null}}function _(e){if(e){let t=l.get(e);if(t&&!t.targets.size){try{t.io.disconnect()}catch{}l.delete(e)}}u.size||d.size||g()}function y(e){let t=u.get(e);if(!t)return;let n=l.get(t.bucketKey);if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch{}}try{n?.io.unobserve(e)}catch{}n?.targets.delete(e),u.delete(e),d.delete(e),_(t.bucketKey)}function b(){!0!==window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__&&a&&f==null&&d.size&&(f=a(()=>{f=null;let e=d.values().next().value;e&&(d.delete(e),y(e),d.size&&b())},{timeout:1200}))}function x(t,n){if(!r||typeof IntersectionObserver>`u`)return null;let i=function(t,n){return{root:e?.(t??null)??null,rootMargin:n?.rootMargin??OD,threshold:n?.threshold??0}}(t,n),a=[m((o=i).root),o.rootMargin,o.threshold].join(`\0`);var o;let s=l.get(a);if(s)return{key:a,bucket:s};let c;try{c=new IntersectionObserver(e=>{for(let t of e)(t.isIntersecting||t.intersectionRatio>0)&&y(t.target)},{root:i.root,rootMargin:i.rootMargin,threshold:i.threshold})}catch{return null}let u={io:c,targets:new Map};return l.set(a,u),{key:a,bucket:u}}function S(){if(r&&i.value)for(let[e,t]of Array.from(u.entries())){let n=x(e,t.opts);if(!n){y(e);continue}if(n.key===t.bucketKey)continue;let r=t.bucketKey,i=l.get(r);try{i?.io.unobserve(e)}catch{}i?.targets.delete(e),t.bucketKey=n.key,n.bucket.targets.set(e,t),n.bucket.io.observe(e),_(r)}}v(i,e=>{if(!e){for(let e of Array.from(u.keys()))y(e);g()}},{flush:`sync`});let C=(e,t)=>{let n=D(!1),a,o=!1,s=!1,c=new Promise(e=>{a=()=>{o||(o=!0,e())}}),f=()=>{s=!0;let t=u.get(e);if(!t)return d.delete(e),void _();let n=l.get(t.bucketKey);try{n?.io.unobserve(e)}catch{}n?.targets.delete(e),u.delete(e),d.delete(e),_(t.bucketKey)};return r&&i.value&&typeof IntersectionObserver<`u`?(h(()=>{if(s)return;let o=i.value?x(e,t):null;if(!o)return n.value=!0,void a();let c={resolve:a,visible:n,bucketKey:o.key,opts:t};u.set(e,c),o.bucket.targets.set(e,c),o.bucket.io.observe(e),r&&p==null&&(p=window.requestAnimationFrame(()=>{p=null,S()})),!1!==t?.allowIdle&&(d.add(e),b())}),{isVisible:n,whenVisible:c,destroy:f}):(n.value=!0,a(),{isVisible:n,whenVisible:c,destroy:f})};return C.refresh=S,t(wD,C),C}function MD(){let e=k(wD,void 0);if(e)return e;let t=new WeakMap,n=new Map,r=new Set,i=null,a=typeof window<`u`?window.requestIdleCallback??(e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16)):null,o=typeof window<`u`?window.cancelIdleCallback??(e=>window.clearTimeout(e)):null,s=()=>{if(i!=null){try{o?.(i)}catch{}i=null}},c=e=>{if(!e)return;let t=n.get(e);if(t&&!t.targets.size){try{t.io.disconnect()}catch{}n.delete(e)}},l=e=>{let i=t.get(e);if(!i)return;let a=n.get(i.bucketKey);if(!i.visible.value){i.visible.value=!0;try{i.resolve()}catch{}}try{a?.io.unobserve(e)}catch{}t.delete(e),a?.targets.delete(e),r.delete(e),c(i.bucketKey),r.size||s()},u=()=>{!0!==window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__&&a&&i==null&&r.size&&(i=a(()=>{i=null;let e=r.values().next().value;e&&(r.delete(e),l(e),r.size&&u())},{timeout:1200}))};return(e,i)=>{let a=D(!1),o,d=!1,f=new Promise(e=>{o=()=>{d||(d=!0,e())}}),p=()=>{let i=t.get(e);if(!i)return r.delete(e),void(r.size||s());let a=n.get(i.bucketKey);try{a?.io.unobserve(e)}catch{}t.delete(e),a?.targets.delete(e),r.delete(e),c(i.bucketKey),r.size||s()},m=(e=>{if(typeof window>`u`||typeof IntersectionObserver>`u`)return null;let t=(e=>[e?.rootMargin??OD,e?.threshold??0].join(`\0`))(e),r=n.get(t);if(r)return{key:t,bucket:r};let i=e?.rootMargin??OD,a;try{a=new IntersectionObserver(e=>{for(let t of e)(t.isIntersecting||t.intersectionRatio>0)&&l(t.target)},{root:null,rootMargin:i,threshold:e?.threshold??0})}catch{return null}let o={io:a,targets:new Set};return n.set(t,o),{key:t,bucket:o}})(i);return m?(t.set(e,{resolve:o,visible:a,bucketKey:m.key}),m.bucket.targets.add(e),m.bucket.io.observe(e),!1!==i?.allowIdle&&(r.add(e),u()),{isVisible:a,whenVisible:f,destroy:p}):(a.value=!0,o(),{isVisible:a,whenVisible:f,destroy:p})}}function ND(e,t){let n=e.indexKey??t[`index-key`]??t.indexKey;return n==null||n===``?``:String(n)}var PD=[`data-markstream-viewport-pending`],FD=[`src`,`alt`,`title`,`loading`,`fetchpriority`,`decoding`,`tabindex`,`aria-label`],ID={key:1,class:`image-placeholder`},LD={key:1,class:`image-node__raw-text`},RD={key:2,class:`image-error`},zD=$(p({__name:`ImageNode`,props:{node:{},fallbackSrc:{default:``},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:[`load`,`error`,`click`],setup(e,{emit:t}){var n;let r=e,a=t,o=D(!1),s=D(!1),l=D(!1),d=D(``),f=D(`primary`),p=D(null),h=ee(),g=k(Cw,null),_=MD(),y=kD(),b=AD(),w=E(()=>cf(r.node.src)),O=E(()=>cf(r.fallbackSrc)),A=((n=i()?.vnode.el)?.querySelector)?.call(n,`img`),j=typeof window<`u`&&A?.getAttribute(`src`)===(w.value||O.value),M=D(typeof window>`u`||j||!b.value),N=x(null),P=``,te=null,ne=E(()=>d.value),I=E(()=>!r.lazy),R=E(()=>typeof window<`u`&&b.value&&!j),V=E(()=>!R.value||M.value),re=E(()=>V.value?ne.value:``),ie=E(()=>y?.value.heavyBlockMargin??y?.value.rootMargin??OD),ae=E(()=>!r.node.loading&&f.value!==`failed`&&d.value.length>0),oe=E(()=>f.value===`failed`),se=E(()=>(s.value||!I.value||R.value)&&!o.value&&!l.value&&f.value!==`failed`&&d.value.length>0),ce=E(()=>ND(r,h));function le(e=ce.value){e&&p.value&&g?.reportHeight(e,p.value.offsetHeight)}function ue(e=ce.value){e&&c(()=>{le(e)})}function de(){te&&=(clearTimeout(te),null)}function fe(){let e=ce.value;e&&P!==e&&(P&&g?.markSettled(P),de(),P=e,g?.markPending(e),typeof window<`u`&&(te=window.setTimeout(()=>{P===e&&(ue(e),pe())},8e3)))}function pe(){return mE(this,null,function*(){let e=P;e&&(de(),P=``,yield c(),le(e),g?.markSettled(e))})}function me(){if(f.value===`primary`&&O.value&&O.value!==d.value)return f.value=`fallback`,d.value=O.value,o.value=!1,l.value=!1,void ue();f.value=`failed`,l.value=!0,a(`error`,d.value),ue()}function he(){o.value=!0,s.value=!1,l.value=!1,a(`load`,ne.value),ue()}function ge(e){e.preventDefault(),o.value&&!l.value&&a(`click`,[e,ne.value])}let{t:_e}=CD();return v([w,O,()=>r.node.loading],()=>(o.value=!1,l.value=!1,r.node.loading?(s.value=!0,d.value=w.value,void(f.value=`primary`)):w.value?(d.value=w.value,void(f.value=`primary`)):O.value?(d.value=O.value,void(f.value=`fallback`)):(d.value=``,f.value=`failed`,void(l.value=!0))),{immediate:!0}),typeof window<`u`&&v([p,R],([e,t],n,r)=>{var i;if((i=N.value)==null||i.destroy(),N.value=null,!t||M.value)return void(M.value=!0);if(!e)return void(M.value=!1);let a=!0,o=_(e,{rootMargin:ie.value,allowIdle:!1});N.value=o,M.value=o.isVisible.value,o.whenVisible.then(()=>{a&&N.value===o&&(M.value=!0)}),r(()=>{a=!1,o.destroy(),N.value===o&&(N.value=null)})},{immediate:!0}),v([ae,o,l,ne,()=>r.lazy,V],([e,t,n,r,i,a])=>e&&r&&!n&&a?t?(pe(),void ue()):i?(fe(),void ue()):void(t||n||fe()):(pe(),void ue()),{flush:`post`,immediate:!0}),u(()=>{var e;(e=N.value)==null||e.destroy(),N.value=null,function(){let e=P;e&&(de(),P=``,g?.markSettled(e))}()}),(t,n)=>(B(),z(`span`,{ref_key:`rootRef`,ref:p,class:`image-node-container`,"data-markstream-viewport-pending":R.value&&!M.value?`true`:void 0},[ae.value?(B(),z(`img`,{key:0,src:re.value||void 0,alt:String(r.node.alt??r.node.title??``),title:String(r.node.title??r.node.alt??``),class:S([`image-node__img`,{"has-placeholder":e.node.loading||se.value,"is-loading":!I.value&&!o.value,"is-loaded":I.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:r.lazy?`lazy`:void 0,fetchpriority:I.value?`high`:void 0,decoding:I.value?`sync`:`async`,tabindex:o.value?0:-1,"aria-label":r.node.alt??F(_e)(`image.preview`),onError:me,onLoad:he,onClick:ge},null,42,FD)):L(``,!0),!e.node.loading&&!se.value||l.value?L(``,!0):(B(),z(`span`,ID,[r.usePlaceholder?m(t.$slots,`placeholder`,{key:0,node:r.node,displaySrc:ne.value,imageLoaded:o.value,hasError:l.value,fallbackSrc:r.fallbackSrc,lazy:r.lazy},()=>[n[0]||=T(`span`,{class:`image-shimmer`},null,-1)],!0):(B(),z(`span`,LD,C(e.node.raw),1))])),oe.value?(B(),z(`span`,RD,[m(t.$slots,`error`,{node:r.node,displaySrc:ne.value,imageLoaded:o.value,hasError:l.value,fallbackSrc:r.fallbackSrc,lazy:r.lazy},()=>[n[1]||=T(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`},[T(`path`,{fill:`currentColor`,d:`M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z`})],-1),T(`span`,null,C(F(_e)(`image.loadError`)),1)],!0)])):L(``,!0)],8,PD))}}),[[`__scopeId`,`data-v-e4e45fcb`]]);zD.install=e=>{e.component(zD.__name,zD)};var BD=R({loader:()=>Promise.resolve().then(()=>dj),suspensible:!1}),VD={key:2},HD=p({__name:`NodeChildRenderer`,props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){let t=e,n=TE(()=>t.customId),r=k(`markstreamHtmlPolicy`,void 0),i=k(`markstreamNestedRendererProps`,void 0),o=E(()=>r?.value??`safe`),s=E(()=>{let e=i?.value??{};return Q(Z({},e),{customId:t.customId??e.customId,htmlPolicy:o.value})}),c=E(()=>t.components[String(t.node.type)]),l=E(()=>!!(c.value&&n.value[t.node.type]&&!xE(String(t.node.type)))),u=E(()=>l.value?UE(t.node,o.value):void 0),d=E(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=E(()=>String(t.node.content??``)),p=E(()=>String(t.node.content??t.node.raw??``));return(t,n)=>c.value&&l.value?(B(),b(a(c.value),O({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":s.value.isDark,"data-markstream-reference-id":e.node.type===`reference`?String(e.node.id):void 0}),{default:y(()=>[d.value?(B(),b(F(BD),O({key:0},s.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):f.value?(B(),b(F(BD),O({key:1},s.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||`child`}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:1},16,[`node`,`loading`,`index-key`,`custom-id`,`is-dark`,`data-markstream-reference-id`])):c.value?(B(),b(a(c.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey,"data-markstream-reference-id":e.node.type===`reference`?String(e.node.id):void 0},null,8,[`node`,`custom-id`,`index-key`,`data-markstream-reference-id`])):e.fallbackToText?(B(),z(`span`,VD,C(p.value),1)):L(``,!0)}}),UD=[`aria-busy`,`aria-label`,`data-language`,`data-markstream-line-numbers`],WD={key:0,translate:`no`,class:`markstream-pre__diff-code`},GD={class:`markstream-pre__diff-pane-content`},KD={key:0,class:`markstream-pre__diff-collapsed-icon`,"aria-hidden":`true`},qD={class:`markstream-pre__diff-number`,"aria-hidden":`true`},JD={class:`markstream-pre__diff-content`},YD={class:`markstream-pre__diff-content-inner`},XD={key:0,translate:`no`,class:`markstream-pre__code markstream-pre__code--wrapped`},ZD=[`data-line-number`,`textContent`],QD={key:0,class:`markstream-pre__line-numbers`,"aria-hidden":`true`},$D=[`textContent`],eO=[`textContent`],tO=p({__name:`PreCodeNode`,props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){let t=e,n=ee(),r=ze();function i(e,t){let n=String(e??``);return t?n:n.replace(/\r\n$|\n$|\r$/,``)}let a=E(()=>{let e=String(t.node?.language??``);return String(String(e).split(/\s+/g)[0]??``).toLowerCase().replace(/[^\w-]/g,``)||`plaintext`}),s=E(()=>`language-${a.value}`),c=E(()=>!0===t.loading||!0===t.node?.loading),l=E(()=>i(t.node?.code,c.value)),d=``,f=1,p=E(()=>function(e){let t=0,n=1;e.startsWith(d)&&(t=d.length,n=f,t>0&&e[t-1]===`\r`&&e[t]===`
|
|
183
|
+
</div>`};let c=/^\[(\d+)\]/,l=/^\[([^\]\n]+)\]/,u=e=>{if(!e.startsWith(`[`))return!1;let t=l.exec(e);if(!t)return e!==`[`&&!/^\[\d+$/.test(e);let n=String(t[1]??``);return!e.slice(t[0].length).startsWith(`(`)&&!/^\d+$/.test(n)};n.inline.ruler.before(`escape`,`reference`,(e,t)=>{let n=e;if(n.src[n.pos]!==`[`)return!1;let r=c.exec(n.src.slice(n.pos));if(!r)return!1;let i=n.src.slice(Math.max(0,n.pos-120),n.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(i))return!1;let a=n.src.slice(n.pos+r[0].length);if(a.startsWith(`](`)||a.startsWith(`(`)||u(a))return!1;if(!t){let e=r[1],t=n.push(`reference`,`span`,0);t.content=e,t.markup=r[0],t.raw=r[0]}return n.pos+=r[0].length,!0}),n.renderer.rules.reference=(e,t)=>{let n=String(e[t].content??``);return`<span class="reference-link" data-reference-id="${n}" role="button" tabindex="0" title="Click to view reference">${n}</span>`};let d=n.use.bind(n);return n.use=((...e)=>(r.__markstreamHasCustomParserExtensions=!0,d(...e))),n}var Sw=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Cw=Symbol.for(`markstream-vue:node-lifecycle`),ww=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>`,Tw=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>`,Ew={id:`material`,core:{"":Tw,plain:`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>`,text:Tw,javascript:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>`,typescript:`<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>`,jsx:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>`,tsx:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>`,html:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>`,css:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>`,scss:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>`,json:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>`,python:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>`,ruby:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>`,go:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>`,java:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>`,kotlin:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>`,c:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>`,cpp:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>`,cs:ww,csharp:ww,php:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>`,shell:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>`,powershell:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>`,sql:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>`,yaml:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>`,markdown:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>`,xml:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>`,rust:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>`,vue:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>`,mermaid:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>`},fallback:`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>`,loadExtended:()=>V(()=>import(`./extended-BP0HZdSW.js`).then(e=>e.materialExtendedMap),[])},Dw=new Map,Ow=`material`,kw=new Map,Aw=new Map,jw=null;function Mw(e){Dw.set(e.id,e)}function Nw(e){let t=Dw.get(Ow);if(!t)return;let n=t.core[e];if(n)return n;let r=kw.get(t.id);if(r){let t=r[e];if(t)return t}t.loadExtended&&!kw.has(t.id)&&Fw(t)}function Pw(){return Dw.get(Ow)?.fallback??``}function Fw(e){return Sw(this,null,function*(){if(kw.has(e.id))return kw.get(e.id)??null;let t=Aw.get(e.id);return t||(t=(e.loadExtended?.call(e)??Promise.resolve(null)).then(t=>(kw.set(e.id,t),jw?.(),t)).catch(()=>(kw.set(e.id,null),null)),Aw.set(e.id,t)),t})}var Iw=x(0);jw=()=>{Iw.value++},Mw(Ew);var Lw={"":``,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`};function Rw(e){let t=function(e){if(!e)return``;let t=e.trim();if(!t)return``;let[n]=t.split(/\s+/),[r]=n.split(`:`);return r.toLowerCase()}(e);return Lw[t]??t}function zw(e){let t=Rw(e);if(!t)return`plaintext`;switch(t){case`plain`:return`plaintext`;case`shell`:return`zsh`;case`objectivec`:return`objective-c`;case`objectivecpp`:return`objective-cpp`;default:return t}}function Bw(e){return Nw(Rw(e))||Pw()}var Vw={js:`JavaScript`,javascript:`JavaScript`,ts:`TypeScript`,typescript:`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`};function Hw(){}var Uw=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Ww=null,Gw=!1,Kw=null,qw=Xw;function Jw(e){let t=e?.default??e;return t&&typeof t.renderToString==`function`?t:null}function Yw(){try{return Jw(globalThis?.katex)}catch{return null}}function Xw(){return Uw(null,null,function*(){let e=Yw();if(e)return e;let t=yield V(()=>import(`./__vite-optional-peer-dep_katex_markstream-vue-Bg9-FXxr.js`),[]);try{yield V(()=>import(`./mhchem_markstream-vue-tp86PqxG.js`),[])}catch{}return Jw(t)})}function Zw(e){let t=Promise.resolve(e).then(e=>Kw===t&&e?(Ww=Jw(e)??e,Ww):null).catch(()=>null).finally(()=>{Kw===t&&(Kw=null)});return Kw=t,Gw=!0,t}function Qw(e){qw=e,Ww=null,Gw=!1,Kw=null}function $w(){Qw(null)}function eT(){return typeof qw==`function`}function tT(){let e=qw;if(!e||e===Xw)return null;if(Ww)return Ww;let t=Yw();if(t)return Ww=t,Ww;if(Gw)return null;try{let t=e();return t?typeof t?.then==`function`?(Zw(t),null):(Ww=Jw(t)??t,Ww):null}catch{return null}}function nT(){return Uw(this,null,function*(){let e=Yw();if(e)return Ww=e,Ww;if(Ww)return Ww;if(Kw)return Kw;if(Gw)return null;let t=qw;if(!t)return Gw=!0,null;try{let e=t();if(typeof e?.then==`function`)return Zw(e);if(e)return Ww=Jw(e)??e,Gw=!0,Ww}catch{}return Gw=!0,null})}function rT(e){return e?e.replace(/·/g,`⋅`).replace(/℃/g,`°C`):``}var iT=null,aT=null,oT=new Map,sT=new Map,cT=5,lT=new Set;function uT(){if(oT.size<cT&&lT.size){let e=cT-oT.size;for(let t of Array.from(lT)){if(e<=0)break;lT.delete(t),e--;try{t()}catch{}}}}function dT(e,t=!0,n=2e3,r){return Uw(this,null,function*(){performance.now();let i=rT(e);if(!eT()){let e=Error(`KaTeX rendering disabled`);return e.name=`KaTeXDisabled`,e.code=`KATEX_DISABLED`,Promise.reject(e)}if(aT)return Promise.reject(aT);let a=`${t?`d`:`i`}:${i}`,o=sT.get(a);if(o)return uT(),Promise.resolve(o);let s=iT||(aT=Error(`[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker().`),aT.name=`WorkerInitError`,aT.code=`WORKER_INIT_ERROR`,null);if(!s)return Promise.reject(aT);if(oT.size>=cT){let e=Error(`Worker busy`);return e.name=`WorkerBusy`,e.code=`WORKER_BUSY`,e.busy=!0,e.inFlight=oT.size,e.max=cT,Promise.reject(e)}return new Promise((e,a)=>{if(r?.aborted){let e=Error(`Aborted`);e.name=`AbortError`,a(e);return}let o=Math.random().toString(36).slice(2),c=null,l=globalThis.setTimeout(()=>{let e=oT.get(o);if(!e)return;oT.delete(o),e.cleanup();let t=Error(`Worker render timed out`);t.name=`WorkerTimeout`,t.code=`WORKER_TIMEOUT`,e.aborted||e.reject(t),uT()},n);c=()=>{let e=oT.get(o);if(!e||e.aborted)return;e.aborted=!0,e.cleanup();let t=Error(`Aborted`);t.name=`AbortError`,a(t)},r&&r.addEventListener(`abort`,c,{once:!0});let u=e,d=a;oT.set(o,{resolve:e=>{u(e)},reject:e=>{d(e)},timeoutId:l,aborted:!1,cleanup:()=>{r&&c&&r.removeEventListener(`abort`,c),c=null}});try{s.postMessage({id:o,content:i,displayMode:t})}catch(e){let t=oT.get(o);oT.delete(o),clearTimeout(l),t?.cleanup(),t?.reject(e),uT()}})})}function fT(e,t=!0,n){let r=`${t?`d`:`i`}:${rT(e)}`;if(sT.set(r,n),sT.size>200){let e=sT.keys().next().value;sT.delete(e)}}var pT=`WORKER_BUSY`;function mT(e=2e3,t){return oT.size<cT?Promise.resolve():new Promise((n,r)=>{let i,a=!1,o=null,s=()=>{},c=()=>{i&&globalThis.clearTimeout(i),lT.delete(s),t&&o&&t.removeEventListener(`abort`,o),o=null};s=()=>{a||(a=!0,c(),n())},lT.add(s),i=globalThis.setTimeout(()=>{if(a)return;a=!0,c();let e=Error(`Wait for worker slot timed out`);e.name=`WorkerBusyTimeout`,e.code=`WORKER_BUSY_TIMEOUT`,r(e)},e),queueMicrotask(()=>uT()),t&&(o=()=>{if(a)return;a=!0,c();let e=Error(`Aborted`);e.name=`AbortError`,r(e)},t.aborted?o():t.addEventListener(`abort`,o,{once:!0}))})}var hT={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function gT(e){return Uw(this,arguments,function*(e,t=!0,n={}){if(!eT()){let e=Error(`KaTeX rendering disabled`);throw e.name=`KaTeXDisabled`,e.code=`KATEX_DISABLED`,e}let r=n.timeout??hT.timeout,i=n.waitTimeout??hT.waitTimeout,a=n.backoffMs??hT.backoffMs,o=n.maxRetries??hT.maxRetries,s=Number.isFinite(o)?Math.max(0,Math.min(Math.floor(o),8)):hT.maxRetries,c=n.signal,l=0;for(;;){if(c?.aborted){let e=Error(`Aborted`);throw e.name=`AbortError`,e}try{return yield dT(e,t,r,c)}catch(e){if(e?.code!==`WORKER_BUSY`||l>=s)throw e;if(l++,yield mT(i,c).catch(()=>{}),c?.aborted){let e=Error(`Aborted`);throw e.name=`AbortError`,e}a>0&&(yield new Promise(e=>globalThis.setTimeout(e,a*l)))}}})}function _T(e){let t=typeof e==`number`?e:Number.parseFloat(String(e??``));return Number.isFinite(t)&&t>0?t:null}function vT(e){for(let t of e.split(/\r?\n/)){let e=t.trim();if(e&&!e.startsWith(`%%`))return(e.match(/^([A-Z][\w-]*)\b/i)?.[1])?.toLowerCase()||``}return``}function yT(e){let t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`%%`)),n=Math.max(1,t.length),r=vT(e);return r===`gantt`?220+28*n:r===`sequencediagram`?180+26*n:r===`classdiagram`||r===`statediagram`||r===`erdiagram`?180+24*n:r===`flowchart`||r===`graph`?170+28*n:200+22*n}function bT(e){let t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}function xT(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function ST(e,t=360,n=500){return xT(e,t,n)}function CT(e,t=120,n=500){return xT(e,t,n)}function wT(e,t=360,n=500){return xT(e,t,n)}function TT(e,t=240,n=500){return xT(e,t,n)}var ET=new Set([`direction`,`label`,`shape`,`icon`,`near`,`link`,`tooltip`,`width`,`height`,`grid-rows`,`grid-columns`,`grid-gap`,`vertical-gap`,`horizontal-gap`,`class`,`constraint`,`source-arrowhead`,`target-arrowhead`]),DT=new Set([`vars`,`classes`,`style`,`layers`,`scenarios`,`steps`]);function OT(e){let t=0,n=!1;for(let r=0;r<e.length;r++){let i=e[r];i!==`"`&&i!==`'`?n||(i===`{`?t+=1:i===`}`&&--t):n=!n}return t}function kT(e){let t=0,n=0,r=0;for(let i of e.split(/\r?\n/)){let e=i.trim();if(r>0){r=Math.max(0,r+OT(e));continue}if(!e||e.startsWith(`#`)||e.startsWith(`...`)||/^[}\]]+$/.test(e))continue;let a=e.match(/^([A-Z_][\w-]*)\s*:(.*)$/i);if(a){let e=a[1].toLowerCase();if(DT.has(e)){t+=1,r=Math.max(0,OT(a[2]));continue}if(ET.has(e)){t+=1;continue}}n+=1,t+=1}return xT(120+46*Math.max(1,n)+8*Math.max(0,t-n),240,500)}var AT=Object.defineProperty,jT=Object.defineProperties,MT=Object.getOwnPropertyDescriptors,NT=Object.getOwnPropertySymbols,PT=Object.prototype.hasOwnProperty,FT=Object.prototype.propertyIsEnumerable,IT=(e,t,n)=>t in e?AT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LT=(e,t)=>{for(var n in t||={})PT.call(t,n)&&IT(e,n,t[n]);if(NT)for(var n of NT(t))FT.call(t,n)&&IT(e,n,t[n]);return e},RT=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),zT=()=>V(()=>import(`./__vite-optional-peer-dep_mermaid_markstream-vue-cPZl55sA.js`),[]),BT=null,VT=zT,HT=null,UT=!1,WT=!1,GT=0;function KT(e){VT=e,GT++,BT=null,HT=null,UT=!1,WT=!1}function qT(){KT(null)}function JT(){return typeof VT==`function`}function YT(e){if(!e)return e;let t=e&&e.default?e.default:e;if(t&&(typeof t.render==`function`||typeof t.parse==`function`||typeof t.initialize==`function`))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render==`function`||typeof t.mermaidAPI.parse==`function`)){let e=t.mermaidAPI;return n=LT({},t),r={render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:n=>typeof t.initialize==`function`?t.initialize(n):e.initialize?e.initialize(n):void 0},jT(n,MT(r))}var n,r;return e.mermaid&&typeof e.mermaid.render==`function`?e.mermaid:t}function XT(e){if(e)try{let t=e?.initialize;e.initialize=n=>{let r=LT({suppressErrorRendering:!0},n||{});return typeof t==`function`?t.call(e,r):e?.mermaidAPI&&typeof e.mermaidAPI.initialize==`function`?e.mermaidAPI.initialize(r):void 0}}catch{}}function ZT(){return RT(this,null,function*(){if(BT)return BT;let e=function(){try{return YT(globalThis?.mermaid)}catch{return null}}();if(e)return BT=e,XT(BT),BT;let t=VT,n=GT;return t?t===zT&&UT?null:HT||(HT=RT(null,null,function*(){let e;try{e=yield t()}catch(e){if(t===zT)return n===GT&&t===VT&&(UT=!0,function(e){WT||(WT=!0,console.warn(`[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.`,e))}(e)),null;throw e}finally{n===GT&&t===VT&&(HT=null)}return n!==GT||t!==VT?null:e?(BT=YT(e),XT(BT),BT):null}),HT):null})}var QT=null,$T=null,eE=new Map,tE=new Map,nE=5,rE=`MERMAID_DISABLED`;function iE(e,t,n,r){if(!JT()){let e=Error(`Mermaid rendering disabled`);return e.name=`MermaidDisabled`,e.code=rE,Promise.reject(e)}let i=`${e}\0${t.theme}\0${n}\0${t.code}`,a=tE.get(i);return a||(a=function(e,t,n=1400){if(!JT()){let e=Error(`Mermaid rendering disabled`);return e.name=`MermaidDisabled`,e.code=`MERMAID_DISABLED`,Promise.reject(e)}if($T)return Promise.reject($T);let r=QT||($T=Error(`[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker().`),$T.name=`WorkerInitError`,$T.code=`WORKER_INIT_ERROR`,null);if(!r)return Promise.reject($T);if(eE.size>=nE){let e=Error(`Worker busy`);return e.name=`WorkerBusy`,e.code=`WORKER_BUSY`,e.inFlight=eE.size,e.max=nE,Promise.reject(e)}return new Promise((i,a)=>{let o=Math.random().toString(36).slice(2),s,c=!1,l=()=>{c||(c=!0,s!=null&&globalThis.clearTimeout(s),eE.delete(o))};eE.set(o,{resolve:e=>{l(),i(e)},reject:e=>{l(),a(e)}});try{r.postMessage({id:o,action:e,payload:t})}catch(e){eE.delete(o),a(e);return}s=globalThis.setTimeout(()=>{let e=Error(`Worker call timed out`);e.name=`WorkerTimeout`,e.code=`WORKER_TIMEOUT`;let t=eE.get(o);t&&t.reject(e)},n)})}(e,t,n),tE.set(i,a),a.then(()=>{tE.get(i)===a&&tE.delete(i)},()=>{tE.get(i)===a&&tE.delete(i)})),function(e,t){if(!t)return e;if(t.aborted){let e=Error(`Aborted`);return e.name=`AbortError`,Promise.reject(e)}return new Promise((n,r)=>{let i=()=>{},a=()=>t.removeEventListener(`abort`,i);i=()=>{a();let e=Error(`Aborted`);e.name=`AbortError`,r(e)},t.addEventListener(`abort`,i,{once:!0}),e.then(e=>{a(),n(e)},e=>{a(),r(e)})})}(a,r)}function aE(e,t,n=1400,r){return iE(`canParse`,{code:e,theme:t},n,r)}function oE(e,t,n=1400,r){return iE(`findPrefix`,{code:e,theme:t},n,r)}var sE=Object.defineProperty,cE=Object.defineProperties,lE=Object.getOwnPropertyDescriptors,uE=Object.getOwnPropertySymbols,dE=Object.prototype.hasOwnProperty,fE=Object.prototype.propertyIsEnumerable,pE=(e,t,n)=>t in e?sE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z=(e,t)=>{for(var n in t||={})dE.call(t,n)&&pE(e,n,t[n]);if(uE)for(var n of uE(t))fE.call(t,n)&&pE(e,n,t[n]);return e},Q=(e,t)=>cE(e,lE(t)),mE=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),hE=`__global__`,gE=`__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__`,_E=(()=>{let e=globalThis;if(e[gE])return e[gE];let t={scopedCustomComponents:{},revision:x(0)};return e[gE]=t,t})(),vE=_E.revision,yE=Symbol(`markstreamCustomComponents`),bE=new Set(`text.paragraph.heading.code_block.list.list_item.blockquote.table.table_row.table_cell.definition_list.definition_item.footnote.footnote_reference.footnote_anchor.admonition.hardbreak.link.image.thematic_break.math_inline.math_block.strong.emphasis.strikethrough.highlight.insert.subscript.superscript.emoji.checkbox.checkbox_input.inline_code.html_inline.html_block.reference.mermaid.infographic.d2.vmr_container`.split(`.`));function xE(e){return bE.has(String(e).trim().toLowerCase())}function SE(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[_\s]+/g,`-`).toLowerCase()}function CE(e={}){let t={};for(let[n,r]of Object.entries(e))if(r!=null){t[n]=r;for(let e of new Set([vf(n),vf(SE(n))]))!e||xE(e)||Object.prototype.hasOwnProperty.call(t,e)||(t[e]=r)}return t}function wE(e,t){typeof e==`string`?_E.scopedCustomComponents[e]=CE(t||{}):_E.scopedCustomComponents[hE]=CE(e||{}),vE.value++}function TE(e){let t=k(yE,null);return E(()=>(vE.value,function(e,t={}){return vE.value,Z(Z(Z({},CE(_E.scopedCustomComponents[hE]||{})),CE(t)),CE(function(e){return e&&_E.scopedCustomComponents[e]||{}}(e)))}(e?.(),t?.value??{})))}var EE=[`aria-label`],DE={key:0,xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,class:`checkbox-icon checkbox-unchecked`},OE={key:1,xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,class:`checkbox-icon checkbox-checked`},$=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},kE=$(p({__name:`CheckboxNode`,props:{node:{}},setup:e=>(t,n)=>(B(),z(`span`,{class:`checkbox-node`,role:`img`,"aria-label":e.node.checked?`checked`:`unchecked`},[e.node.checked?(B(),z(`svg`,OE,[...n[1]||=[T(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`4`,fill:`currentColor`},null,-1),T(`path`,{d:`M9 12l2 2 4-4`,stroke:`hsl(var(--ms-background))`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)]])):(B(),z(`svg`,DE,[...n[0]||=[T(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`4`,stroke:`currentColor`,"stroke-width":`2`},null,-1)]]))],8,EE))}),[[`__scopeId`,`data-v-be21ab83`]]);kE.install=e=>{e.component(kE.__name,kE)};var AE={class:`emoji-node`},jE=$(p({__name:`EmojiNode`,props:{node:{}},setup:e=>(t,n)=>(B(),z(`span`,AE,C(e.node.name),1))}),[[`__scopeId`,`data-v-de55dc97`]]);jE.install=e=>{e.component(jE.__name,jE)};var ME=`.markdown-renderer`;function NE(e,t){if(typeof document>`u`||typeof Element>`u`)return null;let n=function(e){return`[id="${e.replace(/["\\]/g,`\\$&`)}"]`}(t),r=e instanceof Element?e.closest(ME):null;for(;r;){let e=r.querySelector(n);if(e)return e;r=r.parentElement?.closest(ME)??null}return document.querySelector(n)}var PE=[`id`],FE=[`title`],IE=$(p({__name:`FootnoteReferenceNode`,props:{node:{}},setup(e){let t=e,n=`#fnref--${t.node.id}`;function r(e){if(typeof document>`u`)return;let r=NE(e.currentTarget,`fnref--${t.node.id}`);r?r.scrollIntoView({behavior:`smooth`}):console.warn(`Element with href: ${n} not found`)}return(t,i)=>(B(),z(`sup`,{id:`fnref-${e.node.id}`,class:`footnote-reference`,onClick:r},[T(`span`,{href:n,title:`查看脚注 ${e.node.id}`,class:`footnote-link cursor-pointer`},`[`+C(e.node.id)+`]`,9,FE)],8,PE))}}),[[`__scopeId`,`data-v-d1baf613`]]);IE.install=e=>{e.component(IE.__name,IE)};var LE=(()=>{try{return!1}catch{}return!1})();function RE(e){LE&&console.warn(e)}function zE(e,t){return LC(e,t)}function BE(e,t=`safe`,n){return RC(e,t,n)}function VE(e){return HC(e)}function HE(e){return!0===e?``:!1===e?`false`:e==null?null:String(e)}function UE(e,t=`safe`){let n=String(e.tag||e.type||``).trim(),r=BC((i=e.attrs)?Array.isArray(i)?i.every(Array.isArray)?i.map(([e,t])=>[String(e),HE(t)]):i.filter(e=>e&&typeof e==`object`&&!Array.isArray(e)&&`name`in e).map(e=>[String(e.name),HE(e.value)]):Object.entries(i).map(([e,t])=>[e,HE(t)]):null,t,n);var i;if(!r)return;let a=VE(zC(r));return Object.keys(a).length>0?a:void 0}function WE(e,t,n=!1){let r=Object.entries(t??{}),i=r.length>0?r.map(([e,t])=>t===``?` ${e}`:` ${e}="${t}"`).join(``):``;return n?`<${e}${i} />`:`<${e}${i}>`}function GE(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function KE(e,t,n,r,i,a,o=!1){let s=zE(e,r);if(Wd.has(e.toLowerCase())||!s&&kC(e,a))return null;if(!s&&OC(e,a))return o?[WE(e,t,!0)]:[WE(e,t),...n,`</${e}>`];let c=RC(t,a,e),u=c.key,d=u!=null&&u!==``?u:i;if(s){let t=r[e]||r[e.toLowerCase()],i=VE(c);return l(t,Q(Z({},i),{key:d}),n.length>0?n:void 0)}return l(e,Q(Z({},c),{innerHTML:void 0,key:d}),n.length>0?n:void 0)}function qE(e,t,n=`safe`,r=!1){var i;try{if(!r&&Object.keys(t).length===0)return{ok:!0,hasCustomComponents:!1,nodes:null};let i=WC(e),a=!1;for(let e of i)if((e.type===`tag_open`||e.type===`self_closing`)&&zE(e.tagName??``,t)){a=!0;break}let o=r||a?function(e,t,n=`safe`){let r=0,i=[],a=[];for(let o of e)if(o.type===`text`)(i.length>0?i[i.length-1].children:a).push(o.content);else if(o.type===`self_closing`){let e=KE(o.tagName,o.attrs||{},[],t,`ms-html-`+r++,n,!0);GE(i.length>0?i[i.length-1].children:a,e)}else if(o.type===`tag_open`)i.push({tagName:o.tagName,children:[],attrs:o.attrs,autoKey:`ms-html-`+r++});else if(o.type===`tag_close`){let e=o.tagName.toLowerCase(),r=-1;for(let t=i.length-1;t>=0;t--)if(i[t].tagName.toLowerCase()===e){r=t;break}if(r!==-1)for(;i.length>r;){let o=i.pop(),s=KE(o.tagName,o.attrs||{},o.children,t,o.autoKey,n);i.length>0?GE(i[i.length-1].children,s):GE(a,s),o.tagName.toLowerCase()!==e&&i.length>r&&RE(`Auto-closing unclosed tag: <${o.tagName}>`)}else RE(`Ignoring closing tag with no matching opening tag: </${o.tagName}>`)}for(;i.length>0;){let e=i.pop(),r=KE(e.tagName,e.attrs||{},e.children,t,e.autoKey,n);i.length>0?GE(i[i.length-1].children,r):GE(a,r),RE(`Auto-closing unclosed tag: <${e.tagName}>`)}return a}(i,t,n):null;return{ok:!0,hasCustomComponents:a,nodes:o}}catch(e){return i=e,LE&&console.error(`Failed to parse HTML to VNodes:`,i),{ok:!1,hasCustomComponents:!1,nodes:null}}}var JE=[`innerHTML`],YE=$(p({__name:`HtmlInlineNode`,props:{node:{},customId:{},htmlPolicy:{}},setup(e){let t=e,r=k(`markstreamHtmlPolicy`,void 0),i=E(()=>t.htmlPolicy??r?.value??`safe`),a=TE(()=>t.customId),o=p({name:`DynamicRenderer`,props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),s=E(()=>{let e=t.node.content;if(!e)return{mode:`html`,content:``};if(i.value===`escape`)return{mode:`html`,content:qC(e,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:`text`,content:e};let n=!0===t.node.loading&&!0===t.node.autoClosed,r=qE(e,a.value,i.value,n);return r.ok&&(n||r.hasCustomComponents)?{mode:`dynamic`,nodes:r.nodes}:{mode:`html`,content:qC(e,i.value)}});return(e,r)=>s.value.mode===`dynamic`?(B(),z(`span`,{key:0,class:S([`html-inline-node`,{"html-inline-node--loading":t.node.loading}])},[n(F(o),{nodes:s.value.nodes},null,8,[`nodes`])],2)):s.value.mode===`text`?(B(),z(`span`,{key:1,class:S([`html-inline-node`,{"html-inline-node--loading":t.node.loading}])},C(s.value.content),3)):(B(),z(`span`,{key:2,class:S([`html-inline-node`,{"html-inline-node--loading":t.node.loading}]),innerHTML:s.value.content},null,10,JE))}}),[[`__scopeId`,`data-v-fbbbc497`]]);function XE(e){let t=rn(e),n=D(e),r=x(t.getSnapshot().segments),i=new Set,a=0;function o(){a&&cancelAnimationFrame(a),a=0,i.clear()}function s(){let e=t.getSnapshot();n.value=e.settledContent,r.value=e.segments}return N(o),{settledContent:n,segments:r,update:function(e,n,r){r||o();let i=typeof document>`u`||document.visibilityState!==`hidden`;t.update(e,n,r&&i),s()},finish:function(e,n=!1){t.finish(e,n),s()},queueFinish:function(e,n){i.add(e),a||=requestAnimationFrame(()=>{a=0;for(let e of i)t.finish(e,!0);i.clear(),n!=null&&n()||t.settleFinished(),s()})},finishAll:function(e=!1){o(),t.finishAll(e),s()},settleFinished:function(){t.settleFinished(),s()}}}YE.install=e=>{e.component(YE.__name,YE)};var ZE={class:`inline-code`},QE={key:0},$E=[`onAnimationend`],eD=$(p({__name:`InlineCodeNode`,props:{node:{}},setup(e){let t=e,n=ee(),r=k(`markstreamFade`,void 0),i=k(`markstreamTextFinal`,void 0),a=k(`markstreamFinalCleanup`,void 0),s=!0;N(()=>{s=!1});let c=k(`markstreamTextStreamState`,void 0),l=E(()=>{let e=n.fade;return e===``||!0===e||e===`true`||!1!==e&&e!==`false`&&void 0}),u=E(()=>typeof l.value==`boolean`?l.value:typeof r?.value!=`boolean`||r.value),d=E(()=>String(t.node.code??``)),p=E(()=>!u.value),m=E(()=>{let e=n[`index-key`]??n.indexKey;return e==null||e===``?``:String(e)}),{settledContent:h,segments:g,update:_,finish:y,queueFinish:b,finishAll:x}=XE(t.node.code);return v([()=>t.node.code,m,u,()=>g.value.length>0&&!0===i?.value],([e])=>{let t=String(e??``);if(!0===i?.value&&a&&g.value.length&&t===h.value+g.value.map(e=>e.content).join(``)){let e=g.value.find(e=>!e.finished);e&&(x(!0),a(()=>{s&&y(e.id)}));return}let n=m.value;_(t,n?c?.get(n):void 0,u.value&&!0!==i?.value),n&&c?.set(n,t)},{immediate:!0}),(e,t)=>(B(),z(`code`,ZE,[p.value?(B(),z(w,{key:0},[f(C(d.value),1)],64)):(B(),z(w,{key:1},[F(h)?(B(),z(`span`,QE,C(F(h)),1)):L(``,!0),(B(!0),z(w,null,o(F(g),e=>(B(),z(`span`,{key:e.id,class:S(e.finished||!0===F(i)?.value?`inline-code-stream-final`:`inline-code-stream-delta`),onAnimationend:t=>F(b)(e.id)},C(e.content),43,$E))),128))],64))]))}}),[[`__scopeId`,`data-v-8afc29be`]]);eD.install=e=>{e.component(eD.__name,eD)};var tD=D(!1),nD=D(``),rD=D(`top`),iD=D(null),aD=D(null),oD=D(null),sD=D(null),cD=D(null),lD=null,uD=null,dD=0;function fD(){lD&&=(clearTimeout(lD),null),uD&&=(clearTimeout(uD),null)}var pD=!1,mD=null,hD=!1;function gD(e,t,n=`top`,r=!1,i,a){if(!e)return;let o=++dD;fD();let s=()=>mE(null,null,function*(){if(yield function(){return mE(this,null,function*(){if(!pD&&!hD&&typeof document<`u`){mD??=mE(null,null,function*(){let[{createApp:e,h:t},{default:n}]=yield Promise.all([V(()=>import(`./vue.runtime.esm-bundler-Dph2MMo9.js`).then(e=>e.t),__vite__mapDeps([0,1])),V(()=>import(`./Tooltip-CN-JPsWb.js`),__vite__mapDeps([2,0,1,3,4]))]),r=document.createElement(`div`);r.setAttribute(`data-singleton-tooltip`,`1`),document.body.appendChild(r),e({setup:()=>()=>t(n,{visible:tD.value,"anchor-el":iD.value,content:nD.value,placement:rD.value,id:aD.value,originX:oD.value,originY:sD.value,isDark:cD.value??void 0})}).mount(r),pD=!0});try{yield mD}catch(e){pD=!1,mD=null,hD=!0,console.warn(`[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.`,e)}}})}(),pD&&o===dD){aD.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,iD.value=e,nD.value=t,rD.value=n,oD.value=i?.x??null,sD.value=i?.y??null,cD.value=typeof a==`boolean`?a:null,tD.value=!0;try{e.setAttribute(`aria-describedby`,aD.value)}catch{}}});return r?s():lD=setTimeout(s,80),()=>{o===dD&&_D(!0)}}function _D(e=!1){dD+=1,fD();let t=()=>{if(iD.value&&aD.value)try{iD.value.removeAttribute(`aria-describedby`)}catch{}tD.value=!1,iD.value=null,aD.value=null,oD.value=null,sD.value=null};e?t():uD=setTimeout(t,120)}var vD={"common.copy":`Copy`,"common.selectCopy":`全选(复制)`,"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...`},yD=Symbol(`markstreamI18nFallback`);function bD(e,t){return t?.[e]??vD[e]}var xD=(e,t)=>bD(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 SD(e,t){return{t(n){let r=bD(n,t);if(e.te&&r!=null&&!e.te(n))return xD(n,t);let i=e.t(n);return i===n&&r!=null?xD(n,t):i}}}function CD(){let e=function(){try{let e=i(),t=yD,n=e?.provides,r=e?.appContext?.provides;return n?.[t]??r?.[t]??null}catch{}return null}(),t=function(){try{let e=i(),t=e?.proxy,n=t?.$t;if(typeof n==`function`){let e=t?.$te;return{t:n.bind(t),te:typeof e==`function`?e.bind(t):void 0}}let r=e?.appContext?.config?.globalProperties,a=r?.$t;if(typeof a==`function`){let e=r?.$te;return{t:a.bind(r),te:typeof e==`function`?e.bind(r):void 0}}}catch{}return null}();if(t)return SD(t,e);try{let t=globalThis.$vueI18nUse||null;if(t&&typeof t==`function`)try{let n=t();if(n&&typeof n.t==`function`)return SD({t:n.t.bind(n),te:typeof n.te==`function`?n.te.bind(n):void 0},e)}catch{}}catch{}return{t:t=>xD(t,e)}}var wD=Symbol(`ViewportPriority`),TD=Symbol(`ViewportPriorityOptions`),ED=Symbol(`OffscreenHeavyNodeDeferral`),DD=E(()=>!1),OD=`400px`;function kD(){return k(TD,void 0)}function AD(){return k(ED,DD)}function jD(e,n){let r=typeof window<`u`&&typeof document<`u`,i=typeof n==`boolean`?D(n):n,a=r?window.requestIdleCallback??(e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16)):null,o=r?window.cancelIdleCallback??(e=>window.clearTimeout(e)):null,s=new WeakMap,c=1,l=new Map,u=new Map,d=new Set,f=null,p=null;function m(e){if(!e)return`viewport`;let t=s.get(e);return t||(t=c++,s.set(e,t)),String(t)}function g(){if(f!=null){try{o?.(f)}catch{}f=null}}function _(e){if(e){let t=l.get(e);if(t&&!t.targets.size){try{t.io.disconnect()}catch{}l.delete(e)}}u.size||d.size||g()}function y(e){let t=u.get(e);if(!t)return;let n=l.get(t.bucketKey);if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch{}}try{n?.io.unobserve(e)}catch{}n?.targets.delete(e),u.delete(e),d.delete(e),_(t.bucketKey)}function b(){!0!==window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__&&a&&f==null&&d.size&&(f=a(()=>{f=null;let e=d.values().next().value;e&&(d.delete(e),y(e),d.size&&b())},{timeout:1200}))}function x(t,n){if(!r||typeof IntersectionObserver>`u`)return null;let i=function(t,n){return{root:e?.(t??null)??null,rootMargin:n?.rootMargin??OD,threshold:n?.threshold??0}}(t,n),a=[m((o=i).root),o.rootMargin,o.threshold].join(`\0`);var o;let s=l.get(a);if(s)return{key:a,bucket:s};let c;try{c=new IntersectionObserver(e=>{for(let t of e)(t.isIntersecting||t.intersectionRatio>0)&&y(t.target)},{root:i.root,rootMargin:i.rootMargin,threshold:i.threshold})}catch{return null}let u={io:c,targets:new Map};return l.set(a,u),{key:a,bucket:u}}function S(){if(r&&i.value)for(let[e,t]of Array.from(u.entries())){let n=x(e,t.opts);if(!n){y(e);continue}if(n.key===t.bucketKey)continue;let r=t.bucketKey,i=l.get(r);try{i?.io.unobserve(e)}catch{}i?.targets.delete(e),t.bucketKey=n.key,n.bucket.targets.set(e,t),n.bucket.io.observe(e),_(r)}}v(i,e=>{if(!e){for(let e of Array.from(u.keys()))y(e);g()}},{flush:`sync`});let C=(e,t)=>{let n=D(!1),a,o=!1,s=!1,c=new Promise(e=>{a=()=>{o||(o=!0,e())}}),f=()=>{s=!0;let t=u.get(e);if(!t)return d.delete(e),void _();let n=l.get(t.bucketKey);try{n?.io.unobserve(e)}catch{}n?.targets.delete(e),u.delete(e),d.delete(e),_(t.bucketKey)};return r&&i.value&&typeof IntersectionObserver<`u`?(h(()=>{if(s)return;let o=i.value?x(e,t):null;if(!o)return n.value=!0,void a();let c={resolve:a,visible:n,bucketKey:o.key,opts:t};u.set(e,c),o.bucket.targets.set(e,c),o.bucket.io.observe(e),r&&p==null&&(p=window.requestAnimationFrame(()=>{p=null,S()})),!1!==t?.allowIdle&&(d.add(e),b())}),{isVisible:n,whenVisible:c,destroy:f}):(n.value=!0,a(),{isVisible:n,whenVisible:c,destroy:f})};return C.refresh=S,t(wD,C),C}function MD(){let e=k(wD,void 0);if(e)return e;let t=new WeakMap,n=new Map,r=new Set,i=null,a=typeof window<`u`?window.requestIdleCallback??(e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16)):null,o=typeof window<`u`?window.cancelIdleCallback??(e=>window.clearTimeout(e)):null,s=()=>{if(i!=null){try{o?.(i)}catch{}i=null}},c=e=>{if(!e)return;let t=n.get(e);if(t&&!t.targets.size){try{t.io.disconnect()}catch{}n.delete(e)}},l=e=>{let i=t.get(e);if(!i)return;let a=n.get(i.bucketKey);if(!i.visible.value){i.visible.value=!0;try{i.resolve()}catch{}}try{a?.io.unobserve(e)}catch{}t.delete(e),a?.targets.delete(e),r.delete(e),c(i.bucketKey),r.size||s()},u=()=>{!0!==window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__&&a&&i==null&&r.size&&(i=a(()=>{i=null;let e=r.values().next().value;e&&(r.delete(e),l(e),r.size&&u())},{timeout:1200}))};return(e,i)=>{let a=D(!1),o,d=!1,f=new Promise(e=>{o=()=>{d||(d=!0,e())}}),p=()=>{let i=t.get(e);if(!i)return r.delete(e),void(r.size||s());let a=n.get(i.bucketKey);try{a?.io.unobserve(e)}catch{}t.delete(e),a?.targets.delete(e),r.delete(e),c(i.bucketKey),r.size||s()},m=(e=>{if(typeof window>`u`||typeof IntersectionObserver>`u`)return null;let t=(e=>[e?.rootMargin??OD,e?.threshold??0].join(`\0`))(e),r=n.get(t);if(r)return{key:t,bucket:r};let i=e?.rootMargin??OD,a;try{a=new IntersectionObserver(e=>{for(let t of e)(t.isIntersecting||t.intersectionRatio>0)&&l(t.target)},{root:null,rootMargin:i,threshold:e?.threshold??0})}catch{return null}let o={io:a,targets:new Set};return n.set(t,o),{key:t,bucket:o}})(i);return m?(t.set(e,{resolve:o,visible:a,bucketKey:m.key}),m.bucket.targets.add(e),m.bucket.io.observe(e),!1!==i?.allowIdle&&(r.add(e),u()),{isVisible:a,whenVisible:f,destroy:p}):(a.value=!0,o(),{isVisible:a,whenVisible:f,destroy:p})}}function ND(e,t){let n=e.indexKey??t[`index-key`]??t.indexKey;return n==null||n===``?``:String(n)}var PD=[`data-markstream-viewport-pending`],FD=[`src`,`alt`,`title`,`loading`,`fetchpriority`,`decoding`,`tabindex`,`aria-label`],ID={key:1,class:`image-placeholder`},LD={key:1,class:`image-node__raw-text`},RD={key:2,class:`image-error`},zD=$(p({__name:`ImageNode`,props:{node:{},fallbackSrc:{default:``},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:[`load`,`error`,`click`],setup(e,{emit:t}){var n;let r=e,a=t,o=D(!1),s=D(!1),l=D(!1),d=D(``),f=D(`primary`),p=D(null),h=ee(),g=k(Cw,null),_=MD(),y=kD(),b=AD(),w=E(()=>cf(r.node.src)),O=E(()=>cf(r.fallbackSrc)),A=((n=i()?.vnode.el)?.querySelector)?.call(n,`img`),j=typeof window<`u`&&A?.getAttribute(`src`)===(w.value||O.value),M=D(typeof window>`u`||j||!b.value),N=x(null),P=``,te=null,ne=E(()=>d.value),I=E(()=>!r.lazy),R=E(()=>typeof window<`u`&&b.value&&!j),V=E(()=>!R.value||M.value),re=E(()=>V.value?ne.value:``),ie=E(()=>y?.value.heavyBlockMargin??y?.value.rootMargin??OD),ae=E(()=>!r.node.loading&&f.value!==`failed`&&d.value.length>0),oe=E(()=>f.value===`failed`),se=E(()=>(s.value||!I.value||R.value)&&!o.value&&!l.value&&f.value!==`failed`&&d.value.length>0),ce=E(()=>ND(r,h));function le(e=ce.value){e&&p.value&&g?.reportHeight(e,p.value.offsetHeight)}function ue(e=ce.value){e&&c(()=>{le(e)})}function de(){te&&=(clearTimeout(te),null)}function fe(){let e=ce.value;e&&P!==e&&(P&&g?.markSettled(P),de(),P=e,g?.markPending(e),typeof window<`u`&&(te=window.setTimeout(()=>{P===e&&(ue(e),pe())},8e3)))}function pe(){return mE(this,null,function*(){let e=P;e&&(de(),P=``,yield c(),le(e),g?.markSettled(e))})}function me(){if(f.value===`primary`&&O.value&&O.value!==d.value)return f.value=`fallback`,d.value=O.value,o.value=!1,l.value=!1,void ue();f.value=`failed`,l.value=!0,a(`error`,d.value),ue()}function he(){o.value=!0,s.value=!1,l.value=!1,a(`load`,ne.value),ue()}function ge(e){e.preventDefault(),o.value&&!l.value&&a(`click`,[e,ne.value])}let{t:_e}=CD();return v([w,O,()=>r.node.loading],()=>(o.value=!1,l.value=!1,r.node.loading?(s.value=!0,d.value=w.value,void(f.value=`primary`)):w.value?(d.value=w.value,void(f.value=`primary`)):O.value?(d.value=O.value,void(f.value=`fallback`)):(d.value=``,f.value=`failed`,void(l.value=!0))),{immediate:!0}),typeof window<`u`&&v([p,R],([e,t],n,r)=>{var i;if((i=N.value)==null||i.destroy(),N.value=null,!t||M.value)return void(M.value=!0);if(!e)return void(M.value=!1);let a=!0,o=_(e,{rootMargin:ie.value,allowIdle:!1});N.value=o,M.value=o.isVisible.value,o.whenVisible.then(()=>{a&&N.value===o&&(M.value=!0)}),r(()=>{a=!1,o.destroy(),N.value===o&&(N.value=null)})},{immediate:!0}),v([ae,o,l,ne,()=>r.lazy,V],([e,t,n,r,i,a])=>e&&r&&!n&&a?t?(pe(),void ue()):i?(fe(),void ue()):void(t||n||fe()):(pe(),void ue()),{flush:`post`,immediate:!0}),u(()=>{var e;(e=N.value)==null||e.destroy(),N.value=null,function(){let e=P;e&&(de(),P=``,g?.markSettled(e))}()}),(t,n)=>(B(),z(`span`,{ref_key:`rootRef`,ref:p,class:`image-node-container`,"data-markstream-viewport-pending":R.value&&!M.value?`true`:void 0},[ae.value?(B(),z(`img`,{key:0,src:re.value||void 0,alt:String(r.node.alt??r.node.title??``),title:String(r.node.title??r.node.alt??``),class:S([`image-node__img`,{"has-placeholder":e.node.loading||se.value,"is-loading":!I.value&&!o.value,"is-loaded":I.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:r.lazy?`lazy`:void 0,fetchpriority:I.value?`high`:void 0,decoding:I.value?`sync`:`async`,tabindex:o.value?0:-1,"aria-label":r.node.alt??F(_e)(`image.preview`),onError:me,onLoad:he,onClick:ge},null,42,FD)):L(``,!0),!e.node.loading&&!se.value||l.value?L(``,!0):(B(),z(`span`,ID,[r.usePlaceholder?m(t.$slots,`placeholder`,{key:0,node:r.node,displaySrc:ne.value,imageLoaded:o.value,hasError:l.value,fallbackSrc:r.fallbackSrc,lazy:r.lazy},()=>[n[0]||=T(`span`,{class:`image-shimmer`},null,-1)],!0):(B(),z(`span`,LD,C(e.node.raw),1))])),oe.value?(B(),z(`span`,RD,[m(t.$slots,`error`,{node:r.node,displaySrc:ne.value,imageLoaded:o.value,hasError:l.value,fallbackSrc:r.fallbackSrc,lazy:r.lazy},()=>[n[1]||=T(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`},[T(`path`,{fill:`currentColor`,d:`M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z`})],-1),T(`span`,null,C(F(_e)(`image.loadError`)),1)],!0)])):L(``,!0)],8,PD))}}),[[`__scopeId`,`data-v-e4e45fcb`]]);zD.install=e=>{e.component(zD.__name,zD)};var BD=R({loader:()=>Promise.resolve().then(()=>dj),suspensible:!1}),VD={key:2},HD=p({__name:`NodeChildRenderer`,props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){let t=e,n=TE(()=>t.customId),r=k(`markstreamHtmlPolicy`,void 0),i=k(`markstreamNestedRendererProps`,void 0),o=E(()=>r?.value??`safe`),s=E(()=>{let e=i?.value??{};return Q(Z({},e),{customId:t.customId??e.customId,htmlPolicy:o.value})}),c=E(()=>t.components[String(t.node.type)]),l=E(()=>!!(c.value&&n.value[t.node.type]&&!xE(String(t.node.type)))),u=E(()=>l.value?UE(t.node,o.value):void 0),d=E(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=E(()=>String(t.node.content??``)),p=E(()=>String(t.node.content??t.node.raw??``));return(t,n)=>c.value&&l.value?(B(),b(a(c.value),O({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":s.value.isDark,"data-markstream-reference-id":e.node.type===`reference`?String(e.node.id):void 0}),{default:y(()=>[d.value?(B(),b(F(BD),O({key:0},s.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):f.value?(B(),b(F(BD),O({key:1},s.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||`child`}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:1},16,[`node`,`loading`,`index-key`,`custom-id`,`is-dark`,`data-markstream-reference-id`])):c.value?(B(),b(a(c.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey,"data-markstream-reference-id":e.node.type===`reference`?String(e.node.id):void 0},null,8,[`node`,`custom-id`,`index-key`,`data-markstream-reference-id`])):e.fallbackToText?(B(),z(`span`,VD,C(p.value),1)):L(``,!0)}}),UD=[`aria-busy`,`aria-label`,`data-language`,`data-markstream-line-numbers`],WD={key:0,translate:`no`,class:`markstream-pre__diff-code`},GD={class:`markstream-pre__diff-pane-content`},KD={key:0,class:`markstream-pre__diff-collapsed-icon`,"aria-hidden":`true`},qD={class:`markstream-pre__diff-number`,"aria-hidden":`true`},JD={class:`markstream-pre__diff-content`},YD={class:`markstream-pre__diff-content-inner`},XD={key:0,translate:`no`,class:`markstream-pre__code markstream-pre__code--wrapped`},ZD=[`data-line-number`,`textContent`],QD={key:0,class:`markstream-pre__line-numbers`,"aria-hidden":`true`},$D=[`textContent`],eO=[`textContent`],tO=p({__name:`PreCodeNode`,props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){let t=e,n=ee(),r=ze();function i(e,t){let n=String(e??``);return t?n:n.replace(/\r\n$|\n$|\r$/,``)}let a=E(()=>{let e=String(t.node?.language??``);return String(String(e).split(/\s+/g)[0]??``).toLowerCase().replace(/[^\w-]/g,``)||`plaintext`}),s=E(()=>`language-${a.value}`),c=E(()=>!0===t.loading||!0===t.node?.loading),l=E(()=>i(t.node?.code,c.value)),d=``,f=1,p=E(()=>function(e){let t=0,n=1;e.startsWith(d)&&(t=d.length,n=f,t>0&&e[t-1]===`\r`&&e[t]===`
|
|
184
184
|
`&&t++);for(let r=t;r<e.length;r++)e[r]===`
|
|
185
185
|
`?n++:e[r]===`\r`&&(n++,e[r+1]===`
|
|
186
186
|
`&&r++);return d=e,f=n,n}(l.value)),m=``,h=[],g=0,_=0,y=RegExp(`(?<=\\n)|(?<=\\r)(?!\\n)`),b=E(()=>function(e){let t=e.length>m.length&&e.startsWith(m),n=t?h:[],r=t?_:0;t&&(n.length=g);for(let t of e.slice(r).split(y))n.push(t);let i=e[e.length-1];return i===`
|
|
187
187
|
`?(g=n.length,_=e.length,n.push(``)):(g=n.length-1,_=e.length-n[n.length-1].length,i===`\r`&&n.push(``)),m=e,h=n,n}(l.value)),x=E(()=>!0===t.showLineNumbers&&!0===t.node?.diff),O=E(()=>{if(S(n.class).split(/\s+/).includes(`is-wrap`))return!0;let e=I(n.style);return typeof e==`string`?/(?:^|;)\s*white-space\s*:\s*(?:pre-wrap|break-spaces)(?:\s*!important)?\s*(?:;|$)/i.test(e):[`pre-wrap`,`break-spaces`].includes(String(e?.whiteSpace??e?.[`white-space`]))}),k=E(()=>x.value&&O.value),A=0,j=``,M=E(()=>{let e=p.value;e<A&&(A=0,j=``);for(let t=A+1;t<=e;t++)j+=`${j?`
|
|
188
188
|
`:``}${t}`;return A=e,j}),N=E(()=>x.value&&!0===t.diffInline),P=E(()=>{let e=Number(t.reservedHeightPx);if(!Number.isFinite(e)||e<=0)return;let n=`${Math.ceil(e)}px`;return c.value?{maxHeight:n,overflow:`auto`}:{height:n,minHeight:n,maxHeight:n,overflow:`auto`}});function te(e,t){let n=i(e,t);if(!n)return 0;let r=1;for(let e=0;e<n.length;e++)n[e]===`
|
|
189
189
|
`?r++:n[e]===`\r`&&(r++,n[e+1]===`
|
|
190
|
-
`&&e++);return r}let F=E(()=>x.value?gt({code:t.node?.code,hideUnchangedRegions:t.diffHideUnchangedRegions,inline:N.value,language:t.node?.language,loading:c.value,matchCache:r,originalCode:t.node?.originalCode,raw:t.node?.raw,updatedCode:t.node?.updatedCode}):[]),ne=E(()=>{let e=F.value,t=1,n=!1;for(let r of e)for(let e of r.lines)e.kind===`collapsed`&&(n=!0),typeof e.number==`number`&&e.number>t&&(t=e.number);return{maxNumberedLine:t,hasCollapsed:n}}),R=E(()=>{if(!0!==t.showLineNumbers)return;let e=x.value?1:p.value;x.value&&(e=Math.max(e,te(t.node?.originalCode,c.value),te(t.node?.updatedCode,c.value),ne.value.maxNumberedLine));let n=`${Math.max(2,String(e).length)}ch`;return{"--markstream-pre-line-number-width":n,"--markstream-pre-diff-line-number-width":n,"--markstream-code-padding-left":`calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))`}}),V=E(()=>x.value&&ne.value.hasCollapsed),re=E(()=>{let e=a.value;return e?`Code block: ${e}`:`Code block`}),ie=D(null),ae=D([]),oe=null,se=!1,ce=null;function le(){!se&&typeof window<`u`&&x.value&&!N.value&&k.value&&oe==null&&(oe=window.requestAnimationFrame(()=>{!se&&ie.value&&(ae.value=K(ie.value,ae.value)),oe=null}))}function ue(e){ce?.disconnect(),ce=null,e&&x.value&&!N.value&&k.value&&typeof ResizeObserver<`u`&&(ce=new ResizeObserver(()=>{le()}),ce.observe(e))}function de(e,t){if(!k.value)return;let n=ae.value[e];if(!n)return;let r=t===`original`?n.originalHeight:n.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(n.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(r)}px`}}return v(ie,e=>{ue(e),le()},{flush:`post`}),v([x,N,F,k],()=>{ue(ie.value),x.value&&!N.value&&k.value?le():ae.value.length&&(ae.value=[])},{flush:`post`,immediate:!0}),u(()=>{se=!0,oe!=null&&(window.cancelAnimationFrame(oe),oe=null),ce?.disconnect(),ce=null}),(e,n)=>{return B(),z(`pre`,{ref_key:`preRef`,ref:ie,style:I([P.value,R.value]),class:S([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":x.value,"markstream-pre--diff-inline":N.value,"markstream-pre--diff-collapsed":V.value}]),"aria-busy":c.value,"aria-label":re.value,"data-language":a.value,"data-markstream-line-numbers":t.showLineNumbers?`1`:void 0,"data-markstream-pre":`1`,tabindex:`0`},[x.value?(B(),z(`code`,WD,[(B(!0),z(w,null,o(F.value,e=>(B(),z(`span`,{key:e.key,class:S([`markstream-pre__diff-pane`,e.className])},[T(`span`,GD,[(B(!0),z(w,null,o(e.lines,(t,r)=>(B(),z(`span`,{key:t.key,class:S([`markstream-pre__diff-line`,[`markstream-pre__diff-line--${t.kind}`,t.metadataKind?`markstream-pre__diff-line--metadata-${t.metadataKind}`:``,{"markstream-pre__diff-line--empty":t.empty,"markstream-pre__diff-line--collapsed-first":!0===t.collapsedFirst,"markstream-pre__diff-line--collapsed-last":!0===t.collapsedLast}]]),style:I(de(r,e.key))},[n[1]||=T(`span`,{class:`markstream-pre__diff-rail`,"aria-hidden":`true`},null,-1),t.kind===`collapsed`?(B(),z(`span`,KD,[...n[0]||=[T(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`},[T(`path`,{d:`M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06`})],-1)]])):L(``,!0),T(`span`,qD,C(t.number),1),T(`span`,JD,[T(`span`,YD,C(t.code),1)])],6))),128))])],2))),128))])):(B(),z(w,{key:1},[!0===t.showLineNumbers&&!0!==(r=t.node)?.diff&&O.value?(B(),z(`code`,XD,[(B(!0),z(w,null,o(b.value,(e,t)=>(B(),z(`span`,{key:t,class:`markstream-pre__logical-line`,"data-line-number":t+1,textContent:C(e)},null,8,ZD))),128))])):(B(),z(w,{key:1},[t.showLineNumbers?(B(),z(`span`,QD,[T(`span`,{class:`markstream-pre__line-numbers-text`,textContent:C(M.value)},null,8,$D)])):L(``,!0),T(`code`,{translate:`no`,class:`markstream-pre__code`,textContent:C(l.value)},null,8,eO)],64))],64))],14,UD);var r}}});tO.install=e=>{e.component(tO.__name,tO)};var nO=[`onAnimationend`],rO=$(p({__name:`TextNode`,props:{node:{}},emits:[`copy`],setup(e){let t=e,n=ee(),r=k(`markstreamFade`,void 0),i=k(`markstreamTextFinal`,void 0),a=E(()=>!0===i?.value),s=k(`markstreamFinalCleanup`,void 0),c=!0,l=k(`markstreamTextStreamState`,void 0),u=E(()=>{let e=n.fade;return e===``||!0===e||e===`true`||!1!==e&&e!==`false`&&void 0}),p=E(()=>typeof u.value==`boolean`?u.value:typeof r?.value!=`boolean`||r.value),m=E(()=>{let e=n[`index-key`]??n.indexKey;return e==null||e===``?``:String(e)}),{settledContent:h,segments:g,update:_,finish:y,queueFinish:b,finishAll:x,settleFinished:O}=XE(t.node.content),j=D(null),M=D(null),P=D([]),te=D(``),ne,I=``,L=null,R=null,V=!1;function re(e){let t=document.getSelection?.call(document);if(!t||t.rangeCount===0)return!1;let{anchorNode:n,focusNode:r}=t;return n!=null&&e.contains(n)||r!=null&&e.contains(r)}function ie(){if(!P.value.length)return!1;let e=document.getSelection?.call(document);if(!e||e.isCollapsed)return!1;for(let t=0;t<e.rangeCount;t++){let n=e.getRangeAt(t);if(P.value.some(e=>n.intersectsNode(e)))return!0}return!1}function ae(){let e=ie();return e&&(V=!0,le()),e}function oe(e){let t=m.value;_(e,t?l?.get(t):void 0,p.value&&!a.value),t&&l?.set(t,e)}v([h,j,M],function(){let e=j.value;if(!e)return;let t=String(h.value??``),n=M.value;if(L||(L=e.firstChild,I=L?.data??``),!t.startsWith(I))return e.textContent=t,L=e.firstChild,n&&(n.textContent=``),void(I=t);if(!L&&t)return e.textContent=t,L=e.firstChild,void(I=t);if(t.length>I.length&&n){let e=t.slice(I.length),r=n.lastChild;a.value&&r?.nodeType===3&&!re(n)?r.appendData(e):n.appendChild(document.createTextNode(e)),I=t,function(e){if(a.value||e.childNodes.length<=4||re(e))return;let t=``;for(let n=0;n<e.childNodes.length;n++)t+=e.childNodes[n]?.textContent??``;e.textContent=t}(n)}},{immediate:!0}),v([()=>t.node.content,m,p,()=>g.value.length>0&&a.value],([e])=>{let t=String(e??``);if(a.value&&s&&g.value.length&&t===h.value+g.value.map(e=>e.content).join(``)){let e=g.value.find(e=>!e.finished);e&&(x(!0),s(()=>{var t;c&&(t=e.id,y(t,ae()))}))}else{if(ie()){let e=a.value?h.value+g.value.map(e=>e.content).join(``):``;if(!a.value||t.startsWith(e))return R=t,te.value=a.value?t.slice(e.length):``,void le()}te.value=``,R=null,V=!1,oe(t)}},{immediate:!0});let se=D(h.value);function ce(){if(!ie()){if(ue(),R!=null){let e=R;R=null,te.value=``,V=!1,oe(e),O()}else V&&(V=!1,O())}}function le(){ne||(ne=document,ne.addEventListener(`selectionchange`,ce))}function ue(){ne?.removeEventListener(`selectionchange`,ce),ne=void 0}return N(()=>{c=!1,ue()}),(t,n)=>(B(),z(`span`,{class:S([[e.node.center?`text-node-center`:``],`text-node`])},[d(T(`span`,{ref_key:`settledTextEl`,ref:j},C(se.value),513),[[A,F(h)!==``]]),d(T(`span`,{ref_key:`settledAppendsEl`,ref:M},null,512),[[A,F(h)!==``]]),(B(!0),z(w,null,o(F(g),e=>(B(),z(`span`,{key:e.id,ref_for:!0,ref_key:`streamedDeltaEls`,ref:P,class:S(a.value||e.finished?`text-node-stream-final`:`text-node-stream-delta`),onAnimationend:t=>F(b)(e.id,ae)},C(e.content),43,nO))),128)),f(C(te.value),1)],2))}}),[[`__scopeId`,`data-v-e05f584c`]]);function iO(e,t,n){return p({name:e,inheritAttrs:!1,setup(e,{attrs:r,slots:a}){let o=MD(),s=kD(),c=AD(),d=typeof window<`u`&&i()?.vnode.el?.nodeType===1,f=D(typeof window>`u`||d||!c.value),p=x(null),m=null;function h(e){let t=e&&`$el`in e?e.$el:e;p.value=t instanceof HTMLElement?t:null}return typeof window<`u`&&v([p,c],([e,t],n,r)=>{if(m?.destroy(),m=null,!t||f.value)return void(f.value=!0);if(!e)return;let i=!0,a=o(e,{rootMargin:s?.value.heavyBlockMargin,allowIdle:!1});m=a,f.value=a.isVisible.value,a.whenVisible.then(()=>{i&&m===a&&(f.value=!0)}),r(()=>{i=!1,a.destroy(),m===a&&(m=null)})},{immediate:!0}),u(()=>{m?.destroy(),m=null}),()=>l(f.value?t:n,Q(Z({},r),{ref:h}),a)}})}rO.install=e=>{e.component(rO.__name,rO)};var aO=p({name:`CodeBlockNodeLoadingShell`,inheritAttrs:!1,props:`node.isDark.loading.stream.codeBlockOptions.showLineNumbers.theme.darkTheme.lightTheme.isShowPreview.showHeader.showCopyButton.showExpandButton.showPreviewButton.showCollapseButton.showFontSizeButtons.enableFontSizeControl.minWidth.maxWidth.themes.showTooltips.htmlPreviewAllowScripts.htmlPreviewSandbox.customId.indexKey.estimatedHeightPx.estimatedContentHeightPx.estimatedDiffInline.diffInline.diffHideUnchangedRegions.reservedHeightPx`.split(`.`),emits:[`click`,`mouseover`,`mouseout`,`copy`,`previewCode`,`handleArtifactClick`],setup(e,{attrs:t}){let n=e,r=ze();return()=>{let e=n.codeBlockOptions??{},i=At(e),a=Tt({darkTheme:n.darkTheme,isDark:n.isDark,lightTheme:n.lightTheme,theme:n.theme,themes:n.themes}),o=Rw(String(n.node?.language??``)),s=xe(n.node),c=Ce(String(n.node?.raw??``),Vw[o]||(o===`typescript`?`TypeScript`:o?o.charAt(0).toUpperCase()+o.slice(1):Vw[``]),s),u=s?gt({originalCode:n.node?.originalCode,updatedCode:n.node?.updatedCode,loading:!0,matchCache:r}).flatMap(e=>e.lines):[],d=s?{removed:u.filter(e=>e.kind===`removed`).length,added:u.filter(e=>e.kind===`added`).length}:null,f=Number(n.estimatedContentHeightPx??n.reservedHeightPx),p=!s&&Number.isFinite(f)&&f>0?Math.min(i.maxHeight,Math.ceil(f)):void 0,m=e=>l(`button`,{class:`code-action-btn code-loading-action code-loading-action--${e} inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0`,"aria-hidden":`true`,disabled:!0,tabindex:-1,type:`button`}),h=!1!==n.showExpandButton||!1!==n.showPreviewButton&&!1!==n.isShowPreview&&(o===`html`||o===`svg`)||!1!==n.showFontSizeButtons&&!1!==n.enableFontSizeControl,g=e=>e==null?void 0:typeof e==`number`?`${e}px`:String(e),_={"--code-bg":a.background,"--code-fg":a.foreground,"--code-line-number":a.lineNumber,"--markstream-code-fallback-bg":a.background,"--markstream-code-fallback-fg":a.foreground,"--markstream-diff-added-line-fill":a.diffAddedLine,"--markstream-diff-added-number-fill":a.diffAddedNumber,"--markstream-diff-editor-bg":a.background,"--markstream-diff-metadata-bg":a.background,"--markstream-diff-metadata-fg":a.lineNumber,"--markstream-diff-removed-line-fill":a.diffRemovedLine,"--markstream-diff-removed-number-fill":a.diffRemovedNumber,"--markstream-diff-shell-bg":a.background,"--markstream-pre-resolved-theme-bg":a.background,"--markstream-pre-resolved-theme-fg":a.foreground,"--markstream-pre-resolved-theme-line-number":a.lineNumber};return l(`div`,Q(Z({},t),{class:[`code-block-container rounded-lg border`,{dark:!0===n.isDark,"is-dark":a.dark,"is-rendering":!1!==n.loading,"is-diff":s},t.class],style:[Z(Q(Z({},_),{backgroundColor:a.background,color:a.foreground,minWidth:g(n.minWidth),maxWidth:g(n.maxWidth)}),s?{}:{borderColor:`var(--markstream-code-border-color, var(--code-border))`}),t.style],"data-markstream-code-block":`1`,"data-markstream-enhanced":`false`,"data-markstream-code-block-state":n.loading?`streaming`:`settled`,"data-markstream-code-loading":`1`}),[!1===n.showHeader?null:l(`div`,{class:`code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]`},[l(`div`,{class:`code-header-main`},[l(`span`,{class:`icon-slot h-4 w-4 flex-shrink-0`,"aria-hidden":`true`,innerHTML:Bw(o)}),l(`div`,{class:`code-header-copy`},[l(`div`,{class:`code-header-title`},c.title),c.caption?l(`div`,{class:`code-header-caption`},c.caption):null])]),l(`div`,{class:`flex items-center gap-0.5`},[d?l(`div`,{class:`code-diff-stats`,"aria-label":`-${d.removed} +${d.added}`},[l(`span`,{class:`code-diff-stat removed`},`-${d.removed}`),l(`span`,{class:`code-diff-stat added`},`+${d.added}`)]):null,!1===n.showCopyButton?null:m(`copy`),!1===n.showCollapseButton?null:m(`collapse`),h?l(`div`,{class:`relative flex`},[m(`more`)]):null])]),l(`div`,{class:`code-block-shell-content`,style:!1!==n.stream||!1===n.loading?void 0:{display:`none`}},[l(tO,{node:n.node,loading:n.loading,showLineNumbers:n.showLineNumbers??!0!==e.disableLineNumbers,diffInline:s&&!!(n.diffInline??n.estimatedDiffInline??e.diffStyle===`unified`),diffHideUnchangedRegions:s?n.diffHideUnchangedRegions??ve(e):void 0,reservedHeightPx:p,class:[`code-pre-fallback`,{"is-wrap":i.overflow===`wrap`}],style:Q(Z({},_),{"--markstream-code-padding-x":`${i.padding}px`,"--markstream-code-padding-y":`${i.padding}px`,"--markstream-code-tab-size":i.tabSize,"--markstream-pre-diff-line-height":`${i.lineHeight}px`,backgroundColor:a.background,color:a.foreground,fontFamily:i.fontFamily,fontSize:`${i.fontSize}px`,lineHeight:`${i.lineHeight}px`,maxHeight:`${p??i.maxHeight}px`,overflow:`auto`,paddingTop:`${i.padding}px`,paddingBottom:`${i.paddingBottom}px`,tabSize:i.tabSize,whiteSpace:i.overflow===`wrap`?`pre-wrap`:`pre`,overflowWrap:i.overflow===`wrap`?`anywhere`:`normal`}),"data-markstream-code-loading":`1`})]),l(`div`,{class:`code-loading-placeholder`,style:!1===n.stream&&!1!==n.loading?void 0:{display:`none`}},[l(`div`,{class:`loading-skeleton`},[l(`div`,{class:`skeleton-line`}),l(`div`,{class:`skeleton-line`}),l(`div`,{class:`skeleton-line short`})])])])}}}),oO=R({loader:()=>V(()=>import(`./PreCodeBlock-CPJuGkN0.js`),__vite__mapDeps([5,6,0,1])),loadingComponent:aO,delay:0,suspensible:!0}),sO=iO(`ViewportDeferredCodeBlockNode`,R({loader:()=>mE(null,null,function*(){try{return(yield V(()=>import(`./CodeBlockNode-Ubb_GmEN.js`),__vite__mapDeps([7,0,1,6,8,3,4]))).default}catch(e){return console.warn(`[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer.`,e),tO}}),loadingComponent:aO,delay:0,suspensible:!1}),aO),cO=R(()=>mE(null,null,function*(){if(function(){return Reflect.get(globalThis,`process`)?.env}()?.NODE_ENV===`test`&&typeof window<`u`)return e=>l(rO,Q(Z({},e),{node:{type:`text`,content:e.node.raw??`$${e.node.content??``}$`,raw:e.node.raw??`$${e.node.content??``}$`}}));try{return yield nT(),(yield V(()=>import(`./index6-SCztOIu6.js`),__vite__mapDeps([9,0,1]))).default}catch(e){console.warn(`[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".`,e)}return e=>l(rO,Q(Z({},e),{node:{type:`text`,content:e.node.raw??`$${e.node.content??``}$`,raw:e.node.raw??`$${e.node.content??``}$`}}))})),lO=R(()=>mE(null,null,function*(){try{return yield nT(),(yield V(()=>import(`./index5-CkCxVfaP.js`),__vite__mapDeps([10,0,1]))).default}catch(e){console.warn(`[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".`,e)}return e=>l(rO,Q(Z({},e),{node:{type:`text`,content:e.node.raw??`$$${e.node.content??``}$$`,raw:e.node.raw??`$$${e.node.content??``}$$`}}))})),uO=[`data-reference-id`,`data-markstream-reference-id`],dO=$(p({__name:`ReferenceNode`,props:{node:{},messageId:{},threadId:{}},emits:[`click`,`mouseEnter`,`mouseLeave`],setup:e=>(t,n)=>(B(),z(`span`,{class:`reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5`,role:`button`,tabindex:`0`,"data-reference-id":e.node.id,"data-markstream-reference-id":e.node.id,onClick:n[0]||=n=>t.$emit(`click`,n,e.node.id,e.messageId,e.threadId),onMouseenter:n[1]||=n=>t.$emit(`mouseEnter`,n,e.node.id,e.messageId,e.threadId),onMouseleave:n[2]||=n=>t.$emit(`mouseLeave`,n,e.node.id,e.messageId,e.threadId)},C(e.node.id),41,uO))}),[[`__scopeId`,`data-v-b96c91c3`]]);dO.install=e=>{e.component(dO.__name,dO)};var fO={class:`superscript-node`},pO=$(p({__name:`SuperscriptNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,emphasis:AO,footnote_reference:IE,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,emoji:jE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`sup`,fO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`superscript`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`superscript`}-${i}`,"fallback-to-text":``},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-24160b22`]]);pO.install=e=>{e.component(pO.__name,pO)};var mO={class:`subscript-node`},hO=$(p({__name:`SubscriptNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,emphasis:AO,footnote_reference:IE,strikethrough:yO,highlight:OO,insert:EO,superscript:pO,emoji:jE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`sub`,mO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`subscript`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`subscript`}-${i}`,"fallback-to-text":``},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-197fa13b`]]);hO.install=e=>{e.component(hO.__name,hO)};var gO={class:`strong-node`},_O=$(p({__name:`StrongNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,emphasis:AO,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,superscript:pO,emoji:jE,footnote_reference:IE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`strong`,gO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`strong`}-${i}`,components:r.value,node:n,"index-key":`${e.indexKey||`strong`}-${i}`,"custom-id":t.customId},null,8,[`components`,`node`,`index-key`,`custom-id`]))),128))]))}}),[[`__scopeId`,`data-v-a8647104`]]);_O.install=e=>{e.component(_O.__name,_O)};var vO={class:`strikethrough-node`},yO=$(p({__name:`StrikethroughNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,emphasis:AO,highlight:OO,insert:EO,subscript:hO,superscript:pO,emoji:jE,footnote_reference:IE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`del`,vO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`strikethrough`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`strikethrough`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-b7a531fa`]]);yO.install=e=>{e.component(yO.__name,yO)};var bO=[`href`,`title`,`aria-label`,`aria-hidden`,`target`,`rel`],xO=[`aria-hidden`],SO={class:`link-text-wrapper relative inline-flex`},CO={class:`leading-[normal] link-text`},wO=$(p({__name:`LinkNode`,props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){let t=e,r=k(`markstreamShowTooltips`,void 0),i=E(()=>{let e=r?.value;return typeof e==`boolean`?e:t.showTooltip}),a=E(()=>{let e=t.underlineBottom===void 0?`-3px`:typeof t.underlineBottom==`number`?`${t.underlineBottom}px`:String(t.underlineBottom),n=t.animationOpacity??.35,r=Math.max(.12,Math.min(.5*n,n)),i={"--underline-height":`${t.underlineHeight??2}px`,"--underline-bottom":e,"--underline-opacity":String(n),"--underline-rest-opacity":String(r),"--underline-duration":`${t.animationDuration??1.6}s`,"--underline-timing":t.animationTiming??`ease-in-out`,"--underline-iteration":typeof t.animationIteration==`number`?String(t.animationIteration):t.animationIteration??`infinite`};return t.color&&(i[`--link-color`]=t.color),i}),s=TE(()=>t.customId),c=E(()=>Z({text:rO,strong:_O,strikethrough:yO,emphasis:AO,image:zD,html_inline:YE,inline_code:eD,math_inline:cO},s.value)),l=ee(),d=E(()=>{let e=t.node?.attrs;if(!e||typeof e!=`object`)return{};let n={};if(Array.isArray(e))for(let t of e)Array.isArray(t)&&t[0]&&(n[String(t[0])]=String(t[1]??``));else for(let[t,r]of Object.entries(e))t&&r!=null&&!1!==r&&(n[t]=!0===r?``:String(r));return BE(n,`safe`,`a`)}),f=E(()=>Z(Z({},l),d.value)),p=E(()=>BE({href:String(t.node?.href??``)},`safe`,`a`).href),m=E(()=>{if(!p.value)return;let e=f.value.target;return(typeof e==`string`?e.trim():String(e??``).trim())||(of(p.value)?`_blank`:void 0)}),h=E(()=>String(m.value??``).trim().toLowerCase()===`_blank`),g=E(()=>{if(!p.value)return;let e=f.value.rel,t=new Set((typeof e==`string`?e:String(e??``)).split(/\s+/).filter(Boolean)),n=new Set(Array.from(t).filter(e=>e.toLowerCase()!==`opener`));return h.value&&(n.add(`noopener`),n.add(`noreferrer`)),n.size>0?Array.from(n).join(` `):void 0}),_=E(()=>{let e=Z({},f.value);return delete e.title,delete e.href,delete e.target,delete e.rel,e}),y;function x(){i.value&&_D()}u(()=>y?.()),v([()=>t.node.loading,i],([e,t])=>{!e&&t||y==null||y()});let S=E(()=>{let e=t.node?.title;return typeof e==`string`&&e.trim().length>0?e:String(p.value??``)});return(r,s)=>e.node.loading?(B(),z(`span`,O({key:1,class:`link-loading inline-flex items-baseline gap-1.5`,"aria-hidden":e.node.loading?`false`:`true`},F(l),{style:a.value}),[T(`span`,SO,[T(`span`,CO,[n(F(rO),{class:`leading-[normal] link-text`,node:{type:`text`,content:String(e.node.text??``),raw:String(e.node.text??``)},"index-key":`${e.indexKey||`link-text`}-loading`},null,8,[`node`,`index-key`])]),s[1]||=T(`span`,{class:`link-loading-indicator`,"aria-hidden":`true`},null,-1)])],16,xO)):(B(),z(`a`,O({key:0,class:`link-node`,href:p.value,title:i.value?``:S.value,"aria-label":`Link: ${S.value}`,"aria-hidden":e.node.loading?`true`:`false`,target:m.value,rel:g.value},_.value,{style:a.value,onMouseenter:s[0]||=e=>function(e){if(!i.value)return;let n=e,r=n?.clientX!=null&&n?.clientY!=null?{x:n.clientX,y:n.clientY}:void 0,a=t.node?.title||(p.value?.includes(`xn--`)&&(t.node?.text)?.includes(`://`)?t.node.text:p.value)||``;y=gD(e.currentTarget,a,`top`,!1,r)}(e),onMouseleave:x}),[(B(!0),z(w,null,o(e.node.children,(n,r)=>(B(),b(F(HD),{key:`${e.indexKey||`emphasis`}-${r}`,components:c.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`link-text`}-${r}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))],16,bO))}}),[[`__scopeId`,`data-v-388c6c51`]]);wO.install=e=>{e.component(wO.__name,wO)};var TO={class:`insert-node`},EO=$(p({__name:`InsertNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,emphasis:AO,strikethrough:yO,highlight:OO,subscript:hO,superscript:pO,emoji:jE,footnote_reference:IE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`ins`,TO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`insert`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`insert`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-1e2c29d4`]]);EO.install=e=>{e.component(EO.__name,EO)};var DO={class:`highlight-node`},OO=$(p({__name:`HighlightNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,emphasis:AO,strikethrough:yO,insert:EO,subscript:hO,superscript:pO,emoji:jE,footnote_reference:IE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`mark`,DO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`highlight`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`highlight`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-7a62982a`]]);OO.install=e=>{e.component(OO.__name,OO)};var kO={class:`emphasis-node`},AO=$(p({__name:`EmphasisNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,superscript:pO,emoji:jE,footnote_reference:IE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`em`,kO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`emphasis`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`emphasis`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-2a5aafbf`]]);AO.install=e=>{e.component(AO.__name,AO)};var jO={class:`hard-break`},MO=$(p({__name:`HardBreakNode`,props:{node:{}},setup:e=>(e,t)=>(B(),z(`br`,jO))}),[[`__scopeId`,`data-v-50c58f70`]]);MO.install=e=>{e.component(MO.__name,MO)};var NO=p({__name:`SimpleInlineRenderer`,props:{nodes:{},customId:{},indexKey:{}},setup(e){let t=e,n=ne({checkbox:kE,checkbox_input:kE,emoji:jE,emphasis:AO,hardbreak:MO,highlight:OO,inline_code:eD,insert:EO,link:wO,reference:dO,strikethrough:yO,strong:_O,subscript:hO,superscript:pO,text:rO}),r=TE(()=>t.customId),i=E(()=>{let e=r.value;return Object.keys(e).length>0?Z(Z({},n),e):n});return(n,r)=>(B(!0),z(w,null,o(e.nodes,(n,r)=>(B(),b(F(HD),{key:r,components:i.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`inline`}-${r}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))}}),PO=[`cite`],FO={key:0,dir:`auto`,class:`paragraph-node`},IO=[`custom-id`],LO=$(p({__name:`BlockquoteNode`,props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:[`copy`],setup(e){let n=e,r=TE(()=>n.customId),i=E(()=>!!r.value.paragraph),a=E(()=>!!r.value.text),o=E(()=>zt(n.node.children,!i.value)),s=E(()=>!1!==n.fade||a.value?null:Bt(o.value));return t(`markstreamShowTooltips`,E(()=>n.showTooltips)),t(`markstreamFade`,E(()=>n.fade)),(t,r)=>(B(),z(`blockquote`,{class:`blockquote blockquote-node`,dir:`auto`,cite:e.node.cite},[o.value?(B(),z(`p`,FO,[s.value===null?(B(),b(F(NO),{key:1,nodes:o.value,"custom-id":n.customId,"index-key":`blockquote-${n.indexKey}-paragraph`},null,8,[`nodes`,`custom-id`,`index-key`])):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":n.customId},C(s.value),9,IO))])):(B(),b(F(uj),{key:1,"show-tooltips":n.showTooltips,"index-key":`blockquote-${n.indexKey}`,nodes:n.node.children||[],"custom-id":n.customId,typewriter:n.typewriter,fade:n.fade,onCopy:r[0]||=e=>t.$emit(`copy`,e)},null,8,[`show-tooltips`,`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`]))],8,PO))}}),[[`__scopeId`,`data-v-c7658eda`]]);LO.install=e=>{e.component(LO.__name,LO)};var RO={class:`definition-list`},zO={class:`definition-term`},BO={class:`definition-desc`},VO=$(p({__name:`DefinitionListNode`,props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:[`copy`],setup(e){let t=e;return(e,r)=>(B(),z(`dl`,RO,[(B(!0),z(w,null,o(t.node.items,(i,a)=>(B(),z(w,{key:a},[T(`dt`,zO,[n(F(uj),{"index-key":`definition-term-${t.indexKey}-${a}`,nodes:i.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:r[0]||=t=>e.$emit(`copy`,t)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])]),T(`dd`,BO,[n(F(uj),{"index-key":`definition-desc-${t.indexKey}-${a}`,nodes:i.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:r[1]||=t=>e.$emit(`copy`,t)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])])],64))),128))]))}}),[[`__scopeId`,`data-v-4e103b30`]]);VO.install=e=>{e.component(VO.__name,VO)};var HO=[`href`,`title`],UO=$(p({__name:`FootnoteAnchorNode`,props:{node:{}},setup(e){let t=e;function n(e){if(e.preventDefault(),typeof document>`u`)return;let n=NE(e.currentTarget,`fnref-${String(t.node.id??``)}`);n&&n.scrollIntoView({behavior:`smooth`,block:`center`})}return(t,r)=>(B(),z(`a`,{class:`footnote-anchor text-sm hover:underline cursor-pointer`,href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n},` ↩︎ `,8,HO))}}),[[`__scopeId`,`data-v-0dbaa45e`]]);UO.install=e=>{e.component(UO.__name,UO)};var WO=[`id`],GO={class:`flex-1`},KO=p({__name:`FootnoteNode`,props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:[`copy`],setup(e){let t=e;return(r,i)=>(B(),z(`div`,{id:`fnref--${e.node.id}`,class:`footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2`},[T(`div`,GO,[n(F(uj),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||=e=>r.$emit(`copy`,e)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])])],8,WO))}});KO.install=e=>{e.component(KO.__name,KO)};var qO=[`custom-id`],JO=$(p({__name:`HeadingNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=k(`markstreamFade`,void 0),i=E(()=>!1!==r?.value||n.value.text?null:Bt(t.node.children)),s=E(()=>Z({text:rO,inline_code:eD,link:wO,image:zD,strong:_O,emphasis:AO,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,superscript:pO,emoji:jE,checkbox:kE,checkbox_input:kE,footnote_reference:IE,hardbreak:MO,math_inline:cO,reference:dO},n.value));return(n,r)=>(B(),b(a(`h${e.node.level}`),O({class:[`heading-node`,[`heading-${e.node.level}`]],dir:`auto`},e.node.attrs),{default:y(()=>[i.value===null?(B(!0),z(w,{key:1},o(e.node.children,(n,r)=>(B(),b(F(HD),{key:r,components:s.value,"custom-id":t.customId,node:n,"index-key":`${e.indexKey||`heading`}-${r}`},null,8,[`components`,`custom-id`,`node`,`index-key`]))),128)):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":t.customId},C(i.value),9,qO))]),_:1},16,[`class`]))}}),[[`__scopeId`,`data-v-2d6f45ba`]]),YO=JO;YO.install=e=>{e.component(JO.__name,JO)};var XO={key:0,dir:`auto`,class:`paragraph-node`},ZO=[`custom-id`],QO={dir:`auto`,class:`paragraph-node`},$O=[`custom-id`],ek=$(p({__name:`ListItemNode`,props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:[`copy`],setup(e){let n=e,r=E(()=>n.node??n.item),i=TE(()=>n.customId),a=E(()=>!!i.value.paragraph),s=E(()=>!!i.value.text),c=E(()=>zt(r.value?.children,!a.value)),l=E(()=>{if(a.value)return null;let e=r.value?.children;if(!Array.isArray(e)||e.length<2)return null;let t=e[0];if(t?.type!==`paragraph`||!Array.isArray(t.children))return null;let n=e.slice(1);if(!n.every(e=>e?.type===`list`))return null;let i=zt([t]);return i?{paragraphChildren:i,nestedLists:n}:null});function u(){return!1===n.fade&&!s.value}let d=E(()=>u()?Bt(c.value):null),f=E(()=>u()?Bt(l.value?.paragraphChildren):null),p=Object.freeze({}),m=E(()=>{let{value:e}=n;return typeof e==`number`&&Number.isFinite(e)?{value:e}:p});return t(`markstreamShowTooltips`,E(()=>n.showTooltips)),t(`markstreamFade`,E(()=>n.fade)),(e,t)=>(B(),z(`li`,O({class:`list-item`,dir:`auto`},m.value),[c.value?(B(),z(`p`,XO,[d.value===null?(B(),b(F(NO),{key:1,nodes:c.value,"custom-id":n.customId,"index-key":`list-item-${n.indexKey}-paragraph`},null,8,[`nodes`,`custom-id`,`index-key`])):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":n.customId},C(d.value),9,ZO))])):l.value?(B(),z(w,{key:1},[T(`p`,QO,[f.value===null?(B(),b(F(NO),{key:1,nodes:l.value.paragraphChildren,"custom-id":n.customId,"index-key":`list-item-${n.indexKey}-paragraph`},null,8,[`nodes`,`custom-id`,`index-key`])):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":n.customId},C(f.value),9,$O))]),(B(!0),z(w,null,o(l.value.nestedLists,(r,i)=>(B(),b(F(uj),{key:i,nodes:[r],"custom-id":n.customId,"index-key":`list-item-${n.indexKey}-nested-${i}`,"show-tooltips":n.showTooltips,typewriter:n.typewriter,fade:n.fade,"is-dark":n.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:t[0]||=t=>e.$emit(`copy`,t)},null,8,[`nodes`,`custom-id`,`index-key`,`show-tooltips`,`typewriter`,`fade`,`is-dark`]))),128))],64)):(B(),b(F(uj),{key:2,"show-tooltips":n.showTooltips,"index-key":`list-item-${n.indexKey}`,nodes:r.value?.children??[],"custom-id":n.customId,typewriter:n.typewriter,fade:n.fade,"is-dark":n.isDark,"batch-rendering":!1,onCopy:t[1]||=t=>e.$emit(`copy`,t)},null,8,[`show-tooltips`,`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`,`is-dark`]))],16))}}),[[`__scopeId`,`data-v-a2b8a81c`]]);ek.install=e=>{e.component(ek.__name,ek)};var tk=$(p({__name:`ListNode`,props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:[`copy`],setup(e){let t=TE(()=>e.customId),n=E(()=>t.value.list_item||ek);return(t,r)=>(B(),b(a(e.node.ordered?`ol`:`ul`),{class:S([`list-node`,{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:y(()=>[(B(!0),z(w,null,o(e.node.items,(i,o)=>(B(),b(a(n.value),O({key:`${e.indexKey||`list`}-${o}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||`list`}-${o}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?(e.node.start??1)+o:void 0,onCopy:r[0]||=e=>t.$emit(`copy`,e)}),null,16,[`node`,`custom-id`,`index-key`,`typewriter`,`fade`,`is-dark`,`value`]))),128))]),_:1},8,[`class`]))}}),[[`__scopeId`,`data-v-99cb95e0`]]);tk.install=e=>{e.component(tk.__name,tk)};var nk={key:2,class:`html-block-node__raw`},rk=[`innerHTML`],ik={key:1,class:`html-block-node__placeholder`},ak=$(p({__name:`HtmlBlockNode`,props:{node:{},customId:{},htmlPolicy:{}},setup(e){let t=e,n=k(`markstreamHtmlPolicy`,void 0),i=k(`markstreamNestedRendererProps`,void 0),o=E(()=>t.htmlPolicy??n?.value??`safe`),s=E(()=>{let e=i?.value??{};return Q(Z({},e),{customId:t.customId??e.customId,htmlPolicy:o.value})}),l=R({loader:()=>Promise.resolve().then(()=>dj),suspensible:!1}),d=E(()=>{let e=BC(t.node.attrs,o.value);if(!e)return;let n=zC(e);return Object.keys(n).length>0?n:void 0}),f=E(()=>{let e=String(t.node.tag||``).trim(),n=BC(t.node.attrs,o.value,e);if(!n)return;let r=zC(n);return Object.keys(r).length>0?r:void 0}),h=TE(()=>t.customId),g=p({name:`DynamicRenderer`,props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),_=D(null);function S(e,t,n,r){if(!0!==e)return!1;let i=String(t??``);if(!i)return!1;if(i!==String(n??``))return!0;let a=String(r??``).trim();return!!a&&!1===i.toLowerCase().includes(`</${a.toLowerCase()}`)}let A=D(S(t.node.loading,t.node.raw,t.node.content,t.node.tag)),M=D(typeof window>`u`||A.value),N=D(t.node.content),P=D(0),ee=D(String(t.node.raw??``)),te=E(()=>Array.isArray(t.node.children)?t.node.children:[]);v(()=>[t.node.loading,t.node.raw,t.node.content,t.node.tag],([e,t,n,r])=>{let i=String(t??``),a=!ee.value||i.startsWith(ee.value),o=S(e,t,n,r);a?o&&(A.value=!0):(A.value=o,P.value=0),o&&(M.value=!0),ee.value=i},{flush:`sync`});let ne=E(()=>String(t.node.tag||`div`)),I=E(()=>{if(ne.value.trim().toLowerCase()!==`details`||t.node.attrs?.some(([e])=>String(e).toLowerCase()===`open`))return null;let e=te.value[0];return e?.type===`html_block`&&String(e.tag||``).toLowerCase()===`summary`?e:null}),V=E(()=>Bt(I.value?.children)),re=E(()=>{let e=I.value;if(!e)return;let t=BC(e.attrs,o.value,`summary`);if(!t)return;let n=zC(t);return Object.keys(n).length>0?n:void 0}),ie=E(()=>V.value==null?te.value:te.value.slice(1)),ae=E(()=>{let e=ne.value.trim().toLowerCase();return Gd.has(e)||OC(e,o.value)}),oe=E(()=>te.value.length>0&&!!t.node.tag&&!ae.value),se=E(()=>{if(oe.value)return{mode:`structured`};if(!M.value)return{mode:`html`,content:N.value??``};let e=N.value??t.node.content;if(!e)return{mode:`html`,content:``};if(o.value===`escape`)return{mode:`html`,content:qC(e,o.value)};let n=A.value||!0===t.node.loading,r=qE(e,h.value,o.value,n);return r.ok&&(n||r.hasCustomComponents)?{mode:`dynamic`,nodes:r.nodes}:n?{mode:`text`,content:t.node.raw??e}:{mode:`html`,content:qC(e,o.value)}}),ce=MD(),le=kD(),ue=AD(),de=x(null),fe=!!t.node.loading,pe=null;return typeof window<`u`?(v([()=>_.value,()=>t.node.loading,A],([e,n,r],i,a)=>{if(pe?.disconnect(),pe=null,!e||!r||!1===n||typeof ResizeObserver>`u`)return;let o=new ResizeObserver(e=>{if(!A.value||!1===t.node.loading)return;let n=e[0],r=(Array.isArray(n?.borderBoxSize)?n.borderBoxSize[0]:n?.borderBoxSize)?.blockSize??n?.contentRect.height??0;r>P.value&&(P.value=r)});pe=o,o.observe(e),a(()=>o.disconnect())},{immediate:!0}),v(()=>t.node.loading,e=>mE(null,null,function*(){!1!==e||!A.value||P.value<=0||(yield c(),requestAnimationFrame(()=>{!1===t.node.loading&&(P.value=0)}))})),v([()=>_.value,()=>le?.value.heavyBlockMargin,()=>le?.value.rootMargin],([e],n,r)=>{var i,a;if((a=(i=de.value)?.destroy)==null||a.call(i),de.value=null,!fe)return M.value=!0,void(N.value=t.node.content);if(!e)return void(A.value||(M.value=!1));let o=!0,s=le?.value.heavyBlockMargin??le?.value.rootMargin??OD,c=ce(e,{rootMargin:s,allowIdle:!ue.value});de.value=c,M.value=M.value||c.isVisible.value,c.whenVisible.then(()=>{o&&de.value===c&&(M.value=!0)}),r(()=>{o=!1,c.destroy(),de.value===c&&(de.value=null)})},{immediate:!0}),v(()=>t.node.content,e=>{fe&&!M.value||(N.value=e)})):M.value=!0,u(()=>{var e,t;pe?.disconnect(),pe=null,(t=(e=de.value)?.destroy)==null||t.call(e),de.value=null}),(t,n)=>(B(),b(a(oe.value?ne.value:`div`),O({ref_key:`htmlRef`,ref:_,class:`html-block-node`,style:P.value>0?{boxSizing:`border-box`,minHeight:`${P.value}px`}:void 0,"data-markstream-viewport-pending":F(ue)&&!M.value?`true`:void 0},oe.value?f.value:void 0),{default:y(()=>[M.value?(B(),z(w,{key:0},[se.value.mode===`structured`?(B(),z(w,{key:0},[V.value===null?(B(),b(F(l),O({key:1},s.value,{nodes:te.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`])):(B(),z(w,{key:0},[T(`summary`,j(r(re.value)),C(V.value),17),ie.value.length?(B(),b(F(l),O({key:0},s.value,{nodes:ie.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`])):L(``,!0)],64))],64)):se.value.mode===`dynamic`?(B(),b(F(g),{key:1,nodes:se.value.nodes},null,8,[`nodes`])):se.value.mode===`text`?(B(),z(`pre`,nk,C(se.value.content),1)):(B(),z(`div`,O({key:3},d.value,{innerHTML:se.value.content}),null,16,rk))],64)):(B(),z(`div`,ik,[m(t.$slots,`placeholder`,{node:e.node},()=>[n[0]||=T(`span`,{class:`html-block-node__placeholder-bar`},null,-1),n[1]||=T(`span`,{class:`html-block-node__placeholder-bar w-4/5`},null,-1),n[2]||=T(`span`,{class:`html-block-node__placeholder-bar w-2/3`},null,-1)],!0)]))]),_:3},16,[`style`,`data-markstream-viewport-pending`]))}}),[[`__scopeId`,`data-v-b7034867`]]);ak.install=e=>{e.component(ak.__name,ak)};var ok={dir:`auto`,class:`paragraph-node`},sk=[`custom-id`],ck=$(p({__name:`ParagraphNode`,props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){let t=e,n=TE(()=>t.customId),r=k(`markstreamHtmlPolicy`,void 0),i=k(`markstreamFade`,void 0),s=k(`markstreamParseOptions`,void 0),c=k(`markstreamCustomMarkdownIt`,void 0),l=k(`markstreamNestedRendererProps`,void 0),u=E(()=>r?.value??`safe`),d=E(()=>t.parseOptions??s?.value),p=E(()=>t.customMarkdownIt??c?.value),m=E(()=>t.customHtmlTags??l?.value?.customHtmlTags),h=E(()=>{let e=l?.value??{};return Q(Z({},e),{customId:t.customId??e.customId,customHtmlTags:m.value,parseOptions:d.value,customMarkdownIt:p.value,htmlPolicy:u.value})});function g(e){return e.type===`text`&&String(e.content??``).trim()===``}let _=E(()=>t.node.children.filter(e=>!g(e))),v=E(()=>_.value.length>0&&_.value.every(e=>e.type===`image`||function(e){let t=function(e){return e.type===`link`&&Array.isArray(e.children)?e.children.filter(e=>!g(e)):[]}(e);return t.length===1&&t[0]?.type===`image`}(e))),x=E(()=>new Set(yf(m.value))),S=E(()=>{if(!v.value||_.value.length<=1)return t.node.children;let e=[];for(let n=0;n<t.node.children.length;n++){let r=t.node.children[n];if(!g(r)){e.push(r);continue}let i=e.length>0,a=t.node.children.slice(n+1).some(e=>!g(e));i&&a&&e.push(Q(Z({},r),{content:` `,raw:` `}))}return e}),T=E(()=>!1===i?.value&&!n.value.text),D=E(()=>T.value?Bt(S.value):null);function A(e,n){return Z({node:e,"index-key":`${t.indexKey}-${n}`,"custom-id":t.customId,"custom-html-tags":m.value},e.type===`reference`?{"data-markstream-reference-id":String(e.id)}:{})}function j(e){let t=e,r=String(t.type);if(n.value[r])return null;let i=function(e){if(!Array.isArray(e))return``;let t=[];for(let n of e){if(!n||typeof n!=`object`)return null;let e=j(n);if(e==null)return null;t.push(e)}return t.join(``)}(t.children);if(i==null)return null;let a=[r,t.loading,i];switch(r){case`text`:return[...a,t.content,t.center].join(``);case`inline_code`:return[...a,t.code].join(``);case`image`:return[...a,t.src,t.alt,t.title].join(``);case`link`:return[...a,t.href,t.title,t.text,JSON.stringify(t.attrs??null)].join(``);case`html_inline`:case`html_block`:return[...a,t.tag,t.content,t.autoClosed,JSON.stringify(t.attrs??null)].join(``);case`emoji`:return[...a,t.name,t.markup].join(``);case`checkbox`:case`checkbox_input`:return[...a,t.checked].join(``);case`math_inline`:return[...a,t.content,t.markup].join(``);case`reference`:case`footnote_anchor`:case`footnote_reference`:return[...a,t.id].join(``);case`hardbreak`:case`emphasis`:case`strong`:case`strikethrough`:case`highlight`:case`insert`:case`subscript`:case`superscript`:return a.join(``);default:return null}}let M=new Map,N=E(()=>Z({inline_code:eD,image:zD,link:wO,hardbreak:MO,emphasis:AO,strong:_O,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,superscript:pO,html_inline:YE,html_block:ak,emoji:jE,checkbox:kE,math_inline:cO,checkbox_input:kE,reference:dO,footnote_anchor:UO,footnote_reference:IE,text:rO},n.value)),P=E(()=>{let e=S.value;if(M.size>e.length)for(let t of M.keys())t>=e.length&&M.delete(t);return e.map((e,r)=>{let i=j(e),a=M.get(r),o=i!=null&&a?.sig===i?a.child:e;i==null?M.delete(r):M.set(r,{child:o,sig:i});let s=function(e){if(e.type===`html_block`||e.type===`html_inline`){let t=String(e.tag??``).trim().toLowerCase()||Sf(e.content);if(t&&!x.value.has(t)&&wf(e.content??e.raw,t)){let t=String(e.content??e.raw??``);return{child:{type:`text`,content:t,raw:t},component:rO,isCustomComponent:!1}}}return{child:e,component:N.value[e.type],isCustomComponent:!(!n.value[e.type]||xE(String(e.type)))}}(o);return Q(Z({},s),{index:r,key:`${t.indexKey||`paragraph`}-${r}`,customAttrs:s.isCustomComponent?UE(s.child,u.value):void 0,hasSlotChildren:Array.isArray(s.child.children)&&s.child.children.length>0,slotContent:String(s.child.content??``),originalChild:o})})});return(e,n)=>(B(),z(`p`,ok,[D.value===null?(B(!0),z(w,{key:1},o(P.value,e=>{return B(),z(w,{key:e.key},[v.value&&g(e.originalChild)?(B(),z(w,{key:0},[f(C((n=e.originalChild,String((r=n.content)??``))),1)],64)):e.isCustomComponent?(B(),b(a(e.component),O({key:1,ref_for:!0},e.customAttrs,{node:e.child,loading:e.child.loading,"index-key":e.key,"custom-id":t.customId,"custom-html-tags":m.value,"is-dark":h.value.isDark}),{default:y(()=>[e.hasSlotChildren?(B(),b(F(BD),O({key:0,ref_for:!0},h.value,{nodes:e.child.children,"index-key":e.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):e.slotContent?(B(),b(F(BD),O({key:1,ref_for:!0},h.value,{content:e.slotContent,final:!e.child.loading,"index-key":`${e.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:2},1040,[`node`,`loading`,`index-key`,`custom-id`,`custom-html-tags`,`is-dark`])):(B(),b(a(e.component),O({key:2,ref_for:!0},A(e.child,e.index)),null,16))],64);var n,r}),128)):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":t.customId},C(D.value),9,sk))]))}}),[[`__scopeId`,`data-v-c4381289`]]);ck.install=e=>{e.component(ck.__name,ck)};var lk={class:`table-node-wrapper`},uk=[`aria-busy`],dk={key:0},fk=[`custom-id`],pk=[`aria-label`,`onPointerdown`],mk=[`custom-id`],hk={key:0,class:`table-node__loading`,role:`status`,"aria-live":`polite`},gk=$(p({__name:`TableNode`,props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:[`copy`],setup(e){let r=e,i=E(()=>{var e;return(e=r.node.loading)!=null&&e}),a=E(()=>r.node.rows??[]),s=D(null),c=D([]),l=null,d=E(()=>r.node.header.cells.length),f=E(()=>c.value.some(e=>Number.isFinite(e)&&e>0)),p=E(()=>f.value?c.value.map(e=>e>0?{width:`${e}px`}:void 0):[]);t(`markstreamShowTooltips`,E(()=>r.showTooltips)),t(`markstreamFade`,E(()=>r.fade));let h=TE(()=>r.customId),g=E(()=>!!h.value.text),_=E(()=>!!h.value.paragraph),x=new WeakMap;function O(e){let t=!1===r.fade&&!g.value,n=!_.value,i=x.get(e);if(i?.children===e.children&&i.textFastPath===t&&i.paragraphFastPath===n)return i.info;let a=zt(e.children,n,!0),o={simpleChildren:a,plainText:a&&t?Bt(a):null};return x.set(e,{children:e.children,textFastPath:t,paragraphFastPath:n,info:o}),o}function k(e){if(!l)return;e.preventDefault();let t=l.startWidth+l.nextStartWidth,n=Math.min(48,Math.floor(t/2)),r=Math.max(n,Math.min(t-n,Math.round(l.startWidth+e.clientX-l.startX))),i=[...l.widths];i[l.index]=r,i[l.index+1]=t-r,c.value=i}function A(){l&&=(window.removeEventListener(`pointermove`,k),window.removeEventListener(`pointerup`,A),window.removeEventListener(`pointercancel`,A),null)}return v(d,()=>{A(),c.value=[]}),u(A),(t,u)=>(B(),z(`div`,lk,[T(`table`,{ref_key:`tableRef`,ref:s,class:S([`table-node`,{"table-node--loading":i.value}]),"aria-busy":i.value},[f.value?(B(),z(`colgroup`,dk,[(B(!0),z(w,null,o(e.node.header.cells,(e,t)=>(B(),z(`col`,{key:t,style:I(p.value[t])},null,4))),128))])):L(``,!0),T(`thead`,null,[T(`tr`,null,[(B(!0),z(w,null,o(e.node.header.cells,(n,i)=>(B(),z(`th`,{key:i,dir:`auto`,class:S([n.align===`right`?`text-right`:n.align===`center`?`text-center`:`text-left`])},[O(n).plainText===null?O(n).simpleChildren?(B(),b(F(NO),{key:1,nodes:O(n).simpleChildren,"custom-id":r.customId,"index-key":`table-th-${r.indexKey}-${i}`},null,8,[`nodes`,`custom-id`,`index-key`])):(B(),b(F(uj),{key:2,nodes:n.children,"index-key":`table-th-${r.indexKey}`,"custom-id":r.customId,typewriter:r.typewriter,fade:r.fade,"show-tooltips":r.showTooltips,onCopy:u[0]||=e=>t.$emit(`copy`,e)},null,8,[`nodes`,`index-key`,`custom-id`,`typewriter`,`fade`,`show-tooltips`])):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":r.customId},C(O(n).plainText),9,fk)),i<e.node.header.cells.length-1?(B(),z(`button`,{key:3,type:`button`,class:`table-node__resize-handle`,"aria-label":`Resize columns ${i+1} and ${i+2}`,onPointerdown:e=>function(e,t){if(t.button!==0)return;let n=function(){let e=s.value?.querySelectorAll(`thead th`);return Array.from(e??[],e=>Math.round(e.getBoundingClientRect().width))}(),r=n[e],i=n[e+1];r&&i&&(t.preventDefault(),l={index:e,startX:t.clientX,startWidth:r,nextStartWidth:i,widths:n},c.value=n,window.addEventListener(`pointermove`,k),window.addEventListener(`pointerup`,A),window.addEventListener(`pointercancel`,A))}(i,e)},null,40,pk)):L(``,!0)],2))),128))])]),T(`tbody`,null,[(B(!0),z(w,null,o(a.value,(e,n)=>(B(),z(`tr`,{key:n},[(B(!0),z(w,null,o(e.cells,(e,i)=>(B(),z(`td`,{key:i,class:S([e.align===`right`?`text-right`:e.align===`center`?`text-center`:`text-left`]),dir:`auto`},[O(e).plainText===null?O(e).simpleChildren?(B(),b(F(NO),{key:1,nodes:O(e).simpleChildren,"custom-id":r.customId,"index-key":`table-td-${r.indexKey}-${n}-${i}`},null,8,[`nodes`,`custom-id`,`index-key`])):(B(),b(F(uj),{key:2,nodes:e.children,"index-key":`table-td-${r.indexKey}`,"custom-id":r.customId,typewriter:r.typewriter,fade:r.fade,"show-tooltips":r.showTooltips,onCopy:u[1]||=e=>t.$emit(`copy`,e)},null,8,[`nodes`,`index-key`,`custom-id`,`typewriter`,`fade`,`show-tooltips`])):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":r.customId},C(O(e).plainText),9,mk))],2))),128))]))),128))])],10,uk),n(M,{name:`table-node-fade`},{default:y(()=>[i.value?(B(),z(`div`,hk,[m(t.$slots,`loading`,{isLoading:i.value},()=>[u[2]||=T(`span`,{class:`table-node__spinner animate-spin`,"aria-hidden":`true`},null,-1),u[3]||=T(`span`,{class:`sr-only`},`Loading`,-1)],!0)])):L(``,!0)]),_:3})]))}}),[[`__scopeId`,`data-v-6704fa51`]]);gk.install=e=>{e.component(gk.__name,gk)};var _k={class:`hr-node`},vk=$({},[[`render`,function(e,t){return B(),z(`hr`,_k)}],[`__scopeId`,`data-v-b0d616f1`]]);vk.install=e=>{e.component(vk.__name,vk)};var yk={class:`unknown-node`},bk=p({__name:`FallbackComponent`,props:{node:{}},setup:e=>(t,n)=>(B(),z(`div`,yk,C(e.node.raw),1))}),xk=$(p({__name:`VmrContainerNode`,props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){let t=e,n=E(()=>`vmr-container vmr-container-${t.node.name}`),r=TE(()=>t.customId),i=E(()=>Z({text:rO,paragraph:ck,heading:YO,inline_code:eD,link:wO,image:zD,strong:_O,emphasis:AO,strikethrough:yO,insert:EO,subscript:hO,superscript:pO,checkbox:kE,checkbox_input:kE,hardbreak:MO,math_inline:cO,reference:dO,list:tk,math_block:lO,table:gk},r.value));return(r,s)=>(B(),z(`div`,O({class:n.value},e.node.attrs),[(B(!0),z(w,null,o(e.node.children,(n,r)=>{return B(),b(a((o=n.type,i.value[o]||bk)),{key:`${e.indexKey||`vmr-container`}-${r}`,"custom-id":t.customId,node:n,"index-key":`${e.indexKey||`vmr-container`}-${r}`,typewriter:t.typewriter,fade:t.fade,"data-markstream-reference-id":n.type===`reference`?String(n.id):void 0},null,8,[`custom-id`,`node`,`index-key`,`typewriter`,`fade`,`data-markstream-reference-id`]);var o}),128))],16))}}),[[`__scopeId`,`data-v-e38ca2a3`]]);xk.install=e=>{e.component(xk.__name,xk)};var Sk=`__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__`,Ck=[`diff `,`index `,`--- `,`+++ `,`@@ `],wk=(()=>{let e=globalThis;if(e[Sk])return e[Sk];let t={configs:{},controllers:{},revision:x(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Sk]=t,t})(),Tk=null,Ek=null,Dk=null;function Ok(){return Ek||typeof window>`u`?null:(Dk||=V(()=>import(`./layout-BA_bUv_G.js`).then(e=>(Ek=e,wk.revision.value++,e)),[]).catch(()=>null),Dk.then(()=>{}))}var kk=wk.revision;function Ak(e){var t;return e&&(t=wk.configs[e])!=null?t:null}function jk(e,t){let n=Number.parseFloat(String(e??``));return Number.isFinite(n)&&n>0?n:t}function Mk(e){return e?.type===`text`||e?.type===`emoji`||e?.type===`hardbreak`}function Nk(e){if(!Array.isArray(e)||e.length===0)return null;let t=``;for(let n of e){if(!Mk(n))return null;n.type===`text`?t+=String(n.content??``):n.type===`emoji`?t+=String(n.name??n.raw??``):n.type===`hardbreak`&&(t+=`
|
|
190
|
+
`&&e++);return r}let F=E(()=>x.value?gt({code:t.node?.code,hideUnchangedRegions:t.diffHideUnchangedRegions,inline:N.value,language:t.node?.language,loading:c.value,matchCache:r,originalCode:t.node?.originalCode,raw:t.node?.raw,updatedCode:t.node?.updatedCode}):[]),ne=E(()=>{let e=F.value,t=1,n=!1;for(let r of e)for(let e of r.lines)e.kind===`collapsed`&&(n=!0),typeof e.number==`number`&&e.number>t&&(t=e.number);return{maxNumberedLine:t,hasCollapsed:n}}),R=E(()=>{if(!0!==t.showLineNumbers)return;let e=x.value?1:p.value;x.value&&(e=Math.max(e,te(t.node?.originalCode,c.value),te(t.node?.updatedCode,c.value),ne.value.maxNumberedLine));let n=`${Math.max(2,String(e).length)}ch`;return{"--markstream-pre-line-number-width":n,"--markstream-pre-diff-line-number-width":n,"--markstream-code-padding-left":`calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))`}}),V=E(()=>x.value&&ne.value.hasCollapsed),re=E(()=>{let e=a.value;return e?`Code block: ${e}`:`Code block`}),ie=D(null),ae=D([]),oe=null,se=!1,ce=null;function le(){!se&&typeof window<`u`&&x.value&&!N.value&&k.value&&oe==null&&(oe=window.requestAnimationFrame(()=>{!se&&ie.value&&(ae.value=K(ie.value,ae.value)),oe=null}))}function ue(e){ce?.disconnect(),ce=null,e&&x.value&&!N.value&&k.value&&typeof ResizeObserver<`u`&&(ce=new ResizeObserver(()=>{le()}),ce.observe(e))}function de(e,t){if(!k.value)return;let n=ae.value[e];if(!n)return;let r=t===`original`?n.originalHeight:n.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(n.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(r)}px`}}return v(ie,e=>{ue(e),le()},{flush:`post`}),v([x,N,F,k],()=>{ue(ie.value),x.value&&!N.value&&k.value?le():ae.value.length&&(ae.value=[])},{flush:`post`,immediate:!0}),u(()=>{se=!0,oe!=null&&(window.cancelAnimationFrame(oe),oe=null),ce?.disconnect(),ce=null}),(e,n)=>{return B(),z(`pre`,{ref_key:`preRef`,ref:ie,style:I([P.value,R.value]),class:S([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":x.value,"markstream-pre--diff-inline":N.value,"markstream-pre--diff-collapsed":V.value}]),"aria-busy":c.value,"aria-label":re.value,"data-language":a.value,"data-markstream-line-numbers":t.showLineNumbers?`1`:void 0,"data-markstream-pre":`1`,tabindex:`0`},[x.value?(B(),z(`code`,WD,[(B(!0),z(w,null,o(F.value,e=>(B(),z(`span`,{key:e.key,class:S([`markstream-pre__diff-pane`,e.className])},[T(`span`,GD,[(B(!0),z(w,null,o(e.lines,(t,r)=>(B(),z(`span`,{key:t.key,class:S([`markstream-pre__diff-line`,[`markstream-pre__diff-line--${t.kind}`,t.metadataKind?`markstream-pre__diff-line--metadata-${t.metadataKind}`:``,{"markstream-pre__diff-line--empty":t.empty,"markstream-pre__diff-line--collapsed-first":!0===t.collapsedFirst,"markstream-pre__diff-line--collapsed-last":!0===t.collapsedLast}]]),style:I(de(r,e.key))},[n[1]||=T(`span`,{class:`markstream-pre__diff-rail`,"aria-hidden":`true`},null,-1),t.kind===`collapsed`?(B(),z(`span`,KD,[...n[0]||=[T(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`},[T(`path`,{d:`M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06`})],-1)]])):L(``,!0),T(`span`,qD,C(t.number),1),T(`span`,JD,[T(`span`,YD,C(t.code),1)])],6))),128))])],2))),128))])):(B(),z(w,{key:1},[!0===t.showLineNumbers&&!0!==(r=t.node)?.diff&&O.value?(B(),z(`code`,XD,[(B(!0),z(w,null,o(b.value,(e,t)=>(B(),z(`span`,{key:t,class:`markstream-pre__logical-line`,"data-line-number":t+1,textContent:C(e)},null,8,ZD))),128))])):(B(),z(w,{key:1},[t.showLineNumbers?(B(),z(`span`,QD,[T(`span`,{class:`markstream-pre__line-numbers-text`,textContent:C(M.value)},null,8,$D)])):L(``,!0),T(`code`,{translate:`no`,class:`markstream-pre__code`,textContent:C(l.value)},null,8,eO)],64))],64))],14,UD);var r}}});tO.install=e=>{e.component(tO.__name,tO)};var nO=[`onAnimationend`],rO=$(p({__name:`TextNode`,props:{node:{}},emits:[`copy`],setup(e){let t=e,n=ee(),r=k(`markstreamFade`,void 0),i=k(`markstreamTextFinal`,void 0),a=E(()=>!0===i?.value),s=k(`markstreamFinalCleanup`,void 0),c=!0,l=k(`markstreamTextStreamState`,void 0),u=E(()=>{let e=n.fade;return e===``||!0===e||e===`true`||!1!==e&&e!==`false`&&void 0}),p=E(()=>typeof u.value==`boolean`?u.value:typeof r?.value!=`boolean`||r.value),m=E(()=>{let e=n[`index-key`]??n.indexKey;return e==null||e===``?``:String(e)}),{settledContent:h,segments:g,update:_,finish:y,queueFinish:b,finishAll:x,settleFinished:O}=XE(t.node.content),j=D(null),M=D(null),P=D([]),te=D(``),ne,I=``,L=null,R=null,V=!1;function re(e){let t=document.getSelection?.call(document);if(!t||t.rangeCount===0)return!1;let{anchorNode:n,focusNode:r}=t;return n!=null&&e.contains(n)||r!=null&&e.contains(r)}function ie(){if(!P.value.length)return!1;let e=document.getSelection?.call(document);if(!e||e.isCollapsed)return!1;for(let t=0;t<e.rangeCount;t++){let n=e.getRangeAt(t);if(P.value.some(e=>n.intersectsNode(e)))return!0}return!1}function ae(){let e=ie();return e&&(V=!0,le()),e}function oe(e){let t=m.value;_(e,t?l?.get(t):void 0,p.value&&!a.value),t&&l?.set(t,e)}v([h,j,M],function(){let e=j.value;if(!e)return;let t=String(h.value??``),n=M.value;if(L||(L=e.firstChild,I=L?.data??``),!t.startsWith(I))return e.textContent=t,L=e.firstChild,n&&(n.textContent=``),void(I=t);if(!L&&t)return e.textContent=t,L=e.firstChild,void(I=t);if(t.length>I.length&&n){let e=t.slice(I.length),r=n.lastChild;a.value&&r?.nodeType===3&&!re(n)?r.appendData(e):n.appendChild(document.createTextNode(e)),I=t,function(e){if(a.value||e.childNodes.length<=4||re(e))return;let t=``;for(let n=0;n<e.childNodes.length;n++)t+=e.childNodes[n]?.textContent??``;e.textContent=t}(n)}},{immediate:!0}),v([()=>t.node.content,m,p,()=>g.value.length>0&&a.value],([e])=>{let t=String(e??``);if(a.value&&s&&g.value.length&&t===h.value+g.value.map(e=>e.content).join(``)){let e=g.value.find(e=>!e.finished);e&&(x(!0),s(()=>{var t;c&&(t=e.id,y(t,ae()))}))}else{if(ie()){let e=a.value?h.value+g.value.map(e=>e.content).join(``):``;if(!a.value||t.startsWith(e))return R=t,te.value=a.value?t.slice(e.length):``,void le()}te.value=``,R=null,V=!1,oe(t)}},{immediate:!0});let se=D(h.value);function ce(){if(!ie()){if(ue(),R!=null){let e=R;R=null,te.value=``,V=!1,oe(e),O()}else V&&(V=!1,O())}}function le(){ne||(ne=document,ne.addEventListener(`selectionchange`,ce))}function ue(){ne?.removeEventListener(`selectionchange`,ce),ne=void 0}return N(()=>{c=!1,ue()}),(t,n)=>(B(),z(`span`,{class:S([[e.node.center?`text-node-center`:``],`text-node`])},[d(T(`span`,{ref_key:`settledTextEl`,ref:j},C(se.value),513),[[A,F(h)!==``]]),d(T(`span`,{ref_key:`settledAppendsEl`,ref:M},null,512),[[A,F(h)!==``]]),(B(!0),z(w,null,o(F(g),e=>(B(),z(`span`,{key:e.id,ref_for:!0,ref_key:`streamedDeltaEls`,ref:P,class:S(a.value||e.finished?`text-node-stream-final`:`text-node-stream-delta`),onAnimationend:t=>F(b)(e.id,ae)},C(e.content),43,nO))),128)),f(C(te.value),1)],2))}}),[[`__scopeId`,`data-v-e05f584c`]]);function iO(e,t,n){return p({name:e,inheritAttrs:!1,setup(e,{attrs:r,slots:a}){let o=MD(),s=kD(),c=AD(),d=typeof window<`u`&&i()?.vnode.el?.nodeType===1,f=D(typeof window>`u`||d||!c.value),p=x(null),m=null;function h(e){let t=e&&`$el`in e?e.$el:e;p.value=t instanceof HTMLElement?t:null}return typeof window<`u`&&v([p,c],([e,t],n,r)=>{if(m?.destroy(),m=null,!t||f.value)return void(f.value=!0);if(!e)return;let i=!0,a=o(e,{rootMargin:s?.value.heavyBlockMargin,allowIdle:!1});m=a,f.value=a.isVisible.value,a.whenVisible.then(()=>{i&&m===a&&(f.value=!0)}),r(()=>{i=!1,a.destroy(),m===a&&(m=null)})},{immediate:!0}),u(()=>{m?.destroy(),m=null}),()=>l(f.value?t:n,Q(Z({},r),{ref:h}),a)}})}rO.install=e=>{e.component(rO.__name,rO)};var aO=p({name:`CodeBlockNodeLoadingShell`,inheritAttrs:!1,props:`node.isDark.loading.stream.codeBlockOptions.showLineNumbers.theme.darkTheme.lightTheme.isShowPreview.showHeader.showCopyButton.showExpandButton.showPreviewButton.showCollapseButton.showFontSizeButtons.enableFontSizeControl.minWidth.maxWidth.themes.showTooltips.htmlPreviewAllowScripts.htmlPreviewSandbox.customId.indexKey.estimatedHeightPx.estimatedContentHeightPx.estimatedDiffInline.diffInline.diffHideUnchangedRegions.reservedHeightPx`.split(`.`),emits:[`click`,`mouseover`,`mouseout`,`copy`,`previewCode`,`handleArtifactClick`],setup(e,{attrs:t}){let n=e,r=ze();return()=>{let e=n.codeBlockOptions??{},i=At(e),a=Tt({darkTheme:n.darkTheme,isDark:n.isDark,lightTheme:n.lightTheme,theme:n.theme,themes:n.themes}),o=Rw(String(n.node?.language??``)),s=xe(n.node),c=Ce(String(n.node?.raw??``),Vw[o]||(o===`typescript`?`TypeScript`:o?o.charAt(0).toUpperCase()+o.slice(1):Vw[``]),s),u=s?gt({originalCode:n.node?.originalCode,updatedCode:n.node?.updatedCode,loading:!0,matchCache:r}).flatMap(e=>e.lines):[],d=s?{removed:u.filter(e=>e.kind===`removed`).length,added:u.filter(e=>e.kind===`added`).length}:null,f=Number(n.estimatedContentHeightPx??n.reservedHeightPx),p=!s&&Number.isFinite(f)&&f>0?Math.min(i.maxHeight,Math.ceil(f)):void 0,m=e=>l(`button`,{class:`code-action-btn code-loading-action code-loading-action--${e} inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0`,"aria-hidden":`true`,disabled:!0,tabindex:-1,type:`button`}),h=!1!==n.showExpandButton||!1!==n.showPreviewButton&&!1!==n.isShowPreview&&(o===`html`||o===`svg`)||!1!==n.showFontSizeButtons&&!1!==n.enableFontSizeControl,g=e=>e==null?void 0:typeof e==`number`?`${e}px`:String(e),_={"--code-bg":a.background,"--code-fg":a.foreground,"--code-line-number":a.lineNumber,"--markstream-code-fallback-bg":a.background,"--markstream-code-fallback-fg":a.foreground,"--markstream-diff-added-line-fill":a.diffAddedLine,"--markstream-diff-added-number-fill":a.diffAddedNumber,"--markstream-diff-editor-bg":a.background,"--markstream-diff-metadata-bg":a.background,"--markstream-diff-metadata-fg":a.lineNumber,"--markstream-diff-removed-line-fill":a.diffRemovedLine,"--markstream-diff-removed-number-fill":a.diffRemovedNumber,"--markstream-diff-shell-bg":a.background,"--markstream-pre-resolved-theme-bg":a.background,"--markstream-pre-resolved-theme-fg":a.foreground,"--markstream-pre-resolved-theme-line-number":a.lineNumber};return l(`div`,Q(Z({},t),{class:[`code-block-container rounded-lg border`,{dark:!0===n.isDark,"is-dark":a.dark,"is-rendering":!1!==n.loading,"is-diff":s},t.class],style:[Z(Q(Z({},_),{backgroundColor:a.background,color:a.foreground,minWidth:g(n.minWidth),maxWidth:g(n.maxWidth)}),s?{}:{borderColor:`var(--markstream-code-border-color, var(--code-border))`}),t.style],"data-markstream-code-block":`1`,"data-markstream-enhanced":`false`,"data-markstream-code-block-state":n.loading?`streaming`:`settled`,"data-markstream-code-loading":`1`}),[!1===n.showHeader?null:l(`div`,{class:`code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]`},[l(`div`,{class:`code-header-main`},[l(`span`,{class:`icon-slot h-4 w-4 flex-shrink-0`,"aria-hidden":`true`,innerHTML:Bw(o)}),l(`div`,{class:`code-header-copy`},[l(`div`,{class:`code-header-title`},c.title),c.caption?l(`div`,{class:`code-header-caption`},c.caption):null])]),l(`div`,{class:`flex items-center gap-0.5`},[d?l(`div`,{class:`code-diff-stats`,"aria-label":`-${d.removed} +${d.added}`},[l(`span`,{class:`code-diff-stat removed`},`-${d.removed}`),l(`span`,{class:`code-diff-stat added`},`+${d.added}`)]):null,!1===n.showCopyButton?null:m(`copy`),!1===n.showCollapseButton?null:m(`collapse`),h?l(`div`,{class:`relative flex`},[m(`more`)]):null])]),l(`div`,{class:`code-block-shell-content`,style:!1!==n.stream||!1===n.loading?void 0:{display:`none`}},[l(tO,{node:n.node,loading:n.loading,showLineNumbers:n.showLineNumbers??!0!==e.disableLineNumbers,diffInline:s&&!!(n.diffInline??n.estimatedDiffInline??e.diffStyle===`unified`),diffHideUnchangedRegions:s?n.diffHideUnchangedRegions??ve(e):void 0,reservedHeightPx:p,class:[`code-pre-fallback`,{"is-wrap":i.overflow===`wrap`}],style:Q(Z({},_),{"--markstream-code-padding-x":`${i.padding}px`,"--markstream-code-padding-y":`${i.padding}px`,"--markstream-code-tab-size":i.tabSize,"--markstream-pre-diff-line-height":`${i.lineHeight}px`,backgroundColor:a.background,color:a.foreground,fontFamily:i.fontFamily,fontSize:`${i.fontSize}px`,lineHeight:`${i.lineHeight}px`,maxHeight:`${p??i.maxHeight}px`,overflow:`auto`,paddingTop:`${i.padding}px`,paddingBottom:`${i.paddingBottom}px`,tabSize:i.tabSize,whiteSpace:i.overflow===`wrap`?`pre-wrap`:`pre`,overflowWrap:i.overflow===`wrap`?`anywhere`:`normal`}),"data-markstream-code-loading":`1`})]),l(`div`,{class:`code-loading-placeholder`,style:!1===n.stream&&!1!==n.loading?void 0:{display:`none`}},[l(`div`,{class:`loading-skeleton`},[l(`div`,{class:`skeleton-line`}),l(`div`,{class:`skeleton-line`}),l(`div`,{class:`skeleton-line short`})])])])}}}),oO=R({loader:()=>V(()=>import(`./PreCodeBlock-CTyy9U9T.js`),__vite__mapDeps([5,6,0,1])),loadingComponent:aO,delay:0,suspensible:!0}),sO=iO(`ViewportDeferredCodeBlockNode`,R({loader:()=>mE(null,null,function*(){try{return(yield V(()=>import(`./CodeBlockNode-CCsuwj3e.js`),__vite__mapDeps([7,0,1,6,8,3,4]))).default}catch(e){return console.warn(`[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer.`,e),tO}}),loadingComponent:aO,delay:0,suspensible:!1}),aO),cO=R(()=>mE(null,null,function*(){if(function(){return Reflect.get(globalThis,`process`)?.env}()?.NODE_ENV===`test`&&typeof window<`u`)return e=>l(rO,Q(Z({},e),{node:{type:`text`,content:e.node.raw??`$${e.node.content??``}$`,raw:e.node.raw??`$${e.node.content??``}$`}}));try{return yield nT(),(yield V(()=>import(`./index6-BKvbo_v2.js`),__vite__mapDeps([9,0,1]))).default}catch(e){console.warn(`[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".`,e)}return e=>l(rO,Q(Z({},e),{node:{type:`text`,content:e.node.raw??`$${e.node.content??``}$`,raw:e.node.raw??`$${e.node.content??``}$`}}))})),lO=R(()=>mE(null,null,function*(){try{return yield nT(),(yield V(()=>import(`./index5-CQngjG8A.js`),__vite__mapDeps([10,0,1]))).default}catch(e){console.warn(`[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".`,e)}return e=>l(rO,Q(Z({},e),{node:{type:`text`,content:e.node.raw??`$$${e.node.content??``}$$`,raw:e.node.raw??`$$${e.node.content??``}$$`}}))})),uO=[`data-reference-id`,`data-markstream-reference-id`],dO=$(p({__name:`ReferenceNode`,props:{node:{},messageId:{},threadId:{}},emits:[`click`,`mouseEnter`,`mouseLeave`],setup:e=>(t,n)=>(B(),z(`span`,{class:`reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5`,role:`button`,tabindex:`0`,"data-reference-id":e.node.id,"data-markstream-reference-id":e.node.id,onClick:n[0]||=n=>t.$emit(`click`,n,e.node.id,e.messageId,e.threadId),onMouseenter:n[1]||=n=>t.$emit(`mouseEnter`,n,e.node.id,e.messageId,e.threadId),onMouseleave:n[2]||=n=>t.$emit(`mouseLeave`,n,e.node.id,e.messageId,e.threadId)},C(e.node.id),41,uO))}),[[`__scopeId`,`data-v-b96c91c3`]]);dO.install=e=>{e.component(dO.__name,dO)};var fO={class:`superscript-node`},pO=$(p({__name:`SuperscriptNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,emphasis:AO,footnote_reference:IE,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,emoji:jE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`sup`,fO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`superscript`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`superscript`}-${i}`,"fallback-to-text":``},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-24160b22`]]);pO.install=e=>{e.component(pO.__name,pO)};var mO={class:`subscript-node`},hO=$(p({__name:`SubscriptNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,emphasis:AO,footnote_reference:IE,strikethrough:yO,highlight:OO,insert:EO,superscript:pO,emoji:jE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`sub`,mO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`subscript`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`subscript`}-${i}`,"fallback-to-text":``},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-197fa13b`]]);hO.install=e=>{e.component(hO.__name,hO)};var gO={class:`strong-node`},_O=$(p({__name:`StrongNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,emphasis:AO,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,superscript:pO,emoji:jE,footnote_reference:IE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`strong`,gO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`strong`}-${i}`,components:r.value,node:n,"index-key":`${e.indexKey||`strong`}-${i}`,"custom-id":t.customId},null,8,[`components`,`node`,`index-key`,`custom-id`]))),128))]))}}),[[`__scopeId`,`data-v-a8647104`]]);_O.install=e=>{e.component(_O.__name,_O)};var vO={class:`strikethrough-node`},yO=$(p({__name:`StrikethroughNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,emphasis:AO,highlight:OO,insert:EO,subscript:hO,superscript:pO,emoji:jE,footnote_reference:IE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`del`,vO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`strikethrough`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`strikethrough`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-b7a531fa`]]);yO.install=e=>{e.component(yO.__name,yO)};var bO=[`href`,`title`,`aria-label`,`aria-hidden`,`target`,`rel`],xO=[`aria-hidden`],SO={class:`link-text-wrapper relative inline-flex`},CO={class:`leading-[normal] link-text`},wO=$(p({__name:`LinkNode`,props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){let t=e,r=k(`markstreamShowTooltips`,void 0),i=E(()=>{let e=r?.value;return typeof e==`boolean`?e:t.showTooltip}),a=E(()=>{let e=t.underlineBottom===void 0?`-3px`:typeof t.underlineBottom==`number`?`${t.underlineBottom}px`:String(t.underlineBottom),n=t.animationOpacity??.35,r=Math.max(.12,Math.min(.5*n,n)),i={"--underline-height":`${t.underlineHeight??2}px`,"--underline-bottom":e,"--underline-opacity":String(n),"--underline-rest-opacity":String(r),"--underline-duration":`${t.animationDuration??1.6}s`,"--underline-timing":t.animationTiming??`ease-in-out`,"--underline-iteration":typeof t.animationIteration==`number`?String(t.animationIteration):t.animationIteration??`infinite`};return t.color&&(i[`--link-color`]=t.color),i}),s=TE(()=>t.customId),c=E(()=>Z({text:rO,strong:_O,strikethrough:yO,emphasis:AO,image:zD,html_inline:YE,inline_code:eD,math_inline:cO},s.value)),l=ee(),d=E(()=>{let e=t.node?.attrs;if(!e||typeof e!=`object`)return{};let n={};if(Array.isArray(e))for(let t of e)Array.isArray(t)&&t[0]&&(n[String(t[0])]=String(t[1]??``));else for(let[t,r]of Object.entries(e))t&&r!=null&&!1!==r&&(n[t]=!0===r?``:String(r));return BE(n,`safe`,`a`)}),f=E(()=>Z(Z({},l),d.value)),p=E(()=>BE({href:String(t.node?.href??``)},`safe`,`a`).href),m=E(()=>{if(!p.value)return;let e=f.value.target;return(typeof e==`string`?e.trim():String(e??``).trim())||(of(p.value)?`_blank`:void 0)}),h=E(()=>String(m.value??``).trim().toLowerCase()===`_blank`),g=E(()=>{if(!p.value)return;let e=f.value.rel,t=new Set((typeof e==`string`?e:String(e??``)).split(/\s+/).filter(Boolean)),n=new Set(Array.from(t).filter(e=>e.toLowerCase()!==`opener`));return h.value&&(n.add(`noopener`),n.add(`noreferrer`)),n.size>0?Array.from(n).join(` `):void 0}),_=E(()=>{let e=Z({},f.value);return delete e.title,delete e.href,delete e.target,delete e.rel,e}),y;function x(){i.value&&_D()}u(()=>y?.()),v([()=>t.node.loading,i],([e,t])=>{!e&&t||y==null||y()});let S=E(()=>{let e=t.node?.title;return typeof e==`string`&&e.trim().length>0?e:String(p.value??``)});return(r,s)=>e.node.loading?(B(),z(`span`,O({key:1,class:`link-loading inline-flex items-baseline gap-1.5`,"aria-hidden":e.node.loading?`false`:`true`},F(l),{style:a.value}),[T(`span`,SO,[T(`span`,CO,[n(F(rO),{class:`leading-[normal] link-text`,node:{type:`text`,content:String(e.node.text??``),raw:String(e.node.text??``)},"index-key":`${e.indexKey||`link-text`}-loading`},null,8,[`node`,`index-key`])]),s[1]||=T(`span`,{class:`link-loading-indicator`,"aria-hidden":`true`},null,-1)])],16,xO)):(B(),z(`a`,O({key:0,class:`link-node`,href:p.value,title:i.value?``:S.value,"aria-label":`Link: ${S.value}`,"aria-hidden":e.node.loading?`true`:`false`,target:m.value,rel:g.value},_.value,{style:a.value,onMouseenter:s[0]||=e=>function(e){if(!i.value)return;let n=e,r=n?.clientX!=null&&n?.clientY!=null?{x:n.clientX,y:n.clientY}:void 0,a=t.node?.title||(p.value?.includes(`xn--`)&&(t.node?.text)?.includes(`://`)?t.node.text:p.value)||``;y=gD(e.currentTarget,a,`top`,!1,r)}(e),onMouseleave:x}),[(B(!0),z(w,null,o(e.node.children,(n,r)=>(B(),b(F(HD),{key:`${e.indexKey||`emphasis`}-${r}`,components:c.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`link-text`}-${r}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))],16,bO))}}),[[`__scopeId`,`data-v-388c6c51`]]);wO.install=e=>{e.component(wO.__name,wO)};var TO={class:`insert-node`},EO=$(p({__name:`InsertNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,emphasis:AO,strikethrough:yO,highlight:OO,subscript:hO,superscript:pO,emoji:jE,footnote_reference:IE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`ins`,TO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`insert`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`insert`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-1e2c29d4`]]);EO.install=e=>{e.component(EO.__name,EO)};var DO={class:`highlight-node`},OO=$(p({__name:`HighlightNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,emphasis:AO,strikethrough:yO,insert:EO,subscript:hO,superscript:pO,emoji:jE,footnote_reference:IE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`mark`,DO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`highlight`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`highlight`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-7a62982a`]]);OO.install=e=>{e.component(OO.__name,OO)};var kO={class:`emphasis-node`},AO=$(p({__name:`EmphasisNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=E(()=>Z({text:rO,inline_code:eD,link:wO,html_inline:YE,strong:_O,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,superscript:pO,emoji:jE,footnote_reference:IE,math_inline:cO,reference:dO},n.value));return(n,i)=>(B(),z(`em`,kO,[(B(!0),z(w,null,o(e.node.children,(n,i)=>(B(),b(F(HD),{key:`${e.indexKey||`emphasis`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`emphasis`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-2a5aafbf`]]);AO.install=e=>{e.component(AO.__name,AO)};var jO={class:`hard-break`},MO=$(p({__name:`HardBreakNode`,props:{node:{}},setup:e=>(e,t)=>(B(),z(`br`,jO))}),[[`__scopeId`,`data-v-50c58f70`]]);MO.install=e=>{e.component(MO.__name,MO)};var NO=p({__name:`SimpleInlineRenderer`,props:{nodes:{},customId:{},indexKey:{}},setup(e){let t=e,n=ne({checkbox:kE,checkbox_input:kE,emoji:jE,emphasis:AO,hardbreak:MO,highlight:OO,inline_code:eD,insert:EO,link:wO,reference:dO,strikethrough:yO,strong:_O,subscript:hO,superscript:pO,text:rO}),r=TE(()=>t.customId),i=E(()=>{let e=r.value;return Object.keys(e).length>0?Z(Z({},n),e):n});return(n,r)=>(B(!0),z(w,null,o(e.nodes,(n,r)=>(B(),b(F(HD),{key:r,components:i.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`inline`}-${r}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))}}),PO=[`cite`],FO={key:0,dir:`auto`,class:`paragraph-node`},IO=[`custom-id`],LO=$(p({__name:`BlockquoteNode`,props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:[`copy`],setup(e){let n=e,r=TE(()=>n.customId),i=E(()=>!!r.value.paragraph),a=E(()=>!!r.value.text),o=E(()=>zt(n.node.children,!i.value)),s=E(()=>!1!==n.fade||a.value?null:Bt(o.value));return t(`markstreamShowTooltips`,E(()=>n.showTooltips)),t(`markstreamFade`,E(()=>n.fade)),(t,r)=>(B(),z(`blockquote`,{class:`blockquote blockquote-node`,dir:`auto`,cite:e.node.cite},[o.value?(B(),z(`p`,FO,[s.value===null?(B(),b(F(NO),{key:1,nodes:o.value,"custom-id":n.customId,"index-key":`blockquote-${n.indexKey}-paragraph`},null,8,[`nodes`,`custom-id`,`index-key`])):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":n.customId},C(s.value),9,IO))])):(B(),b(F(uj),{key:1,"show-tooltips":n.showTooltips,"index-key":`blockquote-${n.indexKey}`,nodes:n.node.children||[],"custom-id":n.customId,typewriter:n.typewriter,fade:n.fade,onCopy:r[0]||=e=>t.$emit(`copy`,e)},null,8,[`show-tooltips`,`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`]))],8,PO))}}),[[`__scopeId`,`data-v-c7658eda`]]);LO.install=e=>{e.component(LO.__name,LO)};var RO={class:`definition-list`},zO={class:`definition-term`},BO={class:`definition-desc`},VO=$(p({__name:`DefinitionListNode`,props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:[`copy`],setup(e){let t=e;return(e,r)=>(B(),z(`dl`,RO,[(B(!0),z(w,null,o(t.node.items,(i,a)=>(B(),z(w,{key:a},[T(`dt`,zO,[n(F(uj),{"index-key":`definition-term-${t.indexKey}-${a}`,nodes:i.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:r[0]||=t=>e.$emit(`copy`,t)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])]),T(`dd`,BO,[n(F(uj),{"index-key":`definition-desc-${t.indexKey}-${a}`,nodes:i.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:r[1]||=t=>e.$emit(`copy`,t)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])])],64))),128))]))}}),[[`__scopeId`,`data-v-4e103b30`]]);VO.install=e=>{e.component(VO.__name,VO)};var HO=[`href`,`title`],UO=$(p({__name:`FootnoteAnchorNode`,props:{node:{}},setup(e){let t=e;function n(e){if(e.preventDefault(),typeof document>`u`)return;let n=NE(e.currentTarget,`fnref-${String(t.node.id??``)}`);n&&n.scrollIntoView({behavior:`smooth`,block:`center`})}return(t,r)=>(B(),z(`a`,{class:`footnote-anchor text-sm hover:underline cursor-pointer`,href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n},` ↩︎ `,8,HO))}}),[[`__scopeId`,`data-v-0dbaa45e`]]);UO.install=e=>{e.component(UO.__name,UO)};var WO=[`id`],GO={class:`flex-1`},KO=p({__name:`FootnoteNode`,props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:[`copy`],setup(e){let t=e;return(r,i)=>(B(),z(`div`,{id:`fnref--${e.node.id}`,class:`footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2`},[T(`div`,GO,[n(F(uj),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||=e=>r.$emit(`copy`,e)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])])],8,WO))}});KO.install=e=>{e.component(KO.__name,KO)};var qO=[`custom-id`],JO=$(p({__name:`HeadingNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=TE(()=>t.customId),r=k(`markstreamFade`,void 0),i=E(()=>!1!==r?.value||n.value.text?null:Bt(t.node.children)),s=E(()=>Z({text:rO,inline_code:eD,link:wO,image:zD,strong:_O,emphasis:AO,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,superscript:pO,emoji:jE,checkbox:kE,checkbox_input:kE,footnote_reference:IE,hardbreak:MO,math_inline:cO,reference:dO},n.value));return(n,r)=>(B(),b(a(`h${e.node.level}`),O({class:[`heading-node`,[`heading-${e.node.level}`]],dir:`auto`},e.node.attrs),{default:y(()=>[i.value===null?(B(!0),z(w,{key:1},o(e.node.children,(n,r)=>(B(),b(F(HD),{key:r,components:s.value,"custom-id":t.customId,node:n,"index-key":`${e.indexKey||`heading`}-${r}`},null,8,[`components`,`custom-id`,`node`,`index-key`]))),128)):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":t.customId},C(i.value),9,qO))]),_:1},16,[`class`]))}}),[[`__scopeId`,`data-v-2d6f45ba`]]),YO=JO;YO.install=e=>{e.component(JO.__name,JO)};var XO={key:0,dir:`auto`,class:`paragraph-node`},ZO=[`custom-id`],QO={dir:`auto`,class:`paragraph-node`},$O=[`custom-id`],ek=$(p({__name:`ListItemNode`,props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:[`copy`],setup(e){let n=e,r=E(()=>n.node??n.item),i=TE(()=>n.customId),a=E(()=>!!i.value.paragraph),s=E(()=>!!i.value.text),c=E(()=>zt(r.value?.children,!a.value)),l=E(()=>{if(a.value)return null;let e=r.value?.children;if(!Array.isArray(e)||e.length<2)return null;let t=e[0];if(t?.type!==`paragraph`||!Array.isArray(t.children))return null;let n=e.slice(1);if(!n.every(e=>e?.type===`list`))return null;let i=zt([t]);return i?{paragraphChildren:i,nestedLists:n}:null});function u(){return!1===n.fade&&!s.value}let d=E(()=>u()?Bt(c.value):null),f=E(()=>u()?Bt(l.value?.paragraphChildren):null),p=Object.freeze({}),m=E(()=>{let{value:e}=n;return typeof e==`number`&&Number.isFinite(e)?{value:e}:p});return t(`markstreamShowTooltips`,E(()=>n.showTooltips)),t(`markstreamFade`,E(()=>n.fade)),(e,t)=>(B(),z(`li`,O({class:`list-item`,dir:`auto`},m.value),[c.value?(B(),z(`p`,XO,[d.value===null?(B(),b(F(NO),{key:1,nodes:c.value,"custom-id":n.customId,"index-key":`list-item-${n.indexKey}-paragraph`},null,8,[`nodes`,`custom-id`,`index-key`])):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":n.customId},C(d.value),9,ZO))])):l.value?(B(),z(w,{key:1},[T(`p`,QO,[f.value===null?(B(),b(F(NO),{key:1,nodes:l.value.paragraphChildren,"custom-id":n.customId,"index-key":`list-item-${n.indexKey}-paragraph`},null,8,[`nodes`,`custom-id`,`index-key`])):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":n.customId},C(f.value),9,$O))]),(B(!0),z(w,null,o(l.value.nestedLists,(r,i)=>(B(),b(F(uj),{key:i,nodes:[r],"custom-id":n.customId,"index-key":`list-item-${n.indexKey}-nested-${i}`,"show-tooltips":n.showTooltips,typewriter:n.typewriter,fade:n.fade,"is-dark":n.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:t[0]||=t=>e.$emit(`copy`,t)},null,8,[`nodes`,`custom-id`,`index-key`,`show-tooltips`,`typewriter`,`fade`,`is-dark`]))),128))],64)):(B(),b(F(uj),{key:2,"show-tooltips":n.showTooltips,"index-key":`list-item-${n.indexKey}`,nodes:r.value?.children??[],"custom-id":n.customId,typewriter:n.typewriter,fade:n.fade,"is-dark":n.isDark,"batch-rendering":!1,onCopy:t[1]||=t=>e.$emit(`copy`,t)},null,8,[`show-tooltips`,`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`,`is-dark`]))],16))}}),[[`__scopeId`,`data-v-a2b8a81c`]]);ek.install=e=>{e.component(ek.__name,ek)};var tk=$(p({__name:`ListNode`,props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:[`copy`],setup(e){let t=TE(()=>e.customId),n=E(()=>t.value.list_item||ek);return(t,r)=>(B(),b(a(e.node.ordered?`ol`:`ul`),{class:S([`list-node`,{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:y(()=>[(B(!0),z(w,null,o(e.node.items,(i,o)=>(B(),b(a(n.value),O({key:`${e.indexKey||`list`}-${o}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||`list`}-${o}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?(e.node.start??1)+o:void 0,onCopy:r[0]||=e=>t.$emit(`copy`,e)}),null,16,[`node`,`custom-id`,`index-key`,`typewriter`,`fade`,`is-dark`,`value`]))),128))]),_:1},8,[`class`]))}}),[[`__scopeId`,`data-v-99cb95e0`]]);tk.install=e=>{e.component(tk.__name,tk)};var nk={key:2,class:`html-block-node__raw`},rk=[`innerHTML`],ik={key:1,class:`html-block-node__placeholder`},ak=$(p({__name:`HtmlBlockNode`,props:{node:{},customId:{},htmlPolicy:{}},setup(e){let t=e,n=k(`markstreamHtmlPolicy`,void 0),i=k(`markstreamNestedRendererProps`,void 0),o=E(()=>t.htmlPolicy??n?.value??`safe`),s=E(()=>{let e=i?.value??{};return Q(Z({},e),{customId:t.customId??e.customId,htmlPolicy:o.value})}),l=R({loader:()=>Promise.resolve().then(()=>dj),suspensible:!1}),d=E(()=>{let e=BC(t.node.attrs,o.value);if(!e)return;let n=zC(e);return Object.keys(n).length>0?n:void 0}),f=E(()=>{let e=String(t.node.tag||``).trim(),n=BC(t.node.attrs,o.value,e);if(!n)return;let r=zC(n);return Object.keys(r).length>0?r:void 0}),h=TE(()=>t.customId),g=p({name:`DynamicRenderer`,props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),_=D(null);function S(e,t,n,r){if(!0!==e)return!1;let i=String(t??``);if(!i)return!1;if(i!==String(n??``))return!0;let a=String(r??``).trim();return!!a&&!1===i.toLowerCase().includes(`</${a.toLowerCase()}`)}let A=D(S(t.node.loading,t.node.raw,t.node.content,t.node.tag)),M=D(typeof window>`u`||A.value),N=D(t.node.content),P=D(0),ee=D(String(t.node.raw??``)),te=E(()=>Array.isArray(t.node.children)?t.node.children:[]);v(()=>[t.node.loading,t.node.raw,t.node.content,t.node.tag],([e,t,n,r])=>{let i=String(t??``),a=!ee.value||i.startsWith(ee.value),o=S(e,t,n,r);a?o&&(A.value=!0):(A.value=o,P.value=0),o&&(M.value=!0),ee.value=i},{flush:`sync`});let ne=E(()=>String(t.node.tag||`div`)),I=E(()=>{if(ne.value.trim().toLowerCase()!==`details`||t.node.attrs?.some(([e])=>String(e).toLowerCase()===`open`))return null;let e=te.value[0];return e?.type===`html_block`&&String(e.tag||``).toLowerCase()===`summary`?e:null}),V=E(()=>Bt(I.value?.children)),re=E(()=>{let e=I.value;if(!e)return;let t=BC(e.attrs,o.value,`summary`);if(!t)return;let n=zC(t);return Object.keys(n).length>0?n:void 0}),ie=E(()=>V.value==null?te.value:te.value.slice(1)),ae=E(()=>{let e=ne.value.trim().toLowerCase();return Gd.has(e)||OC(e,o.value)}),oe=E(()=>te.value.length>0&&!!t.node.tag&&!ae.value),se=E(()=>{if(oe.value)return{mode:`structured`};if(!M.value)return{mode:`html`,content:N.value??``};let e=N.value??t.node.content;if(!e)return{mode:`html`,content:``};if(o.value===`escape`)return{mode:`html`,content:qC(e,o.value)};let n=A.value||!0===t.node.loading,r=qE(e,h.value,o.value,n);return r.ok&&(n||r.hasCustomComponents)?{mode:`dynamic`,nodes:r.nodes}:n?{mode:`text`,content:t.node.raw??e}:{mode:`html`,content:qC(e,o.value)}}),ce=MD(),le=kD(),ue=AD(),de=x(null),fe=!!t.node.loading,pe=null;return typeof window<`u`?(v([()=>_.value,()=>t.node.loading,A],([e,n,r],i,a)=>{if(pe?.disconnect(),pe=null,!e||!r||!1===n||typeof ResizeObserver>`u`)return;let o=new ResizeObserver(e=>{if(!A.value||!1===t.node.loading)return;let n=e[0],r=(Array.isArray(n?.borderBoxSize)?n.borderBoxSize[0]:n?.borderBoxSize)?.blockSize??n?.contentRect.height??0;r>P.value&&(P.value=r)});pe=o,o.observe(e),a(()=>o.disconnect())},{immediate:!0}),v(()=>t.node.loading,e=>mE(null,null,function*(){!1!==e||!A.value||P.value<=0||(yield c(),requestAnimationFrame(()=>{!1===t.node.loading&&(P.value=0)}))})),v([()=>_.value,()=>le?.value.heavyBlockMargin,()=>le?.value.rootMargin],([e],n,r)=>{var i,a;if((a=(i=de.value)?.destroy)==null||a.call(i),de.value=null,!fe)return M.value=!0,void(N.value=t.node.content);if(!e)return void(A.value||(M.value=!1));let o=!0,s=le?.value.heavyBlockMargin??le?.value.rootMargin??OD,c=ce(e,{rootMargin:s,allowIdle:!ue.value});de.value=c,M.value=M.value||c.isVisible.value,c.whenVisible.then(()=>{o&&de.value===c&&(M.value=!0)}),r(()=>{o=!1,c.destroy(),de.value===c&&(de.value=null)})},{immediate:!0}),v(()=>t.node.content,e=>{fe&&!M.value||(N.value=e)})):M.value=!0,u(()=>{var e,t;pe?.disconnect(),pe=null,(t=(e=de.value)?.destroy)==null||t.call(e),de.value=null}),(t,n)=>(B(),b(a(oe.value?ne.value:`div`),O({ref_key:`htmlRef`,ref:_,class:`html-block-node`,style:P.value>0?{boxSizing:`border-box`,minHeight:`${P.value}px`}:void 0,"data-markstream-viewport-pending":F(ue)&&!M.value?`true`:void 0},oe.value?f.value:void 0),{default:y(()=>[M.value?(B(),z(w,{key:0},[se.value.mode===`structured`?(B(),z(w,{key:0},[V.value===null?(B(),b(F(l),O({key:1},s.value,{nodes:te.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`])):(B(),z(w,{key:0},[T(`summary`,j(r(re.value)),C(V.value),17),ie.value.length?(B(),b(F(l),O({key:0},s.value,{nodes:ie.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`])):L(``,!0)],64))],64)):se.value.mode===`dynamic`?(B(),b(F(g),{key:1,nodes:se.value.nodes},null,8,[`nodes`])):se.value.mode===`text`?(B(),z(`pre`,nk,C(se.value.content),1)):(B(),z(`div`,O({key:3},d.value,{innerHTML:se.value.content}),null,16,rk))],64)):(B(),z(`div`,ik,[m(t.$slots,`placeholder`,{node:e.node},()=>[n[0]||=T(`span`,{class:`html-block-node__placeholder-bar`},null,-1),n[1]||=T(`span`,{class:`html-block-node__placeholder-bar w-4/5`},null,-1),n[2]||=T(`span`,{class:`html-block-node__placeholder-bar w-2/3`},null,-1)],!0)]))]),_:3},16,[`style`,`data-markstream-viewport-pending`]))}}),[[`__scopeId`,`data-v-b7034867`]]);ak.install=e=>{e.component(ak.__name,ak)};var ok={dir:`auto`,class:`paragraph-node`},sk=[`custom-id`],ck=$(p({__name:`ParagraphNode`,props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){let t=e,n=TE(()=>t.customId),r=k(`markstreamHtmlPolicy`,void 0),i=k(`markstreamFade`,void 0),s=k(`markstreamParseOptions`,void 0),c=k(`markstreamCustomMarkdownIt`,void 0),l=k(`markstreamNestedRendererProps`,void 0),u=E(()=>r?.value??`safe`),d=E(()=>t.parseOptions??s?.value),p=E(()=>t.customMarkdownIt??c?.value),m=E(()=>t.customHtmlTags??l?.value?.customHtmlTags),h=E(()=>{let e=l?.value??{};return Q(Z({},e),{customId:t.customId??e.customId,customHtmlTags:m.value,parseOptions:d.value,customMarkdownIt:p.value,htmlPolicy:u.value})});function g(e){return e.type===`text`&&String(e.content??``).trim()===``}let _=E(()=>t.node.children.filter(e=>!g(e))),v=E(()=>_.value.length>0&&_.value.every(e=>e.type===`image`||function(e){let t=function(e){return e.type===`link`&&Array.isArray(e.children)?e.children.filter(e=>!g(e)):[]}(e);return t.length===1&&t[0]?.type===`image`}(e))),x=E(()=>new Set(yf(m.value))),S=E(()=>{if(!v.value||_.value.length<=1)return t.node.children;let e=[];for(let n=0;n<t.node.children.length;n++){let r=t.node.children[n];if(!g(r)){e.push(r);continue}let i=e.length>0,a=t.node.children.slice(n+1).some(e=>!g(e));i&&a&&e.push(Q(Z({},r),{content:` `,raw:` `}))}return e}),T=E(()=>!1===i?.value&&!n.value.text),D=E(()=>T.value?Bt(S.value):null);function A(e,n){return Z({node:e,"index-key":`${t.indexKey}-${n}`,"custom-id":t.customId,"custom-html-tags":m.value},e.type===`reference`?{"data-markstream-reference-id":String(e.id)}:{})}function j(e){let t=e,r=String(t.type);if(n.value[r])return null;let i=function(e){if(!Array.isArray(e))return``;let t=[];for(let n of e){if(!n||typeof n!=`object`)return null;let e=j(n);if(e==null)return null;t.push(e)}return t.join(``)}(t.children);if(i==null)return null;let a=[r,t.loading,i];switch(r){case`text`:return[...a,t.content,t.center].join(``);case`inline_code`:return[...a,t.code].join(``);case`image`:return[...a,t.src,t.alt,t.title].join(``);case`link`:return[...a,t.href,t.title,t.text,JSON.stringify(t.attrs??null)].join(``);case`html_inline`:case`html_block`:return[...a,t.tag,t.content,t.autoClosed,JSON.stringify(t.attrs??null)].join(``);case`emoji`:return[...a,t.name,t.markup].join(``);case`checkbox`:case`checkbox_input`:return[...a,t.checked].join(``);case`math_inline`:return[...a,t.content,t.markup].join(``);case`reference`:case`footnote_anchor`:case`footnote_reference`:return[...a,t.id].join(``);case`hardbreak`:case`emphasis`:case`strong`:case`strikethrough`:case`highlight`:case`insert`:case`subscript`:case`superscript`:return a.join(``);default:return null}}let M=new Map,N=E(()=>Z({inline_code:eD,image:zD,link:wO,hardbreak:MO,emphasis:AO,strong:_O,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,superscript:pO,html_inline:YE,html_block:ak,emoji:jE,checkbox:kE,math_inline:cO,checkbox_input:kE,reference:dO,footnote_anchor:UO,footnote_reference:IE,text:rO},n.value)),P=E(()=>{let e=S.value;if(M.size>e.length)for(let t of M.keys())t>=e.length&&M.delete(t);return e.map((e,r)=>{let i=j(e),a=M.get(r),o=i!=null&&a?.sig===i?a.child:e;i==null?M.delete(r):M.set(r,{child:o,sig:i});let s=function(e){if(e.type===`html_block`||e.type===`html_inline`){let t=String(e.tag??``).trim().toLowerCase()||Sf(e.content);if(t&&!x.value.has(t)&&wf(e.content??e.raw,t)){let t=String(e.content??e.raw??``);return{child:{type:`text`,content:t,raw:t},component:rO,isCustomComponent:!1}}}return{child:e,component:N.value[e.type],isCustomComponent:!(!n.value[e.type]||xE(String(e.type)))}}(o);return Q(Z({},s),{index:r,key:`${t.indexKey||`paragraph`}-${r}`,customAttrs:s.isCustomComponent?UE(s.child,u.value):void 0,hasSlotChildren:Array.isArray(s.child.children)&&s.child.children.length>0,slotContent:String(s.child.content??``),originalChild:o})})});return(e,n)=>(B(),z(`p`,ok,[D.value===null?(B(!0),z(w,{key:1},o(P.value,e=>{return B(),z(w,{key:e.key},[v.value&&g(e.originalChild)?(B(),z(w,{key:0},[f(C((n=e.originalChild,String((r=n.content)??``))),1)],64)):e.isCustomComponent?(B(),b(a(e.component),O({key:1,ref_for:!0},e.customAttrs,{node:e.child,loading:e.child.loading,"index-key":e.key,"custom-id":t.customId,"custom-html-tags":m.value,"is-dark":h.value.isDark}),{default:y(()=>[e.hasSlotChildren?(B(),b(F(BD),O({key:0,ref_for:!0},h.value,{nodes:e.child.children,"index-key":e.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):e.slotContent?(B(),b(F(BD),O({key:1,ref_for:!0},h.value,{content:e.slotContent,final:!e.child.loading,"index-key":`${e.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:2},1040,[`node`,`loading`,`index-key`,`custom-id`,`custom-html-tags`,`is-dark`])):(B(),b(a(e.component),O({key:2,ref_for:!0},A(e.child,e.index)),null,16))],64);var n,r}),128)):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":t.customId},C(D.value),9,sk))]))}}),[[`__scopeId`,`data-v-c4381289`]]);ck.install=e=>{e.component(ck.__name,ck)};var lk={class:`table-node-wrapper`},uk=[`aria-busy`],dk={key:0},fk=[`custom-id`],pk=[`aria-label`,`onPointerdown`],mk=[`custom-id`],hk={key:0,class:`table-node__loading`,role:`status`,"aria-live":`polite`},gk=$(p({__name:`TableNode`,props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:[`copy`],setup(e){let r=e,i=E(()=>{var e;return(e=r.node.loading)!=null&&e}),a=E(()=>r.node.rows??[]),s=D(null),c=D([]),l=null,d=E(()=>r.node.header.cells.length),f=E(()=>c.value.some(e=>Number.isFinite(e)&&e>0)),p=E(()=>f.value?c.value.map(e=>e>0?{width:`${e}px`}:void 0):[]);t(`markstreamShowTooltips`,E(()=>r.showTooltips)),t(`markstreamFade`,E(()=>r.fade));let h=TE(()=>r.customId),g=E(()=>!!h.value.text),_=E(()=>!!h.value.paragraph),x=new WeakMap;function O(e){let t=!1===r.fade&&!g.value,n=!_.value,i=x.get(e);if(i?.children===e.children&&i.textFastPath===t&&i.paragraphFastPath===n)return i.info;let a=zt(e.children,n,!0),o={simpleChildren:a,plainText:a&&t?Bt(a):null};return x.set(e,{children:e.children,textFastPath:t,paragraphFastPath:n,info:o}),o}function k(e){if(!l)return;e.preventDefault();let t=l.startWidth+l.nextStartWidth,n=Math.min(48,Math.floor(t/2)),r=Math.max(n,Math.min(t-n,Math.round(l.startWidth+e.clientX-l.startX))),i=[...l.widths];i[l.index]=r,i[l.index+1]=t-r,c.value=i}function A(){l&&=(window.removeEventListener(`pointermove`,k),window.removeEventListener(`pointerup`,A),window.removeEventListener(`pointercancel`,A),null)}return v(d,()=>{A(),c.value=[]}),u(A),(t,u)=>(B(),z(`div`,lk,[T(`table`,{ref_key:`tableRef`,ref:s,class:S([`table-node`,{"table-node--loading":i.value}]),"aria-busy":i.value},[f.value?(B(),z(`colgroup`,dk,[(B(!0),z(w,null,o(e.node.header.cells,(e,t)=>(B(),z(`col`,{key:t,style:I(p.value[t])},null,4))),128))])):L(``,!0),T(`thead`,null,[T(`tr`,null,[(B(!0),z(w,null,o(e.node.header.cells,(n,i)=>(B(),z(`th`,{key:i,dir:`auto`,class:S([n.align===`right`?`text-right`:n.align===`center`?`text-center`:`text-left`])},[O(n).plainText===null?O(n).simpleChildren?(B(),b(F(NO),{key:1,nodes:O(n).simpleChildren,"custom-id":r.customId,"index-key":`table-th-${r.indexKey}-${i}`},null,8,[`nodes`,`custom-id`,`index-key`])):(B(),b(F(uj),{key:2,nodes:n.children,"index-key":`table-th-${r.indexKey}`,"custom-id":r.customId,typewriter:r.typewriter,fade:r.fade,"show-tooltips":r.showTooltips,onCopy:u[0]||=e=>t.$emit(`copy`,e)},null,8,[`nodes`,`index-key`,`custom-id`,`typewriter`,`fade`,`show-tooltips`])):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":r.customId},C(O(n).plainText),9,fk)),i<e.node.header.cells.length-1?(B(),z(`button`,{key:3,type:`button`,class:`table-node__resize-handle`,"aria-label":`Resize columns ${i+1} and ${i+2}`,onPointerdown:e=>function(e,t){if(t.button!==0)return;let n=function(){let e=s.value?.querySelectorAll(`thead th`);return Array.from(e??[],e=>Math.round(e.getBoundingClientRect().width))}(),r=n[e],i=n[e+1];r&&i&&(t.preventDefault(),l={index:e,startX:t.clientX,startWidth:r,nextStartWidth:i,widths:n},c.value=n,window.addEventListener(`pointermove`,k),window.addEventListener(`pointerup`,A),window.addEventListener(`pointercancel`,A))}(i,e)},null,40,pk)):L(``,!0)],2))),128))])]),T(`tbody`,null,[(B(!0),z(w,null,o(a.value,(e,n)=>(B(),z(`tr`,{key:n},[(B(!0),z(w,null,o(e.cells,(e,i)=>(B(),z(`td`,{key:i,class:S([e.align===`right`?`text-right`:e.align===`center`?`text-center`:`text-left`]),dir:`auto`},[O(e).plainText===null?O(e).simpleChildren?(B(),b(F(NO),{key:1,nodes:O(e).simpleChildren,"custom-id":r.customId,"index-key":`table-td-${r.indexKey}-${n}-${i}`},null,8,[`nodes`,`custom-id`,`index-key`])):(B(),b(F(uj),{key:2,nodes:e.children,"index-key":`table-td-${r.indexKey}`,"custom-id":r.customId,typewriter:r.typewriter,fade:r.fade,"show-tooltips":r.showTooltips,onCopy:u[1]||=e=>t.$emit(`copy`,e)},null,8,[`nodes`,`index-key`,`custom-id`,`typewriter`,`fade`,`show-tooltips`])):(B(),z(`span`,{key:0,class:`text-node`,"custom-id":r.customId},C(O(e).plainText),9,mk))],2))),128))]))),128))])],10,uk),n(M,{name:`table-node-fade`},{default:y(()=>[i.value?(B(),z(`div`,hk,[m(t.$slots,`loading`,{isLoading:i.value},()=>[u[2]||=T(`span`,{class:`table-node__spinner animate-spin`,"aria-hidden":`true`},null,-1),u[3]||=T(`span`,{class:`sr-only`},`Loading`,-1)],!0)])):L(``,!0)]),_:3})]))}}),[[`__scopeId`,`data-v-6704fa51`]]);gk.install=e=>{e.component(gk.__name,gk)};var _k={class:`hr-node`},vk=$({},[[`render`,function(e,t){return B(),z(`hr`,_k)}],[`__scopeId`,`data-v-b0d616f1`]]);vk.install=e=>{e.component(vk.__name,vk)};var yk={class:`unknown-node`},bk=p({__name:`FallbackComponent`,props:{node:{}},setup:e=>(t,n)=>(B(),z(`div`,yk,C(e.node.raw),1))}),xk=$(p({__name:`VmrContainerNode`,props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){let t=e,n=E(()=>`vmr-container vmr-container-${t.node.name}`),r=TE(()=>t.customId),i=E(()=>Z({text:rO,paragraph:ck,heading:YO,inline_code:eD,link:wO,image:zD,strong:_O,emphasis:AO,strikethrough:yO,insert:EO,subscript:hO,superscript:pO,checkbox:kE,checkbox_input:kE,hardbreak:MO,math_inline:cO,reference:dO,list:tk,math_block:lO,table:gk},r.value));return(r,s)=>(B(),z(`div`,O({class:n.value},e.node.attrs),[(B(!0),z(w,null,o(e.node.children,(n,r)=>{return B(),b(a((o=n.type,i.value[o]||bk)),{key:`${e.indexKey||`vmr-container`}-${r}`,"custom-id":t.customId,node:n,"index-key":`${e.indexKey||`vmr-container`}-${r}`,typewriter:t.typewriter,fade:t.fade,"data-markstream-reference-id":n.type===`reference`?String(n.id):void 0},null,8,[`custom-id`,`node`,`index-key`,`typewriter`,`fade`,`data-markstream-reference-id`]);var o}),128))],16))}}),[[`__scopeId`,`data-v-e38ca2a3`]]);xk.install=e=>{e.component(xk.__name,xk)};var Sk=`__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__`,Ck=[`diff `,`index `,`--- `,`+++ `,`@@ `],wk=(()=>{let e=globalThis;if(e[Sk])return e[Sk];let t={configs:{},controllers:{},revision:x(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Sk]=t,t})(),Tk=null,Ek=null,Dk=null;function Ok(){return Ek||typeof window>`u`?null:(Dk||=V(()=>import(`./layout-BA_bUv_G.js`).then(e=>(Ek=e,wk.revision.value++,e)),[]).catch(()=>null),Dk.then(()=>{}))}var kk=wk.revision;function Ak(e){var t;return e&&(t=wk.configs[e])!=null?t:null}function jk(e,t){let n=Number.parseFloat(String(e??``));return Number.isFinite(n)&&n>0?n:t}function Mk(e){return e?.type===`text`||e?.type===`emoji`||e?.type===`hardbreak`}function Nk(e){if(!Array.isArray(e)||e.length===0)return null;let t=``;for(let n of e){if(!Mk(n))return null;n.type===`text`?t+=String(n.content??``):n.type===`emoji`?t+=String(n.name??n.raw??``):n.type===`hardbreak`&&(t+=`
|
|
191
191
|
`)}return t.length>0?t:null}function Pk(e,t,n){if(!e||!Number.isFinite(t)||t<=0||!function(){if(Tk!=null)return Tk;if(typeof document>`u`)return!1;try{let e=document.createElement(`canvas`);return Tk=!!e.getContext?.call(e,`2d`),Tk}catch{return Tk=!1,!1}}())return null;let r=Ek;if(!r)return Ok(),null;try{let i=Math.round(100*t)/100,a=[n.whiteSpace??`pre-wrap`,n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join(`\0`),o=wk.blockEstimateCache.get(a);if(o)return wk.blockEstimateCache.delete(a),wk.blockEstimateCache.set(a,o),{kind:`simple-text`,height:o.height,contentHeight:o.contentHeight};let s=n.whiteSpace??`pre-wrap`,c=function(e,t,n,r){let i=`${r}\0${n}\0${t}`,a=wk.preparedCache.get(i);if(a)return wk.preparedCache.delete(i),wk.preparedCache.set(i,a),a.prepared;let o=e.prepare(t,n,{whiteSpace:r});for(wk.preparedCache.set(i,{prepared:o});wk.preparedCache.size>240;){let e=wk.preparedCache.keys().next().value;if(!e)break;wk.preparedCache.delete(e)}return o}(r,e,n.font,s),l=Math.max(24,i-n.widthAdjustment),u=r.layout(c,l,n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(wk.blockEstimateCache.set(a,{height:f,contentHeight:Math.round(d)});wk.blockEstimateCache.size>4e3;){let e=wk.blockEstimateCache.keys().next().value;if(!e)break;wk.blockEstimateCache.delete(e)}return{kind:`simple-text`,height:f,contentHeight:Math.round(d)}}catch{return null}}function Fk(e,t,n){if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type===`paragraph`){let r=Nk(e.children);return r&&n.paragraph?Pk(r,t,n.paragraph):null}if(e.type===`heading`){let r=Number(e.level||0),i=Nk(e.children),a=n.headings[r];return i&&a?Pk(i,t,a):null}if(e.type===`list_item`){let r=Array.isArray(e.children)?e.children:[];if(r.length!==1||r[0]?.type!==`paragraph`||!n.listItem)return null;let i=Nk(r[0]?.children);return i?Pk(i,t,n.listItem):null}if(e.type===`list`){let r=Array.isArray(e.items)?e.items:[];if(!r.length)return null;let i=Math.max(0,n.listWrapperOverhead);for(let e of r){let r=Fk(e,t,n);if(!r)return null;i+=r.height}return{kind:`simple-text`,height:Math.max(1,Math.round(i)),contentHeight:Math.max(1,Math.round(i))}}return null}function Ik(e){if(!e)return 1;let t=String(e).split(/\r\n|\n|\r/);return Math.max(1,t.length)}function Lk(e,t){let n=String(e??``);return t?n:n.replace(/\r\n$|\n$|\r$/,``)}function Rk(e,t){return e.diff?ye({diffStyle:t})?function(e){let t=Lk(e.raw);if(t){let n=t.split(/\r?\n/);return e.originalCode!=null||e.updatedCode!=null?Math.max(1,n.filter(e=>!Ck.some(t=>e.startsWith(t))).length):Math.max(1,n.length)}return Ik(Lk(e.originalCode))+Ik(Lk(e.updatedCode))}(e):function(e){let t=e.originalCode,n=e.updatedCode;if(t!=null||n!=null)return Math.max(Ik(Lk(t)),Ik(Lk(n)));let r=Lk(e.code).split(/\r?\n/),i=0,a=0;for(let e of r)e.startsWith(`+`)&&!e.startsWith(`+++`)?a++:e.startsWith(`-`)&&!e.startsWith(`---`)?i++:(i++,a++);return Math.max(1,i,a)}(e):Ik(Lk(e.code,!0===e.loading))}function zk(e,t,n){return Math.max(1,Math.ceil(function(e,t){let n=0;for(let r of e)n+=r===` `?t-n%t:r>=`ᄀ`?2:1;return n}(e,n)/t))}function Bk(e,t,n,r,i,a){let o=e/(a?2:1),s=i.codeBlockOptions?.padding==null?t:r.padding,c=i.showLineNumbers??!0!==i.codeBlockOptions?.disableLineNumbers,l=Math.max(2,String(Math.max(1,n)).length)*t,u=c?3*t+l+2:0;return Math.max(1,Math.floor((o-u-2*s)/t))}function Vk(e){return e?`${e.fontStyle||`normal`} ${e.fontWeight||`400`} ${e.fontSize||`16px`} ${e.fontFamily||`sans-serif`}`:``}function Hk(e,t,n=`pre-wrap`){if(!e||!t||typeof window>`u`)return null;let r=window.getComputedStyle(t),i=e.offsetHeight,a=jk(r.lineHeight,1.5*jk(r.fontSize,16)),o=e.getBoundingClientRect().width,s=t.getBoundingClientRect().width;return{font:Vk(r),lineHeight:a,wrapperOverhead:Math.max(0,i-a),widthAdjustment:Math.max(0,o-s),whiteSpace:n}}var Uk=new Set([`node`,`key`,`ref`,`ctx`,`renderNode`,`indexKey`,`__proto__`,`prototype`,`constructor`]);function Wk(e,t={}){let n={},r=new Set(t.omit??[]);if(!e||typeof e!=`object`)return n;let i=Object.getOwnPropertyDescriptors(e);for(let[e,t]of Object.entries(i))Uk.has(e)||r.has(e)||t.enumerable&&`value`in t&&(n[e]=t.value);return n}function Gk(e,t){let n=t.trim().toLowerCase();if(n)for(let t of[n,Rw(n),Ft(n),n===`d2lang`?`d2`:``]){let n=t&&e[t];if(n)return n}}function Kk(e,t,n,r){let i=function(e){return Math.max(0,Math.ceil(e.scrollHeight||0)-Math.ceil(e.clientHeight||0))}(e),a=function(e,t){return Number.isFinite(e)?Math.min(Math.max(0,e),t):0}(n,i);if(!r.isReverseFlexScrollRoot(e))return void(e.scrollTop=a);let o=Math.max(0,i-a),s=[-o,o],c=s[0],l=1/0;for(let n of s){e.scrollTop=n;let i=r.getNormalizedScrollTop(e,t,!1),o=Math.abs(i-a);o<l&&(l=o,c=n)}e.scrollTop=c;let u=r.epsilonPx??2;Math.abs(r.getNormalizedScrollTop(e,t,!1)-a)>u&&(e.scrollTop=c)}function qk(e,t){let n=0,r=null,i=null,a=()=>{let t=i;i=null,r=null,t&&(n=Date.now(),e(...t))};return function(...o){let s=Date.now(),c=t-(s-n);i=o,c<=0?(r&&=(clearTimeout(r),null),n=s,i=null,e(...o)):r||=setTimeout(a,c)}}function Jk(e){return e===`simple`?`simple`:!0===e||e===`true`||e===`precise`?`precise`:`off`}function Yk(e){return Jk(e)!==`off`}var Xk=Symbol(`MarkstreamMathBlockMinHeightCache`);function Zk(){return k(Xk,null)}var Qk=new Set([`text`,`inline_code`,`emoji`,`footnote_reference`]),$k=new Set([`strong`,`emphasis`,`strikethrough`,`highlight`,`insert`,`subscript`,`superscript`,`link`]);function eA(e){let t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function tA(e,t,n,r=22){let i=String(e??``);if(!i)return n;let a=Math.max(18,Math.floor(Math.max(320,t)/8)),o=i.split(/\r?\n/).length,s=Math.ceil(i.length/a);return Math.max(n,Math.ceil(Math.max(1,o,s)*r+12))}function nA(e){if(!e||typeof e!=`object`)return!1;let t=e,n=String(t.type??``);if(Qk.has(n))return!0;if(!$k.has(n))return!1;let r=t.children;return!Array.isArray(r)||!r.length||r.every(nA)}function rA(e){if(!e||typeof e!=`object`)return``;let t=e,n=String(t.type??``);if(n===`text`)return String(t.content??t.raw??``);if(n===`inline_code`)return String(t.code??t.content??t.raw??``);if(n===`emoji`)return String(t.name??t.raw??``);if(typeof t.text==`string`)return t.text;let r=[];for(let e of[`children`,`items`,`cells`,`rows`]){let n=t[e];if(Array.isArray(n)){let e=n.map(rA).filter(Boolean).join(` `);e&&r.push(e)}}return r.join(` `).replace(/\s+/g,` `).trim()}function iA(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`inline_code`||[`children`,`items`,`cells`,`rows`].some(e=>{let n=t[e];return Array.isArray(n)&&n.some(iA)})}function aA(e,t){if(!e)return 30;let n=Math.max(18,Math.floor(Math.max(320,t)/8)),r=e.split(/\r?\n/).length,i=Math.ceil(e.length/n);return 30+26*Math.max(0,Math.max(1,r,i)-1)}function oA(e,t){if(!e||typeof e!=`object`)return 32;let n=e,r=String(n.type??``),i=Number.isFinite(t)&&t>0?t:640;switch(r){case`heading`:return function(e){let t=Number(e.level??e.depth);return t>=4?20:t===3?30:t===2?32:44}(n);case`paragraph`:return function(e,t){let n=String(e??``);if(!n)return 28;let r=Math.max(18,Math.floor(Math.max(320,t)/8)),i=n.split(/\r?\n/).length,a=Math.ceil(n.length/r);return Math.max(1,i,a)<=1?28:tA(n,t,34)}(String(n.raw??n.content??``),i);case`list`:return function(e,t){let n=Array.isArray(e.items)?e.items:[];if(!n.length)return 48;let r=Math.max(48,30*n.length+12),i=12;for(let e of n)i+=aA(rA(e)||String(e.raw??``),t);let a=Math.max(0,i-r);if(n.length>20){let e=Math.round(2.4*n.length);return Math.round(r+Math.max(e,Math.min(a,3*n.length)))}if(a<=0)return r;let o=n.length>8?8*n.length:a;return Math.round(r+Math.min(a,o))}(n,i);case`list_item`:return tA(String(n.raw??n.content??``),i,34);case`blockquote`:return tA(String(n.raw??n.content??``),i,56);case`table`:return function(e,t){let n=[...e.header?[e.header]:[],...Array.isArray(e.rows)?e.rows:[]];if(!n.length){let t=Array.isArray(e.children)?e.children.length:3;return Math.max(120,38*t+48)}return Math.max(120,Math.round(4+n.reduce((e,n)=>e+function(e,t){let n=Math.max(1,e.length),r=Math.max(80,(t-32)/n),i=Math.max(10,Math.floor(r/8)),a=Math.max(1,...e.map(e=>{let t=rA(e)||String(e?.raw??``);return Math.ceil(t.length/i)||1}));return 54+34*Math.max(0,a-1)+(n<=3&&e.some(iA)?14:0)}(function(e){var t;return Array.isArray(e?.cells)&&(t=e.cells)!=null?t:[]}(n),t),0)))}(n,i);case`code_block`:{let e=String(n.language??``).trim().toLowerCase(),t=String(n.code??n.raw??``);return e===`mermaid`?ST(yT(t)):e===`infographic`?wT(bT(t)):tA(t,i,96,20)}case`math_block`:return 72;case`image`:return 220;case`admonition`:case`vmr_container`:case`html_block`:return function(e,t){let n=e.match(/^\s*<details\b([^>]*)>/i);return n&&!/(?:^|\s)open(?:\s|=|$)/i.test(n[1]??``)?tA((e.match(/<summary\b[^>]*>([\s\S]*?)<\/summary>/i)?.[1])?.replace(/<[^>]*>/g,``).trim()||`Details`,t,28,28):tA(e,t,96)}(String(n.raw??n.content??``),i);case`thematic_break`:return 24;default:return tA(String(n.raw??n.content??``),i,40)}}function sA(e,t,n){return Math.min(Math.max(e,t),n)}var cA=new WeakMap;function lA(e,t,n){let r=e;if(n.has(r))return n.get(r);let i=String(e.type).trim().toLowerCase();if(t[i])return n.set(r,!0),!0;if(i===`code_block`){let i=String(e.language??``).trim().toLowerCase();if(i&&Gk(t,i))return n.set(r,!0),!0}let a=e;n.set(r,!1);let o=Object.values(a).some(e=>Array.isArray(e)?e.some(e=>EA(e)&&lA(e,t,n)):EA(e)&&lA(e,t,n));return n.set(r,o),o}var uA=[`total`,`cacheHits`,`appendHits`,`tailHits`,`fullParses`,`chunkedParses`],dA=[`tokenCloneMs`,`processTokensInputTokens`,`processTokensReusedTopLevelNodes`,`processTokensMs`,`safeMarkdownMs`,`tokenizeMs`,`htmlBlockPassesMs`,`parseMarkdownToStructureTotalMs`],fA=new Set([`attrs`,`data`,`items`,`header`,`payload`,`props`,`rows`,`cells`,`term`,`definition`,`sourceMap`]),pA=[`raw`,`content`,`code`,`originalCode`,`updatedCode`],mA=new WeakMap,hA=new WeakMap,gA=1;function _A(){return typeof performance<`u`?performance.now():Date.now()}function vA(e){let t=e.stream;return t&&typeof t.stats==`function`?t.stats():null}function yA(e){if(typeof e!=`object`&&typeof e!=`function`||e===null)return``;let t=e,n=mA.get(t);return n||(n=gA++,mA.set(t,n)),String(n)}function bA(e,t,n,r={}){let i=!1!==r.includeFinal,a={md:yA(t),customMarkdownIt:yA(n),requireClosingStrong:!0===e.requireClosingStrong,customHtmlTags:e.customHtmlTags??[],includeSourceMap:!0===e.includeSourceMap,streamParse:e.streamParse??`auto`,validateLink:yA(e.validateLink),preTransformTokens:yA(e.preTransformTokens),postTransformTokens:yA(e.postTransformTokens),postTransformNodes:yA(e.postTransformNodes)};return i&&(a.final=!0===e.final),JSON.stringify(a)}function xA(e){var t,n;(n=(t=e.stream)?.reset)==null||n.call(t)}function SA(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)--t;let n=e.lastIndexOf(`
|
|
192
192
|
`,t-1)+1;return e.slice(n,t).trim()}function CA(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function wA(e){let t=String(e??``);return`${t.length}:${CA(t)}`}function TA(e,t=new WeakMap,n=0){if(e==null||typeof e==`number`||typeof e==`boolean`)return String(e);if(typeof e==`string`)return`s:${function(e){return e.length<=8192?wA(e):`${e.length}:${CA(e.slice(0,8192))}:truncated`}(e)}`;if(typeof e==`function`)return`fn:${yA(e)}`;if(typeof e!=`object`)return typeof e;let r=e,i=t.get(r);if(i)return`cycle:${i}`;if(n>=6)return`object:${yA(r)}`;let a=yA(r);if(t.set(r,a),Array.isArray(e)){let r=e.slice(0,200);return`a:${e.length}:${r.map(e=>TA(e,t,n+1)).join(`,`)}`}if(typeof e==`object`){let r=e,i=Object.keys(r).sort(),a=i.slice(0,80);return`o:${i.length}:${a.map(e=>`${e}:${TA(r[e],t,n+1)}`).join(`;`)}`}return typeof e}function EA(e){return typeof e==`object`&&!!e&&typeof e.type==`string`&&typeof e.raw==`string`}function DA(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(e=>EA(e)?AA(e,t,n+1):DA(e,t,n+1)).join(`,`)}`:EA(e)?AA(e,t,n):TA(e,t,n)}function OA(e,t,n){return Object.keys(e).sort().filter(e=>e!==`children`&&!pA.includes(e)).map(r=>{let i=e[r];return typeof i==`string`?`${r}=s:${wA(i)}`:typeof i==`number`||typeof i==`boolean`||i==null?`${r}=${String(i)}`:typeof i==`function`?`${r}=fn:${yA(i)}`:fA.has(r)&&(Array.isArray(i)||typeof i==`object`)?`${r}=${DA(i,t,n+1)}`:i&&typeof i==`object`?`${r}=object:${yA(i)}`:``}).filter(Boolean).join(`;`)}function kA(e){return pA.map(t=>{let n=e[t];return typeof n==`string`?`${t}=s:${wA(n)}`:``}).filter(Boolean).join(`;`)}function AA(e,t=new WeakMap,n=0){let r=hA.get(e);if(r)return r;let i=e,a=t.get(i);if(a)return`node-cycle:${a}`;if(n>=6)return`node:${e.type}:${yA(i)}`;let o=yA(i);t.set(i,o);let s=function(e,t,n){let r=e,i=Array.isArray(r.children)?r.children:[],a=i.length?i.slice(0,200).map(e=>AA(e,t,n+1)).join(`|`):``;return[e.type,kA(r),OA(r,t,n),i.length,a].join(`:`)}(e,t,n);return hA.set(i,s),s}function jA(e,t){return AA(e)===AA(t)}function MA(e,t,n){let r=_A(),i=t===`stabilizeSignatureMs`?`stabilizeSignatureCallCount`:`primeSignatureCallCount`;try{return n()}finally{e[t]+=_A()-r,e[i]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function NA(e,t,n){return MA(t,n,()=>AA(e))}function PA(e,t,n){return NA(e,n,`stabilizeSignatureMs`)===NA(t,n,`stabilizeSignatureMs`)}function FA(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function IA(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function LA(e){return!0===e.__markstreamHasCustomParserExtensions||function(e){return Number(e.__markstreamRegisteredPluginCount??0)>0}(e)}function RA(e,t){return e.length===t.length&&e===t}function zA(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;let r=e,i=t,a=Object.keys(r).filter(e=>e!==`type`&&e!==`children`).sort(),o=Object.keys(i).filter(e=>e!==`type`&&e!==`children`).sort();if(a.length!==o.length)return!1;for(let e=0;e<a.length;e++){let t=a[e];if(t!==o[e])return!1;let n=r[t],s=i[t];if(typeof n!=typeof s)return!1;if(typeof n!=`string`){if(typeof n!=`number`&&typeof n!=`boolean`&&n!=null)return null;if(!Object.is(n,s))return!1}else if(typeof s!=`string`||!RA(n,s))return!1}let s=Object.prototype.hasOwnProperty.call(r,`children`);if(s!==Object.prototype.hasOwnProperty.call(i,`children`))return!1;if(!s)return!0;let c=r.children,l=i.children;if(!Array.isArray(c)||!Array.isArray(l))return null;if(c.length!==l.length)return!1;for(let e=0;e<c.length;e++){let t=c[e],r=l[e];if(!EA(t)||!EA(r))return null;let i=zA(t,r,n+1);if(i==null)return null;if(!i)return!1}return!0}function BA(e,t,n=0){if(e===t||e.type!==t.type||n>=6)return;let r=e,i=t;for(let e of[`children`,`items`,`rows`,`cells`]){let t=r[e],a=i[e];if(!Array.isArray(t)||!Array.isArray(a))continue;let o=Math.min(t.length,a.length);for(let e=0;e<o;e++){let r=t[e],i=a[e];r!==i&&EA(r)&&EA(i)&&(!0===zA(r,i)?a[e]=r:BA(r,i,n+1))}}}function VA(e,t){return!e||!t?!1:e===t?!0:e.type===t.type?zA(e,t)??jA(e,t):!1}function HA(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let r=null;return MA(n,`stabilizeSignatureMs`,()=>{r=zA(e,t)}),r??PA(e,t,n)}function UA(e,t){let n={};for(let r of uA){let i=e[r],a=t?.[r];typeof i==`number`&&(n[r]=i-(typeof a==`number`?a:0))}return n}function WA(e,t,n){let r=xw(t.instanceMsgId),i=new Map,a=t.smoothStreamingEnabled??E(()=>!1),o=D(t.renderContent.value),s;function c(){s&&xA(s.md),s=void 0}let l=[],u=``,d=``,f=``,p=!1,m=``,h=new WeakMap,g=function(){let e=``,t=0,n=!1,r=!1,i=!1,a=!1;function o(){e=``,t=0,n=!1,r=!1,i=!1,a=!1}function s(e){let o=!1;for(let s=0;s<e.length;s++){let c=e.charCodeAt(s);if(c===10||c===13){let e=c===10&&a;a=c===13,n=!1,e||(i||(r=!1,t=0),i=!1);continue}a=!1;let l=c===9||c===32;if(l||(i=!0,r&&(o=!0)),t){if(t!==1)l||(c===58?(o=!0,r=!0):t=+(c===91));else{if(n){n=!1;continue}if(c===92){n=!0;continue}c===93&&(t=2)}}else c===91&&(t=1)}return o}return(t,n)=>{if(!t||!n.startsWith(t)||n.length<=t.length)return o(),[!0,0];let r=0;e!==t&&(o(),s(t),r=t.length);let i=n.slice(t.length),a=s(i);return e=n,[a,r+i.length]}}(),_,y=0,b=0,x=_A(),S=-1,C=0;function w(e){S=Number.isInteger(e)?e:0,C+=1}function T(){_&&=(clearTimeout(_),void 0)}function O(){T();let e=t.renderContent.value;o.value!==e&&(o.value=e),x=_A()}v([t.renderContent,t.effectiveFinal,a],([t,n,r])=>{o.value!==t&&(!r||n||function(e,t){if(!e&&t||t.length<=80||t.length<e.length||!t.startsWith(e))return!0;let n=t.slice(e.length);return!(!n||!function(e){let t=function(e){return e.includes(`|`)?e.replace(/^\|/,``).replace(/\|$/,``).split(`|`):[]}(e);return t.length>=2&&t.every(e=>{let t=e.trim();return t.length>=1&&t.replace(/^:/,``).replace(/:$/,``).split(``).every(e=>e===`-`)})}(SA(t))&&(r=t,i=SA(r),!(/^={3,}$/.test(i)||/^-{3,}$/.test(i)||n.includes(`
|
|
193
193
|
|
|
194
194
|
`)||/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(n))));var r,i}(o.value,t)?O():function(){if(b+=1,_)return;let t=Math.max(0,function(e){let t=e.parseCoalesceMs;return typeof t==`number`&&Number.isFinite(t)&&t>=0?t:!0===e.fade?0:80}(e)-(_A()-x));t<=0?O():_=setTimeout(O,t)}())},{flush:`sync`,immediate:!0}),N(T);let k=E(()=>{var n;return bf(e.customHtmlTags,e.parseOptions?.customHtmlTags,(n=t.customComponentsMap?.value??{},Object.entries(n).map(([e,t])=>{let n=vf(e);return t==null||!n||xE(n)||Vd.has(n)||Wd.has(n)?``:n}).filter(Boolean)))}),A=E(()=>{let{key:e,tags:n}=xf(k.value);if(!e)return r;let a=i.get(e);if(a)return a;let o=xw(t.instanceMsgId,{customHtmlTags:n});return i.set(e,o),o}),j=E(()=>{let t=A.value;if(!e.customMarkdownIt)return t;let n=e.customMarkdownIt(t);return t.__markstreamHasCustomParserExtensions=!0,n.__markstreamHasCustomParserExtensions=!0,n}),M=E(()=>{var n;let r=e.parseOptions??{},i=t.effectiveFinal.value,a=k.value,o=i!=null,s=a.length>0;return o||s||r.streamParse==null?Z(Z(Q(Z({},r),{streamParse:(n=r.streamParse)==null||n}),o?{final:i}:{}),s?{customHtmlTags:a}:{}):r}),P=E(()=>new Set(k.value.map(e=>String(e).trim().toLowerCase()).filter(Boolean))),ee=E(()=>bA(M.value,j.value,e.customMarkdownIt,{includeFinal:!0})),te=E(()=>bA(M.value,j.value,e.customMarkdownIt,{includeFinal:!1}));return v([ee,te],([e,t],[n,r])=>{n&&(e===n&&t===r||(O(),t!==r&&(l=[],f=``)))},{flush:`sync`}),{effectiveCustomHtmlTags:k,effectiveCustomHtmlTagsSet:P,mdBase:A,mdInstance:j,mergedParseOptions:M,getParsedNodesDirtyStartIndex:()=>S,getParsedNodesRevision:()=>C,parsedNodes:E(()=>{if(e.nodes?.length)return c(),l=[],f=``,w(0),ne(e.nodes.slice());let n=o.value;if(!n)return c(),l=[],f=``,w(-1),[];let r=t.debugPerformanceEnabled.value,i=r?_A():0,a=j.value,_=ee.value,v=te.value;u&&_!==u&&v!==d&&(s?.md===a?c():xA(a)),d&&v!==d&&(l=[],f=``);let x=t.customComponentsMap?.value??{},C=function(e){let t=e,n=cA.get(t);if(n!==void 0)return n;let r=function(e){return JSON.stringify(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,yA(t)]))}(e);return cA.set(t,r),r}(x);m&&C!==m&&(l=[],f=``,h=new WeakMap);let T=Object.keys(x).length>0,E=typeof M.value.postTransformNodes==`function`;E!==p&&(l=[],f=``);let D=!E&&l.length>0&&n.startsWith(f)&&v===d,O=r?vA(a):null,k=r?{}:void 0,A=LA(a),N=T&&l.some(e=>lA(e,x,h)),P=!A&&!E&&(!T||l.length>0&&!N),F=Z(Q(Z({},M.value),{reuseStableTopLevelNodes:P}),k?{parserMetrics:k}:{}),I;!0===F.final&&s?.md===a?s=void 0:c(),I=dC(n,a,F);let L=r?_A():0;if(D&&!A&&!T&&!M.value.preTransformTokens&&!M.value.postTransformTokens){let e=Math.min(l.length,I.length);for(let t=0;t<e;t++)BA(l[t],I[t])}let R=r?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0,z,B=r?FA(I.length):void 0,V=0,re=0,ie=0;if(D){let t=r?_A():0,[i,o]=T?[0,0]:function(e){let[t,n]=e.scanGlobalReferenceAppend(e.previousContent,e.content),r=e.parseOptions;return[e.previousDirtyStartIndex>0&&!0!==r.final&&!e.customMarkdownIt&&!LA(e.md)&&!t&&typeof r.preTransformTokens!=`function`&&typeof r.postTransformTokens!=`function`&&typeof r.postTransformNodes!=`function`&&(r.customHtmlTags?.length??0)===0?e.previousDirtyStartIndex:0,n]}({content:n,previousContent:f,previousDirtyStartIndex:S,parseOptions:M.value,customMarkdownIt:e.customMarkdownIt,md:a,scanGlobalReferenceAppend:g});ie=o;let s=i<=0,c=T?e=>!lA(e,x,h):void 0;if(R){let e=function(e,t,n,r={}){if(!t.length)return{nodes:e,metrics:FA(e.length)};let i=!1!==r.reuseDirtyTail,a=function(e,t,n,r){let i=Math.min(e.length,t.length);for(let a=Math.min(i,Math.max(0,r.scanStartIndex??0));a<i;a++){let i=t[a],o=e[a];if(r.canReuseNode&&(!r.canReuseNode(i)||!r.canReuseNode(o))||!HA(i,o,n))return a}return e.length===t.length?-1:i}(e,t,n,r);if(a<0)return{nodes:t,metrics:{reusedNodeCount:e.length,dirtyStartIndex:a,stablePrefixNodeCount:e.length,dirtyTailNodeCount:0}};let o=e.slice(),s=a;for(let e=0;e<a;e++)o[e]=t[e];if(i)for(let i=a;i<e.length;i++){let a=t[i],c=e[i];a&&(!r.canReuseNode||r.canReuseNode(a)&&r.canReuseNode(c))&&PA(a,c,n)&&(o[i]=a,s+=1)}return{nodes:o,metrics:{reusedNodeCount:s,dirtyStartIndex:a,stablePrefixNodeCount:a,dirtyTailNodeCount:IA(a,e,t)}}}(I,l,R,{canReuseNode:c,reuseDirtyTail:s,scanStartIndex:i});z=e.nodes,B=e.metrics}else{let e=function(e,t,n={}){if(!t.length)return{nodes:e,metrics:FA(e.length)};let r=!1!==n.reuseDirtyTail,i=function(e,t,n){let r=Math.min(e.length,t.length);for(let i=Math.min(r,Math.max(0,n.scanStartIndex??0));i<r;i++){let r=t[i],a=e[i];if(n.canReuseNode&&(!n.canReuseNode(r)||!n.canReuseNode(a))||!VA(r,a))return i}return e.length===t.length?-1:r}(e,t,n);if(i<0)return{nodes:t,metrics:{reusedNodeCount:e.length,dirtyStartIndex:i,stablePrefixNodeCount:e.length,dirtyTailNodeCount:0}};let a=e.slice(),o=i;for(let e=0;e<i;e++)a[e]=t[e];if(r)for(let r=i;r<e.length;r++){let i=t[r],s=e[r];i&&(!n.canReuseNode||n.canReuseNode(i)&&n.canReuseNode(s))&&jA(i,s)&&(a[r]=i,o+=1)}return{nodes:a,metrics:{reusedNodeCount:o,dirtyStartIndex:i,stablePrefixNodeCount:i,dirtyTailNodeCount:IA(i,e,t)}}}(I,l,{canReuseNode:c,reuseDirtyTail:s,scanStartIndex:i});z=e.nodes,B=e.metrics}V=r?_A()-t:0,re=s?B?.dirtyStartIndex==null||B.dirtyStartIndex<0?z.length:B.dirtyStartIndex:z.length}else z=I,B=FA(z.length);if(!0!==t.effectiveFinal.value&&(R?function(e,t,n=0){for(let r=Math.max(0,n);r<e.length;r++)MA(t,`primeSignatureMs`,()=>AA(e[r]))}(z,R,re):function(e,t=0){for(let n=Math.max(0,t);n<e.length;n++)AA(e[n])}(z,re)),T)for(let e=B?.dirtyStartIndex!=null&&B.dirtyStartIndex>=0?B.dirtyStartIndex:z.length;e<z.length;e++)lA(z[e],x,h);let ae=r?_A()-L:0;y+=1,f=n,u=_,d=v,p=E,m=C,l=z;let oe=B?.dirtyStartIndex??0;if(oe>0&&z[z.length-1]?.type===`footnote`&&(oe=Math.min(oe,z.findIndex(e=>e.type===`footnote`))),w(oe),r){let e=vA(a),r=typeof e?.total==`number`&&e.total>(O?.total??0);t.logPerf(r?`parse(stream)`:`parse(sync)`,Z(Z(Z({rendererId:t.instanceMsgId,ms:Math.round(_A()-i),nodes:z.length,contentLength:n.length,parseCommitCount:y,parseCoalescedCount:b,nodeReuseMs:ae,referenceDefinitionScanChars:ie,signatureMs:R?.signatureMs??0,stabilizeSignatureMs:R?.stabilizeSignatureMs??0,primeSignatureMs:R?.primeSignatureMs??0,signatureCallCount:R?.signatureCallCount??0,stabilizeSignatureCallCount:R?.stabilizeSignatureCallCount??0,primeSignatureCallCount:R?.primeSignatureCallCount??0,stabilizeMs:V},B??{}),k?Object.fromEntries(dA.map(e=>[e,k[e]??0])):{}),e?{streamMode:e.lastMode,streamDelta:UA(e,O),streamStats:e}:{}))}return ne(z)})}}function GA(e){let{isClient:t}=e,n=D(new Set),r=new Map,i=new Map,a=new Map;function o(e){if(!t)return;let n=a.get(e);n!=null&&(window.clearTimeout(n),a.delete(e))}function s(){if(t)for(let e of a.values())window.clearTimeout(e);a.clear()}function c(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:r,nodeVisibilityWatchStops:i,nodeVisibilityFallbackTimers:a,clearVisibilityFallback:o,clearAllVisibilityFallbacks:s,markNodeVisible:function(t,r=!0){var i;r&&o(t),function(t,r){if((a=(i=e.shouldTrackVisibleNodeIndices)?.call(e))!=null&&!a)return;var i,a;let o=n.value,s=o.has(t);if(r){if(s)return;let e=new Set(o);e.add(t),n.value=e;return}if(!s)return;let c=new Set(o);c.delete(t),n.value=c}(t,r),r&&((i=e.onNodeMarkedVisible)==null||i.call(e,t))},resetNodeVisibleState:c,cleanupNodeVisibility:function(t){var s;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(let[e,n]of i.entries())e<t||(n(),i.delete(e));for(let[n,i]of r.entries())n<t||(i.destroy(),r.delete(n),o(n),(s=e.onNodeVisibilityCleaned)==null||s.call(e,n));for(let e of Array.from(a.keys()))e<t||o(e);if(!n.value.size)return;let c=new Set;for(let e of n.value)e<t&&c.add(e);n.value=c},destroyNodeVisibilityState:function(){c();for(let e of i.values())e();i.clear();for(let e of r.values())e.destroy();r.clear(),s()}}}function KA(e){let{isClient:t,virtualizationEnabled:n,listenerEnabled:r,scrollRootElement:i,resolveScrollContainer:a,scheduleFocusSync:o,onScroll:s}=e,c=null,l=null,u=!1,d=null,f=e.requestFrame===void 0?typeof requestAnimationFrame==`function`?requestAnimationFrame:null:e.requestFrame,p=e.cancelFrame===void 0?typeof cancelAnimationFrame==`function`?cancelAnimationFrame:null:e.cancelFrame;function m(){d!=null&&(p?.(d),d=null),u=!1,c&&=(c(),null),l=null,i.value=null}function h(t){let n=e.getScrollTop?e.getScrollTop(t):t.scrollTop;return Math.max(0,Number.isFinite(n)?Math.abs(n):0)}return{cleanupScrollListener:m,setupScrollListener:function(){if(!t)return;if(!((e=r?.value)??n.value))return void m();var e;let p=a();if(!p)return void m();if(i.value===p&&c)return;m(),l=h(p);let g=()=>{s?.(),n.value&&(()=>{if(u)return;u=!0;let e=()=>{if(u=!1,d=null,n.value){let e=function(e){let t=h(e),n=l;l=t;let r=Math.max(480,.75*(e.clientHeight||0));return n==null?t>r?{immediate:!0}:void 0:Math.abs(t-n)>r?{immediate:!0}:void 0}(p);e?o(e):o()}};f?d=f(e):e()})()};p.addEventListener(`scroll`,g,{passive:!0}),i.value=p,c=()=>{p.removeEventListener(`scroll`,g)}}}}function qA(t={}){let n=D(``),r=D(``),i=D(!1),a=qt(t),o=()=>{let e=a.getSnapshot();n.value=e.source,r.value=e.visible,i.value=e.done},s=a.subscribe(o);o();let c=E(()=>Math.max(0,n.value.length-r.value.length)),l=E(()=>c.value===0),u=E(()=>i.value&&l.value);return e()&&N(()=>{s(),a.destroy()}),{source:n,visible:r,done:i,final:u,caughtUp:l,pendingChars:c,enqueue:e=>a.enqueue(e),finish:e=>a.finish(e),flush:e=>a.flush(e),reset:(e,t)=>a.reset(e,t),pause:()=>a.pause(),resume:()=>a.resume()}}var JA=/auto|scroll|overlay/i;function YA(e){if(!e)return!1;let t=(e.overflowY||``).toLowerCase(),n=(e.overflow||``).toLowerCase();return JA.test(t)||JA.test(n)}function XA(e){let t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}var ZA=p({name:`D2BlockNodeLoading`,props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){let t=E(()=>TT(_T(e.estimatedPreviewHeightPx)??kT(String(e.node.code??``))));return()=>l(`div`,{class:`d2-block-container rounded-lg border overflow-hidden`,style:{margin:`var(--ms-flow-diagram-y) 0`,background:`var(--diagram-bg)`,borderColor:`var(--diagram-border)`,color:`hsl(var(--ms-foreground))`,boxShadow:`var(--ms-shadow-subtle)`},"data-markstream-d2":`1`,"data-markstream-mode":`pending`},[e.showHeader?l(`div`,{class:`d2-block-header flex justify-between items-center border-b`,style:{padding:`var(--ms-inset-panel-y) var(--ms-inset-panel-x)`,background:`var(--diagram-header-bg)`,borderColor:`var(--diagram-border)`}},[l(`div`,{class:`flex items-center gap-x-2`},[l(`span`,{class:`d2-label font-medium font-mono`,style:{fontSize:`var(--ms-text-label)`,color:`var(--code-action-fg)`}},`D2`)]),l(`div`,{class:`d2-header-actions flex items-center`,"aria-hidden":`true`})]):null,l(`div`,{class:`d2-block-body`,style:{minHeight:`${t.value}px`}})])}}),QA={class:`m-0 p-0`},$A=[`data-probe`],ej=$(p(Q(Z({},{name:`HeightEstimationProbes`}),{__name:`HeightEstimationProbes`,props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){let t=e;function r(e){return t.headingNodes?.[e]??null}return(t,i)=>(B(),z(`div`,{class:`height-estimation-probes`,style:I({width:`${e.width}px`}),"aria-hidden":`true`},[T(`div`,{ref:t=>e.setParagraphWrapper(t),class:S([`node-content`,{"node-content-flow-root":e.flowRoot}]),"data-probe":`paragraph`},[n(F(ck),{node:e.paragraphNode,"index-key":`probe-paragraph`},null,8,[`node`])],2),T(`div`,{ref:t=>e.setListItemWrapper(t),class:S([`node-content`,{"node-content-flow-root":e.flowRoot}]),"data-probe":`list-item`},[T(`ul`,QA,[n(F(ek),{node:e.listItemNode,"index-key":`probe-list-item`},null,8,[`node`])])],2),T(`div`,{ref:t=>e.setListWrapper(t),class:S([`node-content`,{"node-content-flow-root":e.flowRoot}]),"data-probe":`list`},[n(F(tk),{node:e.listNode,"index-key":`probe-list`},null,8,[`node`])],2),(B(),z(w,null,o(6,t=>T(`div`,{key:`probe-heading-${t}`,ref_for:!0,ref:n=>e.setHeadingWrapper(t,n),class:S([`node-content`,{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${t}`},[n(F(YO),{node:r(t),"index-key":`probe-heading-${t}`},null,8,[`node`,`index-key`])],10,$A)),64))],4))}})),[[`__scopeId`,`data-v-3e0766e2`]]),tj=p({name:`InfographicBlockNodeLoading`,props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){let t=E(()=>wT(_T(e.estimatedPreviewHeightPx)??bT(String(e.node.code??``))));return()=>l(`div`,{class:`infographic-block-container rounded-lg border overflow-hidden`,style:{margin:`var(--ms-flow-diagram-y) 0`,background:`var(--diagram-bg)`,borderColor:`var(--diagram-border)`,color:`hsl(var(--ms-foreground))`},"data-markstream-infographic":`1`,"data-markstream-mode":`pending`},[e.showHeader?l(`div`,{class:`infographic-block-header flex justify-between items-center border-b`,style:{padding:`var(--ms-inset-panel-y) var(--ms-inset-panel-x)`,background:`var(--diagram-header-bg)`,borderColor:`var(--diagram-border)`,minHeight:`calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)`}},[l(`div`,{class:`flex items-center gap-x-2 overflow-hidden`},[l(`span`,{class:`icon-slot action-icon shrink-0`,style:{display:`inline-flex`,width:`var(--ms-action-btn-icon)`,height:`var(--ms-action-btn-icon)`}}),l(`span`,{class:`infographic-label font-medium font-mono truncate`,style:{fontSize:`var(--ms-text-label)`,color:`hsl(var(--ms-muted-foreground))`}},`Infographic`)]),l(`div`,{class:`infographic-header-actions flex items-center opacity-0 pointer-events-none`,style:{gap:`var(--ms-gap-header-actions)`},"aria-hidden":`true`},Array.from({length:4},()=>l(`span`,{class:`infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded`,style:{width:`calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))`,height:`calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))`}})))]):null,l(`div`,{class:`infographic-preview relative overflow-hidden block`,style:{height:`${t.value}px`,minHeight:`var(--ms-size-diagram-min-height)`,background:`var(--diagram-bg)`}},[l(`pre`,{class:`infographic-pending-source text-sm font-mono whitespace-pre-wrap`,style:{position:`absolute`,inset:`0`,zIndex:`1`,margin:`0`,padding:`var(--ms-inset-panel-body)`,overflow:`auto`,textAlign:`left`}},String(e.node.code??``)),l(`div`,{class:`absolute inset-0`},[l(`div`,{class:`w-full text-center flex items-center justify-center min-h-full`})])])])}}),nj=p({name:`MermaidBlockNodeLoading`,props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){let t=E(()=>ST(_T(e.estimatedPreviewHeightPx)??yT(String(e.node.code??``))));return()=>l(`div`,{class:`mermaid-block-container rounded-lg border overflow-hidden`,style:{margin:`var(--ms-flow-diagram-y) 0`,borderColor:`var(--diagram-border)`},"data-markstream-mermaid":`1`,"data-markstream-mode":`pending`},[e.showHeader?l(`div`,{class:`mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]`,style:{background:`var(--diagram-header-bg)`,borderColor:`var(--diagram-border)`}},[l(`div`,{class:`flex items-center gap-x-2 overflow-hidden`},[l(`span`,{class:`mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate`,style:{color:`var(--code-action-fg)`}},`Mermaid`)]),l(`div`,{class:`mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none`,"aria-hidden":`true`},Array.from({length:4},()=>l(`span`,{class:`mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded`},[l(`span`,{class:`action-icon block`})])))]):null,l(`div`,{class:`mermaid-preview-area relative overflow-hidden block`,style:{height:`${t.value}px`,minHeight:`var(--ms-size-diagram-min-height)`,background:`var(--diagram-bg)`}},[l(`pre`,{class:`mermaid-source-code text-sm font-mono whitespace-pre-wrap`,style:{position:`absolute`,inset:`0`,margin:`0`,padding:`var(--ms-inset-panel-body)`,overflow:`auto`,textAlign:`left`}},String(e.node.code??``)),l(`div`,{class:`_mermaid w-full text-center flex items-center justify-center min-h-full`,style:{fontFamily:`inherit`,contentVisibility:`auto`,contain:`content`,containIntrinsicSize:`var(--ms-size-diagram-min-height) 240px`}})])])}}),rj=p({name:`NodeRendererContent`,props:[`item`,`sourceNodes`,`fade`,`nestedRendererProps`],setup(e){let t=k(`markstreamTextFinal`,void 0),n=!0===t?.value;return v(()=>t?.value,e=>{n=!0===e},{flush:`sync`}),()=>l(M,{name:`fade`,css:!1!==e.fade&&!n,appear:!1!==e.fade&&!n},{default:()=>{let t=e.item;return t.rendersCustomNode?l(t.component,Z({key:0},t.customNodeProps),{default:()=>t.hasSlotChildren?l(lj,Q(Z({key:0},e.nestedRendererProps),{nodes:t.node.children,indexKey:t.indexKey,batchRendering:!1,deferNodesUntilVisible:!1,renderAsFragment:!0})):t.slotContent?l(lj,Q(Z({key:1},e.nestedRendererProps),{content:t.slotContent,final:!t.node.loading,indexKey:`${t.indexKey}-content`,smoothStreaming:!1,batchRendering:!1,deferNodesUntilVisible:!1,renderAsFragment:!0})):L(`v-if`,!0)}):l(t.component,Z({key:1},t.nodeProps))}})}}),ij={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:`auto`},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:`auto`},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:`auto`}};function aj(e){if(e==null)return``;if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}var oj=[`data-custom-id`],sj=[`data-node-index`,`data-node-type`],cj=`typewriter-simple-cursor-target`,lj=$(p(Q(Z({},{name:`NodeRenderer`}),{__name:`NodeRenderer`,props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockOptions:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:`auto`},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:[`copy`,`copy-code`,`handleArtifactClick`,`click`,`mouseover`,`mouseout`,`virtual-state-change`,`height-change`,`render-settled`,`render-final`,`anchor-change`],setup(e,{expose:n,emit:r}){let l=e,d=r;function f(e){if(!(typeof Event<`u`&&e instanceof Event))return typeof e==`string`&&d(`copy-code`,e),void d(`copy`,e)}function p(e){d(`handleArtifactClick`,e)}function m(e){d(`mouseover`,e)}function h(e){d(`mouseout`,e)}let C=i(),T=k(`markstreamNestedRendererProps`,void 0);function A(e){let t=C?.vnode.props;return!!t&&(Object.prototype.hasOwnProperty.call(t,e)||Object.prototype.hasOwnProperty.call(t,String(e).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)))}function j(e){let t=l[e];return A(e)?t:T?.value?.[e]??t}let M=E(()=>{return(e=j(`mode`))===`chat`||e===`minimal`||e===`docs`?e:`docs`;var e}),re=E(()=>Jk(j(`typewriter`))),ie=E(()=>re.value!==`off`),ae=E(()=>j(`domMode`)===`minimal`?`minimal`:`full`),oe=E(()=>!0===j(`renderCodeBlocksAsPre`)),se=E(()=>ij[M.value]),ce=E(()=>j(`showTooltips`)??se.value.showTooltips),le=E(()=>j(`fade`)??se.value.fade),ue=E(()=>j(`batchRendering`)??se.value.batchRendering),de=E(()=>j(`initialRenderBatchSize`)??se.value.initialRenderBatchSize),fe=E(()=>j(`renderBatchSize`)??se.value.renderBatchSize),pe=E(()=>j(`renderBatchDelay`)??se.value.renderBatchDelay),me=E(()=>j(`renderBatchBudgetMs`)??se.value.renderBatchBudgetMs),he=E(()=>j(`renderBatchIdleTimeoutMs`)??se.value.renderBatchIdleTimeoutMs),ge=E(()=>j(`deferNodesUntilVisible`)??se.value.deferNodesUntilVisible),_e=E(()=>j(`maxLiveNodes`)??se.value.maxLiveNodes),ve=E(()=>j(`liveNodeBuffer`)??se.value.liveNodeBuffer),be=E(()=>j(`nodeVirtual`)??se.value.nodeVirtual),H={get content(){return l.content},get nodes(){return l.nodes},get final(){return l.final},get parseOptions(){return j(`parseOptions`)},get customMarkdownIt(){return j(`customMarkdownIt`)},get debugPerformance(){return l.debugPerformance},get customHtmlTags(){return j(`customHtmlTags`)},get mode(){return j(`mode`)},get domMode(){return ae.value},get htmlPolicy(){return j(`htmlPolicy`)},get viewportPriority(){return j(`viewportPriority`)},get viewportPriorityOptions(){return j(`viewportPriorityOptions`)},get codeBlockStream(){return j(`codeBlockStream`)},get codeBlockDarkTheme(){return j(`codeBlockDarkTheme`)},get codeBlockLightTheme(){return j(`codeBlockLightTheme`)},get codeBlockMinWidth(){return j(`codeBlockMinWidth`)},get codeBlockMaxWidth(){return j(`codeBlockMaxWidth`)},get codeBlockOptions(){return j(`codeBlockOptions`)},get codeBlockProps(){return j(`codeBlockProps`)},get mermaidProps(){return j(`mermaidProps`)},get d2Props(){return j(`d2Props`)},get infographicProps(){return j(`infographicProps`)},get showTooltips(){return ce.value},get themes(){return j(`themes`)},get isDark(){return j(`isDark`)},get customId(){return j(`customId`)},get indexKey(){return l.indexKey},get typewriter(){return j(`typewriter`)},get smoothStreaming(){return l.smoothStreaming},get smoothStreamingOptions(){return j(`smoothStreamingOptions`)},get parseCoalesceMs(){return j(`parseCoalesceMs`)},get fade(){return le.value},get batchRendering(){return ue.value},get initialRenderBatchSize(){return de.value},get renderBatchSize(){return fe.value},get renderBatchDelay(){return pe.value},get renderBatchBudgetMs(){return me.value},get renderBatchIdleTimeoutMs(){return he.value},get deferNodesUntilVisible(){return ge.value},get maxLiveNodes(){return _e.value},get liveNodeBuffer(){return ve.value},get nodeVirtual(){return be.value},get virtualScroll(){return l.virtualScroll},get renderAsFragment(){return l.renderAsFragment}};function xe(e){d(`height-change`,e)}function Se(e){d(`virtual-state-change`,e)}function Ce(e){d(`anchor-change`,e)}let U=D(),we=D(null),Te=D(null),Ee=D(null),De=te({1:null,2:null,3:null,4:null,5:null,6:null}),Oe=D(!1),ke=new Map,Ae=D(0),je=!1,Me=D(0),Ne=D({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function Pe(e,t){return typeof e==`string`&&e.trim()||t}function Fe(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.max(1,Math.trunc(t)):640}let Ie=E(()=>{let e=H.viewportPriorityOptions??{},t=Pe(e.rootMargin,OD);return{rootMargin:t,heavyBlockMargin:Pe(e.heavyBlockMargin,t),maxTargets:Fe(e.maxTargets)}}),Le=E(()=>Ie.value.rootMargin??OD),Re=E(()=>Ie.value.maxTargets??640);function ze(){if(!0!==l.virtualScroll?.enabled)return null;let e=l.virtualScroll?.scrollRoot;return Be(typeof e==`function`?e():e)}function Be(e){return e?typeof HTMLElement<`u`&&e instanceof HTMLElement?e:typeof e==`object`&&`value`in e?Be(e.value):typeof e==`object`&&`$el`in e?Be(e.$el):null:null}t(TD,Ie);let{isClient:W,renderAsFragment:Ve,debugPerformanceEnabled:He,resolvedShowTooltips:Ue,resolvedHtmlPolicy:We,inheritedSmoothStreaming:Ge,ownsTypewriterCursor:Ke}=function(e){let t=typeof window<`u`,n=ee(),r=k(`markstreamHtmlPolicy`,void 0),i=k(`markstreamTypewriterCursor`,void 0),a=k(`markstreamSmoothStreaming`,void 0);return{isClient:t,renderAsFragment:E(()=>!0===e.renderAsFragment),debugPerformanceEnabled:E(()=>!!(e.debugPerformance&&t&&typeof console<`u`)),resolvedShowTooltips:E(()=>{if(typeof e.showTooltips==`boolean`)return e.showTooltips;let t=n.showTooltips??n[`show-tooltips`];return t===``||!0===t||t===`true`||!1!==t&&t!==`false`&&void 0}),resolvedHtmlPolicy:E(()=>e.htmlPolicy??r?.value??`safe`),inheritedSmoothStreaming:a,inheritedTypewriterCursor:i,ownsTypewriterCursor:E(()=>!0!==i?.value)}}(H),{resolveViewportRoot:qe,resolveScrollContainer:Je,isReverseFlexScrollRoot:Ye,getNormalizedScrollTop:Xe,getOffsetTopWithinRoot:G}=function(e,t){function n(){return t.scrollRoot?.call(t)??null}function r(t){if(typeof window>`u`)return null;let r=n();if(r)return r;let i=t??e.value;if(!i)return null;let a=i.ownerDocument||document,o=a.scrollingElement||a.documentElement,s=i;for(;s&&s!==a.body&&s!==o;){if(YA(window.getComputedStyle(s))&&XA(s))return s;s=s.parentElement}return null}function i(e){if(!t.isClient)return!1;try{let t=window.getComputedStyle(e);return!!(t.display||``).toLowerCase().includes(`flex`)&&(t.flexDirection||``).toLowerCase().endsWith(`reverse`)}catch{return!1}}function a(e,t,n){if(n)return o(t);let r=e.scrollTop;if(!i(e))return r;let a=r<0?-r:r;return Math.max(0,(e.scrollHeight??0)-(e.clientHeight??0))-a}function o(e){let t=Number(e.scrollingElement?.scrollTop),n=Number(e.documentElement?.scrollTop??0),r=Number(e.body?.scrollTop??0);return Math.max(0,Number.isFinite(t)?t:0,Number.isFinite(n)?n:0,Number.isFinite(r)?r:0)}return{resolveViewportRoot:r,resolveScrollContainer:function(t){let i=n();if(i)return i;let a=r(t??e.value??null);if(a)return a;let o=t?.ownerDocument??e.value?.ownerDocument??(typeof document<`u`?document:null);return o?.scrollingElement||o?.documentElement||null},isReverseFlexScrollRoot:i,getNormalizedScrollTop:a,getOffsetTopWithinRoot:function(e,t){let n=t.ownerDocument||e.ownerDocument||document;if(function(e,t){return e===t.documentElement||e===t.body||e===t.scrollingElement}(t,n))return e.getBoundingClientRect().top+o(n);let r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),s=a(t,n,!1);return i.top-r.top+s}}}(U,{isClient:W,scrollRoot:ze});t(`markstreamShowTooltips`,Ue),t(`markstreamHtmlPolicy`,We),t(`markstreamTypewriter`,ie),t(`markstreamFade`,E(()=>!1!==H.fade)),t(`markstreamTypewriterCursor`,E(()=>!0)),t(`markstreamTextStreamState`,ke),t(`markstreamStreamVersion`,Ae),t(`markstreamParseOptions`,E(()=>H.parseOptions)),t(`markstreamCustomMarkdownIt`,E(()=>H.customMarkdownIt));let{smoothStreamingEnabled:Ze,renderContent:Qe,requestedFinal:$e,effectiveFinal:et,scheduleFinalCleanup:tt}=function(e,t){let n=qA(Q(Z(Z({},jt),e.smoothStreamingOptions),{burstInitialContent:!1===e.fade&&!Yk(e.typewriter)})),r=!1!==e.smoothStreamingOptions?.flushOnFinish,i=D(!1),a=Mt(Q(Z({},n),{getSnapshot:()=>({source:n.source.value,pendingChars:n.pendingChars.value,caughtUp:n.caughtUp.value})}),{flushOnFinish:r,commit:e=>mE(null,null,function*(){e(),yield c()}),measure:t.measureFinalCommit,onReady:e=>{i.value=e}});N(a.dispose);let o=E(()=>!1!==e.smoothStreaming&&!e.nodes?.length&&(!0===e.smoothStreaming||!t.inheritedSmoothStreaming?.value)&&(!0===e.smoothStreaming||Yk(e.typewriter)||(e.maxLiveNodes??0)<=0)),l=D(!t.isClient||!0===e.smoothStreaming);s(()=>{l.value=!0});let u=E(()=>l.value&&o.value),d=E(()=>u.value?n.visible.value:e.content??``),f=E(()=>{let t=e.parseOptions??{};return e.final??t.final}),p=E(()=>{let e=f.value;return u.value&&e!=null?!!e&&i.value&&n.caughtUp.value:e});return v([()=>e.content,()=>e.nodes,u,f],([t,n,r,i])=>{a.update(t??``,!!n?.length,r,i,!1!==e.fade)},{immediate:!0}),{smoothStream:n,smoothStreamingEligible:o,smoothStreamingEnabled:u,renderContent:d,requestedFinal:f,effectiveFinal:p,scheduleFinalCleanup:a.scheduleCleanup}}(H,{isClient:W,inheritedSmoothStreaming:Ge,measureFinalCommit:()=>{var e;(e=U.value)==null||e.offsetHeight}}),nt=!0===$e.value,rt=k(`markstreamTextFinal`,void 0),it=E(()=>!0===$e.value||!0===rt?.value);t(`markstreamTextFinal`,it);let at=k(`markstreamFinalCleanup`,void 0);t(`markstreamFinalCleanup`,at??tt),v(it,e=>{var t;e&&((t=U.value)==null||t.querySelectorAll(`.fade-enter-from, .fade-enter-active, .fade-enter-to`).forEach(e=>{e.classList.remove(`fade-enter-from`,`fade-enter-active`,`fade-enter-to`)}))},{flush:`post`}),t(`markstreamSmoothStreaming`,Ze);let ot=D(!1),st=D(!1),ct=D(!1),lt=``,ut=!1,dt=null;function ft(){W&&dt!=null&&(window.clearTimeout(dt),dt=null)}function pt(){ot.value=!1,ft()}function mt(e,t){if(!He.value)return;let n=function(){if(!He.value)return null;let e=yt(ht),t=yt(gt),n=Math.max(vt,t);if(e<=0&&n<=0)return null;let r={total:e,maxPerFrame:n,byLabel:(i=ht,Object.fromEntries(Array.from(i.entries()).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))))};var i;return ht.clear(),gt.clear(),vt=0,r}();console.info(`[markstream-vue][perf] ${e}`,n?Q(Z({},t),{layoutReads:n}):t)}v([()=>H.indexKey,()=>H.customId],()=>{pt(),st.value=!1,ct.value=!l.nodes?.length&&!0!==$e.value&&!!l.content,lt=Qe.value??``,ut=lt.length>0},{flush:`sync`}),v([()=>l.content,()=>l.nodes,$e],([e,t,n])=>{!(t!=null&&t.length)&&!0!==n&&e&&(ct.value=!0)},{flush:`sync`,immediate:!0}),v([Qe,()=>l.nodes,et],([e,t,n])=>{let r=e??``;t?.length||!0===n?(pt(),st.value=!1,lt=r,ut=!0):(r.length>0&&(ct.value=!0),ut?(lt&&r.length>lt.length&&r.startsWith(lt)?(ot.value=!0,st.value=!0,W&&(ft(),dt=window.setTimeout(()=>{var e;dt=null,!0===et.value||(e=l.nodes)!=null&&e.length||(Ro(),ot.value=!1,Vo())},1200))):(r.length<lt.length||!r.startsWith(lt))&&(pt(),st.value=!1),lt=r):(lt=r,ut=!0))},{flush:`sync`,immediate:!0});let ht=new Map,gt=new Map,_t=!1,vt=0;function yt(e){let t=0;for(let n of e.values())t+=n;return t}function bt(){vt=Math.max(vt,yt(gt)),gt.clear(),_t=!1}function xt(e){e.maxPerFrame=Math.max(Number(e.maxPerFrame||0),Number(e.currentFrameTotal||0)),e.currentFrameTotal=0,e.frameScheduled=!1}function St(e){He.value&&(ht.set(e,(ht.get(e)??0)+1),gt.set(e,(gt.get(e)??0)+1),function(e){let t=function(){if(!W||typeof window>`u`)return null;let e=window;if(e.__markstreamLayoutReadPerformance)return e.__markstreamLayoutReadPerformance;let t={total:0,maxPerFrame:0,byLabel:{}};return e.__markstreamLayoutReadPerformance=t,t}();t&&(t.total=Number(t.total||0)+1,t.byLabel[e]=Number(t.byLabel[e]||0)+1,t.currentFrameTotal=Number(t.currentFrameTotal||0)+1,t.frameScheduled||(t.frameScheduled=!0,typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>xt(t)):typeof queueMicrotask==`function`?queueMicrotask(()=>xt(t)):setTimeout(()=>xt(t),0)))}(e),_t||(_t=!0,W&&typeof window<`u`&&typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(bt):typeof queueMicrotask==`function`?queueMicrotask(bt):setTimeout(bt,0)))}function K(e,t){return St(e),t()}let Ct=H.customId?`renderer-${H.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,wt=function(e){let t=new Map;return{scope:e,cache:t,clear:()=>t.clear()}}(Ct),Tt=Ct;t(Xk,wt);let Et=TE(()=>H.customId),{effectiveCustomHtmlTagsSet:Dt,mdInstance:Ot,mergedParseOptions:kt,parsedNodes:q,getParsedNodesDirtyStartIndex:Nt,getParsedNodesRevision:Pt}=WA(H,{instanceMsgId:Ct,renderContent:Qe,effectiveFinal:et,smoothStreamingEnabled:Ze,debugPerformanceEnabled:He,customComponentsMap:Et,logPerf:mt});v(q,()=>{ot.value||wt.clear(),Ae.value+=1,je&&$n(ji(q.value.length))},{immediate:!0});let Ft=E(()=>({customId:H.customId,customHtmlTags:kt.value.customHtmlTags,parseOptions:H.parseOptions,customMarkdownIt:H.customMarkdownIt,htmlPolicy:We.value,viewportPriority:H.viewportPriority,viewportPriorityOptions:Ie.value,mode:M.value,domMode:H.domMode,codeBlockStream:H.codeBlockStream,codeBlockDarkTheme:H.codeBlockDarkTheme,codeBlockLightTheme:H.codeBlockLightTheme,renderCodeBlocksAsPre:oe.value,codeBlockMinWidth:H.codeBlockMinWidth,codeBlockMaxWidth:H.codeBlockMaxWidth,codeBlockOptions:H.codeBlockOptions,codeBlockProps:H.codeBlockProps,mermaidProps:H.mermaidProps,d2Props:H.d2Props,infographicProps:H.infographicProps,showTooltips:Ue.value,themes:H.themes,isDark:H.isDark,typewriter:ie.value,smoothStreamingOptions:H.smoothStreamingOptions,parseCoalesceMs:H.parseCoalesceMs,fade:H.fade}));t(`markstreamNestedRendererProps`,Ft);let It=E(()=>q.value),Lt=E(()=>q.value.length),Rt=D(null),zt=D(null),Bt=D(null),Vt=D(null),Ht=l.indexKey!=null&&String(l.indexKey).startsWith(`list-item-`),Ut=!Ht&&H.customId?Ak(H.customId):null,Wt=E(()=>Ut?(kk.value,Ak(H.customId)):null),Gt=E(()=>!(Ve.value||!H.customId||Ht||!Wt.value?.enabled)),Kt=E(()=>!!(W&&Gt.value)),qt=E(()=>!(Ve.value||!l.virtualScroll?.enabled)),Jt=E(()=>qt.value),Yt=D(!1);s(()=>{Yt.value=!0});let Xt=E(()=>!!(W&&qt.value));t(`markstreamHostScrollManaged`,Xt);let Zt=E(()=>!!(Yt.value&&Xt.value)),Qt=E(()=>Kt.value||Xt.value);v(Qt,e=>{e&&Ok()},{immediate:!0});let $t=E(()=>Kt.value||Zt.value),en=E(()=>Qt.value&&!1!==Wt.value?.textEstimation);function tn(){if(Me.value>0)return Me.value;let e=K(`getMeasuredContainerWidth.clientWidth`,()=>U.value?.clientWidth||0);return Number.isFinite(e)&&e>0?e:0}let nn=E(()=>{let e=tn();return e>0?Math.max(1,Math.round(e)):640}),rn=E(()=>!(!0!==et.value||qt.value||M.value!==`chat`&&M.value!==`minimal`||A(`maxLiveNodes`)||A(`liveNodeBuffer`)||l.nodes?.length||ct.value||!((H.maxLiveNodes??0)<=0))),an=E(()=>rn.value?50:Math.max(1,H.maxLiveNodes??320)),on=E(()=>rn.value?16:Math.max(0,H.liveNodeBuffer??60)),J=E(()=>!Ve.value&&!1!==H.nodeVirtual&&!((H.maxLiveNodes??0)<=0&&!rn.value)&&(!0===H.nodeVirtual?q.value.length>0:q.value.length>an.value)),sn=E(()=>J.value||Kt.value||Xt.value),cn=E(()=>!1!==H.viewportPriority),ln=E(()=>!!cn.value&&!Oe.value);var un=E(()=>cn.value);t(ED,un);let dn=E(()=>!(Ve.value||!1===H.deferNodesUntilVisible||(H.maxLiveNodes??0)<=0||J.value||q.value.length>900||!1===H.viewportPriority)),fn=jD(e=>qe(e?.parentElement??U.value??null),cn),{requestFrame:pn,cancelFrame:mn,hasIdleCallback:hn,isTestEnv:gn}=function(e){return{requestFrame:e.isClient&&typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame.bind(window):null,cancelFrame:e.isClient&&typeof window.cancelAnimationFrame==`function`?window.cancelAnimationFrame.bind(window):null,hasIdleCallback:e.isClient&&typeof window.requestIdleCallback==`function`,isTestEnv:function(){return typeof globalThis>`u`||!(`process`in globalThis)?void 0:Object.getOwnPropertyDescriptor(globalThis,`process`)?.value?.env}()?.NODE_ENV===`test`}}({isClient:W}),_n=E(()=>!0===et.value&&!qt.value),{resolvedBatchSize:vn,resolvedInitialBatch:yn,batchingEnabled:bn,incrementalRenderingActive:xn,renderedCount:Sn,previousRenderContext:Cn,adaptiveBatchSize:wn,previousBatchConfig:Tn}=function(e,t){let n=E(()=>{let t=Math.trunc(e.renderBatchSize??80);return Number.isFinite(t)?Math.max(0,t):0}),r=E(()=>{let t=Math.trunc(e.initialRenderBatchSize??n.value);return Number.isFinite(t)?Math.max(0,t):n.value}),i=E(()=>!t.renderAsFragment.value&&!1!==e.batchRendering&&n.value>0&&t.isClient&&!t.isTestEnv),a=D(0),o=D({key:e.indexKey,total:0}),s=D(Math.max(1,n.value||1)),c=E(()=>i.value&&!t.continuousStreaming?.value&&!t.forceFullRenderFinalContent?.value&&(e.maxLiveNodes??0)<=0);return{resolvedBatchSize:n,resolvedInitialBatch:r,batchingEnabled:i,incrementalRenderingActive:c,renderedCount:a,previousRenderContext:o,adaptiveBatchSize:s,previousBatchConfig:D({batchSize:n.value,initial:r.value,delay:e.renderBatchDelay??16,enabled:c.value})}}(H,{isClient:W,isTestEnv:gn,renderAsFragment:Ve,forceFullRenderFinalContent:_n,continuousStreaming:E(()=>st.value&&!0!==et.value)}),En=E(()=>!Ve.value&&!1!==H.batchRendering&&vn.value>0&&!gn&&(H.maxLiveNodes??0)<=0&&!_n.value),Dn=E(()=>En.value),On=E(()=>Qt.value||Dn.value),kn=E(()=>On.value&&!1!==Wt.value?.codeBlockEstimation),An=new Map,jn=new Map,Mn=new Map,Nn=new WeakMap,Pn=null,Fn=[];v(()=>q.value.length,e=>{Fn.length>e&&(Fn.length=e)});let In=[],Ln=[],Rn=[],zn=[],Bn=-1,Vn=x(Ln),Hn=new Set,Un=D(0),Wn=0,Gn=D(0),Kn=E(()=>(Gn.value,Array.from(An.entries()).sort((e,t)=>e[0]-t[0]))),qn=D(null),Jn=D(null),Yn,Xn=null,Zn=0,Qn=null;function $n(e){Yn.markFallbackHeightPrefixDirty(e)}function er(e){return Yn.getFallbackNodeHeight(e)}function tr(e,t){return Yn.estimateHeightRange(e,t)}function nr(e){return Yn.estimateIndexForOffset(e)}let{activeRestoreAnchor:rr,getRelativeScrollTopWithinContainer:ir,setRelativeScrollTopWithinContainer:ar,resolveAnchorOffset:or,clearRestoreReconcile:sr,scheduleRestoreReconcile:cr,captureRestoreAnchor:lr,restoreAnchor:ur,getAnchorDrift:dr}=function(e){let{isClient:t,containerRef:n,parsedNodeCount:r,requestFrame:i,cancelFrame:a,resolveScrollContainer:o,getNormalizedScrollTop:s,getOffsetTopWithinRoot:c,isReverseFlexScrollRoot:l,estimateIndexForOffset:u,estimateHeightRange:d,getFallbackNodeHeight:f,clamp:p}=e,m=D(null),h=null,g=[];function _(){let e=o(),t=n.value;if(!e||!t)return null;let r=e.ownerDocument||t.ownerDocument||document;if(e===r.documentElement||e===r.body||e===r.scrollingElement){let e=t.getBoundingClientRect();return Math.max(0,-e.top)}return Math.max(0,s(e,r,!1)-c(t,e))}function v(e){var t;let r=o(),i=n.value;if(!r||!i)return;let a=Math.max(0,e),u=r.ownerDocument||i.ownerDocument||document,d=u.defaultView||(typeof window<`u`?window:null);if(r===u.documentElement||r===u.body||r===u.scrollingElement){let e=s(r,u,!0)+i.getBoundingClientRect().top;(t=d?.scrollTo)==null||t.call(d,0,Math.max(0,e+a))}else Kk(r,u,c(i,r)+a,{isReverseFlexScrollRoot:e=>{var t;return(t=l?.(e))!=null&&t},getNormalizedScrollTop:s})}function y(e){let t=r.value,n=p(e.nodeIndex,0,Math.max(0,t-1));return d(0,n)+Math.max(0,e.offsetWithinNodePx)}function b(){if(h!=null&&(a?.(h),h=null),t)for(let e of g)window.clearTimeout(e);g=[]}function x(e){let t=y(e),n=_();n!=null&&Math.abs(n-t)<=.5||v(t)}return{activeRestoreAnchor:m,getRelativeScrollTopWithinContainer:_,setRelativeScrollTopWithinContainer:v,resolveAnchorOffset:y,clearRestoreReconcile:b,applyRestoreAnchor:x,scheduleRestoreReconcile:function(){m.value&&t&&h==null&&(h=i?i(()=>{h=null,m.value&&x(m.value)}):null,h==null&&m.value&&x(m.value))},captureRestoreAnchor:function(){let e=_(),t=r.value;if(e==null||t<=0)return null;let n=p(u(e+1),0,t-1),i=d(0,n),a=f(n);return{nodeIndex:n,offsetWithinNodePx:p(e-i,0,Math.max(0,a-1))}},restoreAnchor:function(e){let n=r.value;if(m.value={nodeIndex:p(e.nodeIndex,0,Math.max(0,n-1)),offsetWithinNodePx:Math.max(0,e.offsetWithinNodePx)},b(),x(m.value),t)for(let e of[0,120,280,480])g.push(window.setTimeout(()=>{m.value&&x(m.value)},e))},getAnchorDrift:function(e){let t=_();return t==null?null:t-y(e)}}}({isClient:W,containerRef:U,parsedNodeCount:Lt,requestFrame:pn,cancelFrame:mn,resolveScrollContainer:()=>qn.value||Je(),getNormalizedScrollTop:Xe,getOffsetTopWithinRoot:G,isReverseFlexScrollRoot:Ye,estimateIndexForOffset:nr,estimateHeightRange:tr,getFallbackNodeHeight:er,clamp:Ai}),{nodeHeights:fr,heightStats:pr,heightTreeSize:mr,heightSumTree:hr,heightKnownTree:gr,averageNodeHeight:_r,resetHeightMeasurements:vr,pruneHeightMeasurements:yr,rebuildHeightTrees:br,syncHeightTreeSize:xr,recordNodeHeight:Sr,removeNodeHeights:Cr,exportHeightCache:wr,importHeightCache:Tr,fenwickRangeSum:Er}=function(e={}){let t=te({}),n=te({total:0,count:0}),r=D(0),i=D([]),a=D([]);function o(){for(let e of Object.keys(t))delete t[Number(e)];n.total=0,n.count=0,r.value=0,i.value=[],a.value=[]}function s(e,t,n){for(let r=t+1;r<e.length;r+=r&-r)e[r]+=n}function c(e,t){let n=0;for(let r=t+1;r>0;r-=r&-r)n+=e[r];return n}function l(e,t,n){if(n<=t)return 0;let r=c(e,n-1);return t<=0?r:r-c(e,t-1)}function u(e){r.value=e;let n=Array(e+1).fill(0),o=Array(e+1).fill(0);for(let[r,i]of Object.entries(t)){let t=Number(r),a=Number(i);!Number.isFinite(t)||t<0||t>=e||!Number.isFinite(a)||a<=0||(s(n,t,a),s(o,t,1))}i.value=n,a.value=o}function d(e){if(!Number.isInteger(e)||e<0)return!1;let o=t[e];if(!Number.isFinite(o)||o<=0)return!1;if(delete t[e],n.total=Math.max(0,n.total-o),n.count=Math.max(0,n.count-1),r.value>e){let t=i.value,n=a.value;t.length&&n.length&&(s(t,e,-o),s(n,e,-1))}return!0}return{nodeHeights:t,heightStats:n,heightTreeSize:r,heightSumTree:i,heightKnownTree:a,averageNodeHeight:E(()=>n.count>0?Math.max(12,n.total/n.count):32),resetHeightMeasurements:o,pruneHeightMeasurements:function(e){if(e<=0)return void o();let r=0,i=0;for(let[n,a]of Object.entries(t)){let o=Number(n),s=Number(a);!Number.isFinite(o)||o<0||o>=e||!Number.isFinite(s)||s<=0?delete t[o]:(r+=s,i++)}n.total=r,n.count=i},rebuildHeightTrees:u,syncHeightTreeSize:function(e){let n=r.value;if(e===n)return;if(e<n||n===0)return void u(e);let o=i.value,c=a.value;o.length=e+1,c.length=e+1;for(let t=n;t<e;t++)o[t+1]=0,c[t+1]=0;for(let r=n;r<e;r++){let e=Number(t[r]);!Number.isFinite(e)||e<=0||(s(o,r,e),s(c,r,1))}for(let t=n+1;t<=e;t++){let e=t-(t&-t);e>=n||(o[t]+=l(o,e,n),c[t]+=l(c,e,n))}r.value=e},recordNodeHeight:function(o,c,l={}){(function(o,c,l={}){var u;if(!Number.isFinite(c)||c<=0)return!1;let d=t[o];if(d&&(!1===l.allowShrink&&c<d||Math.abs(c-d)<=1))return!1;if(t[o]=c,d?n.total+=c-d:(n.total+=c,n.count++),r.value>o){let e=i.value,t=a.value;if(e.length&&t.length){if(d){let t=c-d;t!==0&&s(e,o,t)}else s(e,o,c),s(t,o,1)}}!1!==l.notify&&((u=e.onHeightRecorded)==null||u.call(e,o))})(o,c,Q(Z({},l),{notify:!0}))},removeNodeHeight:function(t,n={}){var r;let i=d(t);return i&&!1!==n.notify&&((r=e.onHeightRecorded)==null||r.call(e,t)),i},removeNodeHeights:function(t,n={}){var r;let i=0,a=1/0;for(let e of t){let t=Number(e);d(t)&&(i++,t<a&&(a=t))}return i>0&&!1!==n.notify&&((r=e.onHeightRecorded)==null||r.call(e,Number.isFinite(a)?a:void 0)),i},exportHeightCache:function(){return Object.entries(t).map(([e,t])=>({index:Number(e),height:Number(t)})).filter(e=>Number.isFinite(e.index)&&e.index>=0&&Number.isFinite(e.height)&&e.height>0).sort((e,t)=>e.index-t.index)},importHeightCache:function(i,a={}){var o;if(!Array.isArray(i))return;let s=r.value,c=!1;if(a.mode!==`merge`){let e=Object.keys(t);if(e.length>0){for(let n of e)delete t[Number(n)];c=!0}}for(let e of i){let n=Number(e.index),r=Number(e.height);if(!Number.isInteger(n)||n<0||s>0&&n>=s||!Number.isFinite(r)||r<=0)continue;let i=t[n];i&&Math.abs(i-r)<=1||(t[n]=r,c=!0)}c&&(function(){let e=0,i=0,a=r.value;for(let[n,r]of Object.entries(t)){let o=Number(n),s=Number(r);!Number.isFinite(o)||o<0||a>0&&o>=a||!Number.isFinite(s)||s<=0?delete t[o]:(e+=s,i++)}n.total=e,n.count=i}(),s>0&&u(s),(o=e.onHeightRecorded)==null||o.call(e))},fenwickRangeSum:l}}({onHeightRecorded:e=>{$n(e??0),Xt.value&&$o(),rr.value&&cr(),Jn.value&&Wa(),Mo(`node-resize`)}});function Dr(e){Number.isInteger(e)&&e>=0&&Hn.add(e)}function Or(e){for(let t of e)Dr(Number(t))}function kr(e){Wn++;let t=!0;try{let n=e();return t=!1!==n,n}finally{Wn--,Wn===0&&t&&Un.value++}}function Ar(){Rn=[],zn=[],Bn=-1,Hn.clear(),Vn.value=Ln}function jr(){Ar(),kr(()=>vr()),In.length=0}function Mr(e){!Number.isInteger(e)||e<0||e>=q.value.length||(In[e]=Ia(e))}function Nr(e,t,n={}){let r=fr[e];Dr(e),Sr(e,t,n);let i=fr[e];return Object.is(r,i)?(Hn.delete(e),!1):(i&&i>0?Mr(e):r&&e<In.length&&(In[e]=void 0),!0)}function Pr(e,t){let n=K(`getNodeLayoutHeight.content.offsetHeight`,()=>t.offsetHeight);return n>0?n:K(`getNodeLayoutHeight.slot.offsetHeight`,()=>An.get(e)?.offsetHeight??0)}function Fr(e,t={}){t.mode===`merge`?Or(e.map(e=>e.index)):Ar(),kr(()=>Tr(e,t)),co()}let Ir=E(()=>dn.value&&ln.value),Lr=E(()=>Qt.value||En.value||Ir.value&&q.value.length>yn.value),Rr=E(()=>!Ve.value&&!1!==H.batchRendering&&vn.value>0&&(H.maxLiveNodes??0)<=0),zr=E(()=>!Ve.value&&nt&&!0===et.value&&!J.value&&!qt.value&&!Gt.value&&!Ir.value&&!Rr.value),Br=E(()=>!!fn&&Ir.value),Vr=E(()=>[Br.value,Ir.value,J.value,Oe.value,Re.value,Le.value,yn.value,!!fn].join(`|`)),Hr=E(()=>J.value||Xt.value),{focusIndex:Ur,liveRange:Wr,updateLiveRange:Gr}=function(e,t){let{parsedNodeCount:n,virtualizationEnabled:r,maxLiveNodesResolved:i,liveNodeBufferResolved:a,clamp:o}=t,s=a??E(()=>Math.max(0,e.liveNodeBuffer??60)),c=D(0),l=te({start:0,end:0});return{liveNodeBufferResolved:s,focusIndex:c,liveRange:l,updateLiveRange:function(){let e=n.value;if(!r.value||e===0)return l.start=0,void(l.end=e);let t=Math.min(i.value,e),a=s.value,u=o(c.value-a,0,Math.max(0,e-t));l.start=u,l.end=Math.min(e,u+t)}}}(H,{parsedNodeCount:Lt,virtualizationEnabled:J,maxLiveNodesResolved:an,liveNodeBufferResolved:on,clamp:Ai}),Kr=new Map,qr=new Map,Jr=new Map,Yr=new Map,Xr=[],Zr=new Map,Qr=-1/0,$r=new Set,ei=D(0),ti=!1,ni=E(()=>(ei.value,$r.size)),ri=new Map,ii=new Map,ai=D(0),oi=0,si=E(()=>(ai.value,oi)),ci=null,li=E(()=>{if(!J.value)return q.value.length;let e=on.value,t=Math.max(Wr.end+e,yn.value),n=Math.min(q.value.length,t);return Math.max(Sn.value,n)});function ui(){ti||(ti=!0,queueMicrotask(()=>{ti=!1,ei.value+=1}))}function di(e,t,n=`node-resize`){if(!W||typeof window>`u`)return null;let r=window.setTimeout(()=>{$r.delete(r)&&ui();try{t()}finally{Mo(n)}},Math.max(0,e));return $r.add(r),ui(),r}function fi(e){W&&e!=null&&($r.delete(e)&&ui(),window.clearTimeout(e))}function pi(){if(W&&typeof window<`u`)for(let e of $r)window.clearTimeout(e);$r.size&&($r.clear(),ui()),Xr.length=0,Yr.clear()}function mi(e){we.value=e}function hi(e){Te.value=e}function gi(e){Ee.value=e}let{cancelScheduledFocusSync:_i,scheduleFocusSync:vi}=function(e){let{isClient:t,containerRef:n,virtualizationEnabled:r,requestFrame:i,cancelFrame:a,syncFocusToScroll:o}=e,s=null;function c(){return n.value?.ownerDocument?.defaultView??(typeof window<`u`?window:null)}function l(){if(!s)return;let e=c();s.viaTimeout?e?e.clearTimeout(s.id):clearTimeout(s.id):a?.(s.id),s=null}return{cancelScheduledFocusSync:l,scheduleFocusSync:function(e={}){if(!r.value)return;if(!t)return void o(!0);if(e.immediate)return l(),void o(!0);if(s)return;let n=()=>{s=null,o()};if(i)return void(s={id:i(n),viaTimeout:!1});let a=c();s={id:a?a.setTimeout(n,16):setTimeout(n,16),viaTimeout:!0}}}}({isClient:W,containerRef:U,virtualizationEnabled:J,requestFrame:pn,cancelFrame:mn,syncFocusToScroll:function(e=!1){if(!J.value)return;let t=qn.value||Je();if(!t)return;let n=t.ownerDocument||U.value?.ownerDocument||document,r=n?.defaultView||(typeof window<`u`?window:null),i=t===n?.documentElement||t===n?.body,a=q.value.length;if(a<=0)return;if(!i&&a>0&&Ye(t)){let n=K(`syncFocusToScroll.clientHeight`,()=>t.clientHeight||0),r=K(`syncFocusToScroll.scrollTop`,()=>t.scrollTop),i=r<0?-r:r;ki(Ai((o=Math.max(0,i)+.5*Math.max(0,n),Yn.estimateIndexForOffsetFromEnd(o)),0,Math.max(0,a-1)),e);return}var o;let s=function(e,t,n,r){let i=U.value;if(!i)return null;let a=r?0:K(`syncFocusToScroll.model.root.getBoundingClientRect`,()=>e.getBoundingClientRect().top),o=K(`syncFocusToScroll.model.container.getBoundingClientRect`,()=>i.getBoundingClientRect().top),s=Math.max(0,a-o),c=r?K(`syncFocusToScroll.model.viewport.clientHeight`,()=>n?.innerHeight??t.documentElement?.clientHeight??e.clientHeight??0):K(`syncFocusToScroll.model.root.clientHeight`,()=>e.clientHeight);return Ai(nr(s+.5*Math.max(0,c)),0,Math.max(0,q.value.length-1))}(t,n,r,i);if(s!=null)return void ki(s,e);let c=i?null:K(`syncFocusToScroll.root.getBoundingClientRect`,()=>t.getBoundingClientRect()),l=i?0:c.top,u=i?K(`syncFocusToScroll.viewport.clientHeight`,()=>r?.innerHeight??t.clientHeight??0):c.bottom,d=Kn.value,f=null,p=null;for(let[e,t]of d){if(!t)continue;let n=K(`syncFocusToScroll.slot.getBoundingClientRect`,()=>t.getBoundingClientRect());n.bottom<=l||n.top>=u||(f??=e,p=e)}if(f==null||p==null){let e=U.value;if(!e)return;let a=i?{top:0}:K(`syncFocusToScroll.fallback.root.getBoundingClientRect`,()=>t.getBoundingClientRect()),o=K(`syncFocusToScroll.fallback.scrollTop`,()=>Xe(t,n,i)),s=i?(()=>{let t=K(`syncFocusToScroll.fallback.container.getBoundingClientRect`,()=>e.getBoundingClientRect()),n=(i?0:a.top)-t.top;return Math.max(0,n)})():(()=>{let n=G(e,t);return Math.max(0,o-n)})(),c=i?K(`syncFocusToScroll.fallback.viewport.clientHeight`,()=>r?.innerHeight??n?.documentElement?.clientHeight??t.clientHeight??0):K(`syncFocusToScroll.fallback.root.clientHeight`,()=>t.clientHeight);ki(Ai(nr(s+.5*Math.max(0,c)),0,Math.max(0,q.value.length-1)),!0)}else ki(Math.round((f+p)/2),e)}}),{visibleNodeIndices:yi,nodeVisibilityHandles:bi,nodeVisibilityWatchStops:xi,nodeVisibilityFallbackTimers:Si,clearVisibilityFallback:Ci,markNodeVisible:wi,cleanupNodeVisibility:Ti,destroyNodeVisibilityState:Ei}=GA({isClient:W,shouldTrackVisibleNodeIndices:()=>Ir.value,shouldCleanupNodeVisibility:()=>J.value,onNodeMarkedVisible:e=>{J.value?vi():Ur.value=Ai(e,0,Math.max(0,q.value.length-1))},onNodeVisibilityCleaned:e=>{An.delete(e)&&No()}}),{cleanupScrollListener:Di,setupScrollListener:Oi}=KA({isClient:W,virtualizationEnabled:J,listenerEnabled:Hr,scrollRootElement:qn,resolveScrollContainer:Je,scheduleFocusSync:vi,onScroll:function(){let e=Jn.value;if(!e)return;let t=Ca();if(!t||function(e){if(So()>=Zn)return Qn=null,!1;let t=Qn;if(t==null)return!0;let n=Math.abs(e.scrollTop-t)<=2;return n||(Qn=null),n}(t))return;let n=Ta(t);(n==null||n<-32||Math.abs(Math.max(0,n)-Math.max(0,e.distanceFromBottomPx))>32)&&Ua(`restore`)},requestFrame:pn,cancelFrame:mn,getScrollTop:e=>{let t=e.ownerDocument||U.value?.ownerDocument||document,n=e===t.documentElement||e===t.body||e===t.scrollingElement;return K(`scrollListener.getScrollTop`,()=>Xe(e,t,n))}});function ki(e,t=!1){let n=Ai(e,0,Math.max(0,q.value.length-1));!t&&Math.abs(n-Ur.value)<=1||(Ur.value=n,Gr())}function Ai(e,t,n){return Math.min(Math.max(e,t),n)}function ji(e=q.value.length){let t=Nt();return!Number.isInteger(t)||t<0?e:Ai(t,0,e)}function Mi(e){return e?.firstElementChild}function Ni(e,t){return e?e.matches?.call(e,t)?e:e.querySelector(t):null}function Pi(e,t){e<1||e>6||(De[e]=t)}function Fi(){if(!Lr.value||typeof ResizeObserver>`u`)return void(Me.value=0);let e=K(`updateMeasuredContainerWidth.clientWidth`,()=>U.value?.clientWidth??0);Me.value=e>0?e:0}let Ii=null;function Li(){Ii?.disconnect(),Ii=null}let Ri=E(()=>oe.value?oO:sO);function zi(){return!1!==H.codeBlockProps?.showHeader}function Bi(){return!1!==H.codeBlockProps?.showCopyButton}function Vi(){let e=H.codeBlockProps?.showLineNumbers;return typeof e==`boolean`?e:!0!==H.codeBlockOptions?.disableLineNumbers}function Hi(e,t,n){let r=fr[t],i=typeof r==`number`&&r>0;if(en.value&&!i&&!function(e){return!!Et.value.paragraph&&(e.type===`paragraph`||e.type===`list_item`||e.type===`list`)}(e)){let t=Fk(e,n,Ne.value);if(t)return t}if(kn.value&&!i&&e.type===`code_block`){let t=function(e){if(e.type!==`code_block`)return null;let t=Vs(e,Is(e));return t===oO?`pre`:t===Ri.value||t===sO?`stream-diffs`:null}(e);if(t===`stream-diffs`||t===`pre`)return function(e,t){if(!e||e.type!==`code_block`)return null;let n=t.rendererKind,r=n!==`pre`&&!1!==t.showHeader,i=n===`pre`&&!1!==t.showHeader,a=!!e.diff,o=0,s=500;if(n===`stream-diffs`){let n=Rk(e,t.diffStyle),r=function(e){return e?0:16}(a);s=500,o=Math.round(n*18+r)}else{let n=At(t.codeBlockOptions),r=function(e,t,n){let r=Rk(e,t.diffStyle),i=Number(t.width);if(n.overflow!==`wrap`||!Number.isFinite(i)||i<=0)return r;let a=Math.max(1,.6*n.fontSize),o=!!e.diff,s=o&&ye({diffStyle:t.diffStyle});if(!o||s){let r=(o?Lk(e.raw)||[Lk(e.originalCode),Lk(e.updatedCode)].filter(Boolean).join(`
|
|
195
|
-
`):Lk(e.code,!0===e.loading)).split(/\r\n|\n|\r/),s=Bk(i,a,r.length,n,t,!1);return r.reduce((e,t)=>e+zk(t,s,n.tabSize),0)}let c=Lk(e.originalCode).split(/\r\n|\n|\r/),l=Lk(e.updatedCode).split(/\r\n|\n|\r/);if(e.originalCode==null&&e.updatedCode==null)return r;let u=Math.max(c.length,l.length),d=Bk(i,a,u,n,t,!0),f=0;for(let e=0;e<u;e++)f+=Math.max(zk(c[e]??``,d,n.tabSize),zk(l[e]??``,d,n.tabSize));return f}(e,t,n);o=Math.round(r*n.lineHeight+n.padding+n.paddingBottom),s=n.maxHeight}let c=Math.max(1,Math.min(o,s));return Z({kind:`code-block`,height:Math.round(c+(n===`pre`?i?37:0:r?40:0)),contentHeight:c,rendererKind:n},a&&n===`stream-diffs`?{diffInline:ye({diffStyle:t.diffStyle})}:{})}(e,{rendererKind:t,codeBlockOptions:H.codeBlockOptions,showHeader:zi(),showLineNumbers:Vi(),width:n,diffStyle:H.codeBlockOptions?.diffStyle})}return null}_(()=>{if(Un.value,Wn>0)return;let e=q.value,t=Pt();if(!e.length||!On.value)return Rn=[],zn=[],Bn=-1,Hn.clear(),void(Vn.value=Ln);let n=Me.value||K(`estimatedNodeHeights.clientWidth`,()=>U.value?.clientWidth||0);if(!Number.isFinite(n)||n<=0)return Rn=[],zn=[],Bn=-1,Hn.clear(),void(Vn.value=Ln);let r=function(e){let t=At(H.codeBlockOptions);return[Math.round(e),en.value,kn.value,Ne.value,t.fontSize,t.lineHeight,t.fontFamily,t.padding,t.paddingBottom,t.maxHeight,t.tabSize,t.overflow,H.codeBlockOptions?.diffStyle??`split`,Vi(),zi(),Bi(),oe.value,Et.value,kk.value]}(n),i=Rn.length<=e.length&&(o=r,(a=zn).length===o.length&&a.every((e,t)=>Object.is(e,o[t])));var a,o;let s=i&&Bn===t?e.length:i?ji(e.length):0,c=i?Array.from(Hn):[];Rn.length=e.length;for(let t=s;t<e.length;t++)Rn[t]=Hi(e[t],t,n);for(let t of c)t>=0&&t<e.length&&t<s&&(Rn[t]=Hi(e[t],t,n));Hn.clear(),zn=r,Bn=t,Vn.value=Rn,P(Vn)},{flush:`sync`});let Ui=E(()=>Vn.value);Yn=function(e){let t=!0,n=-1,r=[0],i=``,a=-1,o=new WeakMap;function s(e=0){t=!0,e<=0?n=0:(n<0||e<n)&&(n=e)}function c(t){let n=e.nodeHeights[t];if(Number.isFinite(n)&&n>0)return n;let r=e.parsedNodes.value[t],i=r?.type,a=!!e.hasCustomParagraphComponent?.call(e),s=e.estimatedNodeHeights.value[t],c=s?.height;if(!function(e,t,n){return!(!n||t?.kind!==`simple-text`||e!==`paragraph`&&e!==`list_item`&&e!==`list`)}(i,s,a)&&Number.isFinite(c)&&c>0)return c;let l=function(t,n){if(!t||typeof t!=`object`||!1===e.shouldCacheStaticFallbackHeight?.call(e))return oA(t,n);let r=t,i=o.get(r);if(i&&i.width===n)return i.height;let a=oA(t,n);return o.set(r,{width:n,height:a}),a}(r,e.getContainerWidth()||640);return i===`heading`||i===`paragraph`&&l<=28&&function(e,t){if(t)return!1;let n=e.children;return!Array.isArray(n)||!n.length||n.every(nA)}(r,a)?l:Math.max(e.averageNodeHeight.value,l)}function l(){let o=e.parsedNodes.value.length,l=e.getPrefixCacheKeyParts().join(`:`),u=r;i!==l&&(i=l,s(0));let d=e.averageNodeHeight.value;a!==d&&(a=d,s(0)),u.length>o+1&&(u.length=o+1,n>=0&&n>=u.length-1&&(t=!1));let f=u.length-1;if(!t){if(f===o)return u;n=f}let p=Math.min(n,f);u.length<o+1&&(u.length=o+1);for(let t=p;t<o;t++)u[t+1]=u[t]+(e.heightEstimationActive.value?c(t):e.nodeHeights[t]??d);return t=!1,n=o,u}function u(t){let n=e.parsedNodes.value.length;if(n<=0||t<=0)return 0;let r=l();if(t>=(r[n]??0))return n-1;let i=0,a=n-1,o=n-1;for(;i<=a;){let e=i+a>>1;(r[e+1]??0)>=t?(o=e,a=e-1):i=e+1}return o}function d(t,n){if(t>=n)return 0;if(e.heightEstimationActive.value)return function(t,n){let r=e.parsedNodes.value.length,i=sA(Math.trunc(t),0,r),a=sA(Math.trunc(n),i,r);if(i>=a)return 0;let o=l();return(o[a]??0)-(o[i]??0)}(t,n);if(e.heightTreeSize.value!==e.parsedNodes.value.length){let r=0;for(let i=t;i<n;i++)r+=e.nodeHeights[i]??e.averageNodeHeight.value;return r}let r=e.heightSumTree.value,i=e.heightKnownTree.value;if(!r.length||!i.length){let r=0;for(let i=t;i<n;i++)r+=e.nodeHeights[i]??e.averageNodeHeight.value;return r}return e.fenwickRangeSum(r,t,n)+(n-t-e.fenwickRangeSum(i,t,n))*e.averageNodeHeight.value}function f(t){if(t<=0)return 0;let n=e.parsedNodes.value;if(e.heightEstimationActive.value)return u(t);if(e.heightTreeSize.value===n.length&&e.heightSumTree.value.length&&e.heightKnownTree.value.length){let r=e.averageNodeHeight.value,i=e.heightSumTree.value,a=e.heightKnownTree.value,o=t=>t<=0?0:e.fenwickRangeSum(i,0,t)+(t-e.fenwickRangeSum(a,0,t))*r,s=0,c=n.length-1,l=n.length-1;for(;s<=c;){let e=s+c>>1;o(e+1)>=t?(l=e,c=e-1):s=e+1}return l}let r=t;for(let t=0;t<n.length;t++){let n=e.nodeHeights[t]??e.averageNodeHeight.value;if(r<=n)return t;r-=n}return Math.max(0,n.length-1)}function p(){if(!e.heightEstimationActive.value)return 0;let t=0,n=e.estimatedNodeHeights.value;for(let r=0;r<n.length;r++){if(!n[r])continue;let i=e.nodeHeights[r];Number.isFinite(i)&&i>0||t++}return t}return{markFallbackHeightPrefixDirty:s,getFallbackNodeHeight:c,estimateHeightRange:d,estimateIndexForOffset:f,estimateIndexForOffsetFromEnd:function(t){let n=e.parsedNodes.value;if(!n.length)return 0;if(t<=0)return Math.max(0,n.length-1);if(e.heightEstimationActive.value){let e=l()[n.length]??0;return u(Math.max(0,e-t))}if(e.heightTreeSize.value===n.length){let e=d(0,n.length);return f(Math.max(0,e-t))}let r=t;for(let t=n.length-1;t>=0;t--){let n=e.nodeHeights[t]??e.averageNodeHeight.value;if(r<=n)return t;r-=n}return 0},getEstimatedNodeHeightCount:p,buildVirtualHeightSummary:function(t){let n=e.parsedNodes.value.length;return{totalNodes:n,measuredCount:e.heightStats.count,estimatedCount:p(),averageNodeHeight:e.averageNodeHeight.value,topSpacerHeight:t.topSpacerHeight,bottomSpacerHeight:t.bottomSpacerHeight,estimatedTotalHeight:d(0,n),width:t.width??e.getContainerWidth()}}}}({parsedNodes:q,nodeHeights:fr,heightStats:pr,heightTreeSize:mr,heightSumTree:hr,heightKnownTree:gr,averageNodeHeight:_r,heightEstimationActive:Qt,estimatedNodeHeights:Ui,getContainerWidth:tn,shouldCacheStaticFallbackHeight:()=>!l.nodes?.length,hasCustomParagraphComponent:()=>!!Et.value.paragraph,getPrefixCacheKeyParts:()=>{let e=eA(Me.value||K(`getFallbackHeightPrefix.clientWidth`,()=>U.value?.clientWidth||0));return[l.virtualScroll?.measurementKey==null?``:String(l.virtualScroll.measurementKey),e,+!!Qt.value,kk.value,+!!Et.value.paragraph]},fenwickRangeSum:Er}),je=!0,v(()=>q.value.length,(e,t)=>{var n;$n(t!=null&&e>=t?ji(e):0),e<=0?jr():(e<mr.value&&(n=e,Ar(),kr(()=>yr(n))),xr(e))},{immediate:!0});let Wi=E(()=>{if(!J.value)return q.value.map((e,t)=>({node:e,index:t}));let e=q.value.length,t=Ai(Wr.start,0,e),n=Ai(Wr.end,t,e);return q.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),Gi=E(()=>J.value?tr(0,Math.min(Wr.start,q.value.length)):0),Ki=E(()=>{if(!J.value)return 0;let e=q.value.length;return tr(Math.min(Wr.end,e),e)});function qi(){return Yn.buildVirtualHeightSummary({topSpacerHeight:Gi.value,bottomSpacerHeight:Ki.value,width:na()})}function Ji(){let e=q.value;return Q(Z({},qi()),{probe:{paragraphReady:!!Ne.value.paragraph,listItemReady:!!Ne.value.listItem,listWrapperOverhead:Ne.value.listWrapperOverhead,headingReadyLevels:Object.entries(Ne.value.headings).filter(([,e])=>!!e).map(([e])=>Number(e))},nodes:e.map((e,t)=>({index:t,type:e.type,estimateKind:Ui.value[t]?.kind??null,rendererKind:Ui.value[t]?.rendererKind??null,estimatedHeight:Ui.value[t]?.height??null,estimatedContentHeight:Ui.value[t]?.contentHeight??null,measuredHeight:fr[t]??null}))})}function Yi(){return l.indexKey==null?qt.value?`virtual-${Zi()}`:`markdown-renderer`:String(l.indexKey)}function Xi(e){let t=String(e),n=`${Yi()}-`;if(!t.startsWith(n))return null;let r=t.slice(n.length).match(/^(\d+)(?:$|-)/);if(!r)return null;let i=Number(r[1]);return!Number.isInteger(i)||i<0||i>=q.value.length?null:i}function Zi(){let e=l.virtualScroll?.sessionKey;return String(e!=null&&e!==``?e:l.indexKey??H.customId??Ct)}function Qi(){let e=l.virtualScroll?.threadKey;return e==null||e===``?void 0:String(e)}let $i=E(()=>Qi()??String(l.indexKey??H.customId??Ct));function ea(e){return(e??``)===(Qi()??``)}function ta(){var e=l.virtualScroll?.measurementKey,t=function(e){let t=e.codeBlockProps,n=e.codeBlockOptions,r=n?.parseDiffOptions;return[e.isDark?`dark`:`light`,e.renderCodeBlocksAsPre?`code-pre`:`code-rich`,!1===e.codeBlockStream?`code-static`:`code-stream`,aj(e.codeBlockMinWidth),aj(e.codeBlockMaxWidth),aj(n?.fontSize),aj(n?.lineHeight),aj(n?.fontFamily),aj(n?.maxHeight),aj(n?.tabSize),aj(n?.padding),aj(n?.overflow),aj(n?.disableLineNumbers),aj(n?.diffStyle),aj(n?.diffIndicators),aj(n?.hunkSeparators),aj(n?.expandUnchanged),aj(n?.collapsedContextThreshold),aj(n?.expansionLineCount),aj(r?.context),aj(t?.showHeader),aj(t?.showCopyButton),aj(t?.showExpandButton),aj(t?.showPreviewButton),aj(t?.showCollapseButton),aj(t?.showFontSizeButtons),aj(t?.showLineNumbers)].join(`\0`)}({renderCodeBlocksAsPre:oe.value,isDark:H.isDark,codeBlockStream:H.codeBlockStream,codeBlockMinWidth:H.codeBlockMinWidth,codeBlockMaxWidth:H.codeBlockMaxWidth,codeBlockOptions:H.codeBlockOptions,codeBlockProps:H.codeBlockProps});return[e==null?``:String(e),t].join(`\0`)}function na(){return tn()}let ra=E(()=>eA(na())),ia=E(()=>[ta(),ra.value].join(`\0`)),aa=E(()=>qt.value?[`virtual`,Qi()??``,Zi(),ia.value].join(`\0`):l.indexKey);function oa(){ai.value+=1}function sa(e){return!(!e||!Number.isInteger(e.index)||e.index<0||e.index>=q.value.length||e.sessionKey!==Zi()||e.threadKey!==Qi()||e.layoutEpochKey!==ia.value)}function ca(e){let t=String(e),n=ii.get(t);return n?sa(n)?n.index:null:Xi(t)}function la(e=`async-node`){(ri.size||ii.size)&&(oi=0,ri.clear(),ii.clear(),oa(),Mo(e))}let ua=k(Cw,null),da={reportHeight(e,t){if(!Xt.value)return;let n=ca(e);if(n==null)return;let r=Kr.get(n);if(!r)return;let i=Number(t),a=Pr(n,r);(function(e,t,n={}){kr(()=>Nr(e,t,n))})(n,Number.isFinite(i)&&i>0?Math.max(i,a||0):a)},markPending(e){if(!Xt.value)return;let t=Xi(e);t!=null&&function(e,t){let n=ii.get(e);if(n&&sa(n))return ri.set(e,Math.max(0,ri.get(e)??0)+1),oi+=1,oa(),void Mo(`async-node`);ri.set(e,1),oi+=1,ii.set(e,function(e){return{index:e,sessionKey:Zi(),threadKey:Qi(),layoutEpochKey:ia.value}}(t)),oa(),Mo(`async-node`)}(String(e),t)},markSettled(e){if(!Xt.value)return;let t=String(e),n=ca(e);if((n!=null||function(e){return ri.has(String(e))}(t))&&function(e){let t=ri.get(e)??0;return!(t<=0||(t<=1?(ri.delete(e),ii.delete(e)):ri.set(e,t-1),oi=Math.max(0,oi-1),oa(),t===1&&Mo(`async-node`),0))}(t)&&n!=null){let e=Kr.get(n);e&&Bo(n,e)}}};function fa(e){if(e!==void 0)return e;let t=0;for(let e of Kr.values())t+=K(`getVisibleDomHeight.offsetHeight`,()=>e.offsetHeight);return t}t(Cw,{reportHeight(e,t){da.reportHeight(e,t),ua?.reportHeight(e,t)},markPending(e){da.markPending(e),ua?.markPending(e)},markSettled(e){da.markSettled(e),ua?.markSettled(e)}});let pa,ma=null,ha=null;function ga(e){return!1!==e&&e!=null&&e!==``}function _a(){return J.value?function(){if(!J.value)return!0;let e=q.value.length,t=Ai(Wr.start,0,e),n=Ai(Wr.end,t,e);if(t>=n)return!0;for(let e=t;e<n;e++)if(!An.has(e)||Po(e)&&!Kr.has(e))return!1;return!0}():Sn.value>=li.value}function va(){return!0===et.value&&!ot.value&&si.value===0&&$r.size===0&&Zr.size===0&&ci==null&&_a()}function ya(){if(l.virtualScroll?.settleMode!==`manual`||ma===Zi()&&pa===Qi())return!0;let e=l.virtualScroll?.settledToken;return!!ga(e)&&ha===ns(e)}function ba(){return va()&&ya()}function xa(e,t){return t.totalNodes<=0?e===`final`?`final`:`estimate`:t.measuredCount>=t.totalNodes?e===`final`?`final`:`measured`:t.measuredCount>0||t.estimatedCount>0?`mixed`:`estimate`}function Sa(e=`manual`,t,n){let r=qi(),i=function(e){return e||(!0===et.value?!_a()||Zr.size>0||ci!=null?`measuring`:ba()?`settled`:`settling`:q.value.length>0?`streaming`:`estimating`)}(t);return{sessionKey:Zi(),threadKey:Qi(),phase:i,nodeCount:r.totalNodes,liveRange:{start:Wr.start,end:Wr.end},renderedCount:Sn.value,measuredCount:r.measuredCount,estimatedCount:r.estimatedCount,averageNodeHeight:r.averageNodeHeight,topSpacerHeight:r.topSpacerHeight,bottomSpacerHeight:r.bottomSpacerHeight,visibleDomHeight:fa(n),totalHeight:wa(r),width:r.width,final:!0===et.value,stable:ba(),confidence:xa(i,r),reason:e}}function Ca(){let e=qn.value||Je(),t=U.value;if(!e||!t)return null;let n=e.ownerDocument||t.ownerDocument||document,r=e===n.documentElement||e===n.body||e===n.scrollingElement;return{root:e,doc:n,isViewportRoot:r,scrollTop:K(`getScrollBox.scrollTop`,()=>Xe(e,n,r)),scrollHeight:K(`getScrollBox.scrollHeight`,()=>r?Math.max(n.documentElement?.scrollHeight??0,n.body?.scrollHeight??0,e.scrollHeight??0):e.scrollHeight),clientHeight:K(`getScrollBox.clientHeight`,()=>r?n.documentElement?.clientHeight||e.clientHeight||0:e.clientHeight)}}function wa(e){let t=q.value.length,n=Math.max(0,tr(0,t)),r=K(`getRendererLogicalHeight.offsetHeight`,()=>U.value?.offsetHeight??0),i=Math.max(0,r>0?r:K(`getRendererLogicalHeight.scrollHeight`,()=>U.value?.scrollHeight??0));return t<=0?Math.ceil(r):J.value?n>0?Math.max(1,Math.ceil(n),function(){let e=Gi.value+Ki.value;for(let t of An.values())t&&(e+=Math.max(0,K(`getVirtualizedDomLogicalHeight.offsetHeight`,()=>t.offsetHeight||0)));return Math.ceil(Math.max(0,e))}(),function(e,t){return e<=0||t<=0?0:t<=e+Math.max(512,.05*e)?Math.ceil(t):0}(n,i)):Math.max(1,Math.ceil(i)):Xt.value?n>0||pr.count>0||(e?.estimatedCount??Yn.getEstimatedNodeHeightCount())>0?(xn.value&&Sn.value,Math.max(1,Math.ceil(i),Math.ceil(n))):Math.ceil(i):Math.max(1,Math.ceil(i),Math.ceil(n))}function Ta(e){let t=U.value;if(!t)return null;let n=K(`getRendererBottomDistanceFromViewport.getBoundingClientRect`,()=>t.getBoundingClientRect());return function(e){return e.isViewportRoot?e.clientHeight:K(`getViewportBottomInRoot.getBoundingClientRect`,()=>e.root.getBoundingClientRect().bottom)}(e)-n.bottom}function Ea(e={}){let t=!1!==e.requireViewport,n=function(e=64){let t=Ca(),n=U.value;if(!t||!n)return!1;let r=function(e){if(e.isViewportRoot)return{top:0,bottom:e.clientHeight};let t=K(`getVirtualViewportRect.getBoundingClientRect`,()=>e.root.getBoundingClientRect());return{top:t.top,bottom:t.bottom}}(t),i=K(`isRendererNearVirtualViewport.getBoundingClientRect`,()=>n.getBoundingClientRect());return i.bottom>=r.top-e&&i.top<=r.bottom+e}();if(t&&!n)return null;let r=function(){let e=Ca(),t=U.value;if(!e||!t||Math.max(0,e.scrollHeight-e.scrollTop-e.clientHeight)>64)return null;let n=Ta(e);return n==null?null:n>=-8&&n<=160?{type:`bottom`,distanceFromBottomPx:Math.max(0,n)}:null}();if(r)return{anchor:r,captured:!0};let i=lr();if(i)return{anchor:{type:`node`,nodeIndex:i.nodeIndex,offsetWithinNodePx:i.offsetWithinNodePx},captured:n};if(!0===e.allowFallback){let e=function(){let e=q.value.length;return e<=0?null:{type:`node`,nodeIndex:Ai(Ur.value,0,Math.max(0,e-1)),offsetWithinNodePx:0}}();return e?{anchor:e,captured:!1}:null}return null}function Da(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Oa(e,t){let n=e;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n^=31,n=Math.imul(n,16777619),n}let ka=new Set([`children`,`items`,`header`,`rows`,`cells`,`attrs`,`data`,`term`,`definition`]);function Aa(e,t=new WeakSet,n=0){if(e==null||typeof e==`number`||typeof e==`boolean`)return String(e);if(typeof e==`string`)return`s:${function(e){let t=e.length>8192?`${e.slice(0,8192)}...${e.length}`:e;return`${e.length}:${Da(t)}`}(e)}`;if(typeof e==`function`)return`fn`;if(typeof e!=`object`)return typeof e;if(t.has(e))return`cycle`;if(n>=6)return`max-depth`;t.add(e);try{if(Array.isArray(e)){if(e.length<=160){let r=[];for(let i=0;i<e.length;i++)r.push(Aa(e[i],t,n+1));return`a:${e.length}:${r.join(`,`)}`}let r=[],i=[],a=Math.max(0,e.length-32),o=2166136261;for(let s=0;s<e.length;s++){let c=Aa(e[s],t,n+1);o=Oa(o,c),s<32&&r.push(c),s>=a&&i.push(c)}return[`a:${e.length}`,`h=${r.join(`,`)}`,`t=${i.join(`,`)}`,`all=${(o>>>0).toString(36)}`].join(`:`)}let r=e,i=Object.keys(r).filter(e=>{let t=r[e];return e!==`parent`&&e!==`el`&&e!==`component`&&(t==null||typeof t==`string`||typeof t==`number`||typeof t==`boolean`||ka.has(e))}).sort();return`o:${i.length}:${i.map(e=>`${e}=${Aa(r[e],t,n+1)}`).join(`;`)}`}finally{t.delete(e)}}let ja=-1,Ma=new Map,Na=-1,Pa=``,Fa=[2166136261];function Ia(e){let t=q.value[e],n=Pt();if(ja!==n&&(ja=n,Ma.clear()),!t)return``;if(l.nodes?.length||H.parseOptions||H.customMarkdownIt||Ot.value.__markstreamHasCustomParserExtensions||Object.keys(Et.value).length!==0)return Da(Aa(t));let r=Ma.get(e);if(r!==void 0)return r;let i=Da(Aa(t));return Ma.set(e,i),i}function La(e,t){let n=e;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n>>>0}function Ra(){let e=Ae.value;if(Na===e)return Pa;let t=q.value.length,n=ji(t);(Na!==e-1||n>t||Fa.length<n+1)&&(n=0),n===0?Fa=[2166136261]:Fa.length=n+1;for(let e=n;e<t;e++){let t=Ia(e);Fa[e+1]=La(Fa[e]??2166136261,t)}return Fa.length=t+1,Pa=((Fa[t]??2166136261)>>>0).toString(36),Na=e,Pa}function za(e,t={}){let n=!0===t.includeHeightCache,r=t.includeContentHash??n,i=n?function(e){let t=function(){let e=Number(l.virtualScroll?.heightCacheLimit??5e3);return!Number.isFinite(e)||e<=0?1/0:Math.max(1,Math.trunc(e))}();if(!Number.isFinite(t)||e.length<=t)return e;let n=new Map,r=e=>{!e||n.size>=t||n.set(e.index,e)},i=q.value.length,a=Ai(Wr.start-2*on.value,0,i),o=Ai(Wr.end+2*on.value,a,i);for(let t of e)t.index>=a&&t.index<o&&r(t);let s=Math.max(1,Math.ceil(e.length/t));for(let i=0;i<e.length&&n.size<t;i+=s)r(e[i]);for(let i=e.length-1;i>=0&&n.size<t;i-=s)r(e[i]);return Array.from(n.values()).sort((e,t)=>e.index-t.index).slice(0,t)}(wr().map(e=>{let t=q.value[e.index];return t?Q(Z({},e),{nodeType:String(t.type??``),signature:Ia(e.index)}):null}).filter(e=>!!e)):[],a=Ea({allowFallback:!0===t.allowAnchorFallback,requireViewport:t.requireViewport});return a||i.length||!0===t.includeEmptyState?Q(Z({sessionKey:e.sessionKey,threadKey:e.threadKey},a?{anchor:a.anchor,anchorCaptured:a.captured}:{anchorCaptured:!1}),{metrics:e,width:e.width,contentHash:r?Ra():void 0,measurementKey:ta()||void 0,heightCache:i.length?i:void 0}):null}function Ba(e){var t,n;let r=Ca();if(!r)return;let i=function(e){let t=U.value;if(!t)return null;let n=G(t,e.root),r=q.value.length,i=K(`getRendererBottomOffsetWithinRoot.offsetHeight`,()=>t.offsetHeight||0),a=Math.max(0,i>0?i:r>0?K(`getRendererBottomOffsetWithinRoot.scrollHeight`,()=>t.scrollHeight||0):0),o=wa();return n+Math.max(a,o)}(r);if(i==null)return;let a=Math.max(0,e.distanceFromBottomPx),o=Math.max(0,i-r.clientHeight-a);(function(e){Zn=So()+120,Qn=e})(o),r.isViewportRoot?(n=(t=r.doc.defaultView)?.scrollTo)==null||n.call(t,0,o):Kk(r.root,r.doc,o,{isReverseFlexScrollRoot:Ye,getNormalizedScrollTop:Xe})}let Va=[];function Ha(){if(W)for(Xn!=null&&(mn?.(Xn),Xn=null);Va.length;){let e=Va.pop();e!=null&&window.clearTimeout(e)}}function Ua(e){let t=!!Jn.value;Jn.value=null,Zn=0,Qn=null,Ha(),t&&e&&Mo(e)}function Wa(){if(!Jn.value||!W||Xn!=null)return;let e=()=>{Xn=null;let e=Jn.value;e&&Ba(e)};Xn=pn?pn(e):null,Xn??e()}function Ga(e,t={}){let n=q.value.length;return n<=0?[]:e.filter(e=>!(!Number.isInteger(e.index)||e.index<0||e.index>=n)&&!(!Number.isFinite(e.height)||e.height<=0)&&!(t.requireSignature&&!e.signature)&&!(t.requireCompatibilityMetadata&&!e.nodeType&&!e.signature)&&function(e){let t=q.value[e.index];return!(!t||e.nodeType&&e.nodeType!==String(t.type??``)||e.signature&&e.signature!==Ia(e.index))}(e))}function Ka(e){let t=eA(na()),n=eA(e);return t!==-1&&n!==-1&&t===n}function qa(e){let t=Number(e?.width);if(Number.isFinite(t)&&t>0)return t;let n=Number(e?.metrics?.width);return Number.isFinite(n)&&n>0?n:null}function Ja(e){return e.sessionKey===Zi()&&!!ea(e.threadKey)&&(e.measurementKey??``)===ta()&&!!Ka(qa(e))&&!!function(e){let t=e.heightCache;return!!t?.length&&(Ya(e)?t.some(e=>!!(e.nodeType||e.signature)):t.some(e=>!!e.signature))}(e)}function Ya(e){return!!(e.contentHash&&e.contentHash===Ra())}function Xa(e){return!Ya(e)}let Za=null,Qa=null,$a=null,eo=null,to=null;function no(e){let t=e.map(e=>[e.index,Math.round(10*e.height),e.nodeType??``,e.signature??``].join(``)).join(``),n=eA(na());return[Qi()??``,Zi(),ta(),q.value.length,n,e.length,Da(t)].join(`:`)}function ro(e=(e=>(e=l.virtualScroll)?.heightCache)()){if(!Xt.value||!e?.length||q.value.length<=0||!Ka((t=l.virtualScroll)?.heightCacheWidth))return!1;var t;let n=Ga(e,{requireSignature:!0});if(!n.length)return!1;let r=no(n);return r===Za?(Qa=`standalone`,!0):(Fr(n,{mode:`merge`}),$n(),Za=r,Qa=`standalone`,Eo(),Mo(`restore`),!0)}function io(){let e=l.virtualScroll?.restoreAnchor;return e==null||!1===e?null:!0===e?`true`:String(e)}function ao(e,t={}){if(!Xt.value||!e||e.sessionKey!==Zi()||!ea(e.threadKey)||q.value.length<=0)return!1;let n=!!e.heightCache?.length&&!oo(),r=!e.anchor||!1===e.anchorCaptured&&!0!==t.allowUncapturedAnchor?null:e.anchor,i=!0===t.restoreAnchor&&!!r&&!oo()&&Number(qa(e))>0,a=!1;if(e.heightCache?.length&&Ja(e)){let t=Ga(e.heightCache,{requireCompatibilityMetadata:!e.contentHash,requireSignature:Xa(e)});t.length&&(Fr(t,{mode:`merge`}),$n(),Za=no(t),Qa=`restore`,Eo(),a=!0)}if(n||i)return!1;if(!t.restoreAnchor||!r)return a&&Mo(`restore`),!0;let o=function(e,t){let n=e.anchor,r=n?n.type===`bottom`?`bottom:${Math.round(n.distanceFromBottomPx)}`:`node:${n.nodeIndex}:${Math.round(n.offsetWithinNodePx)}`:`none`;return[Qi()??``,Zi(),ta(),ra.value,t,r].join(`:`)}(e,t.restoreToken??`imperative`);return $a===o?(a&&Mo(`restore`),!0):($a=o,function(e){let t=()=>{if(e.type===`node`)return Ua(),void ur({nodeIndex:e.nodeIndex,offsetWithinNodePx:e.offsetWithinNodePx});if(sr(),rr.value=null,Jn.value=e,Ha(),Ba(e),W)for(let e of[0,120,280,480])Va.push(window.setTimeout(()=>{let e=Jn.value;e&&Ba(e)},e))};(function(e){if(!J.value)return!1;let t=q.value.length;return!(t<=0||(Ur.value=e.type===`node`?Ai(e.nodeIndex,0,t-1):t-1,Gr(),0))})(e)?c(t):t()}(r),Mo(`restore`),!0)}function oo(){let e=na();return Number.isFinite(e)&&e>0}function so(e){return e.sessionKey===Zi()&&!!ea(e.threadKey)&&(q.value.length<=0||!(!e.heightCache?.length||oo())||!(!(e.anchor&&Number(qa(e))>0)||oo()))}function co(){In.length=0;for(let e of Object.keys(fr)){let t=Number(e);Number.isInteger(t)&&t>=0&&t<q.value.length&&Mr(t)}}function lo(){ci!=null&&(mn?.(ci),ci=null),Lo()}function uo(){return!W||gn?Promise.resolve():new Promise(e=>{let t=!1,n=null,r=()=>{t||(t=!0,n!=null&&window.clearTimeout(n),e())};if(pn)return pn(r),void(n=window.setTimeout(r,50));n=window.setTimeout(r,0)})}function fo(e,t=Qi(),n=ia.value){return Zi()===e&&Qi()===t&&ia.value===n}function po(){return mE(this,arguments,function*(e={}){let t=Zi(),n=Qi(),r=ia.value,i=e.frames??2,a=e.timeoutMs??120,o=e.reason??`manual`,s=e.expectedSettledTokenKey,u=!0===e.flushPendingTimers,d=Sa(o),f=()=>Q(Z({},d),{phase:d.final?`settling`:d.phase,stable:!1,confidence:d.confidence===`final`?`mixed`:d.confidence,reason:o}),p=()=>fo(t,n,r)&&(s==null||wo()===s);for(let e=0;e<i;e++){if(yield c(),!p()||(yield uo(),!p()))return f();Vo(),lo()}if(yield function(e){return!W||e<=0?Promise.resolve():new Promise(t=>window.setTimeout(t,e))}(a),!p()||(u&&pi(),Vo(),lo(),!p()))return f();let m=va();m&&(ma=t,pa=n,l.virtualScroll?.settleMode===`manual`&&s!=null&&ga(l.virtualScroll?.settledToken)&&wo()===s&&(ha=ns(l.virtualScroll.settledToken)));let h=Sa(o,p()&&m&&ya()?`final`:void 0);return ko(h,!0),h})}let mo=`content`,ho=null,go=null,_o=0,vo=null,yo=null,bo=null,xo=null;function So(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function Co(e){let t=vo;if(!t)return!0;let n=l.virtualScroll?.heightDiffThresholdPx??1;return Math.abs(e.totalHeight-t.totalHeight)>n||e.sessionKey!==t.sessionKey||e.phase!==t.phase||e.stable!==t.stable||e.final!==t.final||e.threadKey!==t.threadKey||e.nodeCount!==t.nodeCount||e.measuredCount!==t.measuredCount||e.width!==t.width}function wo(e=(e=>(e=l.virtualScroll)?.settledToken)()){return aj(e)}function To(e,t){return[e,t.sessionKey,t.threadKey??``,ta(),Ra(),aj(l.virtualScroll?.settledToken),Math.round(t.totalHeight),Math.round(t.width)].join(`\0`)}function Eo(){bo=null,xo=null,yo=null}function Do(e){let t=e.heightCache;return t?.length?no(t):``}function Oo(e){let t=e.metrics,n=e.anchor?(r=e.anchor).type===`bottom`?`bottom:${Math.round(r.distanceFromBottomPx)}`:`node:${r.nodeIndex}:${Math.round(r.offsetWithinNodePx)}`:`none`;var r;return[e.sessionKey,e.threadKey??``,e.measurementKey??ta(),e.contentHash??``,Do(e),n,+!!e.anchorCaptured,t.liveRange.start,t.liveRange.end,t.renderedCount,t.nodeCount,Math.round(t.totalHeight),Math.round(t.width),t.phase,+!!t.stable].join(`\0`)}function ko(e,t=!1){if(!Xt.value||function(e=!1){return!e&&qt.value&&!Zt.value}(t))return;let n=t||Co(e),r=function(e,t=!1){return t||e.stable||e.phase===`final`?{state:za(e,{includeHeightCache:!0})}:{state:za(e)}}(e,t).state,i=!!(r&&(n||function(e,t=!1){return!!t||Oo(e)!==yo}(r,t)));if(n&&(xe(e),vo=e,_o=So()),r&&i&&(Se(r),r.anchor&&Ce(r.anchor),yo=Oo(r)),e.stable){let t=To(`settled`,e);if(t!==bo){bo=t;let n=za(e,{includeHeightCache:!0});n&&(Se(n),yo=Oo(n)),function(e){d(`render-settled`,e)}(e)}}if(e.phase===`final`){let t=To(`final`,e);if(t!==xo){xo=t;let n=za(e,{includeHeightCache:!0});n&&(Se(n),yo=Oo(n)),function(e){d(`render-final`,e)}(e)}}}function Ao(){ho!=null&&(mn?.(ho),ho=null),go!=null&&W&&(window.clearTimeout(go),go=null)}function jo(){ho=null,go=null;let e=So(),t;e-Qr>=120&&(Qr=e,t=Vo()),(Zr.size>8||ci==null)&&lo(),ko(Sa(mo,void 0,t))}function Mo(e){if(!Xt.value||(mo=e,ho!=null||go!=null))return;let t=Math.max(0,l.virtualScroll?.emitIntervalMs??32),n=Math.max(0,t-(So()-_o)),r=()=>{go=null,ho=pn?pn(jo):null,ho??jo()};W&&n>0?go=window.setTimeout(r,n):r()}function No(){Gn.value+=1}function Po(e){if(xn.value&&e>=Sn.value){let t=q.value[e],n=!0===$e.value&&!0!==et.value&&e>=q.value.length-2,r=t?.type===`code_block`||t?.type===`image`||t?.type===`mermaid`||t?.type===`infographic`;if(!n||r)return!1}return!Ir.value||e<yn.value||!!(ot.value&&!0!==et.value&&!l.nodes?.length&&e>=q.value.length-on.value)||yi.value.has(e)}function Fo(e){let t=xi.get(e);t&&(t(),xi.delete(e));let n=bi.get(e);n&&(n.destroy(),bi.delete(e)),Ci(e)}function Io(e,t){let n=!1;if(t){let r=An.get(e);if(r===t&&jn.get(e)===Vr.value)return;An.set(e,t),r!==t&&(n=!0)}else An.delete(e)&&(n=!0);if(n&&No(),t||Ci(e),!Br.value||!fn)return Fo(e),t?jn.set(e,Vr.value):jn.delete(e),void(t&&Ir.value&&wi(e,!0));if(!J.value&&Ir.value&&!Oe.value&&bi.size>=Re.value&&(Oe.value||(Oe.value=!0,Ei()),!Br.value||!fn))return Fo(e),jn.set(e,Vr.value),void(t&&wi(e,!0));if(e<yn.value&&!J.value||yi.value.has(e))return Fo(e),jn.set(e,Vr.value),void wi(e,!0);if(!t)return Fo(e),void jn.delete(e);Fo(e);let r=fn(t,{rootMargin:Le.value});if(!r)return void jn.delete(e);bi.set(e,r),jn.set(e,Vr.value),wi(e,r.isVisible.value),Ir.value&&function(e){if(!W||!Ir.value)return;Ci(e);let t=e%17*23,n=window.setTimeout(()=>{if(Si.delete(e),!Ir.value||yi.value.has(e))return;let t=An.get(e);if(!t)return;let n=Je(t),r=t.ownerDocument||document,i=r.defaultView||window,a=!n||n===r.documentElement||n===r.body,o=!a&&n?K(`nodeVisibilityFallback.root.getBoundingClientRect`,()=>n.getBoundingClientRect()):null,s=a?0:o.top,c=a?K(`nodeVisibilityFallback.clientHeight`,()=>i.innerHeight??n?.clientHeight??0):o.bottom,l=K(`nodeVisibilityFallback.node.getBoundingClientRect`,()=>t.getBoundingClientRect());l.bottom>=s-500&&l.top<=c+500&&wi(e,!0)},1800+t);Si.set(e,n)}(e);let i=null;i=v(()=>r.isVisible.value,t=>{if(t){Ci(e),wi(e,!0),i?.(),xi.delete(e),bi.get(e)===r&&bi.delete(e);try{r.destroy()}catch{}}},{immediate:!0}),xi.set(e,i),J.value&&vi()}function Lo(){ci=null,kr(()=>{let e=!1;for(let[t,n]of Zr)Zr.delete(t),Kr.get(t)===n.el&&qr.get(t)===n.version&&(e=Nr(t,n.height,{allowShrink:n.allowShrink})||e);return e})}function Ro(){ci!=null&&(mn?.(ci),ci=null),Zr.clear()}function zo(e,t,n){if(!Number.isFinite(n)||n<=0||Kr.get(e)!==t)return;let r=qr.get(e);if(r==null)return;let i=q.value[e],a=ot.value&&!0!==et.value&&!l.nodes?.length&&e>=q.value.length-2,o=!(!0===i?.loading||a),s=Zr.get(e),c=s?s.allowShrink&&o:o,u=s&&!c?Math.max(s.height,n):n;Zr.set(e,{height:u,allowShrink:c,version:r,el:t}),ci??(ci=pn?pn(Lo):null,ci??Lo())}function Bo(e,t){zo(e,t,Pr(e,t))}function Vo(){let e=0;for(let[t,n]of Kr){let r=Pr(t,n);e+=r,zo(t,n,r)}return e}function Ho(){Pn?.disconnect(),Pn=null,Mn.clear()}function Uo(){for(;Xr.length;)fi(Xr.pop())}v(Zt,e=>{e&&Mo(`content`)},{flush:`post`}),n({getVirtualMetrics:Sa,captureVirtualState:function(e={}){var t;return za(Sa(`manual`),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!0===e.allowFallbackAnchor,requireViewport:!0===e.requireViewport,includeEmptyState:(t=e.includeEmptyState)==null||t})},restoreVirtualState:function(e,t={}){let n=!0===t.restoreAnchor,r=t.restoreToken==null?`imperative`:String(t.restoreToken);eo=e,to={restoreAnchor:n,restoreToken:r,allowUncapturedAnchor:!0===t.allowUncapturedAnchor},!ao(e,{restoreAnchor:n,restoreToken:r,allowUncapturedAnchor:!0===t.allowUncapturedAnchor})&&so(e)||(eo=null,to=null)},forceMeasure:function(e=`manual`){return mE(this,null,function*(){yield c(),yield uo(),Vo(),lo(),yield c();let t=Sa(e);return ko(t,!0),t})},settle:po,scrollToNode:function(e,t=`start`){Ua(),sr();let n=q.value.length;if(n<=0)return;let r=Ai(e,0,n-1),i=()=>{let e=or({nodeIndex:r,offsetWithinNodePx:0}),n=er(r),i=Ca()?.clientHeight??0,a=ir(),o=e;if(t===`center`)o=e-i/2+n/2;else if(t===`end`)o=e-i+n;else if(t===`nearest`&&a!=null){if(e>=a&&e+n<=a+i)return;o=e<a?e:e-i+n}ar(Math.max(0,o)),vi({immediate:!0}),J.value&&(Ur.value=r,Gr())};if(J.value)return Ur.value=r,Gr(),void c(i);i()}});let Wo=new Set;v(()=>sn.value,e=>{if(e)Jr.clear();else{Ho();for(let e of Yr.values())for(let t of e)fi(t);Yr.clear(),qr.clear(),Uo(),Ro()}},{immediate:!0}),v(et,e=>{e&&function(){if(W&&et.value&&Kr.size){Uo();for(let e of Pn?[80]:[80,240,640]){let t=di(e,()=>{for(let[e,t]of Kr)t&&Bo(e,t)},`final`);t!=null&&Xr.push(t)}}}(),Mo(e?`final`:`content`)});let Go=qk(()=>Mo(`content`),16),Ko=qk(()=>Mo(`batch`),16);v([()=>q.value.length,()=>Sn.value],()=>{Jn.value&&Wa(),Go()},{flush:`post`,immediate:!0}),v([()=>Wr.start,()=>Wr.end],()=>{Ko()},{flush:`post`});let{cleanupBatchScheduler:qo}=function(e){let{props:t,isClient:n,isTestEnv:r,parsedNodesIdentity:i,parsedNodeCount:a,desiredRenderedCount:o,datasetKey:s,batchingEnabled:l,incrementalRenderingActive:u,resolvedBatchSize:d,resolvedInitialBatch:f,renderedCount:p,adaptiveBatchSize:m,previousRenderContext:h,previousBatchConfig:g,requestFrame:_,cancelFrame:y,hasIdleCallback:b,cleanupNodeVisibility:x,onDatasetKeyChanged:S,onDatasetChanged:C}=e,w=null,T=`raf`,E=null,D=0,O=!1,k=!1,A=new Set,j=new Set;function M(){if(n){w!=null&&(T===`raf`&&y?y(w):T===`idle`&&typeof window.cancelIdleCallback==`function`?window.cancelIdleCallback(w):T===`timeout`&&window.clearTimeout(w),w=null),D+=1;for(let e of A)y&&y(e);for(let e of j)window.clearTimeout(e);A.clear(),j.clear(),E=null,O=!1,k=!1}}function N(){return typeof performance<`u`?performance.now():Date.now()}function P(e){(function(e){if(!u.value)return;let n=Math.max(2,t.renderBatchBudgetMs??6),r=Math.max(1,d.value||1),i=Math.max(1,Math.floor(r/4));e>1.5*n?m.value=Math.max(i,Math.floor(.8*m.value)):e<.6*n&&m.value<r&&(m.value=Math.min(r,Math.ceil(1.2*m.value)))})(e),O=!1;let n=k||p.value<o.value;k=!1,n&&F()}function ee(e,i={}){if(!u.value)return;let a=o.value;if(p.value>=a)return;let s=Math.max(1,e),l=()=>{let e=N();w=null;let r=E??s;E=null;let i=N();p.value=Math.min(a,p.value+r),x(p.value),function(e,r){if(!n)return void P(r);O=!0;let i=++D;c().then(()=>{if(i!==D)return;let n=N(),a=Math.max(r,n-e),o=()=>{i===D&&P(a)};if(_){let e=null,n=null,r=!1,i=()=>{r||(r=!0,e!==null&&(A.delete(e),e=null),n!==null&&(j.delete(n),window.clearTimeout(n),n=null),o())};e=_(()=>{i()}),A.add(e),n=window.setTimeout(()=>{e!==null&&y&&y(e),i()},Math.max(32,t.renderBatchIdleTimeoutMs??120)),j.add(n);return}let s=window.setTimeout(()=>{j.delete(s),o()},0);j.add(s)})}(e,N()-i)};if(!n||i.immediate)return void l();let d=Math.max(0,t.renderBatchDelay??16);if(E=E==null?s:Math.max(E,s),w!=null)return;let f=typeof document<`u`&&document.visibilityState===`hidden`;if(!r&&!f&&b&&window.requestIdleCallback){let e=Math.max(0,t.renderBatchIdleTimeoutMs??120);T=`idle`,w=window.requestIdleCallback(()=>l(),{timeout:e})}else{if(_&&!r&&!f)return T=`raf`,void(w=_(()=>{d===0?l():(T=`timeout`,w=window.setTimeout(()=>l(),d))}));T=`timeout`,w=window.setTimeout(()=>l(),d)}}function te(e,t={}){O?k=!0:e==null?F():ee(e,t)}function F(){u.value&&ee(l.value?Math.max(1,Math.round(m.value)):Math.max(1,d.value))}return v([i,a,s,u,d,f,()=>t.renderBatchDelay],()=>{let e=a.value,r=h.value,i=s.value,c=!Object.is(i,r.key),l=e!==r.total,_=l&&e>r.total&&r.total>0&&!c,v=c||l;h.value={key:i,total:e};let y=g.value,b=t.renderBatchDelay??16,w=y.batchSize!==d.value||y.initial!==f.value||y.delay!==b||y.enabled!==u.value;g.value={batchSize:d.value,initial:f.value,delay:b,enabled:u.value},c&&S(e),(v||w||!u.value)&&M(),(v&&!_||w)&&(m.value=Math.max(1,d.value||1)),v&&!_&&C();let T=o.value;if(!e)return p.value=0,void x(0);if(!u.value)return p.value=T,void x(p.value);let E=c||r.total===0;p.value=E||w?Math.min(T,f.value):Math.min(p.value,T);let D=Math.max(1,f.value||d.value||e);p.value<T?te(D,{immediate:!n}):x(p.value)},{immediate:!0}),v(o,(e,t)=>{u.value&&(typeof t==`number`&&e<=t||e>p.value&&te())}),{cleanupBatchScheduler:M}}({props:H,isClient:W,isTestEnv:gn,parsedNodesIdentity:It,parsedNodeCount:Lt,desiredRenderedCount:li,datasetKey:aa,batchingEnabled:bn,incrementalRenderingActive:xn,resolvedBatchSize:vn,resolvedInitialBatch:yn,renderedCount:Sn,adaptiveBatchSize:wn,previousRenderContext:Cn,previousBatchConfig:Tn,requestFrame:pn,cancelFrame:mn,hasIdleCallback:hn,cleanupNodeVisibility:Ti,onDatasetKeyChanged:e=>{Ro(),jr(),$n(),Eo(),e>0&&br(e)},onDatasetChanged:()=>{J.value&&vi({immediate:!0})}});v([Hr,J,()=>U.value,()=>ze()],([e,t])=>{if(!e)return Di(),void _i();Oi(),t?vi({immediate:!0}):_i()},{flush:`post`,immediate:!0});let Jo=!1;function Yo(){J.value&&W&&!Jo&&(Jo=!0,pn?pn(()=>{Jo=!1,vi({immediate:!0})}):queueMicrotask(()=>{Jo=!1,vi({immediate:!0})}))}v([()=>q.value.length,()=>J.value],([e,t])=>{t&&e&&W&&Yo()},{flush:`post`}),v(Qt,e=>{e&&function(){if(Rt.value&&zt.value&&Bt.value&&Vt.value?.[1])return;let e=ne({type:`paragraph`,children:[{type:`text`,content:`Probe paragraph text`,raw:`Probe paragraph text`}],raw:`Probe paragraph text`}),t=ne({type:`list_item`,children:[e],raw:`- Probe paragraph text`}),n=ne({type:`list`,ordered:!1,items:[t],raw:`- Probe paragraph text`});Rt.value=e,zt.value=t,Bt.value=n;let r={1:null,2:null,3:null,4:null,5:null,6:null};for(let e=1;e<=6;e++)r[e]=ne({type:`heading`,level:e,text:`Probe heading`,children:[{type:`text`,content:`Probe heading`,raw:`Probe heading`}],raw:`${`#`.repeat(e)} Probe heading`});Vt.value=r}()},{immediate:!0}),v([()=>U.value,Lr],()=>{if(!Lr.value)return Li(),void(Me.value=0);Fi(),Li(),Lr.value&&U.value&&typeof ResizeObserver<`u`&&(Ii=new ResizeObserver(()=>{Fi(),Qt.value&&(rr.value&&cr(),Jn.value&&Wa(),Mo(`resize`))}),Ii.observe(U.value))},{immediate:!0}),v([Qt,nn,ia],()=>mE(null,null,function*(){if(!Qt.value)return Ne.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void $n();yield c(),function(){if(!Qt.value||typeof window>`u`)return Ne.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void $n();let e={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},t=Ni(Mi(we.value),`.paragraph-node`);e.paragraph=Hk(we.value,t,`pre-wrap`);let n=Mi(Te.value)?.querySelector(`.paragraph-node`);e.listItem=Hk(Te.value,n,`pre-wrap`);let r=K(`readSimpleTextProbeProfile.list.offsetHeight`,()=>Ee.value?.offsetHeight??0),i=K(`readSimpleTextProbeProfile.listItem.offsetHeight`,()=>Te.value?.offsetHeight??0);e.listWrapperOverhead=Math.max(0,r-i);for(let t=1;t<=6;t++){let n=Ni(Mi(De[t]),`h${t}`);e.headings[t]=Hk(De[t],n,`pre-wrap`)}Ne.value=e,$n()}()}),{flush:`post`,immediate:!0}),v(()=>q.value.length,()=>{J.value&&Yo()}),v([Qt,Me],()=>{$n(),J.value&&vi({immediate:!0}),rr.value&&cr(),Jn.value&&Wa(),Mo(`resize`)},{immediate:!1}),v(()=>Ir.value,e=>{if(e)for(let[e,t]of An)Io(e,t);else if(Ei(),J.value)vi({immediate:!0});else for(let[e,t]of An)t&&wi(e,!0)},{immediate:!1}),v([Le,Re,()=>ze()],()=>{var e;(e=fn.refresh)==null||e.call(fn);for(let[e,t]of An)Io(e,t)},{immediate:!1}),v([()=>H.viewportPriority,()=>q.value.length,Re],([e,t,n])=>{if(!1!==e){if(Oe.value&&(t<=200||t<=n)){Oe.value=!1;for(let[e,t]of An)Io(e,t)}}else Oe.value=!1}),v(()=>Sn.value,()=>{J.value&&vi({immediate:!0})}),v([Ur,an,on,()=>q.value.length,J],()=>{Gr()},{immediate:!0});let Xo=null,Zo=!1,Qo=null;function $o(){Xo=null,ma=null,pa=void 0,ha=null,Eo()}function es(){Ro(),jr(),$n(),In.length=0;let e=q.value.length;e>0&&br(e),co()}function ts(){Ao(),pi(),vo=null,Za=null,Qa=null,$a=null,eo=null,to=null,Zo=!1,$o(),la(`restore`),sr(),Ua()}function ns(e){return[Qi()??``,Zi(),ta(),ra.value,wo(e),q.value.length,Math.round(tr(0,q.value.length)),Math.round(na()),pr.count,Math.round(pr.total)].join(`:`)}function rs(){return mE(this,null,function*(){let e=l.virtualScroll?.settledToken,t=wo(e),n=Zi(),r=Qi(),i=ia.value;if(Xt.value&&l.virtualScroll?.settleMode===`manual`&&ga(e)){if(va()){if(ns(e)!==ha&&!Zo){Zo=!0;try{let e=yield po({reason:`manual`,expectedSettledTokenKey:t}),a=wo()===t;fo(n,r,i)&&e.sessionKey===n&&e.threadKey===r&&a&&e.stable&&e.phase===`final`&&(ha=ns(l.virtualScroll?.settledToken))}finally{Zo=!1,yield c();let e=l.virtualScroll?.settledToken,t=ga(e)?ns(e):``;fo(n,r,i)&&t&&ha!==t&&rs()}}}else Mo(`manual`)}})}v(Xt,(e,t)=>{if(e!==t){if(!e)return ts(),void Ao();ts(),es(),Qo=ia.value,Mo(`content`)}},{flush:`post`}),v([Xt,ia],([e,t])=>{e?Qo==null?Qo=t:Qo!==t&&(Qo=t,function(e=`resize`){Ro(),jr(),$n(),In.length=0;let t=q.value.length;t>0&&br(t),co(),Za=null,Qa=null,$a=null,vo=null,Zo=!1,$o(),ro(),c(()=>{Vo(),rr.value&&cr(),Jn.value&&Wa(),Mo(e)})}(`resize`)):Qo=null},{flush:`post`,immediate:!0}),v([Xt,()=>Zi(),()=>Qi()],([e])=>{e&&(ts(),es(),la(`content`),Mo(`content`))}),v([Xt,()=>Zi(),()=>Qi(),ia,()=>q.value.length],([e])=>{e&&function(e=`async-node`){let t=!1;for(let[e,n]of Array.from(ii.entries()))sa(n)||(oi-=Math.max(0,ri.get(e)??0),ii.delete(e),ri.delete(e),t=!0);t&&(oa(),Mo(e))}(`async-node`)},{flush:`post`}),v([Xt,()=>l.virtualScroll?.sessionKey,()=>l.virtualScroll?.measurementKey,()=>l.indexKey,()=>Ae.value],([e])=>{e&&(Eo(),function(e=`content`){if(!Xt.value)return;let t=[],n=q.value.length,r=ji(n),i=In.length-1,a=Math.max(n-1,i);for(let e=r;e<=a;e++){if(e>=n){e<=i&&In[e]!==void 0&&t.push(e);continue}let r=Ia(e),a=In[e];a!=null&&a!==r&&t.push(e),In[e]=r}if(i>=n){for(let e=n;e<=i;e++)In[e]=void 0;In.length=n}t.length&&(function(e,t={}){let n=Array.from(e,Number);Or(n);let r=0;if(kr(()=>(r=Cr(n,t),r>0)),r>0)(function(e){for(let t of e)Number.isInteger(t)&&t>=0&&t<In.length&&(In[t]=void 0)})(n);else for(let e of n)Hn.delete(e)}(t,{notify:!1}),$n(r),$o(),rr.value&&cr(),Jn.value&&Wa(),Mo(e))}(`content`))},{flush:`post`,immediate:!0}),v([Xt,()=>q.value.length,()=>Zi(),()=>Qi()],([e,t,n,r],[i,a,o,s])=>{e&&i&&n===o&&r===s&&t!==a&&$o()},{flush:`post`}),v([Xt,()=>l.virtualScroll?.heightCache,()=>l.virtualScroll?.heightCacheWidth,()=>l.virtualScroll?.restoreState,()=>l.virtualScroll?.measurementKey,()=>q.value.length,()=>Zi(),Me],()=>{ro()},{flush:`post`,immediate:!0}),v(io,(e,t)=>{e==null&&t!=null&&(sr(),rr.value=null,Ua(),$a=null)},{flush:`post`}),v([Xt,()=>l.virtualScroll?.restoreState,()=>l.virtualScroll?.restoreAnchor,()=>l.virtualScroll?.measurementKey,()=>q.value.length,()=>Zi(),Me],e=>mE(null,[e],function*([e,t]){if(!e||!t)return;yield c();let n=io();ao(t,{restoreAnchor:n!=null,restoreToken:n??void 0})}),{flush:`post`,immediate:!0}),v([Xt,Me,()=>l.virtualScroll?.restoreState,()=>l.virtualScroll?.measurementKey],([e])=>{if(!e)return;let t=l.virtualScroll?.restoreState;t&&Za&&Qa===`restore`&&(Ja(t)||(es(),Za=null,Qa=null,Mo(`resize`)))},{flush:`post`}),v([Xt,()=>q.value.length,()=>Zi(),Me],e=>mE(null,[e],function*([e]){let t=eo,n=to;e&&t&&(yield c(),!ao(t,{restoreAnchor:!0===n?.restoreAnchor,restoreToken:n?.restoreToken??`imperative`,allowUncapturedAnchor:!0===n?.allowUncapturedAnchor})&&so(t)||(eo=null,to=null))}),{flush:`post`,immediate:!0}),v([Xt,et,()=>l.virtualScroll?.settleMode,()=>Zi(),()=>Qi(),ia,si,ni,()=>Sn.value,li,()=>pr.count,()=>pr.total],([e,t,n])=>{if(!e||!0!==t||n===`manual`||!ba())return;let r=function(){let e=q.value.length;return[Qi()??``,Zi(),ta(),ra.value,e,Math.round(tr(0,e)),Math.round(na()),pr.count,Math.round(pr.total)].join(`:`)}();Xo!==r&&(Xo=r,po({reason:`final`}).then(e=>{e.stable||Xo!==r||(Xo=null)}))},{flush:`post`,immediate:!0}),v([Xt,et,()=>l.virtualScroll?.settleMode,()=>l.virtualScroll?.settledToken,()=>Zi(),()=>Qi(),ia,si,ni,()=>Sn.value,li,()=>q.value.length,()=>pr.count,()=>pr.total],()=>{rs()},{flush:`post`,immediate:!0}),v([()=>q.value.length,J,an,on,()=>Wr.start,()=>Wr.end],([e,t,n,r,i,a])=>{He.value&&mt(`virtualization`,{nodes:e,virtualization:t,maxLiveNodes:n,buffer:r,focusIndex:Ur.value,scroll:t?(()=>{let e=qn.value||Je();return e?{reverse:Ye(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:i,end:a},rendered:Sn.value})}),v([()=>H.customId],([e],t,n)=>{if(!e||Ht)return;let r=function(e,t){return e?(wk.controllers[e]=t,()=>{wk.controllers[e]===t&&delete wk.controllers[e]}):()=>{}}(e,{captureRestoreAnchor:lr,restoreAnchor:ur,getAnchorDrift:dr,getReport:Ji});n(()=>{r()})},{immediate:!0}),u(()=>{(function(){if(Xt.value)try{Vo(),lo();let e=Sa(`manual`);Co(e)&&(xe(e),vo=e,_o=So());let t=za(e,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});t&&(Se(t),t.anchor&&Ce(t.anchor),yo=Oo(t))}catch{}})(),qo(),Ei(),ft(),Ho();for(let e of Yr.values())for(let t of e)fi(t);Yr.clear(),qr.clear(),In.length=0,Uo(),Ro(),Li(),sr(),Ua(),Ao(),Di(),_i()});let is=iO(`ViewportDeferredMermaidBlockNode`,R({loader:()=>mE(null,null,function*(){try{return(yield V(()=>import(`./index10-BTkpIIYS.js`),__vite__mapDeps([11,0,1,8]))).default}catch(e){return console.warn(`[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".`,e),tO}}),loadingComponent:nj,delay:0}),nj),as=iO(`ViewportDeferredInfographicBlockNode`,R({loader:()=>mE(null,null,function*(){try{return(yield V(()=>import(`./index8-CCdHj2vL.js`),__vite__mapDeps([12,0,1]))).default}catch(e){return console.warn(`[markstream-vue] Failed to load InfographicBlockNode. Showing the Infographic source fallback. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.`,e),tj}}),loadingComponent:tj,delay:0}),tj),os=iO(`ViewportDeferredD2BlockNode`,R({loader:()=>mE(null,null,function*(){try{return(yield V(()=>import(`./index9-rtEtkGH0.js`),__vite__mapDeps([13,0,1]))).default}catch(e){return console.warn(`[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".`,e),tO}}),loadingComponent:ZA,delay:0}),ZA),ss={text:rO,paragraph:ck,heading:YO,code_block:sO,list:tk,list_item:ek,blockquote:LO,table:gk,definition_list:VO,footnote:KO,footnote_reference:IE,footnote_anchor:UO,admonition:yj,vmr_container:xk,hardbreak:MO,link:wO,image:zD,thematic_break:vk,math_inline:cO,math_block:lO,strong:_O,emphasis:AO,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,superscript:pO,emoji:jE,checkbox:kE,checkbox_input:kE,inline_code:eD,html_inline:YE,reference:dO,html_block:ak},cs=E(()=>Yi()),ls=E(()=>Wk(H.codeBlockProps)),us=E(()=>Wk(H.codeBlockProps)),ds=E(()=>Q(Z(Z({stream:H.codeBlockStream,darkTheme:H.codeBlockDarkTheme,lightTheme:H.codeBlockLightTheme,themes:H.themes,minWidth:H.codeBlockMinWidth,maxWidth:H.codeBlockMaxWidth},typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{}),us.value),{codeBlockOptions:H.codeBlockOptions})),fs=E(()=>Q(Z(Z({},ds.value),ls.value),{codeBlockOptions:H.codeBlockOptions}));function ps(e){return typeof e==`boolean`?e:void 0}let ms=E(()=>{var e,t;let n=H.codeBlockProps||{},r={};r.showLineNumbers=ps(n.showLineNumbers)??!0!==H.codeBlockOptions?.disableLineNumbers,r.showHeader=(e=ps(n.showHeader))==null||e,r.showCopyButton=(t=ps(n.showCopyButton))==null||t,typeof n.clipboardWriter==`function`&&(r.clipboardWriter=n.clipboardWriter);let i=ps(n.showTooltips)??Ue.value;typeof i==`boolean`&&(r.showTooltips=i),r.codeBlockOptions=H.codeBlockOptions,r.isDark=H.isDark,r.darkTheme=n.darkTheme??H.codeBlockDarkTheme,r.lightTheme=n.lightTheme??H.codeBlockLightTheme,r.theme=n.theme,r.themes=n.themes??H.themes;let a=ps(n.diffInline);a!==void 0&&(r.diffInline=a),n.diffHideUnchangedRegions!==void 0&&(r.diffHideUnchangedRegions=n.diffHideUnchangedRegions);let o=function(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0}(n.reservedHeightPx);return o!==void 0&&(r.reservedHeightPx=o),r}),hs=E(()=>Z({},H.mermaidProps||{})),gs=E(()=>Z({},H.d2Props||{})),_s=E(()=>Z({},H.infographicProps||{})),vs,ys=E(()=>{let e=ie.value,t=H.fade,n=kt.value.customHtmlTags;return vs?.typewriter===e&&vs.fade===t&&vs.customHtmlTags===n?vs:vs={typewriter:e,fade:t,customHtmlTags:n}}),bs=E(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltip:Ue.value}:{})),xs=E(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{})),Ss=E(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{})),Cs=E(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{}));function ws(e){return Array.isArray(e.children)&&e.children.length>0}let Ts=new WeakMap,Es=new WeakMap,Ds=[],Os=[],ks=null,As=[];function js(e,t){let n=String(e?.code??``),r=Es.get(e);if(r&&r.code===n)return r.height;let i=t(n);return Es.set(e,{code:n,height:i}),i}function Ms(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}let Ns=E(()=>{let e=new Map,t=new Map;return q.value.forEach((n,r)=>{if(n.type!==`footnote`)return;let i=n.id,a=e.get(i)??0;t.set(r,a),e.set(i,a+1)}),t});function Ps(e,t){let n=function(e,t,n){let r=Qt.value?Ui.value[t]:null;return[t,e.loading,r,n]}(e.node,e.index,t),r=Ts.get(e.node);if(r&&Ms(r.signature,n))return r.item;let i=function(e,t){if(e.type!==`code_block`)return Fn[t]=void 0,e;let n=e,r=[n.language,n.loading,n.diff,n.code,n.originalCode,n.updatedCode,n.raw,n.startLine,n.endLine,n.sourceMap?.startLine,n.sourceMap?.endLine],i=Fn[t];if(i&&r.every((e,t)=>e===i.signature[t]))return i.node;let a=Z({},n);return Fn[t]={signature:r,node:a},a}(e.node,e.index),a=Is(i),o=Vs(i,a);if((i.type===`html_block`||i.type===`html_inline`)&&o===ss[i.type]){let e=i,t=String(e.tag??``).trim().toLowerCase()||Sf(e.content);if(t){let n=Et.value[t];if(Dt.value.has(t)&&n)o=n,i=Q(Z({},e),{type:t,tag:t,content:Tf(e.content,t)});else if(wf(e.content??e.raw,t)){let t=String(e.content??e.raw??``);i.type===`html_inline`?(o=rO,i={type:`text`,content:t,raw:t}):(o=ck,i={type:`paragraph`,children:[{type:`text`,content:t,raw:t}],raw:t})}}}let s=i.type===`code_block`&&oe.value&&o===oO&&!Gk(Et.value,a),c=Z({},function(e,t,n){let r=t??Is(e);if(e.type===`code_block`){let t=r?Gk(Et.value,r):void 0;if(n&&oe.value&&!t&&n===oO)return ms.value;if(n&&r&&n===t)return r===`mermaid`?Rs(e):r===`infographic`?zs(e):r===`d2`||r===`d2lang`?Bs(e):fs.value;if(n&&n===Et.value.code_block)return fs.value}return r===`mermaid`?Rs(e):r===`infographic`?zs(e):r===`d2`||r===`d2lang`?Bs(e):e.type===`link`?bs.value:e.type===`list`?xs.value:e.type===`blockquote`?Ss.value:e.type===`table`?Cs.value:e.type===`code_block`?ds.value:ys.value}(i,a,o)),l=Qt.value?Ui.value[e.index]:null;i.type===`code_block`&&l?.kind===`code-block`&&(c=Q(Z({},c),s?{reservedHeightPx:l.contentHeight}:{estimatedHeightPx:l.height,estimatedContentHeightPx:l.contentHeight,estimatedDiffInline:l.diffInline})),s||i.type!==`code_block`||a!==`mermaid`||_T(c.estimatedPreviewHeightPx)!=null||(c=Q(Z({},c),{estimatedPreviewHeightPx:ST(js(i,yT))})),s||i.type!==`code_block`||a!==`infographic`||_T(c.estimatedPreviewHeightPx)!=null||(c=Q(Z({},c),{estimatedPreviewHeightPx:wT(js(i,bT))})),i.type===`math_block`&&(c=Q(Z({},c),{cacheScope:Tt}));let u=function(e,t){let n=String(e.type);return!xE(n)&&Et.value[n]===t}(i,o),d=u?UE(i,We.value):void 0,g=i.loading,_=e.index;i.type===`footnote`&&o===KO&&(_=`footnote-${i.id}-${Ns.value.get(e.index)}`);let v=`${cs.value}-${_}`,y=Z({node:i,loading:g,"index-key":v},i.type===`reference`?{"data-markstream-reference-id":String(i.id)}:{}),b={"custom-id":H.customId,"is-dark":H.isDark},x={onCopy:f,onHandleArtifactClick:p},S={onClick:Hs,onMouseover:Gs,onMouseout:Ks},C={onMouseover:m,onMouseout:h},w=Z(Z({},d??{}),c),T=O(y,c,b,x),E=O(w,y,b,x),D={slotRef:t=>Io(e.index,t),contentRef:t=>function(e,t,n){if(n?Wo.add(t):Wo.delete(t),n&&!sn.value&&!Jr.has(e))return;if(n){let t=q.value[e],r=Jr.get(e);if(r&&r.el===n&&r.node===t&&r.loading===t?.loading)return}n||function(e){let t=`${Yi()}-${e}`,n=!1;for(let r of Array.from(ri.keys()))(ii.get(r)?.index===e||r===t||r.startsWith(`${t}-`))&&(oi-=Math.max(0,ri.get(r)??0),ri.delete(r),ii.delete(r),n=!0);n&&(oa(),Mo(`async-node`))}(e),Zr.delete(e),function(e){let t=(qr.get(e)??0)+1;qr.set(e,t)}(e);let r=Yr.get(e);if(r){for(let e of r)fi(e);Yr.delete(e)}if(function(e){let t=Mn.get(e);t&&(Pn?.unobserve(t),Nn.delete(t),Mn.delete(e))}(e),!n||!sn.value)return Kr.delete(e),qr.delete(e),void Jr.delete(e);Kr.set(e,n),Jr.set(e,{el:n,node:q.value[e],loading:q.value[e]?.loading});let i=()=>{Bo(e,n)};queueMicrotask(i);let a=(Pn||typeof ResizeObserver>`u`||(Pn=new ResizeObserver(e=>{if(e.length)for(let t of e){let e=Nn.get(t.target),n=Mn.get(e??-1);e!=null&&n&&Bo(e,n)}else Vo()})),Pn);if(a&&(Mn.set(e,n),Nn.set(n,e),a.observe(n)),typeof window<`u`){let t=q.value[e]?.type===`code_block`?[16,80,240,800]:et.value?[80]:[];if(t.length){let n=t.map(e=>di(e,i,`node-resize`)).filter(e=>e!=null);n.length&&Yr.set(e,n)}}}(e.index,D.vnodeKey,t),node:i,sourceLoading:g,index:e.index,component:o,bindings:c,customBindings:w,nodeProps:T,customNodeProps:E,fragmentNodeProps:O(T,S),customFragmentNodeProps:O(E,S),minimalNodeProps:O(T,C),rendersCustomNode:u,hasSlotChildren:ws(i),slotContent:String(i.content??``),isCodeBlock:i.type===`code_block`,indexKey:v,vnodeKey:`${$i.value}\0${_}\0${i.type}`};return Ts.set(e.node,{signature:n,item:D}),D}let Fs=E(()=>{let e=ks,t=function(){let e=[oe.value,Et.value,Dt.value,We.value,$i.value,cs.value,Tt,Ri.value,H.customId,H.isDark,ms.value,ds.value,fs.value,hs.value,_s.value,gs.value,ys.value,bs.value,xs.value,Ss.value,Cs.value,Qt.value,kk.value,Me.value];return ks&&Ms(ks,e)?ks:(ks=e,e)}(),n=e!==t;if(ks=t,J.value)return Wi.value.map(e=>Ps(e,t));let r=q.value,i=r.length,a=!1;Ds.length>i&&(Ds.length=i,Os.length=i,a=!0);let o=Ds,s=Math.min(o.length,i),c=n?0:s;if(!n)for(let e=0;e<s;e++){let t=r[e];if(t.type===`code_block`){if(o[e]?.node!==Fn[e]?.node||Os[e]!==t||!Object.is(o[e]?.sourceLoading,t.loading)){c=e;break}}else if(o[e]?.node!==t||!Object.is(o[e]?.sourceLoading,t.loading)){c=e;break}}if(!a&&c===i)return As;for(let e=c;e<i;e++)o[e]=Ps({node:r[e],index:e},t),Os[e]=r[e];let l=o.slice();return As=l,l});function Is(e){return e?.type===`code_block`?String(e.language??``).trim().toLowerCase():``}function Ls(e,t,n,r){let i=Z({},e.value);return _T(i.estimatedPreviewHeightPx)??(i.estimatedPreviewHeightPx=r(js(t,n),void 0,i.maxHeight===`none`?null:_T(i.maxHeight)??void 0)),i}function Rs(e){return Ls(hs,e,yT,ST)}function zs(e){return Ls(_s,e,bT,wT)}function Bs(e){return Ls(gs,e,kT,TT)}function Vs(e,t){if(!e)return bk;let n=Et.value,r=n[String(e.type)];if(e.type===`code_block`){let i=t??Is(e);return(i?Gk(n,i):void 0)||(oe.value?n.code_block||oO:i===`mermaid`?n.mermaid||is:i===`infographic`?n.infographic||as:i===`d2`||i===`d2lang`?n.d2||os:r||n.code_block||Ri.value)}return r||ss[String(e.type)]||bk}function Hs(e){let t=e.target instanceof Element?e.target.closest(`[data-markstream-reference-id]`):null,n=e.currentTarget,r=t&&n instanceof Element&&n.contains(t)?t.dataset.markstreamReferenceId:void 0;d(`click`,e,r)}function Us(e){var t;(t=e.target)!=null&&t.closest(`[data-node-index]`)&&d(`mouseover`,e)}function Ws(e){var t;(t=e.target)!=null&&t.closest(`[data-node-index]`)&&d(`mouseout`,e)}function Gs(e){d(`mouseover`,e)}function Ks(e){d(`mouseout`,e)}let qs=D(null),Js=D(!1),Ys=D(null),Xs=E(()=>!(H.domMode!==`minimal`||Ve.value||!1!==H.fade||ie.value||Js.value||En.value||J.value||Jt.value||Gt.value||dn.value||Object.keys(Et.value).length!==0)),Zs,Qs=null,$s=0,ec=0,tc=0,nc=[`code_block`,`admonition`,`table`,`math_block`,`html_block`,`image`,`thematic_break`],rc=new Set(nc),ic=[`.typewriter-cursor`,`.height-estimation-probes`,...nc.map(e=>`[data-node-type="${e}"]`),`script`,`style`].join(`,`);function ac(e){if(!e||typeof e!=`object`)return!1;let t=e.type;return typeof t==`string`&&rc.has(t)}function oc(e){if(!e||typeof e!=`object`)return 0;let t=e,n=t.raw??t.content??t.code;if(typeof n==`string`)return n.length;let r=t.children;if(Array.isArray(r))return r.reduce((e,t)=>e+oc(t),0);let i=t.items;return Array.isArray(i)?i.reduce((e,t)=>e+oc(t),0):0}function sc(){Zs&&=(clearTimeout(Zs),void 0)}function cc(){$s+=1,Qs!=null&&(mn?.(Qs),Qs=null)}function lc(){cc(),pc(),qs.value&&(qs.value.style.visibility=`hidden`)}function uc(e){if(e.nodeType!==Node.TEXT_NODE||!(e.textContent??``).trim())return!1;let t=e.parentElement;return!!t&&!t.closest(ic)}function dc(e){let t=e.lastChild;for(;t;){if(uc(t))return t;if(t.nodeType===Node.ELEMENT_NODE){let e=t;if(!e.matches(ic)&&e.lastChild){t=e.lastChild;continue}}for(;t&&t!==e&&!t.previousSibling;)t=t.parentNode;if(!t||t===e)break;t=t.previousSibling}return null}function fc(){let e=Fs.value;for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||ac(n.node)||!Po(n.index))continue;let r=An.get(n.index);if(!r)continue;let i=dc(r);if(i)return i}return null}function pc(){Ys.value&&=(Ys.value.classList.remove(cj),null)}function mc(){if(re.value!==`simple`||!W||!Js.value||!U.value)return void pc();let e=fc(),t=e?function(e){let t=e.parentElement?.closest(`.text-node`);return t instanceof HTMLElement?t:e.parentElement}(e):null;t!==Ys.value&&(pc(),t&&(t.classList.add(cj),Ys.value=t))}function hc(){if(re.value!==`precise`||!W||!Js.value||Qs!=null)return;let e=$s,t=()=>{Qs=null,e===$s&&function(){if(re.value!==`precise`||!(W&&Js.value&&U.value&&qs.value))return;let e=U.value,t=qs.value;t.style.visibility=`hidden`;let n=fc();if(!n)return;let r=0,i=0,a=20,o=!1;if(n?.textContent){let t=n.textContent.length,s=document.createRange();s.setStart(n,Math.max(0,t-1)),s.setEnd(n,t);let c=typeof s.getClientRects==`function`?s.getClientRects():void 0,l=c?.[c.length-1]??n.parentElement?.getBoundingClientRect();if(l){let t=K(`typewriterCursor.root.getBoundingClientRect`,()=>e.getBoundingClientRect());r=l.right-t.left+e.scrollLeft,i=l.top-t.top+e.scrollTop,a=l.height||a,o=!0}s.detach()}o&&(t.style.transform=`translate(${Math.max(0,r)}px, ${Math.max(0,i)}px)`,t.style.height=`${a}px`,t.style.visibility=`visible`)}()};pn?Qs=pn(t):t()}return v([Qe,()=>l.content,()=>l.nodes,()=>H.typewriter,et],()=>mE(null,null,function*(){if(!W||Ve.value||!Ke.value)return;if(!ie.value)return void((Js.value||Zs||Qs!=null||Ys.value||qs.value)&&(Js.value=!1,sc(),lc()));if(et.value)return Js.value=!1,sc(),void lc();if(l.nodes?.length)return Js.value=!1,sc(),lc(),ec=(l.content??``).length,void(tc=Qe.value.length);let e=function(){return l.nodes?.length?l.nodes.reduce((e,t)=>e+oc(t),0):(l.content??``).length}(),t=function(){return l.nodes?.length?l.nodes.reduce((e,t)=>e+oc(t),0):Qe.value.length}(),n=!ac(q.value[q.value.length-1]),r=e>ec,i=t>tc;if(!ie.value||!n||!r&&!i)return ie.value&&n||(Js.value=!1,lc()),ec=e,void(tc=t);ec=e,tc=t,Js.value=!0,re.value===`precise`&&qs.value&&(qs.value.style.visibility=`hidden`),sc(),yield c(),re.value===`simple`?mc():(pc(),hc()),Zs=setTimeout(()=>{Zs=void 0,Js.value=!1},3e3)}),{flush:`post`,immediate:!0}),v(Js,e=>mE(null,null,function*(){e?(yield c(),re.value===`simple`?mc():(pc(),re.value===`precise`&&hc())):lc()}),{flush:`post`}),v(re,()=>mE(null,null,function*(){if(W&&!Ve.value&&Ke.value&&Js.value){if(yield c(),re.value===`simple`)return cc(),void mc();pc(),re.value===`precise`?hc():lc()}}),{flush:`post`}),v([()=>Sn.value,()=>Wr.start,()=>Wr.end],()=>mE(null,null,function*(){W&&!Ve.value&&Ke.value&&Js.value&&(yield c(),re.value===`simple`?mc():(pc(),re.value===`precise`&&hc()))}),{flush:`post`}),u(()=>{sc(),cc(),pc(),wt.clear()}),(e,t)=>{let n=g(`NodeRenderer`,!0);return F(Ve)?(B(!0),z(w,{key:0},o(Fs.value,e=>(B(),z(w,{key:e.vnodeKey},[e.rendersCustomNode?(B(),b(a(e.component),O({key:0,ref_for:!0},e.customFragmentNodeProps),{default:y(()=>[e.hasSlotChildren?(B(),b(n,O({key:0,ref_for:!0},Ft.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):e.slotContent?(B(),b(n,O({key:1,ref_for:!0},Ft.value,{content:e.slotContent,final:!e.node.loading,"index-key":`${e.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:2},1040)):(B(),b(a(e.component),O({key:1,ref_for:!0},e.fragmentNodeProps),null,16))],64))),128)):(B(),z(`div`,{key:1,ref_key:`containerRef`,ref:U,class:S([`markstream-vue markdown-renderer`,[{dark:H.isDark},{virtualized:J.value},{"virtual-scroll-coordinated":Zt.value},{"stable-layout":zr.value},{"typewriter-simple-cursor":Js.value&&re.value===`simple`}]]),"data-custom-id":H.customId,onClick:Hs,onMouseover:Us,onMouseout:Ws},[$t.value||J.value?(B(),z(w,{key:0},[$t.value?(B(),b(ej,{key:0,width:nn.value,"flow-root":J.value||Zt.value,"paragraph-node":Rt.value,"list-item-node":zt.value,"list-node":Bt.value,"heading-nodes":Vt.value,"set-paragraph-wrapper":mi,"set-list-item-wrapper":hi,"set-list-wrapper":gi,"set-heading-wrapper":Pi},null,8,[`width`,`flow-root`,`paragraph-node`,`list-item-node`,`list-node`,`heading-nodes`])):L(``,!0),J.value?(B(),z(`div`,{key:1,class:`node-spacer`,style:I({height:`${Gi.value}px`}),"aria-hidden":`true`},null,4)):L(``,!0)],64)):L(``,!0),Xs.value?(B(!0),z(w,{key:1},o(Fs.value,e=>(B(),z(w,{key:e.vnodeKey},[Po(e.index)?(B(),b(a(e.component),O({key:0,ref_for:!0},e.minimalNodeProps),null,16)):L(``,!0)],64))),128)):(B(!0),z(w,{key:2},o(Fs.value,e=>(B(),z(`div`,{key:e.vnodeKey,ref_for:!0,ref:e.slotRef,class:`node-slot`,"data-node-index":e.index,"data-node-type":e.node.type},[F(Wo).has(e.vnodeKey)||Po(e.index)?(B(),z(`div`,{key:0,ref_for:!0,ref:e.contentRef,class:`node-content`},[e.isCodeBlock?e.rendersCustomNode?(B(),b(a(e.component),O({key:1,ref_for:!0},e.customNodeProps),{default:y(()=>[e.hasSlotChildren?(B(),b(n,O({key:0,ref_for:!0},Ft.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):e.slotContent?(B(),b(n,O({key:1,ref_for:!0},Ft.value,{content:e.slotContent,final:!e.node.loading,"index-key":`${e.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:2},1040)):(B(),b(a(e.component),O({key:2,ref_for:!0},e.nodeProps),null,16)):(B(),b(rj,{key:0,item:e,"source-nodes":l.nodes,fade:H.fade,"nested-renderer-props":e.rendersCustomNode?Ft.value:void 0},null,8,[`item`,`source-nodes`,`fade`,`nested-renderer-props`]))],512)):(B(),z(`div`,{key:1,class:`node-placeholder`,style:I({height:`${er(e.index)}px`})},null,4))],8,sj))),128)),Js.value&&re.value===`precise`?(B(),z(`span`,{key:3,ref_key:`typewriterCursorRef`,ref:qs,class:`typewriter-cursor`,"aria-hidden":`true`},null,512)):L(``,!0),J.value?(B(),z(`div`,{key:4,class:`node-spacer`,style:I({height:`${Ki.value}px`}),"aria-hidden":`true`},null,4)):L(``,!0)],42,oj))}}})),[[`__scopeId`,`data-v-f4ebaa7e`]]),uj=lj;uj.install=e=>{let t=new Set([`MarkdownRender`,`NodeRenderer`,uj.__name,uj.name].filter(e=>!!e));for(let n of t)e.component(n,lj)};var dj=Object.freeze(Object.defineProperty({__proto__:null,default:uj},Symbol.toStringTag,{value:`Module`})),fj={key:0,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},pj={key:1,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},mj={key:2,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},hj={key:3,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},gj={class:`admonition-title`},_j=[`aria-expanded`,`aria-controls`],vj=[`id`],yj=$(p({__name:`AdmonitionNode`,props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:[`copy`],setup(e,{emit:t}){var r;let i=e,a=t,o=E(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;let e=i.node.kind||`note`;return e.charAt(0).toUpperCase()+e.slice(1)}),s=D(!!i.node.collapsible&&!((r=i.node.open)==null||r));function c(){i.node.collapsible&&(s.value=!s.value)}let l=`admonition-${Math.random().toString(36).slice(2,9)}`;return(t,r)=>(B(),z(`div`,{class:S([`admonition`,[`admonition-${i.node.kind}`]])},[T(`div`,{id:l,class:`admonition-legend`},[i.node.kind===`note`||i.node.kind===`info`?(B(),z(`svg`,fj,[...r[1]||=[T(`circle`,{cx:`12`,cy:`12`,r:`10`},null,-1),T(`path`,{d:`M12 16v-4`},null,-1),T(`path`,{d:`M12 8h.01`},null,-1)]])):i.node.kind===`tip`?(B(),z(`svg`,pj,[...r[2]||=[T(`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`},null,-1),T(`path`,{d:`M9 18h6`},null,-1),T(`path`,{d:`M10 22h4`},null,-1)]])):i.node.kind===`warning`||i.node.kind===`caution`?(B(),z(`svg`,mj,[...r[3]||=[T(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`},null,-1),T(`path`,{d:`M12 9v4`},null,-1),T(`path`,{d:`M12 17h.01`},null,-1)]])):i.node.kind===`danger`||i.node.kind===`error`?(B(),z(`svg`,hj,[...r[4]||=[T(`polygon`,{points:`7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2`},null,-1),T(`path`,{d:`M12 8v4`},null,-1),T(`path`,{d:`M12 16h.01`},null,-1)]])):L(``,!0),T(`span`,gj,C(o.value),1),i.node.collapsible?(B(),z(`button`,{key:4,class:`admonition-toggle`,"aria-expanded":!s.value,"aria-controls":`${l}-content`,onClick:c},[(B(),z(`svg`,{style:I({rotate:s.value?`0deg`:`90deg`}),xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[...r[5]||=[T(`path`,{d:`m9 18 6-6-6-6`},null,-1)]],4))],8,_j)):L(``,!0)]),d(T(`div`,{id:`${l}-content`,class:`admonition-content`,"aria-labelledby":l},[n(F(uj),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:r[0]||=e=>a(`copy`,e)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])],8,vj),[[A,!s.value]])],2))}}),[[`__scopeId`,`data-v-a83480e1`]]);yj.install=e=>{e.component(yj.__name,yj)};var bj=()=>V(()=>import(`./d2_markstream-vue-xMoF3M5G.js`),[]),xj=null,Sj=bj,Cj=null,wj=!1,Tj=!1,Ej=0;function Dj(e){Sj=e,Ej++,xj=null,Cj=null,wj=!1,Tj=!1}function Oj(){Dj(null)}function kj(){return mE(this,null,function*(){if(xj)return xj;let e=Sj,t=Ej;return e?e===bj&&wj?null:Cj||(Cj=mE(null,null,function*(){let n;try{n=yield e()}catch(n){if(e===bj)return t===Ej&&e===Sj&&(wj=!0,function(e){Tj||(Tj=!0,console.warn(`[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.`,e))}(n)),null;throw n}finally{t===Ej&&e===Sj&&(Cj=null)}return t!==Ej||e!==Sj?null:n?(xj=function(e){if(!e)return e;if(e.D2&&typeof e.D2==`function`)return e.D2;if(e.default&&e.default.D2&&typeof e.default.D2==`function`)return e.default.D2;let t=e.default??e;return typeof t==`function`?t:t?.D2&&typeof t.D2==`function`?t.D2:t}(n),xj):null}),Cj):null})}var Aj=null,jj=null,Mj=null,Nj=0;function Pj(e){jj=e??null,Aj=null,Mj=null,Nj++}function Fj(){Pj()}function Ij(){return typeof jj==`function`}function Lj(){return mE(this,null,function*(){if(Aj)return Aj;let e=jj,t=Nj;return e?Mj||(Mj=mE(null,null,function*(){let n=yield e();if(t!==Nj||e!==jj)return null;let r=function(e){if(!e)return null;let t=e.default??e,n=typeof t==`function`&&typeof t.prototype?.render==`function`?t:e.Infographic??t?.Infographic;return typeof n==`function`?n:null}(n);return t!==Nj||e!==jj?null:r?(Aj=r,Aj):null}).finally(()=>{t===Nj&&e===jj&&(Mj=null)}),Mj):null})}function Rj(e){let t=Number.parseFloat(String(e??``));return Number.isFinite(t)?t:0}function zj(e,t){e?.(t)}function Bj(e,t){return e?(zj(t,`readElementBoxHeight.offsetHeight`),Math.ceil(Math.max(0,e.offsetHeight||0))):0}function Vj(e,t){let n=Bj(e,t);if(!e||typeof window>`u`||typeof window.getComputedStyle!=`function`)return n;zj(t,`readElementOuterHeight.getComputedStyle`);let r=window.getComputedStyle(e),i=Rj(r.marginTop),a=Rj(r.marginBottom);return Math.ceil(Math.max(0,n+i+a))}function Hj(e,t,n){if(!e)return 0;let r=function(e){return e?e.matches?.call(e,`.markstream-vue.markdown-renderer`)?e:e.querySelector(`.markstream-vue.markdown-renderer`):null}(e);if(!r)return 0;let i=Number.isFinite(n)?Number(n):Vj(e,t),a=Bj(r,t);return Math.max(0,i-a)}function Uj(e,t,n){let r=n.getKey?.call(n,e,t)??e.id??t;return String(r)}function Wj(e,t,n){return n.getKind?.call(n,e,t)??String(e.kind??``)}function Gj(e,t,n){let r=n.getContent?.call(n,e,t)??e.content;return typeof r==`string`?r:``}function Kj(e,t,n){let r=n.getFinal?.call(n,e,t);if(typeof r==`boolean`)return r;let i=e.final;return typeof i!=`boolean`||i}function qj(e,t,n){return n.getRevision?.call(n,e,t)??e.revision}function Jj(e,t,n){let r=Wj(e,t,n);return r===`assistant-markdown`||r===`markdown`||!r&&Gj(e,t,n).length>0}function Yj(e,t,n){let r=n.estimateItemHeight?.call(n,e,t);if(Number.isFinite(r)&&r>0)return r;let i=Wj(e,t,n);return i===`assistant-markdown`||i===`markdown`?360:i===`system-divider`?44:i===`tool-call`?72:i===`thinking`?92:i===`error`?76:i===`user-message`?88:Gj(e,t,n).length>0?360:96}var Xj=Symbol(`markstreamLanguageIconResolver`),Zj=null;function Qj(){return Zj}function $j(e){return mE(this,null,function*(){let t=Zj;if(t&&typeof t.setRenderOptions==`function`)try{yield t.setRenderOptions({theme:e})}catch{}})}function eM(e){return R(e)}eM(()=>V(()=>import(`./index3-BSWvERvY.js`),__vite__mapDeps([14,7,0,1,6,8,3,4]))),eM(()=>V(()=>import(`./index5-CkCxVfaP.js`),__vite__mapDeps([10,0,1]))),eM(()=>V(()=>import(`./index6-SCztOIu6.js`),__vite__mapDeps([9,0,1]))),eM(()=>V(()=>import(`./index10-BTkpIIYS.js`),__vite__mapDeps([11,0,1,8]))),eM(()=>V(()=>import(`./index8-CCdHj2vL.js`),__vite__mapDeps([12,0,1]))),eM(()=>V(()=>import(`./index9-rtEtkGH0.js`),__vite__mapDeps([13,0,1]))),eM(()=>V(()=>import(`./index4-D6dsLD5o.js`),__vite__mapDeps([15,2,0,1,3,4]))),eM(()=>V(()=>import(`./index7-HKApXTNK.js`),__vite__mapDeps([16,0,1])));var tM=[`data-language`],nM=[`innerHTML`],rM={key:1};wE(`litepaseo`,{code_block:p({inheritAttrs:!1,__name:`CodeBlock`,props:{node:{}},setup(e){let t=e,n=k(`litepaseo-markdown-final`,null),r=E(()=>ie(t.node.diff?`diff`:String(t.node.language??``))),i=E(()=>String(t.node.code??``).replace(/\n$/,``)),a=E(()=>t.node.loading&&!n?.value?null:ae(i.value,r.value));return(e,t)=>(B(),z(`pre`,{class:`code`,"data-language":r.value??void 0},[a.value===null?(B(),z(`code`,rM,C(i.value),1)):(B(),z(`code`,{key:0,class:`hljs`,innerHTML:a.value},null,8,nM))],8,tM))}})});var iM=p({__name:`MarkdownMessage`,props:{content:{},final:{type:Boolean}},setup(e){let n=e;t(`litepaseo-markdown-final`,E(()=>n.final)),$w(),qT(),Oj(),Fj();let r=Object.freeze({showLineNumbers:!1,showHeader:!1,showCopyButton:!1});return(t,n)=>(B(),b(F(uj),{class:`prose`,mode:`chat`,"is-dark":F(re),content:e.content,final:e.final,"smooth-streaming":!1,typewriter:!1,fade:!1,"code-block-stream":!1,"render-code-blocks-as-pre":!0,"code-block-props":F(r),"batch-rendering":!1,"defer-nodes-until-visible":!1,"node-virtual":!1,"viewport-priority":!1,"html-policy":`escape`,"custom-id":`litepaseo`},null,8,[`is-dark`,`content`,`final`,`code-block-props`]))}});export{_e as $,vT as A,rT as B,$j as C,aE as D,Hj as E,yT as F,Iw as G,fT as H,wT as I,Pw as J,Bw as K,pT as L,bT as M,ST as N,oE as O,_T as P,hw as Q,nT as R,_D as S,kD as T,Rw as U,tT as V,Hw as W,Cw as X,Vw as Y,zw as Z,$ as _,Ij as a,De as at,Zk as b,Jj as c,Ce as ct,Yj as d,iM as default,q as dt,yt as et,tO as f,Ct as ft,Vj as g,ln as gt,ND as h,At as ht,Lj as i,Me as it,CT as j,ZT as k,Kj as l,ve as lt,kj as m,Et as mt,Wj as n,ge as nt,Qj as o,xe as ot,Xj as p,Tt as pt,Nw as q,Uj as r,bt as rt,AD as s,wt as st,MD as t,Ae as tt,Gj as u,ye as ut,CD as v,gD as w,uj as x,qj as y,gT as z};
|
|
195
|
+
`):Lk(e.code,!0===e.loading)).split(/\r\n|\n|\r/),s=Bk(i,a,r.length,n,t,!1);return r.reduce((e,t)=>e+zk(t,s,n.tabSize),0)}let c=Lk(e.originalCode).split(/\r\n|\n|\r/),l=Lk(e.updatedCode).split(/\r\n|\n|\r/);if(e.originalCode==null&&e.updatedCode==null)return r;let u=Math.max(c.length,l.length),d=Bk(i,a,u,n,t,!0),f=0;for(let e=0;e<u;e++)f+=Math.max(zk(c[e]??``,d,n.tabSize),zk(l[e]??``,d,n.tabSize));return f}(e,t,n);o=Math.round(r*n.lineHeight+n.padding+n.paddingBottom),s=n.maxHeight}let c=Math.max(1,Math.min(o,s));return Z({kind:`code-block`,height:Math.round(c+(n===`pre`?i?37:0:r?40:0)),contentHeight:c,rendererKind:n},a&&n===`stream-diffs`?{diffInline:ye({diffStyle:t.diffStyle})}:{})}(e,{rendererKind:t,codeBlockOptions:H.codeBlockOptions,showHeader:zi(),showLineNumbers:Vi(),width:n,diffStyle:H.codeBlockOptions?.diffStyle})}return null}_(()=>{if(Un.value,Wn>0)return;let e=q.value,t=Pt();if(!e.length||!On.value)return Rn=[],zn=[],Bn=-1,Hn.clear(),void(Vn.value=Ln);let n=Me.value||K(`estimatedNodeHeights.clientWidth`,()=>U.value?.clientWidth||0);if(!Number.isFinite(n)||n<=0)return Rn=[],zn=[],Bn=-1,Hn.clear(),void(Vn.value=Ln);let r=function(e){let t=At(H.codeBlockOptions);return[Math.round(e),en.value,kn.value,Ne.value,t.fontSize,t.lineHeight,t.fontFamily,t.padding,t.paddingBottom,t.maxHeight,t.tabSize,t.overflow,H.codeBlockOptions?.diffStyle??`split`,Vi(),zi(),Bi(),oe.value,Et.value,kk.value]}(n),i=Rn.length<=e.length&&(o=r,(a=zn).length===o.length&&a.every((e,t)=>Object.is(e,o[t])));var a,o;let s=i&&Bn===t?e.length:i?ji(e.length):0,c=i?Array.from(Hn):[];Rn.length=e.length;for(let t=s;t<e.length;t++)Rn[t]=Hi(e[t],t,n);for(let t of c)t>=0&&t<e.length&&t<s&&(Rn[t]=Hi(e[t],t,n));Hn.clear(),zn=r,Bn=t,Vn.value=Rn,P(Vn)},{flush:`sync`});let Ui=E(()=>Vn.value);Yn=function(e){let t=!0,n=-1,r=[0],i=``,a=-1,o=new WeakMap;function s(e=0){t=!0,e<=0?n=0:(n<0||e<n)&&(n=e)}function c(t){let n=e.nodeHeights[t];if(Number.isFinite(n)&&n>0)return n;let r=e.parsedNodes.value[t],i=r?.type,a=!!e.hasCustomParagraphComponent?.call(e),s=e.estimatedNodeHeights.value[t],c=s?.height;if(!function(e,t,n){return!(!n||t?.kind!==`simple-text`||e!==`paragraph`&&e!==`list_item`&&e!==`list`)}(i,s,a)&&Number.isFinite(c)&&c>0)return c;let l=function(t,n){if(!t||typeof t!=`object`||!1===e.shouldCacheStaticFallbackHeight?.call(e))return oA(t,n);let r=t,i=o.get(r);if(i&&i.width===n)return i.height;let a=oA(t,n);return o.set(r,{width:n,height:a}),a}(r,e.getContainerWidth()||640);return i===`heading`||i===`paragraph`&&l<=28&&function(e,t){if(t)return!1;let n=e.children;return!Array.isArray(n)||!n.length||n.every(nA)}(r,a)?l:Math.max(e.averageNodeHeight.value,l)}function l(){let o=e.parsedNodes.value.length,l=e.getPrefixCacheKeyParts().join(`:`),u=r;i!==l&&(i=l,s(0));let d=e.averageNodeHeight.value;a!==d&&(a=d,s(0)),u.length>o+1&&(u.length=o+1,n>=0&&n>=u.length-1&&(t=!1));let f=u.length-1;if(!t){if(f===o)return u;n=f}let p=Math.min(n,f);u.length<o+1&&(u.length=o+1);for(let t=p;t<o;t++)u[t+1]=u[t]+(e.heightEstimationActive.value?c(t):e.nodeHeights[t]??d);return t=!1,n=o,u}function u(t){let n=e.parsedNodes.value.length;if(n<=0||t<=0)return 0;let r=l();if(t>=(r[n]??0))return n-1;let i=0,a=n-1,o=n-1;for(;i<=a;){let e=i+a>>1;(r[e+1]??0)>=t?(o=e,a=e-1):i=e+1}return o}function d(t,n){if(t>=n)return 0;if(e.heightEstimationActive.value)return function(t,n){let r=e.parsedNodes.value.length,i=sA(Math.trunc(t),0,r),a=sA(Math.trunc(n),i,r);if(i>=a)return 0;let o=l();return(o[a]??0)-(o[i]??0)}(t,n);if(e.heightTreeSize.value!==e.parsedNodes.value.length){let r=0;for(let i=t;i<n;i++)r+=e.nodeHeights[i]??e.averageNodeHeight.value;return r}let r=e.heightSumTree.value,i=e.heightKnownTree.value;if(!r.length||!i.length){let r=0;for(let i=t;i<n;i++)r+=e.nodeHeights[i]??e.averageNodeHeight.value;return r}return e.fenwickRangeSum(r,t,n)+(n-t-e.fenwickRangeSum(i,t,n))*e.averageNodeHeight.value}function f(t){if(t<=0)return 0;let n=e.parsedNodes.value;if(e.heightEstimationActive.value)return u(t);if(e.heightTreeSize.value===n.length&&e.heightSumTree.value.length&&e.heightKnownTree.value.length){let r=e.averageNodeHeight.value,i=e.heightSumTree.value,a=e.heightKnownTree.value,o=t=>t<=0?0:e.fenwickRangeSum(i,0,t)+(t-e.fenwickRangeSum(a,0,t))*r,s=0,c=n.length-1,l=n.length-1;for(;s<=c;){let e=s+c>>1;o(e+1)>=t?(l=e,c=e-1):s=e+1}return l}let r=t;for(let t=0;t<n.length;t++){let n=e.nodeHeights[t]??e.averageNodeHeight.value;if(r<=n)return t;r-=n}return Math.max(0,n.length-1)}function p(){if(!e.heightEstimationActive.value)return 0;let t=0,n=e.estimatedNodeHeights.value;for(let r=0;r<n.length;r++){if(!n[r])continue;let i=e.nodeHeights[r];Number.isFinite(i)&&i>0||t++}return t}return{markFallbackHeightPrefixDirty:s,getFallbackNodeHeight:c,estimateHeightRange:d,estimateIndexForOffset:f,estimateIndexForOffsetFromEnd:function(t){let n=e.parsedNodes.value;if(!n.length)return 0;if(t<=0)return Math.max(0,n.length-1);if(e.heightEstimationActive.value){let e=l()[n.length]??0;return u(Math.max(0,e-t))}if(e.heightTreeSize.value===n.length){let e=d(0,n.length);return f(Math.max(0,e-t))}let r=t;for(let t=n.length-1;t>=0;t--){let n=e.nodeHeights[t]??e.averageNodeHeight.value;if(r<=n)return t;r-=n}return 0},getEstimatedNodeHeightCount:p,buildVirtualHeightSummary:function(t){let n=e.parsedNodes.value.length;return{totalNodes:n,measuredCount:e.heightStats.count,estimatedCount:p(),averageNodeHeight:e.averageNodeHeight.value,topSpacerHeight:t.topSpacerHeight,bottomSpacerHeight:t.bottomSpacerHeight,estimatedTotalHeight:d(0,n),width:t.width??e.getContainerWidth()}}}}({parsedNodes:q,nodeHeights:fr,heightStats:pr,heightTreeSize:mr,heightSumTree:hr,heightKnownTree:gr,averageNodeHeight:_r,heightEstimationActive:Qt,estimatedNodeHeights:Ui,getContainerWidth:tn,shouldCacheStaticFallbackHeight:()=>!l.nodes?.length,hasCustomParagraphComponent:()=>!!Et.value.paragraph,getPrefixCacheKeyParts:()=>{let e=eA(Me.value||K(`getFallbackHeightPrefix.clientWidth`,()=>U.value?.clientWidth||0));return[l.virtualScroll?.measurementKey==null?``:String(l.virtualScroll.measurementKey),e,+!!Qt.value,kk.value,+!!Et.value.paragraph]},fenwickRangeSum:Er}),je=!0,v(()=>q.value.length,(e,t)=>{var n;$n(t!=null&&e>=t?ji(e):0),e<=0?jr():(e<mr.value&&(n=e,Ar(),kr(()=>yr(n))),xr(e))},{immediate:!0});let Wi=E(()=>{if(!J.value)return q.value.map((e,t)=>({node:e,index:t}));let e=q.value.length,t=Ai(Wr.start,0,e),n=Ai(Wr.end,t,e);return q.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),Gi=E(()=>J.value?tr(0,Math.min(Wr.start,q.value.length)):0),Ki=E(()=>{if(!J.value)return 0;let e=q.value.length;return tr(Math.min(Wr.end,e),e)});function qi(){return Yn.buildVirtualHeightSummary({topSpacerHeight:Gi.value,bottomSpacerHeight:Ki.value,width:na()})}function Ji(){let e=q.value;return Q(Z({},qi()),{probe:{paragraphReady:!!Ne.value.paragraph,listItemReady:!!Ne.value.listItem,listWrapperOverhead:Ne.value.listWrapperOverhead,headingReadyLevels:Object.entries(Ne.value.headings).filter(([,e])=>!!e).map(([e])=>Number(e))},nodes:e.map((e,t)=>({index:t,type:e.type,estimateKind:Ui.value[t]?.kind??null,rendererKind:Ui.value[t]?.rendererKind??null,estimatedHeight:Ui.value[t]?.height??null,estimatedContentHeight:Ui.value[t]?.contentHeight??null,measuredHeight:fr[t]??null}))})}function Yi(){return l.indexKey==null?qt.value?`virtual-${Zi()}`:`markdown-renderer`:String(l.indexKey)}function Xi(e){let t=String(e),n=`${Yi()}-`;if(!t.startsWith(n))return null;let r=t.slice(n.length).match(/^(\d+)(?:$|-)/);if(!r)return null;let i=Number(r[1]);return!Number.isInteger(i)||i<0||i>=q.value.length?null:i}function Zi(){let e=l.virtualScroll?.sessionKey;return String(e!=null&&e!==``?e:l.indexKey??H.customId??Ct)}function Qi(){let e=l.virtualScroll?.threadKey;return e==null||e===``?void 0:String(e)}let $i=E(()=>Qi()??String(l.indexKey??H.customId??Ct));function ea(e){return(e??``)===(Qi()??``)}function ta(){var e=l.virtualScroll?.measurementKey,t=function(e){let t=e.codeBlockProps,n=e.codeBlockOptions,r=n?.parseDiffOptions;return[e.isDark?`dark`:`light`,e.renderCodeBlocksAsPre?`code-pre`:`code-rich`,!1===e.codeBlockStream?`code-static`:`code-stream`,aj(e.codeBlockMinWidth),aj(e.codeBlockMaxWidth),aj(n?.fontSize),aj(n?.lineHeight),aj(n?.fontFamily),aj(n?.maxHeight),aj(n?.tabSize),aj(n?.padding),aj(n?.overflow),aj(n?.disableLineNumbers),aj(n?.diffStyle),aj(n?.diffIndicators),aj(n?.hunkSeparators),aj(n?.expandUnchanged),aj(n?.collapsedContextThreshold),aj(n?.expansionLineCount),aj(r?.context),aj(t?.showHeader),aj(t?.showCopyButton),aj(t?.showExpandButton),aj(t?.showPreviewButton),aj(t?.showCollapseButton),aj(t?.showFontSizeButtons),aj(t?.showLineNumbers)].join(`\0`)}({renderCodeBlocksAsPre:oe.value,isDark:H.isDark,codeBlockStream:H.codeBlockStream,codeBlockMinWidth:H.codeBlockMinWidth,codeBlockMaxWidth:H.codeBlockMaxWidth,codeBlockOptions:H.codeBlockOptions,codeBlockProps:H.codeBlockProps});return[e==null?``:String(e),t].join(`\0`)}function na(){return tn()}let ra=E(()=>eA(na())),ia=E(()=>[ta(),ra.value].join(`\0`)),aa=E(()=>qt.value?[`virtual`,Qi()??``,Zi(),ia.value].join(`\0`):l.indexKey);function oa(){ai.value+=1}function sa(e){return!(!e||!Number.isInteger(e.index)||e.index<0||e.index>=q.value.length||e.sessionKey!==Zi()||e.threadKey!==Qi()||e.layoutEpochKey!==ia.value)}function ca(e){let t=String(e),n=ii.get(t);return n?sa(n)?n.index:null:Xi(t)}function la(e=`async-node`){(ri.size||ii.size)&&(oi=0,ri.clear(),ii.clear(),oa(),Mo(e))}let ua=k(Cw,null),da={reportHeight(e,t){if(!Xt.value)return;let n=ca(e);if(n==null)return;let r=Kr.get(n);if(!r)return;let i=Number(t),a=Pr(n,r);(function(e,t,n={}){kr(()=>Nr(e,t,n))})(n,Number.isFinite(i)&&i>0?Math.max(i,a||0):a)},markPending(e){if(!Xt.value)return;let t=Xi(e);t!=null&&function(e,t){let n=ii.get(e);if(n&&sa(n))return ri.set(e,Math.max(0,ri.get(e)??0)+1),oi+=1,oa(),void Mo(`async-node`);ri.set(e,1),oi+=1,ii.set(e,function(e){return{index:e,sessionKey:Zi(),threadKey:Qi(),layoutEpochKey:ia.value}}(t)),oa(),Mo(`async-node`)}(String(e),t)},markSettled(e){if(!Xt.value)return;let t=String(e),n=ca(e);if((n!=null||function(e){return ri.has(String(e))}(t))&&function(e){let t=ri.get(e)??0;return!(t<=0||(t<=1?(ri.delete(e),ii.delete(e)):ri.set(e,t-1),oi=Math.max(0,oi-1),oa(),t===1&&Mo(`async-node`),0))}(t)&&n!=null){let e=Kr.get(n);e&&Bo(n,e)}}};function fa(e){if(e!==void 0)return e;let t=0;for(let e of Kr.values())t+=K(`getVisibleDomHeight.offsetHeight`,()=>e.offsetHeight);return t}t(Cw,{reportHeight(e,t){da.reportHeight(e,t),ua?.reportHeight(e,t)},markPending(e){da.markPending(e),ua?.markPending(e)},markSettled(e){da.markSettled(e),ua?.markSettled(e)}});let pa,ma=null,ha=null;function ga(e){return!1!==e&&e!=null&&e!==``}function _a(){return J.value?function(){if(!J.value)return!0;let e=q.value.length,t=Ai(Wr.start,0,e),n=Ai(Wr.end,t,e);if(t>=n)return!0;for(let e=t;e<n;e++)if(!An.has(e)||Po(e)&&!Kr.has(e))return!1;return!0}():Sn.value>=li.value}function va(){return!0===et.value&&!ot.value&&si.value===0&&$r.size===0&&Zr.size===0&&ci==null&&_a()}function ya(){if(l.virtualScroll?.settleMode!==`manual`||ma===Zi()&&pa===Qi())return!0;let e=l.virtualScroll?.settledToken;return!!ga(e)&&ha===ns(e)}function ba(){return va()&&ya()}function xa(e,t){return t.totalNodes<=0?e===`final`?`final`:`estimate`:t.measuredCount>=t.totalNodes?e===`final`?`final`:`measured`:t.measuredCount>0||t.estimatedCount>0?`mixed`:`estimate`}function Sa(e=`manual`,t,n){let r=qi(),i=function(e){return e||(!0===et.value?!_a()||Zr.size>0||ci!=null?`measuring`:ba()?`settled`:`settling`:q.value.length>0?`streaming`:`estimating`)}(t);return{sessionKey:Zi(),threadKey:Qi(),phase:i,nodeCount:r.totalNodes,liveRange:{start:Wr.start,end:Wr.end},renderedCount:Sn.value,measuredCount:r.measuredCount,estimatedCount:r.estimatedCount,averageNodeHeight:r.averageNodeHeight,topSpacerHeight:r.topSpacerHeight,bottomSpacerHeight:r.bottomSpacerHeight,visibleDomHeight:fa(n),totalHeight:wa(r),width:r.width,final:!0===et.value,stable:ba(),confidence:xa(i,r),reason:e}}function Ca(){let e=qn.value||Je(),t=U.value;if(!e||!t)return null;let n=e.ownerDocument||t.ownerDocument||document,r=e===n.documentElement||e===n.body||e===n.scrollingElement;return{root:e,doc:n,isViewportRoot:r,scrollTop:K(`getScrollBox.scrollTop`,()=>Xe(e,n,r)),scrollHeight:K(`getScrollBox.scrollHeight`,()=>r?Math.max(n.documentElement?.scrollHeight??0,n.body?.scrollHeight??0,e.scrollHeight??0):e.scrollHeight),clientHeight:K(`getScrollBox.clientHeight`,()=>r?n.documentElement?.clientHeight||e.clientHeight||0:e.clientHeight)}}function wa(e){let t=q.value.length,n=Math.max(0,tr(0,t)),r=K(`getRendererLogicalHeight.offsetHeight`,()=>U.value?.offsetHeight??0),i=Math.max(0,r>0?r:K(`getRendererLogicalHeight.scrollHeight`,()=>U.value?.scrollHeight??0));return t<=0?Math.ceil(r):J.value?n>0?Math.max(1,Math.ceil(n),function(){let e=Gi.value+Ki.value;for(let t of An.values())t&&(e+=Math.max(0,K(`getVirtualizedDomLogicalHeight.offsetHeight`,()=>t.offsetHeight||0)));return Math.ceil(Math.max(0,e))}(),function(e,t){return e<=0||t<=0?0:t<=e+Math.max(512,.05*e)?Math.ceil(t):0}(n,i)):Math.max(1,Math.ceil(i)):Xt.value?n>0||pr.count>0||(e?.estimatedCount??Yn.getEstimatedNodeHeightCount())>0?(xn.value&&Sn.value,Math.max(1,Math.ceil(i),Math.ceil(n))):Math.ceil(i):Math.max(1,Math.ceil(i),Math.ceil(n))}function Ta(e){let t=U.value;if(!t)return null;let n=K(`getRendererBottomDistanceFromViewport.getBoundingClientRect`,()=>t.getBoundingClientRect());return function(e){return e.isViewportRoot?e.clientHeight:K(`getViewportBottomInRoot.getBoundingClientRect`,()=>e.root.getBoundingClientRect().bottom)}(e)-n.bottom}function Ea(e={}){let t=!1!==e.requireViewport,n=function(e=64){let t=Ca(),n=U.value;if(!t||!n)return!1;let r=function(e){if(e.isViewportRoot)return{top:0,bottom:e.clientHeight};let t=K(`getVirtualViewportRect.getBoundingClientRect`,()=>e.root.getBoundingClientRect());return{top:t.top,bottom:t.bottom}}(t),i=K(`isRendererNearVirtualViewport.getBoundingClientRect`,()=>n.getBoundingClientRect());return i.bottom>=r.top-e&&i.top<=r.bottom+e}();if(t&&!n)return null;let r=function(){let e=Ca(),t=U.value;if(!e||!t||Math.max(0,e.scrollHeight-e.scrollTop-e.clientHeight)>64)return null;let n=Ta(e);return n==null?null:n>=-8&&n<=160?{type:`bottom`,distanceFromBottomPx:Math.max(0,n)}:null}();if(r)return{anchor:r,captured:!0};let i=lr();if(i)return{anchor:{type:`node`,nodeIndex:i.nodeIndex,offsetWithinNodePx:i.offsetWithinNodePx},captured:n};if(!0===e.allowFallback){let e=function(){let e=q.value.length;return e<=0?null:{type:`node`,nodeIndex:Ai(Ur.value,0,Math.max(0,e-1)),offsetWithinNodePx:0}}();return e?{anchor:e,captured:!1}:null}return null}function Da(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Oa(e,t){let n=e;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n^=31,n=Math.imul(n,16777619),n}let ka=new Set([`children`,`items`,`header`,`rows`,`cells`,`attrs`,`data`,`term`,`definition`]);function Aa(e,t=new WeakSet,n=0){if(e==null||typeof e==`number`||typeof e==`boolean`)return String(e);if(typeof e==`string`)return`s:${function(e){let t=e.length>8192?`${e.slice(0,8192)}...${e.length}`:e;return`${e.length}:${Da(t)}`}(e)}`;if(typeof e==`function`)return`fn`;if(typeof e!=`object`)return typeof e;if(t.has(e))return`cycle`;if(n>=6)return`max-depth`;t.add(e);try{if(Array.isArray(e)){if(e.length<=160){let r=[];for(let i=0;i<e.length;i++)r.push(Aa(e[i],t,n+1));return`a:${e.length}:${r.join(`,`)}`}let r=[],i=[],a=Math.max(0,e.length-32),o=2166136261;for(let s=0;s<e.length;s++){let c=Aa(e[s],t,n+1);o=Oa(o,c),s<32&&r.push(c),s>=a&&i.push(c)}return[`a:${e.length}`,`h=${r.join(`,`)}`,`t=${i.join(`,`)}`,`all=${(o>>>0).toString(36)}`].join(`:`)}let r=e,i=Object.keys(r).filter(e=>{let t=r[e];return e!==`parent`&&e!==`el`&&e!==`component`&&(t==null||typeof t==`string`||typeof t==`number`||typeof t==`boolean`||ka.has(e))}).sort();return`o:${i.length}:${i.map(e=>`${e}=${Aa(r[e],t,n+1)}`).join(`;`)}`}finally{t.delete(e)}}let ja=-1,Ma=new Map,Na=-1,Pa=``,Fa=[2166136261];function Ia(e){let t=q.value[e],n=Pt();if(ja!==n&&(ja=n,Ma.clear()),!t)return``;if(l.nodes?.length||H.parseOptions||H.customMarkdownIt||Ot.value.__markstreamHasCustomParserExtensions||Object.keys(Et.value).length!==0)return Da(Aa(t));let r=Ma.get(e);if(r!==void 0)return r;let i=Da(Aa(t));return Ma.set(e,i),i}function La(e,t){let n=e;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n>>>0}function Ra(){let e=Ae.value;if(Na===e)return Pa;let t=q.value.length,n=ji(t);(Na!==e-1||n>t||Fa.length<n+1)&&(n=0),n===0?Fa=[2166136261]:Fa.length=n+1;for(let e=n;e<t;e++){let t=Ia(e);Fa[e+1]=La(Fa[e]??2166136261,t)}return Fa.length=t+1,Pa=((Fa[t]??2166136261)>>>0).toString(36),Na=e,Pa}function za(e,t={}){let n=!0===t.includeHeightCache,r=t.includeContentHash??n,i=n?function(e){let t=function(){let e=Number(l.virtualScroll?.heightCacheLimit??5e3);return!Number.isFinite(e)||e<=0?1/0:Math.max(1,Math.trunc(e))}();if(!Number.isFinite(t)||e.length<=t)return e;let n=new Map,r=e=>{!e||n.size>=t||n.set(e.index,e)},i=q.value.length,a=Ai(Wr.start-2*on.value,0,i),o=Ai(Wr.end+2*on.value,a,i);for(let t of e)t.index>=a&&t.index<o&&r(t);let s=Math.max(1,Math.ceil(e.length/t));for(let i=0;i<e.length&&n.size<t;i+=s)r(e[i]);for(let i=e.length-1;i>=0&&n.size<t;i-=s)r(e[i]);return Array.from(n.values()).sort((e,t)=>e.index-t.index).slice(0,t)}(wr().map(e=>{let t=q.value[e.index];return t?Q(Z({},e),{nodeType:String(t.type??``),signature:Ia(e.index)}):null}).filter(e=>!!e)):[],a=Ea({allowFallback:!0===t.allowAnchorFallback,requireViewport:t.requireViewport});return a||i.length||!0===t.includeEmptyState?Q(Z({sessionKey:e.sessionKey,threadKey:e.threadKey},a?{anchor:a.anchor,anchorCaptured:a.captured}:{anchorCaptured:!1}),{metrics:e,width:e.width,contentHash:r?Ra():void 0,measurementKey:ta()||void 0,heightCache:i.length?i:void 0}):null}function Ba(e){var t,n;let r=Ca();if(!r)return;let i=function(e){let t=U.value;if(!t)return null;let n=G(t,e.root),r=q.value.length,i=K(`getRendererBottomOffsetWithinRoot.offsetHeight`,()=>t.offsetHeight||0),a=Math.max(0,i>0?i:r>0?K(`getRendererBottomOffsetWithinRoot.scrollHeight`,()=>t.scrollHeight||0):0),o=wa();return n+Math.max(a,o)}(r);if(i==null)return;let a=Math.max(0,e.distanceFromBottomPx),o=Math.max(0,i-r.clientHeight-a);(function(e){Zn=So()+120,Qn=e})(o),r.isViewportRoot?(n=(t=r.doc.defaultView)?.scrollTo)==null||n.call(t,0,o):Kk(r.root,r.doc,o,{isReverseFlexScrollRoot:Ye,getNormalizedScrollTop:Xe})}let Va=[];function Ha(){if(W)for(Xn!=null&&(mn?.(Xn),Xn=null);Va.length;){let e=Va.pop();e!=null&&window.clearTimeout(e)}}function Ua(e){let t=!!Jn.value;Jn.value=null,Zn=0,Qn=null,Ha(),t&&e&&Mo(e)}function Wa(){if(!Jn.value||!W||Xn!=null)return;let e=()=>{Xn=null;let e=Jn.value;e&&Ba(e)};Xn=pn?pn(e):null,Xn??e()}function Ga(e,t={}){let n=q.value.length;return n<=0?[]:e.filter(e=>!(!Number.isInteger(e.index)||e.index<0||e.index>=n)&&!(!Number.isFinite(e.height)||e.height<=0)&&!(t.requireSignature&&!e.signature)&&!(t.requireCompatibilityMetadata&&!e.nodeType&&!e.signature)&&function(e){let t=q.value[e.index];return!(!t||e.nodeType&&e.nodeType!==String(t.type??``)||e.signature&&e.signature!==Ia(e.index))}(e))}function Ka(e){let t=eA(na()),n=eA(e);return t!==-1&&n!==-1&&t===n}function qa(e){let t=Number(e?.width);if(Number.isFinite(t)&&t>0)return t;let n=Number(e?.metrics?.width);return Number.isFinite(n)&&n>0?n:null}function Ja(e){return e.sessionKey===Zi()&&!!ea(e.threadKey)&&(e.measurementKey??``)===ta()&&!!Ka(qa(e))&&!!function(e){let t=e.heightCache;return!!t?.length&&(Ya(e)?t.some(e=>!!(e.nodeType||e.signature)):t.some(e=>!!e.signature))}(e)}function Ya(e){return!!(e.contentHash&&e.contentHash===Ra())}function Xa(e){return!Ya(e)}let Za=null,Qa=null,$a=null,eo=null,to=null;function no(e){let t=e.map(e=>[e.index,Math.round(10*e.height),e.nodeType??``,e.signature??``].join(``)).join(``),n=eA(na());return[Qi()??``,Zi(),ta(),q.value.length,n,e.length,Da(t)].join(`:`)}function ro(e=(e=>(e=l.virtualScroll)?.heightCache)()){if(!Xt.value||!e?.length||q.value.length<=0||!Ka((t=l.virtualScroll)?.heightCacheWidth))return!1;var t;let n=Ga(e,{requireSignature:!0});if(!n.length)return!1;let r=no(n);return r===Za?(Qa=`standalone`,!0):(Fr(n,{mode:`merge`}),$n(),Za=r,Qa=`standalone`,Eo(),Mo(`restore`),!0)}function io(){let e=l.virtualScroll?.restoreAnchor;return e==null||!1===e?null:!0===e?`true`:String(e)}function ao(e,t={}){if(!Xt.value||!e||e.sessionKey!==Zi()||!ea(e.threadKey)||q.value.length<=0)return!1;let n=!!e.heightCache?.length&&!oo(),r=!e.anchor||!1===e.anchorCaptured&&!0!==t.allowUncapturedAnchor?null:e.anchor,i=!0===t.restoreAnchor&&!!r&&!oo()&&Number(qa(e))>0,a=!1;if(e.heightCache?.length&&Ja(e)){let t=Ga(e.heightCache,{requireCompatibilityMetadata:!e.contentHash,requireSignature:Xa(e)});t.length&&(Fr(t,{mode:`merge`}),$n(),Za=no(t),Qa=`restore`,Eo(),a=!0)}if(n||i)return!1;if(!t.restoreAnchor||!r)return a&&Mo(`restore`),!0;let o=function(e,t){let n=e.anchor,r=n?n.type===`bottom`?`bottom:${Math.round(n.distanceFromBottomPx)}`:`node:${n.nodeIndex}:${Math.round(n.offsetWithinNodePx)}`:`none`;return[Qi()??``,Zi(),ta(),ra.value,t,r].join(`:`)}(e,t.restoreToken??`imperative`);return $a===o?(a&&Mo(`restore`),!0):($a=o,function(e){let t=()=>{if(e.type===`node`)return Ua(),void ur({nodeIndex:e.nodeIndex,offsetWithinNodePx:e.offsetWithinNodePx});if(sr(),rr.value=null,Jn.value=e,Ha(),Ba(e),W)for(let e of[0,120,280,480])Va.push(window.setTimeout(()=>{let e=Jn.value;e&&Ba(e)},e))};(function(e){if(!J.value)return!1;let t=q.value.length;return!(t<=0||(Ur.value=e.type===`node`?Ai(e.nodeIndex,0,t-1):t-1,Gr(),0))})(e)?c(t):t()}(r),Mo(`restore`),!0)}function oo(){let e=na();return Number.isFinite(e)&&e>0}function so(e){return e.sessionKey===Zi()&&!!ea(e.threadKey)&&(q.value.length<=0||!(!e.heightCache?.length||oo())||!(!(e.anchor&&Number(qa(e))>0)||oo()))}function co(){In.length=0;for(let e of Object.keys(fr)){let t=Number(e);Number.isInteger(t)&&t>=0&&t<q.value.length&&Mr(t)}}function lo(){ci!=null&&(mn?.(ci),ci=null),Lo()}function uo(){return!W||gn?Promise.resolve():new Promise(e=>{let t=!1,n=null,r=()=>{t||(t=!0,n!=null&&window.clearTimeout(n),e())};if(pn)return pn(r),void(n=window.setTimeout(r,50));n=window.setTimeout(r,0)})}function fo(e,t=Qi(),n=ia.value){return Zi()===e&&Qi()===t&&ia.value===n}function po(){return mE(this,arguments,function*(e={}){let t=Zi(),n=Qi(),r=ia.value,i=e.frames??2,a=e.timeoutMs??120,o=e.reason??`manual`,s=e.expectedSettledTokenKey,u=!0===e.flushPendingTimers,d=Sa(o),f=()=>Q(Z({},d),{phase:d.final?`settling`:d.phase,stable:!1,confidence:d.confidence===`final`?`mixed`:d.confidence,reason:o}),p=()=>fo(t,n,r)&&(s==null||wo()===s);for(let e=0;e<i;e++){if(yield c(),!p()||(yield uo(),!p()))return f();Vo(),lo()}if(yield function(e){return!W||e<=0?Promise.resolve():new Promise(t=>window.setTimeout(t,e))}(a),!p()||(u&&pi(),Vo(),lo(),!p()))return f();let m=va();m&&(ma=t,pa=n,l.virtualScroll?.settleMode===`manual`&&s!=null&&ga(l.virtualScroll?.settledToken)&&wo()===s&&(ha=ns(l.virtualScroll.settledToken)));let h=Sa(o,p()&&m&&ya()?`final`:void 0);return ko(h,!0),h})}let mo=`content`,ho=null,go=null,_o=0,vo=null,yo=null,bo=null,xo=null;function So(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function Co(e){let t=vo;if(!t)return!0;let n=l.virtualScroll?.heightDiffThresholdPx??1;return Math.abs(e.totalHeight-t.totalHeight)>n||e.sessionKey!==t.sessionKey||e.phase!==t.phase||e.stable!==t.stable||e.final!==t.final||e.threadKey!==t.threadKey||e.nodeCount!==t.nodeCount||e.measuredCount!==t.measuredCount||e.width!==t.width}function wo(e=(e=>(e=l.virtualScroll)?.settledToken)()){return aj(e)}function To(e,t){return[e,t.sessionKey,t.threadKey??``,ta(),Ra(),aj(l.virtualScroll?.settledToken),Math.round(t.totalHeight),Math.round(t.width)].join(`\0`)}function Eo(){bo=null,xo=null,yo=null}function Do(e){let t=e.heightCache;return t?.length?no(t):``}function Oo(e){let t=e.metrics,n=e.anchor?(r=e.anchor).type===`bottom`?`bottom:${Math.round(r.distanceFromBottomPx)}`:`node:${r.nodeIndex}:${Math.round(r.offsetWithinNodePx)}`:`none`;var r;return[e.sessionKey,e.threadKey??``,e.measurementKey??ta(),e.contentHash??``,Do(e),n,+!!e.anchorCaptured,t.liveRange.start,t.liveRange.end,t.renderedCount,t.nodeCount,Math.round(t.totalHeight),Math.round(t.width),t.phase,+!!t.stable].join(`\0`)}function ko(e,t=!1){if(!Xt.value||function(e=!1){return!e&&qt.value&&!Zt.value}(t))return;let n=t||Co(e),r=function(e,t=!1){return t||e.stable||e.phase===`final`?{state:za(e,{includeHeightCache:!0})}:{state:za(e)}}(e,t).state,i=!!(r&&(n||function(e,t=!1){return!!t||Oo(e)!==yo}(r,t)));if(n&&(xe(e),vo=e,_o=So()),r&&i&&(Se(r),r.anchor&&Ce(r.anchor),yo=Oo(r)),e.stable){let t=To(`settled`,e);if(t!==bo){bo=t;let n=za(e,{includeHeightCache:!0});n&&(Se(n),yo=Oo(n)),function(e){d(`render-settled`,e)}(e)}}if(e.phase===`final`){let t=To(`final`,e);if(t!==xo){xo=t;let n=za(e,{includeHeightCache:!0});n&&(Se(n),yo=Oo(n)),function(e){d(`render-final`,e)}(e)}}}function Ao(){ho!=null&&(mn?.(ho),ho=null),go!=null&&W&&(window.clearTimeout(go),go=null)}function jo(){ho=null,go=null;let e=So(),t;e-Qr>=120&&(Qr=e,t=Vo()),(Zr.size>8||ci==null)&&lo(),ko(Sa(mo,void 0,t))}function Mo(e){if(!Xt.value||(mo=e,ho!=null||go!=null))return;let t=Math.max(0,l.virtualScroll?.emitIntervalMs??32),n=Math.max(0,t-(So()-_o)),r=()=>{go=null,ho=pn?pn(jo):null,ho??jo()};W&&n>0?go=window.setTimeout(r,n):r()}function No(){Gn.value+=1}function Po(e){if(xn.value&&e>=Sn.value){let t=q.value[e],n=!0===$e.value&&!0!==et.value&&e>=q.value.length-2,r=t?.type===`code_block`||t?.type===`image`||t?.type===`mermaid`||t?.type===`infographic`;if(!n||r)return!1}return!Ir.value||e<yn.value||!!(ot.value&&!0!==et.value&&!l.nodes?.length&&e>=q.value.length-on.value)||yi.value.has(e)}function Fo(e){let t=xi.get(e);t&&(t(),xi.delete(e));let n=bi.get(e);n&&(n.destroy(),bi.delete(e)),Ci(e)}function Io(e,t){let n=!1;if(t){let r=An.get(e);if(r===t&&jn.get(e)===Vr.value)return;An.set(e,t),r!==t&&(n=!0)}else An.delete(e)&&(n=!0);if(n&&No(),t||Ci(e),!Br.value||!fn)return Fo(e),t?jn.set(e,Vr.value):jn.delete(e),void(t&&Ir.value&&wi(e,!0));if(!J.value&&Ir.value&&!Oe.value&&bi.size>=Re.value&&(Oe.value||(Oe.value=!0,Ei()),!Br.value||!fn))return Fo(e),jn.set(e,Vr.value),void(t&&wi(e,!0));if(e<yn.value&&!J.value||yi.value.has(e))return Fo(e),jn.set(e,Vr.value),void wi(e,!0);if(!t)return Fo(e),void jn.delete(e);Fo(e);let r=fn(t,{rootMargin:Le.value});if(!r)return void jn.delete(e);bi.set(e,r),jn.set(e,Vr.value),wi(e,r.isVisible.value),Ir.value&&function(e){if(!W||!Ir.value)return;Ci(e);let t=e%17*23,n=window.setTimeout(()=>{if(Si.delete(e),!Ir.value||yi.value.has(e))return;let t=An.get(e);if(!t)return;let n=Je(t),r=t.ownerDocument||document,i=r.defaultView||window,a=!n||n===r.documentElement||n===r.body,o=!a&&n?K(`nodeVisibilityFallback.root.getBoundingClientRect`,()=>n.getBoundingClientRect()):null,s=a?0:o.top,c=a?K(`nodeVisibilityFallback.clientHeight`,()=>i.innerHeight??n?.clientHeight??0):o.bottom,l=K(`nodeVisibilityFallback.node.getBoundingClientRect`,()=>t.getBoundingClientRect());l.bottom>=s-500&&l.top<=c+500&&wi(e,!0)},1800+t);Si.set(e,n)}(e);let i=null;i=v(()=>r.isVisible.value,t=>{if(t){Ci(e),wi(e,!0),i?.(),xi.delete(e),bi.get(e)===r&&bi.delete(e);try{r.destroy()}catch{}}},{immediate:!0}),xi.set(e,i),J.value&&vi()}function Lo(){ci=null,kr(()=>{let e=!1;for(let[t,n]of Zr)Zr.delete(t),Kr.get(t)===n.el&&qr.get(t)===n.version&&(e=Nr(t,n.height,{allowShrink:n.allowShrink})||e);return e})}function Ro(){ci!=null&&(mn?.(ci),ci=null),Zr.clear()}function zo(e,t,n){if(!Number.isFinite(n)||n<=0||Kr.get(e)!==t)return;let r=qr.get(e);if(r==null)return;let i=q.value[e],a=ot.value&&!0!==et.value&&!l.nodes?.length&&e>=q.value.length-2,o=!(!0===i?.loading||a),s=Zr.get(e),c=s?s.allowShrink&&o:o,u=s&&!c?Math.max(s.height,n):n;Zr.set(e,{height:u,allowShrink:c,version:r,el:t}),ci??(ci=pn?pn(Lo):null,ci??Lo())}function Bo(e,t){zo(e,t,Pr(e,t))}function Vo(){let e=0;for(let[t,n]of Kr){let r=Pr(t,n);e+=r,zo(t,n,r)}return e}function Ho(){Pn?.disconnect(),Pn=null,Mn.clear()}function Uo(){for(;Xr.length;)fi(Xr.pop())}v(Zt,e=>{e&&Mo(`content`)},{flush:`post`}),n({getVirtualMetrics:Sa,captureVirtualState:function(e={}){var t;return za(Sa(`manual`),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!0===e.allowFallbackAnchor,requireViewport:!0===e.requireViewport,includeEmptyState:(t=e.includeEmptyState)==null||t})},restoreVirtualState:function(e,t={}){let n=!0===t.restoreAnchor,r=t.restoreToken==null?`imperative`:String(t.restoreToken);eo=e,to={restoreAnchor:n,restoreToken:r,allowUncapturedAnchor:!0===t.allowUncapturedAnchor},!ao(e,{restoreAnchor:n,restoreToken:r,allowUncapturedAnchor:!0===t.allowUncapturedAnchor})&&so(e)||(eo=null,to=null)},forceMeasure:function(e=`manual`){return mE(this,null,function*(){yield c(),yield uo(),Vo(),lo(),yield c();let t=Sa(e);return ko(t,!0),t})},settle:po,scrollToNode:function(e,t=`start`){Ua(),sr();let n=q.value.length;if(n<=0)return;let r=Ai(e,0,n-1),i=()=>{let e=or({nodeIndex:r,offsetWithinNodePx:0}),n=er(r),i=Ca()?.clientHeight??0,a=ir(),o=e;if(t===`center`)o=e-i/2+n/2;else if(t===`end`)o=e-i+n;else if(t===`nearest`&&a!=null){if(e>=a&&e+n<=a+i)return;o=e<a?e:e-i+n}ar(Math.max(0,o)),vi({immediate:!0}),J.value&&(Ur.value=r,Gr())};if(J.value)return Ur.value=r,Gr(),void c(i);i()}});let Wo=new Set;v(()=>sn.value,e=>{if(e)Jr.clear();else{Ho();for(let e of Yr.values())for(let t of e)fi(t);Yr.clear(),qr.clear(),Uo(),Ro()}},{immediate:!0}),v(et,e=>{e&&function(){if(W&&et.value&&Kr.size){Uo();for(let e of Pn?[80]:[80,240,640]){let t=di(e,()=>{for(let[e,t]of Kr)t&&Bo(e,t)},`final`);t!=null&&Xr.push(t)}}}(),Mo(e?`final`:`content`)});let Go=qk(()=>Mo(`content`),16),Ko=qk(()=>Mo(`batch`),16);v([()=>q.value.length,()=>Sn.value],()=>{Jn.value&&Wa(),Go()},{flush:`post`,immediate:!0}),v([()=>Wr.start,()=>Wr.end],()=>{Ko()},{flush:`post`});let{cleanupBatchScheduler:qo}=function(e){let{props:t,isClient:n,isTestEnv:r,parsedNodesIdentity:i,parsedNodeCount:a,desiredRenderedCount:o,datasetKey:s,batchingEnabled:l,incrementalRenderingActive:u,resolvedBatchSize:d,resolvedInitialBatch:f,renderedCount:p,adaptiveBatchSize:m,previousRenderContext:h,previousBatchConfig:g,requestFrame:_,cancelFrame:y,hasIdleCallback:b,cleanupNodeVisibility:x,onDatasetKeyChanged:S,onDatasetChanged:C}=e,w=null,T=`raf`,E=null,D=0,O=!1,k=!1,A=new Set,j=new Set;function M(){if(n){w!=null&&(T===`raf`&&y?y(w):T===`idle`&&typeof window.cancelIdleCallback==`function`?window.cancelIdleCallback(w):T===`timeout`&&window.clearTimeout(w),w=null),D+=1;for(let e of A)y&&y(e);for(let e of j)window.clearTimeout(e);A.clear(),j.clear(),E=null,O=!1,k=!1}}function N(){return typeof performance<`u`?performance.now():Date.now()}function P(e){(function(e){if(!u.value)return;let n=Math.max(2,t.renderBatchBudgetMs??6),r=Math.max(1,d.value||1),i=Math.max(1,Math.floor(r/4));e>1.5*n?m.value=Math.max(i,Math.floor(.8*m.value)):e<.6*n&&m.value<r&&(m.value=Math.min(r,Math.ceil(1.2*m.value)))})(e),O=!1;let n=k||p.value<o.value;k=!1,n&&F()}function ee(e,i={}){if(!u.value)return;let a=o.value;if(p.value>=a)return;let s=Math.max(1,e),l=()=>{let e=N();w=null;let r=E??s;E=null;let i=N();p.value=Math.min(a,p.value+r),x(p.value),function(e,r){if(!n)return void P(r);O=!0;let i=++D;c().then(()=>{if(i!==D)return;let n=N(),a=Math.max(r,n-e),o=()=>{i===D&&P(a)};if(_){let e=null,n=null,r=!1,i=()=>{r||(r=!0,e!==null&&(A.delete(e),e=null),n!==null&&(j.delete(n),window.clearTimeout(n),n=null),o())};e=_(()=>{i()}),A.add(e),n=window.setTimeout(()=>{e!==null&&y&&y(e),i()},Math.max(32,t.renderBatchIdleTimeoutMs??120)),j.add(n);return}let s=window.setTimeout(()=>{j.delete(s),o()},0);j.add(s)})}(e,N()-i)};if(!n||i.immediate)return void l();let d=Math.max(0,t.renderBatchDelay??16);if(E=E==null?s:Math.max(E,s),w!=null)return;let f=typeof document<`u`&&document.visibilityState===`hidden`;if(!r&&!f&&b&&window.requestIdleCallback){let e=Math.max(0,t.renderBatchIdleTimeoutMs??120);T=`idle`,w=window.requestIdleCallback(()=>l(),{timeout:e})}else{if(_&&!r&&!f)return T=`raf`,void(w=_(()=>{d===0?l():(T=`timeout`,w=window.setTimeout(()=>l(),d))}));T=`timeout`,w=window.setTimeout(()=>l(),d)}}function te(e,t={}){O?k=!0:e==null?F():ee(e,t)}function F(){u.value&&ee(l.value?Math.max(1,Math.round(m.value)):Math.max(1,d.value))}return v([i,a,s,u,d,f,()=>t.renderBatchDelay],()=>{let e=a.value,r=h.value,i=s.value,c=!Object.is(i,r.key),l=e!==r.total,_=l&&e>r.total&&r.total>0&&!c,v=c||l;h.value={key:i,total:e};let y=g.value,b=t.renderBatchDelay??16,w=y.batchSize!==d.value||y.initial!==f.value||y.delay!==b||y.enabled!==u.value;g.value={batchSize:d.value,initial:f.value,delay:b,enabled:u.value},c&&S(e),(v||w||!u.value)&&M(),(v&&!_||w)&&(m.value=Math.max(1,d.value||1)),v&&!_&&C();let T=o.value;if(!e)return p.value=0,void x(0);if(!u.value)return p.value=T,void x(p.value);let E=c||r.total===0;p.value=E||w?Math.min(T,f.value):Math.min(p.value,T);let D=Math.max(1,f.value||d.value||e);p.value<T?te(D,{immediate:!n}):x(p.value)},{immediate:!0}),v(o,(e,t)=>{u.value&&(typeof t==`number`&&e<=t||e>p.value&&te())}),{cleanupBatchScheduler:M}}({props:H,isClient:W,isTestEnv:gn,parsedNodesIdentity:It,parsedNodeCount:Lt,desiredRenderedCount:li,datasetKey:aa,batchingEnabled:bn,incrementalRenderingActive:xn,resolvedBatchSize:vn,resolvedInitialBatch:yn,renderedCount:Sn,adaptiveBatchSize:wn,previousRenderContext:Cn,previousBatchConfig:Tn,requestFrame:pn,cancelFrame:mn,hasIdleCallback:hn,cleanupNodeVisibility:Ti,onDatasetKeyChanged:e=>{Ro(),jr(),$n(),Eo(),e>0&&br(e)},onDatasetChanged:()=>{J.value&&vi({immediate:!0})}});v([Hr,J,()=>U.value,()=>ze()],([e,t])=>{if(!e)return Di(),void _i();Oi(),t?vi({immediate:!0}):_i()},{flush:`post`,immediate:!0});let Jo=!1;function Yo(){J.value&&W&&!Jo&&(Jo=!0,pn?pn(()=>{Jo=!1,vi({immediate:!0})}):queueMicrotask(()=>{Jo=!1,vi({immediate:!0})}))}v([()=>q.value.length,()=>J.value],([e,t])=>{t&&e&&W&&Yo()},{flush:`post`}),v(Qt,e=>{e&&function(){if(Rt.value&&zt.value&&Bt.value&&Vt.value?.[1])return;let e=ne({type:`paragraph`,children:[{type:`text`,content:`Probe paragraph text`,raw:`Probe paragraph text`}],raw:`Probe paragraph text`}),t=ne({type:`list_item`,children:[e],raw:`- Probe paragraph text`}),n=ne({type:`list`,ordered:!1,items:[t],raw:`- Probe paragraph text`});Rt.value=e,zt.value=t,Bt.value=n;let r={1:null,2:null,3:null,4:null,5:null,6:null};for(let e=1;e<=6;e++)r[e]=ne({type:`heading`,level:e,text:`Probe heading`,children:[{type:`text`,content:`Probe heading`,raw:`Probe heading`}],raw:`${`#`.repeat(e)} Probe heading`});Vt.value=r}()},{immediate:!0}),v([()=>U.value,Lr],()=>{if(!Lr.value)return Li(),void(Me.value=0);Fi(),Li(),Lr.value&&U.value&&typeof ResizeObserver<`u`&&(Ii=new ResizeObserver(()=>{Fi(),Qt.value&&(rr.value&&cr(),Jn.value&&Wa(),Mo(`resize`))}),Ii.observe(U.value))},{immediate:!0}),v([Qt,nn,ia],()=>mE(null,null,function*(){if(!Qt.value)return Ne.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void $n();yield c(),function(){if(!Qt.value||typeof window>`u`)return Ne.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void $n();let e={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},t=Ni(Mi(we.value),`.paragraph-node`);e.paragraph=Hk(we.value,t,`pre-wrap`);let n=Mi(Te.value)?.querySelector(`.paragraph-node`);e.listItem=Hk(Te.value,n,`pre-wrap`);let r=K(`readSimpleTextProbeProfile.list.offsetHeight`,()=>Ee.value?.offsetHeight??0),i=K(`readSimpleTextProbeProfile.listItem.offsetHeight`,()=>Te.value?.offsetHeight??0);e.listWrapperOverhead=Math.max(0,r-i);for(let t=1;t<=6;t++){let n=Ni(Mi(De[t]),`h${t}`);e.headings[t]=Hk(De[t],n,`pre-wrap`)}Ne.value=e,$n()}()}),{flush:`post`,immediate:!0}),v(()=>q.value.length,()=>{J.value&&Yo()}),v([Qt,Me],()=>{$n(),J.value&&vi({immediate:!0}),rr.value&&cr(),Jn.value&&Wa(),Mo(`resize`)},{immediate:!1}),v(()=>Ir.value,e=>{if(e)for(let[e,t]of An)Io(e,t);else if(Ei(),J.value)vi({immediate:!0});else for(let[e,t]of An)t&&wi(e,!0)},{immediate:!1}),v([Le,Re,()=>ze()],()=>{var e;(e=fn.refresh)==null||e.call(fn);for(let[e,t]of An)Io(e,t)},{immediate:!1}),v([()=>H.viewportPriority,()=>q.value.length,Re],([e,t,n])=>{if(!1!==e){if(Oe.value&&(t<=200||t<=n)){Oe.value=!1;for(let[e,t]of An)Io(e,t)}}else Oe.value=!1}),v(()=>Sn.value,()=>{J.value&&vi({immediate:!0})}),v([Ur,an,on,()=>q.value.length,J],()=>{Gr()},{immediate:!0});let Xo=null,Zo=!1,Qo=null;function $o(){Xo=null,ma=null,pa=void 0,ha=null,Eo()}function es(){Ro(),jr(),$n(),In.length=0;let e=q.value.length;e>0&&br(e),co()}function ts(){Ao(),pi(),vo=null,Za=null,Qa=null,$a=null,eo=null,to=null,Zo=!1,$o(),la(`restore`),sr(),Ua()}function ns(e){return[Qi()??``,Zi(),ta(),ra.value,wo(e),q.value.length,Math.round(tr(0,q.value.length)),Math.round(na()),pr.count,Math.round(pr.total)].join(`:`)}function rs(){return mE(this,null,function*(){let e=l.virtualScroll?.settledToken,t=wo(e),n=Zi(),r=Qi(),i=ia.value;if(Xt.value&&l.virtualScroll?.settleMode===`manual`&&ga(e)){if(va()){if(ns(e)!==ha&&!Zo){Zo=!0;try{let e=yield po({reason:`manual`,expectedSettledTokenKey:t}),a=wo()===t;fo(n,r,i)&&e.sessionKey===n&&e.threadKey===r&&a&&e.stable&&e.phase===`final`&&(ha=ns(l.virtualScroll?.settledToken))}finally{Zo=!1,yield c();let e=l.virtualScroll?.settledToken,t=ga(e)?ns(e):``;fo(n,r,i)&&t&&ha!==t&&rs()}}}else Mo(`manual`)}})}v(Xt,(e,t)=>{if(e!==t){if(!e)return ts(),void Ao();ts(),es(),Qo=ia.value,Mo(`content`)}},{flush:`post`}),v([Xt,ia],([e,t])=>{e?Qo==null?Qo=t:Qo!==t&&(Qo=t,function(e=`resize`){Ro(),jr(),$n(),In.length=0;let t=q.value.length;t>0&&br(t),co(),Za=null,Qa=null,$a=null,vo=null,Zo=!1,$o(),ro(),c(()=>{Vo(),rr.value&&cr(),Jn.value&&Wa(),Mo(e)})}(`resize`)):Qo=null},{flush:`post`,immediate:!0}),v([Xt,()=>Zi(),()=>Qi()],([e])=>{e&&(ts(),es(),la(`content`),Mo(`content`))}),v([Xt,()=>Zi(),()=>Qi(),ia,()=>q.value.length],([e])=>{e&&function(e=`async-node`){let t=!1;for(let[e,n]of Array.from(ii.entries()))sa(n)||(oi-=Math.max(0,ri.get(e)??0),ii.delete(e),ri.delete(e),t=!0);t&&(oa(),Mo(e))}(`async-node`)},{flush:`post`}),v([Xt,()=>l.virtualScroll?.sessionKey,()=>l.virtualScroll?.measurementKey,()=>l.indexKey,()=>Ae.value],([e])=>{e&&(Eo(),function(e=`content`){if(!Xt.value)return;let t=[],n=q.value.length,r=ji(n),i=In.length-1,a=Math.max(n-1,i);for(let e=r;e<=a;e++){if(e>=n){e<=i&&In[e]!==void 0&&t.push(e);continue}let r=Ia(e),a=In[e];a!=null&&a!==r&&t.push(e),In[e]=r}if(i>=n){for(let e=n;e<=i;e++)In[e]=void 0;In.length=n}t.length&&(function(e,t={}){let n=Array.from(e,Number);Or(n);let r=0;if(kr(()=>(r=Cr(n,t),r>0)),r>0)(function(e){for(let t of e)Number.isInteger(t)&&t>=0&&t<In.length&&(In[t]=void 0)})(n);else for(let e of n)Hn.delete(e)}(t,{notify:!1}),$n(r),$o(),rr.value&&cr(),Jn.value&&Wa(),Mo(e))}(`content`))},{flush:`post`,immediate:!0}),v([Xt,()=>q.value.length,()=>Zi(),()=>Qi()],([e,t,n,r],[i,a,o,s])=>{e&&i&&n===o&&r===s&&t!==a&&$o()},{flush:`post`}),v([Xt,()=>l.virtualScroll?.heightCache,()=>l.virtualScroll?.heightCacheWidth,()=>l.virtualScroll?.restoreState,()=>l.virtualScroll?.measurementKey,()=>q.value.length,()=>Zi(),Me],()=>{ro()},{flush:`post`,immediate:!0}),v(io,(e,t)=>{e==null&&t!=null&&(sr(),rr.value=null,Ua(),$a=null)},{flush:`post`}),v([Xt,()=>l.virtualScroll?.restoreState,()=>l.virtualScroll?.restoreAnchor,()=>l.virtualScroll?.measurementKey,()=>q.value.length,()=>Zi(),Me],e=>mE(null,[e],function*([e,t]){if(!e||!t)return;yield c();let n=io();ao(t,{restoreAnchor:n!=null,restoreToken:n??void 0})}),{flush:`post`,immediate:!0}),v([Xt,Me,()=>l.virtualScroll?.restoreState,()=>l.virtualScroll?.measurementKey],([e])=>{if(!e)return;let t=l.virtualScroll?.restoreState;t&&Za&&Qa===`restore`&&(Ja(t)||(es(),Za=null,Qa=null,Mo(`resize`)))},{flush:`post`}),v([Xt,()=>q.value.length,()=>Zi(),Me],e=>mE(null,[e],function*([e]){let t=eo,n=to;e&&t&&(yield c(),!ao(t,{restoreAnchor:!0===n?.restoreAnchor,restoreToken:n?.restoreToken??`imperative`,allowUncapturedAnchor:!0===n?.allowUncapturedAnchor})&&so(t)||(eo=null,to=null))}),{flush:`post`,immediate:!0}),v([Xt,et,()=>l.virtualScroll?.settleMode,()=>Zi(),()=>Qi(),ia,si,ni,()=>Sn.value,li,()=>pr.count,()=>pr.total],([e,t,n])=>{if(!e||!0!==t||n===`manual`||!ba())return;let r=function(){let e=q.value.length;return[Qi()??``,Zi(),ta(),ra.value,e,Math.round(tr(0,e)),Math.round(na()),pr.count,Math.round(pr.total)].join(`:`)}();Xo!==r&&(Xo=r,po({reason:`final`}).then(e=>{e.stable||Xo!==r||(Xo=null)}))},{flush:`post`,immediate:!0}),v([Xt,et,()=>l.virtualScroll?.settleMode,()=>l.virtualScroll?.settledToken,()=>Zi(),()=>Qi(),ia,si,ni,()=>Sn.value,li,()=>q.value.length,()=>pr.count,()=>pr.total],()=>{rs()},{flush:`post`,immediate:!0}),v([()=>q.value.length,J,an,on,()=>Wr.start,()=>Wr.end],([e,t,n,r,i,a])=>{He.value&&mt(`virtualization`,{nodes:e,virtualization:t,maxLiveNodes:n,buffer:r,focusIndex:Ur.value,scroll:t?(()=>{let e=qn.value||Je();return e?{reverse:Ye(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:i,end:a},rendered:Sn.value})}),v([()=>H.customId],([e],t,n)=>{if(!e||Ht)return;let r=function(e,t){return e?(wk.controllers[e]=t,()=>{wk.controllers[e]===t&&delete wk.controllers[e]}):()=>{}}(e,{captureRestoreAnchor:lr,restoreAnchor:ur,getAnchorDrift:dr,getReport:Ji});n(()=>{r()})},{immediate:!0}),u(()=>{(function(){if(Xt.value)try{Vo(),lo();let e=Sa(`manual`);Co(e)&&(xe(e),vo=e,_o=So());let t=za(e,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});t&&(Se(t),t.anchor&&Ce(t.anchor),yo=Oo(t))}catch{}})(),qo(),Ei(),ft(),Ho();for(let e of Yr.values())for(let t of e)fi(t);Yr.clear(),qr.clear(),In.length=0,Uo(),Ro(),Li(),sr(),Ua(),Ao(),Di(),_i()});let is=iO(`ViewportDeferredMermaidBlockNode`,R({loader:()=>mE(null,null,function*(){try{return(yield V(()=>import(`./index10-ExQJARIx.js`),__vite__mapDeps([11,0,1,8]))).default}catch(e){return console.warn(`[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".`,e),tO}}),loadingComponent:nj,delay:0}),nj),as=iO(`ViewportDeferredInfographicBlockNode`,R({loader:()=>mE(null,null,function*(){try{return(yield V(()=>import(`./index8-4EOYGS9L.js`),__vite__mapDeps([12,0,1]))).default}catch(e){return console.warn(`[markstream-vue] Failed to load InfographicBlockNode. Showing the Infographic source fallback. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.`,e),tj}}),loadingComponent:tj,delay:0}),tj),os=iO(`ViewportDeferredD2BlockNode`,R({loader:()=>mE(null,null,function*(){try{return(yield V(()=>import(`./index9-BTjkNo53.js`),__vite__mapDeps([13,0,1]))).default}catch(e){return console.warn(`[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".`,e),tO}}),loadingComponent:ZA,delay:0}),ZA),ss={text:rO,paragraph:ck,heading:YO,code_block:sO,list:tk,list_item:ek,blockquote:LO,table:gk,definition_list:VO,footnote:KO,footnote_reference:IE,footnote_anchor:UO,admonition:yj,vmr_container:xk,hardbreak:MO,link:wO,image:zD,thematic_break:vk,math_inline:cO,math_block:lO,strong:_O,emphasis:AO,strikethrough:yO,highlight:OO,insert:EO,subscript:hO,superscript:pO,emoji:jE,checkbox:kE,checkbox_input:kE,inline_code:eD,html_inline:YE,reference:dO,html_block:ak},cs=E(()=>Yi()),ls=E(()=>Wk(H.codeBlockProps)),us=E(()=>Wk(H.codeBlockProps)),ds=E(()=>Q(Z(Z({stream:H.codeBlockStream,darkTheme:H.codeBlockDarkTheme,lightTheme:H.codeBlockLightTheme,themes:H.themes,minWidth:H.codeBlockMinWidth,maxWidth:H.codeBlockMaxWidth},typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{}),us.value),{codeBlockOptions:H.codeBlockOptions})),fs=E(()=>Q(Z(Z({},ds.value),ls.value),{codeBlockOptions:H.codeBlockOptions}));function ps(e){return typeof e==`boolean`?e:void 0}let ms=E(()=>{var e,t;let n=H.codeBlockProps||{},r={};r.showLineNumbers=ps(n.showLineNumbers)??!0!==H.codeBlockOptions?.disableLineNumbers,r.showHeader=(e=ps(n.showHeader))==null||e,r.showCopyButton=(t=ps(n.showCopyButton))==null||t,typeof n.clipboardWriter==`function`&&(r.clipboardWriter=n.clipboardWriter);let i=ps(n.showTooltips)??Ue.value;typeof i==`boolean`&&(r.showTooltips=i),r.codeBlockOptions=H.codeBlockOptions,r.isDark=H.isDark,r.darkTheme=n.darkTheme??H.codeBlockDarkTheme,r.lightTheme=n.lightTheme??H.codeBlockLightTheme,r.theme=n.theme,r.themes=n.themes??H.themes;let a=ps(n.diffInline);a!==void 0&&(r.diffInline=a),n.diffHideUnchangedRegions!==void 0&&(r.diffHideUnchangedRegions=n.diffHideUnchangedRegions);let o=function(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0}(n.reservedHeightPx);return o!==void 0&&(r.reservedHeightPx=o),r}),hs=E(()=>Z({},H.mermaidProps||{})),gs=E(()=>Z({},H.d2Props||{})),_s=E(()=>Z({},H.infographicProps||{})),vs,ys=E(()=>{let e=ie.value,t=H.fade,n=kt.value.customHtmlTags;return vs?.typewriter===e&&vs.fade===t&&vs.customHtmlTags===n?vs:vs={typewriter:e,fade:t,customHtmlTags:n}}),bs=E(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltip:Ue.value}:{})),xs=E(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{})),Ss=E(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{})),Cs=E(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{}));function ws(e){return Array.isArray(e.children)&&e.children.length>0}let Ts=new WeakMap,Es=new WeakMap,Ds=[],Os=[],ks=null,As=[];function js(e,t){let n=String(e?.code??``),r=Es.get(e);if(r&&r.code===n)return r.height;let i=t(n);return Es.set(e,{code:n,height:i}),i}function Ms(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}let Ns=E(()=>{let e=new Map,t=new Map;return q.value.forEach((n,r)=>{if(n.type!==`footnote`)return;let i=n.id,a=e.get(i)??0;t.set(r,a),e.set(i,a+1)}),t});function Ps(e,t){let n=function(e,t,n){let r=Qt.value?Ui.value[t]:null;return[t,e.loading,r,n]}(e.node,e.index,t),r=Ts.get(e.node);if(r&&Ms(r.signature,n))return r.item;let i=function(e,t){if(e.type!==`code_block`)return Fn[t]=void 0,e;let n=e,r=[n.language,n.loading,n.diff,n.code,n.originalCode,n.updatedCode,n.raw,n.startLine,n.endLine,n.sourceMap?.startLine,n.sourceMap?.endLine],i=Fn[t];if(i&&r.every((e,t)=>e===i.signature[t]))return i.node;let a=Z({},n);return Fn[t]={signature:r,node:a},a}(e.node,e.index),a=Is(i),o=Vs(i,a);if((i.type===`html_block`||i.type===`html_inline`)&&o===ss[i.type]){let e=i,t=String(e.tag??``).trim().toLowerCase()||Sf(e.content);if(t){let n=Et.value[t];if(Dt.value.has(t)&&n)o=n,i=Q(Z({},e),{type:t,tag:t,content:Tf(e.content,t)});else if(wf(e.content??e.raw,t)){let t=String(e.content??e.raw??``);i.type===`html_inline`?(o=rO,i={type:`text`,content:t,raw:t}):(o=ck,i={type:`paragraph`,children:[{type:`text`,content:t,raw:t}],raw:t})}}}let s=i.type===`code_block`&&oe.value&&o===oO&&!Gk(Et.value,a),c=Z({},function(e,t,n){let r=t??Is(e);if(e.type===`code_block`){let t=r?Gk(Et.value,r):void 0;if(n&&oe.value&&!t&&n===oO)return ms.value;if(n&&r&&n===t)return r===`mermaid`?Rs(e):r===`infographic`?zs(e):r===`d2`||r===`d2lang`?Bs(e):fs.value;if(n&&n===Et.value.code_block)return fs.value}return r===`mermaid`?Rs(e):r===`infographic`?zs(e):r===`d2`||r===`d2lang`?Bs(e):e.type===`link`?bs.value:e.type===`list`?xs.value:e.type===`blockquote`?Ss.value:e.type===`table`?Cs.value:e.type===`code_block`?ds.value:ys.value}(i,a,o)),l=Qt.value?Ui.value[e.index]:null;i.type===`code_block`&&l?.kind===`code-block`&&(c=Q(Z({},c),s?{reservedHeightPx:l.contentHeight}:{estimatedHeightPx:l.height,estimatedContentHeightPx:l.contentHeight,estimatedDiffInline:l.diffInline})),s||i.type!==`code_block`||a!==`mermaid`||_T(c.estimatedPreviewHeightPx)!=null||(c=Q(Z({},c),{estimatedPreviewHeightPx:ST(js(i,yT))})),s||i.type!==`code_block`||a!==`infographic`||_T(c.estimatedPreviewHeightPx)!=null||(c=Q(Z({},c),{estimatedPreviewHeightPx:wT(js(i,bT))})),i.type===`math_block`&&(c=Q(Z({},c),{cacheScope:Tt}));let u=function(e,t){let n=String(e.type);return!xE(n)&&Et.value[n]===t}(i,o),d=u?UE(i,We.value):void 0,g=i.loading,_=e.index;i.type===`footnote`&&o===KO&&(_=`footnote-${i.id}-${Ns.value.get(e.index)}`);let v=`${cs.value}-${_}`,y=Z({node:i,loading:g,"index-key":v},i.type===`reference`?{"data-markstream-reference-id":String(i.id)}:{}),b={"custom-id":H.customId,"is-dark":H.isDark},x={onCopy:f,onHandleArtifactClick:p},S={onClick:Hs,onMouseover:Gs,onMouseout:Ks},C={onMouseover:m,onMouseout:h},w=Z(Z({},d??{}),c),T=O(y,c,b,x),E=O(w,y,b,x),D={slotRef:t=>Io(e.index,t),contentRef:t=>function(e,t,n){if(n?Wo.add(t):Wo.delete(t),n&&!sn.value&&!Jr.has(e))return;if(n){let t=q.value[e],r=Jr.get(e);if(r&&r.el===n&&r.node===t&&r.loading===t?.loading)return}n||function(e){let t=`${Yi()}-${e}`,n=!1;for(let r of Array.from(ri.keys()))(ii.get(r)?.index===e||r===t||r.startsWith(`${t}-`))&&(oi-=Math.max(0,ri.get(r)??0),ri.delete(r),ii.delete(r),n=!0);n&&(oa(),Mo(`async-node`))}(e),Zr.delete(e),function(e){let t=(qr.get(e)??0)+1;qr.set(e,t)}(e);let r=Yr.get(e);if(r){for(let e of r)fi(e);Yr.delete(e)}if(function(e){let t=Mn.get(e);t&&(Pn?.unobserve(t),Nn.delete(t),Mn.delete(e))}(e),!n||!sn.value)return Kr.delete(e),qr.delete(e),void Jr.delete(e);Kr.set(e,n),Jr.set(e,{el:n,node:q.value[e],loading:q.value[e]?.loading});let i=()=>{Bo(e,n)};queueMicrotask(i);let a=(Pn||typeof ResizeObserver>`u`||(Pn=new ResizeObserver(e=>{if(e.length)for(let t of e){let e=Nn.get(t.target),n=Mn.get(e??-1);e!=null&&n&&Bo(e,n)}else Vo()})),Pn);if(a&&(Mn.set(e,n),Nn.set(n,e),a.observe(n)),typeof window<`u`){let t=q.value[e]?.type===`code_block`?[16,80,240,800]:et.value?[80]:[];if(t.length){let n=t.map(e=>di(e,i,`node-resize`)).filter(e=>e!=null);n.length&&Yr.set(e,n)}}}(e.index,D.vnodeKey,t),node:i,sourceLoading:g,index:e.index,component:o,bindings:c,customBindings:w,nodeProps:T,customNodeProps:E,fragmentNodeProps:O(T,S),customFragmentNodeProps:O(E,S),minimalNodeProps:O(T,C),rendersCustomNode:u,hasSlotChildren:ws(i),slotContent:String(i.content??``),isCodeBlock:i.type===`code_block`,indexKey:v,vnodeKey:`${$i.value}\0${_}\0${i.type}`};return Ts.set(e.node,{signature:n,item:D}),D}let Fs=E(()=>{let e=ks,t=function(){let e=[oe.value,Et.value,Dt.value,We.value,$i.value,cs.value,Tt,Ri.value,H.customId,H.isDark,ms.value,ds.value,fs.value,hs.value,_s.value,gs.value,ys.value,bs.value,xs.value,Ss.value,Cs.value,Qt.value,kk.value,Me.value];return ks&&Ms(ks,e)?ks:(ks=e,e)}(),n=e!==t;if(ks=t,J.value)return Wi.value.map(e=>Ps(e,t));let r=q.value,i=r.length,a=!1;Ds.length>i&&(Ds.length=i,Os.length=i,a=!0);let o=Ds,s=Math.min(o.length,i),c=n?0:s;if(!n)for(let e=0;e<s;e++){let t=r[e];if(t.type===`code_block`){if(o[e]?.node!==Fn[e]?.node||Os[e]!==t||!Object.is(o[e]?.sourceLoading,t.loading)){c=e;break}}else if(o[e]?.node!==t||!Object.is(o[e]?.sourceLoading,t.loading)){c=e;break}}if(!a&&c===i)return As;for(let e=c;e<i;e++)o[e]=Ps({node:r[e],index:e},t),Os[e]=r[e];let l=o.slice();return As=l,l});function Is(e){return e?.type===`code_block`?String(e.language??``).trim().toLowerCase():``}function Ls(e,t,n,r){let i=Z({},e.value);return _T(i.estimatedPreviewHeightPx)??(i.estimatedPreviewHeightPx=r(js(t,n),void 0,i.maxHeight===`none`?null:_T(i.maxHeight)??void 0)),i}function Rs(e){return Ls(hs,e,yT,ST)}function zs(e){return Ls(_s,e,bT,wT)}function Bs(e){return Ls(gs,e,kT,TT)}function Vs(e,t){if(!e)return bk;let n=Et.value,r=n[String(e.type)];if(e.type===`code_block`){let i=t??Is(e);return(i?Gk(n,i):void 0)||(oe.value?n.code_block||oO:i===`mermaid`?n.mermaid||is:i===`infographic`?n.infographic||as:i===`d2`||i===`d2lang`?n.d2||os:r||n.code_block||Ri.value)}return r||ss[String(e.type)]||bk}function Hs(e){let t=e.target instanceof Element?e.target.closest(`[data-markstream-reference-id]`):null,n=e.currentTarget,r=t&&n instanceof Element&&n.contains(t)?t.dataset.markstreamReferenceId:void 0;d(`click`,e,r)}function Us(e){var t;(t=e.target)!=null&&t.closest(`[data-node-index]`)&&d(`mouseover`,e)}function Ws(e){var t;(t=e.target)!=null&&t.closest(`[data-node-index]`)&&d(`mouseout`,e)}function Gs(e){d(`mouseover`,e)}function Ks(e){d(`mouseout`,e)}let qs=D(null),Js=D(!1),Ys=D(null),Xs=E(()=>!(H.domMode!==`minimal`||Ve.value||!1!==H.fade||ie.value||Js.value||En.value||J.value||Jt.value||Gt.value||dn.value||Object.keys(Et.value).length!==0)),Zs,Qs=null,$s=0,ec=0,tc=0,nc=[`code_block`,`admonition`,`table`,`math_block`,`html_block`,`image`,`thematic_break`],rc=new Set(nc),ic=[`.typewriter-cursor`,`.height-estimation-probes`,...nc.map(e=>`[data-node-type="${e}"]`),`script`,`style`].join(`,`);function ac(e){if(!e||typeof e!=`object`)return!1;let t=e.type;return typeof t==`string`&&rc.has(t)}function oc(e){if(!e||typeof e!=`object`)return 0;let t=e,n=t.raw??t.content??t.code;if(typeof n==`string`)return n.length;let r=t.children;if(Array.isArray(r))return r.reduce((e,t)=>e+oc(t),0);let i=t.items;return Array.isArray(i)?i.reduce((e,t)=>e+oc(t),0):0}function sc(){Zs&&=(clearTimeout(Zs),void 0)}function cc(){$s+=1,Qs!=null&&(mn?.(Qs),Qs=null)}function lc(){cc(),pc(),qs.value&&(qs.value.style.visibility=`hidden`)}function uc(e){if(e.nodeType!==Node.TEXT_NODE||!(e.textContent??``).trim())return!1;let t=e.parentElement;return!!t&&!t.closest(ic)}function dc(e){let t=e.lastChild;for(;t;){if(uc(t))return t;if(t.nodeType===Node.ELEMENT_NODE){let e=t;if(!e.matches(ic)&&e.lastChild){t=e.lastChild;continue}}for(;t&&t!==e&&!t.previousSibling;)t=t.parentNode;if(!t||t===e)break;t=t.previousSibling}return null}function fc(){let e=Fs.value;for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||ac(n.node)||!Po(n.index))continue;let r=An.get(n.index);if(!r)continue;let i=dc(r);if(i)return i}return null}function pc(){Ys.value&&=(Ys.value.classList.remove(cj),null)}function mc(){if(re.value!==`simple`||!W||!Js.value||!U.value)return void pc();let e=fc(),t=e?function(e){let t=e.parentElement?.closest(`.text-node`);return t instanceof HTMLElement?t:e.parentElement}(e):null;t!==Ys.value&&(pc(),t&&(t.classList.add(cj),Ys.value=t))}function hc(){if(re.value!==`precise`||!W||!Js.value||Qs!=null)return;let e=$s,t=()=>{Qs=null,e===$s&&function(){if(re.value!==`precise`||!(W&&Js.value&&U.value&&qs.value))return;let e=U.value,t=qs.value;t.style.visibility=`hidden`;let n=fc();if(!n)return;let r=0,i=0,a=20,o=!1;if(n?.textContent){let t=n.textContent.length,s=document.createRange();s.setStart(n,Math.max(0,t-1)),s.setEnd(n,t);let c=typeof s.getClientRects==`function`?s.getClientRects():void 0,l=c?.[c.length-1]??n.parentElement?.getBoundingClientRect();if(l){let t=K(`typewriterCursor.root.getBoundingClientRect`,()=>e.getBoundingClientRect());r=l.right-t.left+e.scrollLeft,i=l.top-t.top+e.scrollTop,a=l.height||a,o=!0}s.detach()}o&&(t.style.transform=`translate(${Math.max(0,r)}px, ${Math.max(0,i)}px)`,t.style.height=`${a}px`,t.style.visibility=`visible`)}()};pn?Qs=pn(t):t()}return v([Qe,()=>l.content,()=>l.nodes,()=>H.typewriter,et],()=>mE(null,null,function*(){if(!W||Ve.value||!Ke.value)return;if(!ie.value)return void((Js.value||Zs||Qs!=null||Ys.value||qs.value)&&(Js.value=!1,sc(),lc()));if(et.value)return Js.value=!1,sc(),void lc();if(l.nodes?.length)return Js.value=!1,sc(),lc(),ec=(l.content??``).length,void(tc=Qe.value.length);let e=function(){return l.nodes?.length?l.nodes.reduce((e,t)=>e+oc(t),0):(l.content??``).length}(),t=function(){return l.nodes?.length?l.nodes.reduce((e,t)=>e+oc(t),0):Qe.value.length}(),n=!ac(q.value[q.value.length-1]),r=e>ec,i=t>tc;if(!ie.value||!n||!r&&!i)return ie.value&&n||(Js.value=!1,lc()),ec=e,void(tc=t);ec=e,tc=t,Js.value=!0,re.value===`precise`&&qs.value&&(qs.value.style.visibility=`hidden`),sc(),yield c(),re.value===`simple`?mc():(pc(),hc()),Zs=setTimeout(()=>{Zs=void 0,Js.value=!1},3e3)}),{flush:`post`,immediate:!0}),v(Js,e=>mE(null,null,function*(){e?(yield c(),re.value===`simple`?mc():(pc(),re.value===`precise`&&hc())):lc()}),{flush:`post`}),v(re,()=>mE(null,null,function*(){if(W&&!Ve.value&&Ke.value&&Js.value){if(yield c(),re.value===`simple`)return cc(),void mc();pc(),re.value===`precise`?hc():lc()}}),{flush:`post`}),v([()=>Sn.value,()=>Wr.start,()=>Wr.end],()=>mE(null,null,function*(){W&&!Ve.value&&Ke.value&&Js.value&&(yield c(),re.value===`simple`?mc():(pc(),re.value===`precise`&&hc()))}),{flush:`post`}),u(()=>{sc(),cc(),pc(),wt.clear()}),(e,t)=>{let n=g(`NodeRenderer`,!0);return F(Ve)?(B(!0),z(w,{key:0},o(Fs.value,e=>(B(),z(w,{key:e.vnodeKey},[e.rendersCustomNode?(B(),b(a(e.component),O({key:0,ref_for:!0},e.customFragmentNodeProps),{default:y(()=>[e.hasSlotChildren?(B(),b(n,O({key:0,ref_for:!0},Ft.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):e.slotContent?(B(),b(n,O({key:1,ref_for:!0},Ft.value,{content:e.slotContent,final:!e.node.loading,"index-key":`${e.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:2},1040)):(B(),b(a(e.component),O({key:1,ref_for:!0},e.fragmentNodeProps),null,16))],64))),128)):(B(),z(`div`,{key:1,ref_key:`containerRef`,ref:U,class:S([`markstream-vue markdown-renderer`,[{dark:H.isDark},{virtualized:J.value},{"virtual-scroll-coordinated":Zt.value},{"stable-layout":zr.value},{"typewriter-simple-cursor":Js.value&&re.value===`simple`}]]),"data-custom-id":H.customId,onClick:Hs,onMouseover:Us,onMouseout:Ws},[$t.value||J.value?(B(),z(w,{key:0},[$t.value?(B(),b(ej,{key:0,width:nn.value,"flow-root":J.value||Zt.value,"paragraph-node":Rt.value,"list-item-node":zt.value,"list-node":Bt.value,"heading-nodes":Vt.value,"set-paragraph-wrapper":mi,"set-list-item-wrapper":hi,"set-list-wrapper":gi,"set-heading-wrapper":Pi},null,8,[`width`,`flow-root`,`paragraph-node`,`list-item-node`,`list-node`,`heading-nodes`])):L(``,!0),J.value?(B(),z(`div`,{key:1,class:`node-spacer`,style:I({height:`${Gi.value}px`}),"aria-hidden":`true`},null,4)):L(``,!0)],64)):L(``,!0),Xs.value?(B(!0),z(w,{key:1},o(Fs.value,e=>(B(),z(w,{key:e.vnodeKey},[Po(e.index)?(B(),b(a(e.component),O({key:0,ref_for:!0},e.minimalNodeProps),null,16)):L(``,!0)],64))),128)):(B(!0),z(w,{key:2},o(Fs.value,e=>(B(),z(`div`,{key:e.vnodeKey,ref_for:!0,ref:e.slotRef,class:`node-slot`,"data-node-index":e.index,"data-node-type":e.node.type},[F(Wo).has(e.vnodeKey)||Po(e.index)?(B(),z(`div`,{key:0,ref_for:!0,ref:e.contentRef,class:`node-content`},[e.isCodeBlock?e.rendersCustomNode?(B(),b(a(e.component),O({key:1,ref_for:!0},e.customNodeProps),{default:y(()=>[e.hasSlotChildren?(B(),b(n,O({key:0,ref_for:!0},Ft.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):e.slotContent?(B(),b(n,O({key:1,ref_for:!0},Ft.value,{content:e.slotContent,final:!e.node.loading,"index-key":`${e.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:2},1040)):(B(),b(a(e.component),O({key:2,ref_for:!0},e.nodeProps),null,16)):(B(),b(rj,{key:0,item:e,"source-nodes":l.nodes,fade:H.fade,"nested-renderer-props":e.rendersCustomNode?Ft.value:void 0},null,8,[`item`,`source-nodes`,`fade`,`nested-renderer-props`]))],512)):(B(),z(`div`,{key:1,class:`node-placeholder`,style:I({height:`${er(e.index)}px`})},null,4))],8,sj))),128)),Js.value&&re.value===`precise`?(B(),z(`span`,{key:3,ref_key:`typewriterCursorRef`,ref:qs,class:`typewriter-cursor`,"aria-hidden":`true`},null,512)):L(``,!0),J.value?(B(),z(`div`,{key:4,class:`node-spacer`,style:I({height:`${Ki.value}px`}),"aria-hidden":`true`},null,4)):L(``,!0)],42,oj))}}})),[[`__scopeId`,`data-v-f4ebaa7e`]]),uj=lj;uj.install=e=>{let t=new Set([`MarkdownRender`,`NodeRenderer`,uj.__name,uj.name].filter(e=>!!e));for(let n of t)e.component(n,lj)};var dj=Object.freeze(Object.defineProperty({__proto__:null,default:uj},Symbol.toStringTag,{value:`Module`})),fj={key:0,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},pj={key:1,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},mj={key:2,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},hj={key:3,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},gj={class:`admonition-title`},_j=[`aria-expanded`,`aria-controls`],vj=[`id`],yj=$(p({__name:`AdmonitionNode`,props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:[`copy`],setup(e,{emit:t}){var r;let i=e,a=t,o=E(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;let e=i.node.kind||`note`;return e.charAt(0).toUpperCase()+e.slice(1)}),s=D(!!i.node.collapsible&&!((r=i.node.open)==null||r));function c(){i.node.collapsible&&(s.value=!s.value)}let l=`admonition-${Math.random().toString(36).slice(2,9)}`;return(t,r)=>(B(),z(`div`,{class:S([`admonition`,[`admonition-${i.node.kind}`]])},[T(`div`,{id:l,class:`admonition-legend`},[i.node.kind===`note`||i.node.kind===`info`?(B(),z(`svg`,fj,[...r[1]||=[T(`circle`,{cx:`12`,cy:`12`,r:`10`},null,-1),T(`path`,{d:`M12 16v-4`},null,-1),T(`path`,{d:`M12 8h.01`},null,-1)]])):i.node.kind===`tip`?(B(),z(`svg`,pj,[...r[2]||=[T(`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`},null,-1),T(`path`,{d:`M9 18h6`},null,-1),T(`path`,{d:`M10 22h4`},null,-1)]])):i.node.kind===`warning`||i.node.kind===`caution`?(B(),z(`svg`,mj,[...r[3]||=[T(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`},null,-1),T(`path`,{d:`M12 9v4`},null,-1),T(`path`,{d:`M12 17h.01`},null,-1)]])):i.node.kind===`danger`||i.node.kind===`error`?(B(),z(`svg`,hj,[...r[4]||=[T(`polygon`,{points:`7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2`},null,-1),T(`path`,{d:`M12 8v4`},null,-1),T(`path`,{d:`M12 16h.01`},null,-1)]])):L(``,!0),T(`span`,gj,C(o.value),1),i.node.collapsible?(B(),z(`button`,{key:4,class:`admonition-toggle`,"aria-expanded":!s.value,"aria-controls":`${l}-content`,onClick:c},[(B(),z(`svg`,{style:I({rotate:s.value?`0deg`:`90deg`}),xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[...r[5]||=[T(`path`,{d:`m9 18 6-6-6-6`},null,-1)]],4))],8,_j)):L(``,!0)]),d(T(`div`,{id:`${l}-content`,class:`admonition-content`,"aria-labelledby":l},[n(F(uj),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:r[0]||=e=>a(`copy`,e)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])],8,vj),[[A,!s.value]])],2))}}),[[`__scopeId`,`data-v-a83480e1`]]);yj.install=e=>{e.component(yj.__name,yj)};var bj=()=>V(()=>import(`./d2_markstream-vue-xMoF3M5G.js`),[]),xj=null,Sj=bj,Cj=null,wj=!1,Tj=!1,Ej=0;function Dj(e){Sj=e,Ej++,xj=null,Cj=null,wj=!1,Tj=!1}function Oj(){Dj(null)}function kj(){return mE(this,null,function*(){if(xj)return xj;let e=Sj,t=Ej;return e?e===bj&&wj?null:Cj||(Cj=mE(null,null,function*(){let n;try{n=yield e()}catch(n){if(e===bj)return t===Ej&&e===Sj&&(wj=!0,function(e){Tj||(Tj=!0,console.warn(`[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.`,e))}(n)),null;throw n}finally{t===Ej&&e===Sj&&(Cj=null)}return t!==Ej||e!==Sj?null:n?(xj=function(e){if(!e)return e;if(e.D2&&typeof e.D2==`function`)return e.D2;if(e.default&&e.default.D2&&typeof e.default.D2==`function`)return e.default.D2;let t=e.default??e;return typeof t==`function`?t:t?.D2&&typeof t.D2==`function`?t.D2:t}(n),xj):null}),Cj):null})}var Aj=null,jj=null,Mj=null,Nj=0;function Pj(e){jj=e??null,Aj=null,Mj=null,Nj++}function Fj(){Pj()}function Ij(){return typeof jj==`function`}function Lj(){return mE(this,null,function*(){if(Aj)return Aj;let e=jj,t=Nj;return e?Mj||(Mj=mE(null,null,function*(){let n=yield e();if(t!==Nj||e!==jj)return null;let r=function(e){if(!e)return null;let t=e.default??e,n=typeof t==`function`&&typeof t.prototype?.render==`function`?t:e.Infographic??t?.Infographic;return typeof n==`function`?n:null}(n);return t!==Nj||e!==jj?null:r?(Aj=r,Aj):null}).finally(()=>{t===Nj&&e===jj&&(Mj=null)}),Mj):null})}function Rj(e){let t=Number.parseFloat(String(e??``));return Number.isFinite(t)?t:0}function zj(e,t){e?.(t)}function Bj(e,t){return e?(zj(t,`readElementBoxHeight.offsetHeight`),Math.ceil(Math.max(0,e.offsetHeight||0))):0}function Vj(e,t){let n=Bj(e,t);if(!e||typeof window>`u`||typeof window.getComputedStyle!=`function`)return n;zj(t,`readElementOuterHeight.getComputedStyle`);let r=window.getComputedStyle(e),i=Rj(r.marginTop),a=Rj(r.marginBottom);return Math.ceil(Math.max(0,n+i+a))}function Hj(e,t,n){if(!e)return 0;let r=function(e){return e?e.matches?.call(e,`.markstream-vue.markdown-renderer`)?e:e.querySelector(`.markstream-vue.markdown-renderer`):null}(e);if(!r)return 0;let i=Number.isFinite(n)?Number(n):Vj(e,t),a=Bj(r,t);return Math.max(0,i-a)}function Uj(e,t,n){let r=n.getKey?.call(n,e,t)??e.id??t;return String(r)}function Wj(e,t,n){return n.getKind?.call(n,e,t)??String(e.kind??``)}function Gj(e,t,n){let r=n.getContent?.call(n,e,t)??e.content;return typeof r==`string`?r:``}function Kj(e,t,n){let r=n.getFinal?.call(n,e,t);if(typeof r==`boolean`)return r;let i=e.final;return typeof i!=`boolean`||i}function qj(e,t,n){return n.getRevision?.call(n,e,t)??e.revision}function Jj(e,t,n){let r=Wj(e,t,n);return r===`assistant-markdown`||r===`markdown`||!r&&Gj(e,t,n).length>0}function Yj(e,t,n){let r=n.estimateItemHeight?.call(n,e,t);if(Number.isFinite(r)&&r>0)return r;let i=Wj(e,t,n);return i===`assistant-markdown`||i===`markdown`?360:i===`system-divider`?44:i===`tool-call`?72:i===`thinking`?92:i===`error`?76:i===`user-message`?88:Gj(e,t,n).length>0?360:96}var Xj=Symbol(`markstreamLanguageIconResolver`),Zj=null;function Qj(){return Zj}function $j(e){return mE(this,null,function*(){let t=Zj;if(t&&typeof t.setRenderOptions==`function`)try{yield t.setRenderOptions({theme:e})}catch{}})}function eM(e){return R(e)}eM(()=>V(()=>import(`./index3-BJdA_lu3.js`),__vite__mapDeps([14,7,0,1,6,8,3,4]))),eM(()=>V(()=>import(`./index5-CQngjG8A.js`),__vite__mapDeps([10,0,1]))),eM(()=>V(()=>import(`./index6-BKvbo_v2.js`),__vite__mapDeps([9,0,1]))),eM(()=>V(()=>import(`./index10-ExQJARIx.js`),__vite__mapDeps([11,0,1,8]))),eM(()=>V(()=>import(`./index8-4EOYGS9L.js`),__vite__mapDeps([12,0,1]))),eM(()=>V(()=>import(`./index9-BTjkNo53.js`),__vite__mapDeps([13,0,1]))),eM(()=>V(()=>import(`./index4-BILJ5L4s.js`),__vite__mapDeps([15,2,0,1,3,4]))),eM(()=>V(()=>import(`./index7-DFuP_VHe.js`),__vite__mapDeps([16,0,1])));var tM=[`data-language`],nM=[`innerHTML`],rM={key:1};wE(`litepaseo`,{code_block:p({inheritAttrs:!1,__name:`CodeBlock`,props:{node:{}},setup(e){let t=e,n=k(`litepaseo-markdown-final`,null),r=E(()=>ie(t.node.diff?`diff`:String(t.node.language??``))),i=E(()=>String(t.node.code??``).replace(/\n$/,``)),a=E(()=>t.node.loading&&!n?.value?null:ae(i.value,r.value));return(e,t)=>(B(),z(`pre`,{class:`code`,"data-language":r.value??void 0},[a.value===null?(B(),z(`code`,rM,C(i.value),1)):(B(),z(`code`,{key:0,class:`hljs`,innerHTML:a.value},null,8,nM))],8,tM))}})});var iM=p({__name:`MarkdownMessage`,props:{content:{},final:{type:Boolean}},setup(e){let n=e;t(`litepaseo-markdown-final`,E(()=>n.final)),$w(),qT(),Oj(),Fj();let r=Object.freeze({showLineNumbers:!1,showHeader:!1,showCopyButton:!1});return(t,n)=>(B(),b(F(uj),{class:`prose`,mode:`chat`,"is-dark":F(re),content:e.content,final:e.final,"smooth-streaming":!1,typewriter:!1,fade:!1,"code-block-stream":!1,"render-code-blocks-as-pre":!0,"code-block-props":F(r),"batch-rendering":!1,"defer-nodes-until-visible":!1,"node-virtual":!1,"viewport-priority":!1,"html-policy":`escape`,"custom-id":`litepaseo`},null,8,[`is-dark`,`content`,`final`,`code-block-props`]))}});export{_e as $,vT as A,rT as B,$j as C,aE as D,Hj as E,yT as F,Iw as G,fT as H,wT as I,Pw as J,Bw as K,pT as L,bT as M,ST as N,oE as O,_T as P,hw as Q,nT as R,_D as S,kD as T,Rw as U,tT as V,Hw as W,Cw as X,Vw as Y,zw as Z,$ as _,Ij as a,De as at,Zk as b,Jj as c,Ce as ct,Yj as d,iM as default,q as dt,yt as et,tO as f,Ct as ft,Vj as g,ln as gt,ND as h,At as ht,Lj as i,Me as it,CT as j,ZT as k,Kj as l,ve as lt,kj as m,Et as mt,Wj as n,ge as nt,Qj as o,xe as ot,Xj as p,Tt as pt,Nw as q,Uj as r,bt as rt,AD as s,wt as st,MD as t,Ae as tt,Gj as u,ye as ut,CD as v,gD as w,uj as x,qj as y,gT as z};
|