@moonshot-ai/kimi-code 0.20.1 → 0.20.2

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.
Files changed (73) hide show
  1. package/dist/main.mjs +6949 -6621
  2. package/dist-web/assets/CodeBlockNode-Cj5GCBwy.js +22 -0
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-DPPhMZ1J.js → CodeBlockShell.vue_vue_type_style_index_0_lang-BZQYvYGg.js} +1 -1
  4. package/dist-web/assets/{Tooltip-D4SNb85I.js → Tooltip-FXn3ewBz.js} +1 -1
  5. package/dist-web/assets/{arc-ByMO5pI7.js → arc---yONsFG.js} +1 -1
  6. package/dist-web/assets/{architectureDiagram-3BPJPVTR-Dvmwtelo.js → architectureDiagram-3BPJPVTR-Cu5NFSbj.js} +1 -1
  7. package/dist-web/assets/{blockDiagram-GPEHLZMM-lDGeez1y.js → blockDiagram-GPEHLZMM-eAkllecr.js} +1 -1
  8. package/dist-web/assets/{c4Diagram-AAUBKEIU-BpX1rFb4.js → c4Diagram-AAUBKEIU-BcJyf2yX.js} +1 -1
  9. package/dist-web/assets/channel-BTxFVrej.js +1 -0
  10. package/dist-web/assets/{chunk-2J33WTMH-jodlcE5W.js → chunk-2J33WTMH-DzpuDCg4.js} +1 -1
  11. package/dist-web/assets/{chunk-4BX2VUAB-BrZvBuhT.js → chunk-4BX2VUAB-DPF55Xbc.js} +1 -1
  12. package/dist-web/assets/{chunk-55IACEB6-BMZITsHm.js → chunk-55IACEB6-Ct2k4oQF.js} +1 -1
  13. package/dist-web/assets/{chunk-727SXJPM-Cmhtbm26.js → chunk-727SXJPM-DcWnL_ZJ.js} +1 -1
  14. package/dist-web/assets/{chunk-AQP2D5EJ-yt2A8pJF.js → chunk-AQP2D5EJ-2N1ZTMho.js} +1 -1
  15. package/dist-web/assets/{chunk-FMBD7UC4-C5EABTZN.js → chunk-FMBD7UC4-jNBVe-u1.js} +1 -1
  16. package/dist-web/assets/{chunk-ND2GUHAM-CVMSNFBB.js → chunk-ND2GUHAM-BTBgmjVQ.js} +1 -1
  17. package/dist-web/assets/{chunk-QZHKN3VN-F9qv3qjM.js → chunk-QZHKN3VN-xUCxw3pg.js} +1 -1
  18. package/dist-web/assets/classDiagram-4FO5ZUOK-B47dzfoS.js +1 -0
  19. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-B47dzfoS.js +1 -0
  20. package/dist-web/assets/{cose-bilkent-S5V4N54A-BTsTGLXV.js → cose-bilkent-S5V4N54A-ByEZXDA-.js} +1 -1
  21. package/dist-web/assets/{dagre-BM42HDAG-DrzkpEQT.js → dagre-BM42HDAG-BSfstE2-.js} +1 -1
  22. package/dist-web/assets/{diagram-2AECGRRQ-e1GfngTa.js → diagram-2AECGRRQ-CpI86-tI.js} +1 -1
  23. package/dist-web/assets/{diagram-5GNKFQAL-ousok5qp.js → diagram-5GNKFQAL-B4WYOJbp.js} +1 -1
  24. package/dist-web/assets/{diagram-KO2AKTUF-DyZixoAA.js → diagram-KO2AKTUF-dmm87H0J.js} +1 -1
  25. package/dist-web/assets/{diagram-LMA3HP47-DYvup0AJ.js → diagram-LMA3HP47-CAFHWRvJ.js} +1 -1
  26. package/dist-web/assets/{diagram-OG6HWLK6-DjeAOuOP.js → diagram-OG6HWLK6-CvbELbqm.js} +1 -1
  27. package/dist-web/assets/{erDiagram-TEJ5UH35-DW158lKF.js → erDiagram-TEJ5UH35-BATGAYdA.js} +1 -1
  28. package/dist-web/assets/{flowDiagram-I6XJVG4X-CNe29HBu.js → flowDiagram-I6XJVG4X-BjHCXPMa.js} +1 -1
  29. package/dist-web/assets/{ganttDiagram-6RSMTGT7-DNXeqbuv.js → ganttDiagram-6RSMTGT7-DyP4c3YT.js} +1 -1
  30. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-DxrQ7BFf.js → gitGraphDiagram-PVQCEYII-NzukZ15I.js} +1 -1
  31. package/dist-web/assets/index-BYnLiw5r.css +1 -0
  32. package/dist-web/assets/index-CCjot4qV.js +284 -0
  33. package/dist-web/assets/{index-CO3YU1Qs.js → index-Cfg9noDi.js} +2 -2
  34. package/dist-web/assets/{index-JMCtP-Ps.js → index-D4Er4P8I.js} +1 -1
  35. package/dist-web/assets/{index10-CgqlibfL.js → index10-C4yIRdle.js} +2 -2
  36. package/dist-web/assets/{index11-DEbZPqF_.js → index11-CqNiMTbJ.js} +2 -2
  37. package/dist-web/assets/{index5-6RR-0mhw.js → index5-DKdkj0GC.js} +1 -1
  38. package/dist-web/assets/{index6-Dd2WDK6a.js → index6-DsK3MiZT.js} +1 -1
  39. package/dist-web/assets/index7-DHshPD9x.js +1 -0
  40. package/dist-web/assets/index8-CeUCBmKU.js +2 -0
  41. package/dist-web/assets/{infoDiagram-5YYISTIA-bsQXw5Cf.js → infoDiagram-5YYISTIA-6n_F_-MA.js} +1 -1
  42. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-k8l6Qdjw.js → ishikawaDiagram-YF4QCWOH-CoaeNeqj.js} +1 -1
  43. package/dist-web/assets/{journeyDiagram-JHISSGLW-cYfBbMdz.js → journeyDiagram-JHISSGLW-Bi-m1_1y.js} +1 -1
  44. package/dist-web/assets/{kanban-definition-UN3LZRKU-CTnpueoW.js → kanban-definition-UN3LZRKU-DHxtNMaD.js} +1 -1
  45. package/dist-web/assets/katex-DnlPpQZa.js +257 -0
  46. package/dist-web/assets/{linear-CdKUj4Ug.js → linear-CgHyf5UH.js} +1 -1
  47. package/dist-web/assets/{mermaid.core-UWDZO4h_.js → mermaid.core-CtXm064v.js} +4 -4
  48. package/dist-web/assets/{mhchem-KEf2LMH_.js → mhchem-DtR62fUK.js} +1 -1
  49. package/dist-web/assets/{mindmap-definition-RKZ34NQL-3z79U-lX.js → mindmap-definition-RKZ34NQL-ClpCUmIA.js} +1 -1
  50. package/dist-web/assets/{pieDiagram-4H26LBE5-CMDgRqd9.js → pieDiagram-4H26LBE5-DvYtw1Bp.js} +1 -1
  51. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-DX1F2ToM.js → quadrantDiagram-W4KKPZXB-Dle7c6-0.js} +1 -1
  52. package/dist-web/assets/{requirementDiagram-4Y6WPE33-DoWnnNLY.js → requirementDiagram-4Y6WPE33--X5AnAhp.js} +1 -1
  53. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-ClNy2w1_.js → sankeyDiagram-5OEKKPKP-BUszdT9f.js} +1 -1
  54. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-BfJgBlpQ.js → sequenceDiagram-3UESZ5HK-CDwqGrfV.js} +1 -1
  55. package/dist-web/assets/{stateDiagram-AJRCARHV-KaDNy_Jo.js → stateDiagram-AJRCARHV-Kmd6YXse.js} +1 -1
  56. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CvgWdsVg.js +1 -0
  57. package/dist-web/assets/{timeline-definition-PNZ67QCA-DaKQHHIC.js → timeline-definition-PNZ67QCA-o-RAswWS.js} +1 -1
  58. package/dist-web/assets/{vennDiagram-CIIHVFJN-Cw9sx89s.js → vennDiagram-CIIHVFJN-DljQ_s6w.js} +1 -1
  59. package/dist-web/assets/{vue.runtime.esm-bundler-DNelV8ct.js → vue.runtime.esm-bundler-BP7sjueK.js} +1 -1
  60. package/dist-web/assets/{wardley-L42UT6IY-fWMnczak.js → wardley-L42UT6IY-CW9wuVhK.js} +1 -1
  61. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-Bi8Phs9U.js → wardleyDiagram-YWT4CUSO-Bh0wtRMV.js} +1 -1
  62. package/dist-web/assets/{xychartDiagram-2RQKCTM6-DR3dlDte.js → xychartDiagram-2RQKCTM6-BAjJ0sMH.js} +1 -1
  63. package/dist-web/index.html +2 -2
  64. package/package.json +2 -2
  65. package/dist-web/assets/CodeBlockNode-Ds9FDojm.js +0 -22
  66. package/dist-web/assets/channel-CFIWdU7V.js +0 -1
  67. package/dist-web/assets/classDiagram-4FO5ZUOK-HfSWUU5X.js +0 -1
  68. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-HfSWUU5X.js +0 -1
  69. package/dist-web/assets/index-Dv5UmLv8.css +0 -1
  70. package/dist-web/assets/index-uGnch3Jw.js +0 -273
  71. package/dist-web/assets/index7-DhrSWRIG.js +0 -1
  72. package/dist-web/assets/index8-C1M9n-68.js +0 -2
  73. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BGR-zf4G.js +0 -1
@@ -0,0 +1,22 @@
1
+ import{bR as ao,ci as uo,bQ as Bl,M as El,bl as so,af as gl,bZ as co,c0 as Ol,aU as P,bT as fo,bE as q,az as vo,c1 as wl,c2 as mo,aI as Ll,aL as Xe,s as Nn,bk as Et,cj as bl,u as Sl,I as po,A as ho,bJ as Ln,aY as bt,bL as yo,v as A,aw as St,au as Hn,t as kt,bB as go,bb as Ot,q as w,ck as wo,c4 as bo,c5 as So,c8 as ko,a0 as Co,c3 as kl,aD as xo,bO as Mo,T as Po,as as V,b$ as Bo,cl as Eo}from"./index-CCjot4qV.js";import{i as Z,t as Oo}from"./safeRaf-DGuzXxDK.js";import{V as Lo}from"./CodeBlockShell.vue_vue_type_style_index_0_lang-BZQYvYGg.js";var Fn=(x,k,M)=>new Promise((i,de)=>{var Oe=B=>{try{ee(M.next(B))}catch(L){de(L)}},K=B=>{try{ee(M.throw(B))}catch(L){de(L)}},ee=B=>B.done?i(B.value):Promise.resolve(B.value).then(Oe,K);ee((M=M.apply(x,k)).next())});let Cl=!1,fn=null,vn=null,Ct=!1,mn=null;function Fo(){return Fn(this,null,function*(){if(mn)return mn;mn=Fn(null,null,function*(){if(!vn){if(Ct)return null;try{if(vn=(function(x){const k=x;if(typeof k?.useMonaco=="function")return k;const M=x?.default;return typeof M?.useMonaco=="function"?M:null})(yield ao(()=>import("./__vite-optional-peer-dep_stream-monaco_markstream-vue-BIHI7g3E.js"),[])),!vn)return Ct=!0,null}catch{return Ct=!0,null}}try{return yield(function(x){return Fn(this,null,function*(){return Cl?void 0:fn||(fn=Fn(null,null,function*(){const M=globalThis?.MonacoEnvironment;M&&(typeof M.getWorker=="function"||typeof M.getWorkerUrl=="function")||typeof x?.preloadMonacoWorkers!="function"||(yield x.preloadMonacoWorkers()),Cl=!0}).finally(()=>{fn=null}),fn)})})(vn),uo(),vn}catch{return null}});try{return yield mn}finally{mn=null}})}var $o=Object.defineProperty,No=Object.defineProperties,Ho=Object.getOwnPropertyDescriptors,xl=Object.getOwnPropertySymbols,zo=Object.prototype.hasOwnProperty,To=Object.prototype.propertyIsEnumerable,Ml=(x,k,M)=>k in x?$o(x,k,{enumerable:!0,configurable:!0,writable:!0,value:M}):x[k]=M,_=(x,k)=>{for(var M in k||(k={}))zo.call(k,M)&&Ml(x,M,k[M]);if(xl)for(var M of xl(k))To.call(k,M)&&Ml(x,M,k[M]);return x},ye=(x,k)=>No(x,Ho(k)),H=(x,k,M)=>new Promise((i,de)=>{var Oe=B=>{try{ee(M.next(B))}catch(L){de(L)}},K=B=>{try{ee(M.throw(B))}catch(L){de(L)}},ee=B=>B.done?i(B.value):Promise.resolve(B.value).then(Oe,K);ee((M=M.apply(x,k)).next())});const Ro={class:"html-preview-frame__header"},_o={class:"html-preview-frame__title"},Do={class:"html-preview-frame__label"},Wo=["sandbox","srcdoc"],Ao=Bl(El({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(x){const k=x,M=import.meta!==void 0&&!1;let i=null;const{t:de}=Ol(),Oe=w(()=>{const B=k.code||"",L=B.trim().toLowerCase();return L.startsWith("<!doctype")||L.startsWith("<html")||L.startsWith("<body")?B:`<!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <style>
7
+ html, body {
8
+ margin: 0;
9
+ padding: 0;
10
+ height: 100%;
11
+ background-color: ${k.isDark?"#020617":"#ffffff"};
12
+ color: ${k.isDark?"#e5e7eb":"#020617"};
13
+ }
14
+ body {
15
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;
16
+ }
17
+ </style>
18
+ </head>
19
+ <body>
20
+ ${B}
21
+ </body>
22
+ </html>`}),K=w(()=>{return B=k.htmlPreviewSandbox,L=k.htmlPreviewAllowScripts,typeof B=="string"?((function(ke){if(!M||typeof console>"u"||i===ke)return;const ne=(function(S){return new Set(S.trim().toLowerCase().split(/\s+/).filter(Boolean))})(ke);ne.has("allow-scripts")&&ne.has("allow-same-origin")&&(i=ke,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."))})(B),B):B!==void 0?"":L===!0?"allow-scripts":"";var B,L});function ee(B){var L;B.key!=="Escape"&&B.key!=="Esc"||(L=k.onClose)==null||L.call(k)}return xo(()=>{typeof window<"u"&&window.addEventListener("keydown",ee)}),Ll(()=>{typeof window<"u"&&window.removeEventListener("keydown",ee)}),(B,L)=>(Xe(),Nn(Po,{to:"body"},[A("div",{class:Hn(["markstream-vue",{dark:k.isDark}])},[A("div",{class:"html-preview-frame__backdrop",onClick:L[2]||(L[2]=ke=>{var ne;return(ne=k.onClose)==null?void 0:ne.call(k)})},[A("div",{class:"html-preview-frame",onClick:L[1]||(L[1]=Mo(()=>{},["stop"]))},[A("div",Ro,[A("div",_o,[L[3]||(L[3]=A("span",{class:"html-preview-frame__dot"},null,-1)),A("span",Do,Ot(k.title||Et(de)("common.preview")||"Preview"),1)]),A("button",{type:"button",class:"html-preview-frame__close",onClick:L[0]||(L[0]=ke=>{var ne;return(ne=k.onClose)==null?void 0:ne.call(k)})}," × ")]),A("iframe",{class:"html-preview-frame__iframe",sandbox:K.value,referrerpolicy:"no-referrer",srcdoc:Oe.value},null,8,Wo)])])],2)]))}}),[["__scopeId","data-v-24e66176"]]);let Ye=null,xt=null,pn=null,Qe=null,Mt=null,Pt=null;const Bt=new WeakMap;let Io=0;const qo=["data-markstream-enhanced","data-markstream-enhancement-state","data-markstream-pending"],jo={class:"code-header-main"},Uo=["innerHTML"],Vo={class:"code-header-copy"},Go={class:"code-header-title"},Jo={key:0,class:"code-header-caption"},Ko={class:"code-editor-layer"},Pl="__markstreamMonacoPassiveTouchState__",$n=1.5,Zo=Bl(El({__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:{},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},customId:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},estimatedHeightPx:{},estimatedContentHeightPx:{}},emits:["previewCode","copy"],setup(x,{emit:k}){var M;const i=x,de=k,Oe=so(),K=gl(co,null),ee=gl("markstreamHostScrollManaged",null),B=w(()=>Bo(i,Oe)),L=Co(),ke=w(()=>{const e=L?.vnode.props;return!(!e||!e.onPreviewCode&&!e.onPreviewCode)}),{t:ne}=Ol(),S=P(null),ge=P(null),zn=P(!1),ce=P(al(i.node.language,i.node.code,ft())),fe=w(()=>wo(ce.value)),Lt=w(()=>fe.value==="plaintext"),ve=P(!1),Ce=P(!1),j=P(!1),me=P(!1),I=P(!1),De=P(!1);let F=!1,We=null,xe="";const Le=P(null),Fe=P(null);let hn=0,Tn=0;const Fl=fo(),Ze=P(null),Y=P(typeof window>"u");typeof window<"u"&&q(()=>ge.value,e=>{var n;if((n=Ze.value)==null||n.destroy(),Ze.value=null,!e)return void(Y.value=!1);const t=window.__MARKSTREAM_CODE_BLOCK_VIEWPORT_ROOT_MARGIN__,l=Fl(e,{rootMargin:typeof t=="string"?t:"400px"});Ze.value=l,Y.value=l.isVisible.value,l.whenVisible.then(()=>{Y.value=!0})},{immediate:!0}),vo(()=>{var e;F=!0,(function(){const n=xe;K&&n&&(xe="",K.markSettled(n))})(),(e=Ze.value)==null||e.destroy(),Ze.value=null});let G=null,yn=null,gn=()=>{},wn=()=>{},en=()=>null,te=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),W=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),Rn=()=>{},Ae=()=>{},_n=()=>{},we=null,nn=null,tn=null,Ft=()=>{var e;return String((e=i.node.language)!=null?e:"plaintext")},Dn=()=>H(null,null,function*(){}),$t=!1;const Ie=[],Wn=[];let be=null;function bn(e){var n;return((n=String(e??"").trim().split(/\s+/,1)[0])!=null?n:"")==="diff"}const m=w(()=>{var e;return i.node.diff===!0||bn(i.node.language)||bn(mt(String((e=i.node.raw)!=null?e:"")))}),$e=P({removed:0,added:0}),$l=w(()=>`-${$e.value.removed} +${$e.value.added}`),ln=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5}),Nt=Object.freeze(ye(_({},ln),{enabled:!1,revealLineCount:0}));function An(e){var n;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const t=e;return ye(_(_({},ln),t),{enabled:(n=t.enabled)==null||n})}return _({},ln)}function Ht(e){var n,t,l;if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const o=e.renderSideBySideInlineBreakpoint,a=typeof o=="number"&&Number.isFinite(o)?o:900,r=((t=(n=ge.value)==null?void 0:n.getBoundingClientRect)==null?void 0:t.call(n).width)||((l=ge.value)==null?void 0:l.clientWidth)||(typeof window>"u"?0:window.innerWidth);return r>0&&r<=a}function In(e,n){return{original:Sn(e,!1),updated:Sn(n,!1)}}function Sn(e,n){const t=String(e??"");return n?t:t.replace(/\r\n$|\n$|\r$/,"")}function on(e){var n;return String((n=e?.message)!=null?n:e).includes("no diff result available")}function qe(){try{const e=_n();e&&typeof e.catch=="function"&&e.catch(n=>{on(n)})}catch(e){on(e)}}const Q=w(()=>{var e,n,t,l;const o=i.monacoOptions?_({},i.monacoOptions):{};if(!m.value)return o;const a=o.diffHideUnchangedRegions===void 0?_({},ln):An(o.diffHideUnchangedRegions),r=o.hideUnchangedRegions===void 0?void 0:An(o.hideUnchangedRegions),u=i.stream!==!1&&i.loading!==!1,s=u?_({},Nt):a,c=u?_({},Nt):r,d=(function(v){return v.diffWordWrap!==void 0?v.diffWordWrap:"off"})(o),f=_({},(e=o.experimental)!=null?e:{}),y=(n=o.diffUnchangedRegionStyle)!=null?n:"line-info",g=(function(v){if(!Ht(v))return;const h=v.scrollbar&&typeof v.scrollbar=="object"?v.scrollbar:{};return ye(_({},h),{horizontal:"hidden",horizontalScrollbarSize:0})})(o),p={maxComputationTime:0,diffAlgorithm:"legacy",ignoreTrimWhitespace:!1,renderIndicators:!0,diffUpdateThrottleMs:120,renderLineHighlight:"none",renderLineHighlightOnlyWhenFocus:!0,selectionHighlight:!1,occurrencesHighlight:"off",matchBrackets:"never",lineDecorationsWidth:4,lineNumbersMinChars:2,glyphMargin:!1,minimap:{enabled:!1},renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,diffWordWrap:d,renderSideBySide:(t=o.renderSideBySide)==null||t,diffHideUnchangedRegions:s,useInlineViewWhenSpaceIsLimited:(l=o.useInlineViewWhenSpaceIsLimited)!=null&&l,diffLineStyle:"background",diffAppearance:"auto",diffUnchangedRegionStyle:y,diffHunkActionsOnHover:!1,experimental:f};return _(ye(_(ye(_(_({},p),o),{experimental:f}),c===void 0?{}:{hideUnchangedRegions:c}),{diffHideUnchangedRegions:s,diffWordWrap:d}),g===void 0?{}:{scrollbar:g})}),qn=w(()=>m.value?"diff":"single"),Nl=P(qn.value),ae=P(!1),T=P(!1),ue=P(!1),Ne=P(null),jn=P(0),zt=P(0),le=P(!1),oe=P(!1);let rn=null,an=null,je=!1,Un=null;const Hl=w(()=>{var e,n,t;if(m.value){const o=(e=Q.value)==null?void 0:e.diffWordWrap;if(o==="inherit"){const a=(n=i.monacoOptions)==null?void 0:n.wordWrap;return a==null||String(a)!=="off"}return o==="on"}const l=(t=i.monacoOptions)==null?void 0:t.wordWrap;return l==null||String(l)!=="off"}),kn=w(()=>{var e;return!!m.value&&Ht((e=Q.value)!=null?e:{})});function Tt(e){return ee?.value===!0||!!e&&(!!e.closest('[data-markstream-virtual-timeline="1"], .markstream-virtual-timeline')||!!e.closest(".vue-recycle-scroller, [data-virtualizer], [data-virtual-scroll-root]"))}const Rt=w(()=>Tt(ge.value)),Se=w(()=>!ae.value&&(!!ue.value||(m.value||Rt.value||!Eo())&&!T.value)),_t=w(()=>Se.value||le.value),zl=w(()=>Se.value&&!le.value),Tl=w(()=>!ae.value&&!ue.value&&(Se.value||le.value||oe.value)),Rl=w(()=>T.value&&!ae.value?"ready":ue.value?"fallback":"pending"),Cn=P(!1),Ue=w(()=>Sn(i.node.code,i.node.loading===!0)),Dt=w(()=>m.value?i.node.diff===!0?i.node:ye(_({},i.node),{diff:!0}):Ue.value===i.node.code?i.node:ye(_({},i.node),{code:Ue.value})),ie=P(typeof((M=i.monacoOptions)==null?void 0:M.fontSize)=="number"?i.monacoOptions.fontSize:Number.NaN),z=P(ie.value),Vn=P(null),xn=P(null),_l=w(()=>{const e=ie.value,n=z.value;return typeof e=="number"&&Number.isFinite(e)&&e>0&&typeof n=="number"&&Number.isFinite(n)&&n>0}),Gn=w(()=>{var e;const n=Vn.value;if(typeof n=="number"&&Number.isFinite(n)&&n>0)return n;const t=(e=i.monacoOptions)==null?void 0:e.fontSize;if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t;const l=z.value;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:12}),Wt=w(()=>{var e;const n=xn.value;if(typeof n=="number"&&Number.isFinite(n)&&n>0)return n;const t=(e=i.monacoOptions)==null?void 0:e.lineHeight;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:Gn.value===12?18:Math.max(12,Math.round(1.5*Gn.value))}),Jn=w(()=>Wt.value);function At(e){const n=String(e??"");return n?Math.max(1,n.split(/\r\n|\n|\r/).length):1}function It(e){return e.startsWith("-")&&!e.startsWith("---")}function qt(e){return e.startsWith("+")&&!e.startsWith("+++")}function jt(e){var n;const t=e.some(o=>It(o)),l=e.some(o=>qt(o));return t&&l||bn(i.node.language)&&(t||l)||bn(mt(String((n=i.node.raw)!=null?n:"")))&&(t||l)}const Dl=w(()=>kn.value?(function(){var e,n,t;const l=String((e=i.node.code)!=null?e:"").split(/\r\n|\n|\r/);if(jt(l))return Math.max(1,l.length);const o=String((n=i.node.originalCode)!=null?n:"").split(/\r\n|\n|\r/),a=String((t=i.node.updatedCode)!=null?t:"").split(/\r\n|\n|\r/);let r=0,u=o.length-1,s=a.length-1;for(;r<=u&&r<=s&&o[r]===a[r];)r++;let c=0;for(;u>=r&&s>=r&&o[u]===a[s];)c++,u--,s--;const d=Math.max(0,u-r+1),f=Math.max(0,s-r+1);return Math.max(1,r+d+f+c)})():(function(){var e;const n=String((e=i.node.code)!=null?e:"").split(/\r\n|\n|\r/);if(!jt(n)&&(i.node.originalCode!=null||i.node.updatedCode!=null))return Math.max(At(i.node.originalCode),At(i.node.updatedCode));let t=0,l=0;for(const o of n)It(o)?t++:(qt(o)||t++,l++);return Math.max(1,t,l)})()),Wl=w(()=>{var e;const n=(e=i.monacoOptions)==null?void 0:e.tabSize;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:4}),Kn=w(()=>{var e;const n=(e=i.monacoOptions)==null?void 0:e.padding;return{top:typeof n?.top=="number"&&Number.isFinite(n.top)&&n.top>0?n.top:0,bottom:typeof n?.bottom=="number"&&Number.isFinite(n.bottom)&&n.bottom>0?n.bottom:0}}),Mn=w(()=>{const e=i.estimatedContentHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null});function Pn(e){if(e==null)return null;const n=Math.ceil(e);return!Number.isFinite(n)||n<=0?null:Math.min(n,Math.ceil(Je()))}const un=w(()=>m.value?Math.ceil(Dl.value*Jn.value):Mn.value!=null?null:Math.ceil((e=>{const n=String(e??"");return n?Math.max(1,n.split(/\r\n|\n|\r/).length):1})(Ue.value)*(Wt.value+$n)+1)),Yn=w(()=>{if(m.value){const n=un.value,t=et();return Pn(t!=null&&n!=null?Math.max(n,t):t??n)}const e=Mn.value;return Pn(e??un.value)}),Al=w(()=>{const e=i.estimatedHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}),Qn=P(null),Xn=P(null);function Me(){const e=Qn.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}function Zn(){return m.value&&i.stream!==!1&&(i.loading!==!1||Se.value||le.value||oe.value)}function et(){if(!Zn())return null;const e=Xn.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}function Ut(e){if(!Zn()||e==null)return;const n=Math.min(Math.ceil(e),Math.ceil(Je()));if(!Number.isFinite(n)||n<=0)return;const t=et();Xn.value=t==null?n:Math.max(t,n)}const nt=w(()=>{const e=Me();return e??(Se.value||!T.value?Yn.value:null)}),Il=w(()=>{var e;const n=(e=i.monacoOptions)==null?void 0:e.fontFamily,t=Pn(Mn.value),l=Pn(un.value),o=_(_({fontSize:`${Gn.value}px`,lineHeight:`${Jn.value}px`,tabSize:Wl.value,boxSizing:"border-box",maxHeight:`${Je()}px`,overflow:"auto",paddingTop:`${Kn.value.top}px`,paddingBottom:`${Kn.value.bottom}px`},m.value?(function(a){if(a==null)return{};const r=Math.ceil(a),u=Math.ceil(Je()),s=Math.min(r,u);return r>=u?{height:`${s}px`,minHeight:`${s}px`}:{minHeight:`${r}px`}})(Yn.value):t!=null?{height:`${t}px`,minHeight:`${t}px`}:l!=null?{minHeight:`${l}px`}:{}),typeof n=="string"&&n.trim()?{"--markstream-code-font-family":n.trim()}:{});return o["--markstream-pre-line-number-top"]=`${Kn.value.top}px`,o["--markstream-code-padding-left"]="62px",o["--markstream-pre-line-number-width"]="36px",o["--markstream-pre-line-number-gap"]="0px",m.value&&(o["--markstream-pre-diff-line-height"]=`${Jn.value}px`,o["--markstream-pre-diff-pane-bottom-padding"]="10px"),o}),Vt=w(()=>nt.value!=null&&(!T.value||Me()!=null)),ql=w(()=>{const e=nt.value;if(e==null)return null;if(m.value)return Math.ceil(e);const n=Al.value,t=Mn.value;if(n==null||t==null)return Math.ceil(e);const l=Math.max(0,Math.ceil(n)-Math.ceil(t));return Math.ceil(e+l)}),jl=w(()=>{if(m.value&&Se.value)return;const e=nt.value;return Vt.value&&e!=null?{minHeight:`${e}px`}:void 0});function tt(){rn!=null&&typeof window<"u"&&window.clearTimeout(rn),rn=null}function Gt(){if(!m.value||!I.value||!T.value||le.value||oe.value)return!1;const e=S.value;return!!e&&el(e)}function Jt(e,n=!1,t={}){const l=Math.ceil(e),o=Me();if(o==null)return l;const a=t.allowBelowEstimatedFloor===!0||Gt();return l>=o||a?((n||a)&&I.value&&(Qn.value=null),l):o}function pe(){return new Promise(e=>{Z(()=>e())})}function Kt(){try{const e=S.value;if(!e)return null;const n=e.querySelector(".view-lines .view-line");if(n){const t=Math.ceil(n.getBoundingClientRect().height);if(t>0)return t}}catch{}return null}function lt(){var e,n,t,l,o;try{const a=m.value?(t=(n=(e=W())==null?void 0:e.getModifiedEditor)==null?void 0:n.call(e))!=null?t:W():te(),r=en(),u=(l=r?.EditorOption)==null?void 0:l.fontInfo;if(a&&u!=null){const s=(o=a.getOption)==null?void 0:o.call(a,u),c=s?.fontSize;if(typeof c=="number"&&Number.isFinite(c)&&c>0)return c}}catch{}try{const a=S.value;if(a){const r=a.querySelector(".view-lines .view-line");if(r)try{if(typeof window<"u"&&typeof window.getComputedStyle=="function"){const u=window.getComputedStyle(r).fontSize,s=u&&u.match(/^(\d+(?:\.\d+)?)/);if(s)return Number.parseFloat(s[1])}}catch{}}}catch{}return null}function Ve(e){var n,t;try{const a=en(),r=(n=a?.EditorOption)==null?void 0:n.lineHeight;if(r!=null){const u=(t=e?.getOption)==null?void 0:t.call(e,r);if(typeof u=="number"&&u>0)return u}}catch{}const l=Kt();if(l&&l>0)return l;const o=Number.isFinite(z.value)&&z.value>0?z.value:14;return Math.max(12,Math.round(1.35*o))}function Yt(e){var n,t,l;try{const u=en(),s=(n=u?.EditorOption)==null?void 0:n.padding;if(s!=null){const c=(t=e?.getOption)==null?void 0:t.call(e,s),d=typeof c?.top=="number"?c.top:0,f=typeof c?.bottom=="number"?c.bottom:0;if(d>0||f>0)return d+f}}catch{}const o=(l=Q.value)==null?void 0:l.padding,a=typeof o?.top=="number"?o.top:0,r=typeof o?.bottom=="number"?o.bottom:0;return a>0||r>0?a+r:m.value?24:0}function Qt(e,n){return typeof e!="number"||typeof n!="number"||e<1||n<e?0:n-e+1}function Xt(e){if(!e)return[];const n=e.split(/\r?\n/);return n.length===1&&n[0]===""?[]:n}function ot(){var e,n;m.value?$e.value=(function(t,l){const o=Xt(t),a=Xt(l);let r=0,u=o.length-1,s=a.length-1;for(;r<=u&&r<=s&&o[r]===a[r];)r++;for(;u>=r&&s>=r&&o[u]===a[s];)u--,s--;return{removed:Math.max(0,u-r+1),added:Math.max(0,s-r+1)}})(String((e=i.node.originalCode)!=null?e:""),String((n=i.node.updatedCode)!=null?n:"")):$e.value={removed:0,added:0}}function He(){var e;if(m.value)try{const n=W(),t=(e=n?.getLineChanges)==null?void 0:e.call(n);if(!Array.isArray(t))return void ot();let l=0,o=0;for(const a of t)l+=Qt(a.originalStartLineNumber,a.originalEndLineNumber),o+=Qt(a.modifiedStartLineNumber,a.modifiedEndLineNumber);$e.value={removed:l,added:o}}catch{ot()}else $e.value={removed:0,added:0}}function it(){var e;if(Number.isFinite(z.value)&&z.value>0&&Number.isFinite(ie.value))return z.value;const n=lt();return typeof((e=i.monacoOptions)==null?void 0:e.fontSize)=="number"?(ie.value=i.monacoOptions.fontSize,z.value=i.monacoOptions.fontSize,z.value):n&&n>0?(ie.value=n,z.value=n,n):(ie.value=12,z.value=12,12)}function Ul(){const e=it(),n=Math.min(36,e+1);z.value=n}function Vl(){const e=it(),n=Math.max(10,e-1);z.value=n}function Gl(){it(),Number.isFinite(ie.value)&&(z.value=ie.value)}function Zt(){var e,n,t,l,o,a,r,u,s,c,d,f,y,g;try{const p=m.value?W():null,v=m.value?p:te();if(!v)return null;if(p?.getOriginalEditor&&p?.getModifiedEditor){const E=(e=p.getOriginalEditor)==null?void 0:e.call(p),O=(n=p.getModifiedEditor)==null?void 0:n.call(p);(t=E?.layout)==null||t.call(E),(l=O?.layout)==null||l.call(O);const C=((o=E?.getContentHeight)==null?void 0:o.call(E))||0,U=((a=O?.getContentHeight)==null?void 0:a.call(O))||0,N=Math.max(C,U);if(N>0)return Math.ceil(N+1);const D=((s=(u=(r=E?.getModel)==null?void 0:r.call(E))==null?void 0:u.getLineCount)==null?void 0:s.call(u))||1,R=((f=(d=(c=O?.getModel)==null?void 0:c.call(O))==null?void 0:d.getLineCount)==null?void 0:f.call(d))||1,se=Math.max(D,R),wt=Math.max(Ve(E),Ve(O));return Math.ceil(se*(wt+$n)+0+1)}if(v?.getContentHeight){(y=v?.layout)==null||y.call(v);const E=v.getContentHeight();if(E>0)return Math.ceil(E+1)}const h=(g=v?.getModel)==null?void 0:g.call(v);let b=1;h&&typeof h.getLineCount=="function"&&(b=h.getLineCount());const $=Ve(v);return Math.ceil(b*($+$n)+0+1)}catch{return null}}function el(e){if(typeof window>"u")return!1;const n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return!1;const t=e.querySelectorAll(".editor.modified .diff-hidden-lines .center, .stream-monaco-diff-unchanged-bridge");for(const l of Array.from(t)){if(!(l instanceof HTMLElement))continue;const o=window.getComputedStyle(l);if(o.display==="none"||o.visibility==="hidden"||Number.parseFloat(o.opacity||"1")<=.01)continue;const a=l.getBoundingClientRect();if(!(a.width<=0||a.height<=0||a.bottom<=n.top||a.top>=n.bottom))return!0}return!1}function rt(e){var n;const t=String(e??"").trim(),l=(n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i))==null?void 0:n[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=t.match(/\d+(?:\.\d+)?/g);if(!o||o.length<3)return null;const[a,r,u]=o.slice(0,3).map(Number);return .2126*a+.7152*r+.0722*u}function nl(){var e;const n=(e=S.value)==null?void 0:e.parentElement;return n instanceof HTMLElement?n:null}function sn(e,n){var t;n==null||!Number.isFinite(n)||n<=0||(t=nl())==null||t.style.setProperty(e,`${n}px`)}function Bn(){var e,n,t;if(tl())return;const l=lt();l&&l>0&&(Vn.value=l,z.value=l,ie.value=l);try{const o=Ve(m.value?(t=(n=(e=W())==null?void 0:e.getModifiedEditor)==null?void 0:n.call(e))!=null?t:W():te());o&&o>0&&(xn.value=o)}catch{}try{const o=Kt();o&&o>0&&(xn.value=o)}catch{}}function tl(){return m.value&&_t.value}function dn(){var e;if(!m.value||!Se.value&&!le.value&&!oe.value)return null;const n=S.value,t=(e=ge.value)==null?void 0:e.querySelector("pre.code-pre-fallback");if(!n||!t)return null;const l=Math.ceil(t.getBoundingClientRect().height);return!Number.isFinite(l)||l<=0?null:(n.style.height=`${l}px`,n.style.minHeight=`${l}px`,n.style.maxHeight=`${Math.ceil(Je())}px`,n.style.overflow="hidden",l)}function at(){var e,n,t,l,o,a,r,u;const s=S.value,c=ge.value;if(!s||!c)return;const d=s,f=s.querySelector(".monaco-editor")||s,y=f.querySelector(".monaco-editor-background")||f,g=f.querySelector(".view-lines")||f;let p=null,v=null,h=null;try{typeof window<"u"&&typeof window.getComputedStyle=="function"&&(p=window.getComputedStyle(f),v=y===f?p:window.getComputedStyle(y),h=g===f?p:window.getComputedStyle(g))}catch{p=null,v=null,h=null}const b=String((e=p?.getPropertyValue("--vscode-editor-foreground"))!=null?e:"").trim(),$=String((n=p?.getPropertyValue("--vscode-editor-background"))!=null?n:"").trim(),E=String((l=(t=p?.getPropertyValue("--vscode-editor-selectionBackground"))!=null?t:p?.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?l:"").trim(),O=b||String((a=(o=h?.color)!=null?o:p?.color)!=null?a:"").trim(),C=$||String((u=(r=v?.backgroundColor)!=null?r:p?.backgroundColor)!=null?u:"").trim();return m.value?(O?(c.style.setProperty("--markstream-diff-editor-fg",O),d.style.setProperty("--vscode-editor-foreground",O),d.style.setProperty("--stream-monaco-editor-fg",O)):(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(E?d.style.setProperty("--vscode-editor-selectionBackground",E):d.style.removeProperty("--vscode-editor-selectionBackground"))):(function(U,N,D){if(!Lt.value)return!1;const R=rt(U),se=rt(N);return D?R!=null&&R>170||se!=null&&se<110:R!=null&&R<85||se!=null&&se>190})(C,O,c.classList.contains("is-dark"))?(d.style.removeProperty("--vscode-editor-foreground"),d.style.removeProperty("--vscode-editor-background"),void d.style.removeProperty("--vscode-editor-selectionBackground")):(O&&d.style.setProperty("--vscode-editor-foreground",O),C&&d.style.setProperty("--vscode-editor-background",C),void(E&&d.style.setProperty("--vscode-editor-selectionBackground",E)))}let ut=0,st=0;const ll=/auto|scroll|overlay/i;function he(e,n,t){var l;if(typeof window>"u"||m.value||(function(d){return Rt.value||Tt(d)})(e))return;const o=Math.ceil(n),a=Math.ceil(t)-o;if(Math.abs(a)<=1)return;const r=(function(d){var f,y;if(typeof window>"u")return null;const g=(f=d?.ownerDocument)!=null?f:document,p=g.scrollingElement||g.documentElement||g.body;let v=(y=d?.parentElement)!=null?y:null;for(;v&&v!==g.body&&v!==p;){const h=window.getComputedStyle(v),b=(h.overflowY||"").toLowerCase(),$=(h.overflow||"").toLowerCase();if(ll.test(b)||ll.test($))return v;v=v.parentElement}return p})(e);if(!r)return;const u=(l=e.ownerDocument)!=null?l:document,s=r===u.body||r===u.documentElement||r===u.scrollingElement,c=s?0:r.getBoundingClientRect().top;e.getBoundingClientRect().top-c>=0||(s&&typeof window.scrollBy=="function"?window.scrollBy(0,a):r.scrollTop+=a)}function dt(){try{const e=S.value;if(!e)return;const n=e.getBoundingClientRect().height,t=Zt();if(t!=null&&t>0){const o=Jt(t,!0),a=Me();return e.style.minHeight=a!=null?`${a}px`:"0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",void he(e,n,o)}const l=Me();l!=null&&(e.style.minHeight=`${l}px`,e.style.height=`${l}px`,e.style.maxHeight="none",e.style.overflow="visible",he(e,n,l))}catch{}}function Ge(){for(var e,n;Ie.length>0;)try{(n=(e=Ie.pop())==null?void 0:e.dispose)==null||n.call(e)}catch{}We!=null&&(Oo(We),We=null)}function Pe(){for(var e;Wn.length>0;)try{(e=Wn.pop())==null||e()}catch{}}function J(e=!1){Ce.value||(ve.value?dt():(function(){var n;try{const t=S.value;if(!t)return;const l=t.getBoundingClientRect().height,o=Je(),a=Math.ceil(((n=t.getBoundingClientRect)==null?void 0:n.call(t).height)||0),r=m.value?(function(){var v,h,b,$,E,O,C,U;try{const N=W(),D=(v=N?.getOriginalEditor)==null?void 0:v.call(N),R=(h=N?.getModifiedEditor)==null?void 0:h.call(N);if(!D||!R)return null;const se=((E=($=(b=D.getModel)==null?void 0:b.call(D))==null?void 0:$.getLineCount)==null?void 0:E.call($))||1,wt=((U=(C=(O=R.getModel)==null?void 0:O.call(R))==null?void 0:C.getLineCount)==null?void 0:U.call(C))||1,oo=Math.max(se,wt),io=Math.max(Ve(D),Ve(R)),ro=Math.max(Yt(D),Yt(R));return Math.ceil(oo*(io+$n)+ro+0+1)}catch{return null}})():null,u=m.value&&el(t),s=u&&I.value&&T.value&&!le.value&&!oe.value;if(u||(Fe.value=null),Tn>0&&(Tn--,Le.value!=null))return void he(t,l,Be(t,Le.value,o,{allowBelowEstimatedFloor:s}));if(m.value&&(Se.value||le.value||oe.value)){const v=dn();if(v!=null){const h=Be(t,v,o,{allowBelowEstimatedFloor:!0});return cn(!0),void he(t,l,h)}}const c=m.value?(function(v){var h,b;if(typeof window>"u")return null;try{const $=v.getBoundingClientRect(),E=window.getComputedStyle(v);if(E.display==="none"||E.visibility==="hidden")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 C=0;for(const D of Array.from(v.querySelectorAll(O.join(",")))){if(!(D instanceof HTMLElement))continue;const R=window.getComputedStyle(D);if(R.display==="none"||R.visibility==="hidden"||Number.parseFloat(R.opacity||"1")<=.01)continue;const se=D.getBoundingClientRect();se.height<=0||se.bottom<=$.top||(C=Math.max(C,se.bottom-$.top))}if(C>0)return Math.ceil(C);const U=v.querySelector(".monaco-diff-editor"),N=(b=(h=U?.getBoundingClientRect)==null?void 0:h.call(U).height)!=null?b:0;return N>0?Math.ceil(N+1):null}catch{return null}})(t):null,d=m.value&&kn.value&&!u&&c!=null?Math.ceil(c+10):c;let f;if(f=m.value?u?c:kn.value&&d!=null?d:r!=null?Math.max(d??0,r):d:Zt(),f!=null&&f>0){const v=Fe.value!=null&&Date.now()<hn&&f>=o-1,h=u&&a>0&&a<o-1&&f>=o-1,b=Be(t,v?Fe.value:h?a:f,o,{clearEstimatedFloor:!0,allowBelowEstimatedFloor:s});return u&&b<o-1&&(Fe.value=b,hn=Date.now()+160),void he(t,l,b)}if(Le.value!=null)return void he(t,l,Be(t,Le.value,o,{allowBelowEstimatedFloor:s}));const y=u?a:Math.max(a,r!=null&&r>0?r:0);if(y>0){const v=Fe.value!=null&&Date.now()<hn&&y>=o-1,h=u&&a>0&&a<o-1&&y>=o-1,b=Be(t,v?Fe.value:h?a:y,o,{allowBelowEstimatedFloor:s});return u&&b<o-1&&(Fe.value=b,hn=Date.now()+160),void he(t,l,b)}const g=Me();if(g!=null)return void he(t,l,Be(t,g,o,{allowBelowEstimatedFloor:s}));const p=Number.parseFloat(t.style.height);!Number.isNaN(p)&&p>0?he(t,l,Be(t,p,o,{allowBelowEstimatedFloor:s})):m.value||he(t,l,Be(t,o,o))}catch{}})())}function ol(){ut=0,st=0}function cn(e=!1){var n,t,l;const o=S.value;if(!o)return;const a=m.value?W():te();if(a&&typeof a.layout=="function")try{const r=(n=o.getBoundingClientRect)==null?void 0:n.call(o),u=Math.ceil(((t=r?.width)!=null?t:0)||o.clientWidth||0),s=Math.ceil(((l=r?.height)!=null?l:0)||o.clientHeight||Number.parseFloat(o.style.height||"")||0);if(u>0&&s>0){if(!e&&u===ut&&s===st)return;ut=u,st=s,a.layout({width:u,height:s})}else ol(),a.layout()}catch{}}function re(){if(!m.value)return void Pe();const e=S.value;if(!e)return void Pe();const n=e.querySelector(".monaco-diff-editor");if(!n||n.classList.contains("side-by-side"))return void Pe();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 a=0;a<o;a++){const r=l[a],u=r.querySelector("a"),s=r.querySelector(".center > div:first-child"),c=r.querySelector(".center");if(!u||!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 f=u.getAttribute("title")||"Show Unchanged Region";d.title=f,d.setAttribute("aria-label",f);const y=v=>{v.preventDefault(),v.stopPropagation()},g=v=>{v.preventDefault(),v.stopPropagation(),u.click(),Z(()=>X())},p=v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.stopPropagation(),u.click(),Z(()=>X()))};d.addEventListener("mousedown",y),d.addEventListener("click",g),d.addEventListener("keydown",p),c.appendChild(d),Wn.push(()=>{d.removeEventListener("mousedown",y),d.removeEventListener("click",g),d.removeEventListener("keydown",p),d.parentElement===c&&c.removeChild(d)})}}function X(e=!1){We==null&&(We=Z(()=>{We=null,Z(()=>{re(),J(e),cn()})}))}function Be(e,n,t,l={}){Ut(n);const o=et(),a=o!=null?Math.max(n,o):n,r=Math.min(a,t),u=l.allowBelowEstimatedFloor===!0||Gt(),s=Jt(r,l.clearEstimatedFloor===!0,{allowBelowEstimatedFloor:u}),c=Me();if(e.style.minHeight=c==null||u?"0px":`${Math.min(c,Math.ceil(t))}px`,e.style.height=`${s}px`,e.style.maxHeight=`${Math.ceil(t)}px`,m.value)e.style.overflow="hidden";else{const d=a>t+1;e.style.overflow=d?"auto":"hidden"}return s}function il(e=S.value){return!!e?.querySelector(".monaco-diff-editor .view-lines .view-line")}function Jl(){const e=W();return typeof e?.getOriginalEditor=="function"||typeof e?.getModifiedEditor=="function"||typeof e?.getLineChanges=="function"}function rl(e,n,t){return H(this,null,function*(){try{return void(yield wn(e,n,t))}catch(l){if(!on(l))throw l}if(yield V(),yield pe(),!F&&m.value)try{yield wn(e,n,t)}catch(l){if(!on(l))throw l}})}function Je(){var e,n;const t=(n=(e=i.monacoOptions)==null?void 0:e.MAX_HEIGHT)!=null?n:500;if(typeof t=="number")return t;const l=String(t).match(/^(\d+(?:\.\d+)?)/);return l?Number.parseFloat(l[1]):500}const ct=w(()=>i.isShowPreview&&(ce.value==="html"||ce.value==="svg"));function ft(){return typeof i.node.loading=="boolean"?i.node.loading:i.loading===!0}function al(e,n,t){return t&&!String(n??"")?"plain":wl(String(e??""))}function En(){var e,n,t,l;return!(!ft()||(m.value?String((e=i.node.originalCode)!=null?e:"")||String((n=i.node.updatedCode)!=null?n:"")||String((t=i.node.code)!=null?t:""):String((l=i.node.code)!=null?l:"")))}q(()=>[i.node.language,i.node.code,i.node.loading,i.loading],([e,n,t,l])=>{ce.value=al(e,n,typeof t=="boolean"?t:l===!0)}),q(()=>[i.node.originalCode,i.node.updatedCode,m.value],()=>{ot(),Z(()=>He())},{immediate:!0}),q(()=>[m.value,i.stream,i.loading,Se.value,le.value,oe.value,un.value],()=>{Zn()?Ut(un.value):Xn.value=null},{immediate:!0}),q(()=>[i.node.originalCode,i.node.updatedCode,fe.value,m.value],e=>H(null,[e],function*([,,,n]){var t,l;if(i.stream===!1||!n)return;if(G&&!j.value&&S.value)try{yield Ee(S.value)}catch{}const o=nn;if(o&&!me.value){try{yield o}catch{}if(F||!m.value)return}const a=In(String((t=i.node.originalCode)!=null?t:""),String((l=i.node.updatedCode)!=null?l:"")),r=i.loading===!1;r&&Te();try{yield rl(a.original,a.updated,fe.value),cn(!0)}catch{return}if(r){if(F||!m.value)return;qe(),re(),He(),X()}ve.value&&Z(()=>dt())})),q(()=>i.node.code,e=>H(null,null,function*(){if(i.stream===!1||(ce.value||(ce.value=wl(Ft(e))),m.value))return;const n=nn;if(n&&!me.value){try{yield n}catch{}if(F||m.value)return}if(G&&!j.value&&S.value)try{yield Ee(S.value)}catch{}gn(Sn(i.node.code,i.node.loading===!0),fe.value),ve.value&&Z(()=>dt())}));const vt=w(()=>{const e=ce.value;return e?kl[e]||e.charAt(0).toUpperCase()+e.slice(1):kl[""]});function mt(e){var n,t;const l=(t=(n=String(e??"").split(/\r?\n/,1)[0])==null?void 0:n.trim())!=null?t:"";if(l.length<3)return"";const o=l[0];if(o!=="`"&&o!=="~"||l[1]!==o||l[2]!==o)return"";let a=3;for(;l[a]===o;)a+=1;return l.slice(a).trim()}const ul=w(()=>{var e;return(function(n){const t=mt(n);if(!t)return"";const l=t.split(/\s+/).filter(Boolean);if(!l.length)return"";const o=l[0]==="diff"?l.slice(1):l;for(const a of o){const r=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(r&&/[./\\-]/.test(r))return r}return""})(String((e=i.node.raw)!=null?e:""))}),Kl=w(()=>ul.value||vt.value),sl=w(()=>ul.value?m.value?`Diff / ${vt.value}`:vt.value:""),Yl=w(()=>(bo.value,So(ce.value||""))),Ql=w(()=>{const e={},n=o=>{if(o!=null)return typeof o=="number"?`${o}px`:String(o)},t=n(i.minWidth),l=n(i.maxWidth);if(t&&(e.minWidth=t),l&&(e.maxWidth=l),Vt.value&&!m.value){const o=ql.value;o!=null&&(e.minHeight=`${o}px`)}return m.value||(e.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",e.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg))",e.borderColor="var(--markstream-code-border-color)"),e}),dl=w(()=>i.showTooltips!==!1);function Xl(){return H(this,null,function*(){try{typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(i.node.code)),zn.value=!0,de("copy",i.node.code),setTimeout(()=>{zn.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})}function Zl(e){if(ve.value=!ve.value,e&&dl.value){const l=(function(o){const a=o.currentTarget||o.target;return!a||a.disabled?null:a})(e);if(l){const o=ve.value?ne("common.collapse")||"Collapse":ne("common.expand")||"Expand";ko(l,o,"top",!1,void 0,i.isDark)}}const n=m.value?W():te(),t=S.value;n&&t&&(ve.value?(On(!0),t.style.maxHeight="none",t.style.overflow="visible",J(!0)):(On(!1),t.style.overflow=m.value?"hidden":"auto",J(!0)))}function eo(){var e,n,t;if(Ce.value=!Ce.value,Ce.value){if(S.value){const l=Math.ceil(((n=(e=S.value).getBoundingClientRect)==null?void 0:n.call(e).height)||0);l>0&&(Le.value=l)}On(!1)}else{ve.value&&On(!0),S.value&&Le.value!=null&&(S.value.style.height=`${Le.value}px`);const l=m.value?W():te();try{(t=l?.layout)==null||t.call(l)}catch{}Tn=2,Z(()=>{J(!0)})}}function no(){if(!ct.value)return;const e=ce.value;if(ke.value){const n=e==="html"?"text/html":"image/svg+xml",t=e==="html"?ne("artifacts.htmlPreviewTitle")||"HTML Preview":ne("artifacts.svgPreviewTitle")||"SVG Preview";return void de("previewCode",{node:i.node,artifactType:n,artifactTitle:t,id:`temp-${e}-${Date.now()}`})}e==="html"&&(Cn.value=!Cn.value)}function On(e){var n,t;try{if(m.value){const l=W();(n=l?.updateOptions)==null||n.call(l,{automaticLayout:e})}else{const l=te();(t=l?.updateOptions)==null||t.call(l,{automaticLayout:e})}}catch{}}function Ee(e,n={}){if(!G||F||i.stream===!1&&i.loading!==!1||(gt(),yl())||ae.value||S.value!==e||En())return null;if(we)return we;if(j.value&&I.value)return Promise.resolve();const t=yt(),l=jn.value;let o=!1;j.value=!0,(function(){const r=B.value;K&&r&&xe!==r&&(xe&&K.markSettled(xe),xe=r,K.markPending(r))})();const a=H(null,null,function*(){try{yield(function(r){return H(this,null,function*(){var u;if(typeof window>"u")return yield r();const s=(u=window.Element)==null?void 0:u.prototype,c=s?.addEventListener;if(!s||!c)return yield r();const d=(function(){const f=window,y=f[Pl];if(y)return y;const g={depth:0,original:null};return f[Pl]=g,g})();try{d.depth===0&&(d.original=c,s.addEventListener=function(f,y,g){var p;const v=(p=d.original)!=null?p:c;return f==="touchstart"&&(function(h,b){if(!h)return!1;const $=h;return!(typeof $.closest!="function"||!$.closest(".monaco-editor, .monaco-diff-editor")||b&&typeof b=="object"&&"passive"in b)})(this,g)?v.call(this,f,y,(function(h){return h==null?{passive:!0}:typeof h=="boolean"?{capture:h,passive:!0}:typeof h=="object"?"passive"in h?h:ye(_({},h),{passive:!0}):{passive:!0}})(g)):v.call(this,f,y,g)}),d.depth++}catch{return yield r()}try{return yield r()}finally{d.depth=Math.max(0,d.depth-1),d.depth===0&&d.original&&s.addEventListener!==d.original&&(s.addEventListener=d.original,d.original=null)}})})(()=>(function(r){return H(this,null,function*(){var u;if(!G||F||(ue.value=!1,Ne.value=null,me.value=!1,T.value=!1,le.value=!1,oe.value=!1,tt(),Vn.value=null,xn.value=null,(function(){const f=nl();f&&(f.style.removeProperty("--stream-monaco-line-number-left"),f.style.removeProperty("--stream-monaco-line-number-width"),f.style.removeProperty("--stream-monaco-line-number-gap-to-code"),f.style.removeProperty("--stream-monaco-original-line-number-gap-to-code"),f.style.removeProperty("--stream-monaco-modified-line-number-gap-to-code"),f.style.removeProperty("--stream-monaco-original-scrollable-left"),f.style.removeProperty("--stream-monaco-modified-scrollable-left"))})(),ol(),(function(){const f=Yn.value;Qn.value=I.value||f==null?null:f})(),Ge(),Pe(),(function(f){f.replaceChildren()})(r),Te(),F))return;const s=H(null,null,function*(){var f,y;if(m.value){(function(){if($t||typeof window>"u")return;$t=!0;const p=v=>{var h;on("reason"in v?v.reason:(h=v.error)!=null?h:v.message)&&(v.preventDefault(),v.stopImmediatePropagation())};window.addEventListener("error",p,!0),window.addEventListener("unhandledrejection",p,!0)})(),Ae();const g=In(String((f=i.node.originalCode)!=null?f:""),String((y=i.node.updatedCode)!=null?y:""));yn?yield yn(r,g.original,g.updated,fe.value):yield G(r,i.node.code,fe.value)}else yield G(r,Ue.value,fe.value);me.value=!0}),c=s.finally(()=>{nn===c&&(nn=null)});if(nn=c,yield(function(f){return H(this,null,function*(){if(!m.value)return void(yield f);let y,g=!1;for(f.then(()=>{g=!0},p=>{g=!0,y=p});;){if(F)return;if(g){if(y)throw y;return}if(il()&&Jl())return;yield V(),yield pe()}})})(c),F)return;me.value=!0;const d=m.value?W():te();if(typeof((u=i.monacoOptions)==null?void 0:u.fontSize)=="number")d?.updateOptions({fontSize:i.monacoOptions.fontSize,automaticLayout:!1}),ie.value=i.monacoOptions.fontSize,z.value=i.monacoOptions.fontSize;else if(!tl()){const f=lt();f&&f>0?(ie.value=f,z.value=f):(ie.value=12,z.value=12)}Bn(),ve.value||Ce.value||J(!1),yield(function(){return H(this,null,function*(){Me()!=null&&(re(),J(!1),yield V(),yield pe(),re(),J(!1),yield pe(),re(),J(!1))})})(),F||(I.value=!0,(function(){var f,y,g,p,v;if(Ge(),m.value){const b=W(),$=(f=b?.getOriginalEditor)==null?void 0:f.call(b),E=(y=b?.getModifiedEditor)==null?void 0:y.call(b),O=(C,U)=>{try{const N=C?.[U];if(typeof N!="function")return;const D=N.call(C,()=>X());D&&Ie.push(D)}catch{}};try{const C=(g=b?.onDidUpdateDiff)==null?void 0:g.call(b,()=>{X(),Z(()=>He())});C&&Ie.push(C)}catch{}return O($,"onDidContentSizeChange"),O(E,"onDidContentSizeChange"),O($,"onDidLayoutChange"),void O(E,"onDidLayoutChange")}const h=te();try{const b=(p=h?.onDidContentSizeChange)==null?void 0:p.call(h,()=>X());b&&Ie.push(b)}catch{}try{const b=(v=h?.onDidLayoutChange)==null?void 0:v.call(h,()=>X());b&&Ie.push(b)}catch{}})(),at(),Bn(),re(),He(),X(),yield(function(){return H(this,null,function*(){re(),J(!1),yield V(),yield pe(),re(),J(!1),yield pe(),re(),J(!1)})})(),yield(function(){return H(this,null,function*(){var f;if(m.value){for(let y=0;y<8;y++){if(F)return;const g=S.value,p=W();let v=!1;try{const $=(f=p?.getLineChanges)==null?void 0:f.call(p);v=Array.isArray($)}catch{v=!1}const h=!!g?.querySelector(".monaco-diff-editor"),b=il(g);if(h&&b&&v){if(yield V(),yield pe(),F)return;try{qe(),re(),He(),X()}catch{}return}if(y>=1&&!h)return;yield V(),yield pe()}if(!F)try{qe(),re(),He(),X()}catch{}}})})(),F||(Bn(),(function(){if(!m.value)return;const f=S.value;if(!f)return;const y=f.querySelector(".monaco-diff-editor");function g(p,v,h,b){const $=p.querySelector(v);if(!$)return;const E=$.getBoundingClientRect();if(E.width<=0)return;const O=$.querySelector(".line-numbers"),C=$.querySelector(".view-lines .view-line"),U=$.querySelector(".margin");let N=null;if(C?(N=C.getBoundingClientRect().left-E.left,sn(h,N)):U&&(N=U.getBoundingClientRect().width,sn(h,N)),O){const D=O.getBoundingClientRect();if(D.width>=20&&D.width<=64&&sn("--stream-monaco-line-number-width",D.width),N!=null){const R=N-(D.right-E.left);Number.isFinite(R)&&R>=0&&R<=32&&(sn(b,R),sn("--stream-monaco-line-number-gap-to-code",R))}}}y&&(g(y,".editor.original","--stream-monaco-original-scrollable-left","--stream-monaco-original-line-number-gap-to-code"),g(y,".editor.modified","--stream-monaco-modified-scrollable-left","--stream-monaco-modified-line-number-gap-to-code"))})(),yield V(),dn(),yield pe(),yield(function(){return H(this,null,function*(){if(m.value){if(dn(),le.value=!0,oe.value=!1,T.value=!0,yield V(),dn(),yield pe(),dn(),!F){if(cn(!0),oe.value=!0,tt(),typeof window>"u")return le.value=!1,void(oe.value=!1);rn=window.setTimeout(()=>{rn=null,le.value=!1,oe.value=!1,Z(()=>{Bn(),re(),X()})},120)}}else T.value=!0})})()))})})(e)),an=null}catch(r){const u=yt(),s=l!==jn.value,c=n.allowStaleContentRetry!==!1&&s&&an!==u;if(t!==u||c)return c&&(an=u),o=!0,j.value=!1,I.value=!1,me.value=!1,void(T.value=!1);throw _e(t),r}}).finally(()=>{we===a&&(we=null),(function(){const r=xe;K&&r&&(xe="",V(()=>{var u,s;if(!F){const c=(s=(u=ge.value)==null?void 0:u.offsetHeight)!=null?s:0;c>0&&K.reportHeight(r,c)}K.markSettled(r)}))})(),o&&!F&&queueMicrotask(()=>{var r;const u=S.value;u&&!F&&((r=Ee(u))==null||r.catch(s=>{I.value=!1,T.value=!1,_e()}))})});return we=a,a}q(dl,e=>{e||mo()}),q(()=>z.value,(e,n)=>{const t=m.value?W():te();t&&typeof e=="number"&&Number.isFinite(e)&&e>0&&(t.updateOptions({fontSize:e}),Ce.value||J(!0))},{flush:"post",immediate:!1});let cl=0;const to=q(()=>[S.value,m.value,i.stream,i.loading,De.value,Y.value,i.node.code,i.node.loading],e=>H(null,[e],function*([n,t,l,o,a,r]){const u=++cl;if(!n||!r||je||l===!1&&o!==!1||En()||!G&&(yield(function(){return H(this,null,function*(){if(typeof window>"u"||F||De.value||ae.value)return;if(tn)return tn;const c=H(null,null,function*(){try{const d=yield Fo();if(F)return;if(!d)return void(ae.value=!0);const f=d.useMonaco,y=d.detectLanguage;if(typeof y=="function"&&(Ft=y),typeof f!="function")return;const g=Ke();if(g&&i.themes&&Array.isArray(i.themes)&&!i.themes.includes(g))throw new Error("Preferred theme not in provided themes array");be=ml();const p=f(be);G=p.createEditor||G,yn=p.createDiffEditor||yn,gn=p.updateCode||gn,wn=p.updateDiff||wn,en=p.getEditor||en,te=p.getEditorView||te,W=p.getDiffEditorView||W,Rn=p.cleanupEditor||Rn,Ae=p.safeClean||p.cleanupEditor||Ae,_n=p.refreshDiffPresentation||_n,Dn=p.setTheme||Dn,De.value=!0}catch{if(F)return;ae.value=!0}}).finally(()=>{tn===c&&(tn=null)});return tn=c,c})})(),u!==cl||i.stream===!1&&i.loading!==!1||En()||!Y.value||!G||ae.value||j.value||yl()||F||S.value!==n))return;const s=Ee(n);if(s){try{yield s}catch{I.value=!1,T.value=!1,_e()}I.value&&T.value&&to()}}));function fl(e){return!!e&&typeof e=="object"&&"light"in e&&"dark"in e}function ze(e){return typeof e=="string"?e:e&&typeof e=="object"&&"name"in e?String(e.name):null}function vl(e,n){if(e===n)return!0;const t=ze(e),l=ze(n);return!!t&&t===l}function Ke(){var e;const n=(function(){if(i.theme!==void 0){const s=i.theme;return fl(s)?i.isDark?s.dark:s.light:s}return i.isDark?i.darkTheme:i.lightTheme})(),t=(e=Q.value)==null?void 0:e.theme,l=n??t;if(l!=null&&typeof l=="object")return l;const o=Array.isArray(i.themes)?i.themes:[];if(!o.length||l==null)return l;const a=ze(l),r=o.map(s=>ze(s)).filter(s=>!!s);if(!a||r.includes(a))return l;const u=ze(t);return t!=null&&u&&r.includes(u)?t:o[0]}q(qn,(e,n)=>H(null,null,function*(){if(e===n||(Nl.value=e,!G||!S.value)||!j.value||i.stream===!1&&i.loading!==!1||!Y.value)return;const t=we;if(t){try{yield t}catch{}if(F||!S.value)return}try{I.value=!1,T.value=!1,j.value=!1,me.value=!1,Ge(),Pe(),Ae(),yield V(),yield Ee(S.value)}catch{I.value=!1,T.value=!1,_e()}}));const pt=w(()=>(i.theme!==void 0?!fl(i.theme):vl(i.darkTheme,i.lightTheme))?(function(e){var n,t;if(e&&typeof e=="object"&&((n=e.colors)!=null&&n["editor.background"])){const o=rt(e.colors["editor.background"]);if(o!=null)return o<128}const l=((t=ze(e))!=null?t:"").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})(Ke()):!!i.isDark),ht=w(()=>{var e;if(!m.value)return pt.value?"dark":"light";const n=(e=Q.value)==null?void 0:e.diffAppearance;return n==="light"||n==="dark"?n:pt.value?"dark":"light"}),lo=w(()=>m.value?ht.value==="dark":pt.value);function ml(){const e=ye(_(ye(_({wordWrap:"on",wrappingIndent:"same",themes:i.themes},Q.value||{}),{theme:Ke()}),m.value?{diffAppearance:ht.value}:{}),{onThemeChange(){at()}}),n=(function(){var t;const l=(t=Q.value)==null?void 0:t.fontFamily;return typeof l=="string"&&l.trim()?l.trim():m.value?(function(){var o;if(typeof window>"u")return;const a=(o=ge.value)==null?void 0:o.querySelector("pre.code-pre-fallback");if(a)return window.getComputedStyle(a).fontFamily.trim()||void 0})():void 0})();return n&&(e.fontFamily!=null||(e.fontFamily=n)),e}function Te(){const e=ml();if(!be)return be=e,be;for(const n of Object.keys(be))n in e||delete be[n];return Object.assign(be,e),be}const pl=w(()=>{var e,n,t,l,o,a,r,u,s,c,d,f,y,g,p;return JSON.stringify({diffLineStyle:(n=(e=Q.value)==null?void 0:e.diffLineStyle)!=null?n:"background",diffUnchangedRegionStyle:(l=(t=Q.value)==null?void 0:t.diffUnchangedRegionStyle)!=null?l:"line-info",diffHideUnchangedRegions:((o=i.monacoOptions)==null?void 0:o.diffHideUnchangedRegions)===void 0?_({},ln):An(i.monacoOptions.diffHideUnchangedRegions),renderSideBySide:(r=(a=Q.value)==null?void 0:a.renderSideBySide)==null||r,useInlineViewWhenSpaceIsLimited:(s=(u=Q.value)==null?void 0:u.useInlineViewWhenSpaceIsLimited)!=null&&s,enableSplitViewResizing:(d=(c=Q.value)==null?void 0:c.enableSplitViewResizing)==null||d,ignoreTrimWhitespace:(y=(f=Q.value)==null?void 0:f.ignoreTrimWhitespace)==null||y,originalEditable:(p=(g=Q.value)==null?void 0:g.originalEditable)!=null&&p})}),hl=P(0);function yt(){var e;const n=Ke();return JSON.stringify({kind:qn.value,language:fe.value,structural:pl.value,optionsRevision:hl.value,settledContentGeneration:zt.value,theme:(e=ze(n))!=null?e:n==null?null:"custom",isDark:i.isDark})}q(()=>[i.monacoOptions,i.theme,i.themes,i.lightTheme,i.darkTheme],()=>{hl.value+=1},{deep:!0}),q(()=>[Ue.value,i.node.originalCode,i.node.updatedCode],()=>{jn.value+=1,ft()||(zt.value+=1)});const Re=w(()=>yt());function gt(){ue.value&&Ne.value!==Re.value&&(ue.value=!1,Ne.value=null,an=null,Un=null,j.value=!1,I.value=!1,me.value=!1,T.value=!1)}function yl(){return gt(),ue.value&&Ne.value===Re.value}function _e(e=Re.value){Ne.value=e,ue.value=!0}return q(Re,()=>H(null,null,function*(){if(je||!ue.value||Ne.value===Re.value||!G||!S.value||ae.value||F||!Y.value||i.stream===!1&&i.loading!==!1||En())return;const e=Re.value;je=!0;try{if(gt(),ue.value)return;yield Ee(S.value)}catch{I.value=!1,T.value=!1,_e()}finally{Un=e,yield V(),je=!1}})),q(()=>[i.monacoOptions,Y.value],()=>{var e,n;if(Te(),!G||!Y.value)return;const t=m.value?W():te(),l=typeof((e=i.monacoOptions)==null?void 0:e.fontSize)=="number"?i.monacoOptions.fontSize:Number.isFinite(z.value)?z.value:void 0;typeof l=="number"&&Number.isFinite(l)&&l>0&&((n=t?.updateOptions)==null||n.call(t,{fontSize:l})),J(!1)},{deep:!0}),q(()=>[Ke(),ht.value,De.value,j.value,Y.value],([e],n)=>{De.value&&j.value&&Y.value&&(function(t={}){if(t.appearanceOnly)return;Te();const l=Ke(),o=()=>{m.value&&qe(),Z(()=>{at(),X()})};l?(function(a,r){const u=(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=Bt.get(s);if(c)return c;try{const f=JSON.stringify(s);if(f)return Bt.set(s,f),f}catch{}const d="__theme_"+ ++Io;return Bt.set(s,d),d}return String(s)})(r);return u?(Pt=a,Ye||Mt!==u?Ye?(Qe===u||xt===u||(pn=r,Qe=u),Ye):(pn=r,Qe=u,Ye=H(null,null,function*(){for(;Qe&&pn!=null;){const s=pn,c=Qe;if(pn=null,Qe=null,Mt!==c)try{xt=c,yield(Pt??a)(s),Mt=c}catch{}}}).finally(()=>{Ye=null,xt=null}),Ye):Promise.resolve()):Promise.resolve()})(Dn,l).then(o).catch(a=>{}):o()})({appearanceOnly:n!=null&&vl(e,n[0])})},{flush:"post"}),q(()=>[pl.value,De.value,Y.value],(e,n)=>H(null,[e,n],function*([t,l,o],[a]){if(Te(),!l||!o||!G||!S.value||!j.value||t===a||i.stream===!1&&i.loading!==!1)return;const r=we;if(r){try{yield r}catch{}if(F||!S.value)return}try{I.value=!1,T.value=!1,j.value=!1,me.value=!1,Ge(),Pe(),Ae(),yield V(),yield Ee(S.value,{allowStaleContentRetry:!1})}catch{I.value=!1,T.value=!1,_e()}}),{flush:"post"}),q(()=>[i.loading,Y.value],(e,n)=>H(null,[e,n],function*([t,l],o){if(!l)return;const a=o?.[0];if(a===!1&&t!==!1&&m.value&&j.value&&(yield V(),Z(()=>{H(null,null,function*(){const u=we;if(u)try{yield u}catch{}!F&&m.value&&i.loading!==!1&&(Te(),qe(),X())})})),t)return;const r=a!==void 0&&a!==!1;yield V(),Z(()=>{H(null,null,function*(){var u,s;try{if(r&&(yield(function(){return H(this,null,function*(){if(!ue.value||!G||!S.value||ae.value||F||!Y.value)return!1;if(Un===Re.value)return!0;je=!0;try{ue.value=!1,Ne.value=null,an=null,j.value=!1,I.value=!1,me.value=!1,T.value=!1,Ge(),Pe(),Ae(),yield V();try{yield Ee(S.value)}catch{I.value=!1,T.value=!1,_e()}}finally{yield V(),je=!1}return!0})})()))return void J(!1);if(r&&j.value)if(m.value&&S.value){const c=we;if(c)try{yield c}catch{}Te();const d=In(String((u=i.node.originalCode)!=null?u:""),String((s=i.node.updatedCode)!=null?s:""));if(yield rl(d.original,d.updated,fe.value),F||!m.value)return;qe(),cn(!0),re(),He(),X()}else gn(Ue.value,fe.value);J(!1)}catch{}})})}),{immediate:!0,flush:"post"}),Ll(()=>{tt(),Ge(),Pe(),Rn()}),(e,n)=>ae.value?(Xe(),Nn(Et(bl),{key:0,node:Dt.value,loading:i.loading},null,8,["node","loading"])):(Xe(),Sl("div",{key:1,ref_key:"container",ref:ge,style:St(Ql.value),class:Hn(["code-block-container rounded-lg border",[{dark:i.isDark,"is-rendering":i.loading,"is-dark":lo.value,"is-diff":m.value,"is-plain-text":Lt.value}]]),"data-markstream-code-block":"1","data-markstream-enhanced":T.value&&!ae.value?"true":"false","data-markstream-enhancement-state":Rl.value,"data-markstream-pending":Tl.value?"true":void 0},[po(Lo,{"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:x.stream,"is-collapsed":Ce.value,"is-expanded":ve.value,"copy-text":zn.value,"is-previewable":ct.value,"code-font-size":z.value,"code-font-min":10,"code-font-max":36,"default-code-font-size":ie.value,"font-baseline-ready":_l.value,"diff-stats":m.value?$e.value:null,"diff-stats-aria-label":$l.value,onToggleCollapse:eo,onDecreaseFont:Vl,onResetFont:Gl,onIncreaseFont:Ul,onCopy:Xl,onToggleExpand:Zl,onPreview:no},ho({"header-left":Ln(()=>[bt(e.$slots,"header-left",{},()=>[A("div",jo,[A("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:Yl.value},null,8,Uo),A("div",Vo,[A("div",Go,Ot(Kl.value),1),sl.value?(Xe(),Sl("div",Jo,Ot(sl.value),1)):kt("",!0)])])],!0)]),loading:Ln(()=>[bt(e.$slots,"loading",{loading:x.loading,stream:x.stream},()=>[n[0]||(n[0]=A("div",{class:"loading-skeleton"},[A("div",{class:"skeleton-line"}),A("div",{class:"skeleton-line"}),A("div",{class:"skeleton-line short"})],-1))],!0)]),default:Ln(()=>[yo(A("div",Ko,[A("div",{ref_key:"codeEditor",ref:S,class:Hn(["code-editor-container",[x.stream?"":"code-height-placeholder",{"is-hidden":zl.value}]]),style:St(jl.value)},null,6),_t.value?(Xe(),Nn(Et(bl),{key:0,class:Hn(["code-pre-fallback",{"is-wrap":Hl.value,"is-fading-out":oe.value}]),style:St(Il.value),node:Dt.value,"show-line-numbers":!0,"diff-inline":kn.value},null,8,["class","style","node","diff-inline"])):kt("",!0)],512),[[go,!(Ce.value||!x.stream&&x.loading)]]),Cn.value&&!ke.value&&ct.value&&ce.value==="html"?(Xe(),Nn(Ao,{key:0,code:i.node.code,"html-preview-allow-scripts":i.htmlPreviewAllowScripts,"html-preview-sandbox":i.htmlPreviewSandbox,"is-dark":i.isDark,"on-close":()=>Cn.value=!1},null,8,["code","html-preview-allow-scripts","html-preview-sandbox","is-dark","on-close"])):kt("",!0)]),_:2},[e.$slots["header-right"]?{name:"header-right",fn:Ln(()=>[bt(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,qo))}}),[["__scopeId","data-v-4ece510f"]]);export{Zo as default};
@@ -1 +1 @@
1
- import{M as N,c0 as V,aL as s,u as i,aY as f,v as o,bb as p,t as d,bk as c,aw as D,bO as R,G as _,I as $,bJ as H,F,g as A,bL as S,bB as M,aU as g,q as w,c7 as q,c2 as G}from"./index-uGnch3Jw.js";const I={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},J={class:"flex items-center gap-0.5"},K=["aria-label"],O={class:"code-diff-stat removed"},U={class:"code-diff-stat added"},Y=["aria-label"],Q={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},W={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},X=["aria-pressed"],Z={key:3,class:"relative"},ee=["aria-expanded"],oe=["disabled"],te=["disabled"],ne=["disabled"],ae={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},re={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},le={class:"code-block-shell-content"},se={class:"code-loading-placeholder"},ie={class:"sr-only","aria-live":"polite",role:"status"},de=N({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(a,{emit:z}){const t=a,v=z,u=g(!1),x=g(null),b=g(null);function E(){u.value=!u.value,u.value&&document.addEventListener("click",y,{once:!0,capture:!0})}function y(l){var e,n;const C=l.target;(e=x.value)!=null&&e.contains(C)||(n=b.value)!=null&&n.contains(C)?document.addEventListener("click",y,{once:!0,capture:!0}):u.value=!1}const j=w(()=>t.showFontSizeButtons&&t.enableFontSizeControl||t.showExpandButton||t.isPreviewable&&t.showPreviewButton),{t:r}=V(),k=w(()=>t.showTooltips!==!1);function m(l,e){k.value&&q(l.currentTarget,e,"top",!1,void 0,t.isDark)}function h(){k.value&&G()}function B(l){m(l,t.copyText?r("common.copied")||"Copied":r("common.copy")||"Copy")}const L=w(()=>{var l,e;return!!Number.isFinite(t.codeFontSize)&&((l=t.codeFontSize)!=null?l:0)<=((e=t.codeFontMin)!=null?e:0)}),T=w(()=>!t.fontBaselineReady||t.codeFontSize===t.defaultCodeFontSize),P=w(()=>{var l,e;return!!Number.isFinite(t.codeFontSize)&&((l=t.codeFontSize)!=null?l:0)>=((e=t.codeFontMax)!=null?e:100)});return(l,e)=>(s(),i(F,null,[t.showHeader?(s(),i("div",I,[f(l.$slots,"header-left"),f(l.$slots,"header-right",{},()=>[o("div",J,[a.diffStats?(s(),i("div",{key:0,class:"code-diff-stats","aria-label":a.diffStatsAriaLabel},[o("span",O,"-"+p(a.diffStats.removed),1),o("span",U,"+"+p(a.diffStats.added),1)],8,K)):d("",!0),t.showCopyButton?(s(),i("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":a.copyText?c(r)("common.copied")||"Copied":c(r)("common.copy")||"Copy",onClick:e[0]||(e[0]=n=>v("copy")),onMouseenter:e[1]||(e[1]=n=>B(n)),onFocus:e[2]||(e[2]=n=>B(n)),onMouseleave:h,onBlur:h},[a.copyText?(s(),i("svg",W,[...e[14]||(e[14]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(s(),i("svg",Q,[...e[13]||(e[13]=[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),o("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Y)):d("",!0),t.showCollapseButton?(s(),i("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":a.isCollapsed,onClick:e[3]||(e[3]=n=>v("toggleCollapse")),onMouseenter:e[4]||(e[4]=n=>m(n,a.isCollapsed?c(r)("common.expand")||"Expand":c(r)("common.collapse")||"Collapse")),onFocus:e[5]||(e[5]=n=>m(n,a.isCollapsed?c(r)("common.expand")||"Expand":c(r)("common.collapse")||"Collapse")),onMouseleave:h,onBlur:h},[(s(),i("svg",{style:D({rotate:a.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[15]||(e[15]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,X)):d("",!0),j.value?(s(),i("div",Z,[o("button",{ref_key:"moreBtnRef",ref:b,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":u.value,"aria-haspopup":"true",onClick:R(E,["stop"]),onMouseenter:e[6]||(e[6]=n=>m(n,c(r)("common.more")||"More")),onFocus:e[7]||(e[7]=n=>m(n,c(r)("common.more")||"More")),onMouseleave:h,onBlur:h},[...e[16]||(e[16]=[_('<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="1em" height="1em" viewBox="0 0 24 24" class="action-icon"><g fill="currentColor"><circle cx="12" cy="5" r="1.5"></circle><circle cx="12" cy="12" r="1.5"></circle><circle cx="12" cy="19" r="1.5"></circle></g></svg>',1)])],40,ee),$(A,{name:"code-menu"},{default:H(()=>[u.value?(s(),i("div",{key:0,ref_key:"moreMenuRef",ref:x,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[t.showFontSizeButtons&&t.enableFontSizeControl?(s(),i(F,{key:0},[o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:L.value,onClick:e[8]||(e[8]=n=>v("decreaseFont"))},[e[17]||(e[17]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),o("span",null,p(c(r)("common.fontSmaller")||"Font size −"),1)],8,oe),o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:T.value,onClick:e[9]||(e[9]=n=>v("resetFont"))},[e[18]||(e[18]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),o("path",{d:"M3 3v5h5"})])],-1)),o("span",null,p(c(r)("common.fontReset")||"Font size reset"),1)],8,te),o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:P.value,onClick:e[10]||(e[10]=n=>v("increaseFont"))},[e[19]||(e[19]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),o("span",null,p(c(r)("common.fontLarger")||"Font size +"),1)],8,ne)],64)):d("",!0),t.showExpandButton?(s(),i("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:e[11]||(e[11]=n=>{v("toggleExpand",n),u.value=!1})},[a.isExpanded?(s(),i("svg",ae,[...e[20]||(e[20]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(s(),i("svg",re,[...e[21]||(e[21]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),o("span",null,p(a.isExpanded?c(r)("common.collapse")||"Collapse":c(r)("common.expand")||"Expand"),1)])):d("",!0),a.isPreviewable&&t.showPreviewButton?(s(),i("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:e[12]||(e[12]=n=>{v("preview"),u.value=!1})},[e[22]||(e[22]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),o("circle",{cx:"12",cy:"12",r:"3"})])],-1)),o("span",null,p(c(r)("common.preview")||"Preview"),1)])):d("",!0)],512)):d("",!0)]),_:1})])):d("",!0)])])])):d("",!0),S(o("div",le,[f(l.$slots,"default")],512),[[M,!(a.isCollapsed||!a.stream&&a.loading)]]),S(o("div",se,[f(l.$slots,"loading",{},()=>[e[23]||(e[23]=o("div",{class:"loading-skeleton"},[o("div",{class:"skeleton-line"}),o("div",{class:"skeleton-line"}),o("div",{class:"skeleton-line short"})],-1))])],512),[[M,!a.stream&&a.loading]]),o("span",ie,p(a.copyText?c(r)("common.copied")||"Copied":""),1)],64))}});export{de as V};
1
+ import{M as V,c0 as N,aL as s,u as i,aY as f,v as o,bb as p,t as d,bk as c,aw as R,bO as _,G as D,I as $,bJ as H,F,g as A,bL as S,bB as M,aU as g,q as w,c8 as q,c2 as G}from"./index-CCjot4qV.js";const I={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},J={class:"flex items-center gap-0.5"},K=["aria-label"],O={class:"code-diff-stat removed"},U={class:"code-diff-stat added"},Y=["aria-label"],Q={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},W={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},X=["aria-pressed"],Z={key:3,class:"relative"},ee=["aria-expanded"],oe=["disabled"],te=["disabled"],ne=["disabled"],ae={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},re={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},le={class:"code-block-shell-content"},se={class:"code-loading-placeholder"},ie={class:"sr-only","aria-live":"polite",role:"status"},de=V({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(a,{emit:z}){const t=a,v=z,u=g(!1),x=g(null),b=g(null);function E(){u.value=!u.value,u.value&&document.addEventListener("click",y,{once:!0,capture:!0})}function y(l){var e,n;const C=l.target;(e=x.value)!=null&&e.contains(C)||(n=b.value)!=null&&n.contains(C)?document.addEventListener("click",y,{once:!0,capture:!0}):u.value=!1}const j=w(()=>t.showFontSizeButtons&&t.enableFontSizeControl||t.showExpandButton||t.isPreviewable&&t.showPreviewButton),{t:r}=N(),k=w(()=>t.showTooltips!==!1);function m(l,e){k.value&&q(l.currentTarget,e,"top",!1,void 0,t.isDark)}function h(){k.value&&G()}function B(l){m(l,t.copyText?r("common.copied")||"Copied":r("common.copy")||"Copy")}const L=w(()=>{var l,e;return!!Number.isFinite(t.codeFontSize)&&((l=t.codeFontSize)!=null?l:0)<=((e=t.codeFontMin)!=null?e:0)}),T=w(()=>!t.fontBaselineReady||t.codeFontSize===t.defaultCodeFontSize),P=w(()=>{var l,e;return!!Number.isFinite(t.codeFontSize)&&((l=t.codeFontSize)!=null?l:0)>=((e=t.codeFontMax)!=null?e:100)});return(l,e)=>(s(),i(F,null,[t.showHeader?(s(),i("div",I,[f(l.$slots,"header-left"),f(l.$slots,"header-right",{},()=>[o("div",J,[a.diffStats?(s(),i("div",{key:0,class:"code-diff-stats","aria-label":a.diffStatsAriaLabel},[o("span",O,"-"+p(a.diffStats.removed),1),o("span",U,"+"+p(a.diffStats.added),1)],8,K)):d("",!0),t.showCopyButton?(s(),i("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":a.copyText?c(r)("common.copied")||"Copied":c(r)("common.copy")||"Copy",onClick:e[0]||(e[0]=n=>v("copy")),onMouseenter:e[1]||(e[1]=n=>B(n)),onFocus:e[2]||(e[2]=n=>B(n)),onMouseleave:h,onBlur:h},[a.copyText?(s(),i("svg",W,[...e[14]||(e[14]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(s(),i("svg",Q,[...e[13]||(e[13]=[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),o("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Y)):d("",!0),t.showCollapseButton?(s(),i("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":a.isCollapsed,onClick:e[3]||(e[3]=n=>v("toggleCollapse")),onMouseenter:e[4]||(e[4]=n=>m(n,a.isCollapsed?c(r)("common.expand")||"Expand":c(r)("common.collapse")||"Collapse")),onFocus:e[5]||(e[5]=n=>m(n,a.isCollapsed?c(r)("common.expand")||"Expand":c(r)("common.collapse")||"Collapse")),onMouseleave:h,onBlur:h},[(s(),i("svg",{style:R({rotate:a.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[15]||(e[15]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,X)):d("",!0),j.value?(s(),i("div",Z,[o("button",{ref_key:"moreBtnRef",ref:b,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":u.value,"aria-haspopup":"true",onClick:_(E,["stop"]),onMouseenter:e[6]||(e[6]=n=>m(n,c(r)("common.more")||"More")),onFocus:e[7]||(e[7]=n=>m(n,c(r)("common.more")||"More")),onMouseleave:h,onBlur:h},[...e[16]||(e[16]=[D('<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="1em" height="1em" viewBox="0 0 24 24" class="action-icon"><g fill="currentColor"><circle cx="12" cy="5" r="1.5"></circle><circle cx="12" cy="12" r="1.5"></circle><circle cx="12" cy="19" r="1.5"></circle></g></svg>',1)])],40,ee),$(A,{name:"code-menu"},{default:H(()=>[u.value?(s(),i("div",{key:0,ref_key:"moreMenuRef",ref:x,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[t.showFontSizeButtons&&t.enableFontSizeControl?(s(),i(F,{key:0},[o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:L.value,onClick:e[8]||(e[8]=n=>v("decreaseFont"))},[e[17]||(e[17]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),o("span",null,p(c(r)("common.fontSmaller")||"Font size −"),1)],8,oe),o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:T.value,onClick:e[9]||(e[9]=n=>v("resetFont"))},[e[18]||(e[18]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),o("path",{d:"M3 3v5h5"})])],-1)),o("span",null,p(c(r)("common.fontReset")||"Font size reset"),1)],8,te),o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:P.value,onClick:e[10]||(e[10]=n=>v("increaseFont"))},[e[19]||(e[19]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),o("span",null,p(c(r)("common.fontLarger")||"Font size +"),1)],8,ne)],64)):d("",!0),t.showExpandButton?(s(),i("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:e[11]||(e[11]=n=>{v("toggleExpand",n),u.value=!1})},[a.isExpanded?(s(),i("svg",ae,[...e[20]||(e[20]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(s(),i("svg",re,[...e[21]||(e[21]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),o("span",null,p(a.isExpanded?c(r)("common.collapse")||"Collapse":c(r)("common.expand")||"Expand"),1)])):d("",!0),a.isPreviewable&&t.showPreviewButton?(s(),i("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:e[12]||(e[12]=n=>{v("preview"),u.value=!1})},[e[22]||(e[22]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),o("circle",{cx:"12",cy:"12",r:"3"})])],-1)),o("span",null,p(c(r)("common.preview")||"Preview"),1)])):d("",!0)],512)):d("",!0)]),_:1})])):d("",!0)])])])):d("",!0),S(o("div",le,[f(l.$slots,"default")],512),[[M,!(a.isCollapsed||!a.stream&&a.loading)]]),S(o("div",se,[f(l.$slots,"loading",{},()=>[e[23]||(e[23]=o("div",{class:"loading-skeleton"},[o("div",{class:"skeleton-line"}),o("div",{class:"skeleton-line"}),o("div",{class:"skeleton-line short"})],-1))])],512),[[M,!a.stream&&a.loading]]),o("span",ie,p(a.copyText?c(r)("common.copied")||"Copied":""),1)],64))}});export{de as V};
@@ -1 +1 @@
1
- import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-uGnch3Jw.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-CDU05fwN.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default};
1
+ import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-CCjot4qV.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-CDU05fwN.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default};
@@ -1 +1 @@
1
- import{S as ln,T as an,V as z,W as S,X,Y as un,$ as y,a0 as tn,a1 as F,a2 as _,a3 as rn,a4 as o,a5 as on,a6 as sn,a7 as fn}from"./mermaid.core-UWDZO4h_.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,A,Y,a){var I=E-l,i=q-h,n=Y-v,d=a-A,u=d*I-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*I,h+u*i]}function M(l,h,E,q,v,A,Y){var a=l-E,I=h-q,i=(Y?A:-A)/F(a*a+I*I),n=i*I,d=-i*a,u=l+n,s=h+d,f=E+n,c=q+d,$=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,O=(g<0?-1:1)*F(on(0,T*T*R-P*P)),V=(P*g-m*O)/R,W=(-P*m-g*O)/R,w=(P*g+m*O)/R,p=(-P*m+g*O)/R,x=V-$,e=W-t,r=w-$,j=p-t;return x*x+e*e>r*r+j*j&&(V=w,W=p),{cx:V,cy:W,x01:-n,y01:-d,x11:V*(v/T-1),y11:W*(v/T-1)}}function hn(){var l=cn,h=yn,E=X(0),q=null,v=gn,A=dn,Y=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,$=rn(c-f),t=c>f;if(a||(a=n=I()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if($>tn-y)a.moveTo(s*z(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*z(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=$,O=$,V=Y.apply(this,arguments)/2,W=V>y&&(q?+q.apply(this,arguments):F(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(W>y){var j=sn(W/u*S(V)),G=sn(W/s*S(V));(P-=j*2)>y?(j*=t?1:-1,R+=j,T-=j):(P=0,R=T=(f+c)/2),(O-=G*2)>y?(G*=t?1:-1,m+=G,g-=G):(O=0,m=g=(f+c)/2)}var B=s*z(m),C=s*S(m),H=u*z(T),J=u*S(T);if(w>y){var K=s*z(g),L=s*S(g),N=u*z(R),Q=u*S(R),D;if($<an)if(D=pn(B,C,N,Q,K,L,H,J)){var U=B-D[0],Z=C-D[1],k=K-D[0],b=L-D[1],nn=1/S(fn((U*k+Z*b)/(F(U*U+Z*Z)*F(k*k+b*b)))/2),en=F(D[0]*D[0]+D[1]*D[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}O>y?x>y?(e=M(N,Q,B,C,s,x,t),r=M(K,L,H,J,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(B,C),a.arc(0,0,s,m,g,!t)):a.moveTo(B,C),!(u>y)||!(P>y)?a.lineTo(H,J):p>y?(e=M(H,J,K,L,u,-p,t),r=M(B,C,N,Q,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[z(d)*n,S(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:X(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:X(+n),i):h},i.cornerRadius=function(n){return arguments.length?(E=typeof n=="function"?n:X(+n),i):E},i.padRadius=function(n){return arguments.length?(q=n==null?null:typeof n=="function"?n:X(+n),i):q},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:X(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:X(+n),i):A},i.padAngle=function(n){return arguments.length?(Y=typeof n=="function"?n:X(+n),i):Y},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{S as ln,T as an,V as z,W as S,X,Y as un,$ as y,a0 as tn,a1 as F,a2 as _,a3 as rn,a4 as o,a5 as on,a6 as sn,a7 as fn}from"./mermaid.core-CtXm064v.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,A,Y,a){var I=E-l,i=q-h,n=Y-v,d=a-A,u=d*I-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*I,h+u*i]}function M(l,h,E,q,v,A,Y){var a=l-E,I=h-q,i=(Y?A:-A)/F(a*a+I*I),n=i*I,d=-i*a,u=l+n,s=h+d,f=E+n,c=q+d,$=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,O=(g<0?-1:1)*F(on(0,T*T*R-P*P)),V=(P*g-m*O)/R,W=(-P*m-g*O)/R,w=(P*g+m*O)/R,p=(-P*m+g*O)/R,x=V-$,e=W-t,r=w-$,j=p-t;return x*x+e*e>r*r+j*j&&(V=w,W=p),{cx:V,cy:W,x01:-n,y01:-d,x11:V*(v/T-1),y11:W*(v/T-1)}}function hn(){var l=cn,h=yn,E=X(0),q=null,v=gn,A=dn,Y=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,$=rn(c-f),t=c>f;if(a||(a=n=I()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if($>tn-y)a.moveTo(s*z(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*z(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=$,O=$,V=Y.apply(this,arguments)/2,W=V>y&&(q?+q.apply(this,arguments):F(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(W>y){var j=sn(W/u*S(V)),G=sn(W/s*S(V));(P-=j*2)>y?(j*=t?1:-1,R+=j,T-=j):(P=0,R=T=(f+c)/2),(O-=G*2)>y?(G*=t?1:-1,m+=G,g-=G):(O=0,m=g=(f+c)/2)}var B=s*z(m),C=s*S(m),H=u*z(T),J=u*S(T);if(w>y){var K=s*z(g),L=s*S(g),N=u*z(R),Q=u*S(R),D;if($<an)if(D=pn(B,C,N,Q,K,L,H,J)){var U=B-D[0],Z=C-D[1],k=K-D[0],b=L-D[1],nn=1/S(fn((U*k+Z*b)/(F(U*U+Z*Z)*F(k*k+b*b)))/2),en=F(D[0]*D[0]+D[1]*D[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}O>y?x>y?(e=M(N,Q,B,C,s,x,t),r=M(K,L,H,J,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(B,C),a.arc(0,0,s,m,g,!t)):a.moveTo(B,C),!(u>y)||!(P>y)?a.lineTo(H,J):p>y?(e=M(H,J,K,L,u,-p,t),r=M(B,C,N,Q,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[z(d)*n,S(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:X(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:X(+n),i):h},i.cornerRadius=function(n){return arguments.length?(E=typeof n=="function"?n:X(+n),i):E},i.padRadius=function(n){return arguments.length?(q=n==null?null:typeof n=="function"?n:X(+n),i):q},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:X(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:X(+n),i):A},i.padAngle=function(n){return arguments.length?(Y=typeof n=="function"?n:X(+n),i):Y},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};