import{d as en,c as b,p as En,r as B,w as I,b as Ln,f as Qe,a as Jt,q as tn,e as Ee,u as Ct,k as Nn,s as zn,h as Ke,j as pt,v as Hn,g as ht,i as z,l as yt,n as Ze,x as Dn,t as xt,o as Fn,y as Tn,z as $n,m as Me}from"./tailwind-D5NWkpcg.js";import{$ as nn,U as ln,x as gt,b as _n,D as Rn,C as Kt,M as An,N as In,K as Un,c as Qt,q as jn,V as Wn,r as Vn,d as qn}from"./sidepanel-VcS0zCOq.js";import{i as V,t as Gn}from"./safeRaf-DGuzXxDK.js";import"./TooltipContent.vue_vue_type_script_setup_true_lang-BuJLrO89.js";import"./ext-utils-BLHv4ziY.js";var Jn=Object.defineProperty,Kn=Object.defineProperties,Qn=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertySymbols,Zn=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable,Xt=(E,w,L)=>w in E?Jn(E,w,{enumerable:!0,configurable:!0,writable:!0,value:L}):E[w]=L,H=(E,w)=>{for(var L in w||(w={}))Zn.call(w,L)&&Xt(E,L,w[L]);if(Zt)for(var L of Zt(w))Xn.call(w,L)&&Xt(E,L,w[L]);return E},ge=(E,w)=>Kn(E,Qn(w)),D=(E,w,L)=>new Promise((i,de)=>{var be=p=>{try{q(L.next(p))}catch(P){de(P)}},we=p=>{try{q(L.throw(p))}catch(P){de(P)}},q=p=>p.done?i(p.value):Promise.resolve(p.value).then(be,we);q((L=L.apply(E,w)).next())});const Yn={class:"html-preview-frame__header"},el={class:"html-preview-frame__title"},tl={class:"html-preview-frame__label"},nl=["sandbox","srcdoc"],ll=nn(en({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(E){const w=E,L=import.meta!==void 0&&!1;let i=null;const{t:de}=ln(),be=b(()=>{const p=w.code||"",P=p.trim().toLowerCase();return P.startsWith("<!doctype")||P.startsWith("<html")||P.startsWith("<body")?p:`<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style>
      html, body {
        margin: 0;
        padding: 0;
        height: 100%;
        background-color: ${w.isDark?"#020617":"#ffffff"};
        color: ${w.isDark?"#e5e7eb":"#020617"};
      }
      body {
        font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;
      }
    </style>
  </head>
  <body>
    ${p}
  </body>
</html>`}),we=b(()=>{return p=w.htmlPreviewSandbox,P=w.htmlPreviewAllowScripts,typeof p=="string"?(function(te){if(!L||typeof console>"u"||i===te)return;const N=function(Z){return new Set(Z.trim().toLowerCase().split(/\s+/).filter(Boolean))}(te);N.has("allow-scripts")&&N.has("allow-same-origin")&&(i=te,console.warn("[markstream-vue] htmlPreviewSandbox contains both allow-scripts and allow-same-origin. Use this only for fully trusted content served from an isolated origin."))}(p),p):p!==void 0?"":P===!0?"allow-scripts":"";var p,P});function q(p){var P;p.key!=="Escape"&&p.key!=="Esc"||(P=w.onClose)==null||P.call(w)}return Fn(()=>{typeof window<"u"&&window.addEventListener("keydown",q)}),tn(()=>{typeof window<"u"&&window.removeEventListener("keydown",q)}),(p,P)=>(Ee(),Qe($n,{to:"body"},[z("div",{class:Ze(["markstream-vue",{dark:w.isDark}])},[z("div",{class:"html-preview-frame__backdrop",onClick:P[2]||(P[2]=te=>{var N;return(N=w.onClose)==null?void 0:N.call(w)})},[z("div",{class:"html-preview-frame",onClick:P[1]||(P[1]=Tn(()=>{},["stop"]))},[z("div",Yn,[z("div",el,[P[3]||(P[3]=z("span",{class:"html-preview-frame__dot"},null,-1)),z("span",tl,xt(w.title||Ct(de)("common.preview")||"Preview"),1)]),z("button",{type:"button",class:"html-preview-frame__close",onClick:P[0]||(P[0]=te=>{var N;return(N=w.onClose)==null?void 0:N.call(w)})}," × ")]),z("iframe",{class:"html-preview-frame__iframe",sandbox:we.value,referrerpolicy:"no-referrer",srcdoc:be.value},null,8,nl)])])],2)]))}}),[["__scopeId","data-v-24e66176"]]);let Oe=null,bt=null,Ue=null,Be=null,wt=null,kt=null;const St=new WeakMap;let ol=0;const il=["data-markstream-enhanced"],rl={class:"code-header-main"},al=["innerHTML"],ul={class:"code-header-copy"},sl={class:"code-header-title"},dl={key:0,class:"code-header-caption"},cl={class:"code-editor-layer"},Yt="__markstreamMonacoPassiveTouchState__",yl=nn(en({__name:"CodeBlockNode",props:{node:{},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},theme:{},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isShowPreview:{type:Boolean,default:!0},monacoOptions:{},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},customId:{},estimatedHeightPx:{},estimatedContentHeightPx:{}},emits:["previewCode","copy"],setup(E,{emit:w}){var L;const i=E,de=w,be=En(),we=b(()=>{const e=be==null?void 0:be.vnode.props;return!(!e||!e.onPreviewCode&&!e.onPreviewCode)}),{t:q}=ln(),p=B(null),P=B(null),te=B(!1),N=B(gt(i.node.language)),Z=b(()=>_n(N.value)),Pt=b(()=>Z.value==="plaintext"),X=B(!1),ie=B(!1),U=B(!1),Y=B(!1),Le=B(!1);let T=!1,ke=null;const ce=B(null),ve=B(null);let je=0,Xe=0;const on=Rn(),Ne=B(null),G=B(typeof window>"u");typeof window<"u"&&I(()=>P.value,e=>{var t;if((t=Ne.value)==null||t.destroy(),Ne.value=null,!e)return void(G.value=!1);const n=on(e,{rootMargin:"400px"});Ne.value=n,G.value=n.isVisible.value,n.whenVisible.then(()=>{G.value=!0})},{immediate:!0}),Ln(()=>{var e;T=!0,(e=Ne.value)==null||e.destroy(),Ne.value=null});let j=null,We=null,Ve=()=>{},Ye=()=>{},ze=()=>null,J=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),$=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),et=()=>{},Se=()=>{},He=()=>{},re=null,Mt=()=>{var e;return String((e=i.node.language)!=null?e:"plaintext")},tt=()=>D(null,null,function*(){});const Ce=[],nt=[];let ne=null;const h=b(()=>i.node.diff),fe=B({removed:0,added:0}),rn=b(()=>`-${fe.value.removed} +${fe.value.added}`),De=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5}),Ot=Object.freeze(ge(H({},De),{enabled:!1,revealLineCount:0}));function lt(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return ge(H(H({},De),n),{enabled:(t=n.enabled)==null||t})}return H({},De)}function Bt(e,t){return{original:String(e??""),updated:String(t??"")}}const K=b(()=>{var e,t,n;const l=i.monacoOptions?H({},i.monacoOptions):{};if(!h.value)return l;const o=l.diffHideUnchangedRegions===void 0?H({},De):lt(l.diffHideUnchangedRegions),r=l.hideUnchangedRegions===void 0?void 0:lt(l.hideUnchangedRegions),u=i.stream!==!1&&i.loading!==!1,a=u?H({},Ot):o,s=u?H({},Ot):r,c=H({},(e=l.experimental)!=null?e:{}),d=(t=l.diffUnchangedRegionStyle)!=null?t:"line-info",y={maxComputationTime:0,diffAlgorithm:"legacy",ignoreTrimWhitespace:!1,renderIndicators:!0,diffUpdateThrottleMs:120,renderLineHighlight:"none",renderLineHighlightOnlyWhenFocus:!0,selectionHighlight:!1,occurrencesHighlight:"off",matchBrackets:"never",lineDecorationsWidth:4,lineNumbersMinChars:2,glyphMargin:!1,renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,diffHideUnchangedRegions:a,useInlineViewWhenSpaceIsLimited:(n=l.useInlineViewWhenSpaceIsLimited)!=null&&n,diffLineStyle:"background",diffAppearance:"auto",diffUnchangedRegionStyle:d,diffHunkActionsOnHover:!1,experimental:c};return ge(H(ge(H(H({},y),l),{experimental:c}),s===void 0?{}:{hideUnchangedRegions:s}),{diffHideUnchangedRegions:a})}),Et=b(()=>h.value?"diff":"single"),an=B(Et.value),Fe=B(!1),Q=B(!1),Te=B(!1),un=b(()=>{var e;const t=(e=i.monacoOptions)==null?void 0:e.wordWrap;return t==null||String(t)!=="off"}),Lt=b(()=>!(Fe.value||!Te.value&&(qn()||Q.value))),qe=B(!1);typeof window<"u"&&D(null,null,function*(){try{const e=yield Vn();if(T)return;if(!e)return void(Fe.value=!0);const t=e.useMonaco,n=e.detectLanguage;if(typeof n=="function"&&(Mt=n),typeof t=="function"){const l=Re();if(l&&i.themes&&Array.isArray(i.themes)&&!i.themes.includes(l))throw new Error("Preferred theme not in provided themes array");ne=Gt();const o=t(ne);j=o.createEditor||j,We=o.createDiffEditor||We,Ve=o.updateCode||Ve,Ye=o.updateDiff||Ye,ze=o.getEditor||ze,J=o.getEditorView||J,$=o.getDiffEditorView||$,et=o.cleanupEditor||et,Se=o.safeClean||o.cleanupEditor||Se,He=o.refreshDiffPresentation||He,tt=o.setTheme||tt,Le.value=!0,!T&&p.value&&(yield ye(p.value))}}catch{if(T)return;Fe.value=!0}});const W=B(typeof((L=i.monacoOptions)==null?void 0:L.fontSize)=="number"?i.monacoOptions.fontSize:Number.NaN),M=B(W.value),sn=b(()=>{const e=W.value,t=M.value;return typeof e=="number"&&Number.isFinite(e)&&e>0&&typeof t=="number"&&Number.isFinite(t)&&t>0}),Nt=b(()=>{var e;const t=(e=i.monacoOptions)==null?void 0:e.fontSize;if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t;const n=M.value;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:14}),dn=b(()=>{var e;const t=(e=i.monacoOptions)==null?void 0:e.lineHeight;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:Math.max(12,Math.round(1.35*Nt.value))}),cn=b(()=>{var e;const t=(e=i.monacoOptions)==null?void 0:e.tabSize;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:4}),zt=b(()=>{var e;const t=(e=i.monacoOptions)==null?void 0:e.padding;return{top:typeof(t==null?void 0:t.top)=="number"&&Number.isFinite(t.top)&&t.top>0?t.top:0,bottom:typeof(t==null?void 0:t.bottom)=="number"&&Number.isFinite(t.bottom)&&t.bottom>0?t.bottom:0}}),me=b(()=>{const e=i.estimatedContentHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}),vn=b(()=>{const e=i.estimatedHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}),fn=b(()=>{var e;const t=(e=i.monacoOptions)==null?void 0:e.fontFamily;return H(H({fontSize:`${Nt.value}px`,lineHeight:`${dn.value}px`,tabSize:cn.value,boxSizing:"border-box",maxHeight:`${It()}px`,overflow:"auto",paddingTop:`${zt.value.top}px`,paddingBottom:`${zt.value.bottom}px`},me.value!=null?{height:`${me.value}px`,minHeight:`${me.value}px`}:{}),typeof t=="string"&&t.trim()?{"--markstream-code-font-family":t.trim()}:{})}),Ht=b(()=>me.value!=null&&(!Q.value||pe()!=null)),mn=b(()=>{if(Ht.value)return{minHeight:`${me.value}px`}}),ot=B(null);function pe(){const e=ot.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}function Dt(e,t=!1){const n=Math.ceil(e),l=pe();return l==null?n:n>=l?(t&&Y.value&&(ot.value=null),n):l}function Ge(){return new Promise(e=>{V(()=>e())})}function Ft(){var e,t,n,l,o;try{const r=h.value?(n=(t=(e=$())==null?void 0:e.getModifiedEditor)==null?void 0:t.call(e))!=null?n:$():J(),u=ze(),a=(l=u==null?void 0:u.EditorOption)==null?void 0:l.fontInfo;if(r&&a!=null){const s=(o=r.getOption)==null?void 0:o.call(r,a),c=s==null?void 0:s.fontSize;if(typeof c=="number"&&Number.isFinite(c)&&c>0)return c}}catch{}try{const r=p.value;if(r){const u=r.querySelector(".view-lines .view-line");if(u)try{if(typeof window<"u"&&typeof window.getComputedStyle=="function"){const a=window.getComputedStyle(u).fontSize,s=a&&a.match(/^(\d+(?:\.\d+)?)/);if(s)return Number.parseFloat(s[1])}}catch{}}}catch{}return null}function $e(e){var t,n;try{const r=ze(),u=(t=r==null?void 0:r.EditorOption)==null?void 0:t.lineHeight;if(u!=null){const a=(n=e==null?void 0:e.getOption)==null?void 0:n.call(e,u);if(typeof a=="number"&&a>0)return a}}catch{}const l=function(){try{const r=p.value;if(!r)return null;const u=r.querySelector(".view-lines .view-line");if(u){const a=Math.ceil(u.getBoundingClientRect().height);if(a>0)return a}}catch{}return null}();if(l&&l>0)return l;const o=Number.isFinite(M.value)&&M.value>0?M.value:14;return Math.max(12,Math.round(1.35*o))}function Tt(e){var t,n,l;try{const a=ze(),s=(t=a==null?void 0:a.EditorOption)==null?void 0:t.padding;if(s!=null){const c=(n=e==null?void 0:e.getOption)==null?void 0:n.call(e,s),d=typeof(c==null?void 0:c.top)=="number"?c.top:0,y=typeof(c==null?void 0:c.bottom)=="number"?c.bottom:0;if(d>0||y>0)return d+y}}catch{}const o=(l=K.value)==null?void 0:l.padding,r=typeof(o==null?void 0:o.top)=="number"?o.top:0,u=typeof(o==null?void 0:o.bottom)=="number"?o.bottom:0;return r>0||u>0?r+u:h.value?24:0}function $t(e,t){return typeof e!="number"||typeof t!="number"||e<1||t<e?0:t-e+1}function _t(e){if(!e)return[];const t=e.split(/\r?\n/);return t.length===1&&t[0]===""?[]:t}function it(){var e,t;h.value?fe.value=function(n,l){const o=_t(n),r=_t(l);let u=0,a=o.length-1,s=r.length-1;for(;u<=a&&u<=s&&o[u]===r[u];)u++;for(;a>=u&&s>=u&&o[a]===r[s];)a--,s--;return{removed:Math.max(0,a-u+1),added:Math.max(0,s-u+1)}}(String((e=i.node.originalCode)!=null?e:""),String((t=i.node.updatedCode)!=null?t:"")):fe.value={removed:0,added:0}}function _e(){var e;if(h.value)try{const t=$(),n=(e=t==null?void 0:t.getLineChanges)==null?void 0:e.call(t);if(!Array.isArray(n))return void it();let l=0,o=0;for(const r of n)l+=$t(r.originalStartLineNumber,r.originalEndLineNumber),o+=$t(r.modifiedStartLineNumber,r.modifiedEndLineNumber);fe.value={removed:l,added:o}}catch{it()}else fe.value={removed:0,added:0}}function rt(){var e;if(Number.isFinite(M.value)&&M.value>0&&Number.isFinite(W.value))return M.value;const t=Ft();return typeof((e=i.monacoOptions)==null?void 0:e.fontSize)=="number"?(W.value=i.monacoOptions.fontSize,M.value=i.monacoOptions.fontSize,M.value):t&&t>0?(W.value=t,M.value=t,t):(W.value=12,M.value=12,12)}function pn(){const e=rt(),t=Math.min(36,e+1);M.value=t}function hn(){const e=rt(),t=Math.max(10,e-1);M.value=t}function yn(){rt(),Number.isFinite(W.value)&&(M.value=W.value)}function Rt(){var e,t,n,l,o,r,u,a,s,c,d,y,g,m;try{const f=h.value?$():null,v=h.value?f:J();if(!v)return null;if(f!=null&&f.getOriginalEditor&&(f!=null&&f.getModifiedEditor)){const k=(e=f.getOriginalEditor)==null?void 0:e.call(f),x=(t=f.getModifiedEditor)==null?void 0:t.call(f);(n=k==null?void 0:k.layout)==null||n.call(k),(l=x==null?void 0:x.layout)==null||l.call(x);const C=((o=k==null?void 0:k.getContentHeight)==null?void 0:o.call(k))||0,R=((r=x==null?void 0:x.getContentHeight)==null?void 0:r.call(x))||0,A=Math.max(C,R);if(A>0)return Math.ceil(A+1);const Ie=((s=(a=(u=k==null?void 0:k.getModel)==null?void 0:u.call(k))==null?void 0:a.getLineCount)==null?void 0:s.call(a))||1,ue=((y=(d=(c=x==null?void 0:x.getModel)==null?void 0:c.call(x))==null?void 0:d.getLineCount)==null?void 0:y.call(d))||1,se=Math.max(Ie,ue),mt=Math.max($e(k),$e(x));return Math.ceil(se*(mt+1.5)+0+1)}if(v!=null&&v.getContentHeight){(g=v==null?void 0:v.layout)==null||g.call(v);const k=v.getContentHeight();if(k>0)return Math.ceil(k+1)}const S=(m=v==null?void 0:v.getModel)==null?void 0:m.call(v);let O=1;S&&typeof S.getLineCount=="function"&&(O=S.getLineCount());const F=$e(v);return Math.ceil(O*(F+1.5)+0+1)}catch{return null}}function at(e){var t;const n=String(e??"").trim(),l=(t=n.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i))==null?void 0:t[1];if(l){const s=l.length===3?l.split("").map(c=>`${c}${c}`).join(""):l;return .2126*Number.parseInt(s.slice(0,2),16)+.7152*Number.parseInt(s.slice(2,4),16)+.0722*Number.parseInt(s.slice(4,6),16)}const o=n.match(/\d+(?:\.\d+)?/g);if(!o||o.length<3)return null;const[r,u,a]=o.slice(0,3).map(Number);return .2126*r+.7152*u+.0722*a}function ut(){var e,t,n,l,o,r,u,a;const s=p.value,c=P.value;if(!s||!c)return;const d=s,y=s.querySelector(".monaco-editor")||s,g=y.querySelector(".monaco-editor-background")||y,m=y.querySelector(".view-lines")||y;let f=null,v=null,S=null;try{typeof window<"u"&&typeof window.getComputedStyle=="function"&&(f=window.getComputedStyle(y),v=g===y?f:window.getComputedStyle(g),S=m===y?f:window.getComputedStyle(m))}catch{f=null,v=null,S=null}const O=String((e=f==null?void 0:f.getPropertyValue("--vscode-editor-foreground"))!=null?e:"").trim(),F=String((t=f==null?void 0:f.getPropertyValue("--vscode-editor-background"))!=null?t:"").trim(),k=String((l=(n=f==null?void 0:f.getPropertyValue("--vscode-editor-selectionBackground"))!=null?n:f==null?void 0:f.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?l:"").trim(),x=O||String((r=(o=S==null?void 0:S.color)!=null?o:f==null?void 0:f.color)!=null?r:"").trim(),C=F||String((a=(u=v==null?void 0:v.backgroundColor)!=null?u:f==null?void 0:f.backgroundColor)!=null?a:"").trim();return h.value?(x?(c.style.setProperty("--markstream-diff-editor-fg",x),d.style.setProperty("--vscode-editor-foreground",x),d.style.setProperty("--stream-monaco-editor-fg",x)):(c.style.removeProperty("--markstream-diff-editor-fg"),d.style.removeProperty("--vscode-editor-foreground"),d.style.removeProperty("--stream-monaco-editor-fg")),C?(c.style.setProperty("--markstream-diff-editor-bg",C),c.style.setProperty("--markstream-diff-panel-bg",C),c.style.setProperty("--markstream-diff-panel-bg-soft",C),c.style.setProperty("--markstream-diff-panel-bg-strong",C),d.style.setProperty("--vscode-editor-background",C),d.style.setProperty("--stream-monaco-editor-bg",C),d.style.setProperty("--stream-monaco-fixed-editor-bg",C),d.style.setProperty("--stream-monaco-panel-bg",C),d.style.setProperty("--stream-monaco-panel-bg-soft",C),d.style.setProperty("--stream-monaco-panel-bg-strong",C),d.style.backgroundColor=C):(c.style.removeProperty("--markstream-diff-editor-bg"),c.style.removeProperty("--markstream-diff-panel-bg"),c.style.removeProperty("--markstream-diff-panel-bg-soft"),c.style.removeProperty("--markstream-diff-panel-bg-strong"),d.style.removeProperty("--vscode-editor-background"),d.style.removeProperty("--stream-monaco-editor-bg"),d.style.removeProperty("--stream-monaco-fixed-editor-bg"),d.style.removeProperty("--stream-monaco-panel-bg"),d.style.removeProperty("--stream-monaco-panel-bg-soft"),d.style.removeProperty("--stream-monaco-panel-bg-strong"),d.style.backgroundColor=""),void(k?d.style.setProperty("--vscode-editor-selectionBackground",k):d.style.removeProperty("--vscode-editor-selectionBackground"))):function(R,A,Ie){if(!Pt.value)return!1;const ue=at(R),se=at(A);return Ie?ue!=null&&ue>170||se!=null&&se<110:ue!=null&&ue<85||se!=null&&se>190}(C,x,c.classList.contains("is-dark"))?(d.style.removeProperty("--vscode-editor-foreground"),d.style.removeProperty("--vscode-editor-background"),void d.style.removeProperty("--vscode-editor-selectionBackground")):(x&&d.style.setProperty("--vscode-editor-foreground",x),C&&d.style.setProperty("--vscode-editor-background",C),void(k&&d.style.setProperty("--vscode-editor-selectionBackground",k)))}const At=/auto|scroll|overlay/i;function le(e,t,n){var l;if(typeof window>"u"||h.value)return;const o=Math.ceil(t),r=Math.ceil(n)-o;if(!r)return;const u=function(d){var y,g;if(typeof window>"u")return null;const m=(y=d==null?void 0:d.ownerDocument)!=null?y:document,f=m.scrollingElement||m.documentElement||m.body;let v=(g=d==null?void 0:d.parentElement)!=null?g:null;for(;v&&v!==m.body&&v!==f;){const S=window.getComputedStyle(v),O=(S.overflowY||"").toLowerCase(),F=(S.overflow||"").toLowerCase();if(At.test(O)||At.test(F))return v;v=v.parentElement}return f}(e);if(!u)return;const a=(l=e.ownerDocument)!=null?l:document,s=u===a.body||u===a.documentElement||u===a.scrollingElement,c=s?0:u.getBoundingClientRect().top;e.getBoundingClientRect().top-c>=0||(s&&typeof window.scrollBy=="function"?window.scrollBy(0,r):u.scrollTop+=r)}function st(){try{const e=p.value;if(!e)return;const t=e.getBoundingClientRect().height,n=Rt();if(n!=null&&n>0){const o=Dt(n,!0),r=pe();return e.style.minHeight=r!=null?`${r}px`:"0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",void le(e,t,o)}const l=pe();l!=null&&(e.style.minHeight=`${l}px`,e.style.height=`${l}px`,e.style.maxHeight="none",e.style.overflow="visible",le(e,t,l))}catch{}}function xe(){for(var e,t;Ce.length>0;)try{(t=(e=Ce.pop())==null?void 0:e.dispose)==null||t.call(e)}catch{}ke!=null&&(Gn(ke),ke=null)}function ae(){for(var e;nt.length>0;)try{(e=nt.pop())==null||e()}catch{}}function _(e=!1){ie.value||(X.value?st():function(){var t;try{const n=p.value;if(!n)return;const l=n.getBoundingClientRect().height,o=It(),r=Math.ceil(((t=n.getBoundingClientRect)==null?void 0:t.call(n).height)||0),u=h.value?function(){var m,f,v,S,O,F,k,x;try{const C=$(),R=(m=C==null?void 0:C.getOriginalEditor)==null?void 0:m.call(C),A=(f=C==null?void 0:C.getModifiedEditor)==null?void 0:f.call(C);if(!R||!A)return null;const Ie=((O=(S=(v=R.getModel)==null?void 0:v.call(R))==null?void 0:S.getLineCount)==null?void 0:O.call(S))||1,ue=((x=(k=(F=A.getModel)==null?void 0:F.call(A))==null?void 0:k.getLineCount)==null?void 0:x.call(k))||1,se=Math.max(Ie,ue),mt=Math.max($e(R),$e(A)),Bn=Math.max(Tt(R),Tt(A));return Math.ceil(se*(mt+1.5)+Bn+0+1)}catch{return null}}():null,a=h.value&&function(m){if(typeof window>"u")return!1;const f=m.querySelectorAll(".editor.modified .diff-hidden-lines .center, .stream-monaco-diff-unchanged-bridge");for(const v of Array.from(f)){if(!(v instanceof HTMLElement))continue;const S=window.getComputedStyle(v);if(S.display==="none"||S.visibility==="hidden"||Number.parseFloat(S.opacity||"1")<=.01)continue;const O=v.getBoundingClientRect();if(!(O.width<=0||O.height<=0))return!0}return!1}(n);if(a||(ve.value=null),Xe>0&&(Xe--,ce.value!=null))return void le(n,l,he(n,ce.value,o));const s=h.value?function(m){var f,v;if(typeof window>"u")return null;try{const S=m.getBoundingClientRect();if(S.height<=0)return null;const O=[".editor.original .view-lines .view-line",".editor.modified .view-lines .view-line",".editor.original .view-zones > div",".editor.modified .view-zones > div",".editor.original .margin-view-zones > div",".editor.modified .margin-view-zones > div",".editor.original .diff-hidden-lines",".editor.modified .diff-hidden-lines",".stream-monaco-diff-unchanged-bridge"];let F=0;for(const C of Array.from(m.querySelectorAll(O.join(",")))){if(!(C instanceof HTMLElement))continue;const R=window.getComputedStyle(C);if(R.display==="none"||R.visibility==="hidden"||Number.parseFloat(R.opacity||"1")<=.01)continue;const A=C.getBoundingClientRect();A.height<=0||A.bottom<=S.top||(F=Math.max(F,A.bottom-S.top))}if(F>0)return Math.ceil(F+1);const k=m.querySelector(".monaco-diff-editor"),x=(v=(f=k==null?void 0:k.getBoundingClientRect)==null?void 0:f.call(k).height)!=null?v:0;return x>0?Math.ceil(x+1):null}catch{return null}}(n):null,c=h.value?a?s:Math.max(s??0,u??0)||null:Rt();if(c!=null&&c>0){const m=ve.value!=null&&Date.now()<je&&c>=o-1,f=a&&r>0&&r<o-1&&c>=o-1,v=he(n,m?ve.value:f?r:c,o,{clearEstimatedFloor:!0});return a&&v<o-1&&(ve.value=v,je=Date.now()+160),void le(n,l,v)}if(ce.value!=null)return void le(n,l,he(n,ce.value,o));const d=a?r:Math.max(r,u!=null&&u>0?u:0);if(d>0){const m=ve.value!=null&&Date.now()<je&&d>=o-1,f=a&&r>0&&r<o-1&&d>=o-1,v=he(n,m?ve.value:f?r:d,o);return a&&v<o-1&&(ve.value=v,je=Date.now()+160),void le(n,l,v)}const y=pe();if(y!=null)return void le(n,l,he(n,y,o));const g=Number.parseFloat(n.style.height);!Number.isNaN(g)&&g>0?le(n,l,he(n,g,o)):h.value||le(n,l,he(n,o,o))}catch{}}())}function ee(){if(!h.value)return void ae();const e=p.value;if(!e)return void ae();const t=e.querySelector(".monaco-diff-editor");if(!t||t.classList.contains("side-by-side"))return void ae();const n=Array.from(t.querySelectorAll(".editor.original .diff-hidden-lines")),l=Array.from(t.querySelectorAll(".editor.modified .diff-hidden-lines")),o=Math.min(n.length,l.length);for(let r=0;r<o;r++){const u=l[r],a=u.querySelector("a"),s=u.querySelector(".center > div:first-child"),c=u.querySelector(".center");if(!a||!s||!c||c.querySelector(".markstream-inline-fold-proxy"))continue;const d=document.createElement("button");d.type="button",d.className="markstream-inline-fold-proxy",d.dataset.markstreamInlineFoldProxy="true";const y=a.getAttribute("title")||"Show Unchanged Region";d.title=y,d.setAttribute("aria-label",y);const g=v=>{v.preventDefault(),v.stopPropagation()},m=v=>{v.preventDefault(),v.stopPropagation(),a.click(),V(()=>oe())},f=v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.stopPropagation(),a.click(),V(()=>oe()))};d.addEventListener("mousedown",g),d.addEventListener("click",m),d.addEventListener("keydown",f),c.appendChild(d),nt.push(()=>{d.removeEventListener("mousedown",g),d.removeEventListener("click",m),d.removeEventListener("keydown",f),d.parentElement===c&&c.removeChild(d)})}}function oe(e=!1){ke==null&&(ke=V(()=>{ke=null,V(()=>{ee(),_(e)})}))}function he(e,t,n,l={}){const o=Dt(Math.min(t,n),l.clearEstimatedFloor===!0),r=pe();if(e.style.minHeight=r!=null?`${Math.min(r,Math.ceil(n))}px`:"0px",e.style.height=`${o}px`,e.style.maxHeight=`${Math.ceil(n)}px`,h.value)e.style.overflow="hidden";else{const u=t>n+1;e.style.overflow=u?"auto":"hidden"}return o}function It(){var e,t;const n=(t=(e=i.monacoOptions)==null?void 0:e.MAX_HEIGHT)!=null?t:500;if(typeof n=="number")return n;const l=String(n).match(/^(\d+(?:\.\d+)?)/);return l?Number.parseFloat(l[1]):500}const dt=b(()=>i.isShowPreview&&(N.value==="html"||N.value==="svg"));I(()=>i.node.language,e=>{N.value=gt(e)}),I(()=>[i.node.originalCode,i.node.updatedCode,h.value],()=>{it(),V(()=>_e())},{immediate:!0}),I(()=>[i.node.originalCode,i.node.updatedCode,Z.value,h.value],e=>D(null,[e],function*([t,n,l,o]){if(i.stream===!1||!o)return;if(j&&!U.value&&p.value)try{yield ye(p.value)}catch{}const r=Bt(String(t??""),String(n??"")),u=i.loading===!1;if(u&&Ae(),yield Ye(r.original,r.updated,Z.value),u){if(T||!h.value)return;He(),ee(),_e(),oe()}X.value&&V(()=>st())})),I(()=>i.node.code,e=>D(null,null,function*(){if(i.stream!==!1&&(N.value||(N.value=gt(Mt(e))),!h.value)){if(j&&!U.value&&p.value)try{yield ye(p.value)}catch{}Ve(e,Z.value),X.value&&V(()=>st())}}));const ct=b(()=>{const e=N.value;return e?Kt[e]||e.charAt(0).toUpperCase()+e.slice(1):Kt[""]}),Ut=b(()=>{var e;return function(t){const n=function(r){var u,a;const s=(a=(u=String(r??"").split(/\r?\n/,1)[0])==null?void 0:u.trim())!=null?a:"";if(s.length<3)return"";const c=s[0];if(c!=="`"&&c!=="~"||s[1]!==c||s[2]!==c)return"";let d=3;for(;s[d]===c;)d+=1;return s.slice(d).trim()}(t);if(!n)return"";const l=n.split(/\s+/).filter(Boolean);if(!l.length)return"";const o=l[0]==="diff"?l.slice(1):l;for(const r of o){const u=r.includes(":")?r.slice(r.indexOf(":")+1):r;if(u&&/[./\\-]/.test(u))return u}return""}(String((e=i.node.raw)!=null?e:""))}),gn=b(()=>Ut.value||ct.value),jt=b(()=>Ut.value?h.value?`Diff / ${ct.value}`:ct.value:""),bn=b(()=>(In.value,An(N.value||""))),wn=b(()=>{var e;const t={},n=r=>{if(r!=null)return typeof r=="number"?`${r}px`:String(r)},l=n(i.minWidth),o=n(i.maxWidth);return l&&(t.minWidth=l),o&&(t.maxWidth=o),Ht.value&&(t.minHeight=`${(e=vn.value)!=null?e:me.value}px`),h.value||(t.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",t.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg))",t.borderColor="var(--markstream-code-border-color)"),t}),Wt=b(()=>i.showTooltips!==!1);function kn(){return D(this,null,function*(){try{typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(i.node.code)),te.value=!0,de("copy",i.node.code),setTimeout(()=>{te.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})}function Sn(e){if(X.value=!X.value,e&&Wt.value){const l=function(o){const r=o.currentTarget||o.target;return!r||r.disabled?null:r}(e);if(l){const o=X.value?q("common.collapse")||"Collapse":q("common.expand")||"Expand";Wn(l,o,"top",!1,void 0,i.isDark)}}const t=h.value?$():J(),n=p.value;t&&n&&(X.value?(Je(!0),n.style.maxHeight="none",n.style.overflow="visible",_(!0)):(Je(!1),n.style.overflow=h.value?"hidden":"auto",_(!0)))}function Cn(){var e,t,n;if(ie.value=!ie.value,ie.value){if(p.value){const l=Math.ceil(((t=(e=p.value).getBoundingClientRect)==null?void 0:t.call(e).height)||0);l>0&&(ce.value=l)}Je(!1)}else{X.value&&Je(!0),p.value&&ce.value!=null&&(p.value.style.height=`${ce.value}px`);const l=h.value?$():J();try{(n=l==null?void 0:l.layout)==null||n.call(l)}catch{}Xe=2,V(()=>{_(!0)})}}function xn(){if(!dt.value)return;const e=N.value;if(we.value){const t=e==="html"?"text/html":"image/svg+xml",n=e==="html"?q("artifacts.htmlPreviewTitle")||"HTML Preview":q("artifacts.svgPreviewTitle")||"SVG Preview";return void de("previewCode",{node:i.node,artifactType:t,artifactTitle:n,id:`temp-${e}-${Date.now()}`})}e==="html"&&(qe.value=!qe.value)}function Je(e){var t,n;try{if(h.value){const l=$();(t=l==null?void 0:l.updateOptions)==null||t.call(l,{automaticLayout:e})}else{const l=J();(n=l==null?void 0:l.updateOptions)==null||n.call(l,{automaticLayout:e})}}catch{}}function ye(e){if(!j||T)return null;if(re)return re;if(U.value&&Y.value)return Promise.resolve();U.value=!0;const t=D(null,null,function*(){yield function(n){return D(this,null,function*(){var l;if(typeof window>"u")return yield n();try{const o=(l=window.Element)==null?void 0:l.prototype,r=o==null?void 0:o.addEventListener;if(!o||!r)return yield n();const u=function(){const a=window,s=a[Yt];if(s)return s;const c={depth:0,original:null};return a[Yt]=c,c}();u.depth===0&&(u.original=r,o.addEventListener=function(a,s,c){var d;const y=(d=u.original)!=null?d:r;return a==="touchstart"&&function(g,m){if(!g)return!1;const f=g;return!(typeof f.closest!="function"||!f.closest(".monaco-editor, .monaco-diff-editor")||m&&typeof m=="object"&&"passive"in m)}(this,c)?y.call(this,a,s,function(g){return g==null?{passive:!0}:typeof g=="boolean"?{capture:g,passive:!0}:typeof g=="object"?"passive"in g?g:ge(H({},g),{passive:!0}):{passive:!0}}(c)):y.call(this,a,s,c)}),u.depth++;try{return yield n()}finally{u.depth=Math.max(0,u.depth-1),u.depth===0&&u.original&&o.addEventListener!==u.original&&(o.addEventListener=u.original,u.original=null)}}catch{return yield n()}})}(()=>function(n){return D(this,null,function*(){var l,o,r;if(!j||T||(Te.value=!1,Q.value=!1,function(){const a=me.value;ot.value=Y.value||a==null?null:a}(),xe(),ae(),function(a){a.replaceChildren()}(n),T))return;if(h.value){Se();const a=Bt(String((l=i.node.originalCode)!=null?l:""),String((o=i.node.updatedCode)!=null?o:""));We?yield We(n,a.original,a.updated,Z.value):yield j(n,i.node.code,Z.value)}else yield j(n,i.node.code,Z.value);if(T)return;const u=h.value?$():J();if(typeof((r=i.monacoOptions)==null?void 0:r.fontSize)=="number")u==null||u.updateOptions({fontSize:i.monacoOptions.fontSize,automaticLayout:!1}),W.value=i.monacoOptions.fontSize,M.value=i.monacoOptions.fontSize;else{const a=Ft();a&&a>0?(W.value=a,M.value=a):(W.value=12,M.value=12)}X.value||ie.value||_(!1),yield function(){return D(this,null,function*(){pe()!=null&&(ee(),_(!1),yield Me(),yield Ge(),ee(),_(!1),yield Ge(),ee(),_(!1))})}(),T||(Y.value=!0,function(){var a,s,c,d,y;if(xe(),h.value){const m=$(),f=(a=m==null?void 0:m.getOriginalEditor)==null?void 0:a.call(m),v=(s=m==null?void 0:m.getModifiedEditor)==null?void 0:s.call(m),S=(O,F)=>{try{const k=O==null?void 0:O[F];if(typeof k!="function")return;const x=k.call(O,()=>oe());x&&Ce.push(x)}catch{}};try{const O=(c=m==null?void 0:m.onDidUpdateDiff)==null?void 0:c.call(m,()=>{oe(),V(()=>_e())});O&&Ce.push(O)}catch{}return S(f,"onDidContentSizeChange"),S(v,"onDidContentSizeChange"),S(f,"onDidLayoutChange"),void S(v,"onDidLayoutChange")}const g=J();try{const m=(d=g==null?void 0:g.onDidContentSizeChange)==null?void 0:d.call(g,()=>oe());m&&Ce.push(m)}catch{}try{const m=(y=g==null?void 0:g.onDidLayoutChange)==null?void 0:y.call(g,()=>oe());m&&Ce.push(m)}catch{}}(),ut(),ee(),_e(),oe(),yield function(){return D(this,null,function*(){ee(),_(!1),yield Me(),yield Ge(),ee(),_(!1),yield Ge(),ee(),_(!1)})}(),T||(Q.value=!0))})}(e))}).finally(()=>{re===t&&(re=null)});return re=t,t}I(Wt,e=>{e||Un()}),I(()=>M.value,(e,t)=>{const n=h.value?$():J();n&&typeof e=="number"&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),ie.value||_(!0))},{flush:"post",immediate:!1});const Pn=I(()=>[p.value,h.value,i.stream,i.loading,Le.value,G.value],e=>D(null,[e],function*([t,n,l,o,r,u]){if(!t||!j||!u||l===!1&&o!==!1)return;const a=ye(t);if(a){try{yield a}catch{Y.value=!1,Q.value=!1,Te.value=!0}Pn()}}));function Vt(e){return!!e&&typeof e=="object"&&"light"in e&&"dark"in e}function Pe(e){return typeof e=="string"?e:e&&typeof e=="object"&&"name"in e?String(e.name):null}function qt(e,t){if(e===t)return!0;const n=Pe(e),l=Pe(t);return!!n&&n===l}function Re(){var e;const t=function(){if(i.theme!==void 0){const s=i.theme;return Vt(s)?i.isDark?s.dark:s.light:s}return i.isDark?i.darkTheme:i.lightTheme}(),n=(e=K.value)==null?void 0:e.theme,l=t??n;if(l!=null&&typeof l=="object")return l;const o=Array.isArray(i.themes)?i.themes:[];if(!o.length||l==null)return l;const r=Pe(l),u=o.map(s=>Pe(s)).filter(s=>!!s);if(!r||u.includes(r))return l;const a=Pe(n);return n!=null&&a&&u.includes(a)?n:o[0]}I(Et,(e,t)=>D(null,null,function*(){if(e===t||(an.value=e,!j||!p.value)||!U.value||i.stream===!1&&i.loading!==!1||!G.value)return;const n=re;if(n){try{yield n}catch{}if(T||!p.value)return}try{Y.value=!1,Q.value=!1,U.value=!1,xe(),ae(),Se(),yield Me(),yield ye(p.value)}catch{Y.value=!1,Q.value=!1,Te.value=!0}}));const vt=b(()=>(i.theme!==void 0?!Vt(i.theme):qt(i.darkTheme,i.lightTheme))?function(e){var t,n;if(e&&typeof e=="object"&&((t=e.colors)!=null&&t["editor.background"])){const o=at(e.colors["editor.background"]);if(o!=null)return o<128}const l=((n=Pe(e))!=null?n:"").toLowerCase();return l?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(o=>l.includes(o))&&!["light","latte","dawn","lotus"].some(o=>l.includes(o)):!!i.isDark}(Re()):!!i.isDark),ft=b(()=>{var e;if(!h.value)return vt.value?"dark":"light";const t=(e=K.value)==null?void 0:e.diffAppearance;return t==="light"||t==="dark"?t:vt.value?"dark":"light"}),Mn=b(()=>h.value?ft.value==="dark":vt.value);function Gt(){return ge(H(ge(H({wordWrap:"on",wrappingIndent:"same",themes:i.themes},K.value||{}),{theme:Re()}),h.value?{diffAppearance:ft.value}:{}),{onThemeChange(){ut()}})}function Ae(){const e=Gt();if(!ne)return ne=e,ne;for(const t of Object.keys(ne))t in e||delete ne[t];return Object.assign(ne,e),ne}const On=b(()=>{var e,t,n,l,o,r,u,a,s,c,d,y,g,m,f;return JSON.stringify({diffLineStyle:(t=(e=K.value)==null?void 0:e.diffLineStyle)!=null?t:"background",diffUnchangedRegionStyle:(l=(n=K.value)==null?void 0:n.diffUnchangedRegionStyle)!=null?l:"line-info",diffHideUnchangedRegions:((o=i.monacoOptions)==null?void 0:o.diffHideUnchangedRegions)===void 0?H({},De):lt(i.monacoOptions.diffHideUnchangedRegions),renderSideBySide:(u=(r=K.value)==null?void 0:r.renderSideBySide)==null||u,useInlineViewWhenSpaceIsLimited:(s=(a=K.value)==null?void 0:a.useInlineViewWhenSpaceIsLimited)==null||s,enableSplitViewResizing:(d=(c=K.value)==null?void 0:c.enableSplitViewResizing)==null||d,ignoreTrimWhitespace:(g=(y=K.value)==null?void 0:y.ignoreTrimWhitespace)==null||g,originalEditable:(f=(m=K.value)==null?void 0:m.originalEditable)!=null&&f})});return I(()=>[i.monacoOptions,G.value],()=>{var e,t;if(Ae(),!j||!G.value)return;const n=h.value?$():J(),l=typeof((e=i.monacoOptions)==null?void 0:e.fontSize)=="number"?i.monacoOptions.fontSize:Number.isFinite(M.value)?M.value:void 0;typeof l=="number"&&Number.isFinite(l)&&l>0&&((t=n==null?void 0:n.updateOptions)==null||t.call(n,{fontSize:l})),_(!1)},{deep:!0}),I(()=>[Re(),ft.value,Le.value,U.value,G.value],([e],t)=>{Le.value&&U.value&&G.value&&function(n={}){if(n.appearanceOnly)return;Ae();const l=Re(),o=()=>{h.value&&He(),V(()=>{ut(),oe()})};l?function(r,u){const a=function(s){if(s==null)return null;if(typeof s=="string")return s;if(typeof s=="object"&&"name"in s)return String(s.name);if(typeof s=="object"){const c=St.get(s);if(c)return c;try{const y=JSON.stringify(s);if(y)return St.set(s,y),y}catch{}const d="__theme_"+ ++ol;return St.set(s,d),d}return String(s)}(u);return a?(kt=r,Oe||wt!==a?Oe?(Be===a||bt===a||(Ue=u,Be=a),Oe):(Ue=u,Be=a,Oe=D(null,null,function*(){for(;Be&&Ue!=null;){const s=Ue,c=Be;if(Ue=null,Be=null,wt!==c)try{bt=c,yield(kt??r)(s),wt=c}catch{}}}).finally(()=>{Oe=null,bt=null}),Oe):Promise.resolve()):Promise.resolve()}(tt,l).then(o).catch(r=>{}):o()}({appearanceOnly:t!=null&&qt(e,t[0])})},{flush:"post"}),I(()=>[On.value,Le.value,G.value],(e,t)=>D(null,[e,t],function*([n,l,o],[r]){if(Ae(),!l||!o||!j||!p.value||!U.value||n===r||i.stream===!1&&i.loading!==!1)return;const u=re;if(u){try{yield u}catch{}if(T||!p.value)return}try{Y.value=!1,Q.value=!1,U.value=!1,xe(),ae(),Se(),yield Me(),yield ye(p.value)}catch{Y.value=!1,Q.value=!1,Te.value=!0}}),{flush:"post"}),I(()=>[i.loading,G.value],(e,t)=>D(null,[e,t],function*([n,l],o){if(!l||n)return;const r=o==null?void 0:o[0],u=r!==void 0&&r!==!1;yield Me(),V(()=>{D(null,null,function*(){var a;try{if(u&&U.value)if(h.value&&p.value){const s=re;if(s)try{yield s}catch{}if(Ae(),Y.value=!1,Q.value=!1,U.value=!1,xe(),ae(),Se(),yield Me(),yield ye(p.value),T||!h.value)return;He(),ee(),_e()}else Ve(String((a=i.node.code)!=null?a:""),Z.value);_(!1)}catch{}})})}),{immediate:!0,flush:"post"}),tn(()=>{xe(),ae(),et()}),(e,t)=>Fe.value?(Ee(),Qe(Ct(Qt),{key:0,node:i.node,loading:i.loading},null,8,["node","loading"])):(Ee(),Jt("div",{key:1,ref_key:"container",ref:P,style:yt(wn.value),class:Ze(["code-block-container rounded-lg border",[{dark:i.isDark,"is-rendering":i.loading,"is-dark":Mn.value,"is-diff":h.value,"is-plain-text":Pt.value}]]),"data-markstream-code-block":"1","data-markstream-enhanced":Q.value&&!Fe.value?"true":"false"},[Nn(jn,{"show-header":i.showHeader,"show-collapse-button":i.showCollapseButton,"show-font-size-buttons":i.showFontSizeButtons,"enable-font-size-control":i.enableFontSizeControl,"show-copy-button":i.showCopyButton,"show-expand-button":i.showExpandButton,"show-preview-button":i.showPreviewButton,"show-tooltips":i.showTooltips,"is-dark":i.isDark,loading:i.loading,stream:E.stream,"is-collapsed":ie.value,"is-expanded":X.value,"copy-text":te.value,"is-previewable":dt.value,"code-font-size":M.value,"code-font-min":10,"code-font-max":36,"default-code-font-size":W.value,"font-baseline-ready":sn.value,"diff-stats":h.value?fe.value:null,"diff-stats-aria-label":rn.value,onToggleCollapse:Cn,onDecreaseFont:hn,onResetFont:yn,onIncreaseFont:pn,onCopy:kn,onToggleExpand:Sn,onPreview:xn},zn({"header-left":Ke(()=>[pt(e.$slots,"header-left",{},()=>[z("div",rl,[z("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:bn.value},null,8,al),z("div",ul,[z("div",sl,xt(gn.value),1),jt.value?(Ee(),Jt("div",dl,xt(jt.value),1)):ht("",!0)])])],!0)]),loading:Ke(()=>[pt(e.$slots,"loading",{loading:E.loading,stream:E.stream},()=>[t[0]||(t[0]=z("div",{class:"loading-skeleton"},[z("div",{class:"skeleton-line"}),z("div",{class:"skeleton-line"}),z("div",{class:"skeleton-line short"})],-1))],!0)]),default:Ke(()=>[Hn(z("div",cl,[z("div",{ref_key:"codeEditor",ref:p,class:Ze(["code-editor-container",[E.stream?"":"code-height-placeholder",{"is-hidden":Lt.value}]]),style:yt(mn.value)},null,6),Lt.value?(Ee(),Qe(Ct(Qt),{key:0,class:Ze(["code-pre-fallback",{"is-wrap":un.value}]),style:yt(fn.value),node:i.node},null,8,["class","style","node"])):ht("",!0)],512),[[Dn,!(ie.value||!E.stream&&E.loading)]]),qe.value&&!we.value&&dt.value&&N.value==="html"?(Ee(),Qe(ll,{key:0,code:i.node.code,"html-preview-allow-scripts":i.htmlPreviewAllowScripts,"html-preview-sandbox":i.htmlPreviewSandbox,"is-dark":i.isDark,"on-close":()=>qe.value=!1},null,8,["code","html-preview-allow-scripts","html-preview-sandbox","is-dark","on-close"])):ht("",!0)]),_:2},[e.$slots["header-right"]?{name:"header-right",fn:Ke(()=>[pt(e.$slots,"header-right",{},void 0,!0)]),key:"0"}:void 0]),1032,["show-header","show-collapse-button","show-font-size-buttons","enable-font-size-control","show-copy-button","show-expand-button","show-preview-button","show-tooltips","is-dark","loading","stream","is-collapsed","is-expanded","copy-text","is-previewable","code-font-size","default-code-font-size","font-baseline-ready","diff-stats","diff-stats-aria-label"])],14,il))}}),[["__scopeId","data-v-c1313629"]]);export{yl as default};
