dimcode-web 0.1.0-alpha.14 → 0.1.0-alpha.16

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 (124) hide show
  1. package/package.json +1 -1
  2. package/release-manifest.json +91 -92
  3. package/web/assets/AccountSettings-CuNxjb5M.js +1 -0
  4. package/web/assets/AccountSettings-DnfPPG7u.css +1 -0
  5. package/web/assets/AgentSettings-B1kyVC9H.js +1 -0
  6. package/web/assets/{AppearanceSettings-C6T82OEq.js → AppearanceSettings-BImLkd19.js} +2 -2
  7. package/web/assets/AppearanceSettings-WVGDYAhR.css +1 -0
  8. package/web/assets/ArchivedSettings-BO8xL_Zc.css +1 -0
  9. package/web/assets/ArchivedSettings-C6UPMqfk.js +1 -0
  10. package/web/assets/{CodeBlockNode-DsUHD3_k.js → CodeBlockNode-Cm4qQWYp.js} +5 -5
  11. package/web/assets/DiagnosticsSettings-Bf1nv4em.css +1 -0
  12. package/web/assets/DiagnosticsSettings-YSRtq2dI.js +1 -0
  13. package/web/assets/GeneralSettingsStatus.vue_vue_type_script_setup_true_lang-CWInOGTv.js +1 -0
  14. package/web/assets/McpSettings-BhAZ-WL2.css +1 -0
  15. package/web/assets/McpSettings-y4Wzg8CT.js +1 -0
  16. package/web/assets/ModalitySettings-BpFvRd--.js +1 -0
  17. package/web/assets/PermissionsSettings-CGumt3Ix.css +1 -0
  18. package/web/assets/PermissionsSettings-DQV3cdej.js +1 -0
  19. package/web/assets/PluginSettings-BF6eSPEd.js +1 -0
  20. package/web/assets/PluginSettings-rv5I0LON.css +1 -0
  21. package/web/assets/PreCodeBlock-DH2VwXzi.js +1 -0
  22. package/web/assets/ProviderAuthFlow.vue_vue_type_script_setup_true_lang-opd2fMYR.js +11 -0
  23. package/web/assets/ProviderSettings-A8WG9V7m.js +2 -0
  24. package/web/assets/ProviderSettings-Cc10ophS.css +1 -0
  25. package/web/assets/SettingsPage-DmhRtj9e.js +51 -0
  26. package/web/assets/SkillSettings-CZ98gDWn.js +3 -0
  27. package/web/assets/SkillSettings-DjDPbVAE.css +1 -0
  28. package/web/assets/{Tooltip-BJL7Jk33.js → Tooltip--ZEIq327.js} +1 -1
  29. package/web/assets/{arc-cA0USBj0.js → arc-BSskkHkz.js} +1 -1
  30. package/web/assets/{architectureDiagram-3BPJPVTR-D4GyRGsi.js → architectureDiagram-3BPJPVTR-B3e2_Mi5.js} +1 -1
  31. package/web/assets/arrow-left-mbUIwPsq.js +6 -0
  32. package/web/assets/{blockDiagram-GPEHLZMM-CaMtk8X8.js → blockDiagram-GPEHLZMM-BSII-1bz.js} +1 -1
  33. package/web/assets/{c4Diagram-AAUBKEIU-By4NO5z_.js → c4Diagram-AAUBKEIU-DA3DfWUR.js} +1 -1
  34. package/web/assets/channel-DrR7UcgS.js +1 -0
  35. package/web/assets/{chunk-2J33WTMH-DVR8RXjF.js → chunk-2J33WTMH-B112AqHa.js} +1 -1
  36. package/web/assets/{chunk-4BX2VUAB-BOCw1xVb.js → chunk-4BX2VUAB-DnNs4Y-E.js} +1 -1
  37. package/web/assets/{chunk-55IACEB6-nIfgcEjn.js → chunk-55IACEB6-BEqL8hBV.js} +1 -1
  38. package/web/assets/{chunk-727SXJPM-RYvblIbW.js → chunk-727SXJPM-DBBS3g7k.js} +1 -1
  39. package/web/assets/{chunk-AQP2D5EJ-BO5Su4MY.js → chunk-AQP2D5EJ-B9jCastR.js} +1 -1
  40. package/web/assets/{chunk-FMBD7UC4-Q206iq7t.js → chunk-FMBD7UC4-DllPbdIS.js} +1 -1
  41. package/web/assets/{chunk-ND2GUHAM-BEHXSkEZ.js → chunk-ND2GUHAM-D9KZG0cK.js} +1 -1
  42. package/web/assets/{chunk-QZHKN3VN-B4wImiUI.js → chunk-QZHKN3VN-BoD6R3M0.js} +1 -1
  43. package/web/assets/classDiagram-4FO5ZUOK-DGOBz3OV.js +1 -0
  44. package/web/assets/classDiagram-v2-Q7XG4LA2-DGOBz3OV.js +1 -0
  45. package/web/assets/context-Grqd_9Lt.js +1 -0
  46. package/web/assets/{cose-bilkent-S5V4N54A-BJj5g70v.js → cose-bilkent-S5V4N54A-BXVnnRnw.js} +1 -1
  47. package/web/assets/{cynefin-OW5HDTMX-C-fnPT_y.js → cynefin-OW5HDTMX-B-6oGbPp.js} +1 -1
  48. package/web/assets/{dagre-BM42HDAG-CpAodSX7.js → dagre-BM42HDAG-B22lGQ6O.js} +1 -1
  49. package/web/assets/{diagram-2AECGRRQ-C0jz5rBL.js → diagram-2AECGRRQ-CJpCn-CU.js} +1 -1
  50. package/web/assets/{diagram-5GNKFQAL-CKvRsL1_.js → diagram-5GNKFQAL-CXv-E4RN.js} +1 -1
  51. package/web/assets/{diagram-KO2AKTUF-C9_QTnZb.js → diagram-KO2AKTUF-DE6YITcQ.js} +1 -1
  52. package/web/assets/{diagram-LMA3HP47-B0gvGn3Z.js → diagram-LMA3HP47-C6a1LN_b.js} +1 -1
  53. package/web/assets/{diagram-OG6HWLK6-CoW4sNwB.js → diagram-OG6HWLK6-lzlMxndk.js} +1 -1
  54. package/web/assets/{erDiagram-TEJ5UH35-B1YPrM8R.js → erDiagram-TEJ5UH35-C33pLVdS.js} +1 -1
  55. package/web/assets/{flowDiagram-I6XJVG4X-DbSCyQ1o.js → flowDiagram-I6XJVG4X-CNEnFS_c.js} +1 -1
  56. package/web/assets/{ganttDiagram-6RSMTGT7-DCU_-HcU.js → ganttDiagram-6RSMTGT7-Dvt_IgnY.js} +1 -1
  57. package/web/assets/{gitGraphDiagram-PVQCEYII-BnwXK64G.js → gitGraphDiagram-PVQCEYII-DEM3UDeh.js} +1 -1
  58. package/web/assets/{index-gSmHRsHg.js → index-AEXvUA5U.js} +1 -1
  59. package/web/assets/{index-B9cemsjA.js → index-B4STIxMF.js} +86 -86
  60. package/web/assets/index-BbPaKBmv.css +1 -0
  61. package/web/assets/index-CenMTLFY.js +247 -0
  62. package/web/assets/{index10-B-_2OEd6.js → index10-BMLJ-2NW.js} +1 -1
  63. package/web/assets/{index5-CFV5-M95.js → index5-BvcjsDmt.js} +1 -1
  64. package/web/assets/{index6-C3q8vusa.js → index6-CxMZBEKt.js} +1 -1
  65. package/web/assets/{index8-Cg5dteH_.js → index8-bIdcFO9W.js} +1 -1
  66. package/web/assets/{index9-DOQm5ENJ.js → index9-DBx_o1y8.js} +1 -1
  67. package/web/assets/{infoDiagram-5YYISTIA-B_F1M87B.js → infoDiagram-5YYISTIA-BYT4MYJl.js} +1 -1
  68. package/web/assets/{ishikawaDiagram-YF4QCWOH-DXtU3ayb.js → ishikawaDiagram-YF4QCWOH-C9V1Zhoz.js} +1 -1
  69. package/web/assets/{journeyDiagram-JHISSGLW-DiP3bT6x.js → journeyDiagram-JHISSGLW-Be6x6oc7.js} +1 -1
  70. package/web/assets/{kanban-definition-UN3LZRKU-8kyelCSQ.js → kanban-definition-UN3LZRKU-BctYKWYf.js} +1 -1
  71. package/web/assets/{linear-aMkA3ImE.js → linear-Dl_nEC-L.js} +1 -1
  72. package/web/assets/{markstream-ybWMrpCV.js → markstream-CvxnTmYJ.js} +2 -2
  73. package/web/assets/{mermaid.core-BWfn-FFw.js → mermaid.core-qKUR3_rw.js} +4 -4
  74. package/web/assets/{mindmap-definition-RKZ34NQL-Dge0FtvP.js → mindmap-definition-RKZ34NQL-CeMPPNxO.js} +1 -1
  75. package/web/assets/{pieDiagram-4H26LBE5-D7MzngYj.js → pieDiagram-4H26LBE5-DDfXBtNB.js} +1 -1
  76. package/web/assets/{quadrantDiagram-W4KKPZXB-cjwaMhCa.js → quadrantDiagram-W4KKPZXB-DM7LwKAJ.js} +1 -1
  77. package/web/assets/{requirementDiagram-4Y6WPE33-ACmBdhUc.js → requirementDiagram-4Y6WPE33-CaWzWB7c.js} +1 -1
  78. package/web/assets/{sankeyDiagram-5OEKKPKP-Rva02Dvb.js → sankeyDiagram-5OEKKPKP-DC1oe_AT.js} +1 -1
  79. package/web/assets/{sequenceDiagram-3UESZ5HK-DzazUDns.js → sequenceDiagram-3UESZ5HK-BZM66sLw.js} +1 -1
  80. package/web/assets/settings-general-dc8P6dA0.js +1 -0
  81. package/web/assets/{stateDiagram-AJRCARHV-BODPWGjc.js → stateDiagram-AJRCARHV-BAaUZKRp.js} +1 -1
  82. package/web/assets/stateDiagram-v2-BHNVJYJU-DTfJIIDB.js +1 -0
  83. package/web/assets/{timeline-definition-PNZ67QCA-D5UqFLNW.js → timeline-definition-PNZ67QCA-Boz2EyqB.js} +1 -1
  84. package/web/assets/{vendor-vue-Ci9TYO_I.js → vendor-vue-CncuOShJ.js} +1 -1
  85. package/web/assets/{vennDiagram-CIIHVFJN-CtcagJ7K.js → vennDiagram-CIIHVFJN-ByQmaid9.js} +1 -1
  86. package/web/assets/{wardleyDiagram-YWT4CUSO-G86oBHE2.js → wardleyDiagram-YWT4CUSO-ByOBzspB.js} +1 -1
  87. package/web/assets/{xychartDiagram-2RQKCTM6-BJ1nXYiQ.js → xychartDiagram-2RQKCTM6-BNgy6nQp.js} +1 -1
  88. package/web/assets/zh-CN-DtOnK_oD.js +1 -0
  89. package/web/dimcode-web.json +2 -2
  90. package/web/index.html +3 -3
  91. package/web/assets/AccountSettings-4uSrBroj.js +0 -1
  92. package/web/assets/AccountSettings-DuC-j6CL.css +0 -1
  93. package/web/assets/AgentSettings-BDiSW65Y.js +0 -1
  94. package/web/assets/AppearanceSettings-CX6_CvK6.css +0 -1
  95. package/web/assets/ArchivedSettings-DDK-qro_.js +0 -1
  96. package/web/assets/ArchivedSettings-De1WaCgP.css +0 -1
  97. package/web/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-KPZUoxNU.js +0 -6
  98. package/web/assets/DiagnosticsSettings-BmWPEGHb.css +0 -1
  99. package/web/assets/DiagnosticsSettings-CiDVWqJz.js +0 -1
  100. package/web/assets/GeneralSettingsStatus.vue_vue_type_script_setup_true_lang-DY1_UG_g.js +0 -1
  101. package/web/assets/McpSettings-DCYV728D.css +0 -1
  102. package/web/assets/McpSettings-nYhoS35F.js +0 -1
  103. package/web/assets/ModalitySettings-BkeyOoQt.css +0 -1
  104. package/web/assets/ModalitySettings-mIAic7i5.js +0 -1
  105. package/web/assets/PermissionsSettings-DVv7C2io.css +0 -1
  106. package/web/assets/PermissionsSettings-Dh9gF7YF.js +0 -1
  107. package/web/assets/PluginSettings-BMQazfW6.js +0 -1
  108. package/web/assets/PluginSettings-EhulK7fw.css +0 -1
  109. package/web/assets/PreCodeBlock-DXIuTGLt.js +0 -1
  110. package/web/assets/ProviderAuthFlow.vue_vue_type_script_setup_true_lang-DHd2sgtZ.js +0 -11
  111. package/web/assets/ProviderSettings-Dc3kVfiC.js +0 -2
  112. package/web/assets/ProviderSettings-O7kVWRtj.css +0 -1
  113. package/web/assets/SettingsPage-YJcDRLr9.js +0 -56
  114. package/web/assets/SkillSettings-C16em-eW.css +0 -1
  115. package/web/assets/SkillSettings-ovHdSPTe.js +0 -3
  116. package/web/assets/channel-rxJrCDWw.js +0 -1
  117. package/web/assets/classDiagram-4FO5ZUOK-BtU1pWhP.js +0 -1
  118. package/web/assets/classDiagram-v2-Q7XG4LA2-BtU1pWhP.js +0 -1
  119. package/web/assets/context-ChGKk1Cc.js +0 -1
  120. package/web/assets/index-BKJW0i9Q.js +0 -225
  121. package/web/assets/index-GnV5W03u.css +0 -1
  122. package/web/assets/settings-general-d_R-CH6R.js +0 -1
  123. package/web/assets/stateDiagram-v2-BHNVJYJU-CJ6CdQEh.js +0 -1
  124. package/web/assets/zh-CN-CSwtlg0N.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markstream-ybWMrpCV.js","assets/index-BKJW0i9Q.js","assets/vendor-vue-Ci9TYO_I.js","assets/index-GnV5W03u.css"])))=>i.map(i=>d[i]);
2
- import{d as aa,z as Ga,i as Wt,r as S,m as Qn,p as oa,w as A,o as Ja,H as ra,a as ul,c as rt,I as Xn,f as il,s as $l,n as nt,q as Yn,e as Qa,g as Xa,b as U,j as it,x as At,v as Ya,t as Gt,A as ia,y as m,J as Za,l as O,B as Ka,k as eo}from"./vendor-vue-Ci9TYO_I.js";import{C as lo,a as ua,l as to,h as no,o as sa,f as ao,s as oo,d as ro,A as Zn,i as se,Z as io,J as uo,j as so,K as fo,k as vo,M as co,q as mo,y as ho,t as po,G as go,w as yo,x as bo,Q as wo,H as Kn,I as ea,L as at,X as ko,m as xo}from"./index-B9cemsjA.js";import{B as la,g as So,Q as Co}from"./PreCodeBlock-DXIuTGLt.js";import{_ as Mo}from"./index-BKJW0i9Q.js";var ot=(C,b,M)=>new Promise((ce,ee)=>{var R=k=>{try{n(M.next(k))}catch(H){ee(H)}},he=k=>{try{n(M.throw(k))}catch(H){ee(H)}},n=k=>k.done?ce(k.value):Promise.resolve(k.value).then(R,he);n((M=M.apply(C,b)).next())});let Ut=!1,Hl=null,Ol=null,Dl=null;function Bo(){return ot(this,null,function*(){if(Dl)return Dl;Dl=ot(null,null,function*(){if(!Ol)try{if(Ol=(function(C){var b,M,ce;const ee=C,R=typeof(ee==null?void 0:ee.createCodeBlockRuntime)=="function"||typeof(ee==null?void 0:ee.useMonaco)=="function"?ee:C==null?void 0:C.default,he=(b=R==null?void 0:R.createCodeBlockRuntime)!=null?b:R==null?void 0:R.useMonaco;return typeof he!="function"?null:{createCodeBlockRuntime:n=>he.call(R,n),detectLanguage:(M=R==null?void 0:R.detectLanguage)==null?void 0:M.bind(R),preloadStreamDiffs:(ce=R==null?void 0:R.preloadStreamDiffs)==null?void 0:ce.bind(R)}})(yield Mo(()=>import("./markstream-ybWMrpCV.js"),__vite__mapDeps([0,1,2,3]))),!Ol)return null}catch{return null}try{return yield(function(C){return ot(this,null,function*(){return Ut?void 0:Hl||(Hl=ot(null,null,function*(){const M=C==null?void 0:C.preloadStreamDiffs;typeof M=="function"&&(yield M()),Ut=!0}).finally(()=>{Hl=null}),Hl)})})(Ol),lo(),Ol}catch{return null}});try{return yield Dl}finally{Dl=null}})}var Po=Object.defineProperty,$o=Object.defineProperties,Ho=Object.getOwnPropertyDescriptors,ta=Object.getOwnPropertySymbols,Oo=Object.prototype.hasOwnProperty,Do=Object.prototype.propertyIsEnumerable,na=(C,b,M)=>b in C?Po(C,b,{enumerable:!0,configurable:!0,writable:!0,value:M}):C[b]=M,Ce=(C,b)=>{for(var M in b||(b={}))Oo.call(b,M)&&na(C,M,b[M]);if(ta)for(var M of ta(b))Do.call(b,M)&&na(C,M,b[M]);return C},Nl=(C,b)=>$o(C,Ho(b)),D=(C,b,M)=>new Promise((ce,ee)=>{var R=k=>{try{n(M.next(k))}catch(H){ee(H)}},he=k=>{try{n(M.throw(k))}catch(H){ee(H)}},n=k=>k.done?ce(k.value):Promise.resolve(k.value).then(R,he);n((M=M.apply(C,b)).next())});const No={class:"html-preview-frame__header"},Eo={class:"html-preview-frame__title"},Fo={class:"html-preview-frame__label"},To=["sandbox","srcdoc"],zo=ua(aa({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(C){const b=C,M=import.meta!==void 0&&!1;let ce=null;const{t:ee}=sa(),R=m(()=>{const k=b.code||"",H=k.trim().toLowerCase();return H.startsWith("<!doctype")||H.startsWith("<html")||H.startsWith("<body")?k:`<!doctype html>
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markstream-CvxnTmYJ.js","assets/index-CenMTLFY.js","assets/vendor-vue-CncuOShJ.js","assets/index-BbPaKBmv.css"])))=>i.map(i=>d[i]);
2
+ import{d as aa,A as Ua,i as Wt,r as S,s as Qn,x as oa,w as A,g as Ja,G as ra,o as ul,h as rt,H as Xn,k as il,y as $l,n as nt,c as Yn,j as Qa,l as Xa,e as G,m as it,a as At,v as Ya,t as Ut,u as ia,z as m,I as Za,q as O,B as Ka,p as eo}from"./vendor-vue-CncuOShJ.js";import{C as lo,a as ua,l as to,h as no,o as sa,f as ao,s as oo,d as ro,A as Zn,i as se,Z as io,J as uo,j as so,K as fo,k as vo,M as co,q as mo,y as ho,t as po,G as go,w as yo,x as bo,Q as wo,H as Kn,I as ea,L as at,X as ko,m as xo}from"./index-B4STIxMF.js";import{B as la,g as So,Q as Co}from"./PreCodeBlock-DH2VwXzi.js";import{_ as Mo}from"./index-CenMTLFY.js";var ot=(C,b,M)=>new Promise((ce,ee)=>{var R=k=>{try{n(M.next(k))}catch(H){ee(H)}},he=k=>{try{n(M.throw(k))}catch(H){ee(H)}},n=k=>k.done?ce(k.value):Promise.resolve(k.value).then(R,he);n((M=M.apply(C,b)).next())});let Gt=!1,Hl=null,Ol=null,Dl=null;function Bo(){return ot(this,null,function*(){if(Dl)return Dl;Dl=ot(null,null,function*(){if(!Ol)try{if(Ol=(function(C){var b,M,ce;const ee=C,R=typeof(ee==null?void 0:ee.createCodeBlockRuntime)=="function"||typeof(ee==null?void 0:ee.useMonaco)=="function"?ee:C==null?void 0:C.default,he=(b=R==null?void 0:R.createCodeBlockRuntime)!=null?b:R==null?void 0:R.useMonaco;return typeof he!="function"?null:{createCodeBlockRuntime:n=>he.call(R,n),detectLanguage:(M=R==null?void 0:R.detectLanguage)==null?void 0:M.bind(R),preloadStreamDiffs:(ce=R==null?void 0:R.preloadStreamDiffs)==null?void 0:ce.bind(R)}})(yield Mo(()=>import("./markstream-CvxnTmYJ.js"),__vite__mapDeps([0,1,2,3]))),!Ol)return null}catch{return null}try{return yield(function(C){return ot(this,null,function*(){return Gt?void 0:Hl||(Hl=ot(null,null,function*(){const M=C==null?void 0:C.preloadStreamDiffs;typeof M=="function"&&(yield M()),Gt=!0}).finally(()=>{Hl=null}),Hl)})})(Ol),lo(),Ol}catch{return null}});try{return yield Dl}finally{Dl=null}})}var Po=Object.defineProperty,$o=Object.defineProperties,Ho=Object.getOwnPropertyDescriptors,ta=Object.getOwnPropertySymbols,Oo=Object.prototype.hasOwnProperty,Do=Object.prototype.propertyIsEnumerable,na=(C,b,M)=>b in C?Po(C,b,{enumerable:!0,configurable:!0,writable:!0,value:M}):C[b]=M,Ce=(C,b)=>{for(var M in b||(b={}))Oo.call(b,M)&&na(C,M,b[M]);if(ta)for(var M of ta(b))Do.call(b,M)&&na(C,M,b[M]);return C},Nl=(C,b)=>$o(C,Ho(b)),D=(C,b,M)=>new Promise((ce,ee)=>{var R=k=>{try{n(M.next(k))}catch(H){ee(H)}},he=k=>{try{n(M.throw(k))}catch(H){ee(H)}},n=k=>k.done?ce(k.value):Promise.resolve(k.value).then(R,he);n((M=M.apply(C,b)).next())});const No={class:"html-preview-frame__header"},Eo={class:"html-preview-frame__title"},Fo={class:"html-preview-frame__label"},To=["sandbox","srcdoc"],zo=ua(aa({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(C){const b=C,M=import.meta!==void 0&&!1;let ce=null;const{t:ee}=sa(),R=m(()=>{const k=b.code||"",H=k.trim().toLowerCase();return H.startsWith("<!doctype")||H.startsWith("<html")||H.startsWith("<body")?k:`<!doctype html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="utf-8" />
@@ -20,9 +20,9 @@ import{d as aa,z as Ga,i as Wt,r as S,m as Qn,p as oa,w as A,o as Ja,H as ra,a a
20
20
  <body>
21
21
  ${k}
22
22
  </body>
23
- </html>`}),he=m(()=>{return k=b.htmlPreviewSandbox,H=b.htmlPreviewAllowScripts,typeof k=="string"?((function(je){if(!M||typeof console>"u"||ce===je)return;const X=(function(El){return new Set(El.trim().toLowerCase().split(/\s+/).filter(Boolean))})(je);X.has("allow-scripts")&&X.has("allow-same-origin")&&(ce=je,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."))})(k),k):k!==void 0?"":H===!0?"allow-scripts":"";var k,H});function n(k){var H;k.key!=="Escape"&&k.key!=="Esc"||(H=b.onClose)==null||H.call(b)}return oa(()=>{typeof window<"u"&&window.addEventListener("keydown",n)}),ra(()=>{typeof window<"u"&&window.removeEventListener("keydown",n)}),(k,H)=>(ul(),rt(eo,{to:"body"},[U("div",{class:it(["markstream-vue",{dark:b.isDark}])},[U("div",{class:"html-preview-frame__backdrop",onClick:H[2]||(H[2]=je=>{var X;return(X=b.onClose)==null?void 0:X.call(b)})},[U("div",{class:"html-preview-frame",onClick:H[1]||(H[1]=Ka(()=>{},["stop"]))},[U("div",No,[U("div",Eo,[H[3]||(H[3]=U("span",{class:"html-preview-frame__dot"},null,-1)),U("span",Fo,Gt(b.title||ia(ee)("common.preview")||"Preview"),1)]),U("button",{type:"button",class:"html-preview-frame__close",onClick:H[0]||(H[0]=je=>{var X;return(X=b.onClose)==null?void 0:X.call(b)})}," × ")]),U("iframe",{class:"html-preview-frame__iframe",sandbox:he.value,referrerpolicy:"no-referrer",srcdoc:R.value},null,8,To)])])],2)]))}}),[["__scopeId","data-v-24e66176"]]),Lo=["data-markstream-enhanced","data-markstream-enhancement-state","data-markstream-code-block-state","data-markstream-pending","data-markstream-viewport-pending"],_o={class:"code-header-main"},Ro=["innerHTML"],jo={class:"code-header-copy"},qo={class:"code-header-title"},Io={key:0,class:"code-header-caption"},Vo=["data-markstream-host-hidden"],Qo=ua(aa({__name:"CodeBlockNode",props:{node:{},codeBlockOptions:{},clipboardWriter:{},showLineNumbers:{type:Boolean,default:void 0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},theme:{},darkTheme:{default:void 0},lightTheme:{default:void 0},isShowPreview:{type:Boolean,default:!0},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(C,{emit:b}){var M,ce,ee,R,he;const n=C,k=b,H=m(()=>{var e,l;return(l=n.showLineNumbers)!=null?l:((e=n.codeBlockOptions)==null?void 0:e.disableLineNumbers)!==!0}),je=Ga(),X=Wt(to,null),El=Wt("markstreamHostScrollManaged",null),da=Wt(no,void 0),fa=m(()=>xo(n,je));function Wo(e,l){}const Jt=Qn(),Qt=m(()=>{const e=Jt==null?void 0:Jt.vnode.props;return!(!e||!e.onPreviewCode&&!e["onPreview-code"])}),{t:Xt}=sa(),h=S(null),ne=S(null),ut=S(!1),we=S(zn(n.node.language,n.node.code,Re())),st=m(()=>ho(we.value)),Me=m(()=>st.value==="plaintext"?"text":st.value),dt=m(()=>st.value==="plaintext"),De=S(!1),pe=S(!1),V=S(!1),ge=S(!1),_=S(!1),el=S(!1);let p=!1,sl=!1,ll=null,dl=null,qe=null,Ie=0,Ve=!1,Ne="";const Ee=S(null);let ft=0,vt=!1;const va=ao(),Fl=oo(),ct=ro(),Fe=Za(null),W=S(typeof window>"u"||!ct.value),ca=(ee=(ce=(M=Qn())==null?void 0:M.vnode.el)==null?void 0:ce.textContent)!=null?ee:"",ma=typeof window<"u"&&String((R=n.node.code)!=null?R:"").length>0&&ca.includes(String(n.node.code)),Yt=S(!ma);oa(()=>{Yt.value=!0}),typeof window<"u"&&A([()=>ne.value,ct],([e,l],t,a)=>{var o,d,r;if((o=Fe.value)==null||o.destroy(),Fe.value=null,!l||W.value)return void(W.value=!0);if(!e)return void(W.value=!1);let u=!0;const v=(r=(d=Fl==null?void 0:Fl.value.heavyBlockMargin)!=null?d:Fl==null?void 0:Fl.value.rootMargin)!=null?r:"0px",s=va(e,{rootMargin:v,allowIdle:!1});Fe.value=s,W.value=W.value||s.isVisible.value,s.whenVisible.then(()=>{u&&Fe.value===s&&(W.value=!0)}).catch(()=>{}),a(()=>{u=!1,s.destroy(),Fe.value===s&&(Fe.value=null)})},{immediate:!0}),Ja(()=>{var e;p=!0,(function(){const l=Ne;X&&l&&(Ne="",X.markSettled(l))})(),(e=Fe.value)==null||e.destroy(),Fe.value=null});let ae=null,Tl=null,mt=()=>{},zl=()=>{},ht=()=>{},pt=()=>{},fl=()=>null,ie=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),G=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),gt=()=>{},We=()=>{},yt=()=>{},tl=null,Be=null,vl=null,cl=null,Zt=()=>{var e;return String((e=n.node.language)!=null?e:"plaintext")},bt=()=>D(null,null,function*(){}),wt=!1,Ll=null;const Te=[],Kt=[];let Pe=null,ml=null;const i=m(()=>so(n.node)),hl=S({removed:0,added:0}),ha=m(()=>`-${hl.value.removed} +${hl.value.added}`);function kt(e,l){return{original:e,updated:l}}function en(e){return String(e??"").replace(/\r\n$|\n$|\r$/,"")}function pl(e){var l;return String((l=e==null?void 0:e.message)!=null?l:e).includes("no diff result available")}function _l(){if(!Se())try{const e=yt();e&&typeof e.catch=="function"&&e.catch(l=>{pl(l)})}catch(e){pl(e)}}const gl=m(()=>{const e=Ce({},n.codeBlockOptions||{});for(const a of["theme","themes","themeType","language","languages","stream","disableFileHeader","onThemeChange","renderCustomHeader","renderHeaderMetadata","renderHeaderPrefix","maxHeight","padding","tabSize"])delete e[a];if(!i.value)return e;const l=e.parseDiffOptions&&typeof e.parseDiffOptions=="object"?e.parseDiffOptions:{},t={diffStyle:"split",expandUnchanged:!1,collapsedContextThreshold:5,hunkSeparators:"line-info",parseDiffOptions:{context:2}};return Nl(Ce(Ce({},t),e),{parseDiffOptions:Ce(Ce({},t.parseDiffOptions),l)})}),ln=m(()=>{return(n.theme!==void 0?(e=n.theme)&&typeof e=="object"&&"light"in e&&"dark"in e:!Vn(n.darkTheme,n.lightTheme))?!!n.isDark:(function(l){var t;const a=(t=lt(l))!=null?t:"";return po(a,n.isDark===!0)})(ol());var e}),tn=m(()=>(i.value,ln.value?"dark":"light")),nn=m(()=>i.value?tn.value==="dark":ln.value),E=m(()=>go({darkTheme:n.darkTheme,isDark:n.isDark,lightTheme:n.lightTheme,theme:n.theme,themes:n.themes})),yl=m(()=>i.value?"diff":"single"),an=S(yl.value),me=S(!1),F=S(!1),nl=S(!1),de=S(!1),Ae=S(null),xt=S(0),on=S(0),Rl=S(!1);let bl=null,Ue=!1,St=null,Ct=!1;const jl=m(()=>{var e;return!!i.value&&((e=gl.value)==null?void 0:e.diffStyle)==="unified"}),rn=m(()=>fo(gl.value));function un(e){return(El==null?void 0:El.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 pa=m(()=>un(ne.value)),ze=m(()=>!(me.value||!de.value&&F.value)),sn=m(()=>ze.value),ga=m(()=>ze.value&&!nl.value),ya=m(()=>!me.value&&!de.value&&ze.value),ba=m(()=>F.value&&!me.value?"ready":de.value?"fallback":"pending"),ql=S(!1),$e=m(()=>en(n.node.code)),dn=m(()=>i.value?n.node.diff===!0?n.node:Nl(Ce({},n.node),{diff:!0}):$e.value===n.node.code?n.node:Nl(Ce({},n.node),{code:$e.value}));function Mt(e){const l=e.detectLanguage;typeof l=="function"&&(Zt=l),ml=e,Pe=Un();const t=e.createCodeBlockRuntime(Pe);return!!t&&(ae=t.createEditor||ae,Tl=t.createDiffEditor||Tl,mt=t.updateCode||mt,zl=t.updateDiff||zl,ht=t.finalizeCode||ht,pt=t.finalizeDiff||pt,fl=t.getEditor||fl,ie=t.getEditorView||ie,G=t.getDiffEditorView||G,gt=t.cleanupEditor||gt,We=t.safeClean||t.cleanupEditor||We,yt=t.refreshDiffPresentation||yt,bt=t.setTheme||bt,tl=t.whenVisualReady||null,el.value=!0,!0)}const Bt=uo,wa=wo,ue=S(typeof((he=n.codeBlockOptions)==null?void 0:he.fontSize)=="number"?n.codeBlockOptions.fontSize:Number.NaN),T=S(ue.value),Pt=S(null),Il=S(null),wl=S(null),Ge=S(null),ka=m(()=>{const e=ue.value,l=T.value;return typeof e=="number"&&Number.isFinite(e)&&e>0&&typeof l=="number"&&Number.isFinite(l)&&l>0}),Vl=m(()=>{var e;const l=(e=n.codeBlockOptions)==null?void 0:e.fontSize;if(typeof l=="number"&&Number.isFinite(l)&&l>0)return l;const t=T.value;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:Bt}),xa=m(()=>{var e;const l=(e=n.codeBlockOptions)==null?void 0:e.lineHeight;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:Vl.value===Bt?wa:Math.max(12,Math.round(1.5*Vl.value))}),Wl=m(()=>xa.value),fn=m(()=>{var e;const l=(e=n.codeBlockOptions)==null?void 0:e.tabSize;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:4}),Al=m(()=>{var e;const l=(e=n.codeBlockOptions)==null?void 0:e.padding,t=typeof l=="number"&&Number.isFinite(l)&&l>=0?l:8;return{top:t,bottom:t}}),$t=m(()=>{const e=vo(n.codeBlockOptions);return Nl(Ce({},e),{fontSize:Vl.value,lineHeight:Wl.value,maxHeight:Bl(),padding:Al.value.top,paddingBottom:Al.value.bottom,tabSize:fn.value})}),Ul=m(()=>{const e=n.estimatedContentHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null});function Gl(e){if(e==null)return null;const l=Math.ceil(e);return!Number.isFinite(l)||l<=0?null:Math.min(l,Math.ceil(Bl()))}function vn(){return!i.value&&n.stream!==!1&&n.loading!==!1}const kl=S(vn());function Jl(){return vn()||kl.value}const cn=m(()=>i.value?null:Ul.value==null||Jl()?Math.ceil((e=>{const l=String(e??"");if(!l)return 1;let t=1;for(let a=0;a<l.length;a++)l[a]===`
23
+ </html>`}),he=m(()=>{return k=b.htmlPreviewSandbox,H=b.htmlPreviewAllowScripts,typeof k=="string"?((function(je){if(!M||typeof console>"u"||ce===je)return;const X=(function(El){return new Set(El.trim().toLowerCase().split(/\s+/).filter(Boolean))})(je);X.has("allow-scripts")&&X.has("allow-same-origin")&&(ce=je,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."))})(k),k):k!==void 0?"":H===!0?"allow-scripts":"";var k,H});function n(k){var H;k.key!=="Escape"&&k.key!=="Esc"||(H=b.onClose)==null||H.call(b)}return oa(()=>{typeof window<"u"&&window.addEventListener("keydown",n)}),ra(()=>{typeof window<"u"&&window.removeEventListener("keydown",n)}),(k,H)=>(ul(),rt(eo,{to:"body"},[G("div",{class:it(["markstream-vue",{dark:b.isDark}])},[G("div",{class:"html-preview-frame__backdrop",onClick:H[2]||(H[2]=je=>{var X;return(X=b.onClose)==null?void 0:X.call(b)})},[G("div",{class:"html-preview-frame",onClick:H[1]||(H[1]=Ka(()=>{},["stop"]))},[G("div",No,[G("div",Eo,[H[3]||(H[3]=G("span",{class:"html-preview-frame__dot"},null,-1)),G("span",Fo,Ut(b.title||ia(ee)("common.preview")||"Preview"),1)]),G("button",{type:"button",class:"html-preview-frame__close",onClick:H[0]||(H[0]=je=>{var X;return(X=b.onClose)==null?void 0:X.call(b)})}," × ")]),G("iframe",{class:"html-preview-frame__iframe",sandbox:he.value,referrerpolicy:"no-referrer",srcdoc:R.value},null,8,To)])])],2)]))}}),[["__scopeId","data-v-24e66176"]]),Lo=["data-markstream-enhanced","data-markstream-enhancement-state","data-markstream-code-block-state","data-markstream-pending","data-markstream-viewport-pending"],_o={class:"code-header-main"},Ro=["innerHTML"],jo={class:"code-header-copy"},qo={class:"code-header-title"},Io={key:0,class:"code-header-caption"},Vo=["data-markstream-host-hidden"],Qo=ua(aa({__name:"CodeBlockNode",props:{node:{},codeBlockOptions:{},clipboardWriter:{},showLineNumbers:{type:Boolean,default:void 0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},theme:{},darkTheme:{default:void 0},lightTheme:{default:void 0},isShowPreview:{type:Boolean,default:!0},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(C,{emit:b}){var M,ce,ee,R,he;const n=C,k=b,H=m(()=>{var e,l;return(l=n.showLineNumbers)!=null?l:((e=n.codeBlockOptions)==null?void 0:e.disableLineNumbers)!==!0}),je=Ua(),X=Wt(to,null),El=Wt("markstreamHostScrollManaged",null),da=Wt(no,void 0),fa=m(()=>xo(n,je));function Wo(e,l){}const Jt=Qn(),Qt=m(()=>{const e=Jt==null?void 0:Jt.vnode.props;return!(!e||!e.onPreviewCode&&!e["onPreview-code"])}),{t:Xt}=sa(),h=S(null),ne=S(null),ut=S(!1),we=S(zn(n.node.language,n.node.code,Re())),st=m(()=>ho(we.value)),Me=m(()=>st.value==="plaintext"?"text":st.value),dt=m(()=>st.value==="plaintext"),De=S(!1),pe=S(!1),V=S(!1),ge=S(!1),_=S(!1),el=S(!1);let p=!1,sl=!1,ll=null,dl=null,qe=null,Ie=0,Ve=!1,Ne="";const Ee=S(null);let ft=0,vt=!1;const va=ao(),Fl=oo(),ct=ro(),Fe=Za(null),W=S(typeof window>"u"||!ct.value),ca=(ee=(ce=(M=Qn())==null?void 0:M.vnode.el)==null?void 0:ce.textContent)!=null?ee:"",ma=typeof window<"u"&&String((R=n.node.code)!=null?R:"").length>0&&ca.includes(String(n.node.code)),Yt=S(!ma);oa(()=>{Yt.value=!0}),typeof window<"u"&&A([()=>ne.value,ct],([e,l],t,a)=>{var o,d,r;if((o=Fe.value)==null||o.destroy(),Fe.value=null,!l||W.value)return void(W.value=!0);if(!e)return void(W.value=!1);let u=!0;const v=(r=(d=Fl==null?void 0:Fl.value.heavyBlockMargin)!=null?d:Fl==null?void 0:Fl.value.rootMargin)!=null?r:"0px",s=va(e,{rootMargin:v,allowIdle:!1});Fe.value=s,W.value=W.value||s.isVisible.value,s.whenVisible.then(()=>{u&&Fe.value===s&&(W.value=!0)}).catch(()=>{}),a(()=>{u=!1,s.destroy(),Fe.value===s&&(Fe.value=null)})},{immediate:!0}),Ja(()=>{var e;p=!0,(function(){const l=Ne;X&&l&&(Ne="",X.markSettled(l))})(),(e=Fe.value)==null||e.destroy(),Fe.value=null});let ae=null,Tl=null,mt=()=>{},zl=()=>{},ht=()=>{},pt=()=>{},fl=()=>null,ie=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),U=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),gt=()=>{},We=()=>{},yt=()=>{},tl=null,Be=null,vl=null,cl=null,Zt=()=>{var e;return String((e=n.node.language)!=null?e:"plaintext")},bt=()=>D(null,null,function*(){}),wt=!1,Ll=null;const Te=[],Kt=[];let Pe=null,ml=null;const i=m(()=>so(n.node)),hl=S({removed:0,added:0}),ha=m(()=>`-${hl.value.removed} +${hl.value.added}`);function kt(e,l){return{original:e,updated:l}}function en(e){return String(e??"").replace(/\r\n$|\n$|\r$/,"")}function pl(e){var l;return String((l=e==null?void 0:e.message)!=null?l:e).includes("no diff result available")}function _l(){if(!Se())try{const e=yt();e&&typeof e.catch=="function"&&e.catch(l=>{pl(l)})}catch(e){pl(e)}}const gl=m(()=>{const e=Ce({},n.codeBlockOptions||{});for(const a of["theme","themes","themeType","language","languages","stream","disableFileHeader","onThemeChange","renderCustomHeader","renderHeaderMetadata","renderHeaderPrefix","maxHeight","padding","tabSize"])delete e[a];if(!i.value)return e;const l=e.parseDiffOptions&&typeof e.parseDiffOptions=="object"?e.parseDiffOptions:{},t={diffStyle:"split",expandUnchanged:!1,collapsedContextThreshold:5,hunkSeparators:"line-info",parseDiffOptions:{context:2}};return Nl(Ce(Ce({},t),e),{parseDiffOptions:Ce(Ce({},t.parseDiffOptions),l)})}),ln=m(()=>{return(n.theme!==void 0?(e=n.theme)&&typeof e=="object"&&"light"in e&&"dark"in e:!Vn(n.darkTheme,n.lightTheme))?!!n.isDark:(function(l){var t;const a=(t=lt(l))!=null?t:"";return po(a,n.isDark===!0)})(ol());var e}),tn=m(()=>(i.value,ln.value?"dark":"light")),nn=m(()=>i.value?tn.value==="dark":ln.value),E=m(()=>go({darkTheme:n.darkTheme,isDark:n.isDark,lightTheme:n.lightTheme,theme:n.theme,themes:n.themes})),yl=m(()=>i.value?"diff":"single"),an=S(yl.value),me=S(!1),F=S(!1),nl=S(!1),de=S(!1),Ae=S(null),xt=S(0),on=S(0),Rl=S(!1);let bl=null,Ge=!1,St=null,Ct=!1;const jl=m(()=>{var e;return!!i.value&&((e=gl.value)==null?void 0:e.diffStyle)==="unified"}),rn=m(()=>fo(gl.value));function un(e){return(El==null?void 0:El.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 pa=m(()=>un(ne.value)),ze=m(()=>!(me.value||!de.value&&F.value)),sn=m(()=>ze.value),ga=m(()=>ze.value&&!nl.value),ya=m(()=>!me.value&&!de.value&&ze.value),ba=m(()=>F.value&&!me.value?"ready":de.value?"fallback":"pending"),ql=S(!1),$e=m(()=>en(n.node.code)),dn=m(()=>i.value?n.node.diff===!0?n.node:Nl(Ce({},n.node),{diff:!0}):$e.value===n.node.code?n.node:Nl(Ce({},n.node),{code:$e.value}));function Mt(e){const l=e.detectLanguage;typeof l=="function"&&(Zt=l),ml=e,Pe=Gn();const t=e.createCodeBlockRuntime(Pe);return!!t&&(ae=t.createEditor||ae,Tl=t.createDiffEditor||Tl,mt=t.updateCode||mt,zl=t.updateDiff||zl,ht=t.finalizeCode||ht,pt=t.finalizeDiff||pt,fl=t.getEditor||fl,ie=t.getEditorView||ie,U=t.getDiffEditorView||U,gt=t.cleanupEditor||gt,We=t.safeClean||t.cleanupEditor||We,yt=t.refreshDiffPresentation||yt,bt=t.setTheme||bt,tl=t.whenVisualReady||null,el.value=!0,!0)}const Bt=uo,wa=wo,ue=S(typeof((he=n.codeBlockOptions)==null?void 0:he.fontSize)=="number"?n.codeBlockOptions.fontSize:Number.NaN),T=S(ue.value),Pt=S(null),Il=S(null),wl=S(null),Ue=S(null),ka=m(()=>{const e=ue.value,l=T.value;return typeof e=="number"&&Number.isFinite(e)&&e>0&&typeof l=="number"&&Number.isFinite(l)&&l>0}),Vl=m(()=>{var e;const l=(e=n.codeBlockOptions)==null?void 0:e.fontSize;if(typeof l=="number"&&Number.isFinite(l)&&l>0)return l;const t=T.value;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:Bt}),xa=m(()=>{var e;const l=(e=n.codeBlockOptions)==null?void 0:e.lineHeight;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:Vl.value===Bt?wa:Math.max(12,Math.round(1.5*Vl.value))}),Wl=m(()=>xa.value),fn=m(()=>{var e;const l=(e=n.codeBlockOptions)==null?void 0:e.tabSize;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:4}),Al=m(()=>{var e;const l=(e=n.codeBlockOptions)==null?void 0:e.padding,t=typeof l=="number"&&Number.isFinite(l)&&l>=0?l:8;return{top:t,bottom:t}}),$t=m(()=>{const e=vo(n.codeBlockOptions);return Nl(Ce({},e),{fontSize:Vl.value,lineHeight:Wl.value,maxHeight:Bl(),padding:Al.value.top,paddingBottom:Al.value.bottom,tabSize:fn.value})}),Gl=m(()=>{const e=n.estimatedContentHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null});function Ul(e){if(e==null)return null;const l=Math.ceil(e);return!Number.isFinite(l)||l<=0?null:Math.min(l,Math.ceil(Bl()))}function vn(){return!i.value&&n.stream!==!1&&n.loading!==!1}const kl=S(vn());function Jl(){return vn()||kl.value}const cn=m(()=>i.value?null:Gl.value==null||Jl()?Math.ceil((e=>{const l=String(e??"");if(!l)return 1;let t=1;for(let a=0;a<l.length;a++)l[a]===`
24
24
  `?t++:l[a]==="\r"&&(t++,l[a+1]===`
25
- `&&a++);return t})($e.value)*Wl.value+1):null),mn=m(()=>{if(i.value)return null;const e=Ul.value;return e==null||Jl()?Gl(cn.value):Gl(e)}),Sa=m(()=>{const e=n.estimatedHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}),Ql=S(null);function Je(){const e=Ql.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}const Ht=m(()=>{const e=Je();return e??(!i.value&&Rl.value?null:ze.value||!F.value?mn.value:null)});function hn(e){const l=e?"hsl(152 42% 60%)":"var(--diff-added-fg)",t=e?"hsl(0 58% 58%)":"var(--diff-removed-fg)",a=e?"color-mix(in lab, #121212 80%, #4d9375)":"color-mix(in lab, #ffffff 88%, #1e754f)",o=e?"color-mix(in lab, #121212 80%, #cb7676)":"color-mix(in lab, #ffffff 88%, #ab5959)";return{"--markstream-diff-line-number-bg":"var(--markstream-diff-editor-bg)","--markstream-diff-added-fg":l,"--markstream-diff-removed-fg":t,"--markstream-diff-added-line":a,"--markstream-diff-removed-line":o,"--markstream-diff-added-line-fill":a,"--markstream-diff-added-number-fill":e?"color-mix(in lab, #121212 85%, #4d9375)":"color-mix(in lab, #ffffff 91%, #1e754f)","--markstream-diff-removed-line-fill":o,"--markstream-diff-removed-number-fill":e?"color-mix(in lab, #121212 85%, #cb7676)":"color-mix(in lab, #ffffff 91%, #ab5959)","--markstream-diff-added-gutter":`linear-gradient(90deg, ${l} 0 4px, transparent 4px 100%)`,"--markstream-diff-removed-gutter":`linear-gradient(90deg, ${t} 0 4px, transparent 4px 100%)`,"--markstream-diff-added-inline":e?"hsl(152 42% 60% / 0.28)":"var(--diff-added-inline-bg)","--markstream-diff-removed-inline":e?"hsl(0 58% 58% / 0.28)":"var(--diff-removed-inline-bg)"}}const pn=m(()=>{const e=Gl(Ul.value),l=Gl(cn.value),t=Jl(),a=Ce({},i.value||e==null||t?i.value||l==null?{}:{minHeight:`${l}px`}:{height:`${e}px`,minHeight:`${e}px`});if(a["--markstream-code-fallback-bg"]=E.value.background,a["--markstream-code-fallback-fg"]=E.value.foreground,E.value.builtin&&(a["--markstream-code-theme-bg"]=E.value.background,a["--markstream-code-theme-fg"]=E.value.foreground,a["--markstream-code-theme-line-number"]=E.value.lineNumber),a["--markstream-pre-line-number-top"]=`${Al.value.top}px`,a["--markstream-pre-line-number-left"]="0px",a["--markstream-pre-line-number-padding-left"]="2ch",a["--markstream-pre-line-number-padding-right"]="1ch",a["--markstream-pre-line-number-separator-width"]="2px",i.value){a["--markstream-pre-diff-line-height"]=`${Wl.value}px`,a["--markstream-pre-diff-pane-bottom-padding"]=(jl.value,"0px");const o=Ge.value;o!=null&&o>0&&(a.height=`${o}px`,a.minHeight=`${o}px`,a.maxHeight=`${o}px`),Object.assign(a,hn(nn.value))}return a}),gn=m(()=>Ht.value!=null&&(!F.value||Je()!=null)),Ca=m(()=>{const e=Ht.value;if(e==null)return null;if(i.value)return Math.ceil(e);const l=Sa.value,t=Ul.value;if(l==null||t==null)return Math.ceil(e);const a=Math.max(0,Math.ceil(l)-Math.ceil(t));return Math.ceil(e+a)}),Ma=m(()=>{if(i.value&&ze.value)return{};const e=Ht.value;return gn.value&&e!=null?{minHeight:`${e}px`}:{}});function yn(){Ql.value=null}function bn(){var e,l,t,a,o,d,r,u;const v=(e=ne.value)==null?void 0:e.querySelector("pre.code-pre-fallback"),s=G(),c=(l=v==null?void 0:v.scrollTop)!=null?l:0;(o=(a=(t=s==null?void 0:s.getOriginalEditor)==null?void 0:t.call(s))==null?void 0:a.setScrollTop)==null||o.call(a,c),(u=(r=(d=s==null?void 0:s.getModifiedEditor)==null?void 0:d.call(s))==null?void 0:r.setScrollTop)==null||u.call(r,c)}function wn(){return D(this,null,function*(){return i.value?(Et(),xl(),Y(!0),bn(),ye(),nl.value=!0,yield O(),Y(!0),yield ke(),Y(!0),Ml(),xl(),!!(yield(function(){return D(this,null,function*(){var e;if(!i.value)return!0;for(let l=0;l<4;l++){const t=xl();Y(!0),Ot(t),Ba(t),yield O(),yield ke();const a=(e=ne.value)==null?void 0:e.querySelector("pre.code-pre-fallback");if(!a)return!1;if(t==null)return Xl();const o=a.getBoundingClientRect().height;if(o>0&&Math.abs(o-t)<=2)return!0}return!1})})())&&(F.value=!0,yield O(),xl(),Y(!0),Ml(),ye(),se(()=>{p||se(()=>{p||((function(){var e,l;const t=(e=ne.value)==null?void 0:e.querySelector(".code-block-shell-content"),a=(l=ne.value)==null?void 0:l.querySelector(".code-editor-layer");t&&a&&(a.style.removeProperty("height"),a.style.removeProperty("min-height"),t.style.removeProperty("height"),t.style.removeProperty("min-height"))})(),fe(!0))})}),fe(),!0)):!(tl&&!(yield tl())||(nl.value=!0,yield O(),Y(!0),F.value=!0,yield O(),fe(),0))})}function Ot(e){var l;if(!i.value)return;const t=h.value,a=(l=ne.value)==null?void 0:l.querySelector("pre.code-pre-fallback");if(!t||!a)return;const o=e??Number.parseFloat(t.style.height||"");if(!Number.isFinite(o)||o<=0)return;const d=Math.ceil(o),r=`${d}px`;Ge.value=d;const u=ne.value;u&&(u.dataset.markstreamDiffHandoffHeight=r),a.dataset.markstreamDiffHandoffHeight=r,a.style.setProperty("height",r),a.style.setProperty("min-height",r)}function Ba(e){var l,t,a;if(!i.value)return;const o=(l=ne.value)==null?void 0:l.querySelector(".code-block-shell-content"),d=(t=ne.value)==null?void 0:t.querySelector(".code-editor-layer");if(!o||!d)return;const r=typeof e=="number"&&Number.isFinite(e)&&e>0?Math.ceil(e):Number.parseFloat(((a=h.value)==null?void 0:a.style.height)||"");if(!Number.isFinite(r)||r<=0)return;const u=`${r}px`;d.style.height=u,d.style.minHeight=u,o.style.height=u,o.style.minHeight=u}function xl(){const e=h.value;if(e&&Xl(e)){ye();const l=Cl(e);if(l!=null&&l>0){const t=Math.ceil(l),a=Math.ceil(Bl()),o=Math.min(t,a),d=`${o}px`;return e.style.height=d,e.style.minHeight="0px",e.style.maxHeight=`${a}px`,e.style.overflow=t>a+1?"auto":"hidden",ze.value&&(Ge.value=o,Ot(o)),Le(),o}return le({preferModelDiffHeight:!0}),Ot(),Le(),Number.parseFloat(e.style.height||"")||null}return Et()}function kn(e,l=!1,t={}){const a=Math.ceil(e),o=Je();if(o==null)return a;const d=t.allowBelowEstimatedFloor===!0;return a>=o||d?((l||d)&&_.value&&yn(),a):o}function ke(){return new Promise(e=>{let l=!1,t=null,a=null;const o=()=>{l||(l=!0,a!=null&&globalThis.clearTimeout(a),t!=null&&at(t),e())};a=globalThis.setTimeout(o,50),t=se(o)})}function xn(){var e;try{const l=h.value;if(!l)return null;const t=(e=l.querySelector(".stream-diffs-shell .stream-diffs-surface"))!=null?e:l.querySelector(".stream-diffs-shell");if(t){const a=Math.ceil(t.getBoundingClientRect().height);if(a>0)return a}}catch{}return null}function Dt(){var e,l,t,a,o,d;try{const r=i.value?(t=(l=(e=G())==null?void 0:e.getModifiedEditor)==null?void 0:l.call(e))!=null?t:G():ie(),u=fl(),v=(a=u==null?void 0:u.EditorOption)==null?void 0:a.fontInfo;if(r&&v!=null){const s=(o=r.getOption)==null?void 0:o.call(r,v),c=s==null?void 0:s.fontSize;if(typeof c=="number"&&Number.isFinite(c)&&c>0)return c}}catch{}try{const r=h.value;if(r){const u=(d=r.querySelector(".stream-diffs-shell .stream-diffs-surface"))!=null?d:r.querySelector(".stream-diffs-shell");if(u)try{if(typeof window<"u"&&typeof window.getComputedStyle=="function"){const v=window.getComputedStyle(u).fontSize,s=v&&v.match(/^(\d+(?:\.\d+)?)/);if(s)return Number.parseFloat(s[1])}}catch{}}}catch{}return null}function al(e){var l,t;try{const d=fl(),r=(l=d==null?void 0:d.EditorOption)==null?void 0:l.lineHeight;if(r!=null){const u=(t=e==null?void 0:e.getOption)==null?void 0:t.call(e,r);if(typeof u=="number"&&u>0)return u}}catch{}const a=xn();if(a&&a>0)return a;const o=Number.isFinite(T.value)&&T.value>0?T.value:14;return Math.max(12,Math.round(1.35*o))}function Sn(){var e;const l=(e=n.codeBlockOptions)==null?void 0:e.padding;return typeof l=="number"&&Number.isFinite(l)?2*Math.max(0,l):i.value?24:0}function Cn(e){return!!dt.value||!!e&&(Se(e)||tl!=null)}function Sl(){var e,l;i.value?hl.value=ko(String((e=n.node.originalCode)!=null?e:""),String((l=n.node.updatedCode)!=null?l:"")):hl.value={removed:0,added:0}}function Nt(){var e;if(Number.isFinite(T.value)&&T.value>0&&Number.isFinite(ue.value))return T.value;if(typeof((e=n.codeBlockOptions)==null?void 0:e.fontSize)=="number")return ue.value=n.codeBlockOptions.fontSize,T.value=n.codeBlockOptions.fontSize,n.codeBlockOptions.fontSize;const l=Dt();return l&&l>0?(ue.value=l,T.value=l,l):(ue.value=12,T.value=12,12)}function Pa(){const e=Nt(),l=Math.min(36,e+1);T.value=l}function $a(){const e=Nt(),l=Math.max(10,e-1);T.value=l}function Ha(){Nt(),Number.isFinite(ue.value)&&(T.value=ue.value)}function Mn(){var e,l,t,a,o,d,r,u,v,s,c,g,y,j;try{const z=i.value?G():null,f=i.value?z:ie();if(!f)return null;if(z!=null&&z.getOriginalEditor&&(z!=null&&z.getModifiedEditor)){const B=(e=z.getOriginalEditor)==null?void 0:e.call(z),x=(l=z.getModifiedEditor)==null?void 0:l.call(z);(t=B==null?void 0:B.layout)==null||t.call(B),(a=x==null?void 0:x.layout)==null||a.call(x);const P=((o=B==null?void 0:B.getContentHeight)==null?void 0:o.call(B))||0,Z=((d=x==null?void 0:x.getContentHeight)==null?void 0:d.call(x))||0,be=Math.max(P,Z);if(be>0)return Math.ceil(be);const te=((v=(u=(r=B==null?void 0:B.getModel)==null?void 0:r.call(B))==null?void 0:u.getLineCount)==null?void 0:v.call(u))||1,L=((g=(c=(s=x==null?void 0:x.getModel)==null?void 0:s.call(x))==null?void 0:c.getLineCount)==null?void 0:g.call(c))||1,$=Math.max(te,L),I=Math.max(al(B),al(x)),J=Sn();return Math.ceil($*I+J+0)}if(f!=null&&f.getContentHeight){(y=f==null?void 0:f.layout)==null||y.call(f);const B=f.getContentHeight();if(B>0)return i.value||(Rl.value=!0),Math.ceil(B)}const w=(j=f==null?void 0:f.getModel)==null?void 0:j.call(f);let N=1;w&&typeof w.getLineCount=="function"&&(N=w.getLineCount());const q=al(f);return Math.ceil(N*(q+1.5)+0)}catch{return null}}function Bn(){var e,l;if(i.value)return!1;try{const t=(l=(e=ie())==null?void 0:e.getContentHeight)==null?void 0:l.call(e),a=typeof t=="number"&&Number.isFinite(t)&&t>0;return a&&(Rl.value=!0),a}catch{return!1}}function Cl(e){if(typeof window>"u")return null;try{if(window.getComputedStyle(e).display==="none")return null;const l=e.querySelector("diffs-container");if(l instanceof HTMLElement){const a=l.getBoundingClientRect();if(a.height>0)return Math.ceil(a.height)}const t=e.querySelector(".stream-diffs-shell");if(t){const a=t.getBoundingClientRect();if(a.height>0)return Math.ceil(a.height)}return null}catch{return null}}function Pn(e){var l;const t=String(e??"").trim(),a=(l=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i))==null?void 0:l[1];if(a){const v=a.length===3?a.split("").map(s=>`${s}${s}`).join(""):a;return .2126*Number.parseInt(v.slice(0,2),16)+.7152*Number.parseInt(v.slice(2,4),16)+.0722*Number.parseInt(v.slice(4,6),16)}const o=t.match(/\d+(?:\.\d+)?/g);if(!o||o.length<3)return null;const[d,r,u]=o.slice(0,3).map(Number);return .2126*d+.7152*r+.0722*u}function Ml(){var e,l,t;if($n())return;const a=Dt();a&&a>0&&(Pt.value=a,T.value=a,ue.value=a);try{const o=al(i.value?(t=(l=(e=G())==null?void 0:e.getModifiedEditor)==null?void 0:l.call(e))!=null?t:G():ie());o&&o>0&&(Il.value=o)}catch{}try{const o=xn();o&&o>0&&(Il.value=o)}catch{}}function $n(){return i.value&&sn.value}function Et(){var e;if(!ze.value)return null;const l=h.value,t=(e=ne.value)==null?void 0:e.querySelector("pre.code-pre-fallback");if(!l||!t)return null;const a=Math.ceil(t.getBoundingClientRect().height),o=i.value?Cl(l):null,d=Math.max(a,o!=null&&o>0?Math.ceil(o):0),r=Math.ceil(Bl()),u=Math.min(d,r);return!Number.isFinite(u)||u<=0?null:(i.value&&u>a&&(Ge.value=u),l.style.height=`${u}px`,l.style.minHeight=`${u}px`,l.style.maxHeight=`${r}px`,l.style.overflow=d>r+1?"auto":"hidden",u)}function Ft(){var e,l,t,a,o,d,r,u,v;const s=h.value,c=ne.value;if(!s||!c)return;const g=s;g.style.setProperty("--markstream-diff-metadata-bg",E.value.background),g.style.setProperty("--markstream-diff-metadata-fg",E.value.lineNumber),g.style.setProperty("--diffs-tab-size",String(fn.value)),g.style.setProperty("--diffs-scrollbar-gutter-override","0px"),typeof((e=n.codeBlockOptions)==null?void 0:e.padding)=="number"?g.style.setProperty("--diffs-gap-block",`${Al.value.top}px`):g.style.removeProperty("--diffs-gap-block");const y=s.querySelector(".stream-diffs-shell")||s,j=y,z=y;let f=null,w=null,N=null;try{typeof window<"u"&&typeof window.getComputedStyle=="function"&&(f=window.getComputedStyle(y),w=j===y?f:window.getComputedStyle(j),N=z===y?f:window.getComputedStyle(z))}catch{f=null,w=null,N=null}const q=String((l=f==null?void 0:f.getPropertyValue("--vscode-editor-foreground"))!=null?l:"").trim(),B=String((t=f==null?void 0:f.getPropertyValue("--vscode-editor-background"))!=null?t:"").trim(),x=String((o=(a=f==null?void 0:f.getPropertyValue("--vscode-editor-selectionBackground"))!=null?a:f==null?void 0:f.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?o:"").trim(),P=q||String((r=(d=N==null?void 0:N.color)!=null?d:f==null?void 0:f.color)!=null?r:"").trim(),Z=B||String((v=(u=w==null?void 0:w.backgroundColor)!=null?u:f==null?void 0:f.backgroundColor)!=null?v:"").trim(),be=(function(){var te,L,$,I,J;try{const ve=i.value?($=(L=(te=G())==null?void 0:te.getModifiedEditor)==null?void 0:L.call(te))!=null?$:G():ie(),oe=fl(),re=(I=oe==null?void 0:oe.EditorOption)==null?void 0:I.fontInfo;if(ve&&re!=null){const K=(J=ve.getOption)==null?void 0:J.call(ve,re),Q=K==null?void 0:K.typicalHalfwidthCharacterWidth;if(typeof Q=="number"&&Number.isFinite(Q)&&Q>0)return Q}}catch{}return null})();if(be!=null&&(wl.value=be),i.value){const te=(L,$)=>{$?(c.style.setProperty(L,$),g.style.setProperty(L,$)):(c.style.removeProperty(L),g.style.removeProperty(L))};for(const[L,$]of Object.entries(hn(c.classList.contains("is-dark"))))te(L,$);return P?(c.style.setProperty("--markstream-diff-editor-fg",P),g.style.setProperty("--vscode-editor-foreground",P)):(c.style.removeProperty("--markstream-diff-editor-fg"),g.style.removeProperty("--vscode-editor-foreground")),Z?(c.style.setProperty("--markstream-diff-editor-bg",Z),c.style.setProperty("--markstream-diff-panel-bg",Z),c.style.setProperty("--markstream-diff-panel-bg-soft",Z),c.style.setProperty("--markstream-diff-panel-bg-strong",Z),g.style.setProperty("--vscode-editor-background",Z),g.style.backgroundColor=Z):(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"),g.style.removeProperty("--vscode-editor-background"),g.style.backgroundColor=""),void(x?g.style.setProperty("--vscode-editor-selectionBackground",x):g.style.removeProperty("--vscode-editor-selectionBackground"))}if((function(te,L,$){if(!dt.value)return!1;const I=Pn(te),J=Pn(L);return $?I!=null&&I>170||J!=null&&J<110:I!=null&&I<85||J!=null&&J>190})(Z,P,c.classList.contains("is-dark")))return g.style.removeProperty("--vscode-editor-foreground"),g.style.removeProperty("--vscode-editor-background"),void g.style.removeProperty("--vscode-editor-selectionBackground");P&&g.style.setProperty("--vscode-editor-foreground",P),Z&&g.style.setProperty("--vscode-editor-background",Z),x&&g.style.setProperty("--vscode-editor-selectionBackground",x)}A(()=>[n.stream,n.loading,n.node.loading,i.value],([e,l,t,a])=>{a||e===!1||l===!1||kl.value?(a||e===!1)&&kl.value&&(kl.value=!1):(kl.value=!0,yn())},{immediate:!0});let Tt=0,zt=0;const Hn=/auto|scroll|overlay/i;function xe(e,l,t){var a;if(typeof window>"u"||i.value||(function(c){return pa.value||un(c)})(e))return;const o=Math.ceil(l),d=Math.ceil(t)-o;if(Math.abs(d)<=1)return;const r=(function(c){var g,y;if(typeof window>"u")return null;const j=(g=c==null?void 0:c.ownerDocument)!=null?g:document,z=j.scrollingElement||j.documentElement||j.body;let f=(y=c==null?void 0:c.parentElement)!=null?y:null;for(;f&&f!==j.body&&f!==z;){const w=window.getComputedStyle(f),N=(w.overflowY||"").toLowerCase(),q=(w.overflow||"").toLowerCase();if(Hn.test(N)||Hn.test(q))return f;f=f.parentElement}return z})(e);if(!r)return;const u=(a=e.ownerDocument)!=null?a:document,v=r===u.body||r===u.documentElement||r===u.scrollingElement,s=v?0:r.getBoundingClientRect().top;e.getBoundingClientRect().top-s>=0||(v&&typeof window.scrollBy=="function"?window.scrollBy(0,d):r.scrollTop+=d)}function Lt(){try{const e=h.value;if(!e)return;const l=e.getBoundingClientRect().height,t=Mn();if(t!=null&&t>0){const o=kn(t,!0,{allowBelowEstimatedFloor:!i.value&&_.value&&Bn()}),d=Je();return e.style.minHeight=d!=null?`${d}px`:"0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",void xe(e,l,o)}const a=Je();a!=null&&(e.style.minHeight=`${a}px`,e.style.height=`${a}px`,e.style.maxHeight="none",e.style.overflow="visible",xe(e,l,a))}catch{}}function Qe(){for(var e,l;Te.length>0;)try{(l=(e=Te.pop())==null?void 0:e.dispose)==null||l.call(e)}catch{}ll!=null&&(at(ll),ll=null),dl!=null&&(at(dl),dl=null),qe!=null&&(at(qe),qe=null),Ie=0,Ve=!1}function Xe(){for(var e;Kt.length>0;)try{(e=Kt.pop())==null||e()}catch{}}function le(e=!1){pe.value||(De.value?Lt():(function(l={}){try{const t=h.value;if(!t)return;const a=t.getBoundingClientRect().height,o=Math.ceil(a||0),d=Bl(),r=o,u=Number.parseFloat(t.style.height||""),v=r>0?r:Number.isFinite(u)&&u>0?Math.ceil(u):0,s=i.value?(function(){var x,P,Z,be,te,L,$,I,J,ve,oe,re;if(Se())return null;try{const K=G(),Q=(x=K==null?void 0:K.getOriginalEditor)==null?void 0:x.call(K),rl=(P=K==null?void 0:K.getModifiedEditor)==null?void 0:P.call(K);if(!Q||!rl)return null;const qa=((te=(be=(Z=Q.getModel)==null?void 0:Z.call(Q))==null?void 0:be.getLineCount)==null?void 0:te.call(be))||1,Ia=((I=($=(L=rl.getModel)==null?void 0:L.call(rl))==null?void 0:$.getLineCount)==null?void 0:I.call($))||1,Va=Math.max(qa,Ia),Wa=Math.max(al(Q),al(rl)),Aa=Sn(),Ua=Math.max((ve=(J=Q.getContentHeight)==null?void 0:J.call(Q))!=null?ve:0,(re=(oe=rl.getContentHeight)==null?void 0:oe.call(rl))!=null?re:0);return Math.ceil(Math.max(Ua,Va*Wa+Aa+0))}catch{return null}})():null,c=i.value&&Xl(t);if(ft>0&&(ft--,Ee.value!=null))return void xe(t,a,_e(t,Ee.value,d,{preserveScrollableOverflow:Rt(t)}));if(i.value&&!c&&ze.value){const x=Et();if(x!=null){const P=_e(t,x,d,{allowBelowEstimatedFloor:!0});return Y(!0),void xe(t,a,P)}}const g=i.value&&l.preferModelDiffHeight===!0,y=i.value?Cl(t):null,j=!i.value&&_.value&&Bn(),z=i.value&&n.loading!==!1&&(y!=null||s!=null&&r>0&&s<r-1),f=s!=null;let w;if(i.value)if(g){const x=s!=null&&n.loading===!1&&v>0&&s<v-1;w=n.loading===!1&&y!=null?s==null?y:Math.max(y,s):x?s:y!=null&&s!=null?Math.max(y,s,n.loading!==!1?v:0):Math.max(y??0,s??0,n.loading!==!1?v:0)||null}else w=jl.value&&y!=null||y!=null?f?Math.max(y,s):y:i.value&&n.loading!==!1?s!=null&&v>0&&s<v-1?s:v>0?v:null:s;else w=Mn();if(i.value&&w!=null&&v>0&&(n.loading!==!1||l.holdCurrentDiffHeight===!0)&&(w=Math.max(w,v)),w!=null&&w>0)return void xe(t,a,_e(t,w,d,{clearEstimatedFloor:!0,allowBelowEstimatedFloor:j||z,preserveScrollableOverflow:Rt(t),renderedStreamingDiffHeight:y}));if(Ee.value!=null)return void xe(t,a,_e(t,Ee.value,d,{preserveScrollableOverflow:Rt(t)}));const N=i.value&&n.loading!==!1?r:Math.max(r,s!=null&&s>0?s:0);if(N>0)return void xe(t,a,_e(t,N,d));const q=Je();if(!(q==null||i.value&&n.loading!==!1&&c))return void xe(t,a,_e(t,q,d));const B=Number.parseFloat(t.style.height);!Number.isNaN(B)&&B>0?xe(t,a,_e(t,B,d)):i.value||xe(t,a,_e(t,d,d))}catch{}})(typeof e=="object"?e:{}))}function On(){Tt=0,zt=0}function Y(e=!1){var l,t,a;if(pe.value)return;const o=h.value;if(!o)return;const d=i.value?G():ie();if(d&&typeof d.layout=="function")try{const r=(l=o.getBoundingClientRect)==null?void 0:l.call(o),u=Math.ceil(((t=r==null?void 0:r.width)!=null?t:0)||o.clientWidth||0),v=Math.ceil(((a=r==null?void 0:r.height)!=null?a:0)||o.clientHeight||Number.parseFloat(o.style.height||"")||0);if(u>0&&v>0){if(!e&&u===Tt&&v===zt)return;Tt=u,zt=v,d.layout({width:u,height:v})}else On(),d.layout()}catch{}}function ye(){Xe()}function fe(e=!1){if(p||ll!=null)return;const l=()=>{p||(ye(),le(e),Y())};ll=se(()=>{ll=null,l(),dl=se(()=>{dl=null,l()})}),Le()}function Le(e=!1){if(!i.value||p||!e&&n.loading===!1||(Ve=Ve||e,Ie=Math.max(Ie,e?18:6),qe!=null))return;const l=()=>{if(qe=null,!i.value||p||Ie<=0||!Ve&&n.loading===!1)return Ie=0,void(Ve=!1);Ie--,ye(),le({preferModelDiffHeight:!0,holdCurrentDiffHeight:Ve}),Y(),Ie>0?qe=se(l):Ve=!1};qe=se(l)}function _e(e,l,t,a={}){var o;const d=i.value&&n.loading!==!1,r="renderedStreamingDiffHeight"in a?d&&(o=a.renderedStreamingDiffHeight)!=null?o:null:d?Cl(e):null,u=r!=null&&r>l+1?r:l,v=Math.min(u,t),s=a.allowBelowEstimatedFloor===!0,c=kn(v,a.clearEstimatedFloor===!0,{allowBelowEstimatedFloor:s}),g=Je();e.style.minHeight=g==null||s?"0px":`${Math.min(g,Math.ceil(t))}px`,e.style.height=`${c}px`,e.style.maxHeight=`${Math.ceil(t)}px`;const y=a.preserveScrollableOverflow===!0||u>t+1||_t(e,c);return e.style.overflow=y?"auto":"hidden",c}function _t(e,l=0){var t;const a=Math.ceil(((t=e.getBoundingClientRect)==null?void 0:t.call(e).height)||0),o=Math.max(l,e.clientHeight||0,a);return o>0&&e.scrollHeight>o+1}function Rt(e){var l;return vt||_t(e,(l=Ee.value)!=null?l:0)}function Xl(e=h.value){return Se(e)}function Dn(e=h.value){return Se(e)}function Nn(){var e,l;if(Se())return!0;const t=(l=(e=ie())==null?void 0:e.getModel)==null?void 0:l.call(e);return typeof(t==null?void 0:t.getValue)=="function"&&t.getValue()===$e.value}function Se(e=h.value){return!!(e!=null&&e.querySelector("diffs-container"))}function En(){return n.loading!==!1||F.value}function Oa(){const e=G();return typeof(e==null?void 0:e.getOriginalEditor)=="function"||typeof(e==null?void 0:e.getModifiedEditor)=="function"||typeof(e==null?void 0:e.getLineChanges)=="function"}function Fn(){return D(this,null,function*(){if(!i.value)return!0;for(let e=0;e<30;e++){if(p)return!1;if(Se())return yield O(),yield ke(),!p&&Se();yield O(),yield ke()}return!1})}let jt="";function Tn(e,l,t){return D(this,null,function*(){const a=`${e}\0${l}\0${t}`;if(jt!==a){try{return yield zl(e,l,t),void(jt=a)}catch(o){if(!pl(o))throw o}if(yield O(),yield ke(),!p&&i.value)try{yield zl(e,l,t),jt=a}catch(o){if(!pl(o))throw o}}})}function Bl(){var e,l;return(l=(e=n.codeBlockOptions)==null?void 0:e.maxHeight)!=null?l:500}const qt=m(()=>n.isShowPreview&&(we.value==="html"||we.value==="svg"));function Re(){return typeof n.node.loading=="boolean"?n.node.loading:n.loading===!0}function zn(e,l,t){return!t||(function(){var a,o,d;if(!Re())return!0;const r=String((a=n.node.raw)!=null?a:""),u=(d=(o=r.split(/\r\n|\n|\r/,1)[0])==null?void 0:o.trimStart())!=null?d:"";return!/^(?:`{3,}|~{3,})/.test(u)||/\r\n|\n|\r/.test(r)})()&&String(l??"")?Zn(String(e??"")):"plain"}function Yl(){return Re()}let Ye=null,Zl=!1,Kl=0;function Ln(){Ye=null,Kl++}function _n(){return D(this,arguments,function*(e=Kl){if(!Zl){Zl=!0;try{for(;Ye&&!p&&!i.value&&e===Kl;){const l=Ye;Ye=null;try{yield Promise.resolve(mt(l.code,l.language)),yield O(),p||i.value||(le(!1),Y())}catch{}}}finally{Zl=!1,!Ye||p||i.value||_n()}}})}function Rn(e,l){Ye={code:e,language:l},_n(Kl)}A(()=>[n.node.language,n.node.code,n.node.raw,n.node.loading,n.loading],([e,l,t,a,o])=>{we.value=zn(e,l,typeof a=="boolean"?a:o===!0)}),A(()=>[n.node.originalCode,n.node.updatedCode,i.value],()=>{se(()=>Sl())},{immediate:!0});let et=0;A(()=>[n.node.originalCode,n.node.updatedCode,Me.value,i.value,n.stream],e=>D(null,[e],function*([,,,l,t]){var a,o;const d=++et;if(!l||Re()||t===!1&&!V.value)return;if(t!==!1&&ae&&!V.value&&h.value)try{yield He(h.value)}catch{}const r=vl;if(r&&!ge.value){try{yield r}catch{}if(p||!i.value||d!==et)return}if(d!==et)return;const u=kt(String((a=n.node.originalCode)!=null?a:""),String((o=n.node.updatedCode)!=null?o:"")),v=n.loading===!1;v&&Ze();try{if(yield Tn(u.original,u.updated,Me.value),p||!i.value||d!==et)return;yield O(),Y(!0),ye(),le(n.loading===!1||{preferModelDiffHeight:!0}),Y(!0),fe(!0)}catch{return}if(v){if(p||!i.value)return;_l(),ye(),Sl(),fe(),Le(!0)}De.value&&se(()=>Lt())})),A(()=>n.node.code,e=>D(null,null,function*(){if(Re()||n.stream===!1||(we.value||(we.value=Zn(Zt(e))),i.value))return;const l=vl;if(l&&!ge.value){try{yield l}catch{}if(p||i.value)return}if(ae&&!V.value&&h.value)try{yield He(h.value)}catch{}Rn(en(n.node.code),Me.value),De.value&&se(()=>Lt())}));const Da=m(()=>{const e=we.value;return e?Kn[e]||e.charAt(0).toUpperCase()+e.slice(1):Kn[""]}),jn=m(()=>{var e;return yo(String((e=n.node.raw)!=null?e:""),Da.value,i.value)}),Na=m(()=>jn.value.title),qn=m(()=>jn.value.caption),Ea=m(()=>(co.value,Co(we.value||"",da))),Fa=m(()=>{const e={};e["--markstream-code-layout-character-width"]=wl.value==null?"1ch":`${wl.value}px`,e["--markstream-code-fallback-bg"]=E.value.background,e["--markstream-code-fallback-fg"]=E.value.foreground,E.value.builtin&&(e["--markstream-code-theme-bg"]=E.value.background,e["--markstream-code-theme-fg"]=E.value.foreground,e["--markstream-code-theme-line-number"]=E.value.lineNumber),e["--markstream-diff-added-line-fill"]=E.value.diffAddedLine,e["--markstream-diff-added-number-fill"]=E.value.diffAddedNumber,e["--markstream-diff-editor-bg"]=E.value.background,e["--markstream-diff-removed-line-fill"]=E.value.diffRemovedLine,e["--markstream-diff-removed-number-fill"]=E.value.diffRemovedNumber,e["--markstream-diff-shell-bg"]=E.value.background,e["--markstream-pre-resolved-theme-bg"]=E.value.background,e["--markstream-pre-resolved-theme-fg"]=E.value.foreground,e["--markstream-pre-resolved-theme-line-number"]=E.value.lineNumber;const l=o=>{if(o!=null)return typeof o=="number"?`${o}px`:String(o)},t=l(n.minWidth),a=l(n.maxWidth);if(t&&(e.minWidth=t),a&&(e.maxWidth=a),gn.value&&!i.value&&!pe.value){const o=Ca.value;o!=null&&(e.minHeight=`${o}px`)}return e.color="var(--markstream-code-fallback-fg, var(--markstream-code-theme-fg, var(--markstream-pre-resolved-theme-fg)))",e.backgroundColor="var(--markstream-code-fallback-bg, var(--markstream-code-theme-bg, var(--markstream-pre-resolved-theme-bg)))",i.value||(e.borderColor="var(--markstream-code-border-color, var(--code-border))"),e}),Ta=m(()=>n.showTooltips!==!1);function za(){return D(this,null,function*(){const e=n.node.code;try{n.clipboardWriter?yield n.clipboardWriter(e):typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(e)),ut.value=!0,k("copy",e),setTimeout(()=>{ut.value=!1},1e3)}catch(l){console.error("复制失败:",l)}})}function La(){De.value=!De.value;const e=i.value?G():ie(),l=h.value;e&&l&&(De.value?(l.style.maxHeight="none",l.style.overflow="visible",le(!0)):(l.style.overflow="auto",le(!0)))}function _a(){var e,l;if(pe.value=!pe.value,pe.value){if(vt=!1,h.value){const t=Math.ceil(((l=(e=h.value).getBoundingClientRect)==null?void 0:l.call(e).height)||0);vt=_t(h.value,t)||h.value.style.overflow==="auto"||h.value.style.overflowY==="auto",t>0&&(Ee.value=t)}}else h.value&&Ee.value!=null&&(h.value.style.height=`${Ee.value}px`),ft=2,O(()=>{pe.value||p||(le(!0),Y(!0))})}function Ra(){if(!qt.value)return;const e=we.value;if(Qt.value){const l=e==="html"?"text/html":"image/svg+xml",t=e==="html"?Xt("artifacts.htmlPreviewTitle")||"HTML Preview":Xt("artifacts.svgPreviewTitle")||"SVG Preview";return void k("previewCode",{node:n.node,artifactType:l,artifactTitle:t,id:`temp-${e}-${Date.now()}`})}e==="html"&&(ql.value=!ql.value)}function He(e,l={}){if(!ae||p||n.stream===!1&&n.loading!==!1||(Vt(),Jn())||me.value||h.value!==e||Yl())return null;if(Be)return Be;if(V.value&&_.value)return Promise.resolve();const t=It(),a=xt.value;let o=!1;V.value=!0,(function(){const r=fa.value;X&&r&&Ne!==r&&(Ne&&X.markSettled(Ne),Ne=r,X.markPending(r))})();const d=D(null,null,function*(){try{yield(function(r){return D(this,null,function*(){var u,v;if(!ae||p)return;sl=!1;const s=yl.value;if(Ct=!1,de.value=!1,Ae.value=null,ge.value=!1,F.value=!1,nl.value=!1,Pt.value=null,Il.value=null,wl.value=null,Ge.value=null,On(),(function(){if(Rl.value=!1,Jl())return void(Ql.value=null);const f=mn.value;Ql.value=_.value||f==null?null:f})(),Qe(),Xe(),(function(f){f.replaceChildren()})(r),Ze(),yield ea(An()),p)return;const c=D(null,null,function*(){var f,w;if(s==="diff"){(function(){if(wt||typeof window>"u")return;wt=!0;const q=B=>{var x;pl("reason"in B?B.reason:(x=B.error)!=null?x:B.message)&&(B.preventDefault(),B.stopImmediatePropagation())};window.addEventListener("error",q,!0),window.addEventListener("unhandledrejection",q,!0),Ll=()=>{window.removeEventListener("error",q,!0),window.removeEventListener("unhandledrejection",q,!0),wt=!1,Ll=null}})(),We();const N=kt(String((f=n.node.originalCode)!=null?f:""),String((w=n.node.updatedCode)!=null?w:""));Tl?yield Tl(r,N.original,N.updated,Me.value):yield ae(r,n.node.code,Me.value)}else yield ae(r,$e.value,Me.value);ge.value=!0}),g=c.finally(()=>{vl===g&&(vl=null)});if(vl=g,yield(function(f){return D(this,null,function*(){if(!i.value)return void(yield f);let w,N=!1;for(f.then(()=>{N=!0},q=>{N=!0,w=q});;){if(p)return;if(N){if(w)throw w;return}if(Xl()&&Oa())return;yield O(),yield ke()}})})(g),p||yl.value!==s)return;ge.value=!0;const y=(u=n.codeBlockOptions)==null?void 0:u.fontSize;if(typeof y=="number"&&Number.isFinite(y)&&y>0){const f=s==="diff"?G():ie();(v=f==null?void 0:f.updateOptions)==null||v.call(f,{fontSize:y}),ue.value=y,T.value=y}else if(!$n()){const f=Dt();f&&f>0?(ue.value=f,T.value=f):(ue.value=12,T.value=12)}for(Ml();sl;)if(sl=!1,yield Wn(),p)return;De.value||pe.value||le(!1),_.value=!0,an.value=s,(function(){var f,w,N,q,B;if(Qe(),i.value){const P=G(),Z=(f=P==null?void 0:P.getOriginalEditor)==null?void 0:f.call(P),be=(w=P==null?void 0:P.getModifiedEditor)==null?void 0:w.call(P),te=($,I)=>{try{const J=$==null?void 0:$[I];if(typeof J!="function")return;const ve=J.call($,()=>fe());ve&&Te.push(ve)}catch{}};try{const $=(N=P==null?void 0:P.onDidUpdateDiff)==null?void 0:N.call(P,()=>{fe(),se(()=>Sl())});$&&Te.push($)}catch{}te(Z,"onDidContentSizeChange"),te(be,"onDidContentSizeChange");const L=h.value;if(L&&typeof MutationObserver<"u"){const $=["diffs-container",".stream-diffs-shell",".stream-diffs-surface"].join(","),I=oe=>{var re;const K=oe instanceof HTMLElement?oe:oe.parentElement;return!!((re=K==null?void 0:K.closest)!=null&&re.call(K,$))},J=oe=>{var re,K;const Q=oe instanceof HTMLElement?oe:oe.parentElement;return!!((re=Q==null?void 0:Q.closest)!=null&&re.call(Q,$)||(K=Q==null?void 0:Q.querySelector)!=null&&K.call(Q,$))},ve=new MutationObserver(oe=>{i.value&&En()&&oe.some(re=>I(re.target)||Array.from(re.addedNodes).some(J)||Array.from(re.removedNodes).some(I))&&(ye(),le({preferModelDiffHeight:!0}),Y(),Le())});ve.observe(L,{attributeFilter:["class"],attributes:!0,childList:!0,characterData:!0,subtree:!0}),Te.push({dispose:()=>ve.disconnect()})}if(L&&typeof ResizeObserver<"u"){const $=new ResizeObserver(()=>{if(!i.value||(Y(),!En()))return;const I=Cl(L);I!=null&&(Math.ceil(L.getBoundingClientRect().height||0)<=I+1||(ye(),le({preferModelDiffHeight:!0}),Y()))});$.observe(L),Te.push({dispose:()=>$.disconnect()})}return}const x=ie();try{const P=(q=x==null?void 0:x.onDidContentSizeChange)==null?void 0:q.call(x,()=>fe());P&&Te.push(P)}catch{}try{const P=(B=x==null?void 0:x.onDidLayoutChange)==null?void 0:B.call(x,()=>fe());P&&Te.push(P)}catch{}})(),Ft(),Ml(),ye(),Sl(),fe(),yield O();let j=null;tl&&(j=yield tl(),j&&(yield O(),yield ke()));const z=j??(s==="diff"?yield Fn():yield(function(){return D(this,null,function*(){if(Se())return yield O(),yield ke(),Se();for(let f=0;f<30;f++){if(p||i.value)return!1;const w=h.value,N=Nn(),q=Dn(w),B=!$e.value.trim()||Cn(w);if(N&&q&&B&&(yield O(),yield ke(),!p&&!i.value&&Nn()&&Dn(h.value)&&(!$e.value.trim()||Cn(h.value))))return!0;yield O(),yield ke()}return!1})})());p||(z?(Ml(),xl(),(yield wn())||Oe()):Oe())})})(e),bl=null}catch(r){const u=It(),v=a!==xt.value,s=l.allowStaleContentRetry!==!1&&v&&bl!==u;if(t!==u||s)return s&&(bl=u),o=!0,V.value=!1,_.value=!1,ge.value=!1,void(F.value=!1);throw Oe(t),r}}).finally(()=>{Be===d&&(Be=null),(function(){const r=Ne;X&&r&&(Ne="",O(()=>{var u,v;if(!p){const s=(v=(u=ne.value)==null?void 0:u.offsetHeight)!=null?v:0;s>0&&X.reportHeight(r,s)}X.markSettled(r)}))})(),o&&!p&&queueMicrotask(()=>{var r;const u=h.value;u&&!p&&((r=He(u))==null||r.catch(v=>{_.value=!1,F.value=!1,Oe()}))})});return Be=d,d}A(Ta,e=>{e||io()}),A(()=>T.value,(e,l)=>{var t;const a=i.value?G():ie();a&&typeof e=="number"&&Number.isFinite(e)&&e>0&&((t=a.updateOptions)==null||t.call(a,{fontSize:e}),pe.value||le(!0))},{flush:"post",immediate:!1});let In=0;const ja=A(()=>[h.value,i.value,n.stream,n.loading,el.value,W.value,n.node.language,n.node.raw,n.node.code,n.node.loading],e=>D(null,[e],function*([l,t,a,o,d,r]){const u=++In;if(!l||!r||Re()||Ue||a===!1&&o!==!1||!ae&&(yield(function(){return D(this,null,function*(){if(typeof window>"u"||p||el.value||me.value)return;if(cl)return cl;const s=D(null,null,function*(){try{const c=yield Bo();if(p)return;if(!c)return void(me.value=!0);Mt(c)}catch{if(p)return;me.value=!0}}).finally(()=>{cl===s&&(cl=null)});return cl=s,s})})(),u!==In||n.stream===!1&&n.loading!==!1||Yl()||!W.value||!ae||me.value||V.value||Jn()||p||h.value!==l)||Yl())return;const v=He(l);if(v){try{yield v}catch{_.value=!1,F.value=!1,Oe()}_.value&&F.value&&ja()}}));function lt(e){return typeof e=="string"?e:null}function Vn(e,l){if(e===l)return!0;const t=lt(e),a=lt(l);return!!t&&t===a}function ol(){return mo({darkTheme:n.darkTheme,isDark:n.isDark,lightTheme:n.lightTheme,theme:n.theme,themes:n.themes})}function Wn(){return D(this,arguments,function*(e={}){Ze();const l=()=>{i.value&&_l(),se(()=>{Ft(),fe()})};if(e.appearanceOnly)return void l();const t=ol();if(t)try{yield ea(An()),yield bt(t),l()}catch{}else l()})}function An(){const e=n.themes;return e&&typeof e[0]=="string"&&typeof e[1]=="string"?{dark:e[0],light:e[1]}:ol()}function Un(){var e,l,t,a,o;const d=$t.value,r=Nl(Ce({},gl.value||{}),{wordWrap:d.overflow==="wrap"?"on":"off",overflow:d.overflow,themes:n.themes,stream:!1,MAX_HEIGHT:(l=(e=n.codeBlockOptions)==null?void 0:e.maxHeight)!=null?l:500,fontSize:Vl.value,lineHeight:Wl.value,theme:ol(),themeType:n.isDark?"dark":"light",disableLineNumbers:!H.value,disableFileHeader:!0,workerManager:(o=(a=(t=gl.value)==null?void 0:t.workerManager)!=null?a:bo())!=null?o:void 0,onThemeChange(){Ft()}}),u=(function(){var g;const y=(g=gl.value)==null?void 0:g.fontFamily;return typeof y=="string"&&y.trim()?y.trim():i.value?(function(){var j;if(typeof window>"u")return;const z=(j=ne.value)==null?void 0:j.querySelector("pre.code-pre-fallback");if(z)return window.getComputedStyle(z).fontFamily.trim()||void 0})():void 0})();u&&(r.fontFamily!=null||(r.fontFamily=u));const v=typeof r.unsafeCSS=="string"?r.unsafeCSS:"",s=`
25
+ `&&a++);return t})($e.value)*Wl.value+1):null),mn=m(()=>{if(i.value)return null;const e=Gl.value;return e==null||Jl()?Ul(cn.value):Ul(e)}),Sa=m(()=>{const e=n.estimatedHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}),Ql=S(null);function Je(){const e=Ql.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}const Ht=m(()=>{const e=Je();return e??(!i.value&&Rl.value?null:ze.value||!F.value?mn.value:null)});function hn(e){const l=e?"hsl(152 42% 60%)":"var(--diff-added-fg)",t=e?"hsl(0 58% 58%)":"var(--diff-removed-fg)",a=e?"color-mix(in lab, #121212 80%, #4d9375)":"color-mix(in lab, #ffffff 88%, #1e754f)",o=e?"color-mix(in lab, #121212 80%, #cb7676)":"color-mix(in lab, #ffffff 88%, #ab5959)";return{"--markstream-diff-line-number-bg":"var(--markstream-diff-editor-bg)","--markstream-diff-added-fg":l,"--markstream-diff-removed-fg":t,"--markstream-diff-added-line":a,"--markstream-diff-removed-line":o,"--markstream-diff-added-line-fill":a,"--markstream-diff-added-number-fill":e?"color-mix(in lab, #121212 85%, #4d9375)":"color-mix(in lab, #ffffff 91%, #1e754f)","--markstream-diff-removed-line-fill":o,"--markstream-diff-removed-number-fill":e?"color-mix(in lab, #121212 85%, #cb7676)":"color-mix(in lab, #ffffff 91%, #ab5959)","--markstream-diff-added-gutter":`linear-gradient(90deg, ${l} 0 4px, transparent 4px 100%)`,"--markstream-diff-removed-gutter":`linear-gradient(90deg, ${t} 0 4px, transparent 4px 100%)`,"--markstream-diff-added-inline":e?"hsl(152 42% 60% / 0.28)":"var(--diff-added-inline-bg)","--markstream-diff-removed-inline":e?"hsl(0 58% 58% / 0.28)":"var(--diff-removed-inline-bg)"}}const pn=m(()=>{const e=Ul(Gl.value),l=Ul(cn.value),t=Jl(),a=Ce({},i.value||e==null||t?i.value||l==null?{}:{minHeight:`${l}px`}:{height:`${e}px`,minHeight:`${e}px`});if(a["--markstream-code-fallback-bg"]=E.value.background,a["--markstream-code-fallback-fg"]=E.value.foreground,E.value.builtin&&(a["--markstream-code-theme-bg"]=E.value.background,a["--markstream-code-theme-fg"]=E.value.foreground,a["--markstream-code-theme-line-number"]=E.value.lineNumber),a["--markstream-pre-line-number-top"]=`${Al.value.top}px`,a["--markstream-pre-line-number-left"]="0px",a["--markstream-pre-line-number-padding-left"]="2ch",a["--markstream-pre-line-number-padding-right"]="1ch",a["--markstream-pre-line-number-separator-width"]="2px",i.value){a["--markstream-pre-diff-line-height"]=`${Wl.value}px`,a["--markstream-pre-diff-pane-bottom-padding"]=(jl.value,"0px");const o=Ue.value;o!=null&&o>0&&(a.height=`${o}px`,a.minHeight=`${o}px`,a.maxHeight=`${o}px`),Object.assign(a,hn(nn.value))}return a}),gn=m(()=>Ht.value!=null&&(!F.value||Je()!=null)),Ca=m(()=>{const e=Ht.value;if(e==null)return null;if(i.value)return Math.ceil(e);const l=Sa.value,t=Gl.value;if(l==null||t==null)return Math.ceil(e);const a=Math.max(0,Math.ceil(l)-Math.ceil(t));return Math.ceil(e+a)}),Ma=m(()=>{if(i.value&&ze.value)return{};const e=Ht.value;return gn.value&&e!=null?{minHeight:`${e}px`}:{}});function yn(){Ql.value=null}function bn(){var e,l,t,a,o,d,r,u;const v=(e=ne.value)==null?void 0:e.querySelector("pre.code-pre-fallback"),s=U(),c=(l=v==null?void 0:v.scrollTop)!=null?l:0;(o=(a=(t=s==null?void 0:s.getOriginalEditor)==null?void 0:t.call(s))==null?void 0:a.setScrollTop)==null||o.call(a,c),(u=(r=(d=s==null?void 0:s.getModifiedEditor)==null?void 0:d.call(s))==null?void 0:r.setScrollTop)==null||u.call(r,c)}function wn(){return D(this,null,function*(){return i.value?(Et(),xl(),Y(!0),bn(),ye(),nl.value=!0,yield O(),Y(!0),yield ke(),Y(!0),Ml(),xl(),!!(yield(function(){return D(this,null,function*(){var e;if(!i.value)return!0;for(let l=0;l<4;l++){const t=xl();Y(!0),Ot(t),Ba(t),yield O(),yield ke();const a=(e=ne.value)==null?void 0:e.querySelector("pre.code-pre-fallback");if(!a)return!1;if(t==null)return Xl();const o=a.getBoundingClientRect().height;if(o>0&&Math.abs(o-t)<=2)return!0}return!1})})())&&(F.value=!0,yield O(),xl(),Y(!0),Ml(),ye(),se(()=>{p||se(()=>{p||((function(){var e,l;const t=(e=ne.value)==null?void 0:e.querySelector(".code-block-shell-content"),a=(l=ne.value)==null?void 0:l.querySelector(".code-editor-layer");t&&a&&(a.style.removeProperty("height"),a.style.removeProperty("min-height"),t.style.removeProperty("height"),t.style.removeProperty("min-height"))})(),fe(!0))})}),fe(),!0)):!(tl&&!(yield tl())||(nl.value=!0,yield O(),Y(!0),F.value=!0,yield O(),fe(),0))})}function Ot(e){var l;if(!i.value)return;const t=h.value,a=(l=ne.value)==null?void 0:l.querySelector("pre.code-pre-fallback");if(!t||!a)return;const o=e??Number.parseFloat(t.style.height||"");if(!Number.isFinite(o)||o<=0)return;const d=Math.ceil(o),r=`${d}px`;Ue.value=d;const u=ne.value;u&&(u.dataset.markstreamDiffHandoffHeight=r),a.dataset.markstreamDiffHandoffHeight=r,a.style.setProperty("height",r),a.style.setProperty("min-height",r)}function Ba(e){var l,t,a;if(!i.value)return;const o=(l=ne.value)==null?void 0:l.querySelector(".code-block-shell-content"),d=(t=ne.value)==null?void 0:t.querySelector(".code-editor-layer");if(!o||!d)return;const r=typeof e=="number"&&Number.isFinite(e)&&e>0?Math.ceil(e):Number.parseFloat(((a=h.value)==null?void 0:a.style.height)||"");if(!Number.isFinite(r)||r<=0)return;const u=`${r}px`;d.style.height=u,d.style.minHeight=u,o.style.height=u,o.style.minHeight=u}function xl(){const e=h.value;if(e&&Xl(e)){ye();const l=Cl(e);if(l!=null&&l>0){const t=Math.ceil(l),a=Math.ceil(Bl()),o=Math.min(t,a),d=`${o}px`;return e.style.height=d,e.style.minHeight="0px",e.style.maxHeight=`${a}px`,e.style.overflow=t>a+1?"auto":"hidden",ze.value&&(Ue.value=o,Ot(o)),Le(),o}return le({preferModelDiffHeight:!0}),Ot(),Le(),Number.parseFloat(e.style.height||"")||null}return Et()}function kn(e,l=!1,t={}){const a=Math.ceil(e),o=Je();if(o==null)return a;const d=t.allowBelowEstimatedFloor===!0;return a>=o||d?((l||d)&&_.value&&yn(),a):o}function ke(){return new Promise(e=>{let l=!1,t=null,a=null;const o=()=>{l||(l=!0,a!=null&&globalThis.clearTimeout(a),t!=null&&at(t),e())};a=globalThis.setTimeout(o,50),t=se(o)})}function xn(){var e;try{const l=h.value;if(!l)return null;const t=(e=l.querySelector(".stream-diffs-shell .stream-diffs-surface"))!=null?e:l.querySelector(".stream-diffs-shell");if(t){const a=Math.ceil(t.getBoundingClientRect().height);if(a>0)return a}}catch{}return null}function Dt(){var e,l,t,a,o,d;try{const r=i.value?(t=(l=(e=U())==null?void 0:e.getModifiedEditor)==null?void 0:l.call(e))!=null?t:U():ie(),u=fl(),v=(a=u==null?void 0:u.EditorOption)==null?void 0:a.fontInfo;if(r&&v!=null){const s=(o=r.getOption)==null?void 0:o.call(r,v),c=s==null?void 0:s.fontSize;if(typeof c=="number"&&Number.isFinite(c)&&c>0)return c}}catch{}try{const r=h.value;if(r){const u=(d=r.querySelector(".stream-diffs-shell .stream-diffs-surface"))!=null?d:r.querySelector(".stream-diffs-shell");if(u)try{if(typeof window<"u"&&typeof window.getComputedStyle=="function"){const v=window.getComputedStyle(u).fontSize,s=v&&v.match(/^(\d+(?:\.\d+)?)/);if(s)return Number.parseFloat(s[1])}}catch{}}}catch{}return null}function al(e){var l,t;try{const d=fl(),r=(l=d==null?void 0:d.EditorOption)==null?void 0:l.lineHeight;if(r!=null){const u=(t=e==null?void 0:e.getOption)==null?void 0:t.call(e,r);if(typeof u=="number"&&u>0)return u}}catch{}const a=xn();if(a&&a>0)return a;const o=Number.isFinite(T.value)&&T.value>0?T.value:14;return Math.max(12,Math.round(1.35*o))}function Sn(){var e;const l=(e=n.codeBlockOptions)==null?void 0:e.padding;return typeof l=="number"&&Number.isFinite(l)?2*Math.max(0,l):i.value?24:0}function Cn(e){return!!dt.value||!!e&&(Se(e)||tl!=null)}function Sl(){var e,l;i.value?hl.value=ko(String((e=n.node.originalCode)!=null?e:""),String((l=n.node.updatedCode)!=null?l:"")):hl.value={removed:0,added:0}}function Nt(){var e;if(Number.isFinite(T.value)&&T.value>0&&Number.isFinite(ue.value))return T.value;if(typeof((e=n.codeBlockOptions)==null?void 0:e.fontSize)=="number")return ue.value=n.codeBlockOptions.fontSize,T.value=n.codeBlockOptions.fontSize,n.codeBlockOptions.fontSize;const l=Dt();return l&&l>0?(ue.value=l,T.value=l,l):(ue.value=12,T.value=12,12)}function Pa(){const e=Nt(),l=Math.min(36,e+1);T.value=l}function $a(){const e=Nt(),l=Math.max(10,e-1);T.value=l}function Ha(){Nt(),Number.isFinite(ue.value)&&(T.value=ue.value)}function Mn(){var e,l,t,a,o,d,r,u,v,s,c,g,y,j;try{const z=i.value?U():null,f=i.value?z:ie();if(!f)return null;if(z!=null&&z.getOriginalEditor&&(z!=null&&z.getModifiedEditor)){const B=(e=z.getOriginalEditor)==null?void 0:e.call(z),x=(l=z.getModifiedEditor)==null?void 0:l.call(z);(t=B==null?void 0:B.layout)==null||t.call(B),(a=x==null?void 0:x.layout)==null||a.call(x);const P=((o=B==null?void 0:B.getContentHeight)==null?void 0:o.call(B))||0,Z=((d=x==null?void 0:x.getContentHeight)==null?void 0:d.call(x))||0,be=Math.max(P,Z);if(be>0)return Math.ceil(be);const te=((v=(u=(r=B==null?void 0:B.getModel)==null?void 0:r.call(B))==null?void 0:u.getLineCount)==null?void 0:v.call(u))||1,L=((g=(c=(s=x==null?void 0:x.getModel)==null?void 0:s.call(x))==null?void 0:c.getLineCount)==null?void 0:g.call(c))||1,$=Math.max(te,L),I=Math.max(al(B),al(x)),J=Sn();return Math.ceil($*I+J+0)}if(f!=null&&f.getContentHeight){(y=f==null?void 0:f.layout)==null||y.call(f);const B=f.getContentHeight();if(B>0)return i.value||(Rl.value=!0),Math.ceil(B)}const w=(j=f==null?void 0:f.getModel)==null?void 0:j.call(f);let N=1;w&&typeof w.getLineCount=="function"&&(N=w.getLineCount());const q=al(f);return Math.ceil(N*(q+1.5)+0)}catch{return null}}function Bn(){var e,l;if(i.value)return!1;try{const t=(l=(e=ie())==null?void 0:e.getContentHeight)==null?void 0:l.call(e),a=typeof t=="number"&&Number.isFinite(t)&&t>0;return a&&(Rl.value=!0),a}catch{return!1}}function Cl(e){if(typeof window>"u")return null;try{if(window.getComputedStyle(e).display==="none")return null;const l=e.querySelector("diffs-container");if(l instanceof HTMLElement){const a=l.getBoundingClientRect();if(a.height>0)return Math.ceil(a.height)}const t=e.querySelector(".stream-diffs-shell");if(t){const a=t.getBoundingClientRect();if(a.height>0)return Math.ceil(a.height)}return null}catch{return null}}function Pn(e){var l;const t=String(e??"").trim(),a=(l=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i))==null?void 0:l[1];if(a){const v=a.length===3?a.split("").map(s=>`${s}${s}`).join(""):a;return .2126*Number.parseInt(v.slice(0,2),16)+.7152*Number.parseInt(v.slice(2,4),16)+.0722*Number.parseInt(v.slice(4,6),16)}const o=t.match(/\d+(?:\.\d+)?/g);if(!o||o.length<3)return null;const[d,r,u]=o.slice(0,3).map(Number);return .2126*d+.7152*r+.0722*u}function Ml(){var e,l,t;if($n())return;const a=Dt();a&&a>0&&(Pt.value=a,T.value=a,ue.value=a);try{const o=al(i.value?(t=(l=(e=U())==null?void 0:e.getModifiedEditor)==null?void 0:l.call(e))!=null?t:U():ie());o&&o>0&&(Il.value=o)}catch{}try{const o=xn();o&&o>0&&(Il.value=o)}catch{}}function $n(){return i.value&&sn.value}function Et(){var e;if(!ze.value)return null;const l=h.value,t=(e=ne.value)==null?void 0:e.querySelector("pre.code-pre-fallback");if(!l||!t)return null;const a=Math.ceil(t.getBoundingClientRect().height),o=i.value?Cl(l):null,d=Math.max(a,o!=null&&o>0?Math.ceil(o):0),r=Math.ceil(Bl()),u=Math.min(d,r);return!Number.isFinite(u)||u<=0?null:(i.value&&u>a&&(Ue.value=u),l.style.height=`${u}px`,l.style.minHeight=`${u}px`,l.style.maxHeight=`${r}px`,l.style.overflow=d>r+1?"auto":"hidden",u)}function Ft(){var e,l,t,a,o,d,r,u,v;const s=h.value,c=ne.value;if(!s||!c)return;const g=s;g.style.setProperty("--markstream-diff-metadata-bg",E.value.background),g.style.setProperty("--markstream-diff-metadata-fg",E.value.lineNumber),g.style.setProperty("--diffs-tab-size",String(fn.value)),g.style.setProperty("--diffs-scrollbar-gutter-override","0px"),typeof((e=n.codeBlockOptions)==null?void 0:e.padding)=="number"?g.style.setProperty("--diffs-gap-block",`${Al.value.top}px`):g.style.removeProperty("--diffs-gap-block");const y=s.querySelector(".stream-diffs-shell")||s,j=y,z=y;let f=null,w=null,N=null;try{typeof window<"u"&&typeof window.getComputedStyle=="function"&&(f=window.getComputedStyle(y),w=j===y?f:window.getComputedStyle(j),N=z===y?f:window.getComputedStyle(z))}catch{f=null,w=null,N=null}const q=String((l=f==null?void 0:f.getPropertyValue("--vscode-editor-foreground"))!=null?l:"").trim(),B=String((t=f==null?void 0:f.getPropertyValue("--vscode-editor-background"))!=null?t:"").trim(),x=String((o=(a=f==null?void 0:f.getPropertyValue("--vscode-editor-selectionBackground"))!=null?a:f==null?void 0:f.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?o:"").trim(),P=q||String((r=(d=N==null?void 0:N.color)!=null?d:f==null?void 0:f.color)!=null?r:"").trim(),Z=B||String((v=(u=w==null?void 0:w.backgroundColor)!=null?u:f==null?void 0:f.backgroundColor)!=null?v:"").trim(),be=(function(){var te,L,$,I,J;try{const ve=i.value?($=(L=(te=U())==null?void 0:te.getModifiedEditor)==null?void 0:L.call(te))!=null?$:U():ie(),oe=fl(),re=(I=oe==null?void 0:oe.EditorOption)==null?void 0:I.fontInfo;if(ve&&re!=null){const K=(J=ve.getOption)==null?void 0:J.call(ve,re),Q=K==null?void 0:K.typicalHalfwidthCharacterWidth;if(typeof Q=="number"&&Number.isFinite(Q)&&Q>0)return Q}}catch{}return null})();if(be!=null&&(wl.value=be),i.value){const te=(L,$)=>{$?(c.style.setProperty(L,$),g.style.setProperty(L,$)):(c.style.removeProperty(L),g.style.removeProperty(L))};for(const[L,$]of Object.entries(hn(c.classList.contains("is-dark"))))te(L,$);return P?(c.style.setProperty("--markstream-diff-editor-fg",P),g.style.setProperty("--vscode-editor-foreground",P)):(c.style.removeProperty("--markstream-diff-editor-fg"),g.style.removeProperty("--vscode-editor-foreground")),Z?(c.style.setProperty("--markstream-diff-editor-bg",Z),c.style.setProperty("--markstream-diff-panel-bg",Z),c.style.setProperty("--markstream-diff-panel-bg-soft",Z),c.style.setProperty("--markstream-diff-panel-bg-strong",Z),g.style.setProperty("--vscode-editor-background",Z),g.style.backgroundColor=Z):(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"),g.style.removeProperty("--vscode-editor-background"),g.style.backgroundColor=""),void(x?g.style.setProperty("--vscode-editor-selectionBackground",x):g.style.removeProperty("--vscode-editor-selectionBackground"))}if((function(te,L,$){if(!dt.value)return!1;const I=Pn(te),J=Pn(L);return $?I!=null&&I>170||J!=null&&J<110:I!=null&&I<85||J!=null&&J>190})(Z,P,c.classList.contains("is-dark")))return g.style.removeProperty("--vscode-editor-foreground"),g.style.removeProperty("--vscode-editor-background"),void g.style.removeProperty("--vscode-editor-selectionBackground");P&&g.style.setProperty("--vscode-editor-foreground",P),Z&&g.style.setProperty("--vscode-editor-background",Z),x&&g.style.setProperty("--vscode-editor-selectionBackground",x)}A(()=>[n.stream,n.loading,n.node.loading,i.value],([e,l,t,a])=>{a||e===!1||l===!1||kl.value?(a||e===!1)&&kl.value&&(kl.value=!1):(kl.value=!0,yn())},{immediate:!0});let Tt=0,zt=0;const Hn=/auto|scroll|overlay/i;function xe(e,l,t){var a;if(typeof window>"u"||i.value||(function(c){return pa.value||un(c)})(e))return;const o=Math.ceil(l),d=Math.ceil(t)-o;if(Math.abs(d)<=1)return;const r=(function(c){var g,y;if(typeof window>"u")return null;const j=(g=c==null?void 0:c.ownerDocument)!=null?g:document,z=j.scrollingElement||j.documentElement||j.body;let f=(y=c==null?void 0:c.parentElement)!=null?y:null;for(;f&&f!==j.body&&f!==z;){const w=window.getComputedStyle(f),N=(w.overflowY||"").toLowerCase(),q=(w.overflow||"").toLowerCase();if(Hn.test(N)||Hn.test(q))return f;f=f.parentElement}return z})(e);if(!r)return;const u=(a=e.ownerDocument)!=null?a:document,v=r===u.body||r===u.documentElement||r===u.scrollingElement,s=v?0:r.getBoundingClientRect().top;e.getBoundingClientRect().top-s>=0||(v&&typeof window.scrollBy=="function"?window.scrollBy(0,d):r.scrollTop+=d)}function Lt(){try{const e=h.value;if(!e)return;const l=e.getBoundingClientRect().height,t=Mn();if(t!=null&&t>0){const o=kn(t,!0,{allowBelowEstimatedFloor:!i.value&&_.value&&Bn()}),d=Je();return e.style.minHeight=d!=null?`${d}px`:"0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",void xe(e,l,o)}const a=Je();a!=null&&(e.style.minHeight=`${a}px`,e.style.height=`${a}px`,e.style.maxHeight="none",e.style.overflow="visible",xe(e,l,a))}catch{}}function Qe(){for(var e,l;Te.length>0;)try{(l=(e=Te.pop())==null?void 0:e.dispose)==null||l.call(e)}catch{}ll!=null&&(at(ll),ll=null),dl!=null&&(at(dl),dl=null),qe!=null&&(at(qe),qe=null),Ie=0,Ve=!1}function Xe(){for(var e;Kt.length>0;)try{(e=Kt.pop())==null||e()}catch{}}function le(e=!1){pe.value||(De.value?Lt():(function(l={}){try{const t=h.value;if(!t)return;const a=t.getBoundingClientRect().height,o=Math.ceil(a||0),d=Bl(),r=o,u=Number.parseFloat(t.style.height||""),v=r>0?r:Number.isFinite(u)&&u>0?Math.ceil(u):0,s=i.value?(function(){var x,P,Z,be,te,L,$,I,J,ve,oe,re;if(Se())return null;try{const K=U(),Q=(x=K==null?void 0:K.getOriginalEditor)==null?void 0:x.call(K),rl=(P=K==null?void 0:K.getModifiedEditor)==null?void 0:P.call(K);if(!Q||!rl)return null;const qa=((te=(be=(Z=Q.getModel)==null?void 0:Z.call(Q))==null?void 0:be.getLineCount)==null?void 0:te.call(be))||1,Ia=((I=($=(L=rl.getModel)==null?void 0:L.call(rl))==null?void 0:$.getLineCount)==null?void 0:I.call($))||1,Va=Math.max(qa,Ia),Wa=Math.max(al(Q),al(rl)),Aa=Sn(),Ga=Math.max((ve=(J=Q.getContentHeight)==null?void 0:J.call(Q))!=null?ve:0,(re=(oe=rl.getContentHeight)==null?void 0:oe.call(rl))!=null?re:0);return Math.ceil(Math.max(Ga,Va*Wa+Aa+0))}catch{return null}})():null,c=i.value&&Xl(t);if(ft>0&&(ft--,Ee.value!=null))return void xe(t,a,_e(t,Ee.value,d,{preserveScrollableOverflow:Rt(t)}));if(i.value&&!c&&ze.value){const x=Et();if(x!=null){const P=_e(t,x,d,{allowBelowEstimatedFloor:!0});return Y(!0),void xe(t,a,P)}}const g=i.value&&l.preferModelDiffHeight===!0,y=i.value?Cl(t):null,j=!i.value&&_.value&&Bn(),z=i.value&&n.loading!==!1&&(y!=null||s!=null&&r>0&&s<r-1),f=s!=null;let w;if(i.value)if(g){const x=s!=null&&n.loading===!1&&v>0&&s<v-1;w=n.loading===!1&&y!=null?s==null?y:Math.max(y,s):x?s:y!=null&&s!=null?Math.max(y,s,n.loading!==!1?v:0):Math.max(y??0,s??0,n.loading!==!1?v:0)||null}else w=jl.value&&y!=null||y!=null?f?Math.max(y,s):y:i.value&&n.loading!==!1?s!=null&&v>0&&s<v-1?s:v>0?v:null:s;else w=Mn();if(i.value&&w!=null&&v>0&&(n.loading!==!1||l.holdCurrentDiffHeight===!0)&&(w=Math.max(w,v)),w!=null&&w>0)return void xe(t,a,_e(t,w,d,{clearEstimatedFloor:!0,allowBelowEstimatedFloor:j||z,preserveScrollableOverflow:Rt(t),renderedStreamingDiffHeight:y}));if(Ee.value!=null)return void xe(t,a,_e(t,Ee.value,d,{preserveScrollableOverflow:Rt(t)}));const N=i.value&&n.loading!==!1?r:Math.max(r,s!=null&&s>0?s:0);if(N>0)return void xe(t,a,_e(t,N,d));const q=Je();if(!(q==null||i.value&&n.loading!==!1&&c))return void xe(t,a,_e(t,q,d));const B=Number.parseFloat(t.style.height);!Number.isNaN(B)&&B>0?xe(t,a,_e(t,B,d)):i.value||xe(t,a,_e(t,d,d))}catch{}})(typeof e=="object"?e:{}))}function On(){Tt=0,zt=0}function Y(e=!1){var l,t,a;if(pe.value)return;const o=h.value;if(!o)return;const d=i.value?U():ie();if(d&&typeof d.layout=="function")try{const r=(l=o.getBoundingClientRect)==null?void 0:l.call(o),u=Math.ceil(((t=r==null?void 0:r.width)!=null?t:0)||o.clientWidth||0),v=Math.ceil(((a=r==null?void 0:r.height)!=null?a:0)||o.clientHeight||Number.parseFloat(o.style.height||"")||0);if(u>0&&v>0){if(!e&&u===Tt&&v===zt)return;Tt=u,zt=v,d.layout({width:u,height:v})}else On(),d.layout()}catch{}}function ye(){Xe()}function fe(e=!1){if(p||ll!=null)return;const l=()=>{p||(ye(),le(e),Y())};ll=se(()=>{ll=null,l(),dl=se(()=>{dl=null,l()})}),Le()}function Le(e=!1){if(!i.value||p||!e&&n.loading===!1||(Ve=Ve||e,Ie=Math.max(Ie,e?18:6),qe!=null))return;const l=()=>{if(qe=null,!i.value||p||Ie<=0||!Ve&&n.loading===!1)return Ie=0,void(Ve=!1);Ie--,ye(),le({preferModelDiffHeight:!0,holdCurrentDiffHeight:Ve}),Y(),Ie>0?qe=se(l):Ve=!1};qe=se(l)}function _e(e,l,t,a={}){var o;const d=i.value&&n.loading!==!1,r="renderedStreamingDiffHeight"in a?d&&(o=a.renderedStreamingDiffHeight)!=null?o:null:d?Cl(e):null,u=r!=null&&r>l+1?r:l,v=Math.min(u,t),s=a.allowBelowEstimatedFloor===!0,c=kn(v,a.clearEstimatedFloor===!0,{allowBelowEstimatedFloor:s}),g=Je();e.style.minHeight=g==null||s?"0px":`${Math.min(g,Math.ceil(t))}px`,e.style.height=`${c}px`,e.style.maxHeight=`${Math.ceil(t)}px`;const y=a.preserveScrollableOverflow===!0||u>t+1||_t(e,c);return e.style.overflow=y?"auto":"hidden",c}function _t(e,l=0){var t;const a=Math.ceil(((t=e.getBoundingClientRect)==null?void 0:t.call(e).height)||0),o=Math.max(l,e.clientHeight||0,a);return o>0&&e.scrollHeight>o+1}function Rt(e){var l;return vt||_t(e,(l=Ee.value)!=null?l:0)}function Xl(e=h.value){return Se(e)}function Dn(e=h.value){return Se(e)}function Nn(){var e,l;if(Se())return!0;const t=(l=(e=ie())==null?void 0:e.getModel)==null?void 0:l.call(e);return typeof(t==null?void 0:t.getValue)=="function"&&t.getValue()===$e.value}function Se(e=h.value){return!!(e!=null&&e.querySelector("diffs-container"))}function En(){return n.loading!==!1||F.value}function Oa(){const e=U();return typeof(e==null?void 0:e.getOriginalEditor)=="function"||typeof(e==null?void 0:e.getModifiedEditor)=="function"||typeof(e==null?void 0:e.getLineChanges)=="function"}function Fn(){return D(this,null,function*(){if(!i.value)return!0;for(let e=0;e<30;e++){if(p)return!1;if(Se())return yield O(),yield ke(),!p&&Se();yield O(),yield ke()}return!1})}let jt="";function Tn(e,l,t){return D(this,null,function*(){const a=`${e}\0${l}\0${t}`;if(jt!==a){try{return yield zl(e,l,t),void(jt=a)}catch(o){if(!pl(o))throw o}if(yield O(),yield ke(),!p&&i.value)try{yield zl(e,l,t),jt=a}catch(o){if(!pl(o))throw o}}})}function Bl(){var e,l;return(l=(e=n.codeBlockOptions)==null?void 0:e.maxHeight)!=null?l:500}const qt=m(()=>n.isShowPreview&&(we.value==="html"||we.value==="svg"));function Re(){return typeof n.node.loading=="boolean"?n.node.loading:n.loading===!0}function zn(e,l,t){return!t||(function(){var a,o,d;if(!Re())return!0;const r=String((a=n.node.raw)!=null?a:""),u=(d=(o=r.split(/\r\n|\n|\r/,1)[0])==null?void 0:o.trimStart())!=null?d:"";return!/^(?:`{3,}|~{3,})/.test(u)||/\r\n|\n|\r/.test(r)})()&&String(l??"")?Zn(String(e??"")):"plain"}function Yl(){return Re()}let Ye=null,Zl=!1,Kl=0;function Ln(){Ye=null,Kl++}function _n(){return D(this,arguments,function*(e=Kl){if(!Zl){Zl=!0;try{for(;Ye&&!p&&!i.value&&e===Kl;){const l=Ye;Ye=null;try{yield Promise.resolve(mt(l.code,l.language)),yield O(),p||i.value||(le(!1),Y())}catch{}}}finally{Zl=!1,!Ye||p||i.value||_n()}}})}function Rn(e,l){Ye={code:e,language:l},_n(Kl)}A(()=>[n.node.language,n.node.code,n.node.raw,n.node.loading,n.loading],([e,l,t,a,o])=>{we.value=zn(e,l,typeof a=="boolean"?a:o===!0)}),A(()=>[n.node.originalCode,n.node.updatedCode,i.value],()=>{se(()=>Sl())},{immediate:!0});let et=0;A(()=>[n.node.originalCode,n.node.updatedCode,Me.value,i.value,n.stream],e=>D(null,[e],function*([,,,l,t]){var a,o;const d=++et;if(!l||Re()||t===!1&&!V.value)return;if(t!==!1&&ae&&!V.value&&h.value)try{yield He(h.value)}catch{}const r=vl;if(r&&!ge.value){try{yield r}catch{}if(p||!i.value||d!==et)return}if(d!==et)return;const u=kt(String((a=n.node.originalCode)!=null?a:""),String((o=n.node.updatedCode)!=null?o:"")),v=n.loading===!1;v&&Ze();try{if(yield Tn(u.original,u.updated,Me.value),p||!i.value||d!==et)return;yield O(),Y(!0),ye(),le(n.loading===!1||{preferModelDiffHeight:!0}),Y(!0),fe(!0)}catch{return}if(v){if(p||!i.value)return;_l(),ye(),Sl(),fe(),Le(!0)}De.value&&se(()=>Lt())})),A(()=>n.node.code,e=>D(null,null,function*(){if(Re()||n.stream===!1||(we.value||(we.value=Zn(Zt(e))),i.value))return;const l=vl;if(l&&!ge.value){try{yield l}catch{}if(p||i.value)return}if(ae&&!V.value&&h.value)try{yield He(h.value)}catch{}Rn(en(n.node.code),Me.value),De.value&&se(()=>Lt())}));const Da=m(()=>{const e=we.value;return e?Kn[e]||e.charAt(0).toUpperCase()+e.slice(1):Kn[""]}),jn=m(()=>{var e;return yo(String((e=n.node.raw)!=null?e:""),Da.value,i.value)}),Na=m(()=>jn.value.title),qn=m(()=>jn.value.caption),Ea=m(()=>(co.value,Co(we.value||"",da))),Fa=m(()=>{const e={};e["--markstream-code-layout-character-width"]=wl.value==null?"1ch":`${wl.value}px`,e["--markstream-code-fallback-bg"]=E.value.background,e["--markstream-code-fallback-fg"]=E.value.foreground,E.value.builtin&&(e["--markstream-code-theme-bg"]=E.value.background,e["--markstream-code-theme-fg"]=E.value.foreground,e["--markstream-code-theme-line-number"]=E.value.lineNumber),e["--markstream-diff-added-line-fill"]=E.value.diffAddedLine,e["--markstream-diff-added-number-fill"]=E.value.diffAddedNumber,e["--markstream-diff-editor-bg"]=E.value.background,e["--markstream-diff-removed-line-fill"]=E.value.diffRemovedLine,e["--markstream-diff-removed-number-fill"]=E.value.diffRemovedNumber,e["--markstream-diff-shell-bg"]=E.value.background,e["--markstream-pre-resolved-theme-bg"]=E.value.background,e["--markstream-pre-resolved-theme-fg"]=E.value.foreground,e["--markstream-pre-resolved-theme-line-number"]=E.value.lineNumber;const l=o=>{if(o!=null)return typeof o=="number"?`${o}px`:String(o)},t=l(n.minWidth),a=l(n.maxWidth);if(t&&(e.minWidth=t),a&&(e.maxWidth=a),gn.value&&!i.value&&!pe.value){const o=Ca.value;o!=null&&(e.minHeight=`${o}px`)}return e.color="var(--markstream-code-fallback-fg, var(--markstream-code-theme-fg, var(--markstream-pre-resolved-theme-fg)))",e.backgroundColor="var(--markstream-code-fallback-bg, var(--markstream-code-theme-bg, var(--markstream-pre-resolved-theme-bg)))",i.value||(e.borderColor="var(--markstream-code-border-color, var(--code-border))"),e}),Ta=m(()=>n.showTooltips!==!1);function za(){return D(this,null,function*(){const e=n.node.code;try{n.clipboardWriter?yield n.clipboardWriter(e):typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(e)),ut.value=!0,k("copy",e),setTimeout(()=>{ut.value=!1},1e3)}catch(l){console.error("复制失败:",l)}})}function La(){De.value=!De.value;const e=i.value?U():ie(),l=h.value;e&&l&&(De.value?(l.style.maxHeight="none",l.style.overflow="visible",le(!0)):(l.style.overflow="auto",le(!0)))}function _a(){var e,l;if(pe.value=!pe.value,pe.value){if(vt=!1,h.value){const t=Math.ceil(((l=(e=h.value).getBoundingClientRect)==null?void 0:l.call(e).height)||0);vt=_t(h.value,t)||h.value.style.overflow==="auto"||h.value.style.overflowY==="auto",t>0&&(Ee.value=t)}}else h.value&&Ee.value!=null&&(h.value.style.height=`${Ee.value}px`),ft=2,O(()=>{pe.value||p||(le(!0),Y(!0))})}function Ra(){if(!qt.value)return;const e=we.value;if(Qt.value){const l=e==="html"?"text/html":"image/svg+xml",t=e==="html"?Xt("artifacts.htmlPreviewTitle")||"HTML Preview":Xt("artifacts.svgPreviewTitle")||"SVG Preview";return void k("previewCode",{node:n.node,artifactType:l,artifactTitle:t,id:`temp-${e}-${Date.now()}`})}e==="html"&&(ql.value=!ql.value)}function He(e,l={}){if(!ae||p||n.stream===!1&&n.loading!==!1||(Vt(),Jn())||me.value||h.value!==e||Yl())return null;if(Be)return Be;if(V.value&&_.value)return Promise.resolve();const t=It(),a=xt.value;let o=!1;V.value=!0,(function(){const r=fa.value;X&&r&&Ne!==r&&(Ne&&X.markSettled(Ne),Ne=r,X.markPending(r))})();const d=D(null,null,function*(){try{yield(function(r){return D(this,null,function*(){var u,v;if(!ae||p)return;sl=!1;const s=yl.value;if(Ct=!1,de.value=!1,Ae.value=null,ge.value=!1,F.value=!1,nl.value=!1,Pt.value=null,Il.value=null,wl.value=null,Ue.value=null,On(),(function(){if(Rl.value=!1,Jl())return void(Ql.value=null);const f=mn.value;Ql.value=_.value||f==null?null:f})(),Qe(),Xe(),(function(f){f.replaceChildren()})(r),Ze(),yield ea(An()),p)return;const c=D(null,null,function*(){var f,w;if(s==="diff"){(function(){if(wt||typeof window>"u")return;wt=!0;const q=B=>{var x;pl("reason"in B?B.reason:(x=B.error)!=null?x:B.message)&&(B.preventDefault(),B.stopImmediatePropagation())};window.addEventListener("error",q,!0),window.addEventListener("unhandledrejection",q,!0),Ll=()=>{window.removeEventListener("error",q,!0),window.removeEventListener("unhandledrejection",q,!0),wt=!1,Ll=null}})(),We();const N=kt(String((f=n.node.originalCode)!=null?f:""),String((w=n.node.updatedCode)!=null?w:""));Tl?yield Tl(r,N.original,N.updated,Me.value):yield ae(r,n.node.code,Me.value)}else yield ae(r,$e.value,Me.value);ge.value=!0}),g=c.finally(()=>{vl===g&&(vl=null)});if(vl=g,yield(function(f){return D(this,null,function*(){if(!i.value)return void(yield f);let w,N=!1;for(f.then(()=>{N=!0},q=>{N=!0,w=q});;){if(p)return;if(N){if(w)throw w;return}if(Xl()&&Oa())return;yield O(),yield ke()}})})(g),p||yl.value!==s)return;ge.value=!0;const y=(u=n.codeBlockOptions)==null?void 0:u.fontSize;if(typeof y=="number"&&Number.isFinite(y)&&y>0){const f=s==="diff"?U():ie();(v=f==null?void 0:f.updateOptions)==null||v.call(f,{fontSize:y}),ue.value=y,T.value=y}else if(!$n()){const f=Dt();f&&f>0?(ue.value=f,T.value=f):(ue.value=12,T.value=12)}for(Ml();sl;)if(sl=!1,yield Wn(),p)return;De.value||pe.value||le(!1),_.value=!0,an.value=s,(function(){var f,w,N,q,B;if(Qe(),i.value){const P=U(),Z=(f=P==null?void 0:P.getOriginalEditor)==null?void 0:f.call(P),be=(w=P==null?void 0:P.getModifiedEditor)==null?void 0:w.call(P),te=($,I)=>{try{const J=$==null?void 0:$[I];if(typeof J!="function")return;const ve=J.call($,()=>fe());ve&&Te.push(ve)}catch{}};try{const $=(N=P==null?void 0:P.onDidUpdateDiff)==null?void 0:N.call(P,()=>{fe(),se(()=>Sl())});$&&Te.push($)}catch{}te(Z,"onDidContentSizeChange"),te(be,"onDidContentSizeChange");const L=h.value;if(L&&typeof MutationObserver<"u"){const $=["diffs-container",".stream-diffs-shell",".stream-diffs-surface"].join(","),I=oe=>{var re;const K=oe instanceof HTMLElement?oe:oe.parentElement;return!!((re=K==null?void 0:K.closest)!=null&&re.call(K,$))},J=oe=>{var re,K;const Q=oe instanceof HTMLElement?oe:oe.parentElement;return!!((re=Q==null?void 0:Q.closest)!=null&&re.call(Q,$)||(K=Q==null?void 0:Q.querySelector)!=null&&K.call(Q,$))},ve=new MutationObserver(oe=>{i.value&&En()&&oe.some(re=>I(re.target)||Array.from(re.addedNodes).some(J)||Array.from(re.removedNodes).some(I))&&(ye(),le({preferModelDiffHeight:!0}),Y(),Le())});ve.observe(L,{attributeFilter:["class"],attributes:!0,childList:!0,characterData:!0,subtree:!0}),Te.push({dispose:()=>ve.disconnect()})}if(L&&typeof ResizeObserver<"u"){const $=new ResizeObserver(()=>{if(!i.value||(Y(),!En()))return;const I=Cl(L);I!=null&&(Math.ceil(L.getBoundingClientRect().height||0)<=I+1||(ye(),le({preferModelDiffHeight:!0}),Y()))});$.observe(L),Te.push({dispose:()=>$.disconnect()})}return}const x=ie();try{const P=(q=x==null?void 0:x.onDidContentSizeChange)==null?void 0:q.call(x,()=>fe());P&&Te.push(P)}catch{}try{const P=(B=x==null?void 0:x.onDidLayoutChange)==null?void 0:B.call(x,()=>fe());P&&Te.push(P)}catch{}})(),Ft(),Ml(),ye(),Sl(),fe(),yield O();let j=null;tl&&(j=yield tl(),j&&(yield O(),yield ke()));const z=j??(s==="diff"?yield Fn():yield(function(){return D(this,null,function*(){if(Se())return yield O(),yield ke(),Se();for(let f=0;f<30;f++){if(p||i.value)return!1;const w=h.value,N=Nn(),q=Dn(w),B=!$e.value.trim()||Cn(w);if(N&&q&&B&&(yield O(),yield ke(),!p&&!i.value&&Nn()&&Dn(h.value)&&(!$e.value.trim()||Cn(h.value))))return!0;yield O(),yield ke()}return!1})})());p||(z?(Ml(),xl(),(yield wn())||Oe()):Oe())})})(e),bl=null}catch(r){const u=It(),v=a!==xt.value,s=l.allowStaleContentRetry!==!1&&v&&bl!==u;if(t!==u||s)return s&&(bl=u),o=!0,V.value=!1,_.value=!1,ge.value=!1,void(F.value=!1);throw Oe(t),r}}).finally(()=>{Be===d&&(Be=null),(function(){const r=Ne;X&&r&&(Ne="",O(()=>{var u,v;if(!p){const s=(v=(u=ne.value)==null?void 0:u.offsetHeight)!=null?v:0;s>0&&X.reportHeight(r,s)}X.markSettled(r)}))})(),o&&!p&&queueMicrotask(()=>{var r;const u=h.value;u&&!p&&((r=He(u))==null||r.catch(v=>{_.value=!1,F.value=!1,Oe()}))})});return Be=d,d}A(Ta,e=>{e||io()}),A(()=>T.value,(e,l)=>{var t;const a=i.value?U():ie();a&&typeof e=="number"&&Number.isFinite(e)&&e>0&&((t=a.updateOptions)==null||t.call(a,{fontSize:e}),pe.value||le(!0))},{flush:"post",immediate:!1});let In=0;const ja=A(()=>[h.value,i.value,n.stream,n.loading,el.value,W.value,n.node.language,n.node.raw,n.node.code,n.node.loading],e=>D(null,[e],function*([l,t,a,o,d,r]){const u=++In;if(!l||!r||Re()||Ge||a===!1&&o!==!1||!ae&&(yield(function(){return D(this,null,function*(){if(typeof window>"u"||p||el.value||me.value)return;if(cl)return cl;const s=D(null,null,function*(){try{const c=yield Bo();if(p)return;if(!c)return void(me.value=!0);Mt(c)}catch{if(p)return;me.value=!0}}).finally(()=>{cl===s&&(cl=null)});return cl=s,s})})(),u!==In||n.stream===!1&&n.loading!==!1||Yl()||!W.value||!ae||me.value||V.value||Jn()||p||h.value!==l)||Yl())return;const v=He(l);if(v){try{yield v}catch{_.value=!1,F.value=!1,Oe()}_.value&&F.value&&ja()}}));function lt(e){return typeof e=="string"?e:null}function Vn(e,l){if(e===l)return!0;const t=lt(e),a=lt(l);return!!t&&t===a}function ol(){return mo({darkTheme:n.darkTheme,isDark:n.isDark,lightTheme:n.lightTheme,theme:n.theme,themes:n.themes})}function Wn(){return D(this,arguments,function*(e={}){Ze();const l=()=>{i.value&&_l(),se(()=>{Ft(),fe()})};if(e.appearanceOnly)return void l();const t=ol();if(t)try{yield ea(An()),yield bt(t),l()}catch{}else l()})}function An(){const e=n.themes;return e&&typeof e[0]=="string"&&typeof e[1]=="string"?{dark:e[0],light:e[1]}:ol()}function Gn(){var e,l,t,a,o;const d=$t.value,r=Nl(Ce({},gl.value||{}),{wordWrap:d.overflow==="wrap"?"on":"off",overflow:d.overflow,themes:n.themes,stream:!1,MAX_HEIGHT:(l=(e=n.codeBlockOptions)==null?void 0:e.maxHeight)!=null?l:500,fontSize:Vl.value,lineHeight:Wl.value,theme:ol(),themeType:n.isDark?"dark":"light",disableLineNumbers:!H.value,disableFileHeader:!0,workerManager:(o=(a=(t=gl.value)==null?void 0:t.workerManager)!=null?a:bo())!=null?o:void 0,onThemeChange(){Ft()}}),u=(function(){var g;const y=(g=gl.value)==null?void 0:g.fontFamily;return typeof y=="string"&&y.trim()?y.trim():i.value?(function(){var j;if(typeof window>"u")return;const z=(j=ne.value)==null?void 0:j.querySelector("pre.code-pre-fallback");if(z)return window.getComputedStyle(z).fontFamily.trim()||void 0})():void 0})();u&&(r.fontFamily!=null||(r.fontFamily=u));const v=typeof r.unsafeCSS=="string"?r.unsafeCSS:"",s=`
26
26
  [data-file] [data-line],
27
27
  [data-diff] [data-line] {
28
28
  white-space: ${(c=d.overflow)==="wrap"?"pre-wrap":"pre"} !important;
@@ -40,4 +40,4 @@ ${s}
40
40
  color: var(--markstream-diff-metadata-fg) !important;
41
41
  background-color: var(--markstream-diff-metadata-bg) !important;
42
42
  }
43
- ${v}`.trim(),r}function Ze(){const e=Un();if(!Pe)return Pe=e,Pe;for(const l of Object.keys(Pe))l in e||delete Pe[l];return Object.assign(Pe,e),Pe}A(yl,(e,l)=>D(null,null,function*(){if(e===l||de.value||Ue||(Ln(),!ae||!h.value)||!V.value||n.stream===!1&&n.loading!==!1||!W.value)return;const t=Be;if(t){try{yield t}catch{}if(p||!h.value)return}if(an.value!==e||!V.value||!_.value)try{_.value=!1,F.value=!1,V.value=!1,ge.value=!1,Qe(),Xe(),We(),yield O(),yield He(h.value)}catch{_.value=!1,F.value=!1,Oe()}}));const tt=S(0),Gn=m(()=>String(tt.value));let Pl=!1;function It(){var e;const l=ol();return JSON.stringify({kind:yl.value,language:Me.value,structural:Gn.value,optionsRevision:tt.value,settledContentGeneration:on.value,theme:(e=lt(l))!=null?e:l==null?null:"custom",isDark:n.isDark})}A(()=>{var e;return(e=n.codeBlockOptions)==null?void 0:e.fontSize},e=>{const l=typeof e=="number"&&Number.isFinite(e)&&e>0?e:Bt;ue.value=l,T.value=l,Pt.value=null,Il.value=null,wl.value=null}),A(()=>[n.codeBlockOptions,n.showLineNumbers],()=>{tt.value+=1,n.stream===!1&&n.loading!==!1&&(Pl=!0)},{deep:!0}),A(()=>[$e.value,n.node.originalCode,n.node.updatedCode],()=>{xt.value+=1,Re()||(on.value+=1)});const Ke=m(()=>It());function Vt(){de.value&&Ae.value!==Ke.value&&(de.value=!1,Ae.value=null,bl=null,St=null,V.value=!1,_.value=!1,ge.value=!1,F.value=!1,nl.value=!1)}function Jn(){return Vt(),de.value&&Ae.value===Ke.value}function Oe(e=Ke.value){Ae.value=e,de.value=!0,nl.value=!1}return A(Ke,()=>D(null,null,function*(){if(Ue||!de.value||Ae.value===Ke.value||!ae||!h.value||me.value||p||!W.value||n.stream===!1&&n.loading!==!1||Yl())return;const e=Ke.value;Ue=!0;try{if(Vt(),de.value)return;yield He(h.value)}catch{_.value=!1,F.value=!1,Oe()}finally{St=e,yield O(),Ue=!1}})),A(()=>[n.codeBlockOptions,W.value],()=>{var e,l;if(Ze(),!ae||!W.value)return;const t=i.value?G():ie(),a=typeof((e=n.codeBlockOptions)==null?void 0:e.fontSize)=="number"?n.codeBlockOptions.fontSize:Number.isFinite(T.value)?T.value:void 0;typeof a=="number"&&Number.isFinite(a)&&a>0&&((l=t==null?void 0:t.updateOptions)==null||l.call(t,{fontSize:a})),le(!1)},{deep:!0}),A(()=>[ol(),tn.value,el.value,V.value,W.value],([e,l],t)=>{if(!el.value||!W.value)return;const a=t!=null&&Vn(e,t[0]),o=t!=null&&l!==t[1];_.value?(sl=!1,Wn({appearanceOnly:a})):a&&!o||(sl=!0)},{flush:"post"}),A(()=>[Gn.value,el.value,W.value],(e,l)=>D(null,[e,l],function*([t,a,o],[d]){if(Ze(),!a||!o||!ae||!h.value||!V.value||t===d)return;if(n.stream===!1&&n.loading!==!1)return void(Pl=!0);Pl=!1;const r=Be;if(r){try{yield r}catch{}if(p||!h.value)return}try{_.value=!1,F.value=!1,V.value=!1,ge.value=!1,Qe(),Xe(),We(),ml&&Mt(ml),yield O(),yield He(h.value,{allowStaleContentRetry:!1})}catch{_.value=!1,F.value=!1,Oe()}}),{flush:"post"}),A(()=>[n.loading,W.value],([e,l])=>{e===!1&&l&&Pl&&(Pl=!1,tt.value+=1)},{flush:"post"}),A(()=>[n.loading,W.value],(e,l)=>D(null,[e,l],function*([t,a],o){if(!a)return;const d=o==null?void 0:o[0];if(d===!1&&t!==!1&&i.value&&V.value&&(yield O(),se(()=>{D(null,null,function*(){const u=Be;if(u)try{yield u}catch{}!p&&i.value&&n.loading!==!1&&(Ze(),_l(),fe())})})),t)return;const r=d!==void 0&&d!==!1;yield O(),se(()=>{D(null,null,function*(){var u,v;try{if(r&&(yield(function(){return D(this,null,function*(){if(!de.value||!ae||!h.value||me.value||p||!W.value)return!1;if(St===Ke.value)return!0;Ue=!0;try{de.value=!1,Ae.value=null,bl=null,V.value=!1,_.value=!1,ge.value=!1,F.value=!1,Qe(),Xe(),We(),ml&&Mt(ml),yield O();try{yield He(h.value)}catch{_.value=!1,F.value=!1,Oe()}}finally{yield O(),Ue=!1}return!0})})()))return void le(!1);if(r&&i.value&&V.value&&Ct&&h.value)return Ct=!1,_.value=!1,F.value=!1,V.value=!1,ge.value=!1,Qe(),Xe(),We(),yield O(),yield He(h.value,{allowStaleContentRetry:!1}),void Le(!0);if(r&&V.value)if(i.value&&h.value){const s=Be;if(s)try{yield s}catch{}Ze();const c=kt(String((u=n.node.originalCode)!=null?u:""),String((v=n.node.updatedCode)!=null?v:""));if(yield Tn(c.original,c.updated,Me.value),p||!i.value)return;yield Promise.resolve(pt()),_l(),Y(!0),bn(),ye(),Sl();const g=yield Fn();p||!g||F.value||(yield wn()),fe(),Le(!0)}else Ln(),Rn($e.value,Me.value),yield new Promise(s=>{const c=()=>{p?s():Zl||Ye?setTimeout(c,16):s()};c()}),p||i.value||(yield Promise.resolve(ht()));r&&i.value?(le({preferModelDiffHeight:!0,holdCurrentDiffHeight:!0}),Le(!0)):le(!1)}catch{}})})}),{immediate:!0,flush:"post"}),ra(()=>{Qe(),Xe(),gt(),Ll==null||Ll()}),(e,l)=>{var t;return me.value?(ul(),rt(la,{key:0,style:nt(pn.value),node:dn.value,loading:n.loading,"show-line-numbers":H.value,"diff-inline":jl.value,"diff-hide-unchanged-regions":rn.value,"code-block-options":n.codeBlockOptions,"resolved-visual-options":$t.value,"reserved-height-px":i.value&&(t=Ge.value)!=null?t:void 0,"is-dark":n.isDark,theme:n.theme,"dark-theme":n.darkTheme,"light-theme":n.lightTheme,themes:n.themes,"show-header":n.showHeader,"show-copy-button":n.showCopyButton,"clipboard-writer":n.clipboardWriter,"show-tooltips":n.showTooltips,onCopy:l[0]||(l[0]=a=>k("copy",a))},Xn({_:2},[e.$slots["header-left"]?{name:"header-left",fn:il(()=>[$l(e.$slots,"header-left",{},void 0,!0)]),key:"0"}:void 0,e.$slots["header-right"]?{name:"header-right",fn:il(()=>[$l(e.$slots,"header-right",{},void 0,!0)]),key:"1"}:void 0]),1032,["style","node","loading","show-line-numbers","diff-inline","diff-hide-unchanged-regions","code-block-options","resolved-visual-options","reserved-height-px","is-dark","theme","dark-theme","light-theme","themes","show-header","show-copy-button","clipboard-writer","show-tooltips"])):(ul(),Yn("div",{key:1,ref_key:"container",ref:ne,style:nt(Fa.value),class:it(["code-block-container rounded-lg border",[{dark:n.isDark,"is-rendering":n.loading,"is-dark":nn.value,"is-diff":i.value,"is-plain-text":dt.value}]]),"data-markstream-code-block":"1","data-markstream-enhanced":F.value&&!me.value?"true":"false","data-markstream-enhancement-state":ba.value,"data-markstream-code-block-state":Re()?"streaming":"settled","data-markstream-pending":ya.value?"true":void 0,"data-markstream-viewport-pending":Yt.value&&ia(ct)&&!W.value?"true":void 0},[Qa(So,{"show-header":n.showHeader,"show-collapse-button":n.showCollapseButton,"show-font-size-buttons":n.showFontSizeButtons,"enable-font-size-control":n.enableFontSizeControl,"show-copy-button":n.showCopyButton,"show-expand-button":n.showExpandButton,"show-preview-button":n.showPreviewButton,"show-tooltips":n.showTooltips,"is-dark":n.isDark,loading:n.loading,stream:C.stream,"is-collapsed":pe.value,"is-expanded":De.value,"copy-text":ut.value,"is-previewable":qt.value,"code-font-size":T.value,"code-font-min":10,"code-font-max":36,"default-code-font-size":ue.value,"font-baseline-ready":ka.value,"diff-stats":i.value?hl.value:null,"diff-stats-aria-label":ha.value,onToggleCollapse:_a,onDecreaseFont:$a,onResetFont:Ha,onIncreaseFont:Pa,onCopy:za,onToggleExpand:La,onPreview:Ra},Xn({"header-left":il(()=>[$l(e.$slots,"header-left",{},()=>[U("div",_o,[U("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:Ea.value},null,8,Ro),U("div",jo,[U("div",qo,Gt(Na.value),1),qn.value?(ul(),Yn("div",Io,Gt(qn.value),1)):At("",!0)])])],!0)]),loading:il(()=>[$l(e.$slots,"loading",{loading:C.loading,stream:C.stream},()=>[l[1]||(l[1]=U("div",{class:"loading-skeleton"},[U("div",{class:"skeleton-line"}),U("div",{class:"skeleton-line"}),U("div",{class:"skeleton-line short"})],-1))],!0)]),default:il(()=>{var a;return[Xa(U("div",{class:it(["code-editor-layer",{"code-editor-layer--collapsed":pe.value}])},[U("div",{ref_key:"codeEditor",ref:h,class:it(["code-editor-container",C.stream?"":"code-height-placeholder"]),"data-markstream-host-hidden":ga.value?"true":void 0,style:nt(Ma.value)},null,14,Vo),sn.value?(ul(),rt(la,{key:0,style:nt(pn.value),node:dn.value,loading:n.loading,"show-line-numbers":H.value,"diff-inline":jl.value,"diff-hide-unchanged-regions":rn.value,"code-block-options":n.codeBlockOptions,"resolved-visual-options":$t.value,"reserved-height-px":i.value&&(a=Ge.value)!=null?a:void 0,"is-dark":n.isDark,theme:n.theme,"dark-theme":n.darkTheme,"light-theme":n.lightTheme,themes:n.themes,"show-toolbar":!1},null,8,["style","node","loading","show-line-numbers","diff-inline","diff-hide-unchanged-regions","code-block-options","resolved-visual-options","reserved-height-px","is-dark","theme","dark-theme","light-theme","themes"])):At("",!0)],2),[[Ya,!!C.stream||!C.loading]]),ql.value&&!Qt.value&&qt.value&&we.value==="html"?(ul(),rt(zo,{key:0,code:n.node.code,"html-preview-allow-scripts":n.htmlPreviewAllowScripts,"html-preview-sandbox":n.htmlPreviewSandbox,"is-dark":n.isDark,"on-close":()=>ql.value=!1},null,8,["code","html-preview-allow-scripts","html-preview-sandbox","is-dark","on-close"])):At("",!0)]}),_:2},[e.$slots["header-right"]?{name:"header-right",fn:il(()=>[$l(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,Lo))}}}),[["__scopeId","data-v-2c9e024e"]]);export{Qo as default};
43
+ ${v}`.trim(),r}function Ze(){const e=Gn();if(!Pe)return Pe=e,Pe;for(const l of Object.keys(Pe))l in e||delete Pe[l];return Object.assign(Pe,e),Pe}A(yl,(e,l)=>D(null,null,function*(){if(e===l||de.value||Ge||(Ln(),!ae||!h.value)||!V.value||n.stream===!1&&n.loading!==!1||!W.value)return;const t=Be;if(t){try{yield t}catch{}if(p||!h.value)return}if(an.value!==e||!V.value||!_.value)try{_.value=!1,F.value=!1,V.value=!1,ge.value=!1,Qe(),Xe(),We(),yield O(),yield He(h.value)}catch{_.value=!1,F.value=!1,Oe()}}));const tt=S(0),Un=m(()=>String(tt.value));let Pl=!1;function It(){var e;const l=ol();return JSON.stringify({kind:yl.value,language:Me.value,structural:Un.value,optionsRevision:tt.value,settledContentGeneration:on.value,theme:(e=lt(l))!=null?e:l==null?null:"custom",isDark:n.isDark})}A(()=>{var e;return(e=n.codeBlockOptions)==null?void 0:e.fontSize},e=>{const l=typeof e=="number"&&Number.isFinite(e)&&e>0?e:Bt;ue.value=l,T.value=l,Pt.value=null,Il.value=null,wl.value=null}),A(()=>[n.codeBlockOptions,n.showLineNumbers],()=>{tt.value+=1,n.stream===!1&&n.loading!==!1&&(Pl=!0)},{deep:!0}),A(()=>[$e.value,n.node.originalCode,n.node.updatedCode],()=>{xt.value+=1,Re()||(on.value+=1)});const Ke=m(()=>It());function Vt(){de.value&&Ae.value!==Ke.value&&(de.value=!1,Ae.value=null,bl=null,St=null,V.value=!1,_.value=!1,ge.value=!1,F.value=!1,nl.value=!1)}function Jn(){return Vt(),de.value&&Ae.value===Ke.value}function Oe(e=Ke.value){Ae.value=e,de.value=!0,nl.value=!1}return A(Ke,()=>D(null,null,function*(){if(Ge||!de.value||Ae.value===Ke.value||!ae||!h.value||me.value||p||!W.value||n.stream===!1&&n.loading!==!1||Yl())return;const e=Ke.value;Ge=!0;try{if(Vt(),de.value)return;yield He(h.value)}catch{_.value=!1,F.value=!1,Oe()}finally{St=e,yield O(),Ge=!1}})),A(()=>[n.codeBlockOptions,W.value],()=>{var e,l;if(Ze(),!ae||!W.value)return;const t=i.value?U():ie(),a=typeof((e=n.codeBlockOptions)==null?void 0:e.fontSize)=="number"?n.codeBlockOptions.fontSize:Number.isFinite(T.value)?T.value:void 0;typeof a=="number"&&Number.isFinite(a)&&a>0&&((l=t==null?void 0:t.updateOptions)==null||l.call(t,{fontSize:a})),le(!1)},{deep:!0}),A(()=>[ol(),tn.value,el.value,V.value,W.value],([e,l],t)=>{if(!el.value||!W.value)return;const a=t!=null&&Vn(e,t[0]),o=t!=null&&l!==t[1];_.value?(sl=!1,Wn({appearanceOnly:a})):a&&!o||(sl=!0)},{flush:"post"}),A(()=>[Un.value,el.value,W.value],(e,l)=>D(null,[e,l],function*([t,a,o],[d]){if(Ze(),!a||!o||!ae||!h.value||!V.value||t===d)return;if(n.stream===!1&&n.loading!==!1)return void(Pl=!0);Pl=!1;const r=Be;if(r){try{yield r}catch{}if(p||!h.value)return}try{_.value=!1,F.value=!1,V.value=!1,ge.value=!1,Qe(),Xe(),We(),ml&&Mt(ml),yield O(),yield He(h.value,{allowStaleContentRetry:!1})}catch{_.value=!1,F.value=!1,Oe()}}),{flush:"post"}),A(()=>[n.loading,W.value],([e,l])=>{e===!1&&l&&Pl&&(Pl=!1,tt.value+=1)},{flush:"post"}),A(()=>[n.loading,W.value],(e,l)=>D(null,[e,l],function*([t,a],o){if(!a)return;const d=o==null?void 0:o[0];if(d===!1&&t!==!1&&i.value&&V.value&&(yield O(),se(()=>{D(null,null,function*(){const u=Be;if(u)try{yield u}catch{}!p&&i.value&&n.loading!==!1&&(Ze(),_l(),fe())})})),t)return;const r=d!==void 0&&d!==!1;yield O(),se(()=>{D(null,null,function*(){var u,v;try{if(r&&(yield(function(){return D(this,null,function*(){if(!de.value||!ae||!h.value||me.value||p||!W.value)return!1;if(St===Ke.value)return!0;Ge=!0;try{de.value=!1,Ae.value=null,bl=null,V.value=!1,_.value=!1,ge.value=!1,F.value=!1,Qe(),Xe(),We(),ml&&Mt(ml),yield O();try{yield He(h.value)}catch{_.value=!1,F.value=!1,Oe()}}finally{yield O(),Ge=!1}return!0})})()))return void le(!1);if(r&&i.value&&V.value&&Ct&&h.value)return Ct=!1,_.value=!1,F.value=!1,V.value=!1,ge.value=!1,Qe(),Xe(),We(),yield O(),yield He(h.value,{allowStaleContentRetry:!1}),void Le(!0);if(r&&V.value)if(i.value&&h.value){const s=Be;if(s)try{yield s}catch{}Ze();const c=kt(String((u=n.node.originalCode)!=null?u:""),String((v=n.node.updatedCode)!=null?v:""));if(yield Tn(c.original,c.updated,Me.value),p||!i.value)return;yield Promise.resolve(pt()),_l(),Y(!0),bn(),ye(),Sl();const g=yield Fn();p||!g||F.value||(yield wn()),fe(),Le(!0)}else Ln(),Rn($e.value,Me.value),yield new Promise(s=>{const c=()=>{p?s():Zl||Ye?setTimeout(c,16):s()};c()}),p||i.value||(yield Promise.resolve(ht()));r&&i.value?(le({preferModelDiffHeight:!0,holdCurrentDiffHeight:!0}),Le(!0)):le(!1)}catch{}})})}),{immediate:!0,flush:"post"}),ra(()=>{Qe(),Xe(),gt(),Ll==null||Ll()}),(e,l)=>{var t;return me.value?(ul(),rt(la,{key:0,style:nt(pn.value),node:dn.value,loading:n.loading,"show-line-numbers":H.value,"diff-inline":jl.value,"diff-hide-unchanged-regions":rn.value,"code-block-options":n.codeBlockOptions,"resolved-visual-options":$t.value,"reserved-height-px":i.value&&(t=Ue.value)!=null?t:void 0,"is-dark":n.isDark,theme:n.theme,"dark-theme":n.darkTheme,"light-theme":n.lightTheme,themes:n.themes,"show-header":n.showHeader,"show-copy-button":n.showCopyButton,"clipboard-writer":n.clipboardWriter,"show-tooltips":n.showTooltips,onCopy:l[0]||(l[0]=a=>k("copy",a))},Xn({_:2},[e.$slots["header-left"]?{name:"header-left",fn:il(()=>[$l(e.$slots,"header-left",{},void 0,!0)]),key:"0"}:void 0,e.$slots["header-right"]?{name:"header-right",fn:il(()=>[$l(e.$slots,"header-right",{},void 0,!0)]),key:"1"}:void 0]),1032,["style","node","loading","show-line-numbers","diff-inline","diff-hide-unchanged-regions","code-block-options","resolved-visual-options","reserved-height-px","is-dark","theme","dark-theme","light-theme","themes","show-header","show-copy-button","clipboard-writer","show-tooltips"])):(ul(),Yn("div",{key:1,ref_key:"container",ref:ne,style:nt(Fa.value),class:it(["code-block-container rounded-lg border",[{dark:n.isDark,"is-rendering":n.loading,"is-dark":nn.value,"is-diff":i.value,"is-plain-text":dt.value}]]),"data-markstream-code-block":"1","data-markstream-enhanced":F.value&&!me.value?"true":"false","data-markstream-enhancement-state":ba.value,"data-markstream-code-block-state":Re()?"streaming":"settled","data-markstream-pending":ya.value?"true":void 0,"data-markstream-viewport-pending":Yt.value&&ia(ct)&&!W.value?"true":void 0},[Qa(So,{"show-header":n.showHeader,"show-collapse-button":n.showCollapseButton,"show-font-size-buttons":n.showFontSizeButtons,"enable-font-size-control":n.enableFontSizeControl,"show-copy-button":n.showCopyButton,"show-expand-button":n.showExpandButton,"show-preview-button":n.showPreviewButton,"show-tooltips":n.showTooltips,"is-dark":n.isDark,loading:n.loading,stream:C.stream,"is-collapsed":pe.value,"is-expanded":De.value,"copy-text":ut.value,"is-previewable":qt.value,"code-font-size":T.value,"code-font-min":10,"code-font-max":36,"default-code-font-size":ue.value,"font-baseline-ready":ka.value,"diff-stats":i.value?hl.value:null,"diff-stats-aria-label":ha.value,onToggleCollapse:_a,onDecreaseFont:$a,onResetFont:Ha,onIncreaseFont:Pa,onCopy:za,onToggleExpand:La,onPreview:Ra},Xn({"header-left":il(()=>[$l(e.$slots,"header-left",{},()=>[G("div",_o,[G("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:Ea.value},null,8,Ro),G("div",jo,[G("div",qo,Ut(Na.value),1),qn.value?(ul(),Yn("div",Io,Ut(qn.value),1)):At("",!0)])])],!0)]),loading:il(()=>[$l(e.$slots,"loading",{loading:C.loading,stream:C.stream},()=>[l[1]||(l[1]=G("div",{class:"loading-skeleton"},[G("div",{class:"skeleton-line"}),G("div",{class:"skeleton-line"}),G("div",{class:"skeleton-line short"})],-1))],!0)]),default:il(()=>{var a;return[Xa(G("div",{class:it(["code-editor-layer",{"code-editor-layer--collapsed":pe.value}])},[G("div",{ref_key:"codeEditor",ref:h,class:it(["code-editor-container",C.stream?"":"code-height-placeholder"]),"data-markstream-host-hidden":ga.value?"true":void 0,style:nt(Ma.value)},null,14,Vo),sn.value?(ul(),rt(la,{key:0,style:nt(pn.value),node:dn.value,loading:n.loading,"show-line-numbers":H.value,"diff-inline":jl.value,"diff-hide-unchanged-regions":rn.value,"code-block-options":n.codeBlockOptions,"resolved-visual-options":$t.value,"reserved-height-px":i.value&&(a=Ue.value)!=null?a:void 0,"is-dark":n.isDark,theme:n.theme,"dark-theme":n.darkTheme,"light-theme":n.lightTheme,themes:n.themes,"show-toolbar":!1},null,8,["style","node","loading","show-line-numbers","diff-inline","diff-hide-unchanged-regions","code-block-options","resolved-visual-options","reserved-height-px","is-dark","theme","dark-theme","light-theme","themes"])):At("",!0)],2),[[Ya,!!C.stream||!C.loading]]),ql.value&&!Qt.value&&qt.value&&we.value==="html"?(ul(),rt(zo,{key:0,code:n.node.code,"html-preview-allow-scripts":n.htmlPreviewAllowScripts,"html-preview-sandbox":n.htmlPreviewSandbox,"is-dark":n.isDark,"on-close":()=>ql.value=!1},null,8,["code","html-preview-allow-scripts","html-preview-sandbox","is-dark","on-close"])):At("",!0)]}),_:2},[e.$slots["header-right"]?{name:"header-right",fn:il(()=>[$l(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,Lo))}}}),[["__scopeId","data-v-2c9e024e"]]);export{Qo as default};
@@ -0,0 +1 @@
1
+ dl div[data-v-c78a2caa]{display:grid;grid-template-columns:minmax(120px,1fr) 2fr;gap:var(--space-3);margin-block:var(--space-3)}dd[data-v-c78a2caa]{margin:0;overflow-wrap:anywhere}dt[data-v-c78a2caa]{color:var(--muted-foreground)}.recording-toggle[data-v-c78a2caa]{display:flex;align-items:center;gap:var(--space-2)}.feature-list[data-v-c78a2caa]{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:var(--space-2);padding:0;list-style:none;font-size:var(--text-sm)}
@@ -0,0 +1 @@
1
+ import{d as N,x as O,c as v,e,t,u as s,j as q,F as T,a as w,B as F,l as k,L as U,b as z,C as G,E as B,r as i,z as I,o as p}from"./vendor-vue-CncuOShJ.js";import{u as E}from"./settings-general-dc8P6dA0.js";import{u as j,F as P,G as D,k as A}from"./index-CenMTLFY.js";import{_ as $}from"./GeneralSettingsStatus.vue_vue_type_script_setup_true_lang-CWInOGTv.js";import{b as H,r as J,m as M}from"./context-Grqd_9Lt.js";const K={class:"settings-page"},Q={"data-route-heading":"",tabindex:"-1"},W={class:"settings-card"},X=["disabled"],Y={class:"recording-toggle"},Z=["disabled"],ee={class:"ui-banner settings-banner","data-tone":"warning"},te={class:"settings-actions"},se=["disabled"],oe={class:"settings-card"},ae={class:"settings-card"},ne={class:"feature-list"},le={key:0},re=N({__name:"DiagnosticsSettings",setup(ie){const o=E(),a=j(),g=i(),y=i(),n=i(!1),h=i(""),b=i(""),l=i(),d=i(!1),f=i(!1),u=I(()=>l.value!==void 0&&d.value!==l.value.enabled);H(u);const S=I(()=>{var r;return((r=a.hello)==null?void 0:r.features.filter(c=>c.toLocaleLowerCase().includes(b.value.toLocaleLowerCase())).sort())??[]});async function _(){if(!n.value&&!(u.value&&!window.confirm(o("Discard unsaved recording settings?","放弃未保存的录制设置?")))){n.value=!0,h.value="",f.value=!1;try{const r=performance.now();g.value=await a.client.call("daemon.ping",{},P),y.value=Math.round(performance.now()-r),a.supports("settings.read")&&(l.value=await a.client.call("settings.read",{source:"model-log",scope:"user"},D),d.value=l.value.enabled)}catch(r){h.value=M(r)}finally{n.value=!1}}}async function V(){if(!(!l.value||!u.value||n.value)&&!(d.value&&!window.confirm(o("Record model requests and responses? Recordings include prompts, source code and tool output. Custom headers may contain secrets. The file has no automatic rotation.","录制模型请求和响应?录制包含提示词、源代码和工具输出。自定义请求头可能包含机密。文件不会自动轮换。")))){n.value=!0,h.value="",f.value=!1;try{l.value=await a.client.call("settings.update",{source:"model-log",scope:"user",expectedRevision:l.value.revision,document:{enabled:d.value}},D),d.value=l.value.enabled,f.value=!0}catch(r){h.value=M(r)}finally{n.value=!1}}}return J(a,_,u),O(_),(r,c)=>{var x,R,C,L;return p(),v("article",K,[e("header",null,[e("h2",Q,t(s(o)("Diagnostics","诊断")),1),e("p",null,t(s(o)("Live connection and server information. This page never displays credentials or bootstrap tokens.","实时连接和服务器信息。此页面不会显示凭据或引导令牌。")),1)]),q($,{busy:n.value,error:h.value,saved:f.value&&!u.value,onReload:_},null,8,["busy","error","saved"]),e("dl",W,[e("div",null,[e("dt",null,t(s(o)("Server version","服务器版本")),1),e("dd",null,t(((x=s(a).hello)==null?void 0:x.serverVersion)??"—"),1)]),e("div",null,[e("dt",null,t(s(o)("Protocol","协议")),1),e("dd",null,t(((R=s(a).hello)==null?void 0:R.protocolVersion)??"—"),1)]),e("div",null,[e("dt",null,t(s(o)("Instance","实例")),1),e("dd",null,[e("code",null,t(((C=s(a).hello)==null?void 0:C.instanceId)??"—"),1)])]),e("div",null,[e("dt",null,t(s(o)("Connection","连接")),1),e("dd",null,t(s(a).phase),1)]),g.value?(p(),v(T,{key:0},[e("div",null,[e("dt",null,t(s(o)("Sessions","会话")),1),e("dd",null,t(g.value.sessions),1)]),e("div",null,[e("dt",null,t(s(o)("Connections","连接数")),1),e("dd",null,t(g.value.connections),1)]),e("div",null,[e("dt",null,t(s(o)("Round trip","往返延迟")),1),e("dd",null,t(y.value)+" ms",1)])],64)):w("",!0)]),e("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:n.value,onClick:_},t(s(o)("Refresh diagnostics","刷新诊断")),9,X),l.value?(p(),v("form",{key:0,class:"settings-card settings-form",onSubmit:F(V,["prevent"])},[e("h3",null,t(s(o)("Model request recording","模型请求录制")),1),e("p",null,t(s(o)("Changes apply to new model requests without restarting. In-flight requests finish with their existing recorder. Records are written to model-log/recordings.jsonl in the daemon execution home.","更改适用于新模型请求,无需重启。正在进行的请求继续使用原录制器。记录写入守护进程执行目录中的 model-log/recordings.jsonl。")),1),e("label",Y,[k(e("input",{"onUpdate:modelValue":c[0]||(c[0]=m=>d.value=m),type:"checkbox",disabled:n.value||!s(a).supports("settings.update")},null,8,Z),[[U,d.value]]),z(t(s(o)("Record model requests and responses","录制模型请求和响应")),1)]),e("p",ee,t(s(o)("Recordings contain prompts, code and tool output. Custom headers may contain secrets. Files are private but have no automatic size limit or rotation.","录制包含提示词、代码和工具输出。自定义请求头可能包含机密。文件为私有文件,但没有自动大小限制或轮换。")),1),e("div",te,[e("button",{class:"ui-button","data-size":"md","data-variant":"primary",disabled:n.value||!u.value||!s(a).supports("settings.update")},t(s(o)("Save recording settings","保存录制设置")),9,se)])],32)):w("",!0),e("section",oe,[e("h3",null,t(s(o)("Process logs","进程日志")),1),e("p",null,t(s(o)("The daemon writes runtime output to the private daemon.log in its native home when the CLI starts it, and to stderr when it is started directly; the file appends across starts. RUST_LOG sets the filter and is read when the daemon starts, and with it unset the daemon keeps errors only.","CLI 启动守护进程时,运行时输出写入其本机目录中的私有 daemon.log;直接启动时写入 stderr,该文件跨多次启动追加。RUST_LOG 设置过滤条件,在守护进程启动时读取;未设置时只保留错误。")),1),e("p",null,t(s(o)("This page has no log-mode control. To raise logging, run dimcode daemon stop, then start the daemon from a terminal with the filter set, for example RUST_LOG=debug dimcode.","本页没有日志模式开关。要提高日志级别,先运行 dimcode daemon stop,再从终端带过滤条件启动守护进程,例如 RUST_LOG=debug dimcode。")),1),e("p",null,t(s(o)("The complete record of what a run committed is dimcode export SESSION_ID; read it with daemon.log. Model request recording above is a separate opt-in record of model wire exchanges, not a process-log switch.","一次运行提交内容的完整记录是 dimcode export SESSION_ID,与 daemon.log 一起阅读。上方的模型请求录制是独立的、需主动启用的模型请求线路记录,不是进程日志开关。")),1)]),e("section",ae,[e("h3",null,t(s(o)("Advertised methods","已声明的方法"))+" ("+t(((L=s(a).hello)==null?void 0:L.features.length)??0)+")",1),e("label",null,[e("span",null,t(s(o)("Filter methods","筛选方法")),1),k(e("input",{"onUpdate:modelValue":c[1]||(c[1]=m=>b.value=m),class:"ui-field","data-size":"md",type:"search"},null,512),[[G,b.value]])]),e("ul",ne,[(p(!0),v(T,null,B(S.value,m=>(p(),v("li",{key:m},[e("code",null,t(m),1)]))),128))]),S.value.length?w("",!0):(p(),v("p",le,t(s(o)("No matching methods.","没有匹配的方法。")),1))])])}}}),pe=A(re,[["__scopeId","data-v-c78a2caa"]]);export{pe as default};
@@ -0,0 +1 @@
1
+ import{u}from"./settings-general-dc8P6dA0.js";import{d as l,c as t,F as c,t as s,u as o,a as r,b,e as m,o as a}from"./vendor-vue-CncuOShJ.js";const y={key:0,class:"ui-banner settings-banner",role:"status"},g={key:1,class:"ui-banner settings-banner","data-tone":"danger",role:"alert"},k=["disabled"],f={key:2,class:"ui-banner settings-banner","data-tone":"success",role:"status"},S=l({__name:"GeneralSettingsStatus",props:{busy:{type:Boolean},error:{},saved:{type:Boolean}},emits:["reload"],setup(e){const n=u();return(d,i)=>(a(),t(c,null,[e.busy?(a(),t("p",y,s(o(n)("Working…","正在处理…")),1)):r("",!0),e.error?(a(),t("p",g,[b(s(e.error)+" ",1),m("button",{class:"ui-button","data-size":"sm","data-variant":"secondary",type:"button",disabled:e.busy,onClick:i[0]||(i[0]=p=>d.$emit("reload"))},s(o(n)("Reload","重新加载")),9,k)])):r("",!0),e.saved&&!e.error?(a(),t("p",f,s(o(n)("Saved","已保存")),1)):r("",!0)],64))}});export{S as _};
@@ -0,0 +1 @@
1
+ fieldset[data-v-56366ac6]{display:grid;gap:var(--space-4);min-width:0;padding:0;border:0}label[data-v-56366ac6]{display:grid;gap:var(--space-2)}.checkbox-label[data-v-56366ac6],.argument-row[data-v-56366ac6]{display:flex;align-items:center;gap:var(--space-2)}.argument-row[data-v-56366ac6]{margin-block:var(--space-2)}.argument-row input[data-v-56366ac6]{flex:1;min-width:0}.secret-row[data-v-56366ac6]{display:grid;grid-template-columns:1fr auto 1fr auto;gap:var(--space-2);margin-block:var(--space-3)}.search-label[data-v-56366ac6]{margin-block:var(--space-4)}.runtime-detail[data-v-56366ac6]{border-top:1px solid var(--border);padding-top:var(--space-3)}code[data-v-56366ac6],li p[data-v-56366ac6]{overflow-wrap:anywhere}@media(max-width:700px){.secret-row[data-v-56366ac6]{grid-template-columns:1fr 1fr}}
@@ -0,0 +1 @@
1
+ import{d as _e,w as we,x as Ce,g as Ue,c as u,e as n,t,u as a,l as y,C as U,B as Y,j as Ae,F as w,E as D,b as P,a as v,D as j,L as de,r as A,z as $,o as r}from"./vendor-vue-CncuOShJ.js";import{u as Se}from"./settings-general-dc8P6dA0.js";import{u as ze,l as ce,m as Ie,n as Me,i as E,o as ve,p as Pe,k as Ve}from"./index-CenMTLFY.js";import{_ as Re}from"./GeneralSettingsStatus.vue_vue_type_script_setup_true_lang-CWInOGTv.js";import{b as Te,r as xe,m as x}from"./context-Grqd_9Lt.js";const De={class:"settings-page"},je=["disabled"],Ee={class:"settings-actions"},Oe=["disabled"],Le=["disabled"],Ne={key:0,class:"settings-card settings-form","aria-live":"polite"},$e={key:0},qe={key:2,role:"status"},Be={key:0},Fe={key:0},Ke={key:1},We={key:2},He={key:3},Je=["disabled"],Ge={class:"settings-actions"},Qe=["disabled"],Xe=["disabled"],Ye=["disabled"],Ze={key:0,class:"ui-banner settings-banner","data-tone":"warning"},et=["disabled"],tt=["disabled"],at=["disabled"],nt=["disabled"],ot={value:"user"},st={key:0,value:"project"},lt={key:0},it=["disabled"],ut={key:0},rt={value:"keep"},dt={value:"replace"},ct={key:1},vt=["onUpdate:modelValue","aria-label"],pt=["onClick"],mt={key:0},bt={key:1},ht=["required"],ft={class:"checkbox-label"},yt=["disabled"],gt={key:0},kt={key:3},_t={value:"keep"},wt={value:"set"},Ct={value:"remove"},Ut={key:4,class:"settings-form"},At={key:0},St={value:"keep"},zt={value:"set"},It={value:"remove"},Mt={key:1},Pt=["required"],Vt={key:3},Rt={value:"keep"},Tt=["disabled"],xt={value:"remove"},Dt={key:0},jt={key:4},Et=["onUpdate:modelValue","aria-label","readonly"],Ot=["onUpdate:modelValue","aria-label"],Lt={key:0,value:"keep"},Nt={value:"set"},$t={key:1,value:"remove"},qt=["onUpdate:modelValue","aria-label"],Bt=["onClick"],Ft={key:5,class:"checkbox-label"},Kt={key:6},Wt={key:7},Ht={class:"settings-actions"},Jt=["disabled"],Gt=["disabled"],Qt={key:2,class:"settings-card",role:"status"},Xt={key:0},Yt={key:1},Zt={key:2},ea={key:3},ta={key:0},aa={key:5},na={key:6},oa={key:0},sa={key:7},la={key:3,class:"settings-card"},ia=["href"],ua=["disabled"],ra={class:"settings-actions"},da=["disabled"],ca=["disabled"],va={class:"search-label"},pa={class:"settings-actions"},ma=["disabled","onClick"],ba=["disabled","onClick"],ha=["disabled","onClick"],fa=["disabled","onClick"],ya=["disabled","onClick"],ga=["disabled","onClick"],ka=["disabled","onClick"],_a=["disabled","onClick"],wa=["disabled","onClick"],Ca={key:0},Ua={key:4,role:"status"},Aa=_e({__name:"McpSettings",setup(Sa){const e=Se(),b=ze(),z=A(),W=A(""),O=A(""),c=A(!1),_=A(""),i=A(),H=A(""),h=A(!1),J=A(""),I=A(),Z=A(""),R=A(""),V=A(""),m=A(),g=A(),ee=A(),G=A("");let te=!0;const T=$(()=>i.value!==void 0&&JSON.stringify(i.value)!==H.value),pe=$(()=>i.value!==void 0&&(h.value?i.value.oauthAction==="set"||i.value.oauthAction==="keep"&&i.value.oauth:i.value.oauth)),ae=$(()=>i.value!==void 0&&i.value.secretsInUserScope&&i.value.authConfigured),ne=$(()=>{var o;return((o=z.value)==null?void 0:o.servers.filter(s=>s.id.toLocaleLowerCase().includes(G.value.toLocaleLowerCase())))??[]});Te($(()=>T.value||!!V.value||!!R.value)),we(i,()=>{g.value=void 0},{deep:!0});function me(o){switch(o){case"timeout":return e("The server did not answer before the deadline.","服务器在时限内未响应。");case"response":return e("The server answered something Dim cannot use.","服务器的返回无法被 Dim 使用。");case"cleanup":return e("The temporary connection did not close cleanly.","临时连接未能正常关闭。");default:return e("The connection or a request failed.","连接或请求失败。")}}function L(){return O.value?{cwd:O.value}:{}}function q(o){return{...L(),id:o.id,source:o.source}}function Q(o){var p,d;const s=o==="user"?(p=z.value)==null?void 0:p.userRevision:(d=z.value)==null?void 0:d.projectRevision;if(s===void 0)throw new Error(e("Load the project catalog before editing it.","编辑项目前请先加载项目目录。"));return s}async function B(){z.value=await b.client.call("mcp.catalog",L(),ve)}async function F(){var s;if(!m.value)return;const o=(s=z.value)==null?void 0:s.servers.find(p=>{var d;return p.id===((d=m.value)==null?void 0:d.server.id)&&p.source===m.value.server.source});if(!o){m.value=void 0;return}m.value={server:o,inspection:await b.client.call("mcp.inspect",q(o),ce)}}async function oe(o){if(!c.value&&!(V.value&&!window.confirm(e("Discard the entered OAuth client secret?","放弃已输入的 OAuth 客户端密钥?")))){c.value=!0,_.value="";try{m.value={server:o,inspection:await b.client.call("mcp.inspect",q(o),ce)},V.value=""}catch(s){_.value=x(s)}finally{c.value=!1}}}async function K(){if(!c.value&&!(T.value&&!window.confirm(e("Discard unsaved MCP configuration?","放弃未保存的 MCP 配置?")))){c.value=!0,_.value="";try{if(!b.supports("mcp.catalog"))throw new Error(e("MCP management is not available on this server.","此服务器不支持 MCP 管理。"));const o=W.value.trim(),s=await b.client.call("mcp.catalog",o?{cwd:o}:{},ve);O.value=o,z.value=s,i.value=void 0,m.value=void 0,V.value="",g.value=void 0}catch(o){_.value=x(o)}finally{c.value=!1}}}function be(){T.value&&!window.confirm(e("Discard unsaved MCP configuration?","放弃未保存的 MCP 配置?"))||(i.value={id:"",source:"user",type:"stdio",command:"",args:[],argsAction:"replace",storedArgsCount:0,cwd:"",url:"",secrets:[],enabled:!1,oauth:!1,clientId:"",token:"",bearerAction:"keep",authConfigured:!1,oauthAction:"keep",callbackPort:"",scopes:"",metadataUrl:"",metadataConfigured:!1,metadataAction:"keep",secretsInUserScope:!1},H.value=JSON.stringify(i.value),h.value=!1,J.value=Q("user"))}async function he(o){var s,p,d,S;if(!(o.source==="plugin"||c.value)&&!(T.value&&!window.confirm(e("Discard unsaved MCP configuration?","放弃未保存的 MCP 配置?")))){c.value=!0,_.value="";try{const M=await b.client.call("mcp.configuration",q(o),Pe);if(M.revision===void 0)throw new Error(e("This entry has no source revision and cannot be edited.","此条目没有源修订号,无法编辑。"));const f=M.configuration;i.value={id:o.id,source:o.source,type:f.type,command:f.type==="stdio"?f.command:"",args:[],argsAction:"keep",storedArgsCount:f.type==="stdio"?f.argsCount:0,cwd:f.type==="stdio"?f.cwd??"":"",url:"",...f.type!=="stdio"?{endpoint:f.endpoint}:{},secrets:(f.type==="stdio"?f.envNames:f.headerNames).map(l=>({name:l,action:"keep",value:"",stored:!0})),enabled:M.enabled,oauth:f.type!=="stdio"&&f.oauthConfigured,authConfigured:f.type!=="stdio"&&f.authConfigured,clientId:f.type!=="stdio"?((s=f.oauth)==null?void 0:s.clientId)??"":"",callbackPort:f.type!=="stdio"?String(((p=f.oauth)==null?void 0:p.callbackPort)??""):"",scopes:f.type!=="stdio"?((d=f.oauth)==null?void 0:d.scopes)??"":"",metadataConfigured:f.type!=="stdio"&&(((S=f.oauth)==null?void 0:S.metadataConfigured)??!1),metadataUrl:"",metadataAction:"keep",token:"",bearerAction:"keep",oauthAction:"keep",secretsInUserScope:M.secretsInUserScope},h.value=!0,J.value=M.revision,H.value=JSON.stringify(i.value)}catch(M){_.value=x(M)}finally{c.value=!1}}}function fe(){T.value&&!window.confirm(e("Discard unsaved MCP configuration?","放弃未保存的 MCP 配置?"))||(i.value=void 0)}function se(o){const s=Object.fromEntries(o.secrets.filter(S=>S.action==="set").map(S=>[S.name.trim(),S.value])),p=o.source==="user"&&o.enabled;if(o.type==="stdio")return{type:"stdio",command:o.command,args:o.args,...o.cwd?{cwd:o.cwd}:{},env:s,enabled:p};const d={...o.clientId.trim()?{clientId:o.clientId.trim()}:{},...o.callbackPort?{callbackPort:Number(o.callbackPort)}:{},...o.scopes.trim()?{scopes:o.scopes.trim()}:{},...o.metadataUrl.trim()?{authServerMetadataUrl:o.metadataUrl.trim()}:{}};return{type:o.type,url:o.url.trim(),headers:s,enabled:p,...o.token?{auth:{type:"bearer",token:o.token}}:{},...o.oauth?{oauth:d}:{}}}function le(o){if(o.secretsInUserScope){if(o.type==="stdio")return{command:o.command,cwd:o.cwd};const d={};return o.oauthAction==="remove"&&(d.oauth={action:"remove"}),o.oauthAction==="set"&&(d.oauth={action:"set",clientId:o.clientId.trim()||null,callbackPort:o.callbackPort?Number(o.callbackPort):null,scopes:o.scopes.trim()||null}),d}const s=Object.fromEntries(o.secrets.filter(d=>d.action!=="keep").map(d=>[d.name.trim(),d.action==="remove"?null:d.value]));if(o.type==="stdio")return{command:o.command,...o.argsAction==="replace"?{args:o.args}:{},cwd:o.cwd,env:s};const p={...o.url.trim()?{url:o.url.trim()}:{},headers:s};return o.bearerAction!=="keep"&&(p.bearer=o.bearerAction==="remove"?{action:"remove"}:{action:"set",token:o.token}),o.oauthAction==="remove"&&(p.oauth={action:"remove"}),o.oauthAction==="set"&&(p.oauth={action:"set",clientId:o.clientId.trim()||null,callbackPort:o.callbackPort?Number(o.callbackPort):null,scopes:o.scopes.trim()||null,...o.metadataAction==="remove"?{authServerMetadataUrl:null}:o.metadataAction==="set"?{authServerMetadataUrl:o.metadataUrl.trim()}:{}}),p}function ie(o){var p;const s=o.secrets.map(d=>d.name.trim());return s.some(d=>!d)||new Set(s).size!==s.length?(_.value=e("Secret field names must be nonempty and unique.","机密字段名称不能为空且必须唯一。"),!1):((p=ee.value)==null?void 0:p.reportValidity())??!1}async function ye(){var s;const o=i.value;if(!(!o||c.value||!T.value)&&(_.value="",!!ie(o))){if(!h.value&&((s=z.value)!=null&&s.servers.some(p=>p.id===o.id.trim()))){_.value=e("This ID already exists in the effective catalog. Edit the existing entry instead.","此 ID 已存在于有效目录中。请编辑现有条目。");return}if(!(!h.value&&o.source==="user"&&o.enabled&&!window.confirm(e("Enabling this server permits its configured command or network connection to run. Continue?","启用此服务器将允许运行其配置命令或网络连接。是否继续?")))){c.value=!0;try{h.value?await b.client.call("mcp.update",{...L(),id:o.id,source:o.source,expectedVersion:J.value,patch:le(o)},E):await b.client.call("mcp.save",{...L(),id:o.id.trim(),source:o.source,expectedVersion:Q(o.source),configuration:se(o)},E),i.value=void 0,await B(),await F()}catch(p){_.value=x(p)}finally{c.value=!1}}}}async function X(o){if(c.value)return;_.value="";let s,p;if(o)s=q(o),p=o.id;else{const d=i.value;if(!d||!ie(d))return;s={...L(),id:d.id.trim(),source:d.source,...h.value?{patch:le(d)}:{configuration:se(d)}},p=d.id}if(window.confirm(e("Open a temporary connection and list tools? This executes the configured command or contacts its endpoint. No configuration is saved and the connection is closed after the test.","打开临时连接并列出工具?这会执行配置的命令或连接端点。测试不会保存设置,且会在结束后关闭连接。"))){c.value=!0,g.value=void 0;try{const d=await b.client.call("mcp.test",s,Ie);g.value={id:p,probe:d},await B(),await F()}catch(d){_.value=x(d)}finally{c.value=!1}}}async function N(o,s){var p;if(!c.value&&!(o==="mcp.remove"&&!window.confirm(e("Remove this server configuration?","移除此服务器配置?")))&&!(o==="mcp.set_enabled"&&!s.enabled&&!window.confirm(e("Enabling this server permits its configured command or network connection to run. Continue?","启用此服务器将允许运行其配置命令或网络连接。是否继续?")))){c.value=!0,_.value="";try{const d=q(s);if(o==="mcp.set_enabled"||o==="mcp.remove"){if(s.source==="plugin")return;d.expectedVersion=Q(s.source),o==="mcp.set_enabled"&&(d.enabled=!s.enabled)}if(o==="mcp.auth.start"){((p=m.value)==null?void 0:p.server.id)===s.id&&m.value.server.source===s.source&&V.value&&(d.clientSecret=V.value);const S=await b.client.call(o,d,Me);if(!te){await b.client.call("mcp.auth.cancel",{attemptId:S.attemptId},E);return}I.value=S,Z.value=s.id}else await b.client.call(o,d,E);await B(),await F()}catch(d){_.value=x(d)}finally{o==="mcp.auth.start"&&(V.value=""),c.value=!1}}}async function ue(o){var k,C;if(c.value||o.source==="plugin"||!b.supports("mcp.move"))return;const s=o.source==="user"?"user":"project",p=s==="user"?"project":"user";if(p==="project"&&!O.value){_.value=e("Load a project directory before moving a server into it.","移入项目前请先加载项目目录。");return}if(T.value&&!window.confirm(e("Discard unsaved MCP configuration?","放弃未保存的 MCP 配置?")))return;const d=p==="project"?e("Move this server to the project? Withheld values stay in your local Dim configuration, the workspace file gets only the public configuration, and the entry starts disabled.","将此服务器移入项目?隐藏值保留在本地 Dim 配置中,工作区文件只包含公开配置,且条目默认禁用。"):e("Move this server to user scope? It keeps its current enabled state and its withheld values move to your local configuration.","将此服务器移入用户范围?它会保留当前启用状态,隐藏值会移至本地配置。");if(!window.confirm(d))return;const S=(k=z.value)==null?void 0:k.userRevision,M=(C=z.value)==null?void 0:C.projectRevision,f=s==="user"?S:M,l=p==="user"?S:M;if(f===void 0||l===void 0){_.value=e("Load the catalog before moving this server.","移动此服务器前请先加载目录。");return}c.value=!0,_.value="";try{await b.client.call("mcp.move",{...L(),id:o.id,from:s,to:p,expectedFromVersion:f,expectedToVersion:l},E),i.value=void 0,m.value=void 0,await B(),await F()}catch(ke){_.value=x(ke)}finally{c.value=!1}}function ge(o){var p;const s=(p=z.value)==null?void 0:p.servers.find(d=>d.id===o&&d.source==="project");s&&ue(s)}async function re(o=!1){if(!(!I.value||!o&&!R.value||c.value)){c.value=!0,_.value="";try{await b.client.call(o?"mcp.auth.cancel":"mcp.auth.complete",{attemptId:I.value.attemptId,...o?{}:{callbackUrl:R.value}},E),R.value="",I.value=void 0,await B(),await F()}catch(s){_.value=x(s)}finally{c.value=!1}}}return xe(b,K,$(()=>i.value!==void 0||!!V.value||!!R.value||!!I.value)),Ce(K),Ue(()=>{te=!1,R.value="",V.value="",I.value&&b.client.call("mcp.auth.cancel",{attemptId:I.value.attemptId},E).catch(()=>{})}),(o,s)=>{var p,d,S,M,f;return r(),u("article",De,[n("header",null,[s[31]||(s[31]=n("h2",{"data-route-heading":"",tabindex:"-1"},"MCP",-1)),n("p",null,t(a(e)("Manage command and remote MCP servers. Project servers stay disabled until you explicitly enable them locally.","管理命令和远程 MCP 服务器。项目服务器默认禁用,只有您在本地明确启用后才会运行。")),1)]),n("form",{class:"settings-card settings-form",onSubmit:Y(K,["prevent"])},[n("label",null,[n("span",null,t(a(e)("Project directory (optional, absolute path)","项目目录(可选,绝对路径)")),1),y(n("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>W.value=l),class:"ui-field","data-size":"md",disabled:c.value},null,8,je),[[U,W.value]])]),n("div",Ee,[n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value},t(a(e)("Load / refresh","加载 / 刷新")),9,Oe),n("button",{class:"ui-button","data-size":"md","data-variant":"primary",type:"button",disabled:c.value||!z.value||!a(b).supports("mcp.save"),onClick:be},t(a(e)("Add server","添加服务器")),9,Le)])],32),Ae(Re,{busy:c.value,error:_.value,onReload:K},null,8,["busy","error"]),(r(!0),u(w,null,D((p=z.value)==null?void 0:p.errors,l=>(r(),u("p",{key:l,class:"ui-banner settings-banner","data-tone":"warning"},t(l),1))),128)),m.value?(r(),u("section",Ne,[n("h3",null,t(a(e)("Server details","服务器详情"))+": "+t(m.value.server.id),1),n("p",null,t(m.value.server.source)+" · "+t(m.value.server.transport)+" · "+t(m.value.inspection.enabled?a(e)("Enabled","已启用"):a(e)("Disabled","已禁用")),1),m.value.inspection.configuration.type==="stdio"?(r(),u(w,{key:0},[n("p",null,[P(t(a(e)("Executable","可执行程序"))+": ",1),n("code",null,t(m.value.inspection.configuration.command),1)]),n("p",null,t(a(e)("Stored arguments (hidden)","已存参数(隐藏)"))+": "+t(m.value.inspection.configuration.argsCount),1),n("p",null,t(a(e)("Working directory","工作目录"))+": "+t(m.value.inspection.configuration.cwd||a(e)("Daemon directory","守护进程目录")),1),n("p",null,t(a(e)("Environment names","环境变量名"))+": "+t(m.value.inspection.configuration.envNames.join(", ")||"—"),1)],64)):(r(),u(w,{key:1},[n("p",null,[P(t(a(e)("Endpoint (origin only)","端点(仅来源)"))+": ",1),n("code",null,t(m.value.inspection.configuration.endpoint),1)]),n("p",null,t(a(e)("Header names","请求头名称"))+": "+t(m.value.inspection.configuration.headerNames.join(", ")||"—"),1),n("p",null,t(a(e)("Stored bearer token","已存储的 Bearer 令牌"))+": "+t(m.value.inspection.configuration.authConfigured?a(e)("Configured","已配置"):a(e)("None","无")),1),(d=m.value.inspection.configuration.oauth)!=null&&d.clientId?(r(),u("p",$e,"OAuth client ID: "+t(m.value.inspection.configuration.oauth.clientId),1)):v("",!0)],64)),n("p",null,t(a(e)("Connection snapshots do not open a connection. Tool lists are the last successful discovery for each live connection generation.","查看快照不会打开连接。工具列表来自每个活动连接代次最近一次成功的发现。")),1),m.value.inspection.connections.length?v("",!0):(r(),u("p",qe,t(a(e)("No live session connections. Use Test connection to discover tools without creating a session.","没有活动会话连接。可通过“测试连接”发现工具,无需创建会话。")),1)),(r(!0),u(w,null,D(m.value.inspection.connections,(l,k)=>(r(),u("section",{key:k,class:"runtime-detail"},[n("h4",null,[P(t(a(e)("Connection","连接"))+" "+t(k+1)+" · "+t(l.state),1),l.expired?(r(),u(w,{key:0},[P(" · "+t(a(e)("Credential expired","凭据已过期")),1)],64)):v("",!0)]),l.tools?(r(),u("ul",Be,[(r(!0),u(w,null,D(l.tools,C=>(r(),u("li",{key:C.name},[n("strong",null,t(C.name),1),C.description?(r(),u("p",Fe,t(C.description),1)):v("",!0)]))),128))])):v("",!0),l.tools===void 0?(r(),u("p",Ke,t(a(e)("Tools have not been discovered.","尚未发现工具。")),1)):l.tools.length?v("",!0):(r(),u("p",We,t(a(e)("The server exposes no tools.","服务器没有提供工具。")),1))]))),128)),m.value.inspection.configuration.type!=="stdio"&&((S=m.value.inspection.configuration.oauth)!=null&&S.clientId)?(r(),u("label",He,[n("span",null,t(a(e)("OAuth client secret (optional, sent once on Sign in)","OAuth 客户端密钥(可选,仅在登录时发送一次)")),1),y(n("input",{"onUpdate:modelValue":s[1]||(s[1]=l=>V.value=l),class:"ui-field","data-size":"md",type:"password",autocomplete:"new-password",disabled:c.value},null,8,Je),[[U,V.value]])])):v("",!0),n("div",Ge,[n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value,onClick:s[2]||(s[2]=l=>oe(m.value.server))},t(a(e)("Refresh details","刷新详情")),9,Qe),n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value||!a(b).supports("mcp.test")||m.value.server.source!=="user"&&!m.value.server.enabled,onClick:s[3]||(s[3]=l=>X(m.value.server))},t(a(e)("Test connection","测试连接")),9,Xe),m.value.server.transport!=="stdio"?(r(),u("button",{key:0,class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value||!!I.value||!m.value.server.enabled||!a(b).supports("mcp.auth.start"),onClick:s[4]||(s[4]=l=>N("mcp.auth.start",m.value.server))},t(a(e)("Sign in","登录")),9,Ye)):v("",!0)])])):v("",!0),i.value?(r(),u("form",{key:1,ref_key:"editorForm",ref:ee,class:"settings-card settings-form",autocomplete:"off",onSubmit:Y(ye,["prevent"])},[n("h3",null,t(h.value?a(e)("Edit server","编辑服务器"):a(e)("New server","新服务器")),1),h.value&&i.value.secretsInUserScope?(r(),u("p",Ze,[P(t(a(e)("Withheld arguments, environment, headers, URL parts and OAuth metadata are stored in your user-scope configuration. They cannot be edited here; non-secret fields still save through the owner.","隐藏的参数、环境变量、请求头、URL 部分和 OAuth 元数据存储在用户范围配置中。此处无法编辑;非机密字段仍可通过所有者保存。"))+" ",1),n("button",{class:"ui-button","data-size":"sm","data-variant":"secondary",type:"button",disabled:c.value||!a(b).supports("mcp.move"),onClick:s[5]||(s[5]=l=>ge(i.value.id))},t(a(e)("Move to user to edit","移到用户范围编辑")),9,et)])):v("",!0),n("fieldset",{disabled:c.value},[n("label",null,[n("span",null,t(a(e)("Server ID","服务器 ID")),1),y(n("input",{"onUpdate:modelValue":s[6]||(s[6]=l=>i.value.id=l),class:"ui-field","data-size":"md",disabled:h.value,required:""},null,8,at),[[U,i.value.id]])]),n("label",null,[n("span",null,t(a(e)("Source","来源")),1),y(n("select",{"onUpdate:modelValue":s[7]||(s[7]=l=>i.value.source=l),class:"ui-field","data-size":"md",disabled:h.value},[n("option",ot,t(a(e)("User","用户")),1),O.value?(r(),u("option",st,t(a(e)("Project","项目")),1)):v("",!0)],8,nt),[[j,i.value.source]])]),h.value?(r(),u("p",lt,t(a(e)("The source and transport are fixed. Changes write only this source. Use Move to change the source; a move into a project keeps withheld values in your user-scope configuration.","来源和传输方式固定。更改只写入此来源。使用“移动”更改来源;移入项目时隐藏值保留在用户范围配置中。")),1)):v("",!0),n("label",null,[n("span",null,t(a(e)("Transport","传输方式")),1),y(n("select",{"onUpdate:modelValue":s[8]||(s[8]=l=>i.value.type=l),class:"ui-field","data-size":"md",disabled:h.value},[...s[32]||(s[32]=[n("option",{value:"stdio"},"stdio",-1),n("option",{value:"http"},"HTTP",-1),n("option",{value:"sse"},"SSE",-1)])],8,it),[[j,i.value.type]])]),i.value.type==="stdio"?(r(),u(w,{key:1},[n("label",null,[n("span",null,t(a(e)("Executable","可执行程序")),1),y(n("input",{"onUpdate:modelValue":s[9]||(s[9]=l=>i.value.command=l),class:"ui-field","data-size":"md",required:""},null,512),[[U,i.value.command]])]),n("label",null,[n("span",null,t(a(e)("Working directory (optional)","工作目录(可选)")),1),y(n("input",{"onUpdate:modelValue":s[10]||(s[10]=l=>i.value.cwd=l),class:"ui-field","data-size":"md"},null,512),[[U,i.value.cwd]])]),h.value&&!i.value.secretsInUserScope?(r(),u("label",ut,[n("span",null,t(a(e)("Stored arguments (hidden)","已存参数(隐藏)"))+": "+t(i.value.storedArgsCount),1),y(n("select",{"onUpdate:modelValue":s[11]||(s[11]=l=>i.value.argsAction=l),class:"ui-field"},[n("option",rt,t(a(e)("Keep stored arguments","保留已存参数")),1),n("option",dt,t(a(e)("Replace all arguments","替换全部参数")),1)],512),[[j,i.value.argsAction]])])):v("",!0),!i.value.secretsInUserScope&&(!h.value||i.value.argsAction==="replace")?(r(),u("div",ct,[n("strong",null,t(a(e)("Arguments (one per field)","参数(每个字段一个)")),1),(r(!0),u(w,null,D(i.value.args,(l,k)=>(r(),u("div",{key:k,class:"argument-row"},[y(n("input",{"onUpdate:modelValue":C=>i.value.args[k]=C,class:"ui-field","data-size":"md",type:"password",autocomplete:"new-password","aria-label":a(e)("Argument","参数")},null,8,vt),[[U,i.value.args[k]]]),n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",type:"button",onClick:C=>i.value.args.splice(k,1)},t(a(e)("Remove","移除")),9,pt)]))),128)),n("button",{class:"ui-button","data-size":"sm","data-variant":"secondary",type:"button",onClick:s[12]||(s[12]=l=>i.value.args.push(""))},t(a(e)("Add argument","添加参数")),1)])):v("",!0)],64)):(r(),u(w,{key:2},[h.value?(r(),u("p",mt,t(a(e)("Current endpoint","当前端点"))+": "+t(i.value.endpoint)+" — "+t(a(e)("Path and credentials are hidden.","路径和凭据已隐藏。")),1)):v("",!0),i.value.secretsInUserScope?v("",!0):(r(),u("label",bt,[n("span",null,t(h.value?a(e)("Replace URL (blank preserves the stored URL)","替换 URL(留空保留已存储的 URL)"):"URL"),1),y(n("input",{"onUpdate:modelValue":s[13]||(s[13]=l=>i.value.url=l),class:"ui-field","data-size":"md",type:"url",required:!h.value,autocomplete:"off"},null,8,ht),[[U,i.value.url]])])),h.value?v("",!0):(r(),u(w,{key:2},[n("label",ft,[y(n("input",{"onUpdate:modelValue":s[14]||(s[14]=l=>i.value.oauth=l),type:"checkbox",disabled:!!i.value.token},null,8,yt),[[de,i.value.oauth]]),P(t(a(e)("Configure OAuth","配置 OAuth")),1)]),i.value.oauth?v("",!0):(r(),u("label",gt,[n("span",null,t(a(e)("Bearer token (optional, write-only)","Bearer 令牌(可选,只写)")),1),y(n("input",{"onUpdate:modelValue":s[15]||(s[15]=l=>i.value.token=l),class:"ui-field","data-size":"md",type:"password",autocomplete:"new-password"},null,512),[[U,i.value.token]])]))],64)),h.value&&!ae.value?(r(),u("label",kt,[n("span",null,t(a(e)("OAuth configuration","OAuth 配置")),1),y(n("select",{"onUpdate:modelValue":s[16]||(s[16]=l=>i.value.oauthAction=l),class:"ui-field","data-size":"md"},[n("option",_t,t(a(e)("Preserve existing configuration","保留现有配置")),1),n("option",wt,t(a(e)("Configure / edit OAuth","配置 / 编辑 OAuth")),1),n("option",Ct,t(a(e)("Remove explicit configuration (automatic discovery remains)","移除显式配置(仍可自动发现)")),1)],512),[[j,i.value.oauthAction]])])):v("",!0),!h.value&&i.value.oauth||h.value&&i.value.oauthAction==="set"&&!ae.value?(r(),u("section",Ut,[n("p",null,t(a(e)("OAuth cannot be combined with a bearer token or Authorization header. Remove those explicitly when enabling OAuth. Leave optional fields blank to use defaults.","OAuth 不能与 Bearer 令牌或 Authorization 请求头一起使用。启用 OAuth 时请明确移除这些字段。可选字段留空使用默认值。")),1),n("label",null,[n("span",null,t(a(e)("OAuth client ID (optional)","OAuth 客户端 ID(可选)")),1),y(n("input",{"onUpdate:modelValue":s[17]||(s[17]=l=>i.value.clientId=l),class:"ui-field","data-size":"md"},null,512),[[U,i.value.clientId]])]),n("label",null,[n("span",null,t(a(e)("Callback port (default 1456)","回调端口(默认 1456)")),1),y(n("input",{"onUpdate:modelValue":s[18]||(s[18]=l=>i.value.callbackPort=l),class:"ui-field","data-size":"md",type:"number",min:"1",max:"65535",step:"1",placeholder:"1456"},null,512),[[U,i.value.callbackPort]])]),n("label",null,[n("span",null,t(a(e)("Scopes (space separated, optional)","权限范围(空格分隔,可选)")),1),y(n("input",{"onUpdate:modelValue":s[19]||(s[19]=l=>i.value.scopes=l),class:"ui-field","data-size":"md"},null,512),[[U,i.value.scopes]])]),h.value&&!i.value.secretsInUserScope?(r(),u("label",At,[n("span",null,t(a(e)("Authorization metadata URL","授权元数据 URL"))+" · "+t(i.value.metadataConfigured?a(e)("Configured (hidden)","已配置(隐藏)"):a(e)("None","无")),1),y(n("select",{"onUpdate:modelValue":s[20]||(s[20]=l=>i.value.metadataAction=l),class:"ui-field","data-size":"md"},[n("option",St,t(a(e)("Keep","保留")),1),n("option",zt,t(a(e)("Replace","替换")),1),n("option",It,t(a(e)("Remove","移除")),1)],512),[[j,i.value.metadataAction]])])):v("",!0),!i.value.secretsInUserScope&&(!h.value||i.value.metadataAction==="set")?(r(),u("label",Mt,[n("span",null,t(a(e)("Authorization metadata URL (optional fallback)","授权元数据 URL(可选回退)")),1),y(n("input",{"onUpdate:modelValue":s[21]||(s[21]=l=>i.value.metadataUrl=l),class:"ui-field","data-size":"md",type:"url",required:h.value&&i.value.metadataAction==="set",autocomplete:"off"},null,8,Pt),[[U,i.value.metadataUrl]])])):v("",!0),n("p",null,t(a(e)("Client secrets are entered under server details when signing in, never in saved configuration.","客户端密钥在服务器详情中登录时输入,绝不写入配置。")),1)])):v("",!0)],64)),h.value&&!i.value.secretsInUserScope&&i.value.type!=="stdio"?(r(),u("section",Vt,[n("h4",null,t(a(e)("Bearer token (write-only)","Bearer 令牌(只写)")),1),n("p",null,t(i.value.authConfigured?a(e)("A token is configured.","已配置令牌。"):a(e)("No token is configured.","未配置令牌。")),1),n("label",null,[n("span",null,t(a(e)("Token action","令牌操作")),1),y(n("select",{"onUpdate:modelValue":s[22]||(s[22]=l=>i.value.bearerAction=l),class:"ui-field","data-size":"md"},[n("option",Rt,t(a(e)("Keep stored token","保留已存储的令牌")),1),n("option",{value:"set",disabled:pe.value},t(a(e)("Replace token","替换令牌")),9,Tt),n("option",xt,t(a(e)("Remove token","移除令牌")),1)],512),[[j,i.value.bearerAction]])]),i.value.bearerAction==="set"?(r(),u("label",Dt,[n("span",null,t(a(e)("New bearer token","新 Bearer 令牌")),1),y(n("input",{"onUpdate:modelValue":s[23]||(s[23]=l=>i.value.token=l),class:"ui-field","data-size":"md",type:"password",autocomplete:"new-password",required:""},null,512),[[U,i.value.token]])])):v("",!0)])):v("",!0),i.value.secretsInUserScope?v("",!0):(r(),u("section",jt,[n("h4",null,t(i.value.type==="stdio"?a(e)("Environment variables","环境变量"):a(e)("HTTP headers","HTTP 请求头")),1),n("p",null,t(a(e)("Stored values are never returned. Keep preserves a value; Set replaces it; Remove deletes it. Values are not stored in this browser.","已存储的值不会返回。“保留”维持原值,“设置”替换原值,“删除”移除字段。值不会保存在此浏览器中。")),1),(r(!0),u(w,null,D(i.value.secrets,(l,k)=>(r(),u("div",{key:k,class:"secret-row"},[y(n("input",{"onUpdate:modelValue":C=>l.name=C,class:"ui-field","data-size":"md","aria-label":a(e)("Field name","字段名称"),readonly:l.stored,required:""},null,8,Et),[[U,l.name]]),y(n("select",{"onUpdate:modelValue":C=>l.action=C,class:"ui-field","data-size":"md","aria-label":a(e)("Secret action","机密操作")},[l.stored?(r(),u("option",Lt,t(a(e)("Keep","保留")),1)):v("",!0),n("option",Nt,t(a(e)("Set","设置")),1),l.stored?(r(),u("option",$t,t(a(e)("Remove","删除")),1)):v("",!0)],8,Ot),[[j,l.action]]),l.action==="set"?y((r(),u("input",{key:0,"onUpdate:modelValue":C=>l.value=C,class:"ui-field","data-size":"md",type:"password",autocomplete:"new-password","aria-label":a(e)("New value","新值")},null,8,qt)),[[U,l.value]]):v("",!0),n("button",{class:"ui-button","data-size":"sm","data-variant":"secondary",type:"button",onClick:C=>i.value.secrets.splice(k,1)},t(a(e)("Cancel field change","取消字段更改")),9,Bt)]))),128)),n("button",{class:"ui-button","data-size":"sm","data-variant":"secondary",type:"button",onClick:s[24]||(s[24]=l=>i.value.secrets.push({name:"",action:"set",value:""}))},t(a(e)("Add field","添加字段")),1)])),!h.value&&i.value.source==="user"?(r(),u("label",Ft,[y(n("input",{"onUpdate:modelValue":s[25]||(s[25]=l=>i.value.enabled=l),type:"checkbox"},null,512),[[de,i.value.enabled]]),P(t(a(e)("Enable after saving","保存后启用")),1)])):v("",!0),i.value.source==="project"?(r(),u("p",Kt,t(a(e)("Project tests require a saved entry that you explicitly enabled locally. Unsaved project definitions cannot execute.","项目测试要求条目已保存且由您在本地明确启用。未保存的项目定义不能执行。")),1)):v("",!0),h.value?(r(),u("p",Wt,t(a(e)("Enablement and unedited fields are preserved. Use the server actions to enable, disable or sign in.","启用状态及未编辑字段会被保留。请通过服务器操作启用、禁用或登录。")),1)):v("",!0),n("div",Ht,[n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",type:"button",disabled:!a(b).supports("mcp.test")||i.value.source==="project"&&(!h.value||!i.value.enabled),onClick:s[26]||(s[26]=l=>X())},t(a(e)("Test draft connection","测试草稿连接")),9,Jt),n("button",{class:"ui-button","data-size":"md","data-variant":"primary",disabled:!T.value||h.value&&!a(b).supports("mcp.update")},t(a(e)("Save server","保存服务器")),9,Gt),n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",type:"button",onClick:fe},t(a(e)("Cancel","取消")),1)])],8,tt)],544)):v("",!0),g.value?(r(),u("section",Qt,[g.value.probe.status==="connected"?(r(),u("h3",Xt,t(a(e)("Connection test passed","连接测试通过"))+": "+t(g.value.id)+" · "+t(g.value.probe.latencyMs)+" ms",1)):g.value.probe.status==="authRequired"?(r(),u("h3",Yt,t(a(e)("Sign-in required","需要登录"))+": "+t(g.value.id)+" · "+t(g.value.probe.latencyMs)+" ms",1)):(r(),u("h3",Zt,t(a(e)("Connection test failed","连接测试失败"))+": "+t(g.value.id)+" · "+t(g.value.probe.latencyMs)+" ms",1)),g.value.probe.status==="connected"?(r(),u("p",ea,t(a(e)("The temporary connection has been closed. Configuration and session connections were not changed.","临时连接已关闭。配置及会话连接未被更改。")),1)):g.value.probe.status==="authRequired"?(r(),u(w,{key:4},[n("p",null,t(g.value.probe.expired?a(e)("The stored credential was rejected. Sign in again.","已存储的凭据被拒绝,请重新登录。"):a(e)("This server requires sign-in.","此服务器需要登录。")),1),(M=g.value.probe.missingScopes)!=null&&M.length?(r(),u("p",ta,t(a(e)("Additional scopes","额外权限范围"))+": "+t(g.value.probe.missingScopes.join(", ")),1)):v("",!0)],64)):(r(),u("p",aa,[P(t(me(g.value.probe.reason)),1),g.value.probe.message?(r(),u(w,{key:0},[P(" · "+t(g.value.probe.message),1)],64)):v("",!0)])),g.value.probe.tools?(r(),u("ul",na,[(r(!0),u(w,null,D(g.value.probe.tools,l=>(r(),u("li",{key:l.name},[n("strong",null,t(l.name),1),l.description?(r(),u("p",oa,t(l.description),1)):v("",!0)]))),128))])):v("",!0),g.value.probe.status==="connected"&&!((f=g.value.probe.tools)!=null&&f.length)?(r(),u("p",sa,t(a(e)("The server exposes no tools.","服务器没有提供工具。")),1)):v("",!0)])):v("",!0),I.value?(r(),u("section",la,[n("h3",null,t(a(e)("Authorize MCP","授权 MCP"))+": "+t(Z.value),1),n("p",null,[P(t(a(e)("Callback","回调"))+": ",1),n("code",null,t(I.value.redirectUri),1),P(" · "+t(a(e)("Expires","过期时间"))+": "+t(new Date(I.value.expiresAt).toLocaleString()),1)]),n("a",{class:"ui-button","data-size":"md","data-variant":"primary",href:I.value.authorizationUrl,target:"_blank",rel:"noopener noreferrer"},t(a(e)("Open authorization page","打开授权页面")),9,ia),n("form",{class:"settings-form",autocomplete:"off",onSubmit:s[29]||(s[29]=Y(l=>re(),["prevent"]))},[n("label",null,[n("span",null,t(a(e)("Paste the full callback URL after authorization","授权后粘贴完整回调 URL")),1),y(n("input",{"onUpdate:modelValue":s[27]||(s[27]=l=>R.value=l),class:"ui-field","data-size":"md",type:"password",autocomplete:"new-password",disabled:c.value,required:""},null,8,ua),[[U,R.value]])]),n("div",ra,[n("button",{class:"ui-button","data-size":"md","data-variant":"primary",disabled:c.value||!a(b).supports("mcp.auth.complete")},t(a(e)("Complete sign-in","完成登录")),9,da),n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",type:"button",disabled:c.value||!a(b).supports("mcp.auth.cancel"),onClick:s[28]||(s[28]=l=>re(!0))},t(a(e)("Cancel sign-in","取消登录")),9,ca)])],32)])):v("",!0),n("label",va,[n("span",null,t(a(e)("Search servers","搜索服务器")),1),y(n("input",{"onUpdate:modelValue":s[30]||(s[30]=l=>G.value=l),class:"ui-field","data-size":"md",type:"search"},null,512),[[U,G.value]])]),(r(!0),u(w,null,D(ne.value,l=>(r(),u("section",{key:`${l.source}:${l.id}`,class:"settings-card"},[n("h3",null,t(l.id),1),n("p",null,[P(t(l.source)+" · "+t(l.transport)+" · "+t(l.enabled?a(e)("Enabled","已启用"):a(e)("Disabled","已禁用")),1),l.auth?(r(),u(w,{key:0},[P(" · OAuth: "+t(l.auth),1)],64)):v("",!0)]),n("div",pa,[n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value||!a(b).supports("mcp.inspect"),onClick:k=>oe(l)},t(a(e)("Details / tools","详情 / 工具")),9,ma),n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value||!!i.value||!a(b).supports("mcp.test")||l.source!=="user"&&!l.enabled,onClick:k=>X(l)},t(a(e)("Test connection","测试连接")),9,ba),l.source!=="plugin"?(r(),u(w,{key:0},[n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value||!!i.value||!a(b).supports("mcp.configuration")||!a(b).supports("mcp.update"),onClick:k=>he(l)},t(a(e)("Edit","编辑")),9,ha),n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value||!!i.value||!a(b).supports("mcp.move")||l.source==="user"&&!O.value,onClick:k=>ue(l)},t(l.source==="user"?a(e)("Move to project…","移入项目…"):a(e)("Move to user…","移到用户…")),9,fa),n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value||!!i.value||!a(b).supports("mcp.set_enabled"),onClick:k=>N("mcp.set_enabled",l)},t(l.enabled?a(e)("Disable","禁用"):a(e)("Enable","启用")),9,ya),n("button",{class:"ui-button","data-size":"md","data-variant":"danger-ghost",disabled:c.value||!!i.value||!a(b).supports("mcp.remove"),onClick:k=>N("mcp.remove",l)},t(a(e)("Remove","移除")),9,ga)],64)):v("",!0),n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value||!l.enabled||!a(b).supports("mcp.disconnect"),onClick:k=>N("mcp.disconnect",l)},t(a(e)("Disconnect","断开连接")),9,ka),l.transport!=="stdio"?(r(),u(w,{key:1},[n("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value||!!I.value||!l.enabled||!a(b).supports("mcp.auth.start"),onClick:k=>N("mcp.auth.start",l)},t(a(e)("Sign in","登录")),9,_a),l.auth?(r(),u("button",{key:0,class:"ui-button","data-size":"md","data-variant":"secondary",disabled:c.value||!a(b).supports("mcp.auth.logout"),onClick:k=>N("mcp.auth.logout",l)},t(a(e)("Sign out","退出登录")),9,wa)):v("",!0)],64)):v("",!0)]),l.source==="plugin"?(r(),u("p",Ca,t(a(e)("This entry is owned by its plugin. Change it through Plugins.","此条目归其插件所有。请通过插件页面更改。")),1)):v("",!0)]))),128)),z.value&&!ne.value.length?(r(),u("p",Ua,t(a(e)("No matching MCP servers. Add a server to get started.","没有匹配的 MCP 服务器。请添加服务器以开始使用。")),1)):v("",!0)])}}}),Ra=Ve(Aa,[["__scopeId","data-v-56366ac6"]]);export{Ra as default};
@@ -0,0 +1 @@
1
+ import{d as w,x as J,c as d,e as i,t as o,u as l,j as A,B as L,F as N,E as x,a as I,r as h,z as E,o as c}from"./vendor-vue-CncuOShJ.js";import{u as P}from"./settings-general-dc8P6dA0.js";import{u as q,a as G,g as R,R as H}from"./index-CenMTLFY.js";import{_ as K}from"./GeneralSettingsStatus.vue_vue_type_script_setup_true_lang-CWInOGTv.js";import{b as Q,r as U,m as O}from"./context-Grqd_9Lt.js";const W={class:"settings-page"},X={"data-route-heading":"",tabindex:"-1"},Y={key:0,class:"ui-banner settings-banner","data-tone":"warning"},Z=["value","disabled","onChange"],ee={value:""},ae=["value","disabled"],te={key:1,class:"ui-field-hint","data-tone":"danger"},ne={key:2},se={class:"settings-actions"},oe=["disabled"],fe=w({__name:"ModalitySettings",setup(re){const n=P(),f=q(),b=G(),v=h(),m=h({}),u=h(!1),g=h(""),y=h(!1),_=h(!1),k=E(()=>{var e,a;return((a=(e=v.value)==null?void 0:e.categories.find(t=>t.category==="image"))==null?void 0:a.operations)??[]}),p=E(()=>k.value.some(e=>e.key!==void 0&&(m.value[e.key]??"")!==M(e)));Q(p);function S(e){return JSON.stringify([e.providerId,e.modelId])}function M(e){const a=k.value.find(t=>t.key===e.key);return a!=null&&a.default?S(a.default):""}function C(e){var t,s;const a=(t=b.providers)==null?void 0:t.find(r=>r.providerId===e.providerId);return a?`${a.name} / ${((s=a.models.find(r=>r.id===e.modelId))==null?void 0:s.name)??e.modelId}`:`${e.providerId} / ${e.modelId}`}function B(e){switch(e){case"generate":return n("Image generation","图像生成");case"edit":return n("Image editing","图像编辑");case"enhance":return n("Image enhancement","图像增强");case"understand":return n("Image understanding","图像理解");default:return e}}function D(e){return e.reasons.map(a=>a.detail).join("; ")}function F(e){if(!e.effective)return e.default?n("None. The configured default is unavailable and is never replaced by another model.","无。已配置的默认值不可用,且不会被其他模型替代。"):n("None. No model serves this operation now.","无。当前没有模型服务此操作。");const a=C(e.effective);return e.effective.source==="automatic"?`${a} (${n("automatic","自动")})`:`${a} (${n("configured","已配置")})`}function j(e){if(e==="")return null;const[a,t]=JSON.parse(e);return{providerId:a,modelId:t}}function z(e,a){m.value[e]=a.target.value}function T(e){var t;const a=((t=e.categories.find(s=>s.category==="image"))==null?void 0:t.operations)??[];m.value=Object.fromEntries(a.filter(s=>s.key!==void 0).map(s=>[s.key,s.default?S(s.default):""]))}async function $(){if(!u.value&&!(p.value&&!window.confirm(n("Discard unsaved defaults?","放弃未保存的默认设置?")))){u.value=!0,g.value="",y.value=!1,_.value=!1;try{if(!f.supports("modality.capabilities"))throw new Error(n("Modality settings are not available on this server.","此服务器不支持多模态设置。"));const[e]=await Promise.all([f.client.call("modality.capabilities",{},R),b.load()]);if(!e.categories.some(a=>a.category==="image"))throw new Error(n("The server reports no image category for Modality.","服务器未返回多模态的图像类别。"));v.value=e,T(e),b.error&&(g.value=b.error)}catch(e){g.value=O(e)}finally{u.value=!1}}}async function V(){if(!(!v.value||u.value||!p.value||y.value)){u.value=!0,g.value="",_.value=!1;try{for(const e of k.value)e.key===void 0||(m.value[e.key]??"")===M(e)||(v.value=await f.client.call("modality.configure",{expectedRevision:v.value.revision,category:"image",operation:e.operation,model:j(m.value[e.key]??"")},R));_.value=!0}catch(e){y.value=e instanceof H&&e.appError==="modality_conflict",g.value=y.value?n("Modality defaults changed. Reload before saving again; your draft has been preserved.","多模态默认设置已变更。请重新加载后再保存,当前草稿已保留。"):O(e)}finally{u.value=!1}}}return U(f,$,p),J($),(e,a)=>(c(),d("article",W,[i("header",null,[i("h2",X,o(l(n)("Modality","多模态")),1),i("p",null,o(l(n)("Choose the default model for each image operation. Clearing a default restores automatic resolution; an unavailable default is never replaced by another model.","为每个图像操作选择默认模型。清除默认值即恢复自动解析;不可用的默认值不会被其他模型替代。")),1)]),A(K,{busy:u.value,error:g.value,saved:_.value&&!p.value,onReload:$},null,8,["busy","error","saved"]),v.value?(c(),d("form",{key:0,class:"settings-form",onSubmit:L(V,["prevent"])},[(c(!0),d(N,null,x(k.value,t=>{var s;return c(),d("section",{key:t.operation,class:"settings-card"},[i("h3",null,o(B(t.operation)),1),t.reasons.length?(c(),d("p",Y,o(D(t)),1)):I("",!0),i("label",null,[i("span",null,o(l(n)("Default model","默认模型")),1),i("select",{value:m.value[t.key]??"",class:"ui-field","data-size":"md",disabled:u.value||y.value||!l(f).supports("modality.configure"),onChange:r=>z(t.key,r)},[i("option",ee,o(l(n)("Automatic","自动")),1),(c(!0),d(N,null,x(t.options,r=>(c(),d("option",{key:S(r),value:S(r),disabled:!r.available},o(C(r))+o(r.available?"":` (${l(n)("unavailable","不可用")})`),9,ae))),128))],40,Z)]),i("p",null,o(l(n)("Currently effective","当前生效"))+": "+o(F(t)),1),t.default&&!t.default.available?(c(),d("p",te,o((s=t.default.reason)==null?void 0:s.detail),1)):I("",!0),t.operation==="understand"?(c(),d("p",ne,o(l(n)("Selection only for now: the Session image-understanding path does not read this default yet, so it does not change the model a Session uses.","目前仅用于选择:会话的图像理解路径尚未读取此默认值,因此不会改变会话使用的模型。")),1)):I("",!0)])}),128)),i("footer",se,[i("button",{class:"ui-button","data-size":"md","data-variant":"primary",disabled:u.value||!p.value||y.value||!l(f).supports("modality.configure")},o(l(n)("Save defaults","保存默认设置")),9,oe)])],32)):I("",!0)]))}});export{fe as default};
@@ -0,0 +1 @@
1
+ fieldset[data-v-8d0f4351]{min-width:0;padding:0;border:0}label[data-v-8d0f4351]{display:grid;gap:var(--space-2)}legend[data-v-8d0f4351]{margin-bottom:var(--space-4);color:var(--muted-foreground);font-size:var(--text-sm)}.rule-row[data-v-8d0f4351]{display:grid;grid-template-columns:minmax(120px,1fr) auto auto auto;gap:var(--space-2);margin-bottom:var(--space-3)}@media(max-width:640px){.rule-row[data-v-8d0f4351]{grid-template-columns:1fr 1fr}.rule-row input[data-v-8d0f4351]{grid-column:1 / -1}}
@@ -0,0 +1 @@
1
+ import{d as T,x as F,c as m,e,t,u as s,j as O,b as N,a as x,B as U,l as y,L as M,F as J,E as L,r as c,z,C as j,D as A,o as p}from"./vendor-vue-CncuOShJ.js";import{u as q}from"./settings-general-dc8P6dA0.js";import{u as I,z as W,A as B,C as G,f as H,k as K}from"./index-CenMTLFY.js";import{_ as Q}from"./GeneralSettingsStatus.vue_vue_type_script_setup_true_lang-CWInOGTv.js";import{b as X,r as Y,m as C}from"./context-Grqd_9Lt.js";const Z={class:"settings-page"},ee={"data-route-heading":"",tabindex:"-1"},ae={key:0,class:"ui-banner settings-banner","data-tone":"danger",role:"alert"},se=["disabled"],te={key:0,class:"ui-banner settings-banner","data-tone":"warning"},ne=["disabled"],oe={class:"ui-banner settings-banner","data-tone":"warning"},le={class:"settings-actions"},ie=["disabled"],ue={class:"settings-card"},re=["disabled"],de=["onUpdate:modelValue","aria-label"],ce=["onUpdate:modelValue","aria-label"],ve={value:"exact"},me={value:"prefix"},pe=["onUpdate:modelValue","aria-label"],be={value:"allow"},he={value:"deny"},fe=["onClick"],_e={key:0},we={class:"settings-actions"},ge=["disabled"],xe=["disabled"],ye=T({__name:"PermissionsSettings",setup(ke){const a=q(),i=I(),v=c(),d=c([]),n=c(!1),f=c(""),k=c(!1),l=c(),b=c(!1),h=c(!1),S=c(),_=c(""),V=z(()=>l.value!==void 0&&(b.value!==l.value.sandbox||h.value!==l.value.network)),D=z(()=>v.value!==void 0&&JSON.stringify(d.value)!==JSON.stringify(v.value.commandRules)),R=z(()=>D.value||V.value);X(R);async function g(){if(!n.value&&!(R.value&&!window.confirm(a("Discard unsaved command rules?","放弃未保存的命令规则?")))){n.value=!0,f.value="",k.value=!1;try{if(!i.supports("permission.rules"))throw new Error(a("Command rules are not available on this server.","此服务器不支持命令规则。"));v.value=await i.client.call("permission.rules",{},W),d.value=v.value.commandRules.map(o=>({...o}))}catch(o){f.value=C(o)}try{_.value="",i.supports("settings.read")&&(l.value=await i.client.call("settings.read",{source:"execution",scope:"user"},B),b.value=l.value.sandbox,h.value=l.value.network),i.supports("host.execution.backend")&&(S.value=await i.client.call("host.execution.backend",{},G))}catch(o){_.value=C(o)}n.value=!1}}async function $(){if(!(!v.value||!D.value||n.value)){if(d.value.some(o=>!o.command.trim()||/[;&|`()<>$\n\r]/.test(o.command))){f.value=a("Enter a simple command without shell separators, substitutions or redirection.","请输入不含 Shell 分隔符、替换或重定向的简单命令。");return}if(!(d.value.some(o=>o.decision==="allow")&&!window.confirm(a("Save command rules that allow execution without asking? Deny presets still take precedence.","保存允许免询问执行的命令规则?拒绝预设仍然优先。")))){n.value=!0,f.value="",k.value=!1;try{const o=await i.client.call("permission.set_rules",{expectedRevision:v.value.revision,commandRules:d.value},H);v.value={revision:o,commandRules:d.value.map(u=>({...u}))},k.value=!0}catch(o){f.value=C(o)}finally{n.value=!1}}}}async function P(){if(!(!l.value||n.value||!V.value||(l.value.sandbox&&!b.value||!l.value.network&&h.value)&&!window.confirm(a("New commands will run with less isolation than now. Running processes keep their boundary.","新命令将以比现在更少的隔离运行。已运行的进程保留原边界。")))){n.value=!0,_.value="";try{l.value=await i.client.call("settings.update",{source:"execution",scope:"user",expectedRevision:l.value.revision,document:{sandbox:b.value,network:h.value}},B),b.value=l.value.sandbox,h.value=l.value.network}catch(u){_.value=C(u)}finally{n.value=!1}}}return Y(i,g,R),F(g),(o,u)=>(p(),m("article",Z,[e("header",null,[e("h2",ee,t(s(a)("Permissions","权限")),1),e("p",null,t(s(a)("User-level command rules apply to process-starting agent tools in every session. Deny wins; Allow never overrides a denied permission preset.","用户命令规则适用于所有会话中启动进程的代理工具。拒绝优先;允许规则不会越过权限预设的拒绝。")),1)]),O(Q,{busy:n.value,error:f.value,saved:k.value&&!R.value,onReload:g},null,8,["busy","error","saved"]),_.value?(p(),m("p",ae,[N(t(_.value)+" ",1),e("button",{class:"ui-button","data-variant":"ghost",disabled:n.value,onClick:g},t(s(a)("Reload","重新加载")),9,se)])):x("",!0),l.value?(p(),m("form",{key:1,class:"settings-card settings-form",onSubmit:u[2]||(u[2]=U(r=>P(),["prevent"]))},[e("h3",null,t(s(a)("Execution","执行")),1),e("p",null,t(s(a)("Applies to new commands on this execution host. Running processes keep their boundary. A platform without a sandbox backend fails the command instead of running it unsandboxed.","适用于此执行主机上的新命令。已运行的进程保留原边界。没有沙盒后端的平台会让命令失败,而不是不加隔离地运行。")),1),S.value&&S.value.available===!1?(p(),m("p",te,t(s(a)("Sandbox is unavailable on this host: ","此主机上沙盒不可用:"))+t(S.value.reason),1)):x("",!0),e("fieldset",{class:"settings-form",disabled:n.value||!s(i).supports("settings.update")},[e("label",null,[y(e("input",{"onUpdate:modelValue":u[0]||(u[0]=r=>b.value=r),type:"checkbox"},null,512),[[M,b.value]]),N(t(s(a)("Sandbox — run commands isolated from the host","沙盒 — 在隔离环境中运行命令")),1)]),e("label",null,[y(e("input",{"onUpdate:modelValue":u[1]||(u[1]=r=>h.value=r),type:"checkbox"},null,512),[[M,h.value]]),N(t(s(a)("Network — allow outbound connections while sandboxed","网络 — 沙盒内允许出站连接")),1)])],8,ne),e("p",oe,t(s(a)("Network applies only while the sandbox is on. With the sandbox off, commands run as the daemon user with this host's files and network.","网络仅在沙盒开启时生效。沙盒关闭时,命令以守护进程用户的身份、使用此主机的文件和网络运行。")),1),e("div",le,[e("button",{class:"ui-button","data-variant":"primary",disabled:n.value||!V.value||!s(i).supports("settings.update")},t(s(a)("Save execution settings","保存执行设置")),9,ie)])],32)):x("",!0),v.value?(p(),m("form",{key:2,class:"settings-form",onSubmit:U($,["prevent"])},[e("section",ue,[e("h3",null,t(s(a)("Command rules","命令规则")),1),e("fieldset",{disabled:n.value||!s(i).supports("permission.set_rules")},[e("legend",null,t(s(a)("Match commands by words, not wildcards or regular expressions.","按单词匹配命令,不支持通配符或正则表达式。")),1),(p(!0),m(J,null,L(d.value,(r,E)=>(p(),m("div",{key:E,class:"rule-row"},[y(e("input",{"onUpdate:modelValue":w=>r.command=w,class:"ui-field","data-size":"md","aria-label":s(a)("Command","命令"),placeholder:"git status",required:""},null,8,de),[[j,r.command]]),y(e("select",{"onUpdate:modelValue":w=>r.match=w,class:"ui-field","data-size":"md","aria-label":s(a)("Match","匹配方式")},[e("option",ve,t(s(a)("Exact","精确")),1),e("option",me,t(s(a)("Prefix","前缀")),1)],8,ce),[[A,r.match]]),y(e("select",{"onUpdate:modelValue":w=>r.decision=w,class:"ui-field","data-size":"md","aria-label":s(a)("Decision","决策")},[e("option",be,t(s(a)("Allow","允许")),1),e("option",he,t(s(a)("Deny","拒绝")),1)],8,pe),[[A,r.decision]]),e("button",{class:"ui-button","data-size":"md","data-variant":"danger-ghost",type:"button",onClick:w=>d.value.splice(E,1)},t(s(a)("Remove","移除")),9,fe)]))),128)),d.value.length?x("",!0):(p(),m("p",_e,t(s(a)("No command rules. The session permission preset and approval flow decide each call.","尚无命令规则。每次调用由会话权限预设和审批流程决定。")),1)),e("button",{class:"ui-button","data-size":"md","data-variant":"secondary",type:"button",onClick:u[3]||(u[3]=r=>d.value.push({command:"",match:"prefix",decision:"deny"}))},t(s(a)("Add rule","添加规则")),1)],8,re)]),e("footer",we,[e("button",{class:"ui-button","data-size":"md","data-variant":"secondary",type:"button",disabled:n.value,onClick:g},t(s(a)("Reload","重新加载")),9,ge),e("button",{class:"ui-button","data-size":"md","data-variant":"primary",disabled:n.value||!D.value||!s(i).supports("permission.set_rules")},t(s(a)("Save rules","保存规则")),9,xe)])],32)):x("",!0)]))}}),Ne=K(ye,[["__scopeId","data-v-8d0f4351"]]);export{Ne as default};
@@ -0,0 +1 @@
1
+ import{d as N,x as B,c as u,e as a,t,u as l,j as T,l as p,D as E,C as x,a as _,L as j,b as S,B as F,F as w,E as V,r as v,z as P,o as d}from"./vendor-vue-CncuOShJ.js";import{u as q}from"./settings-general-dc8P6dA0.js";import{u as O,q as A,i as H,k as J}from"./index-CenMTLFY.js";import{_ as K}from"./GeneralSettingsStatus.vue_vue_type_script_setup_true_lang-CWInOGTv.js";import{b as Q,r as W,m as $}from"./context-Grqd_9Lt.js";const X={class:"settings-page"},Y={"data-route-heading":"",tabindex:"-1"},Z=["disabled"],ee={value:"path"},ae=["placeholder"],te={key:0},le={class:"checkbox-label"},se={class:"ui-button","data-size":"md","data-variant":"primary"},ne={class:"search-label"},oe={key:0},ie={key:0,class:"ui-banner","data-tone":"danger"},ue={class:"settings-actions"},de=["onUpdate:modelValue","aria-label","disabled"],re=["value"],ce=["disabled","onClick"],ve=["disabled","onClick"],pe=["disabled","onClick"],me=["disabled","onClick"],be=["disabled","onClick"],fe={key:0,role:"status"},_e=["disabled"],ge=N({__name:"PluginSettings",setup(he){const s=q(),c=O(),C=v(),g=v({}),h=v("path"),k=v(""),m=v(""),b=v(""),I=v(!1),L=v(""),r=v(!1),y=v(""),U=P(()=>!!k.value||!!m.value||!!b.value);Q(U);const D=P(()=>{var i;return((i=C.value)==null?void 0:i.filter(o=>o.name.toLocaleLowerCase().includes(L.value.toLocaleLowerCase())))??[]});async function R(){C.value=await c.client.call("plugin.list",{},A),g.value=Object.fromEntries(C.value.map(i=>{var o;return[i.name,i.use??((o=i.candidates[0])==null?void 0:o.id)??""]}))}async function z(){r.value=!0,y.value="";try{if(!c.supports("plugin.list"))throw new Error(s("Plugin management is not available on this server.","此服务器不支持插件管理。"));await R()}catch(i){y.value=$(i)}finally{r.value=!1}}async function f(i,o){if(!r.value&&!(["plugin.install","plugin.enable","plugin.update","plugin.reload"].includes(i)&&!window.confirm(s("Plugins execute trusted code and configured commands with your user privileges. Continue?","插件会以您的用户权限执行受信任代码和配置命令。是否继续?")))&&!(i==="plugin.remove"&&!window.confirm(s("Remove this installed plugin? Its content will be withdrawn.","移除此已安装插件?其提供的内容也将撤回。")))){r.value=!0,y.value="";try{await c.client.call(i,o,H,18e4),i==="plugin.install"&&(k.value="",m.value="",b.value=""),await R()}catch(e){y.value=$(e)}finally{r.value=!1}}}function G(){const i=k.value.trim();i&&f("plugin.install",{source:h.value==="path"?{path:i}:{git:i,...m.value.trim()?{ref:m.value.trim()}:{}},...b.value.trim()?{id:b.value.trim()}:{},enable:I.value})}return W(c,z,U),B(z),(i,o)=>(d(),u("article",X,[a("header",null,[a("h2",Y,t(l(s)("Plugins","插件")),1),a("p",null,t(l(s)("Install local or Git packages, select implementations and manage their lifecycle. Locked system plugins cannot be disabled or replaced.","安装本地或 Git 包、选择实现并管理生命周期。锁定的系统插件不可禁用或替换。")),1)]),T(K,{busy:r.value,error:y.value,onReload:z},null,8,["busy","error"]),a("form",{class:"settings-card settings-form",onSubmit:F(G,["prevent"])},[a("h3",null,t(l(s)("Install plugin","安装插件")),1),a("fieldset",{disabled:r.value||!l(c).supports("plugin.install")},[a("label",null,[a("span",null,t(l(s)("Source type","来源类型")),1),p(a("select",{"onUpdate:modelValue":o[0]||(o[0]=e=>h.value=e),class:"ui-field","data-size":"md"},[a("option",ee,t(l(s)("Local directory","本地目录")),1),o[6]||(o[6]=a("option",{value:"git"},"Git",-1))],512),[[E,h.value]])]),a("label",null,[a("span",null,t(l(s)("Source","来源")),1),p(a("input",{"onUpdate:modelValue":o[1]||(o[1]=e=>k.value=e),class:"ui-field","data-size":"md",placeholder:h.value==="path"?"/path/to/plugin":"https://github.com/owner/plugin.git",required:""},null,8,ae),[[x,k.value]])]),h.value==="git"?(d(),u("label",te,[a("span",null,t(l(s)("Git ref (optional)","Git 引用(可选)")),1),p(a("input",{"onUpdate:modelValue":o[2]||(o[2]=e=>m.value=e),class:"ui-field","data-size":"md"},null,512),[[x,m.value]])])):_("",!0),a("label",null,[a("span",null,t(l(s)("Installation ID (optional)","安装 ID(可选)")),1),p(a("input",{"onUpdate:modelValue":o[3]||(o[3]=e=>b.value=e),class:"ui-field","data-size":"md"},null,512),[[x,b.value]])]),a("label",le,[p(a("input",{"onUpdate:modelValue":o[4]||(o[4]=e=>I.value=e),type:"checkbox"},null,512),[[j,I.value]]),S(t(l(s)("Enable after installation (executes plugin code)","安装后启用(执行插件代码)")),1)]),a("button",se,t(l(s)("Install","安装")),1)],8,Z)],32),a("label",ne,[a("span",null,t(l(s)("Search plugins","搜索插件")),1),p(a("input",{"onUpdate:modelValue":o[5]||(o[5]=e=>L.value=e),class:"ui-field","data-size":"md",type:"search"},null,512),[[x,L.value]])]),(d(!0),u(w,null,V(D.value,e=>(d(),u("section",{key:e.name,class:"settings-card"},[a("h3",null,[S(t(e.name)+" ",1),e.locked?(d(),u("small",oe,t(l(s)("Locked","已锁定")),1)):_("",!0)]),a("p",null,[S(t(e.status??(e.off?"off":"content")),1),e.use?(d(),u(w,{key:0},[S(" · "+t(e.use),1)],64)):_("",!0)]),e.error?(d(),u("p",ie,t(e.error),1)):_("",!0),(d(!0),u(w,null,V(e.refused,n=>(d(),u("p",{key:n.kind,class:"ui-banner","data-tone":"danger"},t(n.kind)+": "+t(n.error),1))),128)),a("div",ue,[p(a("select",{"onUpdate:modelValue":n=>g.value[e.name]=n,class:"ui-field","data-size":"md","aria-label":l(s)("Implementation","实现"),disabled:r.value||e.locked},[(d(!0),u(w,null,V(e.candidates,n=>(d(),u("option",{key:n.id,value:n.id},t(n.id)+" ("+t(n.kinds.join(", "))+")",9,re))),128))],8,de),[[E,g.value[e.name]]]),a("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:r.value||e.locked||!g.value[e.name]||!l(c).supports("plugin.enable"),onClick:n=>f("plugin.enable",{name:e.name,use:g.value[e.name]})},t(l(s)("Enable / use","启用 / 使用")),9,ce),a("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:r.value||e.locked||e.off||!l(c).supports("plugin.disable"),onClick:n=>f("plugin.disable",{name:e.name})},t(l(s)("Disable","禁用")),9,ve),a("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:r.value||e.off||!l(c).supports("plugin.reload"),onClick:n=>f("plugin.reload",{name:e.name})},t(l(s)("Reload","重新加载")),9,pe)]),(d(!0),u(w,null,V(e.candidates.filter(n=>n.id!=="builtin"&&n.id!=="default"),n=>(d(),u("div",{key:n.id,class:"candidate-row"},[a("code",null,t(n.id),1),n.git?(d(),u("button",{key:0,class:"ui-button","data-size":"sm","data-variant":"secondary",disabled:r.value||!l(c).supports("plugin.update"),onClick:M=>f("plugin.update",{id:n.id})},t(l(s)("Update","更新")),9,me)):_("",!0),a("button",{class:"ui-button","data-size":"sm","data-variant":"danger-ghost",disabled:r.value||e.locked||!l(c).supports("plugin.remove"),onClick:M=>f("plugin.remove",{id:n.id})},t(l(s)("Remove","移除")),9,be)]))),128))]))),128)),C.value&&!D.value.length?(d(),u("p",fe,t(l(s)("No matching plugins.","没有匹配的插件。")),1)):_("",!0),a("button",{class:"ui-button","data-size":"md","data-variant":"secondary",disabled:r.value,onClick:z},t(l(s)("Refresh","刷新")),9,_e)]))}}),xe=J(ge,[["__scopeId","data-v-488afb95"]]);export{xe as default};
@@ -0,0 +1 @@
1
+ fieldset[data-v-488afb95]{display:grid;gap:var(--space-4);min-width:0;padding:0;border:0}label[data-v-488afb95]{display:grid;gap:var(--space-2)}.checkbox-label[data-v-488afb95],.candidate-row[data-v-488afb95]{display:flex;align-items:center;gap:var(--space-3)}.candidate-row[data-v-488afb95]{margin-top:var(--space-3);flex-wrap:wrap}.search-label[data-v-488afb95]{margin-block:var(--space-4)}