@moonshot-ai/kimi-code 0.19.1 → 0.20.0

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 (133) hide show
  1. package/dist/main.mjs +6770 -1618
  2. package/dist-web/assets/CodeBlockNode-CaV-jku-.js +22 -0
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-C0rAlIZT.js → CodeBlockShell.vue_vue_type_style_index_0_lang-D2LMLnjQ.js} +1 -1
  4. package/dist-web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  5. package/dist-web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  6. package/dist-web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  7. package/dist-web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  8. package/dist-web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  9. package/dist-web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  10. package/dist-web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  11. package/dist-web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  12. package/dist-web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  13. package/dist-web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  14. package/dist-web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  15. package/dist-web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  16. package/dist-web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  17. package/dist-web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  18. package/dist-web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  19. package/dist-web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  20. package/dist-web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  21. package/dist-web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  22. package/dist-web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  23. package/dist-web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  24. package/dist-web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  25. package/dist-web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  26. package/dist-web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  27. package/dist-web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  28. package/dist-web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  29. package/dist-web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  30. package/dist-web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  31. package/dist-web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  32. package/dist-web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  33. package/dist-web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  34. package/dist-web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  35. package/dist-web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  36. package/dist-web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  37. package/dist-web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  38. package/dist-web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  39. package/dist-web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  40. package/dist-web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  41. package/dist-web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  42. package/dist-web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  43. package/dist-web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  44. package/dist-web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  45. package/dist-web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  46. package/dist-web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  47. package/dist-web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  48. package/dist-web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  49. package/dist-web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  50. package/dist-web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  51. package/dist-web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  52. package/dist-web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  53. package/dist-web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  54. package/dist-web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  55. package/dist-web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  56. package/dist-web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  57. package/dist-web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  58. package/dist-web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  59. package/dist-web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  60. package/dist-web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  61. package/dist-web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  62. package/dist-web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  63. package/dist-web/assets/{Tooltip-BGNN9cLC.js → Tooltip-BkDnpjpB.js} +1 -1
  64. package/dist-web/assets/arc-BpCxx-Lm.js +1 -0
  65. package/dist-web/assets/{architectureDiagram-3BPJPVTR-CdJj5NzX.js → architectureDiagram-3BPJPVTR-BUzyMdWP.js} +1 -1
  66. package/dist-web/assets/{blockDiagram-GPEHLZMM-BM14SQiN.js → blockDiagram-GPEHLZMM-BUkuE4Df.js} +1 -1
  67. package/dist-web/assets/{c4Diagram-AAUBKEIU-FYQfQdwd.js → c4Diagram-AAUBKEIU-Cyx2I5NF.js} +1 -1
  68. package/dist-web/assets/channel-BPMCBZZJ.js +1 -0
  69. package/dist-web/assets/{chunk-2J33WTMH-V2R-DrVS.js → chunk-2J33WTMH-D1yizOHn.js} +1 -1
  70. package/dist-web/assets/{chunk-4BX2VUAB-BabgZRBA.js → chunk-4BX2VUAB-Dh0raYq6.js} +1 -1
  71. package/dist-web/assets/{chunk-55IACEB6-DkJmDlyu.js → chunk-55IACEB6-BEhXMK8a.js} +1 -1
  72. package/dist-web/assets/{chunk-727SXJPM-CvIYC9nm.js → chunk-727SXJPM-DNNSkr-u.js} +2 -2
  73. package/dist-web/assets/{chunk-AQP2D5EJ-uL8LYMfy.js → chunk-AQP2D5EJ-BdIEtlnn.js} +1 -1
  74. package/dist-web/assets/{chunk-FMBD7UC4-EcbDOlvH.js → chunk-FMBD7UC4-CkJ1iFLI.js} +1 -1
  75. package/dist-web/assets/{chunk-ND2GUHAM-C8Qo5Bp8.js → chunk-ND2GUHAM-BHPtuSG5.js} +1 -1
  76. package/dist-web/assets/{chunk-QZHKN3VN-DqF-jFth.js → chunk-QZHKN3VN-CkJm98VG.js} +1 -1
  77. package/dist-web/assets/classDiagram-4FO5ZUOK-JXNmNMT4.js +1 -0
  78. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-JXNmNMT4.js +1 -0
  79. package/dist-web/assets/{cose-bilkent-S5V4N54A-BP-HoEg_.js → cose-bilkent-S5V4N54A-x5W3gqTd.js} +1 -1
  80. package/dist-web/assets/{dagre-BM42HDAG-BAqAth0y.js → dagre-BM42HDAG-eSRg4w-M.js} +1 -1
  81. package/dist-web/assets/{diagram-2AECGRRQ-CXLHAdSr.js → diagram-2AECGRRQ-Cifjip15.js} +1 -1
  82. package/dist-web/assets/{diagram-5GNKFQAL-BoPiyK2f.js → diagram-5GNKFQAL-DLv5M6zi.js} +1 -1
  83. package/dist-web/assets/{diagram-KO2AKTUF-B11ZVuuX.js → diagram-KO2AKTUF-DlsIZYaS.js} +1 -1
  84. package/dist-web/assets/{diagram-LMA3HP47-B8fTjZXi.js → diagram-LMA3HP47-CbDbbTBN.js} +1 -1
  85. package/dist-web/assets/{diagram-OG6HWLK6-DWzU9uYr.js → diagram-OG6HWLK6-DmIs02eE.js} +1 -1
  86. package/dist-web/assets/{erDiagram-TEJ5UH35-4MqNXbsL.js → erDiagram-TEJ5UH35-DKiJXrkX.js} +1 -1
  87. package/dist-web/assets/{flowDiagram-I6XJVG4X-CCJIZLVz.js → flowDiagram-I6XJVG4X-Diwcs-TL.js} +1 -1
  88. package/dist-web/assets/{ganttDiagram-6RSMTGT7-DNfMlT11.js → ganttDiagram-6RSMTGT7-C1Z7ZuXq.js} +1 -1
  89. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-IBySLi3i.js → gitGraphDiagram-PVQCEYII-zAnihooO.js} +1 -1
  90. package/dist-web/assets/index-Cm9Q4xVi.js +3 -0
  91. package/dist-web/assets/index-CytBc_Au.css +1 -0
  92. package/dist-web/assets/index-DsKglRi9.js +273 -0
  93. package/dist-web/assets/index-MiWa00oP.js +9 -0
  94. package/dist-web/assets/{index-CqOt95r5.js → index-sGTig1yI.js} +1 -1
  95. package/dist-web/assets/{index10-9hz8xOXN.js → index10-D-oYkFkv.js} +2 -2
  96. package/dist-web/assets/index11-BZ-VpLJZ.js +9 -0
  97. package/dist-web/assets/{index5-DYhhPUDp.js → index5-BHU3YSPN.js} +1 -1
  98. package/dist-web/assets/{index6-DdsuTXIR.js → index6-DktmVOWV.js} +1 -1
  99. package/dist-web/assets/{index7-CoWnZiYw.js → index7-5thVZydO.js} +1 -1
  100. package/dist-web/assets/index8-oLPFpvcC.js +2 -0
  101. package/dist-web/assets/{infoDiagram-5YYISTIA-BoRSkIVT.js → infoDiagram-5YYISTIA-CTtKRrDv.js} +1 -1
  102. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-oMuu2qq0.js → ishikawaDiagram-YF4QCWOH-CpeSKUEO.js} +1 -1
  103. package/dist-web/assets/{journeyDiagram-JHISSGLW-DeuffmUz.js → journeyDiagram-JHISSGLW-CqozeoGf.js} +1 -1
  104. package/dist-web/assets/{kanban-definition-UN3LZRKU-DLxFUMop.js → kanban-definition-UN3LZRKU-D8fkRjdV.js} +1 -1
  105. package/dist-web/assets/{linear-Lxe_18BZ.js → linear-CcasoJPT.js} +1 -1
  106. package/dist-web/assets/{mermaid.core-4YTQ-5V5.js → mermaid.core-DQW_ubr6.js} +5 -5
  107. package/dist-web/assets/{mindmap-definition-RKZ34NQL-Bb4Tm8kX.js → mindmap-definition-RKZ34NQL-Ds4S3Jr8.js} +1 -1
  108. package/dist-web/assets/{pieDiagram-4H26LBE5-Bl8T3fZ7.js → pieDiagram-4H26LBE5-B6flMWC0.js} +2 -2
  109. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-BoEFFDkb.js → quadrantDiagram-W4KKPZXB-Dp7Mce_9.js} +1 -1
  110. package/dist-web/assets/{requirementDiagram-4Y6WPE33-B-op7Gg7.js → requirementDiagram-4Y6WPE33-POD8vh5c.js} +1 -1
  111. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-DEMaMFQJ.js → sankeyDiagram-5OEKKPKP-DPTFBsjO.js} +1 -1
  112. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-B0FEdEjA.js → sequenceDiagram-3UESZ5HK-D7J9QzqQ.js} +1 -1
  113. package/dist-web/assets/{stateDiagram-AJRCARHV-BbCmT6m3.js → stateDiagram-AJRCARHV-BPCTy0Vu.js} +1 -1
  114. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CJbfs5Xz.js +1 -0
  115. package/dist-web/assets/{timeline-definition-PNZ67QCA-DsuaxnT6.js → timeline-definition-PNZ67QCA-CjYdXq94.js} +1 -1
  116. package/dist-web/assets/{vennDiagram-CIIHVFJN-CC9doxKp.js → vennDiagram-CIIHVFJN-DopODwti.js} +1 -1
  117. package/dist-web/assets/{vue.runtime.esm-bundler-DPCj1V1e.js → vue.runtime.esm-bundler-HPT0I7TD.js} +1 -1
  118. package/dist-web/assets/{wardley-L42UT6IY-C1rlxzgy.js → wardley-L42UT6IY-t4Clap_T.js} +1 -1
  119. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-gCZUj4SL.js → wardleyDiagram-YWT4CUSO-DT5OKzVz.js} +1 -1
  120. package/dist-web/assets/{xychartDiagram-2RQKCTM6-Bg1yj2-o.js → xychartDiagram-2RQKCTM6-BePku_Rt.js} +1 -1
  121. package/dist-web/index.html +2 -2
  122. package/package.json +5 -5
  123. package/dist-web/assets/CodeBlockNode-CEaJG3Ru.js +0 -22
  124. package/dist-web/assets/arc-DZU5jAun.js +0 -1
  125. package/dist-web/assets/channel-y98-FGX8.js +0 -1
  126. package/dist-web/assets/classDiagram-4FO5ZUOK-DIygKdRl.js +0 -1
  127. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DIygKdRl.js +0 -1
  128. package/dist-web/assets/index-CiC6jpjA.js +0 -268
  129. package/dist-web/assets/index-Cp4cno62.css +0 -1
  130. package/dist-web/assets/index-D9E1vajk.js +0 -9
  131. package/dist-web/assets/index11-jpw4aORI.js +0 -9
  132. package/dist-web/assets/index8-nFDUP4kC.js +0 -2
  133. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-DVIg4v2K.js +0 -1
@@ -0,0 +1,22 @@
1
+ import{bR as Vl,ci as Jl,bQ as fl,M as vl,bl as Gl,af as ll,bZ as Yl,c0 as ml,aU as L,bT as Kl,bE as U,az as Ql,c1 as ol,c2 as Xl,aI as pl,aL as je,s as Pn,bk as pt,cj as il,u as rl,I as Zl,A as eo,bJ as Cn,aY as at,bL as no,v as T,aw as ut,au as Bn,t as dt,bB as to,bb as ht,q as g,ck as lo,c4 as oo,c5 as io,c7 as ro,a0 as ao,c3 as al,aD as uo,bO as so,T as co,as as ne,b$ as fo,cl as vo}from"./index-DsKglRi9.js";import{i as V,t as mo}from"./safeRaf-DGuzXxDK.js";import{V as po}from"./CodeBlockShell.vue_vue_type_style_index_0_lang-D2LMLnjQ.js";var xn=(k,w,C)=>new Promise((i,ue)=>{var xe=P=>{try{J(C.next(P))}catch(O){ue(O)}},_=P=>{try{J(C.throw(P))}catch(O){ue(O)}},J=P=>P.done?i(P.value):Promise.resolve(P.value).then(xe,_);J((C=C.apply(k,w)).next())});let ul=!1,rn=null,an=null,st=!1,un=null;function ho(){return xn(this,null,function*(){if(un)return un;un=xn(null,null,function*(){if(!an){if(st)return null;try{if(an=(function(k){const w=k;if(typeof w?.useMonaco=="function")return w;const C=k?.default;return typeof C?.useMonaco=="function"?C:null})(yield Vl(()=>import("./__vite-optional-peer-dep_stream-monaco_markstream-vue-BIHI7g3E.js"),[])),!an)return st=!0,null}catch{return st=!0,null}}try{return yield(function(k){return xn(this,null,function*(){return ul?void 0:rn||(rn=xn(null,null,function*(){const C=globalThis?.MonacoEnvironment;C&&(typeof C.getWorker=="function"||typeof C.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),ul=!0}).finally(()=>{rn=null}),rn)})})(an),Jl(),an}catch{return null}});try{return yield un}finally{un=null}})}var yo=Object.defineProperty,go=Object.defineProperties,wo=Object.getOwnPropertyDescriptors,dl=Object.getOwnPropertySymbols,bo=Object.prototype.hasOwnProperty,So=Object.prototype.propertyIsEnumerable,sl=(k,w,C)=>w in k?yo(k,w,{enumerable:!0,configurable:!0,writable:!0,value:C}):k[w]=C,H=(k,w)=>{for(var C in w||(w={}))bo.call(w,C)&&sl(k,C,w[C]);if(dl)for(var C of dl(w))So.call(w,C)&&sl(k,C,w[C]);return k},ve=(k,w)=>go(k,wo(w)),N=(k,w,C)=>new Promise((i,ue)=>{var xe=P=>{try{J(C.next(P))}catch(O){ue(O)}},_=P=>{try{J(C.throw(P))}catch(O){ue(O)}},J=P=>P.done?i(P.value):Promise.resolve(P.value).then(xe,_);J((C=C.apply(k,w)).next())});const ko={class:"html-preview-frame__header"},Co={class:"html-preview-frame__title"},xo={class:"html-preview-frame__label"},Mo=["sandbox","srcdoc"],Po=fl(vl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const w=k,C=import.meta!==void 0&&!1;let i=null;const{t:ue}=ml(),xe=g(()=>{const P=w.code||"",O=P.trim().toLowerCase();return O.startsWith("<!doctype")||O.startsWith("<html")||O.startsWith("<body")?P:`<!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: ${w.isDark?"#020617":"#ffffff"};
12
+ color: ${w.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
+ ${P}
21
+ </body>
22
+ </html>`}),_=g(()=>{return P=w.htmlPreviewSandbox,O=w.htmlPreviewAllowScripts,typeof P=="string"?((function(we){if(!C||typeof console>"u"||i===we)return;const G=(function(b){return new Set(b.trim().toLowerCase().split(/\s+/).filter(Boolean))})(we);G.has("allow-scripts")&&G.has("allow-same-origin")&&(i=we,console.warn("[markstream-vue] htmlPreviewSandbox contains both allow-scripts and allow-same-origin. Use this only for fully trusted content served from an isolated origin."))})(P),P):P!==void 0?"":O===!0?"allow-scripts":"";var P,O});function J(P){var O;P.key!=="Escape"&&P.key!=="Esc"||(O=w.onClose)==null||O.call(w)}return uo(()=>{typeof window<"u"&&window.addEventListener("keydown",J)}),pl(()=>{typeof window<"u"&&window.removeEventListener("keydown",J)}),(P,O)=>(je(),Pn(co,{to:"body"},[T("div",{class:Bn(["markstream-vue",{dark:w.isDark}])},[T("div",{class:"html-preview-frame__backdrop",onClick:O[2]||(O[2]=we=>{var G;return(G=w.onClose)==null?void 0:G.call(w)})},[T("div",{class:"html-preview-frame",onClick:O[1]||(O[1]=so(()=>{},["stop"]))},[T("div",ko,[T("div",Co,[O[3]||(O[3]=T("span",{class:"html-preview-frame__dot"},null,-1)),T("span",xo,ht(w.title||pt(ue)("common.preview")||"Preview"),1)]),T("button",{type:"button",class:"html-preview-frame__close",onClick:O[0]||(O[0]=we=>{var G;return(G=w.onClose)==null?void 0:G.call(w)})}," × ")]),T("iframe",{class:"html-preview-frame__iframe",sandbox:_.value,referrerpolicy:"no-referrer",srcdoc:xe.value},null,8,Mo)])])],2)]))}}),[["__scopeId","data-v-24e66176"]]);let Ae=null,ct=null,dn=null,Ie=null,ft=null,vt=null;const mt=new WeakMap;let Bo=0;const Eo=["data-markstream-enhanced","data-markstream-pending"],Oo={class:"code-header-main"},Lo=["innerHTML"],Fo={class:"code-header-copy"},$o={class:"code-header-title"},Ho={key:0,class:"code-header-caption"},No={class:"code-editor-layer"},cl="__markstreamMonacoPassiveTouchState__",Mn=1.5,Wo=fl(vl({__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(k,{emit:w}){var C;const i=k,ue=w,xe=Gl(),_=ll(Yl,null),J=ll("markstreamHostScrollManaged",null),P=g(()=>fo(i,xe)),O=ao(),we=g(()=>{const e=O?.vnode.props;return!(!e||!e.onPreviewCode&&!e.onPreviewCode)}),{t:G}=ml(),b=L(null),me=L(null),En=L(!1),de=L(Yt(i.node.language,i.node.code,Gt())),pe=g(()=>lo(de.value)),yt=g(()=>pe.value==="plaintext"),se=L(!1),be=L(!1),te=L(!1),Me=L(!1),ie=L(!1),qe=L(!1);let F=!1,$e=null,Se="";const Pe=L(null),Be=L(null);let sn=0,On=0;const hl=Kl(),Ue=L(null),re=L(typeof window>"u");typeof window<"u"&&U(()=>me.value,e=>{var n;if((n=Ue.value)==null||n.destroy(),Ue.value=null,!e)return void(re.value=!1);const t=hl(e,{rootMargin:"400px"});Ue.value=t,re.value=t.isVisible.value,t.whenVisible.then(()=>{re.value=!0})},{immediate:!0}),Ql(()=>{var e;F=!0,(function(){const n=Se;_&&n&&(Se="",_.markSettled(n))})(),(e=Ue.value)==null||e.destroy(),Ue.value=null});let le=null,cn=null,fn=()=>{},vn=()=>{},Ve=()=>null,Y=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),z=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),Ln=()=>{},Je=()=>{},Fn=()=>{},he=null,Ge=null,gt=()=>{var e;return String((e=i.node.language)!=null?e:"plaintext")},$n=()=>N(null,null,function*(){}),wt=!1;const He=[],Hn=[];let ye=null;function mn(e){var n;return((n=String(e??"").trim().split(/\s+/,1)[0])!=null?n:"")==="diff"}const f=g(()=>{var e;return i.node.diff===!0||mn(i.node.language)||mn(lt(String((e=i.node.raw)!=null?e:"")))}),Ee=L({removed:0,added:0}),yl=g(()=>`-${Ee.value.removed} +${Ee.value.added}`),Ye=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5}),bt=Object.freeze(ve(H({},Ye),{enabled:!1,revealLineCount:0}));function Nn(e){var n;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const t=e;return ve(H(H({},Ye),t),{enabled:(n=t.enabled)==null||n})}return H({},Ye)}function St(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,d=((t=(n=me.value)==null?void 0:n.getBoundingClientRect)==null?void 0:t.call(n).width)||((l=me.value)==null?void 0:l.clientWidth)||(typeof window>"u"?0:window.innerWidth);return d>0&&d<=a}function zn(e,n){return{original:pn(e,!1),updated:pn(n,!1)}}function pn(e,n){const t=String(e??"");return n?t:t.replace(/\r\n$|\n$|\r$/,"")}function Ke(e){var n;return String((n=e?.message)!=null?n:e).includes("no diff result available")}function Ne(){try{const e=Fn();e&&typeof e.catch=="function"&&e.catch(n=>{Ke(n)})}catch(e){Ke(e)}}const A=g(()=>{var e,n,t,l;const o=i.monacoOptions?H({},i.monacoOptions):{};if(!f.value)return o;const a=o.diffHideUnchangedRegions===void 0?H({},Ye):Nn(o.diffHideUnchangedRegions),d=o.hideUnchangedRegions===void 0?void 0:Nn(o.hideUnchangedRegions),r=i.stream!==!1&&i.loading!==!1,u=r?H({},bt):a,c=r?H({},bt):d,s=(function(v){return v.diffWordWrap!==void 0?v.diffWordWrap:"off"})(o),m=H({},(e=o.experimental)!=null?e:{}),h=(n=o.diffUnchangedRegionStyle)!=null?n:"line-info",y=(function(v){if(!St(v))return;const x=v.scrollbar&&typeof v.scrollbar=="object"?v.scrollbar:{};return ve(H({},x),{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:s,renderSideBySide:(t=o.renderSideBySide)==null||t,diffHideUnchangedRegions:u,useInlineViewWhenSpaceIsLimited:(l=o.useInlineViewWhenSpaceIsLimited)!=null&&l,diffLineStyle:"background",diffAppearance:"auto",diffUnchangedRegionStyle:h,diffHunkActionsOnHover:!1,experimental:m};return H(ve(H(ve(H(H({},p),o),{experimental:m}),c===void 0?{}:{hideUnchangedRegions:c}),{diffHideUnchangedRegions:u,diffWordWrap:s}),y===void 0?{}:{scrollbar:y})}),kt=g(()=>f.value?"diff":"single"),gl=L(kt.value),ze=L(!1),I=L(!1),Te=L(!1),K=L(!1),Q=L(!1);let Qe=null;const wl=g(()=>{var e,n,t;if(f.value){const o=(e=A.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"}),hn=g(()=>{var e;return!!f.value&&St((e=A.value)!=null?e:{})});function Ct(e){return J?.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 xt=g(()=>Ct(me.value)),ge=g(()=>!ze.value&&(!!Te.value||(f.value||xt.value||!vo())&&!I.value)),Mt=g(()=>ge.value||K.value),bl=g(()=>ge.value&&!K.value),Sl=g(()=>!ze.value&&!Te.value&&(ge.value||K.value||Q.value)),yn=L(!1),Xe=g(()=>pn(i.node.code,i.node.loading===!0)),Pt=g(()=>f.value?i.node.diff===!0?i.node:ve(H({},i.node),{diff:!0}):Xe.value===i.node.code?i.node:ve(H({},i.node),{code:Xe.value}));typeof window<"u"&&N(null,null,function*(){try{const e=yield ho();if(F)return;if(!e)return void(ze.value=!0);const n=e.useMonaco,t=e.detectLanguage;if(typeof t=="function"&&(gt=t),typeof n=="function"){const l=on();if(l&&i.themes&&Array.isArray(i.themes)&&!i.themes.includes(l))throw new Error("Preferred theme not in provided themes array");ye=tl();const o=n(ye);le=o.createEditor||le,cn=o.createDiffEditor||cn,fn=o.updateCode||fn,vn=o.updateDiff||vn,Ve=o.getEditor||Ve,Y=o.getEditorView||Y,z=o.getDiffEditorView||z,Ln=o.cleanupEditor||Ln,Je=o.safeClean||o.cleanupEditor||Je,Fn=o.refreshDiffPresentation||Fn,$n=o.setTheme||$n,qe.value=!0,!F&&b.value&&(yield Re(b.value))}}catch{if(F)return;ze.value=!0}});const X=L(typeof((C=i.monacoOptions)==null?void 0:C.fontSize)=="number"?i.monacoOptions.fontSize:Number.NaN),$=L(X.value),Tn=L(null),gn=L(null),kl=g(()=>{const e=X.value,n=$.value;return typeof e=="number"&&Number.isFinite(e)&&e>0&&typeof n=="number"&&Number.isFinite(n)&&n>0}),Dn=g(()=>{var e;const n=Tn.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=$.value;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:12}),Bt=g(()=>{var e;const n=gn.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:Dn.value===12?18:Math.max(12,Math.round(1.5*Dn.value))}),Wn=g(()=>Bt.value);function Et(e){const n=String(e??"");return n?Math.max(1,n.split(/\r\n|\n|\r/).length):1}function Ot(e){return e.startsWith("-")&&!e.startsWith("---")}function Lt(e){return e.startsWith("+")&&!e.startsWith("+++")}function Ft(e){var n;const t=e.some(o=>Ot(o)),l=e.some(o=>Lt(o));return t&&l||mn(i.node.language)&&(t||l)||mn(lt(String((n=i.node.raw)!=null?n:"")))&&(t||l)}const Cl=g(()=>hn.value?(function(){var e,n,t;const l=String((e=i.node.code)!=null?e:"").split(/\r\n|\n|\r/);if(Ft(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 d=0,r=o.length-1,u=a.length-1;for(;d<=r&&d<=u&&o[d]===a[d];)d++;let c=0;for(;r>=d&&u>=d&&o[r]===a[u];)c++,r--,u--;const s=Math.max(0,r-d+1),m=Math.max(0,u-d+1);return Math.max(1,d+s+m+c)})():(function(){var e;const n=String((e=i.node.code)!=null?e:"").split(/\r\n|\n|\r/);if(!Ft(n)&&(i.node.originalCode!=null||i.node.updatedCode!=null))return Math.max(Et(i.node.originalCode),Et(i.node.updatedCode));let t=0,l=0;for(const o of n)Ot(o)?t++:(Lt(o)||t++,l++);return Math.max(1,t,l)})()),xl=g(()=>{var e;const n=(e=i.monacoOptions)==null?void 0:e.tabSize;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:4}),Rn=g(()=>{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}}),wn=g(()=>{const e=i.estimatedContentHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null});function bn(e){if(e==null)return null;const n=Math.ceil(e);return!Number.isFinite(n)||n<=0?null:Math.min(n,Math.ceil(We()))}const Ze=g(()=>f.value?Math.ceil(Cl.value*Wn.value):wn.value!=null?null:Math.ceil((e=>{const n=String(e??"");return n?Math.max(1,n.split(/\r\n|\n|\r/).length):1})(Xe.value)*(Bt.value+Mn)+1)),_n=g(()=>{if(f.value){const n=Ze.value,t=qn();return bn(t!=null&&n!=null?Math.max(n,t):t??n)}const e=wn.value;return bn(e??Ze.value)}),Ml=g(()=>{const e=i.estimatedHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}),An=L(null),In=L(null);function ke(){const e=An.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}function jn(){return f.value&&i.stream!==!1&&(i.loading!==!1||ge.value||K.value||Q.value)}function qn(){if(!jn())return null;const e=In.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}function $t(e){if(!jn()||e==null)return;const n=Math.min(Math.ceil(e),Math.ceil(We()));if(!Number.isFinite(n)||n<=0)return;const t=qn();In.value=t==null?n:Math.max(t,n)}const Un=g(()=>{const e=ke();return e??(ge.value||!I.value?_n.value:null)}),Pl=g(()=>{var e;const n=(e=i.monacoOptions)==null?void 0:e.fontFamily,t=bn(wn.value),l=bn(Ze.value),o=H(H({fontSize:`${Dn.value}px`,lineHeight:`${Wn.value}px`,tabSize:xl.value,boxSizing:"border-box",maxHeight:`${We()}px`,overflow:"auto",paddingTop:`${Rn.value.top}px`,paddingBottom:`${Rn.value.bottom}px`},f.value?(function(a){if(a==null)return{};const d=Math.ceil(a),r=Math.ceil(We()),u=Math.min(d,r);return d>=r?{height:`${u}px`,minHeight:`${u}px`}:{minHeight:`${d}px`}})(_n.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"]=`${Rn.value.top}px`,o["--markstream-code-padding-left"]="62px",o["--markstream-pre-line-number-width"]="36px",o["--markstream-pre-line-number-gap"]="0px",f.value&&(o["--markstream-pre-diff-line-height"]=`${Wn.value}px`,o["--markstream-pre-diff-pane-bottom-padding"]="10px"),o}),Ht=g(()=>Un.value!=null&&(!I.value||ke()!=null)),Bl=g(()=>{const e=Un.value;if(e==null)return null;if(f.value)return Math.ceil(e);const n=Ml.value,t=wn.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)}),El=g(()=>{if(f.value&&ge.value)return;const e=Un.value;return Ht.value&&e!=null?{minHeight:`${e}px`}:void 0});function Vn(){Qe!=null&&typeof window<"u"&&window.clearTimeout(Qe),Qe=null}function Nt(){if(!f.value||!ie.value||!I.value||K.value||Q.value)return!1;const e=b.value;return!!e&&At(e)}function zt(e,n=!1,t={}){const l=Math.ceil(e),o=ke();if(o==null)return l;const a=t.allowBelowEstimatedFloor===!0||Nt();return l>=o||a?((n||a)&&ie.value&&(An.value=null),l):o}function ce(){return new Promise(e=>{V(()=>e())})}function Tt(){try{const e=b.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 Jn(){var e,n,t,l,o;try{const a=f.value?(t=(n=(e=z())==null?void 0:e.getModifiedEditor)==null?void 0:n.call(e))!=null?t:z():Y(),d=Ve(),r=(l=d?.EditorOption)==null?void 0:l.fontInfo;if(a&&r!=null){const u=(o=a.getOption)==null?void 0:o.call(a,r),c=u?.fontSize;if(typeof c=="number"&&Number.isFinite(c)&&c>0)return c}}catch{}try{const a=b.value;if(a){const d=a.querySelector(".view-lines .view-line");if(d)try{if(typeof window<"u"&&typeof window.getComputedStyle=="function"){const r=window.getComputedStyle(d).fontSize,u=r&&r.match(/^(\d+(?:\.\d+)?)/);if(u)return Number.parseFloat(u[1])}}catch{}}}catch{}return null}function De(e){var n,t;try{const a=Ve(),d=(n=a?.EditorOption)==null?void 0:n.lineHeight;if(d!=null){const r=(t=e?.getOption)==null?void 0:t.call(e,d);if(typeof r=="number"&&r>0)return r}}catch{}const l=Tt();if(l&&l>0)return l;const o=Number.isFinite($.value)&&$.value>0?$.value:14;return Math.max(12,Math.round(1.35*o))}function Dt(e){var n,t,l;try{const r=Ve(),u=(n=r?.EditorOption)==null?void 0:n.padding;if(u!=null){const c=(t=e?.getOption)==null?void 0:t.call(e,u),s=typeof c?.top=="number"?c.top:0,m=typeof c?.bottom=="number"?c.bottom:0;if(s>0||m>0)return s+m}}catch{}const o=(l=A.value)==null?void 0:l.padding,a=typeof o?.top=="number"?o.top:0,d=typeof o?.bottom=="number"?o.bottom:0;return a>0||d>0?a+d:f.value?24:0}function Wt(e,n){return typeof e!="number"||typeof n!="number"||e<1||n<e?0:n-e+1}function Rt(e){if(!e)return[];const n=e.split(/\r?\n/);return n.length===1&&n[0]===""?[]:n}function Gn(){var e,n;f.value?Ee.value=(function(t,l){const o=Rt(t),a=Rt(l);let d=0,r=o.length-1,u=a.length-1;for(;d<=r&&d<=u&&o[d]===a[d];)d++;for(;r>=d&&u>=d&&o[r]===a[u];)r--,u--;return{removed:Math.max(0,r-d+1),added:Math.max(0,u-d+1)}})(String((e=i.node.originalCode)!=null?e:""),String((n=i.node.updatedCode)!=null?n:"")):Ee.value={removed:0,added:0}}function Oe(){var e;if(f.value)try{const n=z(),t=(e=n?.getLineChanges)==null?void 0:e.call(n);if(!Array.isArray(t))return void Gn();let l=0,o=0;for(const a of t)l+=Wt(a.originalStartLineNumber,a.originalEndLineNumber),o+=Wt(a.modifiedStartLineNumber,a.modifiedEndLineNumber);Ee.value={removed:l,added:o}}catch{Gn()}else Ee.value={removed:0,added:0}}function Yn(){var e;if(Number.isFinite($.value)&&$.value>0&&Number.isFinite(X.value))return $.value;const n=Jn();return typeof((e=i.monacoOptions)==null?void 0:e.fontSize)=="number"?(X.value=i.monacoOptions.fontSize,$.value=i.monacoOptions.fontSize,$.value):n&&n>0?(X.value=n,$.value=n,n):(X.value=12,$.value=12,12)}function Ol(){const e=Yn(),n=Math.min(36,e+1);$.value=n}function Ll(){const e=Yn(),n=Math.max(10,e-1);$.value=n}function Fl(){Yn(),Number.isFinite(X.value)&&($.value=X.value)}function _t(){var e,n,t,l,o,a,d,r,u,c,s,m,h,y;try{const p=f.value?z():null,v=f.value?p:Y();if(!v)return null;if(p?.getOriginalEditor&&p?.getModifiedEditor){const S=(e=p.getOriginalEditor)==null?void 0:e.call(p),E=(n=p.getModifiedEditor)==null?void 0:n.call(p);(t=S?.layout)==null||t.call(S),(l=E?.layout)==null||l.call(E);const M=((o=S?.getContentHeight)==null?void 0:o.call(S))||0,ae=((a=E?.getContentHeight)==null?void 0:a.call(E))||0,R=Math.max(M,ae);if(R>0)return Math.ceil(R+1);const ee=((u=(r=(d=S?.getModel)==null?void 0:d.call(S))==null?void 0:r.getLineCount)==null?void 0:u.call(r))||1,W=((m=(s=(c=E?.getModel)==null?void 0:c.call(E))==null?void 0:s.getLineCount)==null?void 0:m.call(s))||1,oe=Math.max(ee,W),rt=Math.max(De(S),De(E));return Math.ceil(oe*(rt+Mn)+0+1)}if(v?.getContentHeight){(h=v?.layout)==null||h.call(v);const S=v.getContentHeight();if(S>0)return Math.ceil(S+1)}const x=(y=v?.getModel)==null?void 0:y.call(v);let B=1;x&&typeof x.getLineCount=="function"&&(B=x.getLineCount());const D=De(v);return Math.ceil(B*(D+Mn)+0+1)}catch{return null}}function At(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 Kn(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 u=l.length===3?l.split("").map(c=>`${c}${c}`).join(""):l;return .2126*Number.parseInt(u.slice(0,2),16)+.7152*Number.parseInt(u.slice(2,4),16)+.0722*Number.parseInt(u.slice(4,6),16)}const o=t.match(/\d+(?:\.\d+)?/g);if(!o||o.length<3)return null;const[a,d,r]=o.slice(0,3).map(Number);return .2126*a+.7152*d+.0722*r}function It(){var e;const n=(e=b.value)==null?void 0:e.parentElement;return n instanceof HTMLElement?n:null}function en(e,n){var t;n==null||!Number.isFinite(n)||n<=0||(t=It())==null||t.style.setProperty(e,`${n}px`)}function Sn(){var e,n,t;if(jt())return;const l=Jn();l&&l>0&&(Tn.value=l,$.value=l,X.value=l);try{const o=De(f.value?(t=(n=(e=z())==null?void 0:e.getModifiedEditor)==null?void 0:n.call(e))!=null?t:z():Y());o&&o>0&&(gn.value=o)}catch{}try{const o=Tt();o&&o>0&&(gn.value=o)}catch{}}function jt(){return f.value&&Mt.value}function nn(){var e;if(!f.value||!ge.value&&!K.value&&!Q.value)return null;const n=b.value,t=(e=me.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(We())}px`,n.style.overflow="hidden",l)}function Qn(){var e,n,t,l,o,a,d,r;const u=b.value,c=me.value;if(!u||!c)return;const s=u,m=u.querySelector(".monaco-editor")||u,h=m.querySelector(".monaco-editor-background")||m,y=m.querySelector(".view-lines")||m;let p=null,v=null,x=null;try{typeof window<"u"&&typeof window.getComputedStyle=="function"&&(p=window.getComputedStyle(m),v=h===m?p:window.getComputedStyle(h),x=y===m?p:window.getComputedStyle(y))}catch{p=null,v=null,x=null}const B=String((e=p?.getPropertyValue("--vscode-editor-foreground"))!=null?e:"").trim(),D=String((n=p?.getPropertyValue("--vscode-editor-background"))!=null?n:"").trim(),S=String((l=(t=p?.getPropertyValue("--vscode-editor-selectionBackground"))!=null?t:p?.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?l:"").trim(),E=B||String((a=(o=x?.color)!=null?o:p?.color)!=null?a:"").trim(),M=D||String((r=(d=v?.backgroundColor)!=null?d:p?.backgroundColor)!=null?r:"").trim();return f.value?(E?(c.style.setProperty("--markstream-diff-editor-fg",E),s.style.setProperty("--vscode-editor-foreground",E),s.style.setProperty("--stream-monaco-editor-fg",E)):(c.style.removeProperty("--markstream-diff-editor-fg"),s.style.removeProperty("--vscode-editor-foreground"),s.style.removeProperty("--stream-monaco-editor-fg")),M?(c.style.setProperty("--markstream-diff-editor-bg",M),c.style.setProperty("--markstream-diff-panel-bg",M),c.style.setProperty("--markstream-diff-panel-bg-soft",M),c.style.setProperty("--markstream-diff-panel-bg-strong",M),s.style.setProperty("--vscode-editor-background",M),s.style.setProperty("--stream-monaco-editor-bg",M),s.style.setProperty("--stream-monaco-fixed-editor-bg",M),s.style.setProperty("--stream-monaco-panel-bg",M),s.style.setProperty("--stream-monaco-panel-bg-soft",M),s.style.setProperty("--stream-monaco-panel-bg-strong",M),s.style.backgroundColor=M):(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"),s.style.removeProperty("--vscode-editor-background"),s.style.removeProperty("--stream-monaco-editor-bg"),s.style.removeProperty("--stream-monaco-fixed-editor-bg"),s.style.removeProperty("--stream-monaco-panel-bg"),s.style.removeProperty("--stream-monaco-panel-bg-soft"),s.style.removeProperty("--stream-monaco-panel-bg-strong"),s.style.backgroundColor=""),void(S?s.style.setProperty("--vscode-editor-selectionBackground",S):s.style.removeProperty("--vscode-editor-selectionBackground"))):(function(ae,R,ee){if(!yt.value)return!1;const W=Kn(ae),oe=Kn(R);return ee?W!=null&&W>170||oe!=null&&oe<110:W!=null&&W<85||oe!=null&&oe>190})(M,E,c.classList.contains("is-dark"))?(s.style.removeProperty("--vscode-editor-foreground"),s.style.removeProperty("--vscode-editor-background"),void s.style.removeProperty("--vscode-editor-selectionBackground")):(E&&s.style.setProperty("--vscode-editor-foreground",E),M&&s.style.setProperty("--vscode-editor-background",M),void(S&&s.style.setProperty("--vscode-editor-selectionBackground",S)))}let Xn=0,Zn=0;const qt=/auto|scroll|overlay/i;function fe(e,n,t){var l;if(typeof window>"u"||f.value||(function(s){return xt.value||Ct(s)})(e))return;const o=Math.ceil(n),a=Math.ceil(t)-o;if(Math.abs(a)<=1)return;const d=(function(s){var m,h;if(typeof window>"u")return null;const y=(m=s?.ownerDocument)!=null?m:document,p=y.scrollingElement||y.documentElement||y.body;let v=(h=s?.parentElement)!=null?h:null;for(;v&&v!==y.body&&v!==p;){const x=window.getComputedStyle(v),B=(x.overflowY||"").toLowerCase(),D=(x.overflow||"").toLowerCase();if(qt.test(B)||qt.test(D))return v;v=v.parentElement}return p})(e);if(!d)return;const r=(l=e.ownerDocument)!=null?l:document,u=d===r.body||d===r.documentElement||d===r.scrollingElement,c=u?0:d.getBoundingClientRect().top;e.getBoundingClientRect().top-c>=0||(u&&typeof window.scrollBy=="function"?window.scrollBy(0,a):d.scrollTop+=a)}function et(){try{const e=b.value;if(!e)return;const n=e.getBoundingClientRect().height,t=_t();if(t!=null&&t>0){const o=zt(t,!0),a=ke();return e.style.minHeight=a!=null?`${a}px`:"0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",void fe(e,n,o)}const l=ke();l!=null&&(e.style.minHeight=`${l}px`,e.style.height=`${l}px`,e.style.maxHeight="none",e.style.overflow="visible",fe(e,n,l))}catch{}}function tn(){for(var e,n;He.length>0;)try{(n=(e=He.pop())==null?void 0:e.dispose)==null||n.call(e)}catch{}$e!=null&&(mo($e),$e=null)}function Le(){for(var e;Hn.length>0;)try{(e=Hn.pop())==null||e()}catch{}}function j(e=!1){be.value||(se.value?et():(function(){var n;try{const t=b.value;if(!t)return;const l=t.getBoundingClientRect().height,o=We(),a=Math.ceil(((n=t.getBoundingClientRect)==null?void 0:n.call(t).height)||0),d=f.value?(function(){var v,x,B,D,S,E,M,ae;try{const R=z(),ee=(v=R?.getOriginalEditor)==null?void 0:v.call(R),W=(x=R?.getModifiedEditor)==null?void 0:x.call(R);if(!ee||!W)return null;const oe=((S=(D=(B=ee.getModel)==null?void 0:B.call(ee))==null?void 0:D.getLineCount)==null?void 0:S.call(D))||1,rt=((ae=(M=(E=W.getModel)==null?void 0:E.call(W))==null?void 0:M.getLineCount)==null?void 0:ae.call(M))||1,jl=Math.max(oe,rt),ql=Math.max(De(ee),De(W)),Ul=Math.max(Dt(ee),Dt(W));return Math.ceil(jl*(ql+Mn)+Ul+0+1)}catch{return null}})():null,r=f.value&&At(t),u=r&&ie.value&&I.value&&!K.value&&!Q.value;if(r||(Be.value=null),On>0&&(On--,Pe.value!=null))return void fe(t,l,Ce(t,Pe.value,o,{allowBelowEstimatedFloor:u}));if(f.value&&(ge.value||K.value||Q.value)){const v=nn();if(v!=null){const x=Ce(t,v,o,{allowBelowEstimatedFloor:!0});return ln(!0),void fe(t,l,x)}}const c=f.value?(function(v){var x,B;if(typeof window>"u")return null;try{const D=v.getBoundingClientRect(),S=window.getComputedStyle(v);if(S.display==="none"||S.visibility==="hidden")return null;const E=[".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 M=0;for(const ee of Array.from(v.querySelectorAll(E.join(",")))){if(!(ee instanceof HTMLElement))continue;const W=window.getComputedStyle(ee);if(W.display==="none"||W.visibility==="hidden"||Number.parseFloat(W.opacity||"1")<=.01)continue;const oe=ee.getBoundingClientRect();oe.height<=0||oe.bottom<=D.top||(M=Math.max(M,oe.bottom-D.top))}if(M>0)return Math.ceil(M);const ae=v.querySelector(".monaco-diff-editor"),R=(B=(x=ae?.getBoundingClientRect)==null?void 0:x.call(ae).height)!=null?B:0;return R>0?Math.ceil(R+1):null}catch{return null}})(t):null,s=f.value&&hn.value&&!r&&c!=null?Math.ceil(c+10):c;let m;if(m=f.value?r?c:hn.value&&s!=null?s:d!=null?Math.max(s??0,d):s:_t(),m!=null&&m>0){const v=Be.value!=null&&Date.now()<sn&&m>=o-1,x=r&&a>0&&a<o-1&&m>=o-1,B=Ce(t,v?Be.value:x?a:m,o,{clearEstimatedFloor:!0,allowBelowEstimatedFloor:u});return r&&B<o-1&&(Be.value=B,sn=Date.now()+160),void fe(t,l,B)}if(Pe.value!=null)return void fe(t,l,Ce(t,Pe.value,o,{allowBelowEstimatedFloor:u}));const h=r?a:Math.max(a,d!=null&&d>0?d:0);if(h>0){const v=Be.value!=null&&Date.now()<sn&&h>=o-1,x=r&&a>0&&a<o-1&&h>=o-1,B=Ce(t,v?Be.value:x?a:h,o,{allowBelowEstimatedFloor:u});return r&&B<o-1&&(Be.value=B,sn=Date.now()+160),void fe(t,l,B)}const y=ke();if(y!=null)return void fe(t,l,Ce(t,y,o,{allowBelowEstimatedFloor:u}));const p=Number.parseFloat(t.style.height);!Number.isNaN(p)&&p>0?fe(t,l,Ce(t,p,o,{allowBelowEstimatedFloor:u})):f.value||fe(t,l,Ce(t,o,o))}catch{}})())}function Ut(){Xn=0,Zn=0}function ln(e=!1){var n,t,l;const o=b.value;if(!o)return;const a=f.value?z():Y();if(a&&typeof a.layout=="function")try{const d=(n=o.getBoundingClientRect)==null?void 0:n.call(o),r=Math.ceil(((t=d?.width)!=null?t:0)||o.clientWidth||0),u=Math.ceil(((l=d?.height)!=null?l:0)||o.clientHeight||Number.parseFloat(o.style.height||"")||0);if(r>0&&u>0){if(!e&&r===Xn&&u===Zn)return;Xn=r,Zn=u,a.layout({width:r,height:u})}else Ut(),a.layout()}catch{}}function Z(){if(!f.value)return void Le();const e=b.value;if(!e)return void Le();const n=e.querySelector(".monaco-diff-editor");if(!n||n.classList.contains("side-by-side"))return void Le();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 d=l[a],r=d.querySelector("a"),u=d.querySelector(".center > div:first-child"),c=d.querySelector(".center");if(!r||!u||!c||c.querySelector(".markstream-inline-fold-proxy"))continue;const s=document.createElement("button");s.type="button",s.className="markstream-inline-fold-proxy",s.dataset.markstreamInlineFoldProxy="true";const m=r.getAttribute("title")||"Show Unchanged Region";s.title=m,s.setAttribute("aria-label",m);const h=v=>{v.preventDefault(),v.stopPropagation()},y=v=>{v.preventDefault(),v.stopPropagation(),r.click(),V(()=>q())},p=v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.stopPropagation(),r.click(),V(()=>q()))};s.addEventListener("mousedown",h),s.addEventListener("click",y),s.addEventListener("keydown",p),c.appendChild(s),Hn.push(()=>{s.removeEventListener("mousedown",h),s.removeEventListener("click",y),s.removeEventListener("keydown",p),s.parentElement===c&&c.removeChild(s)})}}function q(e=!1){$e==null&&($e=V(()=>{$e=null,V(()=>{Z(),j(e),ln()})}))}function Ce(e,n,t,l={}){$t(n);const o=qn(),a=o!=null?Math.max(n,o):n,d=Math.min(a,t),r=l.allowBelowEstimatedFloor===!0||Nt(),u=zt(d,l.clearEstimatedFloor===!0,{allowBelowEstimatedFloor:r}),c=ke();if(e.style.minHeight=c==null||r?"0px":`${Math.min(c,Math.ceil(t))}px`,e.style.height=`${u}px`,e.style.maxHeight=`${Math.ceil(t)}px`,f.value)e.style.overflow="hidden";else{const s=a>t+1;e.style.overflow=s?"auto":"hidden"}return u}function Vt(e=b.value){return!!e?.querySelector(".monaco-diff-editor .view-lines .view-line")}function $l(){const e=z();return typeof e?.getOriginalEditor=="function"||typeof e?.getModifiedEditor=="function"||typeof e?.getLineChanges=="function"}function Jt(e,n,t){return N(this,null,function*(){try{return void(yield vn(e,n,t))}catch(l){if(!Ke(l))throw l}if(yield ne(),yield ce(),!F&&f.value)try{yield vn(e,n,t)}catch(l){if(!Ke(l))throw l}})}function We(){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 nt=g(()=>i.isShowPreview&&(de.value==="html"||de.value==="svg"));function Gt(){return typeof i.node.loading=="boolean"?i.node.loading:i.loading===!0}function Yt(e,n,t){return t&&!String(n??"")?"plain":ol(String(e??""))}function Kt(){var e,n,t,l;return!(!Gt()||(f.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:"")))}U(()=>[i.node.language,i.node.code,i.node.loading,i.loading],([e,n,t,l])=>{de.value=Yt(e,n,typeof t=="boolean"?t:l===!0)}),U(()=>[i.node.originalCode,i.node.updatedCode,f.value],()=>{Gn(),V(()=>Oe())},{immediate:!0}),U(()=>[f.value,i.stream,i.loading,ge.value,K.value,Q.value,Ze.value],()=>{jn()?$t(Ze.value):In.value=null},{immediate:!0}),U(()=>[i.node.originalCode,i.node.updatedCode,pe.value,f.value],e=>N(null,[e],function*([,,,n]){var t,l;if(i.stream===!1||!n)return;if(le&&!te.value&&b.value)try{yield Re(b.value)}catch{}const o=Ge;if(o&&!Me.value){try{yield o}catch{}if(F||!f.value)return}const a=zn(String((t=i.node.originalCode)!=null?t:""),String((l=i.node.updatedCode)!=null?l:"")),d=i.loading===!1;d&&Fe();try{yield Jt(a.original,a.updated,pe.value),ln(!0)}catch{return}if(d){if(F||!f.value)return;Ne(),Z(),Oe(),q()}se.value&&V(()=>et())})),U(()=>i.node.code,e=>N(null,null,function*(){if(i.stream===!1||(de.value||(de.value=ol(gt(e))),f.value))return;const n=Ge;if(n&&!Me.value){try{yield n}catch{}if(F||f.value)return}if(le&&!te.value&&b.value)try{yield Re(b.value)}catch{}fn(pn(i.node.code,i.node.loading===!0),pe.value),se.value&&V(()=>et())}));const tt=g(()=>{const e=de.value;return e?al[e]||e.charAt(0).toUpperCase()+e.slice(1):al[""]});function lt(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 Qt=g(()=>{var e;return(function(n){const t=lt(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 d=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(d&&/[./\\-]/.test(d))return d}return""})(String((e=i.node.raw)!=null?e:""))}),Hl=g(()=>Qt.value||tt.value),Xt=g(()=>Qt.value?f.value?`Diff / ${tt.value}`:tt.value:""),Nl=g(()=>(oo.value,io(de.value||""))),zl=g(()=>{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),Ht.value&&!f.value){const o=Bl.value;o!=null&&(e.minHeight=`${o}px`)}return f.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}),Zt=g(()=>i.showTooltips!==!1);function Tl(){return N(this,null,function*(){try{typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(i.node.code)),En.value=!0,ue("copy",i.node.code),setTimeout(()=>{En.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})}function Dl(e){if(se.value=!se.value,e&&Zt.value){const l=(function(o){const a=o.currentTarget||o.target;return!a||a.disabled?null:a})(e);if(l){const o=se.value?G("common.collapse")||"Collapse":G("common.expand")||"Expand";ro(l,o,"top",!1,void 0,i.isDark)}}const n=f.value?z():Y(),t=b.value;n&&t&&(se.value?(kn(!0),t.style.maxHeight="none",t.style.overflow="visible",j(!0)):(kn(!1),t.style.overflow=f.value?"hidden":"auto",j(!0)))}function Wl(){var e,n,t;if(be.value=!be.value,be.value){if(b.value){const l=Math.ceil(((n=(e=b.value).getBoundingClientRect)==null?void 0:n.call(e).height)||0);l>0&&(Pe.value=l)}kn(!1)}else{se.value&&kn(!0),b.value&&Pe.value!=null&&(b.value.style.height=`${Pe.value}px`);const l=f.value?z():Y();try{(t=l?.layout)==null||t.call(l)}catch{}On=2,V(()=>{j(!0)})}}function Rl(){if(!nt.value)return;const e=de.value;if(we.value){const n=e==="html"?"text/html":"image/svg+xml",t=e==="html"?G("artifacts.htmlPreviewTitle")||"HTML Preview":G("artifacts.svgPreviewTitle")||"SVG Preview";return void ue("previewCode",{node:i.node,artifactType:n,artifactTitle:t,id:`temp-${e}-${Date.now()}`})}e==="html"&&(yn.value=!yn.value)}function kn(e){var n,t;try{if(f.value){const l=z();(n=l?.updateOptions)==null||n.call(l,{automaticLayout:e})}else{const l=Y();(t=l?.updateOptions)==null||t.call(l,{automaticLayout:e})}}catch{}}function Re(e){if(!le||F||Kt())return null;if(he)return he;if(te.value&&ie.value)return Promise.resolve();te.value=!0,(function(){const t=P.value;_&&t&&Se!==t&&(Se&&_.markSettled(Se),Se=t,_.markPending(t))})();const n=N(null,null,function*(){yield(function(t){return N(this,null,function*(){var l;if(typeof window>"u")return yield t();try{const o=(l=window.Element)==null?void 0:l.prototype,a=o?.addEventListener;if(!o||!a)return yield t();const d=(function(){const r=window,u=r[cl];if(u)return u;const c={depth:0,original:null};return r[cl]=c,c})();d.depth===0&&(d.original=a,o.addEventListener=function(r,u,c){var s;const m=(s=d.original)!=null?s:a;return r==="touchstart"&&(function(h,y){if(!h)return!1;const p=h;return!(typeof p.closest!="function"||!p.closest(".monaco-editor, .monaco-diff-editor")||y&&typeof y=="object"&&"passive"in y)})(this,c)?m.call(this,r,u,(function(h){return h==null?{passive:!0}:typeof h=="boolean"?{capture:h,passive:!0}:typeof h=="object"?"passive"in h?h:ve(H({},h),{passive:!0}):{passive:!0}})(c)):m.call(this,r,u,c)}),d.depth++;try{return yield t()}finally{d.depth=Math.max(0,d.depth-1),d.depth===0&&d.original&&o.addEventListener!==d.original&&(o.addEventListener=d.original,d.original=null)}}catch{return yield t()}})})(()=>(function(t){return N(this,null,function*(){var l;if(!le||F||(Te.value=!1,Me.value=!1,I.value=!1,K.value=!1,Q.value=!1,Vn(),Tn.value=null,gn.value=null,(function(){const r=It();r&&(r.style.removeProperty("--stream-monaco-line-number-left"),r.style.removeProperty("--stream-monaco-line-number-width"),r.style.removeProperty("--stream-monaco-line-number-gap-to-code"),r.style.removeProperty("--stream-monaco-original-line-number-gap-to-code"),r.style.removeProperty("--stream-monaco-modified-line-number-gap-to-code"),r.style.removeProperty("--stream-monaco-original-scrollable-left"),r.style.removeProperty("--stream-monaco-modified-scrollable-left"))})(),Ut(),(function(){const r=_n.value;An.value=ie.value||r==null?null:r})(),tn(),Le(),(function(r){r.replaceChildren()})(t),Fe(),F))return;const o=N(null,null,function*(){var r,u;if(f.value){(function(){if(wt||typeof window>"u")return;wt=!0;const s=m=>{var h;Ke("reason"in m?m.reason:(h=m.error)!=null?h:m.message)&&(m.preventDefault(),m.stopImmediatePropagation())};window.addEventListener("error",s,!0),window.addEventListener("unhandledrejection",s,!0)})(),Je();const c=zn(String((r=i.node.originalCode)!=null?r:""),String((u=i.node.updatedCode)!=null?u:""));cn?yield cn(t,c.original,c.updated,pe.value):yield le(t,i.node.code,pe.value)}else yield le(t,Xe.value,pe.value);Me.value=!0}),a=o.finally(()=>{Ge===a&&(Ge=null)});if(Ge=a,yield(function(r){return N(this,null,function*(){if(!f.value)return void(yield r);let u,c=!1;for(r.then(()=>{c=!0},s=>{c=!0,u=s});;){if(F)return;if(c){if(u)throw u;return}if(Vt()&&$l())return;yield ne(),yield ce()}})})(a),F)return;Me.value=!0;const d=f.value?z():Y();if(typeof((l=i.monacoOptions)==null?void 0:l.fontSize)=="number")d?.updateOptions({fontSize:i.monacoOptions.fontSize,automaticLayout:!1}),X.value=i.monacoOptions.fontSize,$.value=i.monacoOptions.fontSize;else if(!jt()){const r=Jn();r&&r>0?(X.value=r,$.value=r):(X.value=12,$.value=12)}Sn(),se.value||be.value||j(!1),yield(function(){return N(this,null,function*(){ke()!=null&&(Z(),j(!1),yield ne(),yield ce(),Z(),j(!1),yield ce(),Z(),j(!1))})})(),F||(ie.value=!0,(function(){var r,u,c,s,m;if(tn(),f.value){const y=z(),p=(r=y?.getOriginalEditor)==null?void 0:r.call(y),v=(u=y?.getModifiedEditor)==null?void 0:u.call(y),x=(B,D)=>{try{const S=B?.[D];if(typeof S!="function")return;const E=S.call(B,()=>q());E&&He.push(E)}catch{}};try{const B=(c=y?.onDidUpdateDiff)==null?void 0:c.call(y,()=>{q(),V(()=>Oe())});B&&He.push(B)}catch{}return x(p,"onDidContentSizeChange"),x(v,"onDidContentSizeChange"),x(p,"onDidLayoutChange"),void x(v,"onDidLayoutChange")}const h=Y();try{const y=(s=h?.onDidContentSizeChange)==null?void 0:s.call(h,()=>q());y&&He.push(y)}catch{}try{const y=(m=h?.onDidLayoutChange)==null?void 0:m.call(h,()=>q());y&&He.push(y)}catch{}})(),Qn(),Sn(),Z(),Oe(),q(),yield(function(){return N(this,null,function*(){Z(),j(!1),yield ne(),yield ce(),Z(),j(!1),yield ce(),Z(),j(!1)})})(),yield(function(){return N(this,null,function*(){var r;if(f.value){for(let u=0;u<8;u++){if(F)return;const c=b.value,s=z();let m=!1;try{const p=(r=s?.getLineChanges)==null?void 0:r.call(s);m=Array.isArray(p)}catch{m=!1}const h=!!c?.querySelector(".monaco-diff-editor"),y=Vt(c);if(h&&y&&m){if(yield ne(),yield ce(),F)return;try{Ne(),Z(),Oe(),q()}catch{}return}if(u>=1&&!h)return;yield ne(),yield ce()}if(!F)try{Ne(),Z(),Oe(),q()}catch{}}})})(),F||(Sn(),(function(){if(!f.value)return;const r=b.value;if(!r)return;const u=r.querySelector(".monaco-diff-editor");function c(s,m,h,y){const p=s.querySelector(m);if(!p)return;const v=p.getBoundingClientRect();if(v.width<=0)return;const x=p.querySelector(".line-numbers"),B=p.querySelector(".view-lines .view-line"),D=p.querySelector(".margin");let S=null;if(B?(S=B.getBoundingClientRect().left-v.left,en(h,S)):D&&(S=D.getBoundingClientRect().width,en(h,S)),x){const E=x.getBoundingClientRect();if(E.width>=20&&E.width<=64&&en("--stream-monaco-line-number-width",E.width),S!=null){const M=S-(E.right-v.left);Number.isFinite(M)&&M>=0&&M<=32&&(en(y,M),en("--stream-monaco-line-number-gap-to-code",M))}}}u&&(c(u,".editor.original","--stream-monaco-original-scrollable-left","--stream-monaco-original-line-number-gap-to-code"),c(u,".editor.modified","--stream-monaco-modified-scrollable-left","--stream-monaco-modified-line-number-gap-to-code"))})(),yield ne(),nn(),yield ce(),yield(function(){return N(this,null,function*(){if(f.value){if(nn(),K.value=!0,Q.value=!1,I.value=!0,yield ne(),nn(),yield ce(),nn(),!F){if(ln(!0),Q.value=!0,Vn(),typeof window>"u")return K.value=!1,void(Q.value=!1);Qe=window.setTimeout(()=>{Qe=null,K.value=!1,Q.value=!1,V(()=>{Sn(),Z(),q()})},120)}}else I.value=!0})})()))})})(e))}).finally(()=>{he===n&&(he=null),(function(){const t=Se;_&&t&&(Se="",ne(()=>{var l,o;if(!F){const a=(o=(l=me.value)==null?void 0:l.offsetHeight)!=null?o:0;a>0&&_.reportHeight(t,a)}_.markSettled(t)}))})()});return he=n,n}U(Zt,e=>{e||Xl()}),U(()=>$.value,(e,n)=>{const t=f.value?z():Y();t&&typeof e=="number"&&Number.isFinite(e)&&e>0&&(t.updateOptions({fontSize:e}),be.value||j(!0))},{flush:"post",immediate:!1});const _l=U(()=>[b.value,f.value,i.stream,i.loading,qe.value,re.value,i.node.code,i.node.loading],e=>N(null,[e],function*([n,t,l,o,a,d]){if(!n||!le||!d||l===!1&&o!==!1||Kt())return;const r=Re(n);if(r){try{yield r}catch{ie.value=!1,I.value=!1,Te.value=!0}_l()}}));function el(e){return!!e&&typeof e=="object"&&"light"in e&&"dark"in e}function _e(e){return typeof e=="string"?e:e&&typeof e=="object"&&"name"in e?String(e.name):null}function nl(e,n){if(e===n)return!0;const t=_e(e),l=_e(n);return!!t&&t===l}function on(){var e;const n=(function(){if(i.theme!==void 0){const u=i.theme;return el(u)?i.isDark?u.dark:u.light:u}return i.isDark?i.darkTheme:i.lightTheme})(),t=(e=A.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=_e(l),d=o.map(u=>_e(u)).filter(u=>!!u);if(!a||d.includes(a))return l;const r=_e(t);return t!=null&&r&&d.includes(r)?t:o[0]}U(kt,(e,n)=>N(null,null,function*(){if(e===n||(gl.value=e,!le||!b.value)||!te.value||i.stream===!1&&i.loading!==!1||!re.value)return;const t=he;if(t){try{yield t}catch{}if(F||!b.value)return}try{ie.value=!1,I.value=!1,te.value=!1,Me.value=!1,tn(),Le(),Je(),yield ne(),yield Re(b.value)}catch{ie.value=!1,I.value=!1,Te.value=!0}}));const ot=g(()=>(i.theme!==void 0?!el(i.theme):nl(i.darkTheme,i.lightTheme))?(function(e){var n,t;if(e&&typeof e=="object"&&((n=e.colors)!=null&&n["editor.background"])){const o=Kn(e.colors["editor.background"]);if(o!=null)return o<128}const l=((t=_e(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})(on()):!!i.isDark),it=g(()=>{var e;if(!f.value)return ot.value?"dark":"light";const n=(e=A.value)==null?void 0:e.diffAppearance;return n==="light"||n==="dark"?n:ot.value?"dark":"light"}),Al=g(()=>f.value?it.value==="dark":ot.value);function tl(){const e=ve(H(ve(H({wordWrap:"on",wrappingIndent:"same",themes:i.themes},A.value||{}),{theme:on()}),f.value?{diffAppearance:it.value}:{}),{onThemeChange(){Qn()}}),n=(function(){var t;const l=(t=A.value)==null?void 0:t.fontFamily;return typeof l=="string"&&l.trim()?l.trim():f.value?(function(){var o;if(typeof window>"u")return;const a=(o=me.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 Fe(){const e=tl();if(!ye)return ye=e,ye;for(const n of Object.keys(ye))n in e||delete ye[n];return Object.assign(ye,e),ye}const Il=g(()=>{var e,n,t,l,o,a,d,r,u,c,s,m,h,y,p;return JSON.stringify({diffLineStyle:(n=(e=A.value)==null?void 0:e.diffLineStyle)!=null?n:"background",diffUnchangedRegionStyle:(l=(t=A.value)==null?void 0:t.diffUnchangedRegionStyle)!=null?l:"line-info",diffHideUnchangedRegions:((o=i.monacoOptions)==null?void 0:o.diffHideUnchangedRegions)===void 0?H({},Ye):Nn(i.monacoOptions.diffHideUnchangedRegions),renderSideBySide:(d=(a=A.value)==null?void 0:a.renderSideBySide)==null||d,useInlineViewWhenSpaceIsLimited:(u=(r=A.value)==null?void 0:r.useInlineViewWhenSpaceIsLimited)!=null&&u,enableSplitViewResizing:(s=(c=A.value)==null?void 0:c.enableSplitViewResizing)==null||s,ignoreTrimWhitespace:(h=(m=A.value)==null?void 0:m.ignoreTrimWhitespace)==null||h,originalEditable:(p=(y=A.value)==null?void 0:y.originalEditable)!=null&&p})});return U(()=>[i.monacoOptions,re.value],()=>{var e,n;if(Fe(),!le||!re.value)return;const t=f.value?z():Y(),l=typeof((e=i.monacoOptions)==null?void 0:e.fontSize)=="number"?i.monacoOptions.fontSize:Number.isFinite($.value)?$.value:void 0;typeof l=="number"&&Number.isFinite(l)&&l>0&&((n=t?.updateOptions)==null||n.call(t,{fontSize:l})),j(!1)},{deep:!0}),U(()=>[on(),it.value,qe.value,te.value,re.value],([e],n)=>{qe.value&&te.value&&re.value&&(function(t={}){if(t.appearanceOnly)return;Fe();const l=on(),o=()=>{f.value&&Ne(),V(()=>{Qn(),q()})};l?(function(a,d){const r=(function(u){if(u==null)return null;if(typeof u=="string")return u;if(typeof u=="object"&&"name"in u)return String(u.name);if(typeof u=="object"){const c=mt.get(u);if(c)return c;try{const m=JSON.stringify(u);if(m)return mt.set(u,m),m}catch{}const s="__theme_"+ ++Bo;return mt.set(u,s),s}return String(u)})(d);return r?(vt=a,Ae||ft!==r?Ae?(Ie===r||ct===r||(dn=d,Ie=r),Ae):(dn=d,Ie=r,Ae=N(null,null,function*(){for(;Ie&&dn!=null;){const u=dn,c=Ie;if(dn=null,Ie=null,ft!==c)try{ct=c,yield(vt??a)(u),ft=c}catch{}}}).finally(()=>{Ae=null,ct=null}),Ae):Promise.resolve()):Promise.resolve()})($n,l).then(o).catch(a=>{}):o()})({appearanceOnly:n!=null&&nl(e,n[0])})},{flush:"post"}),U(()=>[Il.value,qe.value,re.value],(e,n)=>N(null,[e,n],function*([t,l,o],[a]){if(Fe(),!l||!o||!le||!b.value||!te.value||t===a||i.stream===!1&&i.loading!==!1)return;const d=he;if(d){try{yield d}catch{}if(F||!b.value)return}try{ie.value=!1,I.value=!1,te.value=!1,Me.value=!1,tn(),Le(),Je(),yield ne(),yield Re(b.value)}catch{ie.value=!1,I.value=!1,Te.value=!0}}),{flush:"post"}),U(()=>[i.loading,re.value],(e,n)=>N(null,[e,n],function*([t,l],o){if(!l)return;const a=o?.[0];if(a===!1&&t!==!1&&f.value&&te.value&&(yield ne(),V(()=>{N(null,null,function*(){const r=he;if(r)try{yield r}catch{}!F&&f.value&&i.loading!==!1&&(Fe(),Ne(),q())})})),t)return;const d=a!==void 0&&a!==!1;yield ne(),V(()=>{N(null,null,function*(){var r,u;try{if(d&&te.value)if(f.value&&b.value){const c=he;if(c)try{yield c}catch{}Fe();const s=zn(String((r=i.node.originalCode)!=null?r:""),String((u=i.node.updatedCode)!=null?u:""));if(yield Jt(s.original,s.updated,pe.value),F||!f.value)return;Ne(),ln(!0),Z(),Oe(),q()}else fn(Xe.value,pe.value);j(!1)}catch{}})})}),{immediate:!0,flush:"post"}),pl(()=>{Vn(),tn(),Le(),Ln()}),(e,n)=>ze.value?(je(),Pn(pt(il),{key:0,node:Pt.value,loading:i.loading},null,8,["node","loading"])):(je(),rl("div",{key:1,ref_key:"container",ref:me,style:ut(zl.value),class:Bn(["code-block-container rounded-lg border",[{dark:i.isDark,"is-rendering":i.loading,"is-dark":Al.value,"is-diff":f.value,"is-plain-text":yt.value}]]),"data-markstream-code-block":"1","data-markstream-enhanced":I.value&&!ze.value?"true":"false","data-markstream-pending":Sl.value?"true":void 0},[Zl(po,{"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:k.stream,"is-collapsed":be.value,"is-expanded":se.value,"copy-text":En.value,"is-previewable":nt.value,"code-font-size":$.value,"code-font-min":10,"code-font-max":36,"default-code-font-size":X.value,"font-baseline-ready":kl.value,"diff-stats":f.value?Ee.value:null,"diff-stats-aria-label":yl.value,onToggleCollapse:Wl,onDecreaseFont:Ll,onResetFont:Fl,onIncreaseFont:Ol,onCopy:Tl,onToggleExpand:Dl,onPreview:Rl},eo({"header-left":Cn(()=>[at(e.$slots,"header-left",{},()=>[T("div",Oo,[T("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:Nl.value},null,8,Lo),T("div",Fo,[T("div",$o,ht(Hl.value),1),Xt.value?(je(),rl("div",Ho,ht(Xt.value),1)):dt("",!0)])])],!0)]),loading:Cn(()=>[at(e.$slots,"loading",{loading:k.loading,stream:k.stream},()=>[n[0]||(n[0]=T("div",{class:"loading-skeleton"},[T("div",{class:"skeleton-line"}),T("div",{class:"skeleton-line"}),T("div",{class:"skeleton-line short"})],-1))],!0)]),default:Cn(()=>[no(T("div",No,[T("div",{ref_key:"codeEditor",ref:b,class:Bn(["code-editor-container",[k.stream?"":"code-height-placeholder",{"is-hidden":bl.value}]]),style:ut(El.value)},null,6),Mt.value?(je(),Pn(pt(il),{key:0,class:Bn(["code-pre-fallback",{"is-wrap":wl.value,"is-fading-out":Q.value}]),style:ut(Pl.value),node:Pt.value,"show-line-numbers":!0,"diff-inline":hn.value},null,8,["class","style","node","diff-inline"])):dt("",!0)],512),[[to,!(be.value||!k.stream&&k.loading)]]),yn.value&&!we.value&&nt.value&&de.value==="html"?(je(),Pn(Po,{key:0,code:i.node.code,"html-preview-allow-scripts":i.htmlPreviewAllowScripts,"html-preview-sandbox":i.htmlPreviewSandbox,"is-dark":i.isDark,"on-close":()=>yn.value=!1},null,8,["code","html-preview-allow-scripts","html-preview-sandbox","is-dark","on-close"])):dt("",!0)]),_:2},[e.$slots["header-right"]?{name:"header-right",fn:Cn(()=>[at(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,Eo))}}),[["__scopeId","data-v-b5384753"]]);export{Wo 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 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,c6 as I,c2 as q}from"./index-CiC6jpjA.js";const G={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"},O=["aria-label"],U={class:"code-diff-stat removed"},Y={class:"code-diff-stat added"},K=["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&&I(l.currentTarget,e,"top",!1,void 0,t.isDark)}function h(){k.value&&q()}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",G,[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",U,"-"+p(a.diffStats.removed),1),o("span",Y,"+"+p(a.diffStats.added),1)],8,O)):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,K)):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
+ 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-DsKglRi9.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 +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-CiC6jpjA.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:q,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(q)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,j={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[j]:"-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-DsKglRi9.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};
@@ -0,0 +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-DQW_ubr6.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};