@moonshot-ai/kimi-code 2.2.0 → 2.3.1

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 (89) hide show
  1. package/dist/main.mjs +37415 -34827
  2. package/dist-web/assets/CodeBlockNode-Dg2zk5_M.js +43 -0
  3. package/dist-web/assets/PreCodeBlock-aZLOMBKx.js +1 -0
  4. package/dist-web/assets/{Tooltip-DGZLqZ7K.js → Tooltip-4PNR_f15.js} +1 -1
  5. package/dist-web/assets/{abnfDiagram-VRR7QNED-BjZkDU71.js → abnfDiagram-VRR7QNED-z_-0ai5E.js} +1 -1
  6. package/dist-web/assets/{arc-iJsCFL-l.js → arc-Kxg5RAqF.js} +1 -1
  7. package/dist-web/assets/{architectureDiagram-ZJ3FMSHR-DgSeucQZ.js → architectureDiagram-ZJ3FMSHR-2Xshi7A1.js} +1 -1
  8. package/dist-web/assets/{blockDiagram-677ZJIJ3-D-b-mXgF.js → blockDiagram-677ZJIJ3-XV6naLkL.js} +1 -1
  9. package/dist-web/assets/{c4Diagram-LMCZKHZV-BXuDG7QH.js → c4Diagram-LMCZKHZV-CSkBryI0.js} +1 -1
  10. package/dist-web/assets/channel-CLLh9fFD.js +1 -0
  11. package/dist-web/assets/{chunk-2Q5K7J3B-9PYvtmha.js → chunk-2Q5K7J3B-CQzCXLEo.js} +1 -1
  12. package/dist-web/assets/{chunk-32BRIVSS-CLNEOpa3.js → chunk-32BRIVSS-Bb3U5zL8.js} +1 -1
  13. package/dist-web/assets/{chunk-5VM5RSS4-BnPBVsDt.js → chunk-5VM5RSS4-C2_xpzY3.js} +1 -1
  14. package/dist-web/assets/{chunk-EX3LRPZG-B5sNtRSy.js → chunk-EX3LRPZG-BMjh3OP2.js} +1 -1
  15. package/dist-web/assets/{chunk-JWPE2WC7-D-sxo7as.js → chunk-JWPE2WC7-Bgwiccxa.js} +1 -1
  16. package/dist-web/assets/{chunk-MOJQB5TN-CPChu7zn.js → chunk-MOJQB5TN-CClISXJW.js} +1 -1
  17. package/dist-web/assets/{chunk-RYQCIY6F-CqdXJBtY.js → chunk-RYQCIY6F-H_GYUYTT.js} +1 -1
  18. package/dist-web/assets/{chunk-V7JOEXUC-Dq7hJ1E_.js → chunk-V7JOEXUC-B6kqo8yw.js} +1 -1
  19. package/dist-web/assets/{chunk-VR4S4FIN-DqbZLM7b.js → chunk-VR4S4FIN-Cm7c9b3N.js} +1 -1
  20. package/dist-web/assets/{chunk-XXDRQBXY-Ds7teyKk.js → chunk-XXDRQBXY-Vyf77H8-.js} +1 -1
  21. package/dist-web/assets/classDiagram-OUVF2IWQ-B90-0icA.js +1 -0
  22. package/dist-web/assets/classDiagram-v2-EOCWNBFH-B90-0icA.js +1 -0
  23. package/dist-web/assets/{cose-bilkent-JH36ORCC-DPZKSiow.js → cose-bilkent-JH36ORCC-CEByoa7c.js} +1 -1
  24. package/dist-web/assets/{cynefin-VYW2F7L2-Cn0w3Ba_.js → cynefin-VYW2F7L2-rK0CO-KU.js} +1 -1
  25. package/dist-web/assets/{cynefinDiagram-TSTJHNR4-QO_FhdFv.js → cynefinDiagram-TSTJHNR4-BkQYJXmy.js} +1 -1
  26. package/dist-web/assets/{dagre-VKFMJZFB-CxdDh_H-.js → dagre-VKFMJZFB-D3G9Vr0i.js} +1 -1
  27. package/dist-web/assets/{diagram-FQU43EPY-BWSognsT.js → diagram-FQU43EPY-D1AImL9B.js} +1 -1
  28. package/dist-web/assets/{diagram-G47NLZAW-CZSO-0jd.js → diagram-G47NLZAW-gEcij-QO.js} +1 -1
  29. package/dist-web/assets/{diagram-NH7WQ7WH-Cwtl6YSd.js → diagram-NH7WQ7WH-D_4fbKb7.js} +1 -1
  30. package/dist-web/assets/{diagram-OA4YK3LP-CfNlfr8r.js → diagram-OA4YK3LP-538HDlwm.js} +1 -1
  31. package/dist-web/assets/{diagram-WEI45ONY-Dnb8XHFb.js → diagram-WEI45ONY-BMdVxUiC.js} +1 -1
  32. package/dist-web/assets/{ebnfDiagram-CCIWWBDH-jYwb0Iuu.js → ebnfDiagram-CCIWWBDH-CfKSmD2e.js} +1 -1
  33. package/dist-web/assets/{erDiagram-Q63AITRT-BO-rbURM.js → erDiagram-Q63AITRT-B7q8kFgm.js} +1 -1
  34. package/dist-web/assets/{flowDiagram-23GEKE2U-s7QSUi5I.js → flowDiagram-23GEKE2U-BwfyZNsI.js} +1 -1
  35. package/dist-web/assets/{ganttDiagram-NO4QXBWP-Dmg9yeHR.js → ganttDiagram-NO4QXBWP-BRY0H5yQ.js} +1 -1
  36. package/dist-web/assets/{gitGraphDiagram-IHSO6WYX-CkENa9tF.js → gitGraphDiagram-IHSO6WYX-kNRoKY5x.js} +1 -1
  37. package/dist-web/assets/index-8y9QBU_r.js +1142 -0
  38. package/dist-web/assets/index-D4gW_Ktl.css +32 -0
  39. package/dist-web/assets/{index-DFJHK8jJ.js → index-D7dp20Xg.js} +1 -1
  40. package/dist-web/assets/{index-1w7mqrDT.js → index-DLFZel9T.js} +8 -8
  41. package/dist-web/assets/index10-DV07IRf8.js +8 -0
  42. package/dist-web/assets/index5-C8WgbVEm.js +1 -0
  43. package/dist-web/assets/index6-C48ZivJ7.js +1 -0
  44. package/dist-web/assets/index8-B0-UsTuT.js +2 -0
  45. package/dist-web/assets/index9-djyIJPZT.js +1 -0
  46. package/dist-web/assets/{infoDiagram-FWYZ7A6U-Cv8rxZZI.js → infoDiagram-FWYZ7A6U-CM68LLn5.js} +1 -1
  47. package/dist-web/assets/{ishikawaDiagram-FXEZZL3T-CuA1ztjv.js → ishikawaDiagram-FXEZZL3T-HdJO8tF7.js} +1 -1
  48. package/dist-web/assets/{journeyDiagram-5HDEW3XC-CVcfSie7.js → journeyDiagram-5HDEW3XC-DCD13lTN.js} +1 -1
  49. package/dist-web/assets/{kanban-definition-HUTT4EX6-CW1B_N8v.js → kanban-definition-HUTT4EX6-CH__Aque.js} +1 -1
  50. package/dist-web/assets/layout-DcalC1b9.js +4 -0
  51. package/dist-web/assets/{linear-SXgBlKNU.js → linear-B6spGXyl.js} +1 -1
  52. package/dist-web/assets/markstream-CqtaxtIA.js +7 -0
  53. package/dist-web/assets/{mermaid.core-07lp9GgB.js → mermaid.core-DY8EMjrF.js} +4 -4
  54. package/dist-web/assets/{mindmap-definition-LN4V7U3C-DB5YaY0-.js → mindmap-definition-LN4V7U3C-B25hoRAR.js} +1 -1
  55. package/dist-web/assets/{pegDiagram-2B236MQR-DPK1WhFw.js → pegDiagram-2B236MQR-D11k8twc.js} +1 -1
  56. package/dist-web/assets/{pieDiagram-ENE6RG2P-Bf4-DpBr.js → pieDiagram-ENE6RG2P-CwYDxGla.js} +1 -1
  57. package/dist-web/assets/preCodeDiffMetrics-CMO2XhRi.js +1 -0
  58. package/dist-web/assets/{quadrantDiagram-ABIIQ3AL-CDn1Eva8.js → quadrantDiagram-ABIIQ3AL-BPSI_vWW.js} +1 -1
  59. package/dist-web/assets/{railroadDiagram-RFXS5EU6-q0FBCwSb.js → railroadDiagram-RFXS5EU6-I9sb5DNu.js} +1 -1
  60. package/dist-web/assets/{requirementDiagram-TGXJPOKE-BCC0I0NM.js → requirementDiagram-TGXJPOKE-DeasTYe2.js} +1 -1
  61. package/dist-web/assets/{sankeyDiagram-HTMAVEWB-CrXP25QE.js → sankeyDiagram-HTMAVEWB-CqlcFoHA.js} +1 -1
  62. package/dist-web/assets/{sequenceDiagram-DBY2YBRQ-BybZOFTL.js → sequenceDiagram-DBY2YBRQ-BGEjue4x.js} +1 -1
  63. package/dist-web/assets/{sizeCapture-X5ZJPWSS-Wzxe-vov.js → sizeCapture-X5ZJPWSS-TaJA43Gu.js} +1 -1
  64. package/dist-web/assets/{stateDiagram-2N3HPSRC-B-6wH_c6.js → stateDiagram-2N3HPSRC-D4HN_SRR.js} +1 -1
  65. package/dist-web/assets/stateDiagram-v2-6OUMAXLB-BAKG7OO2.js +1 -0
  66. package/dist-web/assets/{swimlanes-5IMT3BWC-D2TiuF7A.js → swimlanes-5IMT3BWC-tHqSJXwl.js} +2 -2
  67. package/dist-web/assets/swimlanesDiagram-G3AALYLV-CjkdSqYs.js +8 -0
  68. package/dist-web/assets/{timeline-definition-FHXFAJF6-fKtSi0CT.js → timeline-definition-FHXFAJF6-BOOttnU8.js} +1 -1
  69. package/dist-web/assets/{vennDiagram-L72KCM5P-BDc6eB4F.js → vennDiagram-L72KCM5P-BnRZHHu9.js} +1 -1
  70. package/dist-web/assets/{vue.runtime.esm-bundler-X5RdzQbe.js → vue.runtime.esm-bundler-Bvx-UDBM.js} +1 -1
  71. package/dist-web/assets/{wardleyDiagram-EHGQE667-DeA9MR_N.js → wardleyDiagram-EHGQE667-Cex5DIJb.js} +1 -1
  72. package/dist-web/assets/{xychartDiagram-FW5EYKEG-gxnf-2A7.js → xychartDiagram-FW5EYKEG-CO75_OFH.js} +1 -1
  73. package/dist-web/index.html +2 -2
  74. package/package.json +10 -8
  75. package/dist-web/assets/CodeBlockNode-C1W11AeO.js +0 -29
  76. package/dist-web/assets/channel-CPw-eGij.js +0 -1
  77. package/dist-web/assets/classDiagram-OUVF2IWQ-gjB3Jhxa.js +0 -1
  78. package/dist-web/assets/classDiagram-v2-EOCWNBFH-gjB3Jhxa.js +0 -1
  79. package/dist-web/assets/index-Bka4JnyA.js +0 -1134
  80. package/dist-web/assets/index-CY1AHs2J.css +0 -32
  81. package/dist-web/assets/index-QvRKRZhc.js +0 -7
  82. package/dist-web/assets/index10-XHMeQILg.js +0 -2
  83. package/dist-web/assets/index11-efQCe3Z8.js +0 -8
  84. package/dist-web/assets/index5-DeylqHIW.js +0 -1
  85. package/dist-web/assets/index6-Bjn2CoJ6.js +0 -1
  86. package/dist-web/assets/index7-BUAQIV8C.js +0 -1
  87. package/dist-web/assets/index8-BjdKteDo.js +0 -1
  88. package/dist-web/assets/stateDiagram-v2-6OUMAXLB-B0aN8Hfn.js +0 -1
  89. package/dist-web/assets/swimlanesDiagram-G3AALYLV-B1JZNV9r.js +0 -8
@@ -0,0 +1,43 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markstream-CqtaxtIA.js","assets/index-8y9QBU_r.js","assets/index-D4gW_Ktl.css"])))=>i.map(i=>d[i]);
2
+ import{bR as Ya,cd as Ga,bQ as aa,M as oa,bl as Ja,af as Wt,bY as Qa,ce as Xa,b$ as ra,aU as S,c0 as Za,c1 as Ka,c2 as eo,a0 as Jn,aD as ia,bE as A,az as lo,cf as Qn,ca as to,cg as no,aI as ua,aL as ul,s as rt,A as Xn,bJ as il,aY as $l,aw as nt,u as Zn,I as ao,bL as oo,v as U,au as it,t as At,bB as ro,bb as Yt,bk as sa,q as m,b7 as io,ch as uo,ci as so,cj as fo,ck as co,as as O,cl as vo,cm as mo,cn as ho,co as po,cp as go,cq as yo,cr as bo,cs as Kn,ct as ea,bO as wo,T as ko,cu as xo,b_ as So}from"./index-8y9QBU_r.js";import{B as la,g as Co,Q as Mo}from"./PreCodeBlock-aZLOMBKx.js";import{i as se,t as at}from"./safeRaf-DGuzXxDK.js";var ot=(C,b,M)=>new Promise((ve,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?ve(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,ve;const ee=C,R=typeof ee?.createCodeBlockRuntime=="function"||typeof ee?.useMonaco=="function"?ee:C?.default,he=(b=R?.createCodeBlockRuntime)!=null?b:R?.useMonaco;return typeof he!="function"?null:{createCodeBlockRuntime:n=>he.call(R,n),detectLanguage:(M=R?.detectLanguage)==null?void 0:M.bind(R),preloadStreamDiffs:(ve=R?.preloadStreamDiffs)==null?void 0:ve.bind(R)}})(yield Ya(()=>import("./markstream-CqtaxtIA.js"),__vite__mapDeps([0,1,2]))),!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?.preloadStreamDiffs;typeof M=="function"&&(yield M()),Ut=!0}).finally(()=>{Hl=null}),Hl)})})(Ol),Ga(),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((ve,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?ve(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=aa(oa({__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 ve=null;const{t:ee}=ra(),R=m(()=>{const k=b.code||"",H=k.trim().toLowerCase();return H.startsWith("<!doctype")||H.startsWith("<html")||H.startsWith("<body")?k:`<!doctype html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <style>
8
+ html, body {
9
+ margin: 0;
10
+ padding: 0;
11
+ height: 100%;
12
+ background-color: ${b.isDark?"#020617":"#ffffff"};
13
+ color: ${b.isDark?"#e5e7eb":"#020617"};
14
+ }
15
+ body {
16
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;
17
+ }
18
+ </style>
19
+ </head>
20
+ <body>
21
+ ${k}
22
+ </body>
23
+ </html>`}),he=m(()=>{return k=b.htmlPreviewSandbox,H=b.htmlPreviewAllowScripts,typeof k=="string"?((function(je){if(!M||typeof console>"u"||ve===je)return;const Q=(function(El){return new Set(El.trim().toLowerCase().split(/\s+/).filter(Boolean))})(je);Q.has("allow-scripts")&&Q.has("allow-same-origin")&&(ve=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 ia(()=>{typeof window<"u"&&window.addEventListener("keydown",n)}),ua(()=>{typeof window<"u"&&window.removeEventListener("keydown",n)}),(k,H)=>(ul(),rt(ko,{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 Q;return(Q=b.onClose)==null?void 0:Q.call(b)})},[U("div",{class:"html-preview-frame",onClick:H[1]||(H[1]=wo(()=>{},["stop"]))},[U("div",No,[U("div",Eo,[H[3]||(H[3]=U("span",{class:"html-preview-frame__dot"},null,-1)),U("span",Fo,Yt(b.title||sa(ee)("common.preview")||"Preview"),1)]),U("button",{type:"button",class:"html-preview-frame__close",onClick:H[0]||(H[0]=je=>{var Q;return(Q=b.onClose)==null?void 0:Q.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"],Go=aa(oa({__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,ve,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=Ja(),Q=Wt(Qa,null),El=Wt("markstreamHostScrollManaged",null),da=Wt(Xa,void 0),fa=m(()=>So(n,je));function Wo(e,l){}const Gt=Jn(),Jt=m(()=>{const e=Gt?.vnode.props;return!(!e||!e.onPreviewCode&&!e["onPreview-code"])}),{t:Qt}=ra(),h=S(null),ne=S(null),ut=S(!1),we=S(zn(n.node.language,n.node.code,Re())),st=m(()=>mo(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,ct=!1;const ca=Za(),Fl=Ka(),vt=eo(),Fe=io(null),W=S(typeof window>"u"||!vt.value),va=(ee=(ve=(M=Jn())==null?void 0:M.vnode.el)==null?void 0:ve.textContent)!=null?ee:"",ma=typeof window<"u"&&String((R=n.node.code)!=null?R:"").length>0&&va.includes(String(n.node.code)),Xt=S(!ma);ia(()=>{Xt.value=!0}),typeof window<"u"&&A([()=>ne.value,vt],([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 c=(r=(d=Fl?.value.heavyBlockMargin)!=null?d:Fl?.value.rootMargin)!=null?r:"0px",s=ca(e,{rootMargin:c,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}),lo(()=>{var e;p=!0,(function(){const l=Ne;Q&&l&&(Ne="",Q.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:()=>{}}),Y=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),gt=()=>{},We=()=>{},yt=()=>{},tl=null,Be=null,cl=null,vl=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(()=>uo(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?.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 ho(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(()=>po({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(()=>so(gl.value));function un(e){return 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,Y=t.getDiffEditorView||Y,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=no,wa=bo,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),Ye=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=fo(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 Yl(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 cn(){return!i.value&&n.stream!==!1&&n.loading!==!1}const kl=S(cn());function Gl(){return cn()||kl.value}const vn=m(()=>i.value?null:Ul.value==null||Gl()?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
+ `?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||Gl()?Yl(vn.value):Yl(e)}),Sa=m(()=>{const e=n.estimatedHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}),Jl=S(null);function Ge(){const e=Jl.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}const Ht=m(()=>{const e=Ge();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=Yl(Ul.value),l=Yl(vn.value),t=Gl(),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=Ye.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||Ge()!=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(){Jl.value=null}function bn(){var e,l,t,a,o,d,r,u;const c=(e=ne.value)==null?void 0:e.querySelector("pre.code-pre-fallback"),s=Y(),v=(l=c?.scrollTop)!=null?l:0;(o=(a=(t=s?.getOriginalEditor)==null?void 0:t.call(s))==null?void 0:a.setScrollTop)==null||o.call(a,v),(u=(r=(d=s?.getModifiedEditor)==null?void 0:d.call(s))==null?void 0:r.setScrollTop)==null||u.call(r,v)}function wn(){return D(this,null,function*(){return i.value?(Et(),xl(),X(!0),bn(),ye(),nl.value=!0,yield O(),X(!0),yield ke(),X(!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();X(!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 Ql();const o=a.getBoundingClientRect().height;if(o>0&&Math.abs(o-t)<=2)return!0}return!1})})())&&(F.value=!0,yield O(),xl(),X(!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(),X(!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`;Ye.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&&Ql(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&&(Ye.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=Ge();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=Y())==null?void 0:e.getModifiedEditor)==null?void 0:l.call(e))!=null?t:Y():ie(),u=fl(),c=(a=u?.EditorOption)==null?void 0:a.fontInfo;if(r&&c!=null){const s=(o=r.getOption)==null?void 0:o.call(r,c),v=s?.fontSize;if(typeof v=="number"&&Number.isFinite(v)&&v>0)return v}}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 c=window.getComputedStyle(u).fontSize,s=c&&c.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?.EditorOption)==null?void 0:l.lineHeight;if(r!=null){const u=(t=e?.getOption)==null?void 0:t.call(e,r);if(typeof u=="number"&&u>0)return u}}catch{}const 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=xo(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,c,s,v,g,y,j;try{const z=i.value?Y():null,f=i.value?z:ie();if(!f)return null;if(z?.getOriginalEditor&&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?.layout)==null||t.call(B),(a=x?.layout)==null||a.call(x);const P=((o=B?.getContentHeight)==null?void 0:o.call(B))||0,Z=((d=x?.getContentHeight)==null?void 0:d.call(x))||0,be=Math.max(P,Z);if(be>0)return Math.ceil(be);const te=((c=(u=(r=B?.getModel)==null?void 0:r.call(B))==null?void 0:u.getLineCount)==null?void 0:c.call(u))||1,L=((g=(v=(s=x?.getModel)==null?void 0:s.call(x))==null?void 0:v.getLineCount)==null?void 0:g.call(v))||1,$=Math.max(te,L),I=Math.max(al(B),al(x)),G=Sn();return Math.ceil($*I+G+0)}if(f?.getContentHeight){(y=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?.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 c=a.length===3?a.split("").map(s=>`${s}${s}`).join(""):a;return .2126*Number.parseInt(c.slice(0,2),16)+.7152*Number.parseInt(c.slice(2,4),16)+.0722*Number.parseInt(c.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=Y())==null?void 0:e.getModifiedEditor)==null?void 0:l.call(e))!=null?t:Y():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&&(Ye.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,c;const s=h.value,v=ne.value;if(!s||!v)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?.getPropertyValue("--vscode-editor-foreground"))!=null?l:"").trim(),B=String((t=f?.getPropertyValue("--vscode-editor-background"))!=null?t:"").trim(),x=String((o=(a=f?.getPropertyValue("--vscode-editor-selectionBackground"))!=null?a:f?.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?o:"").trim(),P=q||String((r=(d=N?.color)!=null?d:f?.color)!=null?r:"").trim(),Z=B||String((c=(u=w?.backgroundColor)!=null?u:f?.backgroundColor)!=null?c:"").trim(),be=(function(){var te,L,$,I,G;try{const ce=i.value?($=(L=(te=Y())==null?void 0:te.getModifiedEditor)==null?void 0:L.call(te))!=null?$:Y():ie(),oe=fl(),re=(I=oe?.EditorOption)==null?void 0:I.fontInfo;if(ce&&re!=null){const K=(G=ce.getOption)==null?void 0:G.call(ce,re),J=K?.typicalHalfwidthCharacterWidth;if(typeof J=="number"&&Number.isFinite(J)&&J>0)return J}}catch{}return null})();if(be!=null&&(wl.value=be),i.value){const te=(L,$)=>{$?(v.style.setProperty(L,$),g.style.setProperty(L,$)):(v.style.removeProperty(L),g.style.removeProperty(L))};for(const[L,$]of Object.entries(hn(v.classList.contains("is-dark"))))te(L,$);return P?(v.style.setProperty("--markstream-diff-editor-fg",P),g.style.setProperty("--vscode-editor-foreground",P)):(v.style.removeProperty("--markstream-diff-editor-fg"),g.style.removeProperty("--vscode-editor-foreground")),Z?(v.style.setProperty("--markstream-diff-editor-bg",Z),v.style.setProperty("--markstream-diff-panel-bg",Z),v.style.setProperty("--markstream-diff-panel-bg-soft",Z),v.style.setProperty("--markstream-diff-panel-bg-strong",Z),g.style.setProperty("--vscode-editor-background",Z),g.style.backgroundColor=Z):(v.style.removeProperty("--markstream-diff-editor-bg"),v.style.removeProperty("--markstream-diff-panel-bg"),v.style.removeProperty("--markstream-diff-panel-bg-soft"),v.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),G=Pn(L);return $?I!=null&&I>170||G!=null&&G<110:I!=null&&I<85||G!=null&&G>190})(Z,P,v.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(v){return pa.value||un(v)})(e))return;const o=Math.ceil(l),d=Math.ceil(t)-o;if(Math.abs(d)<=1)return;const r=(function(v){var g,y;if(typeof window>"u")return null;const j=(g=v?.ownerDocument)!=null?g:document,z=j.scrollingElement||j.documentElement||j.body;let f=(y=v?.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,c=r===u.body||r===u.documentElement||r===u.scrollingElement,s=c?0:r.getBoundingClientRect().top;e.getBoundingClientRect().top-s>=0||(c&&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=Ge();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=Ge();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 Je(){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 Qe(){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||""),c=r>0?r:Number.isFinite(u)&&u>0?Math.ceil(u):0,s=i.value?(function(){var x,P,Z,be,te,L,$,I,G,ce,oe,re;if(Se())return null;try{const K=Y(),J=(x=K?.getOriginalEditor)==null?void 0:x.call(K),rl=(P=K?.getModifiedEditor)==null?void 0:P.call(K);if(!J||!rl)return null;const qa=((te=(be=(Z=J.getModel)==null?void 0:Z.call(J))==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(J),al(rl)),Aa=Sn(),Ua=Math.max((ce=(G=J.getContentHeight)==null?void 0:G.call(J))!=null?ce: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,v=i.value&&Ql(t);if(ft>0&&(ft--,Ee.value!=null))return void xe(t,a,_e(t,Ee.value,d,{preserveScrollableOverflow:Rt(t)}));if(i.value&&!v&&ze.value){const x=Et();if(x!=null){const P=_e(t,x,d,{allowBelowEstimatedFloor:!0});return X(!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&&c>0&&s<c-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?c:0):Math.max(y??0,s??0,n.loading!==!1?c:0)||null}else w=jl.value&&y!=null||y!=null?f?Math.max(y,s):y:i.value&&n.loading!==!1?s!=null&&c>0&&s<c-1?s:c>0?c:null:s;else w=Mn();if(i.value&&w!=null&&c>0&&(n.loading!==!1||l.holdCurrentDiffHeight===!0)&&(w=Math.max(w,c)),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=Ge();if(!(q==null||i.value&&n.loading!==!1&&v))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 X(e=!1){var l,t,a;if(pe.value)return;const o=h.value;if(!o)return;const d=i.value?Y():ie();if(d&&typeof d.layout=="function")try{const r=(l=o.getBoundingClientRect)==null?void 0:l.call(o),u=Math.ceil(((t=r?.width)!=null?t:0)||o.clientWidth||0),c=Math.ceil(((a=r?.height)!=null?a:0)||o.clientHeight||Number.parseFloat(o.style.height||"")||0);if(u>0&&c>0){if(!e&&u===Tt&&c===zt)return;Tt=u,zt=c,d.layout({width:u,height:c})}else On(),d.layout()}catch{}}function ye(){Qe()}function fe(e=!1){if(p||ll!=null)return;const l=()=>{p||(ye(),le(e),X())};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}),X(),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,c=Math.min(u,t),s=a.allowBelowEstimatedFloor===!0,v=kn(c,a.clearEstimatedFloor===!0,{allowBelowEstimatedFloor:s}),g=Ge();e.style.minHeight=g==null||s?"0px":`${Math.min(g,Math.ceil(t))}px`,e.style.height=`${v}px`,e.style.maxHeight=`${Math.ceil(t)}px`;const y=a.preserveScrollableOverflow===!0||u>t+1||_t(e,v);return e.style.overflow=y?"auto":"hidden",v}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 ct||_t(e,(l=Ee.value)!=null?l:0)}function Ql(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?.getValue=="function"&&t.getValue()===$e.value}function Se(e=h.value){return!!e?.querySelector("diffs-container")}function En(){return n.loading!==!1||F.value}function Oa(){const e=Y();return typeof e?.getOriginalEditor=="function"||typeof e?.getModifiedEditor=="function"||typeof 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??"")?Qn(String(e??"")):"plain"}function Xl(){return Re()}let Xe=null,Zl=!1,Kl=0;function Ln(){Xe=null,Kl++}function _n(){return D(this,arguments,function*(e=Kl){if(!Zl){Zl=!0;try{for(;Xe&&!p&&!i.value&&e===Kl;){const l=Xe;Xe=null;try{yield Promise.resolve(mt(l.code,l.language)),yield O(),p||i.value||(le(!1),X())}catch{}}}finally{Zl=!1,!Xe||p||i.value||_n()}}})}function Rn(e,l){Xe={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=cl;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:"")),c=n.loading===!1;c&&Ze();try{if(yield Tn(u.original,u.updated,Me.value),p||!i.value||d!==et)return;yield O(),X(!0),ye(),le(n.loading===!1||{preferModelDiffHeight:!0}),X(!0),fe(!0)}catch{return}if(c){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=Qn(Zt(e))),i.value))return;const l=cl;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[""]||"Plain Text"}),jn=m(()=>{var e;return go(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,Mo(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?Y():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(ct=!1,h.value){const t=Math.ceil(((l=(e=h.value).getBoundingClientRect)==null?void 0:l.call(e).height)||0);ct=_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),X(!0))})}function Ra(){if(!qt.value)return;const e=we.value;if(Jt.value){const l=e==="html"?"text/html":"image/svg+xml",t=e==="html"?Qt("artifacts.htmlPreviewTitle")||"HTML Preview":Qt("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(),Gn())||me.value||h.value!==e||Xl())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;Q&&r&&Ne!==r&&(Ne&&Q.markSettled(Ne),Ne=r,Q.markPending(r))})();const d=D(null,null,function*(){try{yield(function(r){return D(this,null,function*(){var u,c;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,Ye.value=null,On(),(function(){if(Rl.value=!1,Gl())return void(Jl.value=null);const f=mn.value;Jl.value=_.value||f==null?null:f})(),Je(),Qe(),(function(f){f.replaceChildren()})(r),Ze(),yield ea(An()),p)return;const v=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=v.finally(()=>{cl===g&&(cl=null)});if(cl=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(Ql()&&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"?Y():ie();(c=f?.updateOptions)==null||c.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(Je(),i.value){const P=Y(),Z=(f=P?.getOriginalEditor)==null?void 0:f.call(P),be=(w=P?.getModifiedEditor)==null?void 0:w.call(P),te=($,I)=>{try{const G=$?.[I];if(typeof G!="function")return;const ce=G.call($,()=>fe());ce&&Te.push(ce)}catch{}};try{const $=(N=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?.closest)!=null&&re.call(K,$))},G=oe=>{var re,K;const J=oe instanceof HTMLElement?oe:oe.parentElement;return!!((re=J?.closest)!=null&&re.call(J,$)||(K=J?.querySelector)!=null&&K.call(J,$))},ce=new MutationObserver(oe=>{i.value&&En()&&oe.some(re=>I(re.target)||Array.from(re.addedNodes).some(G)||Array.from(re.removedNodes).some(I))&&(ye(),le({preferModelDiffHeight:!0}),X(),Le())});ce.observe(L,{attributeFilter:["class"],attributes:!0,childList:!0,characterData:!0,subtree:!0}),Te.push({dispose:()=>ce.disconnect()})}if(L&&typeof ResizeObserver<"u"){const $=new ResizeObserver(()=>{if(!i.value||(X(),!En()))return;const I=Cl(L);I!=null&&(Math.ceil(L.getBoundingClientRect().height||0)<=I+1||(ye(),le({preferModelDiffHeight:!0}),X()))});$.observe(L),Te.push({dispose:()=>$.disconnect()})}return}const x=ie();try{const P=(q=x?.onDidContentSizeChange)==null?void 0:q.call(x,()=>fe());P&&Te.push(P)}catch{}try{const P=(B=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(),c=a!==xt.value,s=l.allowStaleContentRetry!==!1&&c&&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;Q&&r&&(Ne="",O(()=>{var u,c;if(!p){const s=(c=(u=ne.value)==null?void 0:u.offsetHeight)!=null?c:0;s>0&&Q.reportHeight(r,s)}Q.markSettled(r)}))})(),o&&!p&&queueMicrotask(()=>{var r;const u=h.value;u&&!p&&((r=He(u))==null||r.catch(c=>{_.value=!1,F.value=!1,Oe()}))})});return Be=d,d}A(Ta,e=>{e||to()}),A(()=>T.value,(e,l)=>{var t;const a=i.value?Y():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(vl)return vl;const s=D(null,null,function*(){try{const v=yield Bo();if(p)return;if(!v)return void(me.value=!0);Mt(v)}catch{if(p)return;me.value=!0}}).finally(()=>{vl===s&&(vl=null)});return vl=s,s})})(),u!==In||n.stream===!1&&n.loading!==!1||Xl()||!W.value||!ae||me.value||V.value||Gn()||p||h.value!==l)||Xl())return;const c=He(l);if(c){try{yield c}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 vo({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:yo())!=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 c=typeof r.unsafeCSS=="string"?r.unsafeCSS:"",s=`
26
+ [data-file] [data-line],
27
+ [data-diff] [data-line] {
28
+ white-space: ${(v=d.overflow)==="wrap"?"pre-wrap":"pre"} !important;
29
+ overflow-wrap: ${v==="wrap"?"anywhere":"normal"} !important;
30
+ word-break: normal !important;
31
+ }`;var v;return r.unsafeCSS=`[data-file], [data-diff] { --diffs-min-number-column-width-default: 2ch !important; }
32
+ ${s}
33
+
34
+ [data-no-newline],
35
+ [data-gutter-buffer="metadata"] {
36
+ --diffs-computed-decoration-bg: var(--markstream-diff-metadata-bg) !important;
37
+ --diffs-computed-diff-line-bg: var(--markstream-diff-metadata-bg) !important;
38
+ --diffs-computed-selected-line-bg: var(--markstream-diff-metadata-bg) !important;
39
+ --diffs-line-bg: var(--markstream-diff-metadata-bg) !important;
40
+ color: var(--markstream-diff-metadata-fg) !important;
41
+ background-color: var(--markstream-diff-metadata-bg) !important;
42
+ }
43
+ ${c}`.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,Je(),Qe(),We(),yield O(),yield He(h.value)}catch{_.value=!1,F.value=!1,Oe()}}));const tt=S(0),Yn=m(()=>String(tt.value));let Pl=!1;function It(){var e;const l=ol();return JSON.stringify({kind:yl.value,language:Me.value,structural:Yn.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 Gn(){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||Xl())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?Y():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?.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(()=>[Yn.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,Je(),Qe(),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?.[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,c;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,Je(),Qe(),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,Je(),Qe(),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 v=kt(String((u=n.node.originalCode)!=null?u:""),String((c=n.node.updatedCode)!=null?c:""));if(yield Tn(v.original,v.updated,Me.value),p||!i.value)return;yield Promise.resolve(pt()),_l(),X(!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 v=()=>{p?s():Zl||Xe?setTimeout(v,16):s()};v()}),p||i.value||(yield Promise.resolve(ht()));r&&i.value?(le({preferModelDiffHeight:!0,holdCurrentDiffHeight:!0}),Le(!0)):le(!1)}catch{}})})}),{immediate:!0,flush:"post"}),ua(()=>{Je(),Qe(),gt(),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=Ye.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(),Zn("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":Xt.value&&sa(vt)&&!W.value?"true":void 0},[ao(Co,{"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,Yt(Na.value),1),qn.value?(ul(),Zn("div",Io,Yt(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[oo(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=Ye.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),[[ro,!!C.stream||!C.loading]]),ql.value&&!Jt.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{Go as default};
@@ -0,0 +1 @@
1
+ import{M as ee,b$ as ne,aL as v,u as h,aY as H,v as t,bb as x,t as y,bk as u,aw as oe,bO as le,G as ie,I as G,bJ as A,F as I,ca as j,g as de,bL as W,bB as Y,au as se,aU as E,q as f,c9 as ce,d3 as ue,cf as te,d4 as me,d5 as pe,bl as ve,af as fe,ce as he,az as ge,A as be,d6 as Z,ar as X,s as we,d7 as ke,cp as ye,ch as q,ck as xe,co as Be,cs as J,cj as Ce}from"./index-8y9QBU_r.js";var Se=Object.defineProperty,Fe=Object.defineProperties,Me=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,Q=(a,d,e)=>d in a?Se(a,d,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[d]=e,N=(a,d)=>{for(var e in d||(d={}))ae.call(d,e)&&Q(a,e,d[e]);if(D)for(var e of D(d))re.call(d,e)&&Q(a,e,d[e]);return a},_=(a,d)=>Fe(a,Me(d)),K=(a,d,e)=>new Promise((g,b)=>{var z=m=>{try{w(e.next(m))}catch(C){b(C)}},T=m=>{try{w(e.throw(m))}catch(C){b(C)}},w=m=>m.done?g(m.value):Promise.resolve(m.value).then(z,T);w((e=e.apply(a,d)).next())});function ze(a,d){if(d===void 0)return ue(a);if(d){const g=d(a);if(g!=null&&g!=="")return g}const e=te(a);return me(e)||pe()}const Te={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Pe={class:"flex items-center gap-0.5"},je=["aria-label"],He={class:"code-diff-stat removed"},Oe={class:"code-diff-stat added"},$e=["aria-label"],Ne={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Ee={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Le=["aria-pressed"],Re={key:3,class:"relative"},_e=["aria-expanded"],Ae=["disabled"],De=["disabled"],Ve=["disabled"],Ue={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Ge={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Ie={class:"code-loading-placeholder"},We={class:"sr-only","aria-live":"polite",role:"status"},Ye=ee({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(a,{emit:d}){const e=a,g=d,b=E(!1),z=E(null),T=E(null);function w(){j(!0),b.value=!b.value,b.value&&document.addEventListener("click",C,{once:!0,capture:!0})}function m(){j(!0),b.value=!1}function C(p){var o,i;const R=p.target;(o=z.value)!=null&&o.contains(R)||(i=T.value)!=null&&i.contains(R)?document.addEventListener("click",C,{once:!0,capture:!0}):m()}const O=f(()=>e.showFontSizeButtons&&e.enableFontSizeControl||e.showExpandButton||e.isPreviewable&&e.showPreviewButton),{t:s}=ne(),$=f(()=>e.showTooltips!==!1);function S(p,o){$.value&&ce(p.currentTarget,o,"top",!1,void 0,e.isDark)}function F(){$.value&&j()}function P(p){S(p,e.copyText?s("common.copied")||"Copied":s("common.copy")||"Copy")}const V=f(()=>{var p,o;return!!Number.isFinite(e.codeFontSize)&&((p=e.codeFontSize)!=null?p:0)<=((o=e.codeFontMin)!=null?o:0)}),L=f(()=>!e.fontBaselineReady||e.codeFontSize===e.defaultCodeFontSize),r=f(()=>{var p,o;return!!Number.isFinite(e.codeFontSize)&&((p=e.codeFontSize)!=null?p:0)>=((o=e.codeFontMax)!=null?o:100)});return(p,o)=>(v(),h(I,null,[e.showHeader?(v(),h("div",Te,[H(p.$slots,"header-left"),H(p.$slots,"header-right",{},()=>[t("div",Pe,[a.diffStats?(v(),h("div",{key:0,class:"code-diff-stats","aria-label":a.diffStatsAriaLabel},[t("span",He,"-"+x(a.diffStats.removed),1),t("span",Oe,"+"+x(a.diffStats.added),1)],8,je)):y("",!0),e.showCopyButton?(v(),h("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":a.copyText?u(s)("common.copied")||"Copied":u(s)("common.copy")||"Copy",onClick:o[0]||(o[0]=i=>g("copy")),onMouseenter:o[1]||(o[1]=i=>P(i)),onFocus:o[2]||(o[2]=i=>P(i)),onMouseleave:F,onBlur:F},[a.copyText?(v(),h("svg",Ee,[...o[14]||(o[14]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),h("svg",Ne,[...o[13]||(o[13]=[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),t("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,$e)):y("",!0),e.showCollapseButton?(v(),h("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":a.isCollapsed,onClick:o[3]||(o[3]=i=>g("toggleCollapse")),onMouseenter:o[4]||(o[4]=i=>S(i,a.isCollapsed?u(s)("common.expand")||"Expand":u(s)("common.collapse")||"Collapse")),onFocus:o[5]||(o[5]=i=>S(i,a.isCollapsed?u(s)("common.expand")||"Expand":u(s)("common.collapse")||"Collapse")),onMouseleave:F,onBlur:F},[(v(),h("svg",{style:oe({rotate:a.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...o[15]||(o[15]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,Le)):y("",!0),O.value?(v(),h("div",Re,[t("button",{ref_key:"moreBtnRef",ref:T,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":b.value,"aria-haspopup":"true",onClick:le(w,["stop"]),onMouseenter:o[6]||(o[6]=i=>S(i,u(s)("common.more")||"More")),onFocus:o[7]||(o[7]=i=>S(i,u(s)("common.more")||"More")),onMouseleave:F,onBlur:F},[...o[16]||(o[16]=[ie('<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="1em" height="1em" viewBox="0 0 24 24" class="action-icon"><g fill="currentColor"><circle cx="12" cy="5" r="1.5"></circle><circle cx="12" cy="12" r="1.5"></circle><circle cx="12" cy="19" r="1.5"></circle></g></svg>',1)])],40,_e),G(de,{name:"code-menu"},{default:A(()=>[b.value?(v(),h("div",{key:0,ref_key:"moreMenuRef",ref:z,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[e.showFontSizeButtons&&e.enableFontSizeControl?(v(),h(I,{key:0},[t("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:V.value,onClick:o[8]||(o[8]=i=>{u(j)(!0),g("decreaseFont")})},[o[17]||(o[17]=t("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),t("span",null,x(u(s)("common.fontSmaller")||"Font size −"),1)],8,Ae),t("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:L.value,onClick:o[9]||(o[9]=i=>{u(j)(!0),g("resetFont")})},[o[18]||(o[18]=t("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),t("path",{d:"M3 3v5h5"})])],-1)),t("span",null,x(u(s)("common.fontReset")||"Font size reset"),1)],8,De),t("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:r.value,onClick:o[10]||(o[10]=i=>{u(j)(!0),g("increaseFont")})},[o[19]||(o[19]=t("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),t("span",null,x(u(s)("common.fontLarger")||"Font size +"),1)],8,Ve)],64)):y("",!0),e.showExpandButton?(v(),h("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:o[11]||(o[11]=i=>{m(),g("toggleExpand")})},[a.isExpanded?(v(),h("svg",Ue,[...o[20]||(o[20]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(v(),h("svg",Ge,[...o[21]||(o[21]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),t("span",null,x(a.isExpanded?u(s)("common.collapse")||"Collapse":u(s)("common.expand")||"Expand"),1)])):y("",!0),a.isPreviewable&&e.showPreviewButton?(v(),h("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:o[12]||(o[12]=i=>{m(),g("preview")})},[o[22]||(o[22]=t("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),t("circle",{cx:"12",cy:"12",r:"3"})])],-1)),t("span",null,x(u(s)("common.preview")||"Preview"),1)])):y("",!0)],512)):y("",!0)]),_:1})])):y("",!0)])])])):y("",!0),W(t("div",{class:se(["code-block-shell-content",{"code-block-shell-content--collapsed":a.isCollapsed}])},[H(p.$slots,"default")],2),[[Y,!!a.stream||!a.loading]]),W(t("div",Ie,[H(p.$slots,"loading",{},()=>[o[23]||(o[23]=t("div",{class:"loading-skeleton"},[t("div",{class:"skeleton-line"}),t("div",{class:"skeleton-line"}),t("div",{class:"skeleton-line short"})],-1))])],512),[[Y,!a.stream&&a.loading]]),t("span",We,x(a.copyText?u(s)("common.copied")||"Copied":""),1)],64))}}),Ze={class:"code-header-main"},Xe=["innerHTML"],qe={class:"code-header-copy"},Je={class:"code-header-title"},Qe={key:0,class:"code-header-caption"},Ke=ee(_(N({},{inheritAttrs:!1}),{__name:"PreCodeBlock",props:{codeBlockOptions:{},clipboardWriter:{},darkTheme:{},isDark:{type:Boolean,default:!1},lightTheme:{},resolvedVisualOptions:{},showCopyButton:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showToolbar:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},theme:{},themes:{},node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean,default:!0},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},emits:["copy"],setup(a,{emit:d}){const e=a,g=d,b=ve(),z=f(()=>{const n=b,{class:l,style:M}=n;return((c,k)=>{var U={};for(var B in c)ae.call(c,B)&&k.indexOf(B)<0&&(U[B]=c[B]);if(c!=null&&D)for(var B of D(c))k.indexOf(B)<0&&re.call(c,B)&&(U[B]=c[B]);return U})(n,["class","style"])}),T=E(null),w=E(!1);let m;const C=fe(he,void 0),O=f(()=>{var n,l;return(l=e.showLineNumbers)!=null?l:((n=e.codeBlockOptions)==null?void 0:n.disableLineNumbers)!==!0}),s=f(()=>q(e.node)),$=f(()=>{var n;return e.diffInline===!0||s.value&&ke((n=e.codeBlockOptions)!=null?n:{})}),S=f(()=>{var n,l;return te(String((l=(n=e.node)==null?void 0:n.language)!=null?l:""))}),F=f(()=>{const n=S.value;return n?J[n]||n.charAt(0).toUpperCase()+n.slice(1):J[""]||"Plain Text"}),P=f(()=>{var n,l;return ye(String((l=(n=e.node)==null?void 0:n.raw)!=null?l:""),F.value,q(e.node))}),V=f(()=>(xe.value,ze(S.value,C))),L=f(()=>{var n;return(n=e.resolvedVisualOptions)!=null?n:Ce(e.codeBlockOptions)}),r=f(()=>Be({darkTheme:e.darkTheme,isDark:e.isDark,lightTheme:e.lightTheme,theme:e.theme,themes:e.themes})),p=f(()=>_(N({"--markstream-code-fallback-bg":r.value.background,"--markstream-code-fallback-fg":r.value.foreground},r.value.builtin?{"--markstream-code-theme-bg":r.value.background,"--markstream-code-theme-fg":r.value.foreground,"--markstream-code-theme-line-number":r.value.lineNumber}:{}),{"--markstream-diff-added-line-fill":r.value.diffAddedLine,"--markstream-diff-added-number-fill":r.value.diffAddedNumber,"--markstream-diff-editor-bg":r.value.background,"--markstream-diff-removed-line-fill":r.value.diffRemovedLine,"--markstream-diff-removed-number-fill":r.value.diffRemovedNumber,"--markstream-diff-shell-bg":r.value.background,"--markstream-pre-resolved-theme-bg":r.value.background,"--markstream-pre-resolved-theme-fg":r.value.foreground,"--markstream-pre-resolved-theme-line-number":r.value.lineNumber,backgroundColor:r.value.background,color:r.value.foreground})),o=f(()=>["code-pre-fallback",b.class,{"is-wrap":L.value.overflow==="wrap"}]),i=f(()=>{var n;const l=L.value,M=((n=e.codeBlockOptions)==null?void 0:n.padding)==null?"1ch":`${l.padding}px`,c=s.value&&typeof e.reservedHeightPx=="number"&&Number.isFinite(e.reservedHeightPx)&&e.reservedHeightPx>0?`${Math.ceil(e.reservedHeightPx)}px`:void 0;return N(_(N(_(N({"--markstream-code-font-family":l.fontFamily,"--markstream-code-padding-x":M,"--markstream-code-padding-y":`${l.padding}px`,"--markstream-code-padding-bottom":`${l.paddingBottom}px`,"--markstream-code-scrollbar-gutter":`${l.scrollbarGutter}px`,"--markstream-code-tab-size":String(l.tabSize)},s.value?{"--markstream-pre-diff-line-height":`${l.lineHeight}px`}:{}),{"--markstream-pre-line-number-top":`${l.padding}px`,"--markstream-pre-line-number-left":"0px","--markstream-pre-line-number-padding-left":"2ch","--markstream-pre-line-number-padding-right":"1ch","--markstream-pre-line-number-separator-width":"2px"}),r.value.builtin?{"--markstream-code-theme-bg":r.value.background,"--markstream-code-theme-fg":r.value.foreground,"--markstream-code-theme-line-number":r.value.lineNumber}:{}),{"--markstream-diff-added-line-fill":r.value.diffAddedLine,"--markstream-diff-added-number-fill":r.value.diffAddedNumber,"--markstream-diff-metadata-bg":r.value.background,"--markstream-diff-metadata-fg":r.value.lineNumber,"--markstream-diff-removed-line-fill":r.value.diffRemovedLine,"--markstream-diff-removed-number-fill":r.value.diffRemovedNumber,"--markstream-pre-resolved-theme-bg":r.value.background,"--markstream-pre-resolved-theme-fg":r.value.foreground,"--markstream-pre-resolved-theme-line-number":r.value.lineNumber,"--markstream-pre-line-number-gap-to-code":M,"--markstream-diff-fallback-handoff-height":c??"auto",backgroundColor:"var(--markstream-code-fallback-bg, var(--markstream-code-theme-bg, var(--markstream-pre-resolved-theme-bg)))",boxSizing:"border-box",color:"var(--markstream-code-fallback-fg, var(--markstream-code-theme-fg, var(--markstream-pre-resolved-theme-fg)))",fontFamily:l.fontFamily,fontSize:`${l.fontSize}px`,lineHeight:`${l.lineHeight}px`,margin:"0",maxHeight:`${l.maxHeight}px`,overflow:"auto",overflowX:l.overflow==="wrap"?"hidden":"auto",overflowY:"auto",paddingBottom:`${l.paddingBottom}px`,paddingLeft:O.value?"var(--markstream-code-padding-left)":M,paddingRight:M,paddingTop:`${l.padding}px`,scrollbarGutter:s.value?"auto":"stable",tabSize:l.tabSize,whiteSpace:l.overflow==="scroll"?"pre":"pre-wrap",overflowWrap:l.overflow==="wrap"?"anywhere":"normal",wordBreak:"normal",width:"100%"}),c?{height:c,minHeight:c,maxHeight:c}:{})});function R(){return K(this,null,function*(){const n=String((M=(l=e.node)==null?void 0:l.code)!=null?M:"");var l,M;try{yield(function(c){return K(this,null,function*(){if(e.clipboardWriter)return void(yield e.clipboardWriter(c));if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function")return void(yield navigator.clipboard.writeText(c));if(typeof document>"u"||!document.body)throw new Error("Clipboard API is unavailable");const k=document.createElement("textarea");k.value=c,k.setAttribute("readonly",""),k.style.position="fixed",k.style.opacity="0",document.body.appendChild(k),k.select();try{if(!document.execCommand("copy"))throw new Error("Clipboard copy command failed")}finally{k.remove()}})})(n),w.value=!0,g("copy",n),m&&clearTimeout(m),m=setTimeout(()=>{w.value=!1,m=void 0},1e3)}catch(c){w.value=!1,console.error("[markstream-vue] Failed to copy preformatted code.",c)}})}return ge(()=>{m&&clearTimeout(m)}),(n,l)=>e.showToolbar?(v(),h("div",{key:0,style:oe(p.value),class:"code-block-container rounded-lg border"},[G(Ye,{"show-header":e.showHeader,"show-copy-button":e.showCopyButton,"show-collapse-button":!1,"show-font-size-buttons":!1,"show-expand-button":!1,"show-preview-button":!1,"show-tooltips":e.showTooltips,"copy-text":w.value,stream:"",onCopy:R},be({"header-left":A(()=>[H(n.$slots,"header-left",{},()=>[t("div",Ze,[t("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:V.value},null,8,Xe),t("div",qe,[t("div",Je,x(P.value.title),1),P.value.caption?(v(),h("div",Qe,x(P.value.caption),1)):y("",!0)])])])]),default:A(()=>[G(Z,X({ref_key:"preNodeRef",ref:T},z.value,{class:o.value,style:[u(b).style,i.value],node:e.node,loading:e.loading,"show-line-numbers":O.value,"diff-inline":$.value,"diff-hide-unchanged-regions":e.diffHideUnchangedRegions,"reserved-height-px":e.reservedHeightPx,"data-markstream-code-theme":r.value.name}),null,16,["class","style","node","loading","show-line-numbers","diff-inline","diff-hide-unchanged-regions","reserved-height-px","data-markstream-code-theme"])]),_:2},[n.$slots["header-right"]?{name:"header-right",fn:A(()=>[H(n.$slots,"header-right")]),key:"0"}:void 0]),1032,["show-header","show-copy-button","show-tooltips","copy-text"])],4)):(v(),we(Z,X({key:1,ref_key:"preNodeRef",ref:T},z.value,{class:o.value,style:[u(b).style,i.value],node:e.node,loading:e.loading,"show-line-numbers":O.value,"diff-inline":$.value,"diff-hide-unchanged-regions":e.diffHideUnchangedRegions,"reserved-height-px":e.reservedHeightPx,"data-markstream-code-theme":r.value.name}),null,16,["class","style","node","loading","show-line-numbers","diff-inline","diff-hide-unchanged-regions","reserved-height-px","data-markstream-code-theme"]))}})),oo=Object.freeze(Object.defineProperty({__proto__:null,default:Ke},Symbol.toStringTag,{value:"Module"}));export{Ke as B,oo as P,ze as Q,Ye as g};
@@ -1 +1 @@
1
- import{bQ as J,M as O,aU as p,bE as S,az as Q,aL as F,s as G,v as z,I as K,bJ as W,bL as Z,aw as X,H as A,bb as ee,bB as te,g as le,au as ae,T as ne,as as Y,bR as oe}from"./index-Bka4JnyA.js";var k=(d,x,e)=>new Promise((n,s)=>{var r=i=>{try{c(e.next(i))}catch(v){s(v)}},y=i=>{try{c(e.throw(i))}catch(v){s(v)}},c=i=>i.done?n(i.value):Promise.resolve(i.value).then(r,y);c((e=e.apply(d,x)).next())});const ie=["id"],re=["data-placement"],se=J(O({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(d){var x;const e=d,n=p(null),s=p(null),r=p({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=p({}),c=p((x=e.placement)!=null?x:"top"),i=p(!1),v=p(!1);let E=null,M=null,R=null,P=null,w=null,f=0;function I(){return P?Promise.resolve(P):(w||(w=oe(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(a=>(P=a,a)).catch(a=>{throw w=null,a})),w)}function T(){E&&(E(),E=null),M=null,R=null}function D(a){return k(this,null,function*(){const t=e.anchorEl,l=n.value;if(!e.visible||!t||!l||M===t&&R===l)return;const{autoUpdate:o}=yield I();a()&&e.visible&&e.anchorEl===t&&n.value===l&&(T(),M=t,R=l,E=o(t,l,()=>{$().catch(()=>{B()})}))})}function $(){return k(this,null,function*(){var a,t;const l=e.anchorEl,o=n.value;if(!e.visible||!l||!o)return!1;const{arrow:u,computePosition:C,flip:h,offset:m,shift:b}=yield I();if(!e.visible||e.anchorEl!==l||n.value!==o)return!1;const g=[m((a=e.offset)!=null?a:6),h(),b({padding:6}),...s.value?[u({element:s.value,padding:4})]:[]],{x:j,y:q,placement:N,middlewareData:U}=yield C(l,o,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==l||n.value!==o)return!1;if(r.value.transform=`translate3d(${Math.round(j)}px, ${Math.round(q)}px, 0)`,r.value.left="0px",r.value.top="0px",c.value=N,U.arrow&&s.value){const{x:V,y:L}=U.arrow,H={top:"bottom",bottom:"top",left:"right",right:"left"}[N.split("-")[0]];y.value={left:V!=null?`${V}px`:"",top:L!=null?`${L}px`:"",[H]:"-3px"}}return!0})}function B(){var a,t;const l=e.anchorEl,o=n.value;if(!l||!o)return!1;const u=l.getBoundingClientRect(),C=o.getBoundingClientRect(),h=(a=e.offset)!=null?a:6,m=(t=e.placement)!=null?t:"top";let b=u.left,g=u.top;return m==="bottom"?g=u.bottom+h:m==="left"?b=u.left-C.width-h:m==="right"?b=u.right+h:g=u.top-C.height-h,r.value.transform=`translate3d(${Math.round(Math.max(0,b))}px, ${Math.round(Math.max(0,g))}px, 0)`,r.value.left="0px",r.value.top="0px",c.value=m,y.value={},!0}S(()=>e.visible,a=>k(null,null,function*(){const t=++f;if(a){if(i.value=!1,yield Y(),t!==f||!e.visible)return;if(e.anchorEl&&n.value)try{const l=e.anchorEl,o=n.value,u=l.getBoundingClientRect();if(!(yield $())||t!==f||!e.visible||e.anchorEl!==l||n.value!==o)return;v.value=!1,i.value=!0,yield D(()=>t===f)}catch{if(t!==f||!e.visible)return;if(i.value=B(),e.anchorEl&&n.value)try{yield D(()=>t===f)}catch{}}else i.value=!0}else T()}));let _=0;return S([()=>e.anchorEl,()=>e.placement,()=>e.content],([a],[t])=>k(null,null,function*(){v.value=!!(a&&t&&a!==t&&Math.hypot(a.getBoundingClientRect().left-t.getBoundingClientRect().left,a.getBoundingClientRect().top-t.getBoundingClientRect().top)<=120);const l=++_;if(e.visible&&e.anchorEl&&n.value){if(yield Y(),l!==_||!e.visible||!e.anchorEl||!n.value)return;try{const o=yield $();if(l!==_||!e.visible||!e.anchorEl||!n.value)return;o||B()}catch{B()}yield D(()=>l===_)}})),Q(()=>{f+=1,T()}),(a,t)=>(F(),G(ne,{to:"body"},[z("div",{class:ae(["markstream-vue",{dark:d.isDark}])},[K(le,{name:"tooltip",appear:""},{default:W(()=>[Z(z("div",{id:e.id,ref_key:"tooltip",ref:n,style:X({position:"fixed",transitionProperty:v.value?"opacity, transform":"opacity",left:r.value.left,top:r.value.top,transform:r.value.transform,visibility:i.value?"visible":"hidden",pointerEvents:i.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[A(ee(d.content)+" ",1),z("div",{ref_key:"arrowEl",ref:s,class:"tooltip-arrow","data-placement":c.value,style:X(y.value)},null,12,re)],12,ie),[[te,d.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{se as default};
1
+ import{bQ as H,M as J,aU as p,bE as S,az as O,aL as Q,s as F,v as I,I as K,bJ as W,bL as Z,aw as X,H as A,bb as ee,bB as te,g as le,au as ae,T as ne,as as Y,bR as oe}from"./index-8y9QBU_r.js";var k=(d,x,e)=>new Promise((n,s)=>{var r=i=>{try{c(e.next(i))}catch(v){s(v)}},y=i=>{try{c(e.throw(i))}catch(v){s(v)}},c=i=>i.done?n(i.value):Promise.resolve(i.value).then(r,y);c((e=e.apply(d,x)).next())});const ie=["id"],re=["data-placement"],se=H(J({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(d){var x;const e=d,n=p(null),s=p(null),r=p({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=p({}),c=p((x=e.placement)!=null?x:"top"),i=p(!1),v=p(!1);let E=null,M=null,R=null,P=null,w=null,f=0;function N(){return P?Promise.resolve(P):(w||(w=oe(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(a=>(P=a,a)).catch(a=>{throw w=null,a})),w)}function T(){E&&(E(),E=null),M=null,R=null}function D(a){return k(this,null,function*(){const t=e.anchorEl,l=n.value;if(!e.visible||!t||!l||M===t&&R===l)return;const{autoUpdate:o}=yield N();a()&&e.visible&&e.anchorEl===t&&n.value===l&&(T(),M=t,R=l,E=o(t,l,()=>{$().catch(()=>{B()})}))})}function $(){return k(this,null,function*(){var a,t;const l=e.anchorEl,o=n.value;if(!e.visible||!l||!o)return!1;const{arrow:u,computePosition:C,flip:h,offset:m,shift:b}=yield N();if(!e.visible||e.anchorEl!==l||n.value!==o)return!1;const g=[m((a=e.offset)!=null?a:6),h(),b({padding:6}),...s.value?[u({element:s.value,padding:4})]:[]],{x:j,y:q,placement:U,middlewareData:V}=yield C(l,o,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==l||n.value!==o)return!1;if(r.value.transform=`translate3d(${Math.round(j)}px, ${Math.round(q)}px, 0)`,r.value.left="0px",r.value.top="0px",c.value=U,V.arrow&&s.value){const{x:z,y:L}=V.arrow,G={top:"bottom",bottom:"top",left:"right",right:"left"}[U.split("-")[0]];y.value={left:z!=null?`${z}px`:"",top:L!=null?`${L}px`:"",[G]:"-3px"}}return!0})}function B(){var a,t;const l=e.anchorEl,o=n.value;if(!l||!o)return!1;const u=l.getBoundingClientRect(),C=o.getBoundingClientRect(),h=(a=e.offset)!=null?a:6,m=(t=e.placement)!=null?t:"top";let b=u.left,g=u.top;return m==="bottom"?g=u.bottom+h:m==="left"?b=u.left-C.width-h:m==="right"?b=u.right+h:g=u.top-C.height-h,r.value.transform=`translate3d(${Math.round(Math.max(0,b))}px, ${Math.round(Math.max(0,g))}px, 0)`,r.value.left="0px",r.value.top="0px",c.value=m,y.value={},!0}S(()=>e.visible,a=>k(null,null,function*(){const t=++f;if(a){if(i.value=!1,yield Y(),t!==f||!e.visible)return;if(e.anchorEl&&n.value)try{const l=e.anchorEl,o=n.value,u=l.getBoundingClientRect();if(!(yield $())||t!==f||!e.visible||e.anchorEl!==l||n.value!==o)return;v.value=!1,i.value=!0,yield D(()=>t===f)}catch{if(t!==f||!e.visible)return;if(i.value=B(),e.anchorEl&&n.value)try{yield D(()=>t===f)}catch{}}else i.value=!0}else T()}));let _=0;return S([()=>e.anchorEl,()=>e.placement,()=>e.content],([a],[t])=>k(null,null,function*(){v.value=!!(a&&t&&a!==t&&Math.hypot(a.getBoundingClientRect().left-t.getBoundingClientRect().left,a.getBoundingClientRect().top-t.getBoundingClientRect().top)<=120);const l=++_;if(e.visible&&e.anchorEl&&n.value){if(yield Y(),l!==_||!e.visible||!e.anchorEl||!n.value)return;try{const o=yield $();if(l!==_||!e.visible||!e.anchorEl||!n.value)return;o||B()}catch{B()}yield D(()=>l===_)}})),O(()=>{f+=1,T()}),(a,t)=>(Q(),F(ne,{to:"body"},[I("div",{class:ae(["markstream-vue",{dark:d.isDark}])},[K(le,{name:"tooltip",appear:""},{default:W(()=>[Z(I("div",{id:e.id,ref_key:"tooltip",ref:n,style:X({position:"fixed",transitionProperty:v.value?"opacity, transform":"opacity",left:r.value.left,top:r.value.top,transform:r.value.transform,visibility:i.value?"visible":"hidden",pointerEvents:i.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[A(ee(d.content)+" ",1),I("div",{ref_key:"arrowEl",ref:s,class:"tooltip-arrow","data-placement":c.value,style:X(y.value)},null,12,re)],12,ie),[[te,d.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{se as default};
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-CPChu7zn.js";import{p as f}from"./chunk-JWPE2WC7-D-sxo7as.js";import{_ as n,l as o}from"./mermaid.core-07lp9GgB.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-Cn0w3Ba_.js";import"./index-Bka4JnyA.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
1
+ import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-CClISXJW.js";import{p as f}from"./chunk-JWPE2WC7-Bgwiccxa.js";import{_ as n,l as o}from"./mermaid.core-DY8EMjrF.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-rK0CO-KU.js";import"./index-8y9QBU_r.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
@@ -1 +1 @@
1
- import{G as ln,H as un,I as N,J as I,K as J,L as an,M as y,N as tn,O as j,P as _,Q as rn,R as o,S as on,T as sn,V as fn}from"./mermaid.core-07lp9GgB.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,O,v,R,K,u){var D=q-l,i=O-h,n=K-v,d=u-R,a=d*D-n*i;if(!(a*a<y))return a=(n*(h-R)-d*(l-v))/a,[l+a*D,h+a*i]}function W(l,h,q,O,v,R,K){var u=l-q,D=h-O,i=(K?R:-R)/j(u*u+D*D),n=i*D,d=-i*u,a=l+n,s=h+d,f=q+n,c=O+d,L=(a+f)/2,t=(s+c)/2,m=f-a,g=c-s,A=m*m+g*g,T=v-R,P=a*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),G=(P*g-m*E)/A,H=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=G-L,e=H-t,r=w-L,M=p-t;return x*x+e*e>r*r+M*M&&(G=w,H=p),{cx:G,cy:H,x01:-n,y01:-d,x11:G*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=J(0),O=null,v=gn,R=dn,K=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,L=rn(c-f),t=c>f;if(u||(u=n=D()),s<a&&(d=s,s=a,a=d),!(s>y))u.moveTo(0,0);else if(L>tn-y)u.moveTo(s*N(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*N(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=L,E=L,G=K.apply(this,arguments)/2,H=G>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(H>y){var M=sn(H/a*I(G)),z=sn(H/s*I(G));(P-=M*2)>y?(M*=t?1:-1,A+=M,T-=M):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var Q=s*N(m),V=s*I(m),B=a*N(T),C=a*I(T);if(w>y){var F=s*N(g),U=s*I(g),X=a*N(A),Y=a*I(A),S;if(L<un)if(S=pn(Q,V,X,Y,F,U,B,C)){var Z=Q-S[0],$=V-S[1],k=F-S[0],b=U-S[1],nn=1/I(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(S[0]*S[0]+S[1]*S[1]);p=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=W(X,Y,Q,V,s,x,t),r=W(F,U,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),u.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(u.moveTo(Q,V),u.arc(0,0,s,m,g,!t)):u.moveTo(Q,V),!(a>y)||!(P>y)?u.lineTo(B,C):p>y?(e=W(B,C,F,U,a,-p,t),r=W(Q,V,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,a,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),u.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):u.arc(0,0,a,T,A,t)}if(u.closePath(),n)return u=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[N(d)*n,I(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:J(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:J(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:J(+n),i):q},i.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:J(+n),i):O},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:J(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:J(+n),i):R},i.padAngle=function(n){return arguments.length?(K=typeof n=="function"?n:J(+n),i):K},i.context=function(n){return arguments.length?(u=n??null,i):u},i}export{hn as d};
1
+ import{G as ln,H as un,I as N,J as I,K as J,L as an,M as y,N as tn,O as j,P as _,Q as rn,R as o,S as on,T as sn,V as fn}from"./mermaid.core-DY8EMjrF.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,O,v,R,K,u){var D=q-l,i=O-h,n=K-v,d=u-R,a=d*D-n*i;if(!(a*a<y))return a=(n*(h-R)-d*(l-v))/a,[l+a*D,h+a*i]}function W(l,h,q,O,v,R,K){var u=l-q,D=h-O,i=(K?R:-R)/j(u*u+D*D),n=i*D,d=-i*u,a=l+n,s=h+d,f=q+n,c=O+d,L=(a+f)/2,t=(s+c)/2,m=f-a,g=c-s,A=m*m+g*g,T=v-R,P=a*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),G=(P*g-m*E)/A,H=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=G-L,e=H-t,r=w-L,M=p-t;return x*x+e*e>r*r+M*M&&(G=w,H=p),{cx:G,cy:H,x01:-n,y01:-d,x11:G*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=J(0),O=null,v=gn,R=dn,K=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,L=rn(c-f),t=c>f;if(u||(u=n=D()),s<a&&(d=s,s=a,a=d),!(s>y))u.moveTo(0,0);else if(L>tn-y)u.moveTo(s*N(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*N(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=L,E=L,G=K.apply(this,arguments)/2,H=G>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(H>y){var M=sn(H/a*I(G)),z=sn(H/s*I(G));(P-=M*2)>y?(M*=t?1:-1,A+=M,T-=M):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var Q=s*N(m),V=s*I(m),B=a*N(T),C=a*I(T);if(w>y){var F=s*N(g),U=s*I(g),X=a*N(A),Y=a*I(A),S;if(L<un)if(S=pn(Q,V,X,Y,F,U,B,C)){var Z=Q-S[0],$=V-S[1],k=F-S[0],b=U-S[1],nn=1/I(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(S[0]*S[0]+S[1]*S[1]);p=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=W(X,Y,Q,V,s,x,t),r=W(F,U,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),u.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(u.moveTo(Q,V),u.arc(0,0,s,m,g,!t)):u.moveTo(Q,V),!(a>y)||!(P>y)?u.lineTo(B,C):p>y?(e=W(B,C,F,U,a,-p,t),r=W(Q,V,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,a,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),u.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):u.arc(0,0,a,T,A,t)}if(u.closePath(),n)return u=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[N(d)*n,I(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:J(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:J(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:J(+n),i):q},i.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:J(+n),i):O},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:J(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:J(+n),i):R},i.padAngle=function(n){return arguments.length?(K=typeof n=="function"?n:J(+n),i):K},i.context=function(n){return arguments.length?(u=n??null,i):u},i}export{hn as d};