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