@dimi-agent/cli 0.1.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 (209) hide show
  1. package/README.md +63 -0
  2. package/dist/main.mjs +412209 -0
  3. package/dist-web/assets/CodeBlockNode-BL_lWHk1.js +28 -0
  4. package/dist-web/assets/DesignSystemView-Gp4T3sr4.js +13 -0
  5. package/dist-web/assets/DesignSystemView-VV_44Ep3.css +1 -0
  6. package/dist-web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  7. package/dist-web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  8. package/dist-web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  9. package/dist-web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  10. package/dist-web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  11. package/dist-web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  12. package/dist-web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  13. package/dist-web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  14. package/dist-web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  15. package/dist-web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  16. package/dist-web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  17. package/dist-web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  18. package/dist-web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  19. package/dist-web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  20. package/dist-web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  21. package/dist-web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  22. package/dist-web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  23. package/dist-web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  24. package/dist-web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  25. package/dist-web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  26. package/dist-web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  27. package/dist-web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  28. package/dist-web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  29. package/dist-web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  30. package/dist-web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  31. package/dist-web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  32. package/dist-web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  33. package/dist-web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  34. package/dist-web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  35. package/dist-web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  36. package/dist-web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  37. package/dist-web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  38. package/dist-web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  39. package/dist-web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  40. package/dist-web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  41. package/dist-web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  42. package/dist-web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  43. package/dist-web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  44. package/dist-web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  45. package/dist-web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  46. package/dist-web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  47. package/dist-web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  48. package/dist-web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  49. package/dist-web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  50. package/dist-web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  51. package/dist-web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  52. package/dist-web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  53. package/dist-web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  54. package/dist-web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  55. package/dist-web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  56. package/dist-web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  57. package/dist-web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  58. package/dist-web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  59. package/dist-web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  60. package/dist-web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  61. package/dist-web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  62. package/dist-web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  63. package/dist-web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  64. package/dist-web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  65. package/dist-web/assets/Tooltip-DsL7mF2H.js +1 -0
  66. package/dist-web/assets/__vite-optional-peer-dep_stream-diffs_markstream-vue-BIHI7g3E.js +1 -0
  67. package/dist-web/assets/arc-CWKkAytd.js +1 -0
  68. package/dist-web/assets/arc-Doj0wRZ0.js +1 -0
  69. package/dist-web/assets/architectureDiagram-3BPJPVTR-BxQA87W8.js +36 -0
  70. package/dist-web/assets/architectureDiagram-3BPJPVTR-CQ09RrbH.js +36 -0
  71. package/dist-web/assets/blockDiagram-GPEHLZMM-Bv-uKykJ.js +132 -0
  72. package/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js +132 -0
  73. package/dist-web/assets/c4Diagram-AAUBKEIU-BNwMmBwW.js +10 -0
  74. package/dist-web/assets/c4Diagram-AAUBKEIU-DtzacMnD.js +10 -0
  75. package/dist-web/assets/channel-B2QvGyDT.js +1 -0
  76. package/dist-web/assets/channel-DNkUo9e6.js +1 -0
  77. package/dist-web/assets/chunk-2J33WTMH-D0o9LNEb.js +1 -0
  78. package/dist-web/assets/chunk-2J33WTMH-w4sdiKFO.js +1 -0
  79. package/dist-web/assets/chunk-4BX2VUAB-C9DEPDT4.js +1 -0
  80. package/dist-web/assets/chunk-4BX2VUAB-WqrE2gaw.js +1 -0
  81. package/dist-web/assets/chunk-55IACEB6-B5dE1-Um.js +1 -0
  82. package/dist-web/assets/chunk-55IACEB6-DM4XnM9f.js +1 -0
  83. package/dist-web/assets/chunk-727SXJPM-Dky6n2gf.js +206 -0
  84. package/dist-web/assets/chunk-727SXJPM-Dn5wkDO_.js +206 -0
  85. package/dist-web/assets/chunk-AQP2D5EJ-DjmnKhuo.js +231 -0
  86. package/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js +231 -0
  87. package/dist-web/assets/chunk-FMBD7UC4-B2zs_Y-d.js +15 -0
  88. package/dist-web/assets/chunk-FMBD7UC4-wkNtOdUv.js +15 -0
  89. package/dist-web/assets/chunk-ND2GUHAM-Byh5s8MO.js +1 -0
  90. package/dist-web/assets/chunk-ND2GUHAM-C4-rwdcv.js +1 -0
  91. package/dist-web/assets/chunk-QZHKN3VN-C596rHAe.js +1 -0
  92. package/dist-web/assets/chunk-QZHKN3VN-_Rz9_NuS.js +1 -0
  93. package/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js +1 -0
  94. package/dist-web/assets/classDiagram-4FO5ZUOK-Cc_V2QfH.js +1 -0
  95. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js +1 -0
  96. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Cc_V2QfH.js +1 -0
  97. package/dist-web/assets/cose-bilkent-S5V4N54A-B5CIST3j.js +1 -0
  98. package/dist-web/assets/cose-bilkent-S5V4N54A-Bi19n8m-.js +1 -0
  99. package/dist-web/assets/cytoscape.esm-nFXppDBa.js +331 -0
  100. package/dist-web/assets/d2_markstream-vue-yoD6TSFD.js +1 -0
  101. package/dist-web/assets/dagre-BM42HDAG-DLMfLCoV.js +4 -0
  102. package/dist-web/assets/dagre-BM42HDAG-DQ2h_HWV.js +4 -0
  103. package/dist-web/assets/defaultLocale-CCNgq9ws.js +1 -0
  104. package/dist-web/assets/defaultLocale-DX6XiGOO.js +1 -0
  105. package/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js +43 -0
  106. package/dist-web/assets/diagram-2AECGRRQ-DcJgQFHi.js +43 -0
  107. package/dist-web/assets/diagram-5GNKFQAL-CHeEjhiL.js +10 -0
  108. package/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js +10 -0
  109. package/dist-web/assets/diagram-KO2AKTUF-CCF3txiw.js +3 -0
  110. package/dist-web/assets/diagram-KO2AKTUF-CFQs13i5.js +3 -0
  111. package/dist-web/assets/diagram-LMA3HP47-B5_nRmtD.js +24 -0
  112. package/dist-web/assets/diagram-LMA3HP47-He5zlyMt.js +24 -0
  113. package/dist-web/assets/diagram-OG6HWLK6-BdSBNBYS.js +24 -0
  114. package/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js +24 -0
  115. package/dist-web/assets/erDiagram-TEJ5UH35-CZ1Ubm9Y.js +85 -0
  116. package/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js +85 -0
  117. package/dist-web/assets/extended-p72mFE2C.js +1 -0
  118. package/dist-web/assets/floating-ui.dom-xGUaHE3m.js +1 -0
  119. package/dist-web/assets/flowDiagram-I6XJVG4X-C6eXPlWY.js +162 -0
  120. package/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js +162 -0
  121. package/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js +292 -0
  122. package/dist-web/assets/ganttDiagram-6RSMTGT7-LvGiqVrM.js +292 -0
  123. package/dist-web/assets/gitGraphDiagram-PVQCEYII-D1ktH7c_.js +106 -0
  124. package/dist-web/assets/gitGraphDiagram-PVQCEYII-DMbTATyw.js +106 -0
  125. package/dist-web/assets/graph--OzhPTMs.js +1 -0
  126. package/dist-web/assets/graph-BwjfAU3j.js +1 -0
  127. package/dist-web/assets/index-CXz8XYk1.css +1 -0
  128. package/dist-web/assets/index-DKIJmNQn.js +337 -0
  129. package/dist-web/assets/index10-ePz6DAnA.js +2 -0
  130. package/dist-web/assets/index11-wd1P4PGw.js +8 -0
  131. package/dist-web/assets/index5-D_56m6HR.js +1 -0
  132. package/dist-web/assets/index6-BiWLUsB3.js +1 -0
  133. package/dist-web/assets/index7-DSRe_h5d.js +1 -0
  134. package/dist-web/assets/index8-C0MfrVDC.js +1 -0
  135. package/dist-web/assets/infoDiagram-5YYISTIA-2JF3XEdD.js +2 -0
  136. package/dist-web/assets/infoDiagram-5YYISTIA-C0KiosmZ.js +2 -0
  137. package/dist-web/assets/init-Gi6I4Gst.js +1 -0
  138. package/dist-web/assets/inter-cyrillic-ext-opsz-italic-fe11NjBs.woff2 +0 -0
  139. package/dist-web/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  140. package/dist-web/assets/inter-cyrillic-opsz-italic-Ck9oD2H0.woff2 +0 -0
  141. package/dist-web/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  142. package/dist-web/assets/inter-greek-ext-opsz-italic-BIcRYUEt.woff2 +0 -0
  143. package/dist-web/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  144. package/dist-web/assets/inter-greek-opsz-italic-mtaF_0H_.woff2 +0 -0
  145. package/dist-web/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  146. package/dist-web/assets/inter-latin-ext-opsz-italic-BLMf5All.woff2 +0 -0
  147. package/dist-web/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  148. package/dist-web/assets/inter-latin-opsz-italic-BbqH_2Ar.woff2 +0 -0
  149. package/dist-web/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  150. package/dist-web/assets/inter-vietnamese-opsz-italic-C7TReJrb.woff2 +0 -0
  151. package/dist-web/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  152. package/dist-web/assets/ishikawaDiagram-YF4QCWOH-C5OstRVV.js +70 -0
  153. package/dist-web/assets/ishikawaDiagram-YF4QCWOH-CGUCgDXm.js +70 -0
  154. package/dist-web/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  155. package/dist-web/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  156. package/dist-web/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  157. package/dist-web/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  158. package/dist-web/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  159. package/dist-web/assets/journeyDiagram-JHISSGLW-K-24gGZU.js +139 -0
  160. package/dist-web/assets/journeyDiagram-JHISSGLW-yctdo4bX.js +139 -0
  161. package/dist-web/assets/kanban-definition-UN3LZRKU-CxBCv27E.js +89 -0
  162. package/dist-web/assets/kanban-definition-UN3LZRKU-DDKuz_xA.js +89 -0
  163. package/dist-web/assets/katex-DnlPpQZa.js +257 -0
  164. package/dist-web/assets/katex-HP8lGamR.js +257 -0
  165. package/dist-web/assets/katexRenderer.worker-CO_gEm4q.js +257 -0
  166. package/dist-web/assets/layout-C1ojF0zw.js +1 -0
  167. package/dist-web/assets/layout-SsrduOYp.js +1 -0
  168. package/dist-web/assets/linear-3mB6q2-g.js +1 -0
  169. package/dist-web/assets/linear-DYKn_u2q.js +1 -0
  170. package/dist-web/assets/mermaid.core-oS_owI3c.js +309 -0
  171. package/dist-web/assets/mermaidParser.worker-Dx4jPi9z.js +313 -0
  172. package/dist-web/assets/mhchem-DtR62fUK.js +1 -0
  173. package/dist-web/assets/mindmap-definition-RKZ34NQL-BmJZpjh6.js +96 -0
  174. package/dist-web/assets/mindmap-definition-RKZ34NQL-C0lJUdai.js +96 -0
  175. package/dist-web/assets/ordinal-Cboi1Yqb.js +1 -0
  176. package/dist-web/assets/pieDiagram-4H26LBE5-BkwDAvbt.js +30 -0
  177. package/dist-web/assets/pieDiagram-4H26LBE5-DGCPaNkB.js +30 -0
  178. package/dist-web/assets/quadrantDiagram-W4KKPZXB-B3op7xS9.js +7 -0
  179. package/dist-web/assets/quadrantDiagram-W4KKPZXB-BmT_qM09.js +7 -0
  180. package/dist-web/assets/requirementDiagram-4Y6WPE33-CZrxH1Y2.js +84 -0
  181. package/dist-web/assets/requirementDiagram-4Y6WPE33-xbfEgwL_.js +84 -0
  182. package/dist-web/assets/safeRaf-DGuzXxDK.js +1 -0
  183. package/dist-web/assets/sankeyDiagram-5OEKKPKP-3ff_V2pD.js +40 -0
  184. package/dist-web/assets/sankeyDiagram-5OEKKPKP-De_o7hDr.js +40 -0
  185. package/dist-web/assets/sequenceDiagram-3UESZ5HK-C5YRTKoy.js +162 -0
  186. package/dist-web/assets/sequenceDiagram-3UESZ5HK-VAxffBe7.js +162 -0
  187. package/dist-web/assets/stateDiagram-AJRCARHV-ltBPYPwO.js +1 -0
  188. package/dist-web/assets/stateDiagram-AJRCARHV-nDExQydZ.js +1 -0
  189. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BzwD_BIl.js +1 -0
  190. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Dl6LC5u9.js +1 -0
  191. package/dist-web/assets/timeline-definition-PNZ67QCA-BT-5Wtvy.js +120 -0
  192. package/dist-web/assets/timeline-definition-PNZ67QCA-DsVZdrZa.js +120 -0
  193. package/dist-web/assets/vennDiagram-CIIHVFJN-BBHQmCFf.js +34 -0
  194. package/dist-web/assets/vennDiagram-CIIHVFJN-Tif-M9Km.js +34 -0
  195. package/dist-web/assets/vue.runtime.esm-bundler-BMrzHc_f.js +5 -0
  196. package/dist-web/assets/wardley-L42UT6IY-BJFn8eDD.js +173 -0
  197. package/dist-web/assets/wardley-L42UT6IY-CqiBaH6C.js +173 -0
  198. package/dist-web/assets/wardleyDiagram-YWT4CUSO-DCiyDQNB.js +78 -0
  199. package/dist-web/assets/wardleyDiagram-YWT4CUSO-DfgCjyaL.js +78 -0
  200. package/dist-web/assets/xychartDiagram-2RQKCTM6-DTwp2FCG.js +7 -0
  201. package/dist-web/assets/xychartDiagram-2RQKCTM6-Db_VoDBV.js +7 -0
  202. package/dist-web/boot.js +10 -0
  203. package/dist-web/favicon.ico +0 -0
  204. package/dist-web/index.html +23 -0
  205. package/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  206. package/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  207. package/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  208. package/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  209. package/package.json +108 -0
@@ -0,0 +1,28 @@
1
+ import{bR as wi,cb as bi,bQ as Lo,M as cl,bl as ki,af as ul,bY as xi,cc as Si,b$ as fl,aU as $,c0 as Ci,c1 as Mi,c2 as Bi,a0 as ko,aD as $o,bE as ae,az as Ei,cd as hn,c8 as vt,aI as Oo,aL as G,s as bn,aw as It,au as mt,bk as V,ce as xo,u as oe,I as zo,A as Fi,bJ as Ut,aY as pt,bL as sl,v as b,t as ye,bB as dl,bb as Me,q as k,b7 as Pi,cf as Li,cg as gn,ch as $i,ci as Oi,cj as zi,ck as Hi,as as j,cl as So,cm as Ni,cn as Ti,co as jt,cp as Co,bO as Ho,T as Ri,G as Di,F as Mo,g as Ai,c7 as ji,b_ as qi}from"./index-DKIJmNQn.js";import{i as fe,t as yn}from"./safeRaf-DGuzXxDK.js";var wn=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});let Bo=!1,qt=null,Wt=null,_t=null;function Wi(){return wn(this,null,function*(){if(_t)return _t;_t=wn(null,null,function*(){if(!Wt)try{if(Wt=(function(x){const M=x;if(typeof M?.useMonaco=="function")return M;const w=x?.default;return typeof w?.useMonaco=="function"?w:null})(yield wi(()=>import("./__vite-optional-peer-dep_stream-diffs_markstream-vue-BIHI7g3E.js"),[])),!Wt)return null}catch{return null}try{return yield(function(x){return wn(this,null,function*(){return Bo?void 0:qt||(qt=wn(null,null,function*(){const w=globalThis?.MonacoEnvironment;w&&(typeof w.getWorker=="function"||typeof w.getWorkerUrl=="function")||typeof x?.preloadMonacoWorkers!="function"||(yield x.preloadMonacoWorkers()),Bo=!0}).finally(()=>{qt=null}),qt)})})(Wt),bi(),Wt}catch{return null}});try{return yield _t}finally{_t=null}})}var _i=Object.defineProperty,Ii=Object.defineProperties,Ui=Object.getOwnPropertyDescriptors,Eo=Object.getOwnPropertySymbols,Vi=Object.prototype.hasOwnProperty,Gi=Object.prototype.propertyIsEnumerable,Fo=(x,M,w)=>M in x?_i(x,M,{enumerable:!0,configurable:!0,writable:!0,value:w}):x[M]=w,I=(x,M)=>{for(var w in M||(M={}))Vi.call(M,w)&&Fo(x,w,M[w]);if(Eo)for(var w of Eo(M))Gi.call(M,w)&&Fo(x,w,M[w]);return x},Ce=(x,M)=>Ii(x,Ui(M)),q=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});const Ji={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)]"},Yi={class:"flex items-center gap-0.5"},Qi=["aria-label"],Xi={class:"code-diff-stat removed"},Ki={class:"code-diff-stat added"},Zi=["aria-label"],er={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},tr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},nr=["aria-pressed"],lr={key:3,class:"relative"},or=["aria-expanded"],ir=["disabled"],rr=["disabled"],ar=["disabled"],ur={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},sr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},dr={class:"code-loading-placeholder"},cr={class:"sr-only","aria-live":"polite",role:"status"},fr=cl({__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(x,{emit:M}){const w=x,te=M,ne=$(!1),we=$(null),be=$(null);function r(){vt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",z,{once:!0,capture:!0})}function E(){vt(!0),ne.value=!1}function z(Y){var f,O;const yt=Y.target;(f=we.value)!=null&&f.contains(yt)||(O=be.value)!=null&&O.contains(yt)?document.addEventListener("click",z,{once:!0,capture:!0}):E()}const ie=k(()=>w.showFontSizeButtons&&w.enableFontSizeControl||w.showExpandButton||w.isPreviewable&&w.showPreviewButton),{t:N}=fl(),ht=k(()=>w.showTooltips!==!1);function Ve(Y,f){ht.value&&ji(Y.currentTarget,f,"top",!1,void 0,w.isDark)}function Be(){ht.value&&vt()}function gt(Y){Ve(Y,w.copyText?N("common.copied")||"Copied":N("common.copy")||"Copy")}const vl=k(()=>{var Y,f;return!!Number.isFinite(w.codeFontSize)&&((Y=w.codeFontSize)!=null?Y:0)<=((f=w.codeFontMin)!=null?f:0)}),Vt=k(()=>!w.fontBaselineReady||w.codeFontSize===w.defaultCodeFontSize),Gt=k(()=>{var Y,f;return!!Number.isFinite(w.codeFontSize)&&((Y=w.codeFontSize)!=null?Y:0)>=((f=w.codeFontMax)!=null?f:100)});return(Y,f)=>(G(),oe(Mo,null,[w.showHeader?(G(),oe("div",Ji,[pt(Y.$slots,"header-left"),pt(Y.$slots,"header-right",{},()=>[b("div",Yi,[x.diffStats?(G(),oe("div",{key:0,class:"code-diff-stats","aria-label":x.diffStatsAriaLabel},[b("span",Xi,"-"+Me(x.diffStats.removed),1),b("span",Ki,"+"+Me(x.diffStats.added),1)],8,Qi)):ye("",!0),w.showCopyButton?(G(),oe("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":x.copyText?V(N)("common.copied")||"Copied":V(N)("common.copy")||"Copy",onClick:f[0]||(f[0]=O=>te("copy")),onMouseenter:f[1]||(f[1]=O=>gt(O)),onFocus:f[2]||(f[2]=O=>gt(O)),onMouseleave:Be,onBlur:Be},[x.copyText?(G(),oe("svg",tr,[...f[14]||(f[14]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(G(),oe("svg",er,[...f[13]||(f[13]=[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),b("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,Zi)):ye("",!0),w.showCollapseButton?(G(),oe("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":x.isCollapsed,onClick:f[3]||(f[3]=O=>te("toggleCollapse")),onMouseenter:f[4]||(f[4]=O=>Ve(O,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onFocus:f[5]||(f[5]=O=>Ve(O,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onMouseleave:Be,onBlur:Be},[(G(),oe("svg",{style:It({rotate:x.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"},[...f[15]||(f[15]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,nr)):ye("",!0),ie.value?(G(),oe("div",lr,[b("button",{ref_key:"moreBtnRef",ref:be,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":ne.value,"aria-haspopup":"true",onClick:Ho(r,["stop"]),onMouseenter:f[6]||(f[6]=O=>Ve(O,V(N)("common.more")||"More")),onFocus:f[7]||(f[7]=O=>Ve(O,V(N)("common.more")||"More")),onMouseleave:Be,onBlur:Be},[...f[16]||(f[16]=[Di('<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,or),zo(Ai,{name:"code-menu"},{default:Ut(()=>[ne.value?(G(),oe("div",{key:0,ref_key:"moreMenuRef",ref:we,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"},[w.showFontSizeButtons&&w.enableFontSizeControl?(G(),oe(Mo,{key:0},[b("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:vl.value,onClick:f[8]||(f[8]=O=>{V(vt)(!0),te("decreaseFont")})},[f[17]||(f[17]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),b("span",null,Me(V(N)("common.fontSmaller")||"Font size −"),1)],8,ir),b("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:Vt.value,onClick:f[9]||(f[9]=O=>{V(vt)(!0),te("resetFont")})},[f[18]||(f[18]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),b("path",{d:"M3 3v5h5"})])],-1)),b("span",null,Me(V(N)("common.fontReset")||"Font size reset"),1)],8,rr),b("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:Gt.value,onClick:f[10]||(f[10]=O=>{V(vt)(!0),te("increaseFont")})},[f[19]||(f[19]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),b("span",null,Me(V(N)("common.fontLarger")||"Font size +"),1)],8,ar)],64)):ye("",!0),w.showExpandButton?(G(),oe("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:f[11]||(f[11]=O=>{E(),te("toggleExpand")})},[x.isExpanded?(G(),oe("svg",ur,[...f[20]||(f[20]=[b("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)])])):(G(),oe("svg",sr,[...f[21]||(f[21]=[b("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)])])),b("span",null,Me(x.isExpanded?V(N)("common.collapse")||"Collapse":V(N)("common.expand")||"Expand"),1)])):ye("",!0),x.isPreviewable&&w.showPreviewButton?(G(),oe("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:f[12]||(f[12]=O=>{E(),te("preview")})},[f[22]||(f[22]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("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"}),b("circle",{cx:"12",cy:"12",r:"3"})])],-1)),b("span",null,Me(V(N)("common.preview")||"Preview"),1)])):ye("",!0)],512)):ye("",!0)]),_:1})])):ye("",!0)])])])):ye("",!0),sl(b("div",{class:mt(["code-block-shell-content",{"code-block-shell-content--collapsed":x.isCollapsed}])},[pt(Y.$slots,"default")],2),[[dl,!!x.stream||!x.loading]]),sl(b("div",dr,[pt(Y.$slots,"loading",{},()=>[f[23]||(f[23]=b("div",{class:"loading-skeleton"},[b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line short"})],-1))])],512),[[dl,!x.stream&&x.loading]]),b("span",cr,Me(x.copyText?V(N)("common.copied")||"Copied":""),1)],64))}}),vr={class:"html-preview-frame__header"},mr={class:"html-preview-frame__title"},pr={class:"html-preview-frame__label"},hr=["sandbox","srcdoc"],gr=Lo(cl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(x){const M=x,w=import.meta!==void 0&&!1;let te=null;const{t:ne}=fl(),we=k(()=>{const E=M.code||"",z=E.trim().toLowerCase();return z.startsWith("<!doctype")||z.startsWith("<html")||z.startsWith("<body")?E:`<!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: ${M.isDark?"#020617":"#ffffff"};
12
+ color: ${M.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
+ ${E}
21
+ </body>
22
+ </html>`}),be=k(()=>{return E=M.htmlPreviewSandbox,z=M.htmlPreviewAllowScripts,typeof E=="string"?((function(ie){if(!w||typeof console>"u"||te===ie)return;const N=(function(ht){return new Set(ht.trim().toLowerCase().split(/\s+/).filter(Boolean))})(ie);N.has("allow-scripts")&&N.has("allow-same-origin")&&(te=ie,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."))})(E),E):E!==void 0?"":z===!0?"allow-scripts":"";var E,z});function r(E){var z;E.key!=="Escape"&&E.key!=="Esc"||(z=M.onClose)==null||z.call(M)}return $o(()=>{typeof window<"u"&&window.addEventListener("keydown",r)}),Oo(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(E,z)=>(G(),bn(Ri,{to:"body"},[b("div",{class:mt(["markstream-vue",{dark:M.isDark}])},[b("div",{class:"html-preview-frame__backdrop",onClick:z[2]||(z[2]=ie=>{var N;return(N=M.onClose)==null?void 0:N.call(M)})},[b("div",{class:"html-preview-frame",onClick:z[1]||(z[1]=Ho(()=>{},["stop"]))},[b("div",vr,[b("div",mr,[z[3]||(z[3]=b("span",{class:"html-preview-frame__dot"},null,-1)),b("span",pr,Me(M.title||V(ne)("common.preview")||"Preview"),1)]),b("button",{type:"button",class:"html-preview-frame__close",onClick:z[0]||(z[0]=ie=>{var N;return(N=M.onClose)==null?void 0:N.call(M)})}," × ")]),b("iframe",{class:"html-preview-frame__iframe",sandbox:be.value,referrerpolicy:"no-referrer",srcdoc:we.value},null,8,hr)])])],2)]))}}),[["__scopeId","data-v-24e66176"]]),yr=["data-markstream-enhanced","data-markstream-enhancement-state","data-markstream-code-block-state","data-markstream-pending","data-markstream-viewport-pending"],wr={class:"code-header-main"},br=["innerHTML"],kr={class:"code-header-copy"},xr={class:"code-header-title"},Sr={key:0,class:"code-header-caption"},Cr=["data-markstream-host-hidden"],Po="__markstreamMonacoPassiveTouchState__",Er=Lo(cl({__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:{},estimatedDiffInline:{type:Boolean}},emits:["previewCode","copy"],setup(x,{emit:M}){var w,te,ne,we,be;const r=x,E=M,z=ki(),ie=ul(xi,null),N=ul("markstreamHostScrollManaged",null),ht=ul(Si,void 0),Ve=k(()=>qi(r,z)),Be=new Set;function gt(e){return q(this,null,function*(){var t;if(typeof window>"u")return yield e();const n=(t=window.Element)==null?void 0:t.prototype,l=n?.addEventListener;if(!n||!l)return yield e();const o=(function(){const d=window,u=d[Po];if(u)return u;const a={depth:0,original:null};return d[Po]=a,a})();let i=null;try{o.depth===0&&(o.original=l,n.addEventListener=function(u,a,c){var s;const v=(s=o.original)!=null?s:l;return u==="touchstart"&&(function(p,y){if(!p)return!1;const h=p;return!(typeof h.closest!="function"||!h.closest(".monaco-editor, .monaco-diff-editor")||y&&typeof y=="object"&&"passive"in y)})(this,c)?v.call(this,u,a,(function(p){return p==null?{passive:!0}:typeof p=="boolean"?{capture:p,passive:!0}:typeof p=="object"?"passive"in p?p:Ce(I({},p),{passive:!0}):{passive:!0}})(c)):v.call(this,u,a,c)}),o.depth++;let d=!1;i=()=>{d||(d=!0,Be.delete(i),o.depth=Math.max(0,o.depth-1),o.depth===0&&o.original&&n.addEventListener!==o.original&&(n.addEventListener=o.original,o.original=null))},Be.add(i)}catch{return yield e()}try{return yield e()}finally{i?.()}})}function vl(e,t){}const Vt=ko(),Gt=k(()=>{const e=Vt?.vnode.props;return!(!e||!e.onPreviewCode&&!e["onPreview-code"])}),{t:Y}=fl(),f=$(null),O=$(null),yt=$(!1),ke=$(to(r.node.language,r.node.code,Ie())),kn=k(()=>So(ke.value)),Ee=k(()=>kn.value==="plaintext"?"text":kn.value),xn=k(()=>kn.value==="plaintext"),Fe=$(!1),xe=$(!1),Q=$(!1),Se=$(!1),W=$(!1),wt=$(!1);let B=!1,bt=null,Bt=null,Ge=null,Je=0,Ye=!1,qe="";const Qe=$(null),ve=$(null);let Sn=null,Cn=0;const No=Ci(),Jt=Mi(),Mn=Bi(),We=Pi(null),Z=$(typeof window>"u"||!Mn.value),To=(ne=(te=(w=ko())==null?void 0:w.vnode.el)==null?void 0:te.textContent)!=null?ne:"",Ro=typeof window<"u"&&String((we=r.node.code)!=null?we:"").length>0&&To.includes(String(r.node.code)),ml=$(!Ro);$o(()=>{ml.value=!0}),typeof window<"u"&&ae([()=>O.value,Mn],([e,t],n,l)=>{var o,i,d;if((o=We.value)==null||o.destroy(),We.value=null,!t||Z.value)return void(Z.value=!0);if(!e)return void(Z.value=!1);let u=!0;const a=(d=(i=Jt?.value.heavyBlockMargin)!=null?i:Jt?.value.rootMargin)!=null?d:"0px",c=No(e,{rootMargin:a,allowIdle:!1});We.value=c,Z.value=Z.value||c.isVisible.value,c.whenVisible.then(()=>{u&&We.value===c&&(Z.value=!0)}).catch(()=>{}),l(()=>{u=!1,c.destroy(),We.value===c&&(We.value=null)})},{immediate:!0}),Ei(()=>{var e;B=!0;for(const t of Array.from(Be))t();(function(){const t=qe;ie&&t&&(qe="",ie.markSettled(t))})(),(e=We.value)==null||e.destroy(),We.value=null});let ue=null,Yt=null,Bn=()=>{},Qt=()=>{},kt=()=>null,se=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),U=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),En=()=>{},Xe=()=>{},Fn=()=>{},Ke=null,Oe=null,Et=null,Ft=null,pl=()=>{var e;return String((e=r.node.language)!=null?e:"plaintext")},Pn=()=>q(null,null,function*(){}),Ln=!1,Xt=null;const ze=[],$n=[];let He=null;const m=k(()=>Li(r.node)),Ze=$({removed:0,added:0}),Do=k(()=>`-${Ze.value.removed} +${Ze.value.added}`),hl=Object.freeze(Ce(I({},jt),{enabled:!1,revealLineCount:0}));function gl(e){var t,n,l;const o=((n=(t=O.value)==null?void 0:t.getBoundingClientRect)==null?void 0:n.call(t).width)||((l=O.value)==null?void 0:l.clientWidth)||(typeof window>"u"?0:window.innerWidth);return Ni(e,o)}function Pt(e,t){return{original:Kt(e),updated:Kt(t)}}function Kt(e){return String(e??"").replace(/\r\n$|\n$|\r$/,"")}function Lt(e){var t;return String((t=e?.message)!=null?t:e).includes("no diff result available")}function xt(){if(!$e())try{const e=Fn();e&&typeof e.catch=="function"&&e.catch(t=>{Lt(t)})}catch(e){Lt(e)}}const re=k(()=>{var e,t,n,l;const o=r.monacoOptions?I({},r.monacoOptions):{};if(!m.value)return I({lineDecorationsWidth:0,lineNumbersMinChars:2,glyphMargin:!1},o);const i=o.diffHideUnchangedRegions===void 0?I({},jt):gn(o.diffHideUnchangedRegions),d=o.hideUnchangedRegions===void 0?void 0:gn(o.hideUnchangedRegions),u=r.stream!==!1&&r.loading!==!1,a=u?I({},hl):i,c=u?I({},hl):d,s=(function(g){return g.diffWordWrap!==void 0?g.diffWordWrap:"off"})(o),v=I({},(e=o.experimental)!=null?e:{}),p=(t=o.diffUnchangedRegionStyle)!=null?t:"line-info",y=(function(g){const X=g.scrollbar&&typeof g.scrollbar=="object"?g.scrollbar:{};return I(Ce(I({},X),{verticalScrollbarSize:0,horizontalScrollbarSize:0}),gl(g)?{horizontal:"hidden"}:{})})(o),h={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,padding:{top:0,bottom:0},minimap:{enabled:!1},renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,diffWordWrap:s,renderSideBySide:(n=o.renderSideBySide)==null||n,diffHideUnchangedRegions:a,useInlineViewWhenSpaceIsLimited:(l=o.useInlineViewWhenSpaceIsLimited)!=null&&l,diffLineStyle:"background",diffAppearance:"auto",diffUnchangedRegionStyle:p,diffHunkActionsOnHover:!1,experimental:v};return Ce(I(Ce(I(I({},h),o),{experimental:v}),c===void 0?{}:{hideUnchangedRegions:c}),{diffHideUnchangedRegions:a,diffWordWrap:s,scrollbar:y})}),On=k(()=>(r.theme!==void 0?!uo(r.theme):so(r.darkTheme,r.lightTheme))?(function(e){var t,n;if(e&&typeof e=="object"&&((t=e.colors)!=null&&t["editor.background"])){const o=Xn(e.colors["editor.background"]);if(o!=null)return o<128}const l=((n=rt(e))!=null?n:"").toLowerCase();return l?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(o=>l.includes(o))&&!["light","latte","dawn","lotus"].some(o=>l.includes(o)):!!r.isDark})(Tt()):!!r.isDark),zn=k(()=>{var e;if(!m.value)return On.value?"dark":"light";const t=(e=re.value)==null?void 0:e.diffAppearance;return t==="light"||t==="dark"?t:On.value?"dark":"light"}),yl=k(()=>m.value?zn.value==="dark":On.value),$t=k(()=>m.value?"diff":"single"),wl=$($t.value),ge=$(!1),D=$(!1),Ot=$(!1),me=$(!1),et=$(null),Hn=$(0),bl=$(0),Zt=$(!1);let zt=null,tt=!1,Nn=null,Tn=!1;const Rn=k(()=>{var e,t,n;if(m.value){const o=(e=re.value)==null?void 0:e.diffWordWrap;if(o==="inherit"){const i=(t=r.monacoOptions)==null?void 0:t.wordWrap;return i==null||String(i)!=="off"}return o==="on"}const l=(n=r.monacoOptions)==null?void 0:n.wordWrap;return l==null||String(l)!=="off"}),_e=k(()=>{var e;return!!m.value&&gl((e=re.value)!=null?e:{})}),Dn=k(()=>{var e;const t=(e=r.monacoOptions)==null?void 0:e.diffHideUnchangedRegions;return t===void 0?I({},jt):gn(t)});function kl(e){return N?.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 Ao=k(()=>kl(O.value)),Ne=k(()=>!(ge.value||!me.value&&D.value)),xl=k(()=>Ne.value),jo=k(()=>Ne.value&&!Ot.value),qo=k(()=>!ge.value&&!me.value&&Ne.value),Wo=k(()=>D.value&&!ge.value?"ready":me.value?"fallback":"pending"),en=$(!1),Te=k(()=>Kt(r.node.code)),Sl=k(()=>m.value?r.node.diff===!0?r.node:Ce(I({},r.node),{diff:!0}):Te.value===r.node.code?r.node:Ce(I({},r.node),{code:Te.value})),pe=$(typeof((be=r.monacoOptions)==null?void 0:be.fontSize)=="number"?r.monacoOptions.fontSize:Number.NaN),_=$(pe.value),An=$(null),tn=$(null),nn=$(null),_o=k(()=>{const e=pe.value,t=_.value;return typeof e=="number"&&Number.isFinite(e)&&e>0&&typeof t=="number"&&Number.isFinite(t)&&t>0}),ln=k(()=>{var e;const t=An.value;if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t;const n=(e=r.monacoOptions)==null?void 0:e.fontSize;if(typeof n=="number"&&Number.isFinite(n)&&n>0)return n;const l=_.value;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:12}),Io=k(()=>{var e;const t=tn.value;if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t;const n=(e=r.monacoOptions)==null?void 0:e.lineHeight;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:ln.value===12?18:Math.max(12,Math.round(1.5*ln.value))}),on=k(()=>Io.value),Uo=k(()=>{var e;const t=(e=r.monacoOptions)==null?void 0:e.tabSize;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:4}),jn=k(()=>{var e;const t=(e=r.monacoOptions)==null?void 0:e.padding,n=m.value?0:8;return{top:typeof t?.top=="number"&&Number.isFinite(t.top)&&t.top>=0?t.top:n,bottom:typeof t?.bottom=="number"&&Number.isFinite(t.bottom)&&t.bottom>=0?t.bottom:n}}),rn=k(()=>{const e=r.estimatedContentHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null});function an(e){if(e==null)return null;const t=Math.ceil(e);return!Number.isFinite(t)||t<=0?null:Math.min(t,Math.ceil(Ct()))}function qn(){return!m.value&&r.stream!==!1&&r.loading!==!1}const Cl=k(()=>m.value?null:rn.value==null||qn()?Math.ceil((e=>{const t=String(e??"");return t?Math.max(1,t.split(/\r\n|\n|\r/).length):1})(Te.value)*on.value+1):null),Ml=k(()=>{if(m.value)return null;const e=rn.value;return e==null||qn()?an(Cl.value):an(e)}),Vo=k(()=>{const e=r.estimatedHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}),Wn=$(null);function nt(){const e=Wn.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}const _n=k(()=>{const e=nt();return e??(!m.value&&Zt.value?null:Ne.value||!D.value?Ml.value:null)});function Bl(e){const t=e?"hsl(152 42% 60%)":"var(--diff-added-fg)",n=e?"hsl(0 58% 58%)":"var(--diff-removed-fg)",l=e?"hsl(152 42% 60% / 0.18)":"var(--diff-added-bg)",o=e?"hsl(0 58% 58% / 0.18)":"var(--diff-removed-bg)",i=e?"hsl(152 42% 60% / 0.28)":"var(--diff-added-inline-bg)",d=e?"hsl(0 58% 58% / 0.28)":"var(--diff-removed-inline-bg)",u=`linear-gradient(90deg, ${t} 0 4px, transparent 4px 100%)`,a=`linear-gradient(90deg, ${n} 0 4px, transparent 4px 100%)`,c=e?"hsl(0 0% 7% / 0.98)":"hsl(var(--ms-muted) / 0.45)",s="var(--markstream-code-layout-character-width, 1ch)",v=`calc(${s} + ${s})`,p=`calc(${s} + ${s} + ${s} + ${s} + ${s} + 2px)`,y=`calc(${p} + ${s})`;return{"--markstream-diff-line-number-bg":c,"--markstream-diff-added-fg":t,"--markstream-diff-removed-fg":n,"--markstream-diff-added-line":l,"--markstream-diff-removed-line":o,"--markstream-diff-added-line-fill":l,"--markstream-diff-removed-line-fill":o,"--markstream-diff-added-gutter":u,"--markstream-diff-removed-gutter":a,"--markstream-diff-added-inline":i,"--markstream-diff-removed-inline":d,"--stream-monaco-added-fg":t,"--stream-monaco-removed-fg":n,"--stream-monaco-added-line":l,"--stream-monaco-removed-line":o,"--stream-monaco-added-line-fill":l,"--stream-monaco-removed-line-fill":o,"--stream-monaco-added-gutter":u,"--stream-monaco-removed-gutter":a,"--stream-monaco-added-inline":i,"--stream-monaco-removed-inline":d,"--stream-monaco-gutter-marker-width":"4px","--stream-monaco-gutter-gap":"1ch","--stream-monaco-line-number-left":"0px","--stream-monaco-line-number-width":v,"--stream-monaco-line-number-padding-left":v,"--stream-monaco-line-number-padding-right":s,"--stream-monaco-line-number-separator-width":"2px","--stream-monaco-layout-character-width":s,"--stream-monaco-line-number-box-width":p,"--stream-monaco-line-number-gap-to-code":s,"--stream-monaco-line-number-bg":c,"--stream-monaco-diff-code-gap":s,"--stream-monaco-diff-code-padding":"0px","--stream-monaco-original-margin-width":y,"--stream-monaco-original-scrollable-left":y,"--stream-monaco-original-scrollable-width":`calc(100% - ${y})`,"--stream-monaco-modified-margin-width":y,"--stream-monaco-modified-scrollable-left":y,"--stream-monaco-modified-scrollable-width":`calc(100% - ${y})`}}const El=k(()=>{var e;const t=(e=r.monacoOptions)==null?void 0:e.fontFamily,n=an(rn.value),l=an(Cl.value),o=qn(),i=I(I({fontSize:`${ln.value}px`,lineHeight:`${on.value}px`,tabSize:Uo.value,boxSizing:"border-box",maxHeight:`${Ct()}px`,overflow:"auto",paddingTop:`${jn.value.top}px`,paddingBottom:`${jn.value.bottom}px`},m.value||n==null||o?m.value||l==null?{}:{minHeight:`${l}px`}:{height:`${n}px`,minHeight:`${n}px`}),typeof t=="string"&&t.trim()?{"--markstream-code-font-family":t.trim()}:{});return i["--markstream-pre-line-number-top"]=`${jn.value.top}px`,i["--markstream-code-padding-left"]="calc(2ch + 2ch + 1ch + 2px + 1ch)",i["--markstream-pre-line-number-left"]="0px",i["--markstream-pre-line-number-width"]="2ch",i["--markstream-pre-line-number-padding-left"]="2ch",i["--markstream-pre-line-number-padding-right"]="1ch",i["--markstream-pre-line-number-separator-width"]="2px",m.value&&(i["--markstream-pre-diff-line-height"]=`${on.value}px`,i["--markstream-pre-diff-pane-bottom-padding"]=(_e.value,"0px"),Object.assign(i,Bl(yl.value))),i}),Fl=k(()=>_n.value!=null&&(!D.value||nt()!=null)),Go=k(()=>{const e=_n.value;if(e==null)return null;if(m.value)return Math.ceil(e);const t=Vo.value,n=rn.value;if(t==null||n==null)return Math.ceil(e);const l=Math.max(0,Math.ceil(t)-Math.ceil(n));return Math.ceil(e+l)}),Jo=k(()=>{if(m.value&&Ne.value)return{};const e=_n.value;return Fl.value&&e!=null?{minHeight:`${e}px`}:{}});function Pl(){var e,t,n,l,o,i,d,u;const a=(e=O.value)==null?void 0:e.querySelector("pre.code-pre-fallback"),c=U(),s=(t=a?.scrollTop)!=null?t:0;(o=(l=(n=c?.getOriginalEditor)==null?void 0:n.call(c))==null?void 0:l.setScrollTop)==null||o.call(l,s),(u=(d=(i=c?.getModifiedEditor)==null?void 0:i.call(c))==null?void 0:d.setScrollTop)==null||u.call(d,s)}function Ll(){return q(this,null,function*(){return m.value?(Kn()!=null||un(),ee(!0),Pl(),he(),Ot.value=!0,yield j(),ee(!0),yield Pe(),ee(!0),!(Ke&&!(yield Ke())||(Nt(),un(),ee(!0),D.value=!0,yield j(),un(),ee(!0),Nt(),he(),de(),0))):!(Ke&&!(yield Ke())||(D.value=!0,yield j(),le(!1),ee(),0))})}function un(){const e=f.value;return e&&cn(e)?(he(),le({preferModelDiffHeight:!0}),it(),Number.parseFloat(e.style.height||"")||null):Kn()}function $l(){if(!m.value||!W.value||!D.value||Ne.value)return!1;const e=f.value;return!!e&&Ht(e)}function Ol(e,t=!1,n={}){const l=Math.ceil(e),o=nt();if(o==null)return l;const i=n.allowBelowEstimatedFloor===!0||$l();return l>=o||i?((t||i)&&W.value&&(Wn.value=null),l):o}function Pe(){return new Promise(e=>{let t=!1,n=null,l=null;const o=()=>{t||(t=!0,l!=null&&globalThis.clearTimeout(l),n!=null&&yn(n),e())};l=globalThis.setTimeout(o,50),n=fe(o)})}function zl(){try{const e=f.value;if(!e)return null;const t=e.querySelector(".view-lines .view-line");if(t){const n=Math.ceil(t.getBoundingClientRect().height);if(n>0)return n}}catch{}return null}function In(){var e,t,n,l,o;try{const i=m.value?(n=(t=(e=U())==null?void 0:e.getModifiedEditor)==null?void 0:t.call(e))!=null?n:U():se(),d=kt(),u=(l=d?.EditorOption)==null?void 0:l.fontInfo;if(i&&u!=null){const a=(o=i.getOption)==null?void 0:o.call(i,u),c=a?.fontSize;if(typeof c=="number"&&Number.isFinite(c)&&c>0)return c}}catch{}try{const i=f.value;if(i){const d=i.querySelector(".view-lines .view-line");if(d)try{if(typeof window<"u"&&typeof window.getComputedStyle=="function"){const u=window.getComputedStyle(d).fontSize,a=u&&u.match(/^(\d+(?:\.\d+)?)/);if(a)return Number.parseFloat(a[1])}}catch{}}}catch{}return null}function St(e){var t,n;try{const i=kt(),d=(t=i?.EditorOption)==null?void 0:t.lineHeight;if(d!=null){const u=(n=e?.getOption)==null?void 0:n.call(e,d);if(typeof u=="number"&&u>0)return u}}catch{}const l=zl();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 sn(e){var t,n,l;try{const i=kt(),d=(t=i?.EditorOption)==null?void 0:t.padding;if(d!=null){const u=(n=e?.getOption)==null?void 0:n.call(e,d);if(typeof u?.top=="number"||typeof u?.bottom=="number")return(typeof u?.top=="number"&&Number.isFinite(u.top)?Math.max(0,u.top):0)+(typeof u?.bottom=="number"&&Number.isFinite(u.bottom)?Math.max(0,u.bottom):0)}}catch{}const o=(l=re.value)==null?void 0:l.padding;return typeof o?.top=="number"||typeof o?.bottom=="number"?(typeof o?.top=="number"&&Number.isFinite(o.top)?Math.max(0,o.top):0)+(typeof o?.bottom=="number"&&Number.isFinite(o.bottom)?Math.max(0,o.bottom):0):m.value?24:0}function Hl(e,t){return typeof e!="number"||typeof t!="number"||e<1||t<e?0:t-e+1}function Nl(e){if(!e)return[];const t=e.split(/\r?\n/);return t.length===1&&t[0]===""?[]:t}function dn(e,t){const n=Nl(e),l=Nl(t);let o=0,i=n.length-1,d=l.length-1;for(;o<=i&&o<=d&&n[o]===l[o];)o++;for(;i>=o&&d>=o&&n[i]===l[d];)i--,d--;const u=Math.max(0,i-o+1),a=Math.max(0,d-o+1);if(u===0||a===0)return{removed:u,added:a};if((u+1)*(a+1)<=15e5){const c=a+1;let s=new Uint32Array(c),v=new Uint32Array(c);for(let y=u-1;y>=0;y--){v[a]=0;for(let g=a-1;g>=0;g--)v[g]=n[o+y]===l[o+g]?s[g+1]+1:Math.max(s[g],v[g+1]);const h=s;s=v,v=h}const p=s[0];return{removed:u-p,added:a-p}}return{removed:u,added:a}}function Tl(e){var t;if(!(function(){var d,u,a;return!(!m.value||!_e.value)&&(r.node.originalCode!=null||r.node.updatedCode!=null?dn(String((d=r.node.originalCode)!=null?d:""),String((u=r.node.updatedCode)!=null?u:"")).removed>0:String((a=r.node.code)!=null?a:"").split(/\r\n|\n|\r/).some(c=>(function(s){return s.startsWith("-")&&!s.startsWith("---")})(c)))})())return!0;const n=e?.querySelector(".stream-monaco-fallback-inline-delete-line");if((t=n?.textContent)!=null&&t.trim()&&(n.hasAttribute("data-stream-monaco-colorize-signature")||n.querySelector('[class*="mtk"]')))return!0;const l=e?.querySelector([".editor.modified .view-zones .view-lines.line-delete",".editor.modified .view-lines .view-line.line-delete",".editor.original .view-zones .view-lines.line-delete",".editor.original .view-lines .view-line.line-delete"].join(","));if(!l||!l.matches(".view-line")&&!l.querySelector(".view-line"))return!1;const o=l.getBoundingClientRect(),i=e?.getBoundingClientRect();return i?.width===0&&i.height===0||o.width>0&&o.height>0}function Rl(e,t){if(!e)return!1;const n=t.added<=0||!!e.querySelector([".line-insert",".gutter-insert",".stream-monaco-fallback-line-insert",".stream-monaco-fallback-gutter-insert",".stream-monaco-fallback-line-number-insert"].join(",")),l=t.removed<=0||!!e.querySelector([".line-delete",".gutter-delete",".inline-deleted-margin-view-zone",".stream-monaco-fallback-line-delete",".stream-monaco-fallback-gutter-delete",".stream-monaco-fallback-line-number-delete",".stream-monaco-fallback-inline-delete-line",".stream-monaco-fallback-inline-delete-margin"].join(","));return n&&l}function Un(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?typeof window>"u"||typeof window.getComputedStyle!="function"?n:window.getComputedStyle(n).display==="none"?null:n:null}function Dl(e,t){return Un(e,t)!==null}function Al(e,t){if(!e)return!1;const n=t.added<=0||[".gutter-insert",".stream-monaco-fallback-gutter-insert"].some(o=>Dl(e,o)),l=t.removed<=0||[".gutter-delete",".inline-deleted-margin-view-zone",".stream-monaco-fallback-gutter-delete",".stream-monaco-fallback-inline-delete-margin"].some(o=>Dl(e,o));return n&&l}function jl(e){var t;const n=Array.from((t=e?.querySelectorAll(".monaco-diff-editor .margin-view-overlays .line-numbers"))!=null?t:[]);return!!n.length&&n.some(l=>{var o;if(!((o=l.textContent)!=null&&o.trim()))return!1;if(typeof window>"u"||typeof window.getComputedStyle!="function")return!0;const i=window.getComputedStyle(l);if(i.display==="none")return!1;const d=l.getBoundingClientRect();if(d.width<=0&&d.height<=0)return!0;const u=Number.parseFloat(i.width||""),a=Number.parseFloat(i.paddingLeft||""),c=Number.parseFloat(i.paddingRight||""),s=Math.max(d.width,Number.isFinite(u)?u:0)>=8,v=Number.isFinite(a)&&a>=1&&Number.isFinite(c)&&c>=1;return s&&v})}function ql(e){const t=Un(e,".monaco-diff-editor .view-lines .view-line");if(!t)return!1;if(!Gn())return!0;const n=Un(e,".monaco-diff-editor .margin-view-overlays .line-numbers");if(!n)return!1;if(typeof window>"u"||typeof window.getComputedStyle!="function")return!0;const l=t.getBoundingClientRect(),o=n.getBoundingClientRect();if(l.width<=0&&l.height<=0||o.width<=0&&o.height<=0)return!0;const i=l.left-o.right;return i>=0&&i<=32}function Yo(e,t){return!_e.value||!(t||e?.querySelector([".line-insert",".line-delete",".gutter-insert",".gutter-delete",".stream-monaco-line-number-insert",".stream-monaco-line-number-delete",".stream-monaco-line-insert-fill",".stream-monaco-line-delete-fill",".stream-monaco-fallback-line-insert",".stream-monaco-fallback-line-delete",".stream-monaco-fallback-inline-delete-line"].join(",")))||!!(e?.classList.contains("stream-monaco-diff-inline-native-ready")&&!e.classList.contains("stream-monaco-diff-native-stale"))}function Wl(e,t,n,l){const o=e?.querySelector(`.monaco-diff-editor .editor.${t}`);if(!o)return!1;const i=Array.from(o.querySelectorAll(`.margin-view-overlays .line-numbers.${n}`));if(!i.length)return!0;const d=Array.from(o.querySelectorAll(".lines-content > .view-lines:not(.line-delete) > .view-line"));return!!d.length&&i.every(u=>{const a=u.getBoundingClientRect();let c=null;for(const s of d){const v=s.getBoundingClientRect(),p=Math.abs(v.top-a.top);(!c||p<c.distance)&&(c={node:s,distance:p})}return!c||c.distance>1.25||c.node.classList.contains(l)})}function Qo(e,t){if(!e)return!1;const n=t.added<=0||Wl(e,"modified","stream-monaco-line-number-insert","stream-monaco-line-insert-fill"),l=t.removed<=0||(_e.value?!!e.classList.contains("stream-monaco-diff-inline-native-ready"):Wl(e,"original","stream-monaco-line-number-delete","stream-monaco-line-delete-fill"));return n&&l}function Vn(e){if(xn.value)return!0;if(!e)return!1;const t=Array.from(e.querySelectorAll(".monaco-diff-editor .view-lines .view-line, .monaco-editor .view-lines .view-line")).filter(l=>{var o;if(!((o=l.textContent)!=null&&o.trim()))return!1;const i=l.getBoundingClientRect();return i.width>0||i.height>0});if(!t.length)return!1;const n=t.filter(l=>{var o,i;return i=(o=l.textContent)!=null?o:"",/['"`{}()[\]:;=<>.,]|\/\/|\/\*|\b(?:async|await|class|const|enum|export|for|function|if|import|interface|let|return|switch|type|var|while)\b/.test(i.replace(/\u00A0/g," ").trim())});return!n.length||n.filter(l=>Array.from(l.querySelectorAll("span")).filter(o=>{var i;return(i=o.textContent)==null?void 0:i.trim()}).some(o=>String(o.className||"").split(/\s+/).some(i=>/^mtk\d+$/.test(i)&&i!=="mtk1"))).length>0}function Gn(){const e=re.value;return e?.lineNumbers!=="off"}function Jn(){var e,t;m.value?Ze.value=dn(String((e=r.node.originalCode)!=null?e:""),String((t=r.node.updatedCode)!=null?t:"")):Ze.value={removed:0,added:0}}function lt(){var e;if(m.value)try{const t=U(),n=(e=t?.getLineChanges)==null?void 0:e.call(t);if(!Array.isArray(n))return void Jn();let l=0,o=0;for(const i of n)l+=Hl(i.originalStartLineNumber,i.originalEndLineNumber),o+=Hl(i.modifiedStartLineNumber,i.modifiedEndLineNumber);Ze.value={removed:l,added:o}}catch{Jn()}else Ze.value={removed:0,added:0}}function Yn(){var e;if(Number.isFinite(_.value)&&_.value>0&&Number.isFinite(pe.value))return _.value;const t=In();return typeof((e=r.monacoOptions)==null?void 0:e.fontSize)=="number"?(pe.value=r.monacoOptions.fontSize,_.value=r.monacoOptions.fontSize,_.value):t&&t>0?(pe.value=t,_.value=t,t):(pe.value=12,_.value=12,12)}function Xo(){const e=Yn(),t=Math.min(36,e+1);_.value=t}function Ko(){const e=Yn(),t=Math.max(10,e-1);_.value=t}function Zo(){Yn(),Number.isFinite(pe.value)&&(_.value=pe.value)}function _l(){var e,t,n,l,o,i,d,u,a,c,s,v,p,y;try{const h=m.value?U():null,g=m.value?h:se();if(!g)return null;if(h?.getOriginalEditor&&h?.getModifiedEditor){const C=(e=h.getOriginalEditor)==null?void 0:e.call(h),S=(t=h.getModifiedEditor)==null?void 0:t.call(h);(n=C?.layout)==null||n.call(C),(l=S?.layout)==null||l.call(S);const F=((o=C?.getContentHeight)==null?void 0:o.call(C))||0,P=((i=S?.getContentHeight)==null?void 0:i.call(S))||0,T=Math.max(F,P);if(T>0)return Math.ceil(T);const R=((a=(u=(d=C?.getModel)==null?void 0:d.call(C))==null?void 0:u.getLineCount)==null?void 0:a.call(u))||1,A=((v=(s=(c=S?.getModel)==null?void 0:c.call(S))==null?void 0:s.getLineCount)==null?void 0:v.call(s))||1,H=Math.max(R,A),J=Math.max(St(C),St(S)),K=Math.max(sn(C),sn(S));return Math.ceil(H*J+K+0)}if(g?.getContentHeight){(p=g?.layout)==null||p.call(g);const C=g.getContentHeight();if(C>0)return m.value||(Zt.value=!0),Math.ceil(C)}const X=(y=g?.getModel)==null?void 0:y.call(g);let ce=1;X&&typeof X.getLineCount=="function"&&(ce=X.getLineCount());const L=St(g);return Math.ceil(ce*(L+1.5)+0)}catch{return null}}function Il(){var e,t;if(m.value)return!1;try{const n=(t=(e=se())==null?void 0:e.getContentHeight)==null?void 0:t.call(e),l=typeof n=="number"&&Number.isFinite(n)&&n>0;return l&&(Zt.value=!0),l}catch{return!1}}function Qn(e){var t,n,l;if(typeof window>"u")return null;try{const o=e.getBoundingClientRect(),i=window.getComputedStyle(e);if(i.display==="none"||i.visibility==="hidden")return null;const d=e.querySelector("diffs-container");if(d instanceof HTMLElement){const c=d.getBoundingClientRect();if(c.height>0&&c.bottom>o.top)return Math.ceil(c.bottom-o.top)}const u=[".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 a=0;for(const c of Array.from(e.querySelectorAll(u.join(",")))){if(!(c instanceof HTMLElement)||((t=c.parentElement)!=null&&t.classList.contains("view-zones")||(n=c.parentElement)!=null&&n.classList.contains("margin-view-zones"))&&!((l=c.textContent)!=null&&l.trim()||c.matches(".line-delete, .line-insert, .cdr")||c.querySelector(".diff-hidden-lines, .stream-monaco-diff-unchanged-bridge, .line-delete, .line-insert, .cdr")))continue;const s=window.getComputedStyle(c);if(s.display==="none"||s.visibility==="hidden"||Number.parseFloat(s.opacity||"1")<=.01)continue;const v=c.getBoundingClientRect();v.height<=0||v.bottom<=o.top||(a=Math.max(a,v.bottom-o.top))}return a>0?Math.ceil(a):null}catch{return null}}function Ht(e){if(typeof window>"u")return!1;const t=e.getBoundingClientRect();if(t.width<=0||t.height<=0)return!1;const n=e.querySelectorAll(".editor.modified .diff-hidden-lines, .editor.original .diff-hidden-lines, .stream-monaco-diff-unchanged-bridge");for(const l of Array.from(n)){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 i=l.getBoundingClientRect();if(!(i.width<=0||i.height<=0||i.bottom<=t.top||i.top>=t.bottom))return!0}return!1}function Xn(e){var t;const n=String(e??"").trim(),l=(t=n.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i))==null?void 0:t[1];if(l){const a=l.length===3?l.split("").map(c=>`${c}${c}`).join(""):l;return .2126*Number.parseInt(a.slice(0,2),16)+.7152*Number.parseInt(a.slice(2,4),16)+.0722*Number.parseInt(a.slice(4,6),16)}const o=n.match(/\d+(?:\.\d+)?/g);if(!o||o.length<3)return null;const[i,d,u]=o.slice(0,3).map(Number);return .2126*i+.7152*d+.0722*u}function Nt(){var e,t,n;if(Ul())return;const l=In();l&&l>0&&(An.value=l,_.value=l,pe.value=l);try{const o=St(m.value?(n=(t=(e=U())==null?void 0:e.getModifiedEditor)==null?void 0:t.call(e))!=null?n:U():se());o&&o>0&&(tn.value=o)}catch{}try{const o=zl();o&&o>0&&(tn.value=o)}catch{}}function Ul(){return m.value&&xl.value}function Kn(){var e;if(!m.value||!Ne.value)return null;const t=f.value,n=(e=O.value)==null?void 0:e.querySelector("pre.code-pre-fallback");if(!t||!n)return null;const l=Math.ceil(n.getBoundingClientRect().height);return!Number.isFinite(l)||l<=0?null:(t.style.height=`${l}px`,t.style.minHeight=`${l}px`,t.style.maxHeight=`${Math.ceil(Ct())}px`,t.style.overflow="hidden",l)}function Zn(){var e,t,n,l,o,i,d,u;const a=f.value,c=O.value;if(!a||!c)return;const s=a,v=a.querySelector(".monaco-editor")||a,p=v.querySelector(".monaco-editor-background")||v,y=v.querySelector(".view-lines")||v;let h=null,g=null,X=null;try{typeof window<"u"&&typeof window.getComputedStyle=="function"&&(h=window.getComputedStyle(v),g=p===v?h:window.getComputedStyle(p),X=y===v?h:window.getComputedStyle(y))}catch{h=null,g=null,X=null}const ce=String((e=h?.getPropertyValue("--vscode-editor-foreground"))!=null?e:"").trim(),L=String((t=h?.getPropertyValue("--vscode-editor-background"))!=null?t:"").trim(),C=String((l=(n=h?.getPropertyValue("--vscode-editor-selectionBackground"))!=null?n:h?.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?l:"").trim(),S=ce||String((i=(o=X?.color)!=null?o:h?.color)!=null?i:"").trim(),F=L||String((u=(d=g?.backgroundColor)!=null?d:h?.backgroundColor)!=null?u:"").trim(),P=(function(){var T,R,A,H,J;try{const K=m.value?(A=(R=(T=U())==null?void 0:T.getModifiedEditor)==null?void 0:R.call(T))!=null?A:U():se(),st=kt(),Dt=(H=st?.EditorOption)==null?void 0:H.fontInfo;if(K&&Dt!=null){const At=(J=K.getOption)==null?void 0:J.call(K,Dt),Ue=At?.typicalHalfwidthCharacterWidth;if(typeof Ue=="number"&&Number.isFinite(Ue)&&Ue>0)return Ue}}catch{}return null})();if(P!=null&&(nn.value=P),m.value){const T=(R,A)=>{A?(c.style.setProperty(R,A),s.style.setProperty(R,A)):(c.style.removeProperty(R),s.style.removeProperty(R))};for(const[R,A]of Object.entries(Bl(c.classList.contains("is-dark"))))T(R,A);return S?(c.style.setProperty("--markstream-diff-editor-fg",S),s.style.setProperty("--vscode-editor-foreground",S),s.style.setProperty("--stream-monaco-editor-fg",S)):(c.style.removeProperty("--markstream-diff-editor-fg"),s.style.removeProperty("--vscode-editor-foreground"),s.style.removeProperty("--stream-monaco-editor-fg")),F?(c.style.setProperty("--markstream-diff-editor-bg",F),c.style.setProperty("--markstream-diff-panel-bg",F),c.style.setProperty("--markstream-diff-panel-bg-soft",F),c.style.setProperty("--markstream-diff-panel-bg-strong",F),s.style.setProperty("--vscode-editor-background",F),s.style.setProperty("--stream-monaco-editor-bg",F),s.style.setProperty("--stream-monaco-fixed-editor-bg",F),s.style.setProperty("--stream-monaco-panel-bg",F),s.style.setProperty("--stream-monaco-panel-bg-soft",F),s.style.setProperty("--stream-monaco-panel-bg-strong",F),s.style.backgroundColor=F):(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(C?s.style.setProperty("--vscode-editor-selectionBackground",C):s.style.removeProperty("--vscode-editor-selectionBackground"))}if((function(T,R,A){if(!xn.value)return!1;const H=Xn(T),J=Xn(R);return A?H!=null&&H>170||J!=null&&J<110:H!=null&&H<85||J!=null&&J>190})(F,S,c.classList.contains("is-dark")))return s.style.removeProperty("--vscode-editor-foreground"),s.style.removeProperty("--vscode-editor-background"),void s.style.removeProperty("--vscode-editor-selectionBackground");S&&s.style.setProperty("--vscode-editor-foreground",S),F&&s.style.setProperty("--vscode-editor-background",F),C&&s.style.setProperty("--vscode-editor-selectionBackground",C)}let el=0,tl=0;const Vl=/auto|scroll|overlay/i;function Le(e,t,n){var l;if(typeof window>"u"||m.value||(function(s){return Ao.value||kl(s)})(e))return;const o=Math.ceil(t),i=Math.ceil(n)-o;if(Math.abs(i)<=1)return;const d=(function(s){var v,p;if(typeof window>"u")return null;const y=(v=s?.ownerDocument)!=null?v:document,h=y.scrollingElement||y.documentElement||y.body;let g=(p=s?.parentElement)!=null?p:null;for(;g&&g!==y.body&&g!==h;){const X=window.getComputedStyle(g),ce=(X.overflowY||"").toLowerCase(),L=(X.overflow||"").toLowerCase();if(Vl.test(ce)||Vl.test(L))return g;g=g.parentElement}return h})(e);if(!d)return;const u=(l=e.ownerDocument)!=null?l:document,a=d===u.body||d===u.documentElement||d===u.scrollingElement,c=a?0:d.getBoundingClientRect().top;e.getBoundingClientRect().top-c>=0||(a&&typeof window.scrollBy=="function"?window.scrollBy(0,i):d.scrollTop+=i)}function nl(){try{const e=f.value;if(!e)return;const t=e.getBoundingClientRect().height,n=_l();if(n!=null&&n>0){const o=Ol(n,!0,{allowBelowEstimatedFloor:!m.value&&W.value&&Il()}),i=nt();return e.style.minHeight=i!=null?`${i}px`:"0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",void Le(e,t,o)}const l=nt();l!=null&&(e.style.minHeight=`${l}px`,e.style.height=`${l}px`,e.style.maxHeight="none",e.style.overflow="visible",Le(e,t,l))}catch{}}function ot(){for(var e,t;ze.length>0;)try{(t=(e=ze.pop())==null?void 0:e.dispose)==null||t.call(e)}catch{}bt!=null&&(yn(bt),bt=null),Bt!=null&&(yn(Bt),Bt=null),Ge!=null&&(yn(Ge),Ge=null),Je=0,Ye=!1}function Re(){for(var e;$n.length>0;)try{(e=$n.pop())==null||e()}catch{}}function le(e=!1){xe.value||(Fe.value?nl():(function(t={}){var n,l,o;try{const i=f.value;if(!i)return;const d=i.getBoundingClientRect().height,u=Ct(),a=Math.ceil(((n=i.getBoundingClientRect)==null?void 0:n.call(i).height)||0),c=Number.parseFloat(i.style.height||""),s=a>0?a:Number.isFinite(c)&&c>0?Math.ceil(c):0,v=m.value?(function(){var H,J,K,st,Dt,At,Ue,ho,go,yo,wo,bo;if($e())return null;try{const dt=U(),ct=(H=dt?.getOriginalEditor)==null?void 0:H.call(dt),ft=(J=dt?.getModifiedEditor)==null?void 0:J.call(dt);if(!ct||!ft)return null;const vi=((Dt=(st=(K=ct.getModel)==null?void 0:K.call(ct))==null?void 0:st.getLineCount)==null?void 0:Dt.call(st))||1,mi=((ho=(Ue=(At=ft.getModel)==null?void 0:At.call(ft))==null?void 0:Ue.getLineCount)==null?void 0:ho.call(Ue))||1,pi=Math.max(vi,mi),hi=Math.max(St(ct),St(ft)),gi=Math.max(sn(ct),sn(ft)),yi=Math.max((yo=(go=ct.getContentHeight)==null?void 0:go.call(ct))!=null?yo:0,(bo=(wo=ft.getContentHeight)==null?void 0:wo.call(ft))!=null?bo:0);return Math.ceil(Math.max(yi,pi*hi+gi+0))}catch{return null}})():null,p=m.value&&Ht(i),y=m.value&&cn(i),h=m.value&&i.classList.contains("stream-monaco-diff-native-stale"),g=p&&W.value&&D.value&&!Ne.value;if(p||(ve.value=null),Cn>0&&(Cn--,Qe.value!=null))return void Le(i,d,De(i,Qe.value,u,{allowBelowEstimatedFloor:g}));if(m.value&&!y&&!p&&Ne.value){const H=Kn();if(H!=null){const J=De(i,H,u,{allowBelowEstimatedFloor:!0});return ee(!0),void Le(i,d,J)}}const X=m.value&&t.preferModelDiffHeight===!0,ce=m.value?Qn(i):null,L=ce,C=!m.value&&W.value&&Il(),S=m.value&&r.loading!==!1&&(L!=null||v!=null&&a>0&&v<a-1),F=v!=null&&!g;let P;if(m.value)if(X){const H=v!=null&&r.loading===!1&&s>0&&v<s-1;P=r.loading===!1&&L!=null?p||v==null?L:Math.max(L,v):H?v:L!=null&&v!=null?Math.max(L,v,r.loading!==!1?s:0):Math.max(L??0,v??0,r.loading!==!1?s:0)||null}else P=p?ce:_e.value&&L!=null||L!=null?F?Math.max(L,v):L:m.value&&r.loading!==!1?v!=null&&s>0&&v<s-1?v:s>0?s:null:v;else P=_l();if(m.value&&r.loading===!1&&h&&!g&&P!=null&&v!=null&&(P=Math.min(P,v)),m.value&&P!=null&&s>0&&(r.loading!==!1||r.loading===!1&&h&&!g||t.holdCurrentDiffHeight===!0&&!g)&&(P=Math.max(P,s)),P!=null&&P>0){const H=p&&ve.value!=null,J=p&&a>0&&a<u-1&&P>=u-1,K=De(i,H?Math.max(ve.value,P):J?a:P,u,{clearEstimatedFloor:!0,allowBelowEstimatedFloor:g||C||S});return p&&K<u-1&&(ve.value=Math.max((l=ve.value)!=null?l:0,K)),ll(i),void Le(i,d,K)}if(Qe.value!=null)return void Le(i,d,De(i,Qe.value,u,{allowBelowEstimatedFloor:g}));const T=m.value&&r.loading!==!1||p?a:Math.max(a,v!=null&&v>0?v:0);if(T>0){const H=p&&ve.value!=null,J=p&&a>0&&a<u-1&&T>=u-1,K=De(i,H?Math.max(ve.value,T):J?a:T,u,{allowBelowEstimatedFloor:g});return p&&K<u-1&&(ve.value=Math.max((o=ve.value)!=null?o:0,K)),ll(i),void Le(i,d,K)}const R=nt();if(!(R==null||m.value&&r.loading!==!1&&y))return void Le(i,d,De(i,R,u,{allowBelowEstimatedFloor:g}));const A=Number.parseFloat(i.style.height);!Number.isNaN(A)&&A>0?Le(i,d,De(i,A,u,{allowBelowEstimatedFloor:g})):m.value||Le(i,d,De(i,u,u))}catch{}})(typeof e=="object"?e:{}))}function Gl(){el=0,tl=0}function ee(e=!1){var t,n,l;if(xe.value)return;const o=f.value;if(!o)return;const i=m.value?U():se();if(i&&typeof i.layout=="function")try{const d=(t=o.getBoundingClientRect)==null?void 0:t.call(o),u=Math.ceil(((n=d?.width)!=null?n:0)||o.clientWidth||0),a=Math.ceil(((l=d?.height)!=null?l:0)||o.clientHeight||Number.parseFloat(o.style.height||"")||0);if(u>0&&a>0){if(!e&&u===el&&a===tl)return;el=u,tl=a,i.layout({width:u,height:a})}else Gl(),i.layout()}catch{}}function he(){if(!m.value)return void Re();const e=f.value;if(!e)return void Re();const t=e.querySelector(".monaco-diff-editor");if(!t||t.classList.contains("side-by-side"))return void Re();const n=Array.from(t.querySelectorAll(".editor.original .diff-hidden-lines")),l=Array.from(t.querySelectorAll(".editor.modified .diff-hidden-lines")),o=Math.min(n.length,l.length);for(let i=0;i<o;i++){const d=l[i],u=d.querySelector("a"),a=d.querySelector(".center > div:first-child"),c=d.querySelector(".center");if(!u||!a||!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 v=u.getAttribute("title")||"Show Unchanged Region";s.title=v,s.setAttribute("aria-label",v);const p=g=>{g.preventDefault(),g.stopPropagation()},y=g=>{g.preventDefault(),g.stopPropagation(),u.click(),fe(()=>de())},h=g=>{g.key!=="Enter"&&g.key!==" "||(g.preventDefault(),g.stopPropagation(),u.click(),fe(()=>de()))};s.addEventListener("mousedown",p),s.addEventListener("click",y),s.addEventListener("keydown",h),c.appendChild(s),$n.push(()=>{s.removeEventListener("mousedown",p),s.removeEventListener("click",y),s.removeEventListener("keydown",h),s.parentElement===c&&c.removeChild(s)})}}function de(e=!1){if(B||bt!=null)return;const t=()=>{B||(he(),le(e),ee())};bt=fe(()=>{bt=null,t(),Bt=fe(()=>{Bt=null,t()})}),it()}function it(e=!1){if(!m.value||B||!e&&r.loading===!1||(Ye=Ye||e,Je=Math.max(Je,e?18:6),Ge!=null))return;const t=()=>{if(Ge=null,!m.value||B||Je<=0||!Ye&&r.loading===!1)return Je=0,void(Ye=!1);Je--,he(),le({preferModelDiffHeight:!0,holdCurrentDiffHeight:Ye}),ee(),Je>0?Ge=fe(t):Ye=!1};Ge=fe(t)}function De(e,t,n,l={}){const o=m.value&&r.loading!==!1?Qn(e):null,i=o!=null&&o>t+1?o:t,d=Math.min(i,n),u=l.allowBelowEstimatedFloor===!0||$l(),a=Ol(d,l.clearEstimatedFloor===!0,{allowBelowEstimatedFloor:u}),c=nt();if(e.style.minHeight=c==null||u?"0px":`${Math.min(c,Math.ceil(n))}px`,e.style.height=`${a}px`,e.style.maxHeight=`${Math.ceil(n)}px`,m.value)e.style.overflow="hidden";else{const s=t>n+1;e.style.overflow=s?"auto":"hidden"}return a}function ll(e){var t,n,l,o,i,d,u,a;if(!m.value)return;const c=Fe.value||!Ht(e)||e.getBoundingClientRect().height>=Ct()-1;if(Sn===c)return;Sn=c;const s=Ce(I({},(n=(t=r.monacoOptions)==null?void 0:t.scrollbar)!=null?n:{}),{handleMouseWheel:c}),v=U();try{(i=(o=(l=v?.getOriginalEditor)==null?void 0:l.call(v))==null?void 0:o.updateOptions)==null||i.call(o,{scrollbar:s}),(a=(u=(d=v?.getModifiedEditor)==null?void 0:d.call(v))==null?void 0:u.updateOptions)==null||a.call(u,{scrollbar:s})}catch{}}function cn(e=f.value){return!!$e(e)||!!e?.querySelector(".monaco-diff-editor .view-lines .view-line")}function Jl(e=f.value){return!!$e(e)||!!e?.querySelector(".monaco-editor .view-lines .view-line")}function Yl(){var e,t;if($e())return!0;const n=(t=(e=se())==null?void 0:e.getModel)==null?void 0:t.call(e);return typeof n?.getValue=="function"&&n.getValue()===Te.value}function Ql(e=f.value){return!!$e(e)||!!e?.classList.contains("stream-monaco-diff-root")&&!(_e.value&&!e.classList.contains("stream-monaco-diff-inline"))}function $e(e=f.value){return!!e?.querySelector("diffs-container")}function Xl(e){return r.loading!==!1||D.value||e.classList.contains("stream-monaco-diff-native-stale")||Ht(e)}function ei(){const e=U();return typeof e?.getOriginalEditor=="function"||typeof e?.getModifiedEditor=="function"||typeof e?.getLineChanges=="function"}function Kl(){return q(this,arguments,function*(e={}){var t,n,l;if(!m.value)return!0;if($e())return yield j(),yield Pe(),$e();const o=e.requireHighlight!==!1;let i=0,d=Pt(String((t=r.node.originalCode)!=null?t:""),String((n=r.node.updatedCode)!=null?n:"")),u=dn(d.original,d.updated),a=u.added>0||u.removed>0;const c=()=>{var s,v;const p=Pt(String((s=r.node.originalCode)!=null?s:""),String((v=r.node.updatedCode)!=null?v:""));p.original===d.original&&p.updated===d.updated||(d=p,u=dn(d.original,d.updated),a=u.added>0||u.removed>0)};for(let s=0;s<30;s++){if(B)return!1;c();const v=f.value,p=U(),y=Gn();let h=!1;try{const S=(l=p?.getLineChanges)==null?void 0:l.call(p);h=Array.isArray(S)&&(!a||S.length>0)}catch{h=!1}const g=!!v?.querySelector(".monaco-diff-editor"),X=cn(v),ce=!a||Rl(v,u),L=!a||Al(v,u),C=!y||jl(v);if(g&&X&&h&&ce&&L&&C&&Tl(v)){try{xt(),he(),lt(),de()}catch{}if(yield j(),yield Pe(),B)return!1;const S=f.value,F=!Gn()||jl(S),P=!a||Rl(S,u),T=!a||Al(S,u),R=Yo(S,a),A=Qo(S,u),H=!o||Vn(S),J=Ql(S)&&F&&ql(S)&&P&&T&&R&&A&&H,K=Ql(S)&&F&&ql(S)&&P&&T&&Tl(S)&&H;if(J||K){if(i++,i>=2)return!0}else i=0}yield j(),yield Pe()}return B||(xt(),he(),lt(),de(),c()),!1})}function Zl(e,t,n){return q(this,null,function*(){try{return void(yield Qt(e,t,n))}catch(l){if(!Lt(l))throw l}if(yield j(),yield Pe(),!B&&m.value)try{yield Qt(e,t,n)}catch(l){if(!Lt(l))throw l}})}function Ct(){var e,t;const n=(t=(e=r.monacoOptions)==null?void 0:e.MAX_HEIGHT)!=null?t:500;if(typeof n=="number")return n;const l=String(n).match(/^(\d+(?:\.\d+)?)/);return l?Number.parseFloat(l[1]):500}const ol=k(()=>r.isShowPreview&&(ke.value==="html"||ke.value==="svg"));function Ie(){return typeof r.node.loading=="boolean"?r.node.loading:r.loading===!0}function eo(){var e,t,n;if(!Ie())return!0;const l=String((e=r.node.raw)!=null?e:""),o=(n=(t=l.split(/\r\n|\n|\r/,1)[0])==null?void 0:t.trimStart())!=null?n:"";return!/^(?:`{3,}|~{3,})/.test(o)||/\r\n|\n|\r/.test(l)}function to(e,t,n){return!n||eo()&&String(t??"")?hn(String(e??"")):"plain"}function fn(){return Ie()}let Mt=null,il=!1,vn=0;function no(){Mt=null,vn++}function lo(){return q(this,arguments,function*(e=vn){if(!il){il=!0;try{for(;Mt&&!B&&!m.value&&e===vn;){const t=Mt;Mt=null;try{yield Promise.resolve(Bn(t.code,t.language)),yield j(),B||m.value||(le(!1),ee())}catch{}}}finally{il=!1,!Mt||B||m.value||lo()}}})}function oo(e,t){Mt={code:e,language:t},lo(vn)}ae(()=>[r.node.language,r.node.code,r.node.raw,r.node.loading,r.loading],([e,t,n,l,o])=>{ke.value=to(e,t,typeof l=="boolean"?l:o===!0)}),ae(()=>[r.node.originalCode,r.node.updatedCode,m.value],()=>{ve.value=null,Jn(),fe(()=>lt())},{immediate:!0});let mn=0;ae(()=>[r.node.originalCode,r.node.updatedCode,Ee.value,m.value,r.stream],e=>q(null,[e],function*([,,,t,n]){var l,o;const i=++mn;if(!t||Ie()||n===!1&&!Q.value)return;if(n!==!1&&ue&&!Q.value&&f.value)try{yield Ae(f.value)}catch{}const d=Et;if(d&&!Se.value){try{yield d}catch{}if(B||!m.value||i!==mn)return}if(i!==mn)return;const u=Pt(String((l=r.node.originalCode)!=null?l:""),String((o=r.node.updatedCode)!=null?o:"")),a=r.loading===!1;a&&at();try{if(yield Zl(u.original,u.updated,Ee.value),B||!m.value||i!==mn)return;yield j(),ee(!0),he(),le(r.loading===!1||{preferModelDiffHeight:!0}),ee(!0),de(!0)}catch{return}if(a){if(B||!m.value)return;xt(),he(),lt(),de(),it(!0)}Fe.value&&fe(()=>nl())})),ae(()=>r.node.code,e=>q(null,null,function*(){if(Ie()||r.stream===!1||(ke.value||(ke.value=hn(pl(e))),m.value))return;const t=Et;if(t&&!Se.value){try{yield t}catch{}if(B||m.value)return}if(ue&&!Q.value&&f.value)try{yield Ae(f.value)}catch{}oo(Kt(r.node.code),Ee.value),Fe.value&&fe(()=>nl())}));const ti=k(()=>{const e=ke.value;return e?Co[e]||e.charAt(0).toUpperCase()+e.slice(1):Co[""]}),io=k(()=>{var e;return Ti(String((e=r.node.raw)!=null?e:""),ti.value,m.value)}),ni=k(()=>io.value.title),ro=k(()=>io.value.caption),li=k(()=>($i.value,(function(e,t){if(t===void 0)return Oi(e);if(t){const l=t(e);if(l!=null&&l!=="")return l}const n=hn(e);return zi(n)||Hi()})(ke.value||"",ht))),oi=k(()=>{const e={};e["--markstream-code-layout-character-width"]=nn.value==null?"1ch":`${nn.value}px`;const t=o=>{if(o!=null)return typeof o=="number"?`${o}px`:String(o)},n=t(r.minWidth),l=t(r.maxWidth);if(n&&(e.minWidth=n),l&&(e.maxWidth=l),Fl.value&&!m.value&&!xe.value){const o=Go.value;o!=null&&(e.minHeight=`${o}px`)}return m.value||(e.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",e.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg))",e.borderColor="var(--markstream-code-border-color)"),e}),ii=k(()=>r.showTooltips!==!1);function ri(){return q(this,null,function*(){try{typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(r.node.code)),yt.value=!0,E("copy",r.node.code),setTimeout(()=>{yt.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})}function ai(){Fe.value=!Fe.value;const e=m.value?U():se(),t=f.value;e&&t&&(Fe.value?(pn(!0),t.style.maxHeight="none",t.style.overflow="visible",le(!0)):(pn(!1),t.style.overflow=m.value?"hidden":"auto",le(!0)),ll(t))}function ui(){var e,t;if(xe.value=!xe.value,xe.value){if(f.value){const n=Math.ceil(((t=(e=f.value).getBoundingClientRect)==null?void 0:t.call(e).height)||0);n>0&&(Qe.value=n)}pn(!1)}else Fe.value&&pn(!0),f.value&&Qe.value!=null&&(f.value.style.height=`${Qe.value}px`),Cn=2,j(()=>{xe.value||B||(le(!0),ee(!0))})}function si(){if(!ol.value)return;const e=ke.value;if(Gt.value){const t=e==="html"?"text/html":"image/svg+xml",n=e==="html"?Y("artifacts.htmlPreviewTitle")||"HTML Preview":Y("artifacts.svgPreviewTitle")||"SVG Preview";return void E("previewCode",{node:r.node,artifactType:t,artifactTitle:n,id:`temp-${e}-${Date.now()}`})}e==="html"&&(en.value=!en.value)}function pn(e){var t,n;try{if(m.value){const l=U();(t=l?.updateOptions)==null||t.call(l,{automaticLayout:e})}else{const l=se();(n=l?.updateOptions)==null||n.call(l,{automaticLayout:e})}}catch{}}function di(e){return q(this,null,function*(){var t;if(!ue||B)return;const n=$t.value;if(Tn=!1,me.value=!1,et.value=null,Se.value=!1,D.value=!1,Ot.value=!1,Sn=null,An.value=null,tn.value=null,nn.value=null,(function(){const a=(function(){var c;const s=(c=f.value)==null?void 0:c.parentElement;return s instanceof HTMLElement?s:null})();a&&(a.style.removeProperty("--stream-monaco-line-number-left"),a.style.removeProperty("--stream-monaco-line-number-width"),a.style.removeProperty("--stream-monaco-line-number-gap-to-code"),a.style.removeProperty("--stream-monaco-original-line-number-gap-to-code"),a.style.removeProperty("--stream-monaco-modified-line-number-gap-to-code"),a.style.removeProperty("--stream-monaco-original-scrollable-left"),a.style.removeProperty("--stream-monaco-modified-scrollable-left"))})(),Gl(),(function(){Zt.value=!1;const a=Ml.value;Wn.value=W.value||a==null?null:a})(),ot(),Re(),(function(a){a.replaceChildren()})(e),at(),B)return;const l=q(null,null,function*(){var a,c;if(n==="diff"){(function(){if(Ln||typeof window>"u")return;Ln=!0;const v=p=>{var y;Lt("reason"in p?p.reason:(y=p.error)!=null?y:p.message)&&(p.preventDefault(),p.stopImmediatePropagation())};window.addEventListener("error",v,!0),window.addEventListener("unhandledrejection",v,!0),Xt=()=>{window.removeEventListener("error",v,!0),window.removeEventListener("unhandledrejection",v,!0),Ln=!1,Xt=null}})(),Xe();const s=Pt(String((a=r.node.originalCode)!=null?a:""),String((c=r.node.updatedCode)!=null?c:""));Yt?yield gt(()=>Yt(e,s.original,s.updated,Ee.value)):yield gt(()=>ue(e,r.node.code,Ee.value))}else yield gt(()=>ue(e,Te.value,Ee.value));Se.value=!0}),o=l.finally(()=>{Et===o&&(Et=null)});if(Et=o,yield(function(a){return q(this,null,function*(){if(!m.value)return void(yield a);let c,s=!1;for(a.then(()=>{s=!0},v=>{s=!0,c=v});;){if(B)return;if(s){if(c)throw c;return}if(cn()&&ei())return;yield j(),yield Pe()}})})(o),B||$t.value!==n)return;Se.value=!0;const i=n==="diff"?U():se();if(typeof((t=r.monacoOptions)==null?void 0:t.fontSize)=="number")i?.updateOptions({fontSize:r.monacoOptions.fontSize,automaticLayout:!1}),pe.value=r.monacoOptions.fontSize,_.value=r.monacoOptions.fontSize;else if(!Ul()){const a=In();a&&a>0?(pe.value=a,_.value=a):(pe.value=12,_.value=12)}Nt(),yield co(),Fe.value||xe.value||le(!1),W.value=!0,wl.value=n,(function(){var a,c,s,v,p;if(ot(),m.value){const h=U(),g=(a=h?.getOriginalEditor)==null?void 0:a.call(h),X=(c=h?.getModifiedEditor)==null?void 0:c.call(h),ce=(C,S)=>{try{const F=C?.[S];if(typeof F!="function")return;const P=F.call(C,()=>de());P&&ze.push(P)}catch{}};try{const C=(s=h?.onDidUpdateDiff)==null?void 0:s.call(h,()=>{de(),fe(()=>lt())});C&&ze.push(C)}catch{}ce(g,"onDidContentSizeChange"),ce(X,"onDidContentSizeChange");const L=f.value;if(L&&typeof MutationObserver<"u"){const C=[".view-line",".view-lines",".view-zones",".margin-view-zones",".diff-hidden-lines",".stream-monaco-diff-unchanged-bridge",".stream-monaco-fallback-inline-delete-zone",".stream-monaco-fallback-inline-delete-margin"].join(","),S=T=>{var R;const A=T instanceof HTMLElement?T:T.parentElement;return!!((R=A?.closest)!=null&&R.call(A,C))},F=T=>{var R,A;const H=T instanceof HTMLElement?T:T.parentElement;return!!((R=H?.closest)!=null&&R.call(H,C)||(A=H?.querySelector)!=null&&A.call(H,C))},P=new MutationObserver(T=>{m.value&&Xl(L)&&T.some(R=>S(R.target)||Array.from(R.addedNodes).some(F)||Array.from(R.removedNodes).some(S))&&(he(),le({preferModelDiffHeight:!0}),ee(),it())});P.observe(L,{attributeFilter:["class"],attributes:!0,childList:!0,characterData:!0,subtree:!0}),ze.push({dispose:()=>P.disconnect()})}if(L){const C=S=>{const F=S.target instanceof Element?S.target:null;if(!F?.closest([".stream-monaco-unchanged-summary",".stream-monaco-unchanged-reveal",".stream-monaco-unchanged-expand",".markstream-inline-fold-proxy",".diff-hidden-lines .center"].join(",")))return;const P=Math.ceil(L.getBoundingClientRect().height||0);P>0&&(ve.value=P)};L.addEventListener("click",C,!0),ze.push({dispose:()=>L.removeEventListener("click",C,!0)})}if(L&&typeof ResizeObserver<"u"){const C=new ResizeObserver(()=>{if(!m.value||(ee(),!Xl(L)))return;const S=Qn(L);if(S==null)return;const F=Math.ceil(L.getBoundingClientRect().height||0),P=ve.value;if(Ht(L)&&P!=null){if(F>P+1)ve.value=F;else if(F<P-1)return De(L,P,Ct()),void ee()}F<=S+1||(he(),le({preferModelDiffHeight:!0}),ee())});C.observe(L),ze.push({dispose:()=>C.disconnect()})}return}const y=se();try{const h=(v=y?.onDidContentSizeChange)==null?void 0:v.call(y,()=>de());h&&ze.push(h)}catch{}try{const h=(p=y?.onDidLayoutChange)==null?void 0:p.call(y,()=>de());h&&ze.push(h)}catch{}})(),Zn(),Nt(),he(),lt(),de(),yield j();let d=null;Ke&&(d=yield Ke(),d&&(yield j(),yield Pe()));const u=d??(n==="diff"?yield Kl({requireHighlight:!0}):yield(function(){return q(this,null,function*(){if($e())return yield j(),yield Pe(),$e();for(let a=0;a<30;a++){if(B||m.value)return!1;const c=f.value,s=Yl(),v=Jl(c),p=!Te.value.trim()||Vn(c);if(s&&v&&p&&(yield j(),yield Pe(),!B&&!m.value&&Yl()&&Jl(f.value)&&(!Te.value.trim()||Vn(f.value))))return!0;yield j(),yield Pe()}return!1})})());B||(u?(Nt(),un(),(yield Ll())||je()):je())})}function Ae(e,t={}){if(!ue||B||r.stream===!1&&r.loading!==!1||(al(),po())||ge.value||f.value!==e||fn())return null;if(Oe)return Oe;if(Q.value&&W.value)return Promise.resolve();const n=rl(),l=Hn.value;let o=!1;Q.value=!0,(function(){const d=Ve.value;ie&&d&&qe!==d&&(qe&&ie.markSettled(qe),qe=d,ie.markPending(d))})();const i=q(null,null,function*(){try{yield di(e),zt=null}catch(d){const u=rl(),a=l!==Hn.value,c=t.allowStaleContentRetry!==!1&&a&&zt!==u;if(n!==u||c)return c&&(zt=u),o=!0,Q.value=!1,W.value=!1,Se.value=!1,void(D.value=!1);throw je(n),d}}).finally(()=>{Oe===i&&(Oe=null),(function(){const d=qe;ie&&d&&(qe="",j(()=>{var u,a;if(!B){const c=(a=(u=O.value)==null?void 0:u.offsetHeight)!=null?a:0;c>0&&ie.reportHeight(d,c)}ie.markSettled(d)}))})(),o&&!B&&queueMicrotask(()=>{var d;const u=f.value;u&&!B&&((d=Ae(u))==null||d.catch(a=>{W.value=!1,D.value=!1,je()}))})});return Oe=i,i}ae(ii,e=>{e||vt()}),ae(()=>_.value,(e,t)=>{const n=m.value?U():se();n&&typeof e=="number"&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),xe.value||le(!0))},{flush:"post",immediate:!1});let ao=0;const ci=ae(()=>[f.value,m.value,r.stream,r.loading,wt.value,Z.value,r.node.language,r.node.raw,r.node.code,r.node.loading],e=>q(null,[e],function*([t,n,l,o,i,d]){const u=++ao;if(!t||!d||Ie()||tt||l===!1&&o!==!1||!ue&&(yield(function(){return q(this,null,function*(){if(typeof window>"u"||B||wt.value||ge.value)return;if(Ft)return Ft;const c=q(null,null,function*(){try{const s=yield Wi();if(B)return;if(!s)return void(ge.value=!0);const v=s.useMonaco,p=s.detectLanguage;if(typeof p=="function"&&(pl=p),typeof v!="function")return;He=fo();const y=v(He);ue=y.createEditor||ue,Yt=y.createDiffEditor||Yt,Bn=y.updateCode||Bn,Qt=y.updateDiff||Qt,kt=y.getEditor||kt,se=y.getEditorView||se,U=y.getDiffEditorView||U,En=y.cleanupEditor||En,Xe=y.safeClean||y.cleanupEditor||Xe,Fn=y.refreshDiffPresentation||Fn,Pn=y.setTheme||Pn,Ke=y.whenVisualReady||null,wt.value=!0}catch{if(B)return;ge.value=!0}}).finally(()=>{Ft===c&&(Ft=null)});return Ft=c,c})})(),u!==ao||r.stream===!1&&r.loading!==!1||fn()||!Z.value||!ue||ge.value||Q.value||po()||B||f.value!==t)||fn())return;const a=Ae(t);if(a){try{yield a}catch{W.value=!1,D.value=!1,je()}W.value&&D.value&&ci()}}));function uo(e){return!!e&&typeof e=="object"&&"light"in e&&"dark"in e}function rt(e){return typeof e=="string"?e:e&&typeof e=="object"&&"name"in e?String(e.name):null}function so(e,t){if(e===t)return!0;const n=rt(e),l=rt(t);return!!n&&n===l}function Tt(){var e;const t=(function(){if(r.theme!==void 0){const a=r.theme;return uo(a)?r.isDark?a.dark:a.light:a}return r.isDark?r.darkTheme:r.lightTheme})(),n=(e=re.value)==null?void 0:e.theme,l=t??n;if(l!=null&&typeof l=="object")return l;const o=Array.isArray(r.themes)?r.themes:[];if(!o.length||l==null)return l;const i=rt(l),d=o.map(a=>rt(a)).filter(a=>!!a);if(!i||d.includes(i))return l;const u=rt(n);return n!=null&&u&&d.includes(u)?n:o[0]}function co(){return q(this,arguments,function*(e={}){at();const t=()=>{m.value&&xt(),fe(()=>{Zn(),de()})};if(e.appearanceOnly)return void t();const n=Tt();if(n)try{yield Pn(n),t()}catch{}else t()})}function Rt(e,t){if(typeof t!="string")return;const n=hn(t),l=So(n),o=["plain","objectivec","objectivecpp"].includes(n)?l:n;for(const i of[o,l])i&&!e.includes(i)&&e.push(i)}ae($t,(e,t)=>q(null,null,function*(){if(e===t||me.value||tt||(no(),!ue||!f.value)||!Q.value||r.stream===!1&&r.loading!==!1||!Z.value)return;const n=Oe;if(n){try{yield n}catch{}if(B||!f.value)return}if(wl.value!==e||!Q.value||!W.value)try{W.value=!1,D.value=!1,Q.value=!1,Se.value=!1,ot(),Re(),Xe(),yield j(),yield Ae(f.value)}catch{W.value=!1,D.value=!1,je()}}));const fi=k(()=>{var e;const t=[],n=(e=re.value)==null?void 0:e.languages;if(Array.isArray(n))for(const l of n)Rt(t,l);return eo()&&Rt(t,r.node.language),Rt(t,ke.value),Rt(t,Ee.value),Rt(t,"plaintext"),t});function fo(){const e=Ce(I(Ce(I({wordWrap:"on",wrappingIndent:"same",themes:r.themes},re.value||{}),{languages:fi.value,stream:!1,fontSize:ln.value,lineHeight:on.value,theme:Tt(),disableFileHeader:!0}),m.value?{diffAppearance:zn.value}:{}),{onThemeChange(){Zn()}}),t=(function(){var n;const l=(n=re.value)==null?void 0:n.fontFamily;return typeof l=="string"&&l.trim()?l.trim():m.value?(function(){var o;if(typeof window>"u")return;const i=(o=O.value)==null?void 0:o.querySelector("pre.code-pre-fallback");if(i)return window.getComputedStyle(i).fontFamily.trim()||void 0})():void 0})();if(t&&(e.fontFamily!=null||(e.fontFamily=t)),m.value){e.wordWrap=Rn.value?"on":"off";const n=typeof e.unsafeCSS=="string"?`${e.unsafeCSS}
23
+ `:"",l=(function(){var o,i;const d=Dn.value;if(d===!1||typeof d=="object"&&d.enabled===!1)return null;const u=typeof d=="object"?d:jt,a=Math.max(0,Math.floor((o=u.contextLineCount)!=null?o:2));return{contextLineCount:a,collapsedContextThreshold:a+Math.max(1,Math.floor((i=u.minimumLineCount)!=null?i:4))-1}})();e.unsafeCSS=`${n}
24
+ pre { column-gap: 0; }
25
+ pre > code { column-gap: 0; padding-block: 0; }
26
+ [data-separator="line-info"] { margin-top: 0; }
27
+ `,l?(e.parseDiffOptions=Ce(I({},e.parseDiffOptions),{context:l.contextLineCount}),e.collapsedContextThreshold=l.collapsedContextThreshold,e.expandUnchanged=!1,e.hunkSeparators="line-info",e.unsafeCSS+=`[data-separator="line-info"][data-separator-last] { height: 28px; }
28
+ `):(e.expandUnchanged=!0,e.hunkSeparators="simple")}return e}function at(){const e=fo();if(!He)return He=e,He;for(const t of Object.keys(He))t in e||delete He[t];return Object.assign(He,e),He}const vo=k(()=>{var e,t,n,l,o,i,d,u,a,c,s,v,p,y,h;return JSON.stringify({diffLineStyle:(t=(e=re.value)==null?void 0:e.diffLineStyle)!=null?t:"background",diffUnchangedRegionStyle:(l=(n=re.value)==null?void 0:n.diffUnchangedRegionStyle)!=null?l:"line-info",diffHideUnchangedRegions:((o=r.monacoOptions)==null?void 0:o.diffHideUnchangedRegions)===void 0?I({},jt):gn(r.monacoOptions.diffHideUnchangedRegions),renderSideBySide:(d=(i=re.value)==null?void 0:i.renderSideBySide)==null||d,useInlineViewWhenSpaceIsLimited:(a=(u=re.value)==null?void 0:u.useInlineViewWhenSpaceIsLimited)!=null&&a,enableSplitViewResizing:(s=(c=re.value)==null?void 0:c.enableSplitViewResizing)==null||s,ignoreTrimWhitespace:(p=(v=re.value)==null?void 0:v.ignoreTrimWhitespace)==null||p,originalEditable:(h=(y=re.value)==null?void 0:y.originalEditable)!=null&&h})}),mo=$(0);function rl(){var e;const t=Tt();return JSON.stringify({kind:$t.value,language:Ee.value,structural:vo.value,optionsRevision:mo.value,settledContentGeneration:bl.value,theme:(e=rt(t))!=null?e:t==null?null:"custom",isDark:r.isDark})}ae(()=>[r.monacoOptions,r.theme,r.themes,r.lightTheme,r.darkTheme],()=>{mo.value+=1},{deep:!0}),ae(()=>[Te.value,r.node.originalCode,r.node.updatedCode],()=>{Hn.value+=1,Ie()||(bl.value+=1)});const ut=k(()=>rl());function al(){me.value&&et.value!==ut.value&&(me.value=!1,et.value=null,zt=null,Nn=null,Q.value=!1,W.value=!1,Se.value=!1,D.value=!1,Ot.value=!1)}function po(){return al(),me.value&&et.value===ut.value}function je(e=ut.value){et.value=e,me.value=!0,Ot.value=!1}return ae(ut,()=>q(null,null,function*(){if(tt||!me.value||et.value===ut.value||!ue||!f.value||ge.value||B||!Z.value||r.stream===!1&&r.loading!==!1||fn())return;const e=ut.value;tt=!0;try{if(al(),me.value)return;yield Ae(f.value)}catch{W.value=!1,D.value=!1,je()}finally{Nn=e,yield j(),tt=!1}})),ae(()=>[r.monacoOptions,Z.value],()=>{var e,t;if(at(),!ue||!Z.value)return;const n=m.value?U():se(),l=typeof((e=r.monacoOptions)==null?void 0:e.fontSize)=="number"?r.monacoOptions.fontSize:Number.isFinite(_.value)?_.value:void 0;typeof l=="number"&&Number.isFinite(l)&&l>0&&((t=n?.updateOptions)==null||t.call(n,{fontSize:l})),le(!1)},{deep:!0}),ae(()=>[Tt(),zn.value,wt.value,Q.value,Z.value],([e],t)=>{wt.value&&W.value&&Z.value&&co({appearanceOnly:t!=null&&so(e,t[0])})},{flush:"post"}),ae(()=>[vo.value,wt.value,Z.value],(e,t)=>q(null,[e,t],function*([n,l,o],[i]){if(at(),!l||!o||!ue||!f.value||!Q.value||n===i||r.stream===!1&&r.loading!==!1)return;const d=Oe;if(d){try{yield d}catch{}if(B||!f.value)return}try{W.value=!1,D.value=!1,Q.value=!1,Se.value=!1,ot(),Re(),Xe(),yield j(),yield Ae(f.value,{allowStaleContentRetry:!1})}catch{W.value=!1,D.value=!1,je()}}),{flush:"post"}),ae(()=>[r.loading,Z.value],(e,t)=>q(null,[e,t],function*([n,l],o){if(!l)return;const i=o?.[0];if(i===!1&&n!==!1&&m.value&&Q.value&&(yield j(),fe(()=>{q(null,null,function*(){const u=Oe;if(u)try{yield u}catch{}!B&&m.value&&r.loading!==!1&&(at(),xt(),de())})})),n)return;const d=i!==void 0&&i!==!1;yield j(),fe(()=>{q(null,null,function*(){var u,a;try{if(d&&(yield(function(){return q(this,null,function*(){if(!me.value||!ue||!f.value||ge.value||B||!Z.value)return!1;if(Nn===ut.value)return!0;tt=!0;try{me.value=!1,et.value=null,zt=null,Q.value=!1,W.value=!1,Se.value=!1,D.value=!1,ot(),Re(),Xe(),yield j();try{yield Ae(f.value)}catch{W.value=!1,D.value=!1,je()}}finally{yield j(),tt=!1}return!0})})()))return void le(!1);if(d&&m.value&&Q.value&&Tn&&f.value)return Tn=!1,W.value=!1,D.value=!1,Q.value=!1,Se.value=!1,ot(),Re(),Xe(),yield j(),yield Ae(f.value,{allowStaleContentRetry:!1}),void it(!0);if(d&&Q.value)if(m.value&&f.value){const c=Oe;if(c)try{yield c}catch{}at();const s=Pt(String((u=r.node.originalCode)!=null?u:""),String((a=r.node.updatedCode)!=null?a:""));if(yield Zl(s.original,s.updated,Ee.value),B||!m.value)return;xt(),ee(!0),Pl(),he(),lt();const v=yield Kl({requireHighlight:!0});B||!v||D.value||(yield Ll()),de(),it(!0)}else no(),oo(Te.value,Ee.value);d&&m.value?(le({preferModelDiffHeight:!0,holdCurrentDiffHeight:!0}),it(!0)):le(!1)}catch{}})})}),{immediate:!0,flush:"post"}),Oo(()=>{ot(),Re(),En(),Xt?.()}),(e,t)=>ge.value?(G(),bn(V(xo),{key:0,class:mt(["code-pre-fallback",{"is-wrap":Rn.value}]),style:It(El.value),node:Sl.value,loading:r.loading,"show-line-numbers":!0,"diff-inline":_e.value,"diff-hide-unchanged-regions":Dn.value},null,8,["class","style","node","loading","diff-inline","diff-hide-unchanged-regions"])):(G(),oe("div",{key:1,ref_key:"container",ref:O,style:It(oi.value),class:mt(["code-block-container rounded-lg border",[{dark:r.isDark,"is-rendering":r.loading,"is-dark":yl.value,"is-diff":m.value,"is-plain-text":xn.value}]]),"data-markstream-code-block":"1","data-markstream-enhanced":D.value&&!ge.value?"true":"false","data-markstream-enhancement-state":Wo.value,"data-markstream-code-block-state":Ie()?"streaming":"settled","data-markstream-pending":qo.value?"true":void 0,"data-markstream-viewport-pending":ml.value&&V(Mn)&&!Z.value?"true":void 0},[zo(fr,{"show-header":r.showHeader,"show-collapse-button":r.showCollapseButton,"show-font-size-buttons":r.showFontSizeButtons,"enable-font-size-control":r.enableFontSizeControl,"show-copy-button":r.showCopyButton,"show-expand-button":r.showExpandButton,"show-preview-button":r.showPreviewButton,"show-tooltips":r.showTooltips,"is-dark":r.isDark,loading:r.loading,stream:x.stream,"is-collapsed":xe.value,"is-expanded":Fe.value,"copy-text":yt.value,"is-previewable":ol.value,"code-font-size":_.value,"code-font-min":10,"code-font-max":36,"default-code-font-size":pe.value,"font-baseline-ready":_o.value,"diff-stats":m.value?Ze.value:null,"diff-stats-aria-label":Do.value,onToggleCollapse:ui,onDecreaseFont:Ko,onResetFont:Zo,onIncreaseFont:Xo,onCopy:ri,onToggleExpand:ai,onPreview:si},Fi({"header-left":Ut(()=>[pt(e.$slots,"header-left",{},()=>[b("div",wr,[b("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:li.value},null,8,br),b("div",kr,[b("div",xr,Me(ni.value),1),ro.value?(G(),oe("div",Sr,Me(ro.value),1)):ye("",!0)])])],!0)]),loading:Ut(()=>[pt(e.$slots,"loading",{loading:x.loading,stream:x.stream},()=>[t[0]||(t[0]=b("div",{class:"loading-skeleton"},[b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line short"})],-1))],!0)]),default:Ut(()=>[sl(b("div",{class:mt(["code-editor-layer",{"code-editor-layer--collapsed":xe.value}])},[b("div",{ref_key:"codeEditor",ref:f,class:mt(["code-editor-container",x.stream?"":"code-height-placeholder"]),"data-markstream-host-hidden":jo.value?"true":void 0,style:It(Jo.value)},null,14,Cr),xl.value?(G(),bn(V(xo),{key:0,class:mt(["code-pre-fallback",{"is-wrap":Rn.value}]),style:It(El.value),node:Sl.value,"show-line-numbers":!0,"diff-inline":_e.value,"diff-hide-unchanged-regions":Dn.value},null,8,["class","style","node","diff-inline","diff-hide-unchanged-regions"])):ye("",!0)],2),[[dl,!!x.stream||!x.loading]]),en.value&&!Gt.value&&ol.value&&ke.value==="html"?(G(),bn(gr,{key:0,code:r.node.code,"html-preview-allow-scripts":r.htmlPreviewAllowScripts,"html-preview-sandbox":r.htmlPreviewSandbox,"is-dark":r.isDark,"on-close":()=>en.value=!1},null,8,["code","html-preview-allow-scripts","html-preview-sandbox","is-dark","on-close"])):ye("",!0)]),_:2},[e.$slots["header-right"]?{name:"header-right",fn:Ut(()=>[pt(e.$slots,"header-right",{},void 0,!0)]),key:"0"}:void 0]),1032,["show-header","show-collapse-button","show-font-size-buttons","enable-font-size-control","show-copy-button","show-expand-button","show-preview-button","show-tooltips","is-dark","loading","stream","is-collapsed","is-expanded","copy-text","is-previewable","code-font-size","default-code-font-size","font-baseline-ready","diff-stats","diff-stats-aria-label"])],14,yr))}}),[["__scopeId","data-v-a7a1abdd"]]);export{Er as default};