@moonshot-ai/kimi-code 0.35.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/main.mjs +85912 -81399
  2. package/dist-web/assets/{CodeBlockNode-BAtAs_qm.js → CodeBlockNode-Do73mQqg.js} +2 -2
  3. package/dist-web/assets/{DesignSystemView-CTUhpkDe.js → DesignSystemView-xF63Uyfo.js} +1 -1
  4. package/dist-web/assets/{Tooltip-DbYQWF1U.js → Tooltip-BCySsRbJ.js} +1 -1
  5. package/dist-web/assets/{abnfDiagram-VRR7QNED-C0Afmuc1.js → abnfDiagram-VRR7QNED-LUo2ybd4.js} +1 -1
  6. package/dist-web/assets/{arc-IkhU3FHH.js → arc-HTdwJ95y.js} +1 -1
  7. package/dist-web/assets/{architectureDiagram-ZJ3FMSHR-CBluWNBt.js → architectureDiagram-ZJ3FMSHR-BJZpYPA7.js} +1 -1
  8. package/dist-web/assets/{blockDiagram-677ZJIJ3-BNXb88Fr.js → blockDiagram-677ZJIJ3-CRh0VMzc.js} +1 -1
  9. package/dist-web/assets/{c4Diagram-LMCZKHZV-CUyKVoVi.js → c4Diagram-LMCZKHZV-0GQGcOcv.js} +1 -1
  10. package/dist-web/assets/channel-Dk_xUHM6.js +1 -0
  11. package/dist-web/assets/{chunk-2Q5K7J3B-DsAC7dRk.js → chunk-2Q5K7J3B-Dntoz8YC.js} +1 -1
  12. package/dist-web/assets/{chunk-32BRIVSS-DUDRPqmY.js → chunk-32BRIVSS-DNJ_Bmzz.js} +1 -1
  13. package/dist-web/assets/{chunk-5VM5RSS4-yyj9cAyF.js → chunk-5VM5RSS4-CqIxm4fU.js} +1 -1
  14. package/dist-web/assets/{chunk-EX3LRPZG-BCWDroXJ.js → chunk-EX3LRPZG-6_hx8rcm.js} +1 -1
  15. package/dist-web/assets/{chunk-JWPE2WC7-Dsg3gA8l.js → chunk-JWPE2WC7-R8L-LjRL.js} +1 -1
  16. package/dist-web/assets/{chunk-MOJQB5TN-JQ2kJR9W.js → chunk-MOJQB5TN-CuHpGhX-.js} +1 -1
  17. package/dist-web/assets/{chunk-RYQCIY6F-Df2V79id.js → chunk-RYQCIY6F-Dm138b37.js} +1 -1
  18. package/dist-web/assets/{chunk-V7JOEXUC-B4q9plWN.js → chunk-V7JOEXUC-bFBk02SY.js} +1 -1
  19. package/dist-web/assets/{chunk-VR4S4FIN-CEH7JYJn.js → chunk-VR4S4FIN-Crv01XIW.js} +1 -1
  20. package/dist-web/assets/{chunk-XXDRQBXY-5rh7CWvm.js → chunk-XXDRQBXY-B7Une-L7.js} +1 -1
  21. package/dist-web/assets/classDiagram-OUVF2IWQ-DM4TZiKk.js +1 -0
  22. package/dist-web/assets/classDiagram-v2-EOCWNBFH-DM4TZiKk.js +1 -0
  23. package/dist-web/assets/{cose-bilkent-JH36ORCC-TWQPJk-P.js → cose-bilkent-JH36ORCC-kIdO2NbL.js} +1 -1
  24. package/dist-web/assets/{cynefin-VYW2F7L2-BIlq342y.js → cynefin-VYW2F7L2-CD6doQLg.js} +1 -1
  25. package/dist-web/assets/{cynefinDiagram-TSTJHNR4-zQaCQNIP.js → cynefinDiagram-TSTJHNR4-CjIz9kB7.js} +1 -1
  26. package/dist-web/assets/{dagre-VKFMJZFB-D8gdq5tS.js → dagre-VKFMJZFB-CxsYi2pz.js} +1 -1
  27. package/dist-web/assets/{diagram-FQU43EPY-D2bRXH1a.js → diagram-FQU43EPY-BxnsH35m.js} +1 -1
  28. package/dist-web/assets/{diagram-G47NLZAW-BF9x_uf7.js → diagram-G47NLZAW-CAmFU1Cj.js} +1 -1
  29. package/dist-web/assets/{diagram-NH7WQ7WH-DUn2m-AO.js → diagram-NH7WQ7WH-Db_YtFB_.js} +1 -1
  30. package/dist-web/assets/{diagram-OA4YK3LP-BOIp7TNe.js → diagram-OA4YK3LP--Kd1fr8_.js} +1 -1
  31. package/dist-web/assets/{diagram-WEI45ONY-CFwFRAWa.js → diagram-WEI45ONY-QxbY7aVv.js} +1 -1
  32. package/dist-web/assets/{ebnfDiagram-CCIWWBDH-B4NTctc_.js → ebnfDiagram-CCIWWBDH-DJR1FAj9.js} +1 -1
  33. package/dist-web/assets/{erDiagram-Q63AITRT-DVzumNgk.js → erDiagram-Q63AITRT-CKt0tq4n.js} +1 -1
  34. package/dist-web/assets/{flowDiagram-23GEKE2U-CzI-GKO4.js → flowDiagram-23GEKE2U-CB0TxYKC.js} +1 -1
  35. package/dist-web/assets/{ganttDiagram-NO4QXBWP-B2lfrNfh.js → ganttDiagram-NO4QXBWP-BkswX2CL.js} +1 -1
  36. package/dist-web/assets/{gitGraphDiagram-IHSO6WYX-D7UBC8np.js → gitGraphDiagram-IHSO6WYX-9OkgrWLV.js} +1 -1
  37. package/dist-web/assets/{index-ZmzTmhry.js → index-B1mxH1U6.js} +1 -1
  38. package/dist-web/assets/{index-D-7nOosq.js → index-Bxn5yOTB.js} +9 -9
  39. package/dist-web/assets/{index-DzfhniX8.js → index-DCogO9ha.js} +2 -2
  40. package/dist-web/assets/{index-BZFTzQ6y.js → index-DyqF2DF6.js} +1 -1
  41. package/dist-web/assets/{index10-BCo1_xRY.js → index10-DKtGUVwa.js} +1 -1
  42. package/dist-web/assets/{index11-Ci8_PlMN.js → index11-TEhD5dop.js} +1 -1
  43. package/dist-web/assets/{index5-Cn2jfVMX.js → index5-BZK7AFSJ.js} +1 -1
  44. package/dist-web/assets/{index6-D4fZsFMu.js → index6-CXJ_z4n5.js} +1 -1
  45. package/dist-web/assets/{index7-BT2SBznQ.js → index7-CG7TPx8g.js} +1 -1
  46. package/dist-web/assets/{index8-BaK3y7fN.js → index8-B9apTeKj.js} +1 -1
  47. package/dist-web/assets/{infoDiagram-FWYZ7A6U-DASw56fH.js → infoDiagram-FWYZ7A6U-Dpbgmc1e.js} +1 -1
  48. package/dist-web/assets/{ishikawaDiagram-FXEZZL3T-CcPuml-k.js → ishikawaDiagram-FXEZZL3T-BA2yx5LI.js} +1 -1
  49. package/dist-web/assets/{journeyDiagram-5HDEW3XC-BShuBRgf.js → journeyDiagram-5HDEW3XC-DCwR4Nt_.js} +1 -1
  50. package/dist-web/assets/{kanban-definition-HUTT4EX6-_UoHLqzR.js → kanban-definition-HUTT4EX6-CArc2b0u.js} +1 -1
  51. package/dist-web/assets/{linear-DH49UJnN.js → linear-CV4KY8w2.js} +1 -1
  52. package/dist-web/assets/{mermaid.core-CJB1tAev.js → mermaid.core-CsZwh_jB.js} +4 -4
  53. package/dist-web/assets/{mindmap-definition-LN4V7U3C-HXhM1kRL.js → mindmap-definition-LN4V7U3C-Cg1epIhw.js} +1 -1
  54. package/dist-web/assets/{pegDiagram-2B236MQR-_6D7zUy-.js → pegDiagram-2B236MQR-MoH4JZ6E.js} +1 -1
  55. package/dist-web/assets/{pieDiagram-ENE6RG2P-f3F4At6v.js → pieDiagram-ENE6RG2P-8g8etfu6.js} +1 -1
  56. package/dist-web/assets/{quadrantDiagram-ABIIQ3AL-3t7sFhfl.js → quadrantDiagram-ABIIQ3AL-BxCL4sof.js} +1 -1
  57. package/dist-web/assets/{railroadDiagram-RFXS5EU6-W9nf8fYD.js → railroadDiagram-RFXS5EU6-DS6RTuPq.js} +1 -1
  58. package/dist-web/assets/{requirementDiagram-TGXJPOKE-Bzvt0v7J.js → requirementDiagram-TGXJPOKE-Cgysyqsi.js} +1 -1
  59. package/dist-web/assets/{sankeyDiagram-HTMAVEWB-B5WnWxzh.js → sankeyDiagram-HTMAVEWB-BqJCXBk-.js} +1 -1
  60. package/dist-web/assets/{sequenceDiagram-DBY2YBRQ-CnV0H-kS.js → sequenceDiagram-DBY2YBRQ-FwgGv3En.js} +1 -1
  61. package/dist-web/assets/{sizeCapture-X5ZJPWSS-D5GqjpM0.js → sizeCapture-X5ZJPWSS-CUFKXLd6.js} +1 -1
  62. package/dist-web/assets/{stateDiagram-2N3HPSRC-GIVsAB2M.js → stateDiagram-2N3HPSRC-CR3yEYk8.js} +1 -1
  63. package/dist-web/assets/stateDiagram-v2-6OUMAXLB--VVJVX-W.js +1 -0
  64. package/dist-web/assets/{swimlanes-5IMT3BWC-D6xMtJ1E.js → swimlanes-5IMT3BWC-C7_SkVdK.js} +2 -2
  65. package/dist-web/assets/swimlanesDiagram-G3AALYLV-BWdA3bDm.js +8 -0
  66. package/dist-web/assets/{timeline-definition-FHXFAJF6-5u0AN8o0.js → timeline-definition-FHXFAJF6-DlAcudfE.js} +1 -1
  67. package/dist-web/assets/{vennDiagram-L72KCM5P-ozNTLnJz.js → vennDiagram-L72KCM5P-BV2kbjhg.js} +1 -1
  68. package/dist-web/assets/{vue.runtime.esm-bundler-J0WjtLlK.js → vue.runtime.esm-bundler-D20WEMcO.js} +1 -1
  69. package/dist-web/assets/{wardleyDiagram-EHGQE667-BuQJYWm-.js → wardleyDiagram-EHGQE667-BaiOQb6Q.js} +1 -1
  70. package/dist-web/assets/{xychartDiagram-FW5EYKEG-yQImOWPy.js → xychartDiagram-FW5EYKEG-BklSkO6g.js} +1 -1
  71. package/dist-web/index.html +1 -1
  72. package/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  73. package/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  74. package/package.json +8 -8
  75. package/dist-web/assets/channel-xkK6nTGq.js +0 -1
  76. package/dist-web/assets/classDiagram-OUVF2IWQ-ClMG95L0.js +0 -1
  77. package/dist-web/assets/classDiagram-v2-EOCWNBFH-ClMG95L0.js +0 -1
  78. package/dist-web/assets/stateDiagram-v2-6OUMAXLB-0KuGlzV7.js +0 -1
  79. package/dist-web/assets/swimlanesDiagram-G3AALYLV-DKIx012r.js +0 -8
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/mermaid.core-CJB1tAev.js","assets/_commonjsHelpers-CqkleIqs.js","assets/CodeBlockNode-BAtAs_qm.js","assets/safeRaf-DGuzXxDK.js","assets/index5-Cn2jfVMX.js","assets/index11-Ci8_PlMN.js","assets/DesignSystemView-CTUhpkDe.js","assets/DesignSystemView-DVONbdv-.css","assets/rive-CeXCFBdn.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/mermaid.core-CsZwh_jB.js","assets/_commonjsHelpers-CqkleIqs.js","assets/CodeBlockNode-Do73mQqg.js","assets/safeRaf-DGuzXxDK.js","assets/index5-BZK7AFSJ.js","assets/index11-TEhD5dop.js","assets/DesignSystemView-xF63Uyfo.js","assets/DesignSystemView-DVONbdv-.css","assets/rive-CeXCFBdn.js"])))=>i.map(i=>d[i]);
2
2
  (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
3
3
  * @vue/shared v3.5.39
4
4
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
@@ -309,11 +309,11 @@ ${_}`);c+=T}else c+=S;c+=w,d=h?f+1:e.length}return c}function Yue(e,t){if(!e||!t
309
309
  <button class="copy-button" data-code="${_}">${T}</button>
310
310
  </div>
311
311
  <div class="code-editor"></div>
312
- </div>`};const u=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,d=m=>{if(!m.startsWith("["))return!1;const v=c.exec(m);if(!v)return m!=="["&&!/^\[\d+$/.test(m);const k=String(v[1]??"");return m.slice(v[0].length).startsWith("(")?!1:!/^\d+$/.test(k)},f=(m,v)=>{const k=m;if(k.src[k.pos]!=="[")return!1;const w=u.exec(k.src.slice(k.pos));if(!w)return!1;const b=k.src.slice(Math.max(0,k.pos-120),k.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const _=k.src.slice(k.pos+w[0].length);if(_.startsWith("](")||_.startsWith("(")||d(_))return!1;if(!v){const g=w[1],x=k.push("reference","span",0);x.content=g,x.markup=w[0],x.raw=w[0]}return k.pos+=w[0].length,!0};n.inline.ruler.before("escape","reference",f),n.renderer.rules.reference=(m,v)=>{const w=String(m[v].content??"");return`<span class="reference-link" data-reference-id="${w}" role="button" tabindex="0" title="Click to view reference">${w}</span>`};const h=n.use.bind(n);return n.use=((...m)=>(o.__markstreamHasCustomParserExtensions=!0,h(...m))),n}function Sce({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function t$({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:Sce({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const Ace={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function Mce(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function n$(e){const t=Mce(e);return Ace[t]??t}function Tce(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>n$(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function Ece(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function Ice(e){return Ece(e)?.join("\0")??""}function Lce(e,t){return`${Ice(e)}\0\0${Tce(t)?.join("\0")??""}`}function rd(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function a_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var $ce=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const m=u_();this.startedAt=f&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=u_();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const f=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const m=this.pendingChars,v=m>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,k=Oce(m/Math.max(.001,v/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(k-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const w=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),b=Rce(this.source.slice(this.visible.length),w,this.segmenter);b.text&&(this.visible+=b.text,this.charBudget=Math.max(0,this.charBudget-b.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=rd(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,rd(o,1e3,1)),this.normalizedTargetLatencyMs=rd(s,900,1),this.normalizedCatchUpLatencyMs=rd(i,350,1),this.normalizedCatchUpThreshold=a_(r,600),this.normalizedStartDelayMs=a_(a,80),this.maxCommitFps=Math.trunc(rd(l,30,1)),this.maxCharsPerCommit=Math.trunc(rd(u,80,1)),this.flushOnFinish=c,this.segmenter=Fce(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function Nce(e={},t){const n=new $ce(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function Fce(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function Rce(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function u_(){return typeof performance<"u"?performance.now():Date.now()}function Oce(e,t,n){return Math.min(n,Math.max(t,e))}var Pce=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const G3=Symbol.for("markstream-vue:node-lifecycle");function wVe(){}const c5=new Map;let o$="material";const Ad=new Map,c_=new Map;let Y3=null;function Dce(e){c5.set(e.id,e)}function Bce(e){const t=c5.get(o$);if(!t)return;const n=t.core[e];if(n)return n;const o=Ad.get(t.id);if(o){const s=o[e];if(s)return s}t.loadExtended&&!Ad.has(t.id)&&zce(t)}function Hce(){var e,t;return(t=(e=c5.get(o$))==null?void 0:e.fallback)!=null?t:""}function zce(e){return Pce(this,null,function*(){var t,n,o;if(Ad.has(e.id))return(t=Ad.get(e.id))!=null?t:null;let s=c_.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(Ad.set(e.id,i),Y3?.(),i)).catch(()=>(Ad.set(e.id,null),null)),c_.set(e.id,s)),s})}const d_='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',f_='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',Wce={id:"material",core:{"":f_,plain:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',text:f_,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',cs:d_,csharp:d_,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',powershell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>'},fallback:'<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',loadExtended:()=>jo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Uce=Xr(0);Y3=()=>{Uce.value++},Dce(Wce);const jce={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function T2(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=jce[n])!=null?t:n}function _Ve(e){const t=T2(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function xVe(e){return Bce(T2(e))||Hce()}const p_={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var E2=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let ki=null,Qu=!1,ec=null,I2=f5;function Jp(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function d5(){try{const e=globalThis;return Jp(e?.katex)}catch{return null}}function f5(){return E2(null,null,function*(){const e=d5();if(e)return e;const t=yield jo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield jo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Jp(t)})}function s$(e){const t=Promise.resolve(e).then(n=>{var o;return ec===t&&n?(ki=(o=Jp(n))!=null?o:n,ki):null}).catch(()=>null).finally(()=>{ec===t&&(ec=null)});return ec=t,Qu=!0,t}function Vce(e){I2=e,ki=null,Qu=!1,ec=null}function qce(e){Vce(f5)}function i$(){return typeof I2=="function"}function SVe(){var e;const t=I2;if(!t||t===f5)return null;if(ki)return ki;const n=d5();if(n)return ki=n,ki;if(Qu)return null;try{const o=t();return o?typeof o?.then=="function"?(s$(o),null):(ki=(e=Jp(o))!=null?e:o,ki):null}catch{return null}}function r$(){return E2(this,null,function*(){var e;const t=d5();if(t)return ki=t,ki;if(ki)return ki;if(ec)return ec;if(Qu)return null;const n=I2;if(!n)return Qu=!0,null;try{const o=n();if(typeof o?.then=="function")return s$(o);if(o)return ki=(e=Jp(o))!=null?e:o,Qu=!0,ki}catch{}return Qu=!0,null})}function l$(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Ha=null,Na=null;const Ws=new Map,ea=new Map;let Lp=5;const uc=new Set;function Gf(){if(Ws.size<Lp&&uc.size){let e=Lp-Ws.size;for(const t of Array.from(uc)){if(e<=0)break;uc.delete(t),e--;try{t()}catch{}}}}function a$(){for(const e of Array.from(uc)){uc.delete(e);try{e()}catch{}}}function Kce(e){Ha=e,Na=null,Ha.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=Ws.get(n);if(i)if(Ws.delete(n),clearTimeout(i.timeoutId),i.cleanup(),Gf(),s)i.aborted||i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(ea.set(a,o),ea.size>200){const u=ea.keys().next().value;ea.delete(u)}}i.aborted||i.resolve(o)}},Ha.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of Ws.entries())clearTimeout(o.timeoutId),o.cleanup(),o.aborted||o.reject(new Error(`Worker error: ${t.message}`));Ws.clear(),a$()}}function Zce(){var e;for(const t of Ws.values())clearTimeout(t.timeoutId),t.cleanup(),t.aborted||t.reject(new Error("Worker cleared"));Ws.clear(),a$(),Ha&&((e=Ha.terminate)==null||e.call(Ha)),Ha=null,Na=null}function Gce(e,t=!0,n=2e3,o){return E2(this,null,function*(){performance.now();const s=l$(e);if(!i$()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Na)return Promise.reject(Na);const i=`${t?"d":"i"}:${s}`,r=ea.get(i);if(r)return Gf(),Promise.resolve(r);const l=Ha||(Na=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Na.name="WorkerInitError",Na.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Na);if(Ws.size>=Lp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Ws.size,a.max=Lp,Promise.reject(a)}return new Promise((a,u)=>{if(o?.aborted){const v=new Error("Aborted");return v.name="AbortError",void u(v)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const v=Ws.get(c);if(!v)return;Ws.delete(c),v.cleanup();const k=new Error("Worker render timed out");k.name="WorkerTimeout",k.code="WORKER_TIMEOUT",v.aborted||v.reject(k),Gf()},n);d=()=>{const v=Ws.get(c);if(!v||v.aborted)return;v.aborted=!0,v.cleanup();const k=new Error("Aborted");k.name="AbortError",u(k)},o&&o.addEventListener("abort",d,{once:!0});const h=a,m=u;Ws.set(c,{resolve:v=>{h(v)},reject:v=>{m(v)},timeoutId:f,aborted:!1,cleanup:()=>{o&&d&&o.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:s,displayMode:t})}catch(v){const k=Ws.get(c);Ws.delete(c),clearTimeout(f),k?.cleanup(),k?.reject(v),Gf()}})})}function AVe(e,t=!0,n){const o=`${t?"d":"i"}:${l$(e)}`;if(ea.set(o,n),ea.size>200){const s=ea.keys().next().value;ea.delete(s)}}const Yce="WORKER_BUSY";function Xce(e=2e3,t){return Ws.size<Lp?Promise.resolve():new Promise((n,o)=>{let s,i=!1,r=null,l=()=>{};const a=()=>{s&&globalThis.clearTimeout(s),uc.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{i||(i=!0,a(),n())},uc.add(l),s=globalThis.setTimeout(()=>{if(i)return;i=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",o(u)},e),queueMicrotask(()=>Gf()),t&&(r=()=>{if(i)return;i=!0,a();const u=new Error("Aborted");u.name="AbortError",o(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const sf={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function MVe(e){return E2(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!i$()){const v=new Error("KaTeX rendering disabled");throw v.name="KaTeXDisabled",v.code="KATEX_DISABLED",v}const a=(s=o.timeout)!=null?s:sf.timeout,u=(i=o.waitTimeout)!=null?i:sf.waitTimeout,c=(r=o.backoffMs)!=null?r:sf.backoffMs,d=(l=o.maxRetries)!=null?l:sf.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):sf.maxRetries,h=o.signal;let m=0;for(;;){if(h?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}try{return yield Gce(t,n,a,h)}catch(v){if(v?.code!==Yce||m>=f)throw v;if(m++,yield Xce(u,h).catch(()=>{}),h?.aborted){const k=new Error("Aborted");throw k.name="AbortError",k}c>0&&(yield new Promise(k=>globalThis.setTimeout(k,c*m)))}}})}function Md(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function Jce(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function ig(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=Jce(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function rg(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function u$(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function lg(e,t=360,n=500){return u$(e,t,n)}function ag(e,t=360,n=500){return u$(e,t,n)}var Qce=Object.defineProperty,ede=Object.defineProperties,tde=Object.getOwnPropertyDescriptors,h_=Object.getOwnPropertySymbols,nde=Object.prototype.hasOwnProperty,ode=Object.prototype.propertyIsEnumerable,m_=(e,t,n)=>t in e?Qce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c$=(e,t)=>{for(var n in t||(t={}))nde.call(t,n)&&m_(e,n,t[n]);if(h_)for(var n of h_(t))ode.call(t,n)&&m_(e,n,t[n]);return e},g_=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const ug=()=>jo(()=>import("./mermaid.core-CJB1tAev.js").then(e=>e.bp),__vite__mapDeps([2,3]));let Ul=null,Td=ug,xf=null,X3=!1,J3=!1,Sf=0;function sde(e){Td=e,Sf++,Ul=null,xf=null,X3=!1,J3=!1}function ide(e){sde(ug)}function v_(){return typeof Td=="function"}function y_(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=c$({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},ede(n,tde(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function k_(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=c$({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function TVe(){return g_(this,null,function*(){if(Ul)return Ul;const e=(function(){try{const o=globalThis;return y_(o?.mermaid)}catch{return null}})();if(e)return Ul=e,k_(Ul),Ul;const t=Td,n=Sf;return t?t===ug&&X3?null:xf||(xf=g_(null,null,function*(){let o;try{o=yield t()}catch(s){if(t===ug)return n===Sf&&t===Td&&(X3=!0,(function(i){J3||(J3=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',i))})(s)),null;throw s}finally{n===Sf&&t===Td&&(xf=null)}return n!==Sf||t!==Td?null:o?(Ul=y_(o),k_(Ul),Ul):null}),xf):null})}let Oi=null,Fa=null;const Dr=new Map,Uu=new Map;function Jh(e){for(const t of Dr.values())t.reject(e);Dr.clear(),Uu.clear()}let b_=5,C_=!1;const rde="WORKER_BUSY",w_="MERMAID_DISABLED";function lde(e){if(Oi&&Oi!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",Jh(n)}Oi=e,Fa=null;const t=e;Oi.onmessage=n=>{if(Oi!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Dr.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Oi.onerror=n=>{var o,s;if(Oi===t)if(Dr.size!==0){try{C_?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}Jh(new Error(`Worker error: ${n.message}`))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Oi.onmessageerror=n=>{var o,s;if(Oi===t)if(Dr.size!==0){try{C_?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}Jh(new Error("Worker messageerror"))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function ade(){var e;if(Oi)try{Jh(new Error("Worker cleared")),(e=Oi.terminate)==null||e.call(Oi)}catch{}Oi=null,Fa=null}function d$(e,t,n,o){if(!v_()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=w_,Promise.reject(r)}const s=`${e}\0${t.theme}\0${n}\0${t.code}`;let i=Uu.get(s);return i||(i=(function(r,l,a=1400){if(!v_()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=w_,Promise.reject(c)}if(Fa)return Promise.reject(Fa);const u=Oi||(Fa=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Fa.name="WorkerInitError",Fa.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(Fa);if(Dr.size>=b_){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=rde,c.inFlight=Dr.size,c.max=b_,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const v=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),Dr.delete(f))},k={resolve:w=>{v(),c(w)},reject:w=>{v(),d(w)}};Dr.set(f,k);try{u.postMessage({id:f,action:r,payload:l})}catch(w){return Dr.delete(f),void d(w)}h=globalThis.setTimeout(()=>{const w=new Error("Worker call timed out");w.name="WorkerTimeout",w.code="WORKER_TIMEOUT";const b=Dr.get(f);b&&b.reject(w)},a)})})(e,t,n),Uu.set(s,i),i.then(()=>{Uu.get(s)===i&&Uu.delete(s)},()=>{Uu.get(s)===i&&Uu.delete(s)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(i,o)}function EVe(e,t,n=1400,o){return d$("canParse",{code:e,theme:t},n,o)}function IVe(e,t,n=1400,o){return d$("findPrefix",{code:e,theme:t},n,o)}var ude=Object.defineProperty,cde=Object.defineProperties,dde=Object.getOwnPropertyDescriptors,__=Object.getOwnPropertySymbols,fde=Object.prototype.hasOwnProperty,pde=Object.prototype.propertyIsEnumerable,x_=(e,t,n)=>t in e?ude(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mt=(e,t)=>{for(var n in t||(t={}))fde.call(t,n)&&x_(e,n,t[n]);if(__)for(var n of __(t))pde.call(t,n)&&x_(e,n,t[n]);return e},rn=(e,t)=>cde(e,dde(t)),mo=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const hde="__global__",q9="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Q3=(()=>{const e=globalThis;if(e[q9])return e[q9];const t={scopedCustomComponents:{},revision:Xr(0)};return e[q9]=t,t})(),S_=Q3.revision,mde=Symbol("markstreamCustomComponents"),gde=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function Qp(e){return gde.has(String(e).trim().toLowerCase())}function vde(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function K9(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([Sr(n),Sr(vde(n))]))!s||Qp(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function fs(e){const t=nn(mde,null);return R(()=>{var n;return S_.value,(function(o,s={}){return S_.value,mt(mt(mt({},K9(Q3.scopedCustomComponents[hde]||{})),K9(s)),K9((function(i){return i&&Q3.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const yde=["aria-label"],kde={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},bde={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},Gn=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},nr=Gn(et({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(y(),M("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(y(),M("svg",bde,[...n[1]||(n[1]=[C("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),C("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(y(),M("svg",kde,[...n[0]||(n[0]=[C("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,yde))}),[["__scopeId","data-v-be21ab83"]]);nr.install=e=>{e.component(nr.__name,nr)};const Cde={class:"emoji-node"},zi=Gn(et({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(y(),M("span",Cde,N(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);zi.install=e=>{e.component(zi.__name,zi)};const wde=["id"],_de=["title"],or=Gn(et({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(y(),M("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[C("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+N(e.node.id)+"]",9,_de)],8,wde))}}),[["__scopeId","data-v-c1463a29"]]);or.install=e=>{e.component(or.__name,or)};const f$=(()=>{try{return!1}catch{}return!1})();function Z9(e){f$&&console.warn(e)}function A_(e,t="safe",n){return u5(e,t,n)}function p$(e){return oce(e)}function G9(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function p5(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=Xh((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),G9(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),G9(r.value)]):Object.entries(s).map(([r,l])=>[r,G9(l)]):null,t,n);var s;if(!o)return;const i=p$(Zf(o));return Object.keys(i).length>0?i:void 0}function M_(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function rf(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Y9(e,t,n,o,s,i,r=!1){const l=(function(d,f){return YL(d,f)})(e,o);if(Zp.has(e.toLowerCase())||!l&&qL(e,i))return null;if(!l&&a5(e,i))return r?[M_(e,t,!0)]:[M_(e,t),...n,`</${e}>`];const a=u5(t,i,e),u=a.key,c=u!=null&&u!==""?u:s;if(l){const d=o[e]||o[e.toLowerCase()],f=p$(a);return tn(d,rn(mt({},f),{key:c}),n.length>0?n:void 0)}return tn(e,rn(mt({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function h$(e,t){return rce(e,t)}function cg(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const u=[],c=[];for(const d of i)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=Y9(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);rf(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),v=Y9(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?rf(u[u.length-1].children,v):rf(c,v),m.tagName.toLowerCase()!==f&&u.length>h&&Z9(`Auto-closing unclosed tag: <${m.tagName}>`)}else Z9(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;u.length>0;){const d=u.pop(),f=Y9(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?rf(u[u.length-1].children,f):rf(c,f),Z9(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(XL(e),t,n)}catch(s){return o=s,f$&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const xde=["innerHTML"],sr=Gn(et({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=nn("markstreamHtmlPolicy",void 0),o=R(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=fs(()=>t.customId),i=et({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=R(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:jd(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=cg(l,s.value,o.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!h$(l,s.value))return{mode:"html",content:jd(l,o.value)};const a=cg(l,s.value,o.value);return a===null?{mode:"html",content:jd(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(y(),M("span",{key:0,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[j(p(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(y(),M("span",{key:1,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},N(r.value.content),3)):(y(),M("span",{key:2,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,xde))}}),[["__scopeId","data-v-d17f12b0"]]);sr.install=e=>{e.component(sr.__name,sr)};const Sde={class:"inline-code"},Ade={key:0},li=Gn(et({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=p1(),o=nn("markstreamFade",void 0),s=nn("markstreamTextStreamState",void 0),i=nn("markstreamStreamVersion",void 0),r=R(()=>{const b=n.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),l=R(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=R(()=>{var b;return String((b=t.node.code)!=null?b:"")}),u=R(()=>!l.value),c=R(()=>{var b;const _=(b=n["index-key"])!=null?b:n.indexKey;return _==null||_===""?"":String(_)}),d=Z(t.node.code),f=Z(""),h=Z(0);let m;function v(){m?.(),m=void 0}function k(){v(),f.value&&(d.value=d.value+f.value,f.value="")}Je([()=>t.node.code,c,l],([b])=>{const _=String(b??""),g=c.value,x=t$({nextContent:_,persistedContent:g?s?.get(g):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=x.settledContent,f.value=x.streamedDelta,x.appended?(h.value+=1,(function(){if(!f.value||m||!i)return;const S=i.value;m=Je(()=>i.value,T=>{T!==S&&k()},{flush:"sync"})})()):f.value||v(),g&&s?.set(g,_)},{immediate:!0}),d1(v);const w=R(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(b,_)=>(y(),M("code",Sde,[u.value?(y(),M(Pe,{key:0},[qe(N(a.value),1)],64)):(y(),M(Pe,{key:1},[d.value?(y(),M("span",Ade,N(d.value),1)):ee("",!0),f.value?(y(),M("span",{key:1,class:Re(["inline-code-stream-delta",[w.value]]),onAnimationend:k},N(f.value),35)):ee("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);li.install=e=>{e.component(li.__name,li)};const e8=Z(!1),T_=Z(""),E_=Z("top"),Yf=Z(null),Xf=Z(null),t8=Z(null),n8=Z(null),I_=Z(null);let Qh=null,em=null,o8=0;function m$(){Qh&&(clearTimeout(Qh),Qh=null),em&&(clearTimeout(em),em=null)}let bh=!1,Ch=null,L_=!1;function Mde(e,t,n="top",o=!1,s,i){if(!e)return;const r=++o8;m$();const l=()=>mo(null,null,function*(){var a,u;if(yield(function(){return mo(this,null,function*(){if(!bh&&!L_&&typeof document<"u"){Ch!=null||(Ch=mo(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([jo(()=>import("./vue.runtime.esm-bundler-J0WjtLlK.js"),[]),jo(()=>import("./Tooltip-DbYQWF1U.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:e8.value,"anchor-el":Yf.value,content:T_.value,placement:E_.value,id:Xf.value,originX:t8.value,originY:n8.value,isDark:(m=I_.value)!=null?m:void 0})}}).mount(h),bh=!0}));try{yield Ch}catch(c){bh=!1,Ch=null,L_=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),bh&&r===o8){Xf.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Yf.value=e,T_.value=t,E_.value=n,t8.value=(a=s?.x)!=null?a:null,n8.value=(u=s?.y)!=null?u:null,I_.value=typeof i=="boolean"?i:null,e8.value=!0;try{e.setAttribute("aria-describedby",Xf.value)}catch{}}});o?l():Qh=setTimeout(l,80)}function Tde(e=!1){o8+=1,m$();const t=()=>{if(Yf.value&&Xf.value)try{Yf.value.removeAttribute("aria-describedby")}catch{}e8.value=!1,Yf.value=null,Xf.value=null,t8.value=null,n8.value=null};e?t():em=setTimeout(t,120)}const Ede={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},Ide=Symbol("markstreamI18nFallback");function g$(e,t){var n;return(n=t?.[e])!=null?n:Ede[e]}const s8=(e,t)=>{var n;return(n=g$(e,t))!=null?n:(function(o){return(o.split(".").pop()||o).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function $_(e,t){return{t(n){const o=g$(n,t);if(e.te&&o!=null&&!e.te(n))return s8(n,t);const s=e.t(n);return s===n&&o!=null?s8(n,t):s}}}function Lde(){const e=(function(){var n,o,s;try{const i=ds(),r=Ide,l=i?.provides,a=(n=i?.appContext)==null?void 0:n.provides;return(s=(o=l?.[r])!=null?o:a?.[r])!=null?s:null}catch{}return null})(),t=(function(){var n,o;try{const s=ds(),i=s?.proxy,r=i?.$t;if(typeof r=="function"){const u=i?.$te;return{t:r.bind(i),te:typeof u=="function"?u.bind(i):void 0}}const l=(o=(n=s?.appContext)==null?void 0:n.config)==null?void 0:o.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return $_(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const o=n();if(o&&typeof o.t=="function")return $_({t:o.t.bind(o),te:typeof o.te=="function"?o.te.bind(o):void 0},e)}catch{}}catch{}return{t:n=>s8(n,e)}}const v$=Symbol("ViewportPriority"),y$=Symbol("ViewportPriorityOptions"),k$=Symbol("OffscreenHeavyNodeDeferral"),$de=R(()=>!1),yc="400px";function h5(){return nn(y$,void 0)}function m5(){return nn(k$,$de)}function Nde(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Z(t):t,r=s?(n=window.requestIdleCallback)!=null?n:T=>window.setTimeout(()=>T({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:T=>window.clearTimeout(T):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function v(T){if(!T)return"viewport";let A=a.get(T);return A||(A=u++,a.set(T,A)),String(A)}function k(){if(h!=null){try{l?.(h)}catch{}h=null}}function w(T){if(T){const A=c.get(T);if(A&&!A.targets.size){try{A.io.disconnect()}catch{}c.delete(T)}}d.size||f.size||k()}function b(T){const A=d.get(T);if(!A)return;const E=c.get(A.bucketKey);if(!A.visible.value){A.visible.value=!0;try{A.resolve()}catch{}}try{E?.io.unobserve(T)}catch{}E?.targets.delete(T),d.delete(T),f.delete(T),w(A.bucketKey)}function _(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const T=f.values().next().value;T&&(f.delete(T),b(T),f.size&&_())},{timeout:1200}))}function g(T,A){if(!s||typeof IntersectionObserver>"u")return null;const E=(function(H,O){var F,U,z;return{root:(F=e?.(H??null))!=null?F:null,rootMargin:(U=O?.rootMargin)!=null?U:yc,threshold:(z=O?.threshold)!=null?z:0}})(T,A),P=[v((D=E).root),D.rootMargin,D.threshold].join("\0");var D;const I=c.get(P);if(I)return{key:P,bucket:I};let $;try{$=new IntersectionObserver(H=>{for(const O of H)(O.isIntersecting||O.intersectionRatio>0)&&b(O.target)},{root:E.root,rootMargin:E.rootMargin,threshold:E.threshold})}catch{return null}const B={io:$,targets:new Map};return c.set(P,B),{key:P,bucket:B}}function x(){if(s&&i.value)for(const[T,A]of Array.from(d.entries())){const E=g(T,A.opts);if(!E){b(T);continue}if(E.key===A.bucketKey)continue;const P=A.bucketKey,D=c.get(P);try{D?.io.unobserve(T)}catch{}D?.targets.delete(T),A.bucketKey=E.key,E.bucket.targets.set(T,A),E.bucket.io.observe(T),w(P)}}Je(i,T=>{if(!T){for(const A of Array.from(d.keys()))b(A);k()}},{flush:"sync"});const S=(T,A)=>{const E=Z(!1);let P,D=!1;const I=new Promise(O=>{P=()=>{D||(D=!0,O())}}),$=()=>{const O=d.get(T);if(!O)return f.delete(T),void w();const F=c.get(O.bucketKey);try{F?.io.unobserve(T)}catch{}F?.targets.delete(T),d.delete(T),f.delete(T),w(O.bucketKey)};if(!s||!i.value)return E.value=!0,P(),{isVisible:E,whenVisible:I,destroy:$};const B=g(T,A);if(!B)return E.value=!0,P(),{isVisible:E,whenVisible:I,destroy:$};const H={resolve:P,visible:E,bucketKey:B.key,opts:A};return d.set(T,H),B.bucket.targets.set(T,H),B.bucket.io.observe(T),s&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,x()})),A?.allowIdle!==!1&&(f.add(T),_()),{isVisible:E,whenVisible:I,destroy:$}};return S.refresh=x,Ln(v$,S),S}function g5(){var e,t;const n=nn(v$,void 0);if(n)return n;const o=new WeakMap,s=new Map,i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=s.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}s.delete(h)}},d=h=>{const m=o.get(h);if(!m)return;const v=s.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{v?.io.unobserve(h)}catch{}o.delete(h),v?.targets.delete(h),i.delete(h),c(m.bucketKey),i.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const h=i.values().next().value;h&&(i.delete(h),d(h),i.size&&f())},{timeout:1200}))};return(h,m)=>{const v=Z(!1);let k,w=!1;const b=new Promise(x=>{k=()=>{w||(w=!0,x())}}),_=()=>{const x=o.get(h);if(!x)return i.delete(h),void(i.size||u());const S=s.get(x.bucketKey);try{S?.io.unobserve(h)}catch{}o.delete(h),S?.targets.delete(h),i.delete(h),c(x.bucketKey),i.size||u()},g=(x=>{var S,T;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const A=($=>{var B,H;return[(B=$?.rootMargin)!=null?B:yc,(H=$?.threshold)!=null?H:0].join("\0")})(x),E=s.get(A);if(E)return{key:A,bucket:E};const P=(S=x?.rootMargin)!=null?S:yc;let D;try{D=new IntersectionObserver($=>{for(const B of $)(B.isIntersecting||B.intersectionRatio>0)&&d(B.target)},{root:null,rootMargin:P,threshold:(T=x?.threshold)!=null?T:0})}catch{return null}const I={io:D,targets:new Set};return s.set(A,I),{key:A,bucket:I}})(m);return g?(o.set(h,{resolve:k,visible:v,bucketKey:g.key}),g.bucket.targets.add(h),g.bucket.io.observe(h),m?.allowIdle!==!1&&(i.add(h),f()),{isVisible:v,whenVisible:b,destroy:_}):(v.value=!0,k(),{isVisible:v,whenVisible:b,destroy:_})}}function Fde(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const Rde=["data-markstream-viewport-pending"],Ode=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Pde={key:1,class:"image-placeholder"},Dde={key:1,class:"image-node__raw-text"},Bde={key:2,class:"image-shimmer-overlay"},Hde={key:1,class:"image-node__raw-text"},zde={key:3,class:"image-error"},Va=Gn(et({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,o,s;const i=e,r=t,l=Z(!1),a=Z(!1),u=Z(""),c=Z("primary"),d=Z(null),f=p1(),h=nn(G3,null),m=g5(),v=h5(),k=m5(),w=R(()=>nw(i.node.src)),b=R(()=>nw(i.fallbackSrc)),_=(s=(o=(n=ds())==null?void 0:n.vnode.el)==null?void 0:o.querySelector)==null?void 0:s.call(o,"img"),g=typeof window<"u"&&_?.getAttribute("src")===(w.value||b.value),x=Z(typeof window>"u"||g||!k.value),S=Xr(null);let T="",A=null;const E=R(()=>u.value),P=R(()=>!i.lazy),D=R(()=>typeof window<"u"&&k.value&&!g),I=R(()=>!D.value||x.value),$=R(()=>I.value?E.value:""),B=R(()=>{var de,pe;return(pe=(de=v?.value.heavyBlockMargin)!=null?de:v?.value.rootMargin)!=null?pe:yc}),H=R(()=>!i.node.loading&&c.value!=="failed"&&u.value.length>0),O=R(()=>c.value==="failed"),F=R(()=>(!P.value||D.value&&!x.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),U=R(()=>Fde(i,f));function z(de=U.value){de&&d.value&&h?.reportHeight(de,d.value.offsetHeight)}function W(de=U.value){de&&yt(()=>{z(de)})}function K(){A&&(clearTimeout(A),A=null)}function V(){const de=U.value;de&&T!==de&&(T&&h?.markSettled(T),K(),T=de,h?.markPending(de),typeof window<"u"&&(A=window.setTimeout(()=>{T===de&&(W(de),ie())},8e3)))}function ie(){return mo(this,null,function*(){const de=T;de&&(K(),T="",yield yt(),z(de),h?.markSettled(de))})}function ne(){if(c.value==="primary"&&b.value&&b.value!==u.value)return c.value="fallback",u.value=b.value,l.value=!1,a.value=!1,void W();c.value="failed",a.value=!0,r("error",u.value),W()}function X(){l.value=!0,a.value=!1,r("load",E.value),W()}function le(de){de.preventDefault(),l.value&&!a.value&&r("click",[de,E.value])}const{t:Ie}=Lde();return Je([w,b,()=>i.node.loading],()=>(l.value=!1,a.value=!1,i.node.loading||w.value?(u.value=w.value,void(c.value="primary")):b.value?(u.value=b.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&Je([d,D],([de,pe],ve,oe)=>{var ye;if((ye=S.value)==null||ye.destroy(),S.value=null,!pe||x.value)return void(x.value=!0);if(!de)return void(x.value=!1);let G=!0;const Y=m(de,{rootMargin:B.value,allowIdle:!1});S.value=Y,x.value=Y.isVisible.value,Y.whenVisible.then(()=>{G&&S.value===Y&&(x.value=!0)}),oe(()=>{G=!1,Y.destroy(),S.value===Y&&(S.value=null)})},{immediate:!0}),Je([H,l,a,E,()=>i.lazy,I],([de,pe,ve,oe,ye,G])=>de&&oe&&!ve&&G?pe?(ie(),void W()):ye?(V(),void W()):void(pe||ve||V()):(ie(),void W()),{flush:"post",immediate:!0}),Vn(()=>{var de;(de=S.value)==null||de.destroy(),S.value=null,(function(){const pe=T;pe&&(K(),T="",h?.markSettled(pe))})()}),(de,pe)=>{var ve,oe,ye,G,Y;return y(),M("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":D.value&&!x.value?"true":void 0},[H.value?(y(),M("img",{key:0,src:$.value||void 0,alt:String((oe=(ve=i.node.alt)!=null?ve:i.node.title)!=null?oe:""),title:String((G=(ye=i.node.title)!=null?ye:i.node.alt)!=null?G:""),class:Re(["image-node__img",{"is-loading":!P.value&&!l.value,"is-loaded":P.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:i.lazy?"lazy":void 0,fetchpriority:P.value?"high":void 0,decoding:P.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(Y=i.node.alt)!=null?Y:p(Ie)("image.preview"),onError:ne,onLoad:X,onClick:le},null,42,Ode)):ee("",!0),e.node.loading&&!a.value?(y(),M("span",Pde,[i.usePlaceholder?xn(de.$slots,"placeholder",{key:0,node:i.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[pe[0]||(pe[0]=C("span",{class:"image-shimmer"},null,-1))],!0):(y(),M("span",Dde,N(e.node.raw),1))])):ee("",!0),F.value&&!e.node.loading?(y(),M("span",Bde,[i.usePlaceholder?xn(de.$slots,"placeholder",{key:0,node:i.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[pe[1]||(pe[1]=C("span",{class:"image-shimmer"},null,-1))],!0):(y(),M("span",Hde,N(e.node.raw),1))])):ee("",!0),O.value?(y(),M("span",zde,[xn(de.$slots,"error",{node:i.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[pe[2]||(pe[2]=C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[C("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),C("span",null,N(p(Ie)("image.loadError")),1)],!0)])):ee("",!0)],8,Rde)}}}),[["__scopeId","data-v-046e82ac"]]);Va.install=e=>{e.component(Va.__name,Va)};const Wde={key:2},El=et({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=fs(()=>t.customId),o=nn("markstreamHtmlPolicy",void 0),s=nn("markstreamNestedRendererProps",void 0),i=R(()=>{var m;return(m=o?.value)!=null?m:"safe"}),r=R(()=>{var m,v;const k=(m=s?.value)!=null?m:{};return rn(mt({},k),{customId:(v=t.customId)!=null?v:k.customId,htmlPolicy:i.value})}),l=zr({loader:()=>Promise.resolve().then(()=>M5),suspensible:!1}),a=R(()=>t.components[String(t.node.type)]),u=R(()=>!!(a.value&&n.value[t.node.type]&&!Qp(String(t.node.type)))),c=R(()=>u.value?p5(t.node,i.value):void 0),d=R(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=R(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=R(()=>{var m,v;return String((v=(m=t.node.content)!=null?m:t.node.raw)!=null?v:"")});return(m,v)=>a.value&&u.value?(y(),he(bs(a.value),zn({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:me(()=>[d.value?(y(),he(p(l),zn({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(y(),he(p(l),zn({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(y(),he(bs(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(y(),M("span",Wde,N(h.value),1)):ee("",!0)}}),N_=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function Ude(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return rn(mt(mt({},N_),n),{enabled:(t=n.enabled)==null||t})}return mt({},N_)}function v5(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,o=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=o}function b$(e){var t,n;const o=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(o.length<3)return"";const s=o[0];if(s!=="`"&&s!=="~"||o[1]!==s||o[2]!==s)return"";let i=3;for(;o[i]===s;)i+=1;return o.slice(i).trim()}function F_(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function jde(e){var t;return e.diff===!0||F_(e.language)||F_(b$(String((t=e.raw)!=null?t:"")))}function Vde(e,t,n){const o=(function(s){const i=b$(s);if(!i)return"";const r=i.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:o||t,caption:o?n?`Diff / ${t}`:t:""}}const qde=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],Kde={key:0,translate:"no",class:"markstream-pre__diff-code"},Zde={class:"markstream-pre__diff-pane-content"},Gde={class:"markstream-pre__diff-number","aria-hidden":"true"},Yde={class:"markstream-pre__diff-content"},Xde={class:"markstream-pre__diff-content-inner"},Jde={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},Qde=["textContent"],e1e=["textContent"],Pi=et({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(X,le){const Ie=String(X??"");return le?Ie:Ie.replace(/\r\n$|\n$|\r$/,"")}const o=R(()=>{var X,le,Ie;const de=String((le=(X=t.node)==null?void 0:X.language)!=null?le:"");return String((Ie=String(de).split(/\s+/g)[0])!=null?Ie:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=R(()=>`language-${o.value}`),i=R(()=>{var X;return t.loading===!0||((X=t.node)==null?void 0:X.loading)===!0}),r=R(()=>{var X;return n((X=t.node)==null?void 0:X.code,i.value)});let l="",a=1;const u=R(()=>(function(X){let le=0,Ie=1;X.startsWith(l)&&(le=l.length,Ie=a,le>0&&X[le-1]==="\r"&&X[le]===`
312
+ </div>`};const u=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,d=m=>{if(!m.startsWith("["))return!1;const v=c.exec(m);if(!v)return m!=="["&&!/^\[\d+$/.test(m);const k=String(v[1]??"");return m.slice(v[0].length).startsWith("(")?!1:!/^\d+$/.test(k)},f=(m,v)=>{const k=m;if(k.src[k.pos]!=="[")return!1;const w=u.exec(k.src.slice(k.pos));if(!w)return!1;const b=k.src.slice(Math.max(0,k.pos-120),k.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const _=k.src.slice(k.pos+w[0].length);if(_.startsWith("](")||_.startsWith("(")||d(_))return!1;if(!v){const g=w[1],x=k.push("reference","span",0);x.content=g,x.markup=w[0],x.raw=w[0]}return k.pos+=w[0].length,!0};n.inline.ruler.before("escape","reference",f),n.renderer.rules.reference=(m,v)=>{const w=String(m[v].content??"");return`<span class="reference-link" data-reference-id="${w}" role="button" tabindex="0" title="Click to view reference">${w}</span>`};const h=n.use.bind(n);return n.use=((...m)=>(o.__markstreamHasCustomParserExtensions=!0,h(...m))),n}function Sce({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function t$({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:Sce({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const Ace={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function Mce(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function n$(e){const t=Mce(e);return Ace[t]??t}function Tce(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>n$(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function Ece(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function Ice(e){return Ece(e)?.join("\0")??""}function Lce(e,t){return`${Ice(e)}\0\0${Tce(t)?.join("\0")??""}`}function rd(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function a_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var $ce=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const m=u_();this.startedAt=f&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=u_();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const f=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const m=this.pendingChars,v=m>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,k=Oce(m/Math.max(.001,v/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(k-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const w=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),b=Rce(this.source.slice(this.visible.length),w,this.segmenter);b.text&&(this.visible+=b.text,this.charBudget=Math.max(0,this.charBudget-b.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=rd(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,rd(o,1e3,1)),this.normalizedTargetLatencyMs=rd(s,900,1),this.normalizedCatchUpLatencyMs=rd(i,350,1),this.normalizedCatchUpThreshold=a_(r,600),this.normalizedStartDelayMs=a_(a,80),this.maxCommitFps=Math.trunc(rd(l,30,1)),this.maxCharsPerCommit=Math.trunc(rd(u,80,1)),this.flushOnFinish=c,this.segmenter=Fce(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function Nce(e={},t){const n=new $ce(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function Fce(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function Rce(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function u_(){return typeof performance<"u"?performance.now():Date.now()}function Oce(e,t,n){return Math.min(n,Math.max(t,e))}var Pce=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const G3=Symbol.for("markstream-vue:node-lifecycle");function wVe(){}const c5=new Map;let o$="material";const Ad=new Map,c_=new Map;let Y3=null;function Dce(e){c5.set(e.id,e)}function Bce(e){const t=c5.get(o$);if(!t)return;const n=t.core[e];if(n)return n;const o=Ad.get(t.id);if(o){const s=o[e];if(s)return s}t.loadExtended&&!Ad.has(t.id)&&zce(t)}function Hce(){var e,t;return(t=(e=c5.get(o$))==null?void 0:e.fallback)!=null?t:""}function zce(e){return Pce(this,null,function*(){var t,n,o;if(Ad.has(e.id))return(t=Ad.get(e.id))!=null?t:null;let s=c_.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(Ad.set(e.id,i),Y3?.(),i)).catch(()=>(Ad.set(e.id,null),null)),c_.set(e.id,s)),s})}const d_='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',f_='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',Wce={id:"material",core:{"":f_,plain:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',text:f_,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',cs:d_,csharp:d_,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',powershell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>'},fallback:'<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',loadExtended:()=>jo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Uce=Xr(0);Y3=()=>{Uce.value++},Dce(Wce);const jce={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function T2(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=jce[n])!=null?t:n}function _Ve(e){const t=T2(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function xVe(e){return Bce(T2(e))||Hce()}const p_={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var E2=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let ki=null,Qu=!1,ec=null,I2=f5;function Jp(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function d5(){try{const e=globalThis;return Jp(e?.katex)}catch{return null}}function f5(){return E2(null,null,function*(){const e=d5();if(e)return e;const t=yield jo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield jo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Jp(t)})}function s$(e){const t=Promise.resolve(e).then(n=>{var o;return ec===t&&n?(ki=(o=Jp(n))!=null?o:n,ki):null}).catch(()=>null).finally(()=>{ec===t&&(ec=null)});return ec=t,Qu=!0,t}function Vce(e){I2=e,ki=null,Qu=!1,ec=null}function qce(e){Vce(f5)}function i$(){return typeof I2=="function"}function SVe(){var e;const t=I2;if(!t||t===f5)return null;if(ki)return ki;const n=d5();if(n)return ki=n,ki;if(Qu)return null;try{const o=t();return o?typeof o?.then=="function"?(s$(o),null):(ki=(e=Jp(o))!=null?e:o,ki):null}catch{return null}}function r$(){return E2(this,null,function*(){var e;const t=d5();if(t)return ki=t,ki;if(ki)return ki;if(ec)return ec;if(Qu)return null;const n=I2;if(!n)return Qu=!0,null;try{const o=n();if(typeof o?.then=="function")return s$(o);if(o)return ki=(e=Jp(o))!=null?e:o,Qu=!0,ki}catch{}return Qu=!0,null})}function l$(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Ha=null,Na=null;const Ws=new Map,ea=new Map;let Lp=5;const uc=new Set;function Gf(){if(Ws.size<Lp&&uc.size){let e=Lp-Ws.size;for(const t of Array.from(uc)){if(e<=0)break;uc.delete(t),e--;try{t()}catch{}}}}function a$(){for(const e of Array.from(uc)){uc.delete(e);try{e()}catch{}}}function Kce(e){Ha=e,Na=null,Ha.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=Ws.get(n);if(i)if(Ws.delete(n),clearTimeout(i.timeoutId),i.cleanup(),Gf(),s)i.aborted||i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(ea.set(a,o),ea.size>200){const u=ea.keys().next().value;ea.delete(u)}}i.aborted||i.resolve(o)}},Ha.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of Ws.entries())clearTimeout(o.timeoutId),o.cleanup(),o.aborted||o.reject(new Error(`Worker error: ${t.message}`));Ws.clear(),a$()}}function Zce(){var e;for(const t of Ws.values())clearTimeout(t.timeoutId),t.cleanup(),t.aborted||t.reject(new Error("Worker cleared"));Ws.clear(),a$(),Ha&&((e=Ha.terminate)==null||e.call(Ha)),Ha=null,Na=null}function Gce(e,t=!0,n=2e3,o){return E2(this,null,function*(){performance.now();const s=l$(e);if(!i$()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Na)return Promise.reject(Na);const i=`${t?"d":"i"}:${s}`,r=ea.get(i);if(r)return Gf(),Promise.resolve(r);const l=Ha||(Na=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Na.name="WorkerInitError",Na.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Na);if(Ws.size>=Lp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Ws.size,a.max=Lp,Promise.reject(a)}return new Promise((a,u)=>{if(o?.aborted){const v=new Error("Aborted");return v.name="AbortError",void u(v)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const v=Ws.get(c);if(!v)return;Ws.delete(c),v.cleanup();const k=new Error("Worker render timed out");k.name="WorkerTimeout",k.code="WORKER_TIMEOUT",v.aborted||v.reject(k),Gf()},n);d=()=>{const v=Ws.get(c);if(!v||v.aborted)return;v.aborted=!0,v.cleanup();const k=new Error("Aborted");k.name="AbortError",u(k)},o&&o.addEventListener("abort",d,{once:!0});const h=a,m=u;Ws.set(c,{resolve:v=>{h(v)},reject:v=>{m(v)},timeoutId:f,aborted:!1,cleanup:()=>{o&&d&&o.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:s,displayMode:t})}catch(v){const k=Ws.get(c);Ws.delete(c),clearTimeout(f),k?.cleanup(),k?.reject(v),Gf()}})})}function AVe(e,t=!0,n){const o=`${t?"d":"i"}:${l$(e)}`;if(ea.set(o,n),ea.size>200){const s=ea.keys().next().value;ea.delete(s)}}const Yce="WORKER_BUSY";function Xce(e=2e3,t){return Ws.size<Lp?Promise.resolve():new Promise((n,o)=>{let s,i=!1,r=null,l=()=>{};const a=()=>{s&&globalThis.clearTimeout(s),uc.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{i||(i=!0,a(),n())},uc.add(l),s=globalThis.setTimeout(()=>{if(i)return;i=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",o(u)},e),queueMicrotask(()=>Gf()),t&&(r=()=>{if(i)return;i=!0,a();const u=new Error("Aborted");u.name="AbortError",o(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const sf={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function MVe(e){return E2(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!i$()){const v=new Error("KaTeX rendering disabled");throw v.name="KaTeXDisabled",v.code="KATEX_DISABLED",v}const a=(s=o.timeout)!=null?s:sf.timeout,u=(i=o.waitTimeout)!=null?i:sf.waitTimeout,c=(r=o.backoffMs)!=null?r:sf.backoffMs,d=(l=o.maxRetries)!=null?l:sf.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):sf.maxRetries,h=o.signal;let m=0;for(;;){if(h?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}try{return yield Gce(t,n,a,h)}catch(v){if(v?.code!==Yce||m>=f)throw v;if(m++,yield Xce(u,h).catch(()=>{}),h?.aborted){const k=new Error("Aborted");throw k.name="AbortError",k}c>0&&(yield new Promise(k=>globalThis.setTimeout(k,c*m)))}}})}function Md(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function Jce(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function ig(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=Jce(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function rg(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function u$(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function lg(e,t=360,n=500){return u$(e,t,n)}function ag(e,t=360,n=500){return u$(e,t,n)}var Qce=Object.defineProperty,ede=Object.defineProperties,tde=Object.getOwnPropertyDescriptors,h_=Object.getOwnPropertySymbols,nde=Object.prototype.hasOwnProperty,ode=Object.prototype.propertyIsEnumerable,m_=(e,t,n)=>t in e?Qce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c$=(e,t)=>{for(var n in t||(t={}))nde.call(t,n)&&m_(e,n,t[n]);if(h_)for(var n of h_(t))ode.call(t,n)&&m_(e,n,t[n]);return e},g_=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const ug=()=>jo(()=>import("./mermaid.core-CsZwh_jB.js").then(e=>e.bp),__vite__mapDeps([2,3]));let Ul=null,Td=ug,xf=null,X3=!1,J3=!1,Sf=0;function sde(e){Td=e,Sf++,Ul=null,xf=null,X3=!1,J3=!1}function ide(e){sde(ug)}function v_(){return typeof Td=="function"}function y_(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=c$({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},ede(n,tde(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function k_(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=c$({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function TVe(){return g_(this,null,function*(){if(Ul)return Ul;const e=(function(){try{const o=globalThis;return y_(o?.mermaid)}catch{return null}})();if(e)return Ul=e,k_(Ul),Ul;const t=Td,n=Sf;return t?t===ug&&X3?null:xf||(xf=g_(null,null,function*(){let o;try{o=yield t()}catch(s){if(t===ug)return n===Sf&&t===Td&&(X3=!0,(function(i){J3||(J3=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',i))})(s)),null;throw s}finally{n===Sf&&t===Td&&(xf=null)}return n!==Sf||t!==Td?null:o?(Ul=y_(o),k_(Ul),Ul):null}),xf):null})}let Oi=null,Fa=null;const Dr=new Map,Uu=new Map;function Jh(e){for(const t of Dr.values())t.reject(e);Dr.clear(),Uu.clear()}let b_=5,C_=!1;const rde="WORKER_BUSY",w_="MERMAID_DISABLED";function lde(e){if(Oi&&Oi!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",Jh(n)}Oi=e,Fa=null;const t=e;Oi.onmessage=n=>{if(Oi!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Dr.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Oi.onerror=n=>{var o,s;if(Oi===t)if(Dr.size!==0){try{C_?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}Jh(new Error(`Worker error: ${n.message}`))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Oi.onmessageerror=n=>{var o,s;if(Oi===t)if(Dr.size!==0){try{C_?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}Jh(new Error("Worker messageerror"))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function ade(){var e;if(Oi)try{Jh(new Error("Worker cleared")),(e=Oi.terminate)==null||e.call(Oi)}catch{}Oi=null,Fa=null}function d$(e,t,n,o){if(!v_()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=w_,Promise.reject(r)}const s=`${e}\0${t.theme}\0${n}\0${t.code}`;let i=Uu.get(s);return i||(i=(function(r,l,a=1400){if(!v_()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=w_,Promise.reject(c)}if(Fa)return Promise.reject(Fa);const u=Oi||(Fa=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Fa.name="WorkerInitError",Fa.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(Fa);if(Dr.size>=b_){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=rde,c.inFlight=Dr.size,c.max=b_,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const v=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),Dr.delete(f))},k={resolve:w=>{v(),c(w)},reject:w=>{v(),d(w)}};Dr.set(f,k);try{u.postMessage({id:f,action:r,payload:l})}catch(w){return Dr.delete(f),void d(w)}h=globalThis.setTimeout(()=>{const w=new Error("Worker call timed out");w.name="WorkerTimeout",w.code="WORKER_TIMEOUT";const b=Dr.get(f);b&&b.reject(w)},a)})})(e,t,n),Uu.set(s,i),i.then(()=>{Uu.get(s)===i&&Uu.delete(s)},()=>{Uu.get(s)===i&&Uu.delete(s)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(i,o)}function EVe(e,t,n=1400,o){return d$("canParse",{code:e,theme:t},n,o)}function IVe(e,t,n=1400,o){return d$("findPrefix",{code:e,theme:t},n,o)}var ude=Object.defineProperty,cde=Object.defineProperties,dde=Object.getOwnPropertyDescriptors,__=Object.getOwnPropertySymbols,fde=Object.prototype.hasOwnProperty,pde=Object.prototype.propertyIsEnumerable,x_=(e,t,n)=>t in e?ude(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mt=(e,t)=>{for(var n in t||(t={}))fde.call(t,n)&&x_(e,n,t[n]);if(__)for(var n of __(t))pde.call(t,n)&&x_(e,n,t[n]);return e},rn=(e,t)=>cde(e,dde(t)),mo=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const hde="__global__",q9="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Q3=(()=>{const e=globalThis;if(e[q9])return e[q9];const t={scopedCustomComponents:{},revision:Xr(0)};return e[q9]=t,t})(),S_=Q3.revision,mde=Symbol("markstreamCustomComponents"),gde=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function Qp(e){return gde.has(String(e).trim().toLowerCase())}function vde(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function K9(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([Sr(n),Sr(vde(n))]))!s||Qp(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function fs(e){const t=nn(mde,null);return R(()=>{var n;return S_.value,(function(o,s={}){return S_.value,mt(mt(mt({},K9(Q3.scopedCustomComponents[hde]||{})),K9(s)),K9((function(i){return i&&Q3.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const yde=["aria-label"],kde={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},bde={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},Gn=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},nr=Gn(et({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(y(),M("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(y(),M("svg",bde,[...n[1]||(n[1]=[C("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),C("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(y(),M("svg",kde,[...n[0]||(n[0]=[C("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,yde))}),[["__scopeId","data-v-be21ab83"]]);nr.install=e=>{e.component(nr.__name,nr)};const Cde={class:"emoji-node"},zi=Gn(et({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(y(),M("span",Cde,N(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);zi.install=e=>{e.component(zi.__name,zi)};const wde=["id"],_de=["title"],or=Gn(et({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(y(),M("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[C("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+N(e.node.id)+"]",9,_de)],8,wde))}}),[["__scopeId","data-v-c1463a29"]]);or.install=e=>{e.component(or.__name,or)};const f$=(()=>{try{return!1}catch{}return!1})();function Z9(e){f$&&console.warn(e)}function A_(e,t="safe",n){return u5(e,t,n)}function p$(e){return oce(e)}function G9(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function p5(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=Xh((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),G9(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),G9(r.value)]):Object.entries(s).map(([r,l])=>[r,G9(l)]):null,t,n);var s;if(!o)return;const i=p$(Zf(o));return Object.keys(i).length>0?i:void 0}function M_(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function rf(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Y9(e,t,n,o,s,i,r=!1){const l=(function(d,f){return YL(d,f)})(e,o);if(Zp.has(e.toLowerCase())||!l&&qL(e,i))return null;if(!l&&a5(e,i))return r?[M_(e,t,!0)]:[M_(e,t),...n,`</${e}>`];const a=u5(t,i,e),u=a.key,c=u!=null&&u!==""?u:s;if(l){const d=o[e]||o[e.toLowerCase()],f=p$(a);return tn(d,rn(mt({},f),{key:c}),n.length>0?n:void 0)}return tn(e,rn(mt({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function h$(e,t){return rce(e,t)}function cg(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const u=[],c=[];for(const d of i)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=Y9(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);rf(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),v=Y9(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?rf(u[u.length-1].children,v):rf(c,v),m.tagName.toLowerCase()!==f&&u.length>h&&Z9(`Auto-closing unclosed tag: <${m.tagName}>`)}else Z9(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;u.length>0;){const d=u.pop(),f=Y9(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?rf(u[u.length-1].children,f):rf(c,f),Z9(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(XL(e),t,n)}catch(s){return o=s,f$&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const xde=["innerHTML"],sr=Gn(et({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=nn("markstreamHtmlPolicy",void 0),o=R(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=fs(()=>t.customId),i=et({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=R(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:jd(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=cg(l,s.value,o.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!h$(l,s.value))return{mode:"html",content:jd(l,o.value)};const a=cg(l,s.value,o.value);return a===null?{mode:"html",content:jd(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(y(),M("span",{key:0,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[j(p(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(y(),M("span",{key:1,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},N(r.value.content),3)):(y(),M("span",{key:2,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,xde))}}),[["__scopeId","data-v-d17f12b0"]]);sr.install=e=>{e.component(sr.__name,sr)};const Sde={class:"inline-code"},Ade={key:0},li=Gn(et({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=p1(),o=nn("markstreamFade",void 0),s=nn("markstreamTextStreamState",void 0),i=nn("markstreamStreamVersion",void 0),r=R(()=>{const b=n.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),l=R(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=R(()=>{var b;return String((b=t.node.code)!=null?b:"")}),u=R(()=>!l.value),c=R(()=>{var b;const _=(b=n["index-key"])!=null?b:n.indexKey;return _==null||_===""?"":String(_)}),d=Z(t.node.code),f=Z(""),h=Z(0);let m;function v(){m?.(),m=void 0}function k(){v(),f.value&&(d.value=d.value+f.value,f.value="")}Je([()=>t.node.code,c,l],([b])=>{const _=String(b??""),g=c.value,x=t$({nextContent:_,persistedContent:g?s?.get(g):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=x.settledContent,f.value=x.streamedDelta,x.appended?(h.value+=1,(function(){if(!f.value||m||!i)return;const S=i.value;m=Je(()=>i.value,T=>{T!==S&&k()},{flush:"sync"})})()):f.value||v(),g&&s?.set(g,_)},{immediate:!0}),d1(v);const w=R(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(b,_)=>(y(),M("code",Sde,[u.value?(y(),M(Pe,{key:0},[qe(N(a.value),1)],64)):(y(),M(Pe,{key:1},[d.value?(y(),M("span",Ade,N(d.value),1)):ee("",!0),f.value?(y(),M("span",{key:1,class:Re(["inline-code-stream-delta",[w.value]]),onAnimationend:k},N(f.value),35)):ee("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);li.install=e=>{e.component(li.__name,li)};const e8=Z(!1),T_=Z(""),E_=Z("top"),Yf=Z(null),Xf=Z(null),t8=Z(null),n8=Z(null),I_=Z(null);let Qh=null,em=null,o8=0;function m$(){Qh&&(clearTimeout(Qh),Qh=null),em&&(clearTimeout(em),em=null)}let bh=!1,Ch=null,L_=!1;function Mde(e,t,n="top",o=!1,s,i){if(!e)return;const r=++o8;m$();const l=()=>mo(null,null,function*(){var a,u;if(yield(function(){return mo(this,null,function*(){if(!bh&&!L_&&typeof document<"u"){Ch!=null||(Ch=mo(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([jo(()=>import("./vue.runtime.esm-bundler-D20WEMcO.js"),[]),jo(()=>import("./Tooltip-BCySsRbJ.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:e8.value,"anchor-el":Yf.value,content:T_.value,placement:E_.value,id:Xf.value,originX:t8.value,originY:n8.value,isDark:(m=I_.value)!=null?m:void 0})}}).mount(h),bh=!0}));try{yield Ch}catch(c){bh=!1,Ch=null,L_=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),bh&&r===o8){Xf.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Yf.value=e,T_.value=t,E_.value=n,t8.value=(a=s?.x)!=null?a:null,n8.value=(u=s?.y)!=null?u:null,I_.value=typeof i=="boolean"?i:null,e8.value=!0;try{e.setAttribute("aria-describedby",Xf.value)}catch{}}});o?l():Qh=setTimeout(l,80)}function Tde(e=!1){o8+=1,m$();const t=()=>{if(Yf.value&&Xf.value)try{Yf.value.removeAttribute("aria-describedby")}catch{}e8.value=!1,Yf.value=null,Xf.value=null,t8.value=null,n8.value=null};e?t():em=setTimeout(t,120)}const Ede={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},Ide=Symbol("markstreamI18nFallback");function g$(e,t){var n;return(n=t?.[e])!=null?n:Ede[e]}const s8=(e,t)=>{var n;return(n=g$(e,t))!=null?n:(function(o){return(o.split(".").pop()||o).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function $_(e,t){return{t(n){const o=g$(n,t);if(e.te&&o!=null&&!e.te(n))return s8(n,t);const s=e.t(n);return s===n&&o!=null?s8(n,t):s}}}function Lde(){const e=(function(){var n,o,s;try{const i=ds(),r=Ide,l=i?.provides,a=(n=i?.appContext)==null?void 0:n.provides;return(s=(o=l?.[r])!=null?o:a?.[r])!=null?s:null}catch{}return null})(),t=(function(){var n,o;try{const s=ds(),i=s?.proxy,r=i?.$t;if(typeof r=="function"){const u=i?.$te;return{t:r.bind(i),te:typeof u=="function"?u.bind(i):void 0}}const l=(o=(n=s?.appContext)==null?void 0:n.config)==null?void 0:o.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return $_(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const o=n();if(o&&typeof o.t=="function")return $_({t:o.t.bind(o),te:typeof o.te=="function"?o.te.bind(o):void 0},e)}catch{}}catch{}return{t:n=>s8(n,e)}}const v$=Symbol("ViewportPriority"),y$=Symbol("ViewportPriorityOptions"),k$=Symbol("OffscreenHeavyNodeDeferral"),$de=R(()=>!1),yc="400px";function h5(){return nn(y$,void 0)}function m5(){return nn(k$,$de)}function Nde(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Z(t):t,r=s?(n=window.requestIdleCallback)!=null?n:T=>window.setTimeout(()=>T({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:T=>window.clearTimeout(T):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function v(T){if(!T)return"viewport";let A=a.get(T);return A||(A=u++,a.set(T,A)),String(A)}function k(){if(h!=null){try{l?.(h)}catch{}h=null}}function w(T){if(T){const A=c.get(T);if(A&&!A.targets.size){try{A.io.disconnect()}catch{}c.delete(T)}}d.size||f.size||k()}function b(T){const A=d.get(T);if(!A)return;const E=c.get(A.bucketKey);if(!A.visible.value){A.visible.value=!0;try{A.resolve()}catch{}}try{E?.io.unobserve(T)}catch{}E?.targets.delete(T),d.delete(T),f.delete(T),w(A.bucketKey)}function _(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const T=f.values().next().value;T&&(f.delete(T),b(T),f.size&&_())},{timeout:1200}))}function g(T,A){if(!s||typeof IntersectionObserver>"u")return null;const E=(function(H,O){var F,U,z;return{root:(F=e?.(H??null))!=null?F:null,rootMargin:(U=O?.rootMargin)!=null?U:yc,threshold:(z=O?.threshold)!=null?z:0}})(T,A),P=[v((D=E).root),D.rootMargin,D.threshold].join("\0");var D;const I=c.get(P);if(I)return{key:P,bucket:I};let $;try{$=new IntersectionObserver(H=>{for(const O of H)(O.isIntersecting||O.intersectionRatio>0)&&b(O.target)},{root:E.root,rootMargin:E.rootMargin,threshold:E.threshold})}catch{return null}const B={io:$,targets:new Map};return c.set(P,B),{key:P,bucket:B}}function x(){if(s&&i.value)for(const[T,A]of Array.from(d.entries())){const E=g(T,A.opts);if(!E){b(T);continue}if(E.key===A.bucketKey)continue;const P=A.bucketKey,D=c.get(P);try{D?.io.unobserve(T)}catch{}D?.targets.delete(T),A.bucketKey=E.key,E.bucket.targets.set(T,A),E.bucket.io.observe(T),w(P)}}Je(i,T=>{if(!T){for(const A of Array.from(d.keys()))b(A);k()}},{flush:"sync"});const S=(T,A)=>{const E=Z(!1);let P,D=!1;const I=new Promise(O=>{P=()=>{D||(D=!0,O())}}),$=()=>{const O=d.get(T);if(!O)return f.delete(T),void w();const F=c.get(O.bucketKey);try{F?.io.unobserve(T)}catch{}F?.targets.delete(T),d.delete(T),f.delete(T),w(O.bucketKey)};if(!s||!i.value)return E.value=!0,P(),{isVisible:E,whenVisible:I,destroy:$};const B=g(T,A);if(!B)return E.value=!0,P(),{isVisible:E,whenVisible:I,destroy:$};const H={resolve:P,visible:E,bucketKey:B.key,opts:A};return d.set(T,H),B.bucket.targets.set(T,H),B.bucket.io.observe(T),s&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,x()})),A?.allowIdle!==!1&&(f.add(T),_()),{isVisible:E,whenVisible:I,destroy:$}};return S.refresh=x,Ln(v$,S),S}function g5(){var e,t;const n=nn(v$,void 0);if(n)return n;const o=new WeakMap,s=new Map,i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=s.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}s.delete(h)}},d=h=>{const m=o.get(h);if(!m)return;const v=s.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{v?.io.unobserve(h)}catch{}o.delete(h),v?.targets.delete(h),i.delete(h),c(m.bucketKey),i.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const h=i.values().next().value;h&&(i.delete(h),d(h),i.size&&f())},{timeout:1200}))};return(h,m)=>{const v=Z(!1);let k,w=!1;const b=new Promise(x=>{k=()=>{w||(w=!0,x())}}),_=()=>{const x=o.get(h);if(!x)return i.delete(h),void(i.size||u());const S=s.get(x.bucketKey);try{S?.io.unobserve(h)}catch{}o.delete(h),S?.targets.delete(h),i.delete(h),c(x.bucketKey),i.size||u()},g=(x=>{var S,T;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const A=($=>{var B,H;return[(B=$?.rootMargin)!=null?B:yc,(H=$?.threshold)!=null?H:0].join("\0")})(x),E=s.get(A);if(E)return{key:A,bucket:E};const P=(S=x?.rootMargin)!=null?S:yc;let D;try{D=new IntersectionObserver($=>{for(const B of $)(B.isIntersecting||B.intersectionRatio>0)&&d(B.target)},{root:null,rootMargin:P,threshold:(T=x?.threshold)!=null?T:0})}catch{return null}const I={io:D,targets:new Set};return s.set(A,I),{key:A,bucket:I}})(m);return g?(o.set(h,{resolve:k,visible:v,bucketKey:g.key}),g.bucket.targets.add(h),g.bucket.io.observe(h),m?.allowIdle!==!1&&(i.add(h),f()),{isVisible:v,whenVisible:b,destroy:_}):(v.value=!0,k(),{isVisible:v,whenVisible:b,destroy:_})}}function Fde(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const Rde=["data-markstream-viewport-pending"],Ode=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Pde={key:1,class:"image-placeholder"},Dde={key:1,class:"image-node__raw-text"},Bde={key:2,class:"image-shimmer-overlay"},Hde={key:1,class:"image-node__raw-text"},zde={key:3,class:"image-error"},Va=Gn(et({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,o,s;const i=e,r=t,l=Z(!1),a=Z(!1),u=Z(""),c=Z("primary"),d=Z(null),f=p1(),h=nn(G3,null),m=g5(),v=h5(),k=m5(),w=R(()=>nw(i.node.src)),b=R(()=>nw(i.fallbackSrc)),_=(s=(o=(n=ds())==null?void 0:n.vnode.el)==null?void 0:o.querySelector)==null?void 0:s.call(o,"img"),g=typeof window<"u"&&_?.getAttribute("src")===(w.value||b.value),x=Z(typeof window>"u"||g||!k.value),S=Xr(null);let T="",A=null;const E=R(()=>u.value),P=R(()=>!i.lazy),D=R(()=>typeof window<"u"&&k.value&&!g),I=R(()=>!D.value||x.value),$=R(()=>I.value?E.value:""),B=R(()=>{var de,pe;return(pe=(de=v?.value.heavyBlockMargin)!=null?de:v?.value.rootMargin)!=null?pe:yc}),H=R(()=>!i.node.loading&&c.value!=="failed"&&u.value.length>0),O=R(()=>c.value==="failed"),F=R(()=>(!P.value||D.value&&!x.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),U=R(()=>Fde(i,f));function z(de=U.value){de&&d.value&&h?.reportHeight(de,d.value.offsetHeight)}function W(de=U.value){de&&yt(()=>{z(de)})}function K(){A&&(clearTimeout(A),A=null)}function V(){const de=U.value;de&&T!==de&&(T&&h?.markSettled(T),K(),T=de,h?.markPending(de),typeof window<"u"&&(A=window.setTimeout(()=>{T===de&&(W(de),ie())},8e3)))}function ie(){return mo(this,null,function*(){const de=T;de&&(K(),T="",yield yt(),z(de),h?.markSettled(de))})}function ne(){if(c.value==="primary"&&b.value&&b.value!==u.value)return c.value="fallback",u.value=b.value,l.value=!1,a.value=!1,void W();c.value="failed",a.value=!0,r("error",u.value),W()}function X(){l.value=!0,a.value=!1,r("load",E.value),W()}function le(de){de.preventDefault(),l.value&&!a.value&&r("click",[de,E.value])}const{t:Ie}=Lde();return Je([w,b,()=>i.node.loading],()=>(l.value=!1,a.value=!1,i.node.loading||w.value?(u.value=w.value,void(c.value="primary")):b.value?(u.value=b.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&Je([d,D],([de,pe],ve,oe)=>{var ye;if((ye=S.value)==null||ye.destroy(),S.value=null,!pe||x.value)return void(x.value=!0);if(!de)return void(x.value=!1);let G=!0;const Y=m(de,{rootMargin:B.value,allowIdle:!1});S.value=Y,x.value=Y.isVisible.value,Y.whenVisible.then(()=>{G&&S.value===Y&&(x.value=!0)}),oe(()=>{G=!1,Y.destroy(),S.value===Y&&(S.value=null)})},{immediate:!0}),Je([H,l,a,E,()=>i.lazy,I],([de,pe,ve,oe,ye,G])=>de&&oe&&!ve&&G?pe?(ie(),void W()):ye?(V(),void W()):void(pe||ve||V()):(ie(),void W()),{flush:"post",immediate:!0}),Vn(()=>{var de;(de=S.value)==null||de.destroy(),S.value=null,(function(){const pe=T;pe&&(K(),T="",h?.markSettled(pe))})()}),(de,pe)=>{var ve,oe,ye,G,Y;return y(),M("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":D.value&&!x.value?"true":void 0},[H.value?(y(),M("img",{key:0,src:$.value||void 0,alt:String((oe=(ve=i.node.alt)!=null?ve:i.node.title)!=null?oe:""),title:String((G=(ye=i.node.title)!=null?ye:i.node.alt)!=null?G:""),class:Re(["image-node__img",{"is-loading":!P.value&&!l.value,"is-loaded":P.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:i.lazy?"lazy":void 0,fetchpriority:P.value?"high":void 0,decoding:P.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(Y=i.node.alt)!=null?Y:p(Ie)("image.preview"),onError:ne,onLoad:X,onClick:le},null,42,Ode)):ee("",!0),e.node.loading&&!a.value?(y(),M("span",Pde,[i.usePlaceholder?xn(de.$slots,"placeholder",{key:0,node:i.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[pe[0]||(pe[0]=C("span",{class:"image-shimmer"},null,-1))],!0):(y(),M("span",Dde,N(e.node.raw),1))])):ee("",!0),F.value&&!e.node.loading?(y(),M("span",Bde,[i.usePlaceholder?xn(de.$slots,"placeholder",{key:0,node:i.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[pe[1]||(pe[1]=C("span",{class:"image-shimmer"},null,-1))],!0):(y(),M("span",Hde,N(e.node.raw),1))])):ee("",!0),O.value?(y(),M("span",zde,[xn(de.$slots,"error",{node:i.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[pe[2]||(pe[2]=C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[C("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),C("span",null,N(p(Ie)("image.loadError")),1)],!0)])):ee("",!0)],8,Rde)}}}),[["__scopeId","data-v-046e82ac"]]);Va.install=e=>{e.component(Va.__name,Va)};const Wde={key:2},El=et({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=fs(()=>t.customId),o=nn("markstreamHtmlPolicy",void 0),s=nn("markstreamNestedRendererProps",void 0),i=R(()=>{var m;return(m=o?.value)!=null?m:"safe"}),r=R(()=>{var m,v;const k=(m=s?.value)!=null?m:{};return rn(mt({},k),{customId:(v=t.customId)!=null?v:k.customId,htmlPolicy:i.value})}),l=zr({loader:()=>Promise.resolve().then(()=>M5),suspensible:!1}),a=R(()=>t.components[String(t.node.type)]),u=R(()=>!!(a.value&&n.value[t.node.type]&&!Qp(String(t.node.type)))),c=R(()=>u.value?p5(t.node,i.value):void 0),d=R(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=R(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=R(()=>{var m,v;return String((v=(m=t.node.content)!=null?m:t.node.raw)!=null?v:"")});return(m,v)=>a.value&&u.value?(y(),he(bs(a.value),zn({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:me(()=>[d.value?(y(),he(p(l),zn({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(y(),he(p(l),zn({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(y(),he(bs(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(y(),M("span",Wde,N(h.value),1)):ee("",!0)}}),N_=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function Ude(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return rn(mt(mt({},N_),n),{enabled:(t=n.enabled)==null||t})}return mt({},N_)}function v5(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,o=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=o}function b$(e){var t,n;const o=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(o.length<3)return"";const s=o[0];if(s!=="`"&&s!=="~"||o[1]!==s||o[2]!==s)return"";let i=3;for(;o[i]===s;)i+=1;return o.slice(i).trim()}function F_(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function jde(e){var t;return e.diff===!0||F_(e.language)||F_(b$(String((t=e.raw)!=null?t:"")))}function Vde(e,t,n){const o=(function(s){const i=b$(s);if(!i)return"";const r=i.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:o||t,caption:o?n?`Diff / ${t}`:t:""}}const qde=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],Kde={key:0,translate:"no",class:"markstream-pre__diff-code"},Zde={class:"markstream-pre__diff-pane-content"},Gde={class:"markstream-pre__diff-number","aria-hidden":"true"},Yde={class:"markstream-pre__diff-content"},Xde={class:"markstream-pre__diff-content-inner"},Jde={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},Qde=["textContent"],e1e=["textContent"],Pi=et({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(X,le){const Ie=String(X??"");return le?Ie:Ie.replace(/\r\n$|\n$|\r$/,"")}const o=R(()=>{var X,le,Ie;const de=String((le=(X=t.node)==null?void 0:X.language)!=null?le:"");return String((Ie=String(de).split(/\s+/g)[0])!=null?Ie:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=R(()=>`language-${o.value}`),i=R(()=>{var X;return t.loading===!0||((X=t.node)==null?void 0:X.loading)===!0}),r=R(()=>{var X;return n((X=t.node)==null?void 0:X.code,i.value)});let l="",a=1;const u=R(()=>(function(X){let le=0,Ie=1;X.startsWith(l)&&(le=l.length,Ie=a,le>0&&X[le-1]==="\r"&&X[le]===`
313
313
  `&&le++);for(let de=le;de<X.length;de++)X[de]===`
314
314
  `?Ie++:X[de]==="\r"&&(Ie++,X[de+1]===`
315
315
  `&&de++);return l=X,a=Ie,Ie})(r.value)),c=R(()=>r.value.split(/\r\n|\n|\r/));let d=0,f="";const h=R(()=>{const X=u.value;X<d&&(d=0,f="");for(let le=d+1;le<=X;le++)f+=`${f?`
316
- `:""}${le}`;return d=X,f}),m=R(()=>{var X;return t.showLineNumbers===!0&&((X=t.node)==null?void 0:X.diff)===!0}),v=R(()=>m.value&&t.diffInline===!0),k=R(()=>{const X=Number(t.reservedHeightPx);if(!Number.isFinite(X)||X<=0)return;const le=`${Math.ceil(X)}px`;return i.value?{maxHeight:le,overflow:"auto"}:{height:le,minHeight:le,maxHeight:le,overflow:"auto"}}),w=["diff ","index ","--- ","+++ ","@@ "];function b(X){return String(X??"").trim().length===0}function _(X,le="context",Ie={}){const de=b(X);return{code:X,kind:de&&le!=="hunk"&&le!=="spacer"&&!Ie.preserveBlankKind?"context":le,empty:de}}function g(X){const le=n(X,i.value);return le?le.split(/\r\n|\n|\r/):[]}function x(X,le){return!b(X[le])||le<X.length-1}function S(X){return X.startsWith("-")&&!X.startsWith("---")}function T(X){return X.startsWith("+")&&!X.startsWith("+++")}function A(X){return X.some(le=>w.some(Ie=>le.startsWith(Ie)))}function E(X,le){return le||!X.startsWith(" ")||X.startsWith(" ")?X:` ${X}`}function P(X,le){const Ie=X.length,de=le.length,pe=[];let ve=0;for(;ve<Ie&&ve<de&&X[ve]===le[ve];)pe.push({originalIndex:ve,modifiedIndex:ve}),ve++;const oe=[];let ye=Ie-1,G=de-1;for(;ye>=ve&&G>=ve&&X[ye]===le[G];)oe.unshift({originalIndex:ye,modifiedIndex:G}),ye--,G--;const Y=ye-ve+1,fe=G-ve+1;if(Y<=0||fe<=0||i.value||(Y+1)*(fe+1)>15e5)return pe.concat(oe);const we=fe+1,ge=new Uint32Array((Y+1)*(fe+1));for(let ue=Y-1;ue>=0;ue--)for(let Se=fe-1;Se>=0;Se--){const ze=ue*we+Se;if(X[ve+ue]===le[ve+Se])ge[ze]=ge[(ue+1)*we+Se+1]+1;else{const _e=ge[(ue+1)*we+Se],Ee=ge[ue*we+Se+1];ge[ze]=_e>=Ee?_e:Ee}}const Q=[];let te=0,ce=0;for(;te<Y&&ce<fe;)X[ve+te]===le[ve+ce]?(Q.push({originalIndex:ve+te,modifiedIndex:ve+ce}),te++,ce++):ge[(te+1)*we+ce]>=ge[te*we+ce+1]?te++:ce++;return pe.concat(Q,oe)}function D(X){var le;const Ie=(function(){var G,Y;const fe=t.diffHideUnchangedRegions;if(fe==null||fe===!1)return null;const we=fe===!0?{}:fe;return we.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((G=we.contextLineCount)!=null?G:2)),minimumLineCount:Math.max(1,Math.floor((Y=we.minimumLineCount)!=null?Y:4))}})();if(!Ie||X.length<1||X.length>2||X.length===2&&X[0].lines.length!==X[1].lines.length)return X;const de=X[0].lines,pe=(le=X[1])==null?void 0:le.lines,ve=G=>de[G].kind==="context"&&(pe===void 0||pe[G].kind==="context"&&de[G].code===pe[G].code),oe=[];let ye=0;for(;ye<de.length;){const G=ye;for(;ye<de.length&&ve(ye);)ye++;const Y=ye;if(Y-G>=Ie.minimumLineCount){const fe=G+(G===0?0:Ie.contextLineCount),we=Y-(Y===de.length?0:Ie.contextLineCount);we-fe>=Ie.minimumLineCount&&oe.push({start:fe,end:we})}ye===G&&ye++}return oe.length?X.map((G,Y)=>{const fe=[];let we=0;for(const ge of oe)fe.push(...G.lines.slice(we,ge.start)),fe.push({code:Y===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${G.key}-collapsed-${ge.start}-${ge.end}`,number:""}),we=ge.end;return fe.push(...G.lines.slice(we)),rn(mt({},G),{lines:fe})}):X}const I=R(()=>{var X,le,Ie,de;if(!m.value)return[];const pe=(function(Y){const fe=Y.some(ge=>S(ge)),we=Y.some(ge=>T(ge));return fe&&we||(function(){var ge,Q,te,ce;if(o.value==="diff")return!0;const ue=(ce=(te=String((Q=(ge=t.node)==null?void 0:ge.raw)!=null?Q:"").split(/\r?\n/,1)[0])==null?void 0:te.trim())!=null?ce:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(ue)})()&&(fe||we)})(c.value),ve=(function(){var Y,fe;return((Y=t.node)==null?void 0:Y.originalCode)!=null||((fe=t.node)==null?void 0:fe.updatedCode)!=null})();if(v.value){const Y=ve?(function(fe,we){const ge=g(fe),Q=g(we),te=P(ge,Q);if(te.length>0){const Ee=[];let it=0,Fe=0;for(const Oe of te){for(;it<Oe.originalIndex;)Ee.push(rn(mt({},_(ge[it],"removed",{preserveBlankKind:x(ge,it)})),{key:`inline-removed-source-${it}`,number:it+1})),it++;for(;Fe<Oe.modifiedIndex;)Ee.push(rn(mt({},_(Q[Fe],"added",{preserveBlankKind:x(Q,Fe)})),{key:`inline-added-source-${Fe}`,number:Fe+1})),Fe++;Ee.push(rn(mt({},_(Q[Oe.modifiedIndex])),{key:`inline-context-source-${Oe.originalIndex}-${Oe.modifiedIndex}`,number:Oe.modifiedIndex+1})),it=Oe.originalIndex+1,Fe=Oe.modifiedIndex+1}for(;it<ge.length;)Ee.push(rn(mt({},_(ge[it],"removed",{preserveBlankKind:x(ge,it)})),{key:`inline-removed-source-${it}`,number:it+1})),it++;for(;Fe<Q.length;)Ee.push(rn(mt({},_(Q[Fe],"added",{preserveBlankKind:x(Q,Fe)})),{key:`inline-added-source-${Fe}`,number:Fe+1})),Fe++;return Ee}const ce=[];let ue=0,Se=ge.length-1,ze=Q.length-1;for(;ue<=Se&&ue<=ze&&ge[ue]===Q[ue];)ce.push(rn(mt({},_(Q[ue])),{key:`inline-prefix-${ue}`,number:ue+1})),ue++;const _e=[];for(;Se>=ue&&ze>=ue&&ge[Se]===Q[ze];)_e.unshift(rn(mt({},_(Q[ze])),{key:`inline-suffix-${ze}`,number:ze+1})),Se--,ze--;for(let Ee=ue;Ee<=Se;Ee++)ce.push(rn(mt({},_(ge[Ee],"removed",{preserveBlankKind:x(ge,Ee)})),{key:`inline-removed-source-${Ee}`,number:Ee+1}));for(let Ee=ue;Ee<=ze;Ee++)ce.push(rn(mt({},_(Q[Ee],"added",{preserveBlankKind:x(Q,Ee)})),{key:`inline-added-source-${Ee}`,number:Ee+1}));return ce.concat(_e)})((X=t.node)==null?void 0:X.originalCode,(le=t.node)==null?void 0:le.updatedCode):(function(fe){const we=[];let ge=1,Q=1;const te=A(fe);for(const[ce,ue]of fe.entries())if(ue.startsWith("@@")){const Se=ue.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);Se&&(ge=Number(Se[1]),Q=Number(Se[2])),we.push(rn(mt({},_(ue,"hunk")),{key:`inline-hunk-${ce}`,number:""}))}else if(S(ue))we.push(rn(mt({},_(E(ue.slice(1),te),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ce}`,number:ge++}));else if(T(ue))we.push(rn(mt({},_(E(ue.slice(1),te),"added",{preserveBlankKind:!0})),{key:`inline-added-${ce}`,number:Q++}));else{const Se=te&&ue.startsWith(" ")?ue.slice(1):ue;we.push(rn(mt({},_(Se)),{key:`inline-context-${ce}`,number:Q})),ge++,Q++}return we})(c.value);return D([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:Y}])}if(!pe&&ve)return(function(Y,fe){const we=g(Y),ge=g(fe),Q=P(we,ge),te=[],ce=[];let ue=0,Se=0,ze=0;const _e=(Ee,it)=>{const Fe=Math.max(Ee-ue,it-Se);for(let Oe=0;Oe<Fe;Oe++){const Ge=ue+Oe,at=Se+Oe;te.push(Ge<Ee?rn(mt({},_(we[Ge],"removed",{preserveBlankKind:x(we,Ge)})),{key:`original-changed-${ze}-${Ge}`,number:Ge+1}):rn(mt({},_("","spacer")),{key:`original-spacer-${ze}-${Oe}`,number:""})),ce.push(at<it?rn(mt({},_(ge[at],"added",{preserveBlankKind:x(ge,at)})),{key:`modified-changed-${ze}-${at}`,number:at+1}):rn(mt({},_("","spacer")),{key:`modified-spacer-${ze}-${Oe}`,number:""}))}ue=Ee,Se=it,ze++};for(const Ee of Q)_e(Ee.originalIndex,Ee.modifiedIndex),te.push(rn(mt({},_(we[Ee.originalIndex])),{key:`original-context-${Ee.originalIndex}-${Ee.modifiedIndex}`,number:Ee.originalIndex+1})),ce.push(rn(mt({},_(ge[Ee.modifiedIndex])),{key:`modified-context-${Ee.originalIndex}-${Ee.modifiedIndex}`,number:Ee.modifiedIndex+1})),ue=Ee.originalIndex+1,Se=Ee.modifiedIndex+1;return _e(we.length,ge.length),D([{key:"original",className:"markstream-pre__diff-pane--original",lines:te},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ce}])})((Ie=t.node)==null?void 0:Ie.originalCode,(de=t.node)==null?void 0:de.updatedCode);const oe=[],ye=[],G=A(c.value);for(const Y of c.value)if(Y.startsWith("@@"))oe.push(_(Y,"hunk")),ye.push(_(Y,"hunk"));else if(Y.startsWith("-")&&!Y.startsWith("---"))oe.push(_(E(Y.slice(1),G),"removed",{preserveBlankKind:!0}));else if(Y.startsWith("+")&&!Y.startsWith("+++"))ye.push(_(E(Y.slice(1),G),"added",{preserveBlankKind:!0}));else{const fe=G&&Y.startsWith(" ")?Y.slice(1):Y;oe.push(_(fe)),ye.push(_(fe))}return D([{key:"original",className:"markstream-pre__diff-pane--original",lines:oe.map((Y,fe)=>rn(mt({},Y),{key:`original-${fe}`,number:fe+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ye.map((Y,fe)=>rn(mt({},Y),{key:`modified-${fe}`,number:fe+1}))}])}),$=R(()=>I.value.some(X=>X.lines.some(le=>le.kind==="collapsed"))),B=R(()=>{const X=o.value;return X?`Code block: ${X}`:"Code block"}),H=Z(null),O=Z([]);let F=null,U=!1,z=null;function W(X){const le=Number.parseFloat(String(X??""));return Number.isFinite(le)&&le>0?le:0}function K(X,le){var Ie;if(!X)return le;if(X.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const de=X.querySelector(".markstream-pre__diff-content"),pe=de?.getBoundingClientRect(),ve=(Ie=pe?.height)!=null?Ie:0;return Math.max(le,Math.ceil(ve))}function V(){U||typeof window>"u"||(F!=null&&window.cancelAnimationFrame(F),F=window.requestAnimationFrame(()=>{F=null,U||(function(){var X,le;F=null;const Ie=H.value;if(!Ie||!m.value||v.value||!Ie.classList.contains("is-wrap"))return void(O.value.length&&(O.value=[]));const de=(function(fe){const we=window.getComputedStyle(fe),ge=W(we.getPropertyValue("--markstream-pre-diff-line-height"));if(ge>0)return ge;const Q=W(we.lineHeight);return Q>0?Q:18})(Ie),pe=Array.from(Ie.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),ve=Array.from(Ie.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),oe=Math.max(pe.length,ve.length),ye=[];for(let fe=0;fe<oe;fe++){const we=K((X=pe[fe])!=null?X:null,de),ge=K((le=ve[fe])!=null?le:null,de),Q=Math.max(de,we,ge);ye.push({rowHeight:Q,originalHeight:we,modifiedHeight:ge})}var G,Y;G=O.value,Y=ye,G.length===Y.length&&G.every((fe,we)=>{const ge=Y[we];return ge&&Math.abs(fe.rowHeight-ge.rowHeight)<=.5&&Math.abs(fe.originalHeight-ge.originalHeight)<=.5&&Math.abs(fe.modifiedHeight-ge.modifiedHeight)<=.5})||(O.value=ye)})()}))}function ie(X){z?.disconnect(),z=null,X&&m.value&&!v.value&&typeof ResizeObserver<"u"&&(z=new ResizeObserver(()=>{V()}),z.observe(X))}function ne(X,le){const Ie=O.value[X];if(!Ie)return;const de=le==="original"?Ie.originalHeight:Ie.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(Ie.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(de)}px`}}return Je(H,X=>{ie(X),yt(()=>V())},{flush:"post"}),Je([m,v,I],()=>{ie(H.value),yt(()=>V())},{flush:"post",immediate:!0}),Vn(()=>{U=!0,F!=null&&(window.cancelAnimationFrame(F),F=null),z?.disconnect(),z=null}),(X,le)=>(y(),M("pre",{ref_key:"preRef",ref:H,style:Zt(k.value),class:Re([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":v.value,"markstream-pre--diff-collapsed":$.value}]),"aria-busy":i.value,"aria-label":B.value,"data-language":o.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(y(),M("code",Kde,[(y(!0),M(Pe,null,pt(I.value,Ie=>(y(),M("span",{key:Ie.key,class:Re(["markstream-pre__diff-pane",Ie.className])},[C("span",Zde,[(y(!0),M(Pe,null,pt(Ie.lines,(de,pe)=>(y(),M("span",{key:de.key,class:Re(["markstream-pre__diff-line",[`markstream-pre__diff-line--${de.kind}`,{"markstream-pre__diff-line--empty":de.empty}]]),style:Zt(ne(pe,Ie.key))},[le[0]||(le[0]=C("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),C("span",Gde,N(de.number),1),C("span",Yde,[C("span",Xde,N(de.code),1)])],6))),128))])],2))),128))])):(y(),M(Pe,{key:1},[t.showLineNumbers?(y(),M("span",Jde,[C("span",{class:"markstream-pre__line-numbers-text",textContent:N(h.value)},null,8,Qde)])):ee("",!0),C("code",{translate:"no",class:"markstream-pre__code",textContent:N(r.value)},null,8,e1e)],64))],14,qde))}});Pi.install=e=>{e.component(Pi.__name,Pi)};const t1e={key:0},qo=Gn(et({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=p1(),o=nn("markstreamFade",void 0),s=nn("markstreamTextStreamState",void 0),i=nn("markstreamStreamVersion",void 0),r=R(()=>{const k=n.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),l=R(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=R(()=>{var k;const w=(k=n["index-key"])!=null?k:n.indexKey;return w==null||w===""?"":String(w)}),u=Z(t.node.content),c=Z(""),d=Z(0);let f;function h(){f?.(),f=void 0}function m(){h(),c.value&&(u.value=u.value+c.value,c.value="")}Je([()=>t.node.content,a,l],([k])=>{const w=String(k??""),b=a.value,_=t$({nextContent:w,persistedContent:b?s?.get(b):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=_.settledContent,c.value=_.streamedDelta,_.appended?(d.value+=1,(function(){if(!c.value||f||!i)return;const g=i.value;f=Je(()=>i.value,x=>{x!==g&&m()},{flush:"sync"})})()):c.value||h(),b&&s?.set(b,w)},{immediate:!0}),d1(h);const v=R(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,w)=>(y(),M("span",{class:Re([[e.node.center?"text-node-center":""],"text-node"])},[u.value?(y(),M("span",t1e,N(u.value),1)):ee("",!0),c.value?(y(),M("span",{key:1,class:Re(["text-node-stream-delta",[v.value]]),onAnimationend:m},N(c.value),35)):ee("",!0)],2))}}),[["__scopeId","data-v-a7e90764"]]);function Af(e,t,n){return et({name:e,inheritAttrs:!1,setup(o,{attrs:s,slots:i}){var r,l;const a=g5(),u=h5(),c=m5(),d=typeof window<"u"&&((l=(r=ds())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=Z(typeof window>"u"||d||!c.value),h=Xr(null);let m=null;function v(k){const w=k&&"$el"in k?k.$el:k;h.value=w instanceof HTMLElement?w:null}return typeof window<"u"&&Je([h,c],([k,w],b,_)=>{if(m?.destroy(),m=null,!w||f.value)return void(f.value=!0);if(!k)return;let g=!0;const x=a(k,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=x,f.value=x.isVisible.value,x.whenVisible.then(()=>{g&&m===x&&(f.value=!0)}),_(()=>{g=!1,x.destroy(),m===x&&(m=null)})},{immediate:!0}),Vn(()=>{m?.destroy(),m=null}),()=>tn(f.value?t:n,rn(mt({},s),{ref:v}),i)}})}qo.install=e=>{e.component(qo.__name,qo)};const dg=et({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var o,s,i,r,l,a,u;const c=T2(String((s=(o=n.node)==null?void 0:o.language)!=null?s:"")),d=p_[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):p_[""]),f=jde(n.node),h=Vde(String((r=(i=n.node)==null?void 0:i.raw)!=null?r:""),d,f),m=n.monacoOptions,v=f&&((l=n.estimatedDiffInline)!=null?l:v5(m??{},typeof window>"u"?0:window.innerWidth)),k=m?.diffAppearance,w=k==="dark"||k!=="light"&&n.isDark===!0,b=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,_=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:b===12?18:Math.max(12,Math.round(1.5*b)),g=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,x=f?0:8,S=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:x,T=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:x,A=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",E=mt(mt({fontSize:`${b}px`,lineHeight:`${_}px`,tabSize:g,paddingTop:`${S}px`,paddingBottom:`${T}px`,"--markstream-pre-line-number-top":`${S}px`},f?{"--markstream-pre-diff-line-height":`${_}px`}:{}),A?{"--markstream-code-font-family":A}:{}),P=()=>tn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[tn("svg",{class:"action-icon"})]),D=n.isShowPreview!==!1&&(c==="html"||c==="svg"),I=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||D&&n.showPreviewButton!==!1,$=H=>{if(H!=null)return typeof H=="number"?`${H}px`:String(H)},B=mt(mt(mt({"--markstream-code-layout-character-width":"1ch"},$(n.minWidth)?{minWidth:$(n.minWidth)}:{}),$(n.maxWidth)?{maxWidth:$(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg, var(--code-bg)))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return tn("div",rn(mt({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":w,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[B,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:tn("div",{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)]"},[tn("div",{class:"code-header-main"},[tn("span",{class:"icon-slot h-4 w-4 flex-shrink-0"}),tn("div",{class:"code-header-copy"},[tn("div",{class:"code-header-title"},h.title),h.caption?tn("div",{class:"code-header-caption"},h.caption):null])]),tn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?tn("div",{class:"code-diff-stats","aria-hidden":"true"},[tn("span",{class:"code-diff-stat removed"},"-0"),tn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:P(),n.showCollapseButton===!1?null:P(),I?tn("div",{class:"relative"},[P()]):null])]),tn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[tn(Pi,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:v,diffHideUnchangedRegions:f?Ude(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:E,"data-markstream-code-loading":"1"})]),tn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[tn("div",{class:"loading-skeleton"},[tn("div",{class:"skeleton-line"}),tn("div",{class:"skeleton-line"}),tn("div",{class:"skeleton-line short"})])]),tn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),X9=Af("ViewportDeferredCodeBlockNode",zr({loader:()=>mo(null,null,function*(){try{return(yield jo(()=>import("./CodeBlockNode-BAtAs_qm.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependency stream-diffs is missing. Falling back to preformatted code rendering. To enable enhanced code block features, please install "stream-diffs".',e),Pi}}),loadingComponent:dg,delay:0,suspensible:!1}),dg),Jr=zr(()=>mo(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,o,s,i;return tn(qo,rn(mt({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{return yield r$(),(yield jo(()=>import("./index7-BT2SBznQ.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,o,s,i;return tn(qo,rn(mt({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),C$=zr(()=>mo(null,null,function*(){try{return yield r$(),(yield jo(()=>import("./index6-D4fZsFMu.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,o,s;return tn(qo,rn(mt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),xi=Gn(et({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(y(),M("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},N(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);xi.install=e=>{e.component(xi.__name,xi)};const n1e={class:"superscript-node"},Wi=Gn(et({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,emphasis:Ti,footnote_reference:or,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,emoji:zi,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("sup",n1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"superscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Wi.install=e=>{e.component(Wi.__name,Wi)};const o1e={class:"subscript-node"},Ui=Gn(et({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,emphasis:Ti,footnote_reference:or,strikethrough:Ai,highlight:ir,insert:ji,superscript:Wi,emoji:zi,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("sub",o1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"subscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Ui.install=e=>{e.component(Ui.__name,Ui)};const s1e={class:"strong-node"},Si=Gn(et({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,emphasis:Ti,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,footnote_reference:or,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("strong",s1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"strong"}-${l}`,components:o.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Si.install=e=>{e.component(Si.__name,Si)};const i1e={class:"strikethrough-node"},Ai=Gn(et({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,emphasis:Ti,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,footnote_reference:or,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("del",i1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);Ai.install=e=>{e.component(Ai.__name,Ai)};const r1e=["href","title","aria-label","aria-hidden","target","rel"],l1e=["aria-hidden"],a1e={class:"link-text-wrapper relative inline-flex"},u1e={class:"leading-[normal] link-text"},Mi=Gn(et({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=nn("markstreamShowTooltips",void 0),o=R(()=>{const w=n?.value;return typeof w=="boolean"?w:t.showTooltip}),s=R(()=>{var w,b,_,g,x;const S=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",T=(w=t.animationOpacity)!=null?w:.35,A=Math.max(.12,Math.min(.5*T,T)),E={"--underline-height":`${(b=t.underlineHeight)!=null?b:2}px`,"--underline-bottom":S,"--underline-opacity":String(T),"--underline-rest-opacity":String(A),"--underline-duration":`${(_=t.animationDuration)!=null?_:1.6}s`,"--underline-timing":(g=t.animationTiming)!=null?g:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(x=t.animationIteration)!=null?x:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=fs(()=>t.customId),r=R(()=>mt({text:qo,strong:Si,strikethrough:Ai,emphasis:Ti,image:Va,html_inline:sr,inline_code:li},i.value)),l=p1(),a=R(()=>{var w,b;const _=(w=t.node)==null?void 0:w.attrs;if(!_||typeof _!="object")return{};const g={};if(Array.isArray(_))for(const x of _)Array.isArray(x)&&x[0]&&(g[String(x[0])]=String((b=x[1])!=null?b:""));else for(const[x,S]of Object.entries(_))x&&S!=null&&S!==!1&&(g[x]=S===!0?"":String(S));return A_(g,"safe","a")}),u=R(()=>mt(mt({},l),a.value)),c=R(()=>{var w,b;return A_({href:String((b=(w=t.node)==null?void 0:w.href)!=null?b:"")},"safe","a").href}),d=R(()=>{if(!c.value)return;const w=u.value.target;return(typeof w=="string"?w.trim():String(w??"").trim())||(sie(c.value)?"_blank":void 0)}),f=R(()=>{var w;return String((w=d.value)!=null?w:"").trim().toLowerCase()==="_blank"}),h=R(()=>{if(!c.value)return;const w=u.value.rel,b=new Set((typeof w=="string"?w:String(w??"")).split(/\s+/).filter(Boolean)),_=new Set(Array.from(b).filter(g=>g.toLowerCase()!=="opener"));return f.value&&(_.add("noopener"),_.add("noreferrer")),_.size>0?Array.from(_).join(" "):void 0}),m=R(()=>{const w=mt({},u.value);return delete w.title,delete w.href,delete w.target,delete w.rel,w});function v(){o.value&&Tde()}const k=R(()=>{var w,b;const _=(w=t.node)==null?void 0:w.title;return typeof _=="string"&&_.trim().length>0?_:String((b=c.value)!=null?b:"")});return(w,b)=>{var _,g;return e.node.loading?(y(),M("span",zn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:s.value}),[C("span",a1e,[C("span",u1e,[j(p(qo),{class:"leading-[normal] link-text",node:{type:"text",content:String((_=e.node.text)!=null?_:""),raw:String((g=e.node.text)!=null?g:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),b[1]||(b[1]=C("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,l1e)):(y(),M("a",zn({key:0,class:"link-node",href:c.value,title:o.value?"":k.value,"aria-label":`Link: ${k.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:s.value,onMouseenter:b[0]||(b[0]=x=>(function(S){var T,A,E,P;if(!o.value)return;const D=S,I=D?.clientX!=null&&D?.clientY!=null?{x:D.clientX,y:D.clientY}:void 0,$=((T=t.node)==null?void 0:T.title)||((A=c.value)!=null&&A.includes("xn--")&&((P=(E=t.node)==null?void 0:E.text)!=null&&P.includes("://"))?t.node.text:c.value)||"";Mde(S.currentTarget,$,"top",!1,I)})(x)),onMouseleave:v}),[(y(!0),M(Pe,null,pt(e.node.children,(x,S)=>(y(),he(p(El),{key:`${e.indexKey||"emphasis"}-${S}`,components:r.value,node:x,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${S}`},null,8,["components","node","custom-id","index-key"]))),128))],16,r1e))}}}),[["__scopeId","data-v-367e6ca4"]]);Mi.install=e=>{e.component(Mi.__name,Mi)};const c1e={class:"insert-node"},ji=Gn(et({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,emphasis:Ti,strikethrough:Ai,highlight:ir,subscript:Ui,superscript:Wi,emoji:zi,footnote_reference:or,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("ins",c1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"insert"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);ji.install=e=>{e.component(ji.__name,ji)};const d1e={class:"highlight-node"},ir=Gn(et({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,emphasis:Ti,strikethrough:Ai,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,footnote_reference:or,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("mark",d1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"highlight"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);ir.install=e=>{e.component(ir.__name,ir)};const f1e={class:"emphasis-node"},Ti=Gn(et({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,footnote_reference:or,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("em",f1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Ti.install=e=>{e.component(Ti.__name,Ti)};const p1e={class:"hard-break"},qa=Gn(et({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(y(),M("br",p1e))}),[["__scopeId","data-v-50c58f70"]]);qa.install=e=>{e.component(qa.__name,qa)};const $p=et({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=kt({checkbox:nr,checkbox_input:nr,emoji:zi,emphasis:Ti,hardbreak:qa,highlight:ir,inline_code:li,insert:ji,link:Mi,reference:xi,strikethrough:Ai,strong:Si,subscript:Ui,superscript:Wi,text:qo}),o=fs(()=>t.customId),s=R(()=>{const i=o.value;return Object.keys(i).length>0?mt(mt({},n),i):n});return(i,r)=>(y(!0),M(Pe,null,pt(e.nodes,(l,a)=>(y(),he(p(El),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function i8(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(i8)}function fg(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(i8))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(i8)?s:null}function kc(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const h1e=["cite"],m1e={key:0,dir:"auto",class:"paragraph-node"},g1e=["custom-id"],tm=Gn(et({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>!!n.value.paragraph),s=R(()=>!!n.value.text),i=R(()=>fg(t.node.children,!o.value)),r=R(()=>t.fade!==!1||s.value?null:kc(i.value));return Ln("markstreamShowTooltips",R(()=>t.showTooltips)),Ln("markstreamFade",R(()=>t.fade)),(l,a)=>(y(),M("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(y(),M("p",m1e,[r.value!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(r.value),9,g1e)):(y(),he(p($p),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(y(),he(p(Vi),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,h1e))}}),[["__scopeId","data-v-abfecebc"]]);tm.install=e=>{e.component(tm.__name,tm)};const v1e={class:"definition-list"},y1e={class:"definition-term"},k1e={class:"definition-desc"},nm=Gn(et({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(y(),M("dl",v1e,[(y(!0),M(Pe,null,pt(t.node.items,(s,i)=>(y(),M(Pe,{key:i},[C("dt",y1e,[j(p(Vi),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),C("dd",k1e,[j(p(Vi),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);nm.install=e=>{e.component(nm.__name,nm)};const b1e=["href","title"],Jf=Gn(et({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(y(),M("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,b1e))}}),[["__scopeId","data-v-e1eb37b6"]]);Jf.install=e=>{e.component(Jf.__name,Jf)};const C1e=["id"],w1e={class:"flex-1"},om=et({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(y(),M("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[C("div",w1e,[j(p(Vi),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,C1e))}});om.install=e=>{e.component(om.__name,om)};const _1e=["custom-id"],r8=Gn(et({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=nn("markstreamFade",void 0),s=R(()=>o?.value!==!1||n.value.text?null:kc(t.node.children)),i=R(()=>mt({text:qo,inline_code:li,link:Mi,image:Va,strong:Si,emphasis:Ti,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,checkbox:nr,checkbox_input:nr,footnote_reference:or,hardbreak:qa,math_inline:Jr,reference:xi},n.value));return(r,l)=>(y(),he(bs(`h${e.node.level}`),zn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:me(()=>[s.value!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(s.value),9,_1e)):(y(!0),M(Pe,{key:1},pt(e.node.children,(a,u)=>(y(),he(p(El),{key:u,components:i.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),L2=r8;L2.install=e=>{e.component(r8.__name,r8)};const x1e={key:0,dir:"auto",class:"paragraph-node"},S1e=["custom-id"],A1e={dir:"auto",class:"paragraph-node"},M1e=["custom-id"],Vd=Gn(et({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=R(()=>{var h;return(h=t.node)!=null?h:t.item}),o=fs(()=>t.customId),s=R(()=>!!o.value.paragraph),i=R(()=>!!o.value.text),r=R(()=>{var h;return fg((h=n.value)==null?void 0:h.children,!s.value)}),l=R(()=>{var h;if(s.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const v=m[0];if(v?.type!=="paragraph"||!Array.isArray(v.children))return null;const k=m.slice(1);if(!k.every(b=>b?.type==="list"))return null;const w=fg([v]);return w?{paragraphChildren:w,nestedLists:k}:null});function a(){return t.fade===!1&&!i.value}const u=R(()=>a()?kc(r.value):null),c=R(()=>{var h;return a()?kc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=R(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Ln("markstreamShowTooltips",R(()=>t.showTooltips)),Ln("markstreamFade",R(()=>t.fade)),(h,m)=>{var v,k;return y(),M("li",zn({class:"list-item",dir:"auto"},f.value),[r.value?(y(),M("p",x1e,[u.value!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(u.value),9,S1e)):(y(),he(p($p),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(y(),M(Pe,{key:1},[C("p",A1e,[c.value!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(c.value),9,M1e)):(y(),he(p($p),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(y(!0),M(Pe,null,pt(l.value.nestedLists,(w,b)=>(y(),he(p(Vi),{key:b,nodes:[w],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${b}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:m[0]||(m[0]=_=>h.$emit("copy",_))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(y(),he(p(Vi),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(k=(v=n.value)==null?void 0:v.children)!=null?k:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=w=>h.$emit("copy",w))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Vd.install=e=>{e.component(Vd.__name,Vd)};const qd=Gn(et({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=fs(()=>e.customId),n=R(()=>t.value.list_item||Vd);return(o,s)=>(y(),he(bs(e.node.ordered?"ol":"ul"),{class:Re(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:me(()=>[(y(!0),M(Pe,null,pt(e.node.items,(i,r)=>{var l;return y(),he(bs(n.value),zn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);qd.install=e=>{e.component(qd.__name,qd)};const T1e={key:2,class:"html-block-node__raw"},E1e=["innerHTML"],I1e={key:1,class:"html-block-node__placeholder"},Qf=Gn(et({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=nn("markstreamHtmlPolicy",void 0),o=nn("markstreamNestedRendererProps",void 0),s=R(()=>{var I,$;return($=(I=t.htmlPolicy)!=null?I:n?.value)!=null?$:"safe"}),i=R(()=>{var I,$;const B=(I=o?.value)!=null?I:{};return rn(mt({},B),{customId:($=t.customId)!=null?$:B.customId,htmlPolicy:s.value})}),r=zr({loader:()=>Promise.resolve().then(()=>M5),suspensible:!1}),l=R(()=>{const I=Xh(t.node.attrs,s.value);if(!I)return;const $=Zf(I);return Object.keys($).length>0?$:void 0}),a=R(()=>{const I=String(t.node.tag||"").trim(),$=Xh(t.node.attrs,s.value,I);if(!$)return;const B=Zf($);return Object.keys(B).length>0?B:void 0}),u=fs(()=>t.customId),c=et({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Z(null),f=Z(typeof window>"u"),h=Z(t.node.content),m=R(()=>Array.isArray(t.node.children)?t.node.children:[]),v=R(()=>String(t.node.tag||"div")),k=R(()=>{var I;if(v.value.trim().toLowerCase()!=="details"||(I=t.node.attrs)!=null&&I.some(([B])=>String(B).toLowerCase()==="open"))return null;const $=m.value[0];return $?.type==="html_block"&&String($.tag||"").toLowerCase()==="summary"?$:null}),w=R(()=>{var I;return kc((I=k.value)==null?void 0:I.children)}),b=R(()=>{const I=k.value;if(!I)return;const $=Xh(I.attrs,s.value,"summary");if(!$)return;const B=Zf($);return Object.keys(B).length>0?B:void 0}),_=R(()=>w.value==null?m.value:m.value.slice(1)),g=R(()=>{const I=v.value.trim().toLowerCase();return UI.has(I)||a5(I,s.value)}),x=R(()=>m.value.length>0&&!!t.node.tag&&!g.value),S=R(()=>{var I,$,B;if(x.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(I=h.value)!=null?I:""};const H=($=h.value)!=null?$:t.node.content;if(!H)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:jd(H,s.value)};if(t.node.loading){const F=cg(H,u.value,s.value);return F===null?{mode:"text",content:(B=t.node.raw)!=null?B:H}:{mode:"dynamic",nodes:F}}if(!h$(H,u.value))return{mode:"html",content:jd(H,s.value)};const O=cg(H,u.value,s.value);return O===null?{mode:"html",content:jd(H,s.value)}:{mode:"dynamic",nodes:O}}),T=g5(),A=h5(),E=m5(),P=Xr(null),D=!!t.node.loading;return typeof window<"u"?(Je([()=>d.value,()=>A?.value.heavyBlockMargin,()=>A?.value.rootMargin],([I],$,B)=>{var H,O,F,U;if((O=(H=P.value)==null?void 0:H.destroy)==null||O.call(H),P.value=null,!D)return f.value=!0,void(h.value=t.node.content);if(!I)return void(f.value=!1);let z=!0;const W=(U=(F=A?.value.heavyBlockMargin)!=null?F:A?.value.rootMargin)!=null?U:yc,K=T(I,{rootMargin:W,allowIdle:!E.value});P.value=K,f.value=f.value||K.isVisible.value,K.whenVisible.then(()=>{z&&P.value===K&&(f.value=!0)}),B(()=>{z=!1,K.destroy(),P.value===K&&(P.value=null)})},{immediate:!0}),Je(()=>t.node.content,I=>{D&&!f.value||(h.value=I)})):f.value=!0,Vn(()=>{var I,$;($=(I=P.value)==null?void 0:I.destroy)==null||$.call(I),P.value=null}),(I,$)=>(y(),he(bs(x.value?v.value:"div"),zn({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(E)&&!f.value?"true":void 0},x.value?a.value:void 0),{default:me(()=>[f.value?(y(),M(Pe,{key:0},[S.value.mode==="structured"?(y(),M(Pe,{key:0},[w.value!==null?(y(),M(Pe,{key:0},[C("summary",xR(OA(b.value)),N(w.value),17),_.value.length?(y(),he(p(r),zn({key:0},i.value,{nodes:_.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ee("",!0)],64)):(y(),he(p(r),zn({key:1},i.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):S.value.mode==="dynamic"?(y(),he(p(c),{key:1,nodes:S.value.nodes},null,8,["nodes"])):S.value.mode==="text"?(y(),M("pre",T1e,N(S.value.content),1)):(y(),M("div",zn({key:3},l.value,{innerHTML:S.value.content}),null,16,E1e))],64)):(y(),M("div",I1e,[xn(I.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=C("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=C("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=C("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Qf.install=e=>{e.component(Qf.__name,Qf)};const L1e={dir:"auto",class:"paragraph-node"},$1e=["custom-id"],cc=Gn(et({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=fs(()=>t.customId),o=nn("markstreamHtmlPolicy",void 0),s=nn("markstreamFade",void 0),i=nn("markstreamParseOptions",void 0),r=nn("markstreamCustomMarkdownIt",void 0),l=nn("markstreamNestedRendererProps",void 0),a=R(()=>{var A;return(A=o?.value)!=null?A:"safe"}),u=R(()=>{var A;return(A=t.parseOptions)!=null?A:i?.value}),c=R(()=>{var A;return(A=t.customMarkdownIt)!=null?A:r?.value}),d=R(()=>{var A,E;return(E=t.customHtmlTags)!=null?E:(A=l?.value)==null?void 0:A.customHtmlTags}),f=R(()=>{var A,E;const P=(A=l?.value)!=null?A:{};return rn(mt({},P),{customId:(E=t.customId)!=null?E:P.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=zr({loader:()=>Promise.resolve().then(()=>M5),suspensible:!1});function m(A){var E;return A.type==="text"&&String((E=A.content)!=null?E:"").trim()===""}const v=R(()=>t.node.children.filter(A=>!m(A))),k=R(()=>v.value.length>0&&v.value.every(A=>A.type==="image"||(function(E){var P;const D=(function(I){return I.type==="link"&&Array.isArray(I.children)?I.children.filter($=>!m($)):[]})(E);return D.length===1&&((P=D[0])==null?void 0:P.type)==="image"})(A))),w=R(()=>new Set(Ec(d.value))),b=R(()=>{if(!k.value||v.value.length<=1)return t.node.children;const A=[];for(let E=0;E<t.node.children.length;E++){const P=t.node.children[E];if(!m(P)){A.push(P);continue}const D=A.length>0,I=t.node.children.slice(E+1).some($=>!m($));D&&I&&A.push(rn(mt({},P),{content:" ",raw:" "}))}return A}),_=R(()=>s?.value===!1&&!n.value.text),g=R(()=>_.value?kc(b.value):null);function x(A,E){return{node:A,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const S=R(()=>mt({inline_code:li,image:Va,link:Mi,hardbreak:qa,emphasis:Ti,strong:Si,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,html_inline:sr,html_block:Qf,emoji:zi,checkbox:nr,math_inline:Jr,checkbox_input:nr,reference:xi,footnote_anchor:Jf,footnote_reference:or,text:qo},n.value)),T=R(()=>b.value.map((A,E)=>{var P;const D=(function(I){var $,B,H,O;if(I.type==="html_block"||I.type==="html_inline"){const F=String(($=I.tag)!=null?$:"").trim().toLowerCase()||ZI(I.content);if(F&&!w.value.has(F)&&GI((B=I.content)!=null?B:I.raw,F)){const U=String((O=(H=I.content)!=null?H:I.raw)!=null?O:"");return{child:{type:"text",content:U,raw:U},component:qo,isCustomComponent:!1}}}return{child:I,component:S.value[I.type],isCustomComponent:!!(n.value[I.type]&&!Qp(String(I.type)))}})(A);return rn(mt({},D),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:D.isCustomComponent?p5(D.child,a.value):void 0,hasSlotChildren:Array.isArray(D.child.children)&&D.child.children.length>0,slotContent:String((P=D.child.content)!=null?P:""),originalChild:A})}));return(A,E)=>(y(),M("p",L1e,[g.value!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(g.value),9,$1e)):(y(!0),M(Pe,{key:1},pt(T.value,P=>{return y(),M(Pe,{key:P.key},[k.value&&m(P.originalChild)?(y(),M(Pe,{key:0},[qe(N((D=P.originalChild,String((I=D.content)!=null?I:""))),1)],64)):P.isCustomComponent?(y(),he(bs(P.component),zn({key:1,ref_for:!0},P.customAttrs,{node:P.child,loading:P.child.loading,"index-key":P.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:me(()=>[P.hasSlotChildren?(y(),he(p(h),zn({key:0,ref_for:!0},f.value,{nodes:P.child.children,"index-key":P.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):P.slotContent?(y(),he(p(h),zn({key:1,ref_for:!0},f.value,{content:P.slotContent,final:!P.child.loading,"index-key":`${P.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(y(),he(bs(P.component),zn({key:2,ref_for:!0},x(P.child,P.index)),null,16))],64);var D,I}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);cc.install=e=>{e.component(cc.__name,cc)};const N1e={class:"table-node-wrapper"},F1e=["aria-busy"],R1e={key:0},O1e=["custom-id"],P1e=["aria-label","onPointerdown"],D1e=["custom-id"],B1e={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},ep=Gn(et({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=R(()=>{var w;return(w=t.node.loading)!=null&&w}),o=R(()=>{var w;return(w=t.node.rows)!=null?w:[]}),s=Z(null),i=Z([]);let r=null;const l=R(()=>t.node.header.cells.length),a=R(()=>i.value.some(w=>Number.isFinite(w)&&w>0)),u=R(()=>a.value?i.value.map(w=>w>0?{width:`${w}px`}:void 0):[]);Ln("markstreamShowTooltips",R(()=>t.showTooltips)),Ln("markstreamFade",R(()=>t.fade));const c=fs(()=>t.customId),d=R(()=>!!c.value.text),f=R(()=>!!c.value.paragraph),h=new WeakMap;function m(w){const b=t.fade===!1&&!d.value,_=!f.value,g=h.get(w);if(g?.children===w.children&&g.textFastPath===b&&g.paragraphFastPath===_)return g.info;const x=fg(w.children,_,!0),S={simpleChildren:x,plainText:x&&b?kc(x):null};return h.set(w,{children:w.children,textFastPath:b,paragraphFastPath:_,info:S}),S}function v(w){if(!r)return;w.preventDefault();const b=r.startWidth+r.nextStartWidth,_=Math.min(48,Math.floor(b/2)),g=Math.max(_,Math.min(b-_,Math.round(r.startWidth+w.clientX-r.startX))),x=[...r.widths];x[r.index]=g,x[r.index+1]=b-g,i.value=x}function k(){r&&(window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k),r=null)}return Je(l,()=>{k(),i.value=[]}),Vn(k),(w,b)=>(y(),M("div",N1e,[C("table",{ref_key:"tableRef",ref:s,class:Re(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(y(),M("colgroup",R1e,[(y(!0),M(Pe,null,pt(e.node.header.cells,(_,g)=>(y(),M("col",{key:g,style:Zt(u.value[g])},null,4))),128))])):ee("",!0),C("thead",null,[C("tr",null,[(y(!0),M(Pe,null,pt(e.node.header.cells,(_,g)=>(y(),M("th",{key:g,dir:"auto",class:Re([_.align==="right"?"text-right":_.align==="center"?"text-center":"text-left"])},[m(_).plainText!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(m(_).plainText),9,O1e)):m(_).simpleChildren?(y(),he(p($p),{key:1,nodes:m(_).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${g}`},null,8,["nodes","custom-id","index-key"])):(y(),he(p(Vi),{key:2,nodes:_.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[0]||(b[0]=x=>w.$emit("copy",x))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),g<e.node.header.cells.length-1?(y(),M("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${g+1} and ${g+2}`,onPointerdown:x=>(function(S,T){if(T.button!==0)return;const A=(function(){var D;const I=(D=s.value)==null?void 0:D.querySelectorAll("thead th");return Array.from(I??[],$=>Math.round($.getBoundingClientRect().width))})(),E=A[S],P=A[S+1];E&&P&&(T.preventDefault(),r={index:S,startX:T.clientX,startWidth:E,nextStartWidth:P,widths:A},i.value=A,window.addEventListener("pointermove",v),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k))})(g,x)},null,40,P1e)):ee("",!0)],2))),128))])]),C("tbody",null,[(y(!0),M(Pe,null,pt(o.value,(_,g)=>(y(),M("tr",{key:g},[(y(!0),M(Pe,null,pt(_.cells,(x,S)=>(y(),M("td",{key:S,class:Re([x.align==="right"?"text-right":x.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(x).plainText!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(m(x).plainText),9,D1e)):m(x).simpleChildren?(y(),he(p($p),{key:1,nodes:m(x).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${g}-${S}`},null,8,["nodes","custom-id","index-key"])):(y(),he(p(Vi),{key:2,nodes:x.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[1]||(b[1]=T=>w.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,F1e),j(as,{name:"table-node-fade"},{default:me(()=>[n.value?(y(),M("div",B1e,[xn(w.$slots,"loading",{isLoading:n.value},()=>[b[2]||(b[2]=C("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),b[3]||(b[3]=C("span",{class:"sr-only"},"Loading",-1))],!0)])):ee("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);ep.install=e=>{e.component(ep.__name,ep)};const H1e={class:"hr-node"},sm=Gn({},[["render",function(e,t){return y(),M("hr",H1e)}],["__scopeId","data-v-39b2349c"]]);sm.install=e=>{e.component(sm.__name,sm)};const z1e={class:"unknown-node"},l8=et({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(y(),M("div",z1e,N(e.node.raw),1))}),im=Gn(et({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=R(()=>`vmr-container vmr-container-${t.node.name}`),o=fs(()=>t.customId),s=R(()=>mt({text:qo,paragraph:cc,heading:L2,inline_code:li,link:Mi,image:Va,strong:Si,emphasis:Ti,strikethrough:Ai,insert:ji,subscript:Ui,superscript:Wi,checkbox:nr,checkbox_input:nr,hardbreak:qa,math_inline:Jr,reference:xi,list:qd,math_block:C$,table:ep},o.value));return(i,r)=>(y(),M("div",zn({class:n.value},e.node.attrs),[(y(!0),M(Pe,null,pt(e.node.children,(l,a)=>{return y(),he(bs((u=l.type,s.value[u]||l8)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);im.install=e=>{e.component(im.__name,im)};const W1e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],R_=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function U1e(e){if(e<=255)return W1e[e];let t=0,n=R_.length-1;for(;t<=n;){const o=t+n>>1,s=R_[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const j1e=/[ \t\n\r\f]+/g,V1e=/[\t\n\r\f]| {2,}|^ | $/;let J9=null;const q1e=new RegExp("\\p{Script=Arabic}","u"),ou=new RegExp("\\p{M}","u"),y5=new RegExp("\\p{Nd}","u");function O_(e){return q1e.test(e)}function P_(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function kl(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){if(P_(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(P_(n))return!0}}return!1}const K1e=new Set([" "," ","⁠","\uFEFF"]),Z1e=new Set(["-","‐","–","—"]);function w$(e,t){return!((function(n){const o=tp(n);return o!==null&&K1e.has(o)})(e)||t&&((function(n){const o=tp(n);return o!==null&&(k5.has(o)||bc.has(o))})(e)||(function(n){const o=tp(n);return o!==null&&Z1e.has(o)})(e)))}const k5=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),$2=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),b5=new Set(["'","’"]),bc=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),G1e=new Set([":",".","،","؛"]),Y1e=new Set(["၏"]),X1e=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function J1e(e){if(C5(e))return!0;let t=!1;for(const n of e)if(bc.has(n)||hg(n))t=!0;else if(!t||!ou.test(n))return!1;return t}function Q1e(e){for(const t of e)if(!k5.has(t)&&!bc.has(t))return!1;return e.length>0}function efe(e){if(C5(e))return!0;for(const t of e)if(!($2.has(t)||b5.has(t)||ou.test(t)||hg(t)))return!1;return e.length>0}function C5(e){let t=!1;for(const n of e)if(n!=="\\"&&!ou.test(n)){if(!($2.has(n)||bc.has(n)||b5.has(n)))return!1;t=!0}return t}function pg(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function tp(e){if(e.length===0)return null;const t=pg(e,e.length);return e.slice(t)}const tfe=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function hg(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,o){for(let s=0;s<o.length;s+=2)if(n>=o[s]&&n<=o[s+1])return!0;return!1})(t,tfe)}function nfe(e){const t=(function(n){for(const o of n)if(!ou.test(o))return o;return null})(e);return t!==null&&y5.test(t)}function ofe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(ou.test(o))n--;else{if(!$2.has(o)&&!b5.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function sfe(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function D_(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function B_(e,t){return e&&t!==null&&G1e.has(t)}function ife(e){const t=tp(e);return t!==null&&Y1e.has(t)}function rfe(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function a8(e){let t=e.length;for(;t>0;){const n=pg(e,t),o=e.slice(n,t);if(X1e.has(o))return!0;if(!bc.has(o))return!1;t=n}return!1}function lfe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
316
+ `:""}${le}`;return d=X,f}),m=R(()=>{var X;return t.showLineNumbers===!0&&((X=t.node)==null?void 0:X.diff)===!0}),v=R(()=>m.value&&t.diffInline===!0),k=R(()=>{const X=Number(t.reservedHeightPx);if(!Number.isFinite(X)||X<=0)return;const le=`${Math.ceil(X)}px`;return i.value?{maxHeight:le,overflow:"auto"}:{height:le,minHeight:le,maxHeight:le,overflow:"auto"}}),w=["diff ","index ","--- ","+++ ","@@ "];function b(X){return String(X??"").trim().length===0}function _(X,le="context",Ie={}){const de=b(X);return{code:X,kind:de&&le!=="hunk"&&le!=="spacer"&&!Ie.preserveBlankKind?"context":le,empty:de}}function g(X){const le=n(X,i.value);return le?le.split(/\r\n|\n|\r/):[]}function x(X,le){return!b(X[le])||le<X.length-1}function S(X){return X.startsWith("-")&&!X.startsWith("---")}function T(X){return X.startsWith("+")&&!X.startsWith("+++")}function A(X){return X.some(le=>w.some(Ie=>le.startsWith(Ie)))}function E(X,le){return le||!X.startsWith(" ")||X.startsWith(" ")?X:` ${X}`}function P(X,le){const Ie=X.length,de=le.length,pe=[];let ve=0;for(;ve<Ie&&ve<de&&X[ve]===le[ve];)pe.push({originalIndex:ve,modifiedIndex:ve}),ve++;const oe=[];let ye=Ie-1,G=de-1;for(;ye>=ve&&G>=ve&&X[ye]===le[G];)oe.unshift({originalIndex:ye,modifiedIndex:G}),ye--,G--;const Y=ye-ve+1,fe=G-ve+1;if(Y<=0||fe<=0||i.value||(Y+1)*(fe+1)>15e5)return pe.concat(oe);const we=fe+1,ge=new Uint32Array((Y+1)*(fe+1));for(let ue=Y-1;ue>=0;ue--)for(let Se=fe-1;Se>=0;Se--){const ze=ue*we+Se;if(X[ve+ue]===le[ve+Se])ge[ze]=ge[(ue+1)*we+Se+1]+1;else{const _e=ge[(ue+1)*we+Se],Ee=ge[ue*we+Se+1];ge[ze]=_e>=Ee?_e:Ee}}const Q=[];let te=0,ce=0;for(;te<Y&&ce<fe;)X[ve+te]===le[ve+ce]?(Q.push({originalIndex:ve+te,modifiedIndex:ve+ce}),te++,ce++):ge[(te+1)*we+ce]>=ge[te*we+ce+1]?te++:ce++;return pe.concat(Q,oe)}function D(X){var le;const Ie=(function(){var G,Y;const fe=t.diffHideUnchangedRegions;if(fe==null||fe===!1)return null;const we=fe===!0?{}:fe;return we.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((G=we.contextLineCount)!=null?G:2)),minimumLineCount:Math.max(1,Math.floor((Y=we.minimumLineCount)!=null?Y:4))}})();if(!Ie||X.length<1||X.length>2||X.length===2&&X[0].lines.length!==X[1].lines.length)return X;const de=X[0].lines,pe=(le=X[1])==null?void 0:le.lines,ve=G=>de[G].kind==="context"&&(pe===void 0||pe[G].kind==="context"&&de[G].code===pe[G].code),oe=[];let ye=0;for(;ye<de.length;){const G=ye;for(;ye<de.length&&ve(ye);)ye++;const Y=ye;if(Y-G>=Ie.minimumLineCount){const fe=G+(G===0?0:Ie.contextLineCount),we=Y-(Y===de.length?0:Ie.contextLineCount);we-fe>=Ie.minimumLineCount&&oe.push({start:fe,end:we})}ye===G&&ye++}return oe.length?X.map((G,Y)=>{const fe=[];let we=0;for(const ge of oe)fe.push(...G.lines.slice(we,ge.start)),fe.push({code:Y===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${G.key}-collapsed-${ge.start}-${ge.end}`,number:""}),we=ge.end;return fe.push(...G.lines.slice(we)),rn(mt({},G),{lines:fe})}):X}const I=R(()=>{var X,le,Ie,de;if(!m.value)return[];const pe=(function(Y){const fe=Y.some(ge=>S(ge)),we=Y.some(ge=>T(ge));return fe&&we||(function(){var ge,Q,te,ce;if(o.value==="diff")return!0;const ue=(ce=(te=String((Q=(ge=t.node)==null?void 0:ge.raw)!=null?Q:"").split(/\r?\n/,1)[0])==null?void 0:te.trim())!=null?ce:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(ue)})()&&(fe||we)})(c.value),ve=(function(){var Y,fe;return((Y=t.node)==null?void 0:Y.originalCode)!=null||((fe=t.node)==null?void 0:fe.updatedCode)!=null})();if(v.value){const Y=ve?(function(fe,we){const ge=g(fe),Q=g(we),te=P(ge,Q);if(te.length>0){const Ee=[];let it=0,Fe=0;for(const Oe of te){for(;it<Oe.originalIndex;)Ee.push(rn(mt({},_(ge[it],"removed",{preserveBlankKind:x(ge,it)})),{key:`inline-removed-source-${it}`,number:it+1})),it++;for(;Fe<Oe.modifiedIndex;)Ee.push(rn(mt({},_(Q[Fe],"added",{preserveBlankKind:x(Q,Fe)})),{key:`inline-added-source-${Fe}`,number:Fe+1})),Fe++;Ee.push(rn(mt({},_(Q[Oe.modifiedIndex])),{key:`inline-context-source-${Oe.originalIndex}-${Oe.modifiedIndex}`,number:Oe.modifiedIndex+1})),it=Oe.originalIndex+1,Fe=Oe.modifiedIndex+1}for(;it<ge.length;)Ee.push(rn(mt({},_(ge[it],"removed",{preserveBlankKind:x(ge,it)})),{key:`inline-removed-source-${it}`,number:it+1})),it++;for(;Fe<Q.length;)Ee.push(rn(mt({},_(Q[Fe],"added",{preserveBlankKind:x(Q,Fe)})),{key:`inline-added-source-${Fe}`,number:Fe+1})),Fe++;return Ee}const ce=[];let ue=0,Se=ge.length-1,ze=Q.length-1;for(;ue<=Se&&ue<=ze&&ge[ue]===Q[ue];)ce.push(rn(mt({},_(Q[ue])),{key:`inline-prefix-${ue}`,number:ue+1})),ue++;const _e=[];for(;Se>=ue&&ze>=ue&&ge[Se]===Q[ze];)_e.unshift(rn(mt({},_(Q[ze])),{key:`inline-suffix-${ze}`,number:ze+1})),Se--,ze--;for(let Ee=ue;Ee<=Se;Ee++)ce.push(rn(mt({},_(ge[Ee],"removed",{preserveBlankKind:x(ge,Ee)})),{key:`inline-removed-source-${Ee}`,number:Ee+1}));for(let Ee=ue;Ee<=ze;Ee++)ce.push(rn(mt({},_(Q[Ee],"added",{preserveBlankKind:x(Q,Ee)})),{key:`inline-added-source-${Ee}`,number:Ee+1}));return ce.concat(_e)})((X=t.node)==null?void 0:X.originalCode,(le=t.node)==null?void 0:le.updatedCode):(function(fe){const we=[];let ge=1,Q=1;const te=A(fe);for(const[ce,ue]of fe.entries())if(ue.startsWith("@@")){const Se=ue.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);Se&&(ge=Number(Se[1]),Q=Number(Se[2])),we.push(rn(mt({},_(ue,"hunk")),{key:`inline-hunk-${ce}`,number:""}))}else if(S(ue))we.push(rn(mt({},_(E(ue.slice(1),te),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ce}`,number:ge++}));else if(T(ue))we.push(rn(mt({},_(E(ue.slice(1),te),"added",{preserveBlankKind:!0})),{key:`inline-added-${ce}`,number:Q++}));else{const Se=te&&ue.startsWith(" ")?ue.slice(1):ue;we.push(rn(mt({},_(Se)),{key:`inline-context-${ce}`,number:Q})),ge++,Q++}return we})(c.value);return D([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:Y}])}if(!pe&&ve)return(function(Y,fe){const we=g(Y),ge=g(fe),Q=P(we,ge),te=[],ce=[];let ue=0,Se=0,ze=0;const _e=(Ee,it)=>{const Fe=Math.max(Ee-ue,it-Se);for(let Oe=0;Oe<Fe;Oe++){const Ge=ue+Oe,at=Se+Oe;te.push(Ge<Ee?rn(mt({},_(we[Ge],"removed",{preserveBlankKind:x(we,Ge)})),{key:`original-changed-${ze}-${Ge}`,number:Ge+1}):rn(mt({},_("","spacer")),{key:`original-spacer-${ze}-${Oe}`,number:""})),ce.push(at<it?rn(mt({},_(ge[at],"added",{preserveBlankKind:x(ge,at)})),{key:`modified-changed-${ze}-${at}`,number:at+1}):rn(mt({},_("","spacer")),{key:`modified-spacer-${ze}-${Oe}`,number:""}))}ue=Ee,Se=it,ze++};for(const Ee of Q)_e(Ee.originalIndex,Ee.modifiedIndex),te.push(rn(mt({},_(we[Ee.originalIndex])),{key:`original-context-${Ee.originalIndex}-${Ee.modifiedIndex}`,number:Ee.originalIndex+1})),ce.push(rn(mt({},_(ge[Ee.modifiedIndex])),{key:`modified-context-${Ee.originalIndex}-${Ee.modifiedIndex}`,number:Ee.modifiedIndex+1})),ue=Ee.originalIndex+1,Se=Ee.modifiedIndex+1;return _e(we.length,ge.length),D([{key:"original",className:"markstream-pre__diff-pane--original",lines:te},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ce}])})((Ie=t.node)==null?void 0:Ie.originalCode,(de=t.node)==null?void 0:de.updatedCode);const oe=[],ye=[],G=A(c.value);for(const Y of c.value)if(Y.startsWith("@@"))oe.push(_(Y,"hunk")),ye.push(_(Y,"hunk"));else if(Y.startsWith("-")&&!Y.startsWith("---"))oe.push(_(E(Y.slice(1),G),"removed",{preserveBlankKind:!0}));else if(Y.startsWith("+")&&!Y.startsWith("+++"))ye.push(_(E(Y.slice(1),G),"added",{preserveBlankKind:!0}));else{const fe=G&&Y.startsWith(" ")?Y.slice(1):Y;oe.push(_(fe)),ye.push(_(fe))}return D([{key:"original",className:"markstream-pre__diff-pane--original",lines:oe.map((Y,fe)=>rn(mt({},Y),{key:`original-${fe}`,number:fe+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ye.map((Y,fe)=>rn(mt({},Y),{key:`modified-${fe}`,number:fe+1}))}])}),$=R(()=>I.value.some(X=>X.lines.some(le=>le.kind==="collapsed"))),B=R(()=>{const X=o.value;return X?`Code block: ${X}`:"Code block"}),H=Z(null),O=Z([]);let F=null,U=!1,z=null;function W(X){const le=Number.parseFloat(String(X??""));return Number.isFinite(le)&&le>0?le:0}function K(X,le){var Ie;if(!X)return le;if(X.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const de=X.querySelector(".markstream-pre__diff-content"),pe=de?.getBoundingClientRect(),ve=(Ie=pe?.height)!=null?Ie:0;return Math.max(le,Math.ceil(ve))}function V(){U||typeof window>"u"||(F!=null&&window.cancelAnimationFrame(F),F=window.requestAnimationFrame(()=>{F=null,U||(function(){var X,le;F=null;const Ie=H.value;if(!Ie||!m.value||v.value||!Ie.classList.contains("is-wrap"))return void(O.value.length&&(O.value=[]));const de=(function(fe){const we=window.getComputedStyle(fe),ge=W(we.getPropertyValue("--markstream-pre-diff-line-height"));if(ge>0)return ge;const Q=W(we.lineHeight);return Q>0?Q:18})(Ie),pe=Array.from(Ie.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),ve=Array.from(Ie.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),oe=Math.max(pe.length,ve.length),ye=[];for(let fe=0;fe<oe;fe++){const we=K((X=pe[fe])!=null?X:null,de),ge=K((le=ve[fe])!=null?le:null,de),Q=Math.max(de,we,ge);ye.push({rowHeight:Q,originalHeight:we,modifiedHeight:ge})}var G,Y;G=O.value,Y=ye,G.length===Y.length&&G.every((fe,we)=>{const ge=Y[we];return ge&&Math.abs(fe.rowHeight-ge.rowHeight)<=.5&&Math.abs(fe.originalHeight-ge.originalHeight)<=.5&&Math.abs(fe.modifiedHeight-ge.modifiedHeight)<=.5})||(O.value=ye)})()}))}function ie(X){z?.disconnect(),z=null,X&&m.value&&!v.value&&typeof ResizeObserver<"u"&&(z=new ResizeObserver(()=>{V()}),z.observe(X))}function ne(X,le){const Ie=O.value[X];if(!Ie)return;const de=le==="original"?Ie.originalHeight:Ie.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(Ie.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(de)}px`}}return Je(H,X=>{ie(X),yt(()=>V())},{flush:"post"}),Je([m,v,I],()=>{ie(H.value),yt(()=>V())},{flush:"post",immediate:!0}),Vn(()=>{U=!0,F!=null&&(window.cancelAnimationFrame(F),F=null),z?.disconnect(),z=null}),(X,le)=>(y(),M("pre",{ref_key:"preRef",ref:H,style:Zt(k.value),class:Re([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":v.value,"markstream-pre--diff-collapsed":$.value}]),"aria-busy":i.value,"aria-label":B.value,"data-language":o.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(y(),M("code",Kde,[(y(!0),M(Pe,null,pt(I.value,Ie=>(y(),M("span",{key:Ie.key,class:Re(["markstream-pre__diff-pane",Ie.className])},[C("span",Zde,[(y(!0),M(Pe,null,pt(Ie.lines,(de,pe)=>(y(),M("span",{key:de.key,class:Re(["markstream-pre__diff-line",[`markstream-pre__diff-line--${de.kind}`,{"markstream-pre__diff-line--empty":de.empty}]]),style:Zt(ne(pe,Ie.key))},[le[0]||(le[0]=C("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),C("span",Gde,N(de.number),1),C("span",Yde,[C("span",Xde,N(de.code),1)])],6))),128))])],2))),128))])):(y(),M(Pe,{key:1},[t.showLineNumbers?(y(),M("span",Jde,[C("span",{class:"markstream-pre__line-numbers-text",textContent:N(h.value)},null,8,Qde)])):ee("",!0),C("code",{translate:"no",class:"markstream-pre__code",textContent:N(r.value)},null,8,e1e)],64))],14,qde))}});Pi.install=e=>{e.component(Pi.__name,Pi)};const t1e={key:0},qo=Gn(et({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=p1(),o=nn("markstreamFade",void 0),s=nn("markstreamTextStreamState",void 0),i=nn("markstreamStreamVersion",void 0),r=R(()=>{const k=n.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),l=R(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=R(()=>{var k;const w=(k=n["index-key"])!=null?k:n.indexKey;return w==null||w===""?"":String(w)}),u=Z(t.node.content),c=Z(""),d=Z(0);let f;function h(){f?.(),f=void 0}function m(){h(),c.value&&(u.value=u.value+c.value,c.value="")}Je([()=>t.node.content,a,l],([k])=>{const w=String(k??""),b=a.value,_=t$({nextContent:w,persistedContent:b?s?.get(b):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=_.settledContent,c.value=_.streamedDelta,_.appended?(d.value+=1,(function(){if(!c.value||f||!i)return;const g=i.value;f=Je(()=>i.value,x=>{x!==g&&m()},{flush:"sync"})})()):c.value||h(),b&&s?.set(b,w)},{immediate:!0}),d1(h);const v=R(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,w)=>(y(),M("span",{class:Re([[e.node.center?"text-node-center":""],"text-node"])},[u.value?(y(),M("span",t1e,N(u.value),1)):ee("",!0),c.value?(y(),M("span",{key:1,class:Re(["text-node-stream-delta",[v.value]]),onAnimationend:m},N(c.value),35)):ee("",!0)],2))}}),[["__scopeId","data-v-a7e90764"]]);function Af(e,t,n){return et({name:e,inheritAttrs:!1,setup(o,{attrs:s,slots:i}){var r,l;const a=g5(),u=h5(),c=m5(),d=typeof window<"u"&&((l=(r=ds())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=Z(typeof window>"u"||d||!c.value),h=Xr(null);let m=null;function v(k){const w=k&&"$el"in k?k.$el:k;h.value=w instanceof HTMLElement?w:null}return typeof window<"u"&&Je([h,c],([k,w],b,_)=>{if(m?.destroy(),m=null,!w||f.value)return void(f.value=!0);if(!k)return;let g=!0;const x=a(k,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=x,f.value=x.isVisible.value,x.whenVisible.then(()=>{g&&m===x&&(f.value=!0)}),_(()=>{g=!1,x.destroy(),m===x&&(m=null)})},{immediate:!0}),Vn(()=>{m?.destroy(),m=null}),()=>tn(f.value?t:n,rn(mt({},s),{ref:v}),i)}})}qo.install=e=>{e.component(qo.__name,qo)};const dg=et({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var o,s,i,r,l,a,u;const c=T2(String((s=(o=n.node)==null?void 0:o.language)!=null?s:"")),d=p_[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):p_[""]),f=jde(n.node),h=Vde(String((r=(i=n.node)==null?void 0:i.raw)!=null?r:""),d,f),m=n.monacoOptions,v=f&&((l=n.estimatedDiffInline)!=null?l:v5(m??{},typeof window>"u"?0:window.innerWidth)),k=m?.diffAppearance,w=k==="dark"||k!=="light"&&n.isDark===!0,b=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,_=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:b===12?18:Math.max(12,Math.round(1.5*b)),g=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,x=f?0:8,S=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:x,T=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:x,A=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",E=mt(mt({fontSize:`${b}px`,lineHeight:`${_}px`,tabSize:g,paddingTop:`${S}px`,paddingBottom:`${T}px`,"--markstream-pre-line-number-top":`${S}px`},f?{"--markstream-pre-diff-line-height":`${_}px`}:{}),A?{"--markstream-code-font-family":A}:{}),P=()=>tn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[tn("svg",{class:"action-icon"})]),D=n.isShowPreview!==!1&&(c==="html"||c==="svg"),I=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||D&&n.showPreviewButton!==!1,$=H=>{if(H!=null)return typeof H=="number"?`${H}px`:String(H)},B=mt(mt(mt({"--markstream-code-layout-character-width":"1ch"},$(n.minWidth)?{minWidth:$(n.minWidth)}:{}),$(n.maxWidth)?{maxWidth:$(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg, var(--code-bg)))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return tn("div",rn(mt({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":w,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[B,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:tn("div",{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)]"},[tn("div",{class:"code-header-main"},[tn("span",{class:"icon-slot h-4 w-4 flex-shrink-0"}),tn("div",{class:"code-header-copy"},[tn("div",{class:"code-header-title"},h.title),h.caption?tn("div",{class:"code-header-caption"},h.caption):null])]),tn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?tn("div",{class:"code-diff-stats","aria-hidden":"true"},[tn("span",{class:"code-diff-stat removed"},"-0"),tn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:P(),n.showCollapseButton===!1?null:P(),I?tn("div",{class:"relative"},[P()]):null])]),tn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[tn(Pi,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:v,diffHideUnchangedRegions:f?Ude(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:E,"data-markstream-code-loading":"1"})]),tn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[tn("div",{class:"loading-skeleton"},[tn("div",{class:"skeleton-line"}),tn("div",{class:"skeleton-line"}),tn("div",{class:"skeleton-line short"})])]),tn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),X9=Af("ViewportDeferredCodeBlockNode",zr({loader:()=>mo(null,null,function*(){try{return(yield jo(()=>import("./CodeBlockNode-Do73mQqg.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependency stream-diffs is missing. Falling back to preformatted code rendering. To enable enhanced code block features, please install "stream-diffs".',e),Pi}}),loadingComponent:dg,delay:0,suspensible:!1}),dg),Jr=zr(()=>mo(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,o,s,i;return tn(qo,rn(mt({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{return yield r$(),(yield jo(()=>import("./index7-CG7TPx8g.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,o,s,i;return tn(qo,rn(mt({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),C$=zr(()=>mo(null,null,function*(){try{return yield r$(),(yield jo(()=>import("./index6-CXJ_z4n5.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,o,s;return tn(qo,rn(mt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),xi=Gn(et({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(y(),M("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},N(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);xi.install=e=>{e.component(xi.__name,xi)};const n1e={class:"superscript-node"},Wi=Gn(et({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,emphasis:Ti,footnote_reference:or,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,emoji:zi,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("sup",n1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"superscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Wi.install=e=>{e.component(Wi.__name,Wi)};const o1e={class:"subscript-node"},Ui=Gn(et({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,emphasis:Ti,footnote_reference:or,strikethrough:Ai,highlight:ir,insert:ji,superscript:Wi,emoji:zi,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("sub",o1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"subscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Ui.install=e=>{e.component(Ui.__name,Ui)};const s1e={class:"strong-node"},Si=Gn(et({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,emphasis:Ti,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,footnote_reference:or,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("strong",s1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"strong"}-${l}`,components:o.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Si.install=e=>{e.component(Si.__name,Si)};const i1e={class:"strikethrough-node"},Ai=Gn(et({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,emphasis:Ti,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,footnote_reference:or,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("del",i1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);Ai.install=e=>{e.component(Ai.__name,Ai)};const r1e=["href","title","aria-label","aria-hidden","target","rel"],l1e=["aria-hidden"],a1e={class:"link-text-wrapper relative inline-flex"},u1e={class:"leading-[normal] link-text"},Mi=Gn(et({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=nn("markstreamShowTooltips",void 0),o=R(()=>{const w=n?.value;return typeof w=="boolean"?w:t.showTooltip}),s=R(()=>{var w,b,_,g,x;const S=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",T=(w=t.animationOpacity)!=null?w:.35,A=Math.max(.12,Math.min(.5*T,T)),E={"--underline-height":`${(b=t.underlineHeight)!=null?b:2}px`,"--underline-bottom":S,"--underline-opacity":String(T),"--underline-rest-opacity":String(A),"--underline-duration":`${(_=t.animationDuration)!=null?_:1.6}s`,"--underline-timing":(g=t.animationTiming)!=null?g:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(x=t.animationIteration)!=null?x:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=fs(()=>t.customId),r=R(()=>mt({text:qo,strong:Si,strikethrough:Ai,emphasis:Ti,image:Va,html_inline:sr,inline_code:li},i.value)),l=p1(),a=R(()=>{var w,b;const _=(w=t.node)==null?void 0:w.attrs;if(!_||typeof _!="object")return{};const g={};if(Array.isArray(_))for(const x of _)Array.isArray(x)&&x[0]&&(g[String(x[0])]=String((b=x[1])!=null?b:""));else for(const[x,S]of Object.entries(_))x&&S!=null&&S!==!1&&(g[x]=S===!0?"":String(S));return A_(g,"safe","a")}),u=R(()=>mt(mt({},l),a.value)),c=R(()=>{var w,b;return A_({href:String((b=(w=t.node)==null?void 0:w.href)!=null?b:"")},"safe","a").href}),d=R(()=>{if(!c.value)return;const w=u.value.target;return(typeof w=="string"?w.trim():String(w??"").trim())||(sie(c.value)?"_blank":void 0)}),f=R(()=>{var w;return String((w=d.value)!=null?w:"").trim().toLowerCase()==="_blank"}),h=R(()=>{if(!c.value)return;const w=u.value.rel,b=new Set((typeof w=="string"?w:String(w??"")).split(/\s+/).filter(Boolean)),_=new Set(Array.from(b).filter(g=>g.toLowerCase()!=="opener"));return f.value&&(_.add("noopener"),_.add("noreferrer")),_.size>0?Array.from(_).join(" "):void 0}),m=R(()=>{const w=mt({},u.value);return delete w.title,delete w.href,delete w.target,delete w.rel,w});function v(){o.value&&Tde()}const k=R(()=>{var w,b;const _=(w=t.node)==null?void 0:w.title;return typeof _=="string"&&_.trim().length>0?_:String((b=c.value)!=null?b:"")});return(w,b)=>{var _,g;return e.node.loading?(y(),M("span",zn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:s.value}),[C("span",a1e,[C("span",u1e,[j(p(qo),{class:"leading-[normal] link-text",node:{type:"text",content:String((_=e.node.text)!=null?_:""),raw:String((g=e.node.text)!=null?g:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),b[1]||(b[1]=C("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,l1e)):(y(),M("a",zn({key:0,class:"link-node",href:c.value,title:o.value?"":k.value,"aria-label":`Link: ${k.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:s.value,onMouseenter:b[0]||(b[0]=x=>(function(S){var T,A,E,P;if(!o.value)return;const D=S,I=D?.clientX!=null&&D?.clientY!=null?{x:D.clientX,y:D.clientY}:void 0,$=((T=t.node)==null?void 0:T.title)||((A=c.value)!=null&&A.includes("xn--")&&((P=(E=t.node)==null?void 0:E.text)!=null&&P.includes("://"))?t.node.text:c.value)||"";Mde(S.currentTarget,$,"top",!1,I)})(x)),onMouseleave:v}),[(y(!0),M(Pe,null,pt(e.node.children,(x,S)=>(y(),he(p(El),{key:`${e.indexKey||"emphasis"}-${S}`,components:r.value,node:x,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${S}`},null,8,["components","node","custom-id","index-key"]))),128))],16,r1e))}}}),[["__scopeId","data-v-367e6ca4"]]);Mi.install=e=>{e.component(Mi.__name,Mi)};const c1e={class:"insert-node"},ji=Gn(et({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,emphasis:Ti,strikethrough:Ai,highlight:ir,subscript:Ui,superscript:Wi,emoji:zi,footnote_reference:or,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("ins",c1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"insert"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);ji.install=e=>{e.component(ji.__name,ji)};const d1e={class:"highlight-node"},ir=Gn(et({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,emphasis:Ti,strikethrough:Ai,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,footnote_reference:or,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("mark",d1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"highlight"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);ir.install=e=>{e.component(ir.__name,ir)};const f1e={class:"emphasis-node"},Ti=Gn(et({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>mt({text:qo,inline_code:li,link:Mi,html_inline:sr,strong:Si,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,footnote_reference:or,math_inline:Jr,reference:xi},n.value));return(s,i)=>(y(),M("em",f1e,[(y(!0),M(Pe,null,pt(e.node.children,(r,l)=>(y(),he(p(El),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Ti.install=e=>{e.component(Ti.__name,Ti)};const p1e={class:"hard-break"},qa=Gn(et({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(y(),M("br",p1e))}),[["__scopeId","data-v-50c58f70"]]);qa.install=e=>{e.component(qa.__name,qa)};const $p=et({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=kt({checkbox:nr,checkbox_input:nr,emoji:zi,emphasis:Ti,hardbreak:qa,highlight:ir,inline_code:li,insert:ji,link:Mi,reference:xi,strikethrough:Ai,strong:Si,subscript:Ui,superscript:Wi,text:qo}),o=fs(()=>t.customId),s=R(()=>{const i=o.value;return Object.keys(i).length>0?mt(mt({},n),i):n});return(i,r)=>(y(!0),M(Pe,null,pt(e.nodes,(l,a)=>(y(),he(p(El),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function i8(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(i8)}function fg(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(i8))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(i8)?s:null}function kc(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const h1e=["cite"],m1e={key:0,dir:"auto",class:"paragraph-node"},g1e=["custom-id"],tm=Gn(et({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=fs(()=>t.customId),o=R(()=>!!n.value.paragraph),s=R(()=>!!n.value.text),i=R(()=>fg(t.node.children,!o.value)),r=R(()=>t.fade!==!1||s.value?null:kc(i.value));return Ln("markstreamShowTooltips",R(()=>t.showTooltips)),Ln("markstreamFade",R(()=>t.fade)),(l,a)=>(y(),M("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(y(),M("p",m1e,[r.value!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(r.value),9,g1e)):(y(),he(p($p),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(y(),he(p(Vi),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,h1e))}}),[["__scopeId","data-v-abfecebc"]]);tm.install=e=>{e.component(tm.__name,tm)};const v1e={class:"definition-list"},y1e={class:"definition-term"},k1e={class:"definition-desc"},nm=Gn(et({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(y(),M("dl",v1e,[(y(!0),M(Pe,null,pt(t.node.items,(s,i)=>(y(),M(Pe,{key:i},[C("dt",y1e,[j(p(Vi),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),C("dd",k1e,[j(p(Vi),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);nm.install=e=>{e.component(nm.__name,nm)};const b1e=["href","title"],Jf=Gn(et({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(y(),M("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,b1e))}}),[["__scopeId","data-v-e1eb37b6"]]);Jf.install=e=>{e.component(Jf.__name,Jf)};const C1e=["id"],w1e={class:"flex-1"},om=et({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(y(),M("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[C("div",w1e,[j(p(Vi),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,C1e))}});om.install=e=>{e.component(om.__name,om)};const _1e=["custom-id"],r8=Gn(et({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=fs(()=>t.customId),o=nn("markstreamFade",void 0),s=R(()=>o?.value!==!1||n.value.text?null:kc(t.node.children)),i=R(()=>mt({text:qo,inline_code:li,link:Mi,image:Va,strong:Si,emphasis:Ti,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,checkbox:nr,checkbox_input:nr,footnote_reference:or,hardbreak:qa,math_inline:Jr,reference:xi},n.value));return(r,l)=>(y(),he(bs(`h${e.node.level}`),zn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:me(()=>[s.value!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(s.value),9,_1e)):(y(!0),M(Pe,{key:1},pt(e.node.children,(a,u)=>(y(),he(p(El),{key:u,components:i.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),L2=r8;L2.install=e=>{e.component(r8.__name,r8)};const x1e={key:0,dir:"auto",class:"paragraph-node"},S1e=["custom-id"],A1e={dir:"auto",class:"paragraph-node"},M1e=["custom-id"],Vd=Gn(et({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=R(()=>{var h;return(h=t.node)!=null?h:t.item}),o=fs(()=>t.customId),s=R(()=>!!o.value.paragraph),i=R(()=>!!o.value.text),r=R(()=>{var h;return fg((h=n.value)==null?void 0:h.children,!s.value)}),l=R(()=>{var h;if(s.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const v=m[0];if(v?.type!=="paragraph"||!Array.isArray(v.children))return null;const k=m.slice(1);if(!k.every(b=>b?.type==="list"))return null;const w=fg([v]);return w?{paragraphChildren:w,nestedLists:k}:null});function a(){return t.fade===!1&&!i.value}const u=R(()=>a()?kc(r.value):null),c=R(()=>{var h;return a()?kc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=R(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Ln("markstreamShowTooltips",R(()=>t.showTooltips)),Ln("markstreamFade",R(()=>t.fade)),(h,m)=>{var v,k;return y(),M("li",zn({class:"list-item",dir:"auto"},f.value),[r.value?(y(),M("p",x1e,[u.value!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(u.value),9,S1e)):(y(),he(p($p),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(y(),M(Pe,{key:1},[C("p",A1e,[c.value!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(c.value),9,M1e)):(y(),he(p($p),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(y(!0),M(Pe,null,pt(l.value.nestedLists,(w,b)=>(y(),he(p(Vi),{key:b,nodes:[w],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${b}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:m[0]||(m[0]=_=>h.$emit("copy",_))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(y(),he(p(Vi),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(k=(v=n.value)==null?void 0:v.children)!=null?k:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=w=>h.$emit("copy",w))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Vd.install=e=>{e.component(Vd.__name,Vd)};const qd=Gn(et({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=fs(()=>e.customId),n=R(()=>t.value.list_item||Vd);return(o,s)=>(y(),he(bs(e.node.ordered?"ol":"ul"),{class:Re(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:me(()=>[(y(!0),M(Pe,null,pt(e.node.items,(i,r)=>{var l;return y(),he(bs(n.value),zn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);qd.install=e=>{e.component(qd.__name,qd)};const T1e={key:2,class:"html-block-node__raw"},E1e=["innerHTML"],I1e={key:1,class:"html-block-node__placeholder"},Qf=Gn(et({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=nn("markstreamHtmlPolicy",void 0),o=nn("markstreamNestedRendererProps",void 0),s=R(()=>{var I,$;return($=(I=t.htmlPolicy)!=null?I:n?.value)!=null?$:"safe"}),i=R(()=>{var I,$;const B=(I=o?.value)!=null?I:{};return rn(mt({},B),{customId:($=t.customId)!=null?$:B.customId,htmlPolicy:s.value})}),r=zr({loader:()=>Promise.resolve().then(()=>M5),suspensible:!1}),l=R(()=>{const I=Xh(t.node.attrs,s.value);if(!I)return;const $=Zf(I);return Object.keys($).length>0?$:void 0}),a=R(()=>{const I=String(t.node.tag||"").trim(),$=Xh(t.node.attrs,s.value,I);if(!$)return;const B=Zf($);return Object.keys(B).length>0?B:void 0}),u=fs(()=>t.customId),c=et({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Z(null),f=Z(typeof window>"u"),h=Z(t.node.content),m=R(()=>Array.isArray(t.node.children)?t.node.children:[]),v=R(()=>String(t.node.tag||"div")),k=R(()=>{var I;if(v.value.trim().toLowerCase()!=="details"||(I=t.node.attrs)!=null&&I.some(([B])=>String(B).toLowerCase()==="open"))return null;const $=m.value[0];return $?.type==="html_block"&&String($.tag||"").toLowerCase()==="summary"?$:null}),w=R(()=>{var I;return kc((I=k.value)==null?void 0:I.children)}),b=R(()=>{const I=k.value;if(!I)return;const $=Xh(I.attrs,s.value,"summary");if(!$)return;const B=Zf($);return Object.keys(B).length>0?B:void 0}),_=R(()=>w.value==null?m.value:m.value.slice(1)),g=R(()=>{const I=v.value.trim().toLowerCase();return UI.has(I)||a5(I,s.value)}),x=R(()=>m.value.length>0&&!!t.node.tag&&!g.value),S=R(()=>{var I,$,B;if(x.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(I=h.value)!=null?I:""};const H=($=h.value)!=null?$:t.node.content;if(!H)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:jd(H,s.value)};if(t.node.loading){const F=cg(H,u.value,s.value);return F===null?{mode:"text",content:(B=t.node.raw)!=null?B:H}:{mode:"dynamic",nodes:F}}if(!h$(H,u.value))return{mode:"html",content:jd(H,s.value)};const O=cg(H,u.value,s.value);return O===null?{mode:"html",content:jd(H,s.value)}:{mode:"dynamic",nodes:O}}),T=g5(),A=h5(),E=m5(),P=Xr(null),D=!!t.node.loading;return typeof window<"u"?(Je([()=>d.value,()=>A?.value.heavyBlockMargin,()=>A?.value.rootMargin],([I],$,B)=>{var H,O,F,U;if((O=(H=P.value)==null?void 0:H.destroy)==null||O.call(H),P.value=null,!D)return f.value=!0,void(h.value=t.node.content);if(!I)return void(f.value=!1);let z=!0;const W=(U=(F=A?.value.heavyBlockMargin)!=null?F:A?.value.rootMargin)!=null?U:yc,K=T(I,{rootMargin:W,allowIdle:!E.value});P.value=K,f.value=f.value||K.isVisible.value,K.whenVisible.then(()=>{z&&P.value===K&&(f.value=!0)}),B(()=>{z=!1,K.destroy(),P.value===K&&(P.value=null)})},{immediate:!0}),Je(()=>t.node.content,I=>{D&&!f.value||(h.value=I)})):f.value=!0,Vn(()=>{var I,$;($=(I=P.value)==null?void 0:I.destroy)==null||$.call(I),P.value=null}),(I,$)=>(y(),he(bs(x.value?v.value:"div"),zn({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(E)&&!f.value?"true":void 0},x.value?a.value:void 0),{default:me(()=>[f.value?(y(),M(Pe,{key:0},[S.value.mode==="structured"?(y(),M(Pe,{key:0},[w.value!==null?(y(),M(Pe,{key:0},[C("summary",xR(OA(b.value)),N(w.value),17),_.value.length?(y(),he(p(r),zn({key:0},i.value,{nodes:_.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ee("",!0)],64)):(y(),he(p(r),zn({key:1},i.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):S.value.mode==="dynamic"?(y(),he(p(c),{key:1,nodes:S.value.nodes},null,8,["nodes"])):S.value.mode==="text"?(y(),M("pre",T1e,N(S.value.content),1)):(y(),M("div",zn({key:3},l.value,{innerHTML:S.value.content}),null,16,E1e))],64)):(y(),M("div",I1e,[xn(I.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=C("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=C("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=C("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Qf.install=e=>{e.component(Qf.__name,Qf)};const L1e={dir:"auto",class:"paragraph-node"},$1e=["custom-id"],cc=Gn(et({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=fs(()=>t.customId),o=nn("markstreamHtmlPolicy",void 0),s=nn("markstreamFade",void 0),i=nn("markstreamParseOptions",void 0),r=nn("markstreamCustomMarkdownIt",void 0),l=nn("markstreamNestedRendererProps",void 0),a=R(()=>{var A;return(A=o?.value)!=null?A:"safe"}),u=R(()=>{var A;return(A=t.parseOptions)!=null?A:i?.value}),c=R(()=>{var A;return(A=t.customMarkdownIt)!=null?A:r?.value}),d=R(()=>{var A,E;return(E=t.customHtmlTags)!=null?E:(A=l?.value)==null?void 0:A.customHtmlTags}),f=R(()=>{var A,E;const P=(A=l?.value)!=null?A:{};return rn(mt({},P),{customId:(E=t.customId)!=null?E:P.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=zr({loader:()=>Promise.resolve().then(()=>M5),suspensible:!1});function m(A){var E;return A.type==="text"&&String((E=A.content)!=null?E:"").trim()===""}const v=R(()=>t.node.children.filter(A=>!m(A))),k=R(()=>v.value.length>0&&v.value.every(A=>A.type==="image"||(function(E){var P;const D=(function(I){return I.type==="link"&&Array.isArray(I.children)?I.children.filter($=>!m($)):[]})(E);return D.length===1&&((P=D[0])==null?void 0:P.type)==="image"})(A))),w=R(()=>new Set(Ec(d.value))),b=R(()=>{if(!k.value||v.value.length<=1)return t.node.children;const A=[];for(let E=0;E<t.node.children.length;E++){const P=t.node.children[E];if(!m(P)){A.push(P);continue}const D=A.length>0,I=t.node.children.slice(E+1).some($=>!m($));D&&I&&A.push(rn(mt({},P),{content:" ",raw:" "}))}return A}),_=R(()=>s?.value===!1&&!n.value.text),g=R(()=>_.value?kc(b.value):null);function x(A,E){return{node:A,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const S=R(()=>mt({inline_code:li,image:Va,link:Mi,hardbreak:qa,emphasis:Ti,strong:Si,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,html_inline:sr,html_block:Qf,emoji:zi,checkbox:nr,math_inline:Jr,checkbox_input:nr,reference:xi,footnote_anchor:Jf,footnote_reference:or,text:qo},n.value)),T=R(()=>b.value.map((A,E)=>{var P;const D=(function(I){var $,B,H,O;if(I.type==="html_block"||I.type==="html_inline"){const F=String(($=I.tag)!=null?$:"").trim().toLowerCase()||ZI(I.content);if(F&&!w.value.has(F)&&GI((B=I.content)!=null?B:I.raw,F)){const U=String((O=(H=I.content)!=null?H:I.raw)!=null?O:"");return{child:{type:"text",content:U,raw:U},component:qo,isCustomComponent:!1}}}return{child:I,component:S.value[I.type],isCustomComponent:!!(n.value[I.type]&&!Qp(String(I.type)))}})(A);return rn(mt({},D),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:D.isCustomComponent?p5(D.child,a.value):void 0,hasSlotChildren:Array.isArray(D.child.children)&&D.child.children.length>0,slotContent:String((P=D.child.content)!=null?P:""),originalChild:A})}));return(A,E)=>(y(),M("p",L1e,[g.value!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(g.value),9,$1e)):(y(!0),M(Pe,{key:1},pt(T.value,P=>{return y(),M(Pe,{key:P.key},[k.value&&m(P.originalChild)?(y(),M(Pe,{key:0},[qe(N((D=P.originalChild,String((I=D.content)!=null?I:""))),1)],64)):P.isCustomComponent?(y(),he(bs(P.component),zn({key:1,ref_for:!0},P.customAttrs,{node:P.child,loading:P.child.loading,"index-key":P.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:me(()=>[P.hasSlotChildren?(y(),he(p(h),zn({key:0,ref_for:!0},f.value,{nodes:P.child.children,"index-key":P.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):P.slotContent?(y(),he(p(h),zn({key:1,ref_for:!0},f.value,{content:P.slotContent,final:!P.child.loading,"index-key":`${P.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(y(),he(bs(P.component),zn({key:2,ref_for:!0},x(P.child,P.index)),null,16))],64);var D,I}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);cc.install=e=>{e.component(cc.__name,cc)};const N1e={class:"table-node-wrapper"},F1e=["aria-busy"],R1e={key:0},O1e=["custom-id"],P1e=["aria-label","onPointerdown"],D1e=["custom-id"],B1e={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},ep=Gn(et({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=R(()=>{var w;return(w=t.node.loading)!=null&&w}),o=R(()=>{var w;return(w=t.node.rows)!=null?w:[]}),s=Z(null),i=Z([]);let r=null;const l=R(()=>t.node.header.cells.length),a=R(()=>i.value.some(w=>Number.isFinite(w)&&w>0)),u=R(()=>a.value?i.value.map(w=>w>0?{width:`${w}px`}:void 0):[]);Ln("markstreamShowTooltips",R(()=>t.showTooltips)),Ln("markstreamFade",R(()=>t.fade));const c=fs(()=>t.customId),d=R(()=>!!c.value.text),f=R(()=>!!c.value.paragraph),h=new WeakMap;function m(w){const b=t.fade===!1&&!d.value,_=!f.value,g=h.get(w);if(g?.children===w.children&&g.textFastPath===b&&g.paragraphFastPath===_)return g.info;const x=fg(w.children,_,!0),S={simpleChildren:x,plainText:x&&b?kc(x):null};return h.set(w,{children:w.children,textFastPath:b,paragraphFastPath:_,info:S}),S}function v(w){if(!r)return;w.preventDefault();const b=r.startWidth+r.nextStartWidth,_=Math.min(48,Math.floor(b/2)),g=Math.max(_,Math.min(b-_,Math.round(r.startWidth+w.clientX-r.startX))),x=[...r.widths];x[r.index]=g,x[r.index+1]=b-g,i.value=x}function k(){r&&(window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k),r=null)}return Je(l,()=>{k(),i.value=[]}),Vn(k),(w,b)=>(y(),M("div",N1e,[C("table",{ref_key:"tableRef",ref:s,class:Re(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(y(),M("colgroup",R1e,[(y(!0),M(Pe,null,pt(e.node.header.cells,(_,g)=>(y(),M("col",{key:g,style:Zt(u.value[g])},null,4))),128))])):ee("",!0),C("thead",null,[C("tr",null,[(y(!0),M(Pe,null,pt(e.node.header.cells,(_,g)=>(y(),M("th",{key:g,dir:"auto",class:Re([_.align==="right"?"text-right":_.align==="center"?"text-center":"text-left"])},[m(_).plainText!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(m(_).plainText),9,O1e)):m(_).simpleChildren?(y(),he(p($p),{key:1,nodes:m(_).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${g}`},null,8,["nodes","custom-id","index-key"])):(y(),he(p(Vi),{key:2,nodes:_.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[0]||(b[0]=x=>w.$emit("copy",x))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),g<e.node.header.cells.length-1?(y(),M("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${g+1} and ${g+2}`,onPointerdown:x=>(function(S,T){if(T.button!==0)return;const A=(function(){var D;const I=(D=s.value)==null?void 0:D.querySelectorAll("thead th");return Array.from(I??[],$=>Math.round($.getBoundingClientRect().width))})(),E=A[S],P=A[S+1];E&&P&&(T.preventDefault(),r={index:S,startX:T.clientX,startWidth:E,nextStartWidth:P,widths:A},i.value=A,window.addEventListener("pointermove",v),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k))})(g,x)},null,40,P1e)):ee("",!0)],2))),128))])]),C("tbody",null,[(y(!0),M(Pe,null,pt(o.value,(_,g)=>(y(),M("tr",{key:g},[(y(!0),M(Pe,null,pt(_.cells,(x,S)=>(y(),M("td",{key:S,class:Re([x.align==="right"?"text-right":x.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(x).plainText!==null?(y(),M("span",{key:0,class:"text-node","custom-id":t.customId},N(m(x).plainText),9,D1e)):m(x).simpleChildren?(y(),he(p($p),{key:1,nodes:m(x).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${g}-${S}`},null,8,["nodes","custom-id","index-key"])):(y(),he(p(Vi),{key:2,nodes:x.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[1]||(b[1]=T=>w.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,F1e),j(as,{name:"table-node-fade"},{default:me(()=>[n.value?(y(),M("div",B1e,[xn(w.$slots,"loading",{isLoading:n.value},()=>[b[2]||(b[2]=C("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),b[3]||(b[3]=C("span",{class:"sr-only"},"Loading",-1))],!0)])):ee("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);ep.install=e=>{e.component(ep.__name,ep)};const H1e={class:"hr-node"},sm=Gn({},[["render",function(e,t){return y(),M("hr",H1e)}],["__scopeId","data-v-39b2349c"]]);sm.install=e=>{e.component(sm.__name,sm)};const z1e={class:"unknown-node"},l8=et({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(y(),M("div",z1e,N(e.node.raw),1))}),im=Gn(et({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=R(()=>`vmr-container vmr-container-${t.node.name}`),o=fs(()=>t.customId),s=R(()=>mt({text:qo,paragraph:cc,heading:L2,inline_code:li,link:Mi,image:Va,strong:Si,emphasis:Ti,strikethrough:Ai,insert:ji,subscript:Ui,superscript:Wi,checkbox:nr,checkbox_input:nr,hardbreak:qa,math_inline:Jr,reference:xi,list:qd,math_block:C$,table:ep},o.value));return(i,r)=>(y(),M("div",zn({class:n.value},e.node.attrs),[(y(!0),M(Pe,null,pt(e.node.children,(l,a)=>{return y(),he(bs((u=l.type,s.value[u]||l8)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);im.install=e=>{e.component(im.__name,im)};const W1e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],R_=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function U1e(e){if(e<=255)return W1e[e];let t=0,n=R_.length-1;for(;t<=n;){const o=t+n>>1,s=R_[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const j1e=/[ \t\n\r\f]+/g,V1e=/[\t\n\r\f]| {2,}|^ | $/;let J9=null;const q1e=new RegExp("\\p{Script=Arabic}","u"),ou=new RegExp("\\p{M}","u"),y5=new RegExp("\\p{Nd}","u");function O_(e){return q1e.test(e)}function P_(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function kl(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){if(P_(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(P_(n))return!0}}return!1}const K1e=new Set([" "," ","⁠","\uFEFF"]),Z1e=new Set(["-","‐","–","—"]);function w$(e,t){return!((function(n){const o=tp(n);return o!==null&&K1e.has(o)})(e)||t&&((function(n){const o=tp(n);return o!==null&&(k5.has(o)||bc.has(o))})(e)||(function(n){const o=tp(n);return o!==null&&Z1e.has(o)})(e)))}const k5=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),$2=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),b5=new Set(["'","’"]),bc=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),G1e=new Set([":",".","،","؛"]),Y1e=new Set(["၏"]),X1e=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function J1e(e){if(C5(e))return!0;let t=!1;for(const n of e)if(bc.has(n)||hg(n))t=!0;else if(!t||!ou.test(n))return!1;return t}function Q1e(e){for(const t of e)if(!k5.has(t)&&!bc.has(t))return!1;return e.length>0}function efe(e){if(C5(e))return!0;for(const t of e)if(!($2.has(t)||b5.has(t)||ou.test(t)||hg(t)))return!1;return e.length>0}function C5(e){let t=!1;for(const n of e)if(n!=="\\"&&!ou.test(n)){if(!($2.has(n)||bc.has(n)||b5.has(n)))return!1;t=!0}return t}function pg(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function tp(e){if(e.length===0)return null;const t=pg(e,e.length);return e.slice(t)}const tfe=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function hg(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,o){for(let s=0;s<o.length;s+=2)if(n>=o[s]&&n<=o[s+1])return!0;return!1})(t,tfe)}function nfe(e){const t=(function(n){for(const o of n)if(!ou.test(o))return o;return null})(e);return t!==null&&y5.test(t)}function ofe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(ou.test(o))n--;else{if(!$2.has(o)&&!b5.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function sfe(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function D_(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function B_(e,t){return e&&t!==null&&G1e.has(t)}function ife(e){const t=tp(e);return t!==null&&Y1e.has(t)}function rfe(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function a8(e){let t=e.length;for(;t>0;){const n=pg(e,t),o=e.slice(n,t);if(X1e.has(o))return!0;if(!bc.has(o))return!1;t=n}return!1}function lfe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
317
317
  `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const afe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Or(e){return e.length===1?e[0]:e.join("")}function ufe(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Or(n)}function cfe(e,t,n,o){if(!afe.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=lfe(c,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:Or(r),isWordLike:a,kind:i,start:l}),i=d,r=[c],l=n+u,a=f,u+=c.length):(r.push(c),u+=c.length)}return i!==null&&s.push({text:Or(r),isWordLike:a,kind:i,start:l}),s}function Q9(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const dfe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function ffe(e,t){const n=e.texts[t];return!!n.startsWith("www.")||dfe.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function pfe(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const hfe=new Set([":","-","/","×",",",".","+","–","—"]),mfe=/[\p{P}\p{S}\p{Co}]/u,gfe=new RegExp("\\p{Emoji_Presentation}","u"),vfe=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function _$(e){const t=e.charCodeAt(0);return t<128?(function(n){return n>=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!vfe.has(e)&&!gfe.test(e)&&mfe.test(e)}function H_(e){let t=!1;for(const n of e)if(!ou.test(n)){if(!_$(n))return!1;t=!0}return t}function yfe(e,t,n,o){const s=!t&&H_(e),i=!o&&H_(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=pg(c,d),h=c.slice(f,d);if(!ou.test(h))return h;d=f}return null})(a);return u!==null&&hg(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=pg(a,u),d=a.slice(c,u);if(!ou.test(d))return _$(d)||hg(d);u=c}return!1})(e);return!!(s||i||l)&&!kl(e)&&!kl(n)&&(t||s||r)&&(o||i)}function z_(e){for(const t of e)if(y5.test(t))return!0;return!1}function rm(e){if(e.length===0)return!1;for(const t of e)if(!y5.test(t)&&!hfe.has(t))return!1;return!0}function kfe(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function bfe(e,t,n="normal",o="normal"){const s=(function(a){const u=a??"normal";return u==="pre-wrap"?{mode:u,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:u,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(n),i=s.mode==="pre-wrap"?(function(a){return/[\r\f]/.test(a)?a.replace(/\r\n/g,`
318
318
  `).replace(/[\r\f]/g,`
319
319
  `):a})(e):(function(a){if(!V1e.test(a))return a;let u=a.replace(j1e," ");return u.charCodeAt(0)===32&&(u=u.slice(1)),u.length>0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,f,h;const m=(J9===null&&(J9=new Intl.Segmenter(void 0,{granularity:"word"})),J9);let v=0;const k=[],w=[],b=[],_=[],g=[],x=[],S=[],T=[],A=[],E=[],P=[],D=[];for(const O of m.segment(a))for(const F of cfe(O.segment,(d=O.isWordLike)!=null&&d,O.index,c)){let U=function(){x[le]!==null&&(w[le]=[D_(k,x,S,le)],x[le]=null),w[le].push(F.text),b[le]=b[le]||F.isWordLike,T[le]=T[le]||K,A[le]=A[le]||V,E[le]=ne,P[le]=X,D[le]=B_(A[le],ie)};const z=F.kind==="text",W=sfe(F.text,F.isWordLike,F.kind),K=kl(F.text),V=O_(F.text),ie=tp(F.text),ne=a8(F.text),X=ife(F.text),le=v-1;u.carryCJKAfterClosingQuote&&z&&v>0&&_[le]==="text"&&K&&T[le]&&E[le]||z&&v>0&&_[le]==="text"&&Q1e(F.text)&&T[le]||z&&v>0&&_[le]==="text"&&P[le]?U():z&&v>0&&_[le]==="text"&&F.isWordLike&&V&&D[le]?(U(),b[le]=!0):W!==null&&v>0&&_[le]==="text"&&x[le]===W?S[le]=((f=S[le])!=null?f:1)+1:z&&!F.isWordLike&&v>0&&_[le]==="text"&&!T[le]&&(J1e(F.text)||F.text==="-"&&b[le])?U():(k[v]=F.text,w[v]=[F.text],b[v]=F.isWordLike,_[v]=F.kind,g[v]=F.start,x[v]=W,S[v]=W===null?0:1,T[v]=K,A[v]=V,E[v]=ne,P[v]=X,D[v]=B_(V,ie),v++)}for(let O=0;O<v;O++)x[O]===null?k[O]=Or(w[O]):k[O]=D_(k,x,S,O);for(let O=1;O<v;O++)_[O]!=="text"||b[O]||!C5(k[O])||_[O-1]!=="text"||T[O-1]||(k[O-1]+=k[O],b[O-1]=b[O-1]||b[O],k[O]="");const I=Array.from({length:v},()=>null);let $=-1;for(let O=v-1;O>=0;O--){const F=k[O];if(F.length!==0){if(_[O]==="text"&&!b[O]&&$>=0&&_[$]==="text"&&(efe(F)||F==="-"&&nfe(k[$]))){const U=(h=I[$])!=null?h:[];U.push(F),I[$]=U,g[$]=g[O],k[O]="";continue}$=O}}for(let O=0;O<v;O++){const F=I[O];F!=null&&(k[O]=ufe(F,k[O]))}let B=0;for(let O=0;O<v;O++){const F=k[O];F.length!==0&&(B!==O&&(k[B]=F,b[B]=b[O],_[B]=_[O],g[B]=g[O]),B++)}k.length=B,b.length=B,_.length=B,g.length=B;const H=(function(O){const F=O.texts.slice(),U=O.isWordLike.slice(),z=O.kinds.slice(),W=O.starts.slice();for(let K=0;K<F.length-1;K++){if(z[K]!=="text"||z[K+1]!=="text"||!kl(F[K])||!kl(F[K+1]))continue;const V=ofe(F[K]);V!==null&&(F[K]=V.head,F[K+1]=V.tail+F[K+1],W[K+1]=W[K]+V.head.length)}return{len:F.length,texts:F,isWordLike:U,kinds:z,starts:W}})((function(O){const F=[],U=[],z=[],W=[];let K=0;for(;K<O.len;){const V=O.texts[K],ie=O.kinds[K],ne=O.isWordLike[K];if(ie==="text"){const X=[V];let le=K+1,Ie=ne;for(;le<O.len&&O.kinds[le]==="text"&&yfe(O.texts[le-1],O.isWordLike[le-1],O.texts[le],O.isWordLike[le]);){const de=O.texts[le];X.push(de),Ie=Ie||O.isWordLike[le],le++}if(le>K+1){F.push(Or(X)),U.push(Ie),z.push("text"),W.push(O.starts[K]),K=le;continue}}F.push(V),U.push(ne),z.push(ie),W.push(O.starts[K]),K++}return{len:F.length,texts:F,isWordLike:U,kinds:z,starts:W}})((function(O){const F=[],U=[],z=[],W=[];for(let K=0;K<O.len;K++){const V=O.texts[K];if(O.kinds[K]==="text"&&V.includes("-")){const ie=V.split("-");let ne=ie.length>1;for(let X=0;X<ie.length;X++){const le=ie[X];if(!ne)break;le.length!==0&&z_(le)&&rm(le)||(ne=!1)}if(ne){let X=0;for(let le=0;le<ie.length;le++){const Ie=ie[le],de=le<ie.length-1?`${Ie}-`:Ie;F.push(de),U.push(!0),z.push("text"),W.push(O.starts[K]+X),X+=de.length}continue}}F.push(V),U.push(O.isWordLike[K]),z.push(O.kinds[K]),W.push(O.starts[K])}return{len:F.length,texts:F,isWordLike:U,kinds:z,starts:W}})((function(O){const F=[],U=[],z=[],W=[];for(let K=0;K<O.len;K++){const V=O.texts[K],ie=O.kinds[K];if(ie==="text"&&rm(V)&&z_(V)){const ne=[V];let X=K+1;for(;X<O.len&&O.kinds[X]==="text"&&rm(O.texts[X]);)ne.push(O.texts[X]),X++;F.push(Or(ne)),U.push(!0),z.push("text"),W.push(O.starts[K]),K=X-1;continue}F.push(V),U.push(O.isWordLike[K]),z.push(ie),W.push(O.starts[K])}return{len:F.length,texts:F,isWordLike:U,kinds:z,starts:W}})((function(O){const F=[],U=[],z=[],W=[];for(let K=0;K<O.len;K++){const V=O.texts[K];if(F.push(V),U.push(O.isWordLike[K]),z.push(O.kinds[K]),W.push(O.starts[K]),!pfe(V))continue;const ie=K+1;if(ie>=O.len||Q9(O.kinds[ie]))continue;const ne=[],X=O.starts[ie];let le=ie;for(;le<O.len&&!Q9(O.kinds[le]);)ne.push(O.texts[le]),le++;ne.length>0&&(F.push(Or(ne)),U.push(!0),z.push("text"),W.push(X),K=le-1)}return{len:F.length,texts:F,isWordLike:U,kinds:z,starts:W}})((function(O){const F=O.texts.slice(),U=O.isWordLike.slice(),z=O.kinds.slice(),W=O.starts.slice();for(let V=0;V<O.len;V++){if(z[V]!=="text"||!ffe(O,V))continue;const ie=[F[V]];let ne=V+1;for(;ne<O.len&&!Q9(z[ne]);){ie.push(F[ne]),U[V]=!0;const X=F[ne].includes("?");if(z[ne]="text",F[ne]="",ne++,X)break}F[V]=Or(ie)}let K=0;for(let V=0;V<F.length;V++){const ie=F[V];ie.length!==0&&(K!==V&&(F[K]=ie,U[K]=U[V],z[K]=z[V],W[K]=W[V]),K++)}return F.length=K,U.length=K,z.length=K,W.length=K,{len:K,texts:F,isWordLike:U,kinds:z,starts:W}})((function(O){const F=[],U=[],z=[],W=[];let K=0;for(;K<O.len;){const V=[O.texts[K]];let ie=O.isWordLike[K],ne=O.kinds[K],X=O.starts[K];if(ne==="glue"){const le=[V[0]],Ie=X;for(K++;K<O.len&&O.kinds[K]==="glue";)le.push(O.texts[K]),K++;const de=Or(le);if(!(K<O.len&&O.kinds[K]==="text")){F.push(de),U.push(!1),z.push("glue"),W.push(Ie);continue}V[0]=de,V.push(O.texts[K]),ie=O.isWordLike[K],ne="text",X=Ie,K++}else K++;if(ne==="text")for(;K<O.len&&O.kinds[K]==="glue";){const le=[];for(;K<O.len&&O.kinds[K]==="glue";)le.push(O.texts[K]),K++;const Ie=Or(le);K<O.len&&O.kinds[K]==="text"?(V.push(Ie,O.texts[K]),ie=ie||O.isWordLike[K],K++):V.push(Ie)}F.push(Or(V)),U.push(ie),z.push(ne),W.push(X)}return{len:F.length,texts:F,isWordLike:U,kinds:z,starts:W}})({len:B,texts:k,isWordLike:b,kinds:_,starts:g})))))));for(let O=0;O<H.len-1;O++){const F=rfe(H.texts[O]);F!==null&&(H.kinds[O]!=="space"&&H.kinds[O]!=="preserved-space"||H.kinds[O+1]!=="text"||!O_(H.texts[O+1])||(H.texts[O]=F.space,H.isWordLike[O]=!1,H.kinds[O]=H.kinds[O]==="preserved-space"?"preserved-space":"space",H.texts[O+1]=F.marks+H.texts[O+1],H.starts[O+1]=H.starts[O]+F.space.length))}return H})(i,t,s),l=o==="keep-all"?(function(a,u,c){if(u.len<=1)return u;const d=[],f=[],h=[],m=[];let v=-1,k=!1;function w(_){d.push(u.texts[_]),f.push(u.isWordLike[_]),h.push("text"),m.push(u.starts[_])}function b(_){if(!(v<0)){if(k)v+1===_?w(v):(function(g,x){let S=!1;for(let E=g;E<x;E++)S=S||u.isWordLike[E];const T=u.starts[g],A=x<u.len?u.starts[x]:a.length;d.push(a.slice(T,A)),f.push(S),h.push("text"),m.push(T)})(v,_);else for(let g=v;g<_;g++)w(g);v=-1,k=!1}}for(let _=0;_<u.len;_++){const g=u.texts[_],x=u.kinds[_];x!=="text"?(b(_),d.push(g),f.push(u.isWordLike[_]),h.push(x),m.push(u.starts[_])):(v>=0&&!w$(u.texts[_-1],c)&&b(_),v<0&&(v=_),k=k||kl(g))}return b(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(i,r,t.breakKeepAllAfterPunctuation):r;return mt({normalized:i,chunks:kfe(l,s)},l)}let ld=null;const W_=new Map;let ad=null;const Cfe=new RegExp("\\p{Emoji_Presentation}","u"),wfe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let e4=null;const U_=new Map;function u8(){if(ld!==null)return ld;if(typeof OffscreenCanvas<"u")return ld=new OffscreenCanvas(1,1).getContext("2d"),ld;if(typeof document<"u")return ld=document.createElement("canvas").getContext("2d"),ld;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Sa(e,t){let n=t.get(e);return n===void 0&&(n={width:u8().measureText(e).width,containsCJK:kl(e)},t.set(e,n)),n}function mg(){if(ad!==null)return ad;if(typeof navigator>"u")return ad={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ad;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return ad={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},ad}function x$(){return e4===null&&(e4=new Intl.Segmenter(void 0,{granularity:"grapheme"})),e4}function _fe(e){return Cfe.test(e)||e.includes("️")}function Ou(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=x$();for(const a of l.segment(i))_fe(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function xfe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function j_(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function V_(e,t,n=e.widths.length){for(;t<n&&xfe(e.kinds[t]);)t++;return t}function Sfe(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Afe(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function w5(e,t){return t===0?0:e+t}function Mfe(e,t,n,o,s){return w5(o,t==="tab"?s+(function(i,r){return i.letterSpacing!==0&&i.spacingGraphemeCounts[r]>0?i.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function q_(e,t,n,o){return w5(o,t==="tab"?0:e.lineEndFitAdvances[n])}function K_(e,t,n,o,s){return w5(o,t==="tab"?s:e.lineEndPaintAdvances[n])}function Tfe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Efe(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function wh(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function Ife(e,t){return(function(n,o){if(n.simpleLineWalkFastPath)return(function(I,$){const{widths:B,kinds:H,breakableFitAdvances:O,breakablePreferredBreaks:F}=I;if(B.length===0)return 0;const U=$+mg().lineFitEpsilon;let z=0,W=0,K=!1,V=0,ie=0,ne=-1,X=0;function le(ye=V,G=ie,Y=W){z++,W=0,K=!1,ne=-1,X=0}function Ie(ye,G){K=!0,V=ye+1,ie=0,W=G}function de(ye,G,Y){K=!0,V=ye,ie=G+1,W=Y}function pe(ye,G){K?(W+=G,V=ye+1,ie=0):Ie(ye,G)}function ve(ye,G){var Y;const fe=O[ye],we=(Y=F[ye])!=null?Y:null;let ge=we===null?-1:wh(we,0,G+1),Q=-1,te=0,ce=G;for(;ce<fe.length;){const ue=fe[ce];if(K)if(W+ue>U){if(we!==null&&Q>G){le(ye,Q,te),ce=Q,ge=wh(we,ge,ce+1),Q=-1,te=0;continue}le(),de(ye,ce,ue)}else W+=ue,V=ye,ie=ce+1;else de(ye,ce,ue);const Se=ce+1;we!==null&&we[ge]===Se&&(Q=Se,te=W,ge++),ce++}K&&V===ye&&ie===fe.length&&(V=ye+1,ie=0)}let oe=0;for(;oe<B.length&&(K||(oe=V_(I,oe),!(oe>=B.length)));){const ye=B[oe],G=j_(H[oe]);if(K)if(W+ye>U){if(G){pe(oe,ye),le(oe+1,0,W-ye),oe++;continue}if(ne>=0){if(V>ne||V===ne&&ie>0){le();continue}le(ne,0,X);continue}if(ye>U&&O[oe]!==null){le(),ve(oe,0),oe++;continue}le()}else pe(oe,ye),G&&(ne=oe+1,X=W-ye),oe++;else ye>U&&O[oe]!==null?ve(oe,0):Ie(oe,ye),G&&(ne=oe+1,X=W-ye),oe++}return K&&le(),z})(n,o);const{widths:s,kinds:i,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(s.length===0||u.length===0)return 0;const c=mg(),d=o+c.lineFitEpsilon;let f=0,h=0,m=!1,v=0,k=0,w=-1,b=0,_=null;function g(){w=-1,b=0,_=null}function x(I=v,$=k,B){f++,h=0,m=!1,g()}function S(I,$){m=!0,v=I+1,k=0,h=$}function T(I,$,B){m=!0,v=I,k=$+1,h=B}function A(I,$){m?(h+=$,v=I+1,k=0):S(I,$)}function E(I,$,B,H,O,F){if(!$)return;const U=q_(n,I,B,O);K_(n,I,B,O,H),w=B+1,b=h-F+U,_=I}function P(I,$){var B;const H=r[I],O=(B=l[I])!=null?B:null;let F=O===null?-1:wh(O,0,$+1),U=-1,z=$;for(;z<H.length;){const W=H[z];if(m){const V=Tfe(n,!0,W),ie=h+V;if(Efe(n,ie)>d){if(O!==null&&U>$){x(I,U),z=U,F=wh(O,F,z+1),U=-1;continue}x(),T(I,z,W)}else h=ie,v=I,k=z+1}else T(I,z,W);const K=z+1;O!==null&&O[F]===K&&(U=K,F++),z++}m&&v===I&&k===H.length&&(v=I+1,k=0)}function D(I){f++,g()}for(let I=0;I<u.length;I++){const $=u[I];if($.startSegmentIndex===$.endSegmentIndex){D();continue}m=!1,h=0,$.startSegmentIndex,v=$.startSegmentIndex,k=0,g();let B=$.startSegmentIndex;for(;B<$.endSegmentIndex&&(m||(B=V_(n,B,$.endSegmentIndex),!(B>=$.endSegmentIndex)));){const H=i[B],O=j_(H),F=Afe(n,m,B),U=H==="tab"?Sfe(h+F,n.tabStopAdvance):s[B],z=F+U,W=Mfe(n,H,B,F,U);if(H!=="soft-hyphen")if(m){if(h+W>d){const K=h+q_(n,H,B,F);if(K_(n,H,B,F,U),_==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){x(w,0);continue}if(O&&K<=d){A(B,z),x(B+1,0),B++;continue}if(w>=0&&b<=d){if(v>w||v===w&&k>0){x();continue}const V=w;x(V,0),B=V;continue}if(W>d&&r[B]!==null){x(),P(B,0),B++;continue}x();continue}A(B,z),E(H,O,B,U,F,z),B++}else W>d&&r[B]!==null?P(B,0):S(B,U),E(H,O,B,U,F,z),B++;else m&&(v=B+1,k=0,w=B+1,b=h+a,_=H),B++}m&&($.consumedEndSegmentIndex,x($.consumedEndSegmentIndex,0))}return f})(e,t)}let t4=null;function _5(){return t4===null&&(t4=new Intl.Segmenter(void 0,{granularity:"grapheme"})),t4}function Lfe(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function u(d,f,h){o=[d],s=f,i=h,r=a8(d),l=$2.has(d)}function c(d,f){o.push(d),i=i||f;const h=a8(d);r=d.length===1&&bc.has(d)&&r||h,l=!1}for(const d of _5().segment(e)){const f=d.segment,h=kl(f);o.length!==0?l||k5.has(f)||bc.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):i||h?(a(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return a(),n}function $fe(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(l){if(!(s<0)){if(i)s+1===l?o.push(t[s]):(function(a,u){const c=t[a].start,d=u<t.length?t[u].start:e.length;o.push({text:e.slice(c,d),start:c})})(s,l);else for(let a=s;a<l;a++)o.push(t[a]);s=-1,i=!1}}for(let l=0;l<t.length;l++){const a=t[l];s>=0&&!w$(t[l-1].text,n)&&r(l),s<0&&(s=l),i=i||kl(a.text)}return r(t.length),o}function Z_(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=_5();for(const s of o.segment(e))n++;return n}function Nfe(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Ffe(e,t,n,o,s){const i=mg(),{cache:r,emojiCorrection:l}=(function(D,I){u8().font=D;const $=(function(O){let F=W_.get(O);return F||(F=new Map,W_.set(O,F)),F})(D),B=(function(O){const F=O.match(/(\d+(?:\.\d+)?)\s*px/);return F?parseFloat(F[1]):16})(D),H=I?(function(O,F){let U=U_.get(O);if(U!==void 0)return U;const z=u8();z.font=O;const W=z.measureText("😀").width;if(U=0,W>F+.5&&typeof document<"u"&&document.body!==null){const K=document.createElement("span");K.style.font=O,K.style.display="inline-block",K.style.visibility="hidden",K.style.position="absolute",K.textContent="😀",document.body.appendChild(K);const V=K.getBoundingClientRect().width;document.body.removeChild(K),W-V>.5&&(U=W-V)}return U_.set(O,U),U})(D,B):0;return{cache:$,fontSize:B,emojiCorrection:H}})(t,(a=e.normalized,wfe.test(a)));var a;const u=Ou("-",Sa("-",r),l)+(s===0?0:2*s),c=8*Ou(" ",Sa(" ",r),l),d=s!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],m=[],v=[];let k=e.chunks.length<=1&&!d;const w=null,b=[],_=[],g=[],x=null,S=Array.from({length:e.len});function T(D,I,$,B,H,O,F,U,z){H!=="text"&&H!=="space"&&H!=="zero-width-break"&&(k=!1),f.push(I),h.push($),m.push(B),v.push(H),b.push(F),_.push(U),d&&g.push(z)}function A(D,I,$,B,H){const O=Sa(D,r),F=d?Z_(D,I):0,U=(function(V,ie,ne){return ie>1?V+(ie-1)*ne:V})(Ou(D,O,l),F,s),z=I==="space"||I==="preserved-space"||I==="zero-width-break"?0:U,W=z===0?0:z+(F>0?s:0),K=I==="space"||I==="zero-width-break"?0:U;if(H&&B&&D.length>1){let V="sum-graphemes";s!==0?V="segment-prefixes":rm(D)?V="pair-context":i.preferPrefixWidthsForBreakableRuns&&(V="segment-prefixes");const ie=(function(X,le,Ie,de,pe){if(le.breakableFitAdvances!==void 0&&le.breakableFitMode===pe)return le.breakableFitAdvances;le.breakableFitMode=pe;const ve=x$(),oe=[];for(const fe of ve.segment(X))oe.push(fe.segment);if(oe.length<=1)return le.breakableFitAdvances=null,le.breakableFitAdvances;if(pe==="sum-graphemes"){const fe=[];for(const we of oe){const ge=Sa(we,Ie);fe.push(Ou(we,ge,de))}return le.breakableFitAdvances=fe,le.breakableFitAdvances}if(pe==="pair-context"||oe.length>96){const fe=[];let we=null,ge=0;for(const Q of oe){const te=Ou(Q,Sa(Q,Ie),de);if(we===null)fe.push(te);else{const ce=we+Q,ue=Sa(ce,Ie);fe.push(Ou(ce,ue,de)-ge)}we=Q,ge=te}return le.breakableFitAdvances=fe,le.breakableFitAdvances}const ye=[];let G="",Y=0;for(const fe of oe){G+=fe;const we=Ou(G,Sa(G,Ie),de);ye.push(we-Y),Y=we}return le.breakableFitAdvances=ye,le.breakableFitAdvances})(D,O,r,l,V),ne=ie===null||o==="keep-all"?null:(function(X){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(X))return null;const le=[];let Ie=0;for(const de of _5().segment(X))Ie++,Nfe(de.segment)&&le.push(Ie);return le.length===0?null:le})(D);return void T(D,U,W,K,I,$,ie,ne,F)}T(D,U,W,K,I,$,null,null,F)}for(let D=0;D<e.len;D++){S[D]=f.length;const I=e.texts[D],$=e.isWordLike[D],B=e.kinds[D],H=e.starts[D];if(B==="soft-hyphen"){T(I,0,u,u,B,H,null,null,0);continue}if(B==="hard-break"){T(I,0,0,0,B,H,null,null,0);continue}if(B==="tab"){T(I,0,0,0,B,H,null,null,d?Z_(I,B):0);continue}const O=Sa(I,r);if(B==="text"&&O.containsCJK){const F=Lfe(I,i),U=o==="keep-all"?$fe(I,F,i.breakKeepAllAfterPunctuation):F;for(let z=0;z<U.length;z++){const W=U[z];A(W.text,"text",H+W.start,$,o==="keep-all"||!kl(W.text))}continue}A(I,B,H,$,!0)}const E=(function(D,I,$){const B=[];for(let H=0;H<D.length;H++){const O=D[H],F=O.startSegmentIndex<I.length?I[O.startSegmentIndex]:$,U=O.endSegmentIndex<I.length?I[O.endSegmentIndex]:$,z=O.consumedEndSegmentIndex<I.length?I[O.consumedEndSegmentIndex]:$;B.push({startSegmentIndex:F,endSegmentIndex:U,consumedEndSegmentIndex:z})}return B})(e.chunks,S,f.length),P=w===null?null:(function(D,I){const $=(function(H){const O=H.length;if(O===0)return null;const F=new Array(O);let U=!1;for(let ne=0;ne<O;){const X=H.charCodeAt(ne);let le=X,Ie=1;if(X>=55296&&X<=56319&&ne+1<O){const pe=H.charCodeAt(ne+1);pe>=56320&&pe<=57343&&(le=pe-56320+(X-55296<<10)+65536,Ie=2)}const de=U1e(le);de!=="R"&&de!=="AL"&&de!=="AN"||(U=!0);for(let pe=0;pe<Ie;pe++)F[ne+pe]=de;ne+=Ie}if(!U)return null;let z=0;for(let ne=0;ne<O;ne++){const X=F[ne];if(X==="L"){z=0;break}if(X==="R"||X==="AL"){z=1;break}}const W=new Int8Array(O);for(let ne=0;ne<O;ne++)W[ne]=z;const K=1&z?"R":"L",V=K;let ie=V;for(let ne=0;ne<O;ne++)F[ne]==="NSM"?F[ne]=ie:ie=F[ne];ie=V;for(let ne=0;ne<O;ne++){const X=F[ne];X==="EN"?F[ne]=ie==="AL"?"AN":"EN":X!=="R"&&X!=="L"&&X!=="AL"||(ie=X)}for(let ne=0;ne<O;ne++)F[ne]==="AL"&&(F[ne]="R");for(let ne=1;ne<O-1;ne++)F[ne]==="ES"&&F[ne-1]==="EN"&&F[ne+1]==="EN"&&(F[ne]="EN"),F[ne]!=="CS"||F[ne-1]!=="EN"&&F[ne-1]!=="AN"||F[ne+1]!==F[ne-1]||(F[ne]=F[ne-1]);for(let ne=0;ne<O;ne++){if(F[ne]!=="EN")continue;let X;for(X=ne-1;X>=0&&F[X]==="ET";X--)F[X]="EN";for(X=ne+1;X<O&&F[X]==="ET";X++)F[X]="EN"}for(let ne=0;ne<O;ne++){const X=F[ne];X!=="WS"&&X!=="ES"&&X!=="ET"&&X!=="CS"||(F[ne]="ON")}ie=V;for(let ne=0;ne<O;ne++){const X=F[ne];X==="EN"?F[ne]=ie==="L"?"L":"EN":X!=="R"&&X!=="L"||(ie=X)}for(let ne=0;ne<O;ne++){if(F[ne]!=="ON")continue;let X=ne+1;for(;X<O&&F[X]==="ON";)X++;const le=(ne>0?F[ne-1]:V)!=="L"?"R":"L";if(le===((X<O?F[X]:V)!=="L"?"R":"L"))for(let Ie=ne;Ie<X;Ie++)F[Ie]=le;ne=X-1}for(let ne=0;ne<O;ne++)F[ne]==="ON"&&(F[ne]=K);for(let ne=0;ne<O;ne++){const X=F[ne];1&W[ne]?X!=="L"&&X!=="AN"&&X!=="EN"||W[ne]++:X==="R"?W[ne]++:X!=="AN"&&X!=="EN"||(W[ne]+=2)}return W})(D);if($===null)return null;const B=new Int8Array(I.length);for(let H=0;H<I.length;H++)B[H]=$[I[H]];return B})(e.normalized,w);return x!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:m,kinds:v,simpleLineWalkFastPath:k,segLevels:P,breakableFitAdvances:b,breakablePreferredBreaks:_,letterSpacing:s,spacingGraphemeCounts:g,discretionaryHyphenWidth:u,tabStopAdvance:c,chunks:E,segments:x}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:m,kinds:v,simpleLineWalkFastPath:k,segLevels:P,breakableFitAdvances:b,breakablePreferredBreaks:_,letterSpacing:s,spacingGraphemeCounts:g,discretionaryHyphenWidth:u,tabStopAdvance:c,chunks:E}}const n4="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Rfe=["diff ","index ","--- ","+++ ","@@ "],ys=(()=>{const e=globalThis;if(e[n4])return e[n4];const t={configs:{},controllers:{},revision:Xr(0),preparedCache:new Map,blockEstimateCache:new Map};return e[n4]=t,t})();let lf=null;const o4=ys.revision;function G_(e){var t;return e&&(t=ys.configs[e])!=null?t:null}function Y_(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Ofe(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function s4(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!Ofe(i))return null;i.type==="text"?s+=String((t=i.content)!=null?t:""):i.type==="emoji"?s+=String((o=(n=i.name)!=null?n:i.raw)!=null?o:""):i.type==="hardbreak"&&(s+=`
@@ -321,14 +321,14 @@ ${_}`);c+=T}else c+=S;c+=w,d=h?f+1:e.length}return c}function Yue(e,t){if(!e||!t
321
321
  `,t-1)+1;return e.slice(n,t).trim()}function lx(e){const t=I$(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function I$(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function L$(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function x5(e){const t=String(e??"");return`${t.length}:${L$(t)}`}function d8(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?x5(r):`${r.length}:${L$(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Qi(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${Qi(o)}`;const i=Qi(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>d8(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(u=>`${u}:${d8(r[u],t,n+1)}`).join(";")}`}return typeof e}function gg(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function $$(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>gg(o)?su(o,t,n+1):$$(o,t,n+1)).join(",")}`:gg(e)?su(e,t,n):d8(e,t,n)}function Kfe(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!E$.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${x5(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${Qi(s)}`:Vfe.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${$$(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${Qi(s)}`:""}).filter(Boolean).join(";")}function Zfe(e){return E$.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${x5(n)}`:""}).filter(Boolean).join(";")}function su(e,t=new WeakMap,n=0){const o=ox.get(e);if(o)return o;const s=e,i=t.get(s);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${Qi(s)}`;const r=Qi(s);t.set(s,r);const l=(function(a,u,c){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(m=>su(m,u,c+1)).join("|"):"";return[a.type,Zfe(d),Kfe(d,u,c),f.length,h].join(":")})(e,t,n);return ox.set(s,l),l}function N$(e,t){return su(e)===su(t)}function S5(e,t,n){const o=Rr(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Rr()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function ax(e,t,n){return S5(t,n,()=>su(e))}function F$(e,t,n){return ax(e,n,"stabilizeSignatureMs")===ax(t,n,"stabilizeSignatureMs")}function _h(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function ux(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function cx(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function Gfe(e,t){return e.length===t.length&&e===t}function A5(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(s).filter(c=>c!=="type"&&c!=="children").sort();if(i.length!==r.length)return!1;for(let c=0;c<i.length;c++){const d=i[c];if(d!==r[c])return!1;const f=o[d],h=s[d];if(typeof f!=typeof h)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,h))return!1}else if(typeof h!="string"||!Gfe(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,u=s.children;if(!Array.isArray(a)||!Array.isArray(u))return null;if(a.length!==u.length)return!1;for(let c=0;c<a.length;c++){const d=a[c],f=u[c];if(!gg(d)||!gg(f))return null;const h=A5(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function Yfe(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=A5(e,t);return n??N$(e,t)}function Xfe(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return S5(n,"stabilizeSignatureMs",()=>{o=A5(e,t)}),o??F$(e,t,n)}function Jfe(e,t){const n={};for(const o of Ufe){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function Qfe(e,t){var n;const o=l_(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:R(()=>!1),r=Z(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let B="",H=0,O=!1,F=!1,U=!1,z=!1;function W(){B="",H=0,O=!1,F=!1,U=!1,z=!1}function K(V){let ie=!1;for(let ne=0;ne<V.length;ne++){const X=V.charCodeAt(ne);if(X===10||X===13){const Ie=X===10&&z;z=X===13,O=!1,Ie||(U||(F=!1,H=0),U=!1);continue}z=!1;const le=X===9||X===32;if(le||(U=!0,F&&(ie=!0)),H)if(H!==1)le||(X!==58?H=X===91?1:0:(ie=!0,F=!0));else{if(O){O=!1;continue}if(X===92){O=!0;continue}X===93&&(H=2)}else X===91&&(H=1)}return ie}return(V,ie)=>{if(!V||!ie.startsWith(V)||ie.length<=V.length)return W(),[!0,0];let ne=0;B!==V&&(W(),K(V),ne=V.length);const X=ie.slice(V.length),le=K(X);return B=ie,[le,ne+X.length]}})();let h,m=0,v=0,k=Rr(),w=-1,b=0;function _(B){w=Number.isInteger(B)?B:0,b+=1}function g(){h&&(clearTimeout(h),h=void 0)}function x(){g();const B=t.renderContent.value;r.value!==B&&(r.value=B),k=Rr()}Je([t.renderContent,t.effectiveFinal,i],([B,H,O])=>{r.value!==B&&(!O||H||(function(F,U){if(!F&&U||U.length<=80||U.length<F.length||!U.startsWith(F))return!0;const z=U.slice(F.length);return!!z&&(!!lx(rx(U))||!(!z.includes(`
322
322
 
323
323
  `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(z))||z.endsWith(`
324
- `)&&!(function(W){const K=rx(W);if(lx(K))return!1;const V=I$(K);return V.length>=2&&V.some(ie=>ie.trim())})(U))})(r.value,B)?x():(function(){if(v+=1,h)return;const F=Math.max(0,(function(U){const z=U.parseCoalesceMs;return typeof z=="number"&&Number.isFinite(z)&&z>=0?z:80})(e)-(Rr()-k));F<=0?x():h=setTimeout(x,F)})())},{flush:"sync",immediate:!0}),d1(g);const S=R(()=>{var B,H,O,F;return cie(e.customHtmlTags,(B=e.parseOptions)==null?void 0:B.customHtmlTags,(F=(O=(H=t.customComponentsMap)==null?void 0:H.value)!=null?O:{},Object.entries(F).map(([U,z])=>{const W=Sr(U);return z==null||!W||Qp(W)||WI.has(W)||Zp.has(W)?"":W}).filter(Boolean)))}),T=R(()=>{const{key:B,tags:H}=die(S.value);if(!B)return o;const O=s.get(B);if(O)return O;const F=l_(t.instanceMsgId,{customHtmlTags:H});return s.set(B,F),F}),A=R(()=>{const B=T.value;if(!e.customMarkdownIt)return B;const H=e.customMarkdownIt(B);return B.__markstreamHasCustomParserExtensions=!0,H.__markstreamHasCustomParserExtensions=!0,H}),E=R(()=>{var B,H;const O=(B=e.parseOptions)!=null?B:{},F=t.effectiveFinal.value,U=S.value,z=F!=null,W=U.length>0;return z||W||O.streamParse==null?mt(mt(rn(mt({},O),{streamParse:(H=O.streamParse)==null||H}),z?{final:F}:{}),W?{customHtmlTags:U}:{}):O}),P=R(()=>{var B;return new Set(((B=E.value.customHtmlTags)!=null?B:[]).map(H=>String(H).trim().toLowerCase()).filter(Boolean))}),D=R(()=>ix(E.value,A.value,e.customMarkdownIt,{includeFinal:!0})),I=R(()=>ix(E.value,A.value,e.customMarkdownIt,{includeFinal:!1}));Je([D,I],([B,H],[O,F])=>{O&&(B===O&&H===F||(x(),H!==F&&(l=[],c="")))},{flush:"sync"});const $=R(()=>{var B,H,O,F,U,z,W,K,V,ie,ne;if((B=e.nodes)!=null&&B.length)return l=[],c="",_(0),kt(e.nodes.slice());const X=r.value;if(!X)return l=[],c="",_(-1),[];const le=t.debugPerformanceEnabled.value,Ie=le?Rr():0,de=A.value,pe=D.value,ve=I.value;a&&pe!==a&&(function(Fe){var Oe,Ge;(Ge=(Oe=Fe.stream)==null?void 0:Oe.reset)==null||Ge.call(Oe)})(de),u&&ve!==u&&(l=[],c="");const oe=Object.keys((O=(H=t.customComponentsMap)==null?void 0:H.value)!=null?O:{}).length>0||typeof E.value.postTransformNodes=="function";oe!==d&&(l=[],c="");const ye=!oe&&l.length>0&&X.startsWith(c)&&ve===u,G=le?sx(de):null,Y=le?{}:void 0,fe=cx(de),we=!fe&&!oe,ge=mt(mt(rn(mt({},E.value),{__reuseStableTopLevelNodes:we}),fe?{__disableStreamParse:!0}:{}),Y?{__timing:Y}:{}),Q=UL(X,de,ge),te=le?Rr():0,ce=le?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ue,Se=le?_h(Q.length):void 0,ze=0,_e=0,Ee=0;if(ye){const Fe=le?Rr():0,[Oe,Ge]=(function(Tt){var Bt,Yt;const[Sn,on]=Tt.scanGlobalReferenceAppend(Tt.previousContent,Tt.content),en=Tt.parseOptions;return[Tt.previousDirtyStartIndex>0&&en.final!==!0&&!Tt.customMarkdownIt&&!cx(Tt.md)&&!Sn&&typeof en.preTransformTokens!="function"&&typeof en.postTransformTokens!="function"&&typeof en.postTransformNodes!="function"&&((Yt=(Bt=en.customHtmlTags)==null?void 0:Bt.length)!=null?Yt:0)===0?Tt.previousDirtyStartIndex:0,on]})({content:X,previousContent:c,previousDirtyStartIndex:w,parseOptions:E.value,customMarkdownIt:e.customMarkdownIt,md:de,scanGlobalReferenceAppend:f});Ee=Ge;const at=Oe<=0;if(ce){const Tt=(function(Bt,Yt,Sn,on={}){var en;if(!Yt.length)return{nodes:Bt,metrics:_h(Bt.length)};const Cn=(en=on.scanStartIndex)!=null?en:0,Mn=on.reuseDirtyTail!==!1,We=(function(Lt,gt,wn,yn=0){const go=Math.min(Lt.length,gt.length);for(let qt=Math.min(go,Math.max(0,yn));qt<go;qt++)if(!Xfe(gt[qt],Lt[qt],wn))return qt;return Lt.length===gt.length?-1:go})(Bt,Yt,Sn,Cn);if(We<0)return{nodes:Yt,metrics:{reusedNodeCount:Bt.length,dirtyStartIndex:We,stablePrefixNodeCount:Bt.length,dirtyTailNodeCount:0}};const tt=Bt.slice();let Ue=We;for(let Lt=0;Lt<We;Lt++)tt[Lt]=Yt[Lt];if(Mn)for(let Lt=We;Lt<Bt.length;Lt++){const gt=Yt[Lt],wn=Bt[Lt];gt&&F$(gt,wn,Sn)&&(tt[Lt]=gt,Ue+=1)}return{nodes:tt,metrics:{reusedNodeCount:Ue,dirtyStartIndex:We,stablePrefixNodeCount:We,dirtyTailNodeCount:ux(We,Bt,Yt)}}})(Q,l,ce,{reuseDirtyTail:at,scanStartIndex:Oe});ue=Tt.nodes,Se=Tt.metrics}else{const Tt=(function(Bt,Yt,Sn={}){var on;if(!Yt.length)return{nodes:Bt,metrics:_h(Bt.length)};const en=(on=Sn.scanStartIndex)!=null?on:0,Cn=Sn.reuseDirtyTail!==!1,Mn=(function(Ue,Lt,gt=0){const wn=Math.min(Ue.length,Lt.length);for(let yn=Math.min(wn,Math.max(0,gt));yn<wn;yn++)if(!Yfe(Lt[yn],Ue[yn]))return yn;return Ue.length===Lt.length?-1:wn})(Bt,Yt,en);if(Mn<0)return{nodes:Yt,metrics:{reusedNodeCount:Bt.length,dirtyStartIndex:Mn,stablePrefixNodeCount:Bt.length,dirtyTailNodeCount:0}};const We=Bt.slice();let tt=Mn;for(let Ue=0;Ue<Mn;Ue++)We[Ue]=Yt[Ue];if(Cn)for(let Ue=Mn;Ue<Bt.length;Ue++){const Lt=Yt[Ue],gt=Bt[Ue];Lt&&N$(Lt,gt)&&(We[Ue]=Lt,tt+=1)}return{nodes:We,metrics:{reusedNodeCount:tt,dirtyStartIndex:Mn,stablePrefixNodeCount:Mn,dirtyTailNodeCount:ux(Mn,Bt,Yt)}}})(Q,l,{reuseDirtyTail:at,scanStartIndex:Oe});ue=Tt.nodes,Se=Tt.metrics}ze=le?Rr()-Fe:0,_e=at?Se?.dirtyStartIndex==null||Se.dirtyStartIndex<0?ue.length:Se.dirtyStartIndex:ue.length}else ue=Q,Se=_h(ue.length);t.effectiveFinal.value!==!0&&(ce?(function(Fe,Oe,Ge=0){for(let at=Math.max(0,Ge);at<Fe.length;at++)S5(Oe,"primeSignatureMs",()=>su(Fe[at]))})(ue,ce,_e):(function(Fe,Oe=0){for(let Ge=Math.max(0,Oe);Ge<Fe.length;Ge++)su(Fe[Ge])})(ue,_e));const it=le?Rr()-te:0;if(m+=1,c=X,a=pe,u=ve,d=oe,l=ue,_((F=Se?.dirtyStartIndex)!=null?F:0),le){const Fe=sx(de),Oe=typeof Fe?.total=="number"&&Fe.total>((U=G?.total)!=null?U:0);t.logPerf(Oe?"parse(stream)":"parse(sync)",mt(mt(mt({rendererId:t.instanceMsgId,ms:Math.round(Rr()-Ie),nodes:ue.length,contentLength:X.length,parseCommitCount:m,parseCoalescedCount:v,nodeReuseMs:it,referenceDefinitionScanChars:Ee,signatureMs:(z=ce?.signatureMs)!=null?z:0,stabilizeSignatureMs:(W=ce?.stabilizeSignatureMs)!=null?W:0,primeSignatureMs:(K=ce?.primeSignatureMs)!=null?K:0,signatureCallCount:(V=ce?.signatureCallCount)!=null?V:0,stabilizeSignatureCallCount:(ie=ce?.stabilizeSignatureCallCount)!=null?ie:0,primeSignatureCallCount:(ne=ce?.primeSignatureCallCount)!=null?ne:0,stabilizeMs:ze},Se??{}),Y?Object.fromEntries(jfe.map(Ge=>{var at;return[Ge,(at=Y[Ge])!=null?at:0]})):{}),Fe?{streamMode:Fe.lastMode,streamDelta:Jfe(Fe,G),streamStats:Fe}:{}))}return kt(ue)});return{effectiveCustomHtmlTags:S,effectiveCustomHtmlTagsSet:P,mdBase:T,mdInstance:A,mergedParseOptions:E,getParsedNodesDirtyStartIndex:()=>w,getParsedNodesRevision:()=>b,parsedNodes:$}}function epe(e){const{isClient:t}=e,n=Z(new Set),o=new Map,s=new Map,i=new Map;function r(u){if(!t)return;const c=i.get(u);c!=null&&(window.clearTimeout(c),i.delete(u))}function l(){if(t)for(const u of i.values())window.clearTimeout(u);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((v=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!v)return;var m,v;const k=n.value,w=k.has(f);if(h){if(w)return;const _=new Set(k);return _.add(f),void(n.value=_)}if(!w)return;const b=new Set(k);b.delete(f),n.value=b})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of s.entries())f<u||(h(),s.delete(f));for(const[f,h]of o.entries())f<u||(h.destroy(),o.delete(f),r(f),(c=e.onNodeVisibilityCleaned)==null||c.call(e,f));for(const f of Array.from(i.keys()))f<u||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<u&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const u of s.values())u();s.clear();for(const u of o.values())u.destroy();o.clear(),l()}}}function tpe(e={}){const t=Z(""),n=Z(""),o=Z(!1),s=Nce(e),i=()=>{const c=s.getSnapshot();t.value=c.source,n.value=c.visible,o.value=c.done},r=s.subscribe(i);i();const l=R(()=>Math.max(0,t.value.length-n.value.length)),a=R(()=>l.value===0),u=R(()=>o.value&&a.value);return Kg()&&d1(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:u,caughtUp:a,pendingChars:l,enqueue:c=>s.enqueue(c),finish:c=>s.finish(c),flush:()=>s.flush(),reset:c=>s.reset(c),pause:()=>s.pause(),resume:()=>s.resume()}}const npe={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},dx=/auto|scroll|overlay/i;function ope(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return dx.test(t)||dx.test(n)}function spe(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const ipe={class:"m-0 p-0"},rpe=["data-probe"],lpe=Gn(et(rn(mt({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(o){var s,i;return(i=(s=t.headingNodes)==null?void 0:s[o])!=null?i:null}return(o,s)=>(y(),M("div",{class:"height-estimation-probes",style:Zt({width:`${e.width}px`}),"aria-hidden":"true"},[C("div",{ref:i=>e.setParagraphWrapper(i),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[j(p(cc),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),C("div",{ref:i=>e.setListItemWrapper(i),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[C("ul",ipe,[j(p(Vd),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),C("div",{ref:i=>e.setListWrapper(i),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[j(p(qd),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(y(),M(Pe,null,pt(6,i=>C("div",{key:`probe-heading-${i}`,ref_for:!0,ref:r=>e.setHeadingWrapper(i,r),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${i}`},[j(p(L2),{node:n(i),"index-key":`probe-heading-${i}`},null,8,["node","index-key"])],10,rpe)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),fx=et({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=R(()=>{var n,o;return ag((o=Md(e.estimatedPreviewHeightPx))!=null?o:rg(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return tn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?tn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[tn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),tn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),tn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>tn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,tn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[tn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),tn("div",{class:"absolute inset-0"},[tn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),px=et({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=R(()=>{var n,o;return lg((o=Md(e.estimatedPreviewHeightPx))!=null?o:ig(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return tn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?tn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[tn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),tn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>tn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[tn("span",{class:"action-icon block"})])))]):null,tn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[tn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),tn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),ape={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function As(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const upe=["data-custom-id"],cpe=["data-node-index","data-node-type"],hx="typewriter-simple-cursor-target",R$=Gn(et(rn(mt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n;function i(L){if(!(typeof Event<"u"&&L instanceof Event))return typeof L=="string"&&s("copy-code",L),void s("copy",L)}const r=ds(),l=nn("markstreamNestedRendererProps",void 0);function a(L){const q=r?.vnode.props;return!!q&&(Object.prototype.hasOwnProperty.call(q,L)||Object.prototype.hasOwnProperty.call(q,String(L).replace(/[A-Z]/g,re=>`-${re.toLowerCase()}`)))}function u(L){var q,re;const ae=o[L];return a(L)?ae:(re=(q=l?.value)==null?void 0:q[L])!=null?re:ae}const c=R(()=>{return(L=u("mode"))==="chat"||L==="minimal"||L==="docs"?L:"docs";var L}),d=R(()=>ex(u("typewriter"))),f=R(()=>d.value!=="off"),h=R(()=>u("domMode")==="minimal"?"minimal":"full"),m=R(()=>{return(L={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":L.codeRenderer==="pre"||L.codeRenderer==="shiki"||L.codeRenderer==="monaco"?L.codeRenderer:L.renderCodeBlocksAsPre===!1||L.mode==="docs"?"monaco":"pre";var L}),v=R(()=>ape[c.value]),k=R(()=>{var L;return(L=u("showTooltips"))!=null?L:v.value.showTooltips}),w=R(()=>{var L;return(L=u("fade"))!=null?L:v.value.fade}),b=R(()=>{var L;return(L=u("batchRendering"))!=null?L:v.value.batchRendering}),_=R(()=>{var L;return(L=u("initialRenderBatchSize"))!=null?L:v.value.initialRenderBatchSize}),g=R(()=>{var L;return(L=u("renderBatchSize"))!=null?L:v.value.renderBatchSize}),x=R(()=>{var L;return(L=u("renderBatchDelay"))!=null?L:v.value.renderBatchDelay}),S=R(()=>{var L;return(L=u("renderBatchBudgetMs"))!=null?L:v.value.renderBatchBudgetMs}),T=R(()=>{var L;return(L=u("renderBatchIdleTimeoutMs"))!=null?L:v.value.renderBatchIdleTimeoutMs}),A=R(()=>{var L;return(L=u("deferNodesUntilVisible"))!=null?L:v.value.deferNodesUntilVisible}),E=R(()=>{var L;return(L=u("maxLiveNodes"))!=null?L:v.value.maxLiveNodes}),P=R(()=>{var L;return(L=u("liveNodeBuffer"))!=null?L:v.value.liveNodeBuffer}),D=R(()=>{var L;return(L=u("nodeVirtual"))!=null?L:v.value.nodeVirtual}),I={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return k.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return o.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return w.value},get batchRendering(){return b.value},get initialRenderBatchSize(){return _.value},get renderBatchSize(){return g.value},get renderBatchDelay(){return x.value},get renderBatchBudgetMs(){return S.value},get renderBatchIdleTimeoutMs(){return T.value},get deferNodesUntilVisible(){return A.value},get maxLiveNodes(){return E.value},get liveNodeBuffer(){return P.value},get nodeVirtual(){return D.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function $(L){s("height-change",L)}function B(L){s("virtual-state-change",L)}function H(L){s("anchor-change",L)}const O=Z(),F=Z(null),U=Z(null),z=Z(null),W=Go({1:null,2:null,3:null,4:null,5:null,6:null}),K=Z(!1),V=new Map,ie=Z(0),ne=Z(0),X=Z({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function le(L,q){return typeof L!="string"?q:L.trim()||q}function Ie(L){const q=Number(L);return Number.isFinite(q)&&q>0?Math.max(1,Math.trunc(q)):640}const de=R(()=>{var L;const q=(L=I.viewportPriorityOptions)!=null?L:{},re=le(q.rootMargin,yc);return{rootMargin:re,heavyBlockMargin:le(q.heavyBlockMargin,re),maxTargets:Ie(q.maxTargets)}}),pe=R(()=>{var L;return(L=de.value.rootMargin)!=null?L:yc}),ve=R(()=>{var L;return(L=de.value.maxTargets)!=null?L:640});function oe(){var L,q;if(((L=o.virtualScroll)==null?void 0:L.enabled)!==!0)return null;const re=(q=o.virtualScroll)==null?void 0:q.scrollRoot;return ye(typeof re=="function"?re():re)}function ye(L){return L?typeof HTMLElement<"u"&&L instanceof HTMLElement?L:typeof L=="object"&&"value"in L?ye(L.value):typeof L=="object"&&"$el"in L?ye(L.$el):null:null}Ln(y$,de);const{isClient:G,renderAsFragment:Y,debugPerformanceEnabled:fe,resolvedShowTooltips:we,resolvedHtmlPolicy:ge,inheritedSmoothStreaming:Q,ownsTypewriterCursor:te}=(function(L){const q=typeof window<"u",re=p1(),ae=nn("markstreamHtmlPolicy",void 0),be=nn("markstreamTypewriterCursor",void 0),Ne=nn("markstreamSmoothStreaming",void 0),De=R(()=>L.renderAsFragment===!0),je=R(()=>!!(L.debugPerformance&&q&&typeof console<"u")),ot=R(()=>{var nt;if(typeof L.showTooltips=="boolean")return L.showTooltips;const Be=(nt=re.showTooltips)!=null?nt:re["show-tooltips"];return Be===""||Be===!0||Be==="true"||Be!==!1&&Be!=="false"&&void 0}),Ve=R(()=>{var nt,Be;return(Be=(nt=L.htmlPolicy)!=null?nt:ae?.value)!=null?Be:"safe"}),Ye=R(()=>be?.value!==!0);return{isClient:q,renderAsFragment:De,debugPerformanceEnabled:je,resolvedShowTooltips:ot,resolvedHtmlPolicy:Ve,inheritedSmoothStreaming:Ne,inheritedTypewriterCursor:be,ownsTypewriterCursor:Ye}})(I),{resolveViewportRoot:ce,resolveScrollContainer:ue,isReverseFlexScrollRoot:Se,getNormalizedScrollTop:ze,getOffsetTopWithinRoot:_e}=(function(L,q){function re(){var je,ot;return(ot=(je=q.scrollRoot)==null?void 0:je.call(q))!=null?ot:null}function ae(je){if(typeof window>"u")return null;const ot=re();if(ot)return ot;const Ve=je??L.value;if(!Ve)return null;const Ye=Ve.ownerDocument||document,nt=Ye.scrollingElement||Ye.documentElement;let Be=Ve;for(;Be&&Be!==Ye.body&&Be!==nt;){if(ope(window.getComputedStyle(Be))&&spe(Be))return Be;Be=Be.parentElement}return null}function be(je){if(!q.isClient)return!1;try{const ot=window.getComputedStyle(je);return!!(ot.display||"").toLowerCase().includes("flex")&&(ot.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Ne(je,ot,Ve){var Ye,nt;if(Ve)return De(ot);const Be=je.scrollTop;if(!be(je))return Be;const Xe=Be<0?-Be:Be;return Math.max(0,((Ye=je.scrollHeight)!=null?Ye:0)-((nt=je.clientHeight)!=null?nt:0))-Xe}function De(je){var ot,Ve,Ye,nt,Be;const Xe=Number((ot=je.scrollingElement)==null?void 0:ot.scrollTop),lt=Number((Ye=(Ve=je.documentElement)==null?void 0:Ve.scrollTop)!=null?Ye:0),rt=Number((Be=(nt=je.body)==null?void 0:nt.scrollTop)!=null?Be:0);return Math.max(0,Number.isFinite(Xe)?Xe:0,Number.isFinite(lt)?lt:0,Number.isFinite(rt)?rt:0)}return{resolveViewportRoot:ae,resolveScrollContainer:function(je){var ot,Ve,Ye,nt;const Be=re();if(Be)return Be;const Xe=ae((ot=je??L.value)!=null?ot:null);if(Xe)return Xe;const lt=(nt=(Ye=je?.ownerDocument)!=null?Ye:(Ve=L.value)==null?void 0:Ve.ownerDocument)!=null?nt:typeof document<"u"?document:null;return lt?.scrollingElement||lt?.documentElement||null},isReverseFlexScrollRoot:be,getNormalizedScrollTop:Ne,getOffsetTopWithinRoot:function(je,ot){const Ve=ot.ownerDocument||je.ownerDocument||document;if((function(Xe,lt){return Xe===lt.documentElement||Xe===lt.body||Xe===lt.scrollingElement})(ot,Ve))return je.getBoundingClientRect().top+De(Ve);const Ye=ot.getBoundingClientRect(),nt=je.getBoundingClientRect(),Be=Ne(ot,Ve,!1);return nt.top-Ye.top+Be}}})(O,{isClient:G,scrollRoot:oe});Ln("markstreamShowTooltips",we),Ln("markstreamHtmlPolicy",ge),Ln("markstreamTypewriter",f),Ln("markstreamFade",R(()=>I.fade!==!1)),Ln("markstreamTypewriterCursor",R(()=>!0)),Ln("markstreamTextStreamState",V),Ln("markstreamStreamVersion",ie),Ln("markstreamParseOptions",R(()=>I.parseOptions)),Ln("markstreamCustomMarkdownIt",R(()=>I.customMarkdownIt));const{smoothStreamingEnabled:Ee,renderContent:it,requestedFinal:Fe,effectiveFinal:Oe}=(function(L,q){const re=tpe(mt(mt({},npe),L.smoothStreamingOptions)),ae=R(()=>{var Be,Xe,lt;return L.smoothStreaming!==!1&&!((Be=L.nodes)!=null&&Be.length)&&(L.smoothStreaming===!0||!((Xe=q.inheritedSmoothStreaming)!=null&&Xe.value))&&(L.smoothStreaming===!0||ex(L.typewriter)!=="off"||((lt=L.maxLiveNodes)!=null?lt:0)<=0)}),be=Z(!q.isClient||L.smoothStreaming===!0);dn(()=>{be.value=!0});const Ne=R(()=>be.value&&ae.value),De=R(()=>{var Be;return Ne.value?re.visible.value:(Be=L.content)!=null?Be:""}),je=R(()=>{var Be,Xe;const lt=(Be=L.parseOptions)!=null?Be:{};return(Xe=L.final)!=null?Xe:lt.final}),ot=R(()=>{const Be=je.value;return Ne.value&&Be!=null?!!Be&&re.caughtUp.value:Be});let Ve=0,Ye=!1;function nt(){Ve=0,Ye=!1}return Je([()=>L.content,()=>L.nodes,Ne,je],([Be,Xe,lt,rt])=>{if(Xe?.length)return nt(),void re.reset("");const wt=Be??"";if(!lt)return nt(),re.reset(wt),void(rt&&re.finish({flush:!0}));const dt=re.source.value;if(wt){if(wt!==dt)if(wt.startsWith(dt)){const Ft=wt.slice(dt.length),Ht=re.pendingChars.value;Ft.length<=8?(Ve++,Ye||Ve>=2&&Ht<=8?(Ye=!0,re.reset(wt)):re.enqueue(Ft)):(nt(),re.enqueue(Ft))}else nt(),re.reset(wt)}else nt(),re.reset("");rt&&re.finish()},{immediate:!0}),{smoothStream:re,smoothStreamingEligible:ae,smoothStreamingEnabled:Ne,renderContent:De,requestedFinal:je,effectiveFinal:ot}})(I,{isClient:G,inheritedSmoothStreaming:Q}),Ge=Fe.value===!0;Ln("markstreamSmoothStreaming",Ee);const at=Z(!1),Tt=Z(!1),Bt=Z(!1);let Yt="",Sn=!1,on=null;function en(){G&&on!=null&&(window.clearTimeout(on),on=null)}function Cn(){at.value=!1,en()}function Mn(L,q){if(!fe.value)return;const re=(function(){if(!fe.value)return null;const ae=gt(We),be=gt(tt),Ne=Math.max(Lt,be);if(ae<=0&&Ne<=0)return null;const De={total:ae,maxPerFrame:Ne,byLabel:(je=We,Object.fromEntries(Array.from(je.entries()).sort((ot,Ve)=>Ve[1]-ot[1]||ot[0].localeCompare(Ve[0]))))};var je;return We.clear(),tt.clear(),Lt=0,De})();console.info(`[markstream-vue][perf] ${L}`,re?rn(mt({},q),{layoutReads:re}):q)}Je([()=>I.indexKey,()=>I.customId],()=>{var L,q;Cn(),Tt.value=!1,Bt.value=!((L=o.nodes)!=null&&L.length)&&Fe.value!==!0&&!!o.content,Yt=(q=it.value)!=null?q:"",Sn=Yt.length>0},{flush:"sync"}),Je([()=>o.content,()=>o.nodes,Fe],([L,q,re])=>{!q?.length&&re!==!0&&L&&(Bt.value=!0)},{flush:"sync",immediate:!0}),Je([it,()=>o.nodes,Fe],([L,q,re])=>{const ae=L??"";return q?.length||re===!0?(Cn(),Tt.value=!1,Yt=ae,void(Sn=!0)):(ae.length>0&&(Bt.value=!0),Sn?(Yt&&ae.length>Yt.length&&ae.startsWith(Yt)?(at.value=!0,Tt.value=!0,G&&(en(),on=window.setTimeout(()=>{var be;on=null,Oe.value===!0||(be=o.nodes)!=null&&be.length||(qc(),at.value=!1,Ol())},1200))):(ae.length<Yt.length||!ae.startsWith(Yt))&&(Cn(),Tt.value=!1),void(Yt=ae)):(Yt=ae,void(Sn=!0)))},{flush:"sync",immediate:!0});const We=new Map,tt=new Map;let Ue=!1,Lt=0;function gt(L){let q=0;for(const re of L.values())q+=re;return q}function wn(){Lt=Math.max(Lt,gt(tt)),tt.clear(),Ue=!1}function yn(L){L.maxPerFrame=Math.max(Number(L.maxPerFrame||0),Number(L.currentFrameTotal||0)),L.currentFrameTotal=0,L.frameScheduled=!1}function go(L){var q,re;fe.value&&(We.set(L,((q=We.get(L))!=null?q:0)+1),tt.set(L,((re=tt.get(L))!=null?re:0)+1),(function(ae){const be=(function(){if(!G||typeof window>"u")return null;const Ne=window;if(Ne.__markstreamLayoutReadPerformance)return Ne.__markstreamLayoutReadPerformance;const De={total:0,maxPerFrame:0,byLabel:{}};return Ne.__markstreamLayoutReadPerformance=De,De})();be&&(be.total=Number(be.total||0)+1,be.byLabel[ae]=Number(be.byLabel[ae]||0)+1,be.currentFrameTotal=Number(be.currentFrameTotal||0)+1,be.frameScheduled||(be.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>yn(be),0):queueMicrotask(()=>yn(be)):window.requestAnimationFrame(()=>yn(be))))})(L),Ue||(Ue=!0,G&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(wn):typeof queueMicrotask!="function"?setTimeout(wn,0):queueMicrotask(wn)))}function qt(L,q){return go(L),q()}const ps=I.customId?`renderer-${I.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,xs=(function(L){const q=new Map;return{scope:L,cache:q,clear:()=>q.clear()}})(ps),_n=ps;Ln(A$,xs);const In=fs(()=>I.customId),{effectiveCustomHtmlTagsSet:To,mergedParseOptions:lo,parsedNodes:St,getParsedNodesDirtyStartIndex:hs,getParsedNodesRevision:Jo}=Qfe(I,{instanceMsgId:ps,renderContent:it,effectiveFinal:Oe,smoothStreamingEnabled:Ee,debugPerformanceEnabled:fe,customComponentsMap:In,logPerf:Mn});Je(St,()=>{at.value||xs.clear(),ie.value+=1},{immediate:!0});const uo=R(()=>({customId:I.customId,customHtmlTags:lo.value.customHtmlTags,parseOptions:I.parseOptions,customMarkdownIt:I.customMarkdownIt,htmlPolicy:ge.value,viewportPriority:I.viewportPriority,viewportPriorityOptions:de.value,mode:c.value,domMode:I.domMode,codeRenderer:m.value,codeBlockStream:I.codeBlockStream,codeBlockDarkTheme:I.codeBlockDarkTheme,codeBlockLightTheme:I.codeBlockLightTheme,codeBlockMonacoOptions:I.codeBlockMonacoOptions,renderCodeBlocksAsPre:I.renderCodeBlocksAsPre,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockProps:I.codeBlockProps,mermaidProps:I.mermaidProps,d2Props:I.d2Props,infographicProps:I.infographicProps,showTooltips:we.value,themes:I.themes,langs:I.langs,isDark:I.isDark,typewriter:f.value,smoothStreamingOptions:I.smoothStreamingOptions,parseCoalesceMs:I.parseCoalesceMs,fade:I.fade}));Ln("markstreamNestedRendererProps",uo);const Ys=R(()=>St.value),Nn=R(()=>St.value.length),no=Z(null),$s=Z(null),Xs=Z(null),ci=Z(null),Oo=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),vo=!Oo&&I.customId?G_(I.customId):null,Po=R(()=>vo?(o4.value,G_(I.customId)):null),co=R(()=>{var L;return!!(!Y.value&&I.customId&&!Oo&&((L=Po.value)!=null&&L.enabled))}),Tn=R(()=>!!(G&&co.value)),fo=R(()=>{var L;return!!(!Y.value&&((L=o.virtualScroll)!=null&&L.enabled))}),Qe=R(()=>fo.value),st=Z(!1);dn(()=>{st.value=!0});const Ct=R(()=>!!(G&&fo.value));Ln("markstreamHostScrollManaged",Ct);const Qt=R(()=>!!(st.value&&Ct.value)),kn=R(()=>Tn.value||Ct.value),Ko=R(()=>Tn.value||Qt.value),Eo=R(()=>{var L;return kn.value&&((L=Po.value)==null?void 0:L.textEstimation)!==!1});function bo(){const L=ne.value||qt("getMeasuredContainerWidth.clientWidth",()=>{var q;return((q=O.value)==null?void 0:q.clientWidth)||0});return Number.isFinite(L)&&L>0?L:0}const Ns=R(()=>{const L=bo();return L>0?Math.max(1,Math.round(L)):640}),Do=R(()=>{var L,q;return!(Oe.value!==!0||fo.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(L=o.nodes)!=null&&L.length||Bt.value||!(((q=I.maxLiveNodes)!=null?q:0)<=0))}),Io=R(()=>{var L;return Do.value?50:Math.max(1,(L=I.maxLiveNodes)!=null?L:320)}),Qo=R(()=>{var L;return Do.value?16:Math.max(0,(L=I.liveNodeBuffer)!=null?L:60)}),sn=R(()=>{var L;return!Y.value&&I.nodeVirtual!==!1&&!(((L=I.maxLiveNodes)!=null?L:0)<=0&&!Do.value)&&(I.nodeVirtual===!0?St.value.length>0:St.value.length>Io.value)}),es=R(()=>sn.value||Tn.value||Ct.value),ms=R(()=>I.viewportPriority!==!1),Tr=R(()=>!!ms.value&&!K.value);var ts;ts=R(()=>ms.value),Ln(k$,ts);const Ki=R(()=>{var L;return!(Y.value||I.deferNodesUntilVisible===!1||((L=I.maxLiveNodes)!=null?L:0)<=0||sn.value||St.value.length>900||I.viewportPriority===!1)}),Js=Nde(L=>{var q;return ce((q=L??O.value)!=null?q:null)},ms),{requestFrame:Bo,cancelFrame:Zo,hasIdleCallback:Il,isTestEnv:Zi}=(function(L){const q=L.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,re=L.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,ae=L.isClient&&typeof window.requestIdleCallback=="function",be=(function(){var Ne;if(typeof globalThis>"u"||!("process"in globalThis))return;const De=(Ne=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Ne.value;return De?.env})();return{requestFrame:q,cancelFrame:re,hasIdleCallback:ae,isTestEnv:be?.NODE_ENV==="test"}})({isClient:G}),tl=R(()=>Oe.value===!0&&!fo.value),{resolvedBatchSize:Ho,resolvedInitialBatch:Co,batchingEnabled:Fs,incrementalRenderingActive:Rs,renderedCount:yo,previousRenderContext:ht,adaptiveBatchSize:Le,previousBatchConfig:Ze}=(function(L,q){var re;const ae=R(()=>{var nt;const Be=Math.trunc((nt=L.renderBatchSize)!=null?nt:80);return Number.isFinite(Be)?Math.max(0,Be):0}),be=R(()=>{var nt;const Be=Math.trunc((nt=L.initialRenderBatchSize)!=null?nt:ae.value);return Number.isFinite(Be)?Math.max(0,Be):ae.value}),Ne=R(()=>!q.renderAsFragment.value&&L.batchRendering!==!1&&ae.value>0&&q.isClient&&!q.isTestEnv),De=Z(0),je=Z({key:L.indexKey,total:0}),ot=Z(Math.max(1,ae.value||1)),Ve=R(()=>{var nt,Be,Xe;return Ne.value&&!((nt=q.continuousStreaming)!=null&&nt.value)&&!((Be=q.forceFullRenderFinalContent)!=null&&Be.value)&&((Xe=L.maxLiveNodes)!=null?Xe:0)<=0}),Ye=Z({batchSize:ae.value,initial:be.value,delay:(re=L.renderBatchDelay)!=null?re:16,enabled:Ve.value});return{resolvedBatchSize:ae,resolvedInitialBatch:be,batchingEnabled:Ne,incrementalRenderingActive:Ve,renderedCount:De,previousRenderContext:je,adaptiveBatchSize:ot,previousBatchConfig:Ye}})(I,{isClient:G,isTestEnv:Zi,renderAsFragment:Y,forceFullRenderFinalContent:tl,continuousStreaming:R(()=>Tt.value&&Oe.value!==!0)}),Xt=R(()=>{var L;return!Y.value&&I.batchRendering!==!1&&Ho.value>0&&!Zi&&((L=I.maxLiveNodes)!=null?L:0)<=0&&!tl.value}),gs=R(()=>Xt.value),di=R(()=>kn.value||gs.value),Ei=R(()=>{var L;return di.value&&((L=Po.value)==null?void 0:L.codeBlockEstimation)!==!1}),ao=new Map,Gi=new Map,Er=new WeakMap;let fi=null;const Ll=new WeakMap,zo=new Map,Ir=[];let Qs=[],pi=[],se=-1;const xe=Xr(Ir),J=new Set,Ce=Z(0);let $e=0;const He=Z(0),vt=R(()=>(He.value,Array.from(ao.entries()).sort((L,q)=>L[0]-q[0]))),ut=Z(null),Dt=Z(null);let Et,ln=null,oo=0,Ot=null;function Pt(){Et.markFallbackHeightPrefixDirty()}function Yn(L){return Et.getFallbackNodeHeight(L)}function ko(L,q){return Et.estimateHeightRange(L,q)}function vs(L){return Et.estimateIndexForOffset(L)}const{activeRestoreAnchor:Os,getRelativeScrollTopWithinContainer:ei,setRelativeScrollTopWithinContainer:Lc,resolveAnchorOffset:U2,clearRestoreReconcile:$c,scheduleRestoreReconcile:yu,captureRestoreAnchor:Nc,restoreAnchor:Fc,getAnchorDrift:j2}=(function(L){const{isClient:q,containerRef:re,parsedNodeCount:ae,requestFrame:be,cancelFrame:Ne,resolveScrollContainer:De,getNormalizedScrollTop:je,getOffsetTopWithinRoot:ot,isReverseFlexScrollRoot:Ve,estimateIndexForOffset:Ye,estimateHeightRange:nt,getFallbackNodeHeight:Be,clamp:Xe}=L,lt=Z(null);let rt=null,wt=[];function dt(){const Kt=De(),fn=re.value;if(!Kt||!fn)return null;const vn=Kt.ownerDocument||fn.ownerDocument||document;if(Kt===vn.documentElement||Kt===vn.body||Kt===vn.scrollingElement){const Qn=fn.getBoundingClientRect();return Math.max(0,-Qn.top)}return Math.max(0,je(Kt,vn,!1)-ot(fn,Kt))}function Ft(Kt){var fn;const vn=De(),Qn=re.value;if(!vn||!Qn)return;const Hs=Math.max(0,Kt),Ss=vn.ownerDocument||Qn.ownerDocument||document,$r=Ss.defaultView||(typeof window<"u"?window:null);if(vn===Ss.documentElement||vn===Ss.body||vn===Ss.scrollingElement){const il=je(vn,Ss,!0)+Qn.getBoundingClientRect().top;return void((fn=$r?.scrollTo)==null||fn.call($r,0,Math.max(0,il+Hs)))}J_(vn,Ss,ot(Qn,vn)+Hs,{isReverseFlexScrollRoot:il=>{var K1;return(K1=Ve?.(il))!=null&&K1},getNormalizedScrollTop:je})}function Ht(Kt){const fn=ae.value,vn=Xe(Kt.nodeIndex,0,Math.max(0,fn-1));return nt(0,vn)+Math.max(0,Kt.offsetWithinNodePx)}function Vt(){if(rt!=null&&(Ne?.(rt),rt=null),q)for(const Kt of wt)window.clearTimeout(Kt);wt=[]}function Wt(Kt){const fn=Ht(Kt),vn=dt();vn!=null&&Math.abs(vn-fn)<=.5||Ft(fn)}return{activeRestoreAnchor:lt,getRelativeScrollTopWithinContainer:dt,setRelativeScrollTopWithinContainer:Ft,resolveAnchorOffset:Ht,clearRestoreReconcile:Vt,applyRestoreAnchor:Wt,scheduleRestoreReconcile:function(){lt.value&&q&&rt==null&&(rt=be?be(()=>{rt=null,lt.value&&Wt(lt.value)}):null,rt==null&&lt.value&&Wt(lt.value))},captureRestoreAnchor:function(){const Kt=dt(),fn=ae.value;if(Kt==null||fn<=0)return null;const vn=Xe(Ye(Kt+1),0,fn-1),Qn=nt(0,vn),Hs=Be(vn);return{nodeIndex:vn,offsetWithinNodePx:Xe(Kt-Qn,0,Math.max(0,Hs-1))}},restoreAnchor:function(Kt){const fn=ae.value;if(lt.value={nodeIndex:Xe(Kt.nodeIndex,0,Math.max(0,fn-1)),offsetWithinNodePx:Math.max(0,Kt.offsetWithinNodePx)},Vt(),Wt(lt.value),q)for(const vn of[0,120,280,480])wt.push(window.setTimeout(()=>{lt.value&&Wt(lt.value)},vn))},getAnchorDrift:function(Kt){const fn=dt();return fn==null?null:fn-Ht(Kt)}}})({isClient:G,containerRef:O,parsedNodeCount:Nn,requestFrame:Bo,cancelFrame:Zo,resolveScrollContainer:()=>ut.value||ue(),getNormalizedScrollTop:ze,getOffsetTopWithinRoot:_e,isReverseFlexScrollRoot:Se,estimateIndexForOffset:vs,estimateHeightRange:ko,getFallbackNodeHeight:Yn,clamp:Bs}),{nodeHeights:$l,heightStats:hi,heightTreeSize:x1,heightSumTree:a0,heightKnownTree:u0,averageNodeHeight:S1,resetHeightMeasurements:c0,pruneHeightMeasurements:d0,rebuildHeightTrees:Rc,recordNodeHeight:V2,removeNodeHeights:q2,exportHeightCache:ke,importHeightCache:Ae,fenwickRangeSum:Ke}=(function(L={}){const q=Go({}),re=Go({total:0,count:0}),ae=Z(0),be=Z([]),Ne=Z([]);function De(){for(const Be of Object.keys(q))delete q[Number(Be)];re.total=0,re.count=0,ae.value=0,be.value=[],Ne.value=[]}function je(Be,Xe,lt){for(let rt=Xe+1;rt<Be.length;rt+=rt&-rt)Be[rt]+=lt}function ot(Be,Xe){let lt=0;for(let rt=Xe+1;rt>0;rt-=rt&-rt)lt+=Be[rt];return lt}function Ve(Be){ae.value=Be;const Xe=new Array(Be+1).fill(0),lt=new Array(Be+1).fill(0);for(const[rt,wt]of Object.entries(q)){const dt=Number(rt),Ft=Number(wt);!Number.isFinite(dt)||dt<0||dt>=Be||!Number.isFinite(Ft)||Ft<=0||(je(Xe,dt,Ft),je(lt,dt,1))}be.value=Xe,Ne.value=lt}function Ye(Be){if(!Number.isInteger(Be)||Be<0)return!1;const Xe=q[Be];if(!Number.isFinite(Xe)||Xe<=0)return!1;if(delete q[Be],re.total=Math.max(0,re.total-Xe),re.count=Math.max(0,re.count-1),ae.value>Be){const lt=be.value,rt=Ne.value;lt.length&&rt.length&&(je(lt,Be,-Xe),je(rt,Be,-1))}return!0}const nt=R(()=>re.count>0?Math.max(12,re.total/re.count):32);return{nodeHeights:q,heightStats:re,heightTreeSize:ae,heightSumTree:be,heightKnownTree:Ne,averageNodeHeight:nt,resetHeightMeasurements:De,pruneHeightMeasurements:function(Be){if(Be<=0)return void De();let Xe=0,lt=0;for(const[rt,wt]of Object.entries(q)){const dt=Number(rt),Ft=Number(wt);!Number.isFinite(dt)||dt<0||dt>=Be||!Number.isFinite(Ft)||Ft<=0?delete q[dt]:(Xe+=Ft,lt++)}re.total=Xe,re.count=lt},rebuildHeightTrees:Ve,recordNodeHeight:function(Be,Xe,lt={}){(function(rt,wt,dt={}){var Ft;if(!Number.isFinite(wt)||wt<=0)return!1;const Ht=q[rt];if(Ht&&(dt.allowShrink===!1&&wt<Ht||Math.abs(wt-Ht)<=1))return!1;if(q[rt]=wt,Ht?re.total+=wt-Ht:(re.total+=wt,re.count++),ae.value>rt){const Vt=be.value,Wt=Ne.value;if(Vt.length&&Wt.length)if(Ht){const Kt=wt-Ht;Kt!==0&&je(Vt,rt,Kt)}else je(Vt,rt,wt),je(Wt,rt,1)}dt.notify!==!1&&((Ft=L.onHeightRecorded)==null||Ft.call(L))})(Be,Xe,rn(mt({},lt),{notify:!0}))},removeNodeHeight:function(Be,Xe={}){var lt;const rt=Ye(Be);return rt&&Xe.notify!==!1&&((lt=L.onHeightRecorded)==null||lt.call(L)),rt},removeNodeHeights:function(Be,Xe={}){var lt;let rt=0;for(const wt of Be)Ye(Number(wt))&&rt++;return rt>0&&Xe.notify!==!1&&((lt=L.onHeightRecorded)==null||lt.call(L)),rt},exportHeightCache:function(){return Object.entries(q).map(([Be,Xe])=>({index:Number(Be),height:Number(Xe)})).filter(Be=>Number.isFinite(Be.index)&&Be.index>=0&&Number.isFinite(Be.height)&&Be.height>0).sort((Be,Xe)=>Be.index-Xe.index)},importHeightCache:function(Be,Xe={}){var lt;if(!Array.isArray(Be))return;const rt=ae.value;let wt=!1;if(Xe.mode!=="merge"){const dt=Object.keys(q);if(dt.length>0){for(const Ft of dt)delete q[Number(Ft)];wt=!0}}for(const dt of Be){const Ft=Number(dt.index),Ht=Number(dt.height);if(!Number.isInteger(Ft)||Ft<0||rt>0&&Ft>=rt||!Number.isFinite(Ht)||Ht<=0)continue;const Vt=q[Ft];Vt&&Math.abs(Vt-Ht)<=1||(q[Ft]=Ht,wt=!0)}wt&&((function(){let dt=0,Ft=0;const Ht=ae.value;for(const[Vt,Wt]of Object.entries(q)){const Kt=Number(Vt),fn=Number(Wt);!Number.isFinite(Kt)||Kt<0||Ht>0&&Kt>=Ht||!Number.isFinite(fn)||fn<=0?delete q[Kt]:(dt+=fn,Ft++)}re.total=dt,re.count=Ft})(),rt>0&&Ve(rt),(lt=L.onHeightRecorded)==null||lt.call(L))},fenwickRangeSum:function(Be,Xe,lt){if(lt<=Xe)return 0;const rt=ot(Be,lt-1);return Xe<=0?rt:rt-ot(Be,Xe-1)}}})({onHeightRecorded:()=>{Pt(),Ct.value&&z1(),Os.value&&yu(),Dt.value&&Uc(),po("node-resize")}});function Mt(L){Number.isInteger(L)&&L>=0&&J.add(L)}function Gt(L){for(const q of L)Mt(Number(q))}function an(L){$e++;let q=!0;try{const re=L();return q=re!==!1,re}finally{$e--,$e===0&&q&&Ce.value++}}function Fn(){Qs=[],pi=[],se=-1,J.clear(),xe.value=Ir}function so(){Fn(),an(()=>c0()),zo.clear()}function Ps(L){!Number.isInteger(L)||L<0||L>=St.value.length||zo.set(L,I1(L))}function ku(L,q,re={}){const ae=$l[L];Mt(L),V2(L,q,re);const be=$l[L];return Object.is(ae,be)?(J.delete(L),!1):(be&&be>0?Ps(L):ae&&zo.delete(L),!0)}function A1(L,q){const re=qt("getNodeLayoutHeight.slot.offsetHeight",()=>{var ae,be;return(be=(ae=ao.get(L))==null?void 0:ae.offsetHeight)!=null?be:0});return re>0?re:qt("getNodeLayoutHeight.content.offsetHeight",()=>q.offsetHeight)}function a6(L,q={}){q.mode!=="merge"?Fn():Gt(L.map(re=>re.index)),an(()=>Ae(L,q)),bv()}const nl=R(()=>Ki.value&&Tr.value),wF=R(()=>{var L;return!Y.value&&I.batchRendering!==!1&&Ho.value>0&&((L=I.maxLiveNodes)!=null?L:0)<=0}),_F=R(()=>!Y.value&&Ge&&Oe.value===!0&&!sn.value&&!fo.value&&!co.value&&!nl.value&&!wF.value),u6=R(()=>!!Js&&nl.value),c6=R(()=>sn.value||Ct.value),{focusIndex:Nl,liveRange:Ds,updateLiveRange:M1}=(function(L,q){const{parsedNodeCount:re,virtualizationEnabled:ae,maxLiveNodesResolved:be,liveNodeBufferResolved:Ne,clamp:De}=q,je=Ne??R(()=>{var Ye;return Math.max(0,(Ye=L.liveNodeBuffer)!=null?Ye:60)}),ot=Z(0),Ve=Go({start:0,end:0});return{liveNodeBufferResolved:je,focusIndex:ot,liveRange:Ve,updateLiveRange:function(){const Ye=re.value;if(!ae.value||Ye===0)return Ve.start=0,void(Ve.end=Ye);const nt=Math.min(be.value,Ye),Be=je.value,Xe=De(ot.value-Be,0,Math.max(0,Ye-nt));Ve.start=Xe,Ve.end=Math.min(Ye,Xe+nt)}}})(I,{parsedNodeCount:Nn,virtualizationEnabled:sn,maxLiveNodesResolved:Io,liveNodeBufferResolved:Qo,clamp:Bs}),ol=new Map,bu=new Map,da=new Map,f0=[],Fl=new Map,fa=new Set,d6=Z(0);let K2=!1;const f6=R(()=>(d6.value,fa.size)),Yi=new Map,sl=new Map,p6=Z(0),Z2=R(()=>{p6.value;let L=0;for(const q of Yi.values())L+=Math.max(0,q);return L});let Xi=null;const p0=R(()=>{if(!sn.value)return St.value.length;const L=Qo.value,q=Math.max(Ds.end+L,Co.value),re=Math.min(St.value.length,q);return Math.max(yo.value,re)});function h0(){K2||(K2=!0,queueMicrotask(()=>{K2=!1,d6.value+=1}))}function h6(L,q,re="node-resize"){if(!G||typeof window>"u")return null;const ae=window.setTimeout(()=>{fa.delete(ae)&&h0();try{q()}finally{po(re)}},Math.max(0,L));return fa.add(ae),h0(),ae}function m0(L){G&&L!=null&&(fa.delete(L)&&h0(),window.clearTimeout(L))}function m6(){if(G&&typeof window<"u")for(const L of fa)window.clearTimeout(L);fa.size&&(fa.clear(),h0()),f0.length=0,da.clear()}function xF(L){F.value=L}function SF(L){U.value=L}function AF(L){z.value=L}const{cancelScheduledFocusSync:G2,scheduleFocusSync:Lr}=(function(L){const{isClient:q,containerRef:re,virtualizationEnabled:ae,requestFrame:be,cancelFrame:Ne,syncFocusToScroll:De}=L;let je=null;function ot(){var Ye,nt,Be;return(Be=(nt=(Ye=re.value)==null?void 0:Ye.ownerDocument)==null?void 0:nt.defaultView)!=null?Be:typeof window<"u"?window:null}function Ve(){if(!je)return;const Ye=ot();je.viaTimeout?Ye?Ye.clearTimeout(je.id):clearTimeout(je.id):Ne?.(je.id),je=null}return{cancelScheduledFocusSync:Ve,scheduleFocusSync:function(Ye={}){if(!ae.value)return;if(!q)return void De(!0);if(Ye.immediate)return Ve(),void De(!0);if(je)return;const nt=()=>{je=null,De()};if(be)return void(je={id:be(nt),viaTimeout:!1});const Be=ot();je={id:Be?Be.setTimeout(nt,16):setTimeout(nt,16),viaTimeout:!0}}}})({isClient:G,containerRef:O,virtualizationEnabled:sn,requestFrame:Bo,cancelFrame:Zo,syncFocusToScroll:function(L=!1){var q;if(!sn.value)return;const re=ut.value||ue();if(!re)return;const ae=re.ownerDocument||((q=O.value)==null?void 0:q.ownerDocument)||document,be=ae?.defaultView||(typeof window<"u"?window:null),Ne=re===ae?.documentElement||re===ae?.body,De=St.value.length;if(De<=0)return;if(!Ne&&De>0&&Se(re)){const rt=qt("syncFocusToScroll.clientHeight",()=>re.clientHeight||0),wt=qt("syncFocusToScroll.scrollTop",()=>re.scrollTop),dt=wt<0?-wt:wt;return void y0(Bs((je=Math.max(0,dt)+.5*Math.max(0,rt),Et.estimateIndexForOffsetFromEnd(je)),0,Math.max(0,De-1)),L)}var je;const ot=(function(rt,wt,dt,Ft){const Ht=O.value;if(!Ht)return null;const Vt=Ft?0:qt("syncFocusToScroll.model.root.getBoundingClientRect",()=>rt.getBoundingClientRect().top),Wt=qt("syncFocusToScroll.model.container.getBoundingClientRect",()=>Ht.getBoundingClientRect().top),Kt=Math.max(0,Vt-Wt),fn=Ft?qt("syncFocusToScroll.model.viewport.clientHeight",()=>{var vn,Qn,Hs,Ss;return(Ss=(Hs=(Qn=dt?.innerHeight)!=null?Qn:(vn=wt.documentElement)==null?void 0:vn.clientHeight)!=null?Hs:rt.clientHeight)!=null?Ss:0}):qt("syncFocusToScroll.model.root.clientHeight",()=>rt.clientHeight);return Bs(vs(Kt+.5*Math.max(0,fn)),0,Math.max(0,St.value.length-1))})(re,ae,be,Ne);if(ot!=null)return void y0(ot,L);const Ve=Ne?null:qt("syncFocusToScroll.root.getBoundingClientRect",()=>re.getBoundingClientRect()),Ye=Ne?0:Ve.top,nt=Ne?qt("syncFocusToScroll.viewport.clientHeight",()=>{var rt,wt;return(wt=(rt=be?.innerHeight)!=null?rt:re.clientHeight)!=null?wt:0}):Ve.bottom,Be=vt.value;let Xe=null,lt=null;for(const[rt,wt]of Be){if(!wt)continue;const dt=qt("syncFocusToScroll.slot.getBoundingClientRect",()=>wt.getBoundingClientRect());dt.bottom<=Ye||dt.top>=nt||(Xe==null&&(Xe=rt),lt=rt)}if(Xe==null||lt==null){const rt=O.value;if(!rt)return;const wt=Ne?{top:0}:qt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>re.getBoundingClientRect()),dt=qt("syncFocusToScroll.fallback.scrollTop",()=>ze(re,ae,Ne)),Ft=Ne?(()=>{const Vt=qt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>rt.getBoundingClientRect()),Wt=(Ne?0:wt.top)-Vt.top;return Math.max(0,Wt)})():(()=>{const Vt=_e(rt,re);return Math.max(0,dt-Vt)})(),Ht=Ne?qt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Vt,Wt,Kt,fn;return(fn=(Kt=(Wt=be?.innerHeight)!=null?Wt:(Vt=ae?.documentElement)==null?void 0:Vt.clientHeight)!=null?Kt:re.clientHeight)!=null?fn:0}):qt("syncFocusToScroll.fallback.root.clientHeight",()=>re.clientHeight);return void y0(Bs(vs(Ft+.5*Math.max(0,Ht)),0,Math.max(0,St.value.length-1)),!0)}y0(Math.round((Xe+lt)/2),L)}}),{visibleNodeIndices:Y2,nodeVisibilityHandles:Oc,nodeVisibilityWatchStops:g0,nodeVisibilityFallbackTimers:g6,clearVisibilityFallback:v0,markNodeVisible:pa,cleanupNodeVisibility:MF,destroyNodeVisibilityState:X2}=epe({isClient:G,shouldTrackVisibleNodeIndices:()=>nl.value,shouldCleanupNodeVisibility:()=>sn.value,onNodeMarkedVisible:L=>{sn.value?Lr():Nl.value=Bs(L,0,Math.max(0,St.value.length-1))},onNodeVisibilityCleaned:L=>{ao.delete(L)&&j6()}}),{cleanupScrollListener:v6,setupScrollListener:TF}=(function(L){const{isClient:q,virtualizationEnabled:re,listenerEnabled:ae,scrollRootElement:be,resolveScrollContainer:Ne,scheduleFocusSync:De,onScroll:je}=L;let ot=null,Ve=null;function Ye(){ot&&(ot(),ot=null),Ve=null,be.value=null}function nt(Be){const Xe=L.getScrollTop?L.getScrollTop(Be):Be.scrollTop;return Math.max(0,Number.isFinite(Xe)?Math.abs(Xe):0)}return{cleanupScrollListener:Ye,setupScrollListener:function(){if(!q)return;if(!((Be=ae?.value)!=null?Be:re.value))return void Ye();var Be;const Xe=Ne();if(!Xe)return void Ye();if(be.value===Xe&&ot)return;Ye(),Ve=nt(Xe);const lt=()=>{if(je?.(),re.value){const rt=(function(wt){const dt=nt(wt),Ft=Ve;Ve=dt;const Ht=Math.max(480,.75*(wt.clientHeight||0));return Ft==null?dt>Ht?{immediate:!0}:void 0:Math.abs(dt-Ft)>Ht?{immediate:!0}:void 0})(Xe);rt?De(rt):De()}};Xe.addEventListener("scroll",lt,{passive:!0}),be.value=Xe,ot=()=>{Xe.removeEventListener("scroll",lt)}}}})({isClient:G,virtualizationEnabled:sn,listenerEnabled:c6,scrollRootElement:ut,resolveScrollContainer:ue,scheduleFocusSync:Lr,onScroll:function(){const L=Dt.value;if(!L)return;const q=E1();if(!q||(function(ae){if(R1()>=oo)return Ot=null,!1;const be=Ot;if(be==null)return!0;const Ne=Math.abs(ae.scrollTop-be)<=2;return Ne||(Ot=null),Ne})(q))return;const re=$6(q);re!=null?(re<-32||Math.abs(Math.max(0,re)-Math.max(0,L.distanceFromBottomPx))>32)&&Wc("restore"):Wc("restore")},getScrollTop:L=>{var q;const re=L.ownerDocument||((q=O.value)==null?void 0:q.ownerDocument)||document,ae=L===re.documentElement||L===re.body||L===re.scrollingElement;return qt("scrollListener.getScrollTop",()=>ze(L,re,ae))}});function y0(L,q=!1){const re=Bs(L,0,Math.max(0,St.value.length-1));!q&&Math.abs(re-Nl.value)<=1||(Nl.value=re,M1())}function Bs(L,q,re){return Math.min(Math.max(L,q),re)}function J2(L=St.value.length){const q=hs();return!Number.isInteger(q)||q<0?L:Bs(q,0,L)}function Q2(L){return L?.firstElementChild}function y6(L,q){var re;return L?(re=L.matches)!=null&&re.call(L,q)?L:L.querySelector(q):null}function EF(L,q){L<1||L>6||(W[L]=q)}function k6(){if(!kn.value)return void(ne.value=0);const L=qt("updateExperimentContainerWidth.clientWidth",()=>{var q,re;return(re=(q=O.value)==null?void 0:q.clientWidth)!=null?re:0});ne.value=L>0?L:0}let T1=null;function ev(){T1?.disconnect(),T1=null}const b6=Af("ViewportDeferredMarkdownCodeBlockNode",zr({loader:()=>mo(null,null,function*(){return(yield jo(()=>import("./index5-Cn2jfVMX.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:dg,delay:0,suspensible:!1}),dg);function C6(L){return L===b6}const w6=R(()=>m.value==="pre"?Pi:m.value==="shiki"?b6:X9);function _6(){var L;return((L=I.codeBlockProps)==null?void 0:L.showHeader)!==!1}function x6(L,q,re){const ae=$l[q],be=typeof ae=="number"&&ae>0;if(Eo.value&&!be&&!(function(Ne){return!!In.value.paragraph&&(Ne.type==="paragraph"||Ne.type==="list_item"||Ne.type==="list")})(L)){const Ne=S$(L,re,X.value);if(Ne)return Ne}if(Ei.value&&L.type==="code_block"){const Ne=(function(De){if(De.type!=="code_block")return null;const je=n7(De,T0(De));return C6(je)?"markdown":je===Pi?"pre":je===w6.value||je===X9?"monaco":null})(L);if(Ne==="monaco"||Ne==="markdown"||Ne==="pre")return(function(De,je){var ot,Ve,Ye;if(!De||De.type!=="code_block")return null;const nt=je.rendererKind,Be=nt!=="pre"&&je.showHeader!==!1,Xe=!!De.diff;let lt=0,rt=500;if(nt==="monaco"){const dt=(ot=je.monacoOptions)!=null?ot:{},Ft=r4(De,dt,je.width),Ht=(function(Wt){const Kt=typeof Wt?.fontSize=="number"&&Wt.fontSize>0?Wt.fontSize:12;return typeof Wt?.lineHeight=="number"&&Wt.lineHeight>0?Wt.lineHeight:Math.round(1.5*Kt)})(dt),Vt=(function(Wt,Kt){var fn,vn;const Qn=typeof((fn=Wt?.padding)==null?void 0:fn.top)=="number"?Wt.padding.top:Kt?0:8,Hs=typeof((vn=Wt?.padding)==null?void 0:vn.bottom)=="number"?Wt.padding.bottom:Kt?0:8;return Math.max(0,Qn)+Math.max(0,Hs)})(dt,Xe);rt=typeof dt.MAX_HEIGHT=="number"&&dt.MAX_HEIGHT>0?dt.MAX_HEIGHT:500,lt=Math.round(Ft*Ht+Vt)}else if(nt==="markdown"){const dt=r4(De);lt=Math.round(21*dt+32)}else{const dt=r4(De);lt=Math.round(28*dt),rt=Number.POSITIVE_INFINITY}const wt=Math.max(1,Math.min(lt,rt));return mt({kind:"code-block",height:Math.round(wt+(Be?40:0)),contentHeight:wt,rendererKind:nt},Xe&&nt==="monaco"?{diffInline:v5((Ve=je.monacoOptions)!=null?Ve:{},(Ye=je.width)!=null?Ye:0)}:{})})(L,{rendererKind:Ne,monacoOptions:I.codeBlockMonacoOptions,showHeader:_6(),width:re})}return null}I4(()=>{if(Ce.value,$e>0)return;const L=St.value,q=Jo();if(!L.length||!di.value)return Qs=[],pi=[],se=-1,J.clear(),void(xe.value=Ir);const re=ne.value||qt("estimatedNodeHeights.clientWidth",()=>{var Ve;return((Ve=O.value)==null?void 0:Ve.clientWidth)||0});if(!Number.isFinite(re)||re<=0)return Qs=[],pi=[],se=-1,J.clear(),void(xe.value=Ir);const ae=(function(Ve){return[Math.round(Ve),Eo.value,Ei.value,X.value,I.codeBlockMonacoOptions,_6(),m.value,In.value,o4.value]})(re),be=Qs.length<=L.length&&(De=ae,(Ne=pi).length===De.length&&Ne.every((Ve,Ye)=>Object.is(Ve,De[Ye])));var Ne,De;const je=be&&se===q?L.length:be?J2(L.length):0,ot=be?Array.from(J):[];Qs.length=L.length;for(let Ve=je;Ve<L.length;Ve++)Qs[Ve]=x6(L[Ve],Ve,re);for(const Ve of ot)Ve>=0&&Ve<L.length&&Ve<je&&(Qs[Ve]=x6(L[Ve],Ve,re));J.clear(),pi=ae,se=q,xe.value=Qs,GR(xe)},{flush:"sync"});const Pc=R(()=>xe.value);Et=(function(L){let q=!0,re=[0],ae="";function be(Ye){var nt;const Be=L.nodeHeights[Ye];if(Number.isFinite(Be)&&Be>0)return Be;const Xe=L.parsedNodes.value[Ye],lt=Xe?.type,rt=!!((nt=L.hasCustomParagraphComponent)!=null&&nt.call(L)),wt=L.estimatedNodeHeights.value[Ye],dt=wt?.height;if(!(function(Ht,Vt,Wt){return!!(Wt&&Vt?.kind==="simple-text"&&(Ht==="paragraph"||Ht==="list_item"||Ht==="list"))})(lt,wt,rt)&&Number.isFinite(dt)&&dt>0)return dt;const Ft=Wfe(Xe,L.getContainerWidth()||640);return lt==="heading"||lt==="paragraph"&&Ft<=28&&(function(Ht,Vt){if(Vt)return!1;const Wt=Ht.children;return!Array.isArray(Wt)||!Wt.length||Wt.every(M$)})(Xe,rt)?Ft:Math.max(L.averageNodeHeight.value,Ft)}function Ne(){var Ye;const nt=L.parsedNodes.value.length,Be=L.getPrefixCacheKeyParts().join(":");if(!q&&ae===Be)return re;const Xe=new Array(nt+1);Xe[0]=0;for(let lt=0;lt<nt;lt++)Xe[lt+1]=Xe[lt]+(L.heightEstimationActive.value?be(lt):(Ye=L.nodeHeights[lt])!=null?Ye:L.averageNodeHeight.value);return re=Xe,ae=Be,q=!1,Xe}function De(Ye){var nt,Be;const Xe=L.parsedNodes.value.length;if(Xe<=0||Ye<=0)return 0;const lt=Ne();if(Ye>=((nt=lt[Xe])!=null?nt:0))return Xe-1;let rt=0,wt=Xe-1,dt=Xe-1;for(;rt<=wt;){const Ft=rt+wt>>1;((Be=lt[Ft+1])!=null?Be:0)>=Ye?(dt=Ft,wt=Ft-1):rt=Ft+1}return dt}function je(Ye,nt){var Be,Xe;if(Ye>=nt)return 0;if(L.heightEstimationActive.value)return(function(wt,dt){var Ft,Ht;const Vt=L.parsedNodes.value.length,Wt=tx(Math.trunc(wt),0,Vt),Kt=tx(Math.trunc(dt),Wt,Vt);if(Wt>=Kt)return 0;const fn=Ne();return((Ft=fn[Kt])!=null?Ft:0)-((Ht=fn[Wt])!=null?Ht:0)})(Ye,nt);if(L.heightTreeSize.value!==L.parsedNodes.value.length){let wt=0;for(let dt=Ye;dt<nt;dt++)wt+=(Be=L.nodeHeights[dt])!=null?Be:L.averageNodeHeight.value;return wt}const lt=L.heightSumTree.value,rt=L.heightKnownTree.value;if(!lt.length||!rt.length){let wt=0;for(let dt=Ye;dt<nt;dt++)wt+=(Xe=L.nodeHeights[dt])!=null?Xe:L.averageNodeHeight.value;return wt}return L.fenwickRangeSum(lt,Ye,nt)+(nt-Ye-L.fenwickRangeSum(rt,Ye,nt))*L.averageNodeHeight.value}function ot(Ye){var nt;if(Ye<=0)return 0;const Be=L.parsedNodes.value;if(L.heightEstimationActive.value)return De(Ye);if(L.heightTreeSize.value===Be.length&&L.heightSumTree.value.length&&L.heightKnownTree.value.length){const lt=L.averageNodeHeight.value,rt=L.heightSumTree.value,wt=L.heightKnownTree.value,dt=Wt=>Wt<=0?0:L.fenwickRangeSum(rt,0,Wt)+(Wt-L.fenwickRangeSum(wt,0,Wt))*lt;let Ft=0,Ht=Be.length-1,Vt=Be.length-1;for(;Ft<=Ht;){const Wt=Ft+Ht>>1;dt(Wt+1)>=Ye?(Vt=Wt,Ht=Wt-1):Ft=Wt+1}return Vt}let Xe=Ye;for(let lt=0;lt<Be.length;lt++){const rt=(nt=L.nodeHeights[lt])!=null?nt:L.averageNodeHeight.value;if(Xe<=rt)return lt;Xe-=rt}return Math.max(0,Be.length-1)}function Ve(){if(!L.heightEstimationActive.value)return 0;let Ye=0;const nt=L.estimatedNodeHeights.value;for(let Be=0;Be<nt.length;Be++){if(!nt[Be])continue;const Xe=L.nodeHeights[Be];Number.isFinite(Xe)&&Xe>0||Ye++}return Ye}return{markFallbackHeightPrefixDirty:function(){q=!0},getFallbackNodeHeight:be,estimateHeightRange:je,estimateIndexForOffset:ot,estimateIndexForOffsetFromEnd:function(Ye){var nt,Be;const Xe=L.parsedNodes.value;if(!Xe.length)return 0;if(Ye<=0)return Math.max(0,Xe.length-1);if(L.heightEstimationActive.value){const rt=(nt=Ne()[Xe.length])!=null?nt:0;return De(Math.max(0,rt-Ye))}if(L.heightTreeSize.value===Xe.length){const rt=je(0,Xe.length);return ot(Math.max(0,rt-Ye))}let lt=Ye;for(let rt=Xe.length-1;rt>=0;rt--){const wt=(Be=L.nodeHeights[rt])!=null?Be:L.averageNodeHeight.value;if(lt<=wt)return rt;lt-=wt}return 0},getEstimatedNodeHeightCount:Ve,buildVirtualHeightSummary:function(Ye){var nt;const Be=L.parsedNodes.value.length;return{totalNodes:Be,measuredCount:L.heightStats.count,estimatedCount:Ve(),averageNodeHeight:L.averageNodeHeight.value,topSpacerHeight:Ye.topSpacerHeight,bottomSpacerHeight:Ye.bottomSpacerHeight,estimatedTotalHeight:je(0,Be),width:(nt=Ye.width)!=null?nt:L.getContainerWidth()}}}})({parsedNodes:St,nodeHeights:$l,heightStats:hi,heightTreeSize:x1,heightSumTree:a0,heightKnownTree:u0,averageNodeHeight:S1,heightEstimationActive:kn,estimatedNodeHeights:Pc,getContainerWidth:bo,hasCustomParagraphComponent:()=>!!In.value.paragraph,getPrefixCacheKeyParts:()=>{var L;const q=uf(ne.value||qt("getFallbackHeightPrefix.clientWidth",()=>{var ae;return((ae=O.value)==null?void 0:ae.clientWidth)||0})),re=((L=o.virtualScroll)==null?void 0:L.measurementKey)==null?"":String(o.virtualScroll.measurementKey);return[St.value.length,hi.count,Math.round(hi.total),Math.round(100*S1.value),re,q,kn.value?1:0,o4.value,ie.value,In.value.paragraph?1:0]},fenwickRangeSum:Ke}),Je(()=>St.value.length,L=>{var q;Pt(),L<=0?so():(L<x1.value&&(q=L,Fn(),an(()=>d0(q))),L!==x1.value&&Rc(L))},{immediate:!0});const IF=R(()=>{if(!sn.value)return St.value.map((ae,be)=>({node:ae,index:be}));const L=St.value.length,q=Bs(Ds.start,0,L),re=Bs(Ds.end,q,L);return St.value.slice(q,re).map((ae,be)=>({node:ae,index:q+be}))}),tv=R(()=>sn.value?ko(0,Math.min(Ds.start,St.value.length)):0),nv=R(()=>{if(!sn.value)return 0;const L=St.value.length;return ko(Math.min(Ds.end,L),L)});function S6(){return Et.buildVirtualHeightSummary({topSpacerHeight:tv.value,bottomSpacerHeight:nv.value,width:Cu()})}function LF(){const L=St.value,q=S6();return rn(mt({},q),{probe:{paragraphReady:!!X.value.paragraph,listItemReady:!!X.value.listItem,listWrapperOverhead:X.value.listWrapperOverhead,headingReadyLevels:Object.entries(X.value.headings).filter(([,re])=>!!re).map(([re])=>Number(re))},nodes:L.map((re,ae)=>{var be,Ne,De,je,ot,Ve,Ye,nt,Be;return{index:ae,type:re.type,estimateKind:(Ne=(be=Pc.value[ae])==null?void 0:be.kind)!=null?Ne:null,rendererKind:(je=(De=Pc.value[ae])==null?void 0:De.rendererKind)!=null?je:null,estimatedHeight:(Ve=(ot=Pc.value[ae])==null?void 0:ot.height)!=null?Ve:null,estimatedContentHeight:(nt=(Ye=Pc.value[ae])==null?void 0:Ye.contentHeight)!=null?nt:null,measuredHeight:(Be=$l[ae])!=null?Be:null}})})}function ov(){return o.indexKey!=null?String(o.indexKey):fo.value?`virtual-${wo()}`:"markdown-renderer"}function A6(L){const q=String(L),re=`${ov()}-`;if(!q.startsWith(re))return null;const ae=q.slice(re.length).match(/^(\d+)(?:$|-)/);if(!ae)return null;const be=Number(ae[1]);return!Number.isInteger(be)||be<0||be>=St.value.length?null:be}function wo(){var L,q,re;const ae=(L=o.virtualScroll)==null?void 0:L.sessionKey;return String(ae!=null&&ae!==""?ae:(re=(q=o.indexKey)!=null?q:I.customId)!=null?re:ps)}function ns(){var L;const q=(L=o.virtualScroll)==null?void 0:L.threadKey;return q==null||q===""?void 0:String(q)}const $F=R(()=>{var L,q,re;return(re=ns())!=null?re:String((q=(L=o.indexKey)!=null?L:I.customId)!=null?q:ps)});function sv(L){var q;return(L??"")===((q=ns())!=null?q:"")}function Rl(){var L,q,re;return q=(L=o.virtualScroll)==null?void 0:L.measurementKey,re=(function(){const ae=m.value;return(function(be){var Ne,De;const je=be.renderer,ot=je==="monaco"?be.codeBlockMonacoOptions:void 0,Ve=be.codeBlockProps,Ye=je==="shiki";return[be.isDark?"dark":"light",je==="monaco"?"code-rich":je==="pre"?"code-pre":"code-shiki",be.codeBlockStream===!1?"code-static":"code-stream",As(be.codeBlockMinWidth),As(be.codeBlockMaxWidth),...Ye?[Lce((Ne=Ve?.themes)!=null?Ne:be.themes,(De=Ve?.langs)!=null?De:be.langs)]:[],As(ot?.fontSize),As(ot?.lineHeight),As(ot?.fontFamily),As(ot?.tabSize),As(ot?.MAX_HEIGHT),As(ot?.wordWrap),As(ot?.wrappingIndent),As(ot?.padding),As(Ve?.showHeader),As(Ve?.showCopyButton),As(Ve?.showExpandButton),As(Ve?.showPreviewButton),As(Ve?.showCollapseButton),As(Ve?.showFontSizeButtons)].join("\0")})({renderer:ae,isDark:I.isDark,codeBlockStream:I.codeBlockStream,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockMonacoOptions:ae==="monaco"?I.codeBlockMonacoOptions:void 0,codeBlockProps:I.codeBlockProps,themes:ae==="shiki"?I.themes:void 0,langs:ae==="shiki"?I.langs:void 0})})(),[q==null?"":String(q),re].join("\0")}function Cu(){return bo()}const k0=R(()=>uf(Cu())),Ji=R(()=>[Rl(),k0.value].join("\0")),NF=R(()=>{var L;return fo.value?["virtual",(L=ns())!=null?L:"",wo(),Ji.value].join("\0"):o.indexKey});function Dc(){p6.value+=1}function iv(L){return!(!L||!Number.isInteger(L.index)||L.index<0||L.index>=St.value.length||L.sessionKey!==wo()||L.threadKey!==ns()||L.layoutEpochKey!==Ji.value)}function M6(L){const q=String(L),re=sl.get(q);return re?iv(re)?re.index:null:A6(q)}function T6(L="async-node"){(Yi.size||sl.size)&&(Yi.clear(),sl.clear(),Dc(),po(L))}const Bc=nn(G3,null),rv={reportHeight(L,q){if(!Ct.value)return;const re=M6(L);if(re==null)return;const ae=ol.get(re);if(!ae)return;const be=Number(q),Ne=A1(re,ae);(function(De,je,ot={}){an(()=>ku(De,je,ot))})(re,Number.isFinite(be)&&be>0?Math.max(be,Ne||0):Ne)},markPending(L){if(!Ct.value)return;const q=A6(L);q!=null&&(function(re,ae){var be;const Ne=sl.get(re);if(Ne&&iv(Ne))return Yi.set(re,Math.max(0,(be=Yi.get(re))!=null?be:0)+1),Dc(),void po("async-node");Yi.set(re,1),sl.set(re,(function(De){return{index:De,sessionKey:wo(),threadKey:ns(),layoutEpochKey:Ji.value}})(ae)),Dc(),po("async-node")})(String(L),q)},markSettled(L){if(!Ct.value)return;const q=String(L),re=M6(L);(re!=null||(function(ae){return Yi.has(String(ae))})(q))&&(function(ae){var be;const Ne=(be=Yi.get(ae))!=null?be:0;return!(Ne<=0||(Ne<=1?(Yi.delete(ae),sl.delete(ae)):Yi.set(ae,Ne-1),Dc(),Ne===1&&po("async-node"),0))})(q)&&re!=null&&Ol()}};function FF(){let L=0;for(const q of ol.values())L+=qt("getVisibleDomHeight.offsetHeight",()=>{var re;return(re=q?.offsetHeight)!=null?re:0});return Math.ceil(Math.max(0,L))}Ln(G3,{reportHeight(L,q){rv.reportHeight(L,q),Bc?.reportHeight(L,q)},markPending(L){rv.markPending(L),Bc?.markPending(L)},markSettled(L){rv.markSettled(L),Bc?.markSettled(L)}});let lv,av=null,Hc=null;function b0(L){return L!==!1&&L!=null&&L!==""}function E6(){return sn.value?(function(){if(!sn.value)return!0;const L=St.value.length,q=Bs(Ds.start,0,L),re=Bs(Ds.end,q,L);if(q>=re)return!0;for(let ae=q;ae<re;ae++)if(!ao.has(ae)||x0(ae)&&!ol.has(ae))return!1;return!0})():yo.value>=p0.value}function uv(){return Oe.value===!0&&!at.value&&Z2.value===0&&fa.size===0&&Fl.size===0&&Xi==null&&E6()}function I6(){var L,q;if(((L=o.virtualScroll)==null?void 0:L.settleMode)!=="manual"||av===wo()&&lv===ns())return!0;const re=(q=o.virtualScroll)==null?void 0:q.settledToken;return!!b0(re)&&Hc===W1(re)}function cv(){return uv()&&I6()}function RF(L,q){return q.totalNodes<=0?L==="final"?"final":"estimate":q.measuredCount>=q.totalNodes?L==="final"?"final":"measured":q.measuredCount>0||q.estimatedCount>0?"mixed":"estimate"}function wu(L="manual",q){const re=S6(),ae=(function(be){return be||(Oe.value!==!0?St.value.length>0?"streaming":"estimating":!E6()||Fl.size>0||Xi!=null?"measuring":cv()?"settled":"settling")})(q);return{sessionKey:wo(),threadKey:ns(),phase:ae,nodeCount:re.totalNodes,liveRange:{start:Ds.start,end:Ds.end},renderedCount:yo.value,measuredCount:re.measuredCount,estimatedCount:re.estimatedCount,averageNodeHeight:re.averageNodeHeight,topSpacerHeight:re.topSpacerHeight,bottomSpacerHeight:re.bottomSpacerHeight,visibleDomHeight:FF(),totalHeight:L6(),width:re.width,final:Oe.value===!0,stable:cv(),confidence:RF(ae,re),reason:L}}function E1(){const L=ut.value||ue(),q=O.value;if(!L||!q)return null;const re=L.ownerDocument||q.ownerDocument||document,ae=L===re.documentElement||L===re.body||L===re.scrollingElement,be=qt("getScrollBox.scrollTop",()=>ze(L,re,ae)),Ne=qt("getScrollBox.scrollHeight",()=>{var je,ot,Ve,Ye,nt;return ae?Math.max((ot=(je=re.documentElement)==null?void 0:je.scrollHeight)!=null?ot:0,(Ye=(Ve=re.body)==null?void 0:Ve.scrollHeight)!=null?Ye:0,(nt=L.scrollHeight)!=null?nt:0):L.scrollHeight}),De=qt("getScrollBox.clientHeight",()=>{var je;return ae?((je=re.documentElement)==null?void 0:je.clientHeight)||L.clientHeight||0:L.clientHeight});return{root:L,doc:re,isViewportRoot:ae,scrollTop:be,scrollHeight:Ne,clientHeight:De}}function L6(){const L=St.value.length,q=Math.max(0,ko(0,L)),re=qt("getRendererLogicalHeight.offsetHeight",()=>{var be,Ne;return(Ne=(be=O.value)==null?void 0:be.offsetHeight)!=null?Ne:0}),ae=Math.max(0,re>0?re:qt("getRendererLogicalHeight.scrollHeight",()=>{var be,Ne;return(Ne=(be=O.value)==null?void 0:be.scrollHeight)!=null?Ne:0}));return L<=0?Math.ceil(re):sn.value?q>0?Math.max(1,Math.ceil(q),(function(){let be=tv.value+nv.value;for(const Ne of ao.values())Ne&&(be+=Math.max(0,qt("getVirtualizedDomLogicalHeight.offsetHeight",()=>Ne.offsetHeight||0)));return Math.ceil(Math.max(0,be))})(),(function(be,Ne){return be<=0||Ne<=0?0:Ne<=be+Math.max(512,.05*be)?Math.ceil(Ne):0})(q,ae)):Math.max(1,Math.ceil(ae)):Ct.value?q>0||hi.count>0||Et.getEstimatedNodeHeightCount()>0?(Rs.value&&yo.value,Math.max(1,Math.ceil(ae),Math.ceil(q))):Math.ceil(ae):Math.max(1,Math.ceil(ae),Math.ceil(q))}function $6(L){const q=O.value;if(!q)return null;const re=qt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>q.getBoundingClientRect());return(function(be){return be.isViewportRoot?be.clientHeight:qt("getViewportBottomInRoot.getBoundingClientRect",()=>be.root.getBoundingClientRect().bottom)})(L)-re.bottom}function OF(L={}){const q=L.requireViewport!==!1,re=(function(Ne=64){const De=E1(),je=O.value;if(!De||!je)return!1;const ot=(function(Ye){if(Ye.isViewportRoot)return{top:0,bottom:Ye.clientHeight};const nt=qt("getVirtualViewportRect.getBoundingClientRect",()=>Ye.root.getBoundingClientRect());return{top:nt.top,bottom:nt.bottom}})(De),Ve=qt("isRendererNearVirtualViewport.getBoundingClientRect",()=>je.getBoundingClientRect());return Ve.bottom>=ot.top-Ne&&Ve.top<=ot.bottom+Ne})();if(q&&!re)return null;const ae=(function(){const Ne=E1(),De=O.value;if(!Ne||!De||Math.max(0,Ne.scrollHeight-Ne.scrollTop-Ne.clientHeight)>64)return null;const je=$6(Ne);return je==null?null:je>=-8&&je<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,je)}:null})();if(ae)return{anchor:ae,captured:!0};const be=Nc();if(be)return{anchor:{type:"node",nodeIndex:be.nodeIndex,offsetWithinNodePx:be.offsetWithinNodePx},captured:re};if(L.allowFallback===!0){const Ne=(function(){const De=St.value.length;return De<=0?null:{type:"node",nodeIndex:Bs(Nl.value,0,Math.max(0,De-1)),offsetWithinNodePx:0}})();return Ne?{anchor:Ne,captured:!1}:null}return null}function dv(L){let q=2166136261;for(let re=0;re<L.length;re++)q^=L.charCodeAt(re),q=Math.imul(q,16777619);return(q>>>0).toString(36)}function PF(L,q){let re=L;for(let ae=0;ae<q.length;ae++)re^=q.charCodeAt(ae),re=Math.imul(re,16777619);return re^=31,re=Math.imul(re,16777619),re}const DF=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function C0(L,q=new WeakSet,re=0){if(L==null||typeof L=="number"||typeof L=="boolean")return String(L);if(typeof L=="string")return`s:${(function(ae){const be=ae.length>8192?`${ae.slice(0,8192)}...${ae.length}`:ae;return`${ae.length}:${dv(be)}`})(L)}`;if(typeof L=="function")return"fn";if(typeof L!="object")return typeof L;if(q.has(L))return"cycle";if(re>=6)return"max-depth";q.add(L);try{if(Array.isArray(L)){if(L.length<=160){const Ve=[];for(let Ye=0;Ye<L.length;Ye++)Ve.push(C0(L[Ye],q,re+1));return`a:${L.length}:${Ve.join(",")}`}const Ne=[],De=[],je=Math.max(0,L.length-32);let ot=2166136261;for(let Ve=0;Ve<L.length;Ve++){const Ye=C0(L[Ve],q,re+1);ot=PF(ot,Ye),Ve<32&&Ne.push(Ye),Ve>=je&&De.push(Ye)}return[`a:${L.length}`,`h=${Ne.join(",")}`,`t=${De.join(",")}`,`all=${(ot>>>0).toString(36)}`].join(":")}const ae=L,be=Object.keys(ae).filter(Ne=>{const De=ae[Ne];return Ne!=="parent"&&Ne!=="el"&&Ne!=="component"&&(De==null||typeof De=="string"||typeof De=="number"||typeof De=="boolean"||DF.has(Ne))}).sort();return`o:${be.length}:${be.map(Ne=>`${Ne}=${C0(ae[Ne],q,re+1)}`).join(";")}`}finally{q.delete(L)}}let fv=-1,pv="",_u=[2166136261];function I1(L){const q=St.value[L];return q?dv(C0(q)):""}function BF(L,q){let re=L;for(let ae=0;ae<q.length;ae++)re^=q.charCodeAt(ae),re=Math.imul(re,16777619);return re>>>0}function hv(){var L,q;const re=ie.value;if(fv===re)return pv;const ae=St.value.length;let be=J2(ae);(fv!==re-1||be>ae||_u.length<be+1)&&(be=0),be===0?_u=[2166136261]:_u.length=be+1;for(let Ne=be;Ne<ae;Ne++){const De=I1(Ne);_u[Ne+1]=BF((L=_u[Ne])!=null?L:2166136261,De)}return _u.length=ae+1,pv=(((q=_u[ae])!=null?q:2166136261)>>>0).toString(36),fv=re,pv}function zc(L,q={}){var re;const ae=q.includeHeightCache===!0,be=(re=q.includeContentHash)!=null?re:ae,Ne=ae?(function(je){const ot=(function(){var rt,wt;const dt=Number((wt=(rt=o.virtualScroll)==null?void 0:rt.heightCacheLimit)!=null?wt:5e3);return!Number.isFinite(dt)||dt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(dt))})();if(!Number.isFinite(ot)||je.length<=ot)return je;const Ve=new Map,Ye=rt=>{!rt||Ve.size>=ot||Ve.set(rt.index,rt)},nt=St.value.length,Be=Bs(Ds.start-2*Qo.value,0,nt),Xe=Bs(Ds.end+2*Qo.value,Be,nt);for(const rt of je)rt.index>=Be&&rt.index<Xe&&Ye(rt);const lt=Math.max(1,Math.ceil(je.length/ot));for(let rt=0;rt<je.length&&Ve.size<ot;rt+=lt)Ye(je[rt]);for(let rt=je.length-1;rt>=0&&Ve.size<ot;rt-=lt)Ye(je[rt]);return Array.from(Ve.values()).sort((rt,wt)=>rt.index-wt.index).slice(0,ot)})(ke().map(je=>{var ot;const Ve=St.value[je.index];return Ve?rn(mt({},je),{nodeType:String((ot=Ve.type)!=null?ot:""),signature:I1(je.index)}):null}).filter(je=>!!je)):[],De=OF({allowFallback:q.allowAnchorFallback===!0,requireViewport:q.requireViewport});return De||Ne.length||q.includeEmptyState===!0?rn(mt({sessionKey:L.sessionKey,threadKey:L.threadKey},De?{anchor:De.anchor,anchorCaptured:De.captured}:{anchorCaptured:!1}),{metrics:L,width:L.width,contentHash:be?hv():void 0,measurementKey:Rl()||void 0,heightCache:Ne.length?Ne:void 0}):null}function mv(L){var q,re;const ae=E1();if(!ae)return;const be=(function(je){const ot=O.value;if(!ot)return null;const Ve=_e(ot,je.root),Ye=St.value.length,nt=qt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>ot.offsetHeight||0),Be=Math.max(0,nt>0?nt:Ye>0?qt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>ot.scrollHeight||0):0),Xe=L6();return Ve+Math.max(Be,Xe)})(ae);if(be==null)return;const Ne=Math.max(0,L.distanceFromBottomPx),De=Math.max(0,be-ae.clientHeight-Ne);(function(je){oo=R1()+120,Ot=je})(De),ae.isViewportRoot?(re=(q=ae.doc.defaultView)==null?void 0:q.scrollTo)==null||re.call(q,0,De):J_(ae.root,ae.doc,De,{isReverseFlexScrollRoot:Se,getNormalizedScrollTop:ze})}const gv=[];function N6(){if(G)for(ln!=null&&(Zo?.(ln),ln=null);gv.length;){const L=gv.pop();L!=null&&window.clearTimeout(L)}}function Wc(L){const q=!!Dt.value;Dt.value=null,oo=0,Ot=null,N6(),q&&L&&po(L)}function Uc(){if(!Dt.value||!G||ln!=null)return;const L=()=>{ln=null;const q=Dt.value;q&&mv(q)};ln=Bo?Bo(L):null,ln==null&&L()}function F6(L,q={}){const re=St.value.length;return re<=0?[]:L.filter(ae=>!(!Number.isInteger(ae.index)||ae.index<0||ae.index>=re)&&!(!Number.isFinite(ae.height)||ae.height<=0)&&!(q.requireSignature&&!ae.signature)&&!(q.requireCompatibilityMetadata&&!ae.nodeType&&!ae.signature)&&(function(be){var Ne;const De=St.value[be.index];return!(!De||be.nodeType&&be.nodeType!==String((Ne=De.type)!=null?Ne:"")||be.signature&&be.signature!==I1(be.index))})(ae))}function R6(L){const q=uf(Cu()),re=uf(L);return q!==-1&&re!==-1&&q===re}function vv(L){var q;const re=Number(L?.width);if(Number.isFinite(re)&&re>0)return re;const ae=Number((q=L?.metrics)==null?void 0:q.width);return Number.isFinite(ae)&&ae>0?ae:null}function O6(L){var q;return L.sessionKey===wo()&&!!sv(L.threadKey)&&((q=L.measurementKey)!=null?q:"")===Rl()&&!!R6(vv(L))&&!!(function(re){const ae=re.heightCache;return!!ae?.length&&(P6(re)?ae.some(be=>!!(be.nodeType||be.signature)):ae.some(be=>!!be.signature))})(L)}function P6(L){return!!(L.contentHash&&L.contentHash===hv())}function HF(L){return!P6(L)}let xu=null,Su=null,w0=null,L1=null,$1=null;function yv(L){var q;const re=L.map(be=>{var Ne,De;return[be.index,Math.round(10*be.height),(Ne=be.nodeType)!=null?Ne:"",(De=be.signature)!=null?De:""].join("")}).join(""),ae=uf(Cu());return[(q=ns())!=null?q:"",wo(),Rl(),St.value.length,ae,L.length,dv(re)].join(":")}function D6(L=(q=>(q=o.virtualScroll)==null?void 0:q.heightCache)()){if(!Ct.value||!L?.length||St.value.length<=0||!R6((q=o.virtualScroll)==null?void 0:q.heightCacheWidth))return!1;var q;const re=F6(L,{requireSignature:!0});if(!re.length)return!1;const ae=yv(re);return ae===xu?(Su="standalone",!0):(a6(re,{mode:"merge"}),Pt(),xu=ae,Su="standalone",P1(),po("restore"),!0)}function kv(L,q={}){var re,ae,be;if(!Ct.value||!L||L.sessionKey!==wo()||!sv(L.threadKey)||St.value.length<=0)return!1;const Ne=!!((re=L.heightCache)!=null&&re.length)&&!_0(),De=!L.anchor||L.anchorCaptured===!1&&q.allowUncapturedAnchor!==!0?null:L.anchor,je=q.restoreAnchor===!0&&!!De&&!_0()&&Number(vv(L))>0;let ot=!1;if((ae=L.heightCache)!=null&&ae.length&&O6(L)){const Ye=F6(L.heightCache,{requireCompatibilityMetadata:!L.contentHash,requireSignature:HF(L)});Ye.length&&(a6(Ye,{mode:"merge"}),Pt(),xu=yv(Ye),Su="restore",P1(),ot=!0)}if(Ne||je)return!1;if(!q.restoreAnchor||!De)return ot&&po("restore"),!0;const Ve=(function(Ye,nt){var Be;const Xe=Ye.anchor,lt=Xe?Xe.type==="bottom"?`bottom:${Math.round(Xe.distanceFromBottomPx)}`:`node:${Xe.nodeIndex}:${Math.round(Xe.offsetWithinNodePx)}`:"none";return[(Be=ns())!=null?Be:"",wo(),Rl(),k0.value,nt,lt].join(":")})(L,(be=q.restoreToken)!=null?be:"imperative");return w0===Ve?(ot&&po("restore"),!0):(w0=Ve,(function(Ye){const nt=()=>{if(Ye.type==="node")return Wc(),void Fc({nodeIndex:Ye.nodeIndex,offsetWithinNodePx:Ye.offsetWithinNodePx});if($c(),Os.value=null,Dt.value=Ye,N6(),mv(Ye),G)for(const Be of[0,120,280,480])gv.push(window.setTimeout(()=>{const Xe=Dt.value;Xe&&mv(Xe)},Be))};(function(Be){if(!sn.value)return!1;const Xe=St.value.length;return!(Xe<=0||(Nl.value=Be.type==="node"?Bs(Be.nodeIndex,0,Xe-1):Xe-1,M1(),0))})(Ye)?yt(nt):nt()})(De),po("restore"),!0)}function _0(){const L=Cu();return Number.isFinite(L)&&L>0}function B6(L){var q;return L.sessionKey===wo()&&!!sv(L.threadKey)&&(St.value.length<=0||!(!((q=L.heightCache)!=null&&q.length)||_0())||!(!(L.anchor&&Number(vv(L))>0)||_0()))}function bv(){zo.clear();for(const L of Object.keys($l)){const q=Number(L);Number.isInteger(q)&&q>=0&&q<St.value.length&&Ps(q)}}function N1(){Xi!=null&&(Zo?.(Xi),Xi=null),Ev()}function H6(){return!G||Zi?Promise.resolve():new Promise(L=>{let q=!1,re=null;const ae=()=>{q||(q=!0,re!=null&&window.clearTimeout(re),L())};if(Bo)return Bo(ae),void(re=window.setTimeout(ae,50));re=window.setTimeout(ae,0)})}function Cv(L,q=ns(),re=Ji.value){return wo()===L&&ns()===q&&Ji.value===re}function wv(){return mo(this,arguments,function*(L={}){var q,re,ae,be,Ne;const De=wo(),je=ns(),ot=Ji.value,Ve=(q=L.frames)!=null?q:2,Ye=(re=L.timeoutMs)!=null?re:120,nt=(ae=L.reason)!=null?ae:"manual",Be=L.expectedSettledTokenKey,Xe=L.flushPendingTimers===!0,lt=wu(nt),rt=()=>rn(mt({},lt),{phase:lt.final?"settling":lt.phase,stable:!1,confidence:lt.confidence==="final"?"mixed":lt.confidence,reason:nt}),wt=()=>Cv(De,je,ot)&&(Be==null||O1()===Be);for(let Vt=0;Vt<Ve;Vt++){if(yield yt(),!wt()||(yield H6(),!wt()))return rt();Ol(),N1()}if(yield(function(Vt){return!G||Vt<=0?Promise.resolve():new Promise(Wt=>window.setTimeout(Wt,Vt))})(Ye),!wt()||(Xe&&m6(),Ol(),N1(),!wt()))return rt();const dt=uv();dt&&(av=De,lv=je,((be=o.virtualScroll)==null?void 0:be.settleMode)==="manual"&&Be!=null&&b0((Ne=o.virtualScroll)==null?void 0:Ne.settledToken)&&O1()===Be&&(Hc=W1(o.virtualScroll.settledToken)));const Ft=wt()&&dt&&I6(),Ht=wu(nt,Ft?"final":void 0);return Mv(Ht,!0),Ht})}let _v="content",Au=null,Mu=null,xv=0,F1=null,jc=null,Sv=null,Av=null;function R1(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function z6(L){var q,re;const ae=F1;if(!ae)return!0;const be=(re=(q=o.virtualScroll)==null?void 0:q.heightDiffThresholdPx)!=null?re:1;return Math.abs(L.totalHeight-ae.totalHeight)>be||L.sessionKey!==ae.sessionKey||L.phase!==ae.phase||L.stable!==ae.stable||L.final!==ae.final||L.threadKey!==ae.threadKey||L.nodeCount!==ae.nodeCount||L.measuredCount!==ae.measuredCount||L.width!==ae.width}function O1(L=(q=>(q=o.virtualScroll)==null?void 0:q.settledToken)()){return As(L)}function W6(L,q){var re,ae;return[L,q.sessionKey,(re=q.threadKey)!=null?re:"",Rl(),hv(),As((ae=o.virtualScroll)==null?void 0:ae.settledToken),Math.round(q.totalHeight),Math.round(q.width)].join("\0")}function P1(){Sv=null,Av=null,jc=null}function zF(L){const q=L.heightCache;return q?.length?yv(q):""}function D1(L){var q,re,ae;const be=L.metrics,Ne=L.anchor?(De=L.anchor).type==="bottom"?`bottom:${Math.round(De.distanceFromBottomPx)}`:`node:${De.nodeIndex}:${Math.round(De.offsetWithinNodePx)}`:"none";var De;return[L.sessionKey,(q=L.threadKey)!=null?q:"",(re=L.measurementKey)!=null?re:Rl(),(ae=L.contentHash)!=null?ae:"",zF(L),Ne,L.anchorCaptured?1:0,be.liveRange.start,be.liveRange.end,be.renderedCount,be.nodeCount,Math.round(be.totalHeight),Math.round(be.width),be.phase,be.stable?1:0].join("\0")}function Mv(L,q=!1){if(!Ct.value||(function(De=!1){return!De&&fo.value&&!Qt.value})(q))return;const re=q||z6(L),ae=(function(De,je=!1){return je||De.stable||De.phase==="final"?{state:zc(De,{includeHeightCache:!0})}:{state:zc(De)}})(L,q),be=ae.state,Ne=!!(be&&(re||(function(De,je=!1){return!!je||D1(De)!==jc})(be,q)));if(re&&($(L),F1=L,xv=R1()),be&&Ne&&(B(be),be.anchor&&H(be.anchor),jc=D1(be)),L.stable){const De=W6("settled",L);if(De!==Sv){Sv=De;const je=zc(L,{includeHeightCache:!0});je&&(B(je),jc=D1(je)),(function(ot){s("render-settled",ot)})(L)}}if(L.phase==="final"){const De=W6("final",L);if(De!==Av){Av=De;const je=zc(L,{includeHeightCache:!0});je&&(B(je),jc=D1(je)),(function(ot){s("render-final",ot)})(L)}}}function Tv(){Au!=null&&(Zo?.(Au),Au=null),Mu!=null&&G&&(window.clearTimeout(Mu),Mu=null)}function U6(){Au=null,Mu=null,(function(L){if(Fl.size>0||Xi!=null)return!0;switch(L){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(_v)&&(Ol(),N1()),Mv(wu(_v))}function po(L){var q,re;if(!Ct.value||(_v=L,Au!=null||Mu!=null))return;const ae=Math.max(0,(re=(q=o.virtualScroll)==null?void 0:q.emitIntervalMs)!=null?re:32),be=Math.max(0,ae-(R1()-xv)),Ne=()=>{Mu=null,Au=Bo?Bo(U6):null,Au==null&&U6()};G&&be>0?Mu=window.setTimeout(Ne,be):Ne()}function j6(){He.value+=1}function x0(L){if(Rs.value&&L>=yo.value){const q=St.value[L],re=Fe.value===!0&&Oe.value!==!0&&L>=St.value.length-2,ae=q?.type==="code_block"||q?.type==="image"||q?.type==="mermaid"||q?.type==="infographic";if(!re||ae)return!1}return!nl.value||L<Co.value||Y2.value.has(L)}function Vc(L){const q=g0.get(L);q&&(q(),g0.delete(L));const re=Oc.get(L);re&&(re.destroy(),Oc.delete(L)),v0(L)}function S0(L,q){let re=!1;if(q){const Ne=ao.get(L);ao.set(L,q),Ne!==q&&(re=!0)}else ao.delete(L)&&(re=!0);if(re&&j6(),q||v0(L),!u6.value||!Js)return Vc(L),void(q&&nl.value&&pa(L,!0));if(!sn.value&&nl.value&&!K.value&&Oc.size>=ve.value&&(K.value||(K.value=!0,X2()),!u6.value||!Js))return Vc(L),void(q&&pa(L,!0));if(L<Co.value&&!sn.value||Y2.value.has(L))return Vc(L),void pa(L,!0);if(!q)return void Vc(L);Vc(L);const ae=Js(q,{rootMargin:pe.value});if(!ae)return;Oc.set(L,ae),pa(L,ae.isVisible.value),nl.value&&(function(Ne){if(!G||!nl.value)return;v0(Ne);const De=Ne%17*23,je=window.setTimeout(()=>{if(g6.delete(Ne),!nl.value||Y2.value.has(Ne))return;const ot=ao.get(Ne);if(!ot)return;const Ve=ue(ot),Ye=ot.ownerDocument||document,nt=Ye.defaultView||window,Be=!Ve||Ve===Ye.documentElement||Ve===Ye.body,Xe=!Be&&Ve?qt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ve.getBoundingClientRect()):null,lt=Be?0:Xe.top,rt=Be?qt("nodeVisibilityFallback.clientHeight",()=>{var dt,Ft;return(Ft=(dt=nt.innerHeight)!=null?dt:Ve?.clientHeight)!=null?Ft:0}):Xe.bottom,wt=qt("nodeVisibilityFallback.node.getBoundingClientRect",()=>ot.getBoundingClientRect());wt.bottom>=lt-500&&wt.top<=rt+500&&pa(Ne,!0)},1800+De);g6.set(Ne,je)})(L);let be=null;be=Je(()=>ae.isVisible.value,Ne=>{if(Ne){v0(L),pa(L,!0),be?.(),g0.delete(L),Oc.get(L)===ae&&Oc.delete(L);try{ae.destroy()}catch{}}},{immediate:!0}),g0.set(L,be),sn.value&&Lr()}function Ev(){Xi=null,an(()=>{let L=!1;for(const[q,re]of Fl)Fl.delete(q),ol.get(q)===re.el&&bu.get(q)===re.version&&(L=ku(q,re.height,{allowShrink:re.allowShrink})||L);return L})}function qc(){Xi!=null&&(Zo?.(Xi),Xi=null),Fl.clear()}function A0(L,q){(function(re,ae,be){var Ne;if(!Number.isFinite(be)||be<=0||ol.get(re)!==ae)return;const De=bu.get(re);if(De==null)return;const je=St.value[re],ot=at.value&&Oe.value!==!0&&!((Ne=o.nodes)!=null&&Ne.length)&&re>=St.value.length-2,Ve=!(je?.loading===!0||ot),Ye=Fl.get(re),nt=Ye?Ye.allowShrink&&Ve:Ve,Be=Ye&&!nt?Math.max(Ye.height,be):be;Fl.set(re,{height:Be,allowShrink:nt,version:De,el:ae}),Xi==null&&(Xi=Bo?Bo(Ev):null,Xi==null&&Ev())})(L,q,A1(L,q))}function Ol(){for(const[L,q]of ol)q&&A0(L,q)}function V6(){fi?.disconnect(),fi=null,Gi.clear()}function Iv(){for(;f0.length;)m0(f0.pop())}Je(Qt,L=>{L&&po("content")},{flush:"post"}),t({getVirtualMetrics:wu,captureVirtualState:function(L={}){var q;return zc(wu("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:L.allowFallbackAnchor===!0,requireViewport:L.requireViewport===!0,includeEmptyState:(q=L.includeEmptyState)==null||q})},restoreVirtualState:function(L,q={}){const re=q.restoreAnchor===!0,ae=q.restoreToken==null?"imperative":String(q.restoreToken);L1=L,$1={restoreAnchor:re,restoreToken:ae,allowUncapturedAnchor:q.allowUncapturedAnchor===!0},!kv(L,{restoreAnchor:re,restoreToken:ae,allowUncapturedAnchor:q.allowUncapturedAnchor===!0})&&B6(L)||(L1=null,$1=null)},forceMeasure:function(L="manual"){return mo(this,null,function*(){yield yt(),yield H6(),Ol(),N1(),yield yt();const q=wu(L);return Mv(q,!0),q})},settle:wv,scrollToNode:function(L,q="start"){Wc(),$c();const re=St.value.length;if(re<=0)return;const ae=Bs(L,0,re-1),be=()=>{var Ne;const De=U2({nodeIndex:ae,offsetWithinNodePx:0}),je=Yn(ae),ot=E1(),Ve=(Ne=ot?.clientHeight)!=null?Ne:0,Ye=ei();let nt=De;if(q==="center")nt=De-Ve/2+je/2;else if(q==="end")nt=De-Ve+je;else if(q==="nearest"&&Ye!=null){if(De>=Ye&&De+je<=Ye+Ve)return;nt=De<Ye?De:De-Ve+je}Lc(Math.max(0,nt)),Lr({immediate:!0}),sn.value&&(Nl.value=ae,M1())};if(sn.value)return Nl.value=ae,M1(),void yt(be);be()}}),Je(()=>es.value,L=>{if(!L){V6();for(const q of da.values())for(const re of q)m0(re);da.clear(),bu.clear(),Iv(),qc()}},{immediate:!0}),Je(Oe,L=>{L&&(function(){if(G&&Oe.value&&ol.size){Iv();for(const q of[80,240,640]){const re=h6(q,()=>{for(const[ae,be]of ol)be&&A0(ae,be)},"final");re!=null&&f0.push(re)}}})(),po(L?"final":"content")});const WF=Q_(()=>po("content"),16),UF=Q_(()=>po("batch"),16);Je([()=>St.value.length,()=>yo.value],()=>{Dt.value&&Uc(),WF()},{flush:"post",immediate:!0}),Je([()=>Ds.start,()=>Ds.end],()=>{UF()},{flush:"post"});const{cleanupBatchScheduler:jF}=(function(L){const{props:q,isClient:re,isTestEnv:ae,parsedNodesIdentity:be,parsedNodeCount:Ne,desiredRenderedCount:De,datasetKey:je,batchingEnabled:ot,incrementalRenderingActive:Ve,resolvedBatchSize:Ye,resolvedInitialBatch:nt,renderedCount:Be,adaptiveBatchSize:Xe,previousRenderContext:lt,previousBatchConfig:rt,requestFrame:wt,cancelFrame:dt,hasIdleCallback:Ft,cleanupNodeVisibility:Ht,onDatasetKeyChanged:Vt,onDatasetChanged:Wt}=L;let Kt=null,fn="raf",vn=null,Qn=0,Hs=!1,Ss=!1;const $r=new Set,il=new Set;function K1(){if(re){Kt!=null&&(fn==="raf"&&dt?dt(Kt):fn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(Kt):fn==="timeout"&&window.clearTimeout(Kt),Kt=null),Qn+=1;for(const ti of $r)dt&&dt(ti);for(const ti of il)window.clearTimeout(ti);$r.clear(),il.clear(),vn=null,Hs=!1,Ss=!1}}function R0(){return typeof performance<"u"?performance.now():Date.now()}function u7(ti){(function(Pl){var ma;if(!Ve.value)return;const Dl=Math.max(2,(ma=q.renderBatchBudgetMs)!=null?ma:6),Bl=Math.max(1,Ye.value||1),Nr=Math.max(1,Math.floor(Bl/4));Pl>1.5*Dl?Xe.value=Math.max(Nr,Math.floor(.8*Xe.value)):Pl<.6*Dl&&Xe.value<Bl&&(Xe.value=Math.min(Bl,Math.ceil(1.2*Xe.value)))})(ti),Hs=!1;const Li=Ss||Be.value<De.value;Ss=!1,Li&&f7()}function c7(ti,Li={}){var Pl,ma;if(!Ve.value)return;const Dl=De.value;if(Be.value>=Dl)return;const Bl=Math.max(1,ti),Nr=()=>{const Gc=R0();Kt=null;const Z1=vn??Bl;vn=null;const Yc=R0();Be.value=Math.min(Dl,Be.value+Z1),Ht(Be.value),(function(Pv,O0){if(!re)return void u7(O0);Hs=!0;const p7=++Qn;yt().then(()=>{var h7;if(p7!==Qn)return;const dR=R0(),fR=Math.max(O0,dR-Pv),m7=()=>{p7===Qn&&u7(fR)};if(wt){let Eu=null,Xc=null,v7=!1;const y7=()=>{v7||(v7=!0,Eu!==null&&($r.delete(Eu),Eu=null),Xc!==null&&(il.delete(Xc),window.clearTimeout(Xc),Xc=null),m7())};return Eu=wt(()=>{y7()}),$r.add(Eu),Xc=window.setTimeout(()=>{Eu!==null&&dt&&dt(Eu),y7()},Math.max(32,(h7=q.renderBatchIdleTimeoutMs)!=null?h7:120)),void il.add(Xc)}const g7=window.setTimeout(()=>{il.delete(g7),m7()},0);il.add(g7)})})(Gc,R0()-Yc)};if(!re||Li.immediate)return void Nr();const ga=Math.max(0,(Pl=q.renderBatchDelay)!=null?Pl:16);if(vn=vn!=null?Math.max(vn,Bl):Bl,Kt==null){if(!ae&&Ft&&window.requestIdleCallback){const Gc=Math.max(0,(ma=q.renderBatchIdleTimeoutMs)!=null?ma:120);return fn="idle",void(Kt=window.requestIdleCallback(()=>Nr(),{timeout:Gc}))}if(wt&&!ae)return fn="raf",void(Kt=wt(()=>{ga===0?Nr():(fn="timeout",Kt=window.setTimeout(()=>Nr(),ga))}));fn="timeout",Kt=window.setTimeout(()=>Nr(),ga)}}function d7(ti,Li={}){Hs?Ss=!0:ti==null?f7():c7(ti,Li)}function f7(){Ve.value&&c7(ot.value?Math.max(1,Math.round(Xe.value)):Math.max(1,Ye.value))}return Je([be,Ne,je,Ve,Ye,nt,()=>q.renderBatchDelay],()=>{var ti;const Li=Ne.value,Pl=lt.value,ma=je.value,Dl=!Object.is(ma,Pl.key),Bl=Li!==Pl.total,Nr=Dl||Bl;lt.value={key:ma,total:Li};const ga=rt.value,Gc=(ti=q.renderBatchDelay)!=null?ti:16,Z1=ga.batchSize!==Ye.value||ga.initial!==nt.value||ga.delay!==Gc||ga.enabled!==Ve.value;rt.value={batchSize:Ye.value,initial:nt.value,delay:Gc,enabled:Ve.value},Dl&&Vt(Li),(Nr||Z1||!Ve.value)&&K1(),(Nr||Z1)&&(Xe.value=Math.max(1,Ye.value||1)),Nr&&Wt();const Yc=De.value;if(!Li)return Be.value=0,void Ht(0);if(!Ve.value)return Be.value=Yc,void Ht(Be.value);const Pv=Dl||Pl.total===0;Be.value=Pv||Z1?Math.min(Yc,nt.value):Math.min(Be.value,Yc);const O0=Math.max(1,nt.value||Ye.value||Li);Be.value<Yc?d7(O0,{immediate:!re}):Ht(Be.value)},{immediate:!0}),Je(De,(ti,Li)=>{Ve.value&&(typeof Li=="number"&&ti<=Li||ti>Be.value&&d7())}),{cleanupBatchScheduler:K1}})({props:I,isClient:G,isTestEnv:Zi,parsedNodesIdentity:Ys,parsedNodeCount:Nn,desiredRenderedCount:p0,datasetKey:NF,batchingEnabled:Fs,incrementalRenderingActive:Rs,resolvedBatchSize:Ho,resolvedInitialBatch:Co,renderedCount:yo,adaptiveBatchSize:Le,previousRenderContext:ht,previousBatchConfig:Ze,requestFrame:Bo,cancelFrame:Zo,hasIdleCallback:Il,cleanupNodeVisibility:MF,onDatasetKeyChanged:L=>{qc(),so(),Pt(),P1(),L>0&&Rc(L)},onDatasetChanged:()=>{sn.value&&Lr({immediate:!0})}});Je([c6,sn,()=>O.value,()=>oe()],([L,q])=>{if(!L)return v6(),void G2();TF(),q?Lr({immediate:!0}):G2()},{flush:"post",immediate:!0}),Je([()=>St.value.length,()=>sn.value],L=>mo(null,[L],function*([q,re]){re&&q&&G&&(yield yt(),Lr({immediate:!0}))}),{flush:"post"}),Je(kn,L=>{L&&(function(){var q;if(no.value&&$s.value&&Xs.value&&((q=ci.value)!=null&&q[1]))return;const re=kt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),ae=kt({type:"list_item",children:[re],raw:"- Probe paragraph text"}),be=kt({type:"list",ordered:!1,items:[ae],raw:"- Probe paragraph text"});no.value=re,$s.value=ae,Xs.value=be;const Ne={1:null,2:null,3:null,4:null,5:null,6:null};for(let De=1;De<=6;De++)Ne[De]=kt({type:"heading",level:De,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(De)} Probe heading`});ci.value=Ne})()},{immediate:!0}),Je([()=>O.value,kn],()=>{if(!kn.value)return ev(),void(ne.value=0);k6(),ev(),kn.value&&O.value&&typeof ResizeObserver<"u"&&(T1=new ResizeObserver(()=>{k6(),Os.value&&yu(),Dt.value&&Uc(),po("resize")}),T1.observe(O.value))},{immediate:!0}),Je([kn,Ns,Ji],()=>mo(null,null,function*(){if(!kn.value)return X.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Pt();yield yt(),(function(){if(!kn.value||typeof window>"u")return X.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Pt();const L={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},q=y6(Q2(F.value),".paragraph-node");L.paragraph=l4(F.value,q,"pre-wrap");const re=Q2(U.value),ae=re?.querySelector(".paragraph-node");L.listItem=l4(U.value,ae,"pre-wrap");const be=qt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var De,je;return(je=(De=z.value)==null?void 0:De.offsetHeight)!=null?je:0}),Ne=qt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var De,je;return(je=(De=U.value)==null?void 0:De.offsetHeight)!=null?je:0});L.listWrapperOverhead=Math.max(0,be-Ne);for(let De=1;De<=6;De++){const je=y6(Q2(W[De]),`h${De}`);L.headings[De]=l4(W[De],je,"pre-wrap")}X.value=L,Pt()})()}),{flush:"post",immediate:!0}),Je(()=>St.value.length,()=>{sn.value&&Lr({immediate:!0})}),Je([kn,ne],()=>{Pt(),sn.value&&Lr({immediate:!0}),Os.value&&yu(),Dt.value&&Uc(),po("resize")},{immediate:!1}),Je(()=>nl.value,L=>{if(L)for(const[q,re]of ao)S0(q,re);else if(X2(),sn.value)Lr({immediate:!0});else for(const[q,re]of ao)re&&pa(q,!0)},{immediate:!1}),Je([pe,ve,()=>oe()],()=>{var L;(L=Js.refresh)==null||L.call(Js);for(const[q,re]of ao)S0(q,re)},{immediate:!1}),Je([()=>I.viewportPriority,()=>St.value.length,ve],([L,q,re])=>{if(L!==!1){if(K.value&&(q<=200||q<=re)){K.value=!1;for(const[ae,be]of ao)S0(ae,be)}}else K.value=!1}),Je(()=>yo.value,()=>{sn.value&&Lr({immediate:!0})}),Je([Nl,Io,Qo,()=>St.value.length,sn],()=>{M1()},{immediate:!0});let B1=null,H1=!1,Kc=null;function z1(){B1=null,av=null,lv=void 0,Hc=null,P1()}function Lv(){qc(),so(),Pt(),zo.clear();const L=St.value.length;L>0&&Rc(L),bv()}function $v(){Tv(),m6(),F1=null,xu=null,Su=null,w0=null,L1=null,$1=null,H1=!1,z1(),T6("restore"),$c(),Wc()}function W1(L){var q;return[(q=ns())!=null?q:"",wo(),Rl(),k0.value,O1(L),St.value.length,Math.round(ko(0,St.value.length)),Math.round(Cu()),hi.count,Math.round(hi.total)].join(":")}function q6(){return mo(this,null,function*(){var L,q,re,ae;const be=(L=o.virtualScroll)==null?void 0:L.settledToken,Ne=O1(be),De=wo(),je=ns(),ot=Ji.value;if(Ct.value&&((q=o.virtualScroll)==null?void 0:q.settleMode)==="manual"&&b0(be))if(uv()){if(W1(be)!==Hc&&!H1){H1=!0;try{const Ve=yield wv({reason:"manual",expectedSettledTokenKey:Ne}),Ye=O1()===Ne;Cv(De,je,ot)&&Ve.sessionKey===De&&Ve.threadKey===je&&Ye&&Ve.stable&&Ve.phase==="final"&&(Hc=W1((re=o.virtualScroll)==null?void 0:re.settledToken))}finally{H1=!1,yield yt();const Ve=(ae=o.virtualScroll)==null?void 0:ae.settledToken,Ye=b0(Ve)?W1(Ve):"";Cv(De,je,ot)&&Ye&&Hc!==Ye&&q6()}}}else po("manual")})}Je(Ct,(L,q)=>{if(L!==q){if(!L)return $v(),void Tv();$v(),Lv(),Kc=Ji.value,po("content")}},{flush:"post"}),Je([Ct,Ji],([L,q])=>{L?Kc!=null?Kc!==q&&(Kc=q,(function(re="resize"){qc(),so(),Pt(),zo.clear();const ae=St.value.length;ae>0&&Rc(ae),bv(),xu=null,Su=null,w0=null,F1=null,H1=!1,z1(),D6(),yt(()=>{Ol(),Os.value&&yu(),Dt.value&&Uc(),po(re)})})("resize")):Kc=q:Kc=null},{flush:"post",immediate:!0}),Je([Ct,()=>wo(),()=>ns()],([L])=>{L&&($v(),Lv(),T6("content"),po("content"))}),Je([Ct,()=>wo(),()=>ns(),Ji,()=>St.value.length],([L])=>{L&&(function(q="async-node"){let re=!1;for(const[ae,be]of Array.from(sl.entries()))iv(be)||(sl.delete(ae),Yi.delete(ae),re=!0);re&&(Dc(),po(q))})("async-node")},{flush:"post"}),Je([Ct,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.sessionKey},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>o.indexKey,()=>ie.value],([L])=>{L&&(P1(),(function(q="content"){if(!Ct.value)return;const re=[],ae=St.value.length,be=J2(ae);for(const Ne of Array.from(zo.keys())){if(Ne>=ae){re.push(Ne);continue}if(Ne<be)continue;const De=I1(Ne),je=zo.get(Ne);je!=null&&je!==De&&re.push(Ne),zo.set(Ne,De)}for(const Ne of Array.from(zo.keys()))Ne>=ae&&zo.delete(Ne);re.length&&((function(Ne,De={}){const je=Array.from(Ne,Number);Gt(je);let ot=0;if(an(()=>(ot=q2(je,De),ot>0)),ot>0)(function(Ve){for(const Ye of Ve)zo.delete(Ye)})(je);else for(const Ve of je)J.delete(Ve)})(re,{notify:!1}),Pt(),z1(),Os.value&&yu(),Dt.value&&Uc(),po(q))})("content"))},{flush:"post",immediate:!0}),Je([Ct,()=>St.value.length,()=>wo(),()=>ns()],([L,q,re,ae],[be,Ne,De,je])=>{L&&be&&re===De&&ae===je&&q!==Ne&&z1()},{flush:"post"}),Je([Ct,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.heightCache},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.heightCacheWidth},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>St.value.length,()=>wo(),ne],()=>{D6()},{flush:"post",immediate:!0}),Je([Ct,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreAnchor},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>St.value.length,()=>wo(),ne],L=>mo(null,[L],function*([q,re]){if(!q||!re)return;yield yt();const ae=(function(){var be;const Ne=(be=o.virtualScroll)==null?void 0:be.restoreAnchor;return Ne==null||Ne===!1?null:Ne===!0?"true":String(Ne)})();kv(re,{restoreAnchor:ae!=null,restoreToken:ae??void 0})}),{flush:"post",immediate:!0}),Je([Ct,ne,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey}],([L])=>{var q;if(!L)return;const re=(q=o.virtualScroll)==null?void 0:q.restoreState;re&&xu&&Su==="restore"&&(O6(re)||(Lv(),xu=null,Su=null,po("resize")))},{flush:"post"}),Je([Ct,()=>St.value.length,()=>wo(),ne],L=>mo(null,[L],function*([q]){var re;const ae=L1,be=$1;q&&ae&&(yield yt(),!kv(ae,{restoreAnchor:be?.restoreAnchor===!0,restoreToken:(re=be?.restoreToken)!=null?re:"imperative",allowUncapturedAnchor:be?.allowUncapturedAnchor===!0})&&B6(ae)||(L1=null,$1=null))}),{flush:"post",immediate:!0}),Je([Ct,Oe,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settleMode},()=>wo(),()=>ns(),Ji,Z2,f6,()=>yo.value,p0,()=>hi.count,()=>hi.total],([L,q,re])=>{if(!L||q!==!0||re==="manual"||!cv())return;const ae=(function(){var be;const Ne=St.value.length;return[(be=ns())!=null?be:"",wo(),Rl(),k0.value,Ne,Math.round(ko(0,Ne)),Math.round(Cu()),hi.count,Math.round(hi.total)].join(":")})();B1!==ae&&(B1=ae,wv({reason:"final"}).then(be=>{be.stable||B1!==ae||(B1=null)}))},{flush:"post",immediate:!0}),Je([Ct,Oe,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settleMode},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settledToken},()=>wo(),()=>ns(),Ji,Z2,f6,()=>yo.value,p0,()=>St.value.length,()=>hi.count,()=>hi.total],()=>{q6()},{flush:"post",immediate:!0}),Je([()=>St.value.length,sn,Io,Qo,()=>Ds.start,()=>Ds.end],([L,q,re,ae,be,Ne])=>{fe.value&&Mn("virtualization",{nodes:L,virtualization:q,maxLiveNodes:re,buffer:ae,focusIndex:Nl.value,scroll:q?(()=>{const De=ut.value||ue();return De?{reverse:Se(De),scrollTop:Math.round(De.scrollTop),scrollTopAbs:Math.round(Math.abs(De.scrollTop)),scrollHeight:Math.round(De.scrollHeight),clientHeight:Math.round(De.clientHeight)}:null})():null,liveRange:{start:be,end:Ne},rendered:yo.value})}),Je([()=>I.customId],([L],q,re)=>{if(!L||Oo)return;const ae=(function(be,Ne){return be?(ys.controllers[be]=Ne,()=>{ys.controllers[be]===Ne&&delete ys.controllers[be]}):()=>{}})(L,{captureRestoreAnchor:Nc,restoreAnchor:Fc,getAnchorDrift:j2,getReport:LF});re(()=>{ae()})},{immediate:!0}),Vn(()=>{(function(){if(Ct.value)try{Ol(),N1();const L=wu("manual");z6(L)&&($(L),F1=L,xv=R1());const q=zc(L,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});q&&(B(q),q.anchor&&H(q.anchor),jc=D1(q))}catch{}})(),jF(),X2(),en(),V6();for(const L of da.values())for(const q of L)m0(q);da.clear(),bu.clear(),zo.clear(),Iv(),qc(),ev(),$c(),Wc(),Tv(),v6(),G2()});const VF=Af("ViewportDeferredMermaidBlockNode",zr({loader:()=>mo(null,null,function*(){try{return(yield jo(()=>import("./index11-Ci8_PlMN.js"),__vite__mapDeps([7,5]))).default}catch(L){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',L),Pi}}),loadingComponent:px,delay:0}),px),qF=Af("ViewportDeferredInfographicBlockNode",zr({loader:()=>mo(null,null,function*(){try{return(yield jo(()=>import("./index10-BCo1_xRY.js"),[])).default}catch(L){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',L),Pi}}),loadingComponent:fx,delay:0}),fx),KF=Af("ViewportDeferredD2BlockNode",zr(()=>mo(null,null,function*(){try{return(yield jo(()=>import("./index8-BaK3y7fN.js"),[])).default}catch(L){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',L),Pi}})),Pi),K6={text:qo,paragraph:cc,heading:L2,code_block:X9,list:qd,list_item:Vd,blockquote:tm,table:ep,definition_list:nm,footnote:om,footnote_reference:or,footnote_anchor:Jf,admonition:lm,vmr_container:im,hardbreak:qa,link:Mi,image:Va,thematic_break:sm,math_inline:Jr,math_block:C$,strong:Si,emphasis:Ti,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,checkbox:nr,checkbox_input:nr,inline_code:li,html_inline:sr,reference:xi,html_block:Qf},ZF=R(()=>ov()),Z6=R(()=>X_(I.codeBlockProps)),GF=R(()=>X_(I.codeBlockProps,{omit:["langs"]})),G6=R(()=>mt(mt({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,monacoOptions:I.codeBlockMonacoOptions,themes:I.themes,langs:m.value==="shiki"?I.langs:void 0,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof we.value=="boolean"?{showTooltips:we.value}:{}),GF.value)),Y6=R(()=>mt(rn(mt({},G6.value),{langs:I.langs}),Z6.value));function X6(L){return typeof L=="boolean"?L:void 0}const YF=R(()=>{const L=I.codeBlockProps||{},q={},re=X6(L.showLineNumbers);re!==void 0&&(q.showLineNumbers=re);const ae=X6(L.diffInline);ae!==void 0&&(q.diffInline=ae);const be=(function(Ne){const De=Number(Ne);return Number.isFinite(De)&&De>0?De:void 0})(L.reservedHeightPx);return be!==void 0&&(q.reservedHeightPx=be),q}),XF=R(()=>mt(mt({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,themes:I.themes,langs:I.langs,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof we.value=="boolean"?{showTooltips:we.value}:{}),Z6.value)),JF=R(()=>mt({},I.mermaidProps||{})),J6=R(()=>mt({},I.d2Props||{})),QF=R(()=>mt({},I.infographicProps||{})),U1=R(()=>({typewriter:f.value,fade:I.fade,customHtmlTags:lo.value.customHtmlTags})),eR=R(()=>mt(mt({},U1.value),typeof we.value=="boolean"?{showTooltip:we.value}:{})),tR=R(()=>mt(mt({},U1.value),typeof we.value=="boolean"?{showTooltips:we.value}:{})),nR=R(()=>mt(mt({},U1.value),typeof we.value=="boolean"?{showTooltips:we.value}:{})),oR=R(()=>mt(mt({},U1.value),typeof we.value=="boolean"?{showTooltips:we.value}:{}));function sR(L){return Array.isArray(L.children)&&L.children.length>0}const M0=R(()=>IF.value.map(L=>{var q,re,ae,be,Ne,De,je,ot;let Ve=(function(dt){var Ft,Ht,Vt,Wt,Kt,fn,vn;if(dt.type!=="code_block")return dt;const Qn=dt,Hs=[String((Ft=Qn.language)!=null?Ft:""),String((Ht=Qn.loading)!=null?Ht:""),String((Vt=Qn.diff)!=null?Vt:""),String((Wt=Qn.code)!=null?Wt:""),String((Kt=Qn.originalCode)!=null?Kt:""),String((fn=Qn.updatedCode)!=null?fn:""),String((vn=Qn.raw)!=null?vn:"")].join("\0"),Ss=Ll.get(Qn);if(Ss&&Ss.signature===Hs)return Ss.node;const $r=mt({},Qn);return Ll.set(Qn,{signature:Hs,node:$r}),$r})(L.node);const Ye=T0(Ve);let nt=n7(Ve,Ye);if((Ve.type==="html_block"||Ve.type==="html_inline")&&nt===K6[Ve.type]){const dt=Ve,Ft=String((q=dt.tag)!=null?q:"").trim().toLowerCase()||ZI(dt.content);if(Ft){const Ht=In.value[Ft];if(To.value.has(Ft)&&Ht)nt=Ht,Ve=rn(mt({},dt),{type:Ft,tag:Ft,content:pie(dt.content,Ft)});else if(GI((re=dt.content)!=null?re:dt.raw,Ft)){const Vt=String((be=(ae=dt.content)!=null?ae:dt.raw)!=null?be:"");Ve.type==="html_inline"?(nt=qo,Ve={type:"text",content:Vt,raw:Vt}):(nt=cc,Ve={type:"paragraph",children:[{type:"text",content:Vt,raw:Vt}],raw:Vt})}}}const Be=Ve.type==="code_block"&&m.value==="pre"&&nt===Pi&&!Nv(In.value,Ye);let Xe=mt({},(function(dt,Ft,Ht){const Vt=Ft??T0(dt);if(dt.type==="code_block"){const Wt=Vt?Nv(In.value,Vt):void 0;if(Ht&&m.value==="pre"&&!Wt&&Ht===Pi)return YF.value;if(Ht&&Vt&&Ht===Wt)return Vt==="mermaid"?e7(dt):Vt==="infographic"?t7(dt):Vt==="d2"||Vt==="d2lang"?J6.value:Y6.value;if(Ht&&Ht===In.value.code_block)return Y6.value;if(C6(Ht))return XF.value}return Vt==="mermaid"?e7(dt):Vt==="infographic"?t7(dt):Vt==="d2"||Vt==="d2lang"?J6.value:dt.type==="link"?eR.value:dt.type==="list"?tR.value:dt.type==="blockquote"?nR.value:dt.type==="table"?oR.value:dt.type==="code_block"?G6.value:U1.value})(Ve,Ye,nt));const lt=kn.value?Pc.value[L.index]:null;Ve.type==="code_block"&&lt?.kind==="code-block"&&(Xe=rn(mt({},Xe),Be?{reservedHeightPx:(Ne=lt.height)!=null?Ne:lt.contentHeight}:{estimatedHeightPx:lt.height,estimatedContentHeightPx:lt.contentHeight,estimatedDiffInline:lt.diffInline})),Be||Ve.type!=="code_block"||Ye!=="mermaid"||Md(Xe.estimatedPreviewHeightPx)!=null||(Xe=rn(mt({},Xe),{estimatedPreviewHeightPx:lg(ig(String((De=Ve.code)!=null?De:"")))})),Be||Ve.type!=="code_block"||Ye!=="infographic"||Md(Xe.estimatedPreviewHeightPx)!=null||(Xe=rn(mt({},Xe),{estimatedPreviewHeightPx:ag(rg(String((je=Ve.code)!=null?je:"")))})),Ve.type==="math_block"&&(Xe=rn(mt({},Xe),{cacheScope:_n}));const rt=(function(dt,Ft){const Ht=String(dt.type);return!Qp(Ht)&&In.value[Ht]===Ft})(Ve,nt),wt=rt?p5(Ve,ge.value):void 0;return rn(mt({},L),{node:Ve,component:nt,bindings:Xe,customBindings:mt(mt({},wt??{}),Xe),rendersCustomNode:rt,hasSlotChildren:sR(Ve),slotContent:String((ot=Ve.content)!=null?ot:""),isCodeBlock:Ve.type==="code_block",indexKey:`${ZF.value}-${L.index}`,vnodeKey:`${$F.value}\0${L.index}\0${Ve.type}`})}));function T0(L){var q;return L?.type==="code_block"?String((q=L.language)!=null?q:"").trim().toLowerCase():""}function Nv(L,q){const re=q.trim().toLowerCase();if(re)for(const ae of[re,T2(re),n$(re)]){const be=ae&&L[ae];if(be)return be}}function Q6(L,q,re,ae){var be,Ne;const De=mt({},L.value);return Md(De.estimatedPreviewHeightPx)==null&&(De.estimatedPreviewHeightPx=ae(re(String((be=q?.code)!=null?be:"")),void 0,De.maxHeight==="none"?null:(Ne=Md(De.maxHeight))!=null?Ne:void 0)),De}function e7(L){return Q6(JF,L,ig,lg)}function t7(L){return Q6(QF,L,rg,ag)}function n7(L,q){if(!L)return l8;const re=In.value,ae=re[String(L.type)];if(L.type==="code_block"){const be=q??T0(L),Ne=be?Nv(re,be):void 0;return Ne||(m.value==="pre"?re.code_block||Pi:be==="mermaid"?re.mermaid||VF:be==="infographic"?re.infographic||qF:be==="d2"||be==="d2lang"?re.d2||KF:ae||re.code_block||w6.value)}return ae||K6[String(L.type)]||l8}function Fv(L){s("click",L)}function iR(L){var q;(q=L.target)!=null&&q.closest("[data-node-index]")&&s("mouseover",L)}function rR(L){var q;(q=L.target)!=null&&q.closest("[data-node-index]")&&s("mouseout",L)}function o7(L){s("mouseover",L)}function s7(L){s("mouseout",L)}const Tu=Z(null),Ii=Z(!1),j1=Z(null),lR=R(()=>!(I.domMode!=="minimal"||Y.value||I.fade!==!1||f.value||Ii.value||Xt.value||sn.value||Qe.value||co.value||Ki.value||Object.keys(In.value).length!==0));let V1,Zc=null,Rv=0,E0=0,I0=0;const i7=["code_block","admonition","table","math_block","html_block","image","thematic_break"],aR=new Set(i7),r7=[".typewriter-cursor",".height-estimation-probes",...i7.map(L=>`[data-node-type="${L}"]`),"script","style"].join(",");function l7(L){if(!L||typeof L!="object")return!1;const q=L.type;return typeof q=="string"&&aR.has(q)}function L0(L){var q,re;if(!L||typeof L!="object")return 0;const ae=L,be=(re=(q=ae.raw)!=null?q:ae.content)!=null?re:ae.code;if(typeof be=="string")return be.length;const Ne=ae.children;if(Array.isArray(Ne))return Ne.reduce((je,ot)=>je+L0(ot),0);const De=ae.items;return Array.isArray(De)?De.reduce((je,ot)=>je+L0(ot),0):0}function $0(){V1&&(clearTimeout(V1),V1=void 0)}function Ov(){Rv+=1,Zc!=null&&(Zo?.(Zc),Zc=null)}function q1(){Ov(),ha(),Tu.value&&(Tu.value.style.visibility="hidden")}function uR(L){var q;if(L.nodeType!==Node.TEXT_NODE||!((q=L.textContent)!=null?q:"").trim())return!1;const re=L.parentElement;return!!re&&!re.closest(r7)}function cR(L){let q=L.lastChild;for(;q;){if(uR(q))return q;if(q.nodeType===Node.ELEMENT_NODE){const re=q;if(!re.matches(r7)&&re.lastChild){q=re.lastChild;continue}}for(;q&&q!==L&&!q.previousSibling;)q=q.parentNode;if(!q||q===L)break;q=q.previousSibling}return null}function a7(){const L=M0.value;for(let q=L.length-1;q>=0;q--){const re=L[q];if(!re||l7(re.node)||!x0(re.index))continue;const ae=ao.get(re.index);if(!ae)continue;const be=cR(ae);if(be)return be}return null}function ha(){j1.value&&(j1.value.classList.remove(hx),j1.value=null)}function N0(){if(d.value!=="simple"||!G||!Ii.value||!O.value)return void ha();const L=a7(),q=L?(function(re){var ae;const be=(ae=re.parentElement)==null?void 0:ae.closest(".text-node");return be instanceof HTMLElement?be:re.parentElement})(L):null;q!==j1.value&&(ha(),q&&(q.classList.add(hx),j1.value=q))}function F0(){if(d.value!=="precise"||!G||!Ii.value||Zc!=null)return;const L=Rv,q=()=>{Zc=null,L===Rv&&(function(){var re,ae;if(d.value!=="precise"||!(G&&Ii.value&&O.value&&Tu.value))return;const be=O.value,Ne=Tu.value;Ne.style.visibility="hidden";const De=a7();if(!De)return;let je=0,ot=0,Ve=20,Ye=!1;if(De?.textContent){const nt=De.textContent.length,Be=document.createRange();Be.setStart(De,Math.max(0,nt-1)),Be.setEnd(De,nt);const Xe=typeof Be.getClientRects=="function"?Be.getClientRects():void 0,lt=(ae=Xe?.[Xe.length-1])!=null?ae:(re=De.parentElement)==null?void 0:re.getBoundingClientRect();if(lt){const rt=qt("typewriterCursor.root.getBoundingClientRect",()=>be.getBoundingClientRect());je=lt.right-rt.left+be.scrollLeft,ot=lt.top-rt.top+be.scrollTop,Ve=lt.height||Ve,Ye=!0}Be.detach()}Ye&&(Ne.style.transform=`translate(${Math.max(0,je)}px, ${Math.max(0,ot)}px)`,Ne.style.height=`${Ve}px`,Ne.style.visibility="visible")})()};Bo?Zc=Bo(q):q()}return Je([it,()=>o.content,()=>o.nodes,()=>I.typewriter,Oe],()=>mo(null,null,function*(){var L,q;if(!G||Y.value||!te.value)return;if(Oe.value)return Ii.value=!1,$0(),void q1();if((L=o.nodes)!=null&&L.length)return Ii.value=!1,$0(),q1(),E0=((q=o.content)!=null?q:"").length,void(I0=it.value.length);const re=(function(){var je,ot;return(je=o.nodes)!=null&&je.length?o.nodes.reduce((Ve,Ye)=>Ve+L0(Ye),0):((ot=o.content)!=null?ot:"").length})(),ae=(function(){var je;return(je=o.nodes)!=null&&je.length?o.nodes.reduce((ot,Ve)=>ot+L0(Ve),0):it.value.length})(),be=!l7(St.value[St.value.length-1]),Ne=re>E0,De=ae>I0;if(!f.value||!be||!Ne&&!De)return f.value&&be||(Ii.value=!1,q1()),E0=re,void(I0=ae);E0=re,I0=ae,Ii.value=!0,d.value==="precise"&&Tu.value&&(Tu.value.style.visibility="hidden"),$0(),yield yt(),d.value==="simple"?N0():(ha(),F0()),V1=setTimeout(()=>{V1=void 0,Ii.value=!1},3e3)}),{flush:"post",immediate:!0}),Je(Ii,L=>mo(null,null,function*(){L?(yield yt(),d.value!=="simple"?(ha(),d.value==="precise"&&F0()):N0()):q1()}),{flush:"post"}),Je(d,()=>mo(null,null,function*(){if(G&&!Y.value&&te.value&&Ii.value){if(yield yt(),d.value==="simple")return Ov(),void N0();ha(),d.value!=="precise"?q1():F0()}}),{flush:"post"}),Je([()=>yo.value,()=>Ds.start,()=>Ds.end],()=>mo(null,null,function*(){G&&!Y.value&&te.value&&Ii.value&&(yield yt(),d.value!=="simple"?(ha(),d.value==="precise"&&F0()):N0())}),{flush:"post"}),Vn(()=>{$0(),Ov(),ha(),xs.clear()}),(L,q)=>{const re=zO("NodeRenderer",!0);return p(Y)?(y(!0),M(Pe,{key:0},pt(M0.value,ae=>(y(),M(Pe,{key:ae.vnodeKey},[ae.rendersCustomNode?(y(),he(bs(ae.component),zn({key:0,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onClick:Fv,onMouseover:o7,onMouseout:s7,onCopy:q[0]||(q[0]=be=>i(be)),onHandleArtifactClick:q[1]||(q[1]=be=>s("handleArtifactClick",be))}),{default:me(()=>[ae.hasSlotChildren?(y(),he(re,zn({key:0,ref_for:!0},uo.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(y(),he(re,zn({key:1,ref_for:!0},uo.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(y(),he(bs(ae.component),zn({key:1,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onClick:Fv,onMouseover:o7,onMouseout:s7,onCopy:q[2]||(q[2]=be=>i(be)),onHandleArtifactClick:q[3]||(q[3]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(y(),M("div",{key:1,ref_key:"containerRef",ref:O,class:Re(["markstream-vue markdown-renderer",[{dark:I.isDark},{virtualized:sn.value},{"virtual-scroll-coordinated":Qt.value},{"stable-layout":_F.value},{"typewriter-simple-cursor":Ii.value&&d.value==="simple"}]]),"data-custom-id":I.customId,onClick:Fv,onMouseover:iR,onMouseout:rR},[Ko.value||sn.value?(y(),M(Pe,{key:0},[Ko.value?(y(),he(lpe,{key:0,width:Ns.value,"flow-root":sn.value||Qt.value,"paragraph-node":no.value,"list-item-node":$s.value,"list-node":Xs.value,"heading-nodes":ci.value,"set-paragraph-wrapper":xF,"set-list-item-wrapper":SF,"set-list-wrapper":AF,"set-heading-wrapper":EF},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ee("",!0),sn.value?(y(),M("div",{key:1,class:"node-spacer",style:Zt({height:`${tv.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],64)):ee("",!0),lR.value?(y(!0),M(Pe,{key:1},pt(M0.value,ae=>(y(),M(Pe,{key:ae.vnodeKey},[x0(ae.index)?(y(),he(bs(ae.component),zn({key:0,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onMouseover:q[4]||(q[4]=be=>s("mouseover",be)),onMouseout:q[5]||(q[5]=be=>s("mouseout",be)),onCopy:q[6]||(q[6]=be=>i(be)),onHandleArtifactClick:q[7]||(q[7]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ee("",!0)],64))),128)):(y(!0),M(Pe,{key:2},pt(M0.value,ae=>(y(),M("div",{key:ae.vnodeKey,ref_for:!0,ref:be=>S0(ae.index,be),class:"node-slot","data-node-index":ae.index,"data-node-type":ae.node.type},[x0(ae.index)?(y(),M("div",{key:0,ref_for:!0,ref:be=>(function(Ne,De){var je;De||(function(nt){const Be=`${ov()}-${nt}`;let Xe=!1;for(const lt of Array.from(Yi.keys())){const rt=sl.get(lt);(rt?.index===nt||lt===Be||lt.startsWith(`${Be}-`))&&(Yi.delete(lt),sl.delete(lt),Xe=!0)}Xe&&(Dc(),po("async-node"))})(Ne),Fl.delete(Ne),(function(nt){var Be;const Xe=((Be=bu.get(nt))!=null?Be:0)+1;bu.set(nt,Xe)})(Ne);const ot=da.get(Ne);if(ot){for(const nt of ot)m0(nt);da.delete(Ne)}if((function(nt){const Be=Gi.get(nt);Be&&(fi?.unobserve(Be),Er.delete(Be),Gi.delete(nt))})(Ne),!De||!es.value)return ol.delete(Ne),void bu.delete(Ne);ol.set(Ne,De);const Ve=()=>{A0(Ne,De)};queueMicrotask(Ve);const Ye=(fi||typeof ResizeObserver>"u"||(fi=new ResizeObserver(nt=>{if(nt.length)for(const Be of nt){const Xe=Er.get(Be.target),lt=Gi.get(Xe??-1);Xe!=null&&lt&&A0(Xe,lt)}else Ol()})),fi);if(Ye&&(Gi.set(Ne,De),Er.set(De,Ne),Ye.observe(De)),typeof window<"u"){const nt=((je=St.value[Ne])==null?void 0:je.type)==="code_block"?[16,80,240,800]:Oe.value?[80]:[];if(nt.length){const Be=nt.map(Xe=>h6(Xe,Ve,"node-resize")).filter(Xe=>Xe!=null);Be.length&&da.set(Ne,Be)}}})(ae.index,be),class:"node-content"},[ae.isCodeBlock?ae.rendersCustomNode?(y(),he(bs(ae.component),zn({key:1,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:q[12]||(q[12]=be=>i(be)),onHandleArtifactClick:q[13]||(q[13]=be=>s("handleArtifactClick",be))}),{default:me(()=>[ae.hasSlotChildren?(y(),he(re,zn({key:0,ref_for:!0},uo.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(y(),he(re,zn({key:1,ref_for:!0},uo.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(y(),he(bs(ae.component),zn({key:2,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:q[14]||(q[14]=be=>i(be)),onHandleArtifactClick:q[15]||(q[15]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(y(),he(as,{key:0,name:"fade",css:I.fade!==!1,appear:I.fade!==!1},{default:me(()=>[ae.rendersCustomNode?(y(),he(bs(ae.component),zn({key:0,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:q[8]||(q[8]=be=>i(be)),onHandleArtifactClick:q[9]||(q[9]=be=>s("handleArtifactClick",be))}),{default:me(()=>[ae.hasSlotChildren?(y(),he(re,zn({key:0,ref_for:!0},uo.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(y(),he(re,zn({key:1,ref_for:!0},uo.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(y(),he(bs(ae.component),zn({key:1,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:q[10]||(q[10]=be=>i(be)),onHandleArtifactClick:q[11]||(q[11]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(y(),M("div",{key:1,class:"node-placeholder",style:Zt({height:`${Yn(ae.index)}px`})},null,4))],8,cpe))),128)),Ii.value&&d.value==="precise"?(y(),M("span",{key:3,ref_key:"typewriterCursorRef",ref:Tu,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ee("",!0),sn.value?(y(),M("div",{key:4,class:"node-spacer",style:Zt({height:`${nv.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],42,upe))}}})),[["__scopeId","data-v-a9489508"]]),Vi=R$;Vi.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Vi.__name,Vi.name].filter(n=>!!n));for(const n of t)e.component(n,R$)};const M5=Object.freeze(Object.defineProperty({__proto__:null,default:Vi},Symbol.toStringTag,{value:"Module"})),dpe={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},fpe={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},ppe={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},hpe={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},mpe={class:"admonition-title"},gpe=["aria-expanded","aria-controls"],vpe=["id"],lm=Gn(et({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,s=t,i=R(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const u=o.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=Z(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(y(),M("div",{class:Re(["admonition",[`admonition-${o.node.kind}`]])},[C("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(y(),M("svg",dpe,[...c[1]||(c[1]=[C("circle",{cx:"12",cy:"12",r:"10"},null,-1),C("path",{d:"M12 16v-4"},null,-1),C("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(y(),M("svg",fpe,[...c[2]||(c[2]=[C("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),C("path",{d:"M9 18h6"},null,-1),C("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(y(),M("svg",ppe,[...c[3]||(c[3]=[C("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),C("path",{d:"M12 9v4"},null,-1),C("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(y(),M("svg",hpe,[...c[4]||(c[4]=[C("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),C("path",{d:"M12 8v4"},null,-1),C("path",{d:"M12 16h.01"},null,-1)])])):ee("",!0),C("span",mpe,N(i.value),1),o.node.collapsible?(y(),M("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(y(),M("svg",{style:Zt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[C("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,gpe)):ee("",!0)]),Bn(C("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[j(p(Vi),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:c[0]||(c[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,vpe),[[qs,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);lm.install=e=>{e.component(lm.__name,lm)};const f8=()=>jo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let xh=null,Sh=f8,Ah=null,mx=!1,gx=!1;function $Ve(){return mo(this,null,function*(){if(xh)return xh;const e=Sh;return e?e===f8&&mx?null:Ah||(Ah=mo(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===f8)return e===Sh&&(mx=!0,(function(o){gx||(gx=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',o))})(n)),null;throw n}finally{e===Sh&&(Ah=null)}return e!==Sh?null:t?(xh=(function(n){var o;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),xh):null}),Ah):null})}let Mh=null,O$=null,Th=null;function NVe(){return typeof O$=="function"}function FVe(){return mo(this,null,function*(){if(Mh)return Mh;const e=O$;return e?Th||(Th=mo(null,null,function*(){const t=yield e(),n=(function(o){var s,i,r;if(!o)return null;const l=(s=o.default)!=null?s:o,a=typeof l=="function"&&typeof((i=l.prototype)==null?void 0:i.render)=="function"?l:(r=o.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(Mh=n,Mh):null}).finally(()=>{Th=null}),Th):null})}const RVe=Symbol("markstreamLanguageIconResolver"),P$=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],ype=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),p8=[...P$].sort((e,t)=>t.length-e.length).join("|"),a4=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${p8}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${p8})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),D$=/[),.;!?,。;!?)]+$/;function kpe(e){const t=e.toLowerCase();return P$.some(n=>t.endsWith(`.${n}`))}function bpe(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${p8}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function Cpe(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(D$,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=ype.has(i),a=kpe(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const u=o[2]??o[3],c=u?Number(u):void 0;return{path:s,line:c!==void 0&&Number.isFinite(c)&&c>0?c:void 0}}function wpe(e,t={}){const n=[];a4.lastIndex=0;let o;for(;(o=a4.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const u=a.replace(D$,""),c=a.length-u.length;a=u;const d=Cpe(a,t);if(!d)continue;const f=o.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),c>0&&(a4.lastIndex-=c)}return n}function u4(e,t){let n=0,o=t-1;for(;o>=0&&e[o]==="\\";)n++,o--;return n%2===1}const _pe=/\s/,xpe=/\p{Nd}/u;function Cc(e,t){const n=e.codePointAt(t);return n===void 0?void 0:String.fromCodePoint(n)}function Spe(e,t){if(t<=0)return;const n=e.charCodeAt(t-1),o=n>=56320&&n<=57343&&t>1?t-2:t-1,s=e.codePointAt(o);return s===void 0?void 0:String.fromCodePoint(s)}function vx(e){return e!==void 0&&_pe.test(e)}function a1(e){return e!==void 0&&xpe.test(e)}function Ape(e,t){const n=e[t+1];return a1(Cc(e,t+1))?!0:(n==="-"||n==="+"||n==="."||n==="−"||n==="+"||n==="-")&&a1(Cc(e,t+2))}function vg(e){return e!==void 0&&e>="A"&&e<="Z"}const B$=new RegExp(String.raw`^(?:AED|AFN|ALL|AMD|ANG|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BGN|BHD|BIF|BMD|BND|BOB|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHF|CLF|CLP|CNY|COP|CRC|CUC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SLL|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|UYU|UZS|VED|VES|VND|VUV|WST|XAF|XCD|XOF|XPF|YER|ZAR|ZMW|ZWL|HK|US|SG|AU|CA|NZ|NT|TW|RMB|MEX|TT|BZ|EU|UK)$`);function Mpe(e,t){if(!vg(e[t-1]))return!1;let n=t-1;for(;n>0&&vg(e[n-1]);)n--;return B$.test(e.slice(n,t))||a1(Cc(e,t+1))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")&&!/\p{L}/u.test(Cc(e,t+1)??"")}function Tpe(e,t){if(!vg(e[t-1]))return!1;let n=t-1;for(;n>0&&vg(e[n-1]);)n--;return B$.test(e.slice(n,t))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")}const Epe=/^[-–—,,、;;::~~(([【//]$/;function Ipe(e,t){const n=e[t+1];if(n!=="-"&&n!=="+"&&n!=="."||!a1(Cc(e,t+2)))return!1;const o=e[t-1];return o!==void 0&&Epe.test(o)}function Lpe(e){const t=String.raw`[、,,;;::~~\-–—至到//\s()()=*×=]|和|跟|与|及|或|and|or`;let n=e.replace(new RegExp(String.raw`^(?:${t})+`,"u"),"");for(;;){const s=n.replace(new RegExp(String.raw`^\p{L}+(?:${t})+`,"u"),"").replace(/^[\p{L}][\p{L} ]*(?=\p{Nd})/u,"");if(s===n)break;n=s}if(!/\p{Nd}/u.test(n))return!1;const o=String.raw`[-+]?[\p{Nd}][\p{Nd},.'’]*`;return new RegExp(String.raw`^${o}(?:\p{L}+)?(?:(?:${t})+${o}(?:\p{L}+)?)*$`,"u").test(n)}const ul=-1,yx=1,kx=2,bx=3;function $pe(e){const t=e.length,n=new Uint8Array(t),o=new Int32Array(t+1).fill(ul),s=new Int32Array(t+1),i=new Int32Array(t+1),r=[],l=[];{const F=[];for(let K=0;K<t;K++)if(e[K]==="`"){if(u4(e,K))continue;let V=K+1;for(;V<t&&e[V]==="`";)V++;F.push([K,V]),K=V-1}const U=new Map;for(let K=0;K<F.length;K++){const V=F[K][1]-F[K][0],ie=U.get(V);ie?ie.push(K):U.set(V,[K])}const z=new Map;let W=0;for(;W<F.length;){const[K,V]=F[W],ie=V-K,ne=U.get(ie);let X=z.get(ie)??0;for(;X<ne.length&&ne[X]<=W;)X++;z.set(ie,X),X<ne.length?(l.push([K,F[ne[X]][1]]),W=ne[X]+1):W++}}let a=0;const u=F=>{for(;a<l.length&&F>=(l[a]?.[1]??0);)a++;const U=l[a];return U!==void 0&&F>=U[0]},c=new Set(' \n\r)。,、;:!?"<>`「」『』【】〔〕()*—–“”‘’'),d=[];for(const F of e.matchAll(/\b(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/gi))d.push(F.index);for(const F of e.matchAll(/\b(?:localhost|(?:\d{1,3}\.){3}\d{1,3}|[\w-]+(?:\.[\w-]+)*\.[a-zA-Z]{2,})(?=(?:\/|\?|:\d))/gi))d.push(F.index);for(const F of e.matchAll(/(?:\.{1,2})?\/[\p{L}\p{Nd}._-]+(?:\/[\p{L}\p{Nd}._-]*)*\?/gu))(F.index===0||!/[\w~/.-]/.test(e[F.index-1]))&&d.push(F.index);d.sort((F,U)=>F-U);let f=-1;for(const F of d){if(F<f)continue;let U=F,z=0,W=0,K=0;for(;U<t;){const V=e[U];if(V==="(")z++;else if(V===")"){if(z===0)break;z--}else if(V==="[")W++;else if(V==="]"){if(W===0)break;W--}else if(V==="{")K++;else if(V==="}"){if(K===0)break;K--}else{if(c.has(V))break;if((V===","||V===";"||V==="!"||V==="?")&&!/[A-Za-z0-9$]/.test(e[U+1]??""))break;if(V===":"&&W===0&&U>F+7&&!/[\w/?#@~.+&=%-]/.test(e[U+1]??""))break}U++}r.push([F,U]),f=U}const h=[];for(let F=0;F<t;F++){if(e[F]!=="<"||e[F+1]===void 0||!/[a-zA-Z/]/.test(e[F+1]))continue;let U=F+1;const z=e[U]==="/";z&&U++;const W=/^[a-zA-Z][a-zA-Z0-9-]*/.exec(e.slice(U));if(!W)continue;U+=W[0].length;const K=e[U];if(K===void 0||!/[\s/>]/.test(K))continue;let V=U,ie=ul,ne=ul;for(;V<t;){const X=e[V];if(X===">"){ne=V;break}if(!z&&X==="/"&&e[V+1]===">"){ne=V+1;break}if(!/\s/.test(X)){ie=V;break}for(;V<t&&/\s/.test(e[V]);)V++;const le=e[V];if(le===void 0)break;if(le===">"){ne=V;break}if(z){ie=V;break}if(le==="/"&&e[V+1]===">"){ne=V+1;break}const Ie=/^[a-zA-Z_:][\w:.-]*/.exec(e.slice(V));if(!Ie){ie=V;break}V+=Ie[0].length;let de=V;for(;de<t&&/\s/.test(e[de]);)de++;if(e[de]==="="){for(de++;de<t&&/\s/.test(e[de]);)de++;const pe=e[de];if(pe==='"'||pe==="'"){const ve=e.indexOf(pe,de+1);if(ve===-1){ie=de;break}V=ve+1}else{const ve=/^[^\s"'=<>`]+/.exec(e.slice(de));if(!ve){ie=de;break}V=de+ve[0].length}}}if(ne!==ul)h.push([F,ne+1]),F=ne;else if(ie!==ul){const X=e.indexOf("<",F+1);F=(X!==-1&&X<ie?X:ie)-1}else break}let m=!0,v=!0,k=!0,w=!0;for(let F=0;F<t;F++){if(e[F]!=="<")continue;const U=e[F+1];let z=!1;if(U==="?"&&v){const ie=e.indexOf("?>",F+2);ie===-1?v=!1:(h.push([F,ie+2]),F=ie+1,z=!0)}else if(U==="!"){if(e[F+2]==="-"&&e[F+3]==="-"){if(m){const ie=e.indexOf("-->",F+4);ie===-1?m=!1:(h.push([F,ie+3]),F=ie+2,z=!0)}}else if(e.startsWith("[CDATA[",F+2)){if(k){const ie=e.indexOf("]]>",F+9);ie===-1?k=!1:(h.push([F,ie+3]),F=ie+2,z=!0)}}else if(w&&/[A-Z]/.test(e[F+2]??"")){const ie=e.indexOf(">",F+3);ie===-1?w=!1:(h.push([F,ie+1]),F=ie,z=!0)}}if(z)continue;if(U!==void 0&&/[a-zA-Z]/.test(U)){const ie=/^[a-zA-Z][a-zA-Z0-9+.-]{1,31}:/.exec(e.slice(F+1));if(ie){let ne=F+1+ie[0].length;for(;ne<t&&e[ne]!==">"&&e[ne]!=="<"&&!/\s/.test(e[ne]);)ne++;if(e[ne]===">"){h.push([F,ne+1]),F=ne;continue}}}if(U===void 0||!/[\w.!#$%&'*+/=?^`{|}~-]/.test(U))continue;let W=F+1;for(;W<t&&/[\w.!#$%&'*+/=?^`{|}~-]/.test(e[W]);)W++;if(e[W]!=="@")continue;W++;const K=/^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?/;let V=K.exec(e.slice(W));if(V){for(W+=V[0].length;e[W]==="."&&(V=K.exec(e.slice(W+1)),!!V);)W+=1+V[0].length;e[W]===">"&&(h.push([F,W+1]),F=W)}}h.sort((F,U)=>F[0]-U[0]);const b=[];for(const[F,U]of h){const z=b[b.length-1];z&&F<=z[1]?z[1]=Math.max(z[1],U):b.push([F,U])}r.push(...b);let _=0;const g=F=>{for(;_<b.length&&F>=(b[_]?.[1]??0);)_++;const U=b[_];return U!==void 0&&F>=U[0]},x=[];let S=null,T=0,A=!1;for(let F=0;F<t;F++)if(e[F]==="\\")F++;else if(A)e[F]===">"&&(A=!1);else if(!(u(F)||g(F))){if(S!==null)e[F]===S&&(S=null);else if(x.length>0&&(e[F]==='"'||e[F]==="'")&&F>0&&/\s/.test(e[F-1]))S=e[F];else if(e[F]==="[")T++;else if(e[F]==="]")T>0&&e[F+1]==="("&&(x.push(F),A=e[F+2]==="<",F++),T=Math.max(0,T-1);else if(e[F]==="("&&x.length>0)x.push(-1);else if(e[F]===")"&&x.length>0){const U=x.pop();if(U!==void 0&&U>=0){const z=e.slice(U+2,F);(/\s/.exec(z)===null||z.startsWith("<")&&/^<(?:\\[<>]|[^<>])*>$/.test(z)||/^[^\s]*\s+("([^"\\]|\\.)*"|'([^'\\]|\\.)*'|\(([^()\\]|\\.)*\))$/.test(z))&&r.push([U,F+1])}}}r.sort((F,U)=>F[0]-U[0]);const E=[];for(const[F,U]of r){const z=E[E.length-1];z&&F<=z[1]?z[1]=Math.max(z[1],U):E.push([F,U])}const P=F=>{let U=0,z=E.length-1;for(;U<=z;){const W=U+z>>1,K=E[W];if(K===void 0)return!1;if(F<K[0])z=W-1;else if(F>=K[1])U=W+1;else return!0}return!1};for(let F=0;F<t;F++)i[F+1]=(i[F]??0)+(e[F]==="`"&&!u4(e,F)?1:0),e[F]==="$"&&(u4(e,F)||P(F)?n[F]=yx:vx(e[F-1])||a1(Cc(e,F+1))||Ipe(e,F)?n[F]=kx:n[F]=bx),s[F+1]=(s[F]??0)+(n[F]===kx?1:0);let D=ul;for(let F=t-1;F>=0;F--)n[F]===bx&&(D=F),o[F]=D;const I=/^[\p{L}\p{Nd}\\|{([+.¬°-±×÷′-″←-⇿∀-⋿^_<>=-]$/u,$=/[^\p{L}\p{Nd}\s]$/u,B=/[^\s\u0020-\u007E\u0370-\u03FF\u{1D400}-\u{1D7FF}\p{Nd}¬°-±×÷′-″←-⇿∀-⋿]/u,H=/(?:^|\s)[a-z]{2,}/,O=(F,U)=>{const z=Cc(e,F+1);if(z===void 0||!I.test(z))return!1;const W=o[F+1]??ul;if(W!==ul){const K=e.slice(F+1,W);return!(K.length===((K.codePointAt(0)??0)>65535?2:1))&&B.test(K)||/[,;:!?]$/.test(K)||/^[a-z]{2,}$/.test(K)?!1:(s[W]??0)-(s[F+1]??0)===0&&(i[W]??0)-(i[F+1]??0)===0}return $.test(U)||B.test(U)||H.test(U)};return(F,U=-1)=>{if(e[F]!=="$"||n[F]===yx||e[F+1]==="$"||e[F-1]==="$"&&U!==F||Mpe(e,F)||F+1>=t||vx(e[F+1]))return null;const z=o[F+1]??ul;if(z===ul||(s[z]??0)-(s[F+1]??0)>0||(i[z]??0)-(i[F+1]??0)>0)return null;const W=e.slice(F+1,z);return/^\{[A-Z_][A-Z0-9_]*(?:\}$|[:-])/.test(W)||e[z+1]==="{"&&/^\{[A-Za-z_][A-Za-z0-9_]*(?:[:-][^{}]*)?\}$/.test(W)||a1(Spe(e,F))&&Lpe(W)||Ape(e,F)&&(O(z,W)||Tpe(e,z)||/\s/.test(W)&&/\p{Nd}$/u.test(W)&&!/[+\-*/^=_<>|\\¬°-±×÷′-″←-⇿∀-⋿]/.test(W)||e[z+1]==="$"&&!/\p{L}/u.test(W)&&/[^\p{L}\p{Nd}\s]$/u.test(W))?null:{content:W,end:z+1}}}const Cx=new WeakMap;function Npe(e,t){if(e.src[e.pos]!=="$")return!1;let n=Cx.get(e);(!n||n.src!==e.src)&&(n={src:e.src,match:$pe(e.src),lastEnd:-1},Cx.set(e,n));const o=n.match(e.pos,n.lastEnd);if(!o||o.end>e.posMax)return!1;if(n.lastEnd=o.end,t)return e.pos=o.end,!0;const s=e.push("math_inline","math",0);return s.content=o.content,s.markup="$",s.raw=e.src.slice(e.pos,o.end),s.loading=!1,e.pos=o.end,!0}function Fpe(e){return e.inline.ruler.disable("math"),e.inline.ruler.before("escape","math",Npe),e}const Rpe=12e4,Ope=6e4,Ppe=32,Dpe=3e4,wx=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Bpe(e){let t=0,n=0,o=0;wx.lastIndex=0;let s;for(;(s=wx.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=Rpe||n>=Ope||t>=Ppe||o>=Dpe?"pre":"shiki",codeFenceCount:t,codeChars:n}}async function H$(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return zpe(e)}function Hpe(e){if(typeof e!="string")return;const t=typeof navigator<"u"?navigator.clipboard:void 0;t&&typeof t.writeText=="function"||H$(e)}function zpe(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}const z$="md-table-wide",W$="md-table-toggle",U$="md-table-fade",_x="md-table-toggle--show",Wpe="md-table-at-end",Upe="kimi-table-layout",j$='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>',jpe='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="14" y1="10" x2="21" y2="3"/><line x1="3" y1="21" x2="10" y2="14"/></svg>';function e0(e){return e.querySelector(`button.${W$}`)}function V$(e){return e.querySelector(`.${U$}`)}const Vpe=26;function qpe(e){const t=e0(e);if(!t)return;const n=e.querySelector("thead tr")??e.querySelector("tr");if(!n)return;const o=n.getBoundingClientRect(),s=e.getBoundingClientRect().top,i=Math.max(2,Math.round(o.top-s+(o.height-Vpe)/2));t.style.top=`${i}px`,t.style.right=`${i}px`}function Kpe(e){return e.closest(".a-msg .msg")!==null}function Zpe(e){const t=e.querySelector("table");return t!==null&&t.scrollWidth>e.clientWidth+1}function q$(e){const t=`translateX(${e.scrollLeft}px)`,n=V$(e);n&&(n.style.transform=t);const o=e0(e);o&&(o.style.transform=t);const s=e.scrollLeft+e.clientWidth>=e.scrollWidth-2;e.classList.toggle(Wpe,s)}function Gpe(e,t){const n=e0(e);if(n)return n;if(!Kpe(e))return null;const o=document.createElement("div");o.className=U$,o.setAttribute("aria-hidden","true");const s=document.createElement("button");return s.type="button",s.className=W$,s.innerHTML=j$,s.setAttribute("aria-label",t.widen),s.title=t.widen,s.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),Ype(e,t)}),e.appendChild(o),e.appendChild(s),e.addEventListener("scroll",()=>q$(e),{passive:!0}),T5(e),s}function Ype(e,t){const n=e.classList.toggle(z$),o=e0(e);if(o){o.innerHTML=n?jpe:j$;const s=n?t.restore:t.widen;o.setAttribute("aria-label",s),o.title=s}T5(e),e.dispatchEvent(new CustomEvent(Upe,{bubbles:!0}))}function T5(e){const t=e0(e);if(!t)return;const n=Zpe(e),o=e.classList.contains(z$);t.classList.toggle(_x,n||o);const s=V$(e);s&&s.classList.toggle(_x,n),qpe(e),q$(e)}function Xpe(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Jpe(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}const Qpe={key:1,class:"diff-wrap"},e0e={class:"diff-bar"},t0e=["aria-label","onClick"],n0e={class:"diff-pre"},o0e={key:0,class:"diff-sign"},s0e={class:"diff-text"},i0e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",xx="github-light",Sx="github-dark",r0e=et({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){qce(),ide(),Zce(),ade(),Kce(new Xpe),lde(new Jpe);const{t}=m1(),n=nn("resolveImage"),o=Z(null),s=e,i=R(()=>!s.streaming),r=R(()=>bpe(s.text??"")),l=R(()=>s.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Bpe(s.text??"")),a=f2(),u=R(()=>!s.streaming),c=Go(new Map),d=new Set,f=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,h=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(F){return!/^(https?:|data:|blob:)/i.test(F)}function v(F){if(!n)return;const U=[];for(const z of[f,h]){z.lastIndex=0;let W;for(;(W=z.exec(F))!==null;)U.push(W[2]??"")}for(const z of U)!z||!m(z)||c.has(z)||d.has(z)||(d.add(z),n(z).then(W=>{c.set(z,W!==z?W:"")}).catch(()=>{c.set(z,"")}).finally(()=>{d.delete(z)}))}function k(F){if(!n)return F;const U=z=>{if(!m(z))return null;const W=c.get(z);return W===void 0?i0e:W===""?null:W};return F.replace(f,(z,W,K,V)=>{const ie=U(K);return ie===null?z:`${W}${ie}${V}`}).replace(h,(z,W,K,V)=>{const ie=U(K);return ie===null?z:`${W}${ie}${V}`})}Je(()=>s.text,F=>v(F??""),{immediate:!0});function w(){if(!o.value||!s.openFile||s.streaming)return;const F=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),U=[];let z=F.nextNode();for(;z;){const W=z,K=W.parentElement;K&&!K.closest("a, pre, .md-file-link, svg")&&W.data.trim().length>0&&U.push(W),z=F.nextNode()}for(const W of U){const K=wpe(W.data,{aliases:r.value});if(K.length===0||!W.parentNode)continue;const V=document.createDocumentFragment();let ie=0;for(const ne of K){ne.start>ie&&V.append(document.createTextNode(W.data.slice(ie,ne.start)));const X=document.createElement("button");X.type="button",X.className="md-file-link",X.textContent=ne.text,X.title=ne.line?`${ne.path}:${ne.line}`:ne.path,X.addEventListener("click",le=>{le.preventDefault(),le.stopPropagation(),s.openFile?.({path:ne.path,line:ne.line})}),V.append(X),ie=ne.end}ie<W.data.length&&V.append(document.createTextNode(W.data.slice(ie))),W.parentNode.replaceChild(V,W)}}function b(F){return!(!F||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(F))}function _(F){let U=F.length;for(const z of["#","?"]){const W=F.indexOf(z);W!==-1&&W<U&&(U=W)}return F.slice(0,U)}function g(){if(!o.value||!s.openFile||s.streaming)return;const F=o.value.querySelectorAll("a[href]");for(const U of F){if(U.dataset.mdLinkHandled==="true"||U.closest("svg"))continue;const z=U.getAttribute("href")??"";b(z)&&(U.dataset.mdLinkHandled="true",U.addEventListener("click",W=>{W.preventDefault(),W.stopPropagation(),s.openFile?.({path:_(z)})}))}}function x(){return{widen:t("conversation.widenTable"),restore:t("conversation.restoreTableWidth")}}function S(){if(!o.value||s.streaming)return;const F=x();for(const U of o.value.querySelectorAll(".table-node-wrapper"))Gpe(U,F)}function T(){if(!(!o.value||s.streaming))for(const F of o.value.querySelectorAll(".table-node-wrapper"))T5(F)}function A(){yt().then(()=>{w(),g(),S()})}Je(()=>s.text,A),Je(()=>s.streaming,A);let E=null,P=null;dn(()=>{A(),o.value&&(E=new MutationObserver(A),E.observe(o.value,{childList:!0,subtree:!0}),P=new ResizeObserver(T),P.observe(o.value))}),bn(()=>{E?.disconnect(),P?.disconnect()});const D={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1,monacoOptions:{lineNumbers:!1,fontSize:13,fontFamily:"var(--font-mono)",padding:{top:12,bottom:12}}},I=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,$=R(()=>{const F=k(s.text??""),U=[];let z=0;I.lastIndex=0;let W;for(;(W=I.exec(F))!==null;){const V=W[1]??"",ie=F.slice(z,W.index)+(V||"");ie.trim()&&U.push({kind:"md",text:ie}),U.push({kind:"diff",code:W[2]??""}),z=I.lastIndex}const K=F.slice(z);return(K.trim()||U.length===0)&&U.push({kind:"md",text:K}),U});function B(F){return F.split(`
325
- `).map(U=>U.startsWith("@@")?{type:"hunk",sign:"",text:U}:/^\+(?!\+\+)/.test(U)?{type:"add",sign:"+",text:U.slice(1)}:/^-(?!--)/.test(U)?{type:"del",sign:"-",text:U.slice(1)}:U.startsWith(" ")?{type:"ctx",sign:"",text:U.slice(1)}:{type:"ctx",sign:"",text:U})}const H=Z(null);function O(F,U){H$(F).then(z=>{z&&(H.value=U,setTimeout(()=>{H.value=null},1400))})}return(F,U)=>(y(),M("div",{ref_key:"mdRef",ref:o,class:"md"},[(y(!0),M(Pe,null,pt($.value,(z,W)=>(y(),M(Pe,{key:W},[z.kind==="md"?(y(),he(p(Vi),{key:0,content:z.text,"custom-markdown-it":p(Fpe),mode:"chat","code-renderer":l.value.codeRenderer,"is-dark":p(a),"code-block-light-theme":xx,"code-block-dark-theme":Sx,themes:[xx,Sx],"code-block-props":D,final:i.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:p(Hpe)},null,8,["content","custom-markdown-it","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering","onCopy"])):(y(),M("div",Qpe,[C("div",e0e,[U[0]||(U[0]=C("span",{class:"diff-lang"},"diff",-1)),j(p(pn),{text:p(t)("filePreview.copyCode")},{default:me(()=>[C("button",{class:"diff-copy","aria-label":p(t)("filePreview.copyCode"),onClick:K=>O(z.code,W)},[j(p(Te),{name:H.value===W?"check":"copy",size:"sm"},null,8,["name"])],8,t0e)]),_:2},1032,["text"])]),C("pre",n0e,[C("code",null,[(y(!0),M(Pe,null,pt(B(z.code),(K,V)=>(y(),M("span",{key:V,class:Re(["diff-line",`diff-${K.type}`])},[K.type!=="hunk"?(y(),M("span",o0e,N(K.sign),1)):ee("",!0),C("span",s0e,N(K.text),1)],2))),128))])])]))],64))),128))],512))}}),Ic=ft(r0e,[["__scopeId","data-v-2a3e373d"]]),l0e={state:"idle"};function a0e(e){const t=Z(l0e),n=Z(ui(cn.updateSkippedVersion)),o=Z(!1);if(typeof e?.getUpdateAutoDownload=="function"&&e.getUpdateAutoDownload().then(i=>{o.value=i}).catch(()=>{}),e!==void 0){let i=!1;e.onUpdateStatus(r=>{i=!0,t.value=r}),e.getUpdateStatus().then(r=>{i||(t.value=r)}).catch(()=>{})}const s=R(()=>{const i=t.value;return!(i.state==="idle"||i.state==="available"&&i.version!==void 0&&i.version===n.value)});return{status:t,visible:s,canCheck:typeof e?.checkForUpdates=="function",autoDownload:o,canToggleAutoDownload:typeof e?.getUpdateAutoDownload=="function"&&typeof e?.setUpdateAutoDownload=="function",setAutoDownload:i=>{o.value=i,e?.setUpdateAutoDownload?.(i).catch(()=>{})},skipVersion:()=>{const i=t.value.version;t.value.state==="available"&&i!==void 0&&(n.value=i,Ls(cn.updateSkippedVersion,i))},check:async()=>{if(typeof e?.checkForUpdates!="function")return Promise.resolve({outcome:"unsupported"});const i=await e.checkForUpdates().catch(()=>({outcome:"error",message:"bridge call failed"}));return i.outcome==="available"&&i.version!==void 0&&i.version===n.value&&(n.value=null,ur(cn.updateSkippedVersion)),i},download:()=>{e?.downloadUpdate().catch(()=>{})},install:()=>{e?.installUpdate().catch(()=>{})}}}let c4=null;function K$(){return c4===null&&(c4=a0e(window.kimiDesktop)),c4}const u0e=["data-state"],c0e=["aria-label"],d0e={class:"upd-pill-text"},f0e={key:0,class:"upd-meta"},p0e={key:1,class:"upd-notes"},h0e={class:"upd-notes-title"},m0e={key:2,class:"upd-progress"},g0e={key:3,class:"upd-message"},v0e={class:"upd-foot"},y0e={class:"upd-foot-actions"},k0e=et({__name:"UpdateIndicator",setup(e){const{t,locale:n}=Nt(),{status:o,visible:s,skipVersion:i,download:r,install:l,autoDownload:a,setAutoDownload:u,canToggleAutoDownload:c}=K$(),d=Z(!1),f="0.33.0".trim()?"0.33.0":"",h=R(()=>{switch(o.value.state){case"available":return t("sidebar.update");case"downloading":return`${o.value.percent??0}%`;case"downloaded":return t("sidebar.updateDone");case"error":return t("sidebar.updateFailed");default:return""}}),m=R(()=>{switch(o.value.state){case"available":return t("sidebar.updateAvailable",{version:o.value.version??""});case"downloading":return t("sidebar.updateDownloading",{percent:o.value.percent??0});case"downloaded":return t("sidebar.updateReady",{version:o.value.version??""});case"error":return t("sidebar.updateFailed");default:return""}}),v=R(()=>{const T=o.value.releaseDate;if(T===void 0||T==="")return"";const A=new Date(T),E=Number.isNaN(A.getTime())?T:A.toLocaleDateString();return t("sidebar.updateReleaseDate",{date:E})}),k=R(()=>{const T=[];return v.value!==""&&T.push(v.value),f!==""&&T.push(t("sidebar.updateCurrentVersion",{version:f})),T.join(" · ")}),w=R(()=>o.value.percent??0),b=R(()=>{const T=o.value.releaseNotes;return T===void 0?"":((n.value.toLowerCase().startsWith("zh")?T.zh:T.en)??T.zh??T.en??"").trim()}),_=R(()=>{switch(o.value.state){case"error":return"alert-triangle";default:return"download"}});function g(){r()}function x(){i(),d.value=!1}function S(){l(),d.value=!1}return(T,A)=>p(s)?(y(),M("span",{key:0,class:"upd","data-state":p(o).state},[C("button",{class:"upd-pill",type:"button","aria-label":h.value,onClick:A[0]||(A[0]=E=>d.value=!0)},[j(p(Te),{class:"upd-pill-icon",name:_.value,size:"sm"},null,8,["name"]),C("span",d0e,N(h.value),1)],8,c0e),j(p(ua),{open:d.value,title:m.value,size:"lg","onUpdate:open":A[4]||(A[4]=E=>d.value=E)},{foot:me(()=>[C("div",v0e,[C("div",y0e,[p(o).state==="available"?(y(),M(Pe,{key:0},[j(p(Rt),{variant:"ghost",onClick:x},{default:me(()=>[qe(N(p(t)("sidebar.updateSkip")),1)]),_:1}),j(p(Rt),{onClick:g},{default:me(()=>[qe(N(p(t)("sidebar.updateDownloadNow")),1)]),_:1})],64)):p(o).state==="downloading"?(y(),he(p(Rt),{key:1,variant:"secondary",onClick:A[1]||(A[1]=E=>d.value=!1)},{default:me(()=>[qe(N(p(t)("sidebar.updateBackground")),1)]),_:1})):p(o).state==="downloaded"?(y(),M(Pe,{key:2},[j(p(Rt),{variant:"ghost",onClick:A[2]||(A[2]=E=>d.value=!1)},{default:me(()=>[qe(N(p(t)("sidebar.updateRestartLater")),1)]),_:1}),j(p(Rt),{onClick:S},{default:me(()=>[qe(N(p(t)("sidebar.updateRestartNow")),1)]),_:1})],64)):p(o).state==="error"?(y(),he(p(Rt),{key:3,variant:"danger-soft",onClick:g},{default:me(()=>[qe(N(p(t)("sidebar.updateRetry")),1)]),_:1})):ee("",!0)]),p(c)?(y(),he(p(rW),{key:0,class:"upd-auto","model-value":p(a),"onUpdate:modelValue":A[3]||(A[3]=E=>p(u)(E))},{default:me(()=>[qe(N(p(t)("sidebar.updateAutoDownload")),1)]),_:1},8,["model-value"])):ee("",!0)])]),default:me(()=>[(p(o).state==="available"||p(o).state==="downloaded")&&k.value?(y(),M("p",f0e,N(k.value),1)):ee("",!0),b.value?(y(),M("section",p0e,[C("h4",h0e,N(p(t)("sidebar.updateWhatsNew")),1),j(p(Ic),{text:b.value},null,8,["text"])])):ee("",!0),p(o).state==="downloading"?(y(),M("div",m0e,[C("div",{class:"upd-progress-fill",style:Zt({width:`${w.value}%`})},null,4)])):ee("",!0),p(o).state==="error"&&p(o).message?(y(),M("p",g0e,N(p(o).message),1)):ee("",!0)]),_:1},8,["open","title"])],8,u0e)):ee("",!0)}}),b0e=ft(k0e,[["__scopeId","data-v-c0a4acce"]]),yg=[{code:"en",label:"English"},{code:"zh",label:"简体中文"}],Hn=Mz({locale:$M()});function E5(e){Hn.global.locale.value=e,Ls(cn.locale,e)}const C0e=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],Z$=500,kg=256*1024,Ax=200,d4=16384,f4=500,p4=50,h4=50,w0e=6,_0e=/api[_-]?key|authorization|token|secret|password|cookie|credential|email|phone|nickname|avatar/i,x0e=/^[A-Za-z0-9+/=_-]{200,}$/;let m4=null;function Qr(){if(m4!==null)return m4;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=ui(cn.debug)==="1"),m4=e,e}const Ka=[],Ed=[];let Mf=0;const Yu=[];let Tf=0,S0e=1;const bg=new TextEncoder,A0e=new Set(C0e),I5=Z(0),Ef=Xr(!1);function M0e(){return Ka}function T0e(){Ka.length=0,Ed.length=0,Mf=0,Yu.length=0,Tf=0,I5.value++}function ca(e){if(!Ef.value){try{const t={id:S0e++,ts:Date.now(),source:e.source,kind:String(Kd(e.kind)),label:String(Kd(e.label)),sessionId:e.sessionId===void 0?void 0:String(Kd(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:pu(e.detail)},n=JSON.stringify(t),o=bg.encode(n).byteLength;if(o>kg)return;for(Ka.push(t),Ed.push(n),Mf+=o+(Ed.length>1?1:0);Ka.length>Z$||Mf>kg;){const s=Ed.shift();Ka.shift(),s!==void 0&&(Mf-=bg.encode(s).byteLength,Ed.length>0&&(Mf-=1))}}catch{return}I5.value++}}function Bu(e){if(typeof e=="string")return e.length<=Ax?e:e.slice(0,Ax)}function mr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function E0e(e,t){if(A0e.has(e))try{const n={ts:Date.now(),event:e,sessionId:Bu(t?.sessionId),status:Bu(t?.status),operation:Bu(t?.operation),seq:mr(t?.seq),durationMs:mr(t?.durationMs),messageCount:mr(t?.messageCount),contentCount:mr(t?.contentCount),mediaCount:mr(t?.mediaCount),sessionCount:mr(t?.sessionCount),workspaceCount:mr(t?.workspaceCount),promptId:Bu(t?.promptId),zipBytes:mr(t?.zipBytes),errorName:Bu(t?.errorName),errorCode:mr(t?.errorCode),requestId:Bu(t?.requestId),phase:Bu(t?.phase),httpStatus:mr(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:mr(t?.line),col:mr(t?.col)},o=JSON.stringify(n),s=bg.encode(o).byteLength;if(s>kg)return;for(Yu.push(o),Tf+=s+(Yu.length>1?1:0);Yu.length>Z$||Tf>kg;){const i=Yu.shift();i!==void 0&&(Tf-=bg.encode(i).byteLength,Yu.length>0&&(Tf-=1))}}catch{return}}function Kd(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return x0e.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>f4?`${i.slice(0,f4)}… [+${i.length-f4} chars]`:i}if(n!=="object")return String(e);if(t>=w0e)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,p4).map(r=>Kd(r,t+1));return e.length>p4&&i.push(`[+${e.length-p4} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,h4))o[i]=_0e.test(i)?"[redacted]":Kd(r,t+1);return s.length>h4&&(o._truncatedKeys=s.length-h4),o}function pu(e){if(e===void 0)return;const t=Kd(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>d4)return{_truncated:`detail JSON was ${n.length} chars; first ${d4} kept`,preview:n.slice(0,d4)}}catch{return"[unserializable detail]"}return t}function I0e(e){Qr()&&ca({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:pu(e.body)}})}function L0e(e){if(!Qr())return;const t=e.code!==0;ca({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:pu(e.data)}})}function $0e(e){Qr()&&ca({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function N0e(e,t){Qr()&&ca({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:pu(t)})}function F0e(e){if(!Qr())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;ca({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:pu(e)})}function R0e(e){if(!Qr())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);ca({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:pu(t.payload)})}const O0e={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function P0e(e,t,n){Qr()&&ca({source:"client",kind:`client:${e}`,label:`${O0e[e]} ${t}`,detail:pu(n)})}function D0e(e,t){Qr()&&ca({source:"client",kind:"client:event",label:`· ${e}`,detail:pu(t)})}function bi(e,t){E0e(e,t),ca({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let g4=!1,Eh=null;function B0e(){if(g4)return()=>Eh?.();g4=!0;const e=[];try{if(typeof window<"u"){const n=s=>{bi("window:error",{status:"failed",errorName:s.error instanceof Error?s.error.name:"Error",line:s.lineno,col:s.colno}),Xl(`[kimi-web] window error: ${s.message}`,s.error instanceof Error?s.error.stack:void 0)},o=s=>{const i=s.reason;bi("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i}),Xl(`[kimi-web] unhandled rejection: ${z0e(i)}`,i instanceof Error?i.stack:void 0)};window.addEventListener("error",n),window.addEventListener("unhandledrejection",o),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",o)})}}catch{}if(Qr())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{P0e(n,i.map(H0e).join(" "),i.length>1?i:i[0])}catch{}o.apply(console,i)};console[n]=s,e.push(()=>{console[n]===s&&(console[n]=o)})}const t=()=>{if(Eh===t){for(const n of e.toReversed())n();Eh=null,g4=!1}};return Eh=t,t}function H0e(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function z0e(e){if(e instanceof Error)return e.message;try{return String(e)}catch{return"[unstringifiable reason]"}}function G$(e=Ka){if(typeof document>"u")return;const t=new Blob([W0e(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let o;try{o=document.createElement("a"),o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(o),o.click()}finally{o?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function W0e(e=Ka){return e===Ka?Ed.join(`
324
+ `)&&!(function(W){const K=rx(W);if(lx(K))return!1;const V=I$(K);return V.length>=2&&V.some(ie=>ie.trim())})(U))})(r.value,B)?x():(function(){if(v+=1,h)return;const F=Math.max(0,(function(U){const z=U.parseCoalesceMs;return typeof z=="number"&&Number.isFinite(z)&&z>=0?z:80})(e)-(Rr()-k));F<=0?x():h=setTimeout(x,F)})())},{flush:"sync",immediate:!0}),d1(g);const S=R(()=>{var B,H,O,F;return cie(e.customHtmlTags,(B=e.parseOptions)==null?void 0:B.customHtmlTags,(F=(O=(H=t.customComponentsMap)==null?void 0:H.value)!=null?O:{},Object.entries(F).map(([U,z])=>{const W=Sr(U);return z==null||!W||Qp(W)||WI.has(W)||Zp.has(W)?"":W}).filter(Boolean)))}),T=R(()=>{const{key:B,tags:H}=die(S.value);if(!B)return o;const O=s.get(B);if(O)return O;const F=l_(t.instanceMsgId,{customHtmlTags:H});return s.set(B,F),F}),A=R(()=>{const B=T.value;if(!e.customMarkdownIt)return B;const H=e.customMarkdownIt(B);return B.__markstreamHasCustomParserExtensions=!0,H.__markstreamHasCustomParserExtensions=!0,H}),E=R(()=>{var B,H;const O=(B=e.parseOptions)!=null?B:{},F=t.effectiveFinal.value,U=S.value,z=F!=null,W=U.length>0;return z||W||O.streamParse==null?mt(mt(rn(mt({},O),{streamParse:(H=O.streamParse)==null||H}),z?{final:F}:{}),W?{customHtmlTags:U}:{}):O}),P=R(()=>{var B;return new Set(((B=E.value.customHtmlTags)!=null?B:[]).map(H=>String(H).trim().toLowerCase()).filter(Boolean))}),D=R(()=>ix(E.value,A.value,e.customMarkdownIt,{includeFinal:!0})),I=R(()=>ix(E.value,A.value,e.customMarkdownIt,{includeFinal:!1}));Je([D,I],([B,H],[O,F])=>{O&&(B===O&&H===F||(x(),H!==F&&(l=[],c="")))},{flush:"sync"});const $=R(()=>{var B,H,O,F,U,z,W,K,V,ie,ne;if((B=e.nodes)!=null&&B.length)return l=[],c="",_(0),kt(e.nodes.slice());const X=r.value;if(!X)return l=[],c="",_(-1),[];const le=t.debugPerformanceEnabled.value,Ie=le?Rr():0,de=A.value,pe=D.value,ve=I.value;a&&pe!==a&&(function(Fe){var Oe,Ge;(Ge=(Oe=Fe.stream)==null?void 0:Oe.reset)==null||Ge.call(Oe)})(de),u&&ve!==u&&(l=[],c="");const oe=Object.keys((O=(H=t.customComponentsMap)==null?void 0:H.value)!=null?O:{}).length>0||typeof E.value.postTransformNodes=="function";oe!==d&&(l=[],c="");const ye=!oe&&l.length>0&&X.startsWith(c)&&ve===u,G=le?sx(de):null,Y=le?{}:void 0,fe=cx(de),we=!fe&&!oe,ge=mt(mt(rn(mt({},E.value),{__reuseStableTopLevelNodes:we}),fe?{__disableStreamParse:!0}:{}),Y?{__timing:Y}:{}),Q=UL(X,de,ge),te=le?Rr():0,ce=le?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ue,Se=le?_h(Q.length):void 0,ze=0,_e=0,Ee=0;if(ye){const Fe=le?Rr():0,[Oe,Ge]=(function(Tt){var Bt,Yt;const[Sn,on]=Tt.scanGlobalReferenceAppend(Tt.previousContent,Tt.content),en=Tt.parseOptions;return[Tt.previousDirtyStartIndex>0&&en.final!==!0&&!Tt.customMarkdownIt&&!cx(Tt.md)&&!Sn&&typeof en.preTransformTokens!="function"&&typeof en.postTransformTokens!="function"&&typeof en.postTransformNodes!="function"&&((Yt=(Bt=en.customHtmlTags)==null?void 0:Bt.length)!=null?Yt:0)===0?Tt.previousDirtyStartIndex:0,on]})({content:X,previousContent:c,previousDirtyStartIndex:w,parseOptions:E.value,customMarkdownIt:e.customMarkdownIt,md:de,scanGlobalReferenceAppend:f});Ee=Ge;const at=Oe<=0;if(ce){const Tt=(function(Bt,Yt,Sn,on={}){var en;if(!Yt.length)return{nodes:Bt,metrics:_h(Bt.length)};const Cn=(en=on.scanStartIndex)!=null?en:0,Mn=on.reuseDirtyTail!==!1,We=(function(Lt,gt,wn,yn=0){const go=Math.min(Lt.length,gt.length);for(let qt=Math.min(go,Math.max(0,yn));qt<go;qt++)if(!Xfe(gt[qt],Lt[qt],wn))return qt;return Lt.length===gt.length?-1:go})(Bt,Yt,Sn,Cn);if(We<0)return{nodes:Yt,metrics:{reusedNodeCount:Bt.length,dirtyStartIndex:We,stablePrefixNodeCount:Bt.length,dirtyTailNodeCount:0}};const tt=Bt.slice();let Ue=We;for(let Lt=0;Lt<We;Lt++)tt[Lt]=Yt[Lt];if(Mn)for(let Lt=We;Lt<Bt.length;Lt++){const gt=Yt[Lt],wn=Bt[Lt];gt&&F$(gt,wn,Sn)&&(tt[Lt]=gt,Ue+=1)}return{nodes:tt,metrics:{reusedNodeCount:Ue,dirtyStartIndex:We,stablePrefixNodeCount:We,dirtyTailNodeCount:ux(We,Bt,Yt)}}})(Q,l,ce,{reuseDirtyTail:at,scanStartIndex:Oe});ue=Tt.nodes,Se=Tt.metrics}else{const Tt=(function(Bt,Yt,Sn={}){var on;if(!Yt.length)return{nodes:Bt,metrics:_h(Bt.length)};const en=(on=Sn.scanStartIndex)!=null?on:0,Cn=Sn.reuseDirtyTail!==!1,Mn=(function(Ue,Lt,gt=0){const wn=Math.min(Ue.length,Lt.length);for(let yn=Math.min(wn,Math.max(0,gt));yn<wn;yn++)if(!Yfe(Lt[yn],Ue[yn]))return yn;return Ue.length===Lt.length?-1:wn})(Bt,Yt,en);if(Mn<0)return{nodes:Yt,metrics:{reusedNodeCount:Bt.length,dirtyStartIndex:Mn,stablePrefixNodeCount:Bt.length,dirtyTailNodeCount:0}};const We=Bt.slice();let tt=Mn;for(let Ue=0;Ue<Mn;Ue++)We[Ue]=Yt[Ue];if(Cn)for(let Ue=Mn;Ue<Bt.length;Ue++){const Lt=Yt[Ue],gt=Bt[Ue];Lt&&N$(Lt,gt)&&(We[Ue]=Lt,tt+=1)}return{nodes:We,metrics:{reusedNodeCount:tt,dirtyStartIndex:Mn,stablePrefixNodeCount:Mn,dirtyTailNodeCount:ux(Mn,Bt,Yt)}}})(Q,l,{reuseDirtyTail:at,scanStartIndex:Oe});ue=Tt.nodes,Se=Tt.metrics}ze=le?Rr()-Fe:0,_e=at?Se?.dirtyStartIndex==null||Se.dirtyStartIndex<0?ue.length:Se.dirtyStartIndex:ue.length}else ue=Q,Se=_h(ue.length);t.effectiveFinal.value!==!0&&(ce?(function(Fe,Oe,Ge=0){for(let at=Math.max(0,Ge);at<Fe.length;at++)S5(Oe,"primeSignatureMs",()=>su(Fe[at]))})(ue,ce,_e):(function(Fe,Oe=0){for(let Ge=Math.max(0,Oe);Ge<Fe.length;Ge++)su(Fe[Ge])})(ue,_e));const it=le?Rr()-te:0;if(m+=1,c=X,a=pe,u=ve,d=oe,l=ue,_((F=Se?.dirtyStartIndex)!=null?F:0),le){const Fe=sx(de),Oe=typeof Fe?.total=="number"&&Fe.total>((U=G?.total)!=null?U:0);t.logPerf(Oe?"parse(stream)":"parse(sync)",mt(mt(mt({rendererId:t.instanceMsgId,ms:Math.round(Rr()-Ie),nodes:ue.length,contentLength:X.length,parseCommitCount:m,parseCoalescedCount:v,nodeReuseMs:it,referenceDefinitionScanChars:Ee,signatureMs:(z=ce?.signatureMs)!=null?z:0,stabilizeSignatureMs:(W=ce?.stabilizeSignatureMs)!=null?W:0,primeSignatureMs:(K=ce?.primeSignatureMs)!=null?K:0,signatureCallCount:(V=ce?.signatureCallCount)!=null?V:0,stabilizeSignatureCallCount:(ie=ce?.stabilizeSignatureCallCount)!=null?ie:0,primeSignatureCallCount:(ne=ce?.primeSignatureCallCount)!=null?ne:0,stabilizeMs:ze},Se??{}),Y?Object.fromEntries(jfe.map(Ge=>{var at;return[Ge,(at=Y[Ge])!=null?at:0]})):{}),Fe?{streamMode:Fe.lastMode,streamDelta:Jfe(Fe,G),streamStats:Fe}:{}))}return kt(ue)});return{effectiveCustomHtmlTags:S,effectiveCustomHtmlTagsSet:P,mdBase:T,mdInstance:A,mergedParseOptions:E,getParsedNodesDirtyStartIndex:()=>w,getParsedNodesRevision:()=>b,parsedNodes:$}}function epe(e){const{isClient:t}=e,n=Z(new Set),o=new Map,s=new Map,i=new Map;function r(u){if(!t)return;const c=i.get(u);c!=null&&(window.clearTimeout(c),i.delete(u))}function l(){if(t)for(const u of i.values())window.clearTimeout(u);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((v=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!v)return;var m,v;const k=n.value,w=k.has(f);if(h){if(w)return;const _=new Set(k);return _.add(f),void(n.value=_)}if(!w)return;const b=new Set(k);b.delete(f),n.value=b})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of s.entries())f<u||(h(),s.delete(f));for(const[f,h]of o.entries())f<u||(h.destroy(),o.delete(f),r(f),(c=e.onNodeVisibilityCleaned)==null||c.call(e,f));for(const f of Array.from(i.keys()))f<u||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<u&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const u of s.values())u();s.clear();for(const u of o.values())u.destroy();o.clear(),l()}}}function tpe(e={}){const t=Z(""),n=Z(""),o=Z(!1),s=Nce(e),i=()=>{const c=s.getSnapshot();t.value=c.source,n.value=c.visible,o.value=c.done},r=s.subscribe(i);i();const l=R(()=>Math.max(0,t.value.length-n.value.length)),a=R(()=>l.value===0),u=R(()=>o.value&&a.value);return Kg()&&d1(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:u,caughtUp:a,pendingChars:l,enqueue:c=>s.enqueue(c),finish:c=>s.finish(c),flush:()=>s.flush(),reset:c=>s.reset(c),pause:()=>s.pause(),resume:()=>s.resume()}}const npe={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},dx=/auto|scroll|overlay/i;function ope(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return dx.test(t)||dx.test(n)}function spe(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const ipe={class:"m-0 p-0"},rpe=["data-probe"],lpe=Gn(et(rn(mt({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(o){var s,i;return(i=(s=t.headingNodes)==null?void 0:s[o])!=null?i:null}return(o,s)=>(y(),M("div",{class:"height-estimation-probes",style:Zt({width:`${e.width}px`}),"aria-hidden":"true"},[C("div",{ref:i=>e.setParagraphWrapper(i),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[j(p(cc),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),C("div",{ref:i=>e.setListItemWrapper(i),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[C("ul",ipe,[j(p(Vd),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),C("div",{ref:i=>e.setListWrapper(i),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[j(p(qd),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(y(),M(Pe,null,pt(6,i=>C("div",{key:`probe-heading-${i}`,ref_for:!0,ref:r=>e.setHeadingWrapper(i,r),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${i}`},[j(p(L2),{node:n(i),"index-key":`probe-heading-${i}`},null,8,["node","index-key"])],10,rpe)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),fx=et({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=R(()=>{var n,o;return ag((o=Md(e.estimatedPreviewHeightPx))!=null?o:rg(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return tn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?tn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[tn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),tn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),tn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>tn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,tn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[tn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),tn("div",{class:"absolute inset-0"},[tn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),px=et({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=R(()=>{var n,o;return lg((o=Md(e.estimatedPreviewHeightPx))!=null?o:ig(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return tn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?tn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[tn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),tn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>tn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[tn("span",{class:"action-icon block"})])))]):null,tn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[tn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),tn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),ape={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function As(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const upe=["data-custom-id"],cpe=["data-node-index","data-node-type"],hx="typewriter-simple-cursor-target",R$=Gn(et(rn(mt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n;function i(L){if(!(typeof Event<"u"&&L instanceof Event))return typeof L=="string"&&s("copy-code",L),void s("copy",L)}const r=ds(),l=nn("markstreamNestedRendererProps",void 0);function a(L){const q=r?.vnode.props;return!!q&&(Object.prototype.hasOwnProperty.call(q,L)||Object.prototype.hasOwnProperty.call(q,String(L).replace(/[A-Z]/g,re=>`-${re.toLowerCase()}`)))}function u(L){var q,re;const ae=o[L];return a(L)?ae:(re=(q=l?.value)==null?void 0:q[L])!=null?re:ae}const c=R(()=>{return(L=u("mode"))==="chat"||L==="minimal"||L==="docs"?L:"docs";var L}),d=R(()=>ex(u("typewriter"))),f=R(()=>d.value!=="off"),h=R(()=>u("domMode")==="minimal"?"minimal":"full"),m=R(()=>{return(L={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":L.codeRenderer==="pre"||L.codeRenderer==="shiki"||L.codeRenderer==="monaco"?L.codeRenderer:L.renderCodeBlocksAsPre===!1||L.mode==="docs"?"monaco":"pre";var L}),v=R(()=>ape[c.value]),k=R(()=>{var L;return(L=u("showTooltips"))!=null?L:v.value.showTooltips}),w=R(()=>{var L;return(L=u("fade"))!=null?L:v.value.fade}),b=R(()=>{var L;return(L=u("batchRendering"))!=null?L:v.value.batchRendering}),_=R(()=>{var L;return(L=u("initialRenderBatchSize"))!=null?L:v.value.initialRenderBatchSize}),g=R(()=>{var L;return(L=u("renderBatchSize"))!=null?L:v.value.renderBatchSize}),x=R(()=>{var L;return(L=u("renderBatchDelay"))!=null?L:v.value.renderBatchDelay}),S=R(()=>{var L;return(L=u("renderBatchBudgetMs"))!=null?L:v.value.renderBatchBudgetMs}),T=R(()=>{var L;return(L=u("renderBatchIdleTimeoutMs"))!=null?L:v.value.renderBatchIdleTimeoutMs}),A=R(()=>{var L;return(L=u("deferNodesUntilVisible"))!=null?L:v.value.deferNodesUntilVisible}),E=R(()=>{var L;return(L=u("maxLiveNodes"))!=null?L:v.value.maxLiveNodes}),P=R(()=>{var L;return(L=u("liveNodeBuffer"))!=null?L:v.value.liveNodeBuffer}),D=R(()=>{var L;return(L=u("nodeVirtual"))!=null?L:v.value.nodeVirtual}),I={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return k.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return o.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return w.value},get batchRendering(){return b.value},get initialRenderBatchSize(){return _.value},get renderBatchSize(){return g.value},get renderBatchDelay(){return x.value},get renderBatchBudgetMs(){return S.value},get renderBatchIdleTimeoutMs(){return T.value},get deferNodesUntilVisible(){return A.value},get maxLiveNodes(){return E.value},get liveNodeBuffer(){return P.value},get nodeVirtual(){return D.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function $(L){s("height-change",L)}function B(L){s("virtual-state-change",L)}function H(L){s("anchor-change",L)}const O=Z(),F=Z(null),U=Z(null),z=Z(null),W=Go({1:null,2:null,3:null,4:null,5:null,6:null}),K=Z(!1),V=new Map,ie=Z(0),ne=Z(0),X=Z({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function le(L,q){return typeof L!="string"?q:L.trim()||q}function Ie(L){const q=Number(L);return Number.isFinite(q)&&q>0?Math.max(1,Math.trunc(q)):640}const de=R(()=>{var L;const q=(L=I.viewportPriorityOptions)!=null?L:{},re=le(q.rootMargin,yc);return{rootMargin:re,heavyBlockMargin:le(q.heavyBlockMargin,re),maxTargets:Ie(q.maxTargets)}}),pe=R(()=>{var L;return(L=de.value.rootMargin)!=null?L:yc}),ve=R(()=>{var L;return(L=de.value.maxTargets)!=null?L:640});function oe(){var L,q;if(((L=o.virtualScroll)==null?void 0:L.enabled)!==!0)return null;const re=(q=o.virtualScroll)==null?void 0:q.scrollRoot;return ye(typeof re=="function"?re():re)}function ye(L){return L?typeof HTMLElement<"u"&&L instanceof HTMLElement?L:typeof L=="object"&&"value"in L?ye(L.value):typeof L=="object"&&"$el"in L?ye(L.$el):null:null}Ln(y$,de);const{isClient:G,renderAsFragment:Y,debugPerformanceEnabled:fe,resolvedShowTooltips:we,resolvedHtmlPolicy:ge,inheritedSmoothStreaming:Q,ownsTypewriterCursor:te}=(function(L){const q=typeof window<"u",re=p1(),ae=nn("markstreamHtmlPolicy",void 0),be=nn("markstreamTypewriterCursor",void 0),Ne=nn("markstreamSmoothStreaming",void 0),De=R(()=>L.renderAsFragment===!0),je=R(()=>!!(L.debugPerformance&&q&&typeof console<"u")),ot=R(()=>{var nt;if(typeof L.showTooltips=="boolean")return L.showTooltips;const Be=(nt=re.showTooltips)!=null?nt:re["show-tooltips"];return Be===""||Be===!0||Be==="true"||Be!==!1&&Be!=="false"&&void 0}),Ve=R(()=>{var nt,Be;return(Be=(nt=L.htmlPolicy)!=null?nt:ae?.value)!=null?Be:"safe"}),Ye=R(()=>be?.value!==!0);return{isClient:q,renderAsFragment:De,debugPerformanceEnabled:je,resolvedShowTooltips:ot,resolvedHtmlPolicy:Ve,inheritedSmoothStreaming:Ne,inheritedTypewriterCursor:be,ownsTypewriterCursor:Ye}})(I),{resolveViewportRoot:ce,resolveScrollContainer:ue,isReverseFlexScrollRoot:Se,getNormalizedScrollTop:ze,getOffsetTopWithinRoot:_e}=(function(L,q){function re(){var je,ot;return(ot=(je=q.scrollRoot)==null?void 0:je.call(q))!=null?ot:null}function ae(je){if(typeof window>"u")return null;const ot=re();if(ot)return ot;const Ve=je??L.value;if(!Ve)return null;const Ye=Ve.ownerDocument||document,nt=Ye.scrollingElement||Ye.documentElement;let Be=Ve;for(;Be&&Be!==Ye.body&&Be!==nt;){if(ope(window.getComputedStyle(Be))&&spe(Be))return Be;Be=Be.parentElement}return null}function be(je){if(!q.isClient)return!1;try{const ot=window.getComputedStyle(je);return!!(ot.display||"").toLowerCase().includes("flex")&&(ot.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Ne(je,ot,Ve){var Ye,nt;if(Ve)return De(ot);const Be=je.scrollTop;if(!be(je))return Be;const Xe=Be<0?-Be:Be;return Math.max(0,((Ye=je.scrollHeight)!=null?Ye:0)-((nt=je.clientHeight)!=null?nt:0))-Xe}function De(je){var ot,Ve,Ye,nt,Be;const Xe=Number((ot=je.scrollingElement)==null?void 0:ot.scrollTop),lt=Number((Ye=(Ve=je.documentElement)==null?void 0:Ve.scrollTop)!=null?Ye:0),rt=Number((Be=(nt=je.body)==null?void 0:nt.scrollTop)!=null?Be:0);return Math.max(0,Number.isFinite(Xe)?Xe:0,Number.isFinite(lt)?lt:0,Number.isFinite(rt)?rt:0)}return{resolveViewportRoot:ae,resolveScrollContainer:function(je){var ot,Ve,Ye,nt;const Be=re();if(Be)return Be;const Xe=ae((ot=je??L.value)!=null?ot:null);if(Xe)return Xe;const lt=(nt=(Ye=je?.ownerDocument)!=null?Ye:(Ve=L.value)==null?void 0:Ve.ownerDocument)!=null?nt:typeof document<"u"?document:null;return lt?.scrollingElement||lt?.documentElement||null},isReverseFlexScrollRoot:be,getNormalizedScrollTop:Ne,getOffsetTopWithinRoot:function(je,ot){const Ve=ot.ownerDocument||je.ownerDocument||document;if((function(Xe,lt){return Xe===lt.documentElement||Xe===lt.body||Xe===lt.scrollingElement})(ot,Ve))return je.getBoundingClientRect().top+De(Ve);const Ye=ot.getBoundingClientRect(),nt=je.getBoundingClientRect(),Be=Ne(ot,Ve,!1);return nt.top-Ye.top+Be}}})(O,{isClient:G,scrollRoot:oe});Ln("markstreamShowTooltips",we),Ln("markstreamHtmlPolicy",ge),Ln("markstreamTypewriter",f),Ln("markstreamFade",R(()=>I.fade!==!1)),Ln("markstreamTypewriterCursor",R(()=>!0)),Ln("markstreamTextStreamState",V),Ln("markstreamStreamVersion",ie),Ln("markstreamParseOptions",R(()=>I.parseOptions)),Ln("markstreamCustomMarkdownIt",R(()=>I.customMarkdownIt));const{smoothStreamingEnabled:Ee,renderContent:it,requestedFinal:Fe,effectiveFinal:Oe}=(function(L,q){const re=tpe(mt(mt({},npe),L.smoothStreamingOptions)),ae=R(()=>{var Be,Xe,lt;return L.smoothStreaming!==!1&&!((Be=L.nodes)!=null&&Be.length)&&(L.smoothStreaming===!0||!((Xe=q.inheritedSmoothStreaming)!=null&&Xe.value))&&(L.smoothStreaming===!0||ex(L.typewriter)!=="off"||((lt=L.maxLiveNodes)!=null?lt:0)<=0)}),be=Z(!q.isClient||L.smoothStreaming===!0);dn(()=>{be.value=!0});const Ne=R(()=>be.value&&ae.value),De=R(()=>{var Be;return Ne.value?re.visible.value:(Be=L.content)!=null?Be:""}),je=R(()=>{var Be,Xe;const lt=(Be=L.parseOptions)!=null?Be:{};return(Xe=L.final)!=null?Xe:lt.final}),ot=R(()=>{const Be=je.value;return Ne.value&&Be!=null?!!Be&&re.caughtUp.value:Be});let Ve=0,Ye=!1;function nt(){Ve=0,Ye=!1}return Je([()=>L.content,()=>L.nodes,Ne,je],([Be,Xe,lt,rt])=>{if(Xe?.length)return nt(),void re.reset("");const wt=Be??"";if(!lt)return nt(),re.reset(wt),void(rt&&re.finish({flush:!0}));const dt=re.source.value;if(wt){if(wt!==dt)if(wt.startsWith(dt)){const Ft=wt.slice(dt.length),Ht=re.pendingChars.value;Ft.length<=8?(Ve++,Ye||Ve>=2&&Ht<=8?(Ye=!0,re.reset(wt)):re.enqueue(Ft)):(nt(),re.enqueue(Ft))}else nt(),re.reset(wt)}else nt(),re.reset("");rt&&re.finish()},{immediate:!0}),{smoothStream:re,smoothStreamingEligible:ae,smoothStreamingEnabled:Ne,renderContent:De,requestedFinal:je,effectiveFinal:ot}})(I,{isClient:G,inheritedSmoothStreaming:Q}),Ge=Fe.value===!0;Ln("markstreamSmoothStreaming",Ee);const at=Z(!1),Tt=Z(!1),Bt=Z(!1);let Yt="",Sn=!1,on=null;function en(){G&&on!=null&&(window.clearTimeout(on),on=null)}function Cn(){at.value=!1,en()}function Mn(L,q){if(!fe.value)return;const re=(function(){if(!fe.value)return null;const ae=gt(We),be=gt(tt),Ne=Math.max(Lt,be);if(ae<=0&&Ne<=0)return null;const De={total:ae,maxPerFrame:Ne,byLabel:(je=We,Object.fromEntries(Array.from(je.entries()).sort((ot,Ve)=>Ve[1]-ot[1]||ot[0].localeCompare(Ve[0]))))};var je;return We.clear(),tt.clear(),Lt=0,De})();console.info(`[markstream-vue][perf] ${L}`,re?rn(mt({},q),{layoutReads:re}):q)}Je([()=>I.indexKey,()=>I.customId],()=>{var L,q;Cn(),Tt.value=!1,Bt.value=!((L=o.nodes)!=null&&L.length)&&Fe.value!==!0&&!!o.content,Yt=(q=it.value)!=null?q:"",Sn=Yt.length>0},{flush:"sync"}),Je([()=>o.content,()=>o.nodes,Fe],([L,q,re])=>{!q?.length&&re!==!0&&L&&(Bt.value=!0)},{flush:"sync",immediate:!0}),Je([it,()=>o.nodes,Fe],([L,q,re])=>{const ae=L??"";return q?.length||re===!0?(Cn(),Tt.value=!1,Yt=ae,void(Sn=!0)):(ae.length>0&&(Bt.value=!0),Sn?(Yt&&ae.length>Yt.length&&ae.startsWith(Yt)?(at.value=!0,Tt.value=!0,G&&(en(),on=window.setTimeout(()=>{var be;on=null,Oe.value===!0||(be=o.nodes)!=null&&be.length||(qc(),at.value=!1,Ol())},1200))):(ae.length<Yt.length||!ae.startsWith(Yt))&&(Cn(),Tt.value=!1),void(Yt=ae)):(Yt=ae,void(Sn=!0)))},{flush:"sync",immediate:!0});const We=new Map,tt=new Map;let Ue=!1,Lt=0;function gt(L){let q=0;for(const re of L.values())q+=re;return q}function wn(){Lt=Math.max(Lt,gt(tt)),tt.clear(),Ue=!1}function yn(L){L.maxPerFrame=Math.max(Number(L.maxPerFrame||0),Number(L.currentFrameTotal||0)),L.currentFrameTotal=0,L.frameScheduled=!1}function go(L){var q,re;fe.value&&(We.set(L,((q=We.get(L))!=null?q:0)+1),tt.set(L,((re=tt.get(L))!=null?re:0)+1),(function(ae){const be=(function(){if(!G||typeof window>"u")return null;const Ne=window;if(Ne.__markstreamLayoutReadPerformance)return Ne.__markstreamLayoutReadPerformance;const De={total:0,maxPerFrame:0,byLabel:{}};return Ne.__markstreamLayoutReadPerformance=De,De})();be&&(be.total=Number(be.total||0)+1,be.byLabel[ae]=Number(be.byLabel[ae]||0)+1,be.currentFrameTotal=Number(be.currentFrameTotal||0)+1,be.frameScheduled||(be.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>yn(be),0):queueMicrotask(()=>yn(be)):window.requestAnimationFrame(()=>yn(be))))})(L),Ue||(Ue=!0,G&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(wn):typeof queueMicrotask!="function"?setTimeout(wn,0):queueMicrotask(wn)))}function qt(L,q){return go(L),q()}const ps=I.customId?`renderer-${I.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,xs=(function(L){const q=new Map;return{scope:L,cache:q,clear:()=>q.clear()}})(ps),_n=ps;Ln(A$,xs);const In=fs(()=>I.customId),{effectiveCustomHtmlTagsSet:To,mergedParseOptions:lo,parsedNodes:St,getParsedNodesDirtyStartIndex:hs,getParsedNodesRevision:Jo}=Qfe(I,{instanceMsgId:ps,renderContent:it,effectiveFinal:Oe,smoothStreamingEnabled:Ee,debugPerformanceEnabled:fe,customComponentsMap:In,logPerf:Mn});Je(St,()=>{at.value||xs.clear(),ie.value+=1},{immediate:!0});const uo=R(()=>({customId:I.customId,customHtmlTags:lo.value.customHtmlTags,parseOptions:I.parseOptions,customMarkdownIt:I.customMarkdownIt,htmlPolicy:ge.value,viewportPriority:I.viewportPriority,viewportPriorityOptions:de.value,mode:c.value,domMode:I.domMode,codeRenderer:m.value,codeBlockStream:I.codeBlockStream,codeBlockDarkTheme:I.codeBlockDarkTheme,codeBlockLightTheme:I.codeBlockLightTheme,codeBlockMonacoOptions:I.codeBlockMonacoOptions,renderCodeBlocksAsPre:I.renderCodeBlocksAsPre,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockProps:I.codeBlockProps,mermaidProps:I.mermaidProps,d2Props:I.d2Props,infographicProps:I.infographicProps,showTooltips:we.value,themes:I.themes,langs:I.langs,isDark:I.isDark,typewriter:f.value,smoothStreamingOptions:I.smoothStreamingOptions,parseCoalesceMs:I.parseCoalesceMs,fade:I.fade}));Ln("markstreamNestedRendererProps",uo);const Ys=R(()=>St.value),Nn=R(()=>St.value.length),no=Z(null),$s=Z(null),Xs=Z(null),ci=Z(null),Oo=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),vo=!Oo&&I.customId?G_(I.customId):null,Po=R(()=>vo?(o4.value,G_(I.customId)):null),co=R(()=>{var L;return!!(!Y.value&&I.customId&&!Oo&&((L=Po.value)!=null&&L.enabled))}),Tn=R(()=>!!(G&&co.value)),fo=R(()=>{var L;return!!(!Y.value&&((L=o.virtualScroll)!=null&&L.enabled))}),Qe=R(()=>fo.value),st=Z(!1);dn(()=>{st.value=!0});const Ct=R(()=>!!(G&&fo.value));Ln("markstreamHostScrollManaged",Ct);const Qt=R(()=>!!(st.value&&Ct.value)),kn=R(()=>Tn.value||Ct.value),Ko=R(()=>Tn.value||Qt.value),Eo=R(()=>{var L;return kn.value&&((L=Po.value)==null?void 0:L.textEstimation)!==!1});function bo(){const L=ne.value||qt("getMeasuredContainerWidth.clientWidth",()=>{var q;return((q=O.value)==null?void 0:q.clientWidth)||0});return Number.isFinite(L)&&L>0?L:0}const Ns=R(()=>{const L=bo();return L>0?Math.max(1,Math.round(L)):640}),Do=R(()=>{var L,q;return!(Oe.value!==!0||fo.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(L=o.nodes)!=null&&L.length||Bt.value||!(((q=I.maxLiveNodes)!=null?q:0)<=0))}),Io=R(()=>{var L;return Do.value?50:Math.max(1,(L=I.maxLiveNodes)!=null?L:320)}),Qo=R(()=>{var L;return Do.value?16:Math.max(0,(L=I.liveNodeBuffer)!=null?L:60)}),sn=R(()=>{var L;return!Y.value&&I.nodeVirtual!==!1&&!(((L=I.maxLiveNodes)!=null?L:0)<=0&&!Do.value)&&(I.nodeVirtual===!0?St.value.length>0:St.value.length>Io.value)}),es=R(()=>sn.value||Tn.value||Ct.value),ms=R(()=>I.viewportPriority!==!1),Tr=R(()=>!!ms.value&&!K.value);var ts;ts=R(()=>ms.value),Ln(k$,ts);const Ki=R(()=>{var L;return!(Y.value||I.deferNodesUntilVisible===!1||((L=I.maxLiveNodes)!=null?L:0)<=0||sn.value||St.value.length>900||I.viewportPriority===!1)}),Js=Nde(L=>{var q;return ce((q=L??O.value)!=null?q:null)},ms),{requestFrame:Bo,cancelFrame:Zo,hasIdleCallback:Il,isTestEnv:Zi}=(function(L){const q=L.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,re=L.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,ae=L.isClient&&typeof window.requestIdleCallback=="function",be=(function(){var Ne;if(typeof globalThis>"u"||!("process"in globalThis))return;const De=(Ne=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Ne.value;return De?.env})();return{requestFrame:q,cancelFrame:re,hasIdleCallback:ae,isTestEnv:be?.NODE_ENV==="test"}})({isClient:G}),tl=R(()=>Oe.value===!0&&!fo.value),{resolvedBatchSize:Ho,resolvedInitialBatch:Co,batchingEnabled:Fs,incrementalRenderingActive:Rs,renderedCount:yo,previousRenderContext:ht,adaptiveBatchSize:Le,previousBatchConfig:Ze}=(function(L,q){var re;const ae=R(()=>{var nt;const Be=Math.trunc((nt=L.renderBatchSize)!=null?nt:80);return Number.isFinite(Be)?Math.max(0,Be):0}),be=R(()=>{var nt;const Be=Math.trunc((nt=L.initialRenderBatchSize)!=null?nt:ae.value);return Number.isFinite(Be)?Math.max(0,Be):ae.value}),Ne=R(()=>!q.renderAsFragment.value&&L.batchRendering!==!1&&ae.value>0&&q.isClient&&!q.isTestEnv),De=Z(0),je=Z({key:L.indexKey,total:0}),ot=Z(Math.max(1,ae.value||1)),Ve=R(()=>{var nt,Be,Xe;return Ne.value&&!((nt=q.continuousStreaming)!=null&&nt.value)&&!((Be=q.forceFullRenderFinalContent)!=null&&Be.value)&&((Xe=L.maxLiveNodes)!=null?Xe:0)<=0}),Ye=Z({batchSize:ae.value,initial:be.value,delay:(re=L.renderBatchDelay)!=null?re:16,enabled:Ve.value});return{resolvedBatchSize:ae,resolvedInitialBatch:be,batchingEnabled:Ne,incrementalRenderingActive:Ve,renderedCount:De,previousRenderContext:je,adaptiveBatchSize:ot,previousBatchConfig:Ye}})(I,{isClient:G,isTestEnv:Zi,renderAsFragment:Y,forceFullRenderFinalContent:tl,continuousStreaming:R(()=>Tt.value&&Oe.value!==!0)}),Xt=R(()=>{var L;return!Y.value&&I.batchRendering!==!1&&Ho.value>0&&!Zi&&((L=I.maxLiveNodes)!=null?L:0)<=0&&!tl.value}),gs=R(()=>Xt.value),di=R(()=>kn.value||gs.value),Ei=R(()=>{var L;return di.value&&((L=Po.value)==null?void 0:L.codeBlockEstimation)!==!1}),ao=new Map,Gi=new Map,Er=new WeakMap;let fi=null;const Ll=new WeakMap,zo=new Map,Ir=[];let Qs=[],pi=[],se=-1;const xe=Xr(Ir),J=new Set,Ce=Z(0);let $e=0;const He=Z(0),vt=R(()=>(He.value,Array.from(ao.entries()).sort((L,q)=>L[0]-q[0]))),ut=Z(null),Dt=Z(null);let Et,ln=null,oo=0,Ot=null;function Pt(){Et.markFallbackHeightPrefixDirty()}function Yn(L){return Et.getFallbackNodeHeight(L)}function ko(L,q){return Et.estimateHeightRange(L,q)}function vs(L){return Et.estimateIndexForOffset(L)}const{activeRestoreAnchor:Os,getRelativeScrollTopWithinContainer:ei,setRelativeScrollTopWithinContainer:Lc,resolveAnchorOffset:U2,clearRestoreReconcile:$c,scheduleRestoreReconcile:yu,captureRestoreAnchor:Nc,restoreAnchor:Fc,getAnchorDrift:j2}=(function(L){const{isClient:q,containerRef:re,parsedNodeCount:ae,requestFrame:be,cancelFrame:Ne,resolveScrollContainer:De,getNormalizedScrollTop:je,getOffsetTopWithinRoot:ot,isReverseFlexScrollRoot:Ve,estimateIndexForOffset:Ye,estimateHeightRange:nt,getFallbackNodeHeight:Be,clamp:Xe}=L,lt=Z(null);let rt=null,wt=[];function dt(){const Kt=De(),fn=re.value;if(!Kt||!fn)return null;const vn=Kt.ownerDocument||fn.ownerDocument||document;if(Kt===vn.documentElement||Kt===vn.body||Kt===vn.scrollingElement){const Qn=fn.getBoundingClientRect();return Math.max(0,-Qn.top)}return Math.max(0,je(Kt,vn,!1)-ot(fn,Kt))}function Ft(Kt){var fn;const vn=De(),Qn=re.value;if(!vn||!Qn)return;const Hs=Math.max(0,Kt),Ss=vn.ownerDocument||Qn.ownerDocument||document,$r=Ss.defaultView||(typeof window<"u"?window:null);if(vn===Ss.documentElement||vn===Ss.body||vn===Ss.scrollingElement){const il=je(vn,Ss,!0)+Qn.getBoundingClientRect().top;return void((fn=$r?.scrollTo)==null||fn.call($r,0,Math.max(0,il+Hs)))}J_(vn,Ss,ot(Qn,vn)+Hs,{isReverseFlexScrollRoot:il=>{var K1;return(K1=Ve?.(il))!=null&&K1},getNormalizedScrollTop:je})}function Ht(Kt){const fn=ae.value,vn=Xe(Kt.nodeIndex,0,Math.max(0,fn-1));return nt(0,vn)+Math.max(0,Kt.offsetWithinNodePx)}function Vt(){if(rt!=null&&(Ne?.(rt),rt=null),q)for(const Kt of wt)window.clearTimeout(Kt);wt=[]}function Wt(Kt){const fn=Ht(Kt),vn=dt();vn!=null&&Math.abs(vn-fn)<=.5||Ft(fn)}return{activeRestoreAnchor:lt,getRelativeScrollTopWithinContainer:dt,setRelativeScrollTopWithinContainer:Ft,resolveAnchorOffset:Ht,clearRestoreReconcile:Vt,applyRestoreAnchor:Wt,scheduleRestoreReconcile:function(){lt.value&&q&&rt==null&&(rt=be?be(()=>{rt=null,lt.value&&Wt(lt.value)}):null,rt==null&&lt.value&&Wt(lt.value))},captureRestoreAnchor:function(){const Kt=dt(),fn=ae.value;if(Kt==null||fn<=0)return null;const vn=Xe(Ye(Kt+1),0,fn-1),Qn=nt(0,vn),Hs=Be(vn);return{nodeIndex:vn,offsetWithinNodePx:Xe(Kt-Qn,0,Math.max(0,Hs-1))}},restoreAnchor:function(Kt){const fn=ae.value;if(lt.value={nodeIndex:Xe(Kt.nodeIndex,0,Math.max(0,fn-1)),offsetWithinNodePx:Math.max(0,Kt.offsetWithinNodePx)},Vt(),Wt(lt.value),q)for(const vn of[0,120,280,480])wt.push(window.setTimeout(()=>{lt.value&&Wt(lt.value)},vn))},getAnchorDrift:function(Kt){const fn=dt();return fn==null?null:fn-Ht(Kt)}}})({isClient:G,containerRef:O,parsedNodeCount:Nn,requestFrame:Bo,cancelFrame:Zo,resolveScrollContainer:()=>ut.value||ue(),getNormalizedScrollTop:ze,getOffsetTopWithinRoot:_e,isReverseFlexScrollRoot:Se,estimateIndexForOffset:vs,estimateHeightRange:ko,getFallbackNodeHeight:Yn,clamp:Bs}),{nodeHeights:$l,heightStats:hi,heightTreeSize:x1,heightSumTree:a0,heightKnownTree:u0,averageNodeHeight:S1,resetHeightMeasurements:c0,pruneHeightMeasurements:d0,rebuildHeightTrees:Rc,recordNodeHeight:V2,removeNodeHeights:q2,exportHeightCache:ke,importHeightCache:Ae,fenwickRangeSum:Ke}=(function(L={}){const q=Go({}),re=Go({total:0,count:0}),ae=Z(0),be=Z([]),Ne=Z([]);function De(){for(const Be of Object.keys(q))delete q[Number(Be)];re.total=0,re.count=0,ae.value=0,be.value=[],Ne.value=[]}function je(Be,Xe,lt){for(let rt=Xe+1;rt<Be.length;rt+=rt&-rt)Be[rt]+=lt}function ot(Be,Xe){let lt=0;for(let rt=Xe+1;rt>0;rt-=rt&-rt)lt+=Be[rt];return lt}function Ve(Be){ae.value=Be;const Xe=new Array(Be+1).fill(0),lt=new Array(Be+1).fill(0);for(const[rt,wt]of Object.entries(q)){const dt=Number(rt),Ft=Number(wt);!Number.isFinite(dt)||dt<0||dt>=Be||!Number.isFinite(Ft)||Ft<=0||(je(Xe,dt,Ft),je(lt,dt,1))}be.value=Xe,Ne.value=lt}function Ye(Be){if(!Number.isInteger(Be)||Be<0)return!1;const Xe=q[Be];if(!Number.isFinite(Xe)||Xe<=0)return!1;if(delete q[Be],re.total=Math.max(0,re.total-Xe),re.count=Math.max(0,re.count-1),ae.value>Be){const lt=be.value,rt=Ne.value;lt.length&&rt.length&&(je(lt,Be,-Xe),je(rt,Be,-1))}return!0}const nt=R(()=>re.count>0?Math.max(12,re.total/re.count):32);return{nodeHeights:q,heightStats:re,heightTreeSize:ae,heightSumTree:be,heightKnownTree:Ne,averageNodeHeight:nt,resetHeightMeasurements:De,pruneHeightMeasurements:function(Be){if(Be<=0)return void De();let Xe=0,lt=0;for(const[rt,wt]of Object.entries(q)){const dt=Number(rt),Ft=Number(wt);!Number.isFinite(dt)||dt<0||dt>=Be||!Number.isFinite(Ft)||Ft<=0?delete q[dt]:(Xe+=Ft,lt++)}re.total=Xe,re.count=lt},rebuildHeightTrees:Ve,recordNodeHeight:function(Be,Xe,lt={}){(function(rt,wt,dt={}){var Ft;if(!Number.isFinite(wt)||wt<=0)return!1;const Ht=q[rt];if(Ht&&(dt.allowShrink===!1&&wt<Ht||Math.abs(wt-Ht)<=1))return!1;if(q[rt]=wt,Ht?re.total+=wt-Ht:(re.total+=wt,re.count++),ae.value>rt){const Vt=be.value,Wt=Ne.value;if(Vt.length&&Wt.length)if(Ht){const Kt=wt-Ht;Kt!==0&&je(Vt,rt,Kt)}else je(Vt,rt,wt),je(Wt,rt,1)}dt.notify!==!1&&((Ft=L.onHeightRecorded)==null||Ft.call(L))})(Be,Xe,rn(mt({},lt),{notify:!0}))},removeNodeHeight:function(Be,Xe={}){var lt;const rt=Ye(Be);return rt&&Xe.notify!==!1&&((lt=L.onHeightRecorded)==null||lt.call(L)),rt},removeNodeHeights:function(Be,Xe={}){var lt;let rt=0;for(const wt of Be)Ye(Number(wt))&&rt++;return rt>0&&Xe.notify!==!1&&((lt=L.onHeightRecorded)==null||lt.call(L)),rt},exportHeightCache:function(){return Object.entries(q).map(([Be,Xe])=>({index:Number(Be),height:Number(Xe)})).filter(Be=>Number.isFinite(Be.index)&&Be.index>=0&&Number.isFinite(Be.height)&&Be.height>0).sort((Be,Xe)=>Be.index-Xe.index)},importHeightCache:function(Be,Xe={}){var lt;if(!Array.isArray(Be))return;const rt=ae.value;let wt=!1;if(Xe.mode!=="merge"){const dt=Object.keys(q);if(dt.length>0){for(const Ft of dt)delete q[Number(Ft)];wt=!0}}for(const dt of Be){const Ft=Number(dt.index),Ht=Number(dt.height);if(!Number.isInteger(Ft)||Ft<0||rt>0&&Ft>=rt||!Number.isFinite(Ht)||Ht<=0)continue;const Vt=q[Ft];Vt&&Math.abs(Vt-Ht)<=1||(q[Ft]=Ht,wt=!0)}wt&&((function(){let dt=0,Ft=0;const Ht=ae.value;for(const[Vt,Wt]of Object.entries(q)){const Kt=Number(Vt),fn=Number(Wt);!Number.isFinite(Kt)||Kt<0||Ht>0&&Kt>=Ht||!Number.isFinite(fn)||fn<=0?delete q[Kt]:(dt+=fn,Ft++)}re.total=dt,re.count=Ft})(),rt>0&&Ve(rt),(lt=L.onHeightRecorded)==null||lt.call(L))},fenwickRangeSum:function(Be,Xe,lt){if(lt<=Xe)return 0;const rt=ot(Be,lt-1);return Xe<=0?rt:rt-ot(Be,Xe-1)}}})({onHeightRecorded:()=>{Pt(),Ct.value&&z1(),Os.value&&yu(),Dt.value&&Uc(),po("node-resize")}});function Mt(L){Number.isInteger(L)&&L>=0&&J.add(L)}function Gt(L){for(const q of L)Mt(Number(q))}function an(L){$e++;let q=!0;try{const re=L();return q=re!==!1,re}finally{$e--,$e===0&&q&&Ce.value++}}function Fn(){Qs=[],pi=[],se=-1,J.clear(),xe.value=Ir}function so(){Fn(),an(()=>c0()),zo.clear()}function Ps(L){!Number.isInteger(L)||L<0||L>=St.value.length||zo.set(L,I1(L))}function ku(L,q,re={}){const ae=$l[L];Mt(L),V2(L,q,re);const be=$l[L];return Object.is(ae,be)?(J.delete(L),!1):(be&&be>0?Ps(L):ae&&zo.delete(L),!0)}function A1(L,q){const re=qt("getNodeLayoutHeight.slot.offsetHeight",()=>{var ae,be;return(be=(ae=ao.get(L))==null?void 0:ae.offsetHeight)!=null?be:0});return re>0?re:qt("getNodeLayoutHeight.content.offsetHeight",()=>q.offsetHeight)}function a6(L,q={}){q.mode!=="merge"?Fn():Gt(L.map(re=>re.index)),an(()=>Ae(L,q)),bv()}const nl=R(()=>Ki.value&&Tr.value),wF=R(()=>{var L;return!Y.value&&I.batchRendering!==!1&&Ho.value>0&&((L=I.maxLiveNodes)!=null?L:0)<=0}),_F=R(()=>!Y.value&&Ge&&Oe.value===!0&&!sn.value&&!fo.value&&!co.value&&!nl.value&&!wF.value),u6=R(()=>!!Js&&nl.value),c6=R(()=>sn.value||Ct.value),{focusIndex:Nl,liveRange:Ds,updateLiveRange:M1}=(function(L,q){const{parsedNodeCount:re,virtualizationEnabled:ae,maxLiveNodesResolved:be,liveNodeBufferResolved:Ne,clamp:De}=q,je=Ne??R(()=>{var Ye;return Math.max(0,(Ye=L.liveNodeBuffer)!=null?Ye:60)}),ot=Z(0),Ve=Go({start:0,end:0});return{liveNodeBufferResolved:je,focusIndex:ot,liveRange:Ve,updateLiveRange:function(){const Ye=re.value;if(!ae.value||Ye===0)return Ve.start=0,void(Ve.end=Ye);const nt=Math.min(be.value,Ye),Be=je.value,Xe=De(ot.value-Be,0,Math.max(0,Ye-nt));Ve.start=Xe,Ve.end=Math.min(Ye,Xe+nt)}}})(I,{parsedNodeCount:Nn,virtualizationEnabled:sn,maxLiveNodesResolved:Io,liveNodeBufferResolved:Qo,clamp:Bs}),ol=new Map,bu=new Map,da=new Map,f0=[],Fl=new Map,fa=new Set,d6=Z(0);let K2=!1;const f6=R(()=>(d6.value,fa.size)),Yi=new Map,sl=new Map,p6=Z(0),Z2=R(()=>{p6.value;let L=0;for(const q of Yi.values())L+=Math.max(0,q);return L});let Xi=null;const p0=R(()=>{if(!sn.value)return St.value.length;const L=Qo.value,q=Math.max(Ds.end+L,Co.value),re=Math.min(St.value.length,q);return Math.max(yo.value,re)});function h0(){K2||(K2=!0,queueMicrotask(()=>{K2=!1,d6.value+=1}))}function h6(L,q,re="node-resize"){if(!G||typeof window>"u")return null;const ae=window.setTimeout(()=>{fa.delete(ae)&&h0();try{q()}finally{po(re)}},Math.max(0,L));return fa.add(ae),h0(),ae}function m0(L){G&&L!=null&&(fa.delete(L)&&h0(),window.clearTimeout(L))}function m6(){if(G&&typeof window<"u")for(const L of fa)window.clearTimeout(L);fa.size&&(fa.clear(),h0()),f0.length=0,da.clear()}function xF(L){F.value=L}function SF(L){U.value=L}function AF(L){z.value=L}const{cancelScheduledFocusSync:G2,scheduleFocusSync:Lr}=(function(L){const{isClient:q,containerRef:re,virtualizationEnabled:ae,requestFrame:be,cancelFrame:Ne,syncFocusToScroll:De}=L;let je=null;function ot(){var Ye,nt,Be;return(Be=(nt=(Ye=re.value)==null?void 0:Ye.ownerDocument)==null?void 0:nt.defaultView)!=null?Be:typeof window<"u"?window:null}function Ve(){if(!je)return;const Ye=ot();je.viaTimeout?Ye?Ye.clearTimeout(je.id):clearTimeout(je.id):Ne?.(je.id),je=null}return{cancelScheduledFocusSync:Ve,scheduleFocusSync:function(Ye={}){if(!ae.value)return;if(!q)return void De(!0);if(Ye.immediate)return Ve(),void De(!0);if(je)return;const nt=()=>{je=null,De()};if(be)return void(je={id:be(nt),viaTimeout:!1});const Be=ot();je={id:Be?Be.setTimeout(nt,16):setTimeout(nt,16),viaTimeout:!0}}}})({isClient:G,containerRef:O,virtualizationEnabled:sn,requestFrame:Bo,cancelFrame:Zo,syncFocusToScroll:function(L=!1){var q;if(!sn.value)return;const re=ut.value||ue();if(!re)return;const ae=re.ownerDocument||((q=O.value)==null?void 0:q.ownerDocument)||document,be=ae?.defaultView||(typeof window<"u"?window:null),Ne=re===ae?.documentElement||re===ae?.body,De=St.value.length;if(De<=0)return;if(!Ne&&De>0&&Se(re)){const rt=qt("syncFocusToScroll.clientHeight",()=>re.clientHeight||0),wt=qt("syncFocusToScroll.scrollTop",()=>re.scrollTop),dt=wt<0?-wt:wt;return void y0(Bs((je=Math.max(0,dt)+.5*Math.max(0,rt),Et.estimateIndexForOffsetFromEnd(je)),0,Math.max(0,De-1)),L)}var je;const ot=(function(rt,wt,dt,Ft){const Ht=O.value;if(!Ht)return null;const Vt=Ft?0:qt("syncFocusToScroll.model.root.getBoundingClientRect",()=>rt.getBoundingClientRect().top),Wt=qt("syncFocusToScroll.model.container.getBoundingClientRect",()=>Ht.getBoundingClientRect().top),Kt=Math.max(0,Vt-Wt),fn=Ft?qt("syncFocusToScroll.model.viewport.clientHeight",()=>{var vn,Qn,Hs,Ss;return(Ss=(Hs=(Qn=dt?.innerHeight)!=null?Qn:(vn=wt.documentElement)==null?void 0:vn.clientHeight)!=null?Hs:rt.clientHeight)!=null?Ss:0}):qt("syncFocusToScroll.model.root.clientHeight",()=>rt.clientHeight);return Bs(vs(Kt+.5*Math.max(0,fn)),0,Math.max(0,St.value.length-1))})(re,ae,be,Ne);if(ot!=null)return void y0(ot,L);const Ve=Ne?null:qt("syncFocusToScroll.root.getBoundingClientRect",()=>re.getBoundingClientRect()),Ye=Ne?0:Ve.top,nt=Ne?qt("syncFocusToScroll.viewport.clientHeight",()=>{var rt,wt;return(wt=(rt=be?.innerHeight)!=null?rt:re.clientHeight)!=null?wt:0}):Ve.bottom,Be=vt.value;let Xe=null,lt=null;for(const[rt,wt]of Be){if(!wt)continue;const dt=qt("syncFocusToScroll.slot.getBoundingClientRect",()=>wt.getBoundingClientRect());dt.bottom<=Ye||dt.top>=nt||(Xe==null&&(Xe=rt),lt=rt)}if(Xe==null||lt==null){const rt=O.value;if(!rt)return;const wt=Ne?{top:0}:qt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>re.getBoundingClientRect()),dt=qt("syncFocusToScroll.fallback.scrollTop",()=>ze(re,ae,Ne)),Ft=Ne?(()=>{const Vt=qt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>rt.getBoundingClientRect()),Wt=(Ne?0:wt.top)-Vt.top;return Math.max(0,Wt)})():(()=>{const Vt=_e(rt,re);return Math.max(0,dt-Vt)})(),Ht=Ne?qt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Vt,Wt,Kt,fn;return(fn=(Kt=(Wt=be?.innerHeight)!=null?Wt:(Vt=ae?.documentElement)==null?void 0:Vt.clientHeight)!=null?Kt:re.clientHeight)!=null?fn:0}):qt("syncFocusToScroll.fallback.root.clientHeight",()=>re.clientHeight);return void y0(Bs(vs(Ft+.5*Math.max(0,Ht)),0,Math.max(0,St.value.length-1)),!0)}y0(Math.round((Xe+lt)/2),L)}}),{visibleNodeIndices:Y2,nodeVisibilityHandles:Oc,nodeVisibilityWatchStops:g0,nodeVisibilityFallbackTimers:g6,clearVisibilityFallback:v0,markNodeVisible:pa,cleanupNodeVisibility:MF,destroyNodeVisibilityState:X2}=epe({isClient:G,shouldTrackVisibleNodeIndices:()=>nl.value,shouldCleanupNodeVisibility:()=>sn.value,onNodeMarkedVisible:L=>{sn.value?Lr():Nl.value=Bs(L,0,Math.max(0,St.value.length-1))},onNodeVisibilityCleaned:L=>{ao.delete(L)&&j6()}}),{cleanupScrollListener:v6,setupScrollListener:TF}=(function(L){const{isClient:q,virtualizationEnabled:re,listenerEnabled:ae,scrollRootElement:be,resolveScrollContainer:Ne,scheduleFocusSync:De,onScroll:je}=L;let ot=null,Ve=null;function Ye(){ot&&(ot(),ot=null),Ve=null,be.value=null}function nt(Be){const Xe=L.getScrollTop?L.getScrollTop(Be):Be.scrollTop;return Math.max(0,Number.isFinite(Xe)?Math.abs(Xe):0)}return{cleanupScrollListener:Ye,setupScrollListener:function(){if(!q)return;if(!((Be=ae?.value)!=null?Be:re.value))return void Ye();var Be;const Xe=Ne();if(!Xe)return void Ye();if(be.value===Xe&&ot)return;Ye(),Ve=nt(Xe);const lt=()=>{if(je?.(),re.value){const rt=(function(wt){const dt=nt(wt),Ft=Ve;Ve=dt;const Ht=Math.max(480,.75*(wt.clientHeight||0));return Ft==null?dt>Ht?{immediate:!0}:void 0:Math.abs(dt-Ft)>Ht?{immediate:!0}:void 0})(Xe);rt?De(rt):De()}};Xe.addEventListener("scroll",lt,{passive:!0}),be.value=Xe,ot=()=>{Xe.removeEventListener("scroll",lt)}}}})({isClient:G,virtualizationEnabled:sn,listenerEnabled:c6,scrollRootElement:ut,resolveScrollContainer:ue,scheduleFocusSync:Lr,onScroll:function(){const L=Dt.value;if(!L)return;const q=E1();if(!q||(function(ae){if(R1()>=oo)return Ot=null,!1;const be=Ot;if(be==null)return!0;const Ne=Math.abs(ae.scrollTop-be)<=2;return Ne||(Ot=null),Ne})(q))return;const re=$6(q);re!=null?(re<-32||Math.abs(Math.max(0,re)-Math.max(0,L.distanceFromBottomPx))>32)&&Wc("restore"):Wc("restore")},getScrollTop:L=>{var q;const re=L.ownerDocument||((q=O.value)==null?void 0:q.ownerDocument)||document,ae=L===re.documentElement||L===re.body||L===re.scrollingElement;return qt("scrollListener.getScrollTop",()=>ze(L,re,ae))}});function y0(L,q=!1){const re=Bs(L,0,Math.max(0,St.value.length-1));!q&&Math.abs(re-Nl.value)<=1||(Nl.value=re,M1())}function Bs(L,q,re){return Math.min(Math.max(L,q),re)}function J2(L=St.value.length){const q=hs();return!Number.isInteger(q)||q<0?L:Bs(q,0,L)}function Q2(L){return L?.firstElementChild}function y6(L,q){var re;return L?(re=L.matches)!=null&&re.call(L,q)?L:L.querySelector(q):null}function EF(L,q){L<1||L>6||(W[L]=q)}function k6(){if(!kn.value)return void(ne.value=0);const L=qt("updateExperimentContainerWidth.clientWidth",()=>{var q,re;return(re=(q=O.value)==null?void 0:q.clientWidth)!=null?re:0});ne.value=L>0?L:0}let T1=null;function ev(){T1?.disconnect(),T1=null}const b6=Af("ViewportDeferredMarkdownCodeBlockNode",zr({loader:()=>mo(null,null,function*(){return(yield jo(()=>import("./index5-BZK7AFSJ.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:dg,delay:0,suspensible:!1}),dg);function C6(L){return L===b6}const w6=R(()=>m.value==="pre"?Pi:m.value==="shiki"?b6:X9);function _6(){var L;return((L=I.codeBlockProps)==null?void 0:L.showHeader)!==!1}function x6(L,q,re){const ae=$l[q],be=typeof ae=="number"&&ae>0;if(Eo.value&&!be&&!(function(Ne){return!!In.value.paragraph&&(Ne.type==="paragraph"||Ne.type==="list_item"||Ne.type==="list")})(L)){const Ne=S$(L,re,X.value);if(Ne)return Ne}if(Ei.value&&L.type==="code_block"){const Ne=(function(De){if(De.type!=="code_block")return null;const je=n7(De,T0(De));return C6(je)?"markdown":je===Pi?"pre":je===w6.value||je===X9?"monaco":null})(L);if(Ne==="monaco"||Ne==="markdown"||Ne==="pre")return(function(De,je){var ot,Ve,Ye;if(!De||De.type!=="code_block")return null;const nt=je.rendererKind,Be=nt!=="pre"&&je.showHeader!==!1,Xe=!!De.diff;let lt=0,rt=500;if(nt==="monaco"){const dt=(ot=je.monacoOptions)!=null?ot:{},Ft=r4(De,dt,je.width),Ht=(function(Wt){const Kt=typeof Wt?.fontSize=="number"&&Wt.fontSize>0?Wt.fontSize:12;return typeof Wt?.lineHeight=="number"&&Wt.lineHeight>0?Wt.lineHeight:Math.round(1.5*Kt)})(dt),Vt=(function(Wt,Kt){var fn,vn;const Qn=typeof((fn=Wt?.padding)==null?void 0:fn.top)=="number"?Wt.padding.top:Kt?0:8,Hs=typeof((vn=Wt?.padding)==null?void 0:vn.bottom)=="number"?Wt.padding.bottom:Kt?0:8;return Math.max(0,Qn)+Math.max(0,Hs)})(dt,Xe);rt=typeof dt.MAX_HEIGHT=="number"&&dt.MAX_HEIGHT>0?dt.MAX_HEIGHT:500,lt=Math.round(Ft*Ht+Vt)}else if(nt==="markdown"){const dt=r4(De);lt=Math.round(21*dt+32)}else{const dt=r4(De);lt=Math.round(28*dt),rt=Number.POSITIVE_INFINITY}const wt=Math.max(1,Math.min(lt,rt));return mt({kind:"code-block",height:Math.round(wt+(Be?40:0)),contentHeight:wt,rendererKind:nt},Xe&&nt==="monaco"?{diffInline:v5((Ve=je.monacoOptions)!=null?Ve:{},(Ye=je.width)!=null?Ye:0)}:{})})(L,{rendererKind:Ne,monacoOptions:I.codeBlockMonacoOptions,showHeader:_6(),width:re})}return null}I4(()=>{if(Ce.value,$e>0)return;const L=St.value,q=Jo();if(!L.length||!di.value)return Qs=[],pi=[],se=-1,J.clear(),void(xe.value=Ir);const re=ne.value||qt("estimatedNodeHeights.clientWidth",()=>{var Ve;return((Ve=O.value)==null?void 0:Ve.clientWidth)||0});if(!Number.isFinite(re)||re<=0)return Qs=[],pi=[],se=-1,J.clear(),void(xe.value=Ir);const ae=(function(Ve){return[Math.round(Ve),Eo.value,Ei.value,X.value,I.codeBlockMonacoOptions,_6(),m.value,In.value,o4.value]})(re),be=Qs.length<=L.length&&(De=ae,(Ne=pi).length===De.length&&Ne.every((Ve,Ye)=>Object.is(Ve,De[Ye])));var Ne,De;const je=be&&se===q?L.length:be?J2(L.length):0,ot=be?Array.from(J):[];Qs.length=L.length;for(let Ve=je;Ve<L.length;Ve++)Qs[Ve]=x6(L[Ve],Ve,re);for(const Ve of ot)Ve>=0&&Ve<L.length&&Ve<je&&(Qs[Ve]=x6(L[Ve],Ve,re));J.clear(),pi=ae,se=q,xe.value=Qs,GR(xe)},{flush:"sync"});const Pc=R(()=>xe.value);Et=(function(L){let q=!0,re=[0],ae="";function be(Ye){var nt;const Be=L.nodeHeights[Ye];if(Number.isFinite(Be)&&Be>0)return Be;const Xe=L.parsedNodes.value[Ye],lt=Xe?.type,rt=!!((nt=L.hasCustomParagraphComponent)!=null&&nt.call(L)),wt=L.estimatedNodeHeights.value[Ye],dt=wt?.height;if(!(function(Ht,Vt,Wt){return!!(Wt&&Vt?.kind==="simple-text"&&(Ht==="paragraph"||Ht==="list_item"||Ht==="list"))})(lt,wt,rt)&&Number.isFinite(dt)&&dt>0)return dt;const Ft=Wfe(Xe,L.getContainerWidth()||640);return lt==="heading"||lt==="paragraph"&&Ft<=28&&(function(Ht,Vt){if(Vt)return!1;const Wt=Ht.children;return!Array.isArray(Wt)||!Wt.length||Wt.every(M$)})(Xe,rt)?Ft:Math.max(L.averageNodeHeight.value,Ft)}function Ne(){var Ye;const nt=L.parsedNodes.value.length,Be=L.getPrefixCacheKeyParts().join(":");if(!q&&ae===Be)return re;const Xe=new Array(nt+1);Xe[0]=0;for(let lt=0;lt<nt;lt++)Xe[lt+1]=Xe[lt]+(L.heightEstimationActive.value?be(lt):(Ye=L.nodeHeights[lt])!=null?Ye:L.averageNodeHeight.value);return re=Xe,ae=Be,q=!1,Xe}function De(Ye){var nt,Be;const Xe=L.parsedNodes.value.length;if(Xe<=0||Ye<=0)return 0;const lt=Ne();if(Ye>=((nt=lt[Xe])!=null?nt:0))return Xe-1;let rt=0,wt=Xe-1,dt=Xe-1;for(;rt<=wt;){const Ft=rt+wt>>1;((Be=lt[Ft+1])!=null?Be:0)>=Ye?(dt=Ft,wt=Ft-1):rt=Ft+1}return dt}function je(Ye,nt){var Be,Xe;if(Ye>=nt)return 0;if(L.heightEstimationActive.value)return(function(wt,dt){var Ft,Ht;const Vt=L.parsedNodes.value.length,Wt=tx(Math.trunc(wt),0,Vt),Kt=tx(Math.trunc(dt),Wt,Vt);if(Wt>=Kt)return 0;const fn=Ne();return((Ft=fn[Kt])!=null?Ft:0)-((Ht=fn[Wt])!=null?Ht:0)})(Ye,nt);if(L.heightTreeSize.value!==L.parsedNodes.value.length){let wt=0;for(let dt=Ye;dt<nt;dt++)wt+=(Be=L.nodeHeights[dt])!=null?Be:L.averageNodeHeight.value;return wt}const lt=L.heightSumTree.value,rt=L.heightKnownTree.value;if(!lt.length||!rt.length){let wt=0;for(let dt=Ye;dt<nt;dt++)wt+=(Xe=L.nodeHeights[dt])!=null?Xe:L.averageNodeHeight.value;return wt}return L.fenwickRangeSum(lt,Ye,nt)+(nt-Ye-L.fenwickRangeSum(rt,Ye,nt))*L.averageNodeHeight.value}function ot(Ye){var nt;if(Ye<=0)return 0;const Be=L.parsedNodes.value;if(L.heightEstimationActive.value)return De(Ye);if(L.heightTreeSize.value===Be.length&&L.heightSumTree.value.length&&L.heightKnownTree.value.length){const lt=L.averageNodeHeight.value,rt=L.heightSumTree.value,wt=L.heightKnownTree.value,dt=Wt=>Wt<=0?0:L.fenwickRangeSum(rt,0,Wt)+(Wt-L.fenwickRangeSum(wt,0,Wt))*lt;let Ft=0,Ht=Be.length-1,Vt=Be.length-1;for(;Ft<=Ht;){const Wt=Ft+Ht>>1;dt(Wt+1)>=Ye?(Vt=Wt,Ht=Wt-1):Ft=Wt+1}return Vt}let Xe=Ye;for(let lt=0;lt<Be.length;lt++){const rt=(nt=L.nodeHeights[lt])!=null?nt:L.averageNodeHeight.value;if(Xe<=rt)return lt;Xe-=rt}return Math.max(0,Be.length-1)}function Ve(){if(!L.heightEstimationActive.value)return 0;let Ye=0;const nt=L.estimatedNodeHeights.value;for(let Be=0;Be<nt.length;Be++){if(!nt[Be])continue;const Xe=L.nodeHeights[Be];Number.isFinite(Xe)&&Xe>0||Ye++}return Ye}return{markFallbackHeightPrefixDirty:function(){q=!0},getFallbackNodeHeight:be,estimateHeightRange:je,estimateIndexForOffset:ot,estimateIndexForOffsetFromEnd:function(Ye){var nt,Be;const Xe=L.parsedNodes.value;if(!Xe.length)return 0;if(Ye<=0)return Math.max(0,Xe.length-1);if(L.heightEstimationActive.value){const rt=(nt=Ne()[Xe.length])!=null?nt:0;return De(Math.max(0,rt-Ye))}if(L.heightTreeSize.value===Xe.length){const rt=je(0,Xe.length);return ot(Math.max(0,rt-Ye))}let lt=Ye;for(let rt=Xe.length-1;rt>=0;rt--){const wt=(Be=L.nodeHeights[rt])!=null?Be:L.averageNodeHeight.value;if(lt<=wt)return rt;lt-=wt}return 0},getEstimatedNodeHeightCount:Ve,buildVirtualHeightSummary:function(Ye){var nt;const Be=L.parsedNodes.value.length;return{totalNodes:Be,measuredCount:L.heightStats.count,estimatedCount:Ve(),averageNodeHeight:L.averageNodeHeight.value,topSpacerHeight:Ye.topSpacerHeight,bottomSpacerHeight:Ye.bottomSpacerHeight,estimatedTotalHeight:je(0,Be),width:(nt=Ye.width)!=null?nt:L.getContainerWidth()}}}})({parsedNodes:St,nodeHeights:$l,heightStats:hi,heightTreeSize:x1,heightSumTree:a0,heightKnownTree:u0,averageNodeHeight:S1,heightEstimationActive:kn,estimatedNodeHeights:Pc,getContainerWidth:bo,hasCustomParagraphComponent:()=>!!In.value.paragraph,getPrefixCacheKeyParts:()=>{var L;const q=uf(ne.value||qt("getFallbackHeightPrefix.clientWidth",()=>{var ae;return((ae=O.value)==null?void 0:ae.clientWidth)||0})),re=((L=o.virtualScroll)==null?void 0:L.measurementKey)==null?"":String(o.virtualScroll.measurementKey);return[St.value.length,hi.count,Math.round(hi.total),Math.round(100*S1.value),re,q,kn.value?1:0,o4.value,ie.value,In.value.paragraph?1:0]},fenwickRangeSum:Ke}),Je(()=>St.value.length,L=>{var q;Pt(),L<=0?so():(L<x1.value&&(q=L,Fn(),an(()=>d0(q))),L!==x1.value&&Rc(L))},{immediate:!0});const IF=R(()=>{if(!sn.value)return St.value.map((ae,be)=>({node:ae,index:be}));const L=St.value.length,q=Bs(Ds.start,0,L),re=Bs(Ds.end,q,L);return St.value.slice(q,re).map((ae,be)=>({node:ae,index:q+be}))}),tv=R(()=>sn.value?ko(0,Math.min(Ds.start,St.value.length)):0),nv=R(()=>{if(!sn.value)return 0;const L=St.value.length;return ko(Math.min(Ds.end,L),L)});function S6(){return Et.buildVirtualHeightSummary({topSpacerHeight:tv.value,bottomSpacerHeight:nv.value,width:Cu()})}function LF(){const L=St.value,q=S6();return rn(mt({},q),{probe:{paragraphReady:!!X.value.paragraph,listItemReady:!!X.value.listItem,listWrapperOverhead:X.value.listWrapperOverhead,headingReadyLevels:Object.entries(X.value.headings).filter(([,re])=>!!re).map(([re])=>Number(re))},nodes:L.map((re,ae)=>{var be,Ne,De,je,ot,Ve,Ye,nt,Be;return{index:ae,type:re.type,estimateKind:(Ne=(be=Pc.value[ae])==null?void 0:be.kind)!=null?Ne:null,rendererKind:(je=(De=Pc.value[ae])==null?void 0:De.rendererKind)!=null?je:null,estimatedHeight:(Ve=(ot=Pc.value[ae])==null?void 0:ot.height)!=null?Ve:null,estimatedContentHeight:(nt=(Ye=Pc.value[ae])==null?void 0:Ye.contentHeight)!=null?nt:null,measuredHeight:(Be=$l[ae])!=null?Be:null}})})}function ov(){return o.indexKey!=null?String(o.indexKey):fo.value?`virtual-${wo()}`:"markdown-renderer"}function A6(L){const q=String(L),re=`${ov()}-`;if(!q.startsWith(re))return null;const ae=q.slice(re.length).match(/^(\d+)(?:$|-)/);if(!ae)return null;const be=Number(ae[1]);return!Number.isInteger(be)||be<0||be>=St.value.length?null:be}function wo(){var L,q,re;const ae=(L=o.virtualScroll)==null?void 0:L.sessionKey;return String(ae!=null&&ae!==""?ae:(re=(q=o.indexKey)!=null?q:I.customId)!=null?re:ps)}function ns(){var L;const q=(L=o.virtualScroll)==null?void 0:L.threadKey;return q==null||q===""?void 0:String(q)}const $F=R(()=>{var L,q,re;return(re=ns())!=null?re:String((q=(L=o.indexKey)!=null?L:I.customId)!=null?q:ps)});function sv(L){var q;return(L??"")===((q=ns())!=null?q:"")}function Rl(){var L,q,re;return q=(L=o.virtualScroll)==null?void 0:L.measurementKey,re=(function(){const ae=m.value;return(function(be){var Ne,De;const je=be.renderer,ot=je==="monaco"?be.codeBlockMonacoOptions:void 0,Ve=be.codeBlockProps,Ye=je==="shiki";return[be.isDark?"dark":"light",je==="monaco"?"code-rich":je==="pre"?"code-pre":"code-shiki",be.codeBlockStream===!1?"code-static":"code-stream",As(be.codeBlockMinWidth),As(be.codeBlockMaxWidth),...Ye?[Lce((Ne=Ve?.themes)!=null?Ne:be.themes,(De=Ve?.langs)!=null?De:be.langs)]:[],As(ot?.fontSize),As(ot?.lineHeight),As(ot?.fontFamily),As(ot?.tabSize),As(ot?.MAX_HEIGHT),As(ot?.wordWrap),As(ot?.wrappingIndent),As(ot?.padding),As(Ve?.showHeader),As(Ve?.showCopyButton),As(Ve?.showExpandButton),As(Ve?.showPreviewButton),As(Ve?.showCollapseButton),As(Ve?.showFontSizeButtons)].join("\0")})({renderer:ae,isDark:I.isDark,codeBlockStream:I.codeBlockStream,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockMonacoOptions:ae==="monaco"?I.codeBlockMonacoOptions:void 0,codeBlockProps:I.codeBlockProps,themes:ae==="shiki"?I.themes:void 0,langs:ae==="shiki"?I.langs:void 0})})(),[q==null?"":String(q),re].join("\0")}function Cu(){return bo()}const k0=R(()=>uf(Cu())),Ji=R(()=>[Rl(),k0.value].join("\0")),NF=R(()=>{var L;return fo.value?["virtual",(L=ns())!=null?L:"",wo(),Ji.value].join("\0"):o.indexKey});function Dc(){p6.value+=1}function iv(L){return!(!L||!Number.isInteger(L.index)||L.index<0||L.index>=St.value.length||L.sessionKey!==wo()||L.threadKey!==ns()||L.layoutEpochKey!==Ji.value)}function M6(L){const q=String(L),re=sl.get(q);return re?iv(re)?re.index:null:A6(q)}function T6(L="async-node"){(Yi.size||sl.size)&&(Yi.clear(),sl.clear(),Dc(),po(L))}const Bc=nn(G3,null),rv={reportHeight(L,q){if(!Ct.value)return;const re=M6(L);if(re==null)return;const ae=ol.get(re);if(!ae)return;const be=Number(q),Ne=A1(re,ae);(function(De,je,ot={}){an(()=>ku(De,je,ot))})(re,Number.isFinite(be)&&be>0?Math.max(be,Ne||0):Ne)},markPending(L){if(!Ct.value)return;const q=A6(L);q!=null&&(function(re,ae){var be;const Ne=sl.get(re);if(Ne&&iv(Ne))return Yi.set(re,Math.max(0,(be=Yi.get(re))!=null?be:0)+1),Dc(),void po("async-node");Yi.set(re,1),sl.set(re,(function(De){return{index:De,sessionKey:wo(),threadKey:ns(),layoutEpochKey:Ji.value}})(ae)),Dc(),po("async-node")})(String(L),q)},markSettled(L){if(!Ct.value)return;const q=String(L),re=M6(L);(re!=null||(function(ae){return Yi.has(String(ae))})(q))&&(function(ae){var be;const Ne=(be=Yi.get(ae))!=null?be:0;return!(Ne<=0||(Ne<=1?(Yi.delete(ae),sl.delete(ae)):Yi.set(ae,Ne-1),Dc(),Ne===1&&po("async-node"),0))})(q)&&re!=null&&Ol()}};function FF(){let L=0;for(const q of ol.values())L+=qt("getVisibleDomHeight.offsetHeight",()=>{var re;return(re=q?.offsetHeight)!=null?re:0});return Math.ceil(Math.max(0,L))}Ln(G3,{reportHeight(L,q){rv.reportHeight(L,q),Bc?.reportHeight(L,q)},markPending(L){rv.markPending(L),Bc?.markPending(L)},markSettled(L){rv.markSettled(L),Bc?.markSettled(L)}});let lv,av=null,Hc=null;function b0(L){return L!==!1&&L!=null&&L!==""}function E6(){return sn.value?(function(){if(!sn.value)return!0;const L=St.value.length,q=Bs(Ds.start,0,L),re=Bs(Ds.end,q,L);if(q>=re)return!0;for(let ae=q;ae<re;ae++)if(!ao.has(ae)||x0(ae)&&!ol.has(ae))return!1;return!0})():yo.value>=p0.value}function uv(){return Oe.value===!0&&!at.value&&Z2.value===0&&fa.size===0&&Fl.size===0&&Xi==null&&E6()}function I6(){var L,q;if(((L=o.virtualScroll)==null?void 0:L.settleMode)!=="manual"||av===wo()&&lv===ns())return!0;const re=(q=o.virtualScroll)==null?void 0:q.settledToken;return!!b0(re)&&Hc===W1(re)}function cv(){return uv()&&I6()}function RF(L,q){return q.totalNodes<=0?L==="final"?"final":"estimate":q.measuredCount>=q.totalNodes?L==="final"?"final":"measured":q.measuredCount>0||q.estimatedCount>0?"mixed":"estimate"}function wu(L="manual",q){const re=S6(),ae=(function(be){return be||(Oe.value!==!0?St.value.length>0?"streaming":"estimating":!E6()||Fl.size>0||Xi!=null?"measuring":cv()?"settled":"settling")})(q);return{sessionKey:wo(),threadKey:ns(),phase:ae,nodeCount:re.totalNodes,liveRange:{start:Ds.start,end:Ds.end},renderedCount:yo.value,measuredCount:re.measuredCount,estimatedCount:re.estimatedCount,averageNodeHeight:re.averageNodeHeight,topSpacerHeight:re.topSpacerHeight,bottomSpacerHeight:re.bottomSpacerHeight,visibleDomHeight:FF(),totalHeight:L6(),width:re.width,final:Oe.value===!0,stable:cv(),confidence:RF(ae,re),reason:L}}function E1(){const L=ut.value||ue(),q=O.value;if(!L||!q)return null;const re=L.ownerDocument||q.ownerDocument||document,ae=L===re.documentElement||L===re.body||L===re.scrollingElement,be=qt("getScrollBox.scrollTop",()=>ze(L,re,ae)),Ne=qt("getScrollBox.scrollHeight",()=>{var je,ot,Ve,Ye,nt;return ae?Math.max((ot=(je=re.documentElement)==null?void 0:je.scrollHeight)!=null?ot:0,(Ye=(Ve=re.body)==null?void 0:Ve.scrollHeight)!=null?Ye:0,(nt=L.scrollHeight)!=null?nt:0):L.scrollHeight}),De=qt("getScrollBox.clientHeight",()=>{var je;return ae?((je=re.documentElement)==null?void 0:je.clientHeight)||L.clientHeight||0:L.clientHeight});return{root:L,doc:re,isViewportRoot:ae,scrollTop:be,scrollHeight:Ne,clientHeight:De}}function L6(){const L=St.value.length,q=Math.max(0,ko(0,L)),re=qt("getRendererLogicalHeight.offsetHeight",()=>{var be,Ne;return(Ne=(be=O.value)==null?void 0:be.offsetHeight)!=null?Ne:0}),ae=Math.max(0,re>0?re:qt("getRendererLogicalHeight.scrollHeight",()=>{var be,Ne;return(Ne=(be=O.value)==null?void 0:be.scrollHeight)!=null?Ne:0}));return L<=0?Math.ceil(re):sn.value?q>0?Math.max(1,Math.ceil(q),(function(){let be=tv.value+nv.value;for(const Ne of ao.values())Ne&&(be+=Math.max(0,qt("getVirtualizedDomLogicalHeight.offsetHeight",()=>Ne.offsetHeight||0)));return Math.ceil(Math.max(0,be))})(),(function(be,Ne){return be<=0||Ne<=0?0:Ne<=be+Math.max(512,.05*be)?Math.ceil(Ne):0})(q,ae)):Math.max(1,Math.ceil(ae)):Ct.value?q>0||hi.count>0||Et.getEstimatedNodeHeightCount()>0?(Rs.value&&yo.value,Math.max(1,Math.ceil(ae),Math.ceil(q))):Math.ceil(ae):Math.max(1,Math.ceil(ae),Math.ceil(q))}function $6(L){const q=O.value;if(!q)return null;const re=qt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>q.getBoundingClientRect());return(function(be){return be.isViewportRoot?be.clientHeight:qt("getViewportBottomInRoot.getBoundingClientRect",()=>be.root.getBoundingClientRect().bottom)})(L)-re.bottom}function OF(L={}){const q=L.requireViewport!==!1,re=(function(Ne=64){const De=E1(),je=O.value;if(!De||!je)return!1;const ot=(function(Ye){if(Ye.isViewportRoot)return{top:0,bottom:Ye.clientHeight};const nt=qt("getVirtualViewportRect.getBoundingClientRect",()=>Ye.root.getBoundingClientRect());return{top:nt.top,bottom:nt.bottom}})(De),Ve=qt("isRendererNearVirtualViewport.getBoundingClientRect",()=>je.getBoundingClientRect());return Ve.bottom>=ot.top-Ne&&Ve.top<=ot.bottom+Ne})();if(q&&!re)return null;const ae=(function(){const Ne=E1(),De=O.value;if(!Ne||!De||Math.max(0,Ne.scrollHeight-Ne.scrollTop-Ne.clientHeight)>64)return null;const je=$6(Ne);return je==null?null:je>=-8&&je<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,je)}:null})();if(ae)return{anchor:ae,captured:!0};const be=Nc();if(be)return{anchor:{type:"node",nodeIndex:be.nodeIndex,offsetWithinNodePx:be.offsetWithinNodePx},captured:re};if(L.allowFallback===!0){const Ne=(function(){const De=St.value.length;return De<=0?null:{type:"node",nodeIndex:Bs(Nl.value,0,Math.max(0,De-1)),offsetWithinNodePx:0}})();return Ne?{anchor:Ne,captured:!1}:null}return null}function dv(L){let q=2166136261;for(let re=0;re<L.length;re++)q^=L.charCodeAt(re),q=Math.imul(q,16777619);return(q>>>0).toString(36)}function PF(L,q){let re=L;for(let ae=0;ae<q.length;ae++)re^=q.charCodeAt(ae),re=Math.imul(re,16777619);return re^=31,re=Math.imul(re,16777619),re}const DF=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function C0(L,q=new WeakSet,re=0){if(L==null||typeof L=="number"||typeof L=="boolean")return String(L);if(typeof L=="string")return`s:${(function(ae){const be=ae.length>8192?`${ae.slice(0,8192)}...${ae.length}`:ae;return`${ae.length}:${dv(be)}`})(L)}`;if(typeof L=="function")return"fn";if(typeof L!="object")return typeof L;if(q.has(L))return"cycle";if(re>=6)return"max-depth";q.add(L);try{if(Array.isArray(L)){if(L.length<=160){const Ve=[];for(let Ye=0;Ye<L.length;Ye++)Ve.push(C0(L[Ye],q,re+1));return`a:${L.length}:${Ve.join(",")}`}const Ne=[],De=[],je=Math.max(0,L.length-32);let ot=2166136261;for(let Ve=0;Ve<L.length;Ve++){const Ye=C0(L[Ve],q,re+1);ot=PF(ot,Ye),Ve<32&&Ne.push(Ye),Ve>=je&&De.push(Ye)}return[`a:${L.length}`,`h=${Ne.join(",")}`,`t=${De.join(",")}`,`all=${(ot>>>0).toString(36)}`].join(":")}const ae=L,be=Object.keys(ae).filter(Ne=>{const De=ae[Ne];return Ne!=="parent"&&Ne!=="el"&&Ne!=="component"&&(De==null||typeof De=="string"||typeof De=="number"||typeof De=="boolean"||DF.has(Ne))}).sort();return`o:${be.length}:${be.map(Ne=>`${Ne}=${C0(ae[Ne],q,re+1)}`).join(";")}`}finally{q.delete(L)}}let fv=-1,pv="",_u=[2166136261];function I1(L){const q=St.value[L];return q?dv(C0(q)):""}function BF(L,q){let re=L;for(let ae=0;ae<q.length;ae++)re^=q.charCodeAt(ae),re=Math.imul(re,16777619);return re>>>0}function hv(){var L,q;const re=ie.value;if(fv===re)return pv;const ae=St.value.length;let be=J2(ae);(fv!==re-1||be>ae||_u.length<be+1)&&(be=0),be===0?_u=[2166136261]:_u.length=be+1;for(let Ne=be;Ne<ae;Ne++){const De=I1(Ne);_u[Ne+1]=BF((L=_u[Ne])!=null?L:2166136261,De)}return _u.length=ae+1,pv=(((q=_u[ae])!=null?q:2166136261)>>>0).toString(36),fv=re,pv}function zc(L,q={}){var re;const ae=q.includeHeightCache===!0,be=(re=q.includeContentHash)!=null?re:ae,Ne=ae?(function(je){const ot=(function(){var rt,wt;const dt=Number((wt=(rt=o.virtualScroll)==null?void 0:rt.heightCacheLimit)!=null?wt:5e3);return!Number.isFinite(dt)||dt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(dt))})();if(!Number.isFinite(ot)||je.length<=ot)return je;const Ve=new Map,Ye=rt=>{!rt||Ve.size>=ot||Ve.set(rt.index,rt)},nt=St.value.length,Be=Bs(Ds.start-2*Qo.value,0,nt),Xe=Bs(Ds.end+2*Qo.value,Be,nt);for(const rt of je)rt.index>=Be&&rt.index<Xe&&Ye(rt);const lt=Math.max(1,Math.ceil(je.length/ot));for(let rt=0;rt<je.length&&Ve.size<ot;rt+=lt)Ye(je[rt]);for(let rt=je.length-1;rt>=0&&Ve.size<ot;rt-=lt)Ye(je[rt]);return Array.from(Ve.values()).sort((rt,wt)=>rt.index-wt.index).slice(0,ot)})(ke().map(je=>{var ot;const Ve=St.value[je.index];return Ve?rn(mt({},je),{nodeType:String((ot=Ve.type)!=null?ot:""),signature:I1(je.index)}):null}).filter(je=>!!je)):[],De=OF({allowFallback:q.allowAnchorFallback===!0,requireViewport:q.requireViewport});return De||Ne.length||q.includeEmptyState===!0?rn(mt({sessionKey:L.sessionKey,threadKey:L.threadKey},De?{anchor:De.anchor,anchorCaptured:De.captured}:{anchorCaptured:!1}),{metrics:L,width:L.width,contentHash:be?hv():void 0,measurementKey:Rl()||void 0,heightCache:Ne.length?Ne:void 0}):null}function mv(L){var q,re;const ae=E1();if(!ae)return;const be=(function(je){const ot=O.value;if(!ot)return null;const Ve=_e(ot,je.root),Ye=St.value.length,nt=qt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>ot.offsetHeight||0),Be=Math.max(0,nt>0?nt:Ye>0?qt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>ot.scrollHeight||0):0),Xe=L6();return Ve+Math.max(Be,Xe)})(ae);if(be==null)return;const Ne=Math.max(0,L.distanceFromBottomPx),De=Math.max(0,be-ae.clientHeight-Ne);(function(je){oo=R1()+120,Ot=je})(De),ae.isViewportRoot?(re=(q=ae.doc.defaultView)==null?void 0:q.scrollTo)==null||re.call(q,0,De):J_(ae.root,ae.doc,De,{isReverseFlexScrollRoot:Se,getNormalizedScrollTop:ze})}const gv=[];function N6(){if(G)for(ln!=null&&(Zo?.(ln),ln=null);gv.length;){const L=gv.pop();L!=null&&window.clearTimeout(L)}}function Wc(L){const q=!!Dt.value;Dt.value=null,oo=0,Ot=null,N6(),q&&L&&po(L)}function Uc(){if(!Dt.value||!G||ln!=null)return;const L=()=>{ln=null;const q=Dt.value;q&&mv(q)};ln=Bo?Bo(L):null,ln==null&&L()}function F6(L,q={}){const re=St.value.length;return re<=0?[]:L.filter(ae=>!(!Number.isInteger(ae.index)||ae.index<0||ae.index>=re)&&!(!Number.isFinite(ae.height)||ae.height<=0)&&!(q.requireSignature&&!ae.signature)&&!(q.requireCompatibilityMetadata&&!ae.nodeType&&!ae.signature)&&(function(be){var Ne;const De=St.value[be.index];return!(!De||be.nodeType&&be.nodeType!==String((Ne=De.type)!=null?Ne:"")||be.signature&&be.signature!==I1(be.index))})(ae))}function R6(L){const q=uf(Cu()),re=uf(L);return q!==-1&&re!==-1&&q===re}function vv(L){var q;const re=Number(L?.width);if(Number.isFinite(re)&&re>0)return re;const ae=Number((q=L?.metrics)==null?void 0:q.width);return Number.isFinite(ae)&&ae>0?ae:null}function O6(L){var q;return L.sessionKey===wo()&&!!sv(L.threadKey)&&((q=L.measurementKey)!=null?q:"")===Rl()&&!!R6(vv(L))&&!!(function(re){const ae=re.heightCache;return!!ae?.length&&(P6(re)?ae.some(be=>!!(be.nodeType||be.signature)):ae.some(be=>!!be.signature))})(L)}function P6(L){return!!(L.contentHash&&L.contentHash===hv())}function HF(L){return!P6(L)}let xu=null,Su=null,w0=null,L1=null,$1=null;function yv(L){var q;const re=L.map(be=>{var Ne,De;return[be.index,Math.round(10*be.height),(Ne=be.nodeType)!=null?Ne:"",(De=be.signature)!=null?De:""].join("")}).join(""),ae=uf(Cu());return[(q=ns())!=null?q:"",wo(),Rl(),St.value.length,ae,L.length,dv(re)].join(":")}function D6(L=(q=>(q=o.virtualScroll)==null?void 0:q.heightCache)()){if(!Ct.value||!L?.length||St.value.length<=0||!R6((q=o.virtualScroll)==null?void 0:q.heightCacheWidth))return!1;var q;const re=F6(L,{requireSignature:!0});if(!re.length)return!1;const ae=yv(re);return ae===xu?(Su="standalone",!0):(a6(re,{mode:"merge"}),Pt(),xu=ae,Su="standalone",P1(),po("restore"),!0)}function kv(L,q={}){var re,ae,be;if(!Ct.value||!L||L.sessionKey!==wo()||!sv(L.threadKey)||St.value.length<=0)return!1;const Ne=!!((re=L.heightCache)!=null&&re.length)&&!_0(),De=!L.anchor||L.anchorCaptured===!1&&q.allowUncapturedAnchor!==!0?null:L.anchor,je=q.restoreAnchor===!0&&!!De&&!_0()&&Number(vv(L))>0;let ot=!1;if((ae=L.heightCache)!=null&&ae.length&&O6(L)){const Ye=F6(L.heightCache,{requireCompatibilityMetadata:!L.contentHash,requireSignature:HF(L)});Ye.length&&(a6(Ye,{mode:"merge"}),Pt(),xu=yv(Ye),Su="restore",P1(),ot=!0)}if(Ne||je)return!1;if(!q.restoreAnchor||!De)return ot&&po("restore"),!0;const Ve=(function(Ye,nt){var Be;const Xe=Ye.anchor,lt=Xe?Xe.type==="bottom"?`bottom:${Math.round(Xe.distanceFromBottomPx)}`:`node:${Xe.nodeIndex}:${Math.round(Xe.offsetWithinNodePx)}`:"none";return[(Be=ns())!=null?Be:"",wo(),Rl(),k0.value,nt,lt].join(":")})(L,(be=q.restoreToken)!=null?be:"imperative");return w0===Ve?(ot&&po("restore"),!0):(w0=Ve,(function(Ye){const nt=()=>{if(Ye.type==="node")return Wc(),void Fc({nodeIndex:Ye.nodeIndex,offsetWithinNodePx:Ye.offsetWithinNodePx});if($c(),Os.value=null,Dt.value=Ye,N6(),mv(Ye),G)for(const Be of[0,120,280,480])gv.push(window.setTimeout(()=>{const Xe=Dt.value;Xe&&mv(Xe)},Be))};(function(Be){if(!sn.value)return!1;const Xe=St.value.length;return!(Xe<=0||(Nl.value=Be.type==="node"?Bs(Be.nodeIndex,0,Xe-1):Xe-1,M1(),0))})(Ye)?yt(nt):nt()})(De),po("restore"),!0)}function _0(){const L=Cu();return Number.isFinite(L)&&L>0}function B6(L){var q;return L.sessionKey===wo()&&!!sv(L.threadKey)&&(St.value.length<=0||!(!((q=L.heightCache)!=null&&q.length)||_0())||!(!(L.anchor&&Number(vv(L))>0)||_0()))}function bv(){zo.clear();for(const L of Object.keys($l)){const q=Number(L);Number.isInteger(q)&&q>=0&&q<St.value.length&&Ps(q)}}function N1(){Xi!=null&&(Zo?.(Xi),Xi=null),Ev()}function H6(){return!G||Zi?Promise.resolve():new Promise(L=>{let q=!1,re=null;const ae=()=>{q||(q=!0,re!=null&&window.clearTimeout(re),L())};if(Bo)return Bo(ae),void(re=window.setTimeout(ae,50));re=window.setTimeout(ae,0)})}function Cv(L,q=ns(),re=Ji.value){return wo()===L&&ns()===q&&Ji.value===re}function wv(){return mo(this,arguments,function*(L={}){var q,re,ae,be,Ne;const De=wo(),je=ns(),ot=Ji.value,Ve=(q=L.frames)!=null?q:2,Ye=(re=L.timeoutMs)!=null?re:120,nt=(ae=L.reason)!=null?ae:"manual",Be=L.expectedSettledTokenKey,Xe=L.flushPendingTimers===!0,lt=wu(nt),rt=()=>rn(mt({},lt),{phase:lt.final?"settling":lt.phase,stable:!1,confidence:lt.confidence==="final"?"mixed":lt.confidence,reason:nt}),wt=()=>Cv(De,je,ot)&&(Be==null||O1()===Be);for(let Vt=0;Vt<Ve;Vt++){if(yield yt(),!wt()||(yield H6(),!wt()))return rt();Ol(),N1()}if(yield(function(Vt){return!G||Vt<=0?Promise.resolve():new Promise(Wt=>window.setTimeout(Wt,Vt))})(Ye),!wt()||(Xe&&m6(),Ol(),N1(),!wt()))return rt();const dt=uv();dt&&(av=De,lv=je,((be=o.virtualScroll)==null?void 0:be.settleMode)==="manual"&&Be!=null&&b0((Ne=o.virtualScroll)==null?void 0:Ne.settledToken)&&O1()===Be&&(Hc=W1(o.virtualScroll.settledToken)));const Ft=wt()&&dt&&I6(),Ht=wu(nt,Ft?"final":void 0);return Mv(Ht,!0),Ht})}let _v="content",Au=null,Mu=null,xv=0,F1=null,jc=null,Sv=null,Av=null;function R1(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function z6(L){var q,re;const ae=F1;if(!ae)return!0;const be=(re=(q=o.virtualScroll)==null?void 0:q.heightDiffThresholdPx)!=null?re:1;return Math.abs(L.totalHeight-ae.totalHeight)>be||L.sessionKey!==ae.sessionKey||L.phase!==ae.phase||L.stable!==ae.stable||L.final!==ae.final||L.threadKey!==ae.threadKey||L.nodeCount!==ae.nodeCount||L.measuredCount!==ae.measuredCount||L.width!==ae.width}function O1(L=(q=>(q=o.virtualScroll)==null?void 0:q.settledToken)()){return As(L)}function W6(L,q){var re,ae;return[L,q.sessionKey,(re=q.threadKey)!=null?re:"",Rl(),hv(),As((ae=o.virtualScroll)==null?void 0:ae.settledToken),Math.round(q.totalHeight),Math.round(q.width)].join("\0")}function P1(){Sv=null,Av=null,jc=null}function zF(L){const q=L.heightCache;return q?.length?yv(q):""}function D1(L){var q,re,ae;const be=L.metrics,Ne=L.anchor?(De=L.anchor).type==="bottom"?`bottom:${Math.round(De.distanceFromBottomPx)}`:`node:${De.nodeIndex}:${Math.round(De.offsetWithinNodePx)}`:"none";var De;return[L.sessionKey,(q=L.threadKey)!=null?q:"",(re=L.measurementKey)!=null?re:Rl(),(ae=L.contentHash)!=null?ae:"",zF(L),Ne,L.anchorCaptured?1:0,be.liveRange.start,be.liveRange.end,be.renderedCount,be.nodeCount,Math.round(be.totalHeight),Math.round(be.width),be.phase,be.stable?1:0].join("\0")}function Mv(L,q=!1){if(!Ct.value||(function(De=!1){return!De&&fo.value&&!Qt.value})(q))return;const re=q||z6(L),ae=(function(De,je=!1){return je||De.stable||De.phase==="final"?{state:zc(De,{includeHeightCache:!0})}:{state:zc(De)}})(L,q),be=ae.state,Ne=!!(be&&(re||(function(De,je=!1){return!!je||D1(De)!==jc})(be,q)));if(re&&($(L),F1=L,xv=R1()),be&&Ne&&(B(be),be.anchor&&H(be.anchor),jc=D1(be)),L.stable){const De=W6("settled",L);if(De!==Sv){Sv=De;const je=zc(L,{includeHeightCache:!0});je&&(B(je),jc=D1(je)),(function(ot){s("render-settled",ot)})(L)}}if(L.phase==="final"){const De=W6("final",L);if(De!==Av){Av=De;const je=zc(L,{includeHeightCache:!0});je&&(B(je),jc=D1(je)),(function(ot){s("render-final",ot)})(L)}}}function Tv(){Au!=null&&(Zo?.(Au),Au=null),Mu!=null&&G&&(window.clearTimeout(Mu),Mu=null)}function U6(){Au=null,Mu=null,(function(L){if(Fl.size>0||Xi!=null)return!0;switch(L){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(_v)&&(Ol(),N1()),Mv(wu(_v))}function po(L){var q,re;if(!Ct.value||(_v=L,Au!=null||Mu!=null))return;const ae=Math.max(0,(re=(q=o.virtualScroll)==null?void 0:q.emitIntervalMs)!=null?re:32),be=Math.max(0,ae-(R1()-xv)),Ne=()=>{Mu=null,Au=Bo?Bo(U6):null,Au==null&&U6()};G&&be>0?Mu=window.setTimeout(Ne,be):Ne()}function j6(){He.value+=1}function x0(L){if(Rs.value&&L>=yo.value){const q=St.value[L],re=Fe.value===!0&&Oe.value!==!0&&L>=St.value.length-2,ae=q?.type==="code_block"||q?.type==="image"||q?.type==="mermaid"||q?.type==="infographic";if(!re||ae)return!1}return!nl.value||L<Co.value||Y2.value.has(L)}function Vc(L){const q=g0.get(L);q&&(q(),g0.delete(L));const re=Oc.get(L);re&&(re.destroy(),Oc.delete(L)),v0(L)}function S0(L,q){let re=!1;if(q){const Ne=ao.get(L);ao.set(L,q),Ne!==q&&(re=!0)}else ao.delete(L)&&(re=!0);if(re&&j6(),q||v0(L),!u6.value||!Js)return Vc(L),void(q&&nl.value&&pa(L,!0));if(!sn.value&&nl.value&&!K.value&&Oc.size>=ve.value&&(K.value||(K.value=!0,X2()),!u6.value||!Js))return Vc(L),void(q&&pa(L,!0));if(L<Co.value&&!sn.value||Y2.value.has(L))return Vc(L),void pa(L,!0);if(!q)return void Vc(L);Vc(L);const ae=Js(q,{rootMargin:pe.value});if(!ae)return;Oc.set(L,ae),pa(L,ae.isVisible.value),nl.value&&(function(Ne){if(!G||!nl.value)return;v0(Ne);const De=Ne%17*23,je=window.setTimeout(()=>{if(g6.delete(Ne),!nl.value||Y2.value.has(Ne))return;const ot=ao.get(Ne);if(!ot)return;const Ve=ue(ot),Ye=ot.ownerDocument||document,nt=Ye.defaultView||window,Be=!Ve||Ve===Ye.documentElement||Ve===Ye.body,Xe=!Be&&Ve?qt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ve.getBoundingClientRect()):null,lt=Be?0:Xe.top,rt=Be?qt("nodeVisibilityFallback.clientHeight",()=>{var dt,Ft;return(Ft=(dt=nt.innerHeight)!=null?dt:Ve?.clientHeight)!=null?Ft:0}):Xe.bottom,wt=qt("nodeVisibilityFallback.node.getBoundingClientRect",()=>ot.getBoundingClientRect());wt.bottom>=lt-500&&wt.top<=rt+500&&pa(Ne,!0)},1800+De);g6.set(Ne,je)})(L);let be=null;be=Je(()=>ae.isVisible.value,Ne=>{if(Ne){v0(L),pa(L,!0),be?.(),g0.delete(L),Oc.get(L)===ae&&Oc.delete(L);try{ae.destroy()}catch{}}},{immediate:!0}),g0.set(L,be),sn.value&&Lr()}function Ev(){Xi=null,an(()=>{let L=!1;for(const[q,re]of Fl)Fl.delete(q),ol.get(q)===re.el&&bu.get(q)===re.version&&(L=ku(q,re.height,{allowShrink:re.allowShrink})||L);return L})}function qc(){Xi!=null&&(Zo?.(Xi),Xi=null),Fl.clear()}function A0(L,q){(function(re,ae,be){var Ne;if(!Number.isFinite(be)||be<=0||ol.get(re)!==ae)return;const De=bu.get(re);if(De==null)return;const je=St.value[re],ot=at.value&&Oe.value!==!0&&!((Ne=o.nodes)!=null&&Ne.length)&&re>=St.value.length-2,Ve=!(je?.loading===!0||ot),Ye=Fl.get(re),nt=Ye?Ye.allowShrink&&Ve:Ve,Be=Ye&&!nt?Math.max(Ye.height,be):be;Fl.set(re,{height:Be,allowShrink:nt,version:De,el:ae}),Xi==null&&(Xi=Bo?Bo(Ev):null,Xi==null&&Ev())})(L,q,A1(L,q))}function Ol(){for(const[L,q]of ol)q&&A0(L,q)}function V6(){fi?.disconnect(),fi=null,Gi.clear()}function Iv(){for(;f0.length;)m0(f0.pop())}Je(Qt,L=>{L&&po("content")},{flush:"post"}),t({getVirtualMetrics:wu,captureVirtualState:function(L={}){var q;return zc(wu("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:L.allowFallbackAnchor===!0,requireViewport:L.requireViewport===!0,includeEmptyState:(q=L.includeEmptyState)==null||q})},restoreVirtualState:function(L,q={}){const re=q.restoreAnchor===!0,ae=q.restoreToken==null?"imperative":String(q.restoreToken);L1=L,$1={restoreAnchor:re,restoreToken:ae,allowUncapturedAnchor:q.allowUncapturedAnchor===!0},!kv(L,{restoreAnchor:re,restoreToken:ae,allowUncapturedAnchor:q.allowUncapturedAnchor===!0})&&B6(L)||(L1=null,$1=null)},forceMeasure:function(L="manual"){return mo(this,null,function*(){yield yt(),yield H6(),Ol(),N1(),yield yt();const q=wu(L);return Mv(q,!0),q})},settle:wv,scrollToNode:function(L,q="start"){Wc(),$c();const re=St.value.length;if(re<=0)return;const ae=Bs(L,0,re-1),be=()=>{var Ne;const De=U2({nodeIndex:ae,offsetWithinNodePx:0}),je=Yn(ae),ot=E1(),Ve=(Ne=ot?.clientHeight)!=null?Ne:0,Ye=ei();let nt=De;if(q==="center")nt=De-Ve/2+je/2;else if(q==="end")nt=De-Ve+je;else if(q==="nearest"&&Ye!=null){if(De>=Ye&&De+je<=Ye+Ve)return;nt=De<Ye?De:De-Ve+je}Lc(Math.max(0,nt)),Lr({immediate:!0}),sn.value&&(Nl.value=ae,M1())};if(sn.value)return Nl.value=ae,M1(),void yt(be);be()}}),Je(()=>es.value,L=>{if(!L){V6();for(const q of da.values())for(const re of q)m0(re);da.clear(),bu.clear(),Iv(),qc()}},{immediate:!0}),Je(Oe,L=>{L&&(function(){if(G&&Oe.value&&ol.size){Iv();for(const q of[80,240,640]){const re=h6(q,()=>{for(const[ae,be]of ol)be&&A0(ae,be)},"final");re!=null&&f0.push(re)}}})(),po(L?"final":"content")});const WF=Q_(()=>po("content"),16),UF=Q_(()=>po("batch"),16);Je([()=>St.value.length,()=>yo.value],()=>{Dt.value&&Uc(),WF()},{flush:"post",immediate:!0}),Je([()=>Ds.start,()=>Ds.end],()=>{UF()},{flush:"post"});const{cleanupBatchScheduler:jF}=(function(L){const{props:q,isClient:re,isTestEnv:ae,parsedNodesIdentity:be,parsedNodeCount:Ne,desiredRenderedCount:De,datasetKey:je,batchingEnabled:ot,incrementalRenderingActive:Ve,resolvedBatchSize:Ye,resolvedInitialBatch:nt,renderedCount:Be,adaptiveBatchSize:Xe,previousRenderContext:lt,previousBatchConfig:rt,requestFrame:wt,cancelFrame:dt,hasIdleCallback:Ft,cleanupNodeVisibility:Ht,onDatasetKeyChanged:Vt,onDatasetChanged:Wt}=L;let Kt=null,fn="raf",vn=null,Qn=0,Hs=!1,Ss=!1;const $r=new Set,il=new Set;function K1(){if(re){Kt!=null&&(fn==="raf"&&dt?dt(Kt):fn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(Kt):fn==="timeout"&&window.clearTimeout(Kt),Kt=null),Qn+=1;for(const ti of $r)dt&&dt(ti);for(const ti of il)window.clearTimeout(ti);$r.clear(),il.clear(),vn=null,Hs=!1,Ss=!1}}function R0(){return typeof performance<"u"?performance.now():Date.now()}function u7(ti){(function(Pl){var ma;if(!Ve.value)return;const Dl=Math.max(2,(ma=q.renderBatchBudgetMs)!=null?ma:6),Bl=Math.max(1,Ye.value||1),Nr=Math.max(1,Math.floor(Bl/4));Pl>1.5*Dl?Xe.value=Math.max(Nr,Math.floor(.8*Xe.value)):Pl<.6*Dl&&Xe.value<Bl&&(Xe.value=Math.min(Bl,Math.ceil(1.2*Xe.value)))})(ti),Hs=!1;const Li=Ss||Be.value<De.value;Ss=!1,Li&&f7()}function c7(ti,Li={}){var Pl,ma;if(!Ve.value)return;const Dl=De.value;if(Be.value>=Dl)return;const Bl=Math.max(1,ti),Nr=()=>{const Gc=R0();Kt=null;const Z1=vn??Bl;vn=null;const Yc=R0();Be.value=Math.min(Dl,Be.value+Z1),Ht(Be.value),(function(Pv,O0){if(!re)return void u7(O0);Hs=!0;const p7=++Qn;yt().then(()=>{var h7;if(p7!==Qn)return;const dR=R0(),fR=Math.max(O0,dR-Pv),m7=()=>{p7===Qn&&u7(fR)};if(wt){let Eu=null,Xc=null,v7=!1;const y7=()=>{v7||(v7=!0,Eu!==null&&($r.delete(Eu),Eu=null),Xc!==null&&(il.delete(Xc),window.clearTimeout(Xc),Xc=null),m7())};return Eu=wt(()=>{y7()}),$r.add(Eu),Xc=window.setTimeout(()=>{Eu!==null&&dt&&dt(Eu),y7()},Math.max(32,(h7=q.renderBatchIdleTimeoutMs)!=null?h7:120)),void il.add(Xc)}const g7=window.setTimeout(()=>{il.delete(g7),m7()},0);il.add(g7)})})(Gc,R0()-Yc)};if(!re||Li.immediate)return void Nr();const ga=Math.max(0,(Pl=q.renderBatchDelay)!=null?Pl:16);if(vn=vn!=null?Math.max(vn,Bl):Bl,Kt==null){if(!ae&&Ft&&window.requestIdleCallback){const Gc=Math.max(0,(ma=q.renderBatchIdleTimeoutMs)!=null?ma:120);return fn="idle",void(Kt=window.requestIdleCallback(()=>Nr(),{timeout:Gc}))}if(wt&&!ae)return fn="raf",void(Kt=wt(()=>{ga===0?Nr():(fn="timeout",Kt=window.setTimeout(()=>Nr(),ga))}));fn="timeout",Kt=window.setTimeout(()=>Nr(),ga)}}function d7(ti,Li={}){Hs?Ss=!0:ti==null?f7():c7(ti,Li)}function f7(){Ve.value&&c7(ot.value?Math.max(1,Math.round(Xe.value)):Math.max(1,Ye.value))}return Je([be,Ne,je,Ve,Ye,nt,()=>q.renderBatchDelay],()=>{var ti;const Li=Ne.value,Pl=lt.value,ma=je.value,Dl=!Object.is(ma,Pl.key),Bl=Li!==Pl.total,Nr=Dl||Bl;lt.value={key:ma,total:Li};const ga=rt.value,Gc=(ti=q.renderBatchDelay)!=null?ti:16,Z1=ga.batchSize!==Ye.value||ga.initial!==nt.value||ga.delay!==Gc||ga.enabled!==Ve.value;rt.value={batchSize:Ye.value,initial:nt.value,delay:Gc,enabled:Ve.value},Dl&&Vt(Li),(Nr||Z1||!Ve.value)&&K1(),(Nr||Z1)&&(Xe.value=Math.max(1,Ye.value||1)),Nr&&Wt();const Yc=De.value;if(!Li)return Be.value=0,void Ht(0);if(!Ve.value)return Be.value=Yc,void Ht(Be.value);const Pv=Dl||Pl.total===0;Be.value=Pv||Z1?Math.min(Yc,nt.value):Math.min(Be.value,Yc);const O0=Math.max(1,nt.value||Ye.value||Li);Be.value<Yc?d7(O0,{immediate:!re}):Ht(Be.value)},{immediate:!0}),Je(De,(ti,Li)=>{Ve.value&&(typeof Li=="number"&&ti<=Li||ti>Be.value&&d7())}),{cleanupBatchScheduler:K1}})({props:I,isClient:G,isTestEnv:Zi,parsedNodesIdentity:Ys,parsedNodeCount:Nn,desiredRenderedCount:p0,datasetKey:NF,batchingEnabled:Fs,incrementalRenderingActive:Rs,resolvedBatchSize:Ho,resolvedInitialBatch:Co,renderedCount:yo,adaptiveBatchSize:Le,previousRenderContext:ht,previousBatchConfig:Ze,requestFrame:Bo,cancelFrame:Zo,hasIdleCallback:Il,cleanupNodeVisibility:MF,onDatasetKeyChanged:L=>{qc(),so(),Pt(),P1(),L>0&&Rc(L)},onDatasetChanged:()=>{sn.value&&Lr({immediate:!0})}});Je([c6,sn,()=>O.value,()=>oe()],([L,q])=>{if(!L)return v6(),void G2();TF(),q?Lr({immediate:!0}):G2()},{flush:"post",immediate:!0}),Je([()=>St.value.length,()=>sn.value],L=>mo(null,[L],function*([q,re]){re&&q&&G&&(yield yt(),Lr({immediate:!0}))}),{flush:"post"}),Je(kn,L=>{L&&(function(){var q;if(no.value&&$s.value&&Xs.value&&((q=ci.value)!=null&&q[1]))return;const re=kt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),ae=kt({type:"list_item",children:[re],raw:"- Probe paragraph text"}),be=kt({type:"list",ordered:!1,items:[ae],raw:"- Probe paragraph text"});no.value=re,$s.value=ae,Xs.value=be;const Ne={1:null,2:null,3:null,4:null,5:null,6:null};for(let De=1;De<=6;De++)Ne[De]=kt({type:"heading",level:De,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(De)} Probe heading`});ci.value=Ne})()},{immediate:!0}),Je([()=>O.value,kn],()=>{if(!kn.value)return ev(),void(ne.value=0);k6(),ev(),kn.value&&O.value&&typeof ResizeObserver<"u"&&(T1=new ResizeObserver(()=>{k6(),Os.value&&yu(),Dt.value&&Uc(),po("resize")}),T1.observe(O.value))},{immediate:!0}),Je([kn,Ns,Ji],()=>mo(null,null,function*(){if(!kn.value)return X.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Pt();yield yt(),(function(){if(!kn.value||typeof window>"u")return X.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Pt();const L={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},q=y6(Q2(F.value),".paragraph-node");L.paragraph=l4(F.value,q,"pre-wrap");const re=Q2(U.value),ae=re?.querySelector(".paragraph-node");L.listItem=l4(U.value,ae,"pre-wrap");const be=qt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var De,je;return(je=(De=z.value)==null?void 0:De.offsetHeight)!=null?je:0}),Ne=qt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var De,je;return(je=(De=U.value)==null?void 0:De.offsetHeight)!=null?je:0});L.listWrapperOverhead=Math.max(0,be-Ne);for(let De=1;De<=6;De++){const je=y6(Q2(W[De]),`h${De}`);L.headings[De]=l4(W[De],je,"pre-wrap")}X.value=L,Pt()})()}),{flush:"post",immediate:!0}),Je(()=>St.value.length,()=>{sn.value&&Lr({immediate:!0})}),Je([kn,ne],()=>{Pt(),sn.value&&Lr({immediate:!0}),Os.value&&yu(),Dt.value&&Uc(),po("resize")},{immediate:!1}),Je(()=>nl.value,L=>{if(L)for(const[q,re]of ao)S0(q,re);else if(X2(),sn.value)Lr({immediate:!0});else for(const[q,re]of ao)re&&pa(q,!0)},{immediate:!1}),Je([pe,ve,()=>oe()],()=>{var L;(L=Js.refresh)==null||L.call(Js);for(const[q,re]of ao)S0(q,re)},{immediate:!1}),Je([()=>I.viewportPriority,()=>St.value.length,ve],([L,q,re])=>{if(L!==!1){if(K.value&&(q<=200||q<=re)){K.value=!1;for(const[ae,be]of ao)S0(ae,be)}}else K.value=!1}),Je(()=>yo.value,()=>{sn.value&&Lr({immediate:!0})}),Je([Nl,Io,Qo,()=>St.value.length,sn],()=>{M1()},{immediate:!0});let B1=null,H1=!1,Kc=null;function z1(){B1=null,av=null,lv=void 0,Hc=null,P1()}function Lv(){qc(),so(),Pt(),zo.clear();const L=St.value.length;L>0&&Rc(L),bv()}function $v(){Tv(),m6(),F1=null,xu=null,Su=null,w0=null,L1=null,$1=null,H1=!1,z1(),T6("restore"),$c(),Wc()}function W1(L){var q;return[(q=ns())!=null?q:"",wo(),Rl(),k0.value,O1(L),St.value.length,Math.round(ko(0,St.value.length)),Math.round(Cu()),hi.count,Math.round(hi.total)].join(":")}function q6(){return mo(this,null,function*(){var L,q,re,ae;const be=(L=o.virtualScroll)==null?void 0:L.settledToken,Ne=O1(be),De=wo(),je=ns(),ot=Ji.value;if(Ct.value&&((q=o.virtualScroll)==null?void 0:q.settleMode)==="manual"&&b0(be))if(uv()){if(W1(be)!==Hc&&!H1){H1=!0;try{const Ve=yield wv({reason:"manual",expectedSettledTokenKey:Ne}),Ye=O1()===Ne;Cv(De,je,ot)&&Ve.sessionKey===De&&Ve.threadKey===je&&Ye&&Ve.stable&&Ve.phase==="final"&&(Hc=W1((re=o.virtualScroll)==null?void 0:re.settledToken))}finally{H1=!1,yield yt();const Ve=(ae=o.virtualScroll)==null?void 0:ae.settledToken,Ye=b0(Ve)?W1(Ve):"";Cv(De,je,ot)&&Ye&&Hc!==Ye&&q6()}}}else po("manual")})}Je(Ct,(L,q)=>{if(L!==q){if(!L)return $v(),void Tv();$v(),Lv(),Kc=Ji.value,po("content")}},{flush:"post"}),Je([Ct,Ji],([L,q])=>{L?Kc!=null?Kc!==q&&(Kc=q,(function(re="resize"){qc(),so(),Pt(),zo.clear();const ae=St.value.length;ae>0&&Rc(ae),bv(),xu=null,Su=null,w0=null,F1=null,H1=!1,z1(),D6(),yt(()=>{Ol(),Os.value&&yu(),Dt.value&&Uc(),po(re)})})("resize")):Kc=q:Kc=null},{flush:"post",immediate:!0}),Je([Ct,()=>wo(),()=>ns()],([L])=>{L&&($v(),Lv(),T6("content"),po("content"))}),Je([Ct,()=>wo(),()=>ns(),Ji,()=>St.value.length],([L])=>{L&&(function(q="async-node"){let re=!1;for(const[ae,be]of Array.from(sl.entries()))iv(be)||(sl.delete(ae),Yi.delete(ae),re=!0);re&&(Dc(),po(q))})("async-node")},{flush:"post"}),Je([Ct,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.sessionKey},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>o.indexKey,()=>ie.value],([L])=>{L&&(P1(),(function(q="content"){if(!Ct.value)return;const re=[],ae=St.value.length,be=J2(ae);for(const Ne of Array.from(zo.keys())){if(Ne>=ae){re.push(Ne);continue}if(Ne<be)continue;const De=I1(Ne),je=zo.get(Ne);je!=null&&je!==De&&re.push(Ne),zo.set(Ne,De)}for(const Ne of Array.from(zo.keys()))Ne>=ae&&zo.delete(Ne);re.length&&((function(Ne,De={}){const je=Array.from(Ne,Number);Gt(je);let ot=0;if(an(()=>(ot=q2(je,De),ot>0)),ot>0)(function(Ve){for(const Ye of Ve)zo.delete(Ye)})(je);else for(const Ve of je)J.delete(Ve)})(re,{notify:!1}),Pt(),z1(),Os.value&&yu(),Dt.value&&Uc(),po(q))})("content"))},{flush:"post",immediate:!0}),Je([Ct,()=>St.value.length,()=>wo(),()=>ns()],([L,q,re,ae],[be,Ne,De,je])=>{L&&be&&re===De&&ae===je&&q!==Ne&&z1()},{flush:"post"}),Je([Ct,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.heightCache},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.heightCacheWidth},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>St.value.length,()=>wo(),ne],()=>{D6()},{flush:"post",immediate:!0}),Je([Ct,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreAnchor},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>St.value.length,()=>wo(),ne],L=>mo(null,[L],function*([q,re]){if(!q||!re)return;yield yt();const ae=(function(){var be;const Ne=(be=o.virtualScroll)==null?void 0:be.restoreAnchor;return Ne==null||Ne===!1?null:Ne===!0?"true":String(Ne)})();kv(re,{restoreAnchor:ae!=null,restoreToken:ae??void 0})}),{flush:"post",immediate:!0}),Je([Ct,ne,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey}],([L])=>{var q;if(!L)return;const re=(q=o.virtualScroll)==null?void 0:q.restoreState;re&&xu&&Su==="restore"&&(O6(re)||(Lv(),xu=null,Su=null,po("resize")))},{flush:"post"}),Je([Ct,()=>St.value.length,()=>wo(),ne],L=>mo(null,[L],function*([q]){var re;const ae=L1,be=$1;q&&ae&&(yield yt(),!kv(ae,{restoreAnchor:be?.restoreAnchor===!0,restoreToken:(re=be?.restoreToken)!=null?re:"imperative",allowUncapturedAnchor:be?.allowUncapturedAnchor===!0})&&B6(ae)||(L1=null,$1=null))}),{flush:"post",immediate:!0}),Je([Ct,Oe,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settleMode},()=>wo(),()=>ns(),Ji,Z2,f6,()=>yo.value,p0,()=>hi.count,()=>hi.total],([L,q,re])=>{if(!L||q!==!0||re==="manual"||!cv())return;const ae=(function(){var be;const Ne=St.value.length;return[(be=ns())!=null?be:"",wo(),Rl(),k0.value,Ne,Math.round(ko(0,Ne)),Math.round(Cu()),hi.count,Math.round(hi.total)].join(":")})();B1!==ae&&(B1=ae,wv({reason:"final"}).then(be=>{be.stable||B1!==ae||(B1=null)}))},{flush:"post",immediate:!0}),Je([Ct,Oe,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settleMode},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settledToken},()=>wo(),()=>ns(),Ji,Z2,f6,()=>yo.value,p0,()=>St.value.length,()=>hi.count,()=>hi.total],()=>{q6()},{flush:"post",immediate:!0}),Je([()=>St.value.length,sn,Io,Qo,()=>Ds.start,()=>Ds.end],([L,q,re,ae,be,Ne])=>{fe.value&&Mn("virtualization",{nodes:L,virtualization:q,maxLiveNodes:re,buffer:ae,focusIndex:Nl.value,scroll:q?(()=>{const De=ut.value||ue();return De?{reverse:Se(De),scrollTop:Math.round(De.scrollTop),scrollTopAbs:Math.round(Math.abs(De.scrollTop)),scrollHeight:Math.round(De.scrollHeight),clientHeight:Math.round(De.clientHeight)}:null})():null,liveRange:{start:be,end:Ne},rendered:yo.value})}),Je([()=>I.customId],([L],q,re)=>{if(!L||Oo)return;const ae=(function(be,Ne){return be?(ys.controllers[be]=Ne,()=>{ys.controllers[be]===Ne&&delete ys.controllers[be]}):()=>{}})(L,{captureRestoreAnchor:Nc,restoreAnchor:Fc,getAnchorDrift:j2,getReport:LF});re(()=>{ae()})},{immediate:!0}),Vn(()=>{(function(){if(Ct.value)try{Ol(),N1();const L=wu("manual");z6(L)&&($(L),F1=L,xv=R1());const q=zc(L,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});q&&(B(q),q.anchor&&H(q.anchor),jc=D1(q))}catch{}})(),jF(),X2(),en(),V6();for(const L of da.values())for(const q of L)m0(q);da.clear(),bu.clear(),zo.clear(),Iv(),qc(),ev(),$c(),Wc(),Tv(),v6(),G2()});const VF=Af("ViewportDeferredMermaidBlockNode",zr({loader:()=>mo(null,null,function*(){try{return(yield jo(()=>import("./index11-TEhD5dop.js"),__vite__mapDeps([7,5]))).default}catch(L){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',L),Pi}}),loadingComponent:px,delay:0}),px),qF=Af("ViewportDeferredInfographicBlockNode",zr({loader:()=>mo(null,null,function*(){try{return(yield jo(()=>import("./index10-DKtGUVwa.js"),[])).default}catch(L){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',L),Pi}}),loadingComponent:fx,delay:0}),fx),KF=Af("ViewportDeferredD2BlockNode",zr(()=>mo(null,null,function*(){try{return(yield jo(()=>import("./index8-B9apTeKj.js"),[])).default}catch(L){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',L),Pi}})),Pi),K6={text:qo,paragraph:cc,heading:L2,code_block:X9,list:qd,list_item:Vd,blockquote:tm,table:ep,definition_list:nm,footnote:om,footnote_reference:or,footnote_anchor:Jf,admonition:lm,vmr_container:im,hardbreak:qa,link:Mi,image:Va,thematic_break:sm,math_inline:Jr,math_block:C$,strong:Si,emphasis:Ti,strikethrough:Ai,highlight:ir,insert:ji,subscript:Ui,superscript:Wi,emoji:zi,checkbox:nr,checkbox_input:nr,inline_code:li,html_inline:sr,reference:xi,html_block:Qf},ZF=R(()=>ov()),Z6=R(()=>X_(I.codeBlockProps)),GF=R(()=>X_(I.codeBlockProps,{omit:["langs"]})),G6=R(()=>mt(mt({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,monacoOptions:I.codeBlockMonacoOptions,themes:I.themes,langs:m.value==="shiki"?I.langs:void 0,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof we.value=="boolean"?{showTooltips:we.value}:{}),GF.value)),Y6=R(()=>mt(rn(mt({},G6.value),{langs:I.langs}),Z6.value));function X6(L){return typeof L=="boolean"?L:void 0}const YF=R(()=>{const L=I.codeBlockProps||{},q={},re=X6(L.showLineNumbers);re!==void 0&&(q.showLineNumbers=re);const ae=X6(L.diffInline);ae!==void 0&&(q.diffInline=ae);const be=(function(Ne){const De=Number(Ne);return Number.isFinite(De)&&De>0?De:void 0})(L.reservedHeightPx);return be!==void 0&&(q.reservedHeightPx=be),q}),XF=R(()=>mt(mt({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,themes:I.themes,langs:I.langs,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof we.value=="boolean"?{showTooltips:we.value}:{}),Z6.value)),JF=R(()=>mt({},I.mermaidProps||{})),J6=R(()=>mt({},I.d2Props||{})),QF=R(()=>mt({},I.infographicProps||{})),U1=R(()=>({typewriter:f.value,fade:I.fade,customHtmlTags:lo.value.customHtmlTags})),eR=R(()=>mt(mt({},U1.value),typeof we.value=="boolean"?{showTooltip:we.value}:{})),tR=R(()=>mt(mt({},U1.value),typeof we.value=="boolean"?{showTooltips:we.value}:{})),nR=R(()=>mt(mt({},U1.value),typeof we.value=="boolean"?{showTooltips:we.value}:{})),oR=R(()=>mt(mt({},U1.value),typeof we.value=="boolean"?{showTooltips:we.value}:{}));function sR(L){return Array.isArray(L.children)&&L.children.length>0}const M0=R(()=>IF.value.map(L=>{var q,re,ae,be,Ne,De,je,ot;let Ve=(function(dt){var Ft,Ht,Vt,Wt,Kt,fn,vn;if(dt.type!=="code_block")return dt;const Qn=dt,Hs=[String((Ft=Qn.language)!=null?Ft:""),String((Ht=Qn.loading)!=null?Ht:""),String((Vt=Qn.diff)!=null?Vt:""),String((Wt=Qn.code)!=null?Wt:""),String((Kt=Qn.originalCode)!=null?Kt:""),String((fn=Qn.updatedCode)!=null?fn:""),String((vn=Qn.raw)!=null?vn:"")].join("\0"),Ss=Ll.get(Qn);if(Ss&&Ss.signature===Hs)return Ss.node;const $r=mt({},Qn);return Ll.set(Qn,{signature:Hs,node:$r}),$r})(L.node);const Ye=T0(Ve);let nt=n7(Ve,Ye);if((Ve.type==="html_block"||Ve.type==="html_inline")&&nt===K6[Ve.type]){const dt=Ve,Ft=String((q=dt.tag)!=null?q:"").trim().toLowerCase()||ZI(dt.content);if(Ft){const Ht=In.value[Ft];if(To.value.has(Ft)&&Ht)nt=Ht,Ve=rn(mt({},dt),{type:Ft,tag:Ft,content:pie(dt.content,Ft)});else if(GI((re=dt.content)!=null?re:dt.raw,Ft)){const Vt=String((be=(ae=dt.content)!=null?ae:dt.raw)!=null?be:"");Ve.type==="html_inline"?(nt=qo,Ve={type:"text",content:Vt,raw:Vt}):(nt=cc,Ve={type:"paragraph",children:[{type:"text",content:Vt,raw:Vt}],raw:Vt})}}}const Be=Ve.type==="code_block"&&m.value==="pre"&&nt===Pi&&!Nv(In.value,Ye);let Xe=mt({},(function(dt,Ft,Ht){const Vt=Ft??T0(dt);if(dt.type==="code_block"){const Wt=Vt?Nv(In.value,Vt):void 0;if(Ht&&m.value==="pre"&&!Wt&&Ht===Pi)return YF.value;if(Ht&&Vt&&Ht===Wt)return Vt==="mermaid"?e7(dt):Vt==="infographic"?t7(dt):Vt==="d2"||Vt==="d2lang"?J6.value:Y6.value;if(Ht&&Ht===In.value.code_block)return Y6.value;if(C6(Ht))return XF.value}return Vt==="mermaid"?e7(dt):Vt==="infographic"?t7(dt):Vt==="d2"||Vt==="d2lang"?J6.value:dt.type==="link"?eR.value:dt.type==="list"?tR.value:dt.type==="blockquote"?nR.value:dt.type==="table"?oR.value:dt.type==="code_block"?G6.value:U1.value})(Ve,Ye,nt));const lt=kn.value?Pc.value[L.index]:null;Ve.type==="code_block"&&lt?.kind==="code-block"&&(Xe=rn(mt({},Xe),Be?{reservedHeightPx:(Ne=lt.height)!=null?Ne:lt.contentHeight}:{estimatedHeightPx:lt.height,estimatedContentHeightPx:lt.contentHeight,estimatedDiffInline:lt.diffInline})),Be||Ve.type!=="code_block"||Ye!=="mermaid"||Md(Xe.estimatedPreviewHeightPx)!=null||(Xe=rn(mt({},Xe),{estimatedPreviewHeightPx:lg(ig(String((De=Ve.code)!=null?De:"")))})),Be||Ve.type!=="code_block"||Ye!=="infographic"||Md(Xe.estimatedPreviewHeightPx)!=null||(Xe=rn(mt({},Xe),{estimatedPreviewHeightPx:ag(rg(String((je=Ve.code)!=null?je:"")))})),Ve.type==="math_block"&&(Xe=rn(mt({},Xe),{cacheScope:_n}));const rt=(function(dt,Ft){const Ht=String(dt.type);return!Qp(Ht)&&In.value[Ht]===Ft})(Ve,nt),wt=rt?p5(Ve,ge.value):void 0;return rn(mt({},L),{node:Ve,component:nt,bindings:Xe,customBindings:mt(mt({},wt??{}),Xe),rendersCustomNode:rt,hasSlotChildren:sR(Ve),slotContent:String((ot=Ve.content)!=null?ot:""),isCodeBlock:Ve.type==="code_block",indexKey:`${ZF.value}-${L.index}`,vnodeKey:`${$F.value}\0${L.index}\0${Ve.type}`})}));function T0(L){var q;return L?.type==="code_block"?String((q=L.language)!=null?q:"").trim().toLowerCase():""}function Nv(L,q){const re=q.trim().toLowerCase();if(re)for(const ae of[re,T2(re),n$(re)]){const be=ae&&L[ae];if(be)return be}}function Q6(L,q,re,ae){var be,Ne;const De=mt({},L.value);return Md(De.estimatedPreviewHeightPx)==null&&(De.estimatedPreviewHeightPx=ae(re(String((be=q?.code)!=null?be:"")),void 0,De.maxHeight==="none"?null:(Ne=Md(De.maxHeight))!=null?Ne:void 0)),De}function e7(L){return Q6(JF,L,ig,lg)}function t7(L){return Q6(QF,L,rg,ag)}function n7(L,q){if(!L)return l8;const re=In.value,ae=re[String(L.type)];if(L.type==="code_block"){const be=q??T0(L),Ne=be?Nv(re,be):void 0;return Ne||(m.value==="pre"?re.code_block||Pi:be==="mermaid"?re.mermaid||VF:be==="infographic"?re.infographic||qF:be==="d2"||be==="d2lang"?re.d2||KF:ae||re.code_block||w6.value)}return ae||K6[String(L.type)]||l8}function Fv(L){s("click",L)}function iR(L){var q;(q=L.target)!=null&&q.closest("[data-node-index]")&&s("mouseover",L)}function rR(L){var q;(q=L.target)!=null&&q.closest("[data-node-index]")&&s("mouseout",L)}function o7(L){s("mouseover",L)}function s7(L){s("mouseout",L)}const Tu=Z(null),Ii=Z(!1),j1=Z(null),lR=R(()=>!(I.domMode!=="minimal"||Y.value||I.fade!==!1||f.value||Ii.value||Xt.value||sn.value||Qe.value||co.value||Ki.value||Object.keys(In.value).length!==0));let V1,Zc=null,Rv=0,E0=0,I0=0;const i7=["code_block","admonition","table","math_block","html_block","image","thematic_break"],aR=new Set(i7),r7=[".typewriter-cursor",".height-estimation-probes",...i7.map(L=>`[data-node-type="${L}"]`),"script","style"].join(",");function l7(L){if(!L||typeof L!="object")return!1;const q=L.type;return typeof q=="string"&&aR.has(q)}function L0(L){var q,re;if(!L||typeof L!="object")return 0;const ae=L,be=(re=(q=ae.raw)!=null?q:ae.content)!=null?re:ae.code;if(typeof be=="string")return be.length;const Ne=ae.children;if(Array.isArray(Ne))return Ne.reduce((je,ot)=>je+L0(ot),0);const De=ae.items;return Array.isArray(De)?De.reduce((je,ot)=>je+L0(ot),0):0}function $0(){V1&&(clearTimeout(V1),V1=void 0)}function Ov(){Rv+=1,Zc!=null&&(Zo?.(Zc),Zc=null)}function q1(){Ov(),ha(),Tu.value&&(Tu.value.style.visibility="hidden")}function uR(L){var q;if(L.nodeType!==Node.TEXT_NODE||!((q=L.textContent)!=null?q:"").trim())return!1;const re=L.parentElement;return!!re&&!re.closest(r7)}function cR(L){let q=L.lastChild;for(;q;){if(uR(q))return q;if(q.nodeType===Node.ELEMENT_NODE){const re=q;if(!re.matches(r7)&&re.lastChild){q=re.lastChild;continue}}for(;q&&q!==L&&!q.previousSibling;)q=q.parentNode;if(!q||q===L)break;q=q.previousSibling}return null}function a7(){const L=M0.value;for(let q=L.length-1;q>=0;q--){const re=L[q];if(!re||l7(re.node)||!x0(re.index))continue;const ae=ao.get(re.index);if(!ae)continue;const be=cR(ae);if(be)return be}return null}function ha(){j1.value&&(j1.value.classList.remove(hx),j1.value=null)}function N0(){if(d.value!=="simple"||!G||!Ii.value||!O.value)return void ha();const L=a7(),q=L?(function(re){var ae;const be=(ae=re.parentElement)==null?void 0:ae.closest(".text-node");return be instanceof HTMLElement?be:re.parentElement})(L):null;q!==j1.value&&(ha(),q&&(q.classList.add(hx),j1.value=q))}function F0(){if(d.value!=="precise"||!G||!Ii.value||Zc!=null)return;const L=Rv,q=()=>{Zc=null,L===Rv&&(function(){var re,ae;if(d.value!=="precise"||!(G&&Ii.value&&O.value&&Tu.value))return;const be=O.value,Ne=Tu.value;Ne.style.visibility="hidden";const De=a7();if(!De)return;let je=0,ot=0,Ve=20,Ye=!1;if(De?.textContent){const nt=De.textContent.length,Be=document.createRange();Be.setStart(De,Math.max(0,nt-1)),Be.setEnd(De,nt);const Xe=typeof Be.getClientRects=="function"?Be.getClientRects():void 0,lt=(ae=Xe?.[Xe.length-1])!=null?ae:(re=De.parentElement)==null?void 0:re.getBoundingClientRect();if(lt){const rt=qt("typewriterCursor.root.getBoundingClientRect",()=>be.getBoundingClientRect());je=lt.right-rt.left+be.scrollLeft,ot=lt.top-rt.top+be.scrollTop,Ve=lt.height||Ve,Ye=!0}Be.detach()}Ye&&(Ne.style.transform=`translate(${Math.max(0,je)}px, ${Math.max(0,ot)}px)`,Ne.style.height=`${Ve}px`,Ne.style.visibility="visible")})()};Bo?Zc=Bo(q):q()}return Je([it,()=>o.content,()=>o.nodes,()=>I.typewriter,Oe],()=>mo(null,null,function*(){var L,q;if(!G||Y.value||!te.value)return;if(Oe.value)return Ii.value=!1,$0(),void q1();if((L=o.nodes)!=null&&L.length)return Ii.value=!1,$0(),q1(),E0=((q=o.content)!=null?q:"").length,void(I0=it.value.length);const re=(function(){var je,ot;return(je=o.nodes)!=null&&je.length?o.nodes.reduce((Ve,Ye)=>Ve+L0(Ye),0):((ot=o.content)!=null?ot:"").length})(),ae=(function(){var je;return(je=o.nodes)!=null&&je.length?o.nodes.reduce((ot,Ve)=>ot+L0(Ve),0):it.value.length})(),be=!l7(St.value[St.value.length-1]),Ne=re>E0,De=ae>I0;if(!f.value||!be||!Ne&&!De)return f.value&&be||(Ii.value=!1,q1()),E0=re,void(I0=ae);E0=re,I0=ae,Ii.value=!0,d.value==="precise"&&Tu.value&&(Tu.value.style.visibility="hidden"),$0(),yield yt(),d.value==="simple"?N0():(ha(),F0()),V1=setTimeout(()=>{V1=void 0,Ii.value=!1},3e3)}),{flush:"post",immediate:!0}),Je(Ii,L=>mo(null,null,function*(){L?(yield yt(),d.value!=="simple"?(ha(),d.value==="precise"&&F0()):N0()):q1()}),{flush:"post"}),Je(d,()=>mo(null,null,function*(){if(G&&!Y.value&&te.value&&Ii.value){if(yield yt(),d.value==="simple")return Ov(),void N0();ha(),d.value!=="precise"?q1():F0()}}),{flush:"post"}),Je([()=>yo.value,()=>Ds.start,()=>Ds.end],()=>mo(null,null,function*(){G&&!Y.value&&te.value&&Ii.value&&(yield yt(),d.value!=="simple"?(ha(),d.value==="precise"&&F0()):N0())}),{flush:"post"}),Vn(()=>{$0(),Ov(),ha(),xs.clear()}),(L,q)=>{const re=zO("NodeRenderer",!0);return p(Y)?(y(!0),M(Pe,{key:0},pt(M0.value,ae=>(y(),M(Pe,{key:ae.vnodeKey},[ae.rendersCustomNode?(y(),he(bs(ae.component),zn({key:0,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onClick:Fv,onMouseover:o7,onMouseout:s7,onCopy:q[0]||(q[0]=be=>i(be)),onHandleArtifactClick:q[1]||(q[1]=be=>s("handleArtifactClick",be))}),{default:me(()=>[ae.hasSlotChildren?(y(),he(re,zn({key:0,ref_for:!0},uo.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(y(),he(re,zn({key:1,ref_for:!0},uo.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(y(),he(bs(ae.component),zn({key:1,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onClick:Fv,onMouseover:o7,onMouseout:s7,onCopy:q[2]||(q[2]=be=>i(be)),onHandleArtifactClick:q[3]||(q[3]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(y(),M("div",{key:1,ref_key:"containerRef",ref:O,class:Re(["markstream-vue markdown-renderer",[{dark:I.isDark},{virtualized:sn.value},{"virtual-scroll-coordinated":Qt.value},{"stable-layout":_F.value},{"typewriter-simple-cursor":Ii.value&&d.value==="simple"}]]),"data-custom-id":I.customId,onClick:Fv,onMouseover:iR,onMouseout:rR},[Ko.value||sn.value?(y(),M(Pe,{key:0},[Ko.value?(y(),he(lpe,{key:0,width:Ns.value,"flow-root":sn.value||Qt.value,"paragraph-node":no.value,"list-item-node":$s.value,"list-node":Xs.value,"heading-nodes":ci.value,"set-paragraph-wrapper":xF,"set-list-item-wrapper":SF,"set-list-wrapper":AF,"set-heading-wrapper":EF},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ee("",!0),sn.value?(y(),M("div",{key:1,class:"node-spacer",style:Zt({height:`${tv.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],64)):ee("",!0),lR.value?(y(!0),M(Pe,{key:1},pt(M0.value,ae=>(y(),M(Pe,{key:ae.vnodeKey},[x0(ae.index)?(y(),he(bs(ae.component),zn({key:0,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onMouseover:q[4]||(q[4]=be=>s("mouseover",be)),onMouseout:q[5]||(q[5]=be=>s("mouseout",be)),onCopy:q[6]||(q[6]=be=>i(be)),onHandleArtifactClick:q[7]||(q[7]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ee("",!0)],64))),128)):(y(!0),M(Pe,{key:2},pt(M0.value,ae=>(y(),M("div",{key:ae.vnodeKey,ref_for:!0,ref:be=>S0(ae.index,be),class:"node-slot","data-node-index":ae.index,"data-node-type":ae.node.type},[x0(ae.index)?(y(),M("div",{key:0,ref_for:!0,ref:be=>(function(Ne,De){var je;De||(function(nt){const Be=`${ov()}-${nt}`;let Xe=!1;for(const lt of Array.from(Yi.keys())){const rt=sl.get(lt);(rt?.index===nt||lt===Be||lt.startsWith(`${Be}-`))&&(Yi.delete(lt),sl.delete(lt),Xe=!0)}Xe&&(Dc(),po("async-node"))})(Ne),Fl.delete(Ne),(function(nt){var Be;const Xe=((Be=bu.get(nt))!=null?Be:0)+1;bu.set(nt,Xe)})(Ne);const ot=da.get(Ne);if(ot){for(const nt of ot)m0(nt);da.delete(Ne)}if((function(nt){const Be=Gi.get(nt);Be&&(fi?.unobserve(Be),Er.delete(Be),Gi.delete(nt))})(Ne),!De||!es.value)return ol.delete(Ne),void bu.delete(Ne);ol.set(Ne,De);const Ve=()=>{A0(Ne,De)};queueMicrotask(Ve);const Ye=(fi||typeof ResizeObserver>"u"||(fi=new ResizeObserver(nt=>{if(nt.length)for(const Be of nt){const Xe=Er.get(Be.target),lt=Gi.get(Xe??-1);Xe!=null&&lt&&A0(Xe,lt)}else Ol()})),fi);if(Ye&&(Gi.set(Ne,De),Er.set(De,Ne),Ye.observe(De)),typeof window<"u"){const nt=((je=St.value[Ne])==null?void 0:je.type)==="code_block"?[16,80,240,800]:Oe.value?[80]:[];if(nt.length){const Be=nt.map(Xe=>h6(Xe,Ve,"node-resize")).filter(Xe=>Xe!=null);Be.length&&da.set(Ne,Be)}}})(ae.index,be),class:"node-content"},[ae.isCodeBlock?ae.rendersCustomNode?(y(),he(bs(ae.component),zn({key:1,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:q[12]||(q[12]=be=>i(be)),onHandleArtifactClick:q[13]||(q[13]=be=>s("handleArtifactClick",be))}),{default:me(()=>[ae.hasSlotChildren?(y(),he(re,zn({key:0,ref_for:!0},uo.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(y(),he(re,zn({key:1,ref_for:!0},uo.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(y(),he(bs(ae.component),zn({key:2,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:q[14]||(q[14]=be=>i(be)),onHandleArtifactClick:q[15]||(q[15]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(y(),he(as,{key:0,name:"fade",css:I.fade!==!1,appear:I.fade!==!1},{default:me(()=>[ae.rendersCustomNode?(y(),he(bs(ae.component),zn({key:0,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:q[8]||(q[8]=be=>i(be)),onHandleArtifactClick:q[9]||(q[9]=be=>s("handleArtifactClick",be))}),{default:me(()=>[ae.hasSlotChildren?(y(),he(re,zn({key:0,ref_for:!0},uo.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(y(),he(re,zn({key:1,ref_for:!0},uo.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(y(),he(bs(ae.component),zn({key:1,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:q[10]||(q[10]=be=>i(be)),onHandleArtifactClick:q[11]||(q[11]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(y(),M("div",{key:1,class:"node-placeholder",style:Zt({height:`${Yn(ae.index)}px`})},null,4))],8,cpe))),128)),Ii.value&&d.value==="precise"?(y(),M("span",{key:3,ref_key:"typewriterCursorRef",ref:Tu,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ee("",!0),sn.value?(y(),M("div",{key:4,class:"node-spacer",style:Zt({height:`${nv.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],42,upe))}}})),[["__scopeId","data-v-a9489508"]]),Vi=R$;Vi.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Vi.__name,Vi.name].filter(n=>!!n));for(const n of t)e.component(n,R$)};const M5=Object.freeze(Object.defineProperty({__proto__:null,default:Vi},Symbol.toStringTag,{value:"Module"})),dpe={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},fpe={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},ppe={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},hpe={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},mpe={class:"admonition-title"},gpe=["aria-expanded","aria-controls"],vpe=["id"],lm=Gn(et({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,s=t,i=R(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const u=o.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=Z(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(y(),M("div",{class:Re(["admonition",[`admonition-${o.node.kind}`]])},[C("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(y(),M("svg",dpe,[...c[1]||(c[1]=[C("circle",{cx:"12",cy:"12",r:"10"},null,-1),C("path",{d:"M12 16v-4"},null,-1),C("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(y(),M("svg",fpe,[...c[2]||(c[2]=[C("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),C("path",{d:"M9 18h6"},null,-1),C("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(y(),M("svg",ppe,[...c[3]||(c[3]=[C("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),C("path",{d:"M12 9v4"},null,-1),C("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(y(),M("svg",hpe,[...c[4]||(c[4]=[C("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),C("path",{d:"M12 8v4"},null,-1),C("path",{d:"M12 16h.01"},null,-1)])])):ee("",!0),C("span",mpe,N(i.value),1),o.node.collapsible?(y(),M("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(y(),M("svg",{style:Zt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[C("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,gpe)):ee("",!0)]),Bn(C("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[j(p(Vi),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:c[0]||(c[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,vpe),[[qs,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);lm.install=e=>{e.component(lm.__name,lm)};const f8=()=>jo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let xh=null,Sh=f8,Ah=null,mx=!1,gx=!1;function $Ve(){return mo(this,null,function*(){if(xh)return xh;const e=Sh;return e?e===f8&&mx?null:Ah||(Ah=mo(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===f8)return e===Sh&&(mx=!0,(function(o){gx||(gx=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',o))})(n)),null;throw n}finally{e===Sh&&(Ah=null)}return e!==Sh?null:t?(xh=(function(n){var o;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),xh):null}),Ah):null})}let Mh=null,O$=null,Th=null;function NVe(){return typeof O$=="function"}function FVe(){return mo(this,null,function*(){if(Mh)return Mh;const e=O$;return e?Th||(Th=mo(null,null,function*(){const t=yield e(),n=(function(o){var s,i,r;if(!o)return null;const l=(s=o.default)!=null?s:o,a=typeof l=="function"&&typeof((i=l.prototype)==null?void 0:i.render)=="function"?l:(r=o.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(Mh=n,Mh):null}).finally(()=>{Th=null}),Th):null})}const RVe=Symbol("markstreamLanguageIconResolver"),P$=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],ype=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),p8=[...P$].sort((e,t)=>t.length-e.length).join("|"),a4=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${p8}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${p8})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),D$=/[),.;!?,。;!?)]+$/;function kpe(e){const t=e.toLowerCase();return P$.some(n=>t.endsWith(`.${n}`))}function bpe(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${p8}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function Cpe(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(D$,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=ype.has(i),a=kpe(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const u=o[2]??o[3],c=u?Number(u):void 0;return{path:s,line:c!==void 0&&Number.isFinite(c)&&c>0?c:void 0}}function wpe(e,t={}){const n=[];a4.lastIndex=0;let o;for(;(o=a4.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const u=a.replace(D$,""),c=a.length-u.length;a=u;const d=Cpe(a,t);if(!d)continue;const f=o.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),c>0&&(a4.lastIndex-=c)}return n}function u4(e,t){let n=0,o=t-1;for(;o>=0&&e[o]==="\\";)n++,o--;return n%2===1}const _pe=/\s/,xpe=/\p{Nd}/u;function Cc(e,t){const n=e.codePointAt(t);return n===void 0?void 0:String.fromCodePoint(n)}function Spe(e,t){if(t<=0)return;const n=e.charCodeAt(t-1),o=n>=56320&&n<=57343&&t>1?t-2:t-1,s=e.codePointAt(o);return s===void 0?void 0:String.fromCodePoint(s)}function vx(e){return e!==void 0&&_pe.test(e)}function a1(e){return e!==void 0&&xpe.test(e)}function Ape(e,t){const n=e[t+1];return a1(Cc(e,t+1))?!0:(n==="-"||n==="+"||n==="."||n==="−"||n==="+"||n==="-")&&a1(Cc(e,t+2))}function vg(e){return e!==void 0&&e>="A"&&e<="Z"}const B$=new RegExp(String.raw`^(?:AED|AFN|ALL|AMD|ANG|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BGN|BHD|BIF|BMD|BND|BOB|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHF|CLF|CLP|CNY|COP|CRC|CUC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SLL|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|UYU|UZS|VED|VES|VND|VUV|WST|XAF|XCD|XOF|XPF|YER|ZAR|ZMW|ZWL|HK|US|SG|AU|CA|NZ|NT|TW|RMB|MEX|TT|BZ|EU|UK)$`);function Mpe(e,t){if(!vg(e[t-1]))return!1;let n=t-1;for(;n>0&&vg(e[n-1]);)n--;return B$.test(e.slice(n,t))||a1(Cc(e,t+1))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")&&!/\p{L}/u.test(Cc(e,t+1)??"")}function Tpe(e,t){if(!vg(e[t-1]))return!1;let n=t-1;for(;n>0&&vg(e[n-1]);)n--;return B$.test(e.slice(n,t))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")}const Epe=/^[-–—,,、;;::~~(([【//]$/;function Ipe(e,t){const n=e[t+1];if(n!=="-"&&n!=="+"&&n!=="."||!a1(Cc(e,t+2)))return!1;const o=e[t-1];return o!==void 0&&Epe.test(o)}function Lpe(e){const t=String.raw`[、,,;;::~~\-–—至到//\s()()=*×=]|和|跟|与|及|或|and|or`;let n=e.replace(new RegExp(String.raw`^(?:${t})+`,"u"),"");for(;;){const s=n.replace(new RegExp(String.raw`^\p{L}+(?:${t})+`,"u"),"").replace(/^[\p{L}][\p{L} ]*(?=\p{Nd})/u,"");if(s===n)break;n=s}if(!/\p{Nd}/u.test(n))return!1;const o=String.raw`[-+]?[\p{Nd}][\p{Nd},.'’]*`;return new RegExp(String.raw`^${o}(?:\p{L}+)?(?:(?:${t})+${o}(?:\p{L}+)?)*$`,"u").test(n)}const ul=-1,yx=1,kx=2,bx=3;function $pe(e){const t=e.length,n=new Uint8Array(t),o=new Int32Array(t+1).fill(ul),s=new Int32Array(t+1),i=new Int32Array(t+1),r=[],l=[];{const F=[];for(let K=0;K<t;K++)if(e[K]==="`"){if(u4(e,K))continue;let V=K+1;for(;V<t&&e[V]==="`";)V++;F.push([K,V]),K=V-1}const U=new Map;for(let K=0;K<F.length;K++){const V=F[K][1]-F[K][0],ie=U.get(V);ie?ie.push(K):U.set(V,[K])}const z=new Map;let W=0;for(;W<F.length;){const[K,V]=F[W],ie=V-K,ne=U.get(ie);let X=z.get(ie)??0;for(;X<ne.length&&ne[X]<=W;)X++;z.set(ie,X),X<ne.length?(l.push([K,F[ne[X]][1]]),W=ne[X]+1):W++}}let a=0;const u=F=>{for(;a<l.length&&F>=(l[a]?.[1]??0);)a++;const U=l[a];return U!==void 0&&F>=U[0]},c=new Set(' \n\r)。,、;:!?"<>`「」『』【】〔〕()*—–“”‘’'),d=[];for(const F of e.matchAll(/\b(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/gi))d.push(F.index);for(const F of e.matchAll(/\b(?:localhost|(?:\d{1,3}\.){3}\d{1,3}|[\w-]+(?:\.[\w-]+)*\.[a-zA-Z]{2,})(?=(?:\/|\?|:\d))/gi))d.push(F.index);for(const F of e.matchAll(/(?:\.{1,2})?\/[\p{L}\p{Nd}._-]+(?:\/[\p{L}\p{Nd}._-]*)*\?/gu))(F.index===0||!/[\w~/.-]/.test(e[F.index-1]))&&d.push(F.index);d.sort((F,U)=>F-U);let f=-1;for(const F of d){if(F<f)continue;let U=F,z=0,W=0,K=0;for(;U<t;){const V=e[U];if(V==="(")z++;else if(V===")"){if(z===0)break;z--}else if(V==="[")W++;else if(V==="]"){if(W===0)break;W--}else if(V==="{")K++;else if(V==="}"){if(K===0)break;K--}else{if(c.has(V))break;if((V===","||V===";"||V==="!"||V==="?")&&!/[A-Za-z0-9$]/.test(e[U+1]??""))break;if(V===":"&&W===0&&U>F+7&&!/[\w/?#@~.+&=%-]/.test(e[U+1]??""))break}U++}r.push([F,U]),f=U}const h=[];for(let F=0;F<t;F++){if(e[F]!=="<"||e[F+1]===void 0||!/[a-zA-Z/]/.test(e[F+1]))continue;let U=F+1;const z=e[U]==="/";z&&U++;const W=/^[a-zA-Z][a-zA-Z0-9-]*/.exec(e.slice(U));if(!W)continue;U+=W[0].length;const K=e[U];if(K===void 0||!/[\s/>]/.test(K))continue;let V=U,ie=ul,ne=ul;for(;V<t;){const X=e[V];if(X===">"){ne=V;break}if(!z&&X==="/"&&e[V+1]===">"){ne=V+1;break}if(!/\s/.test(X)){ie=V;break}for(;V<t&&/\s/.test(e[V]);)V++;const le=e[V];if(le===void 0)break;if(le===">"){ne=V;break}if(z){ie=V;break}if(le==="/"&&e[V+1]===">"){ne=V+1;break}const Ie=/^[a-zA-Z_:][\w:.-]*/.exec(e.slice(V));if(!Ie){ie=V;break}V+=Ie[0].length;let de=V;for(;de<t&&/\s/.test(e[de]);)de++;if(e[de]==="="){for(de++;de<t&&/\s/.test(e[de]);)de++;const pe=e[de];if(pe==='"'||pe==="'"){const ve=e.indexOf(pe,de+1);if(ve===-1){ie=de;break}V=ve+1}else{const ve=/^[^\s"'=<>`]+/.exec(e.slice(de));if(!ve){ie=de;break}V=de+ve[0].length}}}if(ne!==ul)h.push([F,ne+1]),F=ne;else if(ie!==ul){const X=e.indexOf("<",F+1);F=(X!==-1&&X<ie?X:ie)-1}else break}let m=!0,v=!0,k=!0,w=!0;for(let F=0;F<t;F++){if(e[F]!=="<")continue;const U=e[F+1];let z=!1;if(U==="?"&&v){const ie=e.indexOf("?>",F+2);ie===-1?v=!1:(h.push([F,ie+2]),F=ie+1,z=!0)}else if(U==="!"){if(e[F+2]==="-"&&e[F+3]==="-"){if(m){const ie=e.indexOf("-->",F+4);ie===-1?m=!1:(h.push([F,ie+3]),F=ie+2,z=!0)}}else if(e.startsWith("[CDATA[",F+2)){if(k){const ie=e.indexOf("]]>",F+9);ie===-1?k=!1:(h.push([F,ie+3]),F=ie+2,z=!0)}}else if(w&&/[A-Z]/.test(e[F+2]??"")){const ie=e.indexOf(">",F+3);ie===-1?w=!1:(h.push([F,ie+1]),F=ie,z=!0)}}if(z)continue;if(U!==void 0&&/[a-zA-Z]/.test(U)){const ie=/^[a-zA-Z][a-zA-Z0-9+.-]{1,31}:/.exec(e.slice(F+1));if(ie){let ne=F+1+ie[0].length;for(;ne<t&&e[ne]!==">"&&e[ne]!=="<"&&!/\s/.test(e[ne]);)ne++;if(e[ne]===">"){h.push([F,ne+1]),F=ne;continue}}}if(U===void 0||!/[\w.!#$%&'*+/=?^`{|}~-]/.test(U))continue;let W=F+1;for(;W<t&&/[\w.!#$%&'*+/=?^`{|}~-]/.test(e[W]);)W++;if(e[W]!=="@")continue;W++;const K=/^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?/;let V=K.exec(e.slice(W));if(V){for(W+=V[0].length;e[W]==="."&&(V=K.exec(e.slice(W+1)),!!V);)W+=1+V[0].length;e[W]===">"&&(h.push([F,W+1]),F=W)}}h.sort((F,U)=>F[0]-U[0]);const b=[];for(const[F,U]of h){const z=b[b.length-1];z&&F<=z[1]?z[1]=Math.max(z[1],U):b.push([F,U])}r.push(...b);let _=0;const g=F=>{for(;_<b.length&&F>=(b[_]?.[1]??0);)_++;const U=b[_];return U!==void 0&&F>=U[0]},x=[];let S=null,T=0,A=!1;for(let F=0;F<t;F++)if(e[F]==="\\")F++;else if(A)e[F]===">"&&(A=!1);else if(!(u(F)||g(F))){if(S!==null)e[F]===S&&(S=null);else if(x.length>0&&(e[F]==='"'||e[F]==="'")&&F>0&&/\s/.test(e[F-1]))S=e[F];else if(e[F]==="[")T++;else if(e[F]==="]")T>0&&e[F+1]==="("&&(x.push(F),A=e[F+2]==="<",F++),T=Math.max(0,T-1);else if(e[F]==="("&&x.length>0)x.push(-1);else if(e[F]===")"&&x.length>0){const U=x.pop();if(U!==void 0&&U>=0){const z=e.slice(U+2,F);(/\s/.exec(z)===null||z.startsWith("<")&&/^<(?:\\[<>]|[^<>])*>$/.test(z)||/^[^\s]*\s+("([^"\\]|\\.)*"|'([^'\\]|\\.)*'|\(([^()\\]|\\.)*\))$/.test(z))&&r.push([U,F+1])}}}r.sort((F,U)=>F[0]-U[0]);const E=[];for(const[F,U]of r){const z=E[E.length-1];z&&F<=z[1]?z[1]=Math.max(z[1],U):E.push([F,U])}const P=F=>{let U=0,z=E.length-1;for(;U<=z;){const W=U+z>>1,K=E[W];if(K===void 0)return!1;if(F<K[0])z=W-1;else if(F>=K[1])U=W+1;else return!0}return!1};for(let F=0;F<t;F++)i[F+1]=(i[F]??0)+(e[F]==="`"&&!u4(e,F)?1:0),e[F]==="$"&&(u4(e,F)||P(F)?n[F]=yx:vx(e[F-1])||a1(Cc(e,F+1))||Ipe(e,F)?n[F]=kx:n[F]=bx),s[F+1]=(s[F]??0)+(n[F]===kx?1:0);let D=ul;for(let F=t-1;F>=0;F--)n[F]===bx&&(D=F),o[F]=D;const I=/^[\p{L}\p{Nd}\\|{([+.¬°-±×÷′-″←-⇿∀-⋿^_<>=-]$/u,$=/[^\p{L}\p{Nd}\s]$/u,B=/[^\s\u0020-\u007E\u0370-\u03FF\u{1D400}-\u{1D7FF}\p{Nd}¬°-±×÷′-″←-⇿∀-⋿]/u,H=/(?:^|\s)[a-z]{2,}/,O=(F,U)=>{const z=Cc(e,F+1);if(z===void 0||!I.test(z))return!1;const W=o[F+1]??ul;if(W!==ul){const K=e.slice(F+1,W);return!(K.length===((K.codePointAt(0)??0)>65535?2:1))&&B.test(K)||/[,;:!?]$/.test(K)||/^[a-z]{2,}$/.test(K)?!1:(s[W]??0)-(s[F+1]??0)===0&&(i[W]??0)-(i[F+1]??0)===0}return $.test(U)||B.test(U)||H.test(U)};return(F,U=-1)=>{if(e[F]!=="$"||n[F]===yx||e[F+1]==="$"||e[F-1]==="$"&&U!==F||Mpe(e,F)||F+1>=t||vx(e[F+1]))return null;const z=o[F+1]??ul;if(z===ul||(s[z]??0)-(s[F+1]??0)>0||(i[z]??0)-(i[F+1]??0)>0)return null;const W=e.slice(F+1,z);return/^\{[A-Z_][A-Z0-9_]*(?:\}$|[:-])/.test(W)||e[z+1]==="{"&&/^\{[A-Za-z_][A-Za-z0-9_]*(?:[:-][^{}]*)?\}$/.test(W)||a1(Spe(e,F))&&Lpe(W)||Ape(e,F)&&(O(z,W)||Tpe(e,z)||/\s/.test(W)&&/\p{Nd}$/u.test(W)&&!/[+\-*/^=_<>|\\¬°-±×÷′-″←-⇿∀-⋿]/.test(W)||e[z+1]==="$"&&!/\p{L}/u.test(W)&&/[^\p{L}\p{Nd}\s]$/u.test(W))?null:{content:W,end:z+1}}}const Cx=new WeakMap;function Npe(e,t){if(e.src[e.pos]!=="$")return!1;let n=Cx.get(e);(!n||n.src!==e.src)&&(n={src:e.src,match:$pe(e.src),lastEnd:-1},Cx.set(e,n));const o=n.match(e.pos,n.lastEnd);if(!o||o.end>e.posMax)return!1;if(n.lastEnd=o.end,t)return e.pos=o.end,!0;const s=e.push("math_inline","math",0);return s.content=o.content,s.markup="$",s.raw=e.src.slice(e.pos,o.end),s.loading=!1,e.pos=o.end,!0}function Fpe(e){return e.inline.ruler.disable("math"),e.inline.ruler.before("escape","math",Npe),e}const Rpe=12e4,Ope=6e4,Ppe=32,Dpe=3e4,wx=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Bpe(e){let t=0,n=0,o=0;wx.lastIndex=0;let s;for(;(s=wx.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=Rpe||n>=Ope||t>=Ppe||o>=Dpe?"pre":"shiki",codeFenceCount:t,codeChars:n}}async function H$(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return zpe(e)}function Hpe(e){if(typeof e!="string")return;const t=typeof navigator<"u"?navigator.clipboard:void 0;t&&typeof t.writeText=="function"||H$(e)}function zpe(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}const z$="md-table-wide",W$="md-table-toggle",U$="md-table-fade",_x="md-table-toggle--show",Wpe="md-table-at-end",Upe="kimi-table-layout",j$='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>',jpe='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="14" y1="10" x2="21" y2="3"/><line x1="3" y1="21" x2="10" y2="14"/></svg>';function e0(e){return e.querySelector(`button.${W$}`)}function V$(e){return e.querySelector(`.${U$}`)}const Vpe=26;function qpe(e){const t=e0(e);if(!t)return;const n=e.querySelector("thead tr")??e.querySelector("tr");if(!n)return;const o=n.getBoundingClientRect(),s=e.getBoundingClientRect().top,i=Math.max(2,Math.round(o.top-s+(o.height-Vpe)/2));t.style.top=`${i}px`,t.style.right=`${i}px`}function Kpe(e){return e.closest(".a-msg .msg")!==null}function Zpe(e){const t=e.querySelector("table");return t!==null&&t.scrollWidth>e.clientWidth+1}function q$(e){const t=`translateX(${e.scrollLeft}px)`,n=V$(e);n&&(n.style.transform=t);const o=e0(e);o&&(o.style.transform=t);const s=e.scrollLeft+e.clientWidth>=e.scrollWidth-2;e.classList.toggle(Wpe,s)}function Gpe(e,t){const n=e0(e);if(n)return n;if(!Kpe(e))return null;const o=document.createElement("div");o.className=U$,o.setAttribute("aria-hidden","true");const s=document.createElement("button");return s.type="button",s.className=W$,s.innerHTML=j$,s.setAttribute("aria-label",t.widen),s.title=t.widen,s.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),Ype(e,t)}),e.appendChild(o),e.appendChild(s),e.addEventListener("scroll",()=>q$(e),{passive:!0}),T5(e),s}function Ype(e,t){const n=e.classList.toggle(z$),o=e0(e);if(o){o.innerHTML=n?jpe:j$;const s=n?t.restore:t.widen;o.setAttribute("aria-label",s),o.title=s}T5(e),e.dispatchEvent(new CustomEvent(Upe,{bubbles:!0}))}function T5(e){const t=e0(e);if(!t)return;const n=Zpe(e),o=e.classList.contains(z$);t.classList.toggle(_x,n||o);const s=V$(e);s&&s.classList.toggle(_x,n),qpe(e),q$(e)}function Xpe(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Jpe(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}const Qpe={key:1,class:"diff-wrap"},e0e={class:"diff-bar"},t0e=["aria-label","onClick"],n0e={class:"diff-pre"},o0e={key:0,class:"diff-sign"},s0e={class:"diff-text"},i0e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",xx="github-light",Sx="github-dark",r0e=et({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){qce(),ide(),Zce(),ade(),Kce(new Xpe),lde(new Jpe);const{t}=m1(),n=nn("resolveImage"),o=Z(null),s=e,i=R(()=>!s.streaming),r=R(()=>bpe(s.text??"")),l=R(()=>s.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Bpe(s.text??"")),a=f2(),u=R(()=>!s.streaming),c=Go(new Map),d=new Set,f=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,h=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(F){return!/^(https?:|data:|blob:)/i.test(F)}function v(F){if(!n)return;const U=[];for(const z of[f,h]){z.lastIndex=0;let W;for(;(W=z.exec(F))!==null;)U.push(W[2]??"")}for(const z of U)!z||!m(z)||c.has(z)||d.has(z)||(d.add(z),n(z).then(W=>{c.set(z,W!==z?W:"")}).catch(()=>{c.set(z,"")}).finally(()=>{d.delete(z)}))}function k(F){if(!n)return F;const U=z=>{if(!m(z))return null;const W=c.get(z);return W===void 0?i0e:W===""?null:W};return F.replace(f,(z,W,K,V)=>{const ie=U(K);return ie===null?z:`${W}${ie}${V}`}).replace(h,(z,W,K,V)=>{const ie=U(K);return ie===null?z:`${W}${ie}${V}`})}Je(()=>s.text,F=>v(F??""),{immediate:!0});function w(){if(!o.value||!s.openFile||s.streaming)return;const F=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),U=[];let z=F.nextNode();for(;z;){const W=z,K=W.parentElement;K&&!K.closest("a, pre, .md-file-link, svg")&&W.data.trim().length>0&&U.push(W),z=F.nextNode()}for(const W of U){const K=wpe(W.data,{aliases:r.value});if(K.length===0||!W.parentNode)continue;const V=document.createDocumentFragment();let ie=0;for(const ne of K){ne.start>ie&&V.append(document.createTextNode(W.data.slice(ie,ne.start)));const X=document.createElement("button");X.type="button",X.className="md-file-link",X.textContent=ne.text,X.title=ne.line?`${ne.path}:${ne.line}`:ne.path,X.addEventListener("click",le=>{le.preventDefault(),le.stopPropagation(),s.openFile?.({path:ne.path,line:ne.line})}),V.append(X),ie=ne.end}ie<W.data.length&&V.append(document.createTextNode(W.data.slice(ie))),W.parentNode.replaceChild(V,W)}}function b(F){return!(!F||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(F))}function _(F){let U=F.length;for(const z of["#","?"]){const W=F.indexOf(z);W!==-1&&W<U&&(U=W)}return F.slice(0,U)}function g(){if(!o.value||!s.openFile||s.streaming)return;const F=o.value.querySelectorAll("a[href]");for(const U of F){if(U.dataset.mdLinkHandled==="true"||U.closest("svg"))continue;const z=U.getAttribute("href")??"";b(z)&&(U.dataset.mdLinkHandled="true",U.addEventListener("click",W=>{W.preventDefault(),W.stopPropagation(),s.openFile?.({path:_(z)})}))}}function x(){return{widen:t("conversation.widenTable"),restore:t("conversation.restoreTableWidth")}}function S(){if(!o.value||s.streaming)return;const F=x();for(const U of o.value.querySelectorAll(".table-node-wrapper"))Gpe(U,F)}function T(){if(!(!o.value||s.streaming))for(const F of o.value.querySelectorAll(".table-node-wrapper"))T5(F)}function A(){yt().then(()=>{w(),g(),S()})}Je(()=>s.text,A),Je(()=>s.streaming,A);let E=null,P=null;dn(()=>{A(),o.value&&(E=new MutationObserver(A),E.observe(o.value,{childList:!0,subtree:!0}),P=new ResizeObserver(T),P.observe(o.value))}),bn(()=>{E?.disconnect(),P?.disconnect()});const D={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1,monacoOptions:{lineNumbers:!1,fontSize:13,fontFamily:"var(--font-mono)",padding:{top:12,bottom:12}}},I=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,$=R(()=>{const F=k(s.text??""),U=[];let z=0;I.lastIndex=0;let W;for(;(W=I.exec(F))!==null;){const V=W[1]??"",ie=F.slice(z,W.index)+(V||"");ie.trim()&&U.push({kind:"md",text:ie}),U.push({kind:"diff",code:W[2]??""}),z=I.lastIndex}const K=F.slice(z);return(K.trim()||U.length===0)&&U.push({kind:"md",text:K}),U});function B(F){return F.split(`
325
+ `).map(U=>U.startsWith("@@")?{type:"hunk",sign:"",text:U}:/^\+(?!\+\+)/.test(U)?{type:"add",sign:"+",text:U.slice(1)}:/^-(?!--)/.test(U)?{type:"del",sign:"-",text:U.slice(1)}:U.startsWith(" ")?{type:"ctx",sign:"",text:U.slice(1)}:{type:"ctx",sign:"",text:U})}const H=Z(null);function O(F,U){H$(F).then(z=>{z&&(H.value=U,setTimeout(()=>{H.value=null},1400))})}return(F,U)=>(y(),M("div",{ref_key:"mdRef",ref:o,class:"md"},[(y(!0),M(Pe,null,pt($.value,(z,W)=>(y(),M(Pe,{key:W},[z.kind==="md"?(y(),he(p(Vi),{key:0,content:z.text,"custom-markdown-it":p(Fpe),mode:"chat","code-renderer":l.value.codeRenderer,"is-dark":p(a),"code-block-light-theme":xx,"code-block-dark-theme":Sx,themes:[xx,Sx],"code-block-props":D,final:i.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:p(Hpe)},null,8,["content","custom-markdown-it","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering","onCopy"])):(y(),M("div",Qpe,[C("div",e0e,[U[0]||(U[0]=C("span",{class:"diff-lang"},"diff",-1)),j(p(pn),{text:p(t)("filePreview.copyCode")},{default:me(()=>[C("button",{class:"diff-copy","aria-label":p(t)("filePreview.copyCode"),onClick:K=>O(z.code,W)},[j(p(Te),{name:H.value===W?"check":"copy",size:"sm"},null,8,["name"])],8,t0e)]),_:2},1032,["text"])]),C("pre",n0e,[C("code",null,[(y(!0),M(Pe,null,pt(B(z.code),(K,V)=>(y(),M("span",{key:V,class:Re(["diff-line",`diff-${K.type}`])},[K.type!=="hunk"?(y(),M("span",o0e,N(K.sign),1)):ee("",!0),C("span",s0e,N(K.text),1)],2))),128))])])]))],64))),128))],512))}}),Ic=ft(r0e,[["__scopeId","data-v-2a3e373d"]]),l0e={state:"idle"};function a0e(e){const t=Z(l0e),n=Z(ui(cn.updateSkippedVersion)),o=Z(!1);if(typeof e?.getUpdateAutoDownload=="function"&&e.getUpdateAutoDownload().then(i=>{o.value=i}).catch(()=>{}),e!==void 0){let i=!1;e.onUpdateStatus(r=>{i=!0,t.value=r}),e.getUpdateStatus().then(r=>{i||(t.value=r)}).catch(()=>{})}const s=R(()=>{const i=t.value;return!(i.state==="idle"||i.state==="available"&&i.version!==void 0&&i.version===n.value)});return{status:t,visible:s,canCheck:typeof e?.checkForUpdates=="function",autoDownload:o,canToggleAutoDownload:typeof e?.getUpdateAutoDownload=="function"&&typeof e?.setUpdateAutoDownload=="function",setAutoDownload:i=>{o.value=i,e?.setUpdateAutoDownload?.(i).catch(()=>{})},skipVersion:()=>{const i=t.value.version;t.value.state==="available"&&i!==void 0&&(n.value=i,Ls(cn.updateSkippedVersion,i))},check:async()=>{if(typeof e?.checkForUpdates!="function")return Promise.resolve({outcome:"unsupported"});const i=await e.checkForUpdates().catch(()=>({outcome:"error",message:"bridge call failed"}));return i.outcome==="available"&&i.version!==void 0&&i.version===n.value&&(n.value=null,ur(cn.updateSkippedVersion)),i},download:()=>{e?.downloadUpdate().catch(()=>{})},install:()=>{e?.installUpdate().catch(()=>{})}}}let c4=null;function K$(){return c4===null&&(c4=a0e(window.kimiDesktop)),c4}const u0e=["data-state"],c0e=["aria-label"],d0e={class:"upd-pill-text"},f0e={key:0,class:"upd-meta"},p0e={key:1,class:"upd-notes"},h0e={class:"upd-notes-title"},m0e={key:2,class:"upd-progress"},g0e={key:3,class:"upd-message"},v0e={class:"upd-foot"},y0e={class:"upd-foot-actions"},k0e=et({__name:"UpdateIndicator",setup(e){const{t,locale:n}=Nt(),{status:o,visible:s,skipVersion:i,download:r,install:l,autoDownload:a,setAutoDownload:u,canToggleAutoDownload:c}=K$(),d=Z(!1),f="0.35.0".trim()?"0.35.0":"",h=R(()=>{switch(o.value.state){case"available":return t("sidebar.update");case"downloading":return`${o.value.percent??0}%`;case"downloaded":return t("sidebar.updateDone");case"error":return t("sidebar.updateFailed");default:return""}}),m=R(()=>{switch(o.value.state){case"available":return t("sidebar.updateAvailable",{version:o.value.version??""});case"downloading":return t("sidebar.updateDownloading",{percent:o.value.percent??0});case"downloaded":return t("sidebar.updateReady",{version:o.value.version??""});case"error":return t("sidebar.updateFailed");default:return""}}),v=R(()=>{const T=o.value.releaseDate;if(T===void 0||T==="")return"";const A=new Date(T),E=Number.isNaN(A.getTime())?T:A.toLocaleDateString();return t("sidebar.updateReleaseDate",{date:E})}),k=R(()=>{const T=[];return v.value!==""&&T.push(v.value),f!==""&&T.push(t("sidebar.updateCurrentVersion",{version:f})),T.join(" · ")}),w=R(()=>o.value.percent??0),b=R(()=>{const T=o.value.releaseNotes;return T===void 0?"":((n.value.toLowerCase().startsWith("zh")?T.zh:T.en)??T.zh??T.en??"").trim()}),_=R(()=>{switch(o.value.state){case"error":return"alert-triangle";default:return"download"}});function g(){r()}function x(){i(),d.value=!1}function S(){l(),d.value=!1}return(T,A)=>p(s)?(y(),M("span",{key:0,class:"upd","data-state":p(o).state},[C("button",{class:"upd-pill",type:"button","aria-label":h.value,onClick:A[0]||(A[0]=E=>d.value=!0)},[j(p(Te),{class:"upd-pill-icon",name:_.value,size:"sm"},null,8,["name"]),C("span",d0e,N(h.value),1)],8,c0e),j(p(ua),{open:d.value,title:m.value,size:"lg","onUpdate:open":A[4]||(A[4]=E=>d.value=E)},{foot:me(()=>[C("div",v0e,[C("div",y0e,[p(o).state==="available"?(y(),M(Pe,{key:0},[j(p(Rt),{variant:"ghost",onClick:x},{default:me(()=>[qe(N(p(t)("sidebar.updateSkip")),1)]),_:1}),j(p(Rt),{onClick:g},{default:me(()=>[qe(N(p(t)("sidebar.updateDownloadNow")),1)]),_:1})],64)):p(o).state==="downloading"?(y(),he(p(Rt),{key:1,variant:"secondary",onClick:A[1]||(A[1]=E=>d.value=!1)},{default:me(()=>[qe(N(p(t)("sidebar.updateBackground")),1)]),_:1})):p(o).state==="downloaded"?(y(),M(Pe,{key:2},[j(p(Rt),{variant:"ghost",onClick:A[2]||(A[2]=E=>d.value=!1)},{default:me(()=>[qe(N(p(t)("sidebar.updateRestartLater")),1)]),_:1}),j(p(Rt),{onClick:S},{default:me(()=>[qe(N(p(t)("sidebar.updateRestartNow")),1)]),_:1})],64)):p(o).state==="error"?(y(),he(p(Rt),{key:3,variant:"danger-soft",onClick:g},{default:me(()=>[qe(N(p(t)("sidebar.updateRetry")),1)]),_:1})):ee("",!0)]),p(c)?(y(),he(p(rW),{key:0,class:"upd-auto","model-value":p(a),"onUpdate:modelValue":A[3]||(A[3]=E=>p(u)(E))},{default:me(()=>[qe(N(p(t)("sidebar.updateAutoDownload")),1)]),_:1},8,["model-value"])):ee("",!0)])]),default:me(()=>[(p(o).state==="available"||p(o).state==="downloaded")&&k.value?(y(),M("p",f0e,N(k.value),1)):ee("",!0),b.value?(y(),M("section",p0e,[C("h4",h0e,N(p(t)("sidebar.updateWhatsNew")),1),j(p(Ic),{text:b.value},null,8,["text"])])):ee("",!0),p(o).state==="downloading"?(y(),M("div",m0e,[C("div",{class:"upd-progress-fill",style:Zt({width:`${w.value}%`})},null,4)])):ee("",!0),p(o).state==="error"&&p(o).message?(y(),M("p",g0e,N(p(o).message),1)):ee("",!0)]),_:1},8,["open","title"])],8,u0e)):ee("",!0)}}),b0e=ft(k0e,[["__scopeId","data-v-c0a4acce"]]),yg=[{code:"en",label:"English"},{code:"zh",label:"简体中文"}],Hn=Mz({locale:$M()});function E5(e){Hn.global.locale.value=e,Ls(cn.locale,e)}const C0e=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],Z$=500,kg=256*1024,Ax=200,d4=16384,f4=500,p4=50,h4=50,w0e=6,_0e=/api[_-]?key|authorization|token|secret|password|cookie|credential|email|phone|nickname|avatar/i,x0e=/^[A-Za-z0-9+/=_-]{200,}$/;let m4=null;function Qr(){if(m4!==null)return m4;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=ui(cn.debug)==="1"),m4=e,e}const Ka=[],Ed=[];let Mf=0;const Yu=[];let Tf=0,S0e=1;const bg=new TextEncoder,A0e=new Set(C0e),I5=Z(0),Ef=Xr(!1);function M0e(){return Ka}function T0e(){Ka.length=0,Ed.length=0,Mf=0,Yu.length=0,Tf=0,I5.value++}function ca(e){if(!Ef.value){try{const t={id:S0e++,ts:Date.now(),source:e.source,kind:String(Kd(e.kind)),label:String(Kd(e.label)),sessionId:e.sessionId===void 0?void 0:String(Kd(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:pu(e.detail)},n=JSON.stringify(t),o=bg.encode(n).byteLength;if(o>kg)return;for(Ka.push(t),Ed.push(n),Mf+=o+(Ed.length>1?1:0);Ka.length>Z$||Mf>kg;){const s=Ed.shift();Ka.shift(),s!==void 0&&(Mf-=bg.encode(s).byteLength,Ed.length>0&&(Mf-=1))}}catch{return}I5.value++}}function Bu(e){if(typeof e=="string")return e.length<=Ax?e:e.slice(0,Ax)}function mr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function E0e(e,t){if(A0e.has(e))try{const n={ts:Date.now(),event:e,sessionId:Bu(t?.sessionId),status:Bu(t?.status),operation:Bu(t?.operation),seq:mr(t?.seq),durationMs:mr(t?.durationMs),messageCount:mr(t?.messageCount),contentCount:mr(t?.contentCount),mediaCount:mr(t?.mediaCount),sessionCount:mr(t?.sessionCount),workspaceCount:mr(t?.workspaceCount),promptId:Bu(t?.promptId),zipBytes:mr(t?.zipBytes),errorName:Bu(t?.errorName),errorCode:mr(t?.errorCode),requestId:Bu(t?.requestId),phase:Bu(t?.phase),httpStatus:mr(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:mr(t?.line),col:mr(t?.col)},o=JSON.stringify(n),s=bg.encode(o).byteLength;if(s>kg)return;for(Yu.push(o),Tf+=s+(Yu.length>1?1:0);Yu.length>Z$||Tf>kg;){const i=Yu.shift();i!==void 0&&(Tf-=bg.encode(i).byteLength,Yu.length>0&&(Tf-=1))}}catch{return}}function Kd(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return x0e.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>f4?`${i.slice(0,f4)}… [+${i.length-f4} chars]`:i}if(n!=="object")return String(e);if(t>=w0e)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,p4).map(r=>Kd(r,t+1));return e.length>p4&&i.push(`[+${e.length-p4} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,h4))o[i]=_0e.test(i)?"[redacted]":Kd(r,t+1);return s.length>h4&&(o._truncatedKeys=s.length-h4),o}function pu(e){if(e===void 0)return;const t=Kd(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>d4)return{_truncated:`detail JSON was ${n.length} chars; first ${d4} kept`,preview:n.slice(0,d4)}}catch{return"[unserializable detail]"}return t}function I0e(e){Qr()&&ca({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:pu(e.body)}})}function L0e(e){if(!Qr())return;const t=e.code!==0;ca({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:pu(e.data)}})}function $0e(e){Qr()&&ca({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function N0e(e,t){Qr()&&ca({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:pu(t)})}function F0e(e){if(!Qr())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;ca({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:pu(e)})}function R0e(e){if(!Qr())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);ca({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:pu(t.payload)})}const O0e={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function P0e(e,t,n){Qr()&&ca({source:"client",kind:`client:${e}`,label:`${O0e[e]} ${t}`,detail:pu(n)})}function D0e(e,t){Qr()&&ca({source:"client",kind:"client:event",label:`· ${e}`,detail:pu(t)})}function bi(e,t){E0e(e,t),ca({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let g4=!1,Eh=null;function B0e(){if(g4)return()=>Eh?.();g4=!0;const e=[];try{if(typeof window<"u"){const n=s=>{bi("window:error",{status:"failed",errorName:s.error instanceof Error?s.error.name:"Error",line:s.lineno,col:s.colno}),Xl(`[kimi-web] window error: ${s.message}`,s.error instanceof Error?s.error.stack:void 0)},o=s=>{const i=s.reason;bi("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i}),Xl(`[kimi-web] unhandled rejection: ${z0e(i)}`,i instanceof Error?i.stack:void 0)};window.addEventListener("error",n),window.addEventListener("unhandledrejection",o),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",o)})}}catch{}if(Qr())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{P0e(n,i.map(H0e).join(" "),i.length>1?i:i[0])}catch{}o.apply(console,i)};console[n]=s,e.push(()=>{console[n]===s&&(console[n]=o)})}const t=()=>{if(Eh===t){for(const n of e.toReversed())n();Eh=null,g4=!1}};return Eh=t,t}function H0e(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function z0e(e){if(e instanceof Error)return e.message;try{return String(e)}catch{return"[unstringifiable reason]"}}function G$(e=Ka){if(typeof document>"u")return;const t=new Blob([W0e(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let o;try{o=document.createElement("a"),o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(o),o.click()}finally{o?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function W0e(e=Ka){return e===Ka?Ed.join(`
326
326
  `):e.map(t=>JSON.stringify(t)).join(`
327
327
  `)}function U0e(){return Yu.join(`
328
- `)}const Mx=cn.clientId,j0e="kimi-code-web",V0e="web";function q0e(){return{serverHttpUrl:Z0e(),clientId:Y0e(),clientName:j0e,clientVersion:X0e(),clientUiMode:V0e}}function K0e(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function Z0e(){const e=Y$();return h8(e||void 0)}const Tx="kimi-desktop-server-origin";function Y$(){if(typeof window>"u")return;const e=new URLSearchParams(window.location.search).get("kimi_origin");try{return e?(window.sessionStorage.setItem(Tx,e),e):window.sessionStorage.getItem(Tx)??void 0}catch{return e??void 0}}function h8(e){const t=e&&e.trim()?e:K0e(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function Ex(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function G0e(){if(typeof window<"u"){const t=Y$();if(t)return Ex(h8(t))}const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return Ex(e)}function Y0e(){const e=ui(Mx);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return Ls(Mx,t),t}function X0e(){return"0.33.0".trim()?"0.33.0":"0.0.0-dev"}const J0e={restRequest:e=>I0e(e),restResponse:e=>L0e(e),restFailure:e=>$0e(e),wsEvent:e=>{switch(e.kind){case"lifecycle":N0e(e.event,e.detail);break;case"in":R0e(e.frame);break;case"out":F0e(e.frame);break}},traceKeyEvent:(e,t)=>bi(e,t)},Q0e={getToken:eQ,markAuthRequired:sQ},ehe=(e,t)=>t===void 0?Hn.global.t(e):Hn.global.t(e,t);function the(){const e=q0e();return eY({origin:e.serverHttpUrl,identity:{clientId:e.clientId,clientName:e.clientName,clientVersion:e.clientVersion,clientUiMode:e.clientUiMode},tracer:J0e,credentialStore:Q0e,t:ehe})}const nhe=the();function _t(){return nhe}function ohe(e,t,n){return e==="idle"&&!t&&!n}function X$(e,t){const n=ui(e);return n===null?t:n==="1"}const Cg=Z(X$(cn.notifyEnabled,!0)),L5=Z(X$(cn.notifySound,!0)),$5=Z(typeof Notification<"u"?Notification.permission:"denied"),she="/favicon.ico";async function ihe(e){if(!e){Cg.value=!1,Ls(cn.notifyEnabled,"0");return}if(typeof Notification>"u")return;let t=Notification.permission;if(t==="default")try{t=await Notification.requestPermission()}catch{}$5.value=t,t==="granted"&&(Cg.value=!0,Ls(cn.notifyEnabled,"1"))}function rhe(e){L5.value=e,Ls(cn.notifySound,e?"1":"0")}function N5(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function lhe(e){return{title:Hn.global.t("settings.notifyTitle"),body:N5(e,Hn.global.t("settings.notifyFallback"))}}function ahe(e,t){return{title:Hn.global.t("settings.notifyQuestionTitle"),body:N5(t,e,Hn.global.t("settings.notifyQuestionFallback"))}}function uhe(e,t){return{title:Hn.global.t("settings.notifyApprovalTitle"),body:N5(t,e,Hn.global.t("settings.notifyApprovalFallback"))}}function F5(e,t,n){if(!Cg.value||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(s=>{$5.value=s,s==="granted"&&Ix(e,t,n)});return}Ix(e,t,n)}}function Ix(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:she,silent:!L5.value});o.onclick=()=>{try{window.kimiDesktop?.showWindow?.(),window.focus()}catch{}e.onClick(),o.close()}}catch{}}function che(e,t){F5(t,lhe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function dhe(e){F5(e,ahe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function fhe(e){F5(e,uhe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function phe(){return{notifyEnabled:Cg,notifySound:L5,notifyPermission:$5,setNotifyEnabled:ihe,setNotifySound:rhe,maybeNotifyCompletion:che,maybeNotifyQuestion:dhe,maybeNotifyApproval:fhe}}const hhe=1e3,mhe=4096,Lx=32*1024;function ghe(e,t){let n=null,o;const s=new Set;async function i(f){try{const m=await _t().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:nC(m,e.tasksBySession[f]??[])},await r(f,m)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const m=h??e.tasksBySession[f]??[],v=_t(),k=new Map;if(await Promise.all(m.map(async b=>{if((b.status==="completed"||b.status==="failed"||b.status==="cancelled")&&!s.has(b.id)&&!((b.outputLines?.length??0)>0))try{const g=await v.getTask(f,b.id,{withOutput:!0,outputBytes:Lx});g.outputPreview!==void 0&&k.set(b.id,{preview:g.outputPreview,bytes:g.outputBytes}),s.add(b.id)}catch{}})),k.size===0)return;const w=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:w.map(b=>{const _=k.get(b.id)??(b.backgroundTaskId!==void 0?k.get(b.backgroundTaskId):void 0);return _?{...b,outputPreview:_.preview,outputBytes:_.bytes}:b})}}async function l(f){if(e.activeSessionId!==f)return;const h=_t();let m;try{m=await h.listTasks(f)}catch{return}const v=new Map;await Promise.all(m.map(async _=>{const g=_.status==="running",x=_.status==="completed"||_.status==="failed"||_.status==="cancelled";if(!(!g&&!x)&&!(x&&(s.has(_.id)||(_.outputLines?.length??0)>0)))try{const S=await h.getTask(f,_.id,{withOutput:!0,outputBytes:g?mhe:Lx});S.outputPreview!==void 0&&v.set(_.id,{preview:S.outputPreview,bytes:S.outputBytes}),x&&s.add(_.id)}catch{}}));const k=e.tasksBySession[f]??[],w=new Map(k.map(_=>[_.id,_])),b=m.map(_=>{const g=w.get(_.id),x=v.get(_.id);return{..._,outputLines:g?.outputLines,text:g?.text,outputPreview:x?.preview??g?.outputPreview,outputBytes:x?.bytes??g?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:nC(b,k)}}function a(f){n!==null&&o===f||(u(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):u())},hhe))}function u(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const c=Z(0);let d=null;return Je(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{c.value=(c.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Je(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(m=>m.status==="running")}},({sid:f,hasRunning:h},m,v)=>{let k;h&&f!==void 0?a(f):f!==void 0?k=setTimeout(()=>{(e.tasksBySession[f]??[]).some(b=>b.status==="running")||u()},1500):u(),v(()=>{k!==void 0&&clearTimeout(k)})},{deep:!0,immediate:!0}),{taskClock:R(()=>c.value),loadTasksForSession:i}}function m8(e){const t=[];for(const n of e??[])n.kind==="video"?t.push({type:"video",source:{kind:"file",fileId:n.fileId}}):n.kind==="file"?t.push({type:"file",fileId:n.fileId,name:n.name??"",mediaType:n.mediaType||"application/octet-stream",size:n.size??0}):t.push({type:"image",source:{kind:"file",fileId:n.fileId}});return t}const vhe=640,yhe=`(max-width: ${vhe}px)`;function khe(){const e=Z(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(yhe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),bn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),bn(()=>t.removeListener(n))),e}const J$=Z(typeof window>"u"?0:window.innerWidth);let Ih=0,wg=!1;function g8(){J$.value=window.innerWidth}function bhe(){wg||typeof window>"u"||(window.addEventListener("resize",g8),wg=!0,g8())}function Che(){!wg||typeof window>"u"||(window.removeEventListener("resize",g8),wg=!1)}function Q$(e,t,n){return Math.max(t,e-n)}function v8(e,t,n){return Math.min(n,Math.max(t,e))}function eN(){return dn(()=>{Ih+=1,bhe()}),Vn(()=>{Ih=Math.max(0,Ih-1),Ih===0&&Che()}),{viewportWidth:J$}}const whe=24;function _he(e){const t=Z(null),n=Z(!0);let o=null,s=null,i=null,r=0,l=0,a=!1,u=0;function c(){const k=t.value;k&&(k.scrollTop=Math.max(k.scrollTop,r))}function d(){const w=t.value?.firstElementChild??null;w!==i&&(i&&o?.unobserve(i),i=w,w&&o?.observe(w))}function f(){const k=t.value;!k||a||(n.value=r-k.scrollTop-l<whe)}function h(k){k!==u||!a||(a=!1,f())}function m(){n.value=!1,a=!0;const k=++u;if(typeof requestAnimationFrame!="function"){queueMicrotask(()=>h(k));return}requestAnimationFrame(()=>{requestAnimationFrame(()=>h(k))})}function v(){const k=t.value;k&&(o?.disconnect(),s?.disconnect(),i=null,a=!1,u++,r=0,l=0,typeof ResizeObserver=="function"?(o=new ResizeObserver(()=>{const w=t.value;if(!w)return;const{scrollHeight:b,clientHeight:_}=w,g=b>r+1,x=_<l-1;if(r=b,l=_,a){h(u);return}n.value&&(g||x)&&c()}),o.observe(k),d()):(r=k.scrollHeight,l=k.clientHeight,c()),typeof MutationObserver=="function"&&(s=new MutationObserver(d),s.observe(k,{childList:!0})))}return Je(e,()=>{n.value=!0,yt(v)}),Je(t,()=>void yt(v)),dn(()=>void yt(v)),bn(()=>{u++,o?.disconnect(),s?.disconnect()}),{scroller:t,following:n,onScroll:f,pinScroll:m}}function xhe(e){try{const t=ui(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function $x(e,t){try{Ls(e,String(t))}catch{}}function She(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1,axis:r="x",applyLive:l}=e;function a(D){return Number.isFinite(D)?Math.min(Rh(s),Math.max(o,Math.round(D))):n}const u=Z(a(xhe(t)??n)),c=Z(!1);function d(D){const I=D<=o,$=D>=Rh(s),B=r==="x"?"col-resize":"row-resize";if(I&&$)return B;const[H,O]=r==="x"?["e-resize","w-resize"]:["s-resize","n-resize"];return $?i?H:O:I?i?O:H:B}const f=Z(null),h=R(()=>d(f.value??u.value));function m(D){typeof document>"u"||(document.body.style.cursor=d(D))}function v(D){const I=a(D);u.value=I,$x(t,I)}Je(()=>Rh(s),D=>{!c.value&&u.value>D&&v(D)});let k=0,w=0,b=null,_=-1,g=0,x=0,S=0;function T(){if(x=0,!c.value)return;const D=g-k;S=a(w+(i?-D:D)),f.value=S,m(S),l?l(S):u.value=S}function A(D){if(c.value&&(g=r==="x"?D.clientX:D.clientY,x===0)){if(typeof requestAnimationFrame!="function"){T();return}x=requestAnimationFrame(T)}}function E(){if(c.value){if(x!==0&&(cancelAnimationFrame(x),T()),c.value=!1,l?v(S):$x(t,u.value),f.value=null,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),b){try{b.releasePointerCapture(_)}catch{}b.removeEventListener("pointermove",A),b.removeEventListener("pointerup",E),b.removeEventListener("pointercancel",E)}b=null,_=-1}}function P(D){D.preventDefault(),c.value=!0,k=r==="x"?D.clientX:D.clientY,w=a(u.value),S=w,b=D.currentTarget,_=D.pointerId,typeof document<"u"&&(document.body.style.userSelect="none"),m(w);try{b.setPointerCapture(_)}catch{}b.addEventListener("pointermove",A),b.addEventListener("pointerup",E),b.addEventListener("pointercancel",E)}return Vn(E),{width:u,dragging:c,cursor:h,clamp:a,setWidth:v,onPointerDown:P}}const Hr=Z(null),Zd=Z(!1),Ahe=R(()=>Hr.value!==null);function R5(e){const t=Hr.value;!t||Zd.value||(Hr.value=null,t.resolve(e))}async function Mhe(){const e=Hr.value;if(!(!e||Zd.value)){if(!e.action){R5(!0);return}Zd.value=!0;try{await e.action(),Hr.value===e&&(Hr.value=null),e.resolve(!0)}catch(t){Hr.value===e&&(Hr.value=null),e.reject(t)}finally{Zd.value=!1}}}function The(e){return Zd.value?Promise.resolve(!1):(Hr.value&&R5(!1),new Promise((t,n)=>{Hr.value={...e,resolve:t,reject:n}}))}function hu(){return{current:Hr,busy:Zd,isConfirmOpen:Ahe,confirm:The,settle:R5,runAction:Mhe}}function Ehe(e){const{sessionId:t}=e;function n(u){return ui(eC(u))??""}function o(u,c){const d=eC(u);c?Ls(d,c):ur(d)}const s=Z(n(t())),i=Z(null);function r(){const u=i.value;u&&(u.style.height="auto",u.style.height=`${u.scrollHeight}px`)}Je(s,u=>{yt(r),o(t(),u)}),Je(t,(u,c)=>{u!==c&&(o(c,s.value),s.value=n(u),yt(r))});function l(u){s.value=u,yt(()=>{const c=i.value;if(!c)return;c.focus();const d=u.length;c.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function Ihe(e){return e?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable===!0:!1}function Lhe(e){const{sessionId:t,mobile:n,starting:o,dockedComposer:s,emptyComposer:i}=e,r=Z(!1);Je(t,()=>{n()||(r.value=!0)}),Je([r,s,i,o],()=>{if(!r.value)return;const l=s.value??i.value;if(!l)return;const a=typeof document<"u"?document.activeElement:null;if(Ihe(a)){r.value=!1;return}l.focus(),(typeof document>"u"||document.activeElement!==a)&&(r.value=!1)},{flush:"post"})}const _g=100;function $he(e){const t=y1(cn.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>_g?n.slice(-_g):n,s={[e]:o};return Tc(cn.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function Nhe(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=Z($he(s())),r=R(()=>i.value[s()??""]??[]);let l=-1,a="";function u(w){const b=s();if(l=-1,!b)return;const _=w.trim();if(!_)return;const g=i.value[b]??[];if(g.at(-1)===_)return;const x=[...g,_],S=x.length>_g?x.slice(-_g):x;i.value={...i.value,[b]:S},Tc(cn.inputHistory,i.value)}function c(){const w=n.value;return w?(w.selectionStart??0)===0:!1}function d(w){t.value=w,yt(()=>{const b=n.value;if(!b)return;o();const _=w.length;b.setSelectionRange(_,_)})}function f(){const w=r.value;if(w.length!==0){if(l===-1)a=t.value,l=w.length-1;else if(l>0)l-=1;else return;d(w[l])}}function h(){if(l===-1)return;const w=r.value;l<w.length-1?(l+=1,d(w[l])):(l=-1,d(a))}function m(){l=-1}function v(){return l!==-1}function k(){return r.value.length>0}return Je(s,()=>{l=-1}),{push:u,caretAtTextStart:c,recallOlder:f,recallNewer:h,resetBrowsing:m,isBrowsing:v,hasHistory:k}}function Fhe(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=Z(!1),u=Z([]),c=Z(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(u.value=mQ(h,CE(s())),c.value=0,a.value=u.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,yt(()=>{const m=n.value;if(!m)return;const v=t.value.length;m.setSelectionRange(v,v),m.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:u,active:c,update:d,select:f}}function Rhe(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=Z(!1),r=Z([]),l=Z(0),a=Z(!1);let u=null;function c(){const h=t.value,m=n.value?.selectionStart??h.length;let v=m-1;for(;v>=0&&!/\s/.test(h[v]);)v--;v++;const k=h.slice(v,m);return k.startsWith("@")?{token:k.slice(1),start:v,end:m}:null}function d(){const h=c(),m=s();if(u!==null&&clearTimeout(u),!h||!m||h.token.length===0){i.value=!1,a.value=!1;return}const v=h.token;u=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;const k=()=>{const w=c();return w!==null&&w.token===v&&i.value};try{const w=await m(v);k()&&(r.value=w)}catch{k()&&(r.value=[])}finally{k()&&(a.value=!1)}},200)}function f(h){const m=c();if(!m)return;const v=t.value;t.value=v.slice(0,m.start)+h.path+v.slice(m.end),i.value=!1,yt(()=>{const k=n.value;if(!k)return;const w=m.start+h.path.length;k.setSelectionRange(w,w),k.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}const Ohe="kimi-web.file-preview-width",gd=320;function Phe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=eN(),i=R(()=>Math.max(0,s.value-t.value)),r=R(()=>Q$(i.value,gd,gd));function l(Y){return v8(Math.round(Y),gd,r.value)}function a(){return l(i.value/2)}const u=R(()=>a()),c=Z(u.value),d=R(()=>v8(c.value,gd,r.value)),f=Z(null),h=R(()=>{const Y=f.value;if(!Y)return null;const fe=e.turns.value.find(we=>we.id===Y.turnId);return fe?.role==="compaction"&&fe.text?fe.text:null}),m=R(()=>h.value!==null);function v(Y){if(f.value?.turnId===Y.turnId){f.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",f.value=Y}function k(){f.value=null,n.value==="compaction"&&(n.value=null)}const w=Z(null),b=R(()=>{const Y=w.value;if(!Y)return{entry:void 0,version:0};const fe=e.auxiliaryTranscripts.getEntry(Y.sessionId,Y.subagentId);return{entry:fe,version:fe?.version.value??0}});function _(Y){const fe=e.turns.value.flatMap(we=>we.tools??[]).find(we=>we.agentId===Y);if(!fe)return{};try{const we=JSON.parse(fe.arg);return{name:typeof we.description=="string"?we.description:void 0,subagentType:typeof we.subagent_type=="string"?we.subagent_type:void 0,status:fe.status,outputLines:fe.output}}catch{return{}}}const g=R(()=>{const Y=w.value;if(!Y)return null;const fe=e.activeAppTasks.value.find(Fe=>Fe.agentId===Y.subagentId||Fe.id===Y.subagentId);if(fe)return UY(fe);const we=b.value.entry?.channel,ge=we?.agents.find(Fe=>Fe.agentId===Y.subagentId),Q=we?.refreshError??!1,te=we===void 0||we.loading,ce=we?.snapshot.meta.activity==="turn",ue=_(Y.subagentId),Se=we?.snapshot.items.findLast(Fe=>Fe.kind==="turn"),ze=Se?.kind==="turn"&&Se.state==="cancelled",_e=Se?.kind==="turn"&&Se.state==="failed"||ue.status==="error",Ee=ce?"working":_e||ze?"failed":te?"queued":Q&&ue.status===void 0?"failed":"completed",it=ce?"running":ze?"cancelled":_e?"failed":te?"running":Q&&ue.status===void 0?"failed":"completed";return{id:Y.subagentId,name:ge?.label??ue.name??Y.subagentId,subagentType:ue.subagentType??(ge?.type==="sub"?"subagent":ge?.type),phase:Ee,status:it,outputLines:ue.outputLines}}),x=R(()=>{const Y=b.value.entry;if(!Y)return[];const fe=w.value,we=Y.channel.agents.find(ge=>ge.agentId===fe?.subagentId);return nX(Y.channel.snapshot,e.getFileUrl,we)}),S=R(()=>b.value.entry?.channel.loading??!1),T=R(()=>b.value.entry?.channel.refreshError??!1),A=R(()=>b.value.entry?.channel.loadingOlder??!1),E=R(()=>b.value.entry?.channel.loadOlderError??!1),P=R(()=>b.value.entry?.channel.snapshot.hasMoreOlder??!1),D=R(()=>b.value.entry?.channel.snapshot.meta.activity==="turn"),I=R(()=>g.value!==null);function $(Y){const fe=e.activeSessionId.value;if(!(!Y||!fe)){if(n.value==="agent"&&w.value?.sessionId===fe&&w.value.subagentId===Y){B();return}w.value={sessionId:fe,subagentId:Y},n.value="agent",e.auxiliaryTranscripts.activate(fe,Y)}}function B(){const Y=w.value;Y&&e.auxiliaryTranscripts.deactivate(Y.sessionId,Y.subagentId),w.value=null,n.value==="agent"&&(n.value=null)}Je(n,(Y,fe)=>{if(fe!=="agent"||Y==="agent")return;const we=w.value;we&&e.auxiliaryTranscripts.deactivate(we.sessionId,we.subagentId)});function H(){const Y=b.value.entry;Y&&Y.channel.loadOlder().catch(()=>{})}const O=Z("list"),F=Z(null);function U(){if(n.value==="diff"){z();return}n.value="diff",O.value="list",F.value=null,e.loadGitStatus(e.activeSessionId.value)}function z(){n.value==="diff"&&(n.value=null),O.value="list",F.value=null,e.clearFileDiff()}async function W(Y){O.value="detail",F.value=Y,await e.loadFileDiff(Y)}const K=Xr(null);function V(Y){if(K.value===Y&&n.value==="turn-diff"){ie();return}K.value=Y,n.value="turn-diff"}function ie(){K.value=null,n.value==="turn-diff"&&(n.value=null)}async function ne(Y){if(!e.activeSessionId.value&&e.activeWorkspaceId.value){const fe=await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,Y);return n.value="btw",fe}return await e.openSideChat(Y),n.value="btw",null}function X(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function le(){n.value==="btw"&&(n.value=null)}const Ie=R(()=>e.sideChatVisible.value),de=R(()=>n.value!==null&&(n.value!=="compaction"||m.value)&&(n.value!=="agent"||I.value)&&(n.value!=="btw"||Ie.value)),pe=Z(!1),ve=Z({});function oe(){switch(n.value){case"compaction":return f.value?{kind:"compaction",...f.value}:null;case"agent":return w.value?{kind:"agent",...w.value}:null;case"btw":return{kind:"btw"};default:return null}}function ye(Y){if(Y)switch(Y.kind){case"compaction":f.value={turnId:Y.turnId},n.value="compaction";break;case"agent":e.activeSessionId.value&&(w.value={sessionId:e.activeSessionId.value,subagentId:Y.subagentId},n.value="agent",e.auxiliaryTranscripts.activate(e.activeSessionId.value,Y.subagentId));break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function G(){return n.value==="compaction"&&m.value?(k(),!0):n.value==="agent"&&I.value?(B(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(z(),!0):n.value==="turn-diff"?(ie(),!0):n.value==="btw"?(X(),!0):!1}return Je(e.activeSessionId,(Y,fe)=>{if(fe){const we=oe();we?ve.value[fe]=we:delete ve.value[fe]}o(),k(),B(),z(),ie(),le(),Y&&ye(ve.value[Y])}),{PREVIEW_WIDTH_KEY:Ohe,PREVIEW_MIN:gd,previewDefaultWidth:u,previewMax:r,previewWidth:c,previewPanelWidth:d,compactionPanelText:h,compactionPanelVisible:m,openCompactionPanel:v,closeCompactionPanel:k,agentPanelMember:g,agentPanelTurns:x,agentPanelLoading:S,agentPanelLoadError:T,agentPanelLoadingMore:A,agentPanelLoadMoreError:E,agentPanelHasMore:P,agentPanelRunning:D,agentPanelVisible:I,openAgentPanel:$,closeAgentPanel:B,loadOlderAgentMessages:H,detailDiffMode:O,detailDiffPath:F,openDiffDetail:U,closeDiffDetail:z,selectDiffFile:W,turnDiffChange:K,openTurnDiff:V,closeTurnDiff:ie,btwVisible:Ie,openSideChatTab:ne,closeSideChat:X,hideSideChatPanel:le,sidePanelVisible:de,panelDragging:pe,closeOpenSidePanel:G}}const Dhe=cn.sidebarWidth,Nx=cn.sidebarCollapsed,Fx=270,v4=220,Bhe=480,Hhe=320;function zhe(e={}){const{viewportWidth:t}=eN(),n=Z(Fx),o=Z(!1),s=Z(!1),i=R(()=>{const c=Hhe+(Rh(e.previewOpen)?gd:0);return Math.min(Bhe,Q$(t.value,v4,c))}),r=R(()=>v8(n.value,v4,i.value));function l(){try{o.value=ui(Nx)==="true"}catch{o.value=!1}}function a(){try{Ls(Nx,String(o.value))}catch{}}function u(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:Dhe,SIDEBAR_DEFAULT:Fx,SIDEBAR_MIN:v4,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:u}}const Whe=40409;function Rx(e){return Us(e)&&e.code===Whe}function Ox(e){return e.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith("\\\\")}function Px(e){if(e.startsWith("\\\\"))return e;const t=/^[a-zA-Z]:/.test(e)?e.slice(0,2):"",n=[];for(const o of e.slice(t.length).split(/[\\/]+/))if(!(!o||o===".")){if(o===".."){n.pop();continue}n.push(o)}return t?`${t}/${n.join("/")}`:`/${n.join("/")}`}function Uhe({client:e,detailTarget:t,t:n}){const o=Z(null),s=Z(null),i=Z(!1),r=Z(null),l=Z(null);let a=0;const u=R(()=>{const g=l.value;return g?e.getFileDownloadUrl(g):null}),c=R(()=>o.value!==null&&l.value!==null);function d(g){return g.length>1?g.replace(/\/+$/,""):g}function f(g){const x=h2(g,e.status.value.cwd);return x===null||x.split(/[\\/]+/).includes("..")?null:h(x)||null}function h(g){const x=[];for(const S of g.split(/[\\/]+/))if(!(!S||S===".")){if(S===".."){x.pop();continue}x.push(S)}return x.join("/")}function m(g){const x=g.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const S=d(e.status.value.cwd);if(x.startsWith("/")){if(!S||x!==S&&!x.startsWith(`${S}/`))return{error:n("filePreview.errors.outsideWorkspace")};const A=x===S?"":x.slice(S.length+1);if(A.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const E=h(A);return E?{path:E}:{error:n("filePreview.errors.isDirectory")}}if(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const T=h(x);return T?{path:T}:{error:n("filePreview.errors.emptyPath")}}async function v(g){const x=o.value;if(t.value==="file"&&x&&x.path===g.path&&x.line===g.line){w();return}const S=++a;if(t.value="file",s.value=null,r.value=null,i.value=!0,o.value=g,l.value=null,typeof g.content=="string"){i.value=!1,s.value={path:g.path,content:g.content,encoding:"utf-8",mime:"text/markdown",isBinary:!1,size:g.content.length};return}if(!Ox(g.path)&&g.path.split(/[\\/]+/).includes("..")){const A=d(e.status.value.cwd);A&&(g={...g,path:Px(`${A}/${g.path}`)})}if(Ox(g.path)){g={...g,path:Px(g.path)};const A=f(g.path);if(A!==null)g={...g,path:A};else{try{const E=await e.readHostFileContent(g.path);if(S!==a)return;l.value=null,s.value={path:g.path,content:E.content,encoding:E.encoding,mime:E.mime,isBinary:E.isBinary,size:E.size}}catch(E){if(S!==a)return;r.value=Rx(E)?n("filePreview.errors.notFound"):pU(E)?n("filePreview.errors.tooLarge"):E instanceof Error?E.message:n("filePreview.errors.loadFailed")}finally{S===a&&(i.value=!1)}return}}const T=m(g.path);if("error"in T){i.value=!1,r.value=T.error;return}l.value=T.path;try{const A=await e.readFileContent(T.path);if(S!==a)return;A?s.value={...A,path:A.path||T.path}:r.value=n("filePreview.errors.loadFailed")}catch(A){if(S!==a)return;r.value=Rx(A)?n("filePreview.errors.notFound"):A instanceof Error?A.message:n("filePreview.errors.loadFailed")}finally{S===a&&(i.value=!1)}}function k(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1}function w(){k(),t.value==="file"&&(t.value=null)}Je(t,(g,x)=>{x==="file"&&g!=="file"&&k()});function b(){const g=s.value?.path??o.value?.path;g&&e.openWorkspaceFile(g,o.value?.line)}function _(){const g=s.value?.path??o.value?.path;g&&e.revealWorkspaceFile(g)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:u,previewExternalActions:c,openFilePreview:v,closeFilePreview:w,openPreviewInEditor:b,revealPreviewFile:_}}function jhe({running:e,title:t="Kimi Code"}){if(Wp){I4(()=>{typeof document<"u"&&(document.title=t)});return}const n=["◐","◓","◑","◒"],o=Z(0);let s=null;function i(){s===null&&(o.value=0,s=setInterval(()=>{o.value=(o.value+1)%n.length},250))}function r(){s!==null&&(clearInterval(s),s=null),o.value=0}Je(e,a=>{a?i():r()},{immediate:!0});const l=R(()=>`${e.value?`${n[o.value]} `:""}${t}`);I4(()=>{typeof document<"u"&&(document.title=l.value)}),bn(()=>{r()})}const Vhe=50,am=5,O5=5,xg=50,qhe=40401,Khe=40402,Zhe=40410,Ghe=40409,Yhe=40902,Xhe=2e3,Jhe=10;function y4(e){return Us(e)&&e.code===Yhe}const Qhe=40904;function eme(e){return Us(e)&&e.code===Qhe}const Hu=Go({}),Lh=Go({}),k4=Go({}),cl=Go(new Set),N2=new Map,wc=new Map,Sg=new Map;let tme=0;const ju=new Map,nme=3;let Dx=0;function ome(){return Dx+=1,`${Date.now().toString(36)}-${Dx}`}function sme(e){return{generation:N2.get(e)??0,pending:(wc.get(e)?.size??0)>0}}function y8(e){const t=++tme;N2.set(e,t);const n=wc.get(e)??new Set;return n.add(t),wc.set(e,n),t}function k8(e,t){const n=wc.get(e);if(n===void 0||(n.delete(t),n.size>0))return;wc.delete(e);const o=Sg.get(e);Sg.delete(e),o?.()}function ime(e){N2.delete(e),wc.delete(e),Sg.delete(e),ju.delete(e)}function rme(e,t){return!t.pending&&t.generation===(N2.get(e)??0)}function lme(e,t){if((wc.get(e)?.size??0)===0){t();return}Sg.set(e,t)}function ame(e,t){const{t:n}=Hn.global,{confirm:o}=hu(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:u,setSessions:c,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:m,unpinSessions:v,setActiveSessionId:k,updateSessionMessages:w,nextOptimisticMsgId:b,getEventConn:_,syncSessionFromSnapshot:g,reopenSession:x,hasLoadedMessages:S,refreshSessionStatus:T,refreshSessionGoal:A,refreshSessionPlans:E,persistSessionProfile:P,mergedWorkspaces:D,workspacesView:I,status:$,workspaceIdForSession:B,savePermissionToStorage:H,savePlanModeToStorage:O,saveSwarmModeToStorage:F,saveGoalModeToStorage:U,draftModes:z,saveUnread:W,saveActiveWorkspaceToStorage:K,saveHiddenWorkspacesToStorage:V,goalErrorMessage:ie,initialized:ne,connectIssue:X,selectedDiffPath:le,fileDiffLines:Ie,fileDiffLoading:de,fileDiffTexts:pe,fileDiffEmptyFile:ve}=t;let oe=!1,ye=0;function G(se,xe,J,Ce){w(se,$e=>{const He=$e.findIndex(Et=>Et.id===xe);if(He===-1)return $e;const vt=$e.findIndex((Et,ln)=>ln!==He&&Et.role==="user"&&(Et.id===Ce||Et.userMessageId===Ce||Et.promptId===J)),ut=$e[He],Dt=vt===-1?ut:$e[vt];return $e.flatMap((Et,ln)=>ln===vt?[]:ln!==He?[Et]:[{...Dt,id:ut.id,promptId:J,userMessageId:Ce,metadata:{...Dt.metadata,...ut.metadata}}])})}async function Y(se){if(e.messagesLoadingMoreBySession[se])return;const xe=e.messagesBySession[se];if(!xe||xe.length===0)return;const J=xe[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[se]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[se]:!1};try{const Ce=await _t().listMessages(se,{beforeId:J,pageSize:Vhe}),$e=[...Ce.items].reverse();w(se,He=>[...$e,...He]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[se]:Ce.hasMore}}catch(Ce){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[se]:!0},l("loadOlderMessages",Ce,{sessionId:se})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[se]:!1}}}function fe(se,xe){s.loadTasksForSession(se),Q(se),xe?.skipStatus!==!0&&T(se),A(se),E(se),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,se)||r.loadSkillsForSession(se)}async function we(se){const xe=e.activeSessionId;if(xe){le.value=se,Ie.value=[],pe.value=null,ve.value=!1,de.value=!0;try{const Ce=await _t().getFileDiff(xe,se);if(le.value!==se||e.activeSessionId!==xe)return;const $e=wX(Ce.diff);if(Ie.value=$e,$e.length===0){const vt=await Ei(se).catch(()=>null);if(le.value!==se||e.activeSessionId!==xe)return;ve.value=vt!==null&&vt.size===0;return}de.value=!1;const He=await cX($e,{truncated:Ce.truncated,readNewText:async()=>{const vt=await Ei(se).catch(()=>null);return!vt||vt.isBinary||vt.encoding!=="utf-8"?null:vt.content}});if(le.value!==se||e.activeSessionId!==xe)return;pe.value=He}catch(J){le.value===se&&(Ie.value=[]),gl("[loadFileDiff] diff unavailable for",se,J)}finally{le.value===se&&(de.value=!1)}}}function ge(){le.value=null,Ie.value=[],pe.value=null,ve.value=!1,de.value=!1}async function Q(se){try{const J=await _t().getGitStatus(se);e.gitStatusBySession={...e.gitStatusBySession,[se]:J}}catch{}}let te=0;async function ce(se){try{const xe=await _t().getUserInfo();if(se!==te||e.managedProviderStatus!=="authenticated")return;e.managedUserInfo=xe.kind==="ok"?xe.userInfo:null,xe.kind==="ok"?e.managedMembership=xe.userInfo.userLevel===Jhe?"free":"member":e.managedMembership=xe.status===402?"free":null}catch{if(se!==te)return;e.managedProviderStatus==="authenticated"&&(e.managedUserInfo=null,e.managedMembership=null)}}async function ue(){e.managedProviderStatus==="authenticated"&&await ce(++te)}async function Se(){const se=++te;try{const J=await _t().getAuth();return e.authReady=J.ready,e.defaultModel=J.defaultModel,e.managedProviderStatus=J.managedProvider?.status??null,e.managedProviderStatus==="authenticated"?ce(se):(e.managedUserInfo=null,e.managedMembership=null),X.value=null,"proceed"}catch(xe){return Us(xe)&&(xe.code===401||xe.code===PM)?(X.value=null,"server-auth-required"):(X.value=(xe instanceof Error?xe.message:String(xe)).slice(0,140),"retry")}}async function ze(){let se=!0;for(;;){const xe=await Se();if(xe!=="retry")return xe;se&&(X.value=null,se=!1),await new Promise(J=>{setTimeout(J,Xhe)})}}async function _e(){try{const se=_t();e.config=await se.getConfig()}catch{}}async function Ee(se){try{const J=await _t().setConfig(se);return e.config=J,e.defaultModel=J.defaultModel??null,!0}catch(xe){return l("setConfig",xe),!1}}const it=100,Fe=720*60*1e3;async function Oe(se){const xe=_t(),J=[];let Ce,$e;for(;se?.shouldContinue?.()!==!1;){let He;try{He=await xe.listSessions({pageSize:it,beforeId:Ce,excludeEmpty:!0})}catch(vt){if(J.length===0)throw vt;$e=vt;break}if(J.push(...He.items),!He.hasMore||He.items.length===0)break;Ce=He.items[He.items.length-1].id}return{sessions:J,error:$e}}function Ge(se){const xe=new Map(e.sessions.map(J=>[J.id,J]));c(se.map(J=>{const Ce=xe.get(J.id);if(Ce===void 0)return J;const $e=o3(J.usage)&&!o3(Ce.usage),He=J.pullRequest??Ce.pullRequest;return!$e&&He===J.pullRequest?J:{...J,usage:$e?Ce.usage:J.usage,pullRequest:He}}))}function at(se){const xe=[...se],J=new Set(xe.map(Ce=>Ce.id));for(const Ce of e.sessions)J.has(Ce.id)||(xe.push(Ce),J.add(Ce.id));return xe.sort((Ce,$e)=>new Date($e.updatedAt).getTime()-new Date(Ce.updatedAt).getTime()),xe}async function Tt(se){const xe=_t(),J=[],Ce=Date.now(),$e=Et=>Ce-new Date(Et.updatedAt).getTime();let He,vt=!1,ut=!0,Dt;for(;;){let Et;try{Et=await xe.listSessions({workspaceId:se,pageSize:am,beforeId:He,excludeEmpty:!0})}catch(Ot){if(ut)throw Ot;Dt=Ot,vt=!0;break}if(vt=Et.hasMore,Et.items.length===0)break;const ln=Et.items[Et.items.length-1],oo=$e(ln)>=Fe;if(!ut&&oo){const Ot=Et.items.findIndex(Yn=>$e(Yn)>=Fe),Pt=Ot>=0?Ot+1:Et.items.length;J.push(...Et.items.slice(0,Pt)),vt=Et.hasMore||Pt<Et.items.length;break}if(J.push(...Et.items),ut=!1,!Et.hasMore||oo)break;He=ln.id}return{workspaceId:se,page:{items:J,hasMore:vt},error:Dt}}async function Bt(){const se=e.workspaces;if(se.length===0){const Ot=await Oe(),Pt=Ot.error===void 0?Ot.sessions:at(Ot.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=Ot.error===void 0,Ot.error!==void 0&&l("load",Ot.error),Pt}const xe=await Promise.allSettled(se.map(Ot=>Tt(Ot.id))),J=[],Ce=new Set,$e=new Map,He=new Set;let vt;for(let Ot=0;Ot<xe.length;Ot++){const Pt=xe[Ot];if(Pt.status==="fulfilled"){$e.set(Pt.value.workspaceId,Pt.value.page),Pt.value.error!==void 0&&(He.size===0&&(vt=Pt.value.error),He.add(Pt.value.workspaceId));for(const Yn of Pt.value.page.items)Ce.has(Yn.id)||(J.push(Yn),Ce.add(Yn.id));continue}He.size===0&&(vt=Pt.reason),He.add(se[Ot].id)}if($e.size===0){l("load",vt);return}const ut=new Set(se.filter(Ot=>He.has(Ot.id)).map(Ot=>Ot.root)),Dt=new Set(se.map(Ot=>Ot.id));for(const Ot of e.sessions)!(Ot.workspaceId!==void 0&&Dt.has(Ot.workspaceId)?He.has(Ot.workspaceId):ut.has(Ot.cwd)||He.has(B(Ot)))||Ce.has(Ot.id)||(J.push(Ot),Ce.add(Ot.id));const Et={},ln={},oo={};for(const{id:Ot}of se){const Pt=$e.get(Ot);if(Pt===void 0){const Yn=e.sessionsHasMoreByWorkspace[Ot],ko=e.sessionsCursorByWorkspace[Ot],vs=e.sessionsInitialCountByWorkspace[Ot];Yn!==void 0&&(Et[Ot]=Yn),ko!==void 0&&(ln[Ot]=ko),vs!==void 0&&(oo[Ot]=vs);continue}Et[Ot]=Pt.hasMore,ln[Ot]=Pt.items.length>0?Pt.items[Pt.items.length-1].id:void 0,oo[Ot]=Math.max(Pt.items.length,am)}return e.sessionsHasMoreByWorkspace=Et,e.sessionsCursorByWorkspace=ln,e.sessionsInitialCountByWorkspace=oo,e.sessionsFullyLoaded=!1,J.sort((Ot,Pt)=>new Date(Pt.updatedAt).getTime()-new Date(Ot.updatedAt).getTime()),He.size>0&&l("load",vt),J}async function Yt(se){if(!e.sessionsLoadingMoreByWorkspace[se]&&e.sessionsHasMoreByWorkspace[se]!==!1&&e.sessionsCursorByWorkspace[se]!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[se]:!0};try{let xe=e.sessionsCursorByWorkspace[se],J;for(let He=0;He<3&&xe!==void 0&&(J=await _t().listSessions({workspaceId:se,pageSize:O5,beforeId:xe,excludeEmpty:!0}),e.sessionsCursorByWorkspace[se]!==xe);He+=1)J=void 0,xe=e.sessionsCursorByWorkspace[se];if(J===void 0)return;const Ce=new Set(e.sessions.map(He=>He.id)),$e=J.items.filter(He=>!Ce.has(He.id));$e.length>0&&c([...e.sessions,...$e]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[se]:J.items.length>0?J.items[J.items.length-1].id:xe},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[se]:J.hasMore}}catch(xe){l("loadMoreSessions",xe)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[se]:!1}}}}function Sn(se){return e.sessions.filter(xe=>!xe.parentSessionId&&B(xe)===se)}const on=5;function en(se,xe){const J=new Set(e.sessions.map(He=>He.id)),Ce=se.items.filter(He=>!J.has(He.id)&&(He.meta.last_prompt??"").length>0).map(kU);Ce.length>0&&c([...e.sessions,...Ce]);for(const He of se.items)if(J.has(He.id)&&He.git!==void 0){const vt=He.git.pull_request;d(He.id,ut=>ut.pullRequest===vt?ut:{...ut,pullRequest:vt})}if(se.items.length>0){const He=Math.min(...se.items.map(vt=>vt.meta.updated_at));e.flatSessionsFrontier=xe?.resetFrontier===!0||e.flatSessionsFrontier===null?He:Math.min(e.flatSessionsFrontier,He)}e.flatSessionsNextPageToken=se.nextPageToken,e.flatSessionsHasMore=se.hasMore;const $e=new Set(I.value.map(He=>He.id));return se.items.filter(He=>(He.meta.last_prompt??"").length>0&&$e.has(B({workspaceId:He.workspace.id,cwd:He.workspace.cwd??""}))).length}async function Cn(){const se=await _t().listSessionsV2({pageSize:xg,include:"git"});en(se,{resetFrontier:!0}),e.flatSessionsSeeded=!0}async function Mn(){if(!(e.flatSessionsSeeded||e.flatSessionsLoading)){e.flatSessionsLoading=!0;try{await Cn()}catch(se){l("ensureFlatSessions",se)}finally{e.flatSessionsLoading=!1}}}async function We(){if(!(e.flatSessionsLoading||e.flatSessionsLoadingMore)&&e.flatSessionsHasMore){e.flatSessionsLoadingMore=!0;try{if(!e.flatSessionsSeeded){await Cn();return}if(e.flatSessionsNextPageToken===null)return;for(let se=0;se<on;se+=1){const xe=e.flatSessionsNextPageToken;if(xe===null||!e.flatSessionsHasMore)break;let J;try{J=await _t().listSessionsV2({pageSize:xg,pageToken:xe,include:"git"})}catch(Ce){if(!mU(Ce))throw Ce;e.flatSessionsNextPageToken=null,await Cn();break}if(en(J)>0)break}}catch(se){l("loadMoreFlatSessions",se)}finally{e.flatSessionsLoadingMore=!1}}}async function tt(se,xe,J,Ce){if(e.sessionsCursorByWorkspace[se]===xe){const He=new Date(J).getTime();let vt;for(const ut of e.sessions){if(B(ut)!==se)continue;const Dt=new Date(ut.updatedAt).getTime();Dt<=He||(vt===void 0||Dt<new Date(vt.updatedAt).getTime())&&(vt=ut)}e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[se]:vt?.id}}let $e=3;for(;$e>0&&Sn(se).length<Ce&&(e.sessionsHasMoreByWorkspace[se]??!1);){const He=e.sessionsCursorByWorkspace[se],vt=Sn(se).length;if(He===void 0)try{const ut=await _t().listSessions({workspaceId:se,pageSize:am,excludeEmpty:!0}),Dt=new Set(e.sessions.map(ln=>ln.id)),Et=ut.items.filter(ln=>!Dt.has(ln.id));Et.length>0&&c([...e.sessions,...Et].sort((ln,oo)=>new Date(oo.updatedAt).getTime()-new Date(ln.updatedAt).getTime())),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[se]:ut.items.length>0?ut.items[ut.items.length-1].id:void 0},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[se]:ut.hasMore}}catch(ut){l("loadMoreSessions",ut);break}else await Yt(se);if($e-=1,Sn(se).length===vt&&e.sessionsCursorByWorkspace[se]===He)break}}async function Ue(){if(e.sessionsFullyLoaded)return;const se=await Oe().catch(Ce=>(gl("[kimi-web] loadAllSessions failed; search covers only loaded sessions",Ce),null));if(se===null)return;const xe=se.error===void 0?se.sessions:at(se.sessions);if(Ge(xe),e.sessionsFullyLoaded=se.error===void 0,se.error!==void 0)return;const J={};for(const Ce of e.workspaces)J[Ce.id]=!1;e.sessionsHasMoreByWorkspace=J}async function Lt(){const se=await _t().getMeta().catch(()=>null);se!==null&&(e.serverVersion=se.serverVersion,e.availableOpenInApps=se.openInApps,e.dangerousBypassAuth=se.dangerousBypassAuth,e.experimentalFlags=se.experimentalFlags,e.backend=se.backend)}async function gt(){const se=Date.now();let xe="accepted";bi("app:load:start"),e.loading=!0;const J=!ne.value;let Ce=!0;try{if(J&&await ze()==="server-auth-required"){Ce=!1,xe="auth-required";return}const $e=_t();await Promise.all([$e.getHealth().catch(()=>null),Lt(),r.loadModels()]),J||await Se(),await _e(),await wn();const He=await Bt(),vt=He??e.sessions;if(He!==void 0&&Ge(He),!J&&He!==void 0&&e.flatSessionsSeeded){e.flatSessionsSeeded=!1,e.flatSessionsNextPageToken=null,e.flatSessionsHasMore=!0,e.flatSessionsFrontier=null;try{await Cn()}catch(Ot){l("ensureFlatSessions",Ot)}}const ut=_E().filter(Ot=>!e.sessions.some(Pt=>Pt.id===Ot));if(ut.length>0){const Ot=await Promise.all(ut.map(Yn=>$s(Yn))),Pt=ut.filter((Yn,ko)=>Ot[ko]==="stale");Pt.length>0&&v(Pt)}const Dt=vt[0],Et=e.activeWorkspaceId;!(Et!==null&&D.value.some(Ot=>Ot.id===Et))&&Dt&&go(B(Dt)),Oo();const oo=typeof window<"u"?Qb(window.location):void 0;!e.activeSessionId&&oo!==void 0&&(e.sessions.some(Pt=>Pt.id===oo)||await no(oo))&&await vo(oo,{urlMode:"replace"}),!e.activeSessionId&&vt.length>0&&await vo(vt[0].id,{urlMode:"replace"})}catch($e){xe="failed",l("load",$e)}finally{e.loading=!1,Ce&&(ne.value=!0),bi("app:load:complete",{status:xe,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-se})}}async function wn(){try{const se=_t(),[xe,J]=await Promise.all([se.listWorkspaces().catch(()=>[]),se.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=yn(xe),e.fsHome=J.home||null,e.recentRoots=J.recentRoots}catch{}}function yn(se){const xe=lh();return Object.keys(xe).length===0?se:se.map(J=>{const Ce=xe[J.root];return Ce!==void 0?{...J,name:Ce}:J})}function go(se){e.activeWorkspaceId=se,K(se)}function qt(se){go(se);const xe=e.sessions.filter(J=>B(J)===se);if(xe.length>0){const J=xe[0];J&&J.id!==e.activeSessionId&&vo(J.id)}else k(void 0),Nn(void 0,"push")}function ps(se){const xe=lh()[se.root],J=xe!==void 0?{...se,name:xe}:se,Ce=Pr(J.root);e.hiddenWorkspaceRoots.some(vt=>Pr(vt)===Ce)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(vt=>Pr(vt)!==Ce),V(e.hiddenWorkspaceRoots));const $e=e.workspaces.findIndex(vt=>vt.id===J.id||vt.root===J.root);if($e===-1){e.workspaces=[J,...e.workspaces];return}const He=[...e.workspaces];He[$e]=J,e.workspaces=He}function xs(se){if(se.type==="workspaceCreated"||se.type==="workspaceUpdated"){ps(se.workspace);return}const xe=e.workspaces.find(Ce=>Ce.id===se.workspaceId)?.root??se.root;if(xe&&!e.hiddenWorkspaceRoots.includes(xe)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,xe],V(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Ce=>Ce.id!==se.workspaceId&&Ce.root!==xe),e.activeWorkspaceId===se.workspaceId||e.activeWorkspaceId===xe){const Ce=I.value[0]?.id??null;if(e.activeWorkspaceId=Ce,Ce)K(Ce);else try{ur(cn.activeWorkspace)}catch{}k(void 0),e.sessionLoading=!1,ge(),Nn(void 0,"replace")}}function _n(){k(void 0),Nn(void 0,"push")}function In(se){go(se),_n(),ge()}async function To(se){const xe=D.value.find(ln=>ln.id===se);if(!xe)return null;const J=e.thinking,Ce=_t();let $e,He=xe.root;try{const ln=await Ce.addWorkspace({root:xe.root});$e=ln.id,He=ln.root,ps(ln)}catch{}const vt=r.draftModel.value??void 0,ut=await Ce.createSession({workspaceId:$e,cwd:He,model:vt});r.draftModel.value=null;const Dt=vt!==void 0&&(!ut.model||ut.model.length===0)?{...ut,model:vt}:ut;f(Dt);const Et=ut.id;return J!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[Et]:J},k3(e,Et)),go(ut.workspaceId??$e??se),await vo(ut.id,{skipStatusRefresh:!0}),z.planMode&&(e.planModeBySession={...e.planModeBySession,[Et]:!0},O()),z.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Et]:!0},F()),z.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Et]:!0},U()),z.planMode=!1,z.swarmMode=!1,z.goalMode=!1,Et}async function lo(se,xe,J){if(cl.has(se))return null;cl.add(se);let Ce=null;try{const $e=await To(se);return $e?(Ce=$e,await Po($e,xe,J),$e):null}catch($e){return l("startSessionAndSendPrompt",$e),Ce}finally{cl.delete(se)}}async function St(se,xe,J,Ce){if(cl.has(se))return null;cl.add(se);let $e=null;try{const He=await To(se);if(!He)return null;$e=He;const vt=e.planModeBySession[He]??!1,ut=e.swarmModeBySession[He]??!1,Dt=e.sessions.find(Ot=>Ot.id===He),Et=(Dt?.model&&Dt.model.length>0?Dt.model:e.defaultModel)??void 0,ln=await r.resolveThinkingForPrompt(He,Et)??e.thinking;return await P({model:Et,planMode:vt,swarmMode:ut,permissionMode:e.permission,thinking:ln},He)&&await r.activateSkill(xe,J,Ce,He,{skipThinkingPersist:!0}),He}catch(He){return l("startSessionAndActivateSkill",He),$e}finally{cl.delete(se)}}async function hs(se,xe){if(cl.has(se))return null;cl.add(se);let J=null;try{const Ce=await To(se);return Ce?(J=Ce,await i.openSideChatOn(Ce,xe),Ce):null}catch(Ce){return l("startSessionAndOpenSideChat",Ce),J}finally{cl.delete(se)}}async function Jo(se){const xe=se.trim();if(!xe)return!1;const J=_t();try{const Ce=await J.addWorkspace({root:xe});return ps(Ce),In(Ce.id),!0}catch(Ce){return gl("[kimi-web] addWorkspaceByPath failed for",xe,Ce),!1}}async function uo(se){try{return await _t().browseFs(se)}catch{return{path:"",parent:null,entries:[]}}}async function Ys(){try{return await _t().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Nn(se,xe){if(xe==="none"||typeof window>"u"||!window.history)return;const J=fQ(se);if(window.location.pathname!==J)try{xe==="push"?window.history.pushState(null,"",J):window.history.replaceState(null,"",J)}catch{}}async function no(se){try{const xe=await _t().getSession(se);return e.sessions.some(J=>J.id===xe.id)||h(xe),!0}catch{return!1}}async function $s(se){try{const xe=await _t().getSession(se);return xe.archived?"stale":(e.sessions.some(J=>J.id===xe.id)||h(xe),"ok")}catch(xe){return Us(xe)&&xe.code===qhe?"stale":"retry"}}function Xs(){const se=Qb(window.location);if(se===void 0){k(void 0);return}if(se!==e.activeSessionId){if(e.sessions.some(xe=>xe.id===se)){vo(se,{urlMode:"none"});return}(async()=>{if(await no(se)){await vo(se,{urlMode:"none"});return}const xe=e.sessions[0];xe?await vo(xe.id,{urlMode:"replace"}):(k(void 0),Nn(void 0,"replace"))})()}}let ci=!1;function Oo(){ci||typeof window>"u"||(ci=!0,window.addEventListener("popstate",Xs))}async function vo(se,xe){if(!e.sessions.some($e=>$e.id===se)){const $e=++ye;if(!await no(se)||$e!==ye)return}const J=S(se),Ce=!J&&u.has(se);u.delete(se);try{Nn(se,xe?.urlMode??"push"),e.sessionLoading=!J&&!Ce,k(se),e.unreadBySession[se]&&(e.unreadBySession={...e.unreadBySession,[se]:!1},W({[se]:!1})),ge();const $e=e.sessions.find(He=>He.id===se);if($e){const He=B($e);e.activeWorkspaceId!==He&&go(He)}if(J){if(await x(se)==="not-found")return}else if(await g(se,{skipStatusRefresh:xe?.skipStatusRefresh===!0})==="not-found")return;fe(se,{skipStatus:xe?.skipStatusRefresh===!0})}catch($e){l("selectSession",$e,{sessionId:se})}finally{e.activeSessionId===se&&(e.sessionLoading=!1)}}async function Po(se,xe,J){const Ce=y8(se);e.inFlightBySession={...e.inFlightBySession,[se]:!0};const $e=b();let He=e.pendingThinkingBySession[se];try{const vt=_t(),ut=[];if(xe&&ut.push({type:"text",text:xe}),ut.push(...m8(J)),ut.length===0)return e.inFlightBySession={...e.inFlightBySession,[se]:!1},"rejected";const Dt={id:$e,sessionId:se,role:"user",content:ut,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};w(se,vs=>[...vs,Dt]);const Et=e.sessions.find(vs=>vs.id===se),ln=(Et?.model&&Et.model.length>0?Et.model:e.defaultModel)??void 0,oo=e.planModeBySession[se]??!1,Ot=e.swarmModeBySession[se]??!1,Pt=e.goalModeBySession[se]??!1;if(Pt&&xe)try{await vt.updateSession(se,{goalObjective:xe.trim()})}catch(vs){return vl(e,se,He)&&T(se),l("createGoal",vs,{sessionId:se}),e.inFlightBySession={...e.inFlightBySession,[se]:!1},w(se,Os=>Os.some(ei=>ei.id===$e)?Os.filter(ei=>ei.id!==$e):Os),"rejected"}const Yn=await r.resolveThinkingForPrompt(se,ln)??e.thinking;He=e.pendingThinkingBySession[se];const ko=await vt.submitPrompt(se,{content:ut,model:ln,thinking:Yn,permissionMode:e.permission,planMode:oo,swarmMode:Ot});return Yn!==void 0&&vl(e,se,He),Pt&&(e.goalModeBySession={...e.goalModeBySession,[se]:!1},U()),e.promptIdBySession={...e.promptIdBySession,[se]:ko.promptId},G(se,$e,ko.promptId,ko.userMessageId),_()?.bindNextPromptId(se,ko.promptId),"ok"}catch(vt){return e.inFlightBySession={...e.inFlightBySession,[se]:!1},w(se,ut=>ut.some(Dt=>Dt.id===$e)?ut.filter(Dt=>Dt.id!==$e||Dt.promptId!==void 0||Dt.userMessageId!==void 0):ut),vl(e,se,He)&&T(se),l("sendPrompt",vt,{sessionId:se}),Us(vt)?"rejected":"uncertain"}finally{k8(se,Ce)}}async function co(se,xe){const J=e.activeSessionId;if(J){if(a.value!=="idle"||e.inFlightBySession[J]){Qe(se,xe);return}if((e.queuedBySession[J]?.length??0)>0){Qe(se,xe),st(J);return}await Po(J,se,xe)}}async function Tn(se,xe){const J=e.activeSessionId;if(!J)return;const Ce=e.queuedBySession[J]??[],$e=[],He=[];for(const Pt of Ce){const Yn=Pt.text.trim();Yn&&$e.push(Yn),Pt.attachments?.length&&He.push(...Pt.attachments)}const vt=se.trim();if(vt&&$e.push(vt),xe?.length&&He.push(...xe),$e.length===0&&He.length===0)return;Ce.length>0&&(e.queuedBySession={...e.queuedBySession,[J]:[]});const ut=$e.join(`
328
+ `)}const Mx=cn.clientId,j0e="kimi-code-web",V0e="web";function q0e(){return{serverHttpUrl:Z0e(),clientId:Y0e(),clientName:j0e,clientVersion:X0e(),clientUiMode:V0e}}function K0e(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function Z0e(){const e=Y$();return h8(e||void 0)}const Tx="kimi-desktop-server-origin";function Y$(){if(typeof window>"u")return;const e=new URLSearchParams(window.location.search).get("kimi_origin");try{return e?(window.sessionStorage.setItem(Tx,e),e):window.sessionStorage.getItem(Tx)??void 0}catch{return e??void 0}}function h8(e){const t=e&&e.trim()?e:K0e(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function Ex(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function G0e(){if(typeof window<"u"){const t=Y$();if(t)return Ex(h8(t))}const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return Ex(e)}function Y0e(){const e=ui(Mx);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return Ls(Mx,t),t}function X0e(){return"0.35.0".trim()?"0.35.0":"0.0.0-dev"}const J0e={restRequest:e=>I0e(e),restResponse:e=>L0e(e),restFailure:e=>$0e(e),wsEvent:e=>{switch(e.kind){case"lifecycle":N0e(e.event,e.detail);break;case"in":R0e(e.frame);break;case"out":F0e(e.frame);break}},traceKeyEvent:(e,t)=>bi(e,t)},Q0e={getToken:eQ,markAuthRequired:sQ},ehe=(e,t)=>t===void 0?Hn.global.t(e):Hn.global.t(e,t);function the(){const e=q0e();return eY({origin:e.serverHttpUrl,identity:{clientId:e.clientId,clientName:e.clientName,clientVersion:e.clientVersion,clientUiMode:e.clientUiMode},tracer:J0e,credentialStore:Q0e,t:ehe})}const nhe=the();function _t(){return nhe}function ohe(e,t,n){return e==="idle"&&!t&&!n}function X$(e,t){const n=ui(e);return n===null?t:n==="1"}const Cg=Z(X$(cn.notifyEnabled,!0)),L5=Z(X$(cn.notifySound,!0)),$5=Z(typeof Notification<"u"?Notification.permission:"denied"),she="/favicon.ico";async function ihe(e){if(!e){Cg.value=!1,Ls(cn.notifyEnabled,"0");return}if(typeof Notification>"u")return;let t=Notification.permission;if(t==="default")try{t=await Notification.requestPermission()}catch{}$5.value=t,t==="granted"&&(Cg.value=!0,Ls(cn.notifyEnabled,"1"))}function rhe(e){L5.value=e,Ls(cn.notifySound,e?"1":"0")}function N5(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function lhe(e){return{title:Hn.global.t("settings.notifyTitle"),body:N5(e,Hn.global.t("settings.notifyFallback"))}}function ahe(e,t){return{title:Hn.global.t("settings.notifyQuestionTitle"),body:N5(t,e,Hn.global.t("settings.notifyQuestionFallback"))}}function uhe(e,t){return{title:Hn.global.t("settings.notifyApprovalTitle"),body:N5(t,e,Hn.global.t("settings.notifyApprovalFallback"))}}function F5(e,t,n){if(!Cg.value||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(s=>{$5.value=s,s==="granted"&&Ix(e,t,n)});return}Ix(e,t,n)}}function Ix(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:she,silent:!L5.value});o.onclick=()=>{try{window.kimiDesktop?.showWindow?.(),window.focus()}catch{}e.onClick(),o.close()}}catch{}}function che(e,t){F5(t,lhe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function dhe(e){F5(e,ahe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function fhe(e){F5(e,uhe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function phe(){return{notifyEnabled:Cg,notifySound:L5,notifyPermission:$5,setNotifyEnabled:ihe,setNotifySound:rhe,maybeNotifyCompletion:che,maybeNotifyQuestion:dhe,maybeNotifyApproval:fhe}}const hhe=1e3,mhe=4096,Lx=32*1024;function ghe(e,t){let n=null,o;const s=new Set;async function i(f){try{const m=await _t().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:nC(m,e.tasksBySession[f]??[])},await r(f,m)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const m=h??e.tasksBySession[f]??[],v=_t(),k=new Map;if(await Promise.all(m.map(async b=>{if((b.status==="completed"||b.status==="failed"||b.status==="cancelled")&&!s.has(b.id)&&!((b.outputLines?.length??0)>0))try{const g=await v.getTask(f,b.id,{withOutput:!0,outputBytes:Lx});g.outputPreview!==void 0&&k.set(b.id,{preview:g.outputPreview,bytes:g.outputBytes}),s.add(b.id)}catch{}})),k.size===0)return;const w=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:w.map(b=>{const _=k.get(b.id)??(b.backgroundTaskId!==void 0?k.get(b.backgroundTaskId):void 0);return _?{...b,outputPreview:_.preview,outputBytes:_.bytes}:b})}}async function l(f){if(e.activeSessionId!==f)return;const h=_t();let m;try{m=await h.listTasks(f)}catch{return}const v=new Map;await Promise.all(m.map(async _=>{const g=_.status==="running",x=_.status==="completed"||_.status==="failed"||_.status==="cancelled";if(!(!g&&!x)&&!(x&&(s.has(_.id)||(_.outputLines?.length??0)>0)))try{const S=await h.getTask(f,_.id,{withOutput:!0,outputBytes:g?mhe:Lx});S.outputPreview!==void 0&&v.set(_.id,{preview:S.outputPreview,bytes:S.outputBytes}),x&&s.add(_.id)}catch{}}));const k=e.tasksBySession[f]??[],w=new Map(k.map(_=>[_.id,_])),b=m.map(_=>{const g=w.get(_.id),x=v.get(_.id);return{..._,outputLines:g?.outputLines,text:g?.text,outputPreview:x?.preview??g?.outputPreview,outputBytes:x?.bytes??g?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:nC(b,k)}}function a(f){n!==null&&o===f||(u(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):u())},hhe))}function u(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const c=Z(0);let d=null;return Je(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{c.value=(c.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Je(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(m=>m.status==="running")}},({sid:f,hasRunning:h},m,v)=>{let k;h&&f!==void 0?a(f):f!==void 0?k=setTimeout(()=>{(e.tasksBySession[f]??[]).some(b=>b.status==="running")||u()},1500):u(),v(()=>{k!==void 0&&clearTimeout(k)})},{deep:!0,immediate:!0}),{taskClock:R(()=>c.value),loadTasksForSession:i}}function m8(e){const t=[];for(const n of e??[])n.kind==="video"?t.push({type:"video",source:{kind:"file",fileId:n.fileId}}):n.kind==="file"?t.push({type:"file",fileId:n.fileId,name:n.name??"",mediaType:n.mediaType||"application/octet-stream",size:n.size??0}):t.push({type:"image",source:{kind:"file",fileId:n.fileId}});return t}const vhe=640,yhe=`(max-width: ${vhe}px)`;function khe(){const e=Z(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(yhe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),bn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),bn(()=>t.removeListener(n))),e}const J$=Z(typeof window>"u"?0:window.innerWidth);let Ih=0,wg=!1;function g8(){J$.value=window.innerWidth}function bhe(){wg||typeof window>"u"||(window.addEventListener("resize",g8),wg=!0,g8())}function Che(){!wg||typeof window>"u"||(window.removeEventListener("resize",g8),wg=!1)}function Q$(e,t,n){return Math.max(t,e-n)}function v8(e,t,n){return Math.min(n,Math.max(t,e))}function eN(){return dn(()=>{Ih+=1,bhe()}),Vn(()=>{Ih=Math.max(0,Ih-1),Ih===0&&Che()}),{viewportWidth:J$}}const whe=24;function _he(e){const t=Z(null),n=Z(!0);let o=null,s=null,i=null,r=0,l=0,a=!1,u=0;function c(){const k=t.value;k&&(k.scrollTop=Math.max(k.scrollTop,r))}function d(){const w=t.value?.firstElementChild??null;w!==i&&(i&&o?.unobserve(i),i=w,w&&o?.observe(w))}function f(){const k=t.value;!k||a||(n.value=r-k.scrollTop-l<whe)}function h(k){k!==u||!a||(a=!1,f())}function m(){n.value=!1,a=!0;const k=++u;if(typeof requestAnimationFrame!="function"){queueMicrotask(()=>h(k));return}requestAnimationFrame(()=>{requestAnimationFrame(()=>h(k))})}function v(){const k=t.value;k&&(o?.disconnect(),s?.disconnect(),i=null,a=!1,u++,r=0,l=0,typeof ResizeObserver=="function"?(o=new ResizeObserver(()=>{const w=t.value;if(!w)return;const{scrollHeight:b,clientHeight:_}=w,g=b>r+1,x=_<l-1;if(r=b,l=_,a){h(u);return}n.value&&(g||x)&&c()}),o.observe(k),d()):(r=k.scrollHeight,l=k.clientHeight,c()),typeof MutationObserver=="function"&&(s=new MutationObserver(d),s.observe(k,{childList:!0})))}return Je(e,()=>{n.value=!0,yt(v)}),Je(t,()=>void yt(v)),dn(()=>void yt(v)),bn(()=>{u++,o?.disconnect(),s?.disconnect()}),{scroller:t,following:n,onScroll:f,pinScroll:m}}function xhe(e){try{const t=ui(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function $x(e,t){try{Ls(e,String(t))}catch{}}function She(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1,axis:r="x",applyLive:l}=e;function a(D){return Number.isFinite(D)?Math.min(Rh(s),Math.max(o,Math.round(D))):n}const u=Z(a(xhe(t)??n)),c=Z(!1);function d(D){const I=D<=o,$=D>=Rh(s),B=r==="x"?"col-resize":"row-resize";if(I&&$)return B;const[H,O]=r==="x"?["e-resize","w-resize"]:["s-resize","n-resize"];return $?i?H:O:I?i?O:H:B}const f=Z(null),h=R(()=>d(f.value??u.value));function m(D){typeof document>"u"||(document.body.style.cursor=d(D))}function v(D){const I=a(D);u.value=I,$x(t,I)}Je(()=>Rh(s),D=>{!c.value&&u.value>D&&v(D)});let k=0,w=0,b=null,_=-1,g=0,x=0,S=0;function T(){if(x=0,!c.value)return;const D=g-k;S=a(w+(i?-D:D)),f.value=S,m(S),l?l(S):u.value=S}function A(D){if(c.value&&(g=r==="x"?D.clientX:D.clientY,x===0)){if(typeof requestAnimationFrame!="function"){T();return}x=requestAnimationFrame(T)}}function E(){if(c.value){if(x!==0&&(cancelAnimationFrame(x),T()),c.value=!1,l?v(S):$x(t,u.value),f.value=null,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),b){try{b.releasePointerCapture(_)}catch{}b.removeEventListener("pointermove",A),b.removeEventListener("pointerup",E),b.removeEventListener("pointercancel",E)}b=null,_=-1}}function P(D){D.preventDefault(),c.value=!0,k=r==="x"?D.clientX:D.clientY,w=a(u.value),S=w,b=D.currentTarget,_=D.pointerId,typeof document<"u"&&(document.body.style.userSelect="none"),m(w);try{b.setPointerCapture(_)}catch{}b.addEventListener("pointermove",A),b.addEventListener("pointerup",E),b.addEventListener("pointercancel",E)}return Vn(E),{width:u,dragging:c,cursor:h,clamp:a,setWidth:v,onPointerDown:P}}const Hr=Z(null),Zd=Z(!1),Ahe=R(()=>Hr.value!==null);function R5(e){const t=Hr.value;!t||Zd.value||(Hr.value=null,t.resolve(e))}async function Mhe(){const e=Hr.value;if(!(!e||Zd.value)){if(!e.action){R5(!0);return}Zd.value=!0;try{await e.action(),Hr.value===e&&(Hr.value=null),e.resolve(!0)}catch(t){Hr.value===e&&(Hr.value=null),e.reject(t)}finally{Zd.value=!1}}}function The(e){return Zd.value?Promise.resolve(!1):(Hr.value&&R5(!1),new Promise((t,n)=>{Hr.value={...e,resolve:t,reject:n}}))}function hu(){return{current:Hr,busy:Zd,isConfirmOpen:Ahe,confirm:The,settle:R5,runAction:Mhe}}function Ehe(e){const{sessionId:t}=e;function n(u){return ui(eC(u))??""}function o(u,c){const d=eC(u);c?Ls(d,c):ur(d)}const s=Z(n(t())),i=Z(null);function r(){const u=i.value;u&&(u.style.height="auto",u.style.height=`${u.scrollHeight}px`)}Je(s,u=>{yt(r),o(t(),u)}),Je(t,(u,c)=>{u!==c&&(o(c,s.value),s.value=n(u),yt(r))});function l(u){s.value=u,yt(()=>{const c=i.value;if(!c)return;c.focus();const d=u.length;c.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function Ihe(e){return e?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable===!0:!1}function Lhe(e){const{sessionId:t,mobile:n,starting:o,dockedComposer:s,emptyComposer:i}=e,r=Z(!1);Je(t,()=>{n()||(r.value=!0)}),Je([r,s,i,o],()=>{if(!r.value)return;const l=s.value??i.value;if(!l)return;const a=typeof document<"u"?document.activeElement:null;if(Ihe(a)){r.value=!1;return}l.focus(),(typeof document>"u"||document.activeElement!==a)&&(r.value=!1)},{flush:"post"})}const _g=100;function $he(e){const t=y1(cn.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>_g?n.slice(-_g):n,s={[e]:o};return Tc(cn.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function Nhe(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=Z($he(s())),r=R(()=>i.value[s()??""]??[]);let l=-1,a="";function u(w){const b=s();if(l=-1,!b)return;const _=w.trim();if(!_)return;const g=i.value[b]??[];if(g.at(-1)===_)return;const x=[...g,_],S=x.length>_g?x.slice(-_g):x;i.value={...i.value,[b]:S},Tc(cn.inputHistory,i.value)}function c(){const w=n.value;return w?(w.selectionStart??0)===0:!1}function d(w){t.value=w,yt(()=>{const b=n.value;if(!b)return;o();const _=w.length;b.setSelectionRange(_,_)})}function f(){const w=r.value;if(w.length!==0){if(l===-1)a=t.value,l=w.length-1;else if(l>0)l-=1;else return;d(w[l])}}function h(){if(l===-1)return;const w=r.value;l<w.length-1?(l+=1,d(w[l])):(l=-1,d(a))}function m(){l=-1}function v(){return l!==-1}function k(){return r.value.length>0}return Je(s,()=>{l=-1}),{push:u,caretAtTextStart:c,recallOlder:f,recallNewer:h,resetBrowsing:m,isBrowsing:v,hasHistory:k}}function Fhe(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=Z(!1),u=Z([]),c=Z(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(u.value=mQ(h,CE(s())),c.value=0,a.value=u.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,yt(()=>{const m=n.value;if(!m)return;const v=t.value.length;m.setSelectionRange(v,v),m.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:u,active:c,update:d,select:f}}function Rhe(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=Z(!1),r=Z([]),l=Z(0),a=Z(!1);let u=null;function c(){const h=t.value,m=n.value?.selectionStart??h.length;let v=m-1;for(;v>=0&&!/\s/.test(h[v]);)v--;v++;const k=h.slice(v,m);return k.startsWith("@")?{token:k.slice(1),start:v,end:m}:null}function d(){const h=c(),m=s();if(u!==null&&clearTimeout(u),!h||!m||h.token.length===0){i.value=!1,a.value=!1;return}const v=h.token;u=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;const k=()=>{const w=c();return w!==null&&w.token===v&&i.value};try{const w=await m(v);k()&&(r.value=w)}catch{k()&&(r.value=[])}finally{k()&&(a.value=!1)}},200)}function f(h){const m=c();if(!m)return;const v=t.value;t.value=v.slice(0,m.start)+h.path+v.slice(m.end),i.value=!1,yt(()=>{const k=n.value;if(!k)return;const w=m.start+h.path.length;k.setSelectionRange(w,w),k.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}const Ohe="kimi-web.file-preview-width",gd=320;function Phe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=eN(),i=R(()=>Math.max(0,s.value-t.value)),r=R(()=>Q$(i.value,gd,gd));function l(Y){return v8(Math.round(Y),gd,r.value)}function a(){return l(i.value/2)}const u=R(()=>a()),c=Z(u.value),d=R(()=>v8(c.value,gd,r.value)),f=Z(null),h=R(()=>{const Y=f.value;if(!Y)return null;const fe=e.turns.value.find(we=>we.id===Y.turnId);return fe?.role==="compaction"&&fe.text?fe.text:null}),m=R(()=>h.value!==null);function v(Y){if(f.value?.turnId===Y.turnId){f.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",f.value=Y}function k(){f.value=null,n.value==="compaction"&&(n.value=null)}const w=Z(null),b=R(()=>{const Y=w.value;if(!Y)return{entry:void 0,version:0};const fe=e.auxiliaryTranscripts.getEntry(Y.sessionId,Y.subagentId);return{entry:fe,version:fe?.version.value??0}});function _(Y){const fe=e.turns.value.flatMap(we=>we.tools??[]).find(we=>we.agentId===Y);if(!fe)return{};try{const we=JSON.parse(fe.arg);return{name:typeof we.description=="string"?we.description:void 0,subagentType:typeof we.subagent_type=="string"?we.subagent_type:void 0,status:fe.status,outputLines:fe.output}}catch{return{}}}const g=R(()=>{const Y=w.value;if(!Y)return null;const fe=e.activeAppTasks.value.find(Fe=>Fe.agentId===Y.subagentId||Fe.id===Y.subagentId);if(fe)return UY(fe);const we=b.value.entry?.channel,ge=we?.agents.find(Fe=>Fe.agentId===Y.subagentId),Q=we?.refreshError??!1,te=we===void 0||we.loading,ce=we?.snapshot.meta.activity==="turn",ue=_(Y.subagentId),Se=we?.snapshot.items.findLast(Fe=>Fe.kind==="turn"),ze=Se?.kind==="turn"&&Se.state==="cancelled",_e=Se?.kind==="turn"&&Se.state==="failed"||ue.status==="error",Ee=ce?"working":_e||ze?"failed":te?"queued":Q&&ue.status===void 0?"failed":"completed",it=ce?"running":ze?"cancelled":_e?"failed":te?"running":Q&&ue.status===void 0?"failed":"completed";return{id:Y.subagentId,name:ge?.label??ue.name??Y.subagentId,subagentType:ue.subagentType??(ge?.type==="sub"?"subagent":ge?.type),phase:Ee,status:it,outputLines:ue.outputLines}}),x=R(()=>{const Y=b.value.entry;if(!Y)return[];const fe=w.value,we=Y.channel.agents.find(ge=>ge.agentId===fe?.subagentId);return nX(Y.channel.snapshot,e.getFileUrl,we)}),S=R(()=>b.value.entry?.channel.loading??!1),T=R(()=>b.value.entry?.channel.refreshError??!1),A=R(()=>b.value.entry?.channel.loadingOlder??!1),E=R(()=>b.value.entry?.channel.loadOlderError??!1),P=R(()=>b.value.entry?.channel.snapshot.hasMoreOlder??!1),D=R(()=>b.value.entry?.channel.snapshot.meta.activity==="turn"),I=R(()=>g.value!==null);function $(Y){const fe=e.activeSessionId.value;if(!(!Y||!fe)){if(n.value==="agent"&&w.value?.sessionId===fe&&w.value.subagentId===Y){B();return}w.value={sessionId:fe,subagentId:Y},n.value="agent",e.auxiliaryTranscripts.activate(fe,Y)}}function B(){const Y=w.value;Y&&e.auxiliaryTranscripts.deactivate(Y.sessionId,Y.subagentId),w.value=null,n.value==="agent"&&(n.value=null)}Je(n,(Y,fe)=>{if(fe!=="agent"||Y==="agent")return;const we=w.value;we&&e.auxiliaryTranscripts.deactivate(we.sessionId,we.subagentId)});function H(){const Y=b.value.entry;Y&&Y.channel.loadOlder().catch(()=>{})}const O=Z("list"),F=Z(null);function U(){if(n.value==="diff"){z();return}n.value="diff",O.value="list",F.value=null,e.loadGitStatus(e.activeSessionId.value)}function z(){n.value==="diff"&&(n.value=null),O.value="list",F.value=null,e.clearFileDiff()}async function W(Y){O.value="detail",F.value=Y,await e.loadFileDiff(Y)}const K=Xr(null);function V(Y){if(K.value===Y&&n.value==="turn-diff"){ie();return}K.value=Y,n.value="turn-diff"}function ie(){K.value=null,n.value==="turn-diff"&&(n.value=null)}async function ne(Y){if(!e.activeSessionId.value&&e.activeWorkspaceId.value){const fe=await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,Y);return n.value="btw",fe}return await e.openSideChat(Y),n.value="btw",null}function X(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function le(){n.value==="btw"&&(n.value=null)}const Ie=R(()=>e.sideChatVisible.value),de=R(()=>n.value!==null&&(n.value!=="compaction"||m.value)&&(n.value!=="agent"||I.value)&&(n.value!=="btw"||Ie.value)),pe=Z(!1),ve=Z({});function oe(){switch(n.value){case"compaction":return f.value?{kind:"compaction",...f.value}:null;case"agent":return w.value?{kind:"agent",...w.value}:null;case"btw":return{kind:"btw"};default:return null}}function ye(Y){if(Y)switch(Y.kind){case"compaction":f.value={turnId:Y.turnId},n.value="compaction";break;case"agent":e.activeSessionId.value&&(w.value={sessionId:e.activeSessionId.value,subagentId:Y.subagentId},n.value="agent",e.auxiliaryTranscripts.activate(e.activeSessionId.value,Y.subagentId));break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function G(){return n.value==="compaction"&&m.value?(k(),!0):n.value==="agent"&&I.value?(B(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(z(),!0):n.value==="turn-diff"?(ie(),!0):n.value==="btw"?(X(),!0):!1}return Je(e.activeSessionId,(Y,fe)=>{if(fe){const we=oe();we?ve.value[fe]=we:delete ve.value[fe]}o(),k(),B(),z(),ie(),le(),Y&&ye(ve.value[Y])}),{PREVIEW_WIDTH_KEY:Ohe,PREVIEW_MIN:gd,previewDefaultWidth:u,previewMax:r,previewWidth:c,previewPanelWidth:d,compactionPanelText:h,compactionPanelVisible:m,openCompactionPanel:v,closeCompactionPanel:k,agentPanelMember:g,agentPanelTurns:x,agentPanelLoading:S,agentPanelLoadError:T,agentPanelLoadingMore:A,agentPanelLoadMoreError:E,agentPanelHasMore:P,agentPanelRunning:D,agentPanelVisible:I,openAgentPanel:$,closeAgentPanel:B,loadOlderAgentMessages:H,detailDiffMode:O,detailDiffPath:F,openDiffDetail:U,closeDiffDetail:z,selectDiffFile:W,turnDiffChange:K,openTurnDiff:V,closeTurnDiff:ie,btwVisible:Ie,openSideChatTab:ne,closeSideChat:X,hideSideChatPanel:le,sidePanelVisible:de,panelDragging:pe,closeOpenSidePanel:G}}const Dhe=cn.sidebarWidth,Nx=cn.sidebarCollapsed,Fx=270,v4=220,Bhe=480,Hhe=320;function zhe(e={}){const{viewportWidth:t}=eN(),n=Z(Fx),o=Z(!1),s=Z(!1),i=R(()=>{const c=Hhe+(Rh(e.previewOpen)?gd:0);return Math.min(Bhe,Q$(t.value,v4,c))}),r=R(()=>v8(n.value,v4,i.value));function l(){try{o.value=ui(Nx)==="true"}catch{o.value=!1}}function a(){try{Ls(Nx,String(o.value))}catch{}}function u(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:Dhe,SIDEBAR_DEFAULT:Fx,SIDEBAR_MIN:v4,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:u}}const Whe=40409;function Rx(e){return Us(e)&&e.code===Whe}function Ox(e){return e.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith("\\\\")}function Px(e){if(e.startsWith("\\\\"))return e;const t=/^[a-zA-Z]:/.test(e)?e.slice(0,2):"",n=[];for(const o of e.slice(t.length).split(/[\\/]+/))if(!(!o||o===".")){if(o===".."){n.pop();continue}n.push(o)}return t?`${t}/${n.join("/")}`:`/${n.join("/")}`}function Uhe({client:e,detailTarget:t,t:n}){const o=Z(null),s=Z(null),i=Z(!1),r=Z(null),l=Z(null);let a=0;const u=R(()=>{const g=l.value;return g?e.getFileDownloadUrl(g):null}),c=R(()=>o.value!==null&&l.value!==null);function d(g){return g.length>1?g.replace(/\/+$/,""):g}function f(g){const x=h2(g,e.status.value.cwd);return x===null||x.split(/[\\/]+/).includes("..")?null:h(x)||null}function h(g){const x=[];for(const S of g.split(/[\\/]+/))if(!(!S||S===".")){if(S===".."){x.pop();continue}x.push(S)}return x.join("/")}function m(g){const x=g.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const S=d(e.status.value.cwd);if(x.startsWith("/")){if(!S||x!==S&&!x.startsWith(`${S}/`))return{error:n("filePreview.errors.outsideWorkspace")};const A=x===S?"":x.slice(S.length+1);if(A.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const E=h(A);return E?{path:E}:{error:n("filePreview.errors.isDirectory")}}if(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const T=h(x);return T?{path:T}:{error:n("filePreview.errors.emptyPath")}}async function v(g){const x=o.value;if(t.value==="file"&&x&&x.path===g.path&&x.line===g.line){w();return}const S=++a;if(t.value="file",s.value=null,r.value=null,i.value=!0,o.value=g,l.value=null,typeof g.content=="string"){i.value=!1,s.value={path:g.path,content:g.content,encoding:"utf-8",mime:"text/markdown",isBinary:!1,size:g.content.length};return}if(!Ox(g.path)&&g.path.split(/[\\/]+/).includes("..")){const A=d(e.status.value.cwd);A&&(g={...g,path:Px(`${A}/${g.path}`)})}if(Ox(g.path)){g={...g,path:Px(g.path)};const A=f(g.path);if(A!==null)g={...g,path:A};else{try{const E=await e.readHostFileContent(g.path);if(S!==a)return;l.value=null,s.value={path:g.path,content:E.content,encoding:E.encoding,mime:E.mime,isBinary:E.isBinary,size:E.size}}catch(E){if(S!==a)return;r.value=Rx(E)?n("filePreview.errors.notFound"):pU(E)?n("filePreview.errors.tooLarge"):E instanceof Error?E.message:n("filePreview.errors.loadFailed")}finally{S===a&&(i.value=!1)}return}}const T=m(g.path);if("error"in T){i.value=!1,r.value=T.error;return}l.value=T.path;try{const A=await e.readFileContent(T.path);if(S!==a)return;A?s.value={...A,path:A.path||T.path}:r.value=n("filePreview.errors.loadFailed")}catch(A){if(S!==a)return;r.value=Rx(A)?n("filePreview.errors.notFound"):A instanceof Error?A.message:n("filePreview.errors.loadFailed")}finally{S===a&&(i.value=!1)}}function k(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1}function w(){k(),t.value==="file"&&(t.value=null)}Je(t,(g,x)=>{x==="file"&&g!=="file"&&k()});function b(){const g=s.value?.path??o.value?.path;g&&e.openWorkspaceFile(g,o.value?.line)}function _(){const g=s.value?.path??o.value?.path;g&&e.revealWorkspaceFile(g)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:u,previewExternalActions:c,openFilePreview:v,closeFilePreview:w,openPreviewInEditor:b,revealPreviewFile:_}}function jhe({running:e,title:t="Kimi Code"}){if(Wp){I4(()=>{typeof document<"u"&&(document.title=t)});return}const n=["◐","◓","◑","◒"],o=Z(0);let s=null;function i(){s===null&&(o.value=0,s=setInterval(()=>{o.value=(o.value+1)%n.length},250))}function r(){s!==null&&(clearInterval(s),s=null),o.value=0}Je(e,a=>{a?i():r()},{immediate:!0});const l=R(()=>`${e.value?`${n[o.value]} `:""}${t}`);I4(()=>{typeof document<"u"&&(document.title=l.value)}),bn(()=>{r()})}const Vhe=50,am=5,O5=5,xg=50,qhe=40401,Khe=40402,Zhe=40410,Ghe=40409,Yhe=40902,Xhe=2e3,Jhe=10;function y4(e){return Us(e)&&e.code===Yhe}const Qhe=40904;function eme(e){return Us(e)&&e.code===Qhe}const Hu=Go({}),Lh=Go({}),k4=Go({}),cl=Go(new Set),N2=new Map,wc=new Map,Sg=new Map;let tme=0;const ju=new Map,nme=3;let Dx=0;function ome(){return Dx+=1,`${Date.now().toString(36)}-${Dx}`}function sme(e){return{generation:N2.get(e)??0,pending:(wc.get(e)?.size??0)>0}}function y8(e){const t=++tme;N2.set(e,t);const n=wc.get(e)??new Set;return n.add(t),wc.set(e,n),t}function k8(e,t){const n=wc.get(e);if(n===void 0||(n.delete(t),n.size>0))return;wc.delete(e);const o=Sg.get(e);Sg.delete(e),o?.()}function ime(e){N2.delete(e),wc.delete(e),Sg.delete(e),ju.delete(e)}function rme(e,t){return!t.pending&&t.generation===(N2.get(e)??0)}function lme(e,t){if((wc.get(e)?.size??0)===0){t();return}Sg.set(e,t)}function ame(e,t){const{t:n}=Hn.global,{confirm:o}=hu(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:u,setSessions:c,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:m,unpinSessions:v,setActiveSessionId:k,updateSessionMessages:w,nextOptimisticMsgId:b,getEventConn:_,syncSessionFromSnapshot:g,reopenSession:x,hasLoadedMessages:S,refreshSessionStatus:T,refreshSessionGoal:A,refreshSessionPlans:E,persistSessionProfile:P,mergedWorkspaces:D,workspacesView:I,status:$,workspaceIdForSession:B,savePermissionToStorage:H,savePlanModeToStorage:O,saveSwarmModeToStorage:F,saveGoalModeToStorage:U,draftModes:z,saveUnread:W,saveActiveWorkspaceToStorage:K,saveHiddenWorkspacesToStorage:V,goalErrorMessage:ie,initialized:ne,connectIssue:X,selectedDiffPath:le,fileDiffLines:Ie,fileDiffLoading:de,fileDiffTexts:pe,fileDiffEmptyFile:ve}=t;let oe=!1,ye=0;function G(se,xe,J,Ce){w(se,$e=>{const He=$e.findIndex(Et=>Et.id===xe);if(He===-1)return $e;const vt=$e.findIndex((Et,ln)=>ln!==He&&Et.role==="user"&&(Et.id===Ce||Et.userMessageId===Ce||Et.promptId===J)),ut=$e[He],Dt=vt===-1?ut:$e[vt];return $e.flatMap((Et,ln)=>ln===vt?[]:ln!==He?[Et]:[{...Dt,id:ut.id,promptId:J,userMessageId:Ce,metadata:{...Dt.metadata,...ut.metadata}}])})}async function Y(se){if(e.messagesLoadingMoreBySession[se])return;const xe=e.messagesBySession[se];if(!xe||xe.length===0)return;const J=xe[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[se]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[se]:!1};try{const Ce=await _t().listMessages(se,{beforeId:J,pageSize:Vhe}),$e=[...Ce.items].reverse();w(se,He=>[...$e,...He]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[se]:Ce.hasMore}}catch(Ce){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[se]:!0},l("loadOlderMessages",Ce,{sessionId:se})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[se]:!1}}}function fe(se,xe){s.loadTasksForSession(se),Q(se),xe?.skipStatus!==!0&&T(se),A(se),E(se),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,se)||r.loadSkillsForSession(se)}async function we(se){const xe=e.activeSessionId;if(xe){le.value=se,Ie.value=[],pe.value=null,ve.value=!1,de.value=!0;try{const Ce=await _t().getFileDiff(xe,se);if(le.value!==se||e.activeSessionId!==xe)return;const $e=wX(Ce.diff);if(Ie.value=$e,$e.length===0){const vt=await Ei(se).catch(()=>null);if(le.value!==se||e.activeSessionId!==xe)return;ve.value=vt!==null&&vt.size===0;return}de.value=!1;const He=await cX($e,{truncated:Ce.truncated,readNewText:async()=>{const vt=await Ei(se).catch(()=>null);return!vt||vt.isBinary||vt.encoding!=="utf-8"?null:vt.content}});if(le.value!==se||e.activeSessionId!==xe)return;pe.value=He}catch(J){le.value===se&&(Ie.value=[]),gl("[loadFileDiff] diff unavailable for",se,J)}finally{le.value===se&&(de.value=!1)}}}function ge(){le.value=null,Ie.value=[],pe.value=null,ve.value=!1,de.value=!1}async function Q(se){try{const J=await _t().getGitStatus(se);e.gitStatusBySession={...e.gitStatusBySession,[se]:J}}catch{}}let te=0;async function ce(se){try{const xe=await _t().getUserInfo();if(se!==te||e.managedProviderStatus!=="authenticated")return;e.managedUserInfo=xe.kind==="ok"?xe.userInfo:null,xe.kind==="ok"?e.managedMembership=xe.userInfo.userLevel===Jhe?"free":"member":e.managedMembership=xe.status===402?"free":null}catch{if(se!==te)return;e.managedProviderStatus==="authenticated"&&(e.managedUserInfo=null,e.managedMembership=null)}}async function ue(){e.managedProviderStatus==="authenticated"&&await ce(++te)}async function Se(){const se=++te;try{const J=await _t().getAuth();return e.authReady=J.ready,e.defaultModel=J.defaultModel,e.managedProviderStatus=J.managedProvider?.status??null,e.managedProviderStatus==="authenticated"?ce(se):(e.managedUserInfo=null,e.managedMembership=null),X.value=null,"proceed"}catch(xe){return Us(xe)&&(xe.code===401||xe.code===PM)?(X.value=null,"server-auth-required"):(X.value=(xe instanceof Error?xe.message:String(xe)).slice(0,140),"retry")}}async function ze(){let se=!0;for(;;){const xe=await Se();if(xe!=="retry")return xe;se&&(X.value=null,se=!1),await new Promise(J=>{setTimeout(J,Xhe)})}}async function _e(){try{const se=_t();e.config=await se.getConfig()}catch{}}async function Ee(se){try{const J=await _t().setConfig(se);return e.config=J,e.defaultModel=J.defaultModel??null,!0}catch(xe){return l("setConfig",xe),!1}}const it=100,Fe=720*60*1e3;async function Oe(se){const xe=_t(),J=[];let Ce,$e;for(;se?.shouldContinue?.()!==!1;){let He;try{He=await xe.listSessions({pageSize:it,beforeId:Ce,excludeEmpty:!0})}catch(vt){if(J.length===0)throw vt;$e=vt;break}if(J.push(...He.items),!He.hasMore||He.items.length===0)break;Ce=He.items[He.items.length-1].id}return{sessions:J,error:$e}}function Ge(se){const xe=new Map(e.sessions.map(J=>[J.id,J]));c(se.map(J=>{const Ce=xe.get(J.id);if(Ce===void 0)return J;const $e=o3(J.usage)&&!o3(Ce.usage),He=J.pullRequest??Ce.pullRequest;return!$e&&He===J.pullRequest?J:{...J,usage:$e?Ce.usage:J.usage,pullRequest:He}}))}function at(se){const xe=[...se],J=new Set(xe.map(Ce=>Ce.id));for(const Ce of e.sessions)J.has(Ce.id)||(xe.push(Ce),J.add(Ce.id));return xe.sort((Ce,$e)=>new Date($e.updatedAt).getTime()-new Date(Ce.updatedAt).getTime()),xe}async function Tt(se){const xe=_t(),J=[],Ce=Date.now(),$e=Et=>Ce-new Date(Et.updatedAt).getTime();let He,vt=!1,ut=!0,Dt;for(;;){let Et;try{Et=await xe.listSessions({workspaceId:se,pageSize:am,beforeId:He,excludeEmpty:!0})}catch(Ot){if(ut)throw Ot;Dt=Ot,vt=!0;break}if(vt=Et.hasMore,Et.items.length===0)break;const ln=Et.items[Et.items.length-1],oo=$e(ln)>=Fe;if(!ut&&oo){const Ot=Et.items.findIndex(Yn=>$e(Yn)>=Fe),Pt=Ot>=0?Ot+1:Et.items.length;J.push(...Et.items.slice(0,Pt)),vt=Et.hasMore||Pt<Et.items.length;break}if(J.push(...Et.items),ut=!1,!Et.hasMore||oo)break;He=ln.id}return{workspaceId:se,page:{items:J,hasMore:vt},error:Dt}}async function Bt(){const se=e.workspaces;if(se.length===0){const Ot=await Oe(),Pt=Ot.error===void 0?Ot.sessions:at(Ot.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=Ot.error===void 0,Ot.error!==void 0&&l("load",Ot.error),Pt}const xe=await Promise.allSettled(se.map(Ot=>Tt(Ot.id))),J=[],Ce=new Set,$e=new Map,He=new Set;let vt;for(let Ot=0;Ot<xe.length;Ot++){const Pt=xe[Ot];if(Pt.status==="fulfilled"){$e.set(Pt.value.workspaceId,Pt.value.page),Pt.value.error!==void 0&&(He.size===0&&(vt=Pt.value.error),He.add(Pt.value.workspaceId));for(const Yn of Pt.value.page.items)Ce.has(Yn.id)||(J.push(Yn),Ce.add(Yn.id));continue}He.size===0&&(vt=Pt.reason),He.add(se[Ot].id)}if($e.size===0){l("load",vt);return}const ut=new Set(se.filter(Ot=>He.has(Ot.id)).map(Ot=>Ot.root)),Dt=new Set(se.map(Ot=>Ot.id));for(const Ot of e.sessions)!(Ot.workspaceId!==void 0&&Dt.has(Ot.workspaceId)?He.has(Ot.workspaceId):ut.has(Ot.cwd)||He.has(B(Ot)))||Ce.has(Ot.id)||(J.push(Ot),Ce.add(Ot.id));const Et={},ln={},oo={};for(const{id:Ot}of se){const Pt=$e.get(Ot);if(Pt===void 0){const Yn=e.sessionsHasMoreByWorkspace[Ot],ko=e.sessionsCursorByWorkspace[Ot],vs=e.sessionsInitialCountByWorkspace[Ot];Yn!==void 0&&(Et[Ot]=Yn),ko!==void 0&&(ln[Ot]=ko),vs!==void 0&&(oo[Ot]=vs);continue}Et[Ot]=Pt.hasMore,ln[Ot]=Pt.items.length>0?Pt.items[Pt.items.length-1].id:void 0,oo[Ot]=Math.max(Pt.items.length,am)}return e.sessionsHasMoreByWorkspace=Et,e.sessionsCursorByWorkspace=ln,e.sessionsInitialCountByWorkspace=oo,e.sessionsFullyLoaded=!1,J.sort((Ot,Pt)=>new Date(Pt.updatedAt).getTime()-new Date(Ot.updatedAt).getTime()),He.size>0&&l("load",vt),J}async function Yt(se){if(!e.sessionsLoadingMoreByWorkspace[se]&&e.sessionsHasMoreByWorkspace[se]!==!1&&e.sessionsCursorByWorkspace[se]!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[se]:!0};try{let xe=e.sessionsCursorByWorkspace[se],J;for(let He=0;He<3&&xe!==void 0&&(J=await _t().listSessions({workspaceId:se,pageSize:O5,beforeId:xe,excludeEmpty:!0}),e.sessionsCursorByWorkspace[se]!==xe);He+=1)J=void 0,xe=e.sessionsCursorByWorkspace[se];if(J===void 0)return;const Ce=new Set(e.sessions.map(He=>He.id)),$e=J.items.filter(He=>!Ce.has(He.id));$e.length>0&&c([...e.sessions,...$e]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[se]:J.items.length>0?J.items[J.items.length-1].id:xe},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[se]:J.hasMore}}catch(xe){l("loadMoreSessions",xe)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[se]:!1}}}}function Sn(se){return e.sessions.filter(xe=>!xe.parentSessionId&&B(xe)===se)}const on=5;function en(se,xe){const J=new Set(e.sessions.map(He=>He.id)),Ce=se.items.filter(He=>!J.has(He.id)&&(He.meta.last_prompt??"").length>0).map(kU);Ce.length>0&&c([...e.sessions,...Ce]);for(const He of se.items)if(J.has(He.id)&&He.git!==void 0){const vt=He.git.pull_request;d(He.id,ut=>ut.pullRequest===vt?ut:{...ut,pullRequest:vt})}if(se.items.length>0){const He=Math.min(...se.items.map(vt=>vt.meta.updated_at));e.flatSessionsFrontier=xe?.resetFrontier===!0||e.flatSessionsFrontier===null?He:Math.min(e.flatSessionsFrontier,He)}e.flatSessionsNextPageToken=se.nextPageToken,e.flatSessionsHasMore=se.hasMore;const $e=new Set(I.value.map(He=>He.id));return se.items.filter(He=>(He.meta.last_prompt??"").length>0&&$e.has(B({workspaceId:He.workspace.id,cwd:He.workspace.cwd??""}))).length}async function Cn(){const se=await _t().listSessionsV2({pageSize:xg,include:"git"});en(se,{resetFrontier:!0}),e.flatSessionsSeeded=!0}async function Mn(){if(!(e.flatSessionsSeeded||e.flatSessionsLoading)){e.flatSessionsLoading=!0;try{await Cn()}catch(se){l("ensureFlatSessions",se)}finally{e.flatSessionsLoading=!1}}}async function We(){if(!(e.flatSessionsLoading||e.flatSessionsLoadingMore)&&e.flatSessionsHasMore){e.flatSessionsLoadingMore=!0;try{if(!e.flatSessionsSeeded){await Cn();return}if(e.flatSessionsNextPageToken===null)return;for(let se=0;se<on;se+=1){const xe=e.flatSessionsNextPageToken;if(xe===null||!e.flatSessionsHasMore)break;let J;try{J=await _t().listSessionsV2({pageSize:xg,pageToken:xe,include:"git"})}catch(Ce){if(!mU(Ce))throw Ce;e.flatSessionsNextPageToken=null,await Cn();break}if(en(J)>0)break}}catch(se){l("loadMoreFlatSessions",se)}finally{e.flatSessionsLoadingMore=!1}}}async function tt(se,xe,J,Ce){if(e.sessionsCursorByWorkspace[se]===xe){const He=new Date(J).getTime();let vt;for(const ut of e.sessions){if(B(ut)!==se)continue;const Dt=new Date(ut.updatedAt).getTime();Dt<=He||(vt===void 0||Dt<new Date(vt.updatedAt).getTime())&&(vt=ut)}e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[se]:vt?.id}}let $e=3;for(;$e>0&&Sn(se).length<Ce&&(e.sessionsHasMoreByWorkspace[se]??!1);){const He=e.sessionsCursorByWorkspace[se],vt=Sn(se).length;if(He===void 0)try{const ut=await _t().listSessions({workspaceId:se,pageSize:am,excludeEmpty:!0}),Dt=new Set(e.sessions.map(ln=>ln.id)),Et=ut.items.filter(ln=>!Dt.has(ln.id));Et.length>0&&c([...e.sessions,...Et].sort((ln,oo)=>new Date(oo.updatedAt).getTime()-new Date(ln.updatedAt).getTime())),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[se]:ut.items.length>0?ut.items[ut.items.length-1].id:void 0},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[se]:ut.hasMore}}catch(ut){l("loadMoreSessions",ut);break}else await Yt(se);if($e-=1,Sn(se).length===vt&&e.sessionsCursorByWorkspace[se]===He)break}}async function Ue(){if(e.sessionsFullyLoaded)return;const se=await Oe().catch(Ce=>(gl("[kimi-web] loadAllSessions failed; search covers only loaded sessions",Ce),null));if(se===null)return;const xe=se.error===void 0?se.sessions:at(se.sessions);if(Ge(xe),e.sessionsFullyLoaded=se.error===void 0,se.error!==void 0)return;const J={};for(const Ce of e.workspaces)J[Ce.id]=!1;e.sessionsHasMoreByWorkspace=J}async function Lt(){const se=await _t().getMeta().catch(()=>null);se!==null&&(e.serverVersion=se.serverVersion,e.availableOpenInApps=se.openInApps,e.dangerousBypassAuth=se.dangerousBypassAuth,e.experimentalFlags=se.experimentalFlags,e.backend=se.backend)}async function gt(){const se=Date.now();let xe="accepted";bi("app:load:start"),e.loading=!0;const J=!ne.value;let Ce=!0;try{if(J&&await ze()==="server-auth-required"){Ce=!1,xe="auth-required";return}const $e=_t();await Promise.all([$e.getHealth().catch(()=>null),Lt(),r.loadModels()]),J||await Se(),await _e(),await wn();const He=await Bt(),vt=He??e.sessions;if(He!==void 0&&Ge(He),!J&&He!==void 0&&e.flatSessionsSeeded){e.flatSessionsSeeded=!1,e.flatSessionsNextPageToken=null,e.flatSessionsHasMore=!0,e.flatSessionsFrontier=null;try{await Cn()}catch(Ot){l("ensureFlatSessions",Ot)}}const ut=_E().filter(Ot=>!e.sessions.some(Pt=>Pt.id===Ot));if(ut.length>0){const Ot=await Promise.all(ut.map(Yn=>$s(Yn))),Pt=ut.filter((Yn,ko)=>Ot[ko]==="stale");Pt.length>0&&v(Pt)}const Dt=vt[0],Et=e.activeWorkspaceId;!(Et!==null&&D.value.some(Ot=>Ot.id===Et))&&Dt&&go(B(Dt)),Oo();const oo=typeof window<"u"?Qb(window.location):void 0;!e.activeSessionId&&oo!==void 0&&(e.sessions.some(Pt=>Pt.id===oo)||await no(oo))&&await vo(oo,{urlMode:"replace"}),!e.activeSessionId&&vt.length>0&&await vo(vt[0].id,{urlMode:"replace"})}catch($e){xe="failed",l("load",$e)}finally{e.loading=!1,Ce&&(ne.value=!0),bi("app:load:complete",{status:xe,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-se})}}async function wn(){try{const se=_t(),[xe,J]=await Promise.all([se.listWorkspaces().catch(()=>[]),se.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=yn(xe),e.fsHome=J.home||null,e.recentRoots=J.recentRoots}catch{}}function yn(se){const xe=lh();return Object.keys(xe).length===0?se:se.map(J=>{const Ce=xe[J.root];return Ce!==void 0?{...J,name:Ce}:J})}function go(se){e.activeWorkspaceId=se,K(se)}function qt(se){go(se);const xe=e.sessions.filter(J=>B(J)===se);if(xe.length>0){const J=xe[0];J&&J.id!==e.activeSessionId&&vo(J.id)}else k(void 0),Nn(void 0,"push")}function ps(se){const xe=lh()[se.root],J=xe!==void 0?{...se,name:xe}:se,Ce=Pr(J.root);e.hiddenWorkspaceRoots.some(vt=>Pr(vt)===Ce)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(vt=>Pr(vt)!==Ce),V(e.hiddenWorkspaceRoots));const $e=e.workspaces.findIndex(vt=>vt.id===J.id||vt.root===J.root);if($e===-1){e.workspaces=[J,...e.workspaces];return}const He=[...e.workspaces];He[$e]=J,e.workspaces=He}function xs(se){if(se.type==="workspaceCreated"||se.type==="workspaceUpdated"){ps(se.workspace);return}const xe=e.workspaces.find(Ce=>Ce.id===se.workspaceId)?.root??se.root;if(xe&&!e.hiddenWorkspaceRoots.includes(xe)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,xe],V(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Ce=>Ce.id!==se.workspaceId&&Ce.root!==xe),e.activeWorkspaceId===se.workspaceId||e.activeWorkspaceId===xe){const Ce=I.value[0]?.id??null;if(e.activeWorkspaceId=Ce,Ce)K(Ce);else try{ur(cn.activeWorkspace)}catch{}k(void 0),e.sessionLoading=!1,ge(),Nn(void 0,"replace")}}function _n(){k(void 0),Nn(void 0,"push")}function In(se){go(se),_n(),ge()}async function To(se){const xe=D.value.find(ln=>ln.id===se);if(!xe)return null;const J=e.thinking,Ce=_t();let $e,He=xe.root;try{const ln=await Ce.addWorkspace({root:xe.root});$e=ln.id,He=ln.root,ps(ln)}catch{}const vt=r.draftModel.value??void 0,ut=await Ce.createSession({workspaceId:$e,cwd:He,model:vt});r.draftModel.value=null;const Dt=vt!==void 0&&(!ut.model||ut.model.length===0)?{...ut,model:vt}:ut;f(Dt);const Et=ut.id;return J!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[Et]:J},k3(e,Et)),go(ut.workspaceId??$e??se),await vo(ut.id,{skipStatusRefresh:!0}),z.planMode&&(e.planModeBySession={...e.planModeBySession,[Et]:!0},O()),z.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Et]:!0},F()),z.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Et]:!0},U()),z.planMode=!1,z.swarmMode=!1,z.goalMode=!1,Et}async function lo(se,xe,J){if(cl.has(se))return null;cl.add(se);let Ce=null;try{const $e=await To(se);return $e?(Ce=$e,await Po($e,xe,J),$e):null}catch($e){return l("startSessionAndSendPrompt",$e),Ce}finally{cl.delete(se)}}async function St(se,xe,J,Ce){if(cl.has(se))return null;cl.add(se);let $e=null;try{const He=await To(se);if(!He)return null;$e=He;const vt=e.planModeBySession[He]??!1,ut=e.swarmModeBySession[He]??!1,Dt=e.sessions.find(Ot=>Ot.id===He),Et=(Dt?.model&&Dt.model.length>0?Dt.model:e.defaultModel)??void 0,ln=await r.resolveThinkingForPrompt(He,Et)??e.thinking;return await P({model:Et,planMode:vt,swarmMode:ut,permissionMode:e.permission,thinking:ln},He)&&await r.activateSkill(xe,J,Ce,He,{skipThinkingPersist:!0}),He}catch(He){return l("startSessionAndActivateSkill",He),$e}finally{cl.delete(se)}}async function hs(se,xe){if(cl.has(se))return null;cl.add(se);let J=null;try{const Ce=await To(se);return Ce?(J=Ce,await i.openSideChatOn(Ce,xe),Ce):null}catch(Ce){return l("startSessionAndOpenSideChat",Ce),J}finally{cl.delete(se)}}async function Jo(se){const xe=se.trim();if(!xe)return!1;const J=_t();try{const Ce=await J.addWorkspace({root:xe});return ps(Ce),In(Ce.id),!0}catch(Ce){return gl("[kimi-web] addWorkspaceByPath failed for",xe,Ce),!1}}async function uo(se){try{return await _t().browseFs(se)}catch{return{path:"",parent:null,entries:[]}}}async function Ys(){try{return await _t().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Nn(se,xe){if(xe==="none"||typeof window>"u"||!window.history)return;const J=fQ(se);if(window.location.pathname!==J)try{xe==="push"?window.history.pushState(null,"",J):window.history.replaceState(null,"",J)}catch{}}async function no(se){try{const xe=await _t().getSession(se);return e.sessions.some(J=>J.id===xe.id)||h(xe),!0}catch{return!1}}async function $s(se){try{const xe=await _t().getSession(se);return xe.archived?"stale":(e.sessions.some(J=>J.id===xe.id)||h(xe),"ok")}catch(xe){return Us(xe)&&xe.code===qhe?"stale":"retry"}}function Xs(){const se=Qb(window.location);if(se===void 0){k(void 0);return}if(se!==e.activeSessionId){if(e.sessions.some(xe=>xe.id===se)){vo(se,{urlMode:"none"});return}(async()=>{if(await no(se)){await vo(se,{urlMode:"none"});return}const xe=e.sessions[0];xe?await vo(xe.id,{urlMode:"replace"}):(k(void 0),Nn(void 0,"replace"))})()}}let ci=!1;function Oo(){ci||typeof window>"u"||(ci=!0,window.addEventListener("popstate",Xs))}async function vo(se,xe){if(!e.sessions.some($e=>$e.id===se)){const $e=++ye;if(!await no(se)||$e!==ye)return}const J=S(se),Ce=!J&&u.has(se);u.delete(se);try{Nn(se,xe?.urlMode??"push"),e.sessionLoading=!J&&!Ce,k(se),e.unreadBySession[se]&&(e.unreadBySession={...e.unreadBySession,[se]:!1},W({[se]:!1})),ge();const $e=e.sessions.find(He=>He.id===se);if($e){const He=B($e);e.activeWorkspaceId!==He&&go(He)}if(J){if(await x(se)==="not-found")return}else if(await g(se,{skipStatusRefresh:xe?.skipStatusRefresh===!0})==="not-found")return;fe(se,{skipStatus:xe?.skipStatusRefresh===!0})}catch($e){l("selectSession",$e,{sessionId:se})}finally{e.activeSessionId===se&&(e.sessionLoading=!1)}}async function Po(se,xe,J){const Ce=y8(se);e.inFlightBySession={...e.inFlightBySession,[se]:!0};const $e=b();let He=e.pendingThinkingBySession[se];try{const vt=_t(),ut=[];if(xe&&ut.push({type:"text",text:xe}),ut.push(...m8(J)),ut.length===0)return e.inFlightBySession={...e.inFlightBySession,[se]:!1},"rejected";const Dt={id:$e,sessionId:se,role:"user",content:ut,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};w(se,vs=>[...vs,Dt]);const Et=e.sessions.find(vs=>vs.id===se),ln=(Et?.model&&Et.model.length>0?Et.model:e.defaultModel)??void 0,oo=e.planModeBySession[se]??!1,Ot=e.swarmModeBySession[se]??!1,Pt=e.goalModeBySession[se]??!1;if(Pt&&xe)try{await vt.updateSession(se,{goalObjective:xe.trim()})}catch(vs){return vl(e,se,He)&&T(se),l("createGoal",vs,{sessionId:se}),e.inFlightBySession={...e.inFlightBySession,[se]:!1},w(se,Os=>Os.some(ei=>ei.id===$e)?Os.filter(ei=>ei.id!==$e):Os),"rejected"}const Yn=await r.resolveThinkingForPrompt(se,ln)??e.thinking;He=e.pendingThinkingBySession[se];const ko=await vt.submitPrompt(se,{content:ut,model:ln,thinking:Yn,permissionMode:e.permission,planMode:oo,swarmMode:Ot});return Yn!==void 0&&vl(e,se,He),Pt&&(e.goalModeBySession={...e.goalModeBySession,[se]:!1},U()),e.promptIdBySession={...e.promptIdBySession,[se]:ko.promptId},G(se,$e,ko.promptId,ko.userMessageId),_()?.bindNextPromptId(se,ko.promptId),"ok"}catch(vt){return e.inFlightBySession={...e.inFlightBySession,[se]:!1},w(se,ut=>ut.some(Dt=>Dt.id===$e)?ut.filter(Dt=>Dt.id!==$e||Dt.promptId!==void 0||Dt.userMessageId!==void 0):ut),vl(e,se,He)&&T(se),l("sendPrompt",vt,{sessionId:se}),Us(vt)?"rejected":"uncertain"}finally{k8(se,Ce)}}async function co(se,xe){const J=e.activeSessionId;if(J){if(a.value!=="idle"||e.inFlightBySession[J]){Qe(se,xe);return}if((e.queuedBySession[J]?.length??0)>0){Qe(se,xe),st(J);return}await Po(J,se,xe)}}async function Tn(se,xe){const J=e.activeSessionId;if(!J)return;const Ce=e.queuedBySession[J]??[],$e=[],He=[];for(const Pt of Ce){const Yn=Pt.text.trim();Yn&&$e.push(Yn),Pt.attachments?.length&&He.push(...Pt.attachments)}const vt=se.trim();if(vt&&$e.push(vt),xe?.length&&He.push(...xe),$e.length===0&&He.length===0)return;Ce.length>0&&(e.queuedBySession={...e.queuedBySession,[J]:[]});const ut=$e.join(`
329
329
 
330
330
  `),Dt=()=>{if(Ce.length===0)return;const Pt=e.queuedBySession[J]??[];e.queuedBySession={...e.queuedBySession,[J]:[...Ce,...Pt]}};if(a.value==="idle"&&!e.inFlightBySession[J]){await Po(J,ut,He)==="rejected"&&Dt();return}const Et=[];ut&&Et.push({type:"text",text:ut});for(const Pt of He)Pt.kind==="video"?Et.push({type:"video",source:{kind:"file",fileId:Pt.fileId}}):Pt.kind==="file"?Et.push({type:"file",fileId:Pt.fileId,name:Pt.name??"",mediaType:Pt.mediaType||"application/octet-stream",size:Pt.size??0}):Et.push({type:"image",source:{kind:"file",fileId:Pt.fileId}});const ln=b(),oo={id:ln,sessionId:J,role:"user",content:Et,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};w(J,Pt=>[...Pt,oo]);const Ot=y8(J);try{const Pt=_t(),Yn=e.sessions.find(Lc=>Lc.id===J),ko=(Yn?.model&&Yn.model.length>0?Yn.model:e.defaultModel)??void 0,vs=await r.resolveThinkingForPrompt(J,ko)??e.thinking,Os=e.pendingThinkingBySession[J],ei=await Pt.submitPrompt(J,{content:Et,model:ko,thinking:vs,permissionMode:e.permission,planMode:e.planModeBySession[J]??!1,swarmMode:e.swarmModeBySession[J]??!1});if(vs!==void 0&&vl(e,J,Os),G(J,ln,ei.promptId,ei.userMessageId),ei.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[J]:ei.promptId},_()?.bindNextPromptId(J,ei.promptId);return}try{await Pt.steerPrompts(J,[ei.promptId])}catch{}}catch(Pt){w(J,Yn=>Yn.filter(ko=>ko.id!==ln||ko.promptId!==void 0||ko.userMessageId!==void 0)),Us(Pt)&&Dt(),l("steer",Pt,{sessionId:J})}finally{k8(J,Ot)}}async function fo(se,xe){try{const Ce=await _t().uploadFile({file:se,name:xe});return{fileId:Ce.id,name:Ce.name,mediaType:Ce.mediaType}}catch(J){return l("uploadImage",J),null}}function Qe(se,xe){const J=e.activeSessionId;if(!J)return;const Ce=e.queuedBySession[J]??[],$e={text:se,attachments:xe,id:ome()};e.queuedBySession={...e.queuedBySession,[J]:[...Ce,$e]}}function st(se){const[xe,...J]=e.queuedBySession[se]??[];xe!==void 0&&(e.queuedBySession={...e.queuedBySession,[se]:J},Po(se,xe.text,xe.attachments).then(Ce=>{if(Ce==="ok"){ju.delete(se);return}if(Ce==="uncertain"){ju.delete(se);return}if(!e.sessions.some(Dt=>Dt.id===se)){ju.delete(se);return}const $e=xe.id??xe.text,He=ju.get(se),vt=He!==void 0&&He.key===$e?He.count+1:1;if(vt>=nme){ju.delete(se),(e.queuedBySession[se]?.length??0)>0&&st(se);return}ju.set(se,{key:$e,count:vt});const ut=e.queuedBySession[se]??[];e.queuedBySession={...e.queuedBySession,[se]:[xe,...ut]}}))}function Ct(se,xe){const J=e.inFlightBySession[se]===!0;if(e.inFlightBySession={...e.inFlightBySession,[se]:!1},e.promptIdBySession[se]!==void 0){const $e={...e.promptIdBySession};delete $e[se],e.promptIdBySession=$e}return(J||xe?.turnWasActive===!0||(e.turnActiveBySession[se]??!1))&&st(se),J}function Qt(se,xe){xe.inFlightTurn!==null&&xe.busy||Ct(se)}async function kn(){const se=e.activeSessionId;if(!se)return!1;const xe=e.sessions.find(ut=>ut.id===se);let J=e.promptIdBySession[se];if(J===void 0){const ut=xe?.currentPromptId;ut!==void 0&&ut.length>0&&!ut.startsWith("pr_")&&(J=ut)}const Ce=_t();let $e=!1;const He=()=>{e.inFlightBySession={...e.inFlightBySession,[se]:!1},e.turnActiveBySession={...e.turnActiveBySession,[se]:!1}};if(J!==void 0)try{if((await Ce.abortPrompt(se,J)).aborted)return!0;$e=!0;const Dt={...e.promptIdBySession};delete Dt[se],e.promptIdBySession=Dt,He()}catch(ut){if(Us(ut)&&ut.code===Khe){$e=!0;const Dt={...e.promptIdBySession};delete Dt[se],e.promptIdBySession=Dt,He()}else return l("abortCurrentPrompt",ut,{sessionId:se}),!1}if($e||!((e.inFlightBySession[se]??!1)||(e.turnActiveBySession[se]??!1)||(xe?.mainTurnActive??!1)))return!1;try{return(await Ce.abortSession(se)).aborted===!0}catch(ut){return l("abortCurrentPrompt",ut,{sessionId:se}),!1}}function Ko(se,xe){const J=e.approvalsBySession[se]??[];e.approvalsBySession={...e.approvalsBySession,[se]:J.filter(Ce=>Ce.approvalId!==xe)}}function Eo(se,xe){const J=e.questionsBySession[se]??[];e.questionsBySession={...e.questionsBySession,[se]:J.filter(Ce=>Ce.questionId!==xe)}}async function bo(se,xe){const J=e.activeSessionId;if(!J||Lh[se])return;Lh[se]=!0;const Ce=e.approvalsBySession[J]?.find($e=>$e.approvalId===se&&$e.toolName==="ExitPlanMode")?.toolCallId;try{const $e=_t(),He={decision:xe.decision,scope:xe.scope,feedback:xe.feedback,selectedLabel:xe.selectedLabel};await $e.respondApproval(J,se,He),Ko(J,se),Ce!==void 0&&E(J,Ce)}catch($e){y4($e)?(Ko(J,se),Ce!==void 0&&E(J,Ce)):l("respondApproval",$e,{sessionId:J})}finally{delete Lh[se]}}async function Ns(se,xe){const J=e.activeSessionId;if(J&&!Hu[se]){Hu[se]="answer";try{await _t().respondQuestion(J,se,xe),Eo(J,se)}catch(Ce){y4(Ce)?Eo(J,se):l("respondQuestion",Ce,{sessionId:J})}finally{delete Hu[se]}}}async function Do(se){const xe=e.activeSessionId;if(xe&&!Hu[se]){Hu[se]="dismiss";try{await _t().dismissQuestion(xe,se),Eo(xe,se)}catch(J){y4(J)?Eo(xe,se):l("dismissQuestion",J,{sessionId:xe})}finally{delete Hu[se]}}}async function Io(se){const xe=e.activeSessionId;if(xe&&!k4[se]){k4[se]=!0;try{const J=_t(),Ce=(e.tasksBySession[xe]??[]).find(He=>He.id===se)?.backgroundTaskId;await J.cancelTask(xe,Ce??se);const $e=e.tasksBySession[xe]??[];e.tasksBySession={...e.tasksBySession,[xe]:$e.map(He=>He.id===se?{...He,status:"cancelled"}:He)}}catch(J){eme(J)||l("cancelTask",J,{sessionId:xe})}finally{delete k4[se]}}}function Qo(se){const xe=e.activeSessionId;xe?(e.planModeBySession={...e.planModeBySession,[xe]:se},O(),P({planMode:se})):z.planMode=se}function sn(){const se=e.activeSessionId,xe=se?e.planModeBySession[se]??!1:z.planMode;Qo(!xe)}function es(se){const xe=e.activeSessionId;xe?(e.swarmModeBySession={...e.swarmModeBySession,[xe]:se},F(),P({swarmMode:se})):z.swarmMode=se}async function ms(){const se=e.activeSessionId,J=!(se?e.swarmModeBySession[se]??!1:z.swarmMode);J&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableTitle"),message:n("workspace.swarmEnableConfirm"),variant:"primary"})||es(J)}function Tr(se){const xe=e.activeSessionId;xe?(e.goalModeBySession={...e.goalModeBySession,[xe]:se},U()):z.goalMode=se}function ts(){const se=e.activeSessionId,xe=se?e.goalModeBySession[se]??!1:z.goalMode;Tr(!xe)}async function Ki(se){const xe=se.trim();if(!xe||e.permission==="manual"&&!await o({title:n("workspace.goalStartTitle"),message:n("workspace.goalStartConfirm",{objective:xe}),variant:"primary"}))return null;let J=e.activeSessionId,Ce=null;if(!J){const $e=e.activeWorkspaceId,He=$e&&I.value.some(vt=>vt.id===$e)?$e:I.value[0]?.id??null;if(!He)return null;try{J=await To(He)??void 0,Ce=J??null}catch(vt){return l("createGoal",vt),null}if(!J)return null}try{await _t().updateSession(J,{goalObjective:xe})}catch($e){return l("createGoal",$e,{sessionId:J,message:ie($e)}),Ce}return e.goalModeBySession[J]&&(e.goalModeBySession={...e.goalModeBySession,[J]:!1},U()),e.activeSessionId===J?await co(xe):await Po(J,xe),Ce}function Js(se){const xe=e.activeSessionId;xe&&Promise.resolve(_t().updateSession(xe,{goalControl:se})).catch(J=>{l("controlGoal",J,{sessionId:xe,message:ie(J)})})}function Bo(se){e.permission=se,H(se),P({permissionMode:se})}function Zo(se){const xe=[...e.warnings];xe.splice(se,1),e.warnings=xe}async function Il(se,xe){try{await _t().updateSession(se,{title:xe}),d(se,Ce=>({...Ce,title:xe}))}catch(J){l("renameSession",J,{sessionId:se})}}async function Zi(se,xe){const J=e.workspaces.find($e=>$e.id===se)?.root,Ce=()=>{e.workspaces=e.workspaces.map($e=>$e.id===se?{...$e,name:xe}:$e)};try{if(await _t().updateWorkspace(se,{name:xe}),J!==void 0){const $e=lh();J in $e&&(delete $e[J],tC($e))}Ce()}catch($e){if(J!==void 0&&Us($e)&&$e.code===Zhe){tC({...lh(),[J]:xe}),Ce();return}l("renameWorkspace",$e)}}async function tl(se){const xe=e.workspaces.find(He=>He.id===se)?.root??D.value.find(He=>He.id===se)?.root??se,J=e.activeSessionId?e.sessions.find(He=>He.id===e.activeSessionId):void 0,Ce=e.activeWorkspaceId===se||e.activeWorkspaceId===xe,$e=!!(J&&(J.cwd===xe||J.workspaceId===se||B(J)===se));xe&&!e.hiddenWorkspaceRoots.includes(xe)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,xe],V(e.hiddenWorkspaceRoots));try{await _t().deleteWorkspace(se)}catch(He){gl("[kimi-web] deleteWorkspace registry cleanup failed for",se,He)}if(e.workspaces=e.workspaces.filter(He=>He.id!==se&&He.root!==xe),Ce||$e){const He=I.value[0]?.id??null;if(e.activeWorkspaceId=He,He)K(He);else try{ur(cn.activeWorkspace)}catch{}}(Ce||$e)&&(k(void 0),e.sessionLoading=!1,ge(),Nn(void 0,"replace"))}async function Ho(se){try{const xe=_t(),J=e.sessions.find(ut=>ut.id===se),Ce=J!==void 0?B(J):void 0,$e=Ce!==void 0?Sn(Ce).length:0;await xe.archiveSession(se),m(se),J!==void 0&&Ce!==void 0&&tt(Ce,se,J.updatedAt,$e),i.clearSideChatForSession(se);const{[se]:He,...vt}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=vt,e.activeSessionId===se){const ut=e.sessions[0];ut?await vo(ut.id,{urlMode:"replace"}):(k(void 0),Nn(void 0,"replace"))}}catch(xe){l("archiveSession",xe,{sessionId:se})}}async function Co(se){if(oe)return;const xe=se??e.activeSessionId;if(!xe){const Ce=n("commands.export.noSession");bi("export:failed",{status:"no-session"}),l("exportSession",new Error(Ce),{message:Ce});return}oe=!0;const J=Date.now();bi("export:start",{sessionId:xe});try{const Ce=U0e(),{blob:$e,fileName:He}=await _t().exportSession(xe,Ce,{desktop:Wp});if(typeof document>"u")throw new Error("Document is unavailable");const vt=URL.createObjectURL($e);let ut;try{ut=document.createElement("a"),ut.href=vt,ut.download=He,document.body.append(ut),ut.click()}finally{ut?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(vt)}catch{}},0)}bi("export:accepted",{sessionId:xe,status:"accepted",zipBytes:$e.size,durationMs:Date.now()-J})}catch(Ce){const $e=typeof Ce=="object"&&Ce!==null?Ce:void 0;bi("export:failed",{sessionId:xe,status:"failed",durationMs:Date.now()-J,errorName:typeof $e?.name=="string"?$e.name:typeof Ce,errorCode:typeof $e?.code=="number"?$e.code:void 0,requestId:typeof $e?.requestId=="string"?$e.requestId:void 0,phase:typeof $e?.phase=="string"?$e.phase:void 0,httpStatus:typeof $e?.status=="number"?$e.status:void 0}),l("exportSession",Ce,{sessionId:xe})}finally{oe=!1}}async function Fs(se){try{const xe=await _t().restoreSession(se);return f(xe),!0}catch(xe){return l("restoreSession",xe,{sessionId:se}),!1}}function Rs(se){return _t().listSessions({archivedOnly:!0,beforeId:se?.beforeId,pageSize:se?.pageSize??50})}async function yo(){try{await _t().logout(),await Se(),await gt()}catch(se){l("logout",se)}}function ht(se){const xe=e.activeSessionId;xe&&_t().compactSession(xe,se).catch(J=>{l("compact",J,{sessionId:xe})})}async function Le(se){const xe=se??e.activeSessionId;if(xe)try{const J=await _t().forkSession(xe);f(J),await vo(J.id)}catch(J){l("fork",J,{sessionId:xe})}}async function Ze(se=1){const xe=e.activeSessionId;if(!xe)return null;const J=e.messagesBySession[xe]??[];let Ce=-1;for(let ut=J.length-1;ut>=0;ut--){const Dt=J[ut];if(Dt.role==="user"&&!(Dt.metadata?.origin&&Dt.metadata.origin.kind!=="user")){Ce=ut;break}}const $e=Ce>=0?J[Ce].content.filter(ut=>ut.type==="text").map(ut=>ut.text).join(`
331
- `):null,He=se===1&&Ce>=0&&J.slice(Ce+1).every(ut=>ut.role!=="user"),vt=He?e.sessions.find(ut=>ut.id===xe):void 0;if(He&&(e.messagesBySession={...e.messagesBySession,[xe]:J.slice(0,Ce)},vt!==void 0)){const ut={...vt};delete ut.lastTurnReason,f(ut)}try{return await _t().undoSession(xe,se),await g(xe),{text:$e}}catch(ut){return He&&(e.messagesBySession={...e.messagesBySession,[xe]:J},vt!==void 0&&f(vt),await g(xe).catch(()=>{})),l("undo",ut,{sessionId:xe}),null}}function Xt(se){const xe=e.activeSessionId;if(!xe)return;const J=e.queuedBySession[xe]??[];if(se<0||se>=J.length)return;const Ce=[...J];Ce.splice(se,1),e.queuedBySession={...e.queuedBySession,[xe]:Ce}}function gs(se,xe){const J=e.activeSessionId;if(!J)return;const Ce=e.queuedBySession[J]??[];if(se===xe||se<0||se>=Ce.length||xe<0||xe>=Ce.length)return;const $e=[...Ce],[He]=$e.splice(se,1);He!==void 0&&($e.splice(xe,0,He),e.queuedBySession={...e.queuedBySession,[J]:$e})}async function di(se){const xe=e.activeSessionId;if(!xe)return[];try{return(await _t().listDirectory(xe,{path:se,includeGitStatus:!0})).items}catch{return[]}}async function Ei(se){const xe=e.activeSessionId;if(!xe)return null;try{const Ce=await _t().readFile(xe,{path:se});return{path:Ce.path,content:Ce.content,encoding:Ce.encoding,mime:Ce.mime,languageId:Ce.languageId,isBinary:Ce.isBinary,size:Ce.size,lineCount:Ce.lineCount}}catch(J){if(gl("[kimi-web] readFileContent failed for",se,J),Us(J)&&J.code===Ghe)throw J;return null}}async function ao(se){return _t().readHostFileContent(se)}const Gi=10485760;function Er(se){const xe=e.activeSessionId;return xe?_t().getFileDownloadUrl(xe,se):null}async function fi(se,xe){const J=e.activeSessionId;if(!J)return!1;try{return await _t().openFile(J,{path:se,line:xe}),!0}catch(Ce){return l("openFile",Ce,{sessionId:J}),!1}}async function Ll(se){const xe=e.activeSessionId;if(!xe)return;const J=$.value.cwd||".";try{await _t().openInApp(xe,se,J)}catch(Ce){l("openInApp",Ce,{sessionId:xe})}}async function zo(se){const xe=e.activeSessionId;if(!xe)return!1;try{return await _t().revealFile(xe,{path:se}),!0}catch(J){return l("revealFile",J,{sessionId:xe}),!1}}function Ir(se){return se.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(se)||se.startsWith("\\\\")}async function Qs(se){if(/^(https?:|data:|blob:)/i.test(se))return se;const xe=e.activeSessionId;if(!xe)return se;let J=se;if(Ir(J)){const Ce=e.sessions.find(He=>He.id===xe)?.cwd,$e=Ce?h2(J,Ce):null;if($e)J=$e;else try{const He=await ao(J);return!He.isBinary||He.encoding!=="base64"?se:`data:${He.mime};base64,${He.content}`}catch{return se}}try{const $e=await _t().readFile(xe,{path:J,length:Gi});return!$e.isBinary||$e.encoding!=="base64"||$e.truncated?se:`data:${$e.mime};base64,${$e.content}`}catch{return se}}async function pi(se){const xe=e.sessions.find(Ce=>Ce.id===e.activeSessionId),J=xe===void 0?e.activeWorkspaceId:B(xe);if(!J)return[];try{return(await _t().searchFiles(J,{query:se,limit:20})).items.map(He=>({path:He.path,name:He.name}))}catch{return[]}}return{loadFileDiff:we,clearFileDiff:ge,loadGitStatus:Q,checkAuth:Se,probeManagedMembership:ue,loadConfig:_e,updateConfig:Ee,listAllSessionsGlobal:Oe,load:gt,refreshServerMeta:Lt,loadWorkspaces:wn,loadMoreSessions:Yt,loadAllSessions:Ue,ensureFlatSessions:Mn,loadMoreFlatSessions:We,selectWorkspace:go,openWorkspace:qt,upsertWorkspacePreserveOrder:ps,applyWorkspaceEvent:xs,clearActiveSession:_n,openWorkspaceDraft:In,startSessionAndSendPrompt:lo,startSessionAndActivateSkill:St,startSessionAndOpenSideChat:hs,addWorkspaceByPath:Jo,browseFs:uo,getFsHome:Ys,writeSessionUrl:Nn,fetchSessionIntoList:no,onSessionRoutePopState:Xs,bindSessionRoute:Oo,selectSession:vo,submitPromptInternal:Po,finishPromptLocal:Ct,localTurnStartState:sme,isLocalTurnSnapshotCurrent:rme,afterLocalTurnStartsSettle:lme,handleSessionSnapshot:Qt,sendPrompt:co,steerPrompt:Tn,uploadImage:fo,enqueue:Qe,unqueue:Xt,reorderQueue:gs,abortCurrentPrompt:kn,respondApproval:bo,respondQuestion:Ns,dismissQuestion:Do,pendingQuestionActions:Hu,pendingApprovalActions:Lh,cancelTask:Io,setPlanMode:Qo,togglePlanMode:sn,setSwarmMode:es,toggleSwarmMode:ms,setGoalMode:Tr,toggleGoalMode:ts,createGoal:Ki,controlGoal:Js,setPermission:Bo,dismissWarning:Zo,renameSession:Il,renameWorkspace:Zi,deleteWorkspace:tl,archiveSession:Ho,exportSession:Co,restoreSession:Fs,loadArchivedSessions:Rs,logout:yo,compact:ht,forkSession:Le,undo:Ze,listDir:di,readFileContent:Ei,readHostFileContent:ao,getFileDownloadUrl:Er,openWorkspaceFile:fi,openInApp:Ll,revealWorkspaceFile:zo,resolveImageUrl:Qs,searchFiles:pi,loadOlderMessages:Y,refreshSessionSidecars:fe,isStartingFirstPrompt:()=>cl.size>0}}const tN=cn.starredModels,Bx=new Error("profile persist failed");function ume(){try{const e=ui(tN);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function cme(e){try{Ls(tN,JSON.stringify(e))}catch{}}function dme(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,updateSession:r,updateSessionMessages:l,loadConfig:a,checkAuth:u}=t,c=Z([]),d=Z(ume()),f=Z({}),h=Z({}),m=Z([]),v=Z(null);function k(pe){if(!(pe==null||pe.length===0))return c.value.find(ve=>ve.id===pe)??c.value.find(ve=>ve.model===pe)}function w(){const pe=e.activeSessionId?e.sessions.find(oe=>oe.id===e.activeSessionId):void 0,ve=pe===void 0?v.value??e.defaultModel:pe.model||e.defaultModel;return k(ve)?.id??ve??void 0}function b(pe){if(pe===void 0)return;const ve=k(pe);return ve===void 0?void 0:bp(ve)}function _(pe,ve){const oe=pe==null?void 0:e.thinkingBySession[pe];return oe!==void 0&&gJ(ve,oe)?oe:bp(ve)}function g(pe,ve){if(ve===void 0)return;const oe=k(ve);return oe===void 0?void 0:_(pe,oe)}async function x(pe,ve){return pe!=null&&e.thinkingBySession[pe]===void 0&&await o(pe),g(pe,ve)}function S(pe){e.thinking=pe;const ve=e.activeSessionId;return pe!==void 0&&ve!==null&&ve!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ve]:pe},k3(e,ve)),pe}Je([()=>e.activeSessionId,()=>w(),()=>{const pe=e.activeSessionId;return pe==null?void 0:e.thinkingBySession[pe]}],()=>{const pe=k(w());pe!==void 0&&(e.thinking=_(e.activeSessionId,pe))});function T(pe){_t().setConfig({thinking:vJ(pe,k(w())?.supportEfforts)}).catch(ve=>n("setConfig",ve))}async function A(pe){try{const oe=await _t().listSkills(pe);f.value={...f.value,[pe]:oe}}catch{}}async function E(pe){try{const oe=await _t().listSkillsForWorkspace(pe);h.value={...h.value,[pe]:oe}}catch{}}async function P(){try{const pe=_t();c.value=await pe.listModels();const ve=k(w());ve!==void 0&&(e.thinking=_(e.activeSessionId,ve))}catch(pe){n("loadModels",pe)}}async function D(){try{const pe=_t();m.value=await pe.listProviders()}catch(pe){n("loadProviders",pe)}}async function I(pe){const ve=e.activeSessionId,oe=k(pe),ye=e.thinking,G=ve?e.sessions.find(ge=>ge.id===ve)?.model:void 0,Y=w()!==(oe?.id??pe),fe=yJ(oe,ye,Y);if(!ve)return v.value=pe,e.thinking=fe,fe!==ye&&fe!==void 0&&T(fe),!0;r(ve,ge=>({...ge,model:pe}));let we;fe!==ye&&(e.thinking=fe,fe!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ve]:fe},we=k3(e,ve)));try{await _t().updateSession(ve,{model:pe,thinking:fe!==ye?fe:void 0})}catch(ge){return r(ve,Q=>({...Q,model:G??Q.model})),fe!==ye&&(e.thinking=ye,ye!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ve]:ye}),vl(e,ve,we)&&o(ve)),n("setModel",ge,{sessionId:ve}),!1}return fe!==ye&&fe!==void 0&&T(fe),vl(e,ve,we),await o(ve),!0}function $(pe){const ve=new Set(d.value);ve.has(pe)?ve.delete(pe):ve.add(pe),d.value=Array.from(ve),cme(d.value)}async function B(pe,ve,oe,ye,G){const Y=ye??e.activeSessionId;if(!Y)return;const fe=i.value==="idle"&&!e.inFlightBySession[Y],we=`msg_skill_opt_${Date.now().toString(36)}`,ge=fe?y8(Y):void 0;if(fe){e.inFlightBySession={...e.inFlightBySession,[Y]:!0};const Q={id:we,sessionId:Y,role:"user",content:[{type:"text",text:`/${pe}${ve?` ${ve}`:""}`},...m8(oe)],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:pe,skillArgs:ve}}};l(Y,te=>[...te,Q])}try{if(G?.skipThinkingPersist!==!0){const Q=e.sessions.find(ue=>ue.id===Y)?.model,te=(Q&&Q.length>0?Q:e.defaultModel)??void 0;if(!await s({thinking:await x(Y,te)??e.thinking},Y))throw Bx}await _t().activateSkill(Y,pe,ve,m8(oe))}catch(Q){fe&&(e.inFlightBySession={...e.inFlightBySession,[Y]:!1},l(Y,te=>te.filter(ce=>ce.id!==we))),Q!==Bx&&n("activateSkill",Q,{sessionId:Y})}finally{ge!==void 0&&k8(Y,ge)}}async function H(pe){return _t().getProvider(pe)}async function O(pe){try{return await _t().addProvider(pe),await Promise.all([D(),P(),a()]),await u(),null}catch(ve){return Xl("[kimi-web] operation failed: addProvider",ve),ve instanceof Error?ve.message:String(ve)}}async function F(pe,ve){try{return await _t().updateProvider(pe,ve),await Promise.all([D(),P(),a()]),null}catch(oe){return Xl("[kimi-web] operation failed: updateProvider",oe),oe instanceof Error?oe.message:String(oe)}}async function U(pe){try{const oe=await _t().deleteProvider(pe);return await Promise.all([D(),P(),a()]),await u(),oe}catch(ve){return n("deleteProvider",ve),null}}async function z(pe){try{const ve=await _t().refreshProvider(pe);for(const oe of ve.failed)n("refreshProvider",new Error(oe.reason),{message:oe.provider});await Promise.all([D(),P(),a()])}catch(ve){n("refreshProvider",ve)}}async function W(){try{const pe=await _t().refreshAllProviders();for(const ve of pe.failed)n("refreshAllProviders",new Error(ve.reason),{message:ve.provider});await Promise.all([D(),P(),a()])}catch(pe){n("refreshAllProviders",pe)}}async function K(){try{return{kind:"ok",items:await _t().listCatalogProviders()}}catch(pe){return pe instanceof wd&&pe.code===void 0?{kind:"unsupported"}:(Xl("[kimi-web] operation failed: loadCatalogProviders",pe),{kind:"error"})}}async function V(pe){try{return await _t().importCatalogProvider(pe),await Promise.all([D(),P(),a()]),await u(),null}catch(ve){return Xl("[kimi-web] operation failed: importCatalogProvider",ve),ve instanceof Error?ve.message:String(ve)}}async function ie(pe){try{const oe=await _t().importCustomRegistry(pe);return await Promise.all([D(),P(),a()]),await u(),oe}catch(ve){return Xl("[kimi-web] operation failed: importCustomRegistry",ve),ve instanceof Error?ve.message:String(ve)}}async function ne(){try{return await _t().startOAuthLogin()}catch{return null}}async function X(){try{return await _t().pollOAuthLogin()}catch(pe){return gl("[kimi-web] pollOAuthLogin failed",pe),null}}async function le(){try{await _t().cancelOAuthLogin()}catch{}}async function Ie(){try{return await _t().getUsage()}catch(pe){return{kind:"error",message:pe instanceof Error?pe.message:String(pe)}}}function de(pe){const ve=S(pe);s({thinking:ve}),ve!==void 0&&T(ve)}return{models:c,starredModelIds:d,providers:m,draftModel:v,skillsBySession:f,skillsByWorkspace:h,loadSkillsForSession:A,loadSkillsForWorkspace:E,loadModels:P,loadProviders:D,setModel:I,thinkingLevelForModelId:b,thinkingLevelForSessionId:g,resolveThinkingForPrompt:x,toggleStarModel:$,activateSkill:B,addProvider:O,updateProvider:F,deleteProvider:U,getProvider:H,loadCatalogProviders:K,importCatalogProvider:V,importCustomRegistry:ie,refreshProvider:z,refreshAllProviders:W,startOAuthLogin:ne,pollOAuthLogin:X,cancelOAuthLogin:le,getUsage:Ie,setThinking:de}}function fme(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i,resolveThinkingForPrompt:r,refreshSessionStatus:l}=t,a=Z({}),u=R(()=>{const O=e.activeSessionId;if(!O)return null;const F=a.value[O];return F?{parentId:O,agentId:F.agentId}:null}),c=R(()=>u.value?.parentId??null),d=R(()=>u.value!==null),f=R(()=>{const O=u.value;return O?!!e.sideChatSendingByAgent[O.agentId]:!1}),h=R(()=>{const O=u.value;return O?e.sideChatSendingByAgent[O.agentId]?!0:(e.tasksBySession[O.parentId]??[]).some(F=>F.id===O.agentId&&F.status==="running"):!1}),m=O=>_t().getFileUrl(O),v=[],k=KT(),w=R(()=>{const O=u.value;return O?k({messages:e.sideChatMessagesByAgent[O.agentId]??[],approvals:v,getFileUrl:m,sessionActive:h.value}):[]});function b(O,F){e.sideChatMessagesByAgent[O]=F(e.sideChatMessagesByAgent[O]??[])}function _(O,F){b(O,U=>[...U,F])}function g(O,F){b(O,U=>{const z=U.find(W=>W.id===F);return z?.promptId!==void 0||z?.userMessageId!==void 0?U:U.filter(W=>W.id!==F)})}function x(O,F){const U=e.sideChatUserMessageIdsBySession[O]??[];U.includes(F)||(e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[O]:[...U,F]})}function S(O,F,U,z){b(O,W=>{const K=W.findIndex(X=>X.id===F);if(K===-1)return W;const V=W.findIndex((X,le)=>le!==K&&X.role==="user"&&(X.id===z||X.userMessageId===z||X.promptId===U)),ie=W[K],ne=V===-1?ie:W[V];return W.flatMap((X,le)=>le===V?[]:le!==K?[X]:[{...ne,id:ie.id,promptId:U,userMessageId:z,metadata:{...ne.metadata,...ie.metadata}}])})}function T(O,F){x(F.sessionId,F.userMessageId??F.id),b(O,U=>{const z=U.findIndex(V=>V.role==="user"&&(V.userMessageId===(F.userMessageId??F.id)||V.promptId!==void 0&&V.promptId===F.promptId));if(z===-1)return[...U,F];const W=U[z],K=[...U];return K[z]={...F,id:W.id,promptId:F.promptId??W.promptId,userMessageId:F.userMessageId??F.id,metadata:{...F.metadata,...W.metadata}},K})}function A(O,F,U){U&&b(O,z=>{const W=z.at(-1);if(W?.role==="assistant"){const K=W.content[0],V=K?.type==="text"?K.text:"";return[...z.slice(0,-1),{...W,content:[{type:"text",text:`${V}${U}`}]}]}return[...z,{id:o(),sessionId:F,role:"assistant",content:[{type:"text",text:U}],createdAt:new Date().toISOString()}]})}function E(O,F,U){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[O]:!1},!U)return;const W=(e.sideChatMessagesByAgent[O]??[]).at(-1);(W?.role==="assistant"&&W.content[0]?.type==="text"?W.content[0].text:"").trim().length>0||A(O,F,U)}async function P(O){const F=e.activeSessionId;F&&await D(F,O)}async function D(O,F){if(!a.value[O]){let U;try{({agentId:U}=await _t().startBtw(O))}catch(z){n("openSideChat",z,{sessionId:O});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[U]:e.sideChatMessagesByAgent[U]??[]},a.value={...a.value,[O]:{agentId:U}},s(),i()?.markSideChannelAgent(O,U)}F&&F.trim()&&await I(O,F.trim())}async function I(O,F){const U=a.value[O],z=F.trim();if(!U||!z)return;const W=O,K=U.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[K]:!0};const V=o(),ie={id:V,sessionId:W,role:"user",content:[{type:"text",text:z}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};_(K,ie);let ne;try{const X=e.sessions.find(pe=>pe.id===W),le=(X?.model&&X.model.length>0?X.model:e.defaultModel)??void 0,Ie=await r(W,le)??e.thinking;ne=e.pendingThinkingBySession[W];const de=await _t().submitPrompt(W,{content:[{type:"text",text:z}],agentId:K,model:le,thinking:Ie,permissionMode:e.permission,planMode:e.planModeBySession[W]??!1,swarmMode:e.swarmModeBySession[W]??!1});Ie!==void 0&&vl(e,W,ne),S(K,V,de.promptId,de.userMessageId),x(W,de.userMessageId)}catch(X){vl(e,W,ne)&&l(W),n("sendSideChatPrompt",X,{sessionId:W}),g(K,V),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[K]:!1}}}function $(){const O=e.activeSessionId;if(!O)return;const{[O]:F,...U}=a.value;a.value=U}async function B(O){const F=u.value;F&&await I(F.parentId,O)}function H(O){if(!a.value[O])return;const{[O]:F,...U}=a.value;a.value=U}return{sideChatTargetBySession:a,sideChatSessionId:c,sideChatVisible:d,sideChatSending:f,sideChatRunning:h,sideChatTurns:w,appendSideChatAssistantText:A,finishSideChatAgent:E,reconcileSideChatUserMessage:T,openSideChat:P,openSideChatOn:D,closeSideChat:$,sendSideChatPrompt:B,clearSideChatForSession:H}}class pme{transcript;sessionId;agentId;fetchPage;pageSize;onChange;onGap;refreshPromise=null;buffered=[];agents_=[];seq_;loadingOlder_=!1;loadOlderError_=!1;refreshError_=!1;constructor(t){this.sessionId=t.sessionId,this.agentId=t.agentId,this.transcript=new tj(t.agentId),this.fetchPage=t.fetchPage,this.pageSize=t.pageSize??20,this.onChange=t.onChange,this.onGap=t.onGap}get snapshot(){return this.transcript.snapshot()}get seq(){return this.seq_}get agents(){return this.agents_}get loading(){return this.refreshPromise!==null}get loadingOlder(){return this.loadingOlder_}get loadOlderError(){return this.loadOlderError_}get refreshError(){return this.refreshError_}refresh(){if(this.refreshPromise!==null)return this.refreshPromise;this.refreshError_=!1;const t=this.fetchPage({pageSize:this.pageSize}).then(n=>this.applyPage(n,!0)).catch(n=>{throw this.refreshError_=!0,n}).finally(()=>{this.refreshPromise=null;const n=this.buffered;this.buffered=[];for(const o of n)this.applyOps(o.ops,o.seq);this.onChange?.()});return this.refreshPromise=t,this.onChange?.(),t}receiveReset(t,n){this.transcript.receive([{op:"reset",agentId:this.agentId,snapshot:t}]),n!==void 0&&(this.seq_=n),this.refreshError_=!1,this.onChange?.()}applyOps(t,n){if(this.refreshPromise!==null||this.loadingOlder_)return this.buffered.push({ops:t,...n!==void 0?{seq:n}:{}}),!1;if(n!==void 0&&this.seq_!==void 0){if(n<=this.seq_)return!0;if(n!==this.seq_+1)return this.onGap?.(),!1}const o=this.transcript.apply(t);return n!==void 0&&(this.seq_=n),o.gap!==void 0&&this.onGap?.(),o.accepted.length>0&&this.onChange?.(),o.gap===void 0}async loadOlder(){if(!this.snapshot.hasMoreOlder||this.loadingOlder_)return;const t=this.snapshot.items.find(n=>n.kind==="turn");if(t?.kind==="turn"){this.loadingOlder_=!0,this.loadOlderError_=!1,this.onChange?.();try{const n=await this.fetchPage({beforeTurn:t.turnId,pageSize:this.pageSize});this.applyPage(n,!1)}catch(n){throw this.loadOlderError_=!0,n}finally{this.loadingOlder_=!1;const n=this.buffered;this.buffered=[];for(const o of n)this.applyOps(o.ops,o.seq);this.onChange?.()}}}applyPage(t,n){this.agents_=t.agents;const o=this.snapshot,s=n?t:{...t,items:hme(t.items,o.items),hasMoreOlder:t.hasMoreOlder};this.receiveReset(s,n?t.seq:void 0)}}function hme(e,t){const n=new Set,o=[];for(const s of[...e,...t]){const i=s.kind==="turn"?s.turnId:s.kind==="marker"?s.markerId:s.refId;n.has(i)||(n.add(i),o.push(s))}return o}function mme(e){const t=qS(new Map),n=new Map,o=new Map,s=new Set;let i=null,r=null;function l(){i!==null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(i),i=null),r!==null&&(clearTimeout(r),r=null);for(const _ of s)_.version.value+=1;s.clear()}function a(_){s.add(_),!(i!==null||r!==null)&&(typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(l)),r=setTimeout(l,50))}function u(_,g){return`${_}\0${g}`}function c(_,g,x){const S=e.getEventConnection();S!==null&&(S.subscribeTranscript(_,g,x),o.set(_,g))}function d(_,g){const x=u(_,g),S=t.get(x);if(S!==void 0)return S;const T={channel:new pme({sessionId:_,agentId:g,fetchPage:A=>e.api.getSessionTranscript(_,{...A,agentId:g}),onChange:()=>{a(T)},onGap:()=>{f(T)}}),version:Z(0),baselineLoaded:!1,resumePromise:null};return t.set(x,T),T}async function f(_){if(_.resumePromise!==null)return _.resumePromise;const g=h(_).finally(()=>{_.resumePromise===g&&(_.resumePromise=null)});return _.resumePromise=g,g}async function h(_){try{await _.channel.refresh(),_.baselineLoaded=!0,n.get(_.channel.sessionId)===_.channel.agentId&&c(_.channel.sessionId,_.channel.agentId,_.channel.seq)}catch{n.get(_.channel.sessionId)===_.channel.agentId&&c(_.channel.sessionId,_.channel.agentId)}}function m(_,g){e.connectEventsIfNeeded(),n.set(_,g);const x=d(_,g);return x.baselineLoaded?c(_,g,x.channel.seq):f(x),x}function v(_,g){if(n.get(_)!==g)return;n.delete(_);const x=o.get(_);x!==void 0&&(e.getEventConnection()?.unsubscribeTranscript(_,[x]),o.delete(_))}function k(_,g,x,S){if(n.get(_)!==g)return;const T=d(_,g);T.channel.receiveReset(x,S),T.baselineLoaded=!0}function w(_,g,x,S){return n.get(_)!==g?!0:d(_,g).channel.applyOps(x,S)}function b(_){n.delete(_),o.delete(_)&&e.getEventConnection()?.unsubscribeTranscript(_);for(const[g,x]of t)x.channel.sessionId===_&&(t.delete(g),s.delete(x))}return{getEntry:(_,g)=>t.get(u(_,g)),activate:m,deactivate:v,receiveReset:k,applyOps:w,forgetSession:b}}const $h=XT(),Da=phe(),nN=cn.permission,oN=cn.activeWorkspace,sN=cn.planMode,iN=cn.swarmMode,rN=cn.goalMode,Hx=40401,Ag=cn.onboarded;ur(cn.codeFont);ur(cn.accent);ur(cn.theme);ur(cn.thinking);ur(cn.notifyOnComplete);ur(cn.notifyOnQuestion);ur(cn.notifyOnApproval);ur(cn.soundOnComplete);function gme(){try{const e=ui(nN);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function vme(e){try{Ls(nN,e)}catch{}}function b4(e){const t=ui(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,i]of Object.entries(n))i===!0&&(o[s]=!0);return o}catch{return{}}}function P5(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);Ls(e,JSON.stringify(n))}catch{}}function lN(){P5(sN,Me.planModeBySession)}function aN(){P5(iN,Me.swarmModeBySession)}function uN(){P5(rN,Me.goalModeBySession)}function yme(){try{return ui(oN)}catch{return null}}const cN=cn.hiddenWorkspaces;function kme(){try{const e=ui(cN);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function bme(e){try{Ls(cN,JSON.stringify(e))}catch{}}function Cme(e){try{Ls(oN,e)}catch{}}function wme(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Me=Go({...oY(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",experimentalFlags:{},workspaceName:"kimi-web",connection:"disconnected",permission:gme(),thinking:void 0,thinkingBySession:{},pendingThinkingBySession:{},planModeBySession:b4(sN),swarmModeBySession:b4(iN),goalModeBySession:b4(rN),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:Ey(),authReady:!1,defaultModel:null,managedProviderStatus:null,managedUserInfo:null,managedMembership:null,workspaces:[],activeWorkspaceId:yme(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:kme(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1,flatSessionsNextPageToken:null,flatSessionsHasMore:!0,flatSessionsLoading:!1,flatSessionsLoadingMore:!1,flatSessionsSeeded:!1,flatSessionsFrontier:null}),Mg=Go({}),np=new Map,If=new Map;function _me(e,t){return`${e}\0${t??"*"}`}async function b8(e,t){const n=_me(e,t),o=(np.get(n)??0)+1;np.set(n,o),t!==void 0&&If.set(e,(If.get(e)??0)+1);const s=If.get(e)??0;try{const i=await _t().getSessionPlans(e,{agentId:"main",toolCallId:t});if(np.get(n)!==o||t===void 0&&(If.get(e)??0)!==s||!Me.sessions.some(l=>l.id===e))return;const r=Object.fromEntries(i.map(l=>[l.toolCallId,l]));Mg[e]=t===void 0?r:{...Mg[e],...r}}catch(i){gl("[refreshSessionPlans] plan history unavailable for",e,i)}}function xme(e){const t=`${e}\0`;for(const n of np.keys())n.startsWith(t)&&np.delete(n);If.delete(e),delete Mg[e]}const F2=Go({planMode:!1,swarmMode:!1,goalMode:!1});function D5(e){Me.sessions=e}function R2(e,t){Me.sessions=Me.sessions.map(n=>n.id===e?t(n):n)}function Sme(e){Me.sessions=[e,...Me.sessions.filter(t=>t.id!==e.id)]}function Ame(e){Me.sessions=[...Me.sessions,e]}function Mme(e){Me.sessions=Me.sessions.filter(t=>t.id!==e)}function dN(){const e=Me.activeSessionId;e&&Me.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Me.unreadBySession[e]=!1,Iy({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===cn.unread&&(Me.unreadBySession=Ey(),dN())});function C8(){if(rr===null||!rr.health().stale)return;bi("ws:stale-reconnect",{sessionId:Me.activeSessionId,status:"stale"}),D0e("ws: stale socket on focus, reconnecting",{activeSessionId:Me.activeSessionId}),rr.reconnect();const e=Me.activeSessionId;e&&Lg.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(dN(),C8())});typeof window<"u"&&(window.addEventListener("focus",C8),window.addEventListener("online",C8));function B5(e){Me.activeSessionId=e}function Tme(e){Ni(Me.messagesBySession,e)}function Eme(e,t){Me.messagesBySession[e]=t}function fN(e,t){Me.messagesBySession[e]=t(Me.messagesBySession[e]??[])}function Ime(e){delete Me.messagesBySession[e]}function pN(e){rr?.unsubscribe(e),Tg.forgetSession(e),ege(e),Gd.discard(({meta:t})=>t.sessionId===e),Mme(e),Ime(e),xme(e),delete Me.approvalsBySession[e],delete Me.questionsBySession[e],delete Me.tasksBySession[e],delete Me.goalBySession[e],delete Me.gitStatusBySession[e],delete Me.lastSeqBySession[e],delete Me.compactionBySession[e],delete Me.messagesLoadingMoreBySession[e],delete Me.messagesHasMoreBySession[e],delete Me.messagesLoadMoreErrorBySession[e],delete w8[e],Ig.delete(e),um.delete(e),MN.delete(e),ime(e),delete Me.queuedBySession[e],delete Me.promptIdBySession[e],delete Me.inFlightBySession[e],delete Me.turnActiveBySession[e],delete Me.turnEndedPromptIdBySession[e],delete Me.turnErrorBySession[e],delete Me.turnRetryBySession[e],delete Me.planModeBySession[e],delete Me.swarmModeBySession[e],delete Me.goalModeBySession[e],delete Me.thinkingBySession[e],delete Me.pendingThinkingBySession[e],lN(),aN(),uN(),Yo.value.includes(e)&&(Yo.value=uE(Yo.value,e),k1(Yo.value))}const hN=Z(null),mN=Z([]),gN=Z(!1),vN=Z(null),yN=Z(!1),kN=Z(!1),bN=Z(null);async function _c(e){let t;try{t=await _t().getSessionStatus(e)}catch{return}R2(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Me.swarmModeBySession[e]=t.swarmMode,Me.planModeBySession[e]=t.planMode,t.thinkingEffort.length>0&&rE(Me,e,t.thinkingEffort)}async function Lme(e){const t=Me.goalVersionBySession[e]??0;let n;try{n=await _t().getSessionGoal(e)}catch{return}(Me.goalVersionBySession[e]??0)===t&&(n===null||n.status==="complete"?delete Me.goalBySession[e]:Me.goalBySession[e]=n)}function CN(e,t){const n=t??Me.activeSessionId;if(!n)return Promise.resolve(!1);const o=e.thinking!==void 0?Me.pendingThinkingBySession[n]:void 0;return Promise.resolve(_t().updateSession(n,e)).then(()=>(vl(Me,n,o),_c(n))).then(()=>!0).catch(s=>(vl(Me,n,o)&&_c(n),t0("persistSessionProfile",s,{sessionId:n}),!1))}function wN(e){try{return ui(e)??""}catch{return""}}function $me(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("kimi_onboarded")==="1"}const _N=$me();if(_N&&wN(Ag)!=="1")try{Ls(Ag,"1")}catch{}const xN=Z(_N||wN(Ag)==="1");function Nme(e){xN.value=e;try{Ls(Ag,e?"1":"0")}catch{}e&&window.kimiDesktop?.setOnboarded?.()}let rr=null;const Tg=mme({api:_t(),connectEventsIfNeeded:H5,getEventConnection:()=>rr});let zx=0;function SN(){return zx+=1,`msg_opt_${Date.now().toString(36)}_${zx}`}function Wx(e,t,n){const o={sessions:Me.sessions,activeSessionId:Me.activeSessionId,messagesBySession:Me.messagesBySession,approvalsBySession:Me.approvalsBySession,planReviewByToolCallId:Me.planReviewByToolCallId,questionsBySession:Me.questionsBySession,tasksBySession:Me.tasksBySession,goalBySession:Me.goalBySession,goalVersionBySession:Me.goalVersionBySession,lastSeqBySession:Me.lastSeqBySession,turnActiveBySession:Me.turnActiveBySession,turnEndedPromptIdBySession:Me.turnEndedPromptIdBySession,turnErrorBySession:Me.turnErrorBySession,turnRetryBySession:Me.turnRetryBySession,compactionBySession:Me.compactionBySession,config:Me.config,warnings:Me.warnings},s=fY(o,e,{sessionId:t,seq:n},{t:(i,r)=>r===void 0?Hn.global.t(i):Hn.global.t(i,r)});s.sessions!==o.sessions&&D5(s.sessions),s.activeSessionId!==o.activeSessionId&&B5(s.activeSessionId),Tme(s.messagesBySession),Ni(Me.approvalsBySession,s.approvalsBySession),Ni(Me.planReviewByToolCallId,s.planReviewByToolCallId),Ni(Me.questionsBySession,s.questionsBySession),Ni(Me.tasksBySession,s.tasksBySession),Ni(Me.goalBySession,s.goalBySession),Ni(Me.goalVersionBySession,s.goalVersionBySession),Ni(Me.lastSeqBySession,s.lastSeqBySession),Ni(Me.turnActiveBySession,s.turnActiveBySession),Ni(Me.turnEndedPromptIdBySession,s.turnEndedPromptIdBySession),Ni(Me.turnErrorBySession,s.turnErrorBySession),Ni(Me.turnRetryBySession,s.turnRetryBySession),Ni(Me.compactionBySession,s.compactionBySession),s.config!==o.config&&(Me.config=s.config??null),pY(s.warnings,o.warnings)||(Me.warnings=s.warnings),e.type==="configChanged"&&(Me.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Rn.loadModels(),Rn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Me.swarmModeBySession[e.sessionId]=e.swarmMode),e.planMode!==void 0&&(Me.planModeBySession[e.sessionId]=e.planMode),e.thinking!==void 0&&rE(Me,e.sessionId,e.thinking)),e.type==="sessionDeleted"&&V5(e.sessionId)}function Fme(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="user")return;if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type==="toolUse"&&s.toolName==="ExitPlanMode")return s.toolCallId}}}function Rme(e,t){const n=Me.lastSeqBySession[t.sessionId]??0,o=Me.turnActiveBySession[t.sessionId]??!1,s=e.type==="approvalResolved"||e.type==="approvalExpired"?Me.approvalsBySession[t.sessionId]?.find(r=>r.approvalId===e.approvalId&&r.toolName==="ExitPlanMode")?.toolCallId:void 0,i=si.sideChatTargetBySession.value[t.sessionId];if(e.type==="messageCreated"&&e.message.role==="user"&&e.agentId!==void 0&&Object.prototype.hasOwnProperty.call(Me.sideChatMessagesByAgent,e.agentId)){Wx({type:"unknown",raw:{_noop:!0}},t.sessionId,t.seq),si.reconcileSideChatUserMessage(e.agentId,e.message);return}if(Wx(e,t.sessionId,t.seq),i){const{agentId:r}=i,l=t.sessionId;e.type==="agentDelta"&&e.agentId===r?e.delta.text&&si.appendSideChatAssistantText(r,l,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===r?si.finishSideChatAgent(r,l):e.type==="taskProgress"&&e.taskId===r?si.appendSideChatAssistantText(r,l,e.outputChunk):e.type==="taskCompleted"&&e.taskId===r&&si.finishSideChatAgent(r,l,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const r=e.message.sessionId;Me.promptIdBySession[r]!==e.message.promptId&&(Me.promptIdBySession[r]=e.message.promptId)}if(e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const r=e.reason;y2e(e.sessionId,r==="cancelled"||r==="failed"||r==="blocked"?"aborted":"idle",o);const l=Fme(Me.messagesBySession[e.sessionId]??[]);l!==void 0&&b8(e.sessionId,l)}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&o||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&v2e(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&Me.promptIdBySession[e.sessionId]===e.promptId&&At.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&k2e(e.sessionId,e.question),e.type==="approvalRequested"&&b2e(e.sessionId,e.approval),s!==void 0&&b8(t.sessionId,s)}const Gd=gX(({appEvent:e,meta:t})=>Rme(e,t),({appEvent:e})=>fX(e),{coalesce:yX}),Ome=3e4;let Ux=0,oi=null;const op=new Map;let Eg=0,Yd=null;function Pme(){Yd!==null&&(clearTimeout(Yd),Yd=null)}function jx(e){if(!Me.connected||Yd!==null)return;const t=Math.min(Ome,1e3*2**Eg);Eg+=1,gl("[kimi-web] session work reconciliation incomplete; retrying",e),Yd=setTimeout(()=>{Yd=null,Me.connected&&AN()},t)}function Dme(e,t){const n=new Map(e.map(u=>[u.id,u]));let o=!1,s=!1;const i={...Me.turnActiveBySession},r=[],l=new Map,a=Me.sessions.map(u=>{const c=n.get(u.id);if(c===void 0)return u;const d=t.workEventSeqBySession.get(u.id)??0,f=t.turnEventSeqBySession.get(u.id)??0,h=t.pendingEventBySession.get(u.id),m=d>c.lastSeq,v=f>c.lastSeq,k=h!==void 0&&h.seq>c.lastSeq,w=m||v&&u.mainTurnActive===!0?u.busy||u.mainTurnActive===!0:c.busy,b=m||v?u.mainTurnActive:c.mainTurnActive??(w?u.mainTurnActive:!1),_=k?h.source==="work"?u.pendingInteraction:(Me.approvalsBySession[u.id]?.length??0)>0?"approval":(Me.questionsBySession[u.id]?.length??0)>0?"question":"none":c.pendingInteraction??(w?u.pendingInteraction:"none");(k&&h.source==="work"||!k&&(c.pendingInteraction!==void 0||c.busy===!1))&&_!==void 0&&l.set(u.id,_);const g=m?u.lastTurnReason:c.lastTurnReason;op.set(u.id,Math.max(op.get(u.id)??0,c.lastSeq));const x=t.turnStartBySession.get(u.id);return(b===!1||b===void 0&&!w)&&t.witnessedTurnBySession.has(u.id)&&x!==void 0&&At.isLocalTurnSnapshotCurrent(u.id,x)&&r.push(u.id),b===!0&&!i[u.id]?(i[u.id]=!0,s=!0):(b===!1||!w)&&i[u.id]&&(delete i[u.id],s=!0),u.busy===w&&u.mainTurnActive===b&&u.pendingInteraction===_&&u.lastTurnReason===g?u:(o=!0,{...u,busy:w,mainTurnActive:b,pendingInteraction:_,lastTurnReason:g})});o&&D5(a),s&&Ni(Me.turnActiveBySession,i);for(const[u,c]of l)c==="none"?(delete Me.approvalsBySession[u],delete Me.questionsBySession[u]):c==="question"&&delete Me.approvalsBySession[u];for(const u of r)At.finishPromptLocal(u,{turnWasActive:!0})}async function AN(){const e={workEventSeqBySession:new Map,turnEventSeqBySession:new Map,pendingEventBySession:new Map,turnStartBySession:new Map(Me.sessions.map(t=>[t.id,At.localTurnStartState(t.id)])),witnessedTurnBySession:new Set(Me.sessions.filter(t=>Me.inFlightBySession[t.id]||Me.turnActiveBySession[t.id]).map(t=>t.id))};oi=e;try{const t=await At.listAllSessionsGlobal({shouldContinue:()=>oi===e&&Me.connected});if(oi!==e||!Me.connected)return;Gd.flush(),Dme(t.sessions,e),oi=null,t.error!==void 0?jx(t.error):Eg=0}catch(t){if(oi!==e||!Me.connected)return;oi=null,jx(t)}}function H5(){if(rr!==null||typeof WebSocket>"u")return;bi("ws:connection",{status:"connecting"}),Me.connection="connecting",rr=_t().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){At.applyWorkspaceEvent(t);return}const o=t.type==="sessionWorkChanged",s=t.type==="turnActiveChanged",i=t.type==="approvalRequested"||t.type==="approvalResolved"||t.type==="approvalExpired"||t.type==="questionRequested"||t.type==="questionAnswered"||t.type==="questionDismissed";if((o||s||i)&&n.seq>0){const r=op.get(n.sessionId)??0;if(n.seq<=r)return;op.set(n.sessionId,n.seq)}if(oi!==null&&(o||s||i))if(o){const r=oi.workEventSeqBySession.get(n.sessionId)??0;if(n.seq>r&&oi.workEventSeqBySession.set(n.sessionId,n.seq),t.pendingInteraction!==void 0||!t.busy){const l=oi.pendingEventBySession.get(n.sessionId);(l===void 0||n.seq>l.seq)&&oi.pendingEventBySession.set(n.sessionId,{seq:n.seq,source:"work"})}}else if(s){const r=oi.turnEventSeqBySession.get(n.sessionId)??0;n.seq>r&&oi.turnEventSeqBySession.set(n.sessionId,n.seq)}else{const r=oi.pendingEventBySession.get(n.sessionId);(r===void 0||n.seq>r.seq)&&oi.pendingEventBySession.set(n.sessionId,{seq:n.seq,source:"interaction"})}for(const r of vX({appEvent:t,meta:n}))Gd(r)},onResync(t,n,o){bi("ws:resync",{sessionId:t,status:"required",seq:n}),Gd.flush(),Ig.add(t),Lg.request(t)},onError(t,n,o){bi("ws:error",{status:"failed",errorCode:t,fatal:o}),O2({severity:"error",title:Hn.global.t("warnings.wsTitle"),message:n,details:[Lo("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){bi("ws:connection",{status:t?"connected":"disconnected"}),Me.connected=t,Me.connection=t?"connected":"disconnected",t||(oi=null,op.clear(),Pme(),Eg=0),t&&(Ux+=1,qme(),At.refreshServerMeta())},onReplayComplete(){Gd.flush(),Ux>1&&AN()},onTranscriptReset(t,n,o,s){Tg.receiveReset(t,n,o,s)},onTranscriptOps(t,n,o,s){return Tg.applyOps(t,n,o,s)}})}const w8={},Ig=new Set,um=new Set,MN=new Set;function Bme(e){return Us(e)&&e.code===Hx?!0:typeof e=="object"&&e!==null&&e.code===Hx}function Lo(e,t){if(!(t==null||t===""))return{label:Hn.global.t(`warnings.details.${e}`),value:TN(t)}}function TN(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Hme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function zme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Wme(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function Ume(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function Vx(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function jme(e,t,n){const o=iy(t),s=Us(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Lo("operation",e),Lo("sessionId",n??Me.activeSessionId),Lo("connection",Me.connection),Lo("timestamp",Ume(i??Date.now()))];return o?l.push(Lo("duration",Vx(r)),Lo("request",`${t.method} ${t.path}`),Lo("endpoint",t.url),Lo("requestId",t.requestId),Lo("phase",t.phase),Lo("timeout",`${t.timeoutMs}ms`),Lo("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Lo("contentType",t.contentType),Lo("responsePreview",t.bodyPreview),Lo("cause",t.cause)):s?l.push(Lo("duration",Vx(r)),Lo("code",t.code),Lo("requestId",t.requestId),Lo("message",t.message),Lo("details",t.details)):l.push(Lo("errorName",Hme(t)),Lo("message",zme(t)??TN(t)),Lo("stack",Wme(t))),l.filter(a=>a!==void 0)}function Vme(e,t,n={}){const o=iy(t),s=Us(t),i=n.title??(o?Hn.global.t("warnings.daemonNetworkTitle"):s?Hn.global.t("warnings.daemonApiTitle"):Hn.global.t("warnings.operationFailedTitle")),r=n.message??(o?Hn.global.t("warnings.daemonNetworkMessage"):s?t.message:Hn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:jme(e,t,n.sessionId)}}function O2(e){Me.warnings=[...Me.warnings,e]}function qme(){const e=Hn.global.t("warnings.wsTitle"),t=Me.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Me.warnings.length&&(Me.warnings=t)}function t0(e,t,n){Xl(`[kimi-web] operation failed: ${e}`,t);const o=Us(t),s=iy(t);bi("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:o?t.code:void 0,requestId:o||s?t.requestId:void 0,phase:s?t.phase:void 0,httpStatus:s?t.status:void 0}),O2(Vme(e,t,n))}const Kme={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function Zme(e){if(!Us(e)||e.code===void 0)return;const t=Kme[e.code];return t?Hn.global.t(t):void 0}async function Gme(e){if(pN(e),Me.activeSessionId!==e)return;const t=Me.sessions[0];t?await At.selectSession(t.id,{urlMode:"replace"}):(B5(void 0),Me.sessionLoading=!1,At.writeSessionUrl(void 0,"replace"))}const qx=new Set;async function Yme(e){if(!qx.has(e)){qx.add(e);try{const t=await _t().getSessionWarnings(e),n=Hn.global.t("warnings.noteLabel");for(const o of t)O2(`${n}: ${o.message}`)}catch{}}}async function z5(e,t){const n=At.localTurnStartState(e);try{const s=await _t().getSessionSnapshot(e);if(!Me.sessions.some(c=>c.id===e))return"ok";Gd.flush();const i=Me.lastSeqBySession[e]??0,r=w8[e],l=Ig.has(e)||$g.has(e);if(!l&&r!==void 0&&r===s.epoch&&i>s.asOfSeq)return um.delete(e)||(um.add(e),Lg.request(e)),"ok";if(!At.isLocalTurnSnapshotCurrent(e,n))return At.afterLocalTurnStartsSettle(e,()=>{Lg.request(e)}),"ok";const a=Me.turnRetryBySession[e];a!==void 0&&a.turnId!==s.inFlightTurn?.turnId&&delete Me.turnRetryBySession[e],(l||s.session.lastTurnReason!=="failed")&&delete Me.turnErrorBySession[e];const u=o3(s.session.usage);R2(e,c=>({...s.session,model:s.session.model&&s.session.model.length>0?s.session.model:c.model,usage:u?c.usage:s.session.usage,updatedAt:!s.session.mainTurnActive&&s.session.updatedAt>c.updatedAt?s.session.updatedAt:c.updatedAt})),Eme(e,gQ(Me.messagesBySession[e]??[],s.messages)),Me.tasksBySession[e]=_Q(s.subagents,Me.tasksBySession[e]??[]),Me.messagesHasMoreBySession[e]=s.hasMoreMessages,Me.approvalsBySession[e]=s.pendingApprovals;for(const c of s.pendingApprovals){const d=c.display;d?.kind==="plan_review"&&typeof d.plan=="string"&&d.plan.length>0&&(Me.planReviewByToolCallId[c.toolCallId]={plan:d.plan,path:typeof d.path=="string"?d.path:void 0})}return Me.questionsBySession[e]=s.pendingQuestions,Me.lastSeqBySession[e]=s.asOfSeq,w8[e]=s.epoch,Ig.delete(e),um.delete(e),At.handleSessionSnapshot(e,{inFlightTurn:s.inFlightTurn,busy:s.session.busy}),s.session.mainTurnActive??(s.inFlightTurn!==null&&s.session.busy)?Me.turnActiveBySession[e]=!0:delete Me.turnActiveBySession[e],H5(),rr&&(rr.seedSnapshot(e,s),rr.subscribe(e,{seq:s.asOfSeq,epoch:s.epoch}),Qme(e)),$g.delete(e),u&&t?.skipStatusRefresh!==!0&&_c(e),Yme(e),"ok"}catch(o){return Bme(o)?(await Gme(e),"not-found"):(t0("getSessionSnapshot",o,{title:Hn.global.t("warnings.sessionSnapshotTitle"),message:Hn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Lg=vQ(z5);function Xme(e){return Object.prototype.hasOwnProperty.call(Me.messagesBySession,e)}const Jme=4,ql=[],$g=new Set;function Qme(e){const t=ql.indexOf(e);for(t!==-1&&ql.splice(t,1),ql.unshift(e);ql.length>Jme;){let n=-1;for(let s=ql.length-1;s>=0;s--)if(ql[s]!==Me.activeSessionId){n=s;break}if(n===-1)break;const[o]=ql.splice(n,1);if(o===void 0)break;rr?.unsubscribe(o),$g.add(o)}}function ege(e){const t=ql.indexOf(e);t!==-1&&ql.splice(t,1),$g.delete(e)}async function tge(e){return z5(e)}function u1(e,t){return(Me.inFlightBySession[e]??!1)||(Me.turnActiveBySession[e]??!1)||(t??Me.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function n0(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return Hn.global.t("sessions.justNow");if(s<1)return`${Math.round(o/6e4)}m`;if(s<24)return`${Math.round(s)}h`;const i=o/864e5;return i<7?`${Math.round(i)}d`:i<30?`${Math.round(i/7)}w`:i<365?`${Math.round(i/30)}mo`:`${Math.round(i/365)}y`}catch{return e}}const nge=3e4,xc=Z(0);let C4=null;function oge(){C4===null&&(C4=setInterval(()=>{xc.value=(xc.value+1)%Number.MAX_SAFE_INTEGER},nge),C4.unref?.())}function sge(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:o,diff:t.diff};const s=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,i=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(s!==void 0&&i!==void 0){const r=r1(s,i)??Pm(s,i);return{kind:"diff",path:o,diff:r}}return{kind:"diff",path:o,diff:[]}}if(n==="file_io"){const o=typeof t.path=="string"?t.path:"",s=typeof t.operation=="string"?t.operation:"";if(s==="write"&&typeof t.content=="string")return{kind:"file",path:o,content:t.content};if(s==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=r1(t.before,t.after)??Pm(t.before,t.after);return{kind:"diff",path:o,diff:r}}const i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s||n,path:o,detail:i}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:DT(o);return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function ige(e){return{questionId:e.questionId,sessionId:e.sessionId,toolCallId:e.toolCallId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel}))}}function rge(e){const t=Me.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function lge(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":t="fail";let n="";if(e.status==="running"&&e.startedAt){const r=Math.round((Date.now()-new Date(e.startedAt).getTime())/1e3),l=Math.floor(r/60),a=r%60;n=Hn.global.t("tasks.timingRunning",{time:`${l}:${String(a).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){const r=Math.round((new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime())/1e3);n=Hn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??rge(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,agentId:e.agentId,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId,model:e.model,thinkingEffort:e.thinkingEffort}}const age=R(()=>{const e=Me.sessions.find(n=>n.id===Me.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Me.workspaceName,branch:t}}),uge=R(()=>(xc.value,Me.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:n0(e.updatedAt),busy:u1(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason,workspaceId:Ml(e),cwd:e.cwd})))),cge=R(()=>Me.activeSessionId??""),dge=R(()=>{const e=Me.activeSessionId;if(e)return Rn.skillsBySession.value[e]??[];const t=P2.value;return t?Rn.skillsByWorkspace.value[t]??[]:[]}),W5=R(()=>{const e=Me.activeSessionId;return e?Me.inFlightBySession[e]??!1:!1}),fge=R(()=>At.isStartingFirstPrompt()),si=fme(Me,{pushOperationFailure:t0,nextOptimisticMsgId:SN,connectEventsIfNeeded:H5,getEventConn:()=>rr,resolveThinkingForPrompt:(e,t)=>Rn.resolveThinkingForPrompt(e,t),refreshSessionStatus:_c}),o0=R(()=>{const e=Me.activeSessionId;if(!e)return[];const t=si.sideChatTargetBySession.value[e]?.agentId;return(Me.tasksBySession[e]??[]).filter(n=>n.id!==t)}),EN=ghe(Me,o0),s0=R(()=>{const e=Me.activeSessionId;return e?(Me.turnActiveBySession[e]??!1)||(Me.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),pge=R(()=>{const e=Me.activeSessionId;if(e)return Me.turnErrorBySession[e]}),hge=R(()=>{const e=Me.activeSessionId;if(e&&s0.value)return Me.turnRetryBySession[e]}),IN=e=>_t().getFileUrl(e),mge=[],gge=KT(),vge=R(()=>{const e=Me.activeSessionId;if(!e)return[];const t=new Set(Me.sideChatUserMessageIdsBySession[e]??[]);return gge({messages:(Me.messagesBySession[e]??[]).filter(n=>!t.has(n.id)),approvals:Me.approvalsBySession[e]??mge,getFileUrl:IN,sessionActive:s0.value,planReviewByToolCallId:Me.planReviewByToolCallId,plansByToolCallId:Mg[e]})}),yge=R(()=>W5.value||s0.value),kge=R(()=>(EN.taskClock.value,o0.value.map(lge))),LN=R(()=>IX(o0.value)),bge=R(()=>$X(o0.value)),vd=R(()=>{const e=Me.activeSessionId;return e?Me.goalBySession[e]??null:null}),Cge=R(()=>{const e=Me.activeSessionId;return e?bX(Me.messagesBySession[e]??[]):[]}),wge=R(()=>{const e=Me.activeSessionId;return e?Me.compactionBySession[e]??null:null}),_ge=R(()=>Me.connection),xge=R(()=>Me.loading),Sge=R(()=>Me.sessionLoading),Age=R(()=>{const e=Me.activeSessionId;return e?Me.messagesLoadingMoreBySession[e]??!1:!1}),Mge=R(()=>{const e=Me.activeSessionId;return e?Me.messagesHasMoreBySession[e]??!1:!1}),Tge=R(()=>{const e=Me.activeSessionId;return e?Me.messagesLoadMoreErrorBySession[e]??!1:!1}),Ege=R(()=>Me.serverVersion),Ige=R(()=>Me.experimentalFlags),Lge=R(()=>Me.backend),$ge=R(()=>Me.dangerousBypassAuth);function Nge(){Me.dangerousBypassAuth=!1}const Fge=R(()=>Me.permission),Rge=R(()=>Me.thinking),$N=R(()=>{const e=Me.activeSessionId;return e?Me.planModeBySession[e]??!1:F2.planMode}),Oge=R(()=>{const e=Me.activeSessionId;return e?Me.swarmModeBySession[e]??!1:F2.swarmMode}),Pge=R(()=>{const e=Me.activeSessionId;return e?Me.goalModeBySession[e]??!1:F2.goalMode}),Dge=R(()=>{const e=LX(LN.value);return{plan:$N.value,goal:vd.value&&vd.value.status!=="complete"?{status:vd.value.status,turnsUsed:vd.value.turnsUsed,elapsedMs:vd.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Bge=R(()=>{const e=Me.activeSessionId;if(!e)return[];const t=_t();return(Me.queuedBySession[e]??[]).map(n=>({id:n.id??n.text,text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId),name:o.name}))}))}),Hge=R(()=>Me.warnings),zge=R(()=>{const e=Me.activeSessionId;return e?(Me.questionsBySession[e]??[]).map(ige):[]}),Wge=R(()=>{const e=Me.activeSessionId;return e?(Me.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:sge(t),agentName:t.agentName,toolCallId:t.toolCallId})):[]}),U5=R(()=>{const e=Me.activeSessionId;return e?(Me.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Me.questionsBySession[e]??[]).length>0?"awaiting-question":W5.value||s0.value?"running":"idle":"idle"}),Rn=dme(Me,{pushOperationFailure:t0,refreshSessionStatus:_c,persistSessionProfile:CN,activity:U5,updateSession:R2,updateSessionMessages:fN,loadConfig:()=>At.loadConfig(),checkAuth:()=>At.checkAuth()}),_8=R(()=>{const e=Me.activeSessionId;if(!e)return null;const t=Me.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Uge=R(()=>{const e=Me.activeSessionId;return e?Me.gitStatusBySession[e]?.pullRequest??null:null}),jge=R(()=>{const e=Me.activeSessionId;if(!e)return[];const t=Me.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),Vge=R(()=>{const e=Me.activeSessionId;if(!e)return null;const t=Me.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),NN=R(()=>{const e=Me.sessions.find(r=>r.id===Me.activeSessionId),t=_8.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Rn.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??Me.defaultModel)??"—",s=Rn.models.value.find(r=>r.id===o)??Rn.models.value.find(r=>r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Me.permission,branch:t,cwd:e?.cwd??"",isGitRepo:_8.value!==null}}),qge=R(()=>mN.value),Kge=R(()=>Me.sessions.find(t=>t.id===Me.activeSessionId)?.usage.totalCostUsd??0),Zge=R(()=>Me.authReady),Gge=R(()=>Me.defaultModel),Yge=R(()=>Me.managedProviderStatus),Xge=R(()=>Me.managedUserInfo),Jge=R(()=>Me.managedMembership),Qge=R(()=>Me.config),e2e=R(()=>{const e=Me.activeSessionId;if(!e)return{};const t=Me.gitStatusBySession[e];return t?{...t.entries}:{}}),t2e=R(()=>{const e=new Map;for(const t of Me.workspaces){const n=Pr(t.root);e.has(n)||e.set(n,t.id)}return e});function Ml(e){return t2e.value.get(Pr(e.cwd))??e.workspaceId??e.cwd}const j5=R(()=>dJ({workspaces:Me.workspaces,sessions:Me.sessions,hiddenWorkspaceRoots:Me.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:Me.sessionsHasMoreByWorkspace})),Ng=Z(wQ());Je(()=>[j5.value.map(e=>e.id).join("\0"),Me.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=UQ(n,Ng.value);o!==null&&(Ng.value=o,wE(o))});const Yo=Z(_E());function FN(e){const t=LJ(Yo.value,e);t!==Yo.value&&(Yo.value=t,k1(t))}function V5(e){const t=uE(Yo.value,e);t!==Yo.value&&(Yo.value=t,k1(t))}function n2e(e){const t=new Set(e),n=Yo.value.filter(o=>!t.has(o));n.length!==Yo.value.length&&(Yo.value=n,k1(n))}function o2e(e){Yo.value.includes(e)?V5(e):FN(e)}function s2e(e){const t=cE(e,Yo.value);Yo.value=t,k1(t)}function i2e(e,t,n){const o=ON.value.map(r=>r.id),s=NJ(o,e,t,n),i=cE(s,Yo.value);Yo.value=i,k1(i)}const Yr=R(()=>{const e=j5.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:wme(t.root,Me.fsHome),sessionCount:t.sessionCount}));return jQ(e,Ng.value)}),P2=R(()=>{const e=Me.activeWorkspaceId,t=Yr.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Je(P2,e=>{e&&(Object.prototype.hasOwnProperty.call(Rn.skillsByWorkspace.value,e)||Rn.loadSkillsForWorkspace(e))},{immediate:!0});const r2e=R(()=>{const e=P2.value;return e?Yr.value.find(t=>t.id===e)??null:null}),l2e=R(()=>{xc.value;const e=new Set(Yr.value.map(n=>n.id)),t=new Map(Yr.value.map(n=>[n.id,n.name]));return Me.sessions.filter(n=>!n.parentSessionId&&e.has(Ml(n))).map(n=>{const o=Ml(n);return{id:n.id,title:n.title,time:n0(n.updatedAt),busy:u1(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),Fg=Z(xg),q5=R(()=>{xc.value;const e=new Set(Yr.value.map(l=>l.id)),t=new Map(Yr.value.map(l=>[l.id,l.name])),n=new Set(Yo.value),o=(l,a)=>new Date(a.updatedAt).getTime()-new Date(l.updatedAt).getTime(),s=Me.flatSessionsFrontier,i=[],r=[];for(const l of Me.sessions){if(l.parentSessionId||l.archived||n.has(l.id)||!e.has(Ml(l)))continue;if(kE({busy:u1(l.id,l.mainTurnActive),unread:DN.value[l.id]??!1,renaming:!1,questionCount:x8.value[l.id]?.questions??0,approvalCount:x8.value[l.id]?.approvals??0,pendingInteraction:l.pendingInteraction,lastTurnReason:l.lastTurnReason}).hasStatus){i.push(l);continue}s!==null&&new Date(l.updatedAt).getTime()<s||r.push(l)}return i.sort(o),r.sort(o),[...i,...r].map(l=>{const a=Ml(l);return{id:l.id,title:l.title,time:n0(l.updatedAt),busy:u1(l.id,l.mainTurnActive),pendingInteraction:l.pendingInteraction,lastTurnReason:l.lastTurnReason,lastPrompt:l.lastPrompt,updatedAt:l.updatedAt,workspaceId:a,workspaceName:t.get(a),cwdLabel:l.cwd?v1(l.cwd):"-",pullRequest:l.pullRequest}})}),a2e=R(()=>q5.value.slice(0,Fg.value)),u2e=R(()=>Me.flatSessionsHasMore||Fg.value<q5.value.length);function c2e(){Fg.value+=xg,Fg.value>q5.value.length&&Me.flatSessionsHasMore&&At.loadMoreFlatSessions()}function RN(e){xc.value;const t=new Set(Yo.value),n=new Map,o=new Map;for(const s of Me.sessions.toSorted((i,r)=>new Date(r.updatedAt).getTime()-new Date(i.updatedAt).getTime())){if(s.parentSessionId)continue;const i=Ml(s);if(e&&t.has(s.id)){o.set(i,(o.get(i)??0)+1);continue}const r={id:s.id,title:s.title,time:n0(s.updatedAt),busy:u1(s.id,s.mainTurnActive),pendingInteraction:s.pendingInteraction,lastTurnReason:s.lastTurnReason,updatedAt:s.updatedAt},l=n.get(i)??[];l.push(r),n.set(i,l)}return Yr.value.map(s=>({workspace:s,sessions:n.get(s.id)??[],pinnedCount:o.get(s.id)??0,hasMore:Me.sessionsHasMoreByWorkspace[s.id]??!1,loadingMore:Me.sessionsLoadingMoreByWorkspace[s.id]??!1,initialCount:Me.sessionsInitialCountByWorkspace[s.id]??am}))}const d2e=R(()=>RN(!0)),f2e=R(()=>RN(!1)),ON=R(()=>{xc.value;const e=new Set(Yr.value.map(o=>o.id)),t=new Map(Yr.value.map(o=>[o.id,o.name])),n=Me.sessions.filter(o=>!o.parentSessionId&&!o.archived&&e.has(Ml(o)));return $J(n,Yo.value).pinned.map(o=>{const s=Ml(o);return{id:o.id,title:o.title,time:n0(o.updatedAt),busy:u1(o.id,o.mainTurnActive),pendingInteraction:o.pendingInteraction,lastTurnReason:o.lastTurnReason,updatedAt:o.updatedAt,workspaceId:s,workspaceName:t.get(s),pinned:!0,cwdLabel:o.cwd?v1(o.cwd):"-",pullRequest:o.pullRequest}})});function p2e(e){Ng.value=e,wE(e)}const PN=R(()=>{const e={};for(const[t,n]of Object.entries(Me.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Me.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),x8=R(()=>{const e={};for(const[t,n]of Object.entries(Me.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Me.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),DN=R(()=>{const e={};for(const[t,n]of Object.entries(Me.unreadBySession))n&&(e[t]=!0);return e}),h2e=R(()=>{const e={},t=PN.value;for(const n of Me.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=Ml(n);e[s]=(e[s]??0)+o}return e}),m2e=R(()=>Me.recentRoots),g2e=R(()=>Me.availableOpenInApps),At=ame(Me,{taskPoller:EN,sideChat:si,modelProvider:Rn,pushOperationFailure:t0,activity:U5,sessionsKnownEmpty:MN,setSessions:D5,updateSession:R2,upsertSessionFront:Sme,appendSession:Ame,forgetSession:pN,unpinSessions:n2e,setActiveSessionId:B5,updateSessionMessages:fN,nextOptimisticMsgId:SN,getEventConn:()=>rr,syncSessionFromSnapshot:z5,reopenSession:tge,hasLoadedMessages:Xme,refreshSessionStatus:_c,refreshSessionGoal:Lme,refreshSessionPlans:b8,persistSessionProfile:CN,mergedWorkspaces:j5,workspacesView:Yr,status:NN,workspaceIdForSession:Ml,savePermissionToStorage:vme,savePlanModeToStorage:lN,saveSwarmModeToStorage:aN,saveGoalModeToStorage:uN,draftModes:F2,saveUnread:Iy,saveActiveWorkspaceToStorage:Cme,saveHiddenWorkspacesToStorage:bme,goalErrorMessage:Zme,initialized:kN,connectIssue:bN,selectedDiffPath:hN,fileDiffLines:mN,fileDiffLoading:gN,fileDiffTexts:vN,fileDiffEmptyFile:yN});function K5(e){return e===Me.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function v2e(e){Me.turnActiveBySession[e]&&delete Me.turnActiveBySession[e],Me.inFlightBySession[e]&&(Me.inFlightBySession[e]=!1)}function y2e(e,t,n){const o=Me.promptIdBySession[e];At.finishPromptLocal(e,{turnWasActive:n}),e===Me.activeSessionId?(At.loadGitStatus(e),_c(e)):t==="idle"&&(Me.unreadBySession[e]=!0,Iy({[e]:!0}));const s=(Me.approvalsBySession[e]??[]).length>0,i=(Me.questionsBySession[e]??[]).length>0;ohe(t,s,i)&&Da.maybeNotifyCompletion(e,{isUserWatching:K5(e),sessionTitle:Me.sessions.find(r=>r.id===e)?.title??"",promptId:o,onClick:()=>{At.selectSession(e)}})}function k2e(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;Da.maybeNotifyQuestion({isUserWatching:K5(e),sessionTitle:Me.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{At.selectSession(e)}})}function b2e(e,t){Da.maybeNotifyApproval({isUserWatching:K5(e),sessionTitle:Me.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{At.selectSession(e)}})}function mu(){return oge(),{workspace:age,sessions:uge,activeSessionId:cge,workspacesView:Yr,visibleWorkspace:r2e,activeWorkspaceId:P2,sessionsForView:l2e,workspaceGroups:d2e,mobileWorkspaceGroups:f2e,pinnedSessions:ON,flatSessions:a2e,flatSessionsHasMore:u2e,flatSessionsLoadingMore:R(()=>Me.flatSessionsLoadingMore),attentionBySession:PN,pendingBySession:x8,attentionByWorkspace:h2e,unreadBySession:DN,recentRoots:m2e,turns:vge,tasks:kge,activeAppTasks:o0,auxiliaryTranscripts:Tg,getFileUrl:IN,todos:Cge,goal:vd,swarms:LN,swarmMembersByToolCallId:bge,activationBadges:Dge,compaction:wge,status:NN,sessionCost:Kge,fileDiff:qge,selectedDiffPath:hN,fileDiffLoading:gN,fileDiffTexts:vN,fileDiffEmptyFile:yN,changes:jge,gitInfo:_8,gitDiffStats:Vge,activePullRequest:Uge,changesByPath:e2e,pendingApprovals:Wge,availableOpenInApps:g2e,connection:_ge,loading:xge,sessionLoading:Sge,loadingMoreMessages:Age,hasMoreMessages:Mge,loadMoreMessagesError:Tge,serverVersion:Ege,backend:Lge,dangerousBypassAuth:$ge,experimentalFlags:Ige,clearDangerousBypassAuth:Nge,initialized:kN,connectIssue:bN,permission:Fge,thinking:Rge,planMode:$N,swarmMode:Oge,goalMode:Pge,queued:Bge,warnings:Hge,questions:zge,activity:U5,turnActive:s0,activeTurnError:pge,activeTurnRetry:hge,inFlight:W5,working:yge,isStartingFirstPrompt:fge,models:Rn.models,starredModelIds:Rn.starredModelIds,providers:Rn.providers,fontScale:$h.fontScale,setFontScale:$h.setFontScale,colorScheme:$h.colorScheme,setColorScheme:$h.setColorScheme,notifyEnabled:Da.notifyEnabled,notifySound:Da.notifySound,notifyPermission:Da.notifyPermission,setNotifyEnabled:Da.setNotifyEnabled,setNotifySound:Da.setNotifySound,onboarded:xN,setOnboarded:Nme,load:At.load,selectSession:At.selectSession,clearActiveSession:At.clearActiveSession,loadOlderMessages:At.loadOlderMessages,loadWorkspaces:At.loadWorkspaces,loadMoreSessions:At.loadMoreSessions,loadAllSessions:At.loadAllSessions,ensureFlatSessions:At.ensureFlatSessions,loadMoreFlatSessions:c2e,selectWorkspace:At.selectWorkspace,openWorkspace:At.openWorkspace,openWorkspaceDraft:At.openWorkspaceDraft,startSessionAndSendPrompt:At.startSessionAndSendPrompt,startSessionAndActivateSkill:At.startSessionAndActivateSkill,startSessionAndOpenSideChat:At.startSessionAndOpenSideChat,addWorkspaceByPath:At.addWorkspaceByPath,browseFs:At.browseFs,getFsHome:At.getFsHome,sendPrompt:At.sendPrompt,steerPrompt:At.steerPrompt,sideChatVisible:si.sideChatVisible,sideChatSessionId:si.sideChatSessionId,sideChatTurns:si.sideChatTurns,sideChatRunning:si.sideChatRunning,sideChatSending:si.sideChatSending,openSideChat:si.openSideChat,closeSideChat:si.closeSideChat,sendSideChatPrompt:si.sendSideChatPrompt,uploadImage:At.uploadImage,abortCurrentPrompt:At.abortCurrentPrompt,respondApproval:At.respondApproval,respondQuestion:At.respondQuestion,dismissQuestion:At.dismissQuestion,pendingQuestionActions:At.pendingQuestionActions,pendingApprovalActions:At.pendingApprovalActions,cancelTask:At.cancelTask,setPermission:At.setPermission,setThinking:Rn.setThinking,setPlanMode:At.setPlanMode,togglePlanMode:At.togglePlanMode,setSwarmMode:At.setSwarmMode,toggleSwarmMode:At.toggleSwarmMode,setGoalMode:At.setGoalMode,toggleGoalMode:At.toggleGoalMode,createGoal:At.createGoal,controlGoal:At.controlGoal,enqueue:At.enqueue,dismissWarning:At.dismissWarning,renameSession:At.renameSession,renameWorkspace:At.renameWorkspace,deleteWorkspace:At.deleteWorkspace,reorderWorkspaces:p2e,pinSession:FN,unpinSession:V5,togglePinSession:o2e,reorderPinnedSessions:s2e,pinSessionAt:i2e,archiveSession:At.archiveSession,exportSession:At.exportSession,restoreSession:At.restoreSession,loadArchivedSessions:At.loadArchivedSessions,compact:At.compact,forkSession:At.forkSession,undo:At.undo,unqueue:At.unqueue,reorderQueue:At.reorderQueue,searchFiles:At.searchFiles,loadGitStatus:At.loadGitStatus,loadFileDiff:At.loadFileDiff,clearFileDiff:At.clearFileDiff,listDir:At.listDir,readFileContent:At.readFileContent,readHostFileContent:At.readHostFileContent,getFileDownloadUrl:At.getFileDownloadUrl,openWorkspaceFile:At.openWorkspaceFile,openInApp:At.openInApp,revealWorkspaceFile:At.revealWorkspaceFile,resolveImageUrl:At.resolveImageUrl,loadModels:Rn.loadModels,loadProviders:Rn.loadProviders,skills:dge,activateSkill:Rn.activateSkill,setModel:Rn.setModel,toggleStarModel:Rn.toggleStarModel,addProvider:Rn.addProvider,updateProvider:Rn.updateProvider,getProvider:Rn.getProvider,deleteProvider:Rn.deleteProvider,refreshProvider:Rn.refreshProvider,refreshAllProviders:Rn.refreshAllProviders,loadCatalogProviders:Rn.loadCatalogProviders,importCatalogProvider:Rn.importCatalogProvider,importCustomRegistry:Rn.importCustomRegistry,authReady:Zge,defaultModel:Gge,managedProviderStatus:Yge,managedUserInfo:Xge,managedMembership:Jge,notify:O2,config:Qge,loadConfig:At.loadConfig,updateConfig:At.updateConfig,checkAuth:At.checkAuth,probeManagedMembership:At.probeManagedMembership,startOAuthLogin:Rn.startOAuthLogin,pollOAuthLogin:Rn.pollOAuthLogin,cancelOAuthLogin:Rn.cancelOAuthLogin,getUsage:Rn.getUsage,logout:At.logout}}const C2e=["aria-expanded"],w2e={class:"user-menu-avatar","aria-hidden":"true"},_2e=["src"],x2e={class:"user-menu-name"},S2e={class:"user-menu-name"},A2e={class:"user-menu-item-label"},M2e={class:"user-menu-item-label"},T2e={class:"user-menu-item-label user-menu-login-label"},E2e={class:"user-menu-item-label"},I2e={class:"user-menu-row-value"},L2e={class:"user-menu-item-label"},$2e={class:"user-menu-row-value"},N2e={class:"user-menu-item-label"},F2e={key:0,class:"user-menu-usage"},R2e={key:0,class:"user-menu-usage-state"},O2e={key:1,class:"user-menu-usage-state"},P2e={class:"user-menu-usage-error"},D2e={key:2,class:"user-menu-usage-state user-menu-usage-empty"},B2e={class:"user-menu-usage-main"},H2e={class:"user-menu-usage-label"},z2e={key:0,class:"user-menu-usage-hint"},W2e={class:"user-menu-item-label"},U2e={class:"user-menu-item-label"},j2e=et({__name:"UserMenu",emits:["login","openSettings"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=Nt(),i=mu(),{confirm:r}=hu(),l=R(()=>i.managedProviderStatus.value==="authenticated"),a=i.managedUserInfo,u=i.managedMembership,c=R(()=>a.value?.nickname||o("sidebar.defaultUserName")),d=R(()=>u.value==="free"||OJ(a.value?.userLevel)),f=R(()=>u.value!=="free"),h=Z(!1);Je(()=>a.value?.avatar,()=>{h.value=!1});const m=R(()=>!!a.value?.avatar&&!h.value),v=i.colorScheme,k=R(()=>o(`theme.${v.value}`)),w=R(()=>v.value==="light"?"light-mode":v.value==="dark"?"dark-mode":"follow-system"),b=[{value:"light",labelKey:"theme.light",icon:"light-mode"},{value:"dark",labelKey:"theme.dark",icon:"dark-mode"},{value:"system",labelKey:"theme.system",icon:"follow-system"}];function _(te){i.setColorScheme(te)}const g=R(()=>yg.find(te=>te.code===s.value)?.label??s.value);function x(te){s.value!==te&&E5(te)}const S=Z(!1),T=Z({}),A=Z(null),E=Z(null);let P=null;function D(te){const ce=te.target;ce.closest(".user-menu")||ce.closest(".user-menu-trigger")||ce.closest(".user-submenu")||O()}function I(te){te.key==="Escape"&&(te.stopPropagation(),O())}async function $(){if(S.value){O();return}S.value=!0,document.addEventListener("mousedown",D),document.addEventListener("keydown",I,!0),window.addEventListener("resize",O),l.value&&oe(),await yt(),B();const te=E.value;te&&(P=new ResizeObserver(H),P.observe(te))}function B(){const te=E.value,ce=A.value?.el;if(!te||!ce)return;const ue=te.getBoundingClientRect(),Se=4,ze=8,_e=ce.offsetHeight,Ee={left:`${Math.round(ue.left)}px`,width:`${Math.round(ue.width)}px`};ue.top-_e-Se<ze?T.value={...Ee,top:`${Math.round(Math.min(ue.bottom+Se,window.innerHeight-_e-ze))}px`,bottom:"auto",transformOrigin:"top left","--menu-pop-shift":"-2px"}:T.value={...Ee,top:"auto",bottom:`${Math.round(window.innerHeight-ue.top+Se)}px`,transformOrigin:"bottom left","--menu-pop-shift":"2px"}}function H(){const te=E.value;if(!te)return;F.value=null;const ce=te.getBoundingClientRect();T.value={...T.value,left:`${Math.round(ce.left)}px`,width:`${Math.round(ce.width)}px`}}function O(){S.value=!1,F.value=null,le(),P?.disconnect(),P=null,document.removeEventListener("mousedown",D),document.removeEventListener("keydown",I,!0),window.removeEventListener("resize",O)}Vn(O);const F=Z(null),U=Z({}),z=Z(null),W={usage:null,theme:null,language:null};let K=null;function V(te){return ce=>{W[te]=ce instanceof HTMLElement?ce:ce?.$el??null}}function ie(te){le(),F.value!==te&&(F.value=te,yt(Ie))}function ne(te,ce){te.key!=="Enter"&&te.key!==" "&&te.key!=="ArrowRight"||(te.preventDefault(),ie(ce))}function X(){le(),K=setTimeout(()=>{F.value=null,K=null},250)}function le(){K!==null&&(clearTimeout(K),K=null)}function Ie(){const te=F.value,ce=A.value?.el,ue=z.value?.el,Se=te!==null?W[te]:null;if(!ce||!ue||!Se)return;const ze=4,_e=8,Ee=ce.getBoundingClientRect(),it=Se.getBoundingClientRect(),Fe=ue.offsetHeight,Oe=Math.min(ue.offsetWidth,Ee.width);let Ge=Ee.right+ze,at=!1;Ge+Oe>window.innerWidth-_e&&(Ge=Math.max(_e,Ee.left-Oe-ze),at=!0);const Tt=Math.max(_e,Math.min(it.top,window.innerHeight-Fe-_e));U.value={top:`${Math.round(Tt)}px`,left:`${Math.round(Ge)}px`,maxWidth:`${Math.round(Ee.width)}px`,transformOrigin:at?"top right":"top left","--menu-pop-shift":"-2px"}}const de=Z(!1),pe=Z(null);let ve=0;async function oe(){const te=++ve;de.value=!0;try{const ce=await i.getUsage();te===ve&&(pe.value=ce)}finally{te===ve&&(de.value=!1)}}const ye=R(()=>{if(pe.value?.kind!=="ok")return[];const{summary:te,limits:ce}=pe.value,ue=FJ(ce,5,"hour");return[te,ue].filter(Se=>Se!=null)}),G=R(()=>pe.value?.kind==="error"?pe.value.message:o("settings.planUsage.loadFailed"));function Y(te){return te.resetAt===void 0?"":fE(te.resetAt,o)}function fe(){O(),jp()}function we(){O(),n("login")}function ge(){O(),n("openSettings")}async function Q(){O(),await r({title:o("sidebar.logoutConfirmTitle"),message:o("sidebar.logoutConfirmMessage"),variant:"danger",action:()=>i.logout()})}return(te,ce)=>(y(),M(Pe,null,[C("button",{ref_key:"triggerRef",ref:E,class:"user-menu-trigger",type:"button","aria-haspopup":"menu","aria-expanded":S.value,onClick:It($,["stop"])},[l.value?(y(),M(Pe,{key:0},[C("span",w2e,[m.value?(y(),M("img",{key:0,src:p(a)?.avatar,alt:"",onError:ce[0]||(ce[0]=ue=>h.value=!0)},null,40,_2e)):(y(),he(p(Te),{key:1,name:"user",size:"sm"}))]),C("span",x2e,N(c.value),1)],64)):(y(),M(Pe,{key:1},[j(p(Te),{name:"user"}),C("span",S2e,N(p(o)("sidebar.notSignedIn")),1)],64))],8,C2e),(y(),he(Zr,{to:"body"},[j(as,{name:"menu-pop"},{default:me(()=>[S.value?(y(),he(p(Cl),{key:0,ref_key:"menuRef",ref:A,class:"user-menu",style:Zt(T.value),onClick:ce[14]||(ce[14]=It(()=>{},["stop"]))},{default:me(()=>[l.value?(y(),M(Pe,{key:0},[f.value?(y(),he(p(hn),{key:0,ref:V("usage"),"aria-haspopup":"true","aria-expanded":F.value==="usage",onMouseenter:ce[1]||(ce[1]=ue=>ie("usage")),onMouseleave:X,onFocus:ce[2]||(ce[2]=ue=>ie("usage")),onBlur:X,onClick:ce[3]||(ce[3]=ue=>ie("usage")),onKeydown:ce[4]||(ce[4]=ue=>ne(ue,"usage"))},{default:me(()=>[j(p(Te),{name:"histogram",size:"sm"}),C("span",A2e,N(p(o)("settings.planUsage.title")),1),j(p(Te),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"])):ee("",!0),d.value?(y(),he(p(hn),{key:1,onClick:fe,onMouseenter:X},{default:me(()=>[j(p(Te),{name:"music",size:"sm"}),C("span",M2e,N(p(o)("sidebar.upgrade")),1),j(p(Te),{name:"external-link",size:"sm"})]),_:1})):ee("",!0),j(p(hn),{separator:""})],64)):(y(),M(Pe,{key:1},[j(p(hn),{class:"user-menu-login",onClick:we,onMouseenter:X},{default:me(()=>[j(p(Te),{name:"log-in",size:"sm"}),C("span",T2e,N(p(o)("sidebar.signIn")),1)]),_:1}),j(p(hn),{separator:""})],64)),j(p(hn),{ref:V("theme"),"aria-haspopup":"true","aria-expanded":F.value==="theme",onMouseenter:ce[5]||(ce[5]=ue=>ie("theme")),onMouseleave:X,onFocus:ce[6]||(ce[6]=ue=>ie("theme")),onBlur:X,onClick:ce[7]||(ce[7]=ue=>ie("theme")),onKeydown:ce[8]||(ce[8]=ue=>ne(ue,"theme"))},{default:me(()=>[j(p(Te),{name:w.value,size:"sm"},null,8,["name"]),C("span",E2e,N(p(o)("theme.colorSchemeLabel")),1),C("span",I2e,N(k.value),1),j(p(Te),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"]),j(p(hn),{ref:V("language"),"aria-haspopup":"true","aria-expanded":F.value==="language",onMouseenter:ce[9]||(ce[9]=ue=>ie("language")),onMouseleave:X,onFocus:ce[10]||(ce[10]=ue=>ie("language")),onBlur:X,onClick:ce[11]||(ce[11]=ue=>ie("language")),onKeydown:ce[12]||(ce[12]=ue=>ne(ue,"language"))},{default:me(()=>[j(p(Te),{name:"translate",size:"sm"}),C("span",L2e,N(p(o)("sidebar.language")),1),C("span",$2e,N(g.value),1),j(p(Te),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"]),j(p(hn),{onClick:ge,onMouseenter:X},{default:me(()=>[j(p(Te),{name:"settings",size:"sm"}),C("span",N2e,N(p(o)("settings.title")),1)]),_:1}),l.value?(y(),M(Pe,{key:2},[j(p(hn),{separator:""}),j(p(hn),{onClick:ce[13]||(ce[13]=ue=>void Q()),onMouseenter:X},{default:me(()=>[j(p(Te),{name:"log-out",size:"sm"}),qe(" "+N(p(o)("sidebar.signOut")),1)]),_:1})],64)):ee("",!0)]),_:1},8,["style"])):ee("",!0)]),_:1})])),(y(),he(Zr,{to:"body"},[j(as,{name:"menu-pop"},{default:me(()=>[F.value!==null?(y(),he(p(Cl),{key:0,ref_key:"submenuRef",ref:z,class:"user-submenu",style:Zt(U.value),role:F.value==="usage"?"dialog":"menu",onClick:ce[16]||(ce[16]=It(()=>{},["stop"])),onMouseenter:le,onMouseleave:X,onFocusin:le,onFocusout:X},{default:me(()=>[F.value==="usage"?(y(),M("div",F2e,[de.value?(y(),M("div",R2e,[j(p(Ao),{size:"sm"})])):pe.value?.kind!=="ok"?(y(),M("div",O2e,[C("span",P2e,N(G.value),1),j(p(Rt),{variant:"ghost",size:"sm",onClick:ce[15]||(ce[15]=ue=>void oe())},{default:me(()=>[qe(N(p(o)("settings.planUsage.retry")),1)]),_:1})])):ye.value.length===0?(y(),M("span",D2e,N(p(o)("settings.planUsage.empty")),1)):(y(!0),M(Pe,{key:3},pt(ye.value,(ue,Se)=>(y(),M("div",{key:Se,class:"user-menu-usage-row"},[C("span",B2e,[C("span",H2e,N(p(dE)(ue,p(o))),1),Y(ue)?(y(),M("span",z2e,N(Y(ue)),1)):ee("",!0)]),C("span",{class:Re(["user-menu-usage-value",`sev-${p(C3)(ue.used,ue.limit)}`])},N(p(Wh)(ue.used,ue.limit))+"% ",3)]))),128))])):F.value==="theme"?(y(),M(Pe,{key:1},pt(b,ue=>j(p(hn),{key:ue.value,onClick:Se=>_(ue.value)},{default:me(()=>[j(p(Te),{name:ue.icon,size:"sm"},null,8,["name"]),C("span",W2e,N(p(o)(ue.labelKey)),1),p(v)===ue.value?(y(),he(p(Te),{key:0,name:"check",size:"sm"})):ee("",!0)]),_:2},1032,["onClick"])),64)):(y(!0),M(Pe,{key:2},pt(p(yg),ue=>(y(),he(p(hn),{key:ue.code,onClick:Se=>x(ue.code)},{default:me(()=>[C("span",U2e,N(ue.label),1),p(s)===ue.code?(y(),he(p(Te),{key:0,name:"check",size:"sm"})):ee("",!0)]),_:2},1032,["onClick"]))),128))]),_:1},8,["style","role"])):ee("",!0)]),_:1})]))],64))}}),V2e=ft(j2e,[["__scopeId","data-v-06f13413"]]),q2e={class:"ep-search"},K2e=["placeholder"],Z2e={class:"ep-scroll"},G2e={key:0,class:"ep-grid"},Y2e=["onClick"],X2e={key:1,class:"ep-empty"},J2e={class:"ep-label"},Q2e={class:"ep-grid"},eve=["onClick"],tve={class:"ep-label"},nve={class:"ep-grid"},ove=["onClick"],Kx="kimi-web.recent-emojis",sve=et({__name:"SessionEmojiPicker",props:{current:{default:null},removable:{type:Boolean,default:!0}},emits:["pick"],setup(e,{expose:t,emit:n}){const{t:o}=Nt(),{handleCompositionStart:s,handleCompositionEnd:i,isComposingKeyEvent:r}=Ar(),l=e,a=n,u=["⏳","⚠️","🐛","✨","🔥","🚀","🎯","🧪","📝","🔍","🛠️","💡","📦","🎨","🔒","📈","🧹","🚧","✅","❓","🌙","☕","🐳","🗂️","📊","🤖","🧩","⚙️","🌱","📌","💥","🕐"],c={faces:"sidebar.emojiGroupFaces",nature:"sidebar.emojiGroupNature",food:"sidebar.emojiGroupFood",activity:"sidebar.emojiGroupActivity",objects:"sidebar.emojiGroupObjects",symbols:"sidebar.emojiGroupSymbols"},d=sJ.map(S=>({id:S,labelKey:c[S],emojis:sE.filter(T=>T.group===S).map(T=>T.emoji)})),f=Z(h());function h(){try{const S=JSON.parse(localStorage.getItem(Kx)??"[]");return Array.isArray(S)?S.filter(T=>typeof T=="string"):[]}catch{return[]}}function m(S){f.value=aJ(f.value,S);try{localStorage.setItem(Kx,JSON.stringify(f.value))}catch{}a("pick",S)}const v=Z(""),k=R(()=>v.value.trim().length>0),w=R(()=>rJ(v.value)),b=Z(null);dn(()=>b.value?.focus());function _(S){if(r(S))return;const T=w.value[0];k.value&&T&&m(T)}function g(){let S=l.current??void 0;for(;S===void 0||S===l.current;)S=u[Math.floor(Math.random()*u.length)];m(S)}const x=Z(null);return t({el:R(()=>x.value?.el),isComposingKeyEvent:r}),(S,T)=>(y(),he(p(Cl),{ref_key:"menuRef",ref:x,class:"emoji-picker",role:"dialog","aria-label":p(o)("sidebar.sessionEmojiTitle"),onKeydown:T[4]||(T[4]=It(()=>{},["stop"]))},{default:me(()=>[C("div",q2e,[j(p(Te),{name:"search",size:"sm"}),Bn(C("input",{ref_key:"inputRef",ref:b,"onUpdate:modelValue":T[0]||(T[0]=A=>v.value=A),class:"ep-input",type:"text",placeholder:p(o)("sidebar.searchEmoji"),autocomplete:"off",spellcheck:"false",onKeydown:xl(_,["enter"]),onCompositionstart:T[1]||(T[1]=(...A)=>p(s)&&p(s)(...A)),onCompositionend:T[2]||(T[2]=(...A)=>p(i)&&p(i)(...A))},null,40,K2e),[[ai,v.value]])]),C("div",Z2e,[k.value?(y(),M(Pe,{key:0},[w.value.length?(y(),M("div",G2e,[(y(!0),M(Pe,null,pt(w.value,A=>(y(),M("button",{key:A,class:Re(["ep-e",{sel:A===e.current}]),type:"button",onClick:E=>m(A)},N(A),11,Y2e))),128))])):(y(),M("div",X2e,N(p(o)("sidebar.noEmojiResults")),1))],64)):(y(),M(Pe,{key:1},[f.value.length?(y(),M(Pe,{key:0},[C("div",J2e,N(p(o)("sidebar.recentEmojis")),1),C("div",Q2e,[(y(!0),M(Pe,null,pt(f.value,A=>(y(),M("button",{key:A,class:Re(["ep-e",{sel:A===e.current}]),type:"button",onClick:E=>m(A)},N(A),11,eve))),128))])],64)):ee("",!0),(y(!0),M(Pe,null,pt(p(d),A=>(y(),M(Pe,{key:A.id},[C("div",tve,N(p(o)(A.labelKey)),1),C("div",nve,[(y(!0),M(Pe,null,pt(A.emojis,E=>(y(),M("button",{key:E,class:Re(["ep-e",{sel:E===e.current}]),type:"button",onClick:P=>m(E)},N(E),11,ove))),128))])],64))),128))],64))]),j(p(hn),{separator:""}),j(p(hn),{role:"button",disabled:!(e.current&&e.removable),onClick:T[3]||(T[3]=A=>a("pick",null))},{default:me(()=>[j(p(Te),{name:"close",size:"sm"}),qe(" "+N(p(o)("sidebar.removeEmoji")),1)]),_:1},8,["disabled"]),j(p(hn),{role:"button",onClick:g},{default:me(()=>[j(p(Te),{name:"sparkles",size:"sm"}),qe(" "+N(p(o)("sidebar.randomEmoji")),1)]),_:1})]),_:1},8,["aria-label"]))}}),ive=ft(sve,[["__scopeId","data-v-05e46bbb"]]),rve={class:"row"},lve={key:0,class:"lead","aria-hidden":"true"},ave={key:1,class:"unread-dot"},uve={class:"left"},cve=["onKeydown"],dve=["aria-label"],fve={class:"act"},pve={key:0,class:"ts"},hve={key:1,class:"st"},mve={key:1,class:"unread-dot"},gve={key:2,class:"ha"},vve={key:0,class:"sub"},yve={class:"sub-text"},kve=["aria-label"],bve={class:"menu-time"},Cve=et({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","renameStateChange","archive","fork","export","pin"],setup(e,{expose:t,emit:n}){const{t:o}=Nt(),s=e,i=n;function r(ue){const Se=new Date(ue);if(Number.isNaN(Se.getTime()))return ue;const ze=_e=>String(_e).padStart(2,"0");return`${Se.getFullYear()}-${ze(Se.getMonth()+1)}-${ze(Se.getDate())} ${ze(Se.getHours())}:${ze(Se.getMinutes())}`}const l=R(()=>s.session.updatedAt?r(s.session.updatedAt):s.session.time),a=R(()=>s.session.cwdLabel!==void 0),u=R(()=>kE({busy:s.session.busy,unread:s.unread,renaming:W.value,questionCount:s.questionCount,approvalCount:s.approvalCount,pendingInteraction:s.session.pendingInteraction,lastTurnReason:s.session.lastTurnReason})),c=R(()=>u.value.showQuestionBadge),d=R(()=>u.value.showApprovalBadge),f=R(()=>u.value.showAbortedBadge),h=R(()=>u.value.showBusySpinner),m=R(()=>u.value.hasStatus),v=Z(!1),k=Z(null),w=Z({});function b(ue){const Se=ue.target;k.value?.el?.contains(Se)||g()}async function _(){$(),v.value=!0,setTimeout(()=>document.addEventListener("mousedown",b),0),window.addEventListener("resize",g),await yt()}function g(){v.value=!1,document.removeEventListener("mousedown",b),window.removeEventListener("resize",g)}bn(()=>{document.removeEventListener("mousedown",b),document.removeEventListener("mousedown",B),window.removeEventListener("keydown",H,!0),window.removeEventListener("resize",g),window.removeEventListener("resize",$)});const x=R(()=>yE(s.session.title)),S=R(()=>{const ue=x.value.emoji;return ue?s.session.title.slice(ue.length):s.session.title}),T=Z(!1),A=Z(null),E=Z({});let P=null;function D(ue,Se,ze){const _e=A.value?.el,Ee=4,it=8,Fe=_e?.offsetHeight??0,Oe=_e?.offsetWidth??0;let Ge=ue.bottom+Ee,at=!1;Ge+Fe>window.innerHeight-it&&(Ge=Math.max(it,ue.top-Fe-Ee),at=!0);const Tt=ze??(Se==="left"?ue.left:ue.right-Oe),Bt=Math.max(it,Math.min(Tt,window.innerWidth-Oe-it)),Yt=ze===void 0?Se:`${Math.round(Math.min(Math.max(ze-Bt,0),Oe))}px`;E.value={top:`${Math.round(Ge)}px`,left:`${Math.round(Bt)}px`,transformOrigin:`${Yt} ${at?"bottom":"top"}`,"--menu-pop-shift":at?"2px":"-2px"}}async function I(ue,Se,ze="left",_e){const Ee=Se??ue?.getBoundingClientRect();if(Ee){if(T.value){$();return}g(),P=ue??null,T.value=!0,setTimeout(()=>document.addEventListener("mousedown",B),0),window.addEventListener("keydown",H,!0),window.addEventListener("resize",$),await yt(),D(Ee,ze,_e)}}function $(){T.value=!1,P=null,document.removeEventListener("mousedown",B),window.removeEventListener("keydown",H,!0),window.removeEventListener("resize",$)}function B(ue){const Se=ue.target;A.value?.el?.contains(Se)||P?.contains(Se)||$()}function H(ue){ue.key==="Escape"&&(A.value?.isComposingKeyEvent(ue)||(ue.preventDefault(),ue.stopPropagation(),$()))}function O(ue){return ue.clientX||ue.clientY?new DOMRect(ue.clientX,ue.clientY,0,0):void 0}function F(ue){ue.stopPropagation();const Se=ue;I(Se.currentTarget,O(Se),"left",Se.clientX||void 0)}function U(ue){const Se=k.value?.el,ze=ue,_e=O(ze)??Se?.getBoundingClientRect();g(),I(Se,_e,"left",ze.clientX||void 0)}function z(ue){if($(),ue===x.value.emoji)return;const Se=dQ(s.session.title,ue);Se&&Se!==s.session.title&&i("rename",s.session.id,Se)}const W=Z(!1),K=Z(""),V=Z(null),{handleCompositionStart:ie,handleCompositionEnd:ne,isComposingKeyEvent:X}=Ar();async function le(){g(),$(),W.value=!0,K.value=s.session.title,await yt();try{V.value?.focus(),V.value?.select()}catch{}}function Ie(){const ue=K.value.trim();ue&&ue!==s.session.title&&i("rename",s.session.id,ue),W.value=!1}function de(ue){X(ue)||Ie()}function pe(ue){X(ue)||ve()}function ve(){W.value=!1}Je(W,ue=>i("renameStateChange",ue));async function oe(ue){W.value||(ue.preventDefault(),ue.stopPropagation(),v.value&&g(),await _(),ye(ue))}function ye(ue){const Se=k.value?.el,ze=8,_e=Se?.offsetHeight??0,Ee=Se?.offsetWidth??0;let it=ue.clientY,Fe=!1;it+_e>window.innerHeight-ze&&(it=Math.max(ze,ue.clientY-_e),Fe=!0);let Oe=ue.clientX,Ge=!1;Oe+Ee>window.innerWidth-ze&&(Oe=Math.max(ze,ue.clientX-Ee),Ge=!0),w.value={top:`${Math.round(it)}px`,left:`${Math.round(Oe)}px`,transformOrigin:`${Fe?"bottom":"top"} ${Ge?"right":"left"}`,"--menu-pop-shift":Fe?"2px":"-2px"}}const G=Z(!1),Y=Z(!1);async function fe(){const ue=await Zs(s.session.id);G.value=ue,Y.value=!ue,setTimeout(()=>{G.value=!1,Y.value=!1,g()},1500)}function we(){g(),i("fork",s.session.id)}function ge(){g(),i("export",s.session.id)}function Q(){g(),i("pin",s.session.id)}function te(){g(),i("archive",s.session.id)}t({closeMenu:g});function ce(){const ue=s.session.pullRequest?.url;ue&&window.open(ue,"_blank","noopener")}return(ue,Se)=>(y(),M("div",{class:Re(["se",{on:e.active,flat:a.value}]),onClick:Se[7]||(Se[7]=ze=>i("select",e.session.id)),onContextmenu:oe},[C("div",rve,[a.value?ee("",!0):(y(),M("span",lve,[e.session.busy?(y(),he(p(Ao),{key:0,size:"sm"})):e.unread?(y(),M("span",ave)):ee("",!0)])),C("div",uve,[W.value?Bn((y(),M("input",{key:0,ref_key:"renameInputRef",ref:V,"onUpdate:modelValue":Se[0]||(Se[0]=ze=>K.value=ze),class:"rename-input",onClick:Se[1]||(Se[1]=It(()=>{},["stop"])),onKeydown:[xl(It(de,["stop"]),["enter"]),xl(It(pe,["stop"]),["esc"])],onCompositionstart:Se[2]||(Se[2]=(...ze)=>p(ie)&&p(ie)(...ze)),onCompositionend:Se[3]||(Se[3]=(...ze)=>p(ne)&&p(ne)(...ze)),onBlur:Ie},null,40,cve)),[[ai,K.value]]):(y(),M("span",{key:1,class:"t",onDblclick:It(le,["stop"])},[x.value.emoji?(y(),M("button",{key:0,type:"button",class:"emoji","aria-label":p(o)("sidebar.setEmoji"),onClick:It(F,["stop"]),onDblclick:Se[4]||(Se[4]=It(()=>{},["stop"]))},N(x.value.emoji),41,dve)):ee("",!0),qe(N(S.value),1)],32))]),C("span",fve,[j(p(pn),{text:p(o)("workspace.awaitingAnswerTitle")},{default:me(()=>[c.value?(y(),he(p(Vr),{key:0,variant:"info",size:"sm"},{default:me(()=>[qe(N(p(o)("workspace.awaitingAnswer")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),j(p(pn),{text:p(o)("workspace.awaitingPermissionTitle")},{default:me(()=>[d.value?(y(),he(p(Vr),{key:0,variant:"warning",size:"sm"},{default:me(()=>[qe(N(p(o)("workspace.awaitingPermission")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),j(p(pn),{text:p(o)("workspace.abortedTitle")},{default:me(()=>[f.value?(y(),he(p(Vr),{key:0,variant:"danger",size:"sm"},{default:me(()=>[qe(N(p(o)("workspace.aborted")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),!a.value||!m.value?(y(),M("span",pve,N(e.session.time),1)):h.value||e.unread?(y(),M("span",hve,[h.value?(y(),he(p(Ao),{key:0,size:"sm"})):(y(),M("span",mve))])):ee("",!0),W.value?ee("",!0):(y(),M("span",gve,[j(p(pn),{text:e.session.pinned?p(o)("sidebar.unpin"):p(o)("sidebar.pin")},{default:me(()=>[j(p(gn),{class:"pin-btn",size:"sm",label:e.session.pinned?p(o)("sidebar.unpin"):p(o)("sidebar.pin"),onClick:It(Q,["stop"])},{default:me(()=>[j(p(Te),{name:e.session.pinned?"unpin":"pin"},null,8,["name"])]),_:1},8,["label"])]),_:1},8,["text"]),j(p(pn),{text:p(o)("sidebar.archive")},{default:me(()=>[j(p(gn),{class:"archive-btn",size:"sm",label:p(o)("sidebar.archive"),onClick:It(te,["stop"])},{default:me(()=>[j(p(Te),{name:"archive"})]),_:1},8,["label"])]),_:1},8,["text"])]))])]),e.session.cwdLabel!==void 0?(y(),M("div",vve,[j(p(Te),{class:"sub-icon",name:"folder-closed",size:"sm"}),C("span",yve,N(e.session.cwdLabel),1),e.session.pullRequest?(y(),M("button",{key:0,type:"button",class:Re(["pr",`pr--${e.session.pullRequest.state}`]),"aria-label":`PR #${e.session.pullRequest.number}`,onClick:It(ce,["stop"])},[j(p(Te),{name:"git-pull-request",size:"sm"}),C("span",null,"#"+N(e.session.pullRequest.number),1)],10,kve)):ee("",!0)])):ee("",!0),(y(),he(Zr,{to:"body"},[j(as,{name:"menu-pop"},{default:me(()=>[v.value?(y(),he(p(Cl),{key:0,ref_key:"menuRef",ref:k,class:"menu",style:Zt(w.value),onClick:Se[5]||(Se[5]=It(()=>{},["stop"]))},{default:me(()=>[j(p(hn),{danger:Y.value,onClick:fe},{default:me(()=>[j(p(Te),{name:"copy",size:"sm"}),qe(" "+N(Y.value?p(o)("sidebar.copyFailed"):G.value?p(o)("sidebar.copied"):p(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),j(p(hn),{separator:""}),j(p(hn),{onClick:le},{default:me(()=>[j(p(Te),{name:"pencil",size:"sm"}),qe(" "+N(p(o)("sidebar.rename")),1)]),_:1}),j(p(hn),{onClick:U},{default:me(()=>[j(p(Te),{name:"emoji",size:"sm"}),qe(" "+N(p(o)("sidebar.setEmoji")),1)]),_:1}),j(p(hn),{onClick:we},{default:me(()=>[j(p(Te),{name:"git-fork",size:"sm"}),qe(" "+N(p(o)("sidebar.fork")),1)]),_:1}),j(p(hn),{onClick:ge},{default:me(()=>[j(p(Te),{name:"download",size:"sm"}),qe(" "+N(p(o)("sidebar.export")),1)]),_:1}),j(p(hn),{onClick:Q},{default:me(()=>[j(p(Te),{name:e.session.pinned?"unpin":"pin",size:"sm"},null,8,["name"]),qe(" "+N(e.session.pinned?p(o)("sidebar.unpin"):p(o)("sidebar.pin")),1)]),_:1}),j(p(hn),{onClick:te},{default:me(()=>[j(p(Te),{name:"archive",size:"sm"}),qe(" "+N(p(o)("sidebar.archive")),1)]),_:1}),j(p(hn),{separator:""}),C("div",bve,N(l.value),1)]),_:1},8,["style"])):ee("",!0)]),_:1})])),(y(),he(Zr,{to:"body"},[j(as,{name:"menu-pop"},{default:me(()=>[T.value?(y(),he(ive,{key:0,ref_key:"pickerRef",ref:A,class:"picker",style:Zt(E.value),current:x.value.emoji,removable:x.value.rest.length>0,onClick:Se[6]||(Se[6]=It(()=>{},["stop"])),onPick:z},null,8,["style","current","removable"])):ee("",!0)]),_:1})]))],34))}}),Z5=ft(Cve,[["__scopeId","data-v-341acfa2"]]),wve=["draggable"],_ve={class:"gh-top"},xve={class:"gh-name"},Sve=["inert"],Ave={key:0,class:"show-more-row"},Mve=["disabled"],Tve={class:"show-more-label"},Eve={key:1,class:"show-more-sep","aria-hidden":"true"},Ive={class:"show-more-label"},Lve={key:1,class:"group-empty"},$ve=et({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},visibleLimit:{type:Function},pinnedDragSession:{}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","pinSession","dropPinnedSession","expand","collapse","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=R({get:()=>o.renameValue,set:P=>s("updateRenameValue",P)}),r=Z(!1),l=R(()=>o.pinnedDragSession!=null),a=R(()=>o.pinnedDragSession?.workspaceId===o.group.workspace.id);function u(P){if(o.pinnedDragSession!=null){if(!a.value){P.dataTransfer&&(P.dataTransfer.dropEffect="none");return}P.preventDefault(),P.dataTransfer&&(P.dataTransfer.dropEffect="move"),r.value=!0}}function c(P){o.pinnedDragSession==null||!a.value||(P.preventDefault(),r.value=!1,s("dropPinnedSession",o.pinnedDragSession.id))}function d(P){P.currentTarget.contains(P.relatedTarget)||(r.value=!1)}const f=R(()=>o.visibleLimit(o.group.workspace.id)??o.group.initialCount),h=R(()=>{const P=o.group.sessions.slice(0,f.value);if(o.activeId&&!P.some(D=>D.id===o.activeId)){const D=o.group.sessions.find(I=>I.id===o.activeId);if(D)return[...P,D]}return P}),m=R(()=>o.group.sessions.length>f.value||o.group.hasMore||o.group.loadingMore),v=R(()=>f.value>o.group.initialCount);function k(P){o.renameInputRef.value=P instanceof HTMLInputElement?P:null}const{handleCompositionStart:w,handleCompositionEnd:b,isComposingKeyEvent:_}=Ar();function g(P){_(P)||s("confirmRename")}function x(P){_(P)||s("cancelRename")}const S=Z(null);function T(P){o.renamingId!==o.group.workspace.id&&s("groupContextmenu",o.group.workspace,P)}function A(P){P.dataTransfer&&(P.dataTransfer.effectAllowed="move",P.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}function E(P,D){D.dataTransfer&&(D.dataTransfer.effectAllowed="move",D.dataTransfer.setData(Bf,P),D.dataTransfer.setData("text/plain",P))}return(P,D)=>(y(),M("div",{class:Re(["group",{dragging:e.dragging,"pinned-drag-active":l.value&&a.value,"pinned-drop-hover":r.value,"pinned-drop-blocked":l.value&&!a.value}]),onDragover:u,onDrop:c,onDragleave:d},[C("div",{class:Re(["gh",{on:e.group.workspace.id===e.activeWorkspaceId&&e.activeId==="",collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:e.renamingId!==e.group.workspace.id,onClick:D[7]||(D[7]=It(I=>s("groupClick",e.group.workspace.id,I),["stop"])),onContextmenu:T,onDragstart:A,onDragend:D[8]||(D[8]=I=>s("wsDragend"))},[C("div",_ve,[e.isCollapsed(e.group.workspace.id)?(y(),he(p(Te),{key:0,class:"gh-folder",name:"folder-closed"})):(y(),he(p(Te),{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(y(),he(p(pn),{key:2,text:e.group.workspace.root},{default:me(()=>[C("span",xve,N(e.group.workspace.name),1)]),_:1},8,["text"])):Bn((y(),M("input",{key:3,ref:k,"onUpdate:modelValue":D[0]||(D[0]=I=>i.value=I),class:"gh-rename",type:"text",onKeydown:[xl(g,["enter"]),xl(x,["esc"])],onCompositionstart:D[1]||(D[1]=(...I)=>p(w)&&p(w)(...I)),onCompositionend:D[2]||(D[2]=(...I)=>p(b)&&p(b)(...I)),onBlur:D[3]||(D[3]=I=>s("cancelRename")),onClick:D[4]||(D[4]=It(()=>{},["stop"]))},null,544)),[[ai,i.value]]),e.renamingId!==e.group.workspace.id?(y(),M("div",{key:4,class:Re(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[j(p(gn),{class:Re(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:p(n)("sidebar.options"),tooltip:p(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:D[5]||(D[5]=It(I=>s("toggleWsMenu",e.group.workspace,I),["stop"]))},{default:me(()=>[j(p(Te),{name:"dots-horizontal"})]),_:1},8,["class","label","tooltip","aria-expanded"]),j(p(gn),{class:"gh-add",size:"sm",label:p(n)("workspace.newInGroup"),tooltip:p(n)("workspace.newInGroup"),onClick:D[6]||(D[6]=It(I=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:me(()=>[j(p(Te),{name:"chat-new"})]),_:1},8,["label","tooltip"])],2)):ee("",!0)])],42,wve),C("div",{class:Re(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(y(!0),M(Pe,null,pt(h.value,I=>(y(),he(Z5,{key:I.id,session:I,active:I.id===e.activeId,"approval-count":e.pendingBySession[I.id]?.approvals??0,"question-count":e.pendingBySession[I.id]?.questions??0,unread:e.unreadBySession[I.id]??!1,draggable:S.value!==I.id,onDragstart:$=>E(I.id,$),onRenameStateChange:$=>S.value=$?I.id:null,onSelect:D[9]||(D[9]=$=>s("selectSession",$)),onRename:D[10]||(D[10]=($,B)=>s("renameSession",$,B)),onArchive:D[11]||(D[11]=$=>s("archiveSession",$)),onFork:D[12]||(D[12]=$=>s("forkSession",$)),onExport:D[13]||(D[13]=$=>s("exportSession",$)),onPin:D[14]||(D[14]=$=>s("pinSession",$))},null,8,["session","active","approval-count","question-count","unread","draggable","onDragstart","onRenameStateChange"]))),128)),m.value||v.value?(y(),M("div",Ave,[m.value?(y(),M("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:D[15]||(D[15]=It(I=>s("expand",e.group.workspace.id),["stop"]))},[j(p(Te),{name:"chevron-down",size:"sm"}),C("span",Tve,N(e.group.loadingMore?p(n)("sidebar.loadingMore"):p(n)("sidebar.showMore")),1)],8,Mve)):ee("",!0),m.value&&v.value?(y(),M("span",Eve,"·")):ee("",!0),v.value?(y(),M("button",{key:2,class:"show-more",onClick:D[16]||(D[16]=It(I=>s("collapse",e.group.workspace.id),["stop"]))},[j(p(Te),{name:"chevron-up",size:"sm"}),C("span",Ive,N(p(n)("sidebar.showLess")),1)])):ee("",!0)])):ee("",!0),e.group.sessions.length===0?(y(),M("div",Lve,N(e.group.pinnedCount>0?p(n)("sidebar.allPinned",{count:e.group.pinnedCount}):p(n)("sidebar.noSessions")),1)):ee("",!0)],10,Sve)],34))}}),Nve=ft($ve,[["__scopeId","data-v-9586bfbe"]]),Fve={class:"pinned-label"},Rve={class:"pinned-title"},Ove={key:0,class:"pinned-rows"},Pve=["draggable","onDragstart","onDragover","onDrop"],Dve=et({__name:"PinnedSessionList",props:{sessions:{},activeId:{},pendingBySession:{},unreadBySession:{}},emits:["selectSession","renameSession","archiveSession","forkSession","exportSession","pinSession","pinSessionAt","sessionDragStart","sessionDragEnd","reorder"],setup(e,{expose:t,emit:n}){const{t:o}=Nt(),s=e,i=n,r=Z(kQ());function l(){r.value=!r.value,M3(r.value)}function a(){r.value&&(r.value=!1,M3(!1))}t({expand:a});const u=Z(null),c=Z(null),d=Z(null);function f(x,S){if(!S.dataTransfer)return;S.dataTransfer.effectAllowed="move",S.dataTransfer.setData("text/plain",x),u.value=x;const T=s.sessions.find(A=>A.id===x)?.workspaceId;T!==void 0&&i("sessionDragStart",x,T)}function h(){u.value=null,c.value=null,i("sessionDragEnd")}Je(()=>s.sessions,x=>{u.value!==null&&!x.some(S=>S.id===u.value)&&(u.value=null,c.value=null)});function m(x){const S=x.currentTarget.getBoundingClientRect();return x.clientY<S.top+S.height/2?"before":"after"}function v(x){return x.dataTransfer?.types.includes(Bf)??!1}function k(x,S){u.value!==S&&(u.value===null&&!v(x)||(x.preventDefault(),x.dataTransfer&&(x.dataTransfer.dropEffect="move"),c.value={id:S,position:m(x)}))}function w(x,S){const T=u.value,A=c.value?.id===x?c.value.position:"before";if(c.value=null,u.value=null,T!==null){T!==x&&i("reorder",AE(s.sessions.map(P=>P.id),T,x,A));return}const E=S.dataTransfer?.getData(Bf);E&&i("pinSessionAt",E,x,A)}function b(x){if(u.value===null&&!v(x))return;x.preventDefault(),x.dataTransfer&&(x.dataTransfer.dropEffect="move");const S=s.sessions[s.sessions.length-1];S!==void 0&&(c.value={id:S.id,position:"after"})}function _(x){const S=s.sessions.map(E=>E.id),T=u.value;if(c.value=null,u.value=null,T!==null){const E=S[S.length-1];E!==void 0&&T!==E&&i("reorder",[...S.filter(P=>P!==T),T]);return}const A=x.dataTransfer?.getData(Bf);A&&i("pinSessionAt",A,S[S.length-1]??null,"after")}function g(x){x.currentTarget.contains(x.relatedTarget)||(c.value=null)}return(x,S)=>(y(),M("div",{class:"pinned",onDragover:b,onDrop:_,onDragleave:g},[C("div",Fve,[C("span",Rve,N(p(o)("sidebar.pinned")),1),j(p(gn),{class:Re(["pinned-toggle",{"pinned-toggle--on":r.value}]),size:"sm",label:r.value?p(o)("sidebar.expandPinned"):p(o)("sidebar.collapsePinned"),tooltip:r.value?p(o)("sidebar.expandPinned"):p(o)("sidebar.collapsePinned"),onClick:It(l,["stop"])},{default:me(()=>[r.value?(y(),he(p(Te),{key:0,name:"chevron-right"})):(y(),he(p(Te),{key:1,name:"chevron-down"}))]),_:1},8,["class","label","tooltip"])]),r.value?ee("",!0):(y(),M("div",Ove,[(y(!0),M(Pe,null,pt(e.sessions,T=>(y(),M("div",{key:T.id,class:Re(["pin-drop-target",{dragging:u.value===T.id,"drop-before":c.value?.id===T.id&&c.value.position==="before","drop-after":c.value?.id===T.id&&c.value.position==="after"}]),draggable:d.value!==T.id,onDragstart:A=>f(T.id,A),onDragend:h,onDragover:It(A=>k(A,T.id),["stop"]),onDrop:It(A=>w(T.id,A),["stop"])},[j(Z5,{session:T,active:T.id===e.activeId,"approval-count":e.pendingBySession[T.id]?.approvals??0,"question-count":e.pendingBySession[T.id]?.questions??0,unread:e.unreadBySession[T.id]??!1,onRenameStateChange:A=>d.value=A?T.id:null,onSelect:S[0]||(S[0]=A=>i("selectSession",A)),onRename:S[1]||(S[1]=(A,E)=>i("renameSession",A,E)),onArchive:S[2]||(S[2]=A=>i("archiveSession",A)),onFork:S[3]||(S[3]=A=>i("forkSession",A)),onExport:S[4]||(S[4]=A=>i("exportSession",A)),onPin:S[5]||(S[5]=A=>i("pinSession",A))},null,8,["session","active","approval-count","question-count","unread","onRenameStateChange"])],42,Pve))),128))]))],32))}}),Bve=ft(Dve,[["__scopeId","data-v-aec340eb"]]),Hve={class:"ch"},zve={class:"ch-brand"},Wve={class:"ch-tail"},Uve={class:"search-input"},jve={class:"side-section-label"},Vve={class:"side-section-title"},qve={class:"side-section-actions"},Kve={key:0,class:"empty"},Zve=["onDragover","onDrop"],Gve={key:0,class:"empty"},Yve={key:1,class:"show-more-row"},Xve=["disabled"],Jve={class:"show-more-label"},Qve={class:"folder-drop-card"},e9e={class:"view-menu-label"},t9e={class:"view-menu-check"},n9e={class:"view-menu-check"},o9e=!1,s9e=1e3,i9e=et({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},pinnedSessions:{default:()=>[]},flatSessions:{default:()=>[]},flatHasMore:{type:Boolean,default:!1},flatLoadingMore:{type:Boolean,default:!1},initialized:{type:Boolean,default:!1},activeId:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","addWorkspacePaths","rename","archive","fork","export","pin","reorderPinned","pinAt","unpin","renameWorkspace","deleteWorkspace","reorderWorkspaces","loadMoreSessions","loadAllSessions","ensureFlatSessions","loadMoreFlatSessions","openSettings","login","collapse"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z(!1),r=c()?["⌘","K"]:["Ctrl","K"],l=c()?["⌃","⇧","O"]:["Ctrl","Shift","O"];function a(){s("loadAllSessions"),i.value=!0}function u(Qe){(Qe.metaKey||Qe.ctrlKey)&&(Qe.key.toLowerCase()==="k"?(Qe.preventDefault(),a()):!Qe.metaKey&&Qe.ctrlKey&&Qe.shiftKey&&Qe.key.toLowerCase()==="o"&&(Qe.preventDefault(),s("create")))}dn(()=>window.addEventListener("keydown",u)),Vn(()=>window.removeEventListener("keydown",u));function c(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Qe=navigator.userAgentData;return Qe?.platform==="macOS"||Qe?.platform==="iOS"}const d=Z(null),f=Z(!1),h=Z(!1),m=Z(!1);let v=null;function k(Qe=d.value){Qe&&(f.value=Qe.scrollTop>0,h.value=Qe.scrollTop+Qe.clientHeight<Qe.scrollHeight-1)}function w(Qe){k(Qe.target),m.value=!0,v&&clearTimeout(v),v=setTimeout(()=>{m.value=!1,v=null},900)}let b=null;dn(()=>{yt(()=>{k(),typeof ResizeObserver=="function"&&d.value&&(b=new ResizeObserver(()=>k()),b.observe(d.value))})}),Dp(()=>k()),Vn(()=>{b?.disconnect(),v&&clearTimeout(v)});const _=Z(new Set(yQ()));function g(Qe){return _.value.has(Qe)}function x(Qe){const st=new Set(_.value);st.has(Qe)?st.delete(Qe):st.add(Qe),_.value=st,p9(st)}function S(){const Qe=new Set(o.groups.map(st=>st.workspace.id));_.value=Qe,p9(Qe)}function T(){const Qe=new Set;_.value=Qe,p9(Qe)}const A=R(()=>o.groups.length>0&&o.groups.every(Qe=>_.value.has(Qe.workspace.id))),E=Z(new Map);function P(Qe){return E.value.get(Qe)}function D(Qe){const st=o.groups.find(kn=>kn.workspace.id===Qe);if(!st)return;const Ct=(E.value.get(Qe)??st.initialCount)+O5,Qt=new Map(E.value);Qt.set(Qe,Ct),E.value=Qt,st.sessions.length<Ct&&st.hasMore&&s("loadMoreSessions",Qe)}function I(Qe){if(!E.value.has(Qe))return;const st=new Map(E.value);st.delete(Qe),E.value=st}const $=Z(null),B=Z(null);function H(Qe){$.value=Qe}function O(){$.value=null,B.value=null}function F(Qe){const st=Qe.currentTarget.getBoundingClientRect();return Qe.clientY<st.top+st.height/2?"before":"after"}function U(Qe,st){$.value===null||$.value===st||(Qe.preventDefault(),Qe.dataTransfer&&(Qe.dataTransfer.dropEffect="move"),B.value={id:st,position:F(Qe)})}function z(Qe){const st=$.value,Ct=B.value?.id===Qe?B.value.position:"before";if(B.value=null,$.value=null,!st||st===Qe)return;const Qt=AE(o.groups.map(kn=>kn.workspace.id),st,Qe,Ct);s("reorderWorkspaces",Qt)}const W=Z(null);function K(Qe,st){W.value={id:Qe,workspaceId:st}}function V(){W.value=null}function ie(Qe){W.value=null,s("unpin",Qe)}const ne=Z(bQ());function X(Qe){ne.value!==Qe&&(ne.value=Qe,CQ(Qe),Qe==="flat"&&s("ensureFlatSessions"))}Je(()=>o.initialized,Qe=>{Qe&&ne.value==="flat"&&s("ensureFlatSessions")},{immediate:!0});const le=Z(!1),Ie=Z({}),de=Z(null);function pe(Qe){const st=Qe.target;st.closest(".view-menu")||st.closest(".side-section-view")||oe()}async function ve(Qe){if(le.value){oe();return}const st=Qe.currentTarget;le.value=!0,document.addEventListener("mousedown",pe),window.addEventListener("resize",oe),await yt();const Ct=de.value?.el,Qt=st.getBoundingClientRect(),kn=4,Ko=8,Eo=Ct?.offsetHeight??0,bo=Ct?.offsetWidth??0;let Ns=Qt.bottom+kn,Do=!1;Ns+Eo>window.innerHeight-Ko&&(Ns=Math.max(Ko,Qt.top-Eo-kn),Do=!0);let Io=Qt.right-bo;Io<Ko&&(Io=Ko),Ie.value={top:`${Math.round(Ns)}px`,left:`${Math.round(Io)}px`,transformOrigin:Do?"bottom right":"top right","--menu-pop-shift":Do?"2px":"-2px"}}function oe(){le.value=!1,document.removeEventListener("mousedown",pe),window.removeEventListener("resize",oe)}function ye(Qe){X(Qe),oe()}const G=Z(null);function Y(Qe,st){st.dataTransfer&&(st.dataTransfer.effectAllowed="move",st.dataTransfer.setData(Bf,Qe),st.dataTransfer.setData("text/plain",Qe))}const fe=Z(!1);function we(Qe){ne.value!=="flat"||W.value===null||(Qe.preventDefault(),Qe.dataTransfer&&(Qe.dataTransfer.dropEffect="move"),fe.value=!0)}function ge(Qe){ne.value!=="flat"||W.value===null||(Qe.preventDefault(),fe.value=!1,ie(W.value.id))}function Q(Qe){Qe.currentTarget.contains(Qe.relatedTarget)||(fe.value=!1)}function te(Qe,st){st.target.closest(".gh-more, .gh-add")||x(Qe)}function ce(Qe){s("select",Qe)}const ue=Z(null);function Se(Qe){ue.value?ue.value.expand():M3(!1),s("pin",Qe)}function ze(Qe,st,Ct){ue.value?.expand(),s("pinAt",Qe,st,Ct)}const _e=Z(0),Ee=Z(!1);function it(){_e.value=0,Ee.value=!1}function Fe(Qe){!ih()||!c9(Qe)||(Qe.preventDefault(),Qe.stopPropagation(),_e.value+=1,Ee.value=!0)}function Oe(Qe){!ih()||!c9(Qe)||(Qe.preventDefault(),Qe.stopPropagation(),Qe.dataTransfer&&(Qe.dataTransfer.dropEffect="copy"))}function Ge(Qe){!ih()||!c9(Qe)||(_e.value=Math.max(0,_e.value-1),_e.value===0&&(Ee.value=!1))}function at(Qe){if(it(),!ih())return;const st=bJ(Qe);st.length!==0&&(Qe.preventDefault(),Qe.stopPropagation(),s("addWorkspacePaths",st))}const Tt=Z(null),Bt=Z(""),Yt=Z(""),Sn=Z(null);function on(){return Sn}function en(Qe,st){Tt.value=Qe,Yt.value=st,Bt.value=st,yt().then(()=>Sn.value?.focus())}function Cn(){const Qe=Tt.value,st=Bt.value.trim();Qe&&st&&st!==Yt.value&&s("renameWorkspace",Qe,st),Tt.value=null}function Mn(){Tt.value=null}function We(Qe){Bt.value=Qe}const tt=Z(!1),Ue=Z(null),Lt=Z({}),gt=Z(null);function wn(Qe){gt.value?.el&&!gt.value.el.contains(Qe.target)&&go()}function yn(Qe,st){st.preventDefault(),st.stopPropagation(),Ue.value=Qe,Lt.value={top:`${st.clientY}px`,left:`${st.clientX}px`,transformOrigin:"top left","--menu-pop-shift":"-2px"},tt.value=!0,document.addEventListener("mousedown",wn,!0)}function go(){tt.value=!1,document.removeEventListener("mousedown",wn,!0),Ue.value=null}function qt(){Ue.value&&Zs(Ue.value.root),go()}function ps(){Ue.value&&en(Ue.value.id,Ue.value.name),go()}function xs(){const Qe=Ue.value;Qe&&(go(),s("deleteWorkspace",Qe.id))}const _n=Z(null),In=Z(null),To=Z({}),lo=Z(null);function St(Qe){const st=Qe.target;st.closest(".gh-more")||st.closest(".ws-menu")||Jo()}async function hs(Qe,st){if(_n.value===Qe.id){Jo();return}const Ct=st.currentTarget;In.value=Qe,_n.value=Qe.id,document.addEventListener("mousedown",St),window.addEventListener("resize",Jo),await yt();const Qt=lo.value?.el,kn=Ct.getBoundingClientRect(),Ko=4,Eo=8,bo=Qt?.offsetHeight??0,Ns=Qt?.offsetWidth??0;let Do=kn.bottom+Ko,Io=!1;Do+bo>window.innerHeight-Eo&&(Do=Math.max(Eo,kn.top-bo-Ko),Io=!0);let Qo=kn.right-Ns;Qo<Eo&&(Qo=Eo),To.value={top:`${Math.round(Do)}px`,left:`${Math.round(Qo)}px`,transformOrigin:Io?"bottom right":"top right","--menu-pop-shift":Io?"2px":"-2px"}}function Jo(){_n.value=null,In.value=null,document.removeEventListener("mousedown",St),window.removeEventListener("resize",Jo)}function uo(Qe){Zs(Qe.root),Jo()}function Ys(Qe){en(Qe.id,Qe.name),Jo()}function Nn(Qe){Jo(),s("deleteWorkspace",Qe.id)}Vn(()=>{document.removeEventListener("mousedown",wn,!0),document.removeEventListener("mousedown",St),document.removeEventListener("mousedown",pe),window.removeEventListener("resize",Jo),window.removeEventListener("resize",oe)});const no=Z(null);let $s;function Xs(){const Qe=no.value;Qe&&(Qe.classList.remove("blink-now"),Qe.getBoundingClientRect(),Qe.classList.add("blink-now"),clearTimeout($s),$s=setTimeout(()=>Qe.classList.remove("blink-now"),300))}const ci=zr(()=>jo(()=>import("./DesignSystemView-CTUhpkDe.js"),__vite__mapDeps([8,9]))),Oo=Z(!1);let vo,Po=!1;function co(Qe){Po=!1,clearTimeout(vo),Qe.currentTarget.setPointerCapture?.(Qe.pointerId),vo=setTimeout(()=>{Po=!0,Oo.value=!0},s9e)}function Tn(Qe){clearTimeout(vo);const st=Qe.currentTarget;st.hasPointerCapture?.(Qe.pointerId)&&st.releasePointerCapture(Qe.pointerId)}function fo(){if(Po){Po=!1;return}Xs()}return Vn(()=>{clearTimeout(vo)}),(Qe,st)=>(y(),M("aside",{class:Re(["side",{"macos-desktop":p(rc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:Zt({width:e.collapsed?"0px":e.colWidth+"px"})},[C("div",{class:"col",style:Zt({width:e.colWidth+"px"}),onDragenter:Fe,onDragover:Oe,onDragleave:Ge,onDrop:at},[C("div",Hve,[C("div",zve,[p(rc)?ee("",!0):(y(),M(Pe,{key:0},[(y(),M("svg",{ref_key:"logoRef",ref:no,class:"ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:fo,onPointerdown:co,onPointerup:Tn,onPointercancel:Tn},[...st[31]||(st[31]=[iu('<defs data-v-a80a4ba6><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-a80a4ba6><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-a80a4ba6></rect><g class="ch-eyes" fill="#000" data-v-a80a4ba6><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-a80a4ba6></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-a80a4ba6></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-a80a4ba6></rect>',2)])],544)),st[32]||(st[32]=C("span",{class:"ch-name"},"Kimi Code",-1))],64))]),C("div",Wve,[p(rc)?ee("",!0):(y(),he(p(gn),{key:0,class:"ch-collapse",size:"sm",label:p(n)("sidebar.collapseSidebar"),tooltip:p(n)("sidebar.collapseSidebar"),onClick:st[0]||(st[0]=It(Ct=>s("collapse"),["stop"]))},{default:me(()=>[j(p(Te),{name:"panel-collapse"})]),_:1},8,["label","tooltip"])),j(b0e)])]),C("div",{class:Re(["sidebar-actions",{"sidebar-actions--has-workspace-action":o9e}])},[C("button",{class:"btn-new-chat",type:"button",onClick:st[1]||(st[1]=It(Ct=>s("create"),["stop"]))},[j(p(Te),{name:"chat-new"}),C("span",null,N(p(n)("sidebar.newChat")),1),j(p(oa),{keys:p(l)},null,8,["keys"])]),ee("",!0),C("button",{class:"search",type:"button",onClick:a},[j(p(Te),{class:"search-icon",name:"search"}),C("span",Uve,N(p(n)("sidebar.search")),1),j(p(oa),{keys:p(r)},null,8,["keys"])])],2),ne.value==="flat"||e.groups.length>0?(y(),M("div",{key:0,class:Re(["sessions-head",{"sessions-head--scrolled":f.value}])},[e.pinnedSessions.length>0?(y(),he(Bve,{key:0,ref_key:"pinnedListRef",ref:ue,sessions:e.pinnedSessions,"active-id":e.activeId,"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,onSelectSession:ce,onRenameSession:st[3]||(st[3]=(Ct,Qt)=>s("rename",Ct,Qt)),onArchiveSession:st[4]||(st[4]=Ct=>s("archive",Ct)),onForkSession:st[5]||(st[5]=Ct=>s("fork",Ct)),onExportSession:st[6]||(st[6]=Ct=>s("export",Ct)),onPinSession:Se,onPinSessionAt:ze,onSessionDragStart:K,onSessionDragEnd:V,onReorder:st[7]||(st[7]=Ct=>s("reorderPinned",Ct))},null,8,["sessions","active-id","pending-by-session","unread-by-session"])):ee("",!0),C("div",jve,[C("span",Vve,N(p(n)("sidebar.sessionsHeader")),1),C("div",qve,[ne.value==="grouped"?(y(),he(p(gn),{key:0,class:"side-section-toggle",size:"sm",label:A.value?p(n)("sidebar.expandAll"):p(n)("sidebar.collapseAll"),tooltip:A.value?p(n)("sidebar.expandAll"):p(n)("sidebar.collapseAll"),onClick:st[8]||(st[8]=It(Ct=>A.value?T():S(),["stop"]))},{default:me(()=>[A.value?(y(),he(p(Te),{key:0,name:"expand"})):(y(),he(p(Te),{key:1,name:"collapse"}))]),_:1},8,["label","tooltip"])):ee("",!0),j(p(pn),{text:p(n)("sidebar.viewSwitcher")},{default:me(()=>[j(p(gn),{class:"side-section-toggle side-section-view",size:"sm",label:p(n)("sidebar.viewSwitcher"),onClick:It(ve,["stop"])},{default:me(()=>[j(p(Te),{name:"list-settings"})]),_:1},8,["label"])]),_:1},8,["text"])])])],2)):ee("",!0),C("div",{ref_key:"sessionsEl",ref:d,class:Re(["sessions",{scrolling:m.value,"pinned-drag-active":ne.value==="flat"&&W.value!==null,"flat-pinned-drop-hover":fe.value}]),onScroll:w,onDragover:we,onDrop:ge,onDragleave:Q},[ne.value==="grouped"?(y(),M(Pe,{key:0},[e.groups.length===0?(y(),M("div",Kve,N(p(n)("workspace.noWorkspace")),1)):(y(!0),M(Pe,{key:1},pt(e.groups,Ct=>(y(),M("div",{key:Ct.workspace.id,class:Re(["ws-drop-target",{"drop-before":B.value?.id===Ct.workspace.id&&B.value.position==="before","drop-after":B.value?.id===Ct.workspace.id&&B.value.position==="after"}]),onDragover:Qt=>U(Qt,Ct.workspace.id),onDrop:Qt=>z(Ct.workspace.id)},[j(Nve,{group:Ct,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":Tt.value,"rename-value":Bt.value,"rename-input-ref":on(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":_n.value,dragging:$.value===Ct.workspace.id,"is-collapsed":g,"visible-limit":P,"pinned-drag-session":W.value,onGroupClick:te,onGroupContextmenu:yn,onToggleWsMenu:hs,onCreateInWorkspace:st[9]||(st[9]=Qt=>s("createInWorkspace",Qt)),onSelectSession:ce,onRenameSession:st[10]||(st[10]=(Qt,kn)=>s("rename",Qt,kn)),onArchiveSession:st[11]||(st[11]=Qt=>s("archive",Qt)),onForkSession:st[12]||(st[12]=Qt=>s("fork",Qt)),onExportSession:st[13]||(st[13]=Qt=>s("export",Qt)),onPinSession:Se,onDropPinnedSession:ie,onExpand:D,onCollapse:I,onConfirmRename:Cn,onCancelRename:Mn,onUpdateRenameValue:We,onWsDragstart:H,onWsDragend:O},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging","pinned-drag-session"])],42,Zve))),128))],64)):(y(),M(Pe,{key:1},[(y(!0),M(Pe,null,pt(e.flatSessions,Ct=>(y(),he(Z5,{key:Ct.id,session:Ct,active:Ct.id===e.activeId,"approval-count":e.pendingBySession[Ct.id]?.approvals??0,"question-count":e.pendingBySession[Ct.id]?.questions??0,unread:e.unreadBySession[Ct.id]??!1,draggable:G.value!==Ct.id,onDragstart:Qt=>Y(Ct.id,Qt),onRenameStateChange:Qt=>G.value=Qt?Ct.id:null,onSelect:ce,onRename:st[14]||(st[14]=(Qt,kn)=>s("rename",Qt,kn)),onArchive:st[15]||(st[15]=Qt=>s("archive",Qt)),onFork:st[16]||(st[16]=Qt=>s("fork",Qt)),onExport:st[17]||(st[17]=Qt=>s("export",Qt)),onPin:Se},null,8,["session","active","approval-count","question-count","unread","draggable","onDragstart","onRenameStateChange"]))),128)),e.flatSessions.length===0&&!e.flatHasMore&&e.pinnedSessions.length===0?(y(),M("div",Gve,N(p(n)("sidebar.noSessions")),1)):ee("",!0),e.flatHasMore?(y(),M("div",Yve,[C("button",{class:"show-more",disabled:e.flatLoadingMore,onClick:st[18]||(st[18]=It(Ct=>s("loadMoreFlatSessions"),["stop"]))},[C("span",Jve,N(e.flatLoadingMore?p(n)("sidebar.loadingMore"):p(n)("sidebar.loadMore")),1),j(p(Te),{name:"chevron-down",size:"sm"})],8,Xve)])):ee("",!0)],64))],34),C("div",{class:Re(["side-footer",{"side-footer--shadowed":h.value}])},[j(V2e,{onLogin:st[19]||(st[19]=Ct=>s("login")),onOpenSettings:st[20]||(st[20]=Ct=>s("openSettings"))})],2),C("div",{class:Re(["folder-drop-overlay",{show:Ee.value}]),"aria-hidden":"true"},[C("div",Qve,[j(p(Te),{name:"folder",size:"lg"}),C("span",null,N(p(n)("sidebar.dropToAddWorkspace")),1)])],2)],36),j(as,{name:"menu-pop"},{default:me(()=>[tt.value?(y(),he(p(Cl),{key:0,ref_key:"ghMenuRef",ref:gt,class:"gh-menu",style:Zt(Lt.value),onClick:st[21]||(st[21]=It(()=>{},["stop"]))},{default:me(()=>[j(p(hn),{onClick:qt},{default:me(()=>[j(p(Te),{name:"copy",size:"sm"}),qe(" "+N(p(n)("sidebar.copyPath")),1)]),_:1}),j(p(hn),{class:"workspace-rename-item",onClick:ps},{default:me(()=>[j(p(Te),{name:"pencil",size:"sm"}),qe(" "+N(p(n)("sidebar.rename")),1)]),_:1}),j(p(hn),{danger:"",onClick:xs},{default:me(()=>[j(p(Te),{name:"close",size:"sm"}),qe(" "+N(p(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ee("",!0)]),_:1}),j(as,{name:"menu-pop"},{default:me(()=>[_n.value!==null&&In.value?(y(),he(p(Cl),{key:0,ref_key:"wsMenuRef",ref:lo,class:"ws-menu",style:Zt(To.value),onClick:st[25]||(st[25]=It(()=>{},["stop"]))},{default:me(()=>[j(p(hn),{onClick:st[22]||(st[22]=Ct=>uo(In.value))},{default:me(()=>[j(p(Te),{name:"copy",size:"sm"}),qe(" "+N(p(n)("sidebar.copyPath")),1)]),_:1}),j(p(hn),{class:"workspace-rename-item",onClick:st[23]||(st[23]=Ct=>Ys(In.value))},{default:me(()=>[j(p(Te),{name:"pencil",size:"sm"}),qe(" "+N(p(n)("sidebar.rename")),1)]),_:1}),j(p(hn),{danger:"",onClick:st[24]||(st[24]=Ct=>Nn(In.value))},{default:me(()=>[j(p(Te),{name:"close",size:"sm"}),qe(" "+N(p(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ee("",!0)]),_:1}),j(as,{name:"menu-pop"},{default:me(()=>[le.value?(y(),he(p(Cl),{key:0,ref_key:"viewMenuRef",ref:de,class:"view-menu",style:Zt(Ie.value),onClick:st[28]||(st[28]=It(()=>{},["stop"]))},{default:me(()=>[C("div",e9e,N(p(n)("sidebar.viewGroup")),1),j(p(hn),{onClick:st[26]||(st[26]=Ct=>ye("flat"))},{default:me(()=>[j(p(Te),{name:"list",size:"sm"}),qe(" "+N(p(n)("sidebar.viewFlat"))+" ",1),C("span",t9e,[ne.value==="flat"?(y(),he(p(Te),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1}),j(p(hn),{onClick:st[27]||(st[27]=Ct=>ye("grouped"))},{default:me(()=>[j(p(Te),{name:"tree-view",size:"sm"}),qe(" "+N(p(n)("sidebar.viewGrouped"))+" ",1),C("span",n9e,[ne.value==="grouped"?(y(),he(p(Te),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1})]),_:1},8,["style"])):ee("",!0)]),_:1}),i.value?(y(),he(uee,{key:0,sessions:e.sessions,"active-id":e.activeId,onSelect:ce,onClose:st[29]||(st[29]=Ct=>i.value=!1)},null,8,["sessions","active-id"])):ee("",!0),(y(),he(Zr,{to:"body"},[Oo.value?(y(),he(p(ci),{key:0,onClose:st[30]||(st[30]=Ct=>Oo.value=!1)})):ee("",!0)]))],6))}}),r9e=ft(i9e,[["__scopeId","data-v-a80a4ba6"]]),l9e=["aria-label"],a9e=et({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{},applyLive:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),{width:i,dragging:r,cursor:l,onPointerDown:a}=She({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse,applyLive:n.applyLive});return o("update:width",i.value),Je(i,u=>o("update:width",u)),Je(r,u=>o("update:dragging",u)),(u,c)=>(y(),M("div",{class:Re(["rh",{dragging:p(r)}]),style:Zt({cursor:p(l)}),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??p(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...d)=>p(a)&&p(a)(...d))},[...c[1]||(c[1]=[C("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],46,l9e))}}),Zx=ft(a9e,[["__scopeId","data-v-1c6dfdc5"]]),u9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function c9e(e,t){return y(),M("svg",u9e,[...t[0]||(t[0]=[C("path",{d:"M12.0684 2.03418C12.5654 2.03421 12.9687 2.43755 12.9688 2.93457V11.0996H21.0654C21.5625 11.0996 21.9658 11.503 21.9658 12C21.9658 12.497 21.5625 12.9004 21.0654 12.9004H12.9688V21.0654C12.9687 21.5624 12.5654 21.9658 12.0684 21.9658C11.5713 21.9658 11.168 21.5625 11.168 21.0654V12.9004H2.93457C2.43751 12.9004 2.03418 12.4971 2.03418 12C2.03418 11.5029 2.43751 11.0996 2.93457 11.0996H11.168V2.93457C11.168 2.43753 11.5713 2.03418 12.0684 2.03418Z",fill:"currentColor"},null,-1)])])}const d9e=kt({name:"kimi-add",render:c9e}),f9e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function p9e(e,t){return y(),M("svg",f9e,[...t[0]||(t[0]=[C("path",{id:"p0",d:"M 0 -9.9 C -5.468 -9.9 -9.9 -5.468 -9.9 0 C -9.9 1.923 -9.351 3.719 -8.402 5.239 C -8.402 5.239 -9.483 7.821 -9.483 7.821 C -9.896 8.809 -9.171 9.9 -8.099 9.9 C -8.099 9.9 0 9.9 0 9.9 C 5.468 9.9 9.9 5.468 9.9 0 C 9.9 -5.468 5.468 -9.9 0 -9.9 Z M -8.1 0 C -8.1 -4.474 -4.474 -8.1 0 -8.1 C 4.473 -8.1 8.1 -4.474 8.1 0 C 8.1 4.473 4.473 8.1 -0.001 8.1 C -0.001 8.1 -7.648 8.1 -7.648 8.1 L -6.365 5.035 C -6.365 5.035 -6.648 4.629 -6.648 4.629 C -7.563 3.317 -8.1 1.723 -8.1 0 Z",transform:"matrix(1 0 0 1 12 12)",fill:"currentColor","fill-rule":"evenodd"},null,-1),C("path",{id:"p1",d:"M 3.6 0.5 L -2.6 0.5 M 0.5 -2.573 L 0.5 3.573",transform:"translate(11.5 11.5)",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"},null,-1)])])}const h9e=kt({name:"kimi-add-conversation",render:p9e}),m9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function g9e(e,t){return y(),M("svg",m9e,[...t[0]||(t[0]=[C("path",{d:"M15.0996 12C15.5967 12 16 12.4033 16 12.9004C15.9998 13.3973 15.5965 13.7998 15.0996 13.7998H8.90039C8.40346 13.7998 8.00021 13.3973 8 12.9004C8 12.4033 8.40333 12 8.90039 12H15.0996Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19 3.2002C20.5464 3.2002 21.7998 4.4536 21.7998 6V7C21.7998 8.03565 21.2363 8.93754 20.4004 9.42188V17C20.4004 19.1539 18.6539 20.9004 16.5 20.9004H7.5C5.34609 20.9004 3.59961 19.1539 3.59961 17V9.42188C2.76374 8.93754 2.2002 8.03565 2.2002 7V6C2.2002 4.4536 3.4536 3.2002 5 3.2002H19ZM5.40039 17C5.40039 18.1598 6.3402 19.0996 7.5 19.0996H16.5C17.6598 19.0996 18.5996 18.1598 18.5996 17V9.7998H5.40039V17ZM4.89746 5.00488C4.39333 5.05621 4 5.48232 4 6V7L4.00488 7.10254C4.05278 7.57297 4.42703 7.94722 4.89746 7.99512L5 8H19C19.5523 8 20 7.55228 20 7V6C20 5.44772 19.5523 5 19 5H5L4.89746 5.00488Z",fill:"currentColor"},null,-1)])])}const v9e=kt({name:"kimi-archive",render:g9e}),y9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function k9e(e,t){return y(),M("svg",y9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.386 21.6387C11.7378 21.988 12.3059 21.987 12.6565 21.6364L18.1949 16.098C18.5464 15.7465 18.5464 15.1766 18.1949 14.8252C17.8434 14.4737 17.2736 14.4737 16.9221 14.8252L12.9201 18.8272V3.00002C12.9201 2.50297 12.5171 2.10003 12.0201 2.10003C11.523 2.10003 11.1201 2.50297 11.1201 3.00002V18.8383L7.07554 14.8229C6.7228 14.4727 6.15295 14.4747 5.80275 14.8275C5.45255 15.1802 5.45461 15.7501 5.80735 16.1003L11.386 21.6387Z",fill:"currentColor"},null,-1)])])}const b9e=kt({name:"kimi-arrow-down",render:k9e}),C9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function w9e(e,t){return y(),M("svg",C9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.16127 12.814C1.81197 12.4622 1.81299 11.8941 2.16357 11.5435L7.70203 6.00506C8.0535 5.65359 8.62335 5.65359 8.97482 6.00506C9.32629 6.35653 9.32629 6.92638 8.97482 7.27785L4.97276 11.2799H20.8C21.297 11.2799 21.7 11.6829 21.7 12.1799C21.7 12.677 21.297 13.0799 20.8 13.0799H4.96171L8.97712 17.1244C9.32732 17.4772 9.32526 18.047 8.97252 18.3972C8.61978 18.7474 8.04993 18.7454 7.69973 18.3926L2.16127 12.814Z",fill:"currentColor"},null,-1)])])}const _9e=kt({name:"kimi-arrow-left",render:w9e}),x9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function S9e(e,t){return y(),M("svg",x9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21.4387 12.814C21.788 12.4622 21.787 11.8941 21.4364 11.5436L15.8979 6.0051C15.5464 5.65363 14.9766 5.65363 14.6251 6.0051C14.2737 6.35657 14.2737 6.92642 14.6251 7.27789L18.6272 11.28H2.79998C2.30293 11.28 1.89998 11.6829 1.89998 12.18C1.89998 12.677 2.30293 13.08 2.79998 13.08H18.6382L14.6228 17.1245C14.2726 17.4772 14.2747 18.0471 14.6274 18.3973C14.9802 18.7475 15.55 18.7454 15.9002 18.3927L21.4387 12.814Z",fill:"currentColor"},null,-1)])])}const A9e=kt({name:"kimi-arrow-right",render:S9e}),M9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function T9e(e,t){return y(),M("svg",M9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.386 2.36129C11.7378 2.01198 12.3059 2.013 12.6565 2.36358L18.1949 7.90204C18.5464 8.25351 18.5464 8.82336 18.1949 9.17483C17.8434 9.52631 17.2736 9.52631 16.9221 9.17483L12.9201 5.17277V21C12.9201 21.497 12.5171 21.9 12.0201 21.9C11.523 21.9 11.1201 21.497 11.1201 21V5.16172L7.07554 9.17713C6.7228 9.52733 6.15295 9.52527 5.80275 9.17253C5.45255 8.81979 5.45461 8.24995 5.80735 7.89975L11.386 2.36129Z",fill:"currentColor"},null,-1)])])}const E9e=kt({name:"kimi-arrow-up",render:T9e}),I9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function L9e(e,t){return y(),M("svg",I9e,[...t[0]||(t[0]=[C("path",{d:"M19.3027 5.9053C19.6542 5.55397 20.2247 5.55388 20.5761 5.9053C20.9273 6.25675 20.9273 6.82734 20.5761 7.17874L9.65911 18.0948C9.30773 18.4461 8.73814 18.446 8.38665 18.0948L3.42376 13.1328C3.0726 12.7814 3.07263 12.2118 3.42376 11.8604C3.77524 11.509 4.34575 11.5089 4.6972 11.8604L9.02239 16.1856L19.3027 5.9053Z",fill:"currentColor"},null,-1)])])}const $9e=kt({name:"kimi-check",render:L9e}),N9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function F9e(e,t){return y(),M("svg",N9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.3912 16.7134C11.743 17.0627 12.3111 17.0617 12.6617 16.7111L19.6364 9.73641C19.9878 9.38494 19.9878 8.81509 19.6364 8.46362C19.2849 8.11215 18.7151 8.11215 18.3636 8.46362L12.023 14.8042L5.63407 8.46132C5.28133 8.11112 4.71149 8.11318 4.36129 8.46592C4.01109 8.81866 4.01314 9.3885 4.36588 9.73871L11.3912 16.7134Z",fill:"currentColor"},null,-1)])])}const R9e=kt({name:"kimi-chevron-down",render:F9e}),O9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function P9e(e,t){return y(),M("svg",O9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.1261 12.6088C16.4754 12.257 16.4743 11.6889 16.1238 11.3383L9.14904 4.36363C8.79757 4.01216 8.22772 4.01216 7.87625 4.36363C7.52477 4.7151 7.52477 5.28495 7.87625 5.63642L14.2169 11.977L7.87395 18.3659C7.52375 18.7187 7.52581 19.2885 7.87855 19.6387C8.23129 19.9889 8.80113 19.9869 9.15133 19.6341L16.1261 12.6088Z",fill:"currentColor"},null,-1)])])}const D9e=kt({name:"kimi-chevron-right",render:P9e}),B9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function H9e(e,t){return y(),M("svg",B9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.3912 8.46132C11.743 8.11202 12.3111 8.11304 12.6617 8.46362L19.6364 15.4383C19.9878 15.7898 19.9878 16.3597 19.6364 16.7111C19.2849 17.0626 18.7151 17.0626 18.3636 16.7111L12.023 10.3705L5.63407 16.7134C5.28133 17.0636 4.71149 17.0616 4.36129 16.7088C4.01109 16.3561 4.01314 15.7862 4.36588 15.436L11.3912 8.46132Z",fill:"currentColor"},null,-1)])])}const z9e=kt({name:"kimi-chevron-up",render:H9e}),W9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function U9e(e,t){return y(),M("svg",W9e,[...t[0]||(t[0]=[C("path",{d:"M11.8999 6.79965C12.397 6.79965 12.7997 7.20235 12.7997 7.69941V11.7266L14.7359 13.6629C15.0873 14.0143 15.0879 14.584 14.7366 14.9355C14.3852 15.287 13.8148 15.287 13.4633 14.9355L11.2632 12.7355C11.0947 12.5668 11.0002 12.338 11.0001 12.0995V7.69941C11.0001 7.20238 11.4029 6.7997 11.8999 6.79965Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 1.89893C17.4677 1.89893 21.9001 6.33147 21.9002 11.7991C21.9002 17.2669 17.4678 21.6993 12 21.6993C6.53228 21.6993 2.09985 17.2669 2.09985 11.7991C2.09998 6.33147 6.53236 1.89893 12 1.89893ZM20.1 11.7998C20.1 7.32616 16.4737 3.69984 12 3.69984C7.5264 3.69984 3.90008 7.32616 3.90008 11.7998C3.90032 16.2732 7.52655 19.8998 12 19.8998C16.4735 19.8998 20.0998 16.2732 20.1 11.7998Z",fill:"currentColor"},null,-1)])])}const j9e=kt({name:"kimi-clock",render:U9e}),V9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function q9e(e,t){return y(),M("svg",V9e,[...t[0]||(t[0]=[C("path",{d:"M17.9542 4.77253C18.3056 4.42106 18.8761 4.42106 19.2276 4.77253C19.579 5.12401 19.579 5.69452 19.2276 6.04597L13.2735 12.0001L19.2276 17.9542C19.5791 18.3056 19.5791 18.8761 19.2276 19.2276C18.8761 19.5791 18.3056 19.5791 17.9542 19.2276L12.0001 13.2735L6.04595 19.2276C5.69451 19.5791 5.12399 19.579 4.77252 19.2276C4.42104 18.8761 4.42104 18.3056 4.77252 17.9542L10.7266 12.0001L4.77252 6.04597C4.42104 5.6945 4.42104 5.124 4.77252 4.77253C5.12399 4.42107 5.69448 4.42106 6.04595 4.77253L12.0001 10.7266L17.9542 4.77253Z",fill:"currentColor"},null,-1)])])}const K9e=kt({name:"kimi-close",render:q9e}),Z9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function G9e(e,t){return y(),M("svg",Z9e,[...t[0]||(t[0]=[C("path",{d:"M9.85815 11.957C10.9074 11.957 11.7583 12.8083 11.7585 13.8574V19.8574C11.7585 20.3545 11.3552 20.7578 10.8582 20.7578C10.3611 20.7578 9.95776 20.3545 9.95776 19.8574V13.8574C9.95755 13.8024 9.91325 13.7578 9.85815 13.7578H3.85815C3.3611 13.7578 2.95776 13.3545 2.95776 12.8574C2.95798 12.3605 3.36123 11.957 3.85815 11.957H9.85815Z",fill:"currentColor"},null,-1),C("path",{d:"M12.8582 2.95703C13.3551 2.95703 13.7583 3.36054 13.7585 3.85742V9.85742C13.7585 9.91265 13.8029 9.95703 13.8582 9.95703H19.8582C20.3551 9.95703 20.7583 10.3605 20.7585 10.8574C20.7585 11.3545 20.3552 11.7578 19.8582 11.7578H13.8582C12.8088 11.7578 11.9578 10.9068 11.9578 9.85742V3.85742C11.958 3.36054 12.3612 2.95703 12.8582 2.95703Z",fill:"currentColor"},null,-1)])])}const Y9e=kt({name:"kimi-collapse",render:G9e}),X9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function J9e(e,t){return y(),M("svg",X9e,[...t[0]||(t[0]=[C("path",{d:"M11.9004 2.19995C17.3678 2.20016 21.7998 6.63285 21.7998 12.1003C21.7996 17.5677 17.3677 21.9995 11.9004 21.9998H3.80078C2.72946 21.9996 2.00334 20.9089 2.41699 19.9207L3.49805 17.3386C2.54871 15.8189 2.00007 14.0226 2 12.1003C2 6.63272 6.43277 2.19995 11.9004 2.19995ZM11.9004 3.99976C7.42688 3.99976 3.7998 7.62684 3.7998 12.1003C3.79989 13.8228 4.33669 15.4175 5.25195 16.7292L5.53516 17.1345L4.25195 20.2H11.8994C16.3727 20.1999 19.9998 16.5736 20 12.1003C20 7.62697 16.3737 3.99997 11.9004 3.99976ZM8.9541 10.8005C9.75473 10.8006 10.4041 11.4491 10.4043 12.2498C10.4043 13.0505 9.75482 13.6998 8.9541 13.7C8.15329 13.7 7.50391 13.0506 7.50391 12.2498C7.50406 11.4491 8.15339 10.8005 8.9541 10.8005ZM15.1533 10.8005C15.9539 10.8006 16.6034 11.4491 16.6035 12.2498C16.6035 13.0505 15.954 13.6998 15.1533 13.7C14.3525 13.7 13.7031 13.0506 13.7031 12.2498C13.7033 11.4491 14.3526 10.8005 15.1533 10.8005Z",fill:"currentColor"},null,-1)])])}const Q9e=kt({name:"kimi-comment",render:J9e}),e4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function t4e(e,t){return y(),M("svg",e4e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 7.09961C19.1539 7.09961 20.9004 8.84609 20.9004 11V17C20.9004 19.1539 19.1539 20.9004 17 20.9004H11C8.84609 20.9004 7.09961 19.1539 7.09961 17V11C7.09961 8.84609 8.84609 7.09961 11 7.09961H17ZM11 8.90039C9.8402 8.90039 8.90039 9.8402 8.90039 11V17C8.90039 18.1598 9.8402 19.0996 11 19.0996H17C18.1598 19.0996 19.0996 18.1598 19.0996 17V11C19.0996 9.8402 18.1598 8.90039 17 8.90039H11Z",fill:"currentColor"},null,-1),C("path",{d:"M13 3.09961C14.4447 3.09961 15.705 3.88644 16.3779 5.0498C16.6265 5.47999 16.4789 6.03049 16.0488 6.2793C15.6186 6.52781 15.0681 6.38029 14.8193 5.9502C14.4548 5.32041 13.776 4.90039 13 4.90039H7C5.8402 4.90039 4.90039 5.8402 4.90039 7V13C4.90039 13.776 5.32041 14.4548 5.9502 14.8193C6.38029 15.0681 6.52781 15.6186 6.2793 16.0488C6.03049 16.4789 5.47999 16.6265 5.0498 16.3779C3.88644 15.705 3.09961 14.4447 3.09961 13V7C3.09961 4.84609 4.84609 3.09961 7 3.09961H13Z",fill:"currentColor"},null,-1)])])}const n4e=kt({name:"kimi-copy",render:t4e}),o4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function s4e(e,t){return y(),M("svg",o4e,[...t[0]||(t[0]=[C("path",{d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 10.2797 2.43414 8.66074 3.19922 7.24707C3.20172 7.24246 3.20453 7.23801 3.20703 7.2334C3.33385 6.99995 3.47181 6.77351 3.61621 6.55176C3.73214 6.37355 3.85079 6.19744 3.97754 6.02734C5.35905 4.17471 7.36856 2.81959 9.68945 2.27051C9.69952 2.26813 9.70965 2.26602 9.71973 2.26367C9.85224 2.23276 9.98563 2.2043 10.1201 2.17871C10.1542 2.17221 10.1884 2.16631 10.2227 2.16016C10.3466 2.13791 10.4712 2.11724 10.5967 2.09961C10.6301 2.09489 10.6637 2.0913 10.6973 2.08691C10.8216 2.07073 10.9465 2.05552 11.0723 2.04395C11.1125 2.04022 11.153 2.0384 11.1934 2.03516C11.4595 2.0139 11.7284 2 12 2ZM11.9941 3.7998C11.9968 3.86623 12 3.93292 12 4C12 6.76142 9.76142 9 7 9C6.14209 9 5.33517 8.78324 4.62988 8.40234C4.09862 9.48861 3.7998 10.7093 3.7998 12C3.7998 12.4438 3.83644 12.8791 3.9043 13.3037C4.52807 12.5673 5.45945 12.0996 6.5 12.0996C8.37777 12.0996 9.90039 13.6222 9.90039 15.5C9.90039 17.0702 8.83532 18.3903 7.38867 18.7812C8.70267 19.6765 10.2901 20.2002 12 20.2002C12.468 20.2002 12.9264 20.1583 13.373 20.083C13.1323 19.4342 13 18.7327 13 18C13 14.6863 15.6863 12 19 12C19.4098 12 19.8098 12.0416 20.1963 12.1201C20.1969 12.0801 20.2002 12.0401 20.2002 12C20.2002 7.47126 16.5287 3.7998 12 3.7998H11.9941ZM19 13.7998C16.6804 13.7998 14.7998 15.6804 14.7998 18C14.7998 18.5617 14.9112 19.0972 15.1113 19.5869C17.5225 18.597 19.3558 16.4929 19.9727 13.9141C19.6605 13.8399 19.3349 13.7998 19 13.7998ZM6.5 13.9004C5.61634 13.9004 4.90039 14.6163 4.90039 15.5C4.90039 16.3837 5.61634 17.0996 6.5 17.0996C7.38366 17.0996 8.09961 16.3837 8.09961 15.5C8.09961 14.6163 7.38366 13.9004 6.5 13.9004ZM15.5 6.09961C16.8255 6.09961 17.9004 7.17452 17.9004 8.5C17.9004 9.82548 16.8255 10.9004 15.5 10.9004C14.1745 10.9004 13.0996 9.82548 13.0996 8.5C13.0996 7.17452 14.1745 6.09961 15.5 6.09961ZM15.5 7.90039C15.1686 7.90039 14.9004 8.16863 14.9004 8.5C14.9004 8.83137 15.1686 9.09961 15.5 9.09961C15.8314 9.09961 16.0996 8.83137 16.0996 8.5C16.0996 8.16863 15.8314 7.90039 15.5 7.90039ZM10.1992 4C8.35326 4.41375 6.74333 5.44923 5.59961 6.87598C6.02235 7.08306 6.49716 7.2002 7 7.2002C8.76731 7.2002 10.1992 5.76731 10.1992 4Z",fill:"currentColor"},null,-1)])])}const i4e=kt({name:"kimi-dark-mode",render:s4e}),r4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function l4e(e,t){return y(),M("svg",r4e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2.90002C12.4971 2.90002 12.9 3.30297 12.9 3.80002V12.2939L15.8081 9.38585C16.1595 9.03438 16.7294 9.03438 17.0808 9.38585C17.4323 9.73732 17.4323 10.3072 17.0808 10.6586L12.6364 15.1031C12.4676 15.2719 12.2387 15.3667 12 15.3667C11.7613 15.3667 11.5324 15.2719 11.3636 15.1031L6.91917 10.6586C6.5677 10.3072 6.5677 9.73732 6.91917 9.38585C7.27064 9.03438 7.84049 9.03438 8.19196 9.38585L11.1 12.2939V3.80002C11.1 3.30297 11.503 2.90002 12 2.90002ZM4.00001 13.5874C4.49706 13.5874 4.90001 13.9903 4.90001 14.4874V18.043C4.90001 18.2758 4.99249 18.499 5.1571 18.6636C5.32172 18.8282 5.54498 18.9207 5.77778 18.9207H18.2222C18.455 18.9207 18.6783 18.8283 18.8429 18.6636C19.0075 18.499 19.1 18.2758 19.1 18.043V14.4874C19.1 13.9903 19.5029 13.5874 20 13.5874C20.4971 13.5874 20.9 13.9903 20.9 14.4874V18.043C20.9 18.7531 20.6179 19.4342 20.1157 19.9364C19.6135 20.4386 18.9324 20.7207 18.2222 20.7207H5.77778C5.06759 20.7207 4.38649 20.4386 3.88431 19.9364C3.38213 19.4342 3.10001 18.7531 3.10001 18.043V14.4874C3.10001 13.9903 3.50295 13.5874 4.00001 13.5874Z",fill:"currentColor"},null,-1)])])}const a4e=kt({name:"kimi-download",render:l4e}),u4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function c4e(e,t){return y(),M("svg",u4e,[...t[0]||(t[0]=[C("path",{d:"M18.0179 3.09998C18.3963 3.10003 18.7709 3.17491 19.1205 3.31971C19.4701 3.46454 19.7884 3.67614 20.056 3.94373C20.3237 4.21144 20.5362 4.52965 20.681 4.87928C20.8258 5.22887 20.8997 5.60423 20.8997 5.9828C20.8997 6.36118 20.8257 6.73591 20.681 7.08533C20.5362 7.43497 20.3237 7.75317 20.056 8.02088L17.639 10.4379L9.15756 18.9183C8.5296 19.5463 7.74274 19.992 6.8812 20.2074L4.21811 20.8734C3.91148 20.95 3.5871 20.8596 3.36362 20.6361C3.14017 20.4126 3.05063 20.0883 3.12729 19.7816L3.79233 17.1185C4.00771 16.257 4.45344 15.4701 5.08139 14.8422L15.9798 3.94373C16.5203 3.40346 17.2536 3.09998 18.0179 3.09998ZM19.0003 19.1C19.4972 19.1002 19.8997 19.5034 19.8997 20.0004C19.8995 20.4971 19.4971 20.8996 19.0003 20.8998H12.0003C11.5034 20.8998 11.1001 20.4973 11.0999 20.0004C11.0999 19.5033 11.5033 19.1 12.0003 19.1H19.0003ZM18.0179 4.89979C17.7309 4.89979 17.4553 5.01417 17.2523 5.21717L6.35385 16.1146C5.95661 16.5119 5.67469 17.01 5.53842 17.5551L5.23666 18.7631L6.44467 18.4613C6.98971 18.3251 7.48782 18.0431 7.8851 17.6459L18.7826 6.74744C18.883 6.64702 18.9635 6.52821 19.0179 6.39686C19.0723 6.26558 19.0999 6.1247 19.0999 5.9828C19.0999 5.84075 19.0723 5.69916 19.0179 5.56776C18.9635 5.43645 18.883 5.31757 18.7826 5.21717C18.6821 5.11678 18.5631 5.03716 18.432 4.9828C18.3008 4.92845 18.16 4.89983 18.0179 4.89979Z",fill:"currentColor"},null,-1)])])}const d4e=kt({name:"kimi-edit",render:c4e}),f4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function p4e(e,t){return y(),M("svg",f4e,[...t[0]||(t[0]=[C("path",{d:"M5 11.0996C5.49693 11.0996 5.90018 11.5031 5.90039 12V18C5.90039 18.0552 5.94477 18.0996 6 18.0996H12C12.4969 18.0996 12.9002 18.5031 12.9004 19C12.9004 19.4971 12.4971 19.9004 12 19.9004H6C4.95066 19.9004 4.09961 19.0493 4.09961 18V12C4.09982 11.5031 4.50307 11.0996 5 11.0996ZM18 4.09961C19.0492 4.09961 19.9002 4.95084 19.9004 6V12C19.9004 12.4971 19.4971 12.9004 19 12.9004C18.5029 12.9004 18.0996 12.4971 18.0996 12V6C18.0994 5.94495 18.0551 5.90039 18 5.90039H12C11.5029 5.90039 11.0996 5.49706 11.0996 5C11.0998 4.50312 11.5031 4.09961 12 4.09961H18Z",fill:"currentColor"},null,-1)])])}const h4e=kt({name:"kimi-expand",render:p4e}),m4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function g4e(e,t){return y(),M("svg",m4e,[...t[0]||(t[0]=[C("g",null,[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.1723 2.1001C13.9413 2.10018 14.6793 2.40592 15.2231 2.94971L19.0512 6.77783C19.595 7.32162 19.9007 8.0596 19.9008 8.82861V18.0005C19.9008 20.1544 18.1543 21.9009 16.0004 21.9009H8.0004C5.84649 21.9009 4.10001 20.1544 4.10001 18.0005V6.00049C4.10001 3.84658 5.84649 2.1001 8.0004 2.1001H13.1723ZM8.0004 3.90088C6.8406 3.90088 5.90079 4.84069 5.90079 6.00049V18.0005C5.90079 19.1603 6.8406 20.1001 8.0004 20.1001H16.0004C17.1602 20.1001 18.1 19.1603 18.1 18.0005V9.90088H15.0004C13.3988 9.90088 12.1 8.60211 12.1 7.00049V3.90088H8.0004ZM13.9008 7.00049C13.9008 7.608 14.3929 8.1001 15.0004 8.1001H17.8217C17.8072 8.08375 17.7933 8.06681 17.7777 8.05127L13.9496 4.22314C13.9339 4.20745 13.9173 4.19286 13.9008 4.17822V7.00049Z",fill:"currentColor"})],-1)])])}const Gx=kt({name:"kimi-file",render:g4e}),v4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function y4e(e,t){return y(),M("svg",v4e,[...t[0]||(t[0]=[C("path",{d:"M15.4795 15.4971C15.9765 15.4971 16.3799 15.9004 16.3799 16.3975C16.3799 16.8945 15.9765 17.2978 15.4795 17.2979H8.52051C8.02345 17.2979 7.62012 16.8945 7.62012 16.3975C7.62012 15.9004 8.02345 15.4971 8.52051 15.4971H15.4795Z",fill:"currentColor"},null,-1),C("path",{d:"M12.3359 11.0996C12.8329 11.0997 13.2354 11.503 13.2354 12C13.2354 12.497 12.8329 12.9003 12.3359 12.9004H8.52051C8.02345 12.9004 7.62012 12.4971 7.62012 12C7.62012 11.5029 8.02345 11.0996 8.52051 11.0996H12.3359Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.1719 2.09961C13.9408 2.09969 14.6789 2.40555 15.2227 2.94922L19.0508 6.77734C19.5946 7.32113 19.9003 8.05911 19.9004 8.82812V18C19.9004 20.1539 18.1539 21.9004 16 21.9004H8C5.84626 21.9002 4.09961 20.1538 4.09961 18V6C4.09961 3.84621 5.84626 2.09981 8 2.09961H13.1719ZM8 3.90039C6.84037 3.90059 5.90039 4.84032 5.90039 6V18C5.90039 19.1597 6.84037 20.0994 8 20.0996H16C17.1598 20.0996 18.0996 19.1598 18.0996 18V9.90039H15C13.3985 9.90019 12.0996 8.6015 12.0996 7V3.90039H8ZM13.9004 7C13.9004 7.60739 14.3927 8.09941 15 8.09961H17.8213C17.8068 8.08333 17.7928 8.06626 17.7773 8.05078L13.9492 4.22266C13.9335 4.20696 13.9169 4.19237 13.9004 4.17773V7Z",fill:"currentColor"},null,-1)])])}const k4e=kt({name:"kimi-file-text",render:y4e}),b4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function C4e(e,t){return y(),M("svg",b4e,[...t[0]||(t[0]=[C("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const w4e=kt({name:"kimi-folder",render:C4e}),_4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function x4e(e,t){return y(),M("svg",_4e,[...t[0]||(t[0]=[C("g",null,[C("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"})],-1)])])}const S4e=kt({name:"kimi-folder-open",render:x4e}),A4e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function M4e(e,t){return y(),M("svg",A4e,[...t[0]||(t[0]=[C("path",{id:"af-p0",d:"M -2.619 -8.3 C -1.815 -8.3 -1.048 -7.97 -0.499 -7.39 C -0.499 -7.39 0.141 -6.712 0.141 -6.712 C 0.141 -6.712 5.75 -6.712 5.75 -6.712 C 7.904 -6.712 9.65 -4.986 9.65 -2.858 C 9.65 -2.858 9.65 -1.71 9.65 -1.71 C 9.65 -1.219 9.247 -0.821 8.75 -0.821 C 8.253 -0.821 7.85 -1.219 7.85 -1.71 C 7.85 -1.71 7.85 -2.858 7.85 -2.858 C 7.849 -4.004 6.91 -4.934 5.75 -4.934 C 5.75 -4.934 -0.207 -4.934 -0.207 -4.934 C -0.484 -4.934 -0.749 -5.047 -0.938 -5.247 C -0.938 -5.247 -1.815 -6.177 -1.815 -6.177 C -2.023 -6.397 -2.315 -6.521 -2.619 -6.521 C -2.619 -6.521 -6.25 -6.521 -6.25 -6.521 C -7.41 -6.521 -8.35 -5.592 -8.35 -4.446 C -8.35 -4.446 -8.35 4.446 -8.35 4.446 C -8.35 5.592 -7.41 6.521 -6.25 6.521 C -6.25 6.521 1.25 6.521 1.25 6.521 C 1.747 6.521 2.15 6.919 2.15 7.41 C 2.15 7.901 1.747 8.3 1.25 8.3 C 1.25 8.3 -6.25 8.3 -6.25 8.3 C -8.404 8.3 -10.15 6.574 -10.15 4.446 C -10.15 4.446 -10.15 -4.446 -10.15 -4.446 C -10.15 -6.574 -8.404 -8.3 -6.25 -8.3 C -6.25 -8.3 -2.619 -8.3 -2.619 -8.3 Z M 3.75 -2.5 C 4.247 -2.5 4.65 -2.097 4.65 -1.6 C 4.65 -1.103 4.247 -0.699 3.75 -0.699 C 3.75 -0.699 -4.25 -0.699 -4.25 -0.699 C -4.747 -0.699 -5.15 -1.103 -5.15 -1.6 C -5.15 -2.097 -4.747 -2.5 -4.25 -2.5 C -4.25 -2.5 3.75 -2.5 3.75 -2.5 Z",transform:"matrix(1 0 0 1 11.75 12)",fill:"currentColor"},null,-1),C("g",{id:"af-p1"},[C("path",{d:"M 2.635 0 L -2.635 0 M 0 -2.635 L 0 2.635",transform:"matrix(1 0 0 1 18.4 16.3)",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1)])])}const T4e=kt({name:"kimi-folder-plus",render:M4e}),E4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function I4e(e,t){return y(),M("svg",E4e,[...t[0]||(t[0]=[C("path",{d:"M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3ZM12 19.2002C15.9764 19.2002 19.2002 15.9764 19.2002 12C19.2002 8.02355 15.9764 4.7998 12 4.7998V19.2002Z",fill:"currentColor"},null,-1)])])}const L4e=kt({name:"kimi-follow-system",render:I4e}),$4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function N4e(e,t){return y(),M("svg",$4e,[...t[0]||(t[0]=[C("path",{d:"M17 2C19.2091 2 21 3.79086 21 6V15.7646C21 17.2361 20.192 18.5884 18.8965 19.2861L13.8965 21.9785C12.7126 22.616 11.2874 22.616 10.1035 21.9785L5.10352 19.2861C3.80802 18.5884 3 17.2361 3 15.7646V6C3 3.79086 4.79086 2 7 2H17ZM7 3.7998C5.78498 3.7998 4.79981 4.78497 4.7998 6V15.7646C4.7998 16.574 5.24443 17.3184 5.95703 17.7021L10.957 20.3936C11.6082 20.7442 12.3918 20.7442 13.043 20.3936L18.043 17.7021C18.7556 17.3184 19.2002 16.574 19.2002 15.7646V6C19.2002 4.78497 18.215 3.7998 17 3.7998H7ZM12 15.6992C12.4968 15.6992 12.8994 16.1028 12.8994 16.5996C12.8994 17.0964 12.4968 17.5 12 17.5C11.5024 17.5 11.0996 17.0964 11.0996 16.5996C11.0996 16.1028 11.5024 15.6992 12 15.6992ZM12 6.49902C12.4969 6.49922 12.8994 6.86908 12.8994 7.3252V13.6729C12.8994 14.129 12.4969 14.4988 12 14.499C11.5029 14.499 11.0996 14.1291 11.0996 13.6729V7.3252C11.0996 6.86896 11.5029 6.49902 12 6.49902Z",fill:"currentColor"},null,-1)])])}const F4e=kt({name:"kimi-full-access",render:N4e}),R4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function O4e(e,t){return y(),M("svg",R4e,[...t[0]||(t[0]=[C("path",{d:"M12.5092 2.11279C17.7402 2.37781 21.8998 6.70364 21.8998 12.0005C21.8996 17.4153 17.5524 21.8108 12.1576 21.895C12.1056 21.898 12.0532 21.8999 12.0004 21.8999C11.948 21.8999 11.8954 21.8968 11.8432 21.896L11.8422 21.895C6.44751 21.8107 2.10022 17.4152 2.10001 12.0005C2.10001 6.53287 6.53278 2.1001 12.0004 2.1001L12.5092 2.11279ZM8.92715 13.0005C9.02896 14.9787 9.42581 16.721 9.99356 17.9985C10.3249 18.7441 10.6971 19.292 11.0639 19.6411C11.4259 19.9855 11.741 20.1001 12.0004 20.1001C12.2598 20.1 12.5749 19.9856 12.9369 19.6411C13.3037 19.292 13.6749 18.7441 14.0063 17.9985C14.574 16.721 14.9718 14.9788 15.0736 13.0005H8.92715ZM3.96329 13.0005C4.31462 15.8522 6.14714 18.2427 8.66837 19.3823C8.55544 19.1733 8.44916 18.9552 8.34903 18.73C7.66574 17.1926 7.22657 15.1926 7.12344 13.0005H3.96329ZM16.8764 13.0005C16.7732 15.1926 16.3341 17.1926 15.6508 18.73C15.5506 18.9554 15.4435 19.1732 15.3305 19.3823C17.8522 18.2429 19.6851 15.8525 20.0365 13.0005H16.8764ZM8.66934 4.6167C6.08869 5.78266 4.22826 8.25964 3.93985 11.1997H7.11661C7.20176 8.92954 7.64512 6.85497 8.34903 5.271C8.4494 5.04516 8.5561 4.82619 8.66934 4.6167ZM12.0004 3.8999C11.7411 3.8999 11.4259 4.01454 11.0639 4.35889C10.6971 4.70797 10.3249 5.25587 9.99356 6.00146C9.40671 7.32188 9.00186 9.13885 8.91739 11.1997H15.0834C14.9989 9.13884 14.5931 7.32189 14.0063 6.00146C13.6749 5.2559 13.3037 4.70796 12.9369 4.35889C12.5749 4.0144 12.2598 3.90002 12.0004 3.8999ZM15.3295 4.61572C15.443 4.82559 15.5502 5.04471 15.6508 5.271C16.3547 6.85498 16.799 8.92949 16.8842 11.1997H20.06C19.7715 8.25914 17.9108 5.78143 15.3295 4.61572Z",fill:"currentColor"},null,-1)])])}const P4e=kt({name:"kimi-globe",render:O4e}),D4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function B4e(e,t){return y(),M("svg",D4e,[...t[0]||(t[0]=[C("path",{d:"M8 17C8.82834 17 9.5 17.6717 9.5 18.5C9.5 19.3283 8.82834 20 8 20C7.17166 20 6.5 19.3283 6.5 18.5C6.5 17.6717 7.17166 17 8 17ZM16 17C16.8283 17 17.5 17.6717 17.5 18.5C17.5 19.3283 16.8283 20 16 20C15.1717 20 14.5 19.3283 14.5 18.5C14.5 17.6717 15.1717 17 16 17ZM8 10.5C8.82834 10.5 9.5 11.1717 9.5 12C9.5 12.8283 8.82834 13.5 8 13.5C7.17166 13.5 6.5 12.8283 6.5 12C6.5 11.1717 7.17166 10.5 8 10.5ZM16 10.5C16.8283 10.5 17.5 11.1717 17.5 12C17.5 12.8283 16.8283 13.5 16 13.5C15.1717 13.5 14.5 12.8283 14.5 12C14.5 11.1717 15.1717 10.5 16 10.5ZM8 4C8.82834 4 9.5 4.67166 9.5 5.5C9.5 6.32834 8.82834 7 8 7C7.17166 7 6.5 6.32834 6.5 5.5C6.5 4.67166 7.17166 4 8 4ZM16 4C16.8283 4 17.5 4.67166 17.5 5.5C17.5 6.32834 16.8283 7 16 7C15.1717 7 14.5 6.32834 14.5 5.5C14.5 4.67166 15.1717 4 16 4Z",fill:"currentColor"},null,-1)])])}const H4e=kt({name:"kimi-grip",render:B4e}),z4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function W4e(e,t){return y(),M("svg",z4e,[...t[0]||(t[0]=[C("path",{d:"M7.22264 6.10352C7.22264 5.5078 7.48259 4.95449 7.91405 4.56055C8.34271 4.16918 8.90831 3.96198 9.48241 3.96191C9.64155 3.96191 9.80001 3.97936 9.95507 4.01074C10.0127 3.5042 10.2586 3.04178 10.6338 2.69922C11.0625 2.30778 11.6279 2.09961 12.2021 2.09961C12.7763 2.09966 13.3418 2.30783 13.7705 2.69922C13.9947 2.90401 14.1709 3.15244 14.29 3.42676C14.4947 3.37044 14.7071 3.34182 14.9209 3.3418C15.4951 3.3418 16.0605 3.549 16.4892 3.94043C16.8644 4.28293 17.1093 4.74548 17.167 5.25195C17.3223 5.22045 17.4812 5.20312 17.6406 5.20312C18.2147 5.20318 18.7803 5.41135 19.209 5.80273C19.6402 6.19663 19.9004 6.74922 19.9004 7.34473V14.6543C19.9004 17.413 19.2914 19.0434 18.0137 20.21C16.82 21.2998 15.2175 21.9004 13.5615 21.9004C11.7538 21.9004 10.2315 21.5696 8.95702 20.8535C7.67664 20.1341 6.71683 19.0652 5.97362 17.708L3.3496 12.916C3.18848 12.6213 3.10112 12.2914 3.0996 11.9531C3.09812 11.6147 3.18309 11.2835 3.34179 10.9873C3.5001 10.692 3.72639 10.4416 3.99706 10.251C4.26771 10.0604 4.57776 9.93235 4.90136 9.87305C5.56617 9.75102 6.25934 9.84517 6.86425 10.1445C6.9942 10.2088 7.11461 10.2788 7.22264 10.3477V6.10352ZM9.02343 12.7969C9.02336 13.1912 8.76624 13.5395 8.38964 13.6562C8.0129 13.773 7.60387 13.6309 7.38085 13.3057L6.53514 12.0723C6.51218 12.0529 6.48411 12.0282 6.45018 12.002C6.34595 11.9213 6.20986 11.8289 6.06639 11.7578C5.81525 11.6335 5.51637 11.5904 5.22655 11.6436H5.22557C5.15055 11.6573 5.08558 11.6865 5.03417 11.7227C4.98289 11.7588 4.94815 11.7998 4.92772 11.8379C4.90762 11.8755 4.90023 11.9122 4.90038 11.9453C4.90057 11.9782 4.9084 12.0144 4.9287 12.0518L7.55272 16.8438C8.16912 17.9693 8.90989 18.7622 9.83886 19.2842C10.7737 19.8094 11.9704 20.0996 13.5615 20.0996C14.7902 20.0996 15.9536 19.6533 16.7998 18.8809C17.5619 18.185 18.0996 17.1383 18.0996 14.6543V7.34473C18.0996 7.28204 18.0734 7.20342 17.9951 7.13184C17.9139 7.05771 17.7875 7.00396 17.6406 7.00391C17.4937 7.00391 17.3674 7.05771 17.2861 7.13184C17.2077 7.20347 17.1807 7.28199 17.1807 7.34473V11.0693C17.1805 11.5661 16.778 11.9685 16.2812 11.9688C15.7843 11.9688 15.381 11.5662 15.3808 11.0693V5.48242C15.3808 5.41973 15.3537 5.34107 15.2754 5.26953C15.1941 5.19547 15.0677 5.1416 14.9209 5.1416C14.774 5.14166 14.6476 5.19541 14.5664 5.26953C14.4881 5.34105 14.462 5.41974 14.4619 5.48242V11.0693C14.4617 11.5662 14.0584 11.9688 13.5615 11.9688C13.0646 11.9687 12.6613 11.5662 12.6611 11.0693V4.24121C12.6611 4.17852 12.635 4.09989 12.5566 4.02832C12.4754 3.95419 12.349 3.90045 12.2021 3.90039C12.0552 3.90039 11.9289 3.95421 11.8476 4.02832C11.7692 4.09992 11.7422 4.17849 11.7422 4.24121V11.0693C11.742 11.5661 11.3395 11.9685 10.8428 11.9688C10.3458 11.9688 9.94257 11.5662 9.94237 11.0693V6.10352L9.93651 6.05371C9.92534 6.00177 9.89573 5.94433 9.8369 5.89062C9.75567 5.81647 9.62938 5.76172 9.48241 5.76172C9.33554 5.76179 9.2091 5.81651 9.12792 5.89062C9.04964 5.96222 9.02343 6.04084 9.02343 6.10352V12.7969Z",fill:"currentColor"},null,-1)])])}const U4e=kt({name:"kimi-hand",render:W4e}),j4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function V4e(e,t){return y(),M("svg",j4e,[...t[0]||(t[0]=[C("path",{d:"M4 3.33203C4.55224 3.33203 4.99993 3.7798 5 4.33203V18.0908H20.0674C20.6195 18.0908 21.0671 18.5388 21.0674 19.0908C21.0674 19.6431 20.6197 20.0908 20.0674 20.0908H5C3.89543 20.0908 3 19.1954 3 18.0908V4.33203C3.00007 3.7798 3.44776 3.33203 4 3.33203ZM8.19922 9.28418C8.7515 9.28418 9.19922 9.73189 9.19922 10.2842V15.6045C9.19908 16.1567 8.75142 16.6045 8.19922 16.6045C7.64719 16.6043 7.19936 16.1565 7.19922 15.6045V10.2842C7.19922 9.73202 7.6471 9.28438 8.19922 9.28418ZM17.2227 6.85645C17.7748 6.85658 18.2226 7.3043 18.2227 7.85645V15.6045C18.2225 16.1566 17.7747 16.6044 17.2227 16.6045C16.6705 16.6045 16.2228 16.1566 16.2227 15.6045V7.85645C16.2227 7.30422 16.6704 6.85645 17.2227 6.85645ZM12.7109 3.96387C13.2631 3.96387 13.7107 4.41175 13.7109 4.96387V15.6035C13.7109 16.1558 13.2632 16.6035 12.7109 16.6035C12.1587 16.6035 11.7109 16.1558 11.7109 15.6035V4.96387C11.7111 4.41175 12.1588 3.96387 12.7109 3.96387Z",fill:"currentColor"},null,-1)])])}const q4e=kt({name:"kimi-histogram",render:V4e}),K4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Z4e(e,t){return y(),M("svg",K4e,[...t[0]||(t[0]=[C("path",{d:"M8.00916 7.50488C8.47326 7.50488 8.91828 7.68943 9.24646 8.01758C9.57465 8.34577 9.75916 8.79075 9.75916 9.25488C9.75916 9.71901 9.57465 10.164 9.24646 10.4922C8.91828 10.8203 8.47326 11.0049 8.00916 11.0049C7.54507 11.0049 7.10001 10.8203 6.77185 10.4922C6.4437 10.164 6.25916 9.71898 6.25916 9.25488C6.25916 8.79078 6.4437 8.34576 6.77185 8.01758C7.10001 7.68942 7.54507 7.50492 8.00916 7.50488Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.8998 4.09961C20.0537 4.09961 21.8002 5.84609 21.8002 8V16C21.8002 18.1539 20.0537 19.9004 17.8998 19.9004H5.89978C3.74598 19.9003 1.99939 18.1538 1.99939 16V8C1.99939 5.84617 3.74598 4.09974 5.89978 4.09961H17.8998ZM15.4867 12.2539C15.448 12.2184 15.3885 12.2192 15.351 12.2559L11.7338 15.8027C11.0146 16.5079 9.87305 16.5222 9.13708 15.835L6.98669 13.8262C6.95049 13.7924 6.89516 13.791 6.85681 13.8223L3.82361 16.2988C3.96873 17.3168 4.84165 18.0995 5.89978 18.0996H17.8998C18.9375 18.0996 19.7964 17.3466 19.9662 16.3574L15.4867 12.2539ZM5.89978 5.90039C4.74009 5.90052 3.80017 6.84028 3.80017 8V14.002L5.73181 12.4238C6.46046 11.8286 7.51253 11.8634 8.20056 12.5059L10.351 14.5146C10.3897 14.5508 10.4498 14.5497 10.4877 14.5127L14.1049 10.9658C14.819 10.2656 15.9506 10.2466 16.6879 10.9219L19.9994 13.9551V8C19.9994 6.8402 19.0596 5.90039 17.8998 5.90039H5.89978Z",fill:"currentColor"},null,-1)])])}const G4e=kt({name:"kimi-image",render:Z4e}),Y4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function X4e(e,t){return y(),M("svg",Y4e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.09375 2.81174C5.4825 2.50796 6.04376 2.56488 6.34766 2.93869L20.1855 19.9602C20.4895 20.3341 20.421 20.8836 20.0322 21.1877C19.6435 21.4917 19.0823 21.4355 18.7783 21.0617L17.9971 20.1008H5.99609C3.84224 20.1008 2.0958 18.3552 2.0957 16.2014V8.13889C2.09589 6.26755 3.41429 4.70428 5.17285 4.32639L4.93945 4.03928C4.63577 3.66536 4.7051 3.11573 5.09375 2.81174ZM7.13184 14.1096C7.09416 14.0738 7.03659 14.0713 6.99609 14.1037L3.92871 16.5569C4.09761 17.5472 4.95753 18.301 5.99609 18.301H16.5342L13.373 14.4133L11.9072 15.9455C11.1531 16.7324 9.92202 16.7621 9.13281 16.0119L7.13184 14.1096ZM5.99609 6.03928C4.83643 6.03928 3.89669 6.97927 3.89648 8.13889V14.1408L5.83496 12.5901C6.60469 11.9742 7.69929 12.022 8.41504 12.7024L10.416 14.6037C10.4575 14.6431 10.5218 14.642 10.5615 14.6008L12.1641 12.926L9.78906 10.0051C9.70282 10.2646 9.55682 10.5038 9.35645 10.7004C9.02202 11.0285 8.56767 11.2131 8.09473 11.2131C7.62195 11.213 7.1683 11.0284 6.83398 10.7004C6.49961 10.3724 6.31152 9.92701 6.31152 9.46311C6.3116 8.99941 6.49981 8.55474 6.83398 8.22678C7.12986 7.93654 7.51931 7.75901 7.93262 7.7219L6.56543 6.03928H5.99609Z",fill:"currentColor"},null,-1),C("path",{d:"M18.0049 4.31272C20.1587 4.31288 21.9043 6.0593 21.9043 8.21311V13.718C21.9039 15.4743 19.7248 16.2906 18.5713 14.966L14.9141 10.7658C14.5882 10.3912 14.6278 9.82271 15.002 9.49631C15.3768 9.16994 15.9451 9.20948 16.2715 9.5842L19.9287 13.7844C19.9528 13.812 19.9696 13.8167 19.9775 13.8186C19.9908 13.8216 20.0141 13.8213 20.04 13.8117C20.0655 13.8021 20.0826 13.7875 20.0908 13.7766C20.0955 13.7702 20.1044 13.7552 20.1045 13.718V8.21311C20.1045 7.05341 19.1645 6.11366 18.0049 6.1135H10.6328C10.1361 6.11327 9.73267 5.70981 9.73242 5.21311C9.73242 4.71619 10.136 4.31295 10.6328 4.31272H18.0049Z",fill:"currentColor"},null,-1)])])}const J4e=kt({name:"kimi-image-failed",render:X4e}),Q4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function e3e(e,t){return y(),M("svg",Q4e,[...t[0]||(t[0]=[C("path",{d:"M12 2.1001C17.4676 2.10031 21.8994 6.53286 21.8994 12.0005C21.8992 17.4679 17.4674 21.8997 12 21.8999C6.53237 21.8999 2.09982 17.4681 2.09961 12.0005C2.09961 6.53273 6.53224 2.1001 12 2.1001ZM12 3.8999C7.52636 3.8999 3.89941 7.52684 3.89941 12.0005C3.89963 16.474 7.52649 20.1001 12 20.1001C16.4733 20.0999 20.0994 16.4738 20.0996 12.0005C20.0996 7.52697 16.4735 3.90011 12 3.8999ZM12 9.50049C12.4969 9.50068 12.8994 9.87055 12.8994 10.3267V16.6743C12.8992 17.1303 12.4968 17.5003 12 17.5005C11.503 17.5005 11.0998 17.1304 11.0996 16.6743V10.3267C11.0996 9.87043 11.5029 9.50049 12 9.50049ZM12 6.49951C12.4968 6.49951 12.8994 6.90313 12.8994 7.3999C12.8992 7.8965 12.4966 8.30029 12 8.30029C11.5025 8.30028 11.0998 7.8965 11.0996 7.3999C11.0996 6.90313 11.5024 6.49952 12 6.49951Z",fill:"currentColor"},null,-1)])])}const t3e=kt({name:"kimi-info",render:e3e}),n3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function o3e(e,t){return y(),M("svg",n3e,[...t[0]||(t[0]=[iu('<path fill-rule="evenodd" clip-rule="evenodd" d="M12 2.09998C6.53222 2.09998 2.09998 6.53222 2.09998 12C2.09998 17.4677 6.53222 21.9 12 21.9C17.4677 21.9 21.9 17.4677 21.9 12C21.9 6.53222 17.4677 2.09998 12 2.09998ZM3.89998 12C3.89998 7.52633 7.52633 3.89998 12 3.89998C16.4736 3.89998 20.1 7.52633 20.1 12C20.1 16.4736 16.4736 20.1 12 20.1C7.52633 20.1 3.89998 16.4736 3.89998 12Z" fill="currentColor"></path><path d="M9.4286 9.47153C9.4286 8.97448 9.83154 8.57153 10.3286 8.57153H11.1C11.5971 8.57153 12 8.97448 12 9.47153C12 9.96859 11.5971 10.3715 11.1 10.3715H10.3286C9.83154 10.3715 9.4286 9.96859 9.4286 9.47153Z" fill="currentColor"></path><path d="M5.14289 9.47155C5.14289 8.97449 5.54583 8.57155 6.04289 8.57155H7.67146C8.16851 8.57155 8.57146 8.97449 8.57146 9.47155C8.57146 9.9686 8.16851 10.3715 7.67146 10.3715H6.04289C5.54583 10.3715 5.14289 9.9686 5.14289 9.47155Z" fill="currentColor"></path><path d="M8.57146 16.3287C8.57146 15.8316 8.9744 15.4287 9.47145 15.4287H14.5286C15.0257 15.4287 15.4286 15.8316 15.4286 16.3287C15.4286 16.8257 15.0257 17.2287 14.5286 17.2287H9.47145C8.9744 17.2287 8.57146 16.8257 8.57146 16.3287Z" fill="currentColor"></path><path d="M6.04288 12.0001C5.54583 12.0001 5.14288 12.403 5.14288 12.9001C5.14288 13.3972 5.54583 13.8001 6.04288 13.8001H6.81431C7.31137 13.8001 7.71431 13.3972 7.71431 12.9001C7.71431 12.403 7.31137 12.0001 6.81431 12.0001H6.04288Z" fill="currentColor"></path><path d="M9.47145 12.0001C8.9744 12.0001 8.57146 12.403 8.57146 12.9001C8.57146 13.3972 8.9744 13.8001 9.47146 13.8001H10.2429C10.7399 13.8001 11.1429 13.3972 11.1429 12.9001C11.1429 12.403 10.7399 12.0001 10.2429 12.0001H9.47145Z" fill="currentColor"></path><path d="M12.8572 9.47153C12.8572 8.97448 13.2601 8.57153 13.7572 8.57153H14.5286C15.0257 8.57153 15.4286 8.97448 15.4286 9.47153C15.4286 9.96859 15.0257 10.3715 14.5286 10.3715H13.7572C13.2601 10.3715 12.8572 9.96859 12.8572 9.47153Z" fill="currentColor"></path><path d="M12.9 12.0001C12.403 12.0001 12 12.403 12 12.9001C12 13.3972 12.403 13.8001 12.9 13.8001H13.6715C14.1685 13.8001 14.5715 13.3972 14.5715 12.9001C14.5715 12.403 14.1685 12.0001 13.6715 12.0001H12.9Z" fill="currentColor"></path><path d="M16.2857 9.47153C16.2857 8.97448 16.6887 8.57153 17.1857 8.57153H17.9572C18.4542 8.57153 18.8572 8.97448 18.8572 9.47153C18.8572 9.96859 18.4542 10.3715 17.9572 10.3715H17.1857C16.6887 10.3715 16.2857 9.96859 16.2857 9.47153Z" fill="currentColor"></path><path d="M16.3286 12.0001C15.8315 12.0001 15.4286 12.403 15.4286 12.9001C15.4286 13.3972 15.8315 13.8001 16.3286 13.8001H17.9572C18.4542 13.8001 18.8572 13.3972 18.8572 12.9001C18.8572 12.403 18.4542 12.0001 17.9572 12.0001H16.3286Z" fill="currentColor"></path>',10)])])}const s3e=kt({name:"kimi-keyboard",render:o3e}),i3e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function r3e(e,t){return y(),M("svg",i3e,[...t[0]||(t[0]=[C("path",{id:"bar-divider",d:"M 9.3 18.951 L 9.3 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),C("path",{id:"bar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),C("path",{id:"bar-arrow",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const l3e=kt({name:"kimi-left-panel",render:r3e}),a3e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function u3e(e,t){return y(),M("svg",a3e,[...t[0]||(t[0]=[C("path",{id:"bar-divider",d:"M 9.3 18.951 L 9.3 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),C("path",{id:"bar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),C("path",{id:"bar-arrow-expand",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const c3e=kt({name:"kimi-left-panel-expand",render:u3e}),d3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function f3e(e,t){return y(),M("svg",d3e,[...t[0]||(t[0]=[iu('<g><path d="M12.9 1.7999C12.9 1.30285 12.4971 0.899902 12 0.899902C11.5029 0.899902 11.1 1.30285 11.1 1.7999V2.7999C11.1 3.29696 11.5029 3.6999 12 3.6999C12.4971 3.6999 12.9 3.29696 12.9 2.7999V1.7999Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M6.1 11.9999C6.1 8.7414 8.74152 6.09988 12 6.09988C15.2585 6.09988 17.9 8.7414 17.9 11.9999C17.9 15.2584 15.2585 17.8999 12 17.8999C8.74152 17.8999 6.1 15.2584 6.1 11.9999ZM12 7.89988C9.73563 7.89988 7.9 9.73551 7.9 11.9999C7.9 14.2642 9.73563 16.0999 12 16.0999C14.2644 16.0999 16.1 14.2642 16.1 11.9999C16.1 9.73551 14.2644 7.89988 12 7.89988Z" fill="currentColor"></path><path d="M0.899994 11.9999C0.899994 11.5028 1.30294 11.0999 1.79999 11.0999H2.79999C3.29705 11.0999 3.69999 11.5028 3.69999 11.9999C3.69999 12.4969 3.29705 12.8999 2.79999 12.8999H1.79999C1.30294 12.8999 0.899994 12.4969 0.899994 11.9999Z" fill="currentColor"></path><path d="M12 20.2991C12.4971 20.2991 12.9 20.702 12.9 21.1991V22.1991C12.9 22.6961 12.4971 23.0991 12 23.0991C11.5029 23.0991 11.1 22.6961 11.1 22.1991V21.1991C11.1 20.702 11.5029 20.2991 12 20.2991Z" fill="currentColor"></path><path d="M21.2016 11.0999C20.7045 11.0999 20.3016 11.5028 20.3016 11.9999C20.3016 12.4969 20.7045 12.8999 21.2016 12.8999H22.2016C22.6986 12.8999 23.1016 12.4969 23.1016 11.9999C23.1016 11.5028 22.6986 11.0999 22.2016 11.0999H21.2016Z" fill="currentColor"></path><path d="M20.1995 3.79903C20.551 4.1505 20.551 4.72035 20.1995 5.07182L19.4924 5.77893C19.141 6.1304 18.5711 6.1304 18.2196 5.77893C17.8682 5.42746 17.8682 4.85761 18.2196 4.50614L18.9268 3.79903C19.2782 3.44756 19.8481 3.44756 20.1995 3.79903Z" fill="currentColor"></path><path d="M19.4942 18.2215C19.1427 17.87 18.5729 17.87 18.2214 18.2215C17.87 18.573 17.87 19.1428 18.2214 19.4943L18.9285 20.2014C19.28 20.5529 19.8498 20.5529 20.2013 20.2014C20.5528 19.8499 20.5528 19.2801 20.2013 18.9286L19.4942 18.2215Z" fill="currentColor"></path><path d="M5.78079 18.2213C6.13227 18.5727 6.13227 19.1426 5.78079 19.4941L5.07369 20.2012C4.72222 20.5526 4.15237 20.5526 3.8009 20.2012C3.44942 19.8497 3.44942 19.2798 3.8009 18.9284L4.508 18.2213C4.85947 17.8698 5.42932 17.8698 5.78079 18.2213Z" fill="currentColor"></path><path d="M5.07077 3.79912C4.7193 3.44764 4.14945 3.44764 3.79798 3.79912C3.4465 4.15059 3.4465 4.72044 3.79798 5.07191L4.50508 5.77901C4.85655 6.13049 5.4264 6.13049 5.77787 5.77902C6.12935 5.42754 6.12935 4.85769 5.77787 4.50622L5.07077 3.79912Z" fill="currentColor"></path></g>',1)])])}const p3e=kt({name:"kimi-light-mode",render:f3e}),h3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function m3e(e,t){return y(),M("svg",h3e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.97427 8.06961C4.99348 7.33581 6.18946 7.1 7.00001 7.1H9.00001C9.49706 7.1 9.90001 7.50294 9.90001 8C9.90001 8.49706 9.49706 8.9 9.00001 8.9H7.00001C6.47755 8.9 5.67353 9.06419 5.02599 9.53039C4.42434 9.96356 3.90001 10.6934 3.90001 12C3.90001 13.3066 4.42434 14.0364 5.02599 14.4696C5.67353 14.9358 6.47755 15.1 7.00001 15.1H9.00001C9.49706 15.1 9.90001 15.5029 9.90001 16C9.90001 16.4971 9.49706 16.9 9.00001 16.9H7.00001C6.18946 16.9 4.99348 16.6642 3.97427 15.9304C2.90917 15.1636 2.10001 13.8934 2.10001 12C2.10001 10.1066 2.90917 8.83644 3.97427 8.06961ZM14.1 8C14.1 7.50294 14.5029 7.1 15 7.1H17C17.8105 7.1 19.0065 7.33581 20.0257 8.06961C21.0908 8.83644 21.9 10.1066 21.9 12C21.9 13.8934 21.0908 15.1636 20.0257 15.9304C19.0065 16.6642 17.8105 16.9 17 16.9H15C14.5029 16.9 14.1 16.4971 14.1 16C14.1 15.5029 14.5029 15.1 15 15.1H17C17.5225 15.1 18.3265 14.9358 18.974 14.4696C19.5757 14.0364 20.1 13.3066 20.1 12C20.1 10.6934 19.5757 9.96356 18.974 9.53039C18.3265 9.06419 17.5225 8.9 17 8.9H15C14.5029 8.9 14.1 8.49706 14.1 8ZM7.10001 12C7.10001 11.5029 7.50295 11.1 8.00001 11.1H16C16.4971 11.1 16.9 11.5029 16.9 12C16.9 12.4971 16.4971 12.9 16 12.9H8.00001C7.50295 12.9 7.10001 12.4971 7.10001 12Z",fill:"currentColor"},null,-1)])])}const g3e=kt({name:"kimi-link",render:m3e}),v3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function y3e(e,t){return y(),M("svg",v3e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.10001 5.99998C4.10001 5.50292 4.50295 5.09998 5.00001 5.09998H19C19.4971 5.09998 19.9 5.50292 19.9 5.99998C19.9 6.49703 19.4971 6.89998 19 6.89998H5.00001C4.50295 6.89998 4.10001 6.49703 4.10001 5.99998ZM4.10001 12C4.10001 11.5029 4.50295 11.1 5.00001 11.1H19C19.4971 11.1 19.9 11.5029 19.9 12C19.9 12.497 19.4971 12.9 19 12.9H5.00001C4.50295 12.9 4.10001 12.497 4.10001 12ZM4.10001 18C4.10001 17.5029 4.50295 17.1 5.00001 17.1H19C19.4971 17.1 19.9 17.5029 19.9 18C19.9 18.497 19.4971 18.9 19 18.9H5.00001C4.50295 18.9 4.10001 18.497 4.10001 18Z",fill:"currentColor"},null,-1)])])}const k3e=kt({name:"kimi-list",render:y3e}),b3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function C3e(e,t){return y(),M("svg",b3e,[...t[0]||(t[0]=[C("g",null,[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18 4.09961C20.1539 4.09961 21.9004 5.84609 21.9004 8V16C21.9004 18.1539 20.1539 19.9004 18 19.9004H6C3.84609 19.9004 2.09961 18.1539 2.09961 16V8C2.09961 5.84609 3.84609 4.09961 6 4.09961H18ZM3.90039 16C3.90039 17.1598 4.8402 18.0996 6 18.0996H18C19.1598 18.0996 20.0996 17.1598 20.0996 16V9.49805L13.5361 13.5361C12.5955 14.1147 11.4075 14.1084 10.4727 13.5205L3.90039 9.38672V16ZM6 5.90039C5.0746 5.90039 4.29039 6.49909 4.01074 7.33008L11.4316 11.9971C11.7861 12.2199 12.2361 12.2222 12.5928 12.0029L20.0195 7.43457C19.7725 6.54993 18.9636 5.90039 18 5.90039H6Z",fill:"currentColor"})],-1)])])}const w3e=kt({name:"kimi-mail",render:C3e}),_3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function x3e(e,t){return y(),M("svg",_3e,[...t[0]||(t[0]=[C("path",{d:"M17 11.0996C17.4971 11.0996 17.9004 11.5029 17.9004 12C17.9004 12.4971 17.4971 12.9004 17 12.9004H7C6.50294 12.9004 6.09961 12.4971 6.09961 12C6.09961 11.5029 6.50294 11.0996 7 11.0996H17Z",fill:"currentColor"},null,-1)])])}const S3e=kt({name:"kimi-minus",render:x3e}),A3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function M3e(e,t){return y(),M("svg",A3e,[...t[0]||(t[0]=[C("path",{d:"M15.182 3.32802C15.9304 2.72235 17.0309 2.76978 17.724 3.46767L18.5424 4.29189L18.6722 4.43642C19.2377 5.13495 19.234 6.1404 18.6635 6.83486L18.5326 6.97841L18.0248 7.48232C17.9549 7.55172 17.8793 7.61254 17.8021 7.66884C17.9794 8.18027 17.9316 8.7498 17.6595 9.22841C17.6847 9.24522 17.7091 9.2635 17.7328 9.2831L17.8002 9.3456L17.9847 9.53798C19.8515 11.5442 20.4549 14.0022 19.6224 16.2196C19.1921 17.3657 18.4025 18.3827 17.2992 19.203H19.0873L19.1801 19.2079C19.6337 19.2542 19.9877 19.6375 19.9877 20.1034C19.9876 20.5692 19.6337 20.9527 19.1801 20.9989L19.0873 21.0028H13.0385C13.0244 21.0033 13.0104 21.0031 12.9965 21.0028H4.9115C4.41448 21.0028 4.01117 20.6004 4.01111 20.1034C4.01111 19.6064 4.41444 19.203 4.9115 19.203H12.9047C15.7614 18.5471 17.3679 17.1023 17.9369 15.5868C18.4678 14.1726 18.179 12.4782 16.807 10.9188L16.5189 10.6093L16.4574 10.5399C16.4549 10.5368 16.453 10.5333 16.4506 10.5302L12.3011 14.6522C11.6031 15.3454 10.5023 15.3845 9.75818 14.7733L9.61365 14.6425L7.31091 12.3231C6.5717 11.5786 6.57617 10.376 7.32068 9.63662L12.3676 4.62392L12.5121 4.49404C13.0358 4.06988 13.7318 3.96755 14.3402 4.18251C14.3969 4.10597 14.4591 4.03197 14.5287 3.96279L15.0365 3.45791L15.182 3.32802ZM4.83044 12.9335C5.16112 12.6052 5.68305 12.5863 6.03552 12.8759L6.10291 12.9384L9.07361 15.9286L9.13513 15.997C9.42218 16.3514 9.3992 16.8727 9.06873 17.2011C8.7381 17.5294 8.21712 17.5482 7.86462 17.2587L7.79626 17.1972L4.82654 14.2069L4.76501 14.1376C4.47792 13.7831 4.49979 13.2619 4.83044 12.9335ZM13.6693 5.87978L13.6361 5.90126L8.58826 10.914C8.54935 10.9529 8.54943 11.0165 8.58826 11.0556L10.891 13.3739L10.9242 13.3964C10.9602 13.4111 11.0032 13.404 11.0326 13.3749L16.0795 8.3622L16.1019 8.329C16.1117 8.3049 16.1117 8.2779 16.1019 8.2538L16.0804 8.2206L13.7777 5.90224C13.7486 5.87289 13.7054 5.86535 13.6693 5.87978ZM16.3383 4.71376L16.3051 4.73525L15.7972 5.24013C15.7584 5.27904 15.7585 5.34166 15.7972 5.38076L16.6146 6.20498L16.6478 6.22744C16.6838 6.24221 16.7268 6.23487 16.7562 6.20595L17.264 5.70107L17.2865 5.66787C17.2962 5.64382 17.2963 5.61672 17.2865 5.59267L17.265 5.55947L16.4467 4.73623C16.4174 4.70681 16.3744 4.6992 16.3383 4.71376Z",fill:"currentColor"},null,-1)])])}const T3e=kt({name:"kimi-microscope",render:M3e}),E3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function I3e(e,t){return y(),M("svg",E3e,[...t[0]||(t[0]=[C("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),C("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),C("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const L3e=kt({name:"kimi-more",render:I3e}),$3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function N3e(e,t){return y(),M("svg",$3e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 12.0993C8.49691 12.0993 8.90016 12.5028 8.90039 12.9997V17.9997C8.90039 19.6013 7.60163 20.9001 6 20.9001C4.39837 20.9001 3.09961 19.6013 3.09961 17.9997C3.09984 16.3982 4.39852 15.0993 6 15.0993C6.38939 15.0993 6.76033 15.1778 7.09961 15.317V12.9997C7.09984 12.5028 7.50309 12.0993 8 12.0993ZM6 16.9001C5.39263 16.9001 4.90062 17.3923 4.90039 17.9997C4.90039 18.6072 5.39249 19.0993 6 19.0993C6.60751 19.0993 7.09961 18.6072 7.09961 17.9997C7.09938 17.3923 6.60737 16.9001 6 16.9001Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.627 3.35611C19.8025 3.12106 20.9001 4.02068 20.9004 5.21939V15.9997C20.9004 17.6013 19.6016 18.9001 18 18.9001C16.3984 18.9001 15.0996 17.6013 15.0996 15.9997C15.0998 14.3982 16.3985 13.0993 18 13.0993C18.3894 13.0993 18.7603 13.1778 19.0996 13.317V9.21939C19.0993 9.15657 19.0421 9.10946 18.9805 9.12173L12.6768 10.3825C12.1894 10.4799 11.7148 10.1637 11.6172 9.67642C11.52 9.18922 11.8361 8.71439 12.3232 8.61685L18.627 7.35611C18.7868 7.32415 18.9452 7.31502 19.0996 7.32291V5.21939C19.0993 5.15657 19.0421 5.10946 18.9805 5.12173L12.6768 6.38248C12.1894 6.47994 11.7148 6.16372 11.6172 5.67642C11.52 5.18922 11.8361 4.71439 12.3232 4.61685L18.627 3.35611ZM18 14.9001C17.3926 14.9001 16.9006 15.3923 16.9004 15.9997C16.9004 16.6072 17.3925 17.0993 18 17.0993C18.6075 17.0993 19.0996 16.6072 19.0996 15.9997C19.0994 15.3923 18.6074 14.9001 18 14.9001Z",fill:"currentColor"},null,-1),C("path",{d:"M7.32422 5.38931C7.61669 4.87032 8.38346 4.87015 8.67578 5.38931L8.73047 5.50845L8.89551 5.95376L8.97949 6.1481C9.19937 6.58817 9.57968 6.93145 10.0459 7.10415L10.4912 7.26919C11.127 7.50461 11.1666 8.36217 10.6104 8.67544L10.4912 8.73013L10.0459 8.89517C9.5799 9.06783 9.19939 9.41141 8.97949 9.85123L8.89551 10.0456L8.73047 10.4909C8.49495 11.1267 7.63737 11.1665 7.32422 10.61L7.26953 10.4909L7.10449 10.0456C6.93172 9.57931 6.58767 9.19898 6.14746 8.97916L5.9541 8.89517L5.50879 8.73013C4.83054 8.47903 4.83061 7.52037 5.50879 7.26919L5.9541 7.10415L6.14746 7.02017C6.58757 6.80032 6.93176 6.41995 7.10449 5.95376L7.26953 5.50845L7.32422 5.38931Z",fill:"currentColor"},null,-1)])])}const F3e=kt({name:"kimi-music",render:N3e}),R3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function O3e(e,t){return y(),M("svg",R3e,[...t[0]||(t[0]=[C("path",{d:"M17.9551 6.32648C17.955 5.82951 17.5517 5.42706 17.0547 5.42706H15.4844C14.9875 5.42717 14.5851 5.82958 14.585 6.32648V17.6732C14.585 18.1701 14.9874 18.5734 15.4844 18.5735H17.0547C17.5518 18.5735 17.9551 18.1702 17.9551 17.6732V6.32648ZM19.7549 17.6732C19.7549 19.1643 18.5459 20.3734 17.0547 20.3734H15.4844C13.9933 20.3732 12.7842 19.1643 12.7842 17.6732V6.32648C12.7843 4.83546 13.9934 3.62639 15.4844 3.62628H17.0547C18.5458 3.62628 19.7548 4.8354 19.7549 6.32648V17.6732Z",fill:"currentColor"},null,-1),C("path",{d:"M9.41571 6.32648C9.41561 5.82951 9.01231 5.42706 8.51532 5.42706H6.94501C6.44811 5.42717 6.0457 5.82958 6.04559 6.32648V17.6732C6.04559 18.1701 6.44804 18.5734 6.94501 18.5735H8.51532C9.01238 18.5735 9.41571 18.1702 9.41571 17.6732V6.32648ZM11.2155 17.6732C11.2155 19.1643 10.0065 20.3734 8.51532 20.3734H6.94501C5.45393 20.3732 4.24481 19.1643 4.24481 17.6732V6.32648C4.24492 4.83546 5.45399 3.62639 6.94501 3.62628H8.51532C10.0064 3.62628 11.2154 4.8354 11.2155 6.32648V17.6732Z",fill:"currentColor"},null,-1)])])}const P3e=kt({name:"kimi-pause",render:O3e}),D3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function B3e(e,t){return y(),M("svg",D3e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.0176 4.89998C17.7305 4.89998 17.4552 5.014 17.2522 5.217L6.35429 16.1149C5.957 16.5122 5.67517 17.01 5.53889 17.5551L5.23691 18.763L6.44486 18.4611C6.98994 18.3248 7.48773 18.0429 7.88502 17.6456L18.783 6.74773C18.8834 6.64728 18.9631 6.52797 19.0176 6.39658C19.072 6.26517 19.1 6.12441 19.1 5.98236C19.1 5.84031 19.072 5.69956 19.0176 5.56815C18.9631 5.43676 18.8834 5.31745 18.783 5.217C18.6825 5.11649 18.5631 5.03676 18.4318 4.98237C18.3005 4.92798 18.1597 4.89998 18.0176 4.89998ZM15.9794 3.94421C16.52 3.40366 17.2531 3.09998 18.0176 3.09998C18.3961 3.09998 18.7709 3.17452 19.1207 3.31938C19.4704 3.46424 19.7881 3.67656 20.0558 3.94421C20.3235 4.21192 20.5357 4.52969 20.6805 4.87932C20.8254 5.22895 20.9 5.60375 20.9 5.98236C20.9 6.36098 20.8254 6.73578 20.6805 7.08541C20.5357 7.43504 20.3235 7.75281 20.0558 8.02052L17.6385 10.4378L9.15781 18.9184C8.52984 19.5464 7.74301 19.9919 6.88142 20.2073L4.21828 20.8731C3.91158 20.9498 3.58714 20.8599 3.3636 20.6364C3.14006 20.4128 3.05019 20.0884 3.12686 19.7817L3.79264 17.1185C4.00803 16.257 4.45351 15.4701 5.0815 14.8421L15.9794 3.94421Z",fill:"currentColor"},null,-1)])])}const H3e=kt({name:"kimi-pencil",render:B3e}),z3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function W3e(e,t){return y(),M("svg",z3e,[...t[0]||(t[0]=[C("path",{d:"M7.76251 3.10547C8.25776 3.10552 8.74422 3.23849 9.17072 3.49023L19.533 9.60742C20.8536 10.3869 21.2922 12.0901 20.5174 13.4121C20.2785 13.8195 19.9398 14.1604 19.533 14.4004L9.16974 20.5156C7.84721 21.2958 6.14595 20.8511 5.36993 19.5273C5.1196 19.1003 4.98719 18.6142 4.98712 18.1191V5.88672C4.98716 4.3537 6.2273 3.10547 7.76251 3.10547ZM6.7879 18.1191C6.78797 18.2945 6.8343 18.4664 6.92267 18.6172C7.19638 19.0841 7.79336 19.2377 8.25568 18.9648L18.618 12.8496C18.7607 12.7654 18.8803 12.6458 18.9647 12.502C19.2393 12.0334 19.082 11.4311 18.618 11.1572L8.25568 5.04102C8.1061 4.95273 7.93562 4.9063 7.76251 4.90625C7.22703 4.90625 6.78794 5.34218 6.7879 5.88672V18.1191Z",fill:"currentColor"},null,-1)])])}const U3e=kt({name:"kimi-play",render:W3e}),j3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function V3e(e,t){return y(),M("svg",j3e,[...t[0]||(t[0]=[C("path",{d:"M11.999 15.0049C12.6208 15.0049 13.1259 15.5091 13.126 16.1309C13.126 16.7528 12.6209 17.2578 11.999 17.2578C11.3773 17.2576 10.873 16.7526 10.873 16.1309C10.8732 15.5092 11.3774 15.0051 11.999 15.0049Z",fill:"currentColor"},null,-1),C("path",{d:"M10.1611 7.37109C10.9017 6.79576 11.8605 6.60385 12.7881 6.8457C13.808 7.10861 14.6385 7.93756 14.9014 8.95898C15.2694 10.3845 14.5793 11.8629 13.2598 12.4736C13.0803 12.557 12.75 12.9552 12.75 13.3525V13.502C12.75 13.9172 12.4142 14.2527 11.999 14.2529C11.5837 14.2529 11.248 13.9173 11.248 13.502V13.3525C11.248 12.313 11.9587 11.4215 12.6279 11.1113C13.1777 10.8567 13.6681 10.192 13.4473 9.33496C13.3195 8.84253 12.9038 8.42684 12.4121 8.2998C11.9292 8.17289 11.4573 8.26727 11.0811 8.55859C10.71 8.84626 10.4971 9.28012 10.4971 9.74805C10.4968 10.1632 10.1613 10.499 9.74609 10.499C9.33092 10.499 8.99536 10.1632 8.99512 9.74805C8.99512 8.81152 9.41918 7.94493 10.1611 7.37109Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 3.7998C7.47126 3.7998 3.7998 7.47126 3.7998 12C3.7998 16.5287 7.47126 20.2002 12 20.2002C16.5287 20.2002 20.2002 16.5287 20.2002 12C20.2002 7.47126 16.5287 3.7998 12 3.7998Z",fill:"currentColor"},null,-1)])])}const q3e=kt({name:"kimi-question",render:V3e}),K3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Z3e(e,t){return y(),M("svg",K3e,[...t[0]||(t[0]=[C("path",{d:"M12 2C13.1046 2 14 2.89543 14 4C14 4.78019 13.552 5.45353 12.9004 5.7832V7H16.5C18.1569 7 19.5 8.34315 19.5 10V17C19.5 18.6051 18.2394 19.9158 16.6543 19.9961L16.5 20H7.5L7.3457 19.9961C5.81166 19.9184 4.58163 18.6883 4.50391 17.1543L4.5 17V10C4.5 8.34315 5.84315 7 7.5 7H11.0996V5.7832C10.448 5.45353 10 4.78019 10 4C10 2.89543 10.8954 2 12 2ZM7.5 8.7998C6.83726 8.7998 6.2998 9.33726 6.2998 10V17C6.2998 17.6627 6.83726 18.2002 7.5 18.2002H16.5C17.1627 18.2002 17.7002 17.6627 17.7002 17V10C17.7002 9.33726 17.1627 8.7998 16.5 8.7998H7.5ZM3 10.7666C3.49706 10.7666 3.90039 11.1699 3.90039 11.667V15C3.90039 15.4971 3.49706 15.9004 3 15.9004C2.50294 15.9004 2.09961 15.4971 2.09961 15V11.667C2.09961 11.1699 2.50294 10.7666 3 10.7666ZM21 10.7666C21.4971 10.7666 21.9004 11.1699 21.9004 11.667V15C21.9004 15.4971 21.4971 15.9004 21 15.9004C20.5029 15.9004 20.0996 15.4971 20.0996 15V11.667C20.0996 11.1699 20.5029 10.7666 21 10.7666ZM9.5 11.0996C9.99706 11.0996 10.4004 11.5029 10.4004 12V14.5C10.4004 14.9971 9.99706 15.4004 9.5 15.4004C9.00294 15.4004 8.59961 14.9971 8.59961 14.5V12C8.59961 11.5029 9.00294 11.0996 9.5 11.0996ZM14.5 11.0996C14.9971 11.0996 15.4004 11.5029 15.4004 12V14.5C15.4004 14.9971 14.9971 15.4004 14.5 15.4004C14.0029 15.4004 13.5996 14.9971 13.5996 14.5V12C13.5996 11.5029 14.0029 11.0996 14.5 11.0996ZM12 3.5C11.7239 3.5 11.5 3.72386 11.5 4C11.5 4.27614 11.7239 4.5 12 4.5C12.2761 4.5 12.5 4.27614 12.5 4C12.5 3.72386 12.2761 3.5 12 3.5Z",fill:"currentColor"},null,-1)])])}const G3e=kt({name:"kimi-robot",render:Z3e}),Y3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function X3e(e,t){return y(),M("svg",Y3e,[...t[0]||(t[0]=[C("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const J3e=kt({name:"kimi-search",render:X3e}),Q3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function e8e(e,t){return y(),M("svg",Q3e,[...t[0]||(t[0]=[C("path",{d:"M16.5364 10.1636C16.8879 10.5151 16.8879 11.0849 16.5364 11.4364C16.1849 11.7879 15.6151 11.7879 15.2636 11.4364L12.9 9.07281V17.1C12.9 17.597 12.4971 18 12 18C11.503 18 11.1 17.597 11.1 17.1V9.07281L8.73641 11.4364C8.38494 11.7879 7.81509 11.7879 7.46362 11.4364C7.11214 11.0849 7.11214 10.5151 7.46362 10.1636L11.3636 6.2636C11.7151 5.91211 12.2849 5.91211 12.6364 6.2636L16.5364 10.1636Z",fill:"currentColor"},null,-1)])])}const t8e=kt({name:"kimi-send",render:e8e}),n8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function o8e(e,t){return y(),M("svg",n8e,[...t[0]||(t[0]=[C("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),C("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const s8e=kt({name:"kimi-setting",render:o8e}),i8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function r8e(e,t){return y(),M("svg",i8e,[...t[0]||(t[0]=[C("path",{d:"M17 2C19.2091 2 21 3.79086 21 6V15.7646C21 17.2361 20.192 18.5884 18.8965 19.2861L13.8965 21.9785C12.7126 22.616 11.2874 22.616 10.1035 21.9785L5.10352 19.2861C3.80802 18.5884 3 17.2361 3 15.7646V6C3 3.79086 4.79086 2 7 2H17ZM7 3.7998C5.78498 3.7998 4.79981 4.78497 4.7998 6V15.7646C4.7998 16.574 5.24443 17.3184 5.95703 17.7021L10.957 20.3936C11.6082 20.7442 12.3918 20.7442 13.043 20.3936L18.043 17.7021C18.7556 17.3184 19.2002 16.574 19.2002 15.7646V6C19.2002 4.78497 18.215 3.7998 17 3.7998H7Z",fill:"currentColor"},null,-1),C("path",{d:"M10.1611 7.37109C10.9017 6.79576 11.8605 6.60385 12.7881 6.8457C13.808 7.10861 14.6385 7.93756 14.9014 8.95898C15.2694 10.3845 14.5793 11.8629 13.2598 12.4736C13.0803 12.557 12.75 12.9552 12.75 13.3525V13.502C12.75 13.9172 12.4142 14.2527 11.999 14.2529C11.5837 14.2529 11.248 13.9173 11.248 13.502V13.3525C11.248 12.313 11.9587 11.4215 12.6279 11.1113C13.1777 10.8567 13.6681 10.192 13.4473 9.33496C13.3195 8.84253 12.9038 8.42684 12.4121 8.2998C11.9292 8.17289 11.4573 8.26727 11.0811 8.55859C10.71 8.84626 10.4971 9.28012 10.4971 9.74805C10.4968 10.1632 10.1613 10.499 9.74609 10.499C9.33092 10.499 8.99536 10.1632 8.99512 9.74805C8.99512 8.81152 9.41918 7.94493 10.1611 7.37109Z",fill:"currentColor"},null,-1),C("path",{d:"M11.999 15.0049C12.6208 15.0049 13.1259 15.5091 13.126 16.1309C13.126 16.7528 12.6209 17.2578 11.999 17.2578C11.3773 17.2576 10.873 16.7526 10.873 16.1309C10.8732 15.5092 11.3774 15.0051 11.999 15.0049Z",fill:"currentColor"},null,-1)])])}const l8e=kt({name:"kimi-shield-question",render:r8e}),a8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function u8e(e,t){return y(),M("svg",a8e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.90005 12C2.90005 11.503 3.303 11.1 3.80005 11.1H12.2939L9.38588 8.19197C9.03441 7.8405 9.03441 7.27065 9.38588 6.91918C9.73735 6.56771 10.3072 6.56771 10.6587 6.91918L15.1031 11.3636C15.2719 11.5324 15.3667 11.7613 15.3667 12C15.3667 12.2387 15.2719 12.4676 15.1031 12.6364L10.6587 17.0809C10.3072 17.4323 9.73735 17.4323 9.38588 17.0809C9.03441 16.7294 9.03441 16.1595 9.38588 15.8081L12.2939 12.9H3.80005C3.303 12.9 2.90005 12.4971 2.90005 12ZM13.5874 20C13.5874 19.503 13.9904 19.1 14.4874 19.1H18.043C18.2758 19.1 18.4991 19.0075 18.6637 18.8429C18.8283 18.6783 18.9208 18.455 18.9208 18.2222V5.7778C18.9208 5.545 18.8283 5.32174 18.6637 5.15712C18.499 4.9925 18.2758 4.90002 18.043 4.90002H14.4874C13.9904 4.90002 13.5874 4.49708 13.5874 4.00002C13.5874 3.50297 13.9904 3.10003 14.4874 3.10003H18.043C18.7532 3.10003 19.4343 3.38215 19.9365 3.88433C20.4386 4.38651 20.7208 5.06761 20.7208 5.7778V18.2222C20.7208 18.9324 20.4386 19.6135 19.9365 20.1157C19.4343 20.6179 18.7532 20.9 18.043 20.9H14.4874C13.9904 20.9 13.5874 20.4971 13.5874 20Z",fill:"currentColor"},null,-1)])])}const c8e=kt({name:"kimi-sign-in",render:u8e}),d8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function f8e(e,t){return y(),M("svg",d8e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.6364 11.3636C20.9879 11.7151 20.9879 12.2849 20.6364 12.6364L16.1919 17.0808C15.8405 17.4323 15.2706 17.4323 14.9192 17.0808C14.5677 16.7293 14.5677 16.1595 14.9192 15.808L17.8272 12.9H9.33333C8.83627 12.9 8.43333 12.497 8.43333 12C8.43333 11.5029 8.83627 11.1 9.33333 11.1H17.8272L14.9192 8.19193C14.5677 7.84046 14.5677 7.27061 14.9192 6.91914C15.2706 6.56766 15.8405 6.56766 16.1919 6.91914L20.6364 11.3636ZM10.2333 3.99998C10.2333 4.49703 9.83038 4.89998 9.33333 4.89998H5.77777C5.54497 4.89998 5.3217 4.99246 5.15709 5.15707C4.99247 5.32169 4.89999 5.54495 4.89999 5.77775V18.2222C4.89999 18.455 4.99247 18.6783 5.15709 18.8429C5.32171 19.0075 5.54497 19.1 5.77777 19.1H9.33333C9.83038 19.1 10.2333 19.5029 10.2333 20C10.2333 20.497 9.83038 20.9 9.33333 20.9H5.77777C5.06758 20.9 4.38648 20.6179 3.8843 20.1157C3.38212 19.6135 3.09999 18.9324 3.09999 18.2222V5.77775C3.09999 5.06756 3.38212 4.38646 3.8843 3.88428C4.38648 3.3821 5.06758 3.09998 5.77777 3.09998H9.33333C9.83038 3.09998 10.2333 3.50292 10.2333 3.99998Z",fill:"currentColor"},null,-1)])])}const p8e=kt({name:"kimi-sign-out",render:f8e}),h8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function m8e(e,t){return y(),M("svg",h8e,[...t[0]||(t[0]=[iu('<path d="M4 6H14.0" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><path d="M18.0 6H20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><circle cx="16" cy="6" r="2.0" fill="none" stroke="currentColor" stroke-width="1.8"></circle><path d="M4 12H6.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><path d="M10.5 12H20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><circle cx="8.5" cy="12" r="2.0" fill="none" stroke="currentColor" stroke-width="1.8"></circle><path d="M4 18H14.0" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><path d="M18.0 18H20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><circle cx="16" cy="18" r="2.0" fill="none" stroke="currentColor" stroke-width="1.8"></circle>',9)])])}const g8e=kt({name:"kimi-sliders",render:m8e}),v8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function y8e(e,t){return y(),M("svg",v8e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.78027 8.90405C7.5 9.45411 7.5 10.1742 7.5 11.6144V12.3856C7.5 13.8258 7.5 14.5459 7.78027 15.096C8.02681 15.5798 8.42019 15.9732 8.90405 16.2197C9.45411 16.5 10.1742 16.5 11.6144 16.5H12.3856C13.8258 16.5 14.5459 16.5 15.096 16.2197C15.5798 15.9732 15.9732 15.5798 16.2197 15.096C16.5 14.5459 16.5 13.8258 16.5 12.3856V11.6144C16.5 10.1742 16.5 9.45411 16.2197 8.90405C15.9732 8.42019 15.5798 8.02681 15.096 7.78027C14.5459 7.5 13.8258 7.5 12.3856 7.5H11.6144C10.1742 7.5 9.45411 7.5 8.90405 7.78027C8.42019 8.02681 8.02681 8.42019 7.78027 8.90405Z",fill:"currentColor"},null,-1)])])}const k8e=kt({name:"kimi-stop",render:y8e}),b8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function C8e(e,t){return y(),M("svg",b8e,[...t[0]||(t[0]=[C("path",{d:"M7.01562 3.41459C7.4446 3.16449 7.9954 3.30924 8.24609 3.73784C8.49645 4.167 8.35189 4.71868 7.92285 4.96928C5.51497 6.37506 3.90054 8.98498 3.90039 11.9703C3.90076 16.4435 7.52672 20.0699 12 20.0699C16.4733 20.0699 20.0992 16.4435 20.0996 11.9703C20.0996 11.2291 20 10.5116 19.8145 9.83159C19.6838 9.35222 19.967 8.85702 20.4463 8.72612C20.9256 8.59541 21.4207 8.87778 21.5518 9.35698C21.7792 10.1901 21.9004 11.0674 21.9004 11.9703C21.9 17.4376 17.4674 21.8697 12 21.8697C6.53261 21.8697 2.09998 17.4376 2.09961 11.9703C2.09976 8.31904 4.07782 5.12972 7.01562 3.41459ZM8.39258 8.24077C8.75015 7.89591 9.3199 7.90591 9.66504 8.26323C10.01 8.62076 9.99985 9.19051 9.64258 9.53569C9.00203 10.1541 8.60558 11.02 8.60547 11.979C8.60584 13.8536 10.1253 15.3736 12 15.3736C13.8746 15.3735 15.3942 13.8536 15.3945 11.979C15.3945 11.6847 15.3577 11.3989 15.2881 11.1285C15.1646 10.6474 15.4536 10.1568 15.9346 10.0328C16.4158 9.9089 16.9071 10.1991 17.0312 10.6802C17.1383 11.096 17.1943 11.5321 17.1943 11.979C17.194 14.8477 14.8688 17.1733 12 17.1734C9.1312 17.1734 6.80506 14.8478 6.80469 11.979C6.8048 10.5117 7.41519 9.18431 8.39258 8.24077ZM11.5459 1.12651C11.8216 0.965605 12.1631 0.963306 12.4414 1.11967L19.1953 4.91752C19.4859 5.08108 19.662 5.39277 19.6533 5.72612C19.6443 6.05972 19.4515 6.36154 19.1523 6.50932L12.9004 9.5933V12.2583C12.9004 12.7554 12.4971 13.1587 12 13.1587C11.5029 13.1587 11.0996 12.7554 11.0996 12.2583V1.90385C11.0999 1.58444 11.2702 1.2878 11.5459 1.12651ZM12.9004 7.58549L16.8252 5.64897L12.9004 3.44194V7.58549Z",fill:"currentColor"},null,-1)])])}const w8e=kt({name:"kimi-target",render:C8e}),_8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function x8e(e,t){return y(),M("svg",_8e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.9893 6.60743C20.5897 6.60757 21.8877 7.8926 21.8877 9.47736C21.8877 10.7416 21.0607 11.8129 19.9141 12.1955V14.257C19.914 15.8428 18.6152 17.1288 17.0137 17.1289H12.8438V20.1381C12.8437 20.6301 12.4412 21.0293 11.9443 21.0296C11.4473 21.0296 11.044 20.6302 11.0439 20.1381V16.4356C11.0441 15.8343 11.5363 15.3461 12.1436 15.3458H17.0137C17.6211 15.3457 18.1133 14.8585 18.1133 14.257V12.2129C16.9408 11.8451 16.0909 10.7598 16.0908 9.47736C16.0908 7.89251 17.3887 6.60743 18.9893 6.60743ZM18.9893 8.38953C18.3828 8.38953 17.8906 8.87684 17.8906 9.47736C17.8907 10.0778 18.3828 10.5642 18.9893 10.5642C19.5956 10.5641 20.0869 10.0777 20.0869 9.47736C20.0869 8.87693 19.5956 8.38967 18.9893 8.38953Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.89844 6.60743C6.49899 6.60747 7.79688 7.89254 7.79688 9.47736C7.79684 10.7388 6.97371 11.8078 5.83105 12.1926V14.4021C5.83105 15.0036 6.32315 15.4918 6.93066 15.4918H8.37109C8.86789 15.492 9.27038 15.8905 9.27051 16.3824C9.27051 16.8744 8.86797 17.2737 8.37109 17.2739H6.93066C5.32904 17.2739 4.03027 15.9879 4.03027 14.4021V12.2158C2.85382 11.8504 2.00004 10.7627 2 9.47736C2 7.89251 3.29784 6.60743 4.89844 6.60743ZM4.89844 8.38953C4.29196 8.38953 3.7998 8.87684 3.7998 9.47736C3.79985 10.0778 4.29198 10.5642 4.89844 10.5642C5.50485 10.5642 5.99605 10.0778 5.99609 9.47736C5.99609 8.87687 5.50488 8.38958 4.89844 8.38953Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9434 2.9707C13.5439 2.97075 14.8418 4.25581 14.8418 5.84063C14.8418 7.11413 14.0035 8.1923 12.8438 8.56745V13.0135C12.8436 13.5056 12.4403 13.9041 11.9434 13.9041C11.4466 13.9039 11.0431 13.5055 11.043 13.0135V8.56745C9.8836 8.19209 9.04496 7.11387 9.04492 5.84063C9.04492 4.25592 10.343 2.97093 11.9434 2.9707ZM11.9434 4.75281C11.3371 4.75303 10.8447 5.24026 10.8447 5.84063C10.8448 6.44097 11.3371 6.92726 11.9434 6.92749C12.5498 6.92745 13.041 6.44108 13.041 5.84063C13.041 5.24014 12.5498 4.75285 11.9434 4.75281Z",fill:"currentColor"},null,-1)])])}const S8e=kt({name:"kimi-task",render:x8e}),A8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function M8e(e,t){return y(),M("svg",A8e,[...t[0]||(t[0]=[C("path",{d:"M16.5293 15.0596C16.9496 15.1021 17.2772 15.4572 17.2773 15.8887C17.2773 16.3202 16.9497 16.6753 16.5293 16.7178L16.4443 16.7217H12C11.5399 16.7216 11.167 16.3488 11.167 15.8887C11.1671 15.4286 11.54 15.0558 12 15.0557H16.4443L16.5293 15.0596Z",fill:"currentColor"},null,-1),C("path",{d:"M6.96582 7.52246C7.27077 7.21751 7.75375 7.1983 8.08105 7.46484L8.14453 7.52246L10.8232 10.2002C11.5102 10.8872 11.5102 12.0014 10.8232 12.6885L8.14453 15.3672L8.08105 15.4248C7.75377 15.6913 7.27075 15.6721 6.96582 15.3672C6.66114 15.0621 6.64234 14.5791 6.90918 14.252L6.96582 14.1885L9.64453 11.5098C9.68057 11.4736 9.68062 11.415 9.64453 11.3789L6.96582 8.7002C6.64116 8.37488 6.6411 7.84774 6.96582 7.52246Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 3.09961C19.1539 3.09966 20.9004 4.84612 20.9004 7V17C20.9004 19.1539 19.1539 20.9003 17 20.9004H7C4.84609 20.9004 3.09961 19.1539 3.09961 17V7C3.09961 4.84609 4.84609 3.09961 7 3.09961H17ZM7 4.90039C5.8402 4.90039 4.90039 5.8402 4.90039 7V17C4.90039 18.1598 5.8402 19.0996 7 19.0996H17C18.1598 19.0996 19.0996 18.1598 19.0996 17V7C19.0996 5.84024 18.1598 4.90044 17 4.90039H7Z",fill:"currentColor"},null,-1)])])}const T8e=kt({name:"kimi-terminal",render:M8e}),E8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function I8e(e,t){return y(),M("svg",E8e,[...t[0]||(t[0]=[C("path",{d:"M16.9971 3.90597C15.9799 2.99725 14.7342 2.38312 13.394 2.12966C12.0538 1.8762 10.6699 1.99301 9.39111 2.46751C8.11236 2.94202 6.98721 3.75626 6.13676 4.82261C5.2863 5.88896 4.74274 7.16703 4.56457 8.5193C4.40455 9.70501 4.53253 10.9118 4.93767 12.0376C5.34281 13.1634 6.01318 14.175 6.89207 14.9868C7.43557 15.4634 7.87413 16.0477 8.17997 16.7027C8.48581 17.3577 8.65224 18.0691 8.66873 18.7918V18.926C8.66962 19.7412 8.99387 20.5229 9.57035 21.0993C10.1468 21.6758 10.9285 22.0001 11.7437 22.001H12.2604C13.0757 22.0001 13.8573 21.6758 14.4338 21.0993C15.0103 20.5229 15.3345 19.7412 15.3354 18.926V18.4685C15.3479 17.8297 15.4982 17.2011 15.7761 16.6258C16.0539 16.0505 16.4528 15.542 16.9454 15.1351C17.7442 14.4355 18.3853 13.5741 18.826 12.608C19.2668 11.642 19.4973 10.5932 19.5022 9.53136C19.5071 8.46948 19.2863 7.41869 18.8544 6.4486C18.4225 5.4785 17.7894 4.61125 16.9971 3.9043V3.90597ZM12.2604 20.3343H11.7437C11.3704 20.3339 11.0124 20.1853 10.7484 19.9213C10.4844 19.6573 10.3358 19.2993 10.3354 18.926C10.3354 18.926 10.3296 18.7093 10.3287 18.6676H13.6687V18.926C13.6683 19.2993 13.5198 19.6573 13.2558 19.9213C12.9917 20.1853 12.6338 20.3339 12.2604 20.3343ZM15.8437 13.8835C14.8949 14.7064 14.2097 15.7908 13.8737 17.001H12.8354V11.0143C13.3212 10.8426 13.742 10.5249 14.0403 10.1049C14.3387 9.68482 14.4999 9.18285 14.5021 8.66763C14.5021 8.44662 14.4143 8.23466 14.258 8.07838C14.1017 7.9221 13.8897 7.8343 13.6687 7.8343C13.4477 7.8343 13.2358 7.9221 13.0795 8.07838C12.9232 8.23466 12.8354 8.44662 12.8354 8.66763C12.8354 8.88865 12.7476 9.10061 12.5913 9.25689C12.435 9.41317 12.2231 9.50097 12.0021 9.50097C11.7811 9.50097 11.5691 9.41317 11.4128 9.25689C11.2565 9.10061 11.1687 8.88865 11.1687 8.66763C11.1687 8.44662 11.0809 8.23466 10.9247 8.07838C10.7684 7.9221 10.5564 7.8343 10.3354 7.8343C10.1144 7.8343 9.90242 7.9221 9.74614 8.07838C9.58986 8.23466 9.50207 8.44662 9.50207 8.66763C9.5042 9.18285 9.66547 9.68482 9.96381 10.1049C10.2621 10.5249 10.683 10.8426 11.1687 11.0143V17.001H10.0671C9.69123 15.7586 8.98633 14.6411 8.02707 13.7668C7.21286 13.0081 6.63267 12.0324 6.35496 10.9547C6.07725 9.87703 6.1136 8.7424 6.45974 7.68471C6.80588 6.62702 7.44735 5.69042 8.30846 4.98543C9.16956 4.28045 10.2144 3.83649 11.3196 3.70597C11.5487 3.68039 11.779 3.66759 12.0096 3.66763C13.4409 3.66338 14.8226 4.19149 15.8862 5.1493C16.5026 5.69896 16.9952 6.37337 17.3312 7.12782C17.6672 7.88227 17.839 8.69952 17.8352 9.5254C17.8314 10.3513 17.6522 11.1669 17.3092 11.9183C16.9663 12.6696 16.4677 13.3395 15.8462 13.8835H15.8437Z",fill:"currentColor"},null,-1)])])}const L8e=kt({name:"kimi-thinking",render:I8e}),$8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function N8e(e,t){return y(),M("svg",$8e,[...t[0]||(t[0]=[iu('<path d="M9.28994 4.92561C9.6436 4.57634 9.64716 4.0065 9.29789 3.65284C8.94862 3.29918 8.37878 3.29563 8.02512 3.6449L5.91339 5.73041L5.16642 4.95888C4.82067 4.60177 4.2509 4.59256 3.89379 4.9383C3.53668 5.28404 3.52747 5.85382 3.87321 6.21093L5.25245 7.63551C5.41956 7.80811 5.64874 7.90674 5.88897 7.90943C6.1292 7.91213 6.36053 7.81866 6.53146 7.64985L9.28994 4.92561Z" fill="currentColor"></path><path d="M12 5.10022C11.503 5.10022 11.1 5.50316 11.1 6.00022C11.1 6.49728 11.503 6.90022 12 6.90022L19.9965 6.90022C20.4935 6.90022 20.8965 6.49728 20.8965 6.00022C20.8965 5.50316 20.4935 5.10022 19.9965 5.10022L12 5.10022Z" fill="currentColor"></path><path d="M12 11.1002C11.503 11.1002 11.1 11.5032 11.1 12.0002C11.1 12.4973 11.503 12.9002 12 12.9002H19.9965C20.4935 12.9002 20.8965 12.4973 20.8965 12.0002C20.8965 11.5032 20.4935 11.1002 19.9965 11.1002L12 11.1002Z" fill="currentColor"></path><path d="M11.1 18.0002C11.1 17.5032 11.503 17.1002 12 17.1002L19.9965 17.1002C20.4935 17.1002 20.8965 17.5032 20.8965 18.0002C20.8965 18.4973 20.4935 18.9002 19.9965 18.9002H12C11.503 18.9002 11.1 18.4973 11.1 18.0002Z" fill="currentColor"></path><path d="M9.29789 9.77064C9.64716 10.1243 9.6436 10.6941 9.28994 11.0434L6.53146 13.7676C6.36053 13.9365 6.1292 14.0299 5.88897 14.0272C5.64874 14.0245 5.41956 13.9259 5.25245 13.7533L3.87321 12.3287C3.52747 11.9716 3.53668 11.4018 3.89379 11.0561C4.2509 10.7104 4.82067 10.7196 5.16642 11.0767L5.91339 11.8482L8.02512 9.76269C8.37878 9.41342 8.94862 9.41698 9.29789 9.77064Z" fill="currentColor"></path><path d="M9.29789 15.7436C9.64716 16.0973 9.6436 16.6671 9.28994 17.0164L6.53146 19.7406C6.36053 19.9094 6.1292 20.0029 5.88897 20.0002C5.64874 19.9975 5.41956 19.8989 5.25245 19.7263L3.87321 18.3017C3.52747 17.9446 3.53668 17.3748 3.89379 17.0291C4.2509 16.6833 4.82067 16.6926 5.16642 17.0497L5.91339 17.8212L8.02512 15.7357C8.37878 15.3864 8.94862 15.39 9.29789 15.7436Z" fill="currentColor"></path>',6)])])}const F8e=kt({name:"kimi-todo",render:N8e}),R8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function O8e(e,t){return y(),M("svg",R8e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.09752 2.19507C8.5421 1.97278 9.08271 2.15298 9.305 2.59756L10.0562 4.10005H13.5C13.9971 4.10005 14.4 4.50299 14.4 5.00005C14.4 5.49711 13.9971 5.90005 13.5 5.90005H12.3106C12.2556 6.2319 12.1667 6.64073 12.0226 7.0987C11.7254 8.04355 11.191 9.20402 10.2334 10.3239C11.4166 11.196 12.5606 11.7524 13.4512 12.0987C13.978 12.3036 14.4136 12.434 14.7124 12.5122L14.7348 12.5181L15.695 10.5976C15.8475 10.2927 16.1591 10.1 16.5 10.1C16.8409 10.1 17.1525 10.2927 17.305 10.5976L20.7969 17.5814L20.8044 17.5959L20.8137 17.615L21.805 19.5976C22.0273 20.0421 21.8471 20.5827 21.4025 20.805C20.9579 21.0273 20.4173 20.8471 20.195 20.4025L19.4438 18.9H13.5562L12.805 20.4025C12.5827 20.8471 12.0421 21.0273 11.5975 20.805C11.1529 20.5827 10.9727 20.0421 11.195 19.5976L12.1863 17.615C12.1917 17.6036 12.1973 17.5924 12.2031 17.5814L13.9146 14.1583C13.6034 14.0667 13.2256 13.9423 12.7988 13.7764C11.7294 13.3605 10.3442 12.6802 8.92538 11.5924C7.79753 12.5167 6.69473 13.0764 5.83285 13.4112C5.33899 13.603 4.92286 13.7216 4.62401 13.7931C4.47449 13.8288 4.35399 13.8529 4.26741 13.8684C4.2241 13.8762 4.18924 13.8818 4.16343 13.8858L4.13156 13.8904L4.12084 13.8919L4.11682 13.8924L4.11514 13.8927C4.11514 13.8927 4.11368 13.8928 4.00001 13L4.11368 13.8928C3.62061 13.9556 3.17 13.6068 3.10722 13.1137C3.0446 12.6219 3.39148 12.1723 3.88256 12.1077L3.94947 12.0967C4.00428 12.0869 4.09114 12.0698 4.20543 12.0424C4.43422 11.9877 4.77156 11.8924 5.18106 11.7334C5.84103 11.477 6.68484 11.0564 7.56458 10.3753C7.15054 9.93496 6.78945 9.48388 6.50421 9.10102C6.26672 8.78224 6.07517 8.50172 5.94227 8.29973C5.87571 8.19858 5.82359 8.11671 5.78748 8.05909C5.76942 8.03027 5.75535 8.00749 5.74545 7.99135L5.73377 7.9722L5.73032 7.96651L5.72864 7.96371C5.71133 7.9349 5.69582 7.9055 5.68208 7.87566C5.49265 7.46416 5.6393 6.96717 6.03659 6.72853C6.09037 6.69623 6.14617 6.6702 6.20315 6.65023C6.59739 6.51205 7.04758 6.66421 7.27129 7.03623L7.27266 7.0385L7.28001 7.05054C7.28695 7.06186 7.29793 7.07964 7.31274 7.10328C7.34239 7.15059 7.38731 7.2212 7.44595 7.31032C7.56343 7.48886 7.73484 7.73997 7.94765 8.02562C8.21085 8.37889 8.52772 8.77187 8.8756 9.14201C9.64226 8.24147 10.0681 7.3133 10.3056 6.55854C10.381 6.3186 10.4372 6.09683 10.4791 5.90005H9.51951C9.50696 5.90031 9.49442 5.90031 9.48191 5.90005H4.00001C3.50296 5.90005 3.10001 5.49711 3.10001 5.00005C3.10001 4.50299 3.50296 4.10005 4.00001 4.10005H8.04378L7.69503 3.40254C7.67314 3.35877 7.65516 3.31407 7.64094 3.26883C7.51078 2.8546 7.69671 2.39547 8.09752 2.19507ZM16.5 13.0125L18.5438 17.1H14.4562L16.5 13.0125Z",fill:"currentColor"},null,-1),C("path",{d:"M15.1 4.00007C15.1 3.50301 15.5029 3.10007 16 3.10007H18C19.6016 3.10007 20.9 4.39844 20.9 6.00007V8.00007C20.9 8.49712 20.497 8.90007 20 8.90007C19.5029 8.90007 19.1 8.49712 19.1 8.00007V6.00007C19.1 5.39255 18.6075 4.90007 18 4.90007H16C15.5029 4.90007 15.1 4.49712 15.1 4.00007Z",fill:"currentColor"},null,-1),C("path",{d:"M3.99998 15.1001C4.49703 15.1001 4.89998 15.503 4.89998 16.0001V18.0001C4.89998 18.6076 5.39246 19.1001 5.99998 19.1001H7.99998C8.49703 19.1001 8.89998 19.503 8.89998 20.0001C8.89998 20.4971 8.49703 20.9001 7.99998 20.9001H5.99998C4.39835 20.9001 3.09998 19.6017 3.09998 18.0001V16.0001C3.09998 15.503 3.50292 15.1001 3.99998 15.1001Z",fill:"currentColor"},null,-1)])])}const P8e=kt({name:"kimi-translate",render:O8e}),D8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function B8e(e,t){return y(),M("svg",D8e,[...t[0]||(t[0]=[C("path",{d:"M8.10001 3C8.10001 2.50294 8.50295 2.1 9.00001 2.1H15C15.4971 2.1 15.9 2.50294 15.9 3C15.9 3.49706 15.4971 3.9 15 3.9H9.00001C8.50295 3.9 8.10001 3.49706 8.10001 3Z",fill:"currentColor"},null,-1),C("path",{d:"M10 15.9C9.50295 15.9 9.10001 15.4971 9.10001 15L9.10001 10C9.10001 9.50294 9.50295 9.1 10 9.1C10.4971 9.1 10.9 9.50294 10.9 10L10.9 15C10.9 15.4971 10.4971 15.9 10 15.9Z",fill:"currentColor"},null,-1),C("path",{d:"M13.1 15C13.1 15.4971 13.5029 15.9 14 15.9C14.4971 15.9 14.9 15.4971 14.9 15L14.9 10C14.9 9.50294 14.4971 9.1 14 9.1C13.5029 9.1 13.1 9.50294 13.1 10V15Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.10001 6C2.10001 5.50294 2.50295 5.1 3.00001 5.1H4.99152C4.99785 5.09993 5.00417 5.09993 5.01048 5.1H18.9895C18.9958 5.09993 19.0021 5.09993 19.0085 5.1H21C21.4971 5.1 21.9 5.50294 21.9 6C21.9 6.49706 21.4971 6.9 21 6.9H19.8281L18.8448 18.6993C18.7412 19.9432 17.7013 20.9 16.4531 20.9H7.54686C6.29865 20.9 5.25881 19.9432 5.15515 18.6993L4.17188 6.9H3.00001C2.50295 6.9 2.10001 6.49706 2.10001 6ZM5.97811 6.9L18.0219 6.9L17.0511 18.5498C17.0251 18.8608 16.7652 19.1 16.4531 19.1H7.54686C7.23481 19.1 6.97485 18.8608 6.94893 18.5498L5.97811 6.9Z",fill:"currentColor"},null,-1)])])}const H8e=kt({name:"kimi-trash",render:B8e}),z8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function W8e(e,t){return y(),M("svg",z8e,[...t[0]||(t[0]=[C("path",{d:"M7.36336 3.3634C7.71483 3.01192 8.28533 3.01192 8.6368 3.3634C8.98817 3.71488 8.98824 4.2854 8.6368 4.63683L6.17391 7.09972H15.0001C18.2585 7.09977 20.9005 9.74166 20.9005 13.0001C20.9004 16.2585 18.2585 18.9005 15.0001 18.9005H7.00008C6.50307 18.9005 6.09976 18.4971 6.09969 18.0001C6.09969 17.5031 6.50302 17.0997 7.00008 17.0997H15.0001C17.2644 17.0997 19.0996 15.2644 19.0997 13.0001C19.0997 10.7358 17.2644 8.90055 15.0001 8.90051H6.17391L8.6368 11.3634L8.69832 11.4318C8.98668 11.7853 8.96632 12.3073 8.6368 12.6368C8.30728 12.9663 7.78521 12.9867 7.43172 12.6984L7.36336 12.6368L3.36336 8.63683C3.33098 8.60445 3.30286 8.56908 3.27645 8.53332C3.25597 8.50559 3.23607 8.47741 3.21883 8.44738C3.20492 8.42311 3.19221 8.39837 3.18074 8.37316C3.1764 8.36365 3.17109 8.35453 3.16707 8.34484C3.1627 8.33427 3.1593 8.32331 3.15535 8.31261C3.12946 8.24274 3.11237 8.16872 3.10457 8.09191C3.09258 7.97426 3.10262 7.85446 3.1368 7.74035C3.14281 7.72035 3.15094 7.70114 3.15828 7.68176C3.16165 7.67283 3.16341 7.66325 3.16707 7.65441C3.17216 7.64216 3.17806 7.63025 3.18367 7.61828C3.19055 7.60356 3.19744 7.58874 3.20516 7.57433C3.24709 7.49624 3.3012 7.42556 3.36336 7.3634L7.36336 3.3634Z",fill:"currentColor"},null,-1)])])}const U8e=kt({name:"kimi-undo",render:W8e}),j8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function V8e(e,t){return y(),M("svg",j8e,[...t[0]||(t[0]=[C("path",{d:"M11.9997 12.8779C16.0197 12.878 19.4393 15.3848 20.7048 18.8828C21.0812 19.9234 20.2782 20.8962 19.2038 21.0137L18.9861 21.0264H5.0134L4.79562 21.0137C3.7213 20.8961 2.91743 19.9233 3.29367 18.8828C4.55905 15.3847 7.9797 12.8781 11.9997 12.8779ZM11.9997 14.6777C8.84467 14.6779 6.17462 16.5794 5.09152 19.2256H18.9079C17.8248 16.5793 15.1549 14.6778 11.9997 14.6777ZM12.2312 3.00586C14.6088 3.1264 16.4997 5.09239 16.4997 7.5L16.4939 7.73145C16.3734 10.1091 14.4073 11.9999 11.9997 12C9.59225 11.9998 7.62604 10.109 7.50558 7.73145L7.49973 7.5C7.49973 5.01485 9.51462 3.00021 11.9997 3L12.2312 3.00586ZM11.9997 4.7998C10.5087 4.80001 9.29953 6.00896 9.29953 7.5C9.29953 8.99104 10.5087 10.2 11.9997 10.2002C13.4908 10.2001 14.6999 8.99112 14.6999 7.5C14.6999 6.00888 13.4908 4.79989 11.9997 4.7998Z",fill:"currentColor"},null,-1)])])}const q8e=kt({name:"kimi-user",render:V8e}),K8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Z8e(e,t){return y(),M("svg",K8e,[...t[0]||(t[0]=[C("path",{d:"M11.9996 7C11.5026 7 11.0996 7.36985 11.0996 7.82609V14.1739C11.0996 14.6301 11.5026 15 11.9996 15C12.4967 15 12.8996 14.6301 12.8996 14.1739V7.82609C12.8996 7.36985 12.4967 7 11.9996 7Z",fill:"currentColor"},null,-1),C("path",{d:"M12.8996 17.1006C12.8996 17.5974 12.4968 18.001 11.9992 18.001C11.5024 18.001 11.0996 17.5974 11.0996 17.1006C11.0996 16.6038 11.5024 16.2002 11.9992 16.2002C12.4968 16.2002 12.8996 16.6038 12.8996 17.1006Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.5108 3.5501C13.3946 1.61676 10.6041 1.61676 9.48786 3.5501L1.69363 17.0501C0.577423 18.9834 1.97269 21.4001 4.20511 21.4001H19.7936C22.026 21.4001 23.4212 18.9834 22.305 17.0501L14.5108 3.5501ZM11.0467 4.4501C11.4701 3.71676 12.5286 3.71676 12.952 4.4501L20.7462 17.9501C21.1696 18.6834 20.6403 19.6001 19.7936 19.6001H4.20511C3.35833 19.6001 2.82909 18.6834 3.25248 17.9501L11.0467 4.4501Z",fill:"currentColor"},null,-1)])])}const G8e=kt({name:"kimi-warning",render:Z8e}),Y8e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function X8e(e,t){return y(),M("svg",Y8e,[...t[0]||(t[0]=[C("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[C("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm11-2v16"}),C("path",{d:"m9 10l2 2l-2 2"})],-1)])])}const J8e=kt({name:"tabler-layout-sidebar-right-collapse",render:X8e}),Q8e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eye(e,t){return y(),M("svg",Q8e,[...t[0]||(t[0]=[C("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const tye=kt({name:"tabler-paperclip",render:eye}),nye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oye(e,t){return y(),M("svg",nye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const sye=kt({name:"ri-braces-line",render:oye}),iye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rye(e,t){return y(),M("svg",iye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const lye=kt({name:"ri-calendar-close-line",render:rye}),aye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uye(e,t){return y(),M("svg",aye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const cye=kt({name:"ri-calendar-schedule-line",render:uye}),dye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fye(e,t){return y(),M("svg",dye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const pye=kt({name:"ri-calendar-todo-line",render:fye}),hye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mye(e,t){return y(),M("svg",hye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const gye=kt({name:"ri-code-line",render:mye}),vye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yye(e,t){return y(),M("svg",vye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-4-7h8a4 4 0 0 1-8 0m0-2a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m8 0a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3"},null,-1)])])}const kye=kt({name:"ri-emotion-line",render:yye}),bye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Cye(e,t){return y(),M("svg",bye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const wye=kt({name:"ri-external-link-line",render:Cye}),_ye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xye(e,t){return y(),M("svg",_ye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12 3c5.392 0 9.878 3.88 10.819 9c-.94 5.12-5.427 9-10.819 9s-9.878-3.88-10.818-9C2.122 6.88 6.608 3 12 3m0 16a9.005 9.005 0 0 0 8.778-7a9.005 9.005 0 0 0-17.555 0A9.005 9.005 0 0 0 12 19m0-2.5a4.5 4.5 0 1 1 0-9a4.5 4.5 0 0 1 0 9m0-2a2.5 2.5 0 1 0 0-5a2.5 2.5 0 0 0 0 5"},null,-1)])])}const Sye=kt({name:"ri-eye-line",render:xye}),Aye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Mye(e,t){return y(),M("svg",Aye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M17.883 19.297A10.95 10.95 0 0 1 12 21c-5.392 0-9.878-3.88-10.818-9A11 11 0 0 1 4.52 5.935L1.394 2.808l1.414-1.414l19.799 19.798l-1.414 1.415zM5.936 7.35A8.97 8.97 0 0 0 3.223 12a9.005 9.005 0 0 0 13.201 5.838l-2.028-2.028A4.5 4.5 0 0 1 8.19 9.604zm6.978 6.978l-3.242-3.241a2.5 2.5 0 0 0 3.241 3.241m7.893 2.265l-1.431-1.431A8.9 8.9 0 0 0 20.778 12A9.005 9.005 0 0 0 9.552 5.338L7.974 3.76C9.221 3.27 10.58 3 12 3c5.392 0 9.878 3.88 10.819 9a10.95 10.95 0 0 1-2.012 4.593m-9.084-9.084Q11.86 7.5 12 7.5a4.5 4.5 0 0 1 4.492 4.778z"},null,-1)])])}const Tye=kt({name:"ri-eye-off-line",render:Mye}),Eye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Iye(e,t){return y(),M("svg",Eye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const Lye=kt({name:"ri-file-add-line",render:Iye}),$ye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Nye(e,t){return y(),M("svg",$ye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const Fye=kt({name:"ri-flashlight-line",render:Nye}),Rye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Oye(e,t){return y(),M("svg",Rye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const Pye=kt({name:"ri-folder-fill",render:Oye}),Dye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bye(e,t){return y(),M("svg",Dye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const Hye=kt({name:"ri-git-fork-line",render:Bye}),zye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Wye(e,t){return y(),M("svg",zye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const Uye=kt({name:"ri-git-pull-request-line",render:Wye}),jye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Vye(e,t){return y(),M("svg",jye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M2 18h7v2H2zm0-7h9v2H2zm0-7h20v2H2zm18.674 9.025l1.156-.391l1 1.732l-.916.805a4 4 0 0 1 0 1.658l.916.805l-1 1.732l-1.156-.391a4 4 0 0 1-1.435.83L19 21h-2l-.24-1.196a4 4 0 0 1-1.434-.83l-1.156.392l-1-1.732l.916-.805a4 4 0 0 1 0-1.658l-.916-.805l1-1.732l1.156.391c.41-.37.898-.655 1.435-.83L17 11h2l.24 1.196a4 4 0 0 1 1.434.83M18 18a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const qye=kt({name:"ri-list-settings-line",render:Vye}),Kye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Zye(e,t){return y(),M("svg",Kye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M10 2a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H8v2h5V9a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1H8v6h5v-1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1H7a1 1 0 0 1-1-1V8H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm9 16h-4v2h4zm0-8h-4v2h4zM9 4H5v2h4z"},null,-1)])])}const Gye=kt({name:"ri-node-tree",render:Zye}),Yye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xye(e,t){return y(),M("svg",Yye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m13.827 1.69l8.486 8.485l-1.415 1.414l-.707-.707l-4.242 4.243l-.707 3.536l-1.415 1.414l-4.242-4.243l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.243-4.243l1.414-1.414l3.536-.707l4.242-4.243l-.707-.707zm.707 3.536l-4.67 4.67l-2.822.565l6.5 6.5l.564-2.822l4.671-4.67z"},null,-1)])])}const Jye=kt({name:"ri-pushpin-line",render:Xye}),Qye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e5e(e,t){return y(),M("svg",Qye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const t5e=kt({name:"ri-sort-desc",render:e5e}),n5e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function o5e(e,t){return y(),M("svg",n5e,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const s5e=kt({name:"ri-star-fill",render:o5e}),i5e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function r5e(e,t){return y(),M("svg",i5e,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const l5e=kt({name:"ri-star-line",render:r5e}),a5e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u5e(e,t){return y(),M("svg",a5e,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const c5e=kt({name:"ri-tools-line",render:u5e}),d5e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function f5e(e,t){return y(),M("svg",d5e,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m20.97 17.172l-1.414 1.414l-3.535-3.535l-.073.074l-.707 3.536l-1.415 1.414l-4.242-4.243l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.243-4.243L5.34 8.761l3.536-.707l.073-.074l-3.536-3.536L6.828 3.03zM10.365 9.394l-.502.502l-2.822.565l6.5 6.5l.564-2.822l.502-.502zm8.411.074l-1.34 1.34l1.414 1.415l1.34-1.34l.707.707l1.415-1.415l-8.486-8.485l-1.414 1.414l.707.707l-1.34 1.34l1.414 1.415l1.34-1.34z"},null,-1)])])}const p5e=kt({name:"ri-unpin-line",render:f5e}),h5e=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
331
+ `):null,He=se===1&&Ce>=0&&J.slice(Ce+1).every(ut=>ut.role!=="user"),vt=He?e.sessions.find(ut=>ut.id===xe):void 0;if(He&&(e.messagesBySession={...e.messagesBySession,[xe]:J.slice(0,Ce)},vt!==void 0)){const ut={...vt};delete ut.lastTurnReason,f(ut)}try{return await _t().undoSession(xe,se),await g(xe),{text:$e}}catch(ut){return He&&(e.messagesBySession={...e.messagesBySession,[xe]:J},vt!==void 0&&f(vt),await g(xe).catch(()=>{})),l("undo",ut,{sessionId:xe}),null}}function Xt(se){const xe=e.activeSessionId;if(!xe)return;const J=e.queuedBySession[xe]??[];if(se<0||se>=J.length)return;const Ce=[...J];Ce.splice(se,1),e.queuedBySession={...e.queuedBySession,[xe]:Ce}}function gs(se,xe){const J=e.activeSessionId;if(!J)return;const Ce=e.queuedBySession[J]??[];if(se===xe||se<0||se>=Ce.length||xe<0||xe>=Ce.length)return;const $e=[...Ce],[He]=$e.splice(se,1);He!==void 0&&($e.splice(xe,0,He),e.queuedBySession={...e.queuedBySession,[J]:$e})}async function di(se){const xe=e.activeSessionId;if(!xe)return[];try{return(await _t().listDirectory(xe,{path:se,includeGitStatus:!0})).items}catch{return[]}}async function Ei(se){const xe=e.activeSessionId;if(!xe)return null;try{const Ce=await _t().readFile(xe,{path:se});return{path:Ce.path,content:Ce.content,encoding:Ce.encoding,mime:Ce.mime,languageId:Ce.languageId,isBinary:Ce.isBinary,size:Ce.size,lineCount:Ce.lineCount}}catch(J){if(gl("[kimi-web] readFileContent failed for",se,J),Us(J)&&J.code===Ghe)throw J;return null}}async function ao(se){return _t().readHostFileContent(se)}const Gi=10485760;function Er(se){const xe=e.activeSessionId;return xe?_t().getFileDownloadUrl(xe,se):null}async function fi(se,xe){const J=e.activeSessionId;if(!J)return!1;try{return await _t().openFile(J,{path:se,line:xe}),!0}catch(Ce){return l("openFile",Ce,{sessionId:J}),!1}}async function Ll(se){const xe=e.activeSessionId;if(!xe)return;const J=$.value.cwd||".";try{await _t().openInApp(xe,se,J)}catch(Ce){l("openInApp",Ce,{sessionId:xe})}}async function zo(se){const xe=e.activeSessionId;if(!xe)return!1;try{return await _t().revealFile(xe,{path:se}),!0}catch(J){return l("revealFile",J,{sessionId:xe}),!1}}function Ir(se){return se.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(se)||se.startsWith("\\\\")}async function Qs(se){if(/^(https?:|data:|blob:)/i.test(se))return se;const xe=e.activeSessionId;if(!xe)return se;let J=se;if(Ir(J)){const Ce=e.sessions.find(He=>He.id===xe)?.cwd,$e=Ce?h2(J,Ce):null;if($e)J=$e;else try{const He=await ao(J);return!He.isBinary||He.encoding!=="base64"?se:`data:${He.mime};base64,${He.content}`}catch{return se}}try{const $e=await _t().readFile(xe,{path:J,length:Gi});return!$e.isBinary||$e.encoding!=="base64"||$e.truncated?se:`data:${$e.mime};base64,${$e.content}`}catch{return se}}async function pi(se){const xe=e.sessions.find(Ce=>Ce.id===e.activeSessionId),J=xe===void 0?e.activeWorkspaceId:B(xe);if(!J)return[];try{return(await _t().searchFiles(J,{query:se,limit:20})).items.map(He=>({path:He.path,name:He.name}))}catch{return[]}}return{loadFileDiff:we,clearFileDiff:ge,loadGitStatus:Q,checkAuth:Se,probeManagedMembership:ue,loadConfig:_e,updateConfig:Ee,listAllSessionsGlobal:Oe,load:gt,refreshServerMeta:Lt,loadWorkspaces:wn,loadMoreSessions:Yt,loadAllSessions:Ue,ensureFlatSessions:Mn,loadMoreFlatSessions:We,selectWorkspace:go,openWorkspace:qt,upsertWorkspacePreserveOrder:ps,applyWorkspaceEvent:xs,clearActiveSession:_n,openWorkspaceDraft:In,startSessionAndSendPrompt:lo,startSessionAndActivateSkill:St,startSessionAndOpenSideChat:hs,addWorkspaceByPath:Jo,browseFs:uo,getFsHome:Ys,writeSessionUrl:Nn,fetchSessionIntoList:no,onSessionRoutePopState:Xs,bindSessionRoute:Oo,selectSession:vo,submitPromptInternal:Po,finishPromptLocal:Ct,localTurnStartState:sme,isLocalTurnSnapshotCurrent:rme,afterLocalTurnStartsSettle:lme,handleSessionSnapshot:Qt,sendPrompt:co,steerPrompt:Tn,uploadImage:fo,enqueue:Qe,unqueue:Xt,reorderQueue:gs,abortCurrentPrompt:kn,respondApproval:bo,respondQuestion:Ns,dismissQuestion:Do,pendingQuestionActions:Hu,pendingApprovalActions:Lh,cancelTask:Io,setPlanMode:Qo,togglePlanMode:sn,setSwarmMode:es,toggleSwarmMode:ms,setGoalMode:Tr,toggleGoalMode:ts,createGoal:Ki,controlGoal:Js,setPermission:Bo,dismissWarning:Zo,renameSession:Il,renameWorkspace:Zi,deleteWorkspace:tl,archiveSession:Ho,exportSession:Co,restoreSession:Fs,loadArchivedSessions:Rs,logout:yo,compact:ht,forkSession:Le,undo:Ze,listDir:di,readFileContent:Ei,readHostFileContent:ao,getFileDownloadUrl:Er,openWorkspaceFile:fi,openInApp:Ll,revealWorkspaceFile:zo,resolveImageUrl:Qs,searchFiles:pi,loadOlderMessages:Y,refreshSessionSidecars:fe,isStartingFirstPrompt:()=>cl.size>0}}const tN=cn.starredModels,Bx=new Error("profile persist failed");function ume(){try{const e=ui(tN);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function cme(e){try{Ls(tN,JSON.stringify(e))}catch{}}function dme(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,updateSession:r,updateSessionMessages:l,loadConfig:a,checkAuth:u}=t,c=Z([]),d=Z(ume()),f=Z({}),h=Z({}),m=Z([]),v=Z(null);function k(pe){if(!(pe==null||pe.length===0))return c.value.find(ve=>ve.id===pe)??c.value.find(ve=>ve.model===pe)}function w(){const pe=e.activeSessionId?e.sessions.find(oe=>oe.id===e.activeSessionId):void 0,ve=pe===void 0?v.value??e.defaultModel:pe.model||e.defaultModel;return k(ve)?.id??ve??void 0}function b(pe){if(pe===void 0)return;const ve=k(pe);return ve===void 0?void 0:bp(ve)}function _(pe,ve){const oe=pe==null?void 0:e.thinkingBySession[pe];return oe!==void 0&&gJ(ve,oe)?oe:bp(ve)}function g(pe,ve){if(ve===void 0)return;const oe=k(ve);return oe===void 0?void 0:_(pe,oe)}async function x(pe,ve){return pe!=null&&e.thinkingBySession[pe]===void 0&&await o(pe),g(pe,ve)}function S(pe){e.thinking=pe;const ve=e.activeSessionId;return pe!==void 0&&ve!==null&&ve!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ve]:pe},k3(e,ve)),pe}Je([()=>e.activeSessionId,()=>w(),()=>{const pe=e.activeSessionId;return pe==null?void 0:e.thinkingBySession[pe]}],()=>{const pe=k(w());pe!==void 0&&(e.thinking=_(e.activeSessionId,pe))});function T(pe){_t().setConfig({thinking:vJ(pe,k(w())?.supportEfforts)}).catch(ve=>n("setConfig",ve))}async function A(pe){try{const oe=await _t().listSkills(pe);f.value={...f.value,[pe]:oe}}catch{}}async function E(pe){try{const oe=await _t().listSkillsForWorkspace(pe);h.value={...h.value,[pe]:oe}}catch{}}async function P(){try{const pe=_t();c.value=await pe.listModels();const ve=k(w());ve!==void 0&&(e.thinking=_(e.activeSessionId,ve))}catch(pe){n("loadModels",pe)}}async function D(){try{const pe=_t();m.value=await pe.listProviders()}catch(pe){n("loadProviders",pe)}}async function I(pe){const ve=e.activeSessionId,oe=k(pe),ye=e.thinking,G=ve?e.sessions.find(ge=>ge.id===ve)?.model:void 0,Y=w()!==(oe?.id??pe),fe=yJ(oe,ye,Y);if(!ve)return v.value=pe,e.thinking=fe,fe!==ye&&fe!==void 0&&T(fe),!0;r(ve,ge=>({...ge,model:pe}));let we;fe!==ye&&(e.thinking=fe,fe!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ve]:fe},we=k3(e,ve)));try{await _t().updateSession(ve,{model:pe,thinking:fe!==ye?fe:void 0})}catch(ge){return r(ve,Q=>({...Q,model:G??Q.model})),fe!==ye&&(e.thinking=ye,ye!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ve]:ye}),vl(e,ve,we)&&o(ve)),n("setModel",ge,{sessionId:ve}),!1}return fe!==ye&&fe!==void 0&&T(fe),vl(e,ve,we),await o(ve),!0}function $(pe){const ve=new Set(d.value);ve.has(pe)?ve.delete(pe):ve.add(pe),d.value=Array.from(ve),cme(d.value)}async function B(pe,ve,oe,ye,G){const Y=ye??e.activeSessionId;if(!Y)return;const fe=i.value==="idle"&&!e.inFlightBySession[Y],we=`msg_skill_opt_${Date.now().toString(36)}`,ge=fe?y8(Y):void 0;if(fe){e.inFlightBySession={...e.inFlightBySession,[Y]:!0};const Q={id:we,sessionId:Y,role:"user",content:[{type:"text",text:`/${pe}${ve?` ${ve}`:""}`},...m8(oe)],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:pe,skillArgs:ve}}};l(Y,te=>[...te,Q])}try{if(G?.skipThinkingPersist!==!0){const Q=e.sessions.find(ue=>ue.id===Y)?.model,te=(Q&&Q.length>0?Q:e.defaultModel)??void 0;if(!await s({thinking:await x(Y,te)??e.thinking},Y))throw Bx}await _t().activateSkill(Y,pe,ve,m8(oe))}catch(Q){fe&&(e.inFlightBySession={...e.inFlightBySession,[Y]:!1},l(Y,te=>te.filter(ce=>ce.id!==we))),Q!==Bx&&n("activateSkill",Q,{sessionId:Y})}finally{ge!==void 0&&k8(Y,ge)}}async function H(pe){return _t().getProvider(pe)}async function O(pe){try{return await _t().addProvider(pe),await Promise.all([D(),P(),a()]),await u(),null}catch(ve){return Xl("[kimi-web] operation failed: addProvider",ve),ve instanceof Error?ve.message:String(ve)}}async function F(pe,ve){try{return await _t().updateProvider(pe,ve),await Promise.all([D(),P(),a()]),null}catch(oe){return Xl("[kimi-web] operation failed: updateProvider",oe),oe instanceof Error?oe.message:String(oe)}}async function U(pe){try{const oe=await _t().deleteProvider(pe);return await Promise.all([D(),P(),a()]),await u(),oe}catch(ve){return n("deleteProvider",ve),null}}async function z(pe){try{const ve=await _t().refreshProvider(pe);for(const oe of ve.failed)n("refreshProvider",new Error(oe.reason),{message:oe.provider});await Promise.all([D(),P(),a()])}catch(ve){n("refreshProvider",ve)}}async function W(){try{const pe=await _t().refreshAllProviders();for(const ve of pe.failed)n("refreshAllProviders",new Error(ve.reason),{message:ve.provider});await Promise.all([D(),P(),a()])}catch(pe){n("refreshAllProviders",pe)}}async function K(){try{return{kind:"ok",items:await _t().listCatalogProviders()}}catch(pe){return pe instanceof wd&&pe.code===void 0?{kind:"unsupported"}:(Xl("[kimi-web] operation failed: loadCatalogProviders",pe),{kind:"error"})}}async function V(pe){try{return await _t().importCatalogProvider(pe),await Promise.all([D(),P(),a()]),await u(),null}catch(ve){return Xl("[kimi-web] operation failed: importCatalogProvider",ve),ve instanceof Error?ve.message:String(ve)}}async function ie(pe){try{const oe=await _t().importCustomRegistry(pe);return await Promise.all([D(),P(),a()]),await u(),oe}catch(ve){return Xl("[kimi-web] operation failed: importCustomRegistry",ve),ve instanceof Error?ve.message:String(ve)}}async function ne(){try{return await _t().startOAuthLogin()}catch{return null}}async function X(){try{return await _t().pollOAuthLogin()}catch(pe){return gl("[kimi-web] pollOAuthLogin failed",pe),null}}async function le(){try{await _t().cancelOAuthLogin()}catch{}}async function Ie(){try{return await _t().getUsage()}catch(pe){return{kind:"error",message:pe instanceof Error?pe.message:String(pe)}}}function de(pe){const ve=S(pe);s({thinking:ve}),ve!==void 0&&T(ve)}return{models:c,starredModelIds:d,providers:m,draftModel:v,skillsBySession:f,skillsByWorkspace:h,loadSkillsForSession:A,loadSkillsForWorkspace:E,loadModels:P,loadProviders:D,setModel:I,thinkingLevelForModelId:b,thinkingLevelForSessionId:g,resolveThinkingForPrompt:x,toggleStarModel:$,activateSkill:B,addProvider:O,updateProvider:F,deleteProvider:U,getProvider:H,loadCatalogProviders:K,importCatalogProvider:V,importCustomRegistry:ie,refreshProvider:z,refreshAllProviders:W,startOAuthLogin:ne,pollOAuthLogin:X,cancelOAuthLogin:le,getUsage:Ie,setThinking:de}}function fme(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i,resolveThinkingForPrompt:r,refreshSessionStatus:l}=t,a=Z({}),u=R(()=>{const O=e.activeSessionId;if(!O)return null;const F=a.value[O];return F?{parentId:O,agentId:F.agentId}:null}),c=R(()=>u.value?.parentId??null),d=R(()=>u.value!==null),f=R(()=>{const O=u.value;return O?!!e.sideChatSendingByAgent[O.agentId]:!1}),h=R(()=>{const O=u.value;return O?e.sideChatSendingByAgent[O.agentId]?!0:(e.tasksBySession[O.parentId]??[]).some(F=>F.id===O.agentId&&F.status==="running"):!1}),m=O=>_t().getFileUrl(O),v=[],k=KT(),w=R(()=>{const O=u.value;return O?k({messages:e.sideChatMessagesByAgent[O.agentId]??[],approvals:v,getFileUrl:m,sessionActive:h.value}):[]});function b(O,F){e.sideChatMessagesByAgent[O]=F(e.sideChatMessagesByAgent[O]??[])}function _(O,F){b(O,U=>[...U,F])}function g(O,F){b(O,U=>{const z=U.find(W=>W.id===F);return z?.promptId!==void 0||z?.userMessageId!==void 0?U:U.filter(W=>W.id!==F)})}function x(O,F){const U=e.sideChatUserMessageIdsBySession[O]??[];U.includes(F)||(e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[O]:[...U,F]})}function S(O,F,U,z){b(O,W=>{const K=W.findIndex(X=>X.id===F);if(K===-1)return W;const V=W.findIndex((X,le)=>le!==K&&X.role==="user"&&(X.id===z||X.userMessageId===z||X.promptId===U)),ie=W[K],ne=V===-1?ie:W[V];return W.flatMap((X,le)=>le===V?[]:le!==K?[X]:[{...ne,id:ie.id,promptId:U,userMessageId:z,metadata:{...ne.metadata,...ie.metadata}}])})}function T(O,F){x(F.sessionId,F.userMessageId??F.id),b(O,U=>{const z=U.findIndex(V=>V.role==="user"&&(V.userMessageId===(F.userMessageId??F.id)||V.promptId!==void 0&&V.promptId===F.promptId));if(z===-1)return[...U,F];const W=U[z],K=[...U];return K[z]={...F,id:W.id,promptId:F.promptId??W.promptId,userMessageId:F.userMessageId??F.id,metadata:{...F.metadata,...W.metadata}},K})}function A(O,F,U){U&&b(O,z=>{const W=z.at(-1);if(W?.role==="assistant"){const K=W.content[0],V=K?.type==="text"?K.text:"";return[...z.slice(0,-1),{...W,content:[{type:"text",text:`${V}${U}`}]}]}return[...z,{id:o(),sessionId:F,role:"assistant",content:[{type:"text",text:U}],createdAt:new Date().toISOString()}]})}function E(O,F,U){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[O]:!1},!U)return;const W=(e.sideChatMessagesByAgent[O]??[]).at(-1);(W?.role==="assistant"&&W.content[0]?.type==="text"?W.content[0].text:"").trim().length>0||A(O,F,U)}async function P(O){const F=e.activeSessionId;F&&await D(F,O)}async function D(O,F){if(!a.value[O]){let U;try{({agentId:U}=await _t().startBtw(O))}catch(z){n("openSideChat",z,{sessionId:O});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[U]:e.sideChatMessagesByAgent[U]??[]},a.value={...a.value,[O]:{agentId:U}},s(),i()?.markSideChannelAgent(O,U)}F&&F.trim()&&await I(O,F.trim())}async function I(O,F){const U=a.value[O],z=F.trim();if(!U||!z)return;const W=O,K=U.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[K]:!0};const V=o(),ie={id:V,sessionId:W,role:"user",content:[{type:"text",text:z}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};_(K,ie);let ne;try{const X=e.sessions.find(pe=>pe.id===W),le=(X?.model&&X.model.length>0?X.model:e.defaultModel)??void 0,Ie=await r(W,le)??e.thinking;ne=e.pendingThinkingBySession[W];const de=await _t().submitPrompt(W,{content:[{type:"text",text:z}],agentId:K,model:le,thinking:Ie,permissionMode:e.permission,planMode:e.planModeBySession[W]??!1,swarmMode:e.swarmModeBySession[W]??!1});Ie!==void 0&&vl(e,W,ne),S(K,V,de.promptId,de.userMessageId),x(W,de.userMessageId)}catch(X){vl(e,W,ne)&&l(W),n("sendSideChatPrompt",X,{sessionId:W}),g(K,V),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[K]:!1}}}function $(){const O=e.activeSessionId;if(!O)return;const{[O]:F,...U}=a.value;a.value=U}async function B(O){const F=u.value;F&&await I(F.parentId,O)}function H(O){if(!a.value[O])return;const{[O]:F,...U}=a.value;a.value=U}return{sideChatTargetBySession:a,sideChatSessionId:c,sideChatVisible:d,sideChatSending:f,sideChatRunning:h,sideChatTurns:w,appendSideChatAssistantText:A,finishSideChatAgent:E,reconcileSideChatUserMessage:T,openSideChat:P,openSideChatOn:D,closeSideChat:$,sendSideChatPrompt:B,clearSideChatForSession:H}}class pme{transcript;sessionId;agentId;fetchPage;pageSize;onChange;onGap;refreshPromise=null;buffered=[];agents_=[];seq_;loadingOlder_=!1;loadOlderError_=!1;refreshError_=!1;constructor(t){this.sessionId=t.sessionId,this.agentId=t.agentId,this.transcript=new tj(t.agentId),this.fetchPage=t.fetchPage,this.pageSize=t.pageSize??20,this.onChange=t.onChange,this.onGap=t.onGap}get snapshot(){return this.transcript.snapshot()}get seq(){return this.seq_}get agents(){return this.agents_}get loading(){return this.refreshPromise!==null}get loadingOlder(){return this.loadingOlder_}get loadOlderError(){return this.loadOlderError_}get refreshError(){return this.refreshError_}refresh(){if(this.refreshPromise!==null)return this.refreshPromise;this.refreshError_=!1;const t=this.fetchPage({pageSize:this.pageSize}).then(n=>this.applyPage(n,!0)).catch(n=>{throw this.refreshError_=!0,n}).finally(()=>{this.refreshPromise=null;const n=this.buffered;this.buffered=[];for(const o of n)this.applyOps(o.ops,o.seq);this.onChange?.()});return this.refreshPromise=t,this.onChange?.(),t}receiveReset(t,n){this.transcript.receive([{op:"reset",agentId:this.agentId,snapshot:t}]),n!==void 0&&(this.seq_=n),this.refreshError_=!1,this.onChange?.()}applyOps(t,n){if(this.refreshPromise!==null||this.loadingOlder_)return this.buffered.push({ops:t,...n!==void 0?{seq:n}:{}}),!1;if(n!==void 0&&this.seq_!==void 0){if(n<=this.seq_)return!0;if(n!==this.seq_+1)return this.onGap?.(),!1}const o=this.transcript.apply(t);return n!==void 0&&(this.seq_=n),o.gap!==void 0&&this.onGap?.(),o.accepted.length>0&&this.onChange?.(),o.gap===void 0}async loadOlder(){if(!this.snapshot.hasMoreOlder||this.loadingOlder_)return;const t=this.snapshot.items.find(n=>n.kind==="turn");if(t?.kind==="turn"){this.loadingOlder_=!0,this.loadOlderError_=!1,this.onChange?.();try{const n=await this.fetchPage({beforeTurn:t.turnId,pageSize:this.pageSize});this.applyPage(n,!1)}catch(n){throw this.loadOlderError_=!0,n}finally{this.loadingOlder_=!1;const n=this.buffered;this.buffered=[];for(const o of n)this.applyOps(o.ops,o.seq);this.onChange?.()}}}applyPage(t,n){this.agents_=t.agents;const o=this.snapshot,s=n?t:{...t,items:hme(t.items,o.items),hasMoreOlder:t.hasMoreOlder};this.receiveReset(s,n?t.seq:void 0)}}function hme(e,t){const n=new Set,o=[];for(const s of[...e,...t]){const i=s.kind==="turn"?s.turnId:s.kind==="marker"?s.markerId:s.refId;n.has(i)||(n.add(i),o.push(s))}return o}function mme(e){const t=qS(new Map),n=new Map,o=new Map,s=new Set;let i=null,r=null;function l(){i!==null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(i),i=null),r!==null&&(clearTimeout(r),r=null);for(const _ of s)_.version.value+=1;s.clear()}function a(_){s.add(_),!(i!==null||r!==null)&&(typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(l)),r=setTimeout(l,50))}function u(_,g){return`${_}\0${g}`}function c(_,g,x){const S=e.getEventConnection();S!==null&&(S.subscribeTranscript(_,g,x),o.set(_,g))}function d(_,g){const x=u(_,g),S=t.get(x);if(S!==void 0)return S;const T={channel:new pme({sessionId:_,agentId:g,fetchPage:A=>e.api.getSessionTranscript(_,{...A,agentId:g}),onChange:()=>{a(T)},onGap:()=>{f(T)}}),version:Z(0),baselineLoaded:!1,resumePromise:null};return t.set(x,T),T}async function f(_){if(_.resumePromise!==null)return _.resumePromise;const g=h(_).finally(()=>{_.resumePromise===g&&(_.resumePromise=null)});return _.resumePromise=g,g}async function h(_){try{await _.channel.refresh(),_.baselineLoaded=!0,n.get(_.channel.sessionId)===_.channel.agentId&&c(_.channel.sessionId,_.channel.agentId,_.channel.seq)}catch{n.get(_.channel.sessionId)===_.channel.agentId&&c(_.channel.sessionId,_.channel.agentId)}}function m(_,g){e.connectEventsIfNeeded(),n.set(_,g);const x=d(_,g);return x.baselineLoaded?c(_,g,x.channel.seq):f(x),x}function v(_,g){if(n.get(_)!==g)return;n.delete(_);const x=o.get(_);x!==void 0&&(e.getEventConnection()?.unsubscribeTranscript(_,[x]),o.delete(_))}function k(_,g,x,S){if(n.get(_)!==g)return;const T=d(_,g);T.channel.receiveReset(x,S),T.baselineLoaded=!0}function w(_,g,x,S){return n.get(_)!==g?!0:d(_,g).channel.applyOps(x,S)}function b(_){n.delete(_),o.delete(_)&&e.getEventConnection()?.unsubscribeTranscript(_);for(const[g,x]of t)x.channel.sessionId===_&&(t.delete(g),s.delete(x))}return{getEntry:(_,g)=>t.get(u(_,g)),activate:m,deactivate:v,receiveReset:k,applyOps:w,forgetSession:b}}const $h=XT(),Da=phe(),nN=cn.permission,oN=cn.activeWorkspace,sN=cn.planMode,iN=cn.swarmMode,rN=cn.goalMode,Hx=40401,Ag=cn.onboarded;ur(cn.codeFont);ur(cn.accent);ur(cn.theme);ur(cn.thinking);ur(cn.notifyOnComplete);ur(cn.notifyOnQuestion);ur(cn.notifyOnApproval);ur(cn.soundOnComplete);function gme(){try{const e=ui(nN);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function vme(e){try{Ls(nN,e)}catch{}}function b4(e){const t=ui(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,i]of Object.entries(n))i===!0&&(o[s]=!0);return o}catch{return{}}}function P5(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);Ls(e,JSON.stringify(n))}catch{}}function lN(){P5(sN,Me.planModeBySession)}function aN(){P5(iN,Me.swarmModeBySession)}function uN(){P5(rN,Me.goalModeBySession)}function yme(){try{return ui(oN)}catch{return null}}const cN=cn.hiddenWorkspaces;function kme(){try{const e=ui(cN);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function bme(e){try{Ls(cN,JSON.stringify(e))}catch{}}function Cme(e){try{Ls(oN,e)}catch{}}function wme(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Me=Go({...oY(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",experimentalFlags:{},workspaceName:"kimi-web",connection:"disconnected",permission:gme(),thinking:void 0,thinkingBySession:{},pendingThinkingBySession:{},planModeBySession:b4(sN),swarmModeBySession:b4(iN),goalModeBySession:b4(rN),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:Ey(),authReady:!1,defaultModel:null,managedProviderStatus:null,managedUserInfo:null,managedMembership:null,workspaces:[],activeWorkspaceId:yme(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:kme(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1,flatSessionsNextPageToken:null,flatSessionsHasMore:!0,flatSessionsLoading:!1,flatSessionsLoadingMore:!1,flatSessionsSeeded:!1,flatSessionsFrontier:null}),Mg=Go({}),np=new Map,If=new Map;function _me(e,t){return`${e}\0${t??"*"}`}async function b8(e,t){const n=_me(e,t),o=(np.get(n)??0)+1;np.set(n,o),t!==void 0&&If.set(e,(If.get(e)??0)+1);const s=If.get(e)??0;try{const i=await _t().getSessionPlans(e,{agentId:"main",toolCallId:t});if(np.get(n)!==o||t===void 0&&(If.get(e)??0)!==s||!Me.sessions.some(l=>l.id===e))return;const r=Object.fromEntries(i.map(l=>[l.toolCallId,l]));Mg[e]=t===void 0?r:{...Mg[e],...r}}catch(i){gl("[refreshSessionPlans] plan history unavailable for",e,i)}}function xme(e){const t=`${e}\0`;for(const n of np.keys())n.startsWith(t)&&np.delete(n);If.delete(e),delete Mg[e]}const F2=Go({planMode:!1,swarmMode:!1,goalMode:!1});function D5(e){Me.sessions=e}function R2(e,t){Me.sessions=Me.sessions.map(n=>n.id===e?t(n):n)}function Sme(e){Me.sessions=[e,...Me.sessions.filter(t=>t.id!==e.id)]}function Ame(e){Me.sessions=[...Me.sessions,e]}function Mme(e){Me.sessions=Me.sessions.filter(t=>t.id!==e)}function dN(){const e=Me.activeSessionId;e&&Me.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Me.unreadBySession[e]=!1,Iy({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===cn.unread&&(Me.unreadBySession=Ey(),dN())});function C8(){if(rr===null||!rr.health().stale)return;bi("ws:stale-reconnect",{sessionId:Me.activeSessionId,status:"stale"}),D0e("ws: stale socket on focus, reconnecting",{activeSessionId:Me.activeSessionId}),rr.reconnect();const e=Me.activeSessionId;e&&Lg.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(dN(),C8())});typeof window<"u"&&(window.addEventListener("focus",C8),window.addEventListener("online",C8));function B5(e){Me.activeSessionId=e}function Tme(e){Ni(Me.messagesBySession,e)}function Eme(e,t){Me.messagesBySession[e]=t}function fN(e,t){Me.messagesBySession[e]=t(Me.messagesBySession[e]??[])}function Ime(e){delete Me.messagesBySession[e]}function pN(e){rr?.unsubscribe(e),Tg.forgetSession(e),ege(e),Gd.discard(({meta:t})=>t.sessionId===e),Mme(e),Ime(e),xme(e),delete Me.approvalsBySession[e],delete Me.questionsBySession[e],delete Me.tasksBySession[e],delete Me.goalBySession[e],delete Me.gitStatusBySession[e],delete Me.lastSeqBySession[e],delete Me.compactionBySession[e],delete Me.messagesLoadingMoreBySession[e],delete Me.messagesHasMoreBySession[e],delete Me.messagesLoadMoreErrorBySession[e],delete w8[e],Ig.delete(e),um.delete(e),MN.delete(e),ime(e),delete Me.queuedBySession[e],delete Me.promptIdBySession[e],delete Me.inFlightBySession[e],delete Me.turnActiveBySession[e],delete Me.turnEndedPromptIdBySession[e],delete Me.turnErrorBySession[e],delete Me.turnRetryBySession[e],delete Me.planModeBySession[e],delete Me.swarmModeBySession[e],delete Me.goalModeBySession[e],delete Me.thinkingBySession[e],delete Me.pendingThinkingBySession[e],lN(),aN(),uN(),Yo.value.includes(e)&&(Yo.value=uE(Yo.value,e),k1(Yo.value))}const hN=Z(null),mN=Z([]),gN=Z(!1),vN=Z(null),yN=Z(!1),kN=Z(!1),bN=Z(null);async function _c(e){let t;try{t=await _t().getSessionStatus(e)}catch{return}R2(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Me.swarmModeBySession[e]=t.swarmMode,Me.planModeBySession[e]=t.planMode,t.thinkingEffort.length>0&&rE(Me,e,t.thinkingEffort)}async function Lme(e){const t=Me.goalVersionBySession[e]??0;let n;try{n=await _t().getSessionGoal(e)}catch{return}(Me.goalVersionBySession[e]??0)===t&&(n===null||n.status==="complete"?delete Me.goalBySession[e]:Me.goalBySession[e]=n)}function CN(e,t){const n=t??Me.activeSessionId;if(!n)return Promise.resolve(!1);const o=e.thinking!==void 0?Me.pendingThinkingBySession[n]:void 0;return Promise.resolve(_t().updateSession(n,e)).then(()=>(vl(Me,n,o),_c(n))).then(()=>!0).catch(s=>(vl(Me,n,o)&&_c(n),t0("persistSessionProfile",s,{sessionId:n}),!1))}function wN(e){try{return ui(e)??""}catch{return""}}function $me(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("kimi_onboarded")==="1"}const _N=$me();if(_N&&wN(Ag)!=="1")try{Ls(Ag,"1")}catch{}const xN=Z(_N||wN(Ag)==="1");function Nme(e){xN.value=e;try{Ls(Ag,e?"1":"0")}catch{}e&&window.kimiDesktop?.setOnboarded?.()}let rr=null;const Tg=mme({api:_t(),connectEventsIfNeeded:H5,getEventConnection:()=>rr});let zx=0;function SN(){return zx+=1,`msg_opt_${Date.now().toString(36)}_${zx}`}function Wx(e,t,n){const o={sessions:Me.sessions,activeSessionId:Me.activeSessionId,messagesBySession:Me.messagesBySession,approvalsBySession:Me.approvalsBySession,planReviewByToolCallId:Me.planReviewByToolCallId,questionsBySession:Me.questionsBySession,tasksBySession:Me.tasksBySession,goalBySession:Me.goalBySession,goalVersionBySession:Me.goalVersionBySession,lastSeqBySession:Me.lastSeqBySession,turnActiveBySession:Me.turnActiveBySession,turnEndedPromptIdBySession:Me.turnEndedPromptIdBySession,turnErrorBySession:Me.turnErrorBySession,turnRetryBySession:Me.turnRetryBySession,compactionBySession:Me.compactionBySession,config:Me.config,warnings:Me.warnings},s=fY(o,e,{sessionId:t,seq:n},{t:(i,r)=>r===void 0?Hn.global.t(i):Hn.global.t(i,r)});s.sessions!==o.sessions&&D5(s.sessions),s.activeSessionId!==o.activeSessionId&&B5(s.activeSessionId),Tme(s.messagesBySession),Ni(Me.approvalsBySession,s.approvalsBySession),Ni(Me.planReviewByToolCallId,s.planReviewByToolCallId),Ni(Me.questionsBySession,s.questionsBySession),Ni(Me.tasksBySession,s.tasksBySession),Ni(Me.goalBySession,s.goalBySession),Ni(Me.goalVersionBySession,s.goalVersionBySession),Ni(Me.lastSeqBySession,s.lastSeqBySession),Ni(Me.turnActiveBySession,s.turnActiveBySession),Ni(Me.turnEndedPromptIdBySession,s.turnEndedPromptIdBySession),Ni(Me.turnErrorBySession,s.turnErrorBySession),Ni(Me.turnRetryBySession,s.turnRetryBySession),Ni(Me.compactionBySession,s.compactionBySession),s.config!==o.config&&(Me.config=s.config??null),pY(s.warnings,o.warnings)||(Me.warnings=s.warnings),e.type==="configChanged"&&(Me.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Rn.loadModels(),Rn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Me.swarmModeBySession[e.sessionId]=e.swarmMode),e.planMode!==void 0&&(Me.planModeBySession[e.sessionId]=e.planMode),e.thinking!==void 0&&rE(Me,e.sessionId,e.thinking)),e.type==="sessionDeleted"&&V5(e.sessionId)}function Fme(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="user")return;if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type==="toolUse"&&s.toolName==="ExitPlanMode")return s.toolCallId}}}function Rme(e,t){const n=Me.lastSeqBySession[t.sessionId]??0,o=Me.turnActiveBySession[t.sessionId]??!1,s=e.type==="approvalResolved"||e.type==="approvalExpired"?Me.approvalsBySession[t.sessionId]?.find(r=>r.approvalId===e.approvalId&&r.toolName==="ExitPlanMode")?.toolCallId:void 0,i=si.sideChatTargetBySession.value[t.sessionId];if(e.type==="messageCreated"&&e.message.role==="user"&&e.agentId!==void 0&&Object.prototype.hasOwnProperty.call(Me.sideChatMessagesByAgent,e.agentId)){Wx({type:"unknown",raw:{_noop:!0}},t.sessionId,t.seq),si.reconcileSideChatUserMessage(e.agentId,e.message);return}if(Wx(e,t.sessionId,t.seq),i){const{agentId:r}=i,l=t.sessionId;e.type==="agentDelta"&&e.agentId===r?e.delta.text&&si.appendSideChatAssistantText(r,l,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===r?si.finishSideChatAgent(r,l):e.type==="taskProgress"&&e.taskId===r?si.appendSideChatAssistantText(r,l,e.outputChunk):e.type==="taskCompleted"&&e.taskId===r&&si.finishSideChatAgent(r,l,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const r=e.message.sessionId;Me.promptIdBySession[r]!==e.message.promptId&&(Me.promptIdBySession[r]=e.message.promptId)}if(e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const r=e.reason;y2e(e.sessionId,r==="cancelled"||r==="failed"||r==="blocked"?"aborted":"idle",o);const l=Fme(Me.messagesBySession[e.sessionId]??[]);l!==void 0&&b8(e.sessionId,l)}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&o||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&v2e(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&Me.promptIdBySession[e.sessionId]===e.promptId&&At.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&k2e(e.sessionId,e.question),e.type==="approvalRequested"&&b2e(e.sessionId,e.approval),s!==void 0&&b8(t.sessionId,s)}const Gd=gX(({appEvent:e,meta:t})=>Rme(e,t),({appEvent:e})=>fX(e),{coalesce:yX}),Ome=3e4;let Ux=0,oi=null;const op=new Map;let Eg=0,Yd=null;function Pme(){Yd!==null&&(clearTimeout(Yd),Yd=null)}function jx(e){if(!Me.connected||Yd!==null)return;const t=Math.min(Ome,1e3*2**Eg);Eg+=1,gl("[kimi-web] session work reconciliation incomplete; retrying",e),Yd=setTimeout(()=>{Yd=null,Me.connected&&AN()},t)}function Dme(e,t){const n=new Map(e.map(u=>[u.id,u]));let o=!1,s=!1;const i={...Me.turnActiveBySession},r=[],l=new Map,a=Me.sessions.map(u=>{const c=n.get(u.id);if(c===void 0)return u;const d=t.workEventSeqBySession.get(u.id)??0,f=t.turnEventSeqBySession.get(u.id)??0,h=t.pendingEventBySession.get(u.id),m=d>c.lastSeq,v=f>c.lastSeq,k=h!==void 0&&h.seq>c.lastSeq,w=m||v&&u.mainTurnActive===!0?u.busy||u.mainTurnActive===!0:c.busy,b=m||v?u.mainTurnActive:c.mainTurnActive??(w?u.mainTurnActive:!1),_=k?h.source==="work"?u.pendingInteraction:(Me.approvalsBySession[u.id]?.length??0)>0?"approval":(Me.questionsBySession[u.id]?.length??0)>0?"question":"none":c.pendingInteraction??(w?u.pendingInteraction:"none");(k&&h.source==="work"||!k&&(c.pendingInteraction!==void 0||c.busy===!1))&&_!==void 0&&l.set(u.id,_);const g=m?u.lastTurnReason:c.lastTurnReason;op.set(u.id,Math.max(op.get(u.id)??0,c.lastSeq));const x=t.turnStartBySession.get(u.id);return(b===!1||b===void 0&&!w)&&t.witnessedTurnBySession.has(u.id)&&x!==void 0&&At.isLocalTurnSnapshotCurrent(u.id,x)&&r.push(u.id),b===!0&&!i[u.id]?(i[u.id]=!0,s=!0):(b===!1||!w)&&i[u.id]&&(delete i[u.id],s=!0),u.busy===w&&u.mainTurnActive===b&&u.pendingInteraction===_&&u.lastTurnReason===g?u:(o=!0,{...u,busy:w,mainTurnActive:b,pendingInteraction:_,lastTurnReason:g})});o&&D5(a),s&&Ni(Me.turnActiveBySession,i);for(const[u,c]of l)c==="none"?(delete Me.approvalsBySession[u],delete Me.questionsBySession[u]):c==="question"&&delete Me.approvalsBySession[u];for(const u of r)At.finishPromptLocal(u,{turnWasActive:!0})}async function AN(){const e={workEventSeqBySession:new Map,turnEventSeqBySession:new Map,pendingEventBySession:new Map,turnStartBySession:new Map(Me.sessions.map(t=>[t.id,At.localTurnStartState(t.id)])),witnessedTurnBySession:new Set(Me.sessions.filter(t=>Me.inFlightBySession[t.id]||Me.turnActiveBySession[t.id]).map(t=>t.id))};oi=e;try{const t=await At.listAllSessionsGlobal({shouldContinue:()=>oi===e&&Me.connected});if(oi!==e||!Me.connected)return;Gd.flush(),Dme(t.sessions,e),oi=null,t.error!==void 0?jx(t.error):Eg=0}catch(t){if(oi!==e||!Me.connected)return;oi=null,jx(t)}}function H5(){if(rr!==null||typeof WebSocket>"u")return;bi("ws:connection",{status:"connecting"}),Me.connection="connecting",rr=_t().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){At.applyWorkspaceEvent(t);return}const o=t.type==="sessionWorkChanged",s=t.type==="turnActiveChanged",i=t.type==="approvalRequested"||t.type==="approvalResolved"||t.type==="approvalExpired"||t.type==="questionRequested"||t.type==="questionAnswered"||t.type==="questionDismissed";if((o||s||i)&&n.seq>0){const r=op.get(n.sessionId)??0;if(n.seq<=r)return;op.set(n.sessionId,n.seq)}if(oi!==null&&(o||s||i))if(o){const r=oi.workEventSeqBySession.get(n.sessionId)??0;if(n.seq>r&&oi.workEventSeqBySession.set(n.sessionId,n.seq),t.pendingInteraction!==void 0||!t.busy){const l=oi.pendingEventBySession.get(n.sessionId);(l===void 0||n.seq>l.seq)&&oi.pendingEventBySession.set(n.sessionId,{seq:n.seq,source:"work"})}}else if(s){const r=oi.turnEventSeqBySession.get(n.sessionId)??0;n.seq>r&&oi.turnEventSeqBySession.set(n.sessionId,n.seq)}else{const r=oi.pendingEventBySession.get(n.sessionId);(r===void 0||n.seq>r.seq)&&oi.pendingEventBySession.set(n.sessionId,{seq:n.seq,source:"interaction"})}for(const r of vX({appEvent:t,meta:n}))Gd(r)},onResync(t,n,o){bi("ws:resync",{sessionId:t,status:"required",seq:n}),Gd.flush(),Ig.add(t),Lg.request(t)},onError(t,n,o){bi("ws:error",{status:"failed",errorCode:t,fatal:o}),O2({severity:"error",title:Hn.global.t("warnings.wsTitle"),message:n,details:[Lo("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){bi("ws:connection",{status:t?"connected":"disconnected"}),Me.connected=t,Me.connection=t?"connected":"disconnected",t||(oi=null,op.clear(),Pme(),Eg=0),t&&(Ux+=1,qme(),At.refreshServerMeta())},onReplayComplete(){Gd.flush(),Ux>1&&AN()},onTranscriptReset(t,n,o,s){Tg.receiveReset(t,n,o,s)},onTranscriptOps(t,n,o,s){return Tg.applyOps(t,n,o,s)}})}const w8={},Ig=new Set,um=new Set,MN=new Set;function Bme(e){return Us(e)&&e.code===Hx?!0:typeof e=="object"&&e!==null&&e.code===Hx}function Lo(e,t){if(!(t==null||t===""))return{label:Hn.global.t(`warnings.details.${e}`),value:TN(t)}}function TN(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Hme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function zme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Wme(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function Ume(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function Vx(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function jme(e,t,n){const o=iy(t),s=Us(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Lo("operation",e),Lo("sessionId",n??Me.activeSessionId),Lo("connection",Me.connection),Lo("timestamp",Ume(i??Date.now()))];return o?l.push(Lo("duration",Vx(r)),Lo("request",`${t.method} ${t.path}`),Lo("endpoint",t.url),Lo("requestId",t.requestId),Lo("phase",t.phase),Lo("timeout",`${t.timeoutMs}ms`),Lo("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Lo("contentType",t.contentType),Lo("responsePreview",t.bodyPreview),Lo("cause",t.cause)):s?l.push(Lo("duration",Vx(r)),Lo("code",t.code),Lo("requestId",t.requestId),Lo("message",t.message),Lo("details",t.details)):l.push(Lo("errorName",Hme(t)),Lo("message",zme(t)??TN(t)),Lo("stack",Wme(t))),l.filter(a=>a!==void 0)}function Vme(e,t,n={}){const o=iy(t),s=Us(t),i=n.title??(o?Hn.global.t("warnings.daemonNetworkTitle"):s?Hn.global.t("warnings.daemonApiTitle"):Hn.global.t("warnings.operationFailedTitle")),r=n.message??(o?Hn.global.t("warnings.daemonNetworkMessage"):s?t.message:Hn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:jme(e,t,n.sessionId)}}function O2(e){Me.warnings=[...Me.warnings,e]}function qme(){const e=Hn.global.t("warnings.wsTitle"),t=Me.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Me.warnings.length&&(Me.warnings=t)}function t0(e,t,n){Xl(`[kimi-web] operation failed: ${e}`,t);const o=Us(t),s=iy(t);bi("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:o?t.code:void 0,requestId:o||s?t.requestId:void 0,phase:s?t.phase:void 0,httpStatus:s?t.status:void 0}),O2(Vme(e,t,n))}const Kme={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function Zme(e){if(!Us(e)||e.code===void 0)return;const t=Kme[e.code];return t?Hn.global.t(t):void 0}async function Gme(e){if(pN(e),Me.activeSessionId!==e)return;const t=Me.sessions[0];t?await At.selectSession(t.id,{urlMode:"replace"}):(B5(void 0),Me.sessionLoading=!1,At.writeSessionUrl(void 0,"replace"))}const qx=new Set;async function Yme(e){if(!qx.has(e)){qx.add(e);try{const t=await _t().getSessionWarnings(e),n=Hn.global.t("warnings.noteLabel");for(const o of t)O2(`${n}: ${o.message}`)}catch{}}}async function z5(e,t){const n=At.localTurnStartState(e);try{const s=await _t().getSessionSnapshot(e);if(!Me.sessions.some(c=>c.id===e))return"ok";Gd.flush();const i=Me.lastSeqBySession[e]??0,r=w8[e],l=Ig.has(e)||$g.has(e);if(!l&&r!==void 0&&r===s.epoch&&i>s.asOfSeq)return um.delete(e)||(um.add(e),Lg.request(e)),"ok";if(!At.isLocalTurnSnapshotCurrent(e,n))return At.afterLocalTurnStartsSettle(e,()=>{Lg.request(e)}),"ok";const a=Me.turnRetryBySession[e];a!==void 0&&a.turnId!==s.inFlightTurn?.turnId&&delete Me.turnRetryBySession[e],(l||s.session.lastTurnReason!=="failed")&&delete Me.turnErrorBySession[e];const u=o3(s.session.usage);R2(e,c=>({...s.session,model:s.session.model&&s.session.model.length>0?s.session.model:c.model,usage:u?c.usage:s.session.usage,updatedAt:!s.session.mainTurnActive&&s.session.updatedAt>c.updatedAt?s.session.updatedAt:c.updatedAt})),Eme(e,gQ(Me.messagesBySession[e]??[],s.messages)),Me.tasksBySession[e]=_Q(s.subagents,Me.tasksBySession[e]??[]),Me.messagesHasMoreBySession[e]=s.hasMoreMessages,Me.approvalsBySession[e]=s.pendingApprovals;for(const c of s.pendingApprovals){const d=c.display;d?.kind==="plan_review"&&typeof d.plan=="string"&&d.plan.length>0&&(Me.planReviewByToolCallId[c.toolCallId]={plan:d.plan,path:typeof d.path=="string"?d.path:void 0})}return Me.questionsBySession[e]=s.pendingQuestions,Me.lastSeqBySession[e]=s.asOfSeq,w8[e]=s.epoch,Ig.delete(e),um.delete(e),At.handleSessionSnapshot(e,{inFlightTurn:s.inFlightTurn,busy:s.session.busy}),s.session.mainTurnActive??(s.inFlightTurn!==null&&s.session.busy)?Me.turnActiveBySession[e]=!0:delete Me.turnActiveBySession[e],H5(),rr&&(rr.seedSnapshot(e,s),rr.subscribe(e,{seq:s.asOfSeq,epoch:s.epoch}),Qme(e)),$g.delete(e),u&&t?.skipStatusRefresh!==!0&&_c(e),Yme(e),"ok"}catch(o){return Bme(o)?(await Gme(e),"not-found"):(t0("getSessionSnapshot",o,{title:Hn.global.t("warnings.sessionSnapshotTitle"),message:Hn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Lg=vQ(z5);function Xme(e){return Object.prototype.hasOwnProperty.call(Me.messagesBySession,e)}const Jme=4,ql=[],$g=new Set;function Qme(e){const t=ql.indexOf(e);for(t!==-1&&ql.splice(t,1),ql.unshift(e);ql.length>Jme;){let n=-1;for(let s=ql.length-1;s>=0;s--)if(ql[s]!==Me.activeSessionId){n=s;break}if(n===-1)break;const[o]=ql.splice(n,1);if(o===void 0)break;rr?.unsubscribe(o),$g.add(o)}}function ege(e){const t=ql.indexOf(e);t!==-1&&ql.splice(t,1),$g.delete(e)}async function tge(e){return z5(e)}function u1(e,t){return(Me.inFlightBySession[e]??!1)||(Me.turnActiveBySession[e]??!1)||(t??Me.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function n0(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return Hn.global.t("sessions.justNow");if(s<1)return`${Math.round(o/6e4)}m`;if(s<24)return`${Math.round(s)}h`;const i=o/864e5;return i<7?`${Math.round(i)}d`:i<30?`${Math.round(i/7)}w`:i<365?`${Math.round(i/30)}mo`:`${Math.round(i/365)}y`}catch{return e}}const nge=3e4,xc=Z(0);let C4=null;function oge(){C4===null&&(C4=setInterval(()=>{xc.value=(xc.value+1)%Number.MAX_SAFE_INTEGER},nge),C4.unref?.())}function sge(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:o,diff:t.diff};const s=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,i=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(s!==void 0&&i!==void 0){const r=r1(s,i)??Pm(s,i);return{kind:"diff",path:o,diff:r}}return{kind:"diff",path:o,diff:[]}}if(n==="file_io"){const o=typeof t.path=="string"?t.path:"",s=typeof t.operation=="string"?t.operation:"";if(s==="write"&&typeof t.content=="string")return{kind:"file",path:o,content:t.content};if(s==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=r1(t.before,t.after)??Pm(t.before,t.after);return{kind:"diff",path:o,diff:r}}const i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s||n,path:o,detail:i}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:DT(o);return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function ige(e){return{questionId:e.questionId,sessionId:e.sessionId,toolCallId:e.toolCallId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel}))}}function rge(e){const t=Me.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function lge(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":t="fail";let n="";if(e.status==="running"&&e.startedAt){const r=Math.round((Date.now()-new Date(e.startedAt).getTime())/1e3),l=Math.floor(r/60),a=r%60;n=Hn.global.t("tasks.timingRunning",{time:`${l}:${String(a).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){const r=Math.round((new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime())/1e3);n=Hn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??rge(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,agentId:e.agentId,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId,model:e.model,thinkingEffort:e.thinkingEffort}}const age=R(()=>{const e=Me.sessions.find(n=>n.id===Me.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Me.workspaceName,branch:t}}),uge=R(()=>(xc.value,Me.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:n0(e.updatedAt),busy:u1(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason,workspaceId:Ml(e),cwd:e.cwd})))),cge=R(()=>Me.activeSessionId??""),dge=R(()=>{const e=Me.activeSessionId;if(e)return Rn.skillsBySession.value[e]??[];const t=P2.value;return t?Rn.skillsByWorkspace.value[t]??[]:[]}),W5=R(()=>{const e=Me.activeSessionId;return e?Me.inFlightBySession[e]??!1:!1}),fge=R(()=>At.isStartingFirstPrompt()),si=fme(Me,{pushOperationFailure:t0,nextOptimisticMsgId:SN,connectEventsIfNeeded:H5,getEventConn:()=>rr,resolveThinkingForPrompt:(e,t)=>Rn.resolveThinkingForPrompt(e,t),refreshSessionStatus:_c}),o0=R(()=>{const e=Me.activeSessionId;if(!e)return[];const t=si.sideChatTargetBySession.value[e]?.agentId;return(Me.tasksBySession[e]??[]).filter(n=>n.id!==t)}),EN=ghe(Me,o0),s0=R(()=>{const e=Me.activeSessionId;return e?(Me.turnActiveBySession[e]??!1)||(Me.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),pge=R(()=>{const e=Me.activeSessionId;if(e)return Me.turnErrorBySession[e]}),hge=R(()=>{const e=Me.activeSessionId;if(e&&s0.value)return Me.turnRetryBySession[e]}),IN=e=>_t().getFileUrl(e),mge=[],gge=KT(),vge=R(()=>{const e=Me.activeSessionId;if(!e)return[];const t=new Set(Me.sideChatUserMessageIdsBySession[e]??[]);return gge({messages:(Me.messagesBySession[e]??[]).filter(n=>!t.has(n.id)),approvals:Me.approvalsBySession[e]??mge,getFileUrl:IN,sessionActive:s0.value,planReviewByToolCallId:Me.planReviewByToolCallId,plansByToolCallId:Mg[e]})}),yge=R(()=>W5.value||s0.value),kge=R(()=>(EN.taskClock.value,o0.value.map(lge))),LN=R(()=>IX(o0.value)),bge=R(()=>$X(o0.value)),vd=R(()=>{const e=Me.activeSessionId;return e?Me.goalBySession[e]??null:null}),Cge=R(()=>{const e=Me.activeSessionId;return e?bX(Me.messagesBySession[e]??[]):[]}),wge=R(()=>{const e=Me.activeSessionId;return e?Me.compactionBySession[e]??null:null}),_ge=R(()=>Me.connection),xge=R(()=>Me.loading),Sge=R(()=>Me.sessionLoading),Age=R(()=>{const e=Me.activeSessionId;return e?Me.messagesLoadingMoreBySession[e]??!1:!1}),Mge=R(()=>{const e=Me.activeSessionId;return e?Me.messagesHasMoreBySession[e]??!1:!1}),Tge=R(()=>{const e=Me.activeSessionId;return e?Me.messagesLoadMoreErrorBySession[e]??!1:!1}),Ege=R(()=>Me.serverVersion),Ige=R(()=>Me.experimentalFlags),Lge=R(()=>Me.backend),$ge=R(()=>Me.dangerousBypassAuth);function Nge(){Me.dangerousBypassAuth=!1}const Fge=R(()=>Me.permission),Rge=R(()=>Me.thinking),$N=R(()=>{const e=Me.activeSessionId;return e?Me.planModeBySession[e]??!1:F2.planMode}),Oge=R(()=>{const e=Me.activeSessionId;return e?Me.swarmModeBySession[e]??!1:F2.swarmMode}),Pge=R(()=>{const e=Me.activeSessionId;return e?Me.goalModeBySession[e]??!1:F2.goalMode}),Dge=R(()=>{const e=LX(LN.value);return{plan:$N.value,goal:vd.value&&vd.value.status!=="complete"?{status:vd.value.status,turnsUsed:vd.value.turnsUsed,elapsedMs:vd.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Bge=R(()=>{const e=Me.activeSessionId;if(!e)return[];const t=_t();return(Me.queuedBySession[e]??[]).map(n=>({id:n.id??n.text,text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId),name:o.name}))}))}),Hge=R(()=>Me.warnings),zge=R(()=>{const e=Me.activeSessionId;return e?(Me.questionsBySession[e]??[]).map(ige):[]}),Wge=R(()=>{const e=Me.activeSessionId;return e?(Me.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:sge(t),agentName:t.agentName,toolCallId:t.toolCallId})):[]}),U5=R(()=>{const e=Me.activeSessionId;return e?(Me.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Me.questionsBySession[e]??[]).length>0?"awaiting-question":W5.value||s0.value?"running":"idle":"idle"}),Rn=dme(Me,{pushOperationFailure:t0,refreshSessionStatus:_c,persistSessionProfile:CN,activity:U5,updateSession:R2,updateSessionMessages:fN,loadConfig:()=>At.loadConfig(),checkAuth:()=>At.checkAuth()}),_8=R(()=>{const e=Me.activeSessionId;if(!e)return null;const t=Me.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Uge=R(()=>{const e=Me.activeSessionId;return e?Me.gitStatusBySession[e]?.pullRequest??null:null}),jge=R(()=>{const e=Me.activeSessionId;if(!e)return[];const t=Me.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),Vge=R(()=>{const e=Me.activeSessionId;if(!e)return null;const t=Me.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),NN=R(()=>{const e=Me.sessions.find(r=>r.id===Me.activeSessionId),t=_8.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Rn.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??Me.defaultModel)??"—",s=Rn.models.value.find(r=>r.id===o)??Rn.models.value.find(r=>r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Me.permission,branch:t,cwd:e?.cwd??"",isGitRepo:_8.value!==null}}),qge=R(()=>mN.value),Kge=R(()=>Me.sessions.find(t=>t.id===Me.activeSessionId)?.usage.totalCostUsd??0),Zge=R(()=>Me.authReady),Gge=R(()=>Me.defaultModel),Yge=R(()=>Me.managedProviderStatus),Xge=R(()=>Me.managedUserInfo),Jge=R(()=>Me.managedMembership),Qge=R(()=>Me.config),e2e=R(()=>{const e=Me.activeSessionId;if(!e)return{};const t=Me.gitStatusBySession[e];return t?{...t.entries}:{}}),t2e=R(()=>{const e=new Map;for(const t of Me.workspaces){const n=Pr(t.root);e.has(n)||e.set(n,t.id)}return e});function Ml(e){return t2e.value.get(Pr(e.cwd))??e.workspaceId??e.cwd}const j5=R(()=>dJ({workspaces:Me.workspaces,sessions:Me.sessions,hiddenWorkspaceRoots:Me.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:Me.sessionsHasMoreByWorkspace})),Ng=Z(wQ());Je(()=>[j5.value.map(e=>e.id).join("\0"),Me.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=UQ(n,Ng.value);o!==null&&(Ng.value=o,wE(o))});const Yo=Z(_E());function FN(e){const t=LJ(Yo.value,e);t!==Yo.value&&(Yo.value=t,k1(t))}function V5(e){const t=uE(Yo.value,e);t!==Yo.value&&(Yo.value=t,k1(t))}function n2e(e){const t=new Set(e),n=Yo.value.filter(o=>!t.has(o));n.length!==Yo.value.length&&(Yo.value=n,k1(n))}function o2e(e){Yo.value.includes(e)?V5(e):FN(e)}function s2e(e){const t=cE(e,Yo.value);Yo.value=t,k1(t)}function i2e(e,t,n){const o=ON.value.map(r=>r.id),s=NJ(o,e,t,n),i=cE(s,Yo.value);Yo.value=i,k1(i)}const Yr=R(()=>{const e=j5.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:wme(t.root,Me.fsHome),sessionCount:t.sessionCount}));return jQ(e,Ng.value)}),P2=R(()=>{const e=Me.activeWorkspaceId,t=Yr.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Je(P2,e=>{e&&(Object.prototype.hasOwnProperty.call(Rn.skillsByWorkspace.value,e)||Rn.loadSkillsForWorkspace(e))},{immediate:!0});const r2e=R(()=>{const e=P2.value;return e?Yr.value.find(t=>t.id===e)??null:null}),l2e=R(()=>{xc.value;const e=new Set(Yr.value.map(n=>n.id)),t=new Map(Yr.value.map(n=>[n.id,n.name]));return Me.sessions.filter(n=>!n.parentSessionId&&e.has(Ml(n))).map(n=>{const o=Ml(n);return{id:n.id,title:n.title,time:n0(n.updatedAt),busy:u1(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),Fg=Z(xg),q5=R(()=>{xc.value;const e=new Set(Yr.value.map(l=>l.id)),t=new Map(Yr.value.map(l=>[l.id,l.name])),n=new Set(Yo.value),o=(l,a)=>new Date(a.updatedAt).getTime()-new Date(l.updatedAt).getTime(),s=Me.flatSessionsFrontier,i=[],r=[];for(const l of Me.sessions){if(l.parentSessionId||l.archived||n.has(l.id)||!e.has(Ml(l)))continue;if(kE({busy:u1(l.id,l.mainTurnActive),unread:DN.value[l.id]??!1,renaming:!1,questionCount:x8.value[l.id]?.questions??0,approvalCount:x8.value[l.id]?.approvals??0,pendingInteraction:l.pendingInteraction,lastTurnReason:l.lastTurnReason}).hasStatus){i.push(l);continue}s!==null&&new Date(l.updatedAt).getTime()<s||r.push(l)}return i.sort(o),r.sort(o),[...i,...r].map(l=>{const a=Ml(l);return{id:l.id,title:l.title,time:n0(l.updatedAt),busy:u1(l.id,l.mainTurnActive),pendingInteraction:l.pendingInteraction,lastTurnReason:l.lastTurnReason,lastPrompt:l.lastPrompt,updatedAt:l.updatedAt,workspaceId:a,workspaceName:t.get(a),cwdLabel:l.cwd?v1(l.cwd):"-",pullRequest:l.pullRequest}})}),a2e=R(()=>q5.value.slice(0,Fg.value)),u2e=R(()=>Me.flatSessionsHasMore||Fg.value<q5.value.length);function c2e(){Fg.value+=xg,Fg.value>q5.value.length&&Me.flatSessionsHasMore&&At.loadMoreFlatSessions()}function RN(e){xc.value;const t=new Set(Yo.value),n=new Map,o=new Map;for(const s of Me.sessions.toSorted((i,r)=>new Date(r.updatedAt).getTime()-new Date(i.updatedAt).getTime())){if(s.parentSessionId)continue;const i=Ml(s);if(e&&t.has(s.id)){o.set(i,(o.get(i)??0)+1);continue}const r={id:s.id,title:s.title,time:n0(s.updatedAt),busy:u1(s.id,s.mainTurnActive),pendingInteraction:s.pendingInteraction,lastTurnReason:s.lastTurnReason,updatedAt:s.updatedAt},l=n.get(i)??[];l.push(r),n.set(i,l)}return Yr.value.map(s=>({workspace:s,sessions:n.get(s.id)??[],pinnedCount:o.get(s.id)??0,hasMore:Me.sessionsHasMoreByWorkspace[s.id]??!1,loadingMore:Me.sessionsLoadingMoreByWorkspace[s.id]??!1,initialCount:Me.sessionsInitialCountByWorkspace[s.id]??am}))}const d2e=R(()=>RN(!0)),f2e=R(()=>RN(!1)),ON=R(()=>{xc.value;const e=new Set(Yr.value.map(o=>o.id)),t=new Map(Yr.value.map(o=>[o.id,o.name])),n=Me.sessions.filter(o=>!o.parentSessionId&&!o.archived&&e.has(Ml(o)));return $J(n,Yo.value).pinned.map(o=>{const s=Ml(o);return{id:o.id,title:o.title,time:n0(o.updatedAt),busy:u1(o.id,o.mainTurnActive),pendingInteraction:o.pendingInteraction,lastTurnReason:o.lastTurnReason,updatedAt:o.updatedAt,workspaceId:s,workspaceName:t.get(s),pinned:!0,cwdLabel:o.cwd?v1(o.cwd):"-",pullRequest:o.pullRequest}})});function p2e(e){Ng.value=e,wE(e)}const PN=R(()=>{const e={};for(const[t,n]of Object.entries(Me.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Me.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),x8=R(()=>{const e={};for(const[t,n]of Object.entries(Me.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Me.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),DN=R(()=>{const e={};for(const[t,n]of Object.entries(Me.unreadBySession))n&&(e[t]=!0);return e}),h2e=R(()=>{const e={},t=PN.value;for(const n of Me.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=Ml(n);e[s]=(e[s]??0)+o}return e}),m2e=R(()=>Me.recentRoots),g2e=R(()=>Me.availableOpenInApps),At=ame(Me,{taskPoller:EN,sideChat:si,modelProvider:Rn,pushOperationFailure:t0,activity:U5,sessionsKnownEmpty:MN,setSessions:D5,updateSession:R2,upsertSessionFront:Sme,appendSession:Ame,forgetSession:pN,unpinSessions:n2e,setActiveSessionId:B5,updateSessionMessages:fN,nextOptimisticMsgId:SN,getEventConn:()=>rr,syncSessionFromSnapshot:z5,reopenSession:tge,hasLoadedMessages:Xme,refreshSessionStatus:_c,refreshSessionGoal:Lme,refreshSessionPlans:b8,persistSessionProfile:CN,mergedWorkspaces:j5,workspacesView:Yr,status:NN,workspaceIdForSession:Ml,savePermissionToStorage:vme,savePlanModeToStorage:lN,saveSwarmModeToStorage:aN,saveGoalModeToStorage:uN,draftModes:F2,saveUnread:Iy,saveActiveWorkspaceToStorage:Cme,saveHiddenWorkspacesToStorage:bme,goalErrorMessage:Zme,initialized:kN,connectIssue:bN,selectedDiffPath:hN,fileDiffLines:mN,fileDiffLoading:gN,fileDiffTexts:vN,fileDiffEmptyFile:yN});function K5(e){return e===Me.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function v2e(e){Me.turnActiveBySession[e]&&delete Me.turnActiveBySession[e],Me.inFlightBySession[e]&&(Me.inFlightBySession[e]=!1)}function y2e(e,t,n){const o=Me.promptIdBySession[e];At.finishPromptLocal(e,{turnWasActive:n}),e===Me.activeSessionId?(At.loadGitStatus(e),_c(e)):t==="idle"&&(Me.unreadBySession[e]=!0,Iy({[e]:!0}));const s=(Me.approvalsBySession[e]??[]).length>0,i=(Me.questionsBySession[e]??[]).length>0;ohe(t,s,i)&&Da.maybeNotifyCompletion(e,{isUserWatching:K5(e),sessionTitle:Me.sessions.find(r=>r.id===e)?.title??"",promptId:o,onClick:()=>{At.selectSession(e)}})}function k2e(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;Da.maybeNotifyQuestion({isUserWatching:K5(e),sessionTitle:Me.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{At.selectSession(e)}})}function b2e(e,t){Da.maybeNotifyApproval({isUserWatching:K5(e),sessionTitle:Me.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{At.selectSession(e)}})}function mu(){return oge(),{workspace:age,sessions:uge,activeSessionId:cge,workspacesView:Yr,visibleWorkspace:r2e,activeWorkspaceId:P2,sessionsForView:l2e,workspaceGroups:d2e,mobileWorkspaceGroups:f2e,pinnedSessions:ON,flatSessions:a2e,flatSessionsHasMore:u2e,flatSessionsLoadingMore:R(()=>Me.flatSessionsLoadingMore),attentionBySession:PN,pendingBySession:x8,attentionByWorkspace:h2e,unreadBySession:DN,recentRoots:m2e,turns:vge,tasks:kge,activeAppTasks:o0,auxiliaryTranscripts:Tg,getFileUrl:IN,todos:Cge,goal:vd,swarms:LN,swarmMembersByToolCallId:bge,activationBadges:Dge,compaction:wge,status:NN,sessionCost:Kge,fileDiff:qge,selectedDiffPath:hN,fileDiffLoading:gN,fileDiffTexts:vN,fileDiffEmptyFile:yN,changes:jge,gitInfo:_8,gitDiffStats:Vge,activePullRequest:Uge,changesByPath:e2e,pendingApprovals:Wge,availableOpenInApps:g2e,connection:_ge,loading:xge,sessionLoading:Sge,loadingMoreMessages:Age,hasMoreMessages:Mge,loadMoreMessagesError:Tge,serverVersion:Ege,backend:Lge,dangerousBypassAuth:$ge,experimentalFlags:Ige,clearDangerousBypassAuth:Nge,initialized:kN,connectIssue:bN,permission:Fge,thinking:Rge,planMode:$N,swarmMode:Oge,goalMode:Pge,queued:Bge,warnings:Hge,questions:zge,activity:U5,turnActive:s0,activeTurnError:pge,activeTurnRetry:hge,inFlight:W5,working:yge,isStartingFirstPrompt:fge,models:Rn.models,starredModelIds:Rn.starredModelIds,providers:Rn.providers,fontScale:$h.fontScale,setFontScale:$h.setFontScale,colorScheme:$h.colorScheme,setColorScheme:$h.setColorScheme,notifyEnabled:Da.notifyEnabled,notifySound:Da.notifySound,notifyPermission:Da.notifyPermission,setNotifyEnabled:Da.setNotifyEnabled,setNotifySound:Da.setNotifySound,onboarded:xN,setOnboarded:Nme,load:At.load,selectSession:At.selectSession,clearActiveSession:At.clearActiveSession,loadOlderMessages:At.loadOlderMessages,loadWorkspaces:At.loadWorkspaces,loadMoreSessions:At.loadMoreSessions,loadAllSessions:At.loadAllSessions,ensureFlatSessions:At.ensureFlatSessions,loadMoreFlatSessions:c2e,selectWorkspace:At.selectWorkspace,openWorkspace:At.openWorkspace,openWorkspaceDraft:At.openWorkspaceDraft,startSessionAndSendPrompt:At.startSessionAndSendPrompt,startSessionAndActivateSkill:At.startSessionAndActivateSkill,startSessionAndOpenSideChat:At.startSessionAndOpenSideChat,addWorkspaceByPath:At.addWorkspaceByPath,browseFs:At.browseFs,getFsHome:At.getFsHome,sendPrompt:At.sendPrompt,steerPrompt:At.steerPrompt,sideChatVisible:si.sideChatVisible,sideChatSessionId:si.sideChatSessionId,sideChatTurns:si.sideChatTurns,sideChatRunning:si.sideChatRunning,sideChatSending:si.sideChatSending,openSideChat:si.openSideChat,closeSideChat:si.closeSideChat,sendSideChatPrompt:si.sendSideChatPrompt,uploadImage:At.uploadImage,abortCurrentPrompt:At.abortCurrentPrompt,respondApproval:At.respondApproval,respondQuestion:At.respondQuestion,dismissQuestion:At.dismissQuestion,pendingQuestionActions:At.pendingQuestionActions,pendingApprovalActions:At.pendingApprovalActions,cancelTask:At.cancelTask,setPermission:At.setPermission,setThinking:Rn.setThinking,setPlanMode:At.setPlanMode,togglePlanMode:At.togglePlanMode,setSwarmMode:At.setSwarmMode,toggleSwarmMode:At.toggleSwarmMode,setGoalMode:At.setGoalMode,toggleGoalMode:At.toggleGoalMode,createGoal:At.createGoal,controlGoal:At.controlGoal,enqueue:At.enqueue,dismissWarning:At.dismissWarning,renameSession:At.renameSession,renameWorkspace:At.renameWorkspace,deleteWorkspace:At.deleteWorkspace,reorderWorkspaces:p2e,pinSession:FN,unpinSession:V5,togglePinSession:o2e,reorderPinnedSessions:s2e,pinSessionAt:i2e,archiveSession:At.archiveSession,exportSession:At.exportSession,restoreSession:At.restoreSession,loadArchivedSessions:At.loadArchivedSessions,compact:At.compact,forkSession:At.forkSession,undo:At.undo,unqueue:At.unqueue,reorderQueue:At.reorderQueue,searchFiles:At.searchFiles,loadGitStatus:At.loadGitStatus,loadFileDiff:At.loadFileDiff,clearFileDiff:At.clearFileDiff,listDir:At.listDir,readFileContent:At.readFileContent,readHostFileContent:At.readHostFileContent,getFileDownloadUrl:At.getFileDownloadUrl,openWorkspaceFile:At.openWorkspaceFile,openInApp:At.openInApp,revealWorkspaceFile:At.revealWorkspaceFile,resolveImageUrl:At.resolveImageUrl,loadModels:Rn.loadModels,loadProviders:Rn.loadProviders,skills:dge,activateSkill:Rn.activateSkill,setModel:Rn.setModel,toggleStarModel:Rn.toggleStarModel,addProvider:Rn.addProvider,updateProvider:Rn.updateProvider,getProvider:Rn.getProvider,deleteProvider:Rn.deleteProvider,refreshProvider:Rn.refreshProvider,refreshAllProviders:Rn.refreshAllProviders,loadCatalogProviders:Rn.loadCatalogProviders,importCatalogProvider:Rn.importCatalogProvider,importCustomRegistry:Rn.importCustomRegistry,authReady:Zge,defaultModel:Gge,managedProviderStatus:Yge,managedUserInfo:Xge,managedMembership:Jge,notify:O2,config:Qge,loadConfig:At.loadConfig,updateConfig:At.updateConfig,checkAuth:At.checkAuth,probeManagedMembership:At.probeManagedMembership,startOAuthLogin:Rn.startOAuthLogin,pollOAuthLogin:Rn.pollOAuthLogin,cancelOAuthLogin:Rn.cancelOAuthLogin,getUsage:Rn.getUsage,logout:At.logout}}const C2e=["aria-expanded"],w2e={class:"user-menu-avatar","aria-hidden":"true"},_2e=["src"],x2e={class:"user-menu-name"},S2e={class:"user-menu-name"},A2e={class:"user-menu-item-label"},M2e={class:"user-menu-item-label"},T2e={class:"user-menu-item-label user-menu-login-label"},E2e={class:"user-menu-item-label"},I2e={class:"user-menu-row-value"},L2e={class:"user-menu-item-label"},$2e={class:"user-menu-row-value"},N2e={class:"user-menu-item-label"},F2e={key:0,class:"user-menu-usage"},R2e={key:0,class:"user-menu-usage-state"},O2e={key:1,class:"user-menu-usage-state"},P2e={class:"user-menu-usage-error"},D2e={key:2,class:"user-menu-usage-state user-menu-usage-empty"},B2e={class:"user-menu-usage-main"},H2e={class:"user-menu-usage-label"},z2e={key:0,class:"user-menu-usage-hint"},W2e={class:"user-menu-item-label"},U2e={class:"user-menu-item-label"},j2e=et({__name:"UserMenu",emits:["login","openSettings"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=Nt(),i=mu(),{confirm:r}=hu(),l=R(()=>i.managedProviderStatus.value==="authenticated"),a=i.managedUserInfo,u=i.managedMembership,c=R(()=>a.value?.nickname||o("sidebar.defaultUserName")),d=R(()=>u.value==="free"||OJ(a.value?.userLevel)),f=R(()=>u.value!=="free"),h=Z(!1);Je(()=>a.value?.avatar,()=>{h.value=!1});const m=R(()=>!!a.value?.avatar&&!h.value),v=i.colorScheme,k=R(()=>o(`theme.${v.value}`)),w=R(()=>v.value==="light"?"light-mode":v.value==="dark"?"dark-mode":"follow-system"),b=[{value:"light",labelKey:"theme.light",icon:"light-mode"},{value:"dark",labelKey:"theme.dark",icon:"dark-mode"},{value:"system",labelKey:"theme.system",icon:"follow-system"}];function _(te){i.setColorScheme(te)}const g=R(()=>yg.find(te=>te.code===s.value)?.label??s.value);function x(te){s.value!==te&&E5(te)}const S=Z(!1),T=Z({}),A=Z(null),E=Z(null);let P=null;function D(te){const ce=te.target;ce.closest(".user-menu")||ce.closest(".user-menu-trigger")||ce.closest(".user-submenu")||O()}function I(te){te.key==="Escape"&&(te.stopPropagation(),O())}async function $(){if(S.value){O();return}S.value=!0,document.addEventListener("mousedown",D),document.addEventListener("keydown",I,!0),window.addEventListener("resize",O),l.value&&oe(),await yt(),B();const te=E.value;te&&(P=new ResizeObserver(H),P.observe(te))}function B(){const te=E.value,ce=A.value?.el;if(!te||!ce)return;const ue=te.getBoundingClientRect(),Se=4,ze=8,_e=ce.offsetHeight,Ee={left:`${Math.round(ue.left)}px`,width:`${Math.round(ue.width)}px`};ue.top-_e-Se<ze?T.value={...Ee,top:`${Math.round(Math.min(ue.bottom+Se,window.innerHeight-_e-ze))}px`,bottom:"auto",transformOrigin:"top left","--menu-pop-shift":"-2px"}:T.value={...Ee,top:"auto",bottom:`${Math.round(window.innerHeight-ue.top+Se)}px`,transformOrigin:"bottom left","--menu-pop-shift":"2px"}}function H(){const te=E.value;if(!te)return;F.value=null;const ce=te.getBoundingClientRect();T.value={...T.value,left:`${Math.round(ce.left)}px`,width:`${Math.round(ce.width)}px`}}function O(){S.value=!1,F.value=null,le(),P?.disconnect(),P=null,document.removeEventListener("mousedown",D),document.removeEventListener("keydown",I,!0),window.removeEventListener("resize",O)}Vn(O);const F=Z(null),U=Z({}),z=Z(null),W={usage:null,theme:null,language:null};let K=null;function V(te){return ce=>{W[te]=ce instanceof HTMLElement?ce:ce?.$el??null}}function ie(te){le(),F.value!==te&&(F.value=te,yt(Ie))}function ne(te,ce){te.key!=="Enter"&&te.key!==" "&&te.key!=="ArrowRight"||(te.preventDefault(),ie(ce))}function X(){le(),K=setTimeout(()=>{F.value=null,K=null},250)}function le(){K!==null&&(clearTimeout(K),K=null)}function Ie(){const te=F.value,ce=A.value?.el,ue=z.value?.el,Se=te!==null?W[te]:null;if(!ce||!ue||!Se)return;const ze=4,_e=8,Ee=ce.getBoundingClientRect(),it=Se.getBoundingClientRect(),Fe=ue.offsetHeight,Oe=Math.min(ue.offsetWidth,Ee.width);let Ge=Ee.right+ze,at=!1;Ge+Oe>window.innerWidth-_e&&(Ge=Math.max(_e,Ee.left-Oe-ze),at=!0);const Tt=Math.max(_e,Math.min(it.top,window.innerHeight-Fe-_e));U.value={top:`${Math.round(Tt)}px`,left:`${Math.round(Ge)}px`,maxWidth:`${Math.round(Ee.width)}px`,transformOrigin:at?"top right":"top left","--menu-pop-shift":"-2px"}}const de=Z(!1),pe=Z(null);let ve=0;async function oe(){const te=++ve;de.value=!0;try{const ce=await i.getUsage();te===ve&&(pe.value=ce)}finally{te===ve&&(de.value=!1)}}const ye=R(()=>{if(pe.value?.kind!=="ok")return[];const{summary:te,limits:ce}=pe.value,ue=FJ(ce,5,"hour");return[te,ue].filter(Se=>Se!=null)}),G=R(()=>pe.value?.kind==="error"?pe.value.message:o("settings.planUsage.loadFailed"));function Y(te){return te.resetAt===void 0?"":fE(te.resetAt,o)}function fe(){O(),jp()}function we(){O(),n("login")}function ge(){O(),n("openSettings")}async function Q(){O(),await r({title:o("sidebar.logoutConfirmTitle"),message:o("sidebar.logoutConfirmMessage"),variant:"danger",action:()=>i.logout()})}return(te,ce)=>(y(),M(Pe,null,[C("button",{ref_key:"triggerRef",ref:E,class:"user-menu-trigger",type:"button","aria-haspopup":"menu","aria-expanded":S.value,onClick:It($,["stop"])},[l.value?(y(),M(Pe,{key:0},[C("span",w2e,[m.value?(y(),M("img",{key:0,src:p(a)?.avatar,alt:"",onError:ce[0]||(ce[0]=ue=>h.value=!0)},null,40,_2e)):(y(),he(p(Te),{key:1,name:"user",size:"sm"}))]),C("span",x2e,N(c.value),1)],64)):(y(),M(Pe,{key:1},[j(p(Te),{name:"user"}),C("span",S2e,N(p(o)("sidebar.notSignedIn")),1)],64))],8,C2e),(y(),he(Zr,{to:"body"},[j(as,{name:"menu-pop"},{default:me(()=>[S.value?(y(),he(p(Cl),{key:0,ref_key:"menuRef",ref:A,class:"user-menu",style:Zt(T.value),onClick:ce[14]||(ce[14]=It(()=>{},["stop"]))},{default:me(()=>[l.value?(y(),M(Pe,{key:0},[f.value?(y(),he(p(hn),{key:0,ref:V("usage"),"aria-haspopup":"true","aria-expanded":F.value==="usage",onMouseenter:ce[1]||(ce[1]=ue=>ie("usage")),onMouseleave:X,onFocus:ce[2]||(ce[2]=ue=>ie("usage")),onBlur:X,onClick:ce[3]||(ce[3]=ue=>ie("usage")),onKeydown:ce[4]||(ce[4]=ue=>ne(ue,"usage"))},{default:me(()=>[j(p(Te),{name:"histogram",size:"sm"}),C("span",A2e,N(p(o)("settings.planUsage.title")),1),j(p(Te),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"])):ee("",!0),d.value?(y(),he(p(hn),{key:1,onClick:fe,onMouseenter:X},{default:me(()=>[j(p(Te),{name:"music",size:"sm"}),C("span",M2e,N(p(o)("sidebar.upgrade")),1),j(p(Te),{name:"external-link",size:"sm"})]),_:1})):ee("",!0),j(p(hn),{separator:""})],64)):(y(),M(Pe,{key:1},[j(p(hn),{class:"user-menu-login",onClick:we,onMouseenter:X},{default:me(()=>[j(p(Te),{name:"log-in",size:"sm"}),C("span",T2e,N(p(o)("sidebar.signIn")),1)]),_:1}),j(p(hn),{separator:""})],64)),j(p(hn),{ref:V("theme"),"aria-haspopup":"true","aria-expanded":F.value==="theme",onMouseenter:ce[5]||(ce[5]=ue=>ie("theme")),onMouseleave:X,onFocus:ce[6]||(ce[6]=ue=>ie("theme")),onBlur:X,onClick:ce[7]||(ce[7]=ue=>ie("theme")),onKeydown:ce[8]||(ce[8]=ue=>ne(ue,"theme"))},{default:me(()=>[j(p(Te),{name:w.value,size:"sm"},null,8,["name"]),C("span",E2e,N(p(o)("theme.colorSchemeLabel")),1),C("span",I2e,N(k.value),1),j(p(Te),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"]),j(p(hn),{ref:V("language"),"aria-haspopup":"true","aria-expanded":F.value==="language",onMouseenter:ce[9]||(ce[9]=ue=>ie("language")),onMouseleave:X,onFocus:ce[10]||(ce[10]=ue=>ie("language")),onBlur:X,onClick:ce[11]||(ce[11]=ue=>ie("language")),onKeydown:ce[12]||(ce[12]=ue=>ne(ue,"language"))},{default:me(()=>[j(p(Te),{name:"translate",size:"sm"}),C("span",L2e,N(p(o)("sidebar.language")),1),C("span",$2e,N(g.value),1),j(p(Te),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"]),j(p(hn),{onClick:ge,onMouseenter:X},{default:me(()=>[j(p(Te),{name:"settings",size:"sm"}),C("span",N2e,N(p(o)("settings.title")),1)]),_:1}),l.value?(y(),M(Pe,{key:2},[j(p(hn),{separator:""}),j(p(hn),{onClick:ce[13]||(ce[13]=ue=>void Q()),onMouseenter:X},{default:me(()=>[j(p(Te),{name:"log-out",size:"sm"}),qe(" "+N(p(o)("sidebar.signOut")),1)]),_:1})],64)):ee("",!0)]),_:1},8,["style"])):ee("",!0)]),_:1})])),(y(),he(Zr,{to:"body"},[j(as,{name:"menu-pop"},{default:me(()=>[F.value!==null?(y(),he(p(Cl),{key:0,ref_key:"submenuRef",ref:z,class:"user-submenu",style:Zt(U.value),role:F.value==="usage"?"dialog":"menu",onClick:ce[16]||(ce[16]=It(()=>{},["stop"])),onMouseenter:le,onMouseleave:X,onFocusin:le,onFocusout:X},{default:me(()=>[F.value==="usage"?(y(),M("div",F2e,[de.value?(y(),M("div",R2e,[j(p(Ao),{size:"sm"})])):pe.value?.kind!=="ok"?(y(),M("div",O2e,[C("span",P2e,N(G.value),1),j(p(Rt),{variant:"ghost",size:"sm",onClick:ce[15]||(ce[15]=ue=>void oe())},{default:me(()=>[qe(N(p(o)("settings.planUsage.retry")),1)]),_:1})])):ye.value.length===0?(y(),M("span",D2e,N(p(o)("settings.planUsage.empty")),1)):(y(!0),M(Pe,{key:3},pt(ye.value,(ue,Se)=>(y(),M("div",{key:Se,class:"user-menu-usage-row"},[C("span",B2e,[C("span",H2e,N(p(dE)(ue,p(o))),1),Y(ue)?(y(),M("span",z2e,N(Y(ue)),1)):ee("",!0)]),C("span",{class:Re(["user-menu-usage-value",`sev-${p(C3)(ue.used,ue.limit)}`])},N(p(Wh)(ue.used,ue.limit))+"% ",3)]))),128))])):F.value==="theme"?(y(),M(Pe,{key:1},pt(b,ue=>j(p(hn),{key:ue.value,onClick:Se=>_(ue.value)},{default:me(()=>[j(p(Te),{name:ue.icon,size:"sm"},null,8,["name"]),C("span",W2e,N(p(o)(ue.labelKey)),1),p(v)===ue.value?(y(),he(p(Te),{key:0,name:"check",size:"sm"})):ee("",!0)]),_:2},1032,["onClick"])),64)):(y(!0),M(Pe,{key:2},pt(p(yg),ue=>(y(),he(p(hn),{key:ue.code,onClick:Se=>x(ue.code)},{default:me(()=>[C("span",U2e,N(ue.label),1),p(s)===ue.code?(y(),he(p(Te),{key:0,name:"check",size:"sm"})):ee("",!0)]),_:2},1032,["onClick"]))),128))]),_:1},8,["style","role"])):ee("",!0)]),_:1})]))],64))}}),V2e=ft(j2e,[["__scopeId","data-v-06f13413"]]),q2e={class:"ep-search"},K2e=["placeholder"],Z2e={class:"ep-scroll"},G2e={key:0,class:"ep-grid"},Y2e=["onClick"],X2e={key:1,class:"ep-empty"},J2e={class:"ep-label"},Q2e={class:"ep-grid"},eve=["onClick"],tve={class:"ep-label"},nve={class:"ep-grid"},ove=["onClick"],Kx="kimi-web.recent-emojis",sve=et({__name:"SessionEmojiPicker",props:{current:{default:null},removable:{type:Boolean,default:!0}},emits:["pick"],setup(e,{expose:t,emit:n}){const{t:o}=Nt(),{handleCompositionStart:s,handleCompositionEnd:i,isComposingKeyEvent:r}=Ar(),l=e,a=n,u=["⏳","⚠️","🐛","✨","🔥","🚀","🎯","🧪","📝","🔍","🛠️","💡","📦","🎨","🔒","📈","🧹","🚧","✅","❓","🌙","☕","🐳","🗂️","📊","🤖","🧩","⚙️","🌱","📌","💥","🕐"],c={faces:"sidebar.emojiGroupFaces",nature:"sidebar.emojiGroupNature",food:"sidebar.emojiGroupFood",activity:"sidebar.emojiGroupActivity",objects:"sidebar.emojiGroupObjects",symbols:"sidebar.emojiGroupSymbols"},d=sJ.map(S=>({id:S,labelKey:c[S],emojis:sE.filter(T=>T.group===S).map(T=>T.emoji)})),f=Z(h());function h(){try{const S=JSON.parse(localStorage.getItem(Kx)??"[]");return Array.isArray(S)?S.filter(T=>typeof T=="string"):[]}catch{return[]}}function m(S){f.value=aJ(f.value,S);try{localStorage.setItem(Kx,JSON.stringify(f.value))}catch{}a("pick",S)}const v=Z(""),k=R(()=>v.value.trim().length>0),w=R(()=>rJ(v.value)),b=Z(null);dn(()=>b.value?.focus());function _(S){if(r(S))return;const T=w.value[0];k.value&&T&&m(T)}function g(){let S=l.current??void 0;for(;S===void 0||S===l.current;)S=u[Math.floor(Math.random()*u.length)];m(S)}const x=Z(null);return t({el:R(()=>x.value?.el),isComposingKeyEvent:r}),(S,T)=>(y(),he(p(Cl),{ref_key:"menuRef",ref:x,class:"emoji-picker",role:"dialog","aria-label":p(o)("sidebar.sessionEmojiTitle"),onKeydown:T[4]||(T[4]=It(()=>{},["stop"]))},{default:me(()=>[C("div",q2e,[j(p(Te),{name:"search",size:"sm"}),Bn(C("input",{ref_key:"inputRef",ref:b,"onUpdate:modelValue":T[0]||(T[0]=A=>v.value=A),class:"ep-input",type:"text",placeholder:p(o)("sidebar.searchEmoji"),autocomplete:"off",spellcheck:"false",onKeydown:xl(_,["enter"]),onCompositionstart:T[1]||(T[1]=(...A)=>p(s)&&p(s)(...A)),onCompositionend:T[2]||(T[2]=(...A)=>p(i)&&p(i)(...A))},null,40,K2e),[[ai,v.value]])]),C("div",Z2e,[k.value?(y(),M(Pe,{key:0},[w.value.length?(y(),M("div",G2e,[(y(!0),M(Pe,null,pt(w.value,A=>(y(),M("button",{key:A,class:Re(["ep-e",{sel:A===e.current}]),type:"button",onClick:E=>m(A)},N(A),11,Y2e))),128))])):(y(),M("div",X2e,N(p(o)("sidebar.noEmojiResults")),1))],64)):(y(),M(Pe,{key:1},[f.value.length?(y(),M(Pe,{key:0},[C("div",J2e,N(p(o)("sidebar.recentEmojis")),1),C("div",Q2e,[(y(!0),M(Pe,null,pt(f.value,A=>(y(),M("button",{key:A,class:Re(["ep-e",{sel:A===e.current}]),type:"button",onClick:E=>m(A)},N(A),11,eve))),128))])],64)):ee("",!0),(y(!0),M(Pe,null,pt(p(d),A=>(y(),M(Pe,{key:A.id},[C("div",tve,N(p(o)(A.labelKey)),1),C("div",nve,[(y(!0),M(Pe,null,pt(A.emojis,E=>(y(),M("button",{key:E,class:Re(["ep-e",{sel:E===e.current}]),type:"button",onClick:P=>m(E)},N(E),11,ove))),128))])],64))),128))],64))]),j(p(hn),{separator:""}),j(p(hn),{role:"button",disabled:!(e.current&&e.removable),onClick:T[3]||(T[3]=A=>a("pick",null))},{default:me(()=>[j(p(Te),{name:"close",size:"sm"}),qe(" "+N(p(o)("sidebar.removeEmoji")),1)]),_:1},8,["disabled"]),j(p(hn),{role:"button",onClick:g},{default:me(()=>[j(p(Te),{name:"sparkles",size:"sm"}),qe(" "+N(p(o)("sidebar.randomEmoji")),1)]),_:1})]),_:1},8,["aria-label"]))}}),ive=ft(sve,[["__scopeId","data-v-05e46bbb"]]),rve={class:"row"},lve={key:0,class:"lead","aria-hidden":"true"},ave={key:1,class:"unread-dot"},uve={class:"left"},cve=["onKeydown"],dve=["aria-label"],fve={class:"act"},pve={key:0,class:"ts"},hve={key:1,class:"st"},mve={key:1,class:"unread-dot"},gve={key:2,class:"ha"},vve={key:0,class:"sub"},yve={class:"sub-text"},kve=["aria-label"],bve={class:"menu-time"},Cve=et({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","renameStateChange","archive","fork","export","pin"],setup(e,{expose:t,emit:n}){const{t:o}=Nt(),s=e,i=n;function r(ue){const Se=new Date(ue);if(Number.isNaN(Se.getTime()))return ue;const ze=_e=>String(_e).padStart(2,"0");return`${Se.getFullYear()}-${ze(Se.getMonth()+1)}-${ze(Se.getDate())} ${ze(Se.getHours())}:${ze(Se.getMinutes())}`}const l=R(()=>s.session.updatedAt?r(s.session.updatedAt):s.session.time),a=R(()=>s.session.cwdLabel!==void 0),u=R(()=>kE({busy:s.session.busy,unread:s.unread,renaming:W.value,questionCount:s.questionCount,approvalCount:s.approvalCount,pendingInteraction:s.session.pendingInteraction,lastTurnReason:s.session.lastTurnReason})),c=R(()=>u.value.showQuestionBadge),d=R(()=>u.value.showApprovalBadge),f=R(()=>u.value.showAbortedBadge),h=R(()=>u.value.showBusySpinner),m=R(()=>u.value.hasStatus),v=Z(!1),k=Z(null),w=Z({});function b(ue){const Se=ue.target;k.value?.el?.contains(Se)||g()}async function _(){$(),v.value=!0,setTimeout(()=>document.addEventListener("mousedown",b),0),window.addEventListener("resize",g),await yt()}function g(){v.value=!1,document.removeEventListener("mousedown",b),window.removeEventListener("resize",g)}bn(()=>{document.removeEventListener("mousedown",b),document.removeEventListener("mousedown",B),window.removeEventListener("keydown",H,!0),window.removeEventListener("resize",g),window.removeEventListener("resize",$)});const x=R(()=>yE(s.session.title)),S=R(()=>{const ue=x.value.emoji;return ue?s.session.title.slice(ue.length):s.session.title}),T=Z(!1),A=Z(null),E=Z({});let P=null;function D(ue,Se,ze){const _e=A.value?.el,Ee=4,it=8,Fe=_e?.offsetHeight??0,Oe=_e?.offsetWidth??0;let Ge=ue.bottom+Ee,at=!1;Ge+Fe>window.innerHeight-it&&(Ge=Math.max(it,ue.top-Fe-Ee),at=!0);const Tt=ze??(Se==="left"?ue.left:ue.right-Oe),Bt=Math.max(it,Math.min(Tt,window.innerWidth-Oe-it)),Yt=ze===void 0?Se:`${Math.round(Math.min(Math.max(ze-Bt,0),Oe))}px`;E.value={top:`${Math.round(Ge)}px`,left:`${Math.round(Bt)}px`,transformOrigin:`${Yt} ${at?"bottom":"top"}`,"--menu-pop-shift":at?"2px":"-2px"}}async function I(ue,Se,ze="left",_e){const Ee=Se??ue?.getBoundingClientRect();if(Ee){if(T.value){$();return}g(),P=ue??null,T.value=!0,setTimeout(()=>document.addEventListener("mousedown",B),0),window.addEventListener("keydown",H,!0),window.addEventListener("resize",$),await yt(),D(Ee,ze,_e)}}function $(){T.value=!1,P=null,document.removeEventListener("mousedown",B),window.removeEventListener("keydown",H,!0),window.removeEventListener("resize",$)}function B(ue){const Se=ue.target;A.value?.el?.contains(Se)||P?.contains(Se)||$()}function H(ue){ue.key==="Escape"&&(A.value?.isComposingKeyEvent(ue)||(ue.preventDefault(),ue.stopPropagation(),$()))}function O(ue){return ue.clientX||ue.clientY?new DOMRect(ue.clientX,ue.clientY,0,0):void 0}function F(ue){ue.stopPropagation();const Se=ue;I(Se.currentTarget,O(Se),"left",Se.clientX||void 0)}function U(ue){const Se=k.value?.el,ze=ue,_e=O(ze)??Se?.getBoundingClientRect();g(),I(Se,_e,"left",ze.clientX||void 0)}function z(ue){if($(),ue===x.value.emoji)return;const Se=dQ(s.session.title,ue);Se&&Se!==s.session.title&&i("rename",s.session.id,Se)}const W=Z(!1),K=Z(""),V=Z(null),{handleCompositionStart:ie,handleCompositionEnd:ne,isComposingKeyEvent:X}=Ar();async function le(){g(),$(),W.value=!0,K.value=s.session.title,await yt();try{V.value?.focus(),V.value?.select()}catch{}}function Ie(){const ue=K.value.trim();ue&&ue!==s.session.title&&i("rename",s.session.id,ue),W.value=!1}function de(ue){X(ue)||Ie()}function pe(ue){X(ue)||ve()}function ve(){W.value=!1}Je(W,ue=>i("renameStateChange",ue));async function oe(ue){W.value||(ue.preventDefault(),ue.stopPropagation(),v.value&&g(),await _(),ye(ue))}function ye(ue){const Se=k.value?.el,ze=8,_e=Se?.offsetHeight??0,Ee=Se?.offsetWidth??0;let it=ue.clientY,Fe=!1;it+_e>window.innerHeight-ze&&(it=Math.max(ze,ue.clientY-_e),Fe=!0);let Oe=ue.clientX,Ge=!1;Oe+Ee>window.innerWidth-ze&&(Oe=Math.max(ze,ue.clientX-Ee),Ge=!0),w.value={top:`${Math.round(it)}px`,left:`${Math.round(Oe)}px`,transformOrigin:`${Fe?"bottom":"top"} ${Ge?"right":"left"}`,"--menu-pop-shift":Fe?"2px":"-2px"}}const G=Z(!1),Y=Z(!1);async function fe(){const ue=await Zs(s.session.id);G.value=ue,Y.value=!ue,setTimeout(()=>{G.value=!1,Y.value=!1,g()},1500)}function we(){g(),i("fork",s.session.id)}function ge(){g(),i("export",s.session.id)}function Q(){g(),i("pin",s.session.id)}function te(){g(),i("archive",s.session.id)}t({closeMenu:g});function ce(){const ue=s.session.pullRequest?.url;ue&&window.open(ue,"_blank","noopener")}return(ue,Se)=>(y(),M("div",{class:Re(["se",{on:e.active,flat:a.value}]),onClick:Se[7]||(Se[7]=ze=>i("select",e.session.id)),onContextmenu:oe},[C("div",rve,[a.value?ee("",!0):(y(),M("span",lve,[e.session.busy?(y(),he(p(Ao),{key:0,size:"sm"})):e.unread?(y(),M("span",ave)):ee("",!0)])),C("div",uve,[W.value?Bn((y(),M("input",{key:0,ref_key:"renameInputRef",ref:V,"onUpdate:modelValue":Se[0]||(Se[0]=ze=>K.value=ze),class:"rename-input",onClick:Se[1]||(Se[1]=It(()=>{},["stop"])),onKeydown:[xl(It(de,["stop"]),["enter"]),xl(It(pe,["stop"]),["esc"])],onCompositionstart:Se[2]||(Se[2]=(...ze)=>p(ie)&&p(ie)(...ze)),onCompositionend:Se[3]||(Se[3]=(...ze)=>p(ne)&&p(ne)(...ze)),onBlur:Ie},null,40,cve)),[[ai,K.value]]):(y(),M("span",{key:1,class:"t",onDblclick:It(le,["stop"])},[x.value.emoji?(y(),M("button",{key:0,type:"button",class:"emoji","aria-label":p(o)("sidebar.setEmoji"),onClick:It(F,["stop"]),onDblclick:Se[4]||(Se[4]=It(()=>{},["stop"]))},N(x.value.emoji),41,dve)):ee("",!0),qe(N(S.value),1)],32))]),C("span",fve,[j(p(pn),{text:p(o)("workspace.awaitingAnswerTitle")},{default:me(()=>[c.value?(y(),he(p(Vr),{key:0,variant:"info",size:"sm"},{default:me(()=>[qe(N(p(o)("workspace.awaitingAnswer")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),j(p(pn),{text:p(o)("workspace.awaitingPermissionTitle")},{default:me(()=>[d.value?(y(),he(p(Vr),{key:0,variant:"warning",size:"sm"},{default:me(()=>[qe(N(p(o)("workspace.awaitingPermission")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),j(p(pn),{text:p(o)("workspace.abortedTitle")},{default:me(()=>[f.value?(y(),he(p(Vr),{key:0,variant:"danger",size:"sm"},{default:me(()=>[qe(N(p(o)("workspace.aborted")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),!a.value||!m.value?(y(),M("span",pve,N(e.session.time),1)):h.value||e.unread?(y(),M("span",hve,[h.value?(y(),he(p(Ao),{key:0,size:"sm"})):(y(),M("span",mve))])):ee("",!0),W.value?ee("",!0):(y(),M("span",gve,[j(p(pn),{text:e.session.pinned?p(o)("sidebar.unpin"):p(o)("sidebar.pin")},{default:me(()=>[j(p(gn),{class:"pin-btn",size:"sm",label:e.session.pinned?p(o)("sidebar.unpin"):p(o)("sidebar.pin"),onClick:It(Q,["stop"])},{default:me(()=>[j(p(Te),{name:e.session.pinned?"unpin":"pin"},null,8,["name"])]),_:1},8,["label"])]),_:1},8,["text"]),j(p(pn),{text:p(o)("sidebar.archive")},{default:me(()=>[j(p(gn),{class:"archive-btn",size:"sm",label:p(o)("sidebar.archive"),onClick:It(te,["stop"])},{default:me(()=>[j(p(Te),{name:"archive"})]),_:1},8,["label"])]),_:1},8,["text"])]))])]),e.session.cwdLabel!==void 0?(y(),M("div",vve,[j(p(Te),{class:"sub-icon",name:"folder-closed",size:"sm"}),C("span",yve,N(e.session.cwdLabel),1),e.session.pullRequest?(y(),M("button",{key:0,type:"button",class:Re(["pr",`pr--${e.session.pullRequest.state}`]),"aria-label":`PR #${e.session.pullRequest.number}`,onClick:It(ce,["stop"])},[j(p(Te),{name:"git-pull-request",size:"sm"}),C("span",null,"#"+N(e.session.pullRequest.number),1)],10,kve)):ee("",!0)])):ee("",!0),(y(),he(Zr,{to:"body"},[j(as,{name:"menu-pop"},{default:me(()=>[v.value?(y(),he(p(Cl),{key:0,ref_key:"menuRef",ref:k,class:"menu",style:Zt(w.value),onClick:Se[5]||(Se[5]=It(()=>{},["stop"]))},{default:me(()=>[j(p(hn),{danger:Y.value,onClick:fe},{default:me(()=>[j(p(Te),{name:"copy",size:"sm"}),qe(" "+N(Y.value?p(o)("sidebar.copyFailed"):G.value?p(o)("sidebar.copied"):p(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),j(p(hn),{separator:""}),j(p(hn),{onClick:le},{default:me(()=>[j(p(Te),{name:"pencil",size:"sm"}),qe(" "+N(p(o)("sidebar.rename")),1)]),_:1}),j(p(hn),{onClick:U},{default:me(()=>[j(p(Te),{name:"emoji",size:"sm"}),qe(" "+N(p(o)("sidebar.setEmoji")),1)]),_:1}),j(p(hn),{onClick:we},{default:me(()=>[j(p(Te),{name:"git-fork",size:"sm"}),qe(" "+N(p(o)("sidebar.fork")),1)]),_:1}),j(p(hn),{onClick:ge},{default:me(()=>[j(p(Te),{name:"download",size:"sm"}),qe(" "+N(p(o)("sidebar.export")),1)]),_:1}),j(p(hn),{onClick:Q},{default:me(()=>[j(p(Te),{name:e.session.pinned?"unpin":"pin",size:"sm"},null,8,["name"]),qe(" "+N(e.session.pinned?p(o)("sidebar.unpin"):p(o)("sidebar.pin")),1)]),_:1}),j(p(hn),{onClick:te},{default:me(()=>[j(p(Te),{name:"archive",size:"sm"}),qe(" "+N(p(o)("sidebar.archive")),1)]),_:1}),j(p(hn),{separator:""}),C("div",bve,N(l.value),1)]),_:1},8,["style"])):ee("",!0)]),_:1})])),(y(),he(Zr,{to:"body"},[j(as,{name:"menu-pop"},{default:me(()=>[T.value?(y(),he(ive,{key:0,ref_key:"pickerRef",ref:A,class:"picker",style:Zt(E.value),current:x.value.emoji,removable:x.value.rest.length>0,onClick:Se[6]||(Se[6]=It(()=>{},["stop"])),onPick:z},null,8,["style","current","removable"])):ee("",!0)]),_:1})]))],34))}}),Z5=ft(Cve,[["__scopeId","data-v-341acfa2"]]),wve=["draggable"],_ve={class:"gh-top"},xve={class:"gh-name"},Sve=["inert"],Ave={key:0,class:"show-more-row"},Mve=["disabled"],Tve={class:"show-more-label"},Eve={key:1,class:"show-more-sep","aria-hidden":"true"},Ive={class:"show-more-label"},Lve={key:1,class:"group-empty"},$ve=et({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},visibleLimit:{type:Function},pinnedDragSession:{}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","pinSession","dropPinnedSession","expand","collapse","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=R({get:()=>o.renameValue,set:P=>s("updateRenameValue",P)}),r=Z(!1),l=R(()=>o.pinnedDragSession!=null),a=R(()=>o.pinnedDragSession?.workspaceId===o.group.workspace.id);function u(P){if(o.pinnedDragSession!=null){if(!a.value){P.dataTransfer&&(P.dataTransfer.dropEffect="none");return}P.preventDefault(),P.dataTransfer&&(P.dataTransfer.dropEffect="move"),r.value=!0}}function c(P){o.pinnedDragSession==null||!a.value||(P.preventDefault(),r.value=!1,s("dropPinnedSession",o.pinnedDragSession.id))}function d(P){P.currentTarget.contains(P.relatedTarget)||(r.value=!1)}const f=R(()=>o.visibleLimit(o.group.workspace.id)??o.group.initialCount),h=R(()=>{const P=o.group.sessions.slice(0,f.value);if(o.activeId&&!P.some(D=>D.id===o.activeId)){const D=o.group.sessions.find(I=>I.id===o.activeId);if(D)return[...P,D]}return P}),m=R(()=>o.group.sessions.length>f.value||o.group.hasMore||o.group.loadingMore),v=R(()=>f.value>o.group.initialCount);function k(P){o.renameInputRef.value=P instanceof HTMLInputElement?P:null}const{handleCompositionStart:w,handleCompositionEnd:b,isComposingKeyEvent:_}=Ar();function g(P){_(P)||s("confirmRename")}function x(P){_(P)||s("cancelRename")}const S=Z(null);function T(P){o.renamingId!==o.group.workspace.id&&s("groupContextmenu",o.group.workspace,P)}function A(P){P.dataTransfer&&(P.dataTransfer.effectAllowed="move",P.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}function E(P,D){D.dataTransfer&&(D.dataTransfer.effectAllowed="move",D.dataTransfer.setData(Bf,P),D.dataTransfer.setData("text/plain",P))}return(P,D)=>(y(),M("div",{class:Re(["group",{dragging:e.dragging,"pinned-drag-active":l.value&&a.value,"pinned-drop-hover":r.value,"pinned-drop-blocked":l.value&&!a.value}]),onDragover:u,onDrop:c,onDragleave:d},[C("div",{class:Re(["gh",{on:e.group.workspace.id===e.activeWorkspaceId&&e.activeId==="",collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:e.renamingId!==e.group.workspace.id,onClick:D[7]||(D[7]=It(I=>s("groupClick",e.group.workspace.id,I),["stop"])),onContextmenu:T,onDragstart:A,onDragend:D[8]||(D[8]=I=>s("wsDragend"))},[C("div",_ve,[e.isCollapsed(e.group.workspace.id)?(y(),he(p(Te),{key:0,class:"gh-folder",name:"folder-closed"})):(y(),he(p(Te),{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(y(),he(p(pn),{key:2,text:e.group.workspace.root},{default:me(()=>[C("span",xve,N(e.group.workspace.name),1)]),_:1},8,["text"])):Bn((y(),M("input",{key:3,ref:k,"onUpdate:modelValue":D[0]||(D[0]=I=>i.value=I),class:"gh-rename",type:"text",onKeydown:[xl(g,["enter"]),xl(x,["esc"])],onCompositionstart:D[1]||(D[1]=(...I)=>p(w)&&p(w)(...I)),onCompositionend:D[2]||(D[2]=(...I)=>p(b)&&p(b)(...I)),onBlur:D[3]||(D[3]=I=>s("cancelRename")),onClick:D[4]||(D[4]=It(()=>{},["stop"]))},null,544)),[[ai,i.value]]),e.renamingId!==e.group.workspace.id?(y(),M("div",{key:4,class:Re(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[j(p(gn),{class:Re(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:p(n)("sidebar.options"),tooltip:p(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:D[5]||(D[5]=It(I=>s("toggleWsMenu",e.group.workspace,I),["stop"]))},{default:me(()=>[j(p(Te),{name:"dots-horizontal"})]),_:1},8,["class","label","tooltip","aria-expanded"]),j(p(gn),{class:"gh-add",size:"sm",label:p(n)("workspace.newInGroup"),tooltip:p(n)("workspace.newInGroup"),onClick:D[6]||(D[6]=It(I=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:me(()=>[j(p(Te),{name:"chat-new"})]),_:1},8,["label","tooltip"])],2)):ee("",!0)])],42,wve),C("div",{class:Re(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(y(!0),M(Pe,null,pt(h.value,I=>(y(),he(Z5,{key:I.id,session:I,active:I.id===e.activeId,"approval-count":e.pendingBySession[I.id]?.approvals??0,"question-count":e.pendingBySession[I.id]?.questions??0,unread:e.unreadBySession[I.id]??!1,draggable:S.value!==I.id,onDragstart:$=>E(I.id,$),onRenameStateChange:$=>S.value=$?I.id:null,onSelect:D[9]||(D[9]=$=>s("selectSession",$)),onRename:D[10]||(D[10]=($,B)=>s("renameSession",$,B)),onArchive:D[11]||(D[11]=$=>s("archiveSession",$)),onFork:D[12]||(D[12]=$=>s("forkSession",$)),onExport:D[13]||(D[13]=$=>s("exportSession",$)),onPin:D[14]||(D[14]=$=>s("pinSession",$))},null,8,["session","active","approval-count","question-count","unread","draggable","onDragstart","onRenameStateChange"]))),128)),m.value||v.value?(y(),M("div",Ave,[m.value?(y(),M("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:D[15]||(D[15]=It(I=>s("expand",e.group.workspace.id),["stop"]))},[j(p(Te),{name:"chevron-down",size:"sm"}),C("span",Tve,N(e.group.loadingMore?p(n)("sidebar.loadingMore"):p(n)("sidebar.showMore")),1)],8,Mve)):ee("",!0),m.value&&v.value?(y(),M("span",Eve,"·")):ee("",!0),v.value?(y(),M("button",{key:2,class:"show-more",onClick:D[16]||(D[16]=It(I=>s("collapse",e.group.workspace.id),["stop"]))},[j(p(Te),{name:"chevron-up",size:"sm"}),C("span",Ive,N(p(n)("sidebar.showLess")),1)])):ee("",!0)])):ee("",!0),e.group.sessions.length===0?(y(),M("div",Lve,N(e.group.pinnedCount>0?p(n)("sidebar.allPinned",{count:e.group.pinnedCount}):p(n)("sidebar.noSessions")),1)):ee("",!0)],10,Sve)],34))}}),Nve=ft($ve,[["__scopeId","data-v-9586bfbe"]]),Fve={class:"pinned-label"},Rve={class:"pinned-title"},Ove={key:0,class:"pinned-rows"},Pve=["draggable","onDragstart","onDragover","onDrop"],Dve=et({__name:"PinnedSessionList",props:{sessions:{},activeId:{},pendingBySession:{},unreadBySession:{}},emits:["selectSession","renameSession","archiveSession","forkSession","exportSession","pinSession","pinSessionAt","sessionDragStart","sessionDragEnd","reorder"],setup(e,{expose:t,emit:n}){const{t:o}=Nt(),s=e,i=n,r=Z(kQ());function l(){r.value=!r.value,M3(r.value)}function a(){r.value&&(r.value=!1,M3(!1))}t({expand:a});const u=Z(null),c=Z(null),d=Z(null);function f(x,S){if(!S.dataTransfer)return;S.dataTransfer.effectAllowed="move",S.dataTransfer.setData("text/plain",x),u.value=x;const T=s.sessions.find(A=>A.id===x)?.workspaceId;T!==void 0&&i("sessionDragStart",x,T)}function h(){u.value=null,c.value=null,i("sessionDragEnd")}Je(()=>s.sessions,x=>{u.value!==null&&!x.some(S=>S.id===u.value)&&(u.value=null,c.value=null)});function m(x){const S=x.currentTarget.getBoundingClientRect();return x.clientY<S.top+S.height/2?"before":"after"}function v(x){return x.dataTransfer?.types.includes(Bf)??!1}function k(x,S){u.value!==S&&(u.value===null&&!v(x)||(x.preventDefault(),x.dataTransfer&&(x.dataTransfer.dropEffect="move"),c.value={id:S,position:m(x)}))}function w(x,S){const T=u.value,A=c.value?.id===x?c.value.position:"before";if(c.value=null,u.value=null,T!==null){T!==x&&i("reorder",AE(s.sessions.map(P=>P.id),T,x,A));return}const E=S.dataTransfer?.getData(Bf);E&&i("pinSessionAt",E,x,A)}function b(x){if(u.value===null&&!v(x))return;x.preventDefault(),x.dataTransfer&&(x.dataTransfer.dropEffect="move");const S=s.sessions[s.sessions.length-1];S!==void 0&&(c.value={id:S.id,position:"after"})}function _(x){const S=s.sessions.map(E=>E.id),T=u.value;if(c.value=null,u.value=null,T!==null){const E=S[S.length-1];E!==void 0&&T!==E&&i("reorder",[...S.filter(P=>P!==T),T]);return}const A=x.dataTransfer?.getData(Bf);A&&i("pinSessionAt",A,S[S.length-1]??null,"after")}function g(x){x.currentTarget.contains(x.relatedTarget)||(c.value=null)}return(x,S)=>(y(),M("div",{class:"pinned",onDragover:b,onDrop:_,onDragleave:g},[C("div",Fve,[C("span",Rve,N(p(o)("sidebar.pinned")),1),j(p(gn),{class:Re(["pinned-toggle",{"pinned-toggle--on":r.value}]),size:"sm",label:r.value?p(o)("sidebar.expandPinned"):p(o)("sidebar.collapsePinned"),tooltip:r.value?p(o)("sidebar.expandPinned"):p(o)("sidebar.collapsePinned"),onClick:It(l,["stop"])},{default:me(()=>[r.value?(y(),he(p(Te),{key:0,name:"chevron-right"})):(y(),he(p(Te),{key:1,name:"chevron-down"}))]),_:1},8,["class","label","tooltip"])]),r.value?ee("",!0):(y(),M("div",Ove,[(y(!0),M(Pe,null,pt(e.sessions,T=>(y(),M("div",{key:T.id,class:Re(["pin-drop-target",{dragging:u.value===T.id,"drop-before":c.value?.id===T.id&&c.value.position==="before","drop-after":c.value?.id===T.id&&c.value.position==="after"}]),draggable:d.value!==T.id,onDragstart:A=>f(T.id,A),onDragend:h,onDragover:It(A=>k(A,T.id),["stop"]),onDrop:It(A=>w(T.id,A),["stop"])},[j(Z5,{session:T,active:T.id===e.activeId,"approval-count":e.pendingBySession[T.id]?.approvals??0,"question-count":e.pendingBySession[T.id]?.questions??0,unread:e.unreadBySession[T.id]??!1,onRenameStateChange:A=>d.value=A?T.id:null,onSelect:S[0]||(S[0]=A=>i("selectSession",A)),onRename:S[1]||(S[1]=(A,E)=>i("renameSession",A,E)),onArchive:S[2]||(S[2]=A=>i("archiveSession",A)),onFork:S[3]||(S[3]=A=>i("forkSession",A)),onExport:S[4]||(S[4]=A=>i("exportSession",A)),onPin:S[5]||(S[5]=A=>i("pinSession",A))},null,8,["session","active","approval-count","question-count","unread","onRenameStateChange"])],42,Pve))),128))]))],32))}}),Bve=ft(Dve,[["__scopeId","data-v-aec340eb"]]),Hve={class:"ch"},zve={class:"ch-brand"},Wve={class:"ch-tail"},Uve={class:"search-input"},jve={class:"side-section-label"},Vve={class:"side-section-title"},qve={class:"side-section-actions"},Kve={key:0,class:"empty"},Zve=["onDragover","onDrop"],Gve={key:0,class:"empty"},Yve={key:1,class:"show-more-row"},Xve=["disabled"],Jve={class:"show-more-label"},Qve={class:"folder-drop-card"},e9e={class:"view-menu-label"},t9e={class:"view-menu-check"},n9e={class:"view-menu-check"},o9e=!1,s9e=1e3,i9e=et({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},pinnedSessions:{default:()=>[]},flatSessions:{default:()=>[]},flatHasMore:{type:Boolean,default:!1},flatLoadingMore:{type:Boolean,default:!1},initialized:{type:Boolean,default:!1},activeId:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","addWorkspacePaths","rename","archive","fork","export","pin","reorderPinned","pinAt","unpin","renameWorkspace","deleteWorkspace","reorderWorkspaces","loadMoreSessions","loadAllSessions","ensureFlatSessions","loadMoreFlatSessions","openSettings","login","collapse"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z(!1),r=c()?["⌘","K"]:["Ctrl","K"],l=c()?["⌃","⇧","O"]:["Ctrl","Shift","O"];function a(){s("loadAllSessions"),i.value=!0}function u(Qe){(Qe.metaKey||Qe.ctrlKey)&&(Qe.key.toLowerCase()==="k"?(Qe.preventDefault(),a()):!Qe.metaKey&&Qe.ctrlKey&&Qe.shiftKey&&Qe.key.toLowerCase()==="o"&&(Qe.preventDefault(),s("create")))}dn(()=>window.addEventListener("keydown",u)),Vn(()=>window.removeEventListener("keydown",u));function c(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Qe=navigator.userAgentData;return Qe?.platform==="macOS"||Qe?.platform==="iOS"}const d=Z(null),f=Z(!1),h=Z(!1),m=Z(!1);let v=null;function k(Qe=d.value){Qe&&(f.value=Qe.scrollTop>0,h.value=Qe.scrollTop+Qe.clientHeight<Qe.scrollHeight-1)}function w(Qe){k(Qe.target),m.value=!0,v&&clearTimeout(v),v=setTimeout(()=>{m.value=!1,v=null},900)}let b=null;dn(()=>{yt(()=>{k(),typeof ResizeObserver=="function"&&d.value&&(b=new ResizeObserver(()=>k()),b.observe(d.value))})}),Dp(()=>k()),Vn(()=>{b?.disconnect(),v&&clearTimeout(v)});const _=Z(new Set(yQ()));function g(Qe){return _.value.has(Qe)}function x(Qe){const st=new Set(_.value);st.has(Qe)?st.delete(Qe):st.add(Qe),_.value=st,p9(st)}function S(){const Qe=new Set(o.groups.map(st=>st.workspace.id));_.value=Qe,p9(Qe)}function T(){const Qe=new Set;_.value=Qe,p9(Qe)}const A=R(()=>o.groups.length>0&&o.groups.every(Qe=>_.value.has(Qe.workspace.id))),E=Z(new Map);function P(Qe){return E.value.get(Qe)}function D(Qe){const st=o.groups.find(kn=>kn.workspace.id===Qe);if(!st)return;const Ct=(E.value.get(Qe)??st.initialCount)+O5,Qt=new Map(E.value);Qt.set(Qe,Ct),E.value=Qt,st.sessions.length<Ct&&st.hasMore&&s("loadMoreSessions",Qe)}function I(Qe){if(!E.value.has(Qe))return;const st=new Map(E.value);st.delete(Qe),E.value=st}const $=Z(null),B=Z(null);function H(Qe){$.value=Qe}function O(){$.value=null,B.value=null}function F(Qe){const st=Qe.currentTarget.getBoundingClientRect();return Qe.clientY<st.top+st.height/2?"before":"after"}function U(Qe,st){$.value===null||$.value===st||(Qe.preventDefault(),Qe.dataTransfer&&(Qe.dataTransfer.dropEffect="move"),B.value={id:st,position:F(Qe)})}function z(Qe){const st=$.value,Ct=B.value?.id===Qe?B.value.position:"before";if(B.value=null,$.value=null,!st||st===Qe)return;const Qt=AE(o.groups.map(kn=>kn.workspace.id),st,Qe,Ct);s("reorderWorkspaces",Qt)}const W=Z(null);function K(Qe,st){W.value={id:Qe,workspaceId:st}}function V(){W.value=null}function ie(Qe){W.value=null,s("unpin",Qe)}const ne=Z(bQ());function X(Qe){ne.value!==Qe&&(ne.value=Qe,CQ(Qe),Qe==="flat"&&s("ensureFlatSessions"))}Je(()=>o.initialized,Qe=>{Qe&&ne.value==="flat"&&s("ensureFlatSessions")},{immediate:!0});const le=Z(!1),Ie=Z({}),de=Z(null);function pe(Qe){const st=Qe.target;st.closest(".view-menu")||st.closest(".side-section-view")||oe()}async function ve(Qe){if(le.value){oe();return}const st=Qe.currentTarget;le.value=!0,document.addEventListener("mousedown",pe),window.addEventListener("resize",oe),await yt();const Ct=de.value?.el,Qt=st.getBoundingClientRect(),kn=4,Ko=8,Eo=Ct?.offsetHeight??0,bo=Ct?.offsetWidth??0;let Ns=Qt.bottom+kn,Do=!1;Ns+Eo>window.innerHeight-Ko&&(Ns=Math.max(Ko,Qt.top-Eo-kn),Do=!0);let Io=Qt.right-bo;Io<Ko&&(Io=Ko),Ie.value={top:`${Math.round(Ns)}px`,left:`${Math.round(Io)}px`,transformOrigin:Do?"bottom right":"top right","--menu-pop-shift":Do?"2px":"-2px"}}function oe(){le.value=!1,document.removeEventListener("mousedown",pe),window.removeEventListener("resize",oe)}function ye(Qe){X(Qe),oe()}const G=Z(null);function Y(Qe,st){st.dataTransfer&&(st.dataTransfer.effectAllowed="move",st.dataTransfer.setData(Bf,Qe),st.dataTransfer.setData("text/plain",Qe))}const fe=Z(!1);function we(Qe){ne.value!=="flat"||W.value===null||(Qe.preventDefault(),Qe.dataTransfer&&(Qe.dataTransfer.dropEffect="move"),fe.value=!0)}function ge(Qe){ne.value!=="flat"||W.value===null||(Qe.preventDefault(),fe.value=!1,ie(W.value.id))}function Q(Qe){Qe.currentTarget.contains(Qe.relatedTarget)||(fe.value=!1)}function te(Qe,st){st.target.closest(".gh-more, .gh-add")||x(Qe)}function ce(Qe){s("select",Qe)}const ue=Z(null);function Se(Qe){ue.value?ue.value.expand():M3(!1),s("pin",Qe)}function ze(Qe,st,Ct){ue.value?.expand(),s("pinAt",Qe,st,Ct)}const _e=Z(0),Ee=Z(!1);function it(){_e.value=0,Ee.value=!1}function Fe(Qe){!ih()||!c9(Qe)||(Qe.preventDefault(),Qe.stopPropagation(),_e.value+=1,Ee.value=!0)}function Oe(Qe){!ih()||!c9(Qe)||(Qe.preventDefault(),Qe.stopPropagation(),Qe.dataTransfer&&(Qe.dataTransfer.dropEffect="copy"))}function Ge(Qe){!ih()||!c9(Qe)||(_e.value=Math.max(0,_e.value-1),_e.value===0&&(Ee.value=!1))}function at(Qe){if(it(),!ih())return;const st=bJ(Qe);st.length!==0&&(Qe.preventDefault(),Qe.stopPropagation(),s("addWorkspacePaths",st))}const Tt=Z(null),Bt=Z(""),Yt=Z(""),Sn=Z(null);function on(){return Sn}function en(Qe,st){Tt.value=Qe,Yt.value=st,Bt.value=st,yt().then(()=>Sn.value?.focus())}function Cn(){const Qe=Tt.value,st=Bt.value.trim();Qe&&st&&st!==Yt.value&&s("renameWorkspace",Qe,st),Tt.value=null}function Mn(){Tt.value=null}function We(Qe){Bt.value=Qe}const tt=Z(!1),Ue=Z(null),Lt=Z({}),gt=Z(null);function wn(Qe){gt.value?.el&&!gt.value.el.contains(Qe.target)&&go()}function yn(Qe,st){st.preventDefault(),st.stopPropagation(),Ue.value=Qe,Lt.value={top:`${st.clientY}px`,left:`${st.clientX}px`,transformOrigin:"top left","--menu-pop-shift":"-2px"},tt.value=!0,document.addEventListener("mousedown",wn,!0)}function go(){tt.value=!1,document.removeEventListener("mousedown",wn,!0),Ue.value=null}function qt(){Ue.value&&Zs(Ue.value.root),go()}function ps(){Ue.value&&en(Ue.value.id,Ue.value.name),go()}function xs(){const Qe=Ue.value;Qe&&(go(),s("deleteWorkspace",Qe.id))}const _n=Z(null),In=Z(null),To=Z({}),lo=Z(null);function St(Qe){const st=Qe.target;st.closest(".gh-more")||st.closest(".ws-menu")||Jo()}async function hs(Qe,st){if(_n.value===Qe.id){Jo();return}const Ct=st.currentTarget;In.value=Qe,_n.value=Qe.id,document.addEventListener("mousedown",St),window.addEventListener("resize",Jo),await yt();const Qt=lo.value?.el,kn=Ct.getBoundingClientRect(),Ko=4,Eo=8,bo=Qt?.offsetHeight??0,Ns=Qt?.offsetWidth??0;let Do=kn.bottom+Ko,Io=!1;Do+bo>window.innerHeight-Eo&&(Do=Math.max(Eo,kn.top-bo-Ko),Io=!0);let Qo=kn.right-Ns;Qo<Eo&&(Qo=Eo),To.value={top:`${Math.round(Do)}px`,left:`${Math.round(Qo)}px`,transformOrigin:Io?"bottom right":"top right","--menu-pop-shift":Io?"2px":"-2px"}}function Jo(){_n.value=null,In.value=null,document.removeEventListener("mousedown",St),window.removeEventListener("resize",Jo)}function uo(Qe){Zs(Qe.root),Jo()}function Ys(Qe){en(Qe.id,Qe.name),Jo()}function Nn(Qe){Jo(),s("deleteWorkspace",Qe.id)}Vn(()=>{document.removeEventListener("mousedown",wn,!0),document.removeEventListener("mousedown",St),document.removeEventListener("mousedown",pe),window.removeEventListener("resize",Jo),window.removeEventListener("resize",oe)});const no=Z(null);let $s;function Xs(){const Qe=no.value;Qe&&(Qe.classList.remove("blink-now"),Qe.getBoundingClientRect(),Qe.classList.add("blink-now"),clearTimeout($s),$s=setTimeout(()=>Qe.classList.remove("blink-now"),300))}const ci=zr(()=>jo(()=>import("./DesignSystemView-xF63Uyfo.js"),__vite__mapDeps([8,9]))),Oo=Z(!1);let vo,Po=!1;function co(Qe){Po=!1,clearTimeout(vo),Qe.currentTarget.setPointerCapture?.(Qe.pointerId),vo=setTimeout(()=>{Po=!0,Oo.value=!0},s9e)}function Tn(Qe){clearTimeout(vo);const st=Qe.currentTarget;st.hasPointerCapture?.(Qe.pointerId)&&st.releasePointerCapture(Qe.pointerId)}function fo(){if(Po){Po=!1;return}Xs()}return Vn(()=>{clearTimeout(vo)}),(Qe,st)=>(y(),M("aside",{class:Re(["side",{"macos-desktop":p(rc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:Zt({width:e.collapsed?"0px":e.colWidth+"px"})},[C("div",{class:"col",style:Zt({width:e.colWidth+"px"}),onDragenter:Fe,onDragover:Oe,onDragleave:Ge,onDrop:at},[C("div",Hve,[C("div",zve,[p(rc)?ee("",!0):(y(),M(Pe,{key:0},[(y(),M("svg",{ref_key:"logoRef",ref:no,class:"ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:fo,onPointerdown:co,onPointerup:Tn,onPointercancel:Tn},[...st[31]||(st[31]=[iu('<defs data-v-a80a4ba6><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-a80a4ba6><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-a80a4ba6></rect><g class="ch-eyes" fill="#000" data-v-a80a4ba6><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-a80a4ba6></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-a80a4ba6></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-a80a4ba6></rect>',2)])],544)),st[32]||(st[32]=C("span",{class:"ch-name"},"Kimi Code",-1))],64))]),C("div",Wve,[p(rc)?ee("",!0):(y(),he(p(gn),{key:0,class:"ch-collapse",size:"sm",label:p(n)("sidebar.collapseSidebar"),tooltip:p(n)("sidebar.collapseSidebar"),onClick:st[0]||(st[0]=It(Ct=>s("collapse"),["stop"]))},{default:me(()=>[j(p(Te),{name:"panel-collapse"})]),_:1},8,["label","tooltip"])),j(b0e)])]),C("div",{class:Re(["sidebar-actions",{"sidebar-actions--has-workspace-action":o9e}])},[C("button",{class:"btn-new-chat",type:"button",onClick:st[1]||(st[1]=It(Ct=>s("create"),["stop"]))},[j(p(Te),{name:"chat-new"}),C("span",null,N(p(n)("sidebar.newChat")),1),j(p(oa),{keys:p(l)},null,8,["keys"])]),ee("",!0),C("button",{class:"search",type:"button",onClick:a},[j(p(Te),{class:"search-icon",name:"search"}),C("span",Uve,N(p(n)("sidebar.search")),1),j(p(oa),{keys:p(r)},null,8,["keys"])])],2),ne.value==="flat"||e.groups.length>0?(y(),M("div",{key:0,class:Re(["sessions-head",{"sessions-head--scrolled":f.value}])},[e.pinnedSessions.length>0?(y(),he(Bve,{key:0,ref_key:"pinnedListRef",ref:ue,sessions:e.pinnedSessions,"active-id":e.activeId,"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,onSelectSession:ce,onRenameSession:st[3]||(st[3]=(Ct,Qt)=>s("rename",Ct,Qt)),onArchiveSession:st[4]||(st[4]=Ct=>s("archive",Ct)),onForkSession:st[5]||(st[5]=Ct=>s("fork",Ct)),onExportSession:st[6]||(st[6]=Ct=>s("export",Ct)),onPinSession:Se,onPinSessionAt:ze,onSessionDragStart:K,onSessionDragEnd:V,onReorder:st[7]||(st[7]=Ct=>s("reorderPinned",Ct))},null,8,["sessions","active-id","pending-by-session","unread-by-session"])):ee("",!0),C("div",jve,[C("span",Vve,N(p(n)("sidebar.sessionsHeader")),1),C("div",qve,[ne.value==="grouped"?(y(),he(p(gn),{key:0,class:"side-section-toggle",size:"sm",label:A.value?p(n)("sidebar.expandAll"):p(n)("sidebar.collapseAll"),tooltip:A.value?p(n)("sidebar.expandAll"):p(n)("sidebar.collapseAll"),onClick:st[8]||(st[8]=It(Ct=>A.value?T():S(),["stop"]))},{default:me(()=>[A.value?(y(),he(p(Te),{key:0,name:"expand"})):(y(),he(p(Te),{key:1,name:"collapse"}))]),_:1},8,["label","tooltip"])):ee("",!0),j(p(pn),{text:p(n)("sidebar.viewSwitcher")},{default:me(()=>[j(p(gn),{class:"side-section-toggle side-section-view",size:"sm",label:p(n)("sidebar.viewSwitcher"),onClick:It(ve,["stop"])},{default:me(()=>[j(p(Te),{name:"list-settings"})]),_:1},8,["label"])]),_:1},8,["text"])])])],2)):ee("",!0),C("div",{ref_key:"sessionsEl",ref:d,class:Re(["sessions",{scrolling:m.value,"pinned-drag-active":ne.value==="flat"&&W.value!==null,"flat-pinned-drop-hover":fe.value}]),onScroll:w,onDragover:we,onDrop:ge,onDragleave:Q},[ne.value==="grouped"?(y(),M(Pe,{key:0},[e.groups.length===0?(y(),M("div",Kve,N(p(n)("workspace.noWorkspace")),1)):(y(!0),M(Pe,{key:1},pt(e.groups,Ct=>(y(),M("div",{key:Ct.workspace.id,class:Re(["ws-drop-target",{"drop-before":B.value?.id===Ct.workspace.id&&B.value.position==="before","drop-after":B.value?.id===Ct.workspace.id&&B.value.position==="after"}]),onDragover:Qt=>U(Qt,Ct.workspace.id),onDrop:Qt=>z(Ct.workspace.id)},[j(Nve,{group:Ct,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":Tt.value,"rename-value":Bt.value,"rename-input-ref":on(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":_n.value,dragging:$.value===Ct.workspace.id,"is-collapsed":g,"visible-limit":P,"pinned-drag-session":W.value,onGroupClick:te,onGroupContextmenu:yn,onToggleWsMenu:hs,onCreateInWorkspace:st[9]||(st[9]=Qt=>s("createInWorkspace",Qt)),onSelectSession:ce,onRenameSession:st[10]||(st[10]=(Qt,kn)=>s("rename",Qt,kn)),onArchiveSession:st[11]||(st[11]=Qt=>s("archive",Qt)),onForkSession:st[12]||(st[12]=Qt=>s("fork",Qt)),onExportSession:st[13]||(st[13]=Qt=>s("export",Qt)),onPinSession:Se,onDropPinnedSession:ie,onExpand:D,onCollapse:I,onConfirmRename:Cn,onCancelRename:Mn,onUpdateRenameValue:We,onWsDragstart:H,onWsDragend:O},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging","pinned-drag-session"])],42,Zve))),128))],64)):(y(),M(Pe,{key:1},[(y(!0),M(Pe,null,pt(e.flatSessions,Ct=>(y(),he(Z5,{key:Ct.id,session:Ct,active:Ct.id===e.activeId,"approval-count":e.pendingBySession[Ct.id]?.approvals??0,"question-count":e.pendingBySession[Ct.id]?.questions??0,unread:e.unreadBySession[Ct.id]??!1,draggable:G.value!==Ct.id,onDragstart:Qt=>Y(Ct.id,Qt),onRenameStateChange:Qt=>G.value=Qt?Ct.id:null,onSelect:ce,onRename:st[14]||(st[14]=(Qt,kn)=>s("rename",Qt,kn)),onArchive:st[15]||(st[15]=Qt=>s("archive",Qt)),onFork:st[16]||(st[16]=Qt=>s("fork",Qt)),onExport:st[17]||(st[17]=Qt=>s("export",Qt)),onPin:Se},null,8,["session","active","approval-count","question-count","unread","draggable","onDragstart","onRenameStateChange"]))),128)),e.flatSessions.length===0&&!e.flatHasMore&&e.pinnedSessions.length===0?(y(),M("div",Gve,N(p(n)("sidebar.noSessions")),1)):ee("",!0),e.flatHasMore?(y(),M("div",Yve,[C("button",{class:"show-more",disabled:e.flatLoadingMore,onClick:st[18]||(st[18]=It(Ct=>s("loadMoreFlatSessions"),["stop"]))},[C("span",Jve,N(e.flatLoadingMore?p(n)("sidebar.loadingMore"):p(n)("sidebar.loadMore")),1),j(p(Te),{name:"chevron-down",size:"sm"})],8,Xve)])):ee("",!0)],64))],34),C("div",{class:Re(["side-footer",{"side-footer--shadowed":h.value}])},[j(V2e,{onLogin:st[19]||(st[19]=Ct=>s("login")),onOpenSettings:st[20]||(st[20]=Ct=>s("openSettings"))})],2),C("div",{class:Re(["folder-drop-overlay",{show:Ee.value}]),"aria-hidden":"true"},[C("div",Qve,[j(p(Te),{name:"folder",size:"lg"}),C("span",null,N(p(n)("sidebar.dropToAddWorkspace")),1)])],2)],36),j(as,{name:"menu-pop"},{default:me(()=>[tt.value?(y(),he(p(Cl),{key:0,ref_key:"ghMenuRef",ref:gt,class:"gh-menu",style:Zt(Lt.value),onClick:st[21]||(st[21]=It(()=>{},["stop"]))},{default:me(()=>[j(p(hn),{onClick:qt},{default:me(()=>[j(p(Te),{name:"copy",size:"sm"}),qe(" "+N(p(n)("sidebar.copyPath")),1)]),_:1}),j(p(hn),{class:"workspace-rename-item",onClick:ps},{default:me(()=>[j(p(Te),{name:"pencil",size:"sm"}),qe(" "+N(p(n)("sidebar.rename")),1)]),_:1}),j(p(hn),{danger:"",onClick:xs},{default:me(()=>[j(p(Te),{name:"close",size:"sm"}),qe(" "+N(p(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ee("",!0)]),_:1}),j(as,{name:"menu-pop"},{default:me(()=>[_n.value!==null&&In.value?(y(),he(p(Cl),{key:0,ref_key:"wsMenuRef",ref:lo,class:"ws-menu",style:Zt(To.value),onClick:st[25]||(st[25]=It(()=>{},["stop"]))},{default:me(()=>[j(p(hn),{onClick:st[22]||(st[22]=Ct=>uo(In.value))},{default:me(()=>[j(p(Te),{name:"copy",size:"sm"}),qe(" "+N(p(n)("sidebar.copyPath")),1)]),_:1}),j(p(hn),{class:"workspace-rename-item",onClick:st[23]||(st[23]=Ct=>Ys(In.value))},{default:me(()=>[j(p(Te),{name:"pencil",size:"sm"}),qe(" "+N(p(n)("sidebar.rename")),1)]),_:1}),j(p(hn),{danger:"",onClick:st[24]||(st[24]=Ct=>Nn(In.value))},{default:me(()=>[j(p(Te),{name:"close",size:"sm"}),qe(" "+N(p(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ee("",!0)]),_:1}),j(as,{name:"menu-pop"},{default:me(()=>[le.value?(y(),he(p(Cl),{key:0,ref_key:"viewMenuRef",ref:de,class:"view-menu",style:Zt(Ie.value),onClick:st[28]||(st[28]=It(()=>{},["stop"]))},{default:me(()=>[C("div",e9e,N(p(n)("sidebar.viewGroup")),1),j(p(hn),{onClick:st[26]||(st[26]=Ct=>ye("flat"))},{default:me(()=>[j(p(Te),{name:"list",size:"sm"}),qe(" "+N(p(n)("sidebar.viewFlat"))+" ",1),C("span",t9e,[ne.value==="flat"?(y(),he(p(Te),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1}),j(p(hn),{onClick:st[27]||(st[27]=Ct=>ye("grouped"))},{default:me(()=>[j(p(Te),{name:"tree-view",size:"sm"}),qe(" "+N(p(n)("sidebar.viewGrouped"))+" ",1),C("span",n9e,[ne.value==="grouped"?(y(),he(p(Te),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1})]),_:1},8,["style"])):ee("",!0)]),_:1}),i.value?(y(),he(uee,{key:0,sessions:e.sessions,"active-id":e.activeId,onSelect:ce,onClose:st[29]||(st[29]=Ct=>i.value=!1)},null,8,["sessions","active-id"])):ee("",!0),(y(),he(Zr,{to:"body"},[Oo.value?(y(),he(p(ci),{key:0,onClose:st[30]||(st[30]=Ct=>Oo.value=!1)})):ee("",!0)]))],6))}}),r9e=ft(i9e,[["__scopeId","data-v-a80a4ba6"]]),l9e=["aria-label"],a9e=et({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{},applyLive:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),{width:i,dragging:r,cursor:l,onPointerDown:a}=She({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse,applyLive:n.applyLive});return o("update:width",i.value),Je(i,u=>o("update:width",u)),Je(r,u=>o("update:dragging",u)),(u,c)=>(y(),M("div",{class:Re(["rh",{dragging:p(r)}]),style:Zt({cursor:p(l)}),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??p(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...d)=>p(a)&&p(a)(...d))},[...c[1]||(c[1]=[C("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],46,l9e))}}),Zx=ft(a9e,[["__scopeId","data-v-1c6dfdc5"]]),u9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function c9e(e,t){return y(),M("svg",u9e,[...t[0]||(t[0]=[C("path",{d:"M12.0684 2.03418C12.5654 2.03421 12.9687 2.43755 12.9688 2.93457V11.0996H21.0654C21.5625 11.0996 21.9658 11.503 21.9658 12C21.9658 12.497 21.5625 12.9004 21.0654 12.9004H12.9688V21.0654C12.9687 21.5624 12.5654 21.9658 12.0684 21.9658C11.5713 21.9658 11.168 21.5625 11.168 21.0654V12.9004H2.93457C2.43751 12.9004 2.03418 12.4971 2.03418 12C2.03418 11.5029 2.43751 11.0996 2.93457 11.0996H11.168V2.93457C11.168 2.43753 11.5713 2.03418 12.0684 2.03418Z",fill:"currentColor"},null,-1)])])}const d9e=kt({name:"kimi-add",render:c9e}),f9e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function p9e(e,t){return y(),M("svg",f9e,[...t[0]||(t[0]=[C("path",{id:"p0",d:"M 0 -9.9 C -5.468 -9.9 -9.9 -5.468 -9.9 0 C -9.9 1.923 -9.351 3.719 -8.402 5.239 C -8.402 5.239 -9.483 7.821 -9.483 7.821 C -9.896 8.809 -9.171 9.9 -8.099 9.9 C -8.099 9.9 0 9.9 0 9.9 C 5.468 9.9 9.9 5.468 9.9 0 C 9.9 -5.468 5.468 -9.9 0 -9.9 Z M -8.1 0 C -8.1 -4.474 -4.474 -8.1 0 -8.1 C 4.473 -8.1 8.1 -4.474 8.1 0 C 8.1 4.473 4.473 8.1 -0.001 8.1 C -0.001 8.1 -7.648 8.1 -7.648 8.1 L -6.365 5.035 C -6.365 5.035 -6.648 4.629 -6.648 4.629 C -7.563 3.317 -8.1 1.723 -8.1 0 Z",transform:"matrix(1 0 0 1 12 12)",fill:"currentColor","fill-rule":"evenodd"},null,-1),C("path",{id:"p1",d:"M 3.6 0.5 L -2.6 0.5 M 0.5 -2.573 L 0.5 3.573",transform:"translate(11.5 11.5)",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"},null,-1)])])}const h9e=kt({name:"kimi-add-conversation",render:p9e}),m9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function g9e(e,t){return y(),M("svg",m9e,[...t[0]||(t[0]=[C("path",{d:"M15.0996 12C15.5967 12 16 12.4033 16 12.9004C15.9998 13.3973 15.5965 13.7998 15.0996 13.7998H8.90039C8.40346 13.7998 8.00021 13.3973 8 12.9004C8 12.4033 8.40333 12 8.90039 12H15.0996Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19 3.2002C20.5464 3.2002 21.7998 4.4536 21.7998 6V7C21.7998 8.03565 21.2363 8.93754 20.4004 9.42188V17C20.4004 19.1539 18.6539 20.9004 16.5 20.9004H7.5C5.34609 20.9004 3.59961 19.1539 3.59961 17V9.42188C2.76374 8.93754 2.2002 8.03565 2.2002 7V6C2.2002 4.4536 3.4536 3.2002 5 3.2002H19ZM5.40039 17C5.40039 18.1598 6.3402 19.0996 7.5 19.0996H16.5C17.6598 19.0996 18.5996 18.1598 18.5996 17V9.7998H5.40039V17ZM4.89746 5.00488C4.39333 5.05621 4 5.48232 4 6V7L4.00488 7.10254C4.05278 7.57297 4.42703 7.94722 4.89746 7.99512L5 8H19C19.5523 8 20 7.55228 20 7V6C20 5.44772 19.5523 5 19 5H5L4.89746 5.00488Z",fill:"currentColor"},null,-1)])])}const v9e=kt({name:"kimi-archive",render:g9e}),y9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function k9e(e,t){return y(),M("svg",y9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.386 21.6387C11.7378 21.988 12.3059 21.987 12.6565 21.6364L18.1949 16.098C18.5464 15.7465 18.5464 15.1766 18.1949 14.8252C17.8434 14.4737 17.2736 14.4737 16.9221 14.8252L12.9201 18.8272V3.00002C12.9201 2.50297 12.5171 2.10003 12.0201 2.10003C11.523 2.10003 11.1201 2.50297 11.1201 3.00002V18.8383L7.07554 14.8229C6.7228 14.4727 6.15295 14.4747 5.80275 14.8275C5.45255 15.1802 5.45461 15.7501 5.80735 16.1003L11.386 21.6387Z",fill:"currentColor"},null,-1)])])}const b9e=kt({name:"kimi-arrow-down",render:k9e}),C9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function w9e(e,t){return y(),M("svg",C9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.16127 12.814C1.81197 12.4622 1.81299 11.8941 2.16357 11.5435L7.70203 6.00506C8.0535 5.65359 8.62335 5.65359 8.97482 6.00506C9.32629 6.35653 9.32629 6.92638 8.97482 7.27785L4.97276 11.2799H20.8C21.297 11.2799 21.7 11.6829 21.7 12.1799C21.7 12.677 21.297 13.0799 20.8 13.0799H4.96171L8.97712 17.1244C9.32732 17.4772 9.32526 18.047 8.97252 18.3972C8.61978 18.7474 8.04993 18.7454 7.69973 18.3926L2.16127 12.814Z",fill:"currentColor"},null,-1)])])}const _9e=kt({name:"kimi-arrow-left",render:w9e}),x9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function S9e(e,t){return y(),M("svg",x9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21.4387 12.814C21.788 12.4622 21.787 11.8941 21.4364 11.5436L15.8979 6.0051C15.5464 5.65363 14.9766 5.65363 14.6251 6.0051C14.2737 6.35657 14.2737 6.92642 14.6251 7.27789L18.6272 11.28H2.79998C2.30293 11.28 1.89998 11.6829 1.89998 12.18C1.89998 12.677 2.30293 13.08 2.79998 13.08H18.6382L14.6228 17.1245C14.2726 17.4772 14.2747 18.0471 14.6274 18.3973C14.9802 18.7475 15.55 18.7454 15.9002 18.3927L21.4387 12.814Z",fill:"currentColor"},null,-1)])])}const A9e=kt({name:"kimi-arrow-right",render:S9e}),M9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function T9e(e,t){return y(),M("svg",M9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.386 2.36129C11.7378 2.01198 12.3059 2.013 12.6565 2.36358L18.1949 7.90204C18.5464 8.25351 18.5464 8.82336 18.1949 9.17483C17.8434 9.52631 17.2736 9.52631 16.9221 9.17483L12.9201 5.17277V21C12.9201 21.497 12.5171 21.9 12.0201 21.9C11.523 21.9 11.1201 21.497 11.1201 21V5.16172L7.07554 9.17713C6.7228 9.52733 6.15295 9.52527 5.80275 9.17253C5.45255 8.81979 5.45461 8.24995 5.80735 7.89975L11.386 2.36129Z",fill:"currentColor"},null,-1)])])}const E9e=kt({name:"kimi-arrow-up",render:T9e}),I9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function L9e(e,t){return y(),M("svg",I9e,[...t[0]||(t[0]=[C("path",{d:"M19.3027 5.9053C19.6542 5.55397 20.2247 5.55388 20.5761 5.9053C20.9273 6.25675 20.9273 6.82734 20.5761 7.17874L9.65911 18.0948C9.30773 18.4461 8.73814 18.446 8.38665 18.0948L3.42376 13.1328C3.0726 12.7814 3.07263 12.2118 3.42376 11.8604C3.77524 11.509 4.34575 11.5089 4.6972 11.8604L9.02239 16.1856L19.3027 5.9053Z",fill:"currentColor"},null,-1)])])}const $9e=kt({name:"kimi-check",render:L9e}),N9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function F9e(e,t){return y(),M("svg",N9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.3912 16.7134C11.743 17.0627 12.3111 17.0617 12.6617 16.7111L19.6364 9.73641C19.9878 9.38494 19.9878 8.81509 19.6364 8.46362C19.2849 8.11215 18.7151 8.11215 18.3636 8.46362L12.023 14.8042L5.63407 8.46132C5.28133 8.11112 4.71149 8.11318 4.36129 8.46592C4.01109 8.81866 4.01314 9.3885 4.36588 9.73871L11.3912 16.7134Z",fill:"currentColor"},null,-1)])])}const R9e=kt({name:"kimi-chevron-down",render:F9e}),O9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function P9e(e,t){return y(),M("svg",O9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.1261 12.6088C16.4754 12.257 16.4743 11.6889 16.1238 11.3383L9.14904 4.36363C8.79757 4.01216 8.22772 4.01216 7.87625 4.36363C7.52477 4.7151 7.52477 5.28495 7.87625 5.63642L14.2169 11.977L7.87395 18.3659C7.52375 18.7187 7.52581 19.2885 7.87855 19.6387C8.23129 19.9889 8.80113 19.9869 9.15133 19.6341L16.1261 12.6088Z",fill:"currentColor"},null,-1)])])}const D9e=kt({name:"kimi-chevron-right",render:P9e}),B9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function H9e(e,t){return y(),M("svg",B9e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.3912 8.46132C11.743 8.11202 12.3111 8.11304 12.6617 8.46362L19.6364 15.4383C19.9878 15.7898 19.9878 16.3597 19.6364 16.7111C19.2849 17.0626 18.7151 17.0626 18.3636 16.7111L12.023 10.3705L5.63407 16.7134C5.28133 17.0636 4.71149 17.0616 4.36129 16.7088C4.01109 16.3561 4.01314 15.7862 4.36588 15.436L11.3912 8.46132Z",fill:"currentColor"},null,-1)])])}const z9e=kt({name:"kimi-chevron-up",render:H9e}),W9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function U9e(e,t){return y(),M("svg",W9e,[...t[0]||(t[0]=[C("path",{d:"M11.8999 6.79965C12.397 6.79965 12.7997 7.20235 12.7997 7.69941V11.7266L14.7359 13.6629C15.0873 14.0143 15.0879 14.584 14.7366 14.9355C14.3852 15.287 13.8148 15.287 13.4633 14.9355L11.2632 12.7355C11.0947 12.5668 11.0002 12.338 11.0001 12.0995V7.69941C11.0001 7.20238 11.4029 6.7997 11.8999 6.79965Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 1.89893C17.4677 1.89893 21.9001 6.33147 21.9002 11.7991C21.9002 17.2669 17.4678 21.6993 12 21.6993C6.53228 21.6993 2.09985 17.2669 2.09985 11.7991C2.09998 6.33147 6.53236 1.89893 12 1.89893ZM20.1 11.7998C20.1 7.32616 16.4737 3.69984 12 3.69984C7.5264 3.69984 3.90008 7.32616 3.90008 11.7998C3.90032 16.2732 7.52655 19.8998 12 19.8998C16.4735 19.8998 20.0998 16.2732 20.1 11.7998Z",fill:"currentColor"},null,-1)])])}const j9e=kt({name:"kimi-clock",render:U9e}),V9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function q9e(e,t){return y(),M("svg",V9e,[...t[0]||(t[0]=[C("path",{d:"M17.9542 4.77253C18.3056 4.42106 18.8761 4.42106 19.2276 4.77253C19.579 5.12401 19.579 5.69452 19.2276 6.04597L13.2735 12.0001L19.2276 17.9542C19.5791 18.3056 19.5791 18.8761 19.2276 19.2276C18.8761 19.5791 18.3056 19.5791 17.9542 19.2276L12.0001 13.2735L6.04595 19.2276C5.69451 19.5791 5.12399 19.579 4.77252 19.2276C4.42104 18.8761 4.42104 18.3056 4.77252 17.9542L10.7266 12.0001L4.77252 6.04597C4.42104 5.6945 4.42104 5.124 4.77252 4.77253C5.12399 4.42107 5.69448 4.42106 6.04595 4.77253L12.0001 10.7266L17.9542 4.77253Z",fill:"currentColor"},null,-1)])])}const K9e=kt({name:"kimi-close",render:q9e}),Z9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function G9e(e,t){return y(),M("svg",Z9e,[...t[0]||(t[0]=[C("path",{d:"M9.85815 11.957C10.9074 11.957 11.7583 12.8083 11.7585 13.8574V19.8574C11.7585 20.3545 11.3552 20.7578 10.8582 20.7578C10.3611 20.7578 9.95776 20.3545 9.95776 19.8574V13.8574C9.95755 13.8024 9.91325 13.7578 9.85815 13.7578H3.85815C3.3611 13.7578 2.95776 13.3545 2.95776 12.8574C2.95798 12.3605 3.36123 11.957 3.85815 11.957H9.85815Z",fill:"currentColor"},null,-1),C("path",{d:"M12.8582 2.95703C13.3551 2.95703 13.7583 3.36054 13.7585 3.85742V9.85742C13.7585 9.91265 13.8029 9.95703 13.8582 9.95703H19.8582C20.3551 9.95703 20.7583 10.3605 20.7585 10.8574C20.7585 11.3545 20.3552 11.7578 19.8582 11.7578H13.8582C12.8088 11.7578 11.9578 10.9068 11.9578 9.85742V3.85742C11.958 3.36054 12.3612 2.95703 12.8582 2.95703Z",fill:"currentColor"},null,-1)])])}const Y9e=kt({name:"kimi-collapse",render:G9e}),X9e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function J9e(e,t){return y(),M("svg",X9e,[...t[0]||(t[0]=[C("path",{d:"M11.9004 2.19995C17.3678 2.20016 21.7998 6.63285 21.7998 12.1003C21.7996 17.5677 17.3677 21.9995 11.9004 21.9998H3.80078C2.72946 21.9996 2.00334 20.9089 2.41699 19.9207L3.49805 17.3386C2.54871 15.8189 2.00007 14.0226 2 12.1003C2 6.63272 6.43277 2.19995 11.9004 2.19995ZM11.9004 3.99976C7.42688 3.99976 3.7998 7.62684 3.7998 12.1003C3.79989 13.8228 4.33669 15.4175 5.25195 16.7292L5.53516 17.1345L4.25195 20.2H11.8994C16.3727 20.1999 19.9998 16.5736 20 12.1003C20 7.62697 16.3737 3.99997 11.9004 3.99976ZM8.9541 10.8005C9.75473 10.8006 10.4041 11.4491 10.4043 12.2498C10.4043 13.0505 9.75482 13.6998 8.9541 13.7C8.15329 13.7 7.50391 13.0506 7.50391 12.2498C7.50406 11.4491 8.15339 10.8005 8.9541 10.8005ZM15.1533 10.8005C15.9539 10.8006 16.6034 11.4491 16.6035 12.2498C16.6035 13.0505 15.954 13.6998 15.1533 13.7C14.3525 13.7 13.7031 13.0506 13.7031 12.2498C13.7033 11.4491 14.3526 10.8005 15.1533 10.8005Z",fill:"currentColor"},null,-1)])])}const Q9e=kt({name:"kimi-comment",render:J9e}),e4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function t4e(e,t){return y(),M("svg",e4e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 7.09961C19.1539 7.09961 20.9004 8.84609 20.9004 11V17C20.9004 19.1539 19.1539 20.9004 17 20.9004H11C8.84609 20.9004 7.09961 19.1539 7.09961 17V11C7.09961 8.84609 8.84609 7.09961 11 7.09961H17ZM11 8.90039C9.8402 8.90039 8.90039 9.8402 8.90039 11V17C8.90039 18.1598 9.8402 19.0996 11 19.0996H17C18.1598 19.0996 19.0996 18.1598 19.0996 17V11C19.0996 9.8402 18.1598 8.90039 17 8.90039H11Z",fill:"currentColor"},null,-1),C("path",{d:"M13 3.09961C14.4447 3.09961 15.705 3.88644 16.3779 5.0498C16.6265 5.47999 16.4789 6.03049 16.0488 6.2793C15.6186 6.52781 15.0681 6.38029 14.8193 5.9502C14.4548 5.32041 13.776 4.90039 13 4.90039H7C5.8402 4.90039 4.90039 5.8402 4.90039 7V13C4.90039 13.776 5.32041 14.4548 5.9502 14.8193C6.38029 15.0681 6.52781 15.6186 6.2793 16.0488C6.03049 16.4789 5.47999 16.6265 5.0498 16.3779C3.88644 15.705 3.09961 14.4447 3.09961 13V7C3.09961 4.84609 4.84609 3.09961 7 3.09961H13Z",fill:"currentColor"},null,-1)])])}const n4e=kt({name:"kimi-copy",render:t4e}),o4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function s4e(e,t){return y(),M("svg",o4e,[...t[0]||(t[0]=[C("path",{d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 10.2797 2.43414 8.66074 3.19922 7.24707C3.20172 7.24246 3.20453 7.23801 3.20703 7.2334C3.33385 6.99995 3.47181 6.77351 3.61621 6.55176C3.73214 6.37355 3.85079 6.19744 3.97754 6.02734C5.35905 4.17471 7.36856 2.81959 9.68945 2.27051C9.69952 2.26813 9.70965 2.26602 9.71973 2.26367C9.85224 2.23276 9.98563 2.2043 10.1201 2.17871C10.1542 2.17221 10.1884 2.16631 10.2227 2.16016C10.3466 2.13791 10.4712 2.11724 10.5967 2.09961C10.6301 2.09489 10.6637 2.0913 10.6973 2.08691C10.8216 2.07073 10.9465 2.05552 11.0723 2.04395C11.1125 2.04022 11.153 2.0384 11.1934 2.03516C11.4595 2.0139 11.7284 2 12 2ZM11.9941 3.7998C11.9968 3.86623 12 3.93292 12 4C12 6.76142 9.76142 9 7 9C6.14209 9 5.33517 8.78324 4.62988 8.40234C4.09862 9.48861 3.7998 10.7093 3.7998 12C3.7998 12.4438 3.83644 12.8791 3.9043 13.3037C4.52807 12.5673 5.45945 12.0996 6.5 12.0996C8.37777 12.0996 9.90039 13.6222 9.90039 15.5C9.90039 17.0702 8.83532 18.3903 7.38867 18.7812C8.70267 19.6765 10.2901 20.2002 12 20.2002C12.468 20.2002 12.9264 20.1583 13.373 20.083C13.1323 19.4342 13 18.7327 13 18C13 14.6863 15.6863 12 19 12C19.4098 12 19.8098 12.0416 20.1963 12.1201C20.1969 12.0801 20.2002 12.0401 20.2002 12C20.2002 7.47126 16.5287 3.7998 12 3.7998H11.9941ZM19 13.7998C16.6804 13.7998 14.7998 15.6804 14.7998 18C14.7998 18.5617 14.9112 19.0972 15.1113 19.5869C17.5225 18.597 19.3558 16.4929 19.9727 13.9141C19.6605 13.8399 19.3349 13.7998 19 13.7998ZM6.5 13.9004C5.61634 13.9004 4.90039 14.6163 4.90039 15.5C4.90039 16.3837 5.61634 17.0996 6.5 17.0996C7.38366 17.0996 8.09961 16.3837 8.09961 15.5C8.09961 14.6163 7.38366 13.9004 6.5 13.9004ZM15.5 6.09961C16.8255 6.09961 17.9004 7.17452 17.9004 8.5C17.9004 9.82548 16.8255 10.9004 15.5 10.9004C14.1745 10.9004 13.0996 9.82548 13.0996 8.5C13.0996 7.17452 14.1745 6.09961 15.5 6.09961ZM15.5 7.90039C15.1686 7.90039 14.9004 8.16863 14.9004 8.5C14.9004 8.83137 15.1686 9.09961 15.5 9.09961C15.8314 9.09961 16.0996 8.83137 16.0996 8.5C16.0996 8.16863 15.8314 7.90039 15.5 7.90039ZM10.1992 4C8.35326 4.41375 6.74333 5.44923 5.59961 6.87598C6.02235 7.08306 6.49716 7.2002 7 7.2002C8.76731 7.2002 10.1992 5.76731 10.1992 4Z",fill:"currentColor"},null,-1)])])}const i4e=kt({name:"kimi-dark-mode",render:s4e}),r4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function l4e(e,t){return y(),M("svg",r4e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2.90002C12.4971 2.90002 12.9 3.30297 12.9 3.80002V12.2939L15.8081 9.38585C16.1595 9.03438 16.7294 9.03438 17.0808 9.38585C17.4323 9.73732 17.4323 10.3072 17.0808 10.6586L12.6364 15.1031C12.4676 15.2719 12.2387 15.3667 12 15.3667C11.7613 15.3667 11.5324 15.2719 11.3636 15.1031L6.91917 10.6586C6.5677 10.3072 6.5677 9.73732 6.91917 9.38585C7.27064 9.03438 7.84049 9.03438 8.19196 9.38585L11.1 12.2939V3.80002C11.1 3.30297 11.503 2.90002 12 2.90002ZM4.00001 13.5874C4.49706 13.5874 4.90001 13.9903 4.90001 14.4874V18.043C4.90001 18.2758 4.99249 18.499 5.1571 18.6636C5.32172 18.8282 5.54498 18.9207 5.77778 18.9207H18.2222C18.455 18.9207 18.6783 18.8283 18.8429 18.6636C19.0075 18.499 19.1 18.2758 19.1 18.043V14.4874C19.1 13.9903 19.5029 13.5874 20 13.5874C20.4971 13.5874 20.9 13.9903 20.9 14.4874V18.043C20.9 18.7531 20.6179 19.4342 20.1157 19.9364C19.6135 20.4386 18.9324 20.7207 18.2222 20.7207H5.77778C5.06759 20.7207 4.38649 20.4386 3.88431 19.9364C3.38213 19.4342 3.10001 18.7531 3.10001 18.043V14.4874C3.10001 13.9903 3.50295 13.5874 4.00001 13.5874Z",fill:"currentColor"},null,-1)])])}const a4e=kt({name:"kimi-download",render:l4e}),u4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function c4e(e,t){return y(),M("svg",u4e,[...t[0]||(t[0]=[C("path",{d:"M18.0179 3.09998C18.3963 3.10003 18.7709 3.17491 19.1205 3.31971C19.4701 3.46454 19.7884 3.67614 20.056 3.94373C20.3237 4.21144 20.5362 4.52965 20.681 4.87928C20.8258 5.22887 20.8997 5.60423 20.8997 5.9828C20.8997 6.36118 20.8257 6.73591 20.681 7.08533C20.5362 7.43497 20.3237 7.75317 20.056 8.02088L17.639 10.4379L9.15756 18.9183C8.5296 19.5463 7.74274 19.992 6.8812 20.2074L4.21811 20.8734C3.91148 20.95 3.5871 20.8596 3.36362 20.6361C3.14017 20.4126 3.05063 20.0883 3.12729 19.7816L3.79233 17.1185C4.00771 16.257 4.45344 15.4701 5.08139 14.8422L15.9798 3.94373C16.5203 3.40346 17.2536 3.09998 18.0179 3.09998ZM19.0003 19.1C19.4972 19.1002 19.8997 19.5034 19.8997 20.0004C19.8995 20.4971 19.4971 20.8996 19.0003 20.8998H12.0003C11.5034 20.8998 11.1001 20.4973 11.0999 20.0004C11.0999 19.5033 11.5033 19.1 12.0003 19.1H19.0003ZM18.0179 4.89979C17.7309 4.89979 17.4553 5.01417 17.2523 5.21717L6.35385 16.1146C5.95661 16.5119 5.67469 17.01 5.53842 17.5551L5.23666 18.7631L6.44467 18.4613C6.98971 18.3251 7.48782 18.0431 7.8851 17.6459L18.7826 6.74744C18.883 6.64702 18.9635 6.52821 19.0179 6.39686C19.0723 6.26558 19.0999 6.1247 19.0999 5.9828C19.0999 5.84075 19.0723 5.69916 19.0179 5.56776C18.9635 5.43645 18.883 5.31757 18.7826 5.21717C18.6821 5.11678 18.5631 5.03716 18.432 4.9828C18.3008 4.92845 18.16 4.89983 18.0179 4.89979Z",fill:"currentColor"},null,-1)])])}const d4e=kt({name:"kimi-edit",render:c4e}),f4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function p4e(e,t){return y(),M("svg",f4e,[...t[0]||(t[0]=[C("path",{d:"M5 11.0996C5.49693 11.0996 5.90018 11.5031 5.90039 12V18C5.90039 18.0552 5.94477 18.0996 6 18.0996H12C12.4969 18.0996 12.9002 18.5031 12.9004 19C12.9004 19.4971 12.4971 19.9004 12 19.9004H6C4.95066 19.9004 4.09961 19.0493 4.09961 18V12C4.09982 11.5031 4.50307 11.0996 5 11.0996ZM18 4.09961C19.0492 4.09961 19.9002 4.95084 19.9004 6V12C19.9004 12.4971 19.4971 12.9004 19 12.9004C18.5029 12.9004 18.0996 12.4971 18.0996 12V6C18.0994 5.94495 18.0551 5.90039 18 5.90039H12C11.5029 5.90039 11.0996 5.49706 11.0996 5C11.0998 4.50312 11.5031 4.09961 12 4.09961H18Z",fill:"currentColor"},null,-1)])])}const h4e=kt({name:"kimi-expand",render:p4e}),m4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function g4e(e,t){return y(),M("svg",m4e,[...t[0]||(t[0]=[C("g",null,[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.1723 2.1001C13.9413 2.10018 14.6793 2.40592 15.2231 2.94971L19.0512 6.77783C19.595 7.32162 19.9007 8.0596 19.9008 8.82861V18.0005C19.9008 20.1544 18.1543 21.9009 16.0004 21.9009H8.0004C5.84649 21.9009 4.10001 20.1544 4.10001 18.0005V6.00049C4.10001 3.84658 5.84649 2.1001 8.0004 2.1001H13.1723ZM8.0004 3.90088C6.8406 3.90088 5.90079 4.84069 5.90079 6.00049V18.0005C5.90079 19.1603 6.8406 20.1001 8.0004 20.1001H16.0004C17.1602 20.1001 18.1 19.1603 18.1 18.0005V9.90088H15.0004C13.3988 9.90088 12.1 8.60211 12.1 7.00049V3.90088H8.0004ZM13.9008 7.00049C13.9008 7.608 14.3929 8.1001 15.0004 8.1001H17.8217C17.8072 8.08375 17.7933 8.06681 17.7777 8.05127L13.9496 4.22314C13.9339 4.20745 13.9173 4.19286 13.9008 4.17822V7.00049Z",fill:"currentColor"})],-1)])])}const Gx=kt({name:"kimi-file",render:g4e}),v4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function y4e(e,t){return y(),M("svg",v4e,[...t[0]||(t[0]=[C("path",{d:"M15.4795 15.4971C15.9765 15.4971 16.3799 15.9004 16.3799 16.3975C16.3799 16.8945 15.9765 17.2978 15.4795 17.2979H8.52051C8.02345 17.2979 7.62012 16.8945 7.62012 16.3975C7.62012 15.9004 8.02345 15.4971 8.52051 15.4971H15.4795Z",fill:"currentColor"},null,-1),C("path",{d:"M12.3359 11.0996C12.8329 11.0997 13.2354 11.503 13.2354 12C13.2354 12.497 12.8329 12.9003 12.3359 12.9004H8.52051C8.02345 12.9004 7.62012 12.4971 7.62012 12C7.62012 11.5029 8.02345 11.0996 8.52051 11.0996H12.3359Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.1719 2.09961C13.9408 2.09969 14.6789 2.40555 15.2227 2.94922L19.0508 6.77734C19.5946 7.32113 19.9003 8.05911 19.9004 8.82812V18C19.9004 20.1539 18.1539 21.9004 16 21.9004H8C5.84626 21.9002 4.09961 20.1538 4.09961 18V6C4.09961 3.84621 5.84626 2.09981 8 2.09961H13.1719ZM8 3.90039C6.84037 3.90059 5.90039 4.84032 5.90039 6V18C5.90039 19.1597 6.84037 20.0994 8 20.0996H16C17.1598 20.0996 18.0996 19.1598 18.0996 18V9.90039H15C13.3985 9.90019 12.0996 8.6015 12.0996 7V3.90039H8ZM13.9004 7C13.9004 7.60739 14.3927 8.09941 15 8.09961H17.8213C17.8068 8.08333 17.7928 8.06626 17.7773 8.05078L13.9492 4.22266C13.9335 4.20696 13.9169 4.19237 13.9004 4.17773V7Z",fill:"currentColor"},null,-1)])])}const k4e=kt({name:"kimi-file-text",render:y4e}),b4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function C4e(e,t){return y(),M("svg",b4e,[...t[0]||(t[0]=[C("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const w4e=kt({name:"kimi-folder",render:C4e}),_4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function x4e(e,t){return y(),M("svg",_4e,[...t[0]||(t[0]=[C("g",null,[C("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"})],-1)])])}const S4e=kt({name:"kimi-folder-open",render:x4e}),A4e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function M4e(e,t){return y(),M("svg",A4e,[...t[0]||(t[0]=[C("path",{id:"af-p0",d:"M -2.619 -8.3 C -1.815 -8.3 -1.048 -7.97 -0.499 -7.39 C -0.499 -7.39 0.141 -6.712 0.141 -6.712 C 0.141 -6.712 5.75 -6.712 5.75 -6.712 C 7.904 -6.712 9.65 -4.986 9.65 -2.858 C 9.65 -2.858 9.65 -1.71 9.65 -1.71 C 9.65 -1.219 9.247 -0.821 8.75 -0.821 C 8.253 -0.821 7.85 -1.219 7.85 -1.71 C 7.85 -1.71 7.85 -2.858 7.85 -2.858 C 7.849 -4.004 6.91 -4.934 5.75 -4.934 C 5.75 -4.934 -0.207 -4.934 -0.207 -4.934 C -0.484 -4.934 -0.749 -5.047 -0.938 -5.247 C -0.938 -5.247 -1.815 -6.177 -1.815 -6.177 C -2.023 -6.397 -2.315 -6.521 -2.619 -6.521 C -2.619 -6.521 -6.25 -6.521 -6.25 -6.521 C -7.41 -6.521 -8.35 -5.592 -8.35 -4.446 C -8.35 -4.446 -8.35 4.446 -8.35 4.446 C -8.35 5.592 -7.41 6.521 -6.25 6.521 C -6.25 6.521 1.25 6.521 1.25 6.521 C 1.747 6.521 2.15 6.919 2.15 7.41 C 2.15 7.901 1.747 8.3 1.25 8.3 C 1.25 8.3 -6.25 8.3 -6.25 8.3 C -8.404 8.3 -10.15 6.574 -10.15 4.446 C -10.15 4.446 -10.15 -4.446 -10.15 -4.446 C -10.15 -6.574 -8.404 -8.3 -6.25 -8.3 C -6.25 -8.3 -2.619 -8.3 -2.619 -8.3 Z M 3.75 -2.5 C 4.247 -2.5 4.65 -2.097 4.65 -1.6 C 4.65 -1.103 4.247 -0.699 3.75 -0.699 C 3.75 -0.699 -4.25 -0.699 -4.25 -0.699 C -4.747 -0.699 -5.15 -1.103 -5.15 -1.6 C -5.15 -2.097 -4.747 -2.5 -4.25 -2.5 C -4.25 -2.5 3.75 -2.5 3.75 -2.5 Z",transform:"matrix(1 0 0 1 11.75 12)",fill:"currentColor"},null,-1),C("g",{id:"af-p1"},[C("path",{d:"M 2.635 0 L -2.635 0 M 0 -2.635 L 0 2.635",transform:"matrix(1 0 0 1 18.4 16.3)",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1)])])}const T4e=kt({name:"kimi-folder-plus",render:M4e}),E4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function I4e(e,t){return y(),M("svg",E4e,[...t[0]||(t[0]=[C("path",{d:"M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3ZM12 19.2002C15.9764 19.2002 19.2002 15.9764 19.2002 12C19.2002 8.02355 15.9764 4.7998 12 4.7998V19.2002Z",fill:"currentColor"},null,-1)])])}const L4e=kt({name:"kimi-follow-system",render:I4e}),$4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function N4e(e,t){return y(),M("svg",$4e,[...t[0]||(t[0]=[C("path",{d:"M17 2C19.2091 2 21 3.79086 21 6V15.7646C21 17.2361 20.192 18.5884 18.8965 19.2861L13.8965 21.9785C12.7126 22.616 11.2874 22.616 10.1035 21.9785L5.10352 19.2861C3.80802 18.5884 3 17.2361 3 15.7646V6C3 3.79086 4.79086 2 7 2H17ZM7 3.7998C5.78498 3.7998 4.79981 4.78497 4.7998 6V15.7646C4.7998 16.574 5.24443 17.3184 5.95703 17.7021L10.957 20.3936C11.6082 20.7442 12.3918 20.7442 13.043 20.3936L18.043 17.7021C18.7556 17.3184 19.2002 16.574 19.2002 15.7646V6C19.2002 4.78497 18.215 3.7998 17 3.7998H7ZM12 15.6992C12.4968 15.6992 12.8994 16.1028 12.8994 16.5996C12.8994 17.0964 12.4968 17.5 12 17.5C11.5024 17.5 11.0996 17.0964 11.0996 16.5996C11.0996 16.1028 11.5024 15.6992 12 15.6992ZM12 6.49902C12.4969 6.49922 12.8994 6.86908 12.8994 7.3252V13.6729C12.8994 14.129 12.4969 14.4988 12 14.499C11.5029 14.499 11.0996 14.1291 11.0996 13.6729V7.3252C11.0996 6.86896 11.5029 6.49902 12 6.49902Z",fill:"currentColor"},null,-1)])])}const F4e=kt({name:"kimi-full-access",render:N4e}),R4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function O4e(e,t){return y(),M("svg",R4e,[...t[0]||(t[0]=[C("path",{d:"M12.5092 2.11279C17.7402 2.37781 21.8998 6.70364 21.8998 12.0005C21.8996 17.4153 17.5524 21.8108 12.1576 21.895C12.1056 21.898 12.0532 21.8999 12.0004 21.8999C11.948 21.8999 11.8954 21.8968 11.8432 21.896L11.8422 21.895C6.44751 21.8107 2.10022 17.4152 2.10001 12.0005C2.10001 6.53287 6.53278 2.1001 12.0004 2.1001L12.5092 2.11279ZM8.92715 13.0005C9.02896 14.9787 9.42581 16.721 9.99356 17.9985C10.3249 18.7441 10.6971 19.292 11.0639 19.6411C11.4259 19.9855 11.741 20.1001 12.0004 20.1001C12.2598 20.1 12.5749 19.9856 12.9369 19.6411C13.3037 19.292 13.6749 18.7441 14.0063 17.9985C14.574 16.721 14.9718 14.9788 15.0736 13.0005H8.92715ZM3.96329 13.0005C4.31462 15.8522 6.14714 18.2427 8.66837 19.3823C8.55544 19.1733 8.44916 18.9552 8.34903 18.73C7.66574 17.1926 7.22657 15.1926 7.12344 13.0005H3.96329ZM16.8764 13.0005C16.7732 15.1926 16.3341 17.1926 15.6508 18.73C15.5506 18.9554 15.4435 19.1732 15.3305 19.3823C17.8522 18.2429 19.6851 15.8525 20.0365 13.0005H16.8764ZM8.66934 4.6167C6.08869 5.78266 4.22826 8.25964 3.93985 11.1997H7.11661C7.20176 8.92954 7.64512 6.85497 8.34903 5.271C8.4494 5.04516 8.5561 4.82619 8.66934 4.6167ZM12.0004 3.8999C11.7411 3.8999 11.4259 4.01454 11.0639 4.35889C10.6971 4.70797 10.3249 5.25587 9.99356 6.00146C9.40671 7.32188 9.00186 9.13885 8.91739 11.1997H15.0834C14.9989 9.13884 14.5931 7.32189 14.0063 6.00146C13.6749 5.2559 13.3037 4.70796 12.9369 4.35889C12.5749 4.0144 12.2598 3.90002 12.0004 3.8999ZM15.3295 4.61572C15.443 4.82559 15.5502 5.04471 15.6508 5.271C16.3547 6.85498 16.799 8.92949 16.8842 11.1997H20.06C19.7715 8.25914 17.9108 5.78143 15.3295 4.61572Z",fill:"currentColor"},null,-1)])])}const P4e=kt({name:"kimi-globe",render:O4e}),D4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function B4e(e,t){return y(),M("svg",D4e,[...t[0]||(t[0]=[C("path",{d:"M8 17C8.82834 17 9.5 17.6717 9.5 18.5C9.5 19.3283 8.82834 20 8 20C7.17166 20 6.5 19.3283 6.5 18.5C6.5 17.6717 7.17166 17 8 17ZM16 17C16.8283 17 17.5 17.6717 17.5 18.5C17.5 19.3283 16.8283 20 16 20C15.1717 20 14.5 19.3283 14.5 18.5C14.5 17.6717 15.1717 17 16 17ZM8 10.5C8.82834 10.5 9.5 11.1717 9.5 12C9.5 12.8283 8.82834 13.5 8 13.5C7.17166 13.5 6.5 12.8283 6.5 12C6.5 11.1717 7.17166 10.5 8 10.5ZM16 10.5C16.8283 10.5 17.5 11.1717 17.5 12C17.5 12.8283 16.8283 13.5 16 13.5C15.1717 13.5 14.5 12.8283 14.5 12C14.5 11.1717 15.1717 10.5 16 10.5ZM8 4C8.82834 4 9.5 4.67166 9.5 5.5C9.5 6.32834 8.82834 7 8 7C7.17166 7 6.5 6.32834 6.5 5.5C6.5 4.67166 7.17166 4 8 4ZM16 4C16.8283 4 17.5 4.67166 17.5 5.5C17.5 6.32834 16.8283 7 16 7C15.1717 7 14.5 6.32834 14.5 5.5C14.5 4.67166 15.1717 4 16 4Z",fill:"currentColor"},null,-1)])])}const H4e=kt({name:"kimi-grip",render:B4e}),z4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function W4e(e,t){return y(),M("svg",z4e,[...t[0]||(t[0]=[C("path",{d:"M7.22264 6.10352C7.22264 5.5078 7.48259 4.95449 7.91405 4.56055C8.34271 4.16918 8.90831 3.96198 9.48241 3.96191C9.64155 3.96191 9.80001 3.97936 9.95507 4.01074C10.0127 3.5042 10.2586 3.04178 10.6338 2.69922C11.0625 2.30778 11.6279 2.09961 12.2021 2.09961C12.7763 2.09966 13.3418 2.30783 13.7705 2.69922C13.9947 2.90401 14.1709 3.15244 14.29 3.42676C14.4947 3.37044 14.7071 3.34182 14.9209 3.3418C15.4951 3.3418 16.0605 3.549 16.4892 3.94043C16.8644 4.28293 17.1093 4.74548 17.167 5.25195C17.3223 5.22045 17.4812 5.20312 17.6406 5.20312C18.2147 5.20318 18.7803 5.41135 19.209 5.80273C19.6402 6.19663 19.9004 6.74922 19.9004 7.34473V14.6543C19.9004 17.413 19.2914 19.0434 18.0137 20.21C16.82 21.2998 15.2175 21.9004 13.5615 21.9004C11.7538 21.9004 10.2315 21.5696 8.95702 20.8535C7.67664 20.1341 6.71683 19.0652 5.97362 17.708L3.3496 12.916C3.18848 12.6213 3.10112 12.2914 3.0996 11.9531C3.09812 11.6147 3.18309 11.2835 3.34179 10.9873C3.5001 10.692 3.72639 10.4416 3.99706 10.251C4.26771 10.0604 4.57776 9.93235 4.90136 9.87305C5.56617 9.75102 6.25934 9.84517 6.86425 10.1445C6.9942 10.2088 7.11461 10.2788 7.22264 10.3477V6.10352ZM9.02343 12.7969C9.02336 13.1912 8.76624 13.5395 8.38964 13.6562C8.0129 13.773 7.60387 13.6309 7.38085 13.3057L6.53514 12.0723C6.51218 12.0529 6.48411 12.0282 6.45018 12.002C6.34595 11.9213 6.20986 11.8289 6.06639 11.7578C5.81525 11.6335 5.51637 11.5904 5.22655 11.6436H5.22557C5.15055 11.6573 5.08558 11.6865 5.03417 11.7227C4.98289 11.7588 4.94815 11.7998 4.92772 11.8379C4.90762 11.8755 4.90023 11.9122 4.90038 11.9453C4.90057 11.9782 4.9084 12.0144 4.9287 12.0518L7.55272 16.8438C8.16912 17.9693 8.90989 18.7622 9.83886 19.2842C10.7737 19.8094 11.9704 20.0996 13.5615 20.0996C14.7902 20.0996 15.9536 19.6533 16.7998 18.8809C17.5619 18.185 18.0996 17.1383 18.0996 14.6543V7.34473C18.0996 7.28204 18.0734 7.20342 17.9951 7.13184C17.9139 7.05771 17.7875 7.00396 17.6406 7.00391C17.4937 7.00391 17.3674 7.05771 17.2861 7.13184C17.2077 7.20347 17.1807 7.28199 17.1807 7.34473V11.0693C17.1805 11.5661 16.778 11.9685 16.2812 11.9688C15.7843 11.9688 15.381 11.5662 15.3808 11.0693V5.48242C15.3808 5.41973 15.3537 5.34107 15.2754 5.26953C15.1941 5.19547 15.0677 5.1416 14.9209 5.1416C14.774 5.14166 14.6476 5.19541 14.5664 5.26953C14.4881 5.34105 14.462 5.41974 14.4619 5.48242V11.0693C14.4617 11.5662 14.0584 11.9688 13.5615 11.9688C13.0646 11.9687 12.6613 11.5662 12.6611 11.0693V4.24121C12.6611 4.17852 12.635 4.09989 12.5566 4.02832C12.4754 3.95419 12.349 3.90045 12.2021 3.90039C12.0552 3.90039 11.9289 3.95421 11.8476 4.02832C11.7692 4.09992 11.7422 4.17849 11.7422 4.24121V11.0693C11.742 11.5661 11.3395 11.9685 10.8428 11.9688C10.3458 11.9688 9.94257 11.5662 9.94237 11.0693V6.10352L9.93651 6.05371C9.92534 6.00177 9.89573 5.94433 9.8369 5.89062C9.75567 5.81647 9.62938 5.76172 9.48241 5.76172C9.33554 5.76179 9.2091 5.81651 9.12792 5.89062C9.04964 5.96222 9.02343 6.04084 9.02343 6.10352V12.7969Z",fill:"currentColor"},null,-1)])])}const U4e=kt({name:"kimi-hand",render:W4e}),j4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function V4e(e,t){return y(),M("svg",j4e,[...t[0]||(t[0]=[C("path",{d:"M4 3.33203C4.55224 3.33203 4.99993 3.7798 5 4.33203V18.0908H20.0674C20.6195 18.0908 21.0671 18.5388 21.0674 19.0908C21.0674 19.6431 20.6197 20.0908 20.0674 20.0908H5C3.89543 20.0908 3 19.1954 3 18.0908V4.33203C3.00007 3.7798 3.44776 3.33203 4 3.33203ZM8.19922 9.28418C8.7515 9.28418 9.19922 9.73189 9.19922 10.2842V15.6045C9.19908 16.1567 8.75142 16.6045 8.19922 16.6045C7.64719 16.6043 7.19936 16.1565 7.19922 15.6045V10.2842C7.19922 9.73202 7.6471 9.28438 8.19922 9.28418ZM17.2227 6.85645C17.7748 6.85658 18.2226 7.3043 18.2227 7.85645V15.6045C18.2225 16.1566 17.7747 16.6044 17.2227 16.6045C16.6705 16.6045 16.2228 16.1566 16.2227 15.6045V7.85645C16.2227 7.30422 16.6704 6.85645 17.2227 6.85645ZM12.7109 3.96387C13.2631 3.96387 13.7107 4.41175 13.7109 4.96387V15.6035C13.7109 16.1558 13.2632 16.6035 12.7109 16.6035C12.1587 16.6035 11.7109 16.1558 11.7109 15.6035V4.96387C11.7111 4.41175 12.1588 3.96387 12.7109 3.96387Z",fill:"currentColor"},null,-1)])])}const q4e=kt({name:"kimi-histogram",render:V4e}),K4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Z4e(e,t){return y(),M("svg",K4e,[...t[0]||(t[0]=[C("path",{d:"M8.00916 7.50488C8.47326 7.50488 8.91828 7.68943 9.24646 8.01758C9.57465 8.34577 9.75916 8.79075 9.75916 9.25488C9.75916 9.71901 9.57465 10.164 9.24646 10.4922C8.91828 10.8203 8.47326 11.0049 8.00916 11.0049C7.54507 11.0049 7.10001 10.8203 6.77185 10.4922C6.4437 10.164 6.25916 9.71898 6.25916 9.25488C6.25916 8.79078 6.4437 8.34576 6.77185 8.01758C7.10001 7.68942 7.54507 7.50492 8.00916 7.50488Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.8998 4.09961C20.0537 4.09961 21.8002 5.84609 21.8002 8V16C21.8002 18.1539 20.0537 19.9004 17.8998 19.9004H5.89978C3.74598 19.9003 1.99939 18.1538 1.99939 16V8C1.99939 5.84617 3.74598 4.09974 5.89978 4.09961H17.8998ZM15.4867 12.2539C15.448 12.2184 15.3885 12.2192 15.351 12.2559L11.7338 15.8027C11.0146 16.5079 9.87305 16.5222 9.13708 15.835L6.98669 13.8262C6.95049 13.7924 6.89516 13.791 6.85681 13.8223L3.82361 16.2988C3.96873 17.3168 4.84165 18.0995 5.89978 18.0996H17.8998C18.9375 18.0996 19.7964 17.3466 19.9662 16.3574L15.4867 12.2539ZM5.89978 5.90039C4.74009 5.90052 3.80017 6.84028 3.80017 8V14.002L5.73181 12.4238C6.46046 11.8286 7.51253 11.8634 8.20056 12.5059L10.351 14.5146C10.3897 14.5508 10.4498 14.5497 10.4877 14.5127L14.1049 10.9658C14.819 10.2656 15.9506 10.2466 16.6879 10.9219L19.9994 13.9551V8C19.9994 6.8402 19.0596 5.90039 17.8998 5.90039H5.89978Z",fill:"currentColor"},null,-1)])])}const G4e=kt({name:"kimi-image",render:Z4e}),Y4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function X4e(e,t){return y(),M("svg",Y4e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.09375 2.81174C5.4825 2.50796 6.04376 2.56488 6.34766 2.93869L20.1855 19.9602C20.4895 20.3341 20.421 20.8836 20.0322 21.1877C19.6435 21.4917 19.0823 21.4355 18.7783 21.0617L17.9971 20.1008H5.99609C3.84224 20.1008 2.0958 18.3552 2.0957 16.2014V8.13889C2.09589 6.26755 3.41429 4.70428 5.17285 4.32639L4.93945 4.03928C4.63577 3.66536 4.7051 3.11573 5.09375 2.81174ZM7.13184 14.1096C7.09416 14.0738 7.03659 14.0713 6.99609 14.1037L3.92871 16.5569C4.09761 17.5472 4.95753 18.301 5.99609 18.301H16.5342L13.373 14.4133L11.9072 15.9455C11.1531 16.7324 9.92202 16.7621 9.13281 16.0119L7.13184 14.1096ZM5.99609 6.03928C4.83643 6.03928 3.89669 6.97927 3.89648 8.13889V14.1408L5.83496 12.5901C6.60469 11.9742 7.69929 12.022 8.41504 12.7024L10.416 14.6037C10.4575 14.6431 10.5218 14.642 10.5615 14.6008L12.1641 12.926L9.78906 10.0051C9.70282 10.2646 9.55682 10.5038 9.35645 10.7004C9.02202 11.0285 8.56767 11.2131 8.09473 11.2131C7.62195 11.213 7.1683 11.0284 6.83398 10.7004C6.49961 10.3724 6.31152 9.92701 6.31152 9.46311C6.3116 8.99941 6.49981 8.55474 6.83398 8.22678C7.12986 7.93654 7.51931 7.75901 7.93262 7.7219L6.56543 6.03928H5.99609Z",fill:"currentColor"},null,-1),C("path",{d:"M18.0049 4.31272C20.1587 4.31288 21.9043 6.0593 21.9043 8.21311V13.718C21.9039 15.4743 19.7248 16.2906 18.5713 14.966L14.9141 10.7658C14.5882 10.3912 14.6278 9.82271 15.002 9.49631C15.3768 9.16994 15.9451 9.20948 16.2715 9.5842L19.9287 13.7844C19.9528 13.812 19.9696 13.8167 19.9775 13.8186C19.9908 13.8216 20.0141 13.8213 20.04 13.8117C20.0655 13.8021 20.0826 13.7875 20.0908 13.7766C20.0955 13.7702 20.1044 13.7552 20.1045 13.718V8.21311C20.1045 7.05341 19.1645 6.11366 18.0049 6.1135H10.6328C10.1361 6.11327 9.73267 5.70981 9.73242 5.21311C9.73242 4.71619 10.136 4.31295 10.6328 4.31272H18.0049Z",fill:"currentColor"},null,-1)])])}const J4e=kt({name:"kimi-image-failed",render:X4e}),Q4e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function e3e(e,t){return y(),M("svg",Q4e,[...t[0]||(t[0]=[C("path",{d:"M12 2.1001C17.4676 2.10031 21.8994 6.53286 21.8994 12.0005C21.8992 17.4679 17.4674 21.8997 12 21.8999C6.53237 21.8999 2.09982 17.4681 2.09961 12.0005C2.09961 6.53273 6.53224 2.1001 12 2.1001ZM12 3.8999C7.52636 3.8999 3.89941 7.52684 3.89941 12.0005C3.89963 16.474 7.52649 20.1001 12 20.1001C16.4733 20.0999 20.0994 16.4738 20.0996 12.0005C20.0996 7.52697 16.4735 3.90011 12 3.8999ZM12 9.50049C12.4969 9.50068 12.8994 9.87055 12.8994 10.3267V16.6743C12.8992 17.1303 12.4968 17.5003 12 17.5005C11.503 17.5005 11.0998 17.1304 11.0996 16.6743V10.3267C11.0996 9.87043 11.5029 9.50049 12 9.50049ZM12 6.49951C12.4968 6.49951 12.8994 6.90313 12.8994 7.3999C12.8992 7.8965 12.4966 8.30029 12 8.30029C11.5025 8.30028 11.0998 7.8965 11.0996 7.3999C11.0996 6.90313 11.5024 6.49952 12 6.49951Z",fill:"currentColor"},null,-1)])])}const t3e=kt({name:"kimi-info",render:e3e}),n3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function o3e(e,t){return y(),M("svg",n3e,[...t[0]||(t[0]=[iu('<path fill-rule="evenodd" clip-rule="evenodd" d="M12 2.09998C6.53222 2.09998 2.09998 6.53222 2.09998 12C2.09998 17.4677 6.53222 21.9 12 21.9C17.4677 21.9 21.9 17.4677 21.9 12C21.9 6.53222 17.4677 2.09998 12 2.09998ZM3.89998 12C3.89998 7.52633 7.52633 3.89998 12 3.89998C16.4736 3.89998 20.1 7.52633 20.1 12C20.1 16.4736 16.4736 20.1 12 20.1C7.52633 20.1 3.89998 16.4736 3.89998 12Z" fill="currentColor"></path><path d="M9.4286 9.47153C9.4286 8.97448 9.83154 8.57153 10.3286 8.57153H11.1C11.5971 8.57153 12 8.97448 12 9.47153C12 9.96859 11.5971 10.3715 11.1 10.3715H10.3286C9.83154 10.3715 9.4286 9.96859 9.4286 9.47153Z" fill="currentColor"></path><path d="M5.14289 9.47155C5.14289 8.97449 5.54583 8.57155 6.04289 8.57155H7.67146C8.16851 8.57155 8.57146 8.97449 8.57146 9.47155C8.57146 9.9686 8.16851 10.3715 7.67146 10.3715H6.04289C5.54583 10.3715 5.14289 9.9686 5.14289 9.47155Z" fill="currentColor"></path><path d="M8.57146 16.3287C8.57146 15.8316 8.9744 15.4287 9.47145 15.4287H14.5286C15.0257 15.4287 15.4286 15.8316 15.4286 16.3287C15.4286 16.8257 15.0257 17.2287 14.5286 17.2287H9.47145C8.9744 17.2287 8.57146 16.8257 8.57146 16.3287Z" fill="currentColor"></path><path d="M6.04288 12.0001C5.54583 12.0001 5.14288 12.403 5.14288 12.9001C5.14288 13.3972 5.54583 13.8001 6.04288 13.8001H6.81431C7.31137 13.8001 7.71431 13.3972 7.71431 12.9001C7.71431 12.403 7.31137 12.0001 6.81431 12.0001H6.04288Z" fill="currentColor"></path><path d="M9.47145 12.0001C8.9744 12.0001 8.57146 12.403 8.57146 12.9001C8.57146 13.3972 8.9744 13.8001 9.47146 13.8001H10.2429C10.7399 13.8001 11.1429 13.3972 11.1429 12.9001C11.1429 12.403 10.7399 12.0001 10.2429 12.0001H9.47145Z" fill="currentColor"></path><path d="M12.8572 9.47153C12.8572 8.97448 13.2601 8.57153 13.7572 8.57153H14.5286C15.0257 8.57153 15.4286 8.97448 15.4286 9.47153C15.4286 9.96859 15.0257 10.3715 14.5286 10.3715H13.7572C13.2601 10.3715 12.8572 9.96859 12.8572 9.47153Z" fill="currentColor"></path><path d="M12.9 12.0001C12.403 12.0001 12 12.403 12 12.9001C12 13.3972 12.403 13.8001 12.9 13.8001H13.6715C14.1685 13.8001 14.5715 13.3972 14.5715 12.9001C14.5715 12.403 14.1685 12.0001 13.6715 12.0001H12.9Z" fill="currentColor"></path><path d="M16.2857 9.47153C16.2857 8.97448 16.6887 8.57153 17.1857 8.57153H17.9572C18.4542 8.57153 18.8572 8.97448 18.8572 9.47153C18.8572 9.96859 18.4542 10.3715 17.9572 10.3715H17.1857C16.6887 10.3715 16.2857 9.96859 16.2857 9.47153Z" fill="currentColor"></path><path d="M16.3286 12.0001C15.8315 12.0001 15.4286 12.403 15.4286 12.9001C15.4286 13.3972 15.8315 13.8001 16.3286 13.8001H17.9572C18.4542 13.8001 18.8572 13.3972 18.8572 12.9001C18.8572 12.403 18.4542 12.0001 17.9572 12.0001H16.3286Z" fill="currentColor"></path>',10)])])}const s3e=kt({name:"kimi-keyboard",render:o3e}),i3e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function r3e(e,t){return y(),M("svg",i3e,[...t[0]||(t[0]=[C("path",{id:"bar-divider",d:"M 9.3 18.951 L 9.3 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),C("path",{id:"bar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),C("path",{id:"bar-arrow",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const l3e=kt({name:"kimi-left-panel",render:r3e}),a3e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function u3e(e,t){return y(),M("svg",a3e,[...t[0]||(t[0]=[C("path",{id:"bar-divider",d:"M 9.3 18.951 L 9.3 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),C("path",{id:"bar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),C("path",{id:"bar-arrow-expand",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const c3e=kt({name:"kimi-left-panel-expand",render:u3e}),d3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function f3e(e,t){return y(),M("svg",d3e,[...t[0]||(t[0]=[iu('<g><path d="M12.9 1.7999C12.9 1.30285 12.4971 0.899902 12 0.899902C11.5029 0.899902 11.1 1.30285 11.1 1.7999V2.7999C11.1 3.29696 11.5029 3.6999 12 3.6999C12.4971 3.6999 12.9 3.29696 12.9 2.7999V1.7999Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M6.1 11.9999C6.1 8.7414 8.74152 6.09988 12 6.09988C15.2585 6.09988 17.9 8.7414 17.9 11.9999C17.9 15.2584 15.2585 17.8999 12 17.8999C8.74152 17.8999 6.1 15.2584 6.1 11.9999ZM12 7.89988C9.73563 7.89988 7.9 9.73551 7.9 11.9999C7.9 14.2642 9.73563 16.0999 12 16.0999C14.2644 16.0999 16.1 14.2642 16.1 11.9999C16.1 9.73551 14.2644 7.89988 12 7.89988Z" fill="currentColor"></path><path d="M0.899994 11.9999C0.899994 11.5028 1.30294 11.0999 1.79999 11.0999H2.79999C3.29705 11.0999 3.69999 11.5028 3.69999 11.9999C3.69999 12.4969 3.29705 12.8999 2.79999 12.8999H1.79999C1.30294 12.8999 0.899994 12.4969 0.899994 11.9999Z" fill="currentColor"></path><path d="M12 20.2991C12.4971 20.2991 12.9 20.702 12.9 21.1991V22.1991C12.9 22.6961 12.4971 23.0991 12 23.0991C11.5029 23.0991 11.1 22.6961 11.1 22.1991V21.1991C11.1 20.702 11.5029 20.2991 12 20.2991Z" fill="currentColor"></path><path d="M21.2016 11.0999C20.7045 11.0999 20.3016 11.5028 20.3016 11.9999C20.3016 12.4969 20.7045 12.8999 21.2016 12.8999H22.2016C22.6986 12.8999 23.1016 12.4969 23.1016 11.9999C23.1016 11.5028 22.6986 11.0999 22.2016 11.0999H21.2016Z" fill="currentColor"></path><path d="M20.1995 3.79903C20.551 4.1505 20.551 4.72035 20.1995 5.07182L19.4924 5.77893C19.141 6.1304 18.5711 6.1304 18.2196 5.77893C17.8682 5.42746 17.8682 4.85761 18.2196 4.50614L18.9268 3.79903C19.2782 3.44756 19.8481 3.44756 20.1995 3.79903Z" fill="currentColor"></path><path d="M19.4942 18.2215C19.1427 17.87 18.5729 17.87 18.2214 18.2215C17.87 18.573 17.87 19.1428 18.2214 19.4943L18.9285 20.2014C19.28 20.5529 19.8498 20.5529 20.2013 20.2014C20.5528 19.8499 20.5528 19.2801 20.2013 18.9286L19.4942 18.2215Z" fill="currentColor"></path><path d="M5.78079 18.2213C6.13227 18.5727 6.13227 19.1426 5.78079 19.4941L5.07369 20.2012C4.72222 20.5526 4.15237 20.5526 3.8009 20.2012C3.44942 19.8497 3.44942 19.2798 3.8009 18.9284L4.508 18.2213C4.85947 17.8698 5.42932 17.8698 5.78079 18.2213Z" fill="currentColor"></path><path d="M5.07077 3.79912C4.7193 3.44764 4.14945 3.44764 3.79798 3.79912C3.4465 4.15059 3.4465 4.72044 3.79798 5.07191L4.50508 5.77901C4.85655 6.13049 5.4264 6.13049 5.77787 5.77902C6.12935 5.42754 6.12935 4.85769 5.77787 4.50622L5.07077 3.79912Z" fill="currentColor"></path></g>',1)])])}const p3e=kt({name:"kimi-light-mode",render:f3e}),h3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function m3e(e,t){return y(),M("svg",h3e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.97427 8.06961C4.99348 7.33581 6.18946 7.1 7.00001 7.1H9.00001C9.49706 7.1 9.90001 7.50294 9.90001 8C9.90001 8.49706 9.49706 8.9 9.00001 8.9H7.00001C6.47755 8.9 5.67353 9.06419 5.02599 9.53039C4.42434 9.96356 3.90001 10.6934 3.90001 12C3.90001 13.3066 4.42434 14.0364 5.02599 14.4696C5.67353 14.9358 6.47755 15.1 7.00001 15.1H9.00001C9.49706 15.1 9.90001 15.5029 9.90001 16C9.90001 16.4971 9.49706 16.9 9.00001 16.9H7.00001C6.18946 16.9 4.99348 16.6642 3.97427 15.9304C2.90917 15.1636 2.10001 13.8934 2.10001 12C2.10001 10.1066 2.90917 8.83644 3.97427 8.06961ZM14.1 8C14.1 7.50294 14.5029 7.1 15 7.1H17C17.8105 7.1 19.0065 7.33581 20.0257 8.06961C21.0908 8.83644 21.9 10.1066 21.9 12C21.9 13.8934 21.0908 15.1636 20.0257 15.9304C19.0065 16.6642 17.8105 16.9 17 16.9H15C14.5029 16.9 14.1 16.4971 14.1 16C14.1 15.5029 14.5029 15.1 15 15.1H17C17.5225 15.1 18.3265 14.9358 18.974 14.4696C19.5757 14.0364 20.1 13.3066 20.1 12C20.1 10.6934 19.5757 9.96356 18.974 9.53039C18.3265 9.06419 17.5225 8.9 17 8.9H15C14.5029 8.9 14.1 8.49706 14.1 8ZM7.10001 12C7.10001 11.5029 7.50295 11.1 8.00001 11.1H16C16.4971 11.1 16.9 11.5029 16.9 12C16.9 12.4971 16.4971 12.9 16 12.9H8.00001C7.50295 12.9 7.10001 12.4971 7.10001 12Z",fill:"currentColor"},null,-1)])])}const g3e=kt({name:"kimi-link",render:m3e}),v3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function y3e(e,t){return y(),M("svg",v3e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.10001 5.99998C4.10001 5.50292 4.50295 5.09998 5.00001 5.09998H19C19.4971 5.09998 19.9 5.50292 19.9 5.99998C19.9 6.49703 19.4971 6.89998 19 6.89998H5.00001C4.50295 6.89998 4.10001 6.49703 4.10001 5.99998ZM4.10001 12C4.10001 11.5029 4.50295 11.1 5.00001 11.1H19C19.4971 11.1 19.9 11.5029 19.9 12C19.9 12.497 19.4971 12.9 19 12.9H5.00001C4.50295 12.9 4.10001 12.497 4.10001 12ZM4.10001 18C4.10001 17.5029 4.50295 17.1 5.00001 17.1H19C19.4971 17.1 19.9 17.5029 19.9 18C19.9 18.497 19.4971 18.9 19 18.9H5.00001C4.50295 18.9 4.10001 18.497 4.10001 18Z",fill:"currentColor"},null,-1)])])}const k3e=kt({name:"kimi-list",render:y3e}),b3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function C3e(e,t){return y(),M("svg",b3e,[...t[0]||(t[0]=[C("g",null,[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18 4.09961C20.1539 4.09961 21.9004 5.84609 21.9004 8V16C21.9004 18.1539 20.1539 19.9004 18 19.9004H6C3.84609 19.9004 2.09961 18.1539 2.09961 16V8C2.09961 5.84609 3.84609 4.09961 6 4.09961H18ZM3.90039 16C3.90039 17.1598 4.8402 18.0996 6 18.0996H18C19.1598 18.0996 20.0996 17.1598 20.0996 16V9.49805L13.5361 13.5361C12.5955 14.1147 11.4075 14.1084 10.4727 13.5205L3.90039 9.38672V16ZM6 5.90039C5.0746 5.90039 4.29039 6.49909 4.01074 7.33008L11.4316 11.9971C11.7861 12.2199 12.2361 12.2222 12.5928 12.0029L20.0195 7.43457C19.7725 6.54993 18.9636 5.90039 18 5.90039H6Z",fill:"currentColor"})],-1)])])}const w3e=kt({name:"kimi-mail",render:C3e}),_3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function x3e(e,t){return y(),M("svg",_3e,[...t[0]||(t[0]=[C("path",{d:"M17 11.0996C17.4971 11.0996 17.9004 11.5029 17.9004 12C17.9004 12.4971 17.4971 12.9004 17 12.9004H7C6.50294 12.9004 6.09961 12.4971 6.09961 12C6.09961 11.5029 6.50294 11.0996 7 11.0996H17Z",fill:"currentColor"},null,-1)])])}const S3e=kt({name:"kimi-minus",render:x3e}),A3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function M3e(e,t){return y(),M("svg",A3e,[...t[0]||(t[0]=[C("path",{d:"M15.182 3.32802C15.9304 2.72235 17.0309 2.76978 17.724 3.46767L18.5424 4.29189L18.6722 4.43642C19.2377 5.13495 19.234 6.1404 18.6635 6.83486L18.5326 6.97841L18.0248 7.48232C17.9549 7.55172 17.8793 7.61254 17.8021 7.66884C17.9794 8.18027 17.9316 8.7498 17.6595 9.22841C17.6847 9.24522 17.7091 9.2635 17.7328 9.2831L17.8002 9.3456L17.9847 9.53798C19.8515 11.5442 20.4549 14.0022 19.6224 16.2196C19.1921 17.3657 18.4025 18.3827 17.2992 19.203H19.0873L19.1801 19.2079C19.6337 19.2542 19.9877 19.6375 19.9877 20.1034C19.9876 20.5692 19.6337 20.9527 19.1801 20.9989L19.0873 21.0028H13.0385C13.0244 21.0033 13.0104 21.0031 12.9965 21.0028H4.9115C4.41448 21.0028 4.01117 20.6004 4.01111 20.1034C4.01111 19.6064 4.41444 19.203 4.9115 19.203H12.9047C15.7614 18.5471 17.3679 17.1023 17.9369 15.5868C18.4678 14.1726 18.179 12.4782 16.807 10.9188L16.5189 10.6093L16.4574 10.5399C16.4549 10.5368 16.453 10.5333 16.4506 10.5302L12.3011 14.6522C11.6031 15.3454 10.5023 15.3845 9.75818 14.7733L9.61365 14.6425L7.31091 12.3231C6.5717 11.5786 6.57617 10.376 7.32068 9.63662L12.3676 4.62392L12.5121 4.49404C13.0358 4.06988 13.7318 3.96755 14.3402 4.18251C14.3969 4.10597 14.4591 4.03197 14.5287 3.96279L15.0365 3.45791L15.182 3.32802ZM4.83044 12.9335C5.16112 12.6052 5.68305 12.5863 6.03552 12.8759L6.10291 12.9384L9.07361 15.9286L9.13513 15.997C9.42218 16.3514 9.3992 16.8727 9.06873 17.2011C8.7381 17.5294 8.21712 17.5482 7.86462 17.2587L7.79626 17.1972L4.82654 14.2069L4.76501 14.1376C4.47792 13.7831 4.49979 13.2619 4.83044 12.9335ZM13.6693 5.87978L13.6361 5.90126L8.58826 10.914C8.54935 10.9529 8.54943 11.0165 8.58826 11.0556L10.891 13.3739L10.9242 13.3964C10.9602 13.4111 11.0032 13.404 11.0326 13.3749L16.0795 8.3622L16.1019 8.329C16.1117 8.3049 16.1117 8.2779 16.1019 8.2538L16.0804 8.2206L13.7777 5.90224C13.7486 5.87289 13.7054 5.86535 13.6693 5.87978ZM16.3383 4.71376L16.3051 4.73525L15.7972 5.24013C15.7584 5.27904 15.7585 5.34166 15.7972 5.38076L16.6146 6.20498L16.6478 6.22744C16.6838 6.24221 16.7268 6.23487 16.7562 6.20595L17.264 5.70107L17.2865 5.66787C17.2962 5.64382 17.2963 5.61672 17.2865 5.59267L17.265 5.55947L16.4467 4.73623C16.4174 4.70681 16.3744 4.6992 16.3383 4.71376Z",fill:"currentColor"},null,-1)])])}const T3e=kt({name:"kimi-microscope",render:M3e}),E3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function I3e(e,t){return y(),M("svg",E3e,[...t[0]||(t[0]=[C("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),C("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),C("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const L3e=kt({name:"kimi-more",render:I3e}),$3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function N3e(e,t){return y(),M("svg",$3e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 12.0993C8.49691 12.0993 8.90016 12.5028 8.90039 12.9997V17.9997C8.90039 19.6013 7.60163 20.9001 6 20.9001C4.39837 20.9001 3.09961 19.6013 3.09961 17.9997C3.09984 16.3982 4.39852 15.0993 6 15.0993C6.38939 15.0993 6.76033 15.1778 7.09961 15.317V12.9997C7.09984 12.5028 7.50309 12.0993 8 12.0993ZM6 16.9001C5.39263 16.9001 4.90062 17.3923 4.90039 17.9997C4.90039 18.6072 5.39249 19.0993 6 19.0993C6.60751 19.0993 7.09961 18.6072 7.09961 17.9997C7.09938 17.3923 6.60737 16.9001 6 16.9001Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.627 3.35611C19.8025 3.12106 20.9001 4.02068 20.9004 5.21939V15.9997C20.9004 17.6013 19.6016 18.9001 18 18.9001C16.3984 18.9001 15.0996 17.6013 15.0996 15.9997C15.0998 14.3982 16.3985 13.0993 18 13.0993C18.3894 13.0993 18.7603 13.1778 19.0996 13.317V9.21939C19.0993 9.15657 19.0421 9.10946 18.9805 9.12173L12.6768 10.3825C12.1894 10.4799 11.7148 10.1637 11.6172 9.67642C11.52 9.18922 11.8361 8.71439 12.3232 8.61685L18.627 7.35611C18.7868 7.32415 18.9452 7.31502 19.0996 7.32291V5.21939C19.0993 5.15657 19.0421 5.10946 18.9805 5.12173L12.6768 6.38248C12.1894 6.47994 11.7148 6.16372 11.6172 5.67642C11.52 5.18922 11.8361 4.71439 12.3232 4.61685L18.627 3.35611ZM18 14.9001C17.3926 14.9001 16.9006 15.3923 16.9004 15.9997C16.9004 16.6072 17.3925 17.0993 18 17.0993C18.6075 17.0993 19.0996 16.6072 19.0996 15.9997C19.0994 15.3923 18.6074 14.9001 18 14.9001Z",fill:"currentColor"},null,-1),C("path",{d:"M7.32422 5.38931C7.61669 4.87032 8.38346 4.87015 8.67578 5.38931L8.73047 5.50845L8.89551 5.95376L8.97949 6.1481C9.19937 6.58817 9.57968 6.93145 10.0459 7.10415L10.4912 7.26919C11.127 7.50461 11.1666 8.36217 10.6104 8.67544L10.4912 8.73013L10.0459 8.89517C9.5799 9.06783 9.19939 9.41141 8.97949 9.85123L8.89551 10.0456L8.73047 10.4909C8.49495 11.1267 7.63737 11.1665 7.32422 10.61L7.26953 10.4909L7.10449 10.0456C6.93172 9.57931 6.58767 9.19898 6.14746 8.97916L5.9541 8.89517L5.50879 8.73013C4.83054 8.47903 4.83061 7.52037 5.50879 7.26919L5.9541 7.10415L6.14746 7.02017C6.58757 6.80032 6.93176 6.41995 7.10449 5.95376L7.26953 5.50845L7.32422 5.38931Z",fill:"currentColor"},null,-1)])])}const F3e=kt({name:"kimi-music",render:N3e}),R3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function O3e(e,t){return y(),M("svg",R3e,[...t[0]||(t[0]=[C("path",{d:"M17.9551 6.32648C17.955 5.82951 17.5517 5.42706 17.0547 5.42706H15.4844C14.9875 5.42717 14.5851 5.82958 14.585 6.32648V17.6732C14.585 18.1701 14.9874 18.5734 15.4844 18.5735H17.0547C17.5518 18.5735 17.9551 18.1702 17.9551 17.6732V6.32648ZM19.7549 17.6732C19.7549 19.1643 18.5459 20.3734 17.0547 20.3734H15.4844C13.9933 20.3732 12.7842 19.1643 12.7842 17.6732V6.32648C12.7843 4.83546 13.9934 3.62639 15.4844 3.62628H17.0547C18.5458 3.62628 19.7548 4.8354 19.7549 6.32648V17.6732Z",fill:"currentColor"},null,-1),C("path",{d:"M9.41571 6.32648C9.41561 5.82951 9.01231 5.42706 8.51532 5.42706H6.94501C6.44811 5.42717 6.0457 5.82958 6.04559 6.32648V17.6732C6.04559 18.1701 6.44804 18.5734 6.94501 18.5735H8.51532C9.01238 18.5735 9.41571 18.1702 9.41571 17.6732V6.32648ZM11.2155 17.6732C11.2155 19.1643 10.0065 20.3734 8.51532 20.3734H6.94501C5.45393 20.3732 4.24481 19.1643 4.24481 17.6732V6.32648C4.24492 4.83546 5.45399 3.62639 6.94501 3.62628H8.51532C10.0064 3.62628 11.2154 4.8354 11.2155 6.32648V17.6732Z",fill:"currentColor"},null,-1)])])}const P3e=kt({name:"kimi-pause",render:O3e}),D3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function B3e(e,t){return y(),M("svg",D3e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.0176 4.89998C17.7305 4.89998 17.4552 5.014 17.2522 5.217L6.35429 16.1149C5.957 16.5122 5.67517 17.01 5.53889 17.5551L5.23691 18.763L6.44486 18.4611C6.98994 18.3248 7.48773 18.0429 7.88502 17.6456L18.783 6.74773C18.8834 6.64728 18.9631 6.52797 19.0176 6.39658C19.072 6.26517 19.1 6.12441 19.1 5.98236C19.1 5.84031 19.072 5.69956 19.0176 5.56815C18.9631 5.43676 18.8834 5.31745 18.783 5.217C18.6825 5.11649 18.5631 5.03676 18.4318 4.98237C18.3005 4.92798 18.1597 4.89998 18.0176 4.89998ZM15.9794 3.94421C16.52 3.40366 17.2531 3.09998 18.0176 3.09998C18.3961 3.09998 18.7709 3.17452 19.1207 3.31938C19.4704 3.46424 19.7881 3.67656 20.0558 3.94421C20.3235 4.21192 20.5357 4.52969 20.6805 4.87932C20.8254 5.22895 20.9 5.60375 20.9 5.98236C20.9 6.36098 20.8254 6.73578 20.6805 7.08541C20.5357 7.43504 20.3235 7.75281 20.0558 8.02052L17.6385 10.4378L9.15781 18.9184C8.52984 19.5464 7.74301 19.9919 6.88142 20.2073L4.21828 20.8731C3.91158 20.9498 3.58714 20.8599 3.3636 20.6364C3.14006 20.4128 3.05019 20.0884 3.12686 19.7817L3.79264 17.1185C4.00803 16.257 4.45351 15.4701 5.0815 14.8421L15.9794 3.94421Z",fill:"currentColor"},null,-1)])])}const H3e=kt({name:"kimi-pencil",render:B3e}),z3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function W3e(e,t){return y(),M("svg",z3e,[...t[0]||(t[0]=[C("path",{d:"M7.76251 3.10547C8.25776 3.10552 8.74422 3.23849 9.17072 3.49023L19.533 9.60742C20.8536 10.3869 21.2922 12.0901 20.5174 13.4121C20.2785 13.8195 19.9398 14.1604 19.533 14.4004L9.16974 20.5156C7.84721 21.2958 6.14595 20.8511 5.36993 19.5273C5.1196 19.1003 4.98719 18.6142 4.98712 18.1191V5.88672C4.98716 4.3537 6.2273 3.10547 7.76251 3.10547ZM6.7879 18.1191C6.78797 18.2945 6.8343 18.4664 6.92267 18.6172C7.19638 19.0841 7.79336 19.2377 8.25568 18.9648L18.618 12.8496C18.7607 12.7654 18.8803 12.6458 18.9647 12.502C19.2393 12.0334 19.082 11.4311 18.618 11.1572L8.25568 5.04102C8.1061 4.95273 7.93562 4.9063 7.76251 4.90625C7.22703 4.90625 6.78794 5.34218 6.7879 5.88672V18.1191Z",fill:"currentColor"},null,-1)])])}const U3e=kt({name:"kimi-play",render:W3e}),j3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function V3e(e,t){return y(),M("svg",j3e,[...t[0]||(t[0]=[C("path",{d:"M11.999 15.0049C12.6208 15.0049 13.1259 15.5091 13.126 16.1309C13.126 16.7528 12.6209 17.2578 11.999 17.2578C11.3773 17.2576 10.873 16.7526 10.873 16.1309C10.8732 15.5092 11.3774 15.0051 11.999 15.0049Z",fill:"currentColor"},null,-1),C("path",{d:"M10.1611 7.37109C10.9017 6.79576 11.8605 6.60385 12.7881 6.8457C13.808 7.10861 14.6385 7.93756 14.9014 8.95898C15.2694 10.3845 14.5793 11.8629 13.2598 12.4736C13.0803 12.557 12.75 12.9552 12.75 13.3525V13.502C12.75 13.9172 12.4142 14.2527 11.999 14.2529C11.5837 14.2529 11.248 13.9173 11.248 13.502V13.3525C11.248 12.313 11.9587 11.4215 12.6279 11.1113C13.1777 10.8567 13.6681 10.192 13.4473 9.33496C13.3195 8.84253 12.9038 8.42684 12.4121 8.2998C11.9292 8.17289 11.4573 8.26727 11.0811 8.55859C10.71 8.84626 10.4971 9.28012 10.4971 9.74805C10.4968 10.1632 10.1613 10.499 9.74609 10.499C9.33092 10.499 8.99536 10.1632 8.99512 9.74805C8.99512 8.81152 9.41918 7.94493 10.1611 7.37109Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 3.7998C7.47126 3.7998 3.7998 7.47126 3.7998 12C3.7998 16.5287 7.47126 20.2002 12 20.2002C16.5287 20.2002 20.2002 16.5287 20.2002 12C20.2002 7.47126 16.5287 3.7998 12 3.7998Z",fill:"currentColor"},null,-1)])])}const q3e=kt({name:"kimi-question",render:V3e}),K3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Z3e(e,t){return y(),M("svg",K3e,[...t[0]||(t[0]=[C("path",{d:"M12 2C13.1046 2 14 2.89543 14 4C14 4.78019 13.552 5.45353 12.9004 5.7832V7H16.5C18.1569 7 19.5 8.34315 19.5 10V17C19.5 18.6051 18.2394 19.9158 16.6543 19.9961L16.5 20H7.5L7.3457 19.9961C5.81166 19.9184 4.58163 18.6883 4.50391 17.1543L4.5 17V10C4.5 8.34315 5.84315 7 7.5 7H11.0996V5.7832C10.448 5.45353 10 4.78019 10 4C10 2.89543 10.8954 2 12 2ZM7.5 8.7998C6.83726 8.7998 6.2998 9.33726 6.2998 10V17C6.2998 17.6627 6.83726 18.2002 7.5 18.2002H16.5C17.1627 18.2002 17.7002 17.6627 17.7002 17V10C17.7002 9.33726 17.1627 8.7998 16.5 8.7998H7.5ZM3 10.7666C3.49706 10.7666 3.90039 11.1699 3.90039 11.667V15C3.90039 15.4971 3.49706 15.9004 3 15.9004C2.50294 15.9004 2.09961 15.4971 2.09961 15V11.667C2.09961 11.1699 2.50294 10.7666 3 10.7666ZM21 10.7666C21.4971 10.7666 21.9004 11.1699 21.9004 11.667V15C21.9004 15.4971 21.4971 15.9004 21 15.9004C20.5029 15.9004 20.0996 15.4971 20.0996 15V11.667C20.0996 11.1699 20.5029 10.7666 21 10.7666ZM9.5 11.0996C9.99706 11.0996 10.4004 11.5029 10.4004 12V14.5C10.4004 14.9971 9.99706 15.4004 9.5 15.4004C9.00294 15.4004 8.59961 14.9971 8.59961 14.5V12C8.59961 11.5029 9.00294 11.0996 9.5 11.0996ZM14.5 11.0996C14.9971 11.0996 15.4004 11.5029 15.4004 12V14.5C15.4004 14.9971 14.9971 15.4004 14.5 15.4004C14.0029 15.4004 13.5996 14.9971 13.5996 14.5V12C13.5996 11.5029 14.0029 11.0996 14.5 11.0996ZM12 3.5C11.7239 3.5 11.5 3.72386 11.5 4C11.5 4.27614 11.7239 4.5 12 4.5C12.2761 4.5 12.5 4.27614 12.5 4C12.5 3.72386 12.2761 3.5 12 3.5Z",fill:"currentColor"},null,-1)])])}const G3e=kt({name:"kimi-robot",render:Z3e}),Y3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function X3e(e,t){return y(),M("svg",Y3e,[...t[0]||(t[0]=[C("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const J3e=kt({name:"kimi-search",render:X3e}),Q3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function e8e(e,t){return y(),M("svg",Q3e,[...t[0]||(t[0]=[C("path",{d:"M16.5364 10.1636C16.8879 10.5151 16.8879 11.0849 16.5364 11.4364C16.1849 11.7879 15.6151 11.7879 15.2636 11.4364L12.9 9.07281V17.1C12.9 17.597 12.4971 18 12 18C11.503 18 11.1 17.597 11.1 17.1V9.07281L8.73641 11.4364C8.38494 11.7879 7.81509 11.7879 7.46362 11.4364C7.11214 11.0849 7.11214 10.5151 7.46362 10.1636L11.3636 6.2636C11.7151 5.91211 12.2849 5.91211 12.6364 6.2636L16.5364 10.1636Z",fill:"currentColor"},null,-1)])])}const t8e=kt({name:"kimi-send",render:e8e}),n8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function o8e(e,t){return y(),M("svg",n8e,[...t[0]||(t[0]=[C("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),C("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const s8e=kt({name:"kimi-setting",render:o8e}),i8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function r8e(e,t){return y(),M("svg",i8e,[...t[0]||(t[0]=[C("path",{d:"M17 2C19.2091 2 21 3.79086 21 6V15.7646C21 17.2361 20.192 18.5884 18.8965 19.2861L13.8965 21.9785C12.7126 22.616 11.2874 22.616 10.1035 21.9785L5.10352 19.2861C3.80802 18.5884 3 17.2361 3 15.7646V6C3 3.79086 4.79086 2 7 2H17ZM7 3.7998C5.78498 3.7998 4.79981 4.78497 4.7998 6V15.7646C4.7998 16.574 5.24443 17.3184 5.95703 17.7021L10.957 20.3936C11.6082 20.7442 12.3918 20.7442 13.043 20.3936L18.043 17.7021C18.7556 17.3184 19.2002 16.574 19.2002 15.7646V6C19.2002 4.78497 18.215 3.7998 17 3.7998H7Z",fill:"currentColor"},null,-1),C("path",{d:"M10.1611 7.37109C10.9017 6.79576 11.8605 6.60385 12.7881 6.8457C13.808 7.10861 14.6385 7.93756 14.9014 8.95898C15.2694 10.3845 14.5793 11.8629 13.2598 12.4736C13.0803 12.557 12.75 12.9552 12.75 13.3525V13.502C12.75 13.9172 12.4142 14.2527 11.999 14.2529C11.5837 14.2529 11.248 13.9173 11.248 13.502V13.3525C11.248 12.313 11.9587 11.4215 12.6279 11.1113C13.1777 10.8567 13.6681 10.192 13.4473 9.33496C13.3195 8.84253 12.9038 8.42684 12.4121 8.2998C11.9292 8.17289 11.4573 8.26727 11.0811 8.55859C10.71 8.84626 10.4971 9.28012 10.4971 9.74805C10.4968 10.1632 10.1613 10.499 9.74609 10.499C9.33092 10.499 8.99536 10.1632 8.99512 9.74805C8.99512 8.81152 9.41918 7.94493 10.1611 7.37109Z",fill:"currentColor"},null,-1),C("path",{d:"M11.999 15.0049C12.6208 15.0049 13.1259 15.5091 13.126 16.1309C13.126 16.7528 12.6209 17.2578 11.999 17.2578C11.3773 17.2576 10.873 16.7526 10.873 16.1309C10.8732 15.5092 11.3774 15.0051 11.999 15.0049Z",fill:"currentColor"},null,-1)])])}const l8e=kt({name:"kimi-shield-question",render:r8e}),a8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function u8e(e,t){return y(),M("svg",a8e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.90005 12C2.90005 11.503 3.303 11.1 3.80005 11.1H12.2939L9.38588 8.19197C9.03441 7.8405 9.03441 7.27065 9.38588 6.91918C9.73735 6.56771 10.3072 6.56771 10.6587 6.91918L15.1031 11.3636C15.2719 11.5324 15.3667 11.7613 15.3667 12C15.3667 12.2387 15.2719 12.4676 15.1031 12.6364L10.6587 17.0809C10.3072 17.4323 9.73735 17.4323 9.38588 17.0809C9.03441 16.7294 9.03441 16.1595 9.38588 15.8081L12.2939 12.9H3.80005C3.303 12.9 2.90005 12.4971 2.90005 12ZM13.5874 20C13.5874 19.503 13.9904 19.1 14.4874 19.1H18.043C18.2758 19.1 18.4991 19.0075 18.6637 18.8429C18.8283 18.6783 18.9208 18.455 18.9208 18.2222V5.7778C18.9208 5.545 18.8283 5.32174 18.6637 5.15712C18.499 4.9925 18.2758 4.90002 18.043 4.90002H14.4874C13.9904 4.90002 13.5874 4.49708 13.5874 4.00002C13.5874 3.50297 13.9904 3.10003 14.4874 3.10003H18.043C18.7532 3.10003 19.4343 3.38215 19.9365 3.88433C20.4386 4.38651 20.7208 5.06761 20.7208 5.7778V18.2222C20.7208 18.9324 20.4386 19.6135 19.9365 20.1157C19.4343 20.6179 18.7532 20.9 18.043 20.9H14.4874C13.9904 20.9 13.5874 20.4971 13.5874 20Z",fill:"currentColor"},null,-1)])])}const c8e=kt({name:"kimi-sign-in",render:u8e}),d8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function f8e(e,t){return y(),M("svg",d8e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.6364 11.3636C20.9879 11.7151 20.9879 12.2849 20.6364 12.6364L16.1919 17.0808C15.8405 17.4323 15.2706 17.4323 14.9192 17.0808C14.5677 16.7293 14.5677 16.1595 14.9192 15.808L17.8272 12.9H9.33333C8.83627 12.9 8.43333 12.497 8.43333 12C8.43333 11.5029 8.83627 11.1 9.33333 11.1H17.8272L14.9192 8.19193C14.5677 7.84046 14.5677 7.27061 14.9192 6.91914C15.2706 6.56766 15.8405 6.56766 16.1919 6.91914L20.6364 11.3636ZM10.2333 3.99998C10.2333 4.49703 9.83038 4.89998 9.33333 4.89998H5.77777C5.54497 4.89998 5.3217 4.99246 5.15709 5.15707C4.99247 5.32169 4.89999 5.54495 4.89999 5.77775V18.2222C4.89999 18.455 4.99247 18.6783 5.15709 18.8429C5.32171 19.0075 5.54497 19.1 5.77777 19.1H9.33333C9.83038 19.1 10.2333 19.5029 10.2333 20C10.2333 20.497 9.83038 20.9 9.33333 20.9H5.77777C5.06758 20.9 4.38648 20.6179 3.8843 20.1157C3.38212 19.6135 3.09999 18.9324 3.09999 18.2222V5.77775C3.09999 5.06756 3.38212 4.38646 3.8843 3.88428C4.38648 3.3821 5.06758 3.09998 5.77777 3.09998H9.33333C9.83038 3.09998 10.2333 3.50292 10.2333 3.99998Z",fill:"currentColor"},null,-1)])])}const p8e=kt({name:"kimi-sign-out",render:f8e}),h8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function m8e(e,t){return y(),M("svg",h8e,[...t[0]||(t[0]=[iu('<path d="M4 6H14.0" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><path d="M18.0 6H20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><circle cx="16" cy="6" r="2.0" fill="none" stroke="currentColor" stroke-width="1.8"></circle><path d="M4 12H6.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><path d="M10.5 12H20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><circle cx="8.5" cy="12" r="2.0" fill="none" stroke="currentColor" stroke-width="1.8"></circle><path d="M4 18H14.0" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><path d="M18.0 18H20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><circle cx="16" cy="18" r="2.0" fill="none" stroke="currentColor" stroke-width="1.8"></circle>',9)])])}const g8e=kt({name:"kimi-sliders",render:m8e}),v8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function y8e(e,t){return y(),M("svg",v8e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.78027 8.90405C7.5 9.45411 7.5 10.1742 7.5 11.6144V12.3856C7.5 13.8258 7.5 14.5459 7.78027 15.096C8.02681 15.5798 8.42019 15.9732 8.90405 16.2197C9.45411 16.5 10.1742 16.5 11.6144 16.5H12.3856C13.8258 16.5 14.5459 16.5 15.096 16.2197C15.5798 15.9732 15.9732 15.5798 16.2197 15.096C16.5 14.5459 16.5 13.8258 16.5 12.3856V11.6144C16.5 10.1742 16.5 9.45411 16.2197 8.90405C15.9732 8.42019 15.5798 8.02681 15.096 7.78027C14.5459 7.5 13.8258 7.5 12.3856 7.5H11.6144C10.1742 7.5 9.45411 7.5 8.90405 7.78027C8.42019 8.02681 8.02681 8.42019 7.78027 8.90405Z",fill:"currentColor"},null,-1)])])}const k8e=kt({name:"kimi-stop",render:y8e}),b8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function C8e(e,t){return y(),M("svg",b8e,[...t[0]||(t[0]=[C("path",{d:"M7.01562 3.41459C7.4446 3.16449 7.9954 3.30924 8.24609 3.73784C8.49645 4.167 8.35189 4.71868 7.92285 4.96928C5.51497 6.37506 3.90054 8.98498 3.90039 11.9703C3.90076 16.4435 7.52672 20.0699 12 20.0699C16.4733 20.0699 20.0992 16.4435 20.0996 11.9703C20.0996 11.2291 20 10.5116 19.8145 9.83159C19.6838 9.35222 19.967 8.85702 20.4463 8.72612C20.9256 8.59541 21.4207 8.87778 21.5518 9.35698C21.7792 10.1901 21.9004 11.0674 21.9004 11.9703C21.9 17.4376 17.4674 21.8697 12 21.8697C6.53261 21.8697 2.09998 17.4376 2.09961 11.9703C2.09976 8.31904 4.07782 5.12972 7.01562 3.41459ZM8.39258 8.24077C8.75015 7.89591 9.3199 7.90591 9.66504 8.26323C10.01 8.62076 9.99985 9.19051 9.64258 9.53569C9.00203 10.1541 8.60558 11.02 8.60547 11.979C8.60584 13.8536 10.1253 15.3736 12 15.3736C13.8746 15.3735 15.3942 13.8536 15.3945 11.979C15.3945 11.6847 15.3577 11.3989 15.2881 11.1285C15.1646 10.6474 15.4536 10.1568 15.9346 10.0328C16.4158 9.9089 16.9071 10.1991 17.0312 10.6802C17.1383 11.096 17.1943 11.5321 17.1943 11.979C17.194 14.8477 14.8688 17.1733 12 17.1734C9.1312 17.1734 6.80506 14.8478 6.80469 11.979C6.8048 10.5117 7.41519 9.18431 8.39258 8.24077ZM11.5459 1.12651C11.8216 0.965605 12.1631 0.963306 12.4414 1.11967L19.1953 4.91752C19.4859 5.08108 19.662 5.39277 19.6533 5.72612C19.6443 6.05972 19.4515 6.36154 19.1523 6.50932L12.9004 9.5933V12.2583C12.9004 12.7554 12.4971 13.1587 12 13.1587C11.5029 13.1587 11.0996 12.7554 11.0996 12.2583V1.90385C11.0999 1.58444 11.2702 1.2878 11.5459 1.12651ZM12.9004 7.58549L16.8252 5.64897L12.9004 3.44194V7.58549Z",fill:"currentColor"},null,-1)])])}const w8e=kt({name:"kimi-target",render:C8e}),_8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function x8e(e,t){return y(),M("svg",_8e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.9893 6.60743C20.5897 6.60757 21.8877 7.8926 21.8877 9.47736C21.8877 10.7416 21.0607 11.8129 19.9141 12.1955V14.257C19.914 15.8428 18.6152 17.1288 17.0137 17.1289H12.8438V20.1381C12.8437 20.6301 12.4412 21.0293 11.9443 21.0296C11.4473 21.0296 11.044 20.6302 11.0439 20.1381V16.4356C11.0441 15.8343 11.5363 15.3461 12.1436 15.3458H17.0137C17.6211 15.3457 18.1133 14.8585 18.1133 14.257V12.2129C16.9408 11.8451 16.0909 10.7598 16.0908 9.47736C16.0908 7.89251 17.3887 6.60743 18.9893 6.60743ZM18.9893 8.38953C18.3828 8.38953 17.8906 8.87684 17.8906 9.47736C17.8907 10.0778 18.3828 10.5642 18.9893 10.5642C19.5956 10.5641 20.0869 10.0777 20.0869 9.47736C20.0869 8.87693 19.5956 8.38967 18.9893 8.38953Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.89844 6.60743C6.49899 6.60747 7.79688 7.89254 7.79688 9.47736C7.79684 10.7388 6.97371 11.8078 5.83105 12.1926V14.4021C5.83105 15.0036 6.32315 15.4918 6.93066 15.4918H8.37109C8.86789 15.492 9.27038 15.8905 9.27051 16.3824C9.27051 16.8744 8.86797 17.2737 8.37109 17.2739H6.93066C5.32904 17.2739 4.03027 15.9879 4.03027 14.4021V12.2158C2.85382 11.8504 2.00004 10.7627 2 9.47736C2 7.89251 3.29784 6.60743 4.89844 6.60743ZM4.89844 8.38953C4.29196 8.38953 3.7998 8.87684 3.7998 9.47736C3.79985 10.0778 4.29198 10.5642 4.89844 10.5642C5.50485 10.5642 5.99605 10.0778 5.99609 9.47736C5.99609 8.87687 5.50488 8.38958 4.89844 8.38953Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9434 2.9707C13.5439 2.97075 14.8418 4.25581 14.8418 5.84063C14.8418 7.11413 14.0035 8.1923 12.8438 8.56745V13.0135C12.8436 13.5056 12.4403 13.9041 11.9434 13.9041C11.4466 13.9039 11.0431 13.5055 11.043 13.0135V8.56745C9.8836 8.19209 9.04496 7.11387 9.04492 5.84063C9.04492 4.25592 10.343 2.97093 11.9434 2.9707ZM11.9434 4.75281C11.3371 4.75303 10.8447 5.24026 10.8447 5.84063C10.8448 6.44097 11.3371 6.92726 11.9434 6.92749C12.5498 6.92745 13.041 6.44108 13.041 5.84063C13.041 5.24014 12.5498 4.75285 11.9434 4.75281Z",fill:"currentColor"},null,-1)])])}const S8e=kt({name:"kimi-task",render:x8e}),A8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function M8e(e,t){return y(),M("svg",A8e,[...t[0]||(t[0]=[C("path",{d:"M16.5293 15.0596C16.9496 15.1021 17.2772 15.4572 17.2773 15.8887C17.2773 16.3202 16.9497 16.6753 16.5293 16.7178L16.4443 16.7217H12C11.5399 16.7216 11.167 16.3488 11.167 15.8887C11.1671 15.4286 11.54 15.0558 12 15.0557H16.4443L16.5293 15.0596Z",fill:"currentColor"},null,-1),C("path",{d:"M6.96582 7.52246C7.27077 7.21751 7.75375 7.1983 8.08105 7.46484L8.14453 7.52246L10.8232 10.2002C11.5102 10.8872 11.5102 12.0014 10.8232 12.6885L8.14453 15.3672L8.08105 15.4248C7.75377 15.6913 7.27075 15.6721 6.96582 15.3672C6.66114 15.0621 6.64234 14.5791 6.90918 14.252L6.96582 14.1885L9.64453 11.5098C9.68057 11.4736 9.68062 11.415 9.64453 11.3789L6.96582 8.7002C6.64116 8.37488 6.6411 7.84774 6.96582 7.52246Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 3.09961C19.1539 3.09966 20.9004 4.84612 20.9004 7V17C20.9004 19.1539 19.1539 20.9003 17 20.9004H7C4.84609 20.9004 3.09961 19.1539 3.09961 17V7C3.09961 4.84609 4.84609 3.09961 7 3.09961H17ZM7 4.90039C5.8402 4.90039 4.90039 5.8402 4.90039 7V17C4.90039 18.1598 5.8402 19.0996 7 19.0996H17C18.1598 19.0996 19.0996 18.1598 19.0996 17V7C19.0996 5.84024 18.1598 4.90044 17 4.90039H7Z",fill:"currentColor"},null,-1)])])}const T8e=kt({name:"kimi-terminal",render:M8e}),E8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function I8e(e,t){return y(),M("svg",E8e,[...t[0]||(t[0]=[C("path",{d:"M16.9971 3.90597C15.9799 2.99725 14.7342 2.38312 13.394 2.12966C12.0538 1.8762 10.6699 1.99301 9.39111 2.46751C8.11236 2.94202 6.98721 3.75626 6.13676 4.82261C5.2863 5.88896 4.74274 7.16703 4.56457 8.5193C4.40455 9.70501 4.53253 10.9118 4.93767 12.0376C5.34281 13.1634 6.01318 14.175 6.89207 14.9868C7.43557 15.4634 7.87413 16.0477 8.17997 16.7027C8.48581 17.3577 8.65224 18.0691 8.66873 18.7918V18.926C8.66962 19.7412 8.99387 20.5229 9.57035 21.0993C10.1468 21.6758 10.9285 22.0001 11.7437 22.001H12.2604C13.0757 22.0001 13.8573 21.6758 14.4338 21.0993C15.0103 20.5229 15.3345 19.7412 15.3354 18.926V18.4685C15.3479 17.8297 15.4982 17.2011 15.7761 16.6258C16.0539 16.0505 16.4528 15.542 16.9454 15.1351C17.7442 14.4355 18.3853 13.5741 18.826 12.608C19.2668 11.642 19.4973 10.5932 19.5022 9.53136C19.5071 8.46948 19.2863 7.41869 18.8544 6.4486C18.4225 5.4785 17.7894 4.61125 16.9971 3.9043V3.90597ZM12.2604 20.3343H11.7437C11.3704 20.3339 11.0124 20.1853 10.7484 19.9213C10.4844 19.6573 10.3358 19.2993 10.3354 18.926C10.3354 18.926 10.3296 18.7093 10.3287 18.6676H13.6687V18.926C13.6683 19.2993 13.5198 19.6573 13.2558 19.9213C12.9917 20.1853 12.6338 20.3339 12.2604 20.3343ZM15.8437 13.8835C14.8949 14.7064 14.2097 15.7908 13.8737 17.001H12.8354V11.0143C13.3212 10.8426 13.742 10.5249 14.0403 10.1049C14.3387 9.68482 14.4999 9.18285 14.5021 8.66763C14.5021 8.44662 14.4143 8.23466 14.258 8.07838C14.1017 7.9221 13.8897 7.8343 13.6687 7.8343C13.4477 7.8343 13.2358 7.9221 13.0795 8.07838C12.9232 8.23466 12.8354 8.44662 12.8354 8.66763C12.8354 8.88865 12.7476 9.10061 12.5913 9.25689C12.435 9.41317 12.2231 9.50097 12.0021 9.50097C11.7811 9.50097 11.5691 9.41317 11.4128 9.25689C11.2565 9.10061 11.1687 8.88865 11.1687 8.66763C11.1687 8.44662 11.0809 8.23466 10.9247 8.07838C10.7684 7.9221 10.5564 7.8343 10.3354 7.8343C10.1144 7.8343 9.90242 7.9221 9.74614 8.07838C9.58986 8.23466 9.50207 8.44662 9.50207 8.66763C9.5042 9.18285 9.66547 9.68482 9.96381 10.1049C10.2621 10.5249 10.683 10.8426 11.1687 11.0143V17.001H10.0671C9.69123 15.7586 8.98633 14.6411 8.02707 13.7668C7.21286 13.0081 6.63267 12.0324 6.35496 10.9547C6.07725 9.87703 6.1136 8.7424 6.45974 7.68471C6.80588 6.62702 7.44735 5.69042 8.30846 4.98543C9.16956 4.28045 10.2144 3.83649 11.3196 3.70597C11.5487 3.68039 11.779 3.66759 12.0096 3.66763C13.4409 3.66338 14.8226 4.19149 15.8862 5.1493C16.5026 5.69896 16.9952 6.37337 17.3312 7.12782C17.6672 7.88227 17.839 8.69952 17.8352 9.5254C17.8314 10.3513 17.6522 11.1669 17.3092 11.9183C16.9663 12.6696 16.4677 13.3395 15.8462 13.8835H15.8437Z",fill:"currentColor"},null,-1)])])}const L8e=kt({name:"kimi-thinking",render:I8e}),$8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function N8e(e,t){return y(),M("svg",$8e,[...t[0]||(t[0]=[iu('<path d="M9.28994 4.92561C9.6436 4.57634 9.64716 4.0065 9.29789 3.65284C8.94862 3.29918 8.37878 3.29563 8.02512 3.6449L5.91339 5.73041L5.16642 4.95888C4.82067 4.60177 4.2509 4.59256 3.89379 4.9383C3.53668 5.28404 3.52747 5.85382 3.87321 6.21093L5.25245 7.63551C5.41956 7.80811 5.64874 7.90674 5.88897 7.90943C6.1292 7.91213 6.36053 7.81866 6.53146 7.64985L9.28994 4.92561Z" fill="currentColor"></path><path d="M12 5.10022C11.503 5.10022 11.1 5.50316 11.1 6.00022C11.1 6.49728 11.503 6.90022 12 6.90022L19.9965 6.90022C20.4935 6.90022 20.8965 6.49728 20.8965 6.00022C20.8965 5.50316 20.4935 5.10022 19.9965 5.10022L12 5.10022Z" fill="currentColor"></path><path d="M12 11.1002C11.503 11.1002 11.1 11.5032 11.1 12.0002C11.1 12.4973 11.503 12.9002 12 12.9002H19.9965C20.4935 12.9002 20.8965 12.4973 20.8965 12.0002C20.8965 11.5032 20.4935 11.1002 19.9965 11.1002L12 11.1002Z" fill="currentColor"></path><path d="M11.1 18.0002C11.1 17.5032 11.503 17.1002 12 17.1002L19.9965 17.1002C20.4935 17.1002 20.8965 17.5032 20.8965 18.0002C20.8965 18.4973 20.4935 18.9002 19.9965 18.9002H12C11.503 18.9002 11.1 18.4973 11.1 18.0002Z" fill="currentColor"></path><path d="M9.29789 9.77064C9.64716 10.1243 9.6436 10.6941 9.28994 11.0434L6.53146 13.7676C6.36053 13.9365 6.1292 14.0299 5.88897 14.0272C5.64874 14.0245 5.41956 13.9259 5.25245 13.7533L3.87321 12.3287C3.52747 11.9716 3.53668 11.4018 3.89379 11.0561C4.2509 10.7104 4.82067 10.7196 5.16642 11.0767L5.91339 11.8482L8.02512 9.76269C8.37878 9.41342 8.94862 9.41698 9.29789 9.77064Z" fill="currentColor"></path><path d="M9.29789 15.7436C9.64716 16.0973 9.6436 16.6671 9.28994 17.0164L6.53146 19.7406C6.36053 19.9094 6.1292 20.0029 5.88897 20.0002C5.64874 19.9975 5.41956 19.8989 5.25245 19.7263L3.87321 18.3017C3.52747 17.9446 3.53668 17.3748 3.89379 17.0291C4.2509 16.6833 4.82067 16.6926 5.16642 17.0497L5.91339 17.8212L8.02512 15.7357C8.37878 15.3864 8.94862 15.39 9.29789 15.7436Z" fill="currentColor"></path>',6)])])}const F8e=kt({name:"kimi-todo",render:N8e}),R8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function O8e(e,t){return y(),M("svg",R8e,[...t[0]||(t[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.09752 2.19507C8.5421 1.97278 9.08271 2.15298 9.305 2.59756L10.0562 4.10005H13.5C13.9971 4.10005 14.4 4.50299 14.4 5.00005C14.4 5.49711 13.9971 5.90005 13.5 5.90005H12.3106C12.2556 6.2319 12.1667 6.64073 12.0226 7.0987C11.7254 8.04355 11.191 9.20402 10.2334 10.3239C11.4166 11.196 12.5606 11.7524 13.4512 12.0987C13.978 12.3036 14.4136 12.434 14.7124 12.5122L14.7348 12.5181L15.695 10.5976C15.8475 10.2927 16.1591 10.1 16.5 10.1C16.8409 10.1 17.1525 10.2927 17.305 10.5976L20.7969 17.5814L20.8044 17.5959L20.8137 17.615L21.805 19.5976C22.0273 20.0421 21.8471 20.5827 21.4025 20.805C20.9579 21.0273 20.4173 20.8471 20.195 20.4025L19.4438 18.9H13.5562L12.805 20.4025C12.5827 20.8471 12.0421 21.0273 11.5975 20.805C11.1529 20.5827 10.9727 20.0421 11.195 19.5976L12.1863 17.615C12.1917 17.6036 12.1973 17.5924 12.2031 17.5814L13.9146 14.1583C13.6034 14.0667 13.2256 13.9423 12.7988 13.7764C11.7294 13.3605 10.3442 12.6802 8.92538 11.5924C7.79753 12.5167 6.69473 13.0764 5.83285 13.4112C5.33899 13.603 4.92286 13.7216 4.62401 13.7931C4.47449 13.8288 4.35399 13.8529 4.26741 13.8684C4.2241 13.8762 4.18924 13.8818 4.16343 13.8858L4.13156 13.8904L4.12084 13.8919L4.11682 13.8924L4.11514 13.8927C4.11514 13.8927 4.11368 13.8928 4.00001 13L4.11368 13.8928C3.62061 13.9556 3.17 13.6068 3.10722 13.1137C3.0446 12.6219 3.39148 12.1723 3.88256 12.1077L3.94947 12.0967C4.00428 12.0869 4.09114 12.0698 4.20543 12.0424C4.43422 11.9877 4.77156 11.8924 5.18106 11.7334C5.84103 11.477 6.68484 11.0564 7.56458 10.3753C7.15054 9.93496 6.78945 9.48388 6.50421 9.10102C6.26672 8.78224 6.07517 8.50172 5.94227 8.29973C5.87571 8.19858 5.82359 8.11671 5.78748 8.05909C5.76942 8.03027 5.75535 8.00749 5.74545 7.99135L5.73377 7.9722L5.73032 7.96651L5.72864 7.96371C5.71133 7.9349 5.69582 7.9055 5.68208 7.87566C5.49265 7.46416 5.6393 6.96717 6.03659 6.72853C6.09037 6.69623 6.14617 6.6702 6.20315 6.65023C6.59739 6.51205 7.04758 6.66421 7.27129 7.03623L7.27266 7.0385L7.28001 7.05054C7.28695 7.06186 7.29793 7.07964 7.31274 7.10328C7.34239 7.15059 7.38731 7.2212 7.44595 7.31032C7.56343 7.48886 7.73484 7.73997 7.94765 8.02562C8.21085 8.37889 8.52772 8.77187 8.8756 9.14201C9.64226 8.24147 10.0681 7.3133 10.3056 6.55854C10.381 6.3186 10.4372 6.09683 10.4791 5.90005H9.51951C9.50696 5.90031 9.49442 5.90031 9.48191 5.90005H4.00001C3.50296 5.90005 3.10001 5.49711 3.10001 5.00005C3.10001 4.50299 3.50296 4.10005 4.00001 4.10005H8.04378L7.69503 3.40254C7.67314 3.35877 7.65516 3.31407 7.64094 3.26883C7.51078 2.8546 7.69671 2.39547 8.09752 2.19507ZM16.5 13.0125L18.5438 17.1H14.4562L16.5 13.0125Z",fill:"currentColor"},null,-1),C("path",{d:"M15.1 4.00007C15.1 3.50301 15.5029 3.10007 16 3.10007H18C19.6016 3.10007 20.9 4.39844 20.9 6.00007V8.00007C20.9 8.49712 20.497 8.90007 20 8.90007C19.5029 8.90007 19.1 8.49712 19.1 8.00007V6.00007C19.1 5.39255 18.6075 4.90007 18 4.90007H16C15.5029 4.90007 15.1 4.49712 15.1 4.00007Z",fill:"currentColor"},null,-1),C("path",{d:"M3.99998 15.1001C4.49703 15.1001 4.89998 15.503 4.89998 16.0001V18.0001C4.89998 18.6076 5.39246 19.1001 5.99998 19.1001H7.99998C8.49703 19.1001 8.89998 19.503 8.89998 20.0001C8.89998 20.4971 8.49703 20.9001 7.99998 20.9001H5.99998C4.39835 20.9001 3.09998 19.6017 3.09998 18.0001V16.0001C3.09998 15.503 3.50292 15.1001 3.99998 15.1001Z",fill:"currentColor"},null,-1)])])}const P8e=kt({name:"kimi-translate",render:O8e}),D8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function B8e(e,t){return y(),M("svg",D8e,[...t[0]||(t[0]=[C("path",{d:"M8.10001 3C8.10001 2.50294 8.50295 2.1 9.00001 2.1H15C15.4971 2.1 15.9 2.50294 15.9 3C15.9 3.49706 15.4971 3.9 15 3.9H9.00001C8.50295 3.9 8.10001 3.49706 8.10001 3Z",fill:"currentColor"},null,-1),C("path",{d:"M10 15.9C9.50295 15.9 9.10001 15.4971 9.10001 15L9.10001 10C9.10001 9.50294 9.50295 9.1 10 9.1C10.4971 9.1 10.9 9.50294 10.9 10L10.9 15C10.9 15.4971 10.4971 15.9 10 15.9Z",fill:"currentColor"},null,-1),C("path",{d:"M13.1 15C13.1 15.4971 13.5029 15.9 14 15.9C14.4971 15.9 14.9 15.4971 14.9 15L14.9 10C14.9 9.50294 14.4971 9.1 14 9.1C13.5029 9.1 13.1 9.50294 13.1 10V15Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.10001 6C2.10001 5.50294 2.50295 5.1 3.00001 5.1H4.99152C4.99785 5.09993 5.00417 5.09993 5.01048 5.1H18.9895C18.9958 5.09993 19.0021 5.09993 19.0085 5.1H21C21.4971 5.1 21.9 5.50294 21.9 6C21.9 6.49706 21.4971 6.9 21 6.9H19.8281L18.8448 18.6993C18.7412 19.9432 17.7013 20.9 16.4531 20.9H7.54686C6.29865 20.9 5.25881 19.9432 5.15515 18.6993L4.17188 6.9H3.00001C2.50295 6.9 2.10001 6.49706 2.10001 6ZM5.97811 6.9L18.0219 6.9L17.0511 18.5498C17.0251 18.8608 16.7652 19.1 16.4531 19.1H7.54686C7.23481 19.1 6.97485 18.8608 6.94893 18.5498L5.97811 6.9Z",fill:"currentColor"},null,-1)])])}const H8e=kt({name:"kimi-trash",render:B8e}),z8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function W8e(e,t){return y(),M("svg",z8e,[...t[0]||(t[0]=[C("path",{d:"M7.36336 3.3634C7.71483 3.01192 8.28533 3.01192 8.6368 3.3634C8.98817 3.71488 8.98824 4.2854 8.6368 4.63683L6.17391 7.09972H15.0001C18.2585 7.09977 20.9005 9.74166 20.9005 13.0001C20.9004 16.2585 18.2585 18.9005 15.0001 18.9005H7.00008C6.50307 18.9005 6.09976 18.4971 6.09969 18.0001C6.09969 17.5031 6.50302 17.0997 7.00008 17.0997H15.0001C17.2644 17.0997 19.0996 15.2644 19.0997 13.0001C19.0997 10.7358 17.2644 8.90055 15.0001 8.90051H6.17391L8.6368 11.3634L8.69832 11.4318C8.98668 11.7853 8.96632 12.3073 8.6368 12.6368C8.30728 12.9663 7.78521 12.9867 7.43172 12.6984L7.36336 12.6368L3.36336 8.63683C3.33098 8.60445 3.30286 8.56908 3.27645 8.53332C3.25597 8.50559 3.23607 8.47741 3.21883 8.44738C3.20492 8.42311 3.19221 8.39837 3.18074 8.37316C3.1764 8.36365 3.17109 8.35453 3.16707 8.34484C3.1627 8.33427 3.1593 8.32331 3.15535 8.31261C3.12946 8.24274 3.11237 8.16872 3.10457 8.09191C3.09258 7.97426 3.10262 7.85446 3.1368 7.74035C3.14281 7.72035 3.15094 7.70114 3.15828 7.68176C3.16165 7.67283 3.16341 7.66325 3.16707 7.65441C3.17216 7.64216 3.17806 7.63025 3.18367 7.61828C3.19055 7.60356 3.19744 7.58874 3.20516 7.57433C3.24709 7.49624 3.3012 7.42556 3.36336 7.3634L7.36336 3.3634Z",fill:"currentColor"},null,-1)])])}const U8e=kt({name:"kimi-undo",render:W8e}),j8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function V8e(e,t){return y(),M("svg",j8e,[...t[0]||(t[0]=[C("path",{d:"M11.9997 12.8779C16.0197 12.878 19.4393 15.3848 20.7048 18.8828C21.0812 19.9234 20.2782 20.8962 19.2038 21.0137L18.9861 21.0264H5.0134L4.79562 21.0137C3.7213 20.8961 2.91743 19.9233 3.29367 18.8828C4.55905 15.3847 7.9797 12.8781 11.9997 12.8779ZM11.9997 14.6777C8.84467 14.6779 6.17462 16.5794 5.09152 19.2256H18.9079C17.8248 16.5793 15.1549 14.6778 11.9997 14.6777ZM12.2312 3.00586C14.6088 3.1264 16.4997 5.09239 16.4997 7.5L16.4939 7.73145C16.3734 10.1091 14.4073 11.9999 11.9997 12C9.59225 11.9998 7.62604 10.109 7.50558 7.73145L7.49973 7.5C7.49973 5.01485 9.51462 3.00021 11.9997 3L12.2312 3.00586ZM11.9997 4.7998C10.5087 4.80001 9.29953 6.00896 9.29953 7.5C9.29953 8.99104 10.5087 10.2 11.9997 10.2002C13.4908 10.2001 14.6999 8.99112 14.6999 7.5C14.6999 6.00888 13.4908 4.79989 11.9997 4.7998Z",fill:"currentColor"},null,-1)])])}const q8e=kt({name:"kimi-user",render:V8e}),K8e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Z8e(e,t){return y(),M("svg",K8e,[...t[0]||(t[0]=[C("path",{d:"M11.9996 7C11.5026 7 11.0996 7.36985 11.0996 7.82609V14.1739C11.0996 14.6301 11.5026 15 11.9996 15C12.4967 15 12.8996 14.6301 12.8996 14.1739V7.82609C12.8996 7.36985 12.4967 7 11.9996 7Z",fill:"currentColor"},null,-1),C("path",{d:"M12.8996 17.1006C12.8996 17.5974 12.4968 18.001 11.9992 18.001C11.5024 18.001 11.0996 17.5974 11.0996 17.1006C11.0996 16.6038 11.5024 16.2002 11.9992 16.2002C12.4968 16.2002 12.8996 16.6038 12.8996 17.1006Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.5108 3.5501C13.3946 1.61676 10.6041 1.61676 9.48786 3.5501L1.69363 17.0501C0.577423 18.9834 1.97269 21.4001 4.20511 21.4001H19.7936C22.026 21.4001 23.4212 18.9834 22.305 17.0501L14.5108 3.5501ZM11.0467 4.4501C11.4701 3.71676 12.5286 3.71676 12.952 4.4501L20.7462 17.9501C21.1696 18.6834 20.6403 19.6001 19.7936 19.6001H4.20511C3.35833 19.6001 2.82909 18.6834 3.25248 17.9501L11.0467 4.4501Z",fill:"currentColor"},null,-1)])])}const G8e=kt({name:"kimi-warning",render:Z8e}),Y8e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function X8e(e,t){return y(),M("svg",Y8e,[...t[0]||(t[0]=[C("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[C("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm11-2v16"}),C("path",{d:"m9 10l2 2l-2 2"})],-1)])])}const J8e=kt({name:"tabler-layout-sidebar-right-collapse",render:X8e}),Q8e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eye(e,t){return y(),M("svg",Q8e,[...t[0]||(t[0]=[C("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const tye=kt({name:"tabler-paperclip",render:eye}),nye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oye(e,t){return y(),M("svg",nye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const sye=kt({name:"ri-braces-line",render:oye}),iye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rye(e,t){return y(),M("svg",iye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const lye=kt({name:"ri-calendar-close-line",render:rye}),aye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uye(e,t){return y(),M("svg",aye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const cye=kt({name:"ri-calendar-schedule-line",render:uye}),dye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fye(e,t){return y(),M("svg",dye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const pye=kt({name:"ri-calendar-todo-line",render:fye}),hye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mye(e,t){return y(),M("svg",hye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const gye=kt({name:"ri-code-line",render:mye}),vye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yye(e,t){return y(),M("svg",vye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-4-7h8a4 4 0 0 1-8 0m0-2a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m8 0a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3"},null,-1)])])}const kye=kt({name:"ri-emotion-line",render:yye}),bye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Cye(e,t){return y(),M("svg",bye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const wye=kt({name:"ri-external-link-line",render:Cye}),_ye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xye(e,t){return y(),M("svg",_ye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12 3c5.392 0 9.878 3.88 10.819 9c-.94 5.12-5.427 9-10.819 9s-9.878-3.88-10.818-9C2.122 6.88 6.608 3 12 3m0 16a9.005 9.005 0 0 0 8.778-7a9.005 9.005 0 0 0-17.555 0A9.005 9.005 0 0 0 12 19m0-2.5a4.5 4.5 0 1 1 0-9a4.5 4.5 0 0 1 0 9m0-2a2.5 2.5 0 1 0 0-5a2.5 2.5 0 0 0 0 5"},null,-1)])])}const Sye=kt({name:"ri-eye-line",render:xye}),Aye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Mye(e,t){return y(),M("svg",Aye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M17.883 19.297A10.95 10.95 0 0 1 12 21c-5.392 0-9.878-3.88-10.818-9A11 11 0 0 1 4.52 5.935L1.394 2.808l1.414-1.414l19.799 19.798l-1.414 1.415zM5.936 7.35A8.97 8.97 0 0 0 3.223 12a9.005 9.005 0 0 0 13.201 5.838l-2.028-2.028A4.5 4.5 0 0 1 8.19 9.604zm6.978 6.978l-3.242-3.241a2.5 2.5 0 0 0 3.241 3.241m7.893 2.265l-1.431-1.431A8.9 8.9 0 0 0 20.778 12A9.005 9.005 0 0 0 9.552 5.338L7.974 3.76C9.221 3.27 10.58 3 12 3c5.392 0 9.878 3.88 10.819 9a10.95 10.95 0 0 1-2.012 4.593m-9.084-9.084Q11.86 7.5 12 7.5a4.5 4.5 0 0 1 4.492 4.778z"},null,-1)])])}const Tye=kt({name:"ri-eye-off-line",render:Mye}),Eye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Iye(e,t){return y(),M("svg",Eye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const Lye=kt({name:"ri-file-add-line",render:Iye}),$ye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Nye(e,t){return y(),M("svg",$ye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const Fye=kt({name:"ri-flashlight-line",render:Nye}),Rye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Oye(e,t){return y(),M("svg",Rye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const Pye=kt({name:"ri-folder-fill",render:Oye}),Dye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bye(e,t){return y(),M("svg",Dye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const Hye=kt({name:"ri-git-fork-line",render:Bye}),zye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Wye(e,t){return y(),M("svg",zye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const Uye=kt({name:"ri-git-pull-request-line",render:Wye}),jye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Vye(e,t){return y(),M("svg",jye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M2 18h7v2H2zm0-7h9v2H2zm0-7h20v2H2zm18.674 9.025l1.156-.391l1 1.732l-.916.805a4 4 0 0 1 0 1.658l.916.805l-1 1.732l-1.156-.391a4 4 0 0 1-1.435.83L19 21h-2l-.24-1.196a4 4 0 0 1-1.434-.83l-1.156.392l-1-1.732l.916-.805a4 4 0 0 1 0-1.658l-.916-.805l1-1.732l1.156.391c.41-.37.898-.655 1.435-.83L17 11h2l.24 1.196a4 4 0 0 1 1.434.83M18 18a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const qye=kt({name:"ri-list-settings-line",render:Vye}),Kye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Zye(e,t){return y(),M("svg",Kye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M10 2a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H8v2h5V9a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1H8v6h5v-1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1H7a1 1 0 0 1-1-1V8H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm9 16h-4v2h4zm0-8h-4v2h4zM9 4H5v2h4z"},null,-1)])])}const Gye=kt({name:"ri-node-tree",render:Zye}),Yye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xye(e,t){return y(),M("svg",Yye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m13.827 1.69l8.486 8.485l-1.415 1.414l-.707-.707l-4.242 4.243l-.707 3.536l-1.415 1.414l-4.242-4.243l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.243-4.243l1.414-1.414l3.536-.707l4.242-4.243l-.707-.707zm.707 3.536l-4.67 4.67l-2.822.565l6.5 6.5l.564-2.822l4.671-4.67z"},null,-1)])])}const Jye=kt({name:"ri-pushpin-line",render:Xye}),Qye={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e5e(e,t){return y(),M("svg",Qye,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const t5e=kt({name:"ri-sort-desc",render:e5e}),n5e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function o5e(e,t){return y(),M("svg",n5e,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const s5e=kt({name:"ri-star-fill",render:o5e}),i5e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function r5e(e,t){return y(),M("svg",i5e,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const l5e=kt({name:"ri-star-line",render:r5e}),a5e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u5e(e,t){return y(),M("svg",a5e,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const c5e=kt({name:"ri-tools-line",render:u5e}),d5e={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function f5e(e,t){return y(),M("svg",d5e,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m20.97 17.172l-1.414 1.414l-3.535-3.535l-.073.074l-.707 3.536l-1.415 1.414l-4.242-4.243l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.243-4.243L5.34 8.761l3.536-.707l.073-.074l-3.536-3.536L6.828 3.03zM10.365 9.394l-.502.502l-2.822.565l6.5 6.5l.564-2.822l.502-.502zm8.411.074l-1.34 1.34l1.414 1.415l1.34-1.34l.707.707l1.415-1.415l-8.486-8.485l-1.414 1.414l.707.707l-1.34 1.34l1.414 1.415l1.34-1.34z"},null,-1)])])}const p5e=kt({name:"ri-unpin-line",render:f5e}),h5e=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
332
332
  <path d="M12.0684 2.03418C12.5654 2.03421 12.9687 2.43755 12.9688 2.93457V11.0996H21.0654C21.5625 11.0996 21.9658 11.503 21.9658 12C21.9658 12.497 21.5625 12.9004 21.0654 12.9004H12.9688V21.0654C12.9687 21.5624 12.5654 21.9658 12.0684 21.9658C11.5713 21.9658 11.168 21.5625 11.168 21.0654V12.9004H2.93457C2.43751 12.9004 2.03418 12.4971 2.03418 12C2.03418 11.5029 2.43751 11.0996 2.93457 11.0996H11.168V2.93457C11.168 2.43753 11.5713 2.03418 12.0684 2.03418Z" fill="currentColor"/>
333
333
  </svg>
334
334
  `,m5e=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
@@ -598,7 +598,7 @@ ${_}`);c+=T}else c+=S;c+=w,d=h?f+1:e.length}return c}function Yue(e,t){if(!e||!t
598
598
  </svg>
599
599
  `,M6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm11-2v16"/><path d="m9 10l2 2l-2 2"/></g></svg>',T6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"/></svg>',E6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/></svg>',I6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"/></svg>',L6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"/></svg>',$6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"/></svg>',N6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/></svg>',F6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-4-7h8a4 4 0 0 1-8 0m0-2a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m8 0a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3"/></svg>',R6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/></svg>',O6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 3c5.392 0 9.878 3.88 10.819 9c-.94 5.12-5.427 9-10.819 9s-9.878-3.88-10.818-9C2.122 6.88 6.608 3 12 3m0 16a9.005 9.005 0 0 0 8.778-7a9.005 9.005 0 0 0-17.555 0A9.005 9.005 0 0 0 12 19m0-2.5a4.5 4.5 0 1 1 0-9a4.5 4.5 0 0 1 0 9m0-2a2.5 2.5 0 1 0 0-5a2.5 2.5 0 0 0 0 5"/></svg>',P6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M17.883 19.297A10.95 10.95 0 0 1 12 21c-5.392 0-9.878-3.88-10.818-9A11 11 0 0 1 4.52 5.935L1.394 2.808l1.414-1.414l19.799 19.798l-1.414 1.415zM5.936 7.35A8.97 8.97 0 0 0 3.223 12a9.005 9.005 0 0 0 13.201 5.838l-2.028-2.028A4.5 4.5 0 0 1 8.19 9.604zm6.978 6.978l-3.242-3.241a2.5 2.5 0 0 0 3.241 3.241m7.893 2.265l-1.431-1.431A8.9 8.9 0 0 0 20.778 12A9.005 9.005 0 0 0 9.552 5.338L7.974 3.76C9.221 3.27 10.58 3 12 3c5.392 0 9.878 3.88 10.819 9a10.95 10.95 0 0 1-2.012 4.593m-9.084-9.084Q11.86 7.5 12 7.5a4.5 4.5 0 0 1 4.492 4.778z"/></svg>',D6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',B6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/></svg>',H6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/></svg>',z6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"/></svg>',W6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',U6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2 18h7v2H2zm0-7h9v2H2zm0-7h20v2H2zm18.674 9.025l1.156-.391l1 1.732l-.916.805a4 4 0 0 1 0 1.658l.916.805l-1 1.732l-1.156-.391a4 4 0 0 1-1.435.83L19 21h-2l-.24-1.196a4 4 0 0 1-1.434-.83l-1.156.392l-1-1.732l.916-.805a4 4 0 0 1 0-1.658l-.916-.805l1-1.732l1.156.391c.41-.37.898-.655 1.435-.83L17 11h2l.24 1.196a4 4 0 0 1 1.434.83M18 18a2 2 0 1 0 0-4a2 2 0 0 0 0 4"/></svg>',j6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M10 2a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H8v2h5V9a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1H8v6h5v-1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1H7a1 1 0 0 1-1-1V8H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm9 16h-4v2h4zm0-8h-4v2h4zM9 4H5v2h4z"/></svg>',V6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.827 1.69l8.486 8.485l-1.415 1.414l-.707-.707l-4.242 4.243l-.707 3.536l-1.415 1.414l-4.242-4.243l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.243-4.243l1.414-1.414l3.536-.707l4.242-4.243l-.707-.707zm.707 3.536l-4.67 4.67l-2.822.565l6.5 6.5l.564-2.822l4.671-4.67z"/></svg>',q6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/></svg>',K6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/></svg>',Z6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/></svg>',G6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"/></svg>',Y6e='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m20.97 17.172l-1.414 1.414l-3.535-3.535l-.073.074l-.707 3.536l-1.415 1.414l-4.242-4.243l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.243-4.243L5.34 8.761l3.536-.707l.073-.074l-3.536-3.536L6.828 3.03zM10.365 9.394l-.502.502l-2.822.565l6.5 6.5l.564-2.822l.502-.502zm8.411.074l-1.34 1.34l1.414 1.415l1.34-1.34l.707.707l1.415-1.415l-8.486-8.485l-1.414 1.414l.707.707l-1.34 1.34l1.414 1.415l1.34-1.34z"/></svg>',X6e={sm:14,md:16,lg:20};function xt(e,t){return{component:e,svg:t}}const BN={plus:xt(d9e,h5e),"chat-new":xt(h9e,m5e),"calendar-close":xt(lye,I6e),"calendar-schedule":xt(cye,L6e),"calendar-todo":xt(pye,$6e),close:xt(K9e,A5e),check:xt($9e,C5e),archive:xt(v9e,g5e),search:xt(J3e,u6e),copy:xt(n4e,E5e),link:xt(g3e,X5e),"external-link":xt(wye,R6e),download:xt(a4e,L5e),undo:xt(U8e,x6e),send:xt(t8e,c6e),image:xt(G4e,j5e),settings:xt(s8e,d6e),sliders:xt(g8e,m6e),"light-mode":xt(p3e,Y5e),"dark-mode":xt(i4e,I5e),"follow-system":xt(L4e,D5e),"log-in":xt(c8e,p6e),"log-out":xt(p8e,h6e),hand:xt(U4e,W5e),"full-access":xt(F4e,B5e),"shield-question":xt(l8e,f6e),"chevron-down":xt(R9e,w5e),"chevron-right":xt(D9e,_5e),"chevron-up":xt(z9e,x5e),"arrow-up":xt(E9e,b5e),"arrow-down":xt(b9e,v5e),"arrow-right":xt(A9e,k5e),"arrow-left":xt(_9e,y5e),minus:xt(S3e,e6e),microscope:xt(T3e,t6e),"panel-collapse":xt(l3e,Z5e),"panel-collapse-right":xt(J8e,M6e),"panel-expand":xt(c3e,G5e),expand:xt(h4e,N5e),collapse:xt(Y9e,M5e),list:xt(k3e,J5e),"list-settings":xt(qye,U6e),"tree-view":xt(Gye,j6e),sort:xt(t5e,q6e),grip:xt(H4e,z5e),folder:xt(S4e,O5e),"folder-closed":xt(w4e,R5e),"folder-plus":xt(T4e,P5e),"folder-solid":xt(Pye,H6e),file:xt(Gx,Yx),"file-text":xt(k4e,F5e),"file-edit":xt(d4e,$5e),"file-plus":xt(Lye,D6e),"file-off":xt(Gx,Yx),attachment:xt(tye,T6e),"image-off":xt(J4e,V5e),eye:xt(Sye,O6e),"eye-off":xt(Tye,P6e),code:xt(gye,N6e),terminal:xt(T8e,k6e),pencil:xt(H3e,i6e),tool:xt(c5e,G6e),glob:xt(sye,E6e),globe:xt(P4e,H5e),translate:xt(P8e,w6e),"check-list":xt(F8e,C6e),bolt:xt(Fye,B6e),keyboard:xt(s3e,K5e),trash:xt(H8e,_6e),"git-fork":xt(Hye,z6e),"git-pull-request":xt(Uye,W6e),message:xt(Q9e,T5e),mail:xt(w3e,Q5e),user:xt(q8e,S6e),info:xt(t3e,q5e),"help-circle":xt(q3e,l6e),"alert-triangle":xt(G8e,A6e),clock:xt(j9e,S5e),robot:xt(G3e,a6e),sparkles:xt(S8e,y6e),histogram:xt(q4e,U5e),music:xt(F3e,o6e),emoji:xt(kye,F6e),target:xt(w8e,v6e),pause:xt(P3e,s6e),play:xt(U3e,r6e),pin:xt(Jye,V6e),stop:xt(k8e,g6e),star:xt(s5e,K6e),"star-outline":xt(l5e,Z6e),unpin:xt(p5e,Y6e),"dots-horizontal":xt(L3e,n6e),thinking:xt(L8e,b6e)};function J6e(e){return BN[e]}function Q6e(e,t){return e.replace(/<svg\b[^>]*>/,n=>n.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function yd(e,t="md"){const n=BN[e];return n?Q6e(n.svg,X6e[t]):""}const OVe=[["Actions",["plus","attachment","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in","log-out","eye","eye-off"]],["Navigation & layout",["chevron-down","chevron-right","chevron-up","arrow-up","arrow-down","arrow-right","arrow-left","minus","panel-collapse","panel-collapse-right","panel-expand","expand","collapse","list","list-settings","tree-view","sort","grip"]],["Files & tools",["folder","folder-closed","folder-plus","folder-solid","file","file-text","file-edit","file-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-fork","git-pull-request","archive","pin","unpin","target","calendar-schedule","calendar-todo","calendar-close","keyboard","trash","microscope"]],["Communication",["message","mail","user","robot","emoji","translate"]],["Status & media",["info","help-circle","alert-triangle","hand","full-access","shield-question","clock","histogram","music","sparkles","pause","play","stop","star","star-outline","dots-horizontal","thinking","light-mode","dark-mode","follow-system"]]],G5=(e,t)=>t===void 0?Hn.global.t(e):Hn.global.t(e,t);function _1(e){return RT(G5,e)}function Xx(e,t,n=!1){return wy(G5,e,t,n)}function e7e(e){return HG(G5,e)}const t7e={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"sparkles",askuserquestion:"help-circle",exitplanmode:"file-text",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function HN(e){const t=Gs(e);let n=t7e[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),n}function zN(e){return yd(HN(e),"sm")}const n7e={class:"op"},o7e={key:0,class:"op-empty"},s7e=et({__name:"OutputPanel",props:{lines:{default:void 0},emptyText:{default:""}},setup(e){const t=e,n=R(()=>t.lines??[]);return(o,s)=>(y(),M("div",n7e,[n.value.length===0&&e.emptyText?(y(),M("div",o7e,N(e.emptyText),1)):ee("",!0),(y(!0),M(Pe,null,pt(n.value,(i,r)=>(y(),M("div",{key:r},N(i),1))),128))]))}}),dr=ft(s7e,[["__scopeId","data-v-ab413c67"]]),i7e=["disabled","aria-label","aria-expanded"],r7e={class:"lead","aria-hidden":"true"},l7e={class:"main"},a7e={class:"task"},u7e={key:0,class:"type"},c7e={class:"tail"},d7e=["aria-label"],f7e=["aria-expanded"],p7e=et({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openAgent"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t;function i(g){if(!g)return{};try{const x=JSON.parse(g);return{description:typeof x.description=="string"?x.description:void 0,subagentType:typeof x.subagent_type=="string"?x.subagent_type:void 0}}catch{return{}}}const r=R(()=>i(o.tool.arg)),l=R(()=>o.tool.status),a=R(()=>r.value.description||r.value.subagentType||_1(o.tool.name)),u=R(()=>r.value.description?r.value.subagentType:""),c=nn("resolveAgentTaskId"),d=nn("resolveAgentModel"),f=R(()=>o.tool.agentId??c?.(o.tool.id)),h=R(()=>f.value!==void 0),m=R(()=>d?.(o.tool.id,f.value)),v=R(()=>[u.value,m.value?.display,m.value?.effort].filter(g=>g).join(" · ")),k=R(()=>!!o.tool.output&&o.tool.output.length>0),w=R(()=>h.value||k.value),b=Z(!1);function _(){if(f.value!==void 0){s("openAgent",f.value);return}k.value&&(b.value=!b.value)}return(g,x)=>(y(),M("div",{class:Re(["agent-card",{err:l.value==="error"}])},[C("button",{class:"head",type:"button",disabled:!w.value,"aria-label":h.value?p(n)("tasks.openDetail"):void 0,"aria-expanded":h.value?void 0:b.value,onClick:_},[C("span",r7e,[j(p(Te),{name:"robot",size:"sm"})]),C("span",l7e,[C("span",a7e,N(a.value),1),v.value?(y(),M("span",u7e,N(v.value),1)):ee("",!0)]),C("span",c7e,[C("span",{class:Re(["st",l.value]),role:"status","aria-label":l.value},[l.value==="ok"?(y(),he(p(Te),{key:0,name:"check",size:"sm"})):l.value==="error"?(y(),he(p(Te),{key:1,name:"close",size:"sm"})):(y(),he(p(hc),{key:2,status:"running"}))],10,d7e),h.value?(y(),he(p(Te),{key:0,class:"go",name:"arrow-right",size:"sm","aria-hidden":"true"})):k.value?(y(),he(p(Te),{key:1,class:Re(["go car",{open:b.value}]),name:"chevron-right",size:"sm","aria-hidden":"true"},null,8,["class"])):ee("",!0)])],8,i7e),h.value&&k.value?(y(),M("button",{key:0,class:"saved-result",type:"button","aria-expanded":b.value,onClick:x[0]||(x[0]=S=>b.value=!b.value)},[j(p(Te),{class:Re(["saved-result__chevron",{open:b.value}]),name:"chevron-right",size:"sm","aria-hidden":"true"},null,8,["class"]),C("span",null,N(p(n)("tools.output.saved")),1)],8,f7e)):ee("",!0),k.value&&b.value?(y(),M("div",{key:1,class:Re(["result",{"result--legacy":!h.value}])},[j(dr,{lines:e.tool.output},null,8,["lines"])],2)):ee("",!0)],2))}}),h7e=ft(p7e,[["__scopeId","data-v-7cea5372"]]);function m7e(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const o=[];for(const s of n){if(!s||typeof s!="object")continue;const i=s,r=Array.isArray(i.options)?i.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];o.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return o}catch{return[]}}const Nh={recognized:!1,answers:{},note:""};function g7e(e){const t=e?.[0];if(!t)return Nh;let n;try{n=JSON.parse(t)}catch{return Nh}if(!n||typeof n!="object"||Array.isArray(n))return Nh;const o=n.answers;if(!o||typeof o!="object"||Array.isArray(o))return Nh;const s={};for(const[i,r]of Object.entries(o))typeof r=="string"?s[i]=r:r===!0&&(s[i]=!0);return{recognized:!0,answers:s,note:typeof n.note=="string"?n.note:""}}function v7e(e,t,n){return e[t]??e[`q_${n}`]}const y7e=/^opt_\d+_(\d+)$/;function k7e(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const o=n.get(e);if(o!==void 0)return{selected:new Set([o]),otherText:"",indeterminate:!1};const s=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){s.add(a);continue}const u=y7e.exec(l);u?s.add(Number(u[1])):l.length>0&&i.push(l)}return{selected:s,otherText:i.join(", "),indeterminate:!1}}const b7e={class:"tl-ic","aria-hidden":"true"},C7e={class:"tl-main"},w7e=["aria-expanded","aria-label"],_7e={class:"tl-tail"},x7e=["aria-label"],S7e=["inert"],A7e={class:"tl-body-inner"},M7e=et({__name:"ToolDisclosure",props:{status:{},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1}},emits:["toggle"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=nn("pinScroll",()=>{}),r=Z(null);function l(){if(!n.expandable)return;o("toggle");const u=r.value;u&&yt(()=>i(u))}const a=R(()=>n.open?s("tools.disclosure.collapse"):s("tools.disclosure.expand"));return(u,c)=>(y(),M("div",{class:Re(["tool-line",{open:e.open,expandable:e.expandable,err:e.status==="error"}])},[C("div",{ref_key:"headEl",ref:r,class:Re(["tl-head",{clickable:e.expandable}]),onClick:l},[C("span",b7e,[xn(u.$slots,"leading")]),C("span",C7e,[xn(u.$slots,"default"),j(p(pn),{text:a.value},{default:me(()=>[e.expandable?(y(),M("button",{key:0,class:"tl-car",type:"button","aria-expanded":e.open,"aria-label":a.value,onClick:It(l,["stop"])},[j(p(Te),{class:"tl-car-ic",name:"chevron-right",size:"sm","aria-hidden":"true"})],8,w7e)):ee("",!0)]),_:1},8,["text"])]),C("span",_7e,[xn(u.$slots,"trailing"),C("span",{class:Re(["tl-status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(y(),he(p(Te),{key:0,name:"check",size:"sm"})):e.status==="error"?(y(),he(p(Te),{key:1,name:"close",size:"sm"})):e.status==="suspended"?(y(),he(p(hc),{key:2,status:"suspended"})):(y(),he(p(hc),{key:3,status:"running"}))],10,x7e)])],2),e.expandable?(y(),M("div",{key:0,class:Re(["tl-body",{open:e.open}]),inert:!e.open},[C("div",A7e,[xn(u.$slots,"body")])],10,S7e)):ee("",!0)],2))}}),el=ft(M7e,[["__scopeId","data-v-58658159"]]),T7e={key:0,class:"rc-flat"},E7e={class:"rc-head"},I7e={class:"rc-st"},L7e={class:"rc-qtext"},$7e={class:"rc-lb"},N7e={key:0,class:"rc-opt"},F7e={class:"rc-lb"},R7e={class:"rc-ds"},O7e={key:1,class:"rc-opt"},P7e={class:"rc-lb"},D7e={key:2,class:"rc-qskip"},B7e={class:"tl-name"},H7e={key:0,class:"tl-dim"},z7e={key:0,class:"tl-chip"},W7e=80,U7e=et({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia","openFile"],setup(e){const t=e,{t:n}=Nt();function o(T,A=W7e){const E=T.trim();return E.length>A?E.slice(0,A-1)+"…":E}const s=R(()=>m7e(t.tool.arg)),i=R(()=>g7e(t.tool.output)),r=R(()=>i.value.recognized),l=R(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=R(()=>s.value.map((T,A)=>k7e(v7e(i.value.answers,T.question,A),T.options))),u=R(()=>Object.keys(i.value.answers).length);function c(T,A){return a.value[T]?.selected.has(A)??!1}function d(T){return a.value[T]?.otherText??""}function f(T){return a.value[T]?.indeterminate??!1}const h=R(()=>t.tool.status),m=R(()=>s.value.map((T,A)=>({q:T,selected:T.options.map((E,P)=>({o:E,oi:P})).filter(({oi:E})=>c(A,E))}))),v=R(()=>s.value.length===1?n("tools.ask.question",{count:1}):n("tools.ask.questions",{count:s.value.length})),k=R(()=>{const T=s.value[0]?.question??"",A=n("tools.ask.unanswered");return T?`${T} —— ${A}`:A}),w=R(()=>{if(!r.value)return o(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const T=s.value[0]?.question??"",A=o(T);return s.value.length<=1?A:`${A} ${n("tools.ask.more",{count:s.value.length-1})}`}),b=R(()=>r.value?l.value?n("tools.ask.dismissed"):u.value===0?"":u.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:u.value}):""),_=R(()=>!!t.tool.output&&t.tool.output.length>0),g=R(()=>r.value&&(s.value.length>0||l.value)||_.value),x=Z(t.tool.defaultExpanded===!0&&g.value),S=R(()=>_1(t.tool.name));return Je(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&g.value&&(x.value=!0)}),(T,A)=>r.value&&h.value==="ok"?(y(),M("div",{key:0,class:Re(["ask-receipt",{flat:l.value||u.value===0}])},[l.value||u.value===0?(y(),M("span",T7e,N(k.value),1)):(y(),M(Pe,{key:1},[C("div",E7e,[C("span",null,N(p(n)("tools.ask.collected"))+" · "+N(v.value),1),C("span",I7e,[j(p(Te),{name:"check",size:"sm"})])]),(y(!0),M(Pe,null,pt(m.value,(E,P)=>(y(),M("div",{key:P,class:"rc-q"},[C("div",L7e,[C("span",null,N(E.q.question),1)]),(y(!0),M(Pe,null,pt(E.selected,D=>(y(),M("div",{key:D.oi,class:"rc-opt"},[C("span",{class:Re(["rc-g on",E.q.multiSelect?"chk":"rad"])},null,2),C("span",$7e,N(D.o.label),1)]))),128)),d(P)?(y(),M("div",N7e,[C("span",{class:Re(["rc-g on",E.q.multiSelect?"chk":"rad"])},null,2),C("span",F7e,N(d(P)),1),C("span",R7e,N(p(n)("tools.ask.freeInput")),1)])):ee("",!0),f(P)?(y(),M("div",O7e,[A[1]||(A[1]=C("span",{class:"rc-g rad on"},null,-1)),C("span",P7e,N(p(n)("tools.ask.answered")),1)])):ee("",!0),E.selected.length===0&&!d(P)&&!f(P)?(y(),M("div",D7e,N(p(n)("tools.ask.unanswered")),1)):ee("",!0)]))),128))],64))],2)):(y(),he(el,{key:1,status:h.value,open:x.value,expandable:g.value,onToggle:A[0]||(A[0]=E=>x.value=!x.value)},{leading:me(()=>[j(p(Te),{name:"help-circle",size:"sm"})]),trailing:me(()=>[b.value?(y(),M("span",z7e,N(b.value),1)):ee("",!0)]),body:me(()=>[j(dr,{lines:e.tool.output},null,8,["lines"])]),default:me(()=>[C("span",B7e,N(S.value),1),w.value?(y(),M("span",H7e,N(w.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),j7e=ft(U7e,[["__scopeId","data-v-f29eda04"]]);function gu(e){const t=(e??"").trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function jn(e){return typeof e=="string"&&e.length>0?e:void 0}function Ia(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function WN(e){if(e)return jn(e.path)??jn(e.file_path)??jn(e.filePath)??jn(e.filename)}function UN(e){return/^(.*)[\\/][^\\/]+[\\/]?$/.exec(e)?.[1]??""}function V7e(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}const q7e={class:"tl-name"},K7e={class:"tl-mono"},Z7e={key:0,class:"tl-chip"},G7e={class:"cmd-echo"},Y7e=et({__name:"BashTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=Nt(),o=R(()=>t.tool.status),s=R(()=>{const u=gu(t.tool.arg);return(jn(u?.command)??jn(u?.cmd)??jn(u?.script)??t.tool.arg.replace(/^·\s*/,"")).trim()}),i=R(()=>t.tool.status==="running"),r=R(()=>!!t.tool.output&&t.tool.output.length>0),l=R(()=>r.value||i.value||s.value.length>0),a=Z(t.tool.defaultExpanded===!0&&l.value);return Je(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&l.value&&(a.value=!0)}),(u,c)=>(y(),he(el,{status:o.value,open:a.value,expandable:l.value,onToggle:c[0]||(c[0]=d=>a.value=!a.value)},{leading:me(()=>[j(p(Te),{name:"terminal",size:"sm"})]),trailing:me(()=>[e.tool.timing?(y(),M("span",Z7e,N(e.tool.timing),1)):ee("",!0)]),body:me(()=>[C("div",G7e,N(s.value),1),j(dr,{lines:e.tool.output,"empty-text":i.value?p(n)("tools.output.waiting"):p(n)("tools.output.empty")},null,8,["lines","empty-text"])]),default:me(()=>[C("span",q7e,N(p(n)("tools.label.bash")),1),C("span",K7e,N(s.value),1)]),_:1},8,["status","open","expandable"]))}}),X7e=ft(Y7e,[["__scopeId","data-v-8869dd42"]]),J7e={class:"hl-body"},Q7e={key:0,class:"hl-gutter"},eke={key:1,class:"hl-gutter new"},tke={class:"hl-sign"},nke={class:"hl-text"},oke=["data-line"],ske={key:0,class:"hl-gutter"},ike={class:"hl-text"},rke=200,lke=et({__name:"HighlightedCode",props:{code:{default:void 0},lines:{default:void 0},path:{default:void 0},lineNumbers:{type:[Boolean,Array],default:!1},framed:{type:Boolean,default:!0},fullTexts:{default:null},lineClass:{type:Function,default:void 0}},setup(e){const t=e,n=f2(),o=R(()=>eJ(t.path)),s=R(()=>t.lines!==void 0),i=R(()=>t.lineNumbers===!0&&s.value),r=R(()=>(t.lines??[]).some($=>$.oldNo!==void 0)),l=R(()=>(t.lines??[]).some($=>$.newNo!==void 0)),a=R(()=>Array.isArray(t.lineNumbers)?t.lineNumbers:null),u=R(()=>Array.isArray(t.code)?t.code:Sl(t.code??"")),c=R(()=>{const $=t.lines;return $?t.fullTexts?t.fullTexts:{before:$.filter(B=>B.oldNo!==void 0).map(B=>B.text).join(`
600
600
  `),after:$.filter(B=>B.newNo!==void 0).map(B=>B.text).join(`
601
- `)}:null}),d=Z(null),f=Z(null),h=Z(null);function m(){d.value=null,f.value=null,h.value=null}let v=null,k=0,w=0;async function b(){const $=++w;k=Date.now();const B=o.value;if(!B){$===w&&m();return}try{const{codeToTokens:H}=await jo(async()=>{const{codeToTokens:U}=await import("./index-BZFTzQ6y.js").then(z=>z.i);return{codeToTokens:U}},[]),O=n.value?"github-dark":"github-light",F=c.value;if(F){const[U,z]=await Promise.all([F.before?H(F.before,{lang:B,theme:O}):Promise.resolve(null),F.after?H(F.after,{lang:B,theme:O}):Promise.resolve(null)]);if($!==w)return;f.value=U?.tokens??null,h.value=z?.tokens??null}else{const U=u.value.length>0?await H(u.value.join(`
601
+ `)}:null}),d=Z(null),f=Z(null),h=Z(null);function m(){d.value=null,f.value=null,h.value=null}let v=null,k=0,w=0;async function b(){const $=++w;k=Date.now();const B=o.value;if(!B){$===w&&m();return}try{const{codeToTokens:H}=await jo(async()=>{const{codeToTokens:U}=await import("./index-DyqF2DF6.js").then(z=>z.i);return{codeToTokens:U}},[]),O=n.value?"github-dark":"github-light",F=c.value;if(F){const[U,z]=await Promise.all([F.before?H(F.before,{lang:B,theme:O}):Promise.resolve(null),F.after?H(F.after,{lang:B,theme:O}):Promise.resolve(null)]);if($!==w)return;f.value=U?.tokens??null,h.value=z?.tokens??null}else{const U=u.value.length>0?await H(u.value.join(`
602
602
  `),{lang:B,theme:O}):null;if($!==w)return;d.value=U?.tokens??null}}catch{$===w&&m()}}function _(){if(v!==null)return;const $=Math.max(0,rke-(Date.now()-k));v=setTimeout(()=>{v=null,b()},$)}const g=R(()=>u.value.join(`
603
603
  `)),x=R(()=>c.value?.before??null),S=R(()=>c.value?.after??null);Je([g,x,S],_),Je([o,n,()=>t.fullTexts],()=>{w++,m(),_()}),dn(b),bn(()=>{w++,v!==null&&clearTimeout(v),v=null});const T=R(()=>{let $=0;if(Array.isArray(t.lineNumbers))for(const B of t.lineNumbers)B>$&&($=B);else for(const B of t.lines??[])B.oldNo!==void 0&&B.oldNo>$&&($=B.oldNo),B.newNo!==void 0&&B.newNo>$&&($=B.newNo);return Math.max(4,String($).length)});function A($){if($.type==="del"){if($.oldNo===void 0)return null;const H=t.fullTexts?$.oldNo-1:E.value.get($.oldNo);return H===void 0?null:f.value?.[H]??null}if($.newNo===void 0)return null;const B=t.fullTexts?$.newNo-1:P.value.get($.newNo);return B===void 0?null:h.value?.[B]??null}const E=R(()=>{const $=new Map;let B=0;for(const H of t.lines??[])H.oldNo!==void 0&&$.set(H.oldNo,B++);return $}),P=R(()=>{const $=new Map;let B=0;for(const H of t.lines??[])H.newNo!==void 0&&$.set(H.newNo,B++);return $});function D($){const B={};$.color&&(B.color=$.color);const H=$.fontStyle??0;return H&1&&(B.fontStyle="italic"),H&2&&(B.fontWeight="var(--weight-semibold)"),H&4&&(B.textDecoration="underline"),B}function I($){return $.type==="add"?"+":$.type==="del"?"-":" "}return($,B)=>(y(),M("div",{class:Re(["hl-code",{gutter:i.value,"plain-pad":!s.value&&!a.value,framed:e.framed}]),style:Zt({"--gutter-ch":`${T.value}ch`})},[C("div",J7e,[s.value?(y(!0),M(Pe,{key:0},pt(e.lines??[],(H,O)=>(y(),M("div",{key:O,class:Re(["hl-row",`row-${H.type}`])},[i.value?(y(),M(Pe,{key:0},[r.value?(y(),M("span",Q7e,N(H.oldNo??""),1)):ee("",!0),l.value?(y(),M("span",eke,N(H.newNo??""),1)):ee("",!0)],64)):ee("",!0),C("span",tke,N(I(H)),1),C("span",nke,[A(H)?(y(!0),M(Pe,{key:0},pt(A(H)??[],(F,U)=>(y(),M("span",{key:U,style:Zt(D(F))},N(F.content),5))),128)):(y(),M(Pe,{key:1},[qe(N(H.text),1)],64))])],2))),128)):(y(!0),M(Pe,{key:1},pt(u.value,(H,O)=>(y(),M("div",{key:O,class:Re(["hl-row",e.lineClass?.(a.value?.[O]??-1)]),"data-line":a.value?.[O]},[a.value?(y(),M("span",ske,N(a.value[O]??""),1)):ee("",!0),C("span",ike,[d.value?.[O]?(y(!0),M(Pe,{key:0},pt(d.value[O]??[],(F,U)=>(y(),M("span",{key:U,style:Zt(D(F))},N(F.content),5))),128)):(y(),M(Pe,{key:1},[qe(N(H),1)],64))])],10,oke))),128))])],6))}}),Ur=ft(lke,[["__scopeId","data-v-6735e4da"]]),ake={class:"tl-name"},uke={key:1,class:"tl-dim"},cke={key:2,class:"tl-faint"},dke={key:0,class:"tl-add"},fke={key:1,class:"tl-del"},pke={class:"diffbar","aria-hidden":"true"},hke={key:1,class:"tl-chip"},mke=et({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openFile"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=R(()=>n.tool.status),r=R(()=>Gs(n.tool.name)==="write"),l=R(()=>WN(gu(n.tool.arg))??""),a=R(()=>l.value?v1(l.value):""),u=R(()=>l.value?UN(l.value):""),c=R(()=>qT(n.tool)),d=R(()=>FX(n.tool)),f=R(()=>{const x=c.value;return!x||n.tool.status==="error"?{added:0,removed:0}:HT(x)}),h=R(()=>f.value.added>0||f.value.removed>0),m=R(()=>!!n.tool.output&&n.tool.output.length>0),v=R(()=>c.value!==null&&n.tool.status!=="error"),k=R(()=>d.value!==null&&n.tool.status!=="error"),w=R(()=>v.value||k.value||m.value),b=Z(!1),_=Z(b.value);Je(b,x=>{x&&(_.value=!0)});function g(){l.value&&o("openFile",{path:l.value})}return(x,S)=>(y(),he(el,{status:i.value,open:b.value,expandable:w.value,onToggle:S[0]||(S[0]=T=>b.value=!b.value)},{leading:me(()=>[j(p(Te),{name:r.value?"file-plus":"pencil",size:"sm"},null,8,["name"])]),trailing:me(()=>[h.value?(y(),M(Pe,{key:0},[f.value.added>0?(y(),M("span",dke,"+"+N(f.value.added),1)):ee("",!0),f.value.removed>0?(y(),M("span",fke,"−"+N(f.value.removed),1)):ee("",!0),C("span",pke,[C("span",{class:"seg-add",style:Zt({flexGrow:f.value.added})},null,4),C("span",{class:"seg-del",style:Zt({flexGrow:f.value.removed})},null,4)])],64)):r.value&&i.value==="ok"?(y(),M("span",hke,N(p(s)("tools.chip.created")),1)):ee("",!0)]),body:me(()=>[v.value&&_.value?(y(),he(Ur,{key:0,lines:c.value??[],path:l.value},null,8,["lines","path"])):k.value&&_.value?(y(),he(Ur,{key:1,code:d.value?.content??"",path:d.value?.path},null,8,["code","path"])):(y(),he(dr,{key:2,lines:e.tool.output,"empty-text":p(s)("tools.output.waiting")},null,8,["lines","empty-text"]))]),default:me(()=>[C("span",ake,N(r.value?p(s)("tools.label.write"):p(s)("tools.label.edit")),1),a.value?(y(),M("button",{key:0,class:"tl-file",type:"button",onClick:It(g,["stop"])},N(a.value),1)):(y(),M("span",uke,N(l.value||e.tool.arg),1)),u.value?(y(),M("span",cke,N(u.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),gke=ft(mke,[["__scopeId","data-v-bbf61950"]]),vke=["innerHTML"],yke={class:"tl-name"},kke={key:0,class:"tl-dim"},bke={key:0,class:"tl-chip"},Cke={key:1,class:"tl-chip"},wke={key:0,class:"arg-full"},_ke=et({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia","openFile"],setup(e){const t=e,{t:n}=Nt(),o=R(()=>t.tool.status),s=R(()=>_1(t.tool.name)),i=R(()=>zN(t.tool.name)),r=R(()=>Xx(t.tool.name,t.tool.arg)),l=R(()=>Xx(t.tool.name,t.tool.arg,!0)),a=R(()=>e7e({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status})),u=R(()=>!!t.tool.output&&t.tool.output.length>0),c=R(()=>u.value||!!l.value&&l.value!==r.value),d=Z(t.tool.defaultExpanded===!0&&c.value);return Je(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&c.value&&(d.value=!0)}),(f,h)=>(y(),he(el,{status:o.value,open:d.value,expandable:c.value,onToggle:h[0]||(h[0]=m=>d.value=!d.value)},{leading:me(()=>[C("span",{class:"gl",innerHTML:i.value},null,8,vke)]),trailing:me(()=>[a.value?(y(),M("span",bke,N(a.value),1)):e.tool.timing?(y(),M("span",Cke,N(e.tool.timing),1)):ee("",!0)]),body:me(()=>[l.value&&l.value!==r.value?(y(),M("div",wke,N(l.value),1)):ee("",!0),j(dr,{lines:e.tool.output,"empty-text":o.value==="running"?p(n)("tools.output.waiting"):p(n)("tools.output.empty")},null,8,["lines","empty-text"])]),default:me(()=>[C("span",yke,N(s.value),1),r.value?(y(),M("span",kke,N(r.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),xke=ft(_ke,[["__scopeId","data-v-b12a8498"]]),Ske={class:"tl-name"},Ake={key:0,class:"tl-mono"},Mke={key:1,class:"tl-mono"},Tke={key:2,class:"tl-dim"},Eke={key:3,class:"tl-faint"},Ike={key:0,class:"tl-chip"},Lke={key:0,class:"file-list"},$ke=["onClick"],Nke=et({__name:"GlobTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openFile"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=R(()=>n.tool.status),r=R(()=>Gs(n.tool.name)==="glob"),l=R(()=>gu(n.tool.arg)),a=R(()=>{const v=l.value;return jn(v?.pattern)??jn(v?.glob)??jn(v?.query)??""}),u=R(()=>{const v=l.value;return jn(v?.path)??jn(v?.dir)??jn(v?.directory)??jn(v?.cwd)??""}),c=R(()=>(n.tool.output??[]).filter(v=>v.trim().length>0)),d=R(()=>c.value.length>0),f=R(()=>d.value),h=Z(n.tool.defaultExpanded===!0&&f.value);Je(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status],()=>{n.tool.defaultExpanded===!0&&f.value&&(h.value=!0)});function m(v){const k=v.trim();k&&o("openFile",{path:k})}return(v,k)=>(y(),he(el,{status:i.value,open:h.value,expandable:f.value,onToggle:k[0]||(k[0]=w=>h.value=!h.value)},{leading:me(()=>[j(p(Te),{name:r.value?"tree-view":"list",size:"sm"},null,8,["name"])]),trailing:me(()=>[r.value&&c.value.length>0?(y(),M("span",Ike,N(p(s)("tools.chip.files",{count:c.value.length})),1)):ee("",!0)]),body:me(()=>[r.value?(y(),M("div",Lke,[(y(!0),M(Pe,null,pt(c.value,(w,b)=>(y(),M("button",{key:b,class:"file-row",type:"button",onClick:_=>m(w)},N(w),9,$ke))),128))])):(y(),he(dr,{key:1,lines:e.tool.output},null,8,["lines"]))]),default:me(()=>[C("span",Ske,N(p(s)(r.value?"tools.label.glob":"tools.label.ls")),1),r.value&&a.value?(y(),M("span",Ake,N(a.value),1)):!r.value&&u.value?(y(),M("span",Mke,N(u.value),1)):(y(),M("span",Tke,N(e.tool.arg),1)),r.value&&u.value?(y(),M("span",Eke,N(u.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),Fke=ft(Nke,[["__scopeId","data-v-3936099e"]]),Rke={class:"tl-name"},Oke={key:0,class:"tl-dim"},Pke={key:1,class:"tl-pill pill-active"},Dke={key:0,class:"goal-block"},Bke={class:"goal-text"},Hke={key:0,class:"goal-criterion"},zke=et({__name:"GoalTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=Nt(),o=R(()=>t.tool.status),s=R(()=>Gs(t.tool.name)),i=R(()=>gu(t.tool.arg)),r=R(()=>jn(i.value?.objective)??""),l=R(()=>jn(i.value?.completionCriterion)??jn(i.value?.completion_criterion)??""),a={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"},u=R(()=>jn(i.value?.status)??""),c=R(()=>{const b=a[u.value];return b?n(b):u.value}),d=R(()=>{switch(u.value){case"complete":return"pill-done";case"blocked":return"pill-blocked";default:return"pill-active"}}),f=R(()=>{const b=Ia(i.value?.value),_=jn(i.value?.unit);return b===void 0||!_?"":["turns","tokens","milliseconds","seconds","minutes","hours"].includes(_)?n(`tools.goal.${_}`,{value:b}):n("tools.goal.budget",{value:b,unit:_})}),h=R(()=>{switch(s.value){case"creategoal":return r.value;case"updategoal":return c.value;case"setgoalbudget":return f.value;default:return""}}),m=R(()=>!!t.tool.output&&t.tool.output.length>0),v=R(()=>!!l.value||s.value==="creategoal"&&m.value),k=R(()=>v.value||m.value),w=Z(t.tool.defaultExpanded===!0&&k.value);return Je(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&k.value&&(w.value=!0)}),(b,_)=>(y(),he(el,{status:o.value,open:w.value,expandable:k.value,onToggle:_[0]||(_[0]=g=>w.value=!w.value)},{leading:me(()=>[j(p(Te),{name:"target",size:"sm"})]),trailing:me(()=>[s.value==="updategoal"&&c.value?(y(),M("span",{key:0,class:Re(["tl-pill",d.value])},N(c.value),3)):s.value==="creategoal"?(y(),M("span",Pke,N(p(n)("status.goalStatusActive")),1)):ee("",!0)]),body:me(()=>[r.value?(y(),M("div",Dke,[C("div",Bke,N(r.value),1),l.value?(y(),M("div",Hke,N(l.value),1)):ee("",!0)])):ee("",!0),m.value?(y(),he(dr,{key:1,lines:e.tool.output},null,8,["lines"])):ee("",!0)]),default:me(()=>[C("span",Rke,N(p(_1)(e.tool.name)),1),h.value?(y(),M("span",Oke,N(h.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),Wke=ft(zke,[["__scopeId","data-v-862274de"]]),Uke={class:"tl-name"},jke={key:0,class:"tl-mono"},Vke={key:1,class:"tl-dim"},qke={key:2,class:"tl-faint"},Kke={key:0,class:"tl-chip"},Zke={key:0,class:"match-list"},Gke=["onClick"],Yke={key:0,class:"mref"},Xke={class:"mtext"},Jke=et({__name:"GrepTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openFile"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=R(()=>n.tool.status),r=R(()=>Gs(n.tool.name)==="grep"),l=R(()=>gu(n.tool.arg)),a=R(()=>{const k=l.value;return jn(k?.pattern)??jn(k?.query)??jn(k?.regex)??""}),u=R(()=>{const k=l.value;return jn(k?.path)??jn(k?.glob)??jn(k?.include)??""}),c=R(()=>(n.tool.output??[]).filter(k=>k.trim().length>0).map(k=>{const w=/^(.+?):(\d+)[:-](.*)$/.exec(k);return w?{path:w[1],line:Number(w[2]),text:(w[3]??"").trim()}:{text:k}})),d=R(()=>c.value.length),f=R(()=>d.value>0),h=R(()=>f.value),m=Z(n.tool.defaultExpanded===!0&&h.value);Je(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status],()=>{n.tool.defaultExpanded===!0&&h.value&&(m.value=!0)});function v(k){k.path&&o("openFile",{path:k.path,line:k.line})}return(k,w)=>(y(),he(el,{status:i.value,open:m.value,expandable:h.value,onToggle:w[0]||(w[0]=b=>m.value=!m.value)},{leading:me(()=>[j(p(Te),{name:"search",size:"sm"})]),trailing:me(()=>[d.value>0?(y(),M("span",Kke,N(p(s)("tools.chip.results",{count:d.value})),1)):ee("",!0)]),body:me(()=>[r.value?(y(),M("div",Zke,[(y(!0),M(Pe,null,pt(c.value,(b,_)=>(y(),M("button",{key:_,class:Re(["match-row",{link:b.path}]),type:"button",onClick:g=>v(b)},[b.path?(y(),M("span",Yke,N(b.path)+":"+N(b.line),1)):ee("",!0),C("span",Xke,N(b.text),1)],10,Gke))),128))])):(y(),he(dr,{key:1,lines:e.tool.output},null,8,["lines"]))]),default:me(()=>[C("span",Uke,N(p(s)(r.value?"tools.label.grep":"tools.label.search")),1),a.value?(y(),M("span",jke,N(a.value),1)):(y(),M("span",Vke,N(e.tool.arg),1)),u.value?(y(),M("span",qke,N(u.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),Qke=ft(Jke,[["__scopeId","data-v-899c1a48"]]),ebe=["src","controls","muted"],tbe=["src","alt"],nbe=et({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=Z(t.fileId?"":t.url),o=Z(null),s=Z(!t.fileId);let i=null,r=0,l=!1,a=null;function u(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function c(){const d=++r;if(u(),!t.fileId){n.value=t.url;return}if(s.value)try{const f=await _t().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Je(()=>[t.fileId,t.url,s.value],c,{immediate:!0}),dn(()=>{typeof IntersectionObserver=="function"&&o.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(s.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(o.value)):s.value=!0}),Vn(()=>{l=!0,a?.disconnect(),a=null,u()}),(d,f)=>e.kind==="video"?(y(),M("video",{key:0,ref_key:"mediaEl",ref:o,class:Re(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,ebe)):(y(),M("img",{key:1,ref_key:"mediaEl",ref:o,class:Re([e.mediaClass,{"is-resolving":!n.value}]),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,tbe))}}),i0=ft(nbe,[["__scopeId","data-v-0826404b"]]),obe={class:"media-title"},sbe=["src","alt"],ibe=["aria-label"],rbe={key:0,class:"media-video-tile","aria-hidden":"true"},lbe={class:"media-play-badge","aria-hidden":"true"},abe=["src"],ube=et({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(d){return d.split(/[\\/]+/).pop()||d}function r(d){return d<1024?`${d} B`:d<1024*1024?`${(d/1024).toFixed(1)} KB`:`${(d/1024/1024).toFixed(1)} MB`}const l=R(()=>{const d=s.value;if(!d)return"";const f=[d.path?i(d.path):n.tool.name];return d.mimeType&&f.push(d.mimeType),d.bytes!==void 0&&f.push(r(d.bytes)),d.dimensions&&f.push(d.dimensions),f.join(" · ")}),a=R(()=>s.value?.url.startsWith("blob:")??!1),u=R(()=>{const d=s.value;return d?.kind==="video"&&d.fileId!==void 0&&!a.value});function c(d){const f=s.value;if(f?.kind!=="image"&&f?.kind!=="video")return;const h=f.kind==="image"?d.currentTarget.querySelector("img"):null;o("openMedia",{media:f,originImg:h})}return(d,f)=>s.value?(y(),M("div",{key:0,class:Re(["media-tool",{mob:e.mobile}])},[j(p(pn),{text:s.value.path||l.value},{default:me(()=>[C("div",obe,N(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(y(),he(p(pn),{key:0,text:s.value.path||l.value},{default:me(()=>[C("button",{type:"button",class:"media-image-button",onClick:c},[C("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,sbe)])]),_:1},8,["text"])):s.value.kind==="video"?(y(),he(p(pn),{key:1,text:s.value.path||l.value},{default:me(()=>[C("button",{type:"button",class:"media-image-button media-video-button","aria-label":s.value.path?i(s.value.path):l.value,onClick:c},[u.value?(y(),M("span",rbe)):(y(),he(i0,{key:1,url:s.value.url,kind:"video","file-id":a.value?void 0:s.value.fileId,"media-class":"media-video",controls:!1,muted:""},null,8,["url","file-id"])),C("span",lbe,[j(p(Te),{name:"play",size:"sm"})])],8,ibe)]),_:1},8,["text"])):(y(),M("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,abe))],2)):ee("",!0)}}),cbe=ft(ube,[["__scopeId","data-v-3bc3ee1a"]]),dbe=["innerHTML"],fbe={class:"tl-name"},pbe={key:0,class:"tl-faint"},hbe={key:0,class:"tl-chip"},mbe=["title"],gbe={key:1,class:"plan-content"},vbe={key:2,class:"plan-review"},ybe={key:0},kbe={class:"review-label"},bbe={key:1},Cbe={class:"review-label"},wbe={class:"review-feedback"},_be=et({__name:"PlanTool",props:{tool:{},mobile:{type:Boolean}},emits:["openFile"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=Z(n.tool.defaultExpanded===!0),r=R(()=>n.tool.plan),l=R(()=>r.value?.path??n.tool.planPath),a=R(()=>r.value!==void 0||l.value!==void 0||(n.tool.output?.length??0)>0),u=R(()=>{const d=r.value?.review?.state;return d?s(`tools.plan.review.${d}`):void 0});function c(){l.value&&o("openFile",{path:l.value,content:r.value?.plan})}return(d,f)=>(y(),he(el,{status:e.tool.status,open:i.value,expandable:a.value,onToggle:f[0]||(f[0]=h=>i.value=!i.value)},{leading:me(()=>[C("span",{class:"plan-glyph",innerHTML:p(zN)(e.tool.name)},null,8,dbe)]),trailing:me(()=>[e.tool.timing?(y(),M("span",hbe,N(e.tool.timing),1)):ee("",!0)]),body:me(()=>[l.value?(y(),M("button",{key:0,type:"button",class:"plan-path",title:l.value,onClick:c},N(l.value),9,mbe)):ee("",!0),r.value?(y(),M("div",gbe,[j(p(Ic),{text:r.value.plan,"open-file":h=>o("openFile",h)},null,8,["text","open-file"])])):ee("",!0),r.value?.review?.selectedOption||r.value?.review?.feedback?(y(),M("div",vbe,[r.value.review.selectedOption?(y(),M("div",ybe,[C("span",kbe,N(p(s)("tools.plan.selectedOption")),1),C("span",null,N(r.value.review.selectedOption),1)])):ee("",!0),r.value.review.feedback?(y(),M("div",bbe,[C("span",Cbe,N(p(s)("tools.plan.feedback")),1),C("span",wbe,N(r.value.review.feedback),1)])):ee("",!0)])):ee("",!0),r.value?ee("",!0):(y(),he(dr,{key:3,lines:e.tool.output,"empty-text":p(s)("tools.output.empty")},null,8,["lines","empty-text"]))]),default:me(()=>[C("span",fbe,N(p(_1)(e.tool.name)),1),u.value?(y(),M("span",pbe,N(u.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),xbe=ft(_be,[["__scopeId","data-v-8dff80a1"]]),Sbe={class:"tl-name"},Abe={key:1,class:"tl-faint"},Mbe={key:2,class:"tl-faint"},Tbe={key:3,class:"tl-dim"},Ebe={key:0,class:"tl-chip"},Ibe=et({__name:"ReadTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openFile"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=R(()=>n.tool.status),r=R(()=>gu(n.tool.arg)),l=R(()=>WN(r.value)??""),a=R(()=>l.value?v1(l.value):""),u=R(()=>l.value?UN(l.value):""),c=R(()=>{const S=r.value;if(S)return Ia(S.offset)??Ia(S.line_start)??Ia(S.start_line)}),d=R(()=>{const S=r.value;if(!S)return;const T=Ia(S.limit)??Ia(S.length);return Ia(S.line_end)??Ia(S.end_line)??(c.value!==void 0&&T!==void 0?c.value+T:void 0)}),f=R(()=>c.value!==void 0&&d.value!==void 0?`:${c.value}-${d.value}`:c.value!==void 0?`:${c.value}`:""),h=R(()=>n.tool.status==="ok"?UJ(n.tool.output??[]):null),m=R(()=>h.value?.contents??[]),v=R(()=>h.value?.lineNumbers),k=R(()=>h.value?.contents.length??n.tool.output?.length??0),w=R(()=>!!n.tool.output&&n.tool.output.length>0),b=R(()=>h.value!==null||w.value),_=Z(n.tool.defaultExpanded===!0&&b.value),g=Z(_.value);Je(_,S=>{S&&(g.value=!0)}),Je(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status],()=>{n.tool.defaultExpanded===!0&&b.value&&(_.value=!0)});function x(){l.value&&o("openFile",{path:l.value,line:c.value})}return(S,T)=>(y(),he(el,{status:i.value,open:_.value,expandable:b.value,onToggle:T[0]||(T[0]=A=>_.value=!_.value)},{leading:me(()=>[j(p(Te),{name:"file-text",size:"sm"})]),trailing:me(()=>[k.value>0?(y(),M("span",Ebe,N(p(s)("tools.chip.lines",{count:k.value})),1)):ee("",!0)]),body:me(()=>[l.value?(y(),M("button",{key:0,class:"path-link",type:"button",onClick:x},N(l.value),1)):ee("",!0),h.value&&g.value?(y(),he(Ur,{key:1,code:m.value,path:l.value,"line-numbers":v.value},null,8,["code","path","line-numbers"])):(y(),he(dr,{key:2,lines:e.tool.output,"empty-text":p(s)("tools.output.waiting")},null,8,["lines","empty-text"]))]),default:me(()=>[C("span",Sbe,N(p(s)("tools.label.read")),1),a.value?(y(),M("button",{key:0,class:"tl-file",type:"button",onClick:It(x,["stop"])},N(a.value),1)):ee("",!0),u.value?(y(),M("span",Abe,N(u.value),1)):ee("",!0),f.value?(y(),M("span",Mbe,N(f.value),1)):ee("",!0),a.value?ee("",!0):(y(),M("span",Tbe,N(l.value||e.tool.arg),1))]),_:1},8,["status","open","expandable"]))}}),Lbe=ft(Ibe,[["__scopeId","data-v-0edbdd82"]]),$be=["aria-expanded"],Nbe={class:"title"},Fbe={key:0,class:"meta"},Rbe={key:1,class:"sum-txt"},Obe={class:"rt"},Pbe={class:"status"},Dbe={key:0,class:"chip"},Bbe={key:1,class:"tm"},Hbe={class:"body"},zbe={class:"overview"},Wbe={class:"overview-line"},Ube={class:"big"},jbe={key:0,class:"lbl"},Vbe={key:1,class:"lbl"},qbe={key:2,class:"lbl"},Kbe={key:3,class:"lbl"},Zbe={key:0,class:"seg","aria-hidden":"true"},Gbe={key:1,class:"legend"},Ybe=["disabled","aria-label","aria-expanded","onClick"],Xbe={class:"mname"},Jbe={class:"mact"},Qbe={class:"mphase"},eCe=["aria-expanded","onClick"],tCe={key:1,class:"fallback-output"},nCe={key:2,class:"waiting"},oCe=et({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia","openFile","openAgent"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t;function i(F){if(!F)return{};try{const U=JSON.parse(F),z=Array.isArray(U.items)?U.items:void 0;return{description:typeof U.description=="string"?U.description:void 0,itemCount:z?.length}}catch{return{}}}const r=nn("resolveSwarmMembers"),l=R(()=>i(o.tool.arg)),a=R(()=>_1(o.tool.name)),u=R(()=>l.value.description??""),c=R(()=>r?.(o.tool.id)??[]),d=R(()=>EJ(o.tool.output)),f=nn("modelDisplay"),h=nn("subagentEffort"),m=R(()=>{let F;for(const U of c.value){const z=f?.(U.model),W=h?.(U.thinkingEffort),K=[z,W].filter(ie=>ie!==void 0);if(K.length===0)continue;const V=K.join(" · ");if(F===void 0)F=V;else if(F!==V)return}return F}),v=R(()=>o.tool.status),k=R(()=>v.value==="running"?"running":v.value==="error"||(d.value?.failed??0)>0||(d.value?.aborted??0)>0?"error":"ok"),w=R(()=>MX(c.value,d.value)),b=R(()=>{const F={completed:0,working:0,suspended:0,queued:0,failed:0};for(const U of w.value)F[U.phase]++;return F}),_=R(()=>w.value.length||l.value.itemCount||0),g=R(()=>b.value.completed+b.value.failed),x=R(()=>b.value.working+b.value.suspended+b.value.queued),S=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],T=R(()=>S.map(({phase:F,cls:U})=>({phase:F,count:b.value[F],cls:U})).filter(F=>F.count>0)),A=Z(v.value==="running"||x.value>0);function E(){A.value=!A.value}const P=R(()=>w.value.length>0||d.value||v.value==="running"?"":(o.tool.output??[]).join(`
604
604
  `).trim()),D=Z(new Set);function I(F){return D.value.has(F)}function $(F){const U=new Set(D.value);U.has(F)?U.delete(F):U.add(F),D.value=U}function B(F){if(F.agentId){s("openAgent",F.agentId);return}F.body&&$(F.id)}function H(F){return F.agentId!==void 0&&F.body.length>0&&(F.phase==="completed"||F.phase==="failed")}function O(F){return n(`tools.swarm.phase${F[0].toUpperCase()}${F.slice(1)}`)}return(F,U)=>(y(),M("div",{class:Re(["swarm-card",{open:A.value,err:k.value==="error"}])},[C("button",{class:"head",type:"button","aria-expanded":A.value,onClick:E},[j(p(Te),{class:"ic",name:"sparkles",size:"sm"}),C("span",Nbe,N(a.value),1),u.value?(y(),M("span",Fbe,"·")):ee("",!0),u.value?(y(),M("span",Rbe,N(u.value),1)):ee("",!0),C("span",Obe,[C("span",Pbe,[k.value==="ok"?(y(),he(p(Te),{key:0,name:"check",size:"sm"})):k.value==="error"?(y(),he(p(Te),{key:1,name:"close",size:"sm"})):(y(),he(p(hc),{key:2,status:"running"}))]),g.value>0||_.value>0?(y(),M("span",Dbe,N(g.value)+" / "+N(_.value),1)):ee("",!0),e.tool.timing?(y(),M("span",Bbe,N(e.tool.timing),1)):ee("",!0)]),j(p(Te),{class:"car",name:"chevron-right",size:"sm"})],8,$be),Bn(C("div",Hbe,[C("div",zbe,[C("div",Wbe,[C("span",Ube,N(p(n)("tools.swarm.progress",{done:g.value,total:_.value})),1),m.value?(y(),M("span",jbe,N(m.value),1)):ee("",!0),k.value==="running"&&_.value>0?(y(),M("span",Vbe,N(p(n)("tools.swarm.runningSub",{count:x.value})),1)):d.value?(y(),M("span",qbe,N(p(n)("tools.swarm.doneSub",{completed:d.value.completed,failed:d.value.failed+d.value.aborted})),1)):(y(),M("span",Kbe,N(p(n)("tools.swarm.waiting")),1))]),_.value>0&&T.value.length>0?(y(),M("div",Zbe,[(y(!0),M(Pe,null,pt(T.value,z=>(y(),M("span",{key:z.phase,class:Re(z.cls),style:Zt({flex:z.count})},null,6))),128))])):ee("",!0),T.value.length>1?(y(),M("div",Gbe,[(y(!0),M(Pe,null,pt(T.value,z=>(y(),M("span",{key:z.phase},[C("i",{class:Re(["lg-dot",z.cls])},null,2),qe(N(O(z.phase))+" "+N(z.count),1)]))),128))])):ee("",!0)]),w.value.length>0?(y(!0),M(Pe,{key:0},pt(w.value,z=>(y(),M("div",{key:z.id,class:Re(["member",[`phase-${z.phase}`,{open:!z.agentId&&I(z.id)}]])},[C("button",{class:"member-head",type:"button",disabled:!z.agentId&&!z.body,"aria-label":z.agentId?p(n)("tasks.openDetail"):void 0,"aria-expanded":!z.agentId&&z.body?I(z.id):void 0,onClick:W=>B(z)},[j(p(hc),{class:"row-dot",status:z.phase},null,8,["status"]),j(p(pn),{text:z.name},{default:me(()=>[C("span",Xbe,N(z.name),1)]),_:2},1032,["text"]),z.activity?(y(),he(p(pn),{key:0,text:z.activity},{default:me(()=>[C("span",Jbe,N(z.activity),1)]),_:2},1032,["text"])):ee("",!0),C("span",Qbe,N(O(z.phase)),1),z.agentId?(y(),he(p(Te),{key:1,class:"mcar",name:"arrow-right",size:"sm"})):z.body?(y(),he(p(Te),{key:2,class:"mcar",name:"chevron-right",size:"sm"})):ee("",!0)],8,Ybe),H(z)?(y(),M("button",{key:0,class:"member-saved",type:"button","aria-expanded":I(z.id),onClick:W=>$(z.id)},[j(p(Te),{class:Re(["member-saved-car",{open:I(z.id)}]),name:"chevron-right",size:"sm","aria-hidden":"true"},null,8,["class"]),C("span",null,N(p(n)("tools.output.saved")),1)],8,eCe)):ee("",!0),z.body&&(!z.agentId||H(z))?Bn((y(),M("div",{key:1,class:"member-body"},N(z.body),513)),[[qs,I(z.id)]]):ee("",!0)],2))),128)):P.value?(y(),M("div",tCe,N(P.value),1)):(y(),M("div",nCe,N(p(n)("tools.swarm.waiting")),1))],512),[[qs,A.value]])],2))}}),sCe=ft(oCe,[["__scopeId","data-v-f360563e"]]),iCe=et({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e;return(n,o)=>(y(),M("span",{class:Re(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},[t.status==="run"?(y(),he(p(hc),{key:0,status:"running"})):t.status==="pending"?(y(),he(p(hc),{key:1,status:"idle"})):t.status==="done"?(y(),he(p(Te),{key:2,name:"check",size:"sm"})):(y(),he(p(Te),{key:3,name:"close",size:"sm"}))],2))}}),Y5=ft(iCe,[["__scopeId","data-v-f1aedfd0"]]),rCe={class:"tl-name"},lCe={key:0,class:"tl-dim"},aCe={key:0,class:"tl-chip"},uCe={key:1,class:"todo-bar","aria-hidden":"true"},cCe={key:0,class:"todo-list"},dCe={class:"todo-title"},fCe=et({__name:"TodoTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=Nt();function o(m){const v=gu(m),k=v&&Array.isArray(v.todos)?v.todos:v&&Array.isArray(v.items)?v.items:void 0;if(!k)return[];const w=[];for(const b of k){if(!b||typeof b!="object")continue;const _=b,g=jn(_.title)??jn(_.content)??jn(_.activeForm)??jn(_.text);if(!g)continue;const x=jn(_.status)??"pending";w.push({title:g,status:x==="in_progress"?"in_progress":x==="done"||x==="completed"?"done":"pending"})}return w}const s=R(()=>t.tool.status),i=R(()=>o(t.tool.arg)),r=R(()=>i.value.filter(m=>m.status==="done").length),l=R(()=>i.value.length),a=R(()=>i.value.find(m=>m.status==="in_progress")),u=R(()=>l.value>0?r.value/l.value:0),c=R(()=>!!t.tool.output&&t.tool.output.length>0),d=R(()=>l.value>0||c.value),f=Z(t.tool.defaultExpanded===!0&&d.value);Je(()=>[t.tool.defaultExpanded,t.tool.status],()=>{t.tool.defaultExpanded===!0&&d.value&&(f.value=!0)});function h(m){return m.status==="in_progress"?"run":m.status}return(m,v)=>(y(),he(el,{status:s.value,open:f.value,expandable:d.value,onToggle:v[0]||(v[0]=k=>f.value=!f.value)},{leading:me(()=>[j(p(Te),{name:"check-list",size:"sm"})]),trailing:me(()=>[l.value>0?(y(),M("span",aCe,N(r.value)+"/"+N(l.value),1)):ee("",!0),l.value>0?(y(),M("span",uCe,[C("span",{class:"todo-fill",style:Zt({width:`${u.value*100}%`})},null,4)])):ee("",!0)]),body:me(()=>[l.value>0?(y(),M("div",cCe,[(y(!0),M(Pe,null,pt(i.value,(k,w)=>(y(),M("div",{key:w,class:Re(["todo-row",`s-${k.status}`])},[j(Y5,{status:h(k)},null,8,["status"]),C("span",dCe,N(k.title),1)],2))),128))])):c.value?(y(),he(dr,{key:1,lines:e.tool.output},null,8,["lines"])):ee("",!0)]),default:me(()=>[C("span",rCe,N(p(n)("tools.label.todo")),1),a.value?(y(),M("span",lCe,N(a.value.title),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),pCe=ft(fCe,[["__scopeId","data-v-1b7f51f3"]]),hCe={class:"tl-name"},mCe={key:0},gCe={key:1,class:"tl-dim"},vCe={key:0,class:"fetch-url"},yCe=et({__name:"WebFetchTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=Nt(),o=R(()=>t.tool.status),s=R(()=>{const u=gu(t.tool.arg);return jn(u?.url)??jn(u?.uri)??""}),i=R(()=>s.value?V7e(s.value):""),r=R(()=>!!t.tool.output&&t.tool.output.length>0),l=R(()=>r.value),a=Z(t.tool.defaultExpanded===!0&&l.value);return Je(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&l.value&&(a.value=!0)}),(u,c)=>(y(),he(el,{status:o.value,open:a.value,expandable:l.value,onToggle:c[0]||(c[0]=d=>a.value=!a.value)},{leading:me(()=>[j(p(Te),{name:"globe",size:"sm"})]),body:me(()=>[s.value?(y(),M("div",vCe,N(s.value),1)):ee("",!0),j(dr,{lines:e.tool.output,"empty-text":p(n)("tools.output.waiting")},null,8,["lines","empty-text"])]),default:me(()=>[C("span",hCe,N(p(n)("tools.label.web_fetch")),1),i.value?(y(),M("span",mCe,N(i.value),1)):(y(),M("span",gCe,N(e.tool.arg),1))]),_:1},8,["status","open","expandable"]))}}),kCe=ft(yCe,[["__scopeId","data-v-8c248fcc"]]);function bCe(e){if(e.media&&e.status==="ok")return cbe;switch(Gs(e.name)){case"bash":return X7e;case"read":return Lbe;case"edit":case"write":case"multi_edit":return gke;case"grep":case"search":return Qke;case"glob":case"ls":return Fke;case"web_fetch":return kCe;case"todo":return pCe;case"task":return h7e;case"agentswarm":return sCe;case"askuserquestion":return j7e;case"exitplanmode":return xbe;case"creategoal":case"getgoal":case"setgoalbudget":case"updategoal":return Wke;default:return xke}}const X5=et({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia","openFile","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>bCe(n.tool));return(i,r)=>(y(),he(bs(s.value),{tool:e.tool,mobile:e.mobile,onOpenMedia:r[0]||(r[0]=l=>o("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>o("openFile",l)),onOpenAgent:r[2]||(r[2]=l=>o("openAgent",l))},null,40,["tool","mobile"]))}});function ta(e){if(e.blocks)return e.blocks;const t=[];e.thinking&&t.push({kind:"thinking",thinking:e.thinking}),e.text&&t.push({kind:"text",text:e.text});for(const n of e.tools??[])t.push({kind:"tool",tool:n});return t}function jN(e){return!(e.tool.status==="ok"&&e.tool.media)}function CCe(e){const t=ta(e),n=[];let o=[],s=null;const i=()=>{const[l]=o;o.length===1&&l?n.push(l):o.length>1&&n.push({kind:"activity-run",items:o}),o=[]},r=()=>{s&&n.push({kind:"notification",items:s.items,sourceIndex:s.sourceIndex}),s=null};return t.forEach((l,a)=>{if(l.kind==="notification"){i(),s?s.items.push(l.notification):s={items:[l.notification],sourceIndex:a};return}if(r(),l.kind==="thinking"){o.push({kind:"thinking",thinking:l.thinking,startedAt:l.startedAt,durationMs:l.durationMs,sourceIndex:a});return}if(l.kind==="tool"&&jN(l)){o.push({kind:"tool",tool:l.tool,sourceIndex:a});return}i(),l.kind==="text"?n.push({kind:"text",text:l.text,sourceIndex:a}):l.kind==="tool"&&n.push({kind:"tool",tool:l.tool,sourceIndex:a})}),i(),r(),n}const Jx=new WeakMap;function VN(e){const t=Jx.get(e);if(t!==void 0)return t;const n=wCe(e);return Jx.set(e,n),n}function wCe(e){const t=CCe(e);let n=-1;for(let r=t.length-1;r>=0;r--){const l=t[r];if(l?.kind==="text"&&l.text.trim().length>0){n=r;break}}if(n===-1){for(let r=0;r<t.length;r++){const l=t[r];if(l?.kind==="tool"&&!jN(l)){n=r;break}if(l?.kind==="notification"){n=r;break}}if(n===-1)return{folded:t,visible:[]}}const o=t.slice(0,n),s=t.slice(n),i=o.filter(r=>r.kind==="notification");return i.length>0?{folded:o.filter(r=>r.kind!=="notification"),visible:[...i,...s]}:{folded:o,visible:s}}function _Ce(e){let t;for(const n of e){if(n.kind!=="thinking"||n.startedAt===void 0)continue;const o=Date.parse(n.startedAt);Number.isNaN(o)||(t===void 0||o<t)&&(t=o)}return t}function Qx(e){if(e===void 0)return;const t=Date.parse(e);return Number.isNaN(t)?void 0:t}function xCe(e){if(e.state.phase==="settled")return e.durationMs!==void 0?Math.max(0,e.durationMs):e.startMs===void 0||e.endedMs===void 0?void 0:Math.max(0,e.endedMs-e.startMs);if(e.startMs!==void 0)return Math.max(0,e.state.nowMs-e.startMs)}function SCe(e){return VN(e).visible.flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
@@ -634,5 +634,5 @@ ${gt}`)}const tt=We.join(`
634
634
  `,-1)),(y(!0),M(Pe,null,pt(g.output,(x,S)=>(y(),M("span",{key:S,class:"tp-line"},N(x),1))),128)),_[1]||(_[1]=qe(`
635
635
  `,-1))])])])):ee("",!0)])):ee("",!0)],2))),128))])]))}}),bS=ft(kLe,[["__scopeId","data-v-e5e66edb"]]),bLe={class:"todo-card"},CLe={key:0,class:"tc-empty"},wLe={class:"tc-name"},_Le=et({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Nt();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(y(),M("div",bLe,[t.todos.length===0?(y(),M("div",CLe,[i[0]||(i[0]=C("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[C("path",{d:"M9 11l2 2 4-4"}),C("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),C("span",null,N(p(n)("tasks.emptyTodo")),1)])):ee("",!0),(y(!0),M(Pe,null,pt(t.todos,(r,l)=>(y(),M("div",{key:l,class:Re(["tc-row",`s-${r.status}`])},[j(Y5,{status:o(r.status)},null,8,["status"]),C("span",wLe,N(r.title),1)],2))),128))]))}}),xLe=ft(_Le,[["__scopeId","data-v-01c65735"]]),SLe={class:"dock-work-head"},ALe={key:0,class:"dock-work-tab static"},MLe={key:1,class:"dock-work-tab static"},TLe={key:2,class:"dock-work-tab static"},ELe={key:3,class:"dock-work-tab static"},ILe={key:4,class:"dock-work-head-actions"},LLe={key:0,class:"dock-work-foot"},$Le={key:0},NLe={key:1},FLe={key:0,class:"dock-workbar"},RLe={class:"dw-count"},OLe={class:"dw-count"},PLe={class:"dw-count"},DLe=et({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},working:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},authReady:{type:Boolean},managedSignedIn:{type:Boolean},managedMembership:{},starredIds:{},skills:{},goal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},openFile:{type:Function},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","login","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=Nt(),{confirm:r}=hu(),l=R(()=>{switch(o.goal?.status){case"active":return i("status.goalStatusActive");case"paused":return i("status.goalStatusPaused");case"blocked":return i("status.goalStatusBlocked");case"complete":return i("status.goalStatusComplete");default:return""}}),a=R(()=>{const I=o.goal?.budget.tokenBudget;return!o.goal||!I||I<=0?0:Math.max(0,Math.min(100,Math.round(o.goal.tokensUsed/I*100)))}),u=R(()=>o.goal?vc(o.goal.wallClockMs):"");async function c(){await r({title:i("status.goalCancel"),message:i("status.goalCancelConfirm"),confirmLabel:i("status.goalCancelConfirmYes"),cancelLabel:i("status.goalCancelConfirmNo"),variant:"danger"})&&s("controlGoal","cancel")}const d=Z(null),f=R(()=>d.value?.anyPopupOpen===!0),h=Z(null),m=Z(null);function v(I){return d.value?(d.value.loadForEdit(I),!0):!1}function k(I){d.value?.loadAttachmentsForEdit(I)}function w(){d.value?.focus()}const b=()=>d.value?.isEmpty?.()??!1;function _(I){if(!o.dockPanel)return;const $=I.target;$&&(h.value?.contains($)||$ instanceof Element&&$.closest(".ui-pill")||s("close-dock-panel"))}const g=Z(null),x=Z(!1),S=Z(!1);function T(){const I=g.value;if(!I){x.value=!1,S.value=!1;return}x.value=I.scrollTop>0,S.value=I.scrollTop+I.clientHeight<I.scrollHeight-1}function A(I){const $=I.target;x.value=$.scrollTop>0,S.value=$.scrollTop+$.clientHeight<$.scrollHeight-1}let E=null;Je(()=>o.dockPanel,async I=>{typeof document<"u"&&(document.removeEventListener("mousedown",_,!0),I&&document.addEventListener("mousedown",_,!0)),E?.disconnect(),E=null,I?(await yt(),T(),typeof ResizeObserver=="function"&&g.value&&(E=new ResizeObserver(T),E.observe(g.value))):(x.value=!1,S.value=!1)},{immediate:!0});let P=null;function D(){const I=m.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${I}px`)}return dn(()=>{typeof ResizeObserver!="function"||!m.value||(P=new ResizeObserver(D),P.observe(m.value),D())}),bn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",_,!0),P?.disconnect(),P=null,E?.disconnect(),E=null}),t({loadForEdit:v,loadAttachmentsForEdit:k,focus:w,anyPopupOpen:f,isEmpty:b}),(I,$)=>(y(),M("div",{ref_key:"dockRef",ref:m,class:Re(["chat-dock",[e.mobile?"align-mobile":"align-center",{"has-popup":f.value,"has-approval":!!e.pendingApproval&&!e.pendingQuestion}]]),onClick:$[31]||($[31]=It(()=>{},["stop"]))},[j(as,{name:"dock-panel"},{default:me(()=>[e.dockPanel?(y(),M("div",{key:0,ref_key:"workPanelRef",ref:h,class:Re(["dock-work-panel",{"body-scrolled-up":x.value,"body-scrolled-down":S.value}]),onClick:$[5]||($[5]=It(()=>{},["stop"]))},[C("div",SLe,[e.dockPanel==="bash"?(y(),M("span",ALe,N(p(i)("tasks.dockBash"))+" · "+N(e.bashRunning)+" "+N(p(i)("tasks.running")),1)):e.dockPanel==="subagent"?(y(),M("span",MLe,N(p(i)("tasks.dockSubagent"))+" · "+N(e.subagentRunning)+" "+N(p(i)("tasks.running")),1)):e.dockPanel==="todos"?(y(),M("span",TLe,N(p(i)("tasks.dockTodos"))+" · "+N(e.todoDoneCount)+"/"+N(e.todos?.length??0),1)):e.dockPanel==="goal"?(y(),M("span",ELe,N(p(i)("status.goalLabel"))+" · "+N(l.value),1)):ee("",!0),e.dockPanel==="goal"&&e.goal?(y(),M("span",ILe,[e.goal.status==="active"?(y(),he(p(Rt),{key:0,size:"sm",variant:"secondary",class:"dock-goal-action",onClick:$[0]||($[0]=It(B=>s("controlGoal","pause"),["stop"]))},{default:me(()=>[j(p(Te),{name:"pause",size:"md"}),C("span",null,N(p(i)("status.goalPause")),1)]),_:1})):ee("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(y(),he(p(Rt),{key:1,size:"sm",variant:"primary",class:"dock-goal-action",onClick:$[1]||($[1]=It(B=>s("controlGoal","resume"),["stop"]))},{default:me(()=>[j(p(Te),{name:"play",size:"md"}),C("span",null,N(p(i)("status.goalResume")),1)]),_:1})):ee("",!0),j(p(Rt),{size:"sm",variant:"danger-soft",class:"dock-goal-action",onClick:It(c,["stop"])},{default:me(()=>[j(p(Te),{name:"close",size:"md"}),C("span",null,N(p(i)("status.goalCancel")),1)]),_:1})])):ee("",!0)]),C("div",{ref_key:"workBodyRef",ref:g,class:"dock-work-body",onScroll:A},[e.dockPanel==="bash"?(y(),he(bS,{key:0,tasks:e.bashTasks,onCancel:$[2]||($[2]=B=>s("cancelTask",B))},null,8,["tasks"])):e.dockPanel==="subagent"?(y(),he(bS,{key:1,tasks:e.subagentTasks,onCancel:$[3]||($[3]=B=>s("cancelTask",B)),onOpen:$[4]||($[4]=B=>s("openAgent",B))},null,8,["tasks"])):e.dockPanel==="todos"?(y(),he(xLe,{key:2,todos:e.todos??[]},null,8,["todos"])):e.dockPanel==="goal"&&e.goal?(y(),he(qEe,{key:3,goal:e.goal},null,8,["goal"])):ee("",!0)],544),e.dockPanel==="goal"&&e.goal?(y(),M("div",LLe,[C("span",null,N(e.goal.turnsUsed)+" turns",1),C("span",null,N(p(Al)(e.goal.tokensUsed))+" tokens",1),u.value?(y(),M("span",$Le,N(u.value),1)):ee("",!0),e.goal.budget.tokenBudget!==null?(y(),M("span",NLe,N(a.value)+"% token budget",1)):ee("",!0)])):ee("",!0)],2)):ee("",!0)]),_:1}),e.hasDockWork?(y(),M("div",FLe,[e.goal?(y(),he(p(G0),{key:0,active:e.dockPanel==="goal","aria-pressed":e.dockPanel==="goal",onClick:$[6]||($[6]=B=>s("toggle-dock-panel","goal"))},{default:me(()=>[j(p(Te),{name:"target",size:"md"}),C("span",null,N(p(i)("status.goalLabel")),1),C("span",{class:Re(["dw-goal-status",`dw-goal-status--${e.goal.status}`])},N(l.value),3)]),_:1},8,["active","aria-pressed"])):ee("",!0),e.bashTasks.length>0?(y(),he(p(G0),{key:1,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:$[7]||($[7]=B=>s("toggle-dock-panel","bash"))},{default:me(()=>[j(p(Te),{name:"clock",size:"md"}),C("span",null,N(p(i)("tasks.dockBash")),1),C("span",RLe,[$[32]||($[32]=qe("(",-1)),C("b",null,N(e.bashTasks.length),1),$[33]||($[33]=qe(")",-1))])]),_:1},8,["active","aria-pressed"])):ee("",!0),e.subagentTasks.length>0?(y(),he(p(G0),{key:2,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:$[8]||($[8]=B=>s("toggle-dock-panel","subagent"))},{default:me(()=>[j(p(Te),{name:"sparkles",size:"md"}),C("span",null,N(p(i)("tasks.dockSubagent")),1),C("span",OLe,[$[34]||($[34]=qe("(",-1)),C("b",null,N(e.subagentTasks.length),1),$[35]||($[35]=qe(")",-1))])]),_:1},8,["active","aria-pressed"])):ee("",!0),(e.todos?.length??0)>0?(y(),he(p(G0),{key:3,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:$[9]||($[9]=B=>s("toggle-dock-panel","todos"))},{default:me(()=>[j(p(Te),{name:"check-list",size:"md"}),C("span",null,N(p(i)("tasks.dockTodos")),1),C("span",PLe,[$[36]||($[36]=qe("(",-1)),C("b",null,N(e.todoDoneCount)+"/"+N(e.todos?.length??0),1),$[37]||($[37]=qe(")",-1))])]),_:1},8,["active","aria-pressed"])):ee("",!0)])):ee("",!0),e.pendingQuestion?(y(),he(aIe,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:$[10]||($[10]=(B,H)=>s("answer",B,H)),onDismiss:$[11]||($[11]=B=>s("dismiss",B))},null,8,["question","busy-kind"])):e.pendingApproval?(y(),he(JIe,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,"open-file":e.openFile,onDecide:$[12]||($[12]=B=>s("approval",e.pendingApproval.approvalId,B))},null,8,["block","agent-name","busy","open-file"])):(y(),he(mF,{key:3,ref_key:"composerRef",ref:d,"session-id":e.sessionId,running:e.running,working:e.working,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"auth-ready":e.authReady,"managed-signed-in":e.managedSignedIn,"managed-membership":e.managedMembership,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:$[13]||($[13]=B=>s("submit",B)),onSteer:$[14]||($[14]=B=>s("steer",B)),onCommand:$[15]||($[15]=B=>s("command",B)),onInterrupt:$[16]||($[16]=B=>s("interrupt")),onSetPermission:$[17]||($[17]=B=>s("setPermission",B)),onSetThinking:$[18]||($[18]=B=>s("setThinking",B)),onTogglePlan:$[19]||($[19]=B=>s("togglePlan")),onToggleSwarm:$[20]||($[20]=B=>s("toggleSwarm")),onToggleGoal:$[21]||($[21]=B=>s("toggleGoal")),onOpenBtw:$[22]||($[22]=B=>s("openBtw")),onCreateGoal:$[23]||($[23]=B=>s("createGoal",B)),onControlGoal:$[24]||($[24]=B=>s("controlGoal",B)),onFocusGoal:$[25]||($[25]=B=>s("focusGoal")),onFocusSwarm:$[26]||($[26]=B=>s("focusSwarm")),onCompact:$[27]||($[27]=B=>s("compact")),onPickModel:$[28]||($[28]=B=>s("pickModel")),onSelectModel:$[29]||($[29]=B=>s("selectModel",B)),onLogin:$[30]||($[30]=B=>s("login"))},null,8,["session-id","running","working","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","starting"]))],2))}}),BLe=ft(DLe,[["__scopeId","data-v-6f1ea685"]]),HLe=["aria-label","aria-hidden"],zLe={class:"toc-scroll"},WLe=["onClick"],ULe={class:"toc-label"},jLe=240,VLe=et({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=Z(null),r=Z(!0);let l=null;function a(){const c=i.value,d=c?.offsetParent;if(!c||!d)return;const f=c.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=jLe}const u=R(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Je(u,c=>{l?.disconnect(),l=null,c&&yt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),Vn(()=>{l?.disconnect(),l=null}),(c,d)=>u.value?(y(),M("nav",{key:0,ref_key:"navRef",ref:i,class:Re(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":p(s)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[C("div",zLe,[(y(!0),M(Pe,null,pt(e.items,f=>(y(),M("button",{key:f.id,type:"button",class:Re(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>o("select",f.id)},[d[0]||(d[0]=C("span",{class:"toc-bar"},null,-1)),C("span",ULe,N(f.title),1)],10,WLe))),128))])],10,HLe)):ee("",!0)}}),qLe=ft(VLe,[["__scopeId","data-v-b8ba267a"]]),KLe={class:"tsearch-main"},ZLe=["placeholder"],GLe={key:0,class:"tsearch-spin"},YLe=["inert"],XLe={class:"tsearch-foot"},JLe={class:"tsearch-count",role:"status"},QLe={class:"tsearch-rings","aria-hidden":"true"},e$e=800,t$e=400,n$e=1500,o$e=et({__name:"TranscriptSearch",props:{pane:{},reveal:{},mobile:{type:Boolean,default:!1}},emits:["close"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=Nt(),{handleCompositionStart:r,handleCompositionEnd:l,isComposingKeyEvent:a}=Ar(),u=Z(""),c=Z(!1),d=Z([]),f=Z(0),h=Z(null),m=R(()=>d.value.length),v=R(()=>u.value.trim()!==""&&!c.value),k=Z(!1),w=R(()=>{if(m.value===0)return i("conversation.search.noResults");const V={current:f.value+1,total:m.value};return k.value?i("conversation.search.resultsCapped",V):i("conversation.search.results",V)});let b=null,_=null,g=null,x=null,S=null,T=0;const A=Z([]);function E(){const V=o.pane,ie=d.value[f.value];if(!V||ie===void 0){A.value=[];return}const ne=V.getBoundingClientRect(),X=[];for(const le of ie.getClientRects())X.push({top:`${le.top-ne.top+V.scrollTop}px`,left:`${le.left-ne.left}px`,width:`${le.width}px`,height:`${le.height}px`});A.value=X}function P(V,ie){return V.type==="attributes"&&V.target===ie?!0:D(V)}function D(V){const ie=ne=>ne instanceof Element&&(ne.classList.contains("tsearch-rings")||ne.closest(".tsearch-rings")!==null);if(ie(V.target))return!0;if(V.type==="childList"){const ne=[...V.addedNodes,...V.removedNodes];if(ne.length>0&&ne.every(ie))return!0}return!1}function I(){A.value.length!==0&&(S!==null&&clearTimeout(S),S=setTimeout(()=>{S=null,E()},120))}function $(){return o.pane?.querySelector(".chat")??null}function B(){if(b!==null&&(clearTimeout(b),b=null),u.value.trim()===""){c.value=!1,H();return}c.value=!0,b=setTimeout(H,e$e)}function H(V="first"){b!==null&&(clearTimeout(b),b=null),c.value=!1;const ie=$();if(u.value.trim()===""||ie===null){d.value=[],k.value=!1,f.value=0,E3(),E();return}const ne=d.value[f.value],X=ne?.startContainer??null,le=ne?.startOffset??0,Ie=PQ(ie,u.value.trim()),de=Ie.ranges;if(k.value=Ie.truncated,d.value=de,de.length===0){f.value=0,h9([],0),E();return}if(V!==!1){const ve=O(de);f.value=V==="backward"?(ve-1+de.length)%de.length:ve,F();return}const pe=X!==null?de.findIndex(ve=>ve.startContainer===X&&ve.startOffset===le):-1;f.value=pe>=0?pe:O(de),h9(de,f.value),E()}function O(V){const ie=o.pane?.getBoundingClientRect().top??0,ne=V.findIndex(X=>{const le=X.getClientRects(),Ie=le[le.length-1];return Ie!==void 0&&Ie.bottom>=ie});return ne===-1?0:ne}function F(){const V=d.value[f.value];h9(d.value,f.value),V!==void 0&&o.reveal(V),E()}function U(V){m.value!==0&&(f.value=(f.value+V+m.value)%m.value,F())}function z(V){if(V.key==="Enter"&&!a(V)){if(V.preventDefault(),b!==null){H(V.shiftKey?"backward":"first");return}U(V.shiftKey?-1:1)}}function W(V){V.key==="Escape"&&(a(V)||(V.preventDefault(),V.stopPropagation(),s("close")))}function K(){const V=h.value;V&&(V.focus(),V.select())}return t({focusInput:K}),dn(()=>{yt(()=>h.value?.focus()),o.pane&&typeof MutationObserver=="function"&&(g=new MutationObserver(ie=>{if(u.value.trim()!==""&&!ie.every(ne=>P(ne,o.pane))&&b===null){if(Date.now()-T>=n$e){T=Date.now(),_!==null&&(clearTimeout(_),_=null),H(!1);return}_!==null&&clearTimeout(_),_=setTimeout(()=>{_=null,b===null&&(T=Date.now(),H(!1))},t$e)}}),g.observe(o.pane,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["inert","style","class"]})),o.pane?.addEventListener("scroll",I,{passive:!0});const V=[o.pane,o.pane?.querySelector(".content-wrap")??null];if(typeof ResizeObserver=="function"){x=new ResizeObserver(()=>E());for(const ie of V)ie&&x.observe(ie)}}),bn(()=>{b!==null&&clearTimeout(b),_!==null&&clearTimeout(_),S!==null&&clearTimeout(S),g?.disconnect(),g=null,x?.disconnect(),x=null,o.pane?.removeEventListener("scroll",I),E3()}),(V,ie)=>(y(),M("div",{class:Re(["tsearch",{mobile:e.mobile}]),role:"search",onKeydown:W},[C("div",KLe,[j(p(Te),{class:"tsearch-icon",name:"search",size:"sm","aria-hidden":"true"}),Bn(C("input",{ref_key:"inputRef",ref:h,"onUpdate:modelValue":ie[0]||(ie[0]=ne=>u.value=ne),type:"text",class:"tsearch-input",placeholder:p(i)("conversation.search.placeholder"),autocapitalize:"off",autocomplete:"off",spellcheck:"false",onInput:B,onKeydown:z,onCompositionstart:ie[1]||(ie[1]=(...ne)=>p(r)&&p(r)(...ne)),onCompositionend:ie[2]||(ie[2]=(...ne)=>p(l)&&p(l)(...ne))},null,40,ZLe),[[ai,u.value]]),c.value?(y(),M("span",GLe,[j(p(Ao),{size:"sm",label:p(i)("conversation.search.searching")},null,8,["label"])])):ee("",!0),ie[6]||(ie[6]=C("span",{class:"tsearch-sep","aria-hidden":"true"},null,-1)),j(p(gn),{class:"tsearch-close",size:"sm",label:p(i)("conversation.search.close"),tooltip:p(i)("conversation.search.close"),onClick:ie[3]||(ie[3]=ne=>s("close"))},{default:me(()=>[j(p(Te),{name:"close"})]),_:1},8,["label","tooltip"])]),C("div",{class:Re(["tsearch-foot-wrap",{open:v.value}]),inert:!v.value},[C("div",XLe,[j(p(gn),{size:"sm",label:p(i)("conversation.search.previous"),tooltip:p(i)("conversation.search.previous"),disabled:m.value===0,onClick:ie[4]||(ie[4]=ne=>U(-1))},{default:me(()=>[j(p(Te),{name:"arrow-up"})]),_:1},8,["label","tooltip","disabled"]),j(p(gn),{size:"sm",label:p(i)("conversation.search.next"),tooltip:p(i)("conversation.search.next"),disabled:m.value===0,onClick:ie[5]||(ie[5]=ne=>U(1))},{default:me(()=>[j(p(Te),{name:"arrow-down"})]),_:1},8,["label","tooltip","disabled"]),C("span",JLe,N(w.value),1)])],10,YLe),e.pane?(y(),he(Zr,{key:0,to:e.pane},[C("div",QLe,[(y(!0),M(Pe,null,pt(A.value,(ne,X)=>(y(),M("div",{key:X,class:"tsearch-ring",style:Zt(ne)},null,4))),128))])],8,["to"])):ee("",!0)],34))}}),s$e=ft(o$e,[["__scopeId","data-v-26f3fed5"]]),i$e="/assets/k3_doodle1-27EZ2HSw.riv",r$e={class:"doodle-host"},l$e={key:0,class:"doodle-fallback"},a$e=et({__name:"KimiDoodle",setup(e){const t=Z(!1),n=Z(null),o=f2();let s=null;return dn(async()=>{if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches)try{let i=function(){const m=d.stateMachineNames[0];if(!m)return;const v=(d.stateMachineInputs(m)??[]).find(k=>k.name==="light/dark");v&&(v.value=o.value?1:0)};const[{Rive:r,RuntimeLoader:l},a,u]=await Promise.all([jo(()=>import("./rive-CeXCFBdn.js").then(m=>m.r),__vite__mapDeps([10,3])),jo(()=>import("./rive-BxcgqsjB.js"),[]).then(m=>m.default),jo(()=>import("./rive_fallback-ByshBW-N.js"),[]).then(m=>m.default)]),c=n.value;if(!c)return;l.setWasmUrl(a),l.setWasmFallbackUrl(u);const d=new r({canvas:c,src:i$e,autoplay:!0,onLoad(){const m=d.stateMachineNames[0];m&&d.play(m),requestAnimationFrame(()=>{n.value&&(i(),d.resizeDrawingSurfaceToCanvas(),t.value=!0)})}}),f=Je(o,i),h=()=>d.resizeDrawingSurfaceToCanvas();window.addEventListener("resize",h),s=()=>{f(),window.removeEventListener("resize",h),d.cleanup()}}catch{}}),Vn(()=>{s?.(),s=null}),(i,r)=>(y(),M("div",r$e,[t.value?ee("",!0):(y(),M("div",l$e,[xn(i.$slots,"fallback",{},void 0,!0)])),C("canvas",{ref_key:"canvasRef",ref:n,class:Re(["doodle-canvas",{ready:t.value}]),role:"img","aria-label":"Kimi"},null,2)]))}}),u$e=ft(a$e,[["__scopeId","data-v-b7d865dd"]]),c$e={class:"empty-hint"},d$e={class:"empty-hint-title"},f$e={key:1,class:"empty-hint-title is-starting"},p$e={key:2,class:"empty-hint-text"},h$e={key:0,class:"upgrade-banner"},m$e={class:"upgrade-banner-text"},g$e={class:"ws-bar"},v$e={key:0,class:"ws-anchor"},y$e=["aria-expanded"],k$e={class:"ws-chip-name"},b$e={class:"ws-caption"},C$e=["onClick"],w$e={class:"ws-info"},_$e={class:"ws-name"},x$e={class:"ws-path"},S$e=["aria-label"],A$e={key:0,class:"undo-toast",role:"status","aria-live":"polite"},M$e={class:"undo-toast-text"},T$e=48,ff=80,CS=1e3,E$e=420,I$e=3e3,L$e=5e3,$$e=1e4,N$e=2500,F$e=et({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},lastTurnReason:{},turnError:{},turnRetry:{},overlayOpen:{type:Boolean},starting:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},authReady:{type:Boolean},managedSignedIn:{type:Boolean},managedMembership:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","login","openFile","openMedia","openTurnDiff","openCompaction","openAgent","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:o}=Nt(),s=e,i=n,r=Z(!1),l=Z(!1),a=Z(null),u=R(()=>s.workspaces?.find(Ae=>Ae.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=R(()=>(s.workspaces?.length??0)>0),d=R(()=>s.authReady===!1&&(s.models?.length??0)===0&&s.managedSignedIn===!0&&s.managedMembership==="free"),f=R(()=>qQ(s.workspaces??[],s.activeWorkspaceId));function h(ke){if(r.value){r.value=!1;return}const Ae=ke.currentTarget?.closest(".ws-anchor"),Ke=Ae?.closest(".panes");if(Ae instanceof HTMLElement&&Ke instanceof HTMLElement){const Mt=Ae.getBoundingClientRect(),Gt=Ke.getBoundingClientRect(),an=Gt.bottom-Mt.bottom-4,Fn=Mt.top-Gt.top-4;l.value=Fn>an;const so=Math.max(0,Math.floor(l.value?Fn:an));a.value=`min(calc(var(--space-8) * 10), ${so}px)`}else l.value=!1,a.value=null;r.value=!0}function m(ke){r.value=!1,ke!==s.activeWorkspaceId&&i("selectWorkspace",ke)}ur(cn.contentAlign);const v=Z(null),k=Z(null),w=Z(null),b=Z(!1);let _=null;function g(ke,Ae){const Ke=w.value??k.value;return!Ke||Ke.loadForEdit(ke)===!1?!1:(Ke.loadAttachmentsForEdit(Ae??[]),!0)}function x(){b.value=!0,_!==null&&clearTimeout(_),_=setTimeout(()=>{_=null,b.value=!1},2e3)}const S=R(()=>s.tasks.filter(ke=>ke.kind!=="subagent")),T=R(()=>s.tasks.filter(ke=>ke.kind==="subagent"&&ke.runInBackground)),A=R(()=>S.value.filter(ke=>ke.state==="run").length),E=R(()=>T.value.filter(ke=>ke.state==="run").length);function P(ke){const Ae=s.tasks,Ke=Ae.find(Gt=>Gt.id===ke)??Ae.find(Gt=>Gt.parentToolCallId===ke);if(Ke?.agentId)return Ke.agentId;const Mt=Ae.filter(Gt=>Gt.kind==="subagent"&&!Gt.parentToolCallId&&Gt.agentId);if(Mt.length===1)return Mt[0].agentId}Ln("resolveAgentTaskId",P);const D=nn("modelDisplay"),I=nn("subagentEffort");function $(ke,Ae){const Ke=Ae??P(ke);if(Ke===void 0)return;const Mt=s.tasks.find(Fn=>Fn.agentId===Ke||Fn.id===Ke),Gt=D?.(Mt?.model),an=I?.(Mt?.thinkingEffort);if(!(Gt===void 0&&an===void 0))return{display:Gt,effort:an}}Ln("resolveAgentModel",$),Ln("pinScroll",Ko);const B=R(()=>(s.todos??[]).filter(ke=>ke.status==="done").length),H=R(()=>s.goal!=null||S.value.length>0||T.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),O=Z(null),F=R(()=>s.gitInfo?s.changes?.length??0:0);function U(ke){O.value=O.value===ke?null:ke}function z(){O.value=null}function W(){s.goal&&(O.value="goal")}Je(()=>[s.goal,S.value.length,T.value.length,s.todos?.length],()=>{const ke=O.value;if(ke===null)return;ke==="goal"&&s.goal!=null||ke==="bash"&&S.value.length>0||ke==="subagent"&&T.value.length>0||ke==="todos"&&(s.todos?.length??0)>0||z()});function K(ke){if(ke.role==="compaction")return o("conversation.compactedPlain");if(ke.role==="user"){if(ke.skillActivation)return`/${ke.skillActivation.name}`;if(ke.pluginCommand)return`/${ke.pluginCommand.pluginId}:${ke.pluginCommand.commandName}`;const Ke=ke.text.trim().replaceAll(/\s+/g," ");return Ke.length>0?Ke:"user"}const Ae=(ke.text||ke.thinking||"").trim().replaceAll(/\s+/g," ");return Ae.length>0?Ae:(ke.tools?.length??0)>0?`${ke.tools.length} tools`:"kimi"}const V=R(()=>s.turns.filter(ke=>ke.role==="user").map((ke,Ae)=>({id:ke.id,role:ke.role,no:Ae+1,title:K(ke)}))),ie=Z(null);function ne(){const ke=te.value;if(!ke)return;const Ae=V.value;if(Ae.length===0)return;if(We()<=ff){ie.value=Ae[Ae.length-1].id;return}if(le||X===null){const an=ke.scrollTop,Fn=ke.getBoundingClientRect().top,so=[];for(const Ps of ke.querySelectorAll(".turn-anchor[data-turn-id]")){const ku=Ps.dataset.turnId;ku&&so.push({id:ku,top:Ps.getBoundingClientRect().top-Fn+an})}X=so,le=!1}const Ke=new Set(Ae.map(an=>an.id)),Mt=ke.scrollTop+ke.clientHeight/2;let Gt=null;for(const an of X)Ke.has(an.id)&&an.top<=Mt&&(Gt=an.id);ie.value=Gt??Ae[0].id}let X=null,le=!0;function Ie(){le=!0}let de=0;function pe(){de||(de=co(()=>{de=0,ne()}))}const ve=Z(!1);let oe=0;function ye(){oe||(oe=co(()=>{oe=0,Y()}))}function G(){ye(),Ie()}function Y(){const ke=te.value,Ae=!s.mobile&&ke?ke.closest(".con")?.querySelector(".conversation-toc"):null,Ke=Ae?.querySelector(".toc-bar");let Mt=!1;if(ke&&Ae&&Ke){const Gt=Ke.getBoundingClientRect(),an=Ae.getBoundingClientRect(),Fn=Gt.left+Gt.width/2;Mt=Array.from(ke.querySelectorAll(".table-node-wrapper")).some(so=>{const Ps=so.getBoundingClientRect();return Ps.left<=Fn&&Fn<=Ps.right&&Ps.top<an.bottom&&Ps.bottom>an.top})}ve.value!==Mt&&(ve.value=Mt)}const fe=R(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),we=R(()=>{const ke=fe.value;if(ke)return s.pendingQuestionActions?.[ke.questionId]}),ge=R(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),Q=R(()=>{const ke=ge.value;return ke?!!s.pendingApprovalActions?.[ke.approvalId]:!1}),te=Z(null),ce=Z(null),ue=Z(0),Se=Z(0),ze=Z(!1),_e=Z(null);let Ee=null;function it(){if(s.turns.length!==0){if(ze.value){_e.value?.focusInput();return}Ee=document.activeElement,ze.value=!0}}function Fe(){ze.value=!1,yt(()=>{Ee instanceof HTMLElement&&Ee.isConnected&&Ee.focus(),Ee=null})}Je(()=>s.turns.length===0&&!s.sessionLoading,ke=>{ke&&ze.value&&Fe()});const Oe=R(()=>({"--panes-scrollbar-width":`${ue.value}px`})),Ge=R(()=>({"--chat-dock-height":`${Se.value+T$e}px`}));function at(ke){return ke instanceof HTMLElement?ke:ke&&"$el"in ke&&ke.$el instanceof HTMLElement?ke.$el:null}let Tt=0;function Bt(){Tt||(Tt=co(()=>{Tt=0;const ke=te.value,Ae=ke?Math.max(0,ke.offsetWidth-ke.clientWidth):0;Ae!==ue.value&&(ue.value=Ae);const Ke=ce.value?.offsetHeight??0;Ke!==Se.value&&(Se.value=Ke)}))}function Yt(ke){const Ae=at(ke);Ae!==te.value&&(te.value=Ae,Ae&&xe())}function Sn(ke){const Ae=at(ke);Ae!==ce.value&&(ce.value=Ae??null,ke&&"loadForEdit"in ke&&typeof ke.loadForEdit=="function"&&"focus"in ke&&typeof ke.focus=="function"?w.value={loadForEdit:ke.loadForEdit.bind(ke),loadAttachmentsForEdit:"loadAttachmentsForEdit"in ke&&typeof ke.loadAttachmentsForEdit=="function"?ke.loadAttachmentsForEdit.bind(ke):()=>{},focus:ke.focus.bind(ke),get anyPopupOpen(){return"anyPopupOpen"in ke&&ke.anyPopupOpen===!0},isEmpty:"isEmpty"in ke&&typeof ke.isEmpty=="function"?ke.isEmpty.bind(ke):void 0}:w.value=null,se())}const on=Z(!0),en=Z(!1),Cn=Z(!1);let Mn=null;function We(){const ke=te.value;return ke?yo-ke.scrollTop-ht:0}let tt=0,Ue=0,Lt=0,gt=0,wn=0,yn=0,go=0;function qt(){return Date.now()<Ue}function ps(){ye(),Cn.value=!0,Mn&&clearTimeout(Mn),Mn=setTimeout(()=>{Cn.value=!1,Mn=null},900);const ke=te.value;if(!ke)return;const Ae=ke.scrollTop;if(kn()){tt=Ae;return}if(performance.now()-Lt<100){tt=Ae;return}const Ke=We();if(qt()){on.value=!0,en.value=!1,tt=Ae;return}Ae<tt-1&&Ke>1?ke.scrollHeight-Ae-ke.clientHeight>1&&(on.value=!1,en.value=!0):Ke<=ff&&Ae>tt+1&&Date.now()>=gt&&(on.value=!0,en.value=!1),tt=Ae,pe()}function xs(ke=!1){const Ae=te.value;on.value=!0,en.value=!1,no(),Ae&&(!ke&&performance.now()<wn||(ke?In():Ae.scrollTop=Math.max(Ae.scrollTop,yo),tt=Ae.scrollTop))}let _n=0;function In(ke=320){const Ae=te.value;if(!Ae)return;if(_n&&(Tn(_n),_n=0),typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){Ae.scrollTop=Ae.scrollHeight,tt=Ae.scrollTop;return}const Ke=Ae.scrollTop,Mt=performance.now();Lt=Mt,wn=Mt+ke+E$e;const Gt=()=>{_n=0;const an=Math.min(1,(performance.now()-Mt)/ke),Fn=1-Math.pow(1-an,3);Ae.scrollTop=Ke+(Ae.scrollHeight-Ke)*Fn,tt=Ae.scrollTop,an<1?_n=co(Gt):wn=0};_n=co(Gt)}function To(ke,Ae){return(Ae.closest("[inert]")?.closest(".tool-group, .activity-run, .turn-fold")??Ae).getBoundingClientRect().top-ke.getBoundingClientRect().top+ke.scrollTop}function lo(ke,Ae){const Ke=Array.from(ke.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(an=>({node:an,top:To(ke,an)})),Mt=Ke.findIndex(an=>an.top>=Ae),Gt=Mt<0?Math.max(0,Ke.length-1):Mt;return Ke.slice(Gt,Gt+2).flatMap(an=>{const Fn=an.node.dataset.scrollAnchorId,so=Fn??an.node.dataset.turnId;return so?[{kind:Fn?"tool":"turn",id:so,top:an.top}]:[]})}const St=new Map;function hs(ke,Ae){for(const Ke of Ae.anchors){const Mt=Ke.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Gt=ke.querySelector(`[${Mt}="${Ys(Ke.id)}"]`);if(Gt)return To(ke,Gt)-Ke.top}return ke.scrollHeight-Ae.oldHeight}function Jo(ke,Ae,Ke=ke.scrollTop){return ke.scrollTop=Ke+hs(ke,Ae),tt=ke.scrollTop,ke.scrollTop}async function uo(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||Xt.value||!s.hasMoreMessages)return;const ke=s.sessionId,Ae=te.value,Ke=Ae?.scrollTop??0,Mt={anchors:Ae?lo(Ae,Ke):[],oldHeight:Ae?.scrollHeight??0};gs(ke,!0),Ei();try{if(await yt(),await s.loadOlderMessages(ke),await yt(),s.sessionId!==ke){St.set(ke,Mt);return}const Gt=te.value;if(!Gt)return;Jo(Gt,Mt),St.delete(ke)}finally{gs(ke,!1)}}function Ys(ke){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(ke):ke.replaceAll(/["\\]/g,"\\$&")}let Nn=null;function no(){Nn!==null&&(clearTimeout(Nn),Nn=null)}function $s(ke){ao(),on.value=!1,en.value=We()>ff,ke.scrollIntoView({behavior:"smooth",block:"center"}),no(),Nn=setTimeout(()=>{Nn=null;const Ae=te.value;if(!Ae||!ke.isConnected)return;const Ke=ke.getBoundingClientRect().top+ke.offsetHeight/2-(Ae.getBoundingClientRect().top+Ae.clientHeight/2);Math.abs(Ke)>48&&(Ae.scrollTop+=Ke)},480)}function Xs(ke){const Ae=te.value;if(!Ae)return;const Ke=Ae.querySelector(`.turn-anchor[data-turn-id="${Ys(ke)}"]`);Ke&&$s(Ke)}function ci(ke,Ae){const Ke=ke.startContainer.parentElement;if(Ke!==null)for(let Mt=Ke;Mt!==null&&Mt!==Ae;Mt=Mt.parentElement){const Gt=getComputedStyle(Mt),an=/(auto|scroll)/.test(Gt.overflowY)&&Mt.scrollHeight>Mt.clientHeight,Fn=/(auto|scroll)/.test(Gt.overflowX)&&Mt.scrollWidth>Mt.clientWidth;if(!an&&!Fn)continue;const so=ke.getClientRects()[0];if(!so)return;const Ps=Mt.getBoundingClientRect();an&&(Mt.scrollTop+=so.top+so.height/2-(Ps.top+Mt.clientHeight/2)),Fn&&(Mt.scrollLeft+=so.left+so.width/2-(Ps.left+Mt.clientWidth/2))}}function Oo(ke){const Ae=te.value;if(!Ae)return;const Ke=ke.startContainer.parentElement;ao(),on.value=!1,en.value=We()>ff,gt=Date.now()+700;const Mt=Ke?.closest(".u-text-wrap.is-clamped");if(Mt){Mt.querySelector(".u-text-toggle")?.click(),yt(()=>vo(ke,Ae));return}vo(ke,Ae)}function vo(ke,Ae){const Ke=ke.startContainer.parentElement;ci(ke,Ae);const Mt=ke.getClientRects()[0];if(!Mt){Ke instanceof HTMLElement&&$s(Ke);return}const Gt=Ae.getBoundingClientRect(),an=Mt.top+Mt.height/2-(Gt.top+Ae.clientHeight/2),Fn=typeof window>"u"||!window.matchMedia("(prefers-reduced-motion: reduce)").matches;Ae.scrollTo({top:Ae.scrollTop+an,behavior:Fn?"smooth":"auto"}),no(),Nn=setTimeout(()=>{Nn=null;const so=te.value,Ps=ke.getClientRects()[0];if(!so||!Ps)return;const ku=so.getBoundingClientRect(),A1=Ps.top+Ps.height/2-(ku.top+so.clientHeight/2);Math.abs(A1)>48&&(so.scrollTop+=A1)},480)}function Po(){const ke=te.value;if(!ke)return"none";const Ae=ke.firstElementChild,Ke=Ae instanceof HTMLElement?Ae.offsetHeight:0,Mt=ce.value?.offsetHeight??0;return`${ke.scrollHeight}:${ke.clientHeight}:${Ke}:${Mt}`}function co(ke){return typeof requestAnimationFrame=="function"?requestAnimationFrame(ke):setTimeout(ke,16)}function Tn(ke){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(ke):clearTimeout(ke)}let fo=0,Qe=0,st=null,Ct=0;const Qt=Z(!1);function kn(){return performance.now()<fo}function Ko(ke,Ae=200){const Ke=te.value;if(!Ke||Xt.value||(ao(),on.value=!1,st=ke,Ct=ke.getBoundingClientRect().top,fo=performance.now()+Ae,Qt.value=!0,Qe))return;const Mt=()=>{if(Qe=0,!st)return;if(on.value){st=null,Qt.value=!1;return}if(performance.now()>=fo){st=null,Qt.value=!1,Eo();return}const Gt=st.getBoundingClientRect().top-Ct;Gt&&(Ke.scrollTop+=Gt),Qe=co(Mt)};Qe=co(Mt)}function Eo(){We()<=ff?(on.value=!0,en.value=!1):(on.value=!1,en.value=!0)}function bo(ke=36,Ae){if(!on.value&&!qt()){Ae?.();return}const Ke=++go;let Mt="",Gt=0,an=0;yn&&(Tn(yn),yn=0);const Fn=()=>{if(yn=0,Ke!==go)return;if(!on.value&&!qt()){Ae?.();return}xs(!1);const so=Po();Gt=so===Mt?Gt+1:0,Mt=so,an++,Gt<3&&an<ke?yn=co(Fn):Ae?.()};yn=co(Fn)}function Ns(ke,Ae){return ke!==void 0&&ke.length>0&&Ae.length>=ke.length&&ke.firstId!==Ae.firstId&&ke.lastId===Ae.lastId&&ke.lastTextLen===Ae.lastTextLen&&ke.lastThinkingLen===Ae.lastThinkingLen&&ke.lastToolsLen===Ae.lastToolsLen&&ke.approvalIds===Ae.approvalIds}const Do=R(()=>{const ke=(s.approvals??[]).map(an=>an.approvalId).join(","),Ae=s.turns,Ke=Ae.at(-1),Mt=Ke?.thinking?.length??0,Gt=Ke?.tools?.reduce((an,Fn)=>an+Fn.name.length+(Fn.arg?.length??0)+(Fn.output?.join("").length??0),0)??0;return{length:Ae.length,firstId:Ae[0]?.id??"",lastId:Ke?.id??"",lastTextLen:Ke?.text.length??0,lastThinkingLen:Mt,lastToolsLen:Gt,approvalIds:ke}});let Io=s.fileReloadKey;Je(Do,async(ke,Ae)=>{const Ke=s.fileReloadKey,Mt=Ke!==Io;if(Io=Ke,Xt.value&&Ns(Ae,ke)){pe();return}if(Mt){pe();return}await yt(),on.value||qt()?xs(ke.length<Ae.length):en.value=!0,pe()}),Je(ce,()=>{se()}),Je(()=>s.mobile,async()=>{await yt(),Bt()});const Qo=new Map,sn=Z(!1);let es=0,ms=null;function Tr(){sn.value=!0,es&&(Tn(es),es=0),ms&&clearTimeout(ms),ms=setTimeout(()=>{sn.value=!1,ms=null},1200)}function ts(){if(!sn.value)return;let ke=2;const Ae=()=>{if(es=0,ke--,ke>0){es=co(Ae);return}sn.value=!1,ms&&(clearTimeout(ms),ms=null)};es&&Tn(es),es=co(Ae)}Je(()=>s.fileReloadKey,async(ke,Ae)=>{const Ke=te.value;Ae&&Ke&&Qo.set(String(Ae),{top:Ke.scrollTop,following:on.value}),ao(),Tr(),await yt();const Mt=te.value,Gt=ke?Qo.get(String(ke)):void 0;if(Gt&&Mt){const an=St.get(String(ke)),Fn=an?Jo(Mt,an,Gt.top):Gt.top;an&&St.delete(String(ke)),on.value=Gt.following,Mt.scrollTop=Fn,tt=Mt.scrollTop,en.value=!Gt.following&&We()>1,Gt.following?bo(36,ts):ts()}else on.value=!0,tt=0,xs(!1),bo(36,ts);Ie(),ne()}),Je(()=>s.sessionLoading,async(ke,Ae)=>{ke||!Ae||(on.value=!0,await yt(),bo(36,ts),pe())}),Je(()=>s.turnActive,async(ke,Ae)=>{ke||!Ae||!on.value&&!qt()||(await yt(),bo(48),pe())});function Ki(){on.value=!0,en.value=!1,Ue=Date.now()+CS,yt(()=>{xs(!0),bo(16)})}function Js(ke){Ki(),i("submit",ke)}function Bo(ke){on.value=!0,en.value=!1,Ue=Date.now()+CS,i("editMessage",ke)}function Zo(ke){const Ae=s.queued?.[ke],Ke=Ae?.text??"";g(Ke,Ae?.attachments)&&i("editQueued",ke)}function Il(ke){i("reorderQueue",ke)}function Zi(ke,Ae){Ki(),i("answer",ke,Ae)}function tl(ke,Ae){!ke||!Ae||i("approval",ke,Ae)}let Ho=null,Co=null,Fs=null,Rs=null,yo=0,ht=0,Le=0;const Ze=Z(new Set),Xt=R(()=>!!s.sessionId&&Ze.value.has(s.sessionId));function gs(ke,Ae){const Ke=new Set(Ze.value);Ae?Ke.add(ke):Ke.delete(ke),Ze.value=Ke}function di(){Xt.value||Le||(Le=co(()=>{Le=0,!Xt.value&&(kn()||(on.value||qt())&&xs(!1))}))}function Ei(){go++,yn&&(Tn(yn),yn=0),Le&&(Tn(Le),Le=0)}function ao(){const ke=te.value;if(Ue=0,gt=0,Ei(),fo=0,st=null,Qt.value=!1,_n&&(Tn(_n),_n=0),no(),ke){const Ae=ke.scrollTop;typeof ke.scrollTo=="function"?ke.scrollTo({top:Ae,behavior:"auto"}):ke.scrollTop=Ae}wn=0,Lt=Number.NEGATIVE_INFINITY,ke&&(tt=ke.scrollTop)}function Gi(){const ke=te.value;!ke||ke.scrollHeight-ke.clientHeight<=1&&!s.hasMoreMessages||(on.value=!1,ao(),ke.scrollHeight-ke.clientHeight>1&&(en.value=!0))}function Er(ke){const Ae=te.value;if(!Ae)return!1;for(const Ke of ke.composedPath()){if(Ke===Ae)return!1;if(Ke instanceof HTMLElement&&Ke.scrollHeight>Ke.clientHeight+1&&Ke.scrollTop>1)return!0}return!1}function fi(ke){ke.defaultPrevented||ke.ctrlKey||ke.shiftKey||(no(),!(ke.deltaY>=0||Er(ke))&&Gi())}function Ll(ke){const Ae=te.value;if(!Ae||ke.defaultPrevented||ke.button!==0||ke.pointerType==="touch")return;const Ke=Ae.getBoundingClientRect(),Mt=Ae.offsetWidth-Ae.clientWidth,Gt=Mt>0?Mt:12;ke.target===Ae&&ke.clientX>=Ke.right-Gt&&Gi()}let zo=null;function Ir(ke){zo=ke.touches.length===1?ke.touches[0].clientY:null}function Qs(ke){const Ae=ke.touches.length===1?ke.touches[0].clientY:null;no(),Ae!==null&&zo!==null&&Ae>zo+2&&!Er(ke)&&Gi(),zo=Ae}function pi(){if(!Co)return;const ke=te.value?.firstElementChild??null;ke!==Fs&&(Fs&&Co.unobserve(Fs),Fs=ke,ke&&Co.observe(ke))}function se(){if(!Co)return;const ke=ce.value;ke!==Rs&&(Rs&&Co.unobserve(Rs),Rs=ke,ke&&Co.observe(ke))}function xe(){const ke=te.value;Bt(),Ho&&(Ho.disconnect(),ke&&Ho.observe(ke,{childList:!0,subtree:!0,characterData:!0})),Co&&(Co.disconnect(),Fs=null,Rs=null,ke&&Co.observe(ke),pi(),se()),yo=ke?.scrollHeight??0,ht=ke?.clientHeight??0,ye(),Ie()}function J(){pi(),di(),ye(),Ie()}function Ce(){typeof document>"u"||document.visibilityState==="visible"&&on.value&&bo()}const $e=Z(!1);let He=null;function vt(){$e.value=!0,He!==null&&clearTimeout(He),He=setTimeout(()=>{$e.value=!1},I$e)}const ut=Z(null);let Dt=null;const Et=Z(null);let ln=null,oo=!1;function Ot(){ut.value=null,Et.value=null,oo=!1,Dt!==null&&(clearTimeout(Dt),Dt=null),ln!==null&&(clearTimeout(ln),ln=null)}function Pt(){for(let ke=s.turns.length-1;ke>=0;ke--){const Ae=s.turns[ke];if(Ae.goalContinuation)return null;if(Ae.role==="user")return Ae}return null}function Yn(ke){return ta(ke).some(Ae=>Ae.kind==="thinking"&&Ae.thinking.trim().length>0||Ae.kind==="text"&&Ae.text.trim().length>0||Ae.kind==="tool")}function ko(){if(ut.value!==null||Et.value!==null||!s.working||(s.queued?.length??0)>0)return;const ke=Pt();if(ke===null||ke.skillActivation!==void 0||ke.pluginCommand!==void 0)return;s.turns.slice(s.turns.indexOf(ke)+1).every(Ke=>Ke.role==="assistant"&&!Yn(Ke))?(Et.value=ke.id,oo=!1,ln=setTimeout(()=>{Et.value=null},$$e)):ut.value=ke.id}let vs=!1,Os=null;function ei(ke){if(vs)return;Ot();const Ae=s.turns.find(Mt=>Mt.id===ke);Ae===void 0||Ae.role!=="user"||Pt()?.id!==Ae.id||(w.value??k.value)?.isEmpty?.()===!1||(vs=!0,Os=setTimeout(()=>{vs=!1,Os=null},N$e),Bo({text:Ae.text,attachments:Ae.attachments}))}function Lc(){Et.value===null||s.working||!oo||ei(Et.value)}Je(()=>s.working,(ke,Ae)=>{if(!(Ae!==!0||ke)){if(Et.value!==null){Lc();return}ut.value!==null&&Dt===null&&(Dt=setTimeout(()=>{ut.value=null,Dt=null},L$e))}}),Je(()=>Pt()?.id??null,(ke,Ae)=>{ke!==Ae&&Ot()}),Je(()=>s.sessionId,Ot),Je(()=>s.queued?.length,ke=>{(ke??0)>0&&Ot()});const U2=R(()=>{if(s.lastTurnReason!=="cancelled"||s.working||s.turnActive)return null;const ke=s.turns[s.turns.length-1];return ke?.role==="assistant"&&Yn(ke)?ke.id:null}),$c=R(()=>s.lastTurnReason==="failed"&&!s.working&&!s.turnActive&&s.turns.length>0);function yu(){Ki(),i("submit",{text:o("conversation.turnFailedResumeText"),attachments:[]})}const Nc=R(()=>s.working?null:ut.value);function Fc(){i("interrupt")}function j2(){return(w.value?.anyPopupOpen??k.value?.anyPopupOpen)===!0}const{handleCompositionStart:$l,handleCompositionEnd:hi,isComposingKeyEvent:x1}=Ar();let a0=null;function u0(ke){a0=ke.target}function S1(ke){const Ae=ke instanceof Element&&ke!==document.body?ke:a0,Ke=zQ(Ae,".global-preview");if(Ke){iC(Ke);return}const Mt=te.value?.querySelector(".chat");Mt&&iC(Mt)}function c0(ke){if(!(ke.target instanceof Element&&ke.target.closest(".terminal-host")!==null)){if(ke.key==="Escape"&&!s.overlayOpen&&!j2()&&!ke.defaultPrevented&&!ke.repeat&&!x1(ke)){Nc.value!==null?(ke.preventDefault(),ei(Nc.value)):s.working&&(ke.preventDefault(),ko(),Fc());return}if(SQ(ke)&&!s.overlayOpen&&s.turns.length>0){ke.preventDefault(),it();return}BQ(ke)&&!s.overlayOpen&&!HQ(ke.target)&&(ke.preventDefault(),S1(ke.target))}}function d0(){on.value&&di()}dn(()=>{yt(()=>{typeof MutationObserver=="function"&&(Ho=new MutationObserver(J)),typeof ResizeObserver=="function"&&(Co=new ResizeObserver(()=>{ye(),Ie(),Bt();const ke=te.value;if(!ke)return;const{scrollHeight:Ae,clientHeight:Ke}=ke,Mt=Ae>yo+1,Gt=Ke<ht-1;yo=Ae,ht=Ke,!kn()&&(Mt||Gt)&&di()})),xe(),bo(48),ne(),te.value?.addEventListener("kimi-table-layout",G),typeof document<"u"&&(document.addEventListener("visibilitychange",Ce),document.addEventListener("keydown",c0),document.addEventListener("pointerdown",u0,!0),document.addEventListener("compositionstart",$l),document.addEventListener("compositionend",hi)),window.visualViewport?.addEventListener("resize",d0)})}),bn(()=>{te.value?.removeEventListener("kimi-table-layout",G),Ho&&Ho.disconnect(),Co&&Co.disconnect(),Le&&Tn(Le),yn&&Tn(yn),Qe&&Tn(Qe),_n&&Tn(_n),oe&&Tn(oe),de&&Tn(de),Nn!==null&&clearTimeout(Nn),Mn&&clearTimeout(Mn),He!==null&&clearTimeout(He),Dt!==null&&clearTimeout(Dt),ln!==null&&clearTimeout(ln),Os!==null&&clearTimeout(Os),_!==null&&(clearTimeout(_),_=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ce),document.removeEventListener("keydown",c0),document.removeEventListener("pointerdown",u0,!0),document.removeEventListener("compositionstart",$l),document.removeEventListener("compositionend",hi)),window.visualViewport?.removeEventListener("resize",d0)});function Rc(){(w.value??k.value)?.focus()}Lhe({sessionId:()=>s.sessionId,mobile:()=>s.mobile===!0,starting:()=>s.starting===!0,dockedComposer:w,emptyComposer:k});function V2(){vt()}function q2(ke){if(Et.value!==null){if(!ke){oo||Ot();return}oo=!0,Lc()}}return t({loadComposerForEdit:g,focusComposer:Rc,notifyUndone:V2,onAbortOutcome:q2,selectAllRegion:S1}),(ke,Ae)=>(y(),M("section",{class:Re(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(y(),he(LAe,{key:0,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":F.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:b.value,onOpenChanges:Ae[0]||(Ae[0]=Ke=>i("openChanges")),onCopyAll:Ae[1]||(Ae[1]=Ke=>v.value?.copyConversation()),onCopyFinalSummary:Ae[2]||(Ae[2]=Ke=>v.value?.copyFinalSummary()),onOpenPr:Ae[3]||(Ae[3]=Ke=>e.pr&&i("openPr",e.pr.url)),onRenameSession:Ae[4]||(Ae[4]=(Ke,Mt)=>i("renameSession",Ke,Mt)),onForkSession:Ae[5]||(Ae[5]=Ke=>i("forkSession",Ke)),onArchiveSession:Ae[6]||(Ae[6]=Ke=>i("archiveSession",Ke)),onExportSession:Ae[7]||(Ae[7]=Ke=>i("exportSession",Ke))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):e.mobile?ee("",!0):(y(),M("div",{key:1,class:Re(["empty-drag",{"macos-desktop":p(rc)}])},null,2)),j(qLe,{items:V.value,"active-turn-id":ie.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:ve.value,onSelect:Xs},null,8,["items","active-turn-id","mobile","session-loading","occluded"]),C("div",{class:"chat-layout",style:Zt(Ge.value)},[C("div",{ref:Yt,class:Re(["panes chat-scroll",{"is-following":on.value,"history-prepending":Xt.value,"is-pinned":Qt.value,scrolling:Cn.value,"session-settling":sn.value}]),onScrollPassive:ps,onWheelPassive:fi,onPointerdownPassive:Ll,onTouchstartPassive:Ir,onTouchmovePassive:Qs},[C("div",{class:Re(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(y(),M(Pe,{key:0},[Ae[55]||(Ae[55]=C("div",{class:"empty-spacer"},null,-1)),C("div",c$e,[e.starting?(y(),M("span",f$e,[j(p(Ao),{size:"sm"}),C("span",null,N(p(o)("conversation.starting")),1)])):(y(),he(u$e,{key:0,class:"empty-doodle"},{fallback:me(()=>[C("span",d$e,N(p(o)("composer.emptyConversationTitle")),1)]),_:1})),e.starting?ee("",!0):(y(),M("span",p$e,N(p(o)("composer.emptyConversation")),1))]),d.value?(y(),M("div",h$e,[j(p(Te),{class:"upgrade-banner-icon",name:"music",size:"sm"}),C("span",m$e,N(p(o)("composer.upgradeBanner")),1),C("button",{type:"button",class:"upgrade-banner-cta",onClick:Ae[8]||(Ae[8]=Ke=>p(jp)())},N(p(o)("sidebar.upgrade")),1)])):ee("",!0),j(mF,{ref_key:"emptyComposerRef",ref:k,class:"empty-composer","session-id":e.sessionId,running:e.running,working:e.working,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"auth-ready":e.authReady,"managed-signed-in":e.managedSignedIn,"managed-membership":e.managedMembership,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Js,onSteer:Ae[11]||(Ae[11]=Ke=>i("steer",Ke)),onCommand:Ae[12]||(Ae[12]=Ke=>i("command",Ke)),onInterrupt:Fc,onUnqueue:Ae[13]||(Ae[13]=Ke=>i("unqueue",Ke)),onEditQueued:Ae[14]||(Ae[14]=Ke=>i("editQueued",Ke)),onSetPermission:Ae[15]||(Ae[15]=Ke=>i("setPermission",Ke)),onSetThinking:Ae[16]||(Ae[16]=Ke=>i("setThinking",Ke)),onTogglePlan:Ae[17]||(Ae[17]=Ke=>i("togglePlan")),onToggleSwarm:Ae[18]||(Ae[18]=Ke=>i("toggleSwarm")),onToggleGoal:Ae[19]||(Ae[19]=Ke=>i("toggleGoal")),onOpenBtw:Ae[20]||(Ae[20]=Ke=>i("command",{cmd:"/btw",attachments:[]})),onCreateGoal:Ae[21]||(Ae[21]=Ke=>i("createGoal",Ke)),onControlGoal:Ae[22]||(Ae[22]=Ke=>i("controlGoal",Ke)),onFocusGoal:W,onCompact:Ae[23]||(Ae[23]=Ke=>i("compact")),onPickModel:Ae[24]||(Ae[24]=Ke=>i("pickModel")),onSelectModel:Ae[25]||(Ae[25]=Ke=>i("selectModel",Ke)),onLogin:Ae[26]||(Ae[26]=Ke=>i("login"))},fA({_:2},[e.starting?void 0:{name:"footer",fn:me(()=>[C("div",g$e,[c.value?(y(),M("div",v$e,[j(p(pn),{text:p(o)("conversation.switchWorkspace")},{default:me(()=>[C("button",{type:"button",class:Re(["ws-chip",{open:r.value}]),"aria-expanded":r.value,onClick:It(h,["stop"])},[j(p(Te),{name:"folder"}),C("span",k$e,N(u.value),1),j(p(Te),{class:"ws-chip-chev",name:"chevron-down",size:"sm"})],10,y$e)]),_:1},8,["text"]),r.value?(y(),M("div",{key:0,class:Re(["ws-panel",{up:l.value}]),style:Zt(a.value?{maxHeight:a.value}:void 0),role:"menu"},[C("div",b$e,N(p(o)("workspace.recentLabel")),1),(y(!0),M(Pe,null,pt(f.value,Ke=>(y(),M("button",{key:Ke.id,type:"button",class:Re(["ws-row",{on:Ke.id===e.activeWorkspaceId}]),role:"menuitem",onClick:It(Mt=>m(Ke.id),["stop"])},[j(p(Te),{name:"folder"}),C("span",w$e,[C("span",_$e,N(Ke.name),1),C("span",x$e,N(Ke.shortPath),1)]),Ke.id===e.activeWorkspaceId?(y(),he(p(Te),{key:0,class:"ws-check",name:"check",size:"sm"})):ee("",!0)],10,C$e))),128)),Ae[54]||(Ae[54]=C("div",{class:"ws-divider"},null,-1)),C("button",{type:"button",class:"ws-action",role:"menuitem",onClick:Ae[9]||(Ae[9]=It(Ke=>{r.value=!1,i("addWorkspace")},["stop"]))},[j(p(Te),{name:"folder-plus"}),C("span",null,N(p(o)("conversation.pickFolder")),1)])],6)):ee("",!0)])):(y(),M("button",{key:1,type:"button",class:"ws-chip ws-ghost",onClick:Ae[10]||(Ae[10]=Ke=>i("addWorkspace"))},[j(p(Te),{name:"folder-plus"}),C("span",null,N(p(o)("conversation.pickFolder")),1)]))])]),key:"0"}]),1032,["session-id","running","working","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","starting"]),r.value?(y(),M("div",{key:1,class:"ws-backdrop",onClick:Ae[27]||(Ae[27]=Ke=>r.value=!1)})):ee("",!0),Ae[56]||(Ae[56]=C("div",{class:"empty-spacer"},null,-1))],64)):(y(),he(e6,{ref_key:"chatPaneRef",ref:v,key:e.fileReloadKey??"no-session",turns:e.turns,cwd:e.status.cwd,approvals:e.approvals,questions:e.questions,"turn-active":e.turnActive,working:e.working,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":on.value,queued:e.queued,"undo-hint-turn-id":Nc.value,"interrupted-turn-id":U2.value,"turn-failed":$c.value,"turn-error":e.turnError??null,"turn-retry":e.turnRetry??null,onResumeTurn:yu,onOpenFile:Ae[28]||(Ae[28]=Ke=>i("openFile",Ke)),onOpenMedia:Ae[29]||(Ae[29]=Ke=>i("openMedia",Ke)),onOpenTurnDiff:Ae[30]||(Ae[30]=Ke=>i("openTurnDiff",Ke)),onCopyConversationCopied:x,onOpenCompaction:Ae[31]||(Ae[31]=Ke=>i("openCompaction",Ke)),onOpenAgent:Ae[32]||(Ae[32]=Ke=>i("openAgent",Ke)),onEditMessage:Bo,onArmedUndo:ei,onLoadOlderMessages:uo,onUnqueue:Ae[33]||(Ae[33]=Ke=>i("unqueue",Ke)),onEditQueued:Zo,onReorderQueue:Il},null,8,["turns","cwd","approvals","questions","turn-active","working","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued","undo-hint-turn-id","interrupted-turn-id","turn-failed","turn-error","turn-retry"]))],2)],34),e.turns.length===0&&!e.sessionLoading?ee("",!0):(y(),he(BLe,{key:0,ref:Sn,style:Zt(Oe.value),"session-id":e.sessionId,running:e.running,working:e.working,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"auth-ready":e.authReady,"managed-signed-in":e.managedSignedIn,"managed-membership":e.managedMembership,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"dock-panel":O.value,"bash-tasks":S.value,"subagent-tasks":T.value,"bash-running":A.value,"subagent-running":E.value,"todo-done-count":B.value,"has-dock-work":H.value,todos:e.todos,"pending-question":fe.value,"question-busy-kind":we.value,"pending-approval":ge.value,"approval-busy":Q.value,mobile:e.mobile,onToggleDockPanel:Ae[34]||(Ae[34]=Ke=>U(Ke)),onCloseDockPanel:Ae[35]||(Ae[35]=Ke=>z()),onOpenAgent:Ae[36]||(Ae[36]=Ke=>i("openAgent",Ke)),"open-file":Ke=>i("openFile",Ke),onAnswer:Zi,onDismiss:Ae[37]||(Ae[37]=Ke=>i("dismiss",Ke)),onApproval:tl,onCancelTask:Ae[38]||(Ae[38]=Ke=>i("cancelTask",Ke)),onControlGoal:Ae[39]||(Ae[39]=Ke=>i("controlGoal",Ke)),onSubmit:Js,onSteer:Ae[40]||(Ae[40]=Ke=>i("steer",Ke)),onCommand:Ae[41]||(Ae[41]=Ke=>i("command",Ke)),onInterrupt:Fc,onSetPermission:Ae[42]||(Ae[42]=Ke=>i("setPermission",Ke)),onSetThinking:Ae[43]||(Ae[43]=Ke=>i("setThinking",Ke)),onTogglePlan:Ae[44]||(Ae[44]=Ke=>i("togglePlan")),onToggleSwarm:Ae[45]||(Ae[45]=Ke=>i("toggleSwarm")),onToggleGoal:Ae[46]||(Ae[46]=Ke=>i("toggleGoal")),onOpenBtw:Ae[47]||(Ae[47]=Ke=>i("command",{cmd:"/btw",attachments:[]})),onCreateGoal:Ae[48]||(Ae[48]=Ke=>i("createGoal",Ke)),onFocusGoal:W,onCompact:Ae[49]||(Ae[49]=Ke=>i("compact")),onPickModel:Ae[50]||(Ae[50]=Ke=>i("pickModel")),onSelectModel:Ae[51]||(Ae[51]=Ke=>i("selectModel",Ke)),onLogin:Ae[52]||(Ae[52]=Ke=>i("login"))},null,8,["style","session-id","running","working","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","goal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile","open-file"]))],4),ze.value?(y(),he(s$e,{key:2,ref_key:"transcriptSearchRef",ref:_e,pane:te.value,mobile:e.mobile,reveal:Oo,onClose:Fe},null,8,["pane","mobile"])):ee("",!0),j(as,{name:"pill"},{default:me(()=>[en.value?(y(),M("button",{key:0,class:"newmsg-pill",style:Zt({bottom:`${Se.value+12}px`}),"aria-label":p(o)("conversation.jumpToLatestAria"),onClick:Ae[53]||(Ae[53]=Ke=>xs(!0))},[j(p(Te),{class:"pill-chevron",name:"arrow-down",size:"sm"}),qe(" "+N(p(o)("conversation.newMessages")),1)],12,S$e)):ee("",!0)]),_:1}),j(as,{name:"undo-toast"},{default:me(()=>[$e.value?(y(),M("div",A$e,[C("span",M$e,N(p(o)("conversation.undone")),1)])):ee("",!0)]),_:1})],2))}}),R$e=ft(F$e,[["__scopeId","data-v-2ddf1d39"]]),O$e={key:0,class:"fp-empty fp-error"},P$e={key:1,class:"fp-empty"},D$e={key:2,class:"fp-loading"},B$e={class:"fp-path"},H$e={class:"fp-meta"},z$e={key:0,class:"fp-lines"},W$e={class:"fp-size"},U$e={key:3,class:"fp-search"},j$e=["placeholder"],V$e={key:0,class:"fp-search-count"},q$e=["href","aria-label"],K$e={key:1,class:"fp-code"},Z$e={key:1,class:"fp-body fp-code"},G$e={key:2,class:"fp-body"},Y$e=["srcdoc","title"],X$e={key:1,class:"fp-code"},J$e={key:3,class:"fp-body fp-pdf-wrap"},Q$e=["src","title"],eNe={key:1,class:"fp-binary-card"},tNe={class:"fp-binary-label"},nNe={key:4,class:"fp-body fp-table-wrap"},oNe={class:"fp-table"},sNe=["data-line"],iNe={key:5,class:"fp-body fp-image-wrap"},rNe=["src","alt"],lNe={key:1,class:"fp-binary-card"},aNe={class:"fp-binary-icon"},uNe={class:"fp-binary-label"},cNe={key:6,class:"fp-body fp-code"},dNe={key:7,class:"fp-body fp-binary-wrap"},fNe={class:"fp-binary-card"},pNe={class:"fp-binary-icon"},hNe={class:"fp-binary-label"},mNe=et({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=Nt();function o(de,pe){const ve=pe.startsWith("/"),oe=pe.split("/").filter(Boolean);for(const ye of de.split("/"))ye===""||ye==="."||(ye===".."?oe.pop():oe.push(ye));return(ve?"/":"")+oe.join("/")}const s=nn("resolveImage",async de=>de),i=R(()=>{const de=u.file?.path??"",pe=de.lastIndexOf("/");return pe>0?de.slice(0,pe):""});function r(de){if(/^(https?:|data:|blob:)/i.test(de)||de.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(de)||de.startsWith("\\\\"))return de;const pe=i.value;return pe?o(de,pe):de}async function l(de){const pe=r(de);return s?s(pe):pe}Ln("resolveImage",l);function a(de){let pe=de.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(pe)||pe.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(pe)||pe.startsWith("\\\\"))return de;for(const oe of["#","?"]){const ye=pe.indexOf(oe);ye!==-1&&(pe=pe.slice(0,ye))}const ve=i.value;return{...de,path:o(pe,ve)}}const u=e,c=t;function d(de){u.openFile?.(a(de))}const f=Z(null),h=R(()=>{const de=u.file;if(!de)return"binary";const pe=de.mime??"",ve=de.languageId??"",oe=de.path.toLowerCase();return pe==="text/markdown"||ve==="markdown"||ve==="md"||oe.endsWith(".mdx")?"markdown":pe==="application/json"||ve==="json"?"json":pe==="text/html"||ve==="html"||oe.endsWith(".html")||oe.endsWith(".htm")?"html":pe==="application/pdf"||oe.endsWith(".pdf")?"pdf":pe==="text/csv"||ve==="csv"||oe.endsWith(".csv")?"csv":pe.startsWith("image/")?"image":de.isBinary?"binary":pe.startsWith("text/")||ve!==""?"text":"binary"});function m(de){const pe=atob(de),ve=Uint8Array.from(pe,oe=>oe.charCodeAt(0));return new TextDecoder().decode(ve)}const v=R(()=>{const de=u.file;if(!de)return"";if(de.encoding==="base64")try{return m(de.content)}catch{return de.content}return de.content}),k=R(()=>{if(h.value!=="json"||!u.file)return"";try{return JSON.stringify(JSON.parse(v.value),null,2)}catch{return v.value}}),w=R(()=>u.file?(h.value==="json"?k.value:v.value).split(`
636
636
  `):[]),b=R(()=>u.file?h.value==="json"?k.value:v.value:""),_=R(()=>w.value.map((de,pe)=>pe+1)),g=R(()=>u.file&&b.value.length<=f3?u.file.path:void 0),x=Z(""),S=Z(0),T=R(()=>{const de=x.value.trim().toLowerCase();if(!de)return[];const pe=[];return w.value.forEach((ve,oe)=>{ve.toLowerCase().includes(de)&&pe.push(oe+1)}),pe});Je(x,()=>{S.value=0});function A(de,pe=!1){de&&yt(()=>{const ve=f.value?.querySelector(".fp-body"),oe=ve?.querySelector(`[data-line="${de}"]`);if(!ve||!oe)return;pe&&(ve.scrollTop=0);const ye=ve.getBoundingClientRect(),G=oe.getBoundingClientRect(),Y=G.top-ye.top+ve.scrollTop;ve.scrollTop=Y-ve.clientHeight/2+G.height/2})}Je(()=>[u.file?.path,u.line],()=>A(u.line,!0),{immediate:!0});function E(de){const pe=T.value;pe.length!==0&&(S.value=(S.value+de+pe.length)%pe.length,A(pe[S.value]))}function P(de){const pe=T.value;return{target:u.line===de,hit:pe.includes(de),active:pe[S.value]===de}}function D(de){return de<1024?`${de} B`:de<1024*1024?`${(de/1024).toFixed(1)} KB`:`${(de/(1024*1024)).toFixed(1)} MB`}const I=Z(!1),$=Z(!1);function B(){u.file&&Zs(b.value).then(de=>{de&&(I.value=!0,setTimeout(()=>{I.value=!1},1400))})}function H(){u.file&&Zs(u.file.path).then(de=>{de&&($.value=!0,setTimeout(()=>{$.value=!1},1400))})}const O=Z("preview"),F=Z("preview"),U=Z("fit");function z(de){O.value=de}function W(de){F.value=de}function K(de){U.value=de}Je(h,de=>{O.value=de==="html"?"preview":"source",F.value="preview",U.value="fit"});const V=R(()=>{const de=u.file;return!de||h.value!=="image"?null:de.encoding==="base64"?`data:${de.mime};base64,${de.content}`:de.mime==="image/svg+xml"?`data:${de.mime};charset=utf-8,${encodeURIComponent(de.content)}`:null}),ie=R(()=>{const de=u.file;return!de||h.value!=="pdf"?null:u.downloadUrl?u.downloadUrl:de.encoding==="base64"?`data:${de.mime};base64,${de.content}`:null}),ne=R(()=>u.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,v.value].join(""):"");function X(de){const pe=[];let ve="",oe=!1;for(let ye=0;ye<de.length;ye++){const G=de[ye];G==='"'&&de[ye+1]==='"'?(ve+='"',ye++):G==='"'?oe=!oe:G===","&&!oe?(pe.push(ve),ve=""):ve+=G}return pe.push(ve),pe}const le=R(()=>w.value.slice(0,200).map(X));function Ie(de,pe=55){return!de||de.length<=pe?de:"…"+de.slice(de.length-pe+1)}return(de,pe)=>(y(),M("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(y(),M("div",O$e,[C("span",null,N(e.error),1),e.closable?(y(),he(p(Rt),{key:0,variant:"secondary",size:"sm",onClick:pe[0]||(pe[0]=ve=>c("close"))},{default:me(()=>[qe(N(p(n)("filePreview.close")),1)]),_:1})):ee("",!0)])):!e.file&&!e.loading?(y(),M("div",P$e,N(p(n)("filePreview.empty")),1)):e.loading?(y(),M("div",D$e,[pe[7]||(pe[7]=C("span",{class:"spinner"},null,-1)),C("span",null,N(p(n)("filePreview.loading")),1)])):e.file?(y(),M(Pe,{key:3},[j(p(pc),{wrap:"",title:p(n)("common.preview"),closable:e.closable,"close-label":p(n)("filePreview.close"),onClose:pe[6]||(pe[6]=ve=>c("close"))},{default:me(()=>[j(p(pn),{text:e.file.path},{default:me(()=>[C("span",B$e,N(Ie(e.file.path)),1)]),_:1},8,["text"]),C("span",H$e,[e.file.lineCount?(y(),M("span",z$e,N(p(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ee("",!0),C("span",W$e,N(D(e.file.size)),1)]),h.value==="html"?(y(),he(p(wi),{key:0,"model-value":O.value,size:"sm",options:[{value:"preview",label:p(n)("filePreview.preview")},{value:"source",label:p(n)("filePreview.source")}],"onUpdate:modelValue":z},null,8,["model-value","options"])):ee("",!0),h.value==="markdown"?(y(),he(p(wi),{key:1,"model-value":F.value,size:"sm",options:[{value:"preview",label:p(n)("filePreview.preview")},{value:"source",label:p(n)("filePreview.source")}],"onUpdate:modelValue":W},null,8,["model-value","options"])):ee("",!0),h.value==="image"?(y(),he(p(wi),{key:2,"model-value":U.value,size:"sm",options:[{value:"fit",label:p(n)("filePreview.fit")},{value:"actual",label:p(n)("filePreview.actual")}],"onUpdate:modelValue":K},null,8,["model-value","options"])):ee("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(y(),M("div",U$e,[Bn(C("input",{"onUpdate:modelValue":pe[1]||(pe[1]=ve=>x.value=ve),class:"fp-search-input",type:"search",placeholder:p(n)("filePreview.search")},null,8,j$e),[[ai,x.value]]),x.value.trim()?(y(),M("span",V$e,N(T.value.length),1)):ee("",!0),j(p(gn),{size:"sm",disabled:T.value.length===0,label:p(n)("filePreview.prevMatch"),tooltip:p(n)("filePreview.prevMatch"),onClick:pe[2]||(pe[2]=ve=>E(-1))},{default:me(()=>[j(p(Te),{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label","tooltip"]),j(p(gn),{size:"sm",disabled:T.value.length===0,label:p(n)("filePreview.nextMatch"),tooltip:p(n)("filePreview.nextMatch"),onClick:pe[3]||(pe[3]=ve=>E(1))},{default:me(()=>[j(p(Te),{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label","tooltip"])])):ee("",!0),j(p(gn),{size:"sm",class:Re({copied:$.value}),label:$.value?p(n)("filePreview.copied"):p(n)("filePreview.copyPath"),tooltip:$.value?p(n)("filePreview.copied"):p(n)("filePreview.copyPath"),onClick:H},{default:me(()=>[$.value?(y(),he(p(Te),{key:1,class:"fp-check",name:"check",size:"md"})):(y(),he(p(Te),{key:0,name:"link",size:"md"}))]),_:1},8,["class","label","tooltip"]),e.externalActions?(y(),he(p(gn),{key:4,size:"sm",label:p(n)("filePreview.openInEditor"),tooltip:p(n)("filePreview.openInEditor"),onClick:pe[4]||(pe[4]=ve=>c("openExternal"))},{default:me(()=>[j(p(Te),{name:"external-link",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),e.externalActions?(y(),he(p(gn),{key:5,size:"sm",label:p(n)("filePreview.reveal"),tooltip:p(n)("filePreview.reveal"),onClick:pe[5]||(pe[5]=ve=>c("reveal"))},{default:me(()=>[j(p(Te),{name:"folder",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),e.downloadUrl?(y(),he(p(pn),{key:6,text:p(n)("filePreview.download")},{default:me(()=>[C("a",{class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":p(n)("filePreview.download")},[j(p(Te),{name:"download",size:"md"})],8,q$e)]),_:1},8,["text"])):ee("",!0),!e.file.isBinary&&h.value!=="image"?(y(),he(p(gn),{key:7,size:"sm",class:Re({copied:I.value}),label:I.value?p(n)("filePreview.copied"):p(n)("filePreview.copy"),tooltip:I.value?p(n)("filePreview.copied"):p(n)("filePreview.copy"),onClick:B},{default:me(()=>[I.value?(y(),he(p(Te),{key:1,class:"fp-check",name:"check",size:"md"})):(y(),he(p(Te),{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label","tooltip"])):ee("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(y(),M("div",{key:0,class:Re(["fp-body",{"fp-markdown":F.value==="preview"}])},[F.value==="preview"?(y(),he(p(Ic),{key:0,text:v.value,"open-file":u.openFile?d:void 0},null,8,["text","open-file"])):(y(),M("div",K$e,[j(Ur,{code:w.value,path:g.value,"line-numbers":_.value,framed:!1,"line-class":P},null,8,["code","path","line-numbers"])]))],2)):h.value==="json"?(y(),M("div",Z$e,[j(Ur,{code:w.value,path:g.value,"line-numbers":_.value,framed:!1,"line-class":P},null,8,["code","path","line-numbers"])])):h.value==="html"?(y(),M("div",G$e,[O.value==="preview"?(y(),M("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ne.value,title:e.file.path},null,8,Y$e)):(y(),M("div",X$e,[j(Ur,{code:w.value,path:g.value,"line-numbers":_.value,framed:!1,"line-class":P},null,8,["code","path","line-numbers"])]))])):h.value==="pdf"?(y(),M("div",J$e,[ie.value?(y(),M("iframe",{key:0,class:"fp-pdf-frame",src:ie.value,title:e.file.path},null,8,Q$e)):(y(),M("div",eNe,[C("span",tNe,N(p(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(y(),M("div",nNe,[C("table",oNe,[C("tbody",null,[(y(!0),M(Pe,null,pt(le.value,(ve,oe)=>(y(),M("tr",{key:oe,class:Re(P(oe+1)),"data-line":oe+1},[C("th",null,N(oe+1),1),(y(!0),M(Pe,null,pt(ve,(ye,G)=>(y(),M("td",{key:G},N(ye),1))),128))],10,sNe))),128))])])])):h.value==="image"?(y(),M("div",iNe,[V.value?(y(),M("img",{key:0,src:V.value,alt:e.file.path,class:Re(["fp-image",{actual:U.value==="actual"}])},null,10,rNe)):(y(),M("div",lNe,[C("span",aNe,[j(p(Te),{name:"image-off",size:"lg"})]),C("span",uNe,N(p(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:D(e.file.size)})),1)]))])):h.value==="text"?(y(),M("div",cNe,[j(Ur,{code:w.value,path:g.value,"line-numbers":_.value,framed:!1,"line-class":P},null,8,["code","path","line-numbers"])])):(y(),M("div",dNe,[C("div",fNe,[C("span",pNe,[j(p(Te),{name:"file-off",size:"lg"})]),C("span",hNe,N(p(n)("filePreview.binaryNoPreview",{mime:e.file.mime||p(n)("filePreview.unknownType"),size:D(e.file.size)})),1)])]))],64)):ee("",!0)],512))}}),gNe=ft(mNe,[["__scopeId","data-v-4c55a361"]]),vNe={class:"tp"},yNe=et({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=Z(null);return Je(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||yt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(y(),M("div",vNe,[j(p(pc),{title:p(s)("common.preview"),subtitle:e.subtitle??p(s)("thinking.panelTitle"),"close-label":p(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),C("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},N(e.text),513)]))}}),kNe=ft(yNe,[["__scopeId","data-v-afb1f46f"]]),bNe={class:"agent-panel"},CNe={key:0,class:"agent-fallback"},wNe={key:0,class:"agent-error"},_Ne=et({__name:"AgentDetailPanel",props:{member:{},turns:{},running:{type:Boolean},loading:{type:Boolean},loadError:{type:Boolean},hasMore:{type:Boolean},loadingMore:{type:Boolean},loadMoreError:{type:Boolean}},emits:["close","loadOlderMessages","openAgent","openFile","openMedia","openTurnDiff"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=R(()=>n.member.id),{scroller:r,following:l,onScroll:a,pinScroll:u}=_he(i),c=Z(!1);let d=null,f=null;function h(){d!==null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(d),f!==null&&clearTimeout(f),d=null,f=null}Je(i,()=>{c.value=!1,h();const _=()=>{h(),c.value=!0};typeof requestAnimationFrame=="function"?d=requestAnimationFrame(()=>{d=requestAnimationFrame(_)}):f=setTimeout(_,32)},{immediate:!0}),Vn(h);const m=R(()=>{const _=new Set,g=[];for(const x of[n.member.suspendedReason,n.member.text,n.member.outputLines?.join(`
637
- `),n.member.summary]){const S=x?.trim();!S||_.has(S)||(_.add(S),g.push(S))}return g});Ln("pinScroll",()=>{r.value&&u()});function v(_){switch(_){case"queued":return s("tools.swarm.phaseQueued");case"working":return s("tools.swarm.phaseWorking");case"suspended":return s("tools.swarm.phaseSuspended");case"completed":return s("tools.swarm.phaseCompleted");case"failed":return s("tools.swarm.phaseFailed")}}const k=nn("modelDisplay"),w=nn("subagentEffort"),b=R(()=>{const _=[n.member.subagentType,k?.(n.member.model),w?.(n.member.thinkingEffort)].filter(g=>!!g);return _.length>0?_.join(" · "):void 0});return(_,g)=>(y(),M("div",bNe,[j(p(pc),{title:e.member.name,subtitle:b.value,"close-label":p(s)("thinking.close"),onClose:g[0]||(g[0]=x=>o("close"))},{default:me(()=>[j(p(Vr),{variant:"neutral",size:"sm"},{default:me(()=>[qe(N(v(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),C("div",{ref_key:"scroller",ref:r,class:"agent-transcript",onScrollPassive:g[6]||(g[6]=(...x)=>p(a)&&p(a)(...x))},[c.value?(y(),M(Pe,{key:0},[e.turns.length===0&&!e.loading&&(e.loadError||m.value.length>0)?(y(),M("div",CNe,[e.loadError?(y(),M("div",wNe,N(p(s)("tasks.transcriptLoadError")),1)):ee("",!0),m.value.length>0?(y(),he(dr,{key:1,lines:m.value},null,8,["lines"])):ee("",!0)])):(y(),he(e6,{key:1,turns:e.turns,"turn-active":e.running,"session-loading":e.loading&&e.turns.length===0,"has-more-messages":e.hasMore,"loading-more":e.loadingMore,"loading-more-error":e.loadMoreError,"is-following":p(l),"read-only":"",onLoadOlderMessages:g[1]||(g[1]=x=>o("loadOlderMessages")),onOpenAgent:g[2]||(g[2]=x=>o("openAgent",x)),onOpenFile:g[3]||(g[3]=x=>o("openFile",x)),onOpenMedia:g[4]||(g[4]=x=>o("openMedia",x)),onOpenTurnDiff:g[5]||(g[5]=x=>o("openTurnDiff",x))},null,8,["turns","turn-active","session-loading","has-more-messages","loading-more","loading-more-error","is-following"]))],64)):ee("",!0)],544)]))}}),xNe=ft(_Ne,[["__scopeId","data-v-95fdb6f0"]]),SNe={class:"sc"},ANe={key:0,class:"sc-empty"},MNe={key:2,class:"sc-loading"},TNe={class:"sc-composer"},ENe=["placeholder"],INe=["disabled"],LNe=et({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close","openMedia"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=R(()=>n.turns.find(x=>x.role==="user")?.text?.trim()??""),r=R(()=>n.title?.trim()||s("sideChat.title")),l=R(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=Z(""),u=Z(null),c=Z(null);function d(){const g=a.value.trim();g&&(o("send",g),a.value="",yt(()=>{u.value&&(u.value.style.height="auto"),f()}))}function f(){const g=c.value;g&&(g.scrollTop=g.scrollHeight)}Ln("pinScroll",g=>{const x=c.value;if(!x)return;const S=g.getBoundingClientRect().top;requestAnimationFrame(()=>{x.scrollTop+=g.getBoundingClientRect().top-S})});const h=R(()=>{const g=n.turns;if(g.length===0)return"0";const x=g.at(-1),S=x.thinking?.length??0,T=x.tools?.reduce((A,E)=>A+E.name.length+(E.arg?.length??0)+(E.output?.join("").length??0),0)??0;return`${g.length}:${x.text.length}:${S}:${T}`});Je(h,async()=>{!n.running&&!n.sending||(await yt(),f())});const m=R(()=>n.sending?n.turns.at(-1)?.role==="user":!1),{handleCompositionStart:v,handleCompositionEnd:k,isComposingKeyEvent:w}=Ar();function b(g){g.key==="Enter"&&!g.shiftKey&&!w(g)&&(g.preventDefault(),d())}function _(){const g=u.value;g&&(g.style.height="auto",g.style.height=`${Math.min(g.scrollHeight,160)}px`)}return(g,x)=>(y(),M("div",SNe,[j(p(pc),{title:r.value,subtitle:l.value,"close-label":p(s)("thinking.close"),onClose:x[0]||(x[0]=S=>o("close"))},null,8,["title","subtitle","close-label"]),C("div",{ref_key:"bodyRef",ref:c,class:"sc-body"},[e.turns.length===0?(y(),M("div",ANe,N(p(s)("sideChat.empty")),1)):(y(),he(e6,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running,"turn-files-interactive":!1,onOpenMedia:x[1]||(x[1]=S=>o("openMedia",S))},null,8,["turns","turn-active","working"])),m.value?(y(),M("div",MNe,[j(aF,{label:p(s)("conversation.requesting")},null,8,["label"])])):ee("",!0)],512),C("div",TNe,[Bn(C("textarea",{ref_key:"inputRef",ref:u,"onUpdate:modelValue":x[2]||(x[2]=S=>a.value=S),class:"sc-input",rows:"1",placeholder:p(s)("sideChat.placeholder"),onInput:_,onKeydown:b,onCompositionstart:x[3]||(x[3]=(...S)=>p(v)&&p(v)(...S)),onCompositionend:x[4]||(x[4]=(...S)=>p(k)&&p(k)(...S))},null,40,ENe),[[ai,a.value]]),j(p(pn),{text:p(s)("sideChat.send")},{default:me(()=>[C("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[j(p(Te),{name:"arrow-right",size:"sm"})],8,INe)]),_:1},8,["text"])])]))}}),$Ne=ft(LNe,[["__scopeId","data-v-753d11f0"]]),NNe={class:"changes-pane"},FNe={class:"dv-path"},RNe={class:"diff-head"},ONe={class:"back-label"},PNe={key:"loading",class:"empty-state diff-loading"},DNe={key:"lines",class:"dv-lines-wrap"},BNe={key:"empty",class:"empty-state"},HNe={class:"dv-change-count"},zNe={class:"ch-head"},WNe={class:"br-heading"},UNe={class:"br-label"},jNe={class:"br-name"},VNe={key:0,class:"sync-info"},qNe={key:0,class:"ahead"},KNe={key:0,class:"behind"},ZNe={key:1,class:"empty-head"},GNe={class:"ch-list-content"},YNe=["onClick"],XNe={class:"fpath"},JNe=["onClick"],QNe={class:"tree-name"},eFe=["onClick"],tFe={class:"tree-name"},nFe={key:2,class:"empty-state"},oFe={class:"empty-state-icon","aria-hidden":"true"},sFe={key:3,class:"empty-state"},iFe=et({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},fullTexts:{},emptyFile:{type:Boolean},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Nt();function o($){return n($===1?"diff.fileCountOne":"diff.fileCountOther",{number:$})}const s=e,i=t;function r($){const B=$.toLowerCase();return B==="modified"?"modified":B==="added"?"added":B==="deleted"?"deleted":B==="renamed"?"renamed":B==="untracked"?"untracked":B==="conflicted"?"conflicted":B==="ignored"?"ignored":B==="clean"?"clean":"unknown"}const l={modified:"M",added:"+",deleted:"−",renamed:"→",untracked:"+",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function a($){return l[r($)]??"?"}function u($,B=60){return $.length<=B?$:"…"+$.slice($.length-B+1)}const c=R(()=>s.gitInfo!==null),d=R(()=>s.changes.length>0),f=R(()=>(s.selectedDiffPath??null)!==null),h=R(()=>s.mode==="detail"||s.mode==="full"&&f.value),m=R(()=>s.fileDiff??[]),v=R(()=>s.fileDiffLoading===!0);function k($){i("open",$)}function w(){i("back")}function b(){i("close")}const _=Z("list");function g($){_.value=$}function x($){const B={children:[]},H=[...$].sort((O,F)=>O.path.localeCompare(F.path));for(const O of H){const F=O.path.endsWith("/"),U=O.path.split("/").filter(Boolean);if(U.length===0)continue;let z=B;for(let W=0;W<U.length;W++){const K=U[W],V=W===U.length-1&&!F,ie=U.slice(0,W+1).join("/");let ne=z.children.find(X=>X.name===K&&X.kind===(V?"file":"folder"));ne||(ne={name:K,path:ie,kind:V?"file":"folder",status:V?O.status:void 0,children:[]},z.children.push(ne)),z=ne}}return B.children}const S=R(()=>x(s.changes)),T=Z(new Set);function A($){return!T.value.has($)}const E=R(()=>{const $=[];function B(H,O){for(const F of H)$.push({node:F,depth:O}),F.kind==="folder"&&A(F.path)&&B(F.children,O+1)}return B(S.value,0),$});function P($){const B=new Set(T.value);B.has($.path)?B.delete($.path):B.add($.path),T.value=B}function D($){return`calc(var(--tree-base-indent) + ${$} * var(--tree-indent-step))`}function I($){return{paddingLeft:D($),"--tree-depth":String($)}}return($,B)=>(y(),M("div",NNe,[h.value?(y(),M(Pe,{key:0},[j(p(pc),{title:p(n)("diff.title"),closable:e.closable,"close-label":p(n)("diff.close"),onClose:b},{default:me(()=>[j(p(pn),{text:e.selectedDiffPath??""},{default:me(()=>[C("span",FNe,N(u(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),C("div",RNe,[e.hideBack?ee("",!0):(y(),he(p(Rt),{key:0,variant:"ghost",size:"sm",onClick:w},{default:me(()=>[j(p(Te),{name:"arrow-left",size:"sm"}),C("span",ONe,N(p(n)("diff.back")),1)]),_:1}))]),j(as,{name:"diff-content",mode:"out-in"},{default:me(()=>[v.value?(y(),M("div",PNe,[j(p(Ao),{size:"md"}),C("span",null,N(p(n)("diff.loading")),1)])):m.value.length>0?(y(),M("div",DNe,[j(Ur,{lines:m.value,path:e.selectedDiffPath??void 0,"line-numbers":"",framed:!1,"full-texts":e.fullTexts??null},null,8,["lines","path","full-texts"])])):(y(),M("div",BNe,N(e.emptyFile?p(n)("diff.emptyFile"):p(n)("diff.noDiff")),1))]),_:1})],64)):(y(),M(Pe,{key:1},[j(p(pc),{title:p(n)("diff.title"),closable:e.closable,"close-label":p(n)("diff.close"),onClose:b},{default:me(()=>[C("span",HNe,N(o(e.changes.length)),1),j(p(wi),{"model-value":_.value,size:"sm",options:[{value:"list",label:p(n)("diff.list"),icon:"list"},{value:"tree",label:p(n)("diff.tree"),icon:"tree-view"}],"onUpdate:modelValue":g},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),C("div",zNe,[c.value?(y(),M(Pe,{key:0},[C("span",WNe,[j(p(Te),{class:"br-icon",name:"git-fork",size:"sm"}),C("span",UNe,N(p(n)("diff.branch")),1)]),C("span",jNe,N(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(y(),M("span",VNe,[j(p(pn),{text:p(n)("diff.aheadTitle")},{default:me(()=>[e.gitInfo.ahead>0?(y(),M("span",qNe,"↑"+N(e.gitInfo.ahead),1)):ee("",!0)]),_:1},8,["text"]),j(p(pn),{text:p(n)("diff.behindTitle")},{default:me(()=>[e.gitInfo.behind>0?(y(),M("span",KNe,"↓"+N(e.gitInfo.behind),1)):ee("",!0)]),_:1},8,["text"])])):ee("",!0)],64)):(y(),M("span",ZNe,N(p(n)("diff.empty")),1))]),d.value&&_.value==="list"?(y(),he(p(Pk),{key:0,class:"ch-list"},{default:me(()=>[C("div",GNe,[(y(!0),M(Pe,null,pt(e.changes,H=>(y(),he(p(pn),{key:H.path,text:H.path},{default:me(()=>[C("button",{type:"button",class:"ch-row",onClick:O=>k(H.path)},[C("span",{class:Re(["badge",r(H.status)])},N(a(H.status)),3),C("span",XNe,N(u(H.path)),1)],8,YNe)]),_:2},1032,["text"]))),128))])]),_:1})):d.value&&_.value==="tree"?(y(),he(p(Pk),{key:1,class:"ch-list ch-tree"},{default:me(()=>[j(YA,{name:"tree-collapse",tag:"ul",class:"tree-list ch-list-content"},{default:me(()=>[(y(!0),M(Pe,null,pt(E.value,({node:H,depth:O})=>(y(),M("li",{key:H.path,class:"tree-node"},[H.kind==="folder"?(y(),M("button",{key:0,type:"button",class:"tree-row tree-folder",style:Zt(I(O)),onClick:F=>P(H)},[j(p(Te),{class:"tree-icon",name:"folder-solid",size:"sm"}),C("span",QNe,N(H.name),1)],12,JNe)):(y(),he(p(pn),{key:1,text:H.path},{default:me(()=>[C("button",{type:"button",class:"tree-row tree-file",style:Zt(I(O)),onClick:F=>k(H.path)},[C("span",{class:Re(["badge",r(H.status)])},N(a(H.status)),3),C("span",tFe,N(H.name),1)],12,eFe)]),_:2},1032,["text"]))]))),128))]),_:1})]),_:1})):c.value?(y(),M("div",nFe,[C("span",oFe,[j(p(Te),{name:"check",size:"lg"})]),qe(" "+N(p(n)("diff.clean")),1)])):(y(),M("div",sFe,N(p(n)("diff.empty")),1))],64))]))}}),rFe=ft(iFe,[["__scopeId","data-v-7d5ab9c7"]]),lFe={class:"td"},aFe={class:"td-path"},uFe={class:"td-body"},cFe={key:1,class:"td-empty"},dFe=et({__name:"TurnDiffPanel",props:{change:{},cwd:{},closable:{type:Boolean}},emits:["close","openFile"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=R(()=>{const a=n.cwd?h2(n.change.path,n.cwd):null;return r(a??n.change.path)});function r(a,u=48){return!a||a.length<=u?a:"…"+a.slice(a.length-u+1)}const l=R(()=>n.change.diff!==null&&n.change.diff.length>0);return(a,u)=>(y(),M("div",lFe,[j(p(pc),{title:p(s)("conversation.turnFiles.diffTitle"),closable:e.closable,"close-label":p(s)("filePreview.close"),onClose:u[1]||(u[1]=c=>o("close"))},{default:me(()=>[j(p(pn),{text:e.change.path},{default:me(()=>[C("span",aFe,N(i.value),1)]),_:1},8,["text"]),j(p(gn),{size:"sm",label:p(s)("conversation.turnFiles.openFile"),tooltip:p(s)("conversation.turnFiles.openFile"),onClick:u[0]||(u[0]=c=>o("openFile",e.change.path))},{default:me(()=>[j(p(Te),{name:"external-link",size:"md"})]),_:1},8,["label","tooltip"])]),_:1},8,["title","closable","close-label"]),C("div",uFe,[l.value?(y(),he(Ur,{key:0,lines:e.change.diff,path:e.change.path,framed:!1},null,8,["lines","path"])):(y(),M("div",cFe,[C("p",null,N(p(s)("conversation.turnFiles.diffUnavailable")),1),j(p(Rt),{variant:"ghost",size:"sm",onClick:u[2]||(u[2]=c=>o("openFile",e.change.path))},{default:me(()=>[qe(N(p(s)("conversation.turnFiles.openFile")),1)]),_:1})]))])]))}}),fFe=ft(dFe,[["__scopeId","data-v-fdd0bc05"]]);function gF(e,t){let n=null;dn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,yt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),Vn(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const pFe={class:"search-wrap"},hFe=["aria-label"],mFe=["aria-label"],gFe=["aria-pressed","onClick"],vFe={key:1,class:"state-row"},yFe={key:2,class:"state-row unavail"},kFe=["aria-label"],bFe=["aria-selected","onClick","onMouseenter"],CFe={class:"model-main"},wFe={class:"model-name"},_Fe={class:"model-meta"},xFe={class:"model-side"},SFe={key:0,class:"empty"},AFe={class:"footer-hint","aria-hidden":"true"},MFe=et({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=R(()=>new Set(o.starredIds??[]));function r(D){return i.value.has(D)}const l=Z(""),a=Z(null),u=Z(null),c=Z(null),d=Z("all"),f={image_in:"model.capabilityImageInput",video_in:"model.capabilityVideoInput",tool_use:"model.capabilityToolUse",thinking:"model.capabilityThinking",always_thinking:"model.capabilityAlwaysThinking"};function h(D){const I=f[D];return I?n(I):D.replaceAll("_"," ")}function m(D){const I=[D.provider,n("model.contextSuffix",{size:Al(D.maxContextSize)})];for(const $ of D.capabilities??[])I.push(h($));return I.join(" · ")}gF(u,a);const v=R(()=>{const D=new Set,I=[{id:"all",label:n("model.allTab")}];for(const $ of o.models)D.has($.provider)||(D.add($.provider),I.push({id:$.provider,label:$.provider}));return I}),k=R(()=>{const D=l.value.toLowerCase().trim(),I=o.models.filter($=>{if(d.value!=="all"&&$.provider!==d.value)return!1;const B=($.displayName??$.model).toLowerCase().includes(D),H=$.provider.toLowerCase().includes(D),O=$.id.toLowerCase().includes(D);return!D||B||H||O});return d.value!=="all"?I:I.sort(($,B)=>{const H=r($.id)?1:0;return(r(B.id)?1:0)-H})}),w=R(()=>k.value),b=Z(0);Je([l,d],()=>{b.value=0}),Je(v,D=>{D.some(I=>I.id===d.value)||(d.value="all")}),Je(w,D=>{b.value=Math.min(b.value,Math.max(D.length-1,0))}),Je(b,async()=>{await yt(),c.value?.querySelector(".model-row.is-selected")?.scrollIntoView({block:"nearest"})});const{handleCompositionStart:_,handleCompositionEnd:g,isComposingKeyEvent:x}=Ar();function S(D){if(!x(D)){if(D.key==="Escape"){s("close");return}if(D.key==="ArrowDown")D.preventDefault(),b.value=Math.min(b.value+1,w.value.length-1);else if(D.key==="ArrowUp")D.preventDefault(),b.value=Math.max(b.value-1,0);else if(D.key==="Enter"){const I=w.value[b.value];I&&s("select",I.id)}}}dn(()=>{document.addEventListener("keydown",S)}),bn(()=>{document.removeEventListener("keydown",S)});function T(D){s("select",D)}function A(){l.value="",a.value?.focus()}function E(D){return w.value.indexOf(D)}function P(D){d.value=D}return(D,I)=>(y(),he(p(ua),{open:!0,"close-on-esc":!1,title:p(n)("model.title"),size:"lg",height:"fixed",padded:!1,onClose:I[1]||(I[1]=$=>s("close"))},{default:me(()=>[C("div",{ref_key:"dialogRef",ref:u,class:"mp"},[C("div",pFe,[j(p(js),{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=$=>l.value=$),placeholder:p(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:"",onCompositionstart:p(_),onCompositionend:p(g)},null,8,["modelValue","placeholder","onCompositionstart","onCompositionend"]),j(p(pn),{text:p(n)("model.clearSearch")},{default:me(()=>[C("button",{type:"button",class:Re(["search-clear",{"is-on":l.value.length>0}]),tabindex:"-1","aria-label":p(n)("model.clearSearch"),onClick:A},[j(p(Te),{name:"close",size:"sm"})],10,hFe)]),_:1},8,["text"])]),v.value.length>1?(y(),M("div",{key:0,class:"chip-strip","aria-label":p(n)("model.providerTabs")},[(y(!0),M(Pe,null,pt(v.value,$=>(y(),M("button",{key:$.id,type:"button",class:Re(["chip",{"is-active":$.id===d.value}]),"aria-pressed":$.id===d.value,onClick:B=>P($.id)},N($.label),11,gFe))),128))],8,mFe)):ee("",!0),e.loading?(y(),M("div",vFe,[j(p(Ao),{size:"sm"}),C("span",null,N(p(n)("model.loading")),1)])):e.unavailable?(y(),M("div",yFe,[j(p(Te),{name:"alert-triangle",size:"lg"}),C("span",null,N(p(n)("model.unavailable")),1)])):(y(),M("div",{key:3,ref_key:"listRef",ref:c,class:"model-list",role:"listbox","aria-label":p(n)("model.title")},[(y(!0),M(Pe,null,pt(w.value,$=>(y(),M("div",{key:$.id,class:Re(["model-row",{"is-current":$.id===e.current,"is-selected":E($)===b.value}]),role:"option","aria-selected":$.id===e.current,onClick:B=>T($.id),onMouseenter:B=>b.value=E($)},[C("span",CFe,[C("span",wFe,N($.displayName??$.model),1),C("span",_Fe,N(m($)),1)]),C("span",xFe,[$.id===e.current?(y(),he(p(Te),{key:0,class:"model-check",name:"check",size:"sm"})):ee("",!0),j(p(gn),{class:Re(["model-star",{"is-starred":r($.id)}]),size:"sm",label:r($.id)?p(n)("model.unstarTitle"):p(n)("model.starTitle"),tooltip:r($.id)?p(n)("model.unstarTitle"):p(n)("model.starTitle"),onClick:It(B=>s("toggle-star",$.id),["stop"])},{default:me(()=>[r($.id)?(y(),he(p(Te),{key:0,name:"star",size:"md"})):(y(),he(p(Te),{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["class","label","tooltip","onClick"])])],42,bFe))),128)),w.value.length===0?(y(),M("div",SFe,N(o.models.length===0?p(n)("model.emptyNoModels"):p(n)("model.emptyNoMatch")),1)):ee("",!0)],8,kFe)),C("div",AFe,[j(p(oa),{keys:["↑","↓"]}),C("span",null,N(p(n)("model.hintNavigate")),1),I[2]||(I[2]=C("span",{class:"hint-dot"},"·",-1)),j(p(oa),{keys:["Enter"]}),C("span",null,N(p(n)("model.hintSelect")),1),I[3]||(I[3]=C("span",{class:"hint-dot"},"·",-1)),j(p(oa),{keys:["Esc"]}),C("span",null,N(p(n)("model.hintClose")),1)])],512)]),_:1},8,["title"]))}}),TFe=ft(MFe,[["__scopeId","data-v-3ba22330"]]),EFe=3;function vF(e){const t=Z("starting"),n=Z(!1),o=Z(null),s=Z(0);let i=null,r=null,l=null,a=0,u=!1,c=!1;function d(){i&&(clearTimeout(i),i=null),r&&(clearInterval(r),r=null),l&&(clearTimeout(l),l=null)}function f(w){d(),t.value="success",l=setTimeout(()=>{l=null,e.onSuccess?.()},w)}function h(){r&&clearInterval(r),r=setInterval(()=>{s.value>0?s.value--:(r&&clearInterval(r),r=null)},1e3)}function m(w){i&&clearTimeout(i),i=setTimeout(async()=>{const b=await e.onPollOAuthLogin();if(!c){if(b===null){if(a+=1,a>=EFe){d(),n.value=!0,t.value="error";return}m(w);return}a=0,b.status==="authenticated"?f(1200):b.status==="expired"||b.status==="cancelled"?(d(),t.value="expired"):m(w)}},w*1e3)}async function v(){d(),o.value=null,n.value=!1,a=0,u=!1,t.value="starting";const w=await e.onStartOAuthLogin();if(c){w!==null&&w.status!=="authenticated"&&e.onCancelOAuthLogin();return}if(!w){t.value="error";return}if(w.status==="authenticated"){f(800);return}o.value={flowId:w.flowId,verificationUri:w.verificationUri,verificationUriComplete:w.verificationUriComplete,userCode:w.userCode,expiresIn:w.expiresIn,interval:w.interval},s.value=w.expiresIn,t.value="device-code",h(),m(w.interval)}function k(){t.value!=="success"&&(d(),t.value==="device-code"&&!u&&(u=!0,e.onCancelOAuthLogin()))}return Kg()&&d1(()=>{c=!0,k()}),{step:t,pollError:n,flow:o,secondsLeft:s,startFlow:v,cancelFlow:k}}const IFe={key:0,class:"center-body"},LFe={class:"center-text"},$Fe={key:1,class:"nb"},NFe={class:"nb-lead"},FFe=["href"],RFe={class:"nb-code-row"},OFe=["title"],PFe={class:"nb-status"},DFe={class:"nb-status-text"},BFe={class:"nb-countdown"},HFe={key:2,class:"center-body"},zFe={class:"center-text success-text"},WFe={class:"center-hint"},UFe={class:"center-body"},jFe={class:"center-text err-text"},VFe={class:"center-hint"},qFe={class:"actions"},KFe={class:"center-body"},ZFe={class:"center-text warn-text"},GFe={class:"center-hint"},YFe={class:"actions"},XFe=et({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=Z(!0),s=t,i=e,{step:r,pollError:l,flow:a,secondsLeft:u,startFlow:c,cancelFlow:d}=vF({onStartOAuthLogin:i.onStartOAuthLogin,onPollOAuthLogin:i.onPollOAuthLogin,onCancelOAuthLogin:i.onCancelOAuthLogin,onSuccess:()=>{s("success"),s("close")}}),f=Z(!1);dn(async()=>{await c()});async function h(){!a.value||!await Zs(a.value.verificationUriComplete)||(f.value=!0,setTimeout(()=>{f.value=!1},2e3))}async function m(){d(),s("close")}function v(k){const w=Math.floor(k/60),b=k%60;return`${w}:${String(b).padStart(2,"0")}`}return(k,w)=>(y(),he(p(ua),{open:o.value,"onUpdate:open":w[0]||(w[0]=b=>o.value=b),title:p(n)("login.title"),"close-on-overlay":!1,onClose:m},{default:me(()=>[p(r)==="starting"?(y(),M("div",IFe,[j(p(Ao),{size:"md"}),C("span",LFe,N(p(n)("login.starting")),1)])):p(r)==="device-code"&&p(a)?(y(),M("div",$Fe,[C("div",NFe,N(p(n)("login.lead")),1),C("a",{class:"nb-primary",href:p(a).verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[qe(N(p(n)("login.authorizeInBrowser"))+" ",1),j(p(Te),{name:"external-link",size:"sm"})],8,FFe),C("div",RFe,[C("span",{class:"nb-link",title:p(a).verificationUriComplete},N(p(a).verificationUriComplete),9,OFe),j(p(Rt),{class:Re(["nb-copy",{"is-copied":f.value}]),variant:"secondary",size:"sm",onClick:h},{default:me(()=>[f.value?(y(),M(Pe,{key:0},[j(p(Te),{name:"check",size:"sm"}),qe(" "+N(p(n)("login.copied")),1)],64)):(y(),M(Pe,{key:1},[j(p(Te),{name:"copy",size:"sm"}),qe(" "+N(p(n)("login.copyLink")),1)],64))]),_:1},8,["class"])]),C("div",PFe,[j(p(Ao),{size:"sm",label:p(n)("login.waitingAuth")},null,8,["label"]),C("span",DFe,N(p(n)("login.waitingAutoClose")),1),C("span",BFe,N(v(p(u))),1)])])):p(r)==="success"?(y(),M("div",HFe,[j(p(Dd),{kind:"success"}),C("span",zFe,N(p(n)("login.success")),1),C("span",WFe,N(p(n)("login.successHint")),1)])):p(r)==="expired"?(y(),M(Pe,{key:3},[C("div",UFe,[j(p(Dd),{kind:"expired"}),C("span",jFe,N(p(n)("login.expiredTitle")),1),C("span",VFe,N(p(n)("login.expiredHint")),1)]),C("div",qFe,[j(p(Rt),{variant:"primary",onClick:p(c)},{default:me(()=>[qe(N(p(n)("login.retry")),1)]),_:1},8,["onClick"]),j(p(Rt),{variant:"secondary",onClick:m},{default:me(()=>[qe(N(p(n)("login.closeBtn")),1)]),_:1})])],64)):p(r)==="error"?(y(),M(Pe,{key:4},[C("div",KFe,[j(p(Dd),{kind:"error"}),C("span",ZFe,N(p(l)?p(n)("login.pollErrorTitle"):p(n)("login.errorTitle")),1),C("span",GFe,N(p(l)?p(n)("login.pollErrorHint"):p(n)("login.errorHint")),1)]),C("div",YFe,[j(p(Rt),{variant:"primary",onClick:p(c)},{default:me(()=>[qe(N(p(n)("login.retry")),1)]),_:1},8,["onClick"]),j(p(Rt),{variant:"secondary",onClick:m},{default:me(()=>[qe(N(p(n)("login.closeBtn")),1)]),_:1})])],64)):ee("",!0)]),_:1},8,["open","title"]))}}),JFe=ft(XFe,[["__scopeId","data-v-c798a107"]]),yF=et({__name:"LanguageSwitcher",props:{size:{default:"md"}},setup(e){const{locale:t}=Nt(),n=yg.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&E5(s)}return(s,i)=>(y(),he(p(wi),{"model-value":p(t),options:p(n),size:e.size,"onUpdate:modelValue":o},null,8,["model-value","options","size"]))}}),QFe={class:"msg"},eRe={class:"pf-field"},tRe={class:"pf-field-label"},nRe={class:"pf-field"},oRe={class:"pf-field-label"},sRe={class:"pf-field"},iRe={class:"pf-field-label"},rRe={class:"pf-key-wrap"},lRe={class:"pf-field"},aRe={class:"pf-field-label"},uRe={class:"pf-field"},cRe={class:"pf-field-label"},dRe={class:"pf-models"},fRe={key:0,class:"pf-models-empty"},pRe={class:"pf-model-grid pf-model-head"},hRe={key:1},mRe={key:0},gRe={class:"pf-foot"},vRe={key:0,class:"pf-managed-note"},yRe={class:"pf-confirm-msg"},kRe=et({__name:"ProviderForm",props:{mode:{},provider:{},guard:{type:Boolean}},emits:["dirtyChange","guardStay","guardDiscard","added","saved","deleting","deleted","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=mu(),r=Go({id:"",type:"openai",apiKey:"",baseUrl:"",models:[rh()]}),l=Z(""),a=Z(!1),u=Z(!1),c=Z(!1),d=R(()=>n.mode==="add"),f=R(()=>n.provider!==void 0&&mE(n.provider)),h=R(()=>{const $=n.provider;return $===void 0?0:w3($,i.config.value?.models).length}),m=R(()=>f.value&&h.value===0),v=R(()=>DJ.map($=>({value:$,label:s(`providers.types.${$}`)}))),k=R(()=>f.value?s("providers.apiKeyManaged"):!d.value&&n.provider?.hasApiKey===!0?s("providers.apiKeySet"):"sk-…");function w(){l.value="",u.value=!1;const $=n.provider;if(d.value||$===void 0){r.id="",r.type="openai",r.apiKey="",r.baseUrl="",r.models=[rh()];return}r.id=$.id,r.type=$.type,r.apiKey="",r.baseUrl=$.baseUrl??"";const B=w3($,i.config.value?.models);r.models=B.length>0?B:[rh()]}dn(()=>{w(),g()});const b=Z(!1),_=Z(!1);async function g(){const $=n.provider;if(!(d.value||$===void 0||f.value||$.hasApiKey!==!0))try{const B=await i.getProvider($.id);if(_.value)return;B.apiKey!==void 0&&B.apiKey!==""&&(r.apiKey=B.apiKey,b.value=!0)}catch{}}function x(){o("dirtyChange",!0)}const S=Z(!1),T=Z();function A($){l.value=$,yt(()=>T.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}async function E(){if(a.value)return;const $=BJ(r,{requireApiKey:d.value,requireBaseUrl:d.value});if($!==null){A(s(`providers.error.${$}`));return}l.value="",a.value=!0;try{if(d.value){const B=await i.addProvider(HJ(r));if(B!==null){A(B);return}o("dirtyChange",!1),i.notify({severity:"success",title:s("providers.added")}),o("added",r.id.trim())}else{const B=n.provider;if(B===void 0)return;const H=i.config.value?.providers?.[B.id]?.defaultModel,O=await i.updateProvider(B.id,zJ(r,B,{includeBlankApiKey:b.value,existingDefaultModel:H}));if(O!==null){A(O);return}await i.checkAuth(),i.notify({severity:"success",title:s("providers.saved")}),o("dirtyChange",!1),o("saved",r.id.trim())}}finally{a.value=!1}}async function P(){const $=n.provider;if(!($===void 0||c.value)){c.value=!0,o("deleting"),await new Promise(B=>setTimeout(B,300));try{if(await i.deleteProvider($.id)===null){u.value=!1;return}o("dirtyChange",!1),o("deleted",$.id)}finally{c.value=!1}}}function D(){r.models.push(rh()),x()}function I($){r.models.length<=1||(r.models.splice($,1),x())}return($,B)=>(y(),M("div",{class:"pf-form",onInput:x},[e.guard?(y(),he(p(qu),{key:0,variant:"warning",class:"pf-guard"},{default:me(()=>[C("span",QFe,N(p(s)("providers.unsavedGuard")),1),j(p(Rt),{variant:"secondary",size:"sm",onClick:B[0]||(B[0]=H=>o("guardStay"))},{default:me(()=>[qe(N(p(s)("providers.guardStay")),1)]),_:1}),j(p(Rt),{variant:"danger",size:"sm",onClick:B[1]||(B[1]=H=>o("guardDiscard"))},{default:me(()=>[qe(N(p(s)("providers.guardDiscard")),1)]),_:1})]),_:1})):ee("",!0),l.value?(y(),M("div",{key:1,ref_key:"errorBox",ref:T},[j(p(qu),{variant:"danger"},{default:me(()=>[qe(N(l.value),1)]),_:1})],512)):ee("",!0),C("div",eRe,[C("label",tRe,[qe(N(p(s)("providers.fieldId")),1),B[11]||(B[11]=C("span",{class:"req"}," *",-1))]),j(p(js),{modelValue:r.id,"onUpdate:modelValue":B[2]||(B[2]=H=>r.id=H),placeholder:"my-openai",disabled:f.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","disabled"])]),C("div",nRe,[C("label",oRe,[qe(N(p(s)("providers.fieldType")),1),B[12]||(B[12]=C("span",{class:"req"}," *",-1))]),j(p(n3),{"model-value":r.type,options:v.value,disabled:f.value,"onUpdate:modelValue":B[3]||(B[3]=H=>{r.type=H,x()})},null,8,["model-value","options","disabled"])]),C("div",sRe,[C("label",iRe,[qe(N(p(s)("providers.fieldApiKey")),1),B[13]||(B[13]=C("span",{class:"req"}," *",-1))]),C("div",rRe,[j(p(js),{modelValue:r.apiKey,"onUpdate:modelValue":B[4]||(B[4]=H=>r.apiKey=H),type:S.value?"text":"password",placeholder:k.value,disabled:f.value,autocomplete:"off",spellcheck:"false",onInput:B[5]||(B[5]=H=>_.value=!0)},null,8,["modelValue","type","placeholder","disabled"]),f.value?ee("",!0):(y(),he(p(gn),{key:0,class:"pf-key-eye",size:"sm",label:p(s)(S.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(s)(S.value?"providers.hideApiKey":"providers.showApiKey"),onClick:B[6]||(B[6]=H=>S.value=!S.value)},{default:me(()=>[j(p(Te),{name:S.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"]))])]),C("div",lRe,[C("label",aRe,[qe(N(p(s)("providers.fieldBaseUrl")),1),B[14]||(B[14]=C("span",{class:"req"}," *",-1))]),j(p(js),{modelValue:r.baseUrl,"onUpdate:modelValue":B[7]||(B[7]=H=>r.baseUrl=H),placeholder:p(s)("providers.baseUrlPlaceholder"),disabled:f.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder","disabled"])]),C("div",uRe,[C("label",cRe,[qe(N(p(s)("providers.fieldModels")),1),B[15]||(B[15]=C("span",{class:"req"}," *",-1))]),C("div",dRe,[m.value?(y(),M("div",fRe,N(p(s)("providers.noModels")),1)):(y(),M(Pe,{key:1},[C("div",pRe,[C("span",null,[qe(N(p(s)("providers.colModelId")),1),B[16]||(B[16]=C("span",{class:"req"}," *",-1))]),C("span",null,[qe(N(p(s)("providers.colContext")),1),B[17]||(B[17]=C("span",{class:"req"}," *",-1))]),C("span",null,N(p(s)("providers.colDisplayName")),1),B[18]||(B[18]=C("span",null,null,-1))]),(y(!0),M(Pe,null,pt(r.models,(H,O)=>(y(),M("div",{key:O,class:"pf-model-grid"},[j(p(js),{modelValue:H.model,"onUpdate:modelValue":F=>H.model=F,placeholder:p(s)("providers.modelIdPlaceholder"),disabled:f.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),j(p(js),{modelValue:H.maxContextSize,"onUpdate:modelValue":F=>H.maxContextSize=F,inputmode:"numeric",placeholder:p(s)("providers.modelContextPlaceholder"),disabled:f.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),j(p(js),{modelValue:H.displayName,"onUpdate:modelValue":F=>H.displayName=F,placeholder:p(s)("providers.modelNamePlaceholder"),disabled:f.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),f.value?(y(),M("span",hRe)):(y(),he(p(gn),{key:0,size:"sm",label:p(s)("providers.removeModel"),tooltip:p(s)("providers.removeModel"),disabled:r.models.length<=1,onClick:F=>I(O)},{default:me(()=>[j(p(Te),{name:"trash",size:"sm"})]),_:1},8,["label","tooltip","disabled","onClick"]))]))),128)),f.value?ee("",!0):(y(),M("div",mRe,[j(p(Rt),{variant:"ghost",size:"sm",onClick:D},{default:me(()=>[j(p(Te),{name:"plus",size:"sm"}),qe(" "+N(p(s)("providers.addModel")),1)]),_:1})]))],64))])]),C("div",gRe,[f.value?(y(),M("span",vRe,N(p(s)("providers.managedHint")),1)):d.value?(y(),M(Pe,{key:1},[j(p(Rt),{variant:"secondary",size:"sm",onClick:B[8]||(B[8]=H=>o("cancel"))},{default:me(()=>[qe(N(p(s)("common.cancel")),1)]),_:1}),j(p(Rt),{variant:"primary",size:"sm",disabled:a.value,onClick:E},{default:me(()=>[qe(N(p(s)("providers.addProvider")),1)]),_:1},8,["disabled"])],64)):u.value&&n.provider!==void 0?(y(),M(Pe,{key:2},[C("span",yRe,N(p(s)("providers.deleteConfirm",{id:n.provider.id,count:h.value})),1),B[19]||(B[19]=C("span",{class:"spacer"},null,-1)),j(p(Rt),{variant:"secondary",size:"sm",disabled:c.value,onClick:B[9]||(B[9]=H=>u.value=!1)},{default:me(()=>[qe(N(p(s)("common.cancel")),1)]),_:1},8,["disabled"]),j(p(Rt),{variant:"danger",size:"sm",disabled:c.value,onClick:P},{default:me(()=>[qe(N(p(s)("providers.deleteConfirmYes")),1)]),_:1},8,["disabled"])],64)):(y(),M(Pe,{key:3},[j(p(Rt),{variant:"danger-soft",size:"sm",onClick:B[10]||(B[10]=H=>u.value=!0)},{default:me(()=>[qe(N(p(s)("providers.deleteProvider")),1)]),_:1}),B[20]||(B[20]=C("span",{class:"spacer"},null,-1)),j(p(Rt),{variant:"primary",size:"sm",disabled:a.value,onClick:E},{default:me(()=>[qe(N(p(s)("providers.save")),1)]),_:1},8,["disabled"])],64))])],32))}}),kF=ft(kRe,[["__scopeId","data-v-ac0597e3"]]),bRe={class:"af"},CRe={class:"msg"},wRe={key:2,class:"af-catalog"},_Re={key:0,class:"af-center"},xRe={key:1,class:"af-error"},SRe={class:"af-list"},ARe=["disabled","onClick"],MRe={class:"af-entry-name"},TRe={key:1,class:"af-entry-reason"},ERe={key:2,class:"af-entry-count"},IRe={key:0,class:"af-empty"},LRe={class:"af-field"},$Re={class:"af-label"},NRe={class:"af-field"},FRe={class:"af-label"},RRe={class:"af-key-wrap"},ORe={key:0,class:"af-field"},PRe={class:"af-label"},DRe={class:"af-note"},BRe={class:"af-foot"},HRe={class:"af-hint"},zRe={class:"af-field"},WRe={class:"af-label"},URe={class:"af-field"},jRe={class:"af-label"},VRe={class:"af-key-wrap"},qRe={class:"af-foot"},KRe={class:"af-manual"},ZRe=et({__name:"AddProviderFlow",props:{guard:{type:Boolean}},emits:["dirtyChange","guardStay","guardDiscard","added","cancel"],setup(e,{emit:t}){const n=t,{t:o,te:s}=Nt(),i=mu(),r=Z("catalog"),l=R(()=>[{value:"catalog",label:o("providers.catalog.sourceCatalog")},{value:"registry",label:o("providers.catalog.sourceRegistry")},{value:"manual",label:o("providers.catalog.sourceManual")}]),a=Z("loading"),u=Z([]);async function c(){a.value="loading";const U=await i.loadCatalogProviders();U.kind==="ok"?(u.value=U.items,a.value="ready"):U.kind==="unsupported"?(a.value="unsupported",r.value==="catalog"&&(r.value="manual")):a.value="error"}dn(c);const d=Z(""),f=R(()=>{const U=d.value.trim().toLowerCase();return U===""?u.value:u.value.filter(z=>z.name.toLowerCase().includes(U)||z.id.toLowerCase().includes(U))});function h(U){const z=U.rejectReason;return z!==null&&s(`providers.catalog.rejectReason.${z}`)?o(`providers.catalog.rejectReason.${z}`):o("providers.catalog.rejected")}const m=Z(null),v=Z({id:"",apiKey:"",baseUrl:""}),k=Z(!1),w=Z(!1),b=Z("");function _(U){m.value=U,v.value={id:U.id,apiKey:"",baseUrl:""},b.value="",k.value=!1}function g(){m.value=null,b.value="",n("dirtyChange",!1)}function x(){n("dirtyChange",!0)}const S=R(()=>{if(m.value===null)return!1;const z=v.value.id.trim();return z!==""&&i.providers.value.some(W=>W.id===z)}),T=Z();function A(U){b.value=U,yt(()=>T.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}function E(){const U=v.value,z=U.id.trim();return z===""?o("providers.error.idRequired"):pE.test(z)?U.apiKey.trim()===""?o("providers.error.apiKeyRequired"):m.value?.needsBaseUrl===!0&&U.baseUrl.trim()===""?o("providers.error.baseUrlRequired"):null:o("providers.error.idInvalid")}async function P(){const U=m.value;if(U===null||w.value)return;const z=E();if(z!==null){A(z);return}b.value="",w.value=!0;try{const W=v.value,K=W.id.trim(),V=W.baseUrl.trim(),ie=await i.importCatalogProvider({catalogId:U.id,apiKey:W.apiKey.trim(),...V===""?{}:{baseUrl:V},...K===U.id?{}:{id:K}});if(ie!==null){A(ie);return}i.notify({severity:"success",title:o("providers.added")}),n("dirtyChange",!1),n("added",K)}finally{w.value=!1}}const D=Z({url:"",apiKey:""}),I=Z(!1),$=Z(!1),B=Z(""),H=Z();function O(U){B.value=U,yt(()=>H.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}async function F(){if($.value)return;const U=D.value.url.trim();if(U===""){O(o("providers.error.registryUrlRequired"));return}B.value="",$.value=!0;try{const z=D.value.apiKey.trim(),W=await i.importCustomRegistry({url:U,...z===""?{}:{apiKey:z}});if(typeof W=="string"){O(W);return}i.notify({severity:"success",title:o("providers.catalog.registryImported",{count:W.providers.length})}),n("dirtyChange",!1);const K=W.providers[0];K!==void 0?n("added",K.id):n("cancel")}finally{$.value=!1}}return(U,z)=>(y(),M("div",bRe,[e.guard?(y(),he(p(qu),{key:0,variant:"warning",class:"af-guard"},{default:me(()=>[C("span",CRe,N(p(o)("providers.unsavedGuard")),1),j(p(Rt),{variant:"secondary",size:"sm",onClick:z[0]||(z[0]=W=>n("guardStay"))},{default:me(()=>[qe(N(p(o)("providers.guardStay")),1)]),_:1}),j(p(Rt),{variant:"danger",size:"sm",onClick:z[1]||(z[1]=W=>n("guardDiscard"))},{default:me(()=>[qe(N(p(o)("providers.guardDiscard")),1)]),_:1})]),_:1})):ee("",!0),a.value!=="unsupported"?(y(),he(p(wi),{key:1,modelValue:r.value,"onUpdate:modelValue":z[2]||(z[2]=W=>r.value=W),size:"sm",options:l.value},null,8,["modelValue","options"])):ee("",!0),a.value!=="unsupported"?Bn((y(),M("div",wRe,[a.value==="loading"?(y(),M("div",_Re,[j(p(Ao),{size:"sm"}),C("span",null,N(p(o)("providers.catalog.loading")),1)])):a.value==="error"?(y(),M("div",xRe,[j(p(qu),{variant:"danger"},{default:me(()=>[qe(N(p(o)("providers.catalog.loadError")),1)]),_:1}),C("div",null,[j(p(Rt),{variant:"secondary",size:"sm",onClick:c},{default:me(()=>[qe(N(p(o)("providers.catalog.retry")),1)]),_:1})])])):m.value===null?(y(),M(Pe,{key:2},[j(p(js),{modelValue:d.value,"onUpdate:modelValue":z[3]||(z[3]=W=>d.value=W),placeholder:p(o)("providers.catalog.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"]),C("div",SRe,[(y(!0),M(Pe,null,pt(f.value,W=>(y(),M("button",{key:W.id,type:"button",class:"af-entry",disabled:W.rejected,onClick:K=>_(W)},[C("span",MRe,N(W.name),1),W.wireType!==null?(y(),he(p(Vr),{key:0,variant:"neutral",size:"sm"},{default:me(()=>[qe(N(W.wireType),1)]),_:2},1024)):ee("",!0),z[16]||(z[16]=C("span",{class:"grow"},null,-1)),W.rejected?(y(),M("span",TRe,N(h(W)),1)):(y(),M("span",ERe,N(p(o)("providers.modelCount",{count:W.models.length})),1))],8,ARe))),128)),f.value.length===0?(y(),M("div",IRe,N(p(o)("providers.catalog.empty")),1)):ee("",!0)])],64)):(y(),M("div",{key:3,class:"af-import",onInput:x},[C("button",{type:"button",class:"af-back",onClick:g},[j(p(Te),{name:"arrow-left",size:"sm"}),qe(" "+N(p(o)("providers.catalog.backToList")),1)]),C("div",LRe,[C("label",$Re,[qe(N(p(o)("providers.fieldId")),1),z[17]||(z[17]=C("span",{class:"req"}," *",-1))]),j(p(js),{modelValue:v.value.id,"onUpdate:modelValue":z[4]||(z[4]=W=>v.value.id=W),autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),C("div",NRe,[C("label",FRe,[qe(N(p(o)("providers.fieldApiKey")),1),z[18]||(z[18]=C("span",{class:"req"}," *",-1))]),C("div",RRe,[j(p(js),{modelValue:v.value.apiKey,"onUpdate:modelValue":z[5]||(z[5]=W=>v.value.apiKey=W),type:k.value?"text":"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue","type"]),j(p(gn),{class:"af-key-eye",size:"sm",label:p(o)(k.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(o)(k.value?"providers.hideApiKey":"providers.showApiKey"),onClick:z[6]||(z[6]=W=>k.value=!k.value)},{default:me(()=>[j(p(Te),{name:k.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"])])]),m.value.needsBaseUrl?(y(),M("div",ORe,[C("label",PRe,[qe(N(p(o)("providers.fieldBaseUrl")),1),z[19]||(z[19]=C("span",{class:"req"}," *",-1))]),j(p(js),{modelValue:v.value.baseUrl,"onUpdate:modelValue":z[7]||(z[7]=W=>v.value.baseUrl=W),placeholder:p(o)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])])):ee("",!0),S.value?(y(),he(p(qu),{key:1,variant:"warning"},{default:me(()=>[qe(N(p(o)("providers.catalog.overwriteWarning")),1)]),_:1})):ee("",!0),C("div",DRe,N(p(o)("providers.catalog.willImport",{count:m.value.models.length})),1),b.value?(y(),M("div",{key:2,ref_key:"importErrorBox",ref:T},[j(p(qu),{variant:"danger"},{default:me(()=>[qe(N(b.value),1)]),_:1})],512)):ee("",!0),C("div",BRe,[j(p(Rt),{variant:"secondary",size:"sm",onClick:z[8]||(z[8]=W=>n("cancel"))},{default:me(()=>[qe(N(p(o)("common.cancel")),1)]),_:1}),j(p(Rt),{variant:"primary",size:"sm",disabled:w.value,onClick:P},{default:me(()=>[qe(N(p(o)("providers.catalog.importAction")),1)]),_:1},8,["disabled"])])],32))],512)),[[qs,r.value==="catalog"]]):ee("",!0),Bn(C("div",{class:"af-registry",onInput:x},[C("div",HRe,N(p(o)("providers.catalog.registryHint")),1),C("div",zRe,[C("label",WRe,[qe(N(p(o)("providers.catalog.registryUrlLabel")),1),z[20]||(z[20]=C("span",{class:"req"}," *",-1))]),j(p(js),{modelValue:D.value.url,"onUpdate:modelValue":z[9]||(z[9]=W=>D.value.url=W),placeholder:"https://example.com/api.json",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),C("div",URe,[C("label",jRe,N(p(o)("providers.fieldApiKey")),1),C("div",VRe,[j(p(js),{modelValue:D.value.apiKey,"onUpdate:modelValue":z[10]||(z[10]=W=>D.value.apiKey=W),type:I.value?"text":"password",placeholder:p(o)("providers.modelNamePlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","type","placeholder"]),j(p(gn),{class:"af-key-eye",size:"sm",label:p(o)(I.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(o)(I.value?"providers.hideApiKey":"providers.showApiKey"),onClick:z[11]||(z[11]=W=>I.value=!I.value)},{default:me(()=>[j(p(Te),{name:I.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"])])]),B.value?(y(),M("div",{key:0,ref_key:"registryErrorBox",ref:H},[j(p(qu),{variant:"danger"},{default:me(()=>[qe(N(B.value),1)]),_:1})],512)):ee("",!0),C("div",qRe,[j(p(Rt),{variant:"secondary",size:"sm",onClick:z[12]||(z[12]=W=>n("cancel"))},{default:me(()=>[qe(N(p(o)("common.cancel")),1)]),_:1}),j(p(Rt),{variant:"primary",size:"sm",disabled:$.value,onClick:F},{default:me(()=>[qe(N(p(o)("providers.catalog.importAction")),1)]),_:1},8,["disabled"])])],544),[[qs,r.value==="registry"]]),Bn(C("div",KRe,[j(kF,{mode:"add",guard:!1,onDirtyChange:z[13]||(z[13]=W=>n("dirtyChange",W)),onAdded:z[14]||(z[14]=W=>n("added",W)),onCancel:z[15]||(z[15]=W=>n("cancel"))})],512),[[qs,r.value==="manual"]])]))}}),GRe=ft(ZRe,[["__scopeId","data-v-9e5ec0a8"]]),YRe={class:"pp"},XRe={class:"pp-head"},JRe={class:"pp-title"},QRe={key:0,class:"pp-loading"},eOe={key:1,class:"pp-group"},tOe={class:"pp-add-label"},nOe={class:"pp-chev"},oOe={class:"pp-acc"},sOe={class:"pp-acc-in"},iOe={key:1,class:"pp-empty"},rOe=["onClick"],lOe={class:"grow"},aOe={class:"pp-id"},uOe={class:"pp-count"},cOe={class:"pp-chev"},dOe={class:"pp-acc"},fOe={class:"pp-acc-in"},Wu="$add",pOe=et({__name:"ProvidersPanel",setup(e){const{t}=Nt(),n=mu(),o=Z(!0),s=Z(null),i=Z(null);let r=0;const l=Z(!1),a=Z(!1),u=Z(null),c=Z("");let d=0;const f=R(()=>[...n.providers.value].sort((S,T)=>S.id.localeCompare(T.id)));function h(S){return w3(S,n.config.value?.models).length}Je(s,(S,T)=>{T!==null&&T!==S&&(i.value=T,window.clearTimeout(r),r=window.setTimeout(()=>{i.value=null},300)),l.value=!1}),Je(l,S=>{S||(a.value=!1,u.value=null)}),bn(()=>{window.clearTimeout(r),window.clearTimeout(d)});const m=Z(!1);Je(s,S=>{S===Wu?(m.value=!1,yt(()=>requestAnimationFrame(()=>{m.value=!0}))):m.value=!1}),dn(async()=>{o.value=!0;try{await Promise.all([n.loadProviders(),n.loadModels(),n.loadConfig()])}finally{o.value=!1}});function v(S){const T=s.value===S?null:S;if(l.value){u.value=T,a.value=!0;return}s.value=T}function k(){a.value=!1,u.value=null}function w(){a.value=!1,s.value=u.value,u.value=null}function b(S){c.value=S,window.clearTimeout(d),d=window.setTimeout(()=>{c.value=""},1200)}function _(S){s.value=S}function g(S){s.value=S,b(S)}function x(){s.value=null}return(S,T)=>(y(),M("section",YRe,[C("div",XRe,[C("h3",JRe,N(p(t)("settings.tabs.providers")),1),j(p(Rt),{variant:"secondary",size:"sm",onClick:T[0]||(T[0]=A=>v(Wu))},{default:me(()=>[j(p(Te),{name:"plus",size:"sm"}),qe(" "+N(p(t)("providers.addProvider")),1)]),_:1})]),o.value?(y(),M("div",QRe,[j(p(Ao),{size:"sm"}),C("span",null,N(p(t)("providers.loading")),1)])):(y(),M("div",eOe,[s.value===Wu||i.value===Wu?(y(),M("div",{key:0,class:Re(["pp-item pp-add-item",{open:s.value===Wu&&m.value}])},[C("button",{type:"button",class:"pp-row pp-add-row",onClick:T[1]||(T[1]=A=>v(Wu))},[C("span",tOe,N(p(t)("providers.addProvider")),1),T[6]||(T[6]=C("span",{class:"grow"},null,-1)),C("span",nOe,[j(p(Te),{name:"chevron-right",size:"sm"})])]),C("div",oOe,[C("div",sOe,[j(GRe,{guard:a.value&&s.value===Wu,onDirtyChange:T[2]||(T[2]=A=>l.value=A),onGuardStay:k,onGuardDiscard:w,onAdded:g,onCancel:T[3]||(T[3]=A=>s.value=null)},null,8,["guard"])])])],2)):ee("",!0),f.value.length===0?(y(),M("div",iOe,N(p(t)("providers.empty")),1)):ee("",!0),(y(!0),M(Pe,null,pt(f.value,A=>(y(),M("div",{key:A.id,class:Re(["pp-item",{open:s.value===A.id,flash:c.value===A.id}])},[C("button",{type:"button",class:"pp-row",onClick:E=>v(A.id)},[C("div",lOe,[C("span",aOe,N(A.id),1),j(p(Vr),{variant:"neutral",size:"sm"},{default:me(()=>[qe(N(A.type),1)]),_:2},1024),p(mE)(A)?(y(),he(p(Vr),{key:0,variant:"info",size:"sm"},{default:me(()=>[qe(N(p(t)("providers.managedBadge")),1)]),_:1})):ee("",!0)]),C("span",uOe,N(p(t)("providers.modelCount",{count:h(A)})),1),C("span",cOe,[j(p(Te),{name:"chevron-right",size:"sm"})])],8,rOe),C("div",dOe,[C("div",fOe,[s.value===A.id||i.value===A.id?(y(),he(kF,{key:0,mode:"edit",provider:A,guard:a.value&&s.value===A.id,onDirtyChange:T[4]||(T[4]=E=>l.value=E),onGuardStay:k,onGuardDiscard:w,onSaved:_,onDeleting:T[5]||(T[5]=E=>s.value=null),onDeleted:x},null,8,["provider","guard"])):ee("",!0)])])],2))),128))]))]))}}),hOe=ft(pOe,[["__scopeId","data-v-9aa0e3a8"]]),mOe={class:"sec"},gOe={class:"sec-title"},vOe={class:"pu-group"},yOe={class:"pu-row"},kOe={class:"pu-main"},bOe={class:"pu-label"},COe={class:"pu-hint"},wOe=et({__name:"PlanUpgradeCard",setup(e){const{t}=Nt();return(n,o)=>(y(),M("section",mOe,[C("h3",gOe,N(p(t)("settings.planUsage.title")),1),C("div",vOe,[C("div",yOe,[C("span",kOe,[C("span",bOe,N(p(t)("settings.planUsage.freeTitle")),1),C("span",COe,N(p(t)("settings.planUsage.freeHint")),1)]),j(p(Rt),{variant:"primary",size:"sm",onClick:o[0]||(o[0]=s=>p(jp)())},{default:me(()=>[qe(N(p(t)("sidebar.upgrade")),1)]),_:1})])])]))}}),bF=ft(wOe,[["__scopeId","data-v-5711dff8"]]),_Oe={class:"sec"},xOe={class:"sec-title"},SOe={class:"pu-group"},AOe={key:0,class:"pu-row pu-state"},MOe={key:1,class:"pu-row pu-state"},TOe={class:"pu-error-text"},EOe={key:2,class:"pu-row pu-state pu-empty"},IOe={class:"pu-main"},LOe={class:"pu-label"},$Oe={key:0,class:"pu-hint"},NOe={class:"pu-value"},FOe=["aria-valuenow","aria-valuemax"],ROe={key:0,class:"sec"},OOe={class:"sec-title"},POe={class:"pu-group"},DOe={class:"pu-row"},BOe={class:"pu-main"},HOe={class:"pu-label"},zOe={class:"pu-value"},WOe={key:0,class:"pu-value-sub"},UOe={key:0,class:"pu-meter"},jOe={class:"pu-row"},VOe={class:"pu-main"},qOe={class:"pu-label"},KOe={class:"pu-value"},ZOe={class:"pu-row"},GOe={class:"pu-main"},YOe={class:"pu-label"},XOe={class:"pu-value"},JOe={class:"pu-value-sub"},QOe=et({__name:"PlanUsageCard",props:{onFetchUsage:{type:Function}},setup(e){const t=e,{t:n}=Nt(),o=Z(!0),s=Z(null);async function i(){o.value=!0;try{s.value=await t.onFetchUsage()}finally{o.value=!1}}dn(i);const r=R(()=>s.value?.kind==="ok"?s.value:null),l=R(()=>r.value?.extraUsage??null),a=R(()=>{const v=r.value;return v===null?[]:v.summary===null?v.limits:[v.summary,...v.limits]}),u=R(()=>a.value.length>0),c=R(()=>s.value?.kind==="error"?s.value.message:n("settings.planUsage.loadFailed")),d=R(()=>s.value?.kind==="error"&&(s.value.status===402||s.value.status===403)),f=R(()=>l.value!==null&&l.value.monthlyChargeLimitEnabled&&l.value.monthlyChargeLimitCents>0);function h(v,k){const w=PJ(v,k);return`${w.symbol}${w.number}`}function m(v){return v.resetAt===void 0?"":fE(v.resetAt,n)}return(v,k)=>d.value?(y(),he(bF,{key:0})):(y(),M(Pe,{key:1},[C("section",_Oe,[C("h3",xOe,N(p(n)("settings.planUsage.title")),1),C("div",SOe,[o.value?(y(),M("div",AOe,[j(p(Ao),{size:"sm"})])):r.value===null?(y(),M("div",MOe,[C("span",TOe,N(c.value),1),j(p(Rt),{variant:"ghost",size:"sm",onClick:i},{default:me(()=>[qe(N(p(n)("settings.planUsage.retry")),1)]),_:1})])):u.value?(y(!0),M(Pe,{key:3},pt(a.value,(w,b)=>(y(),M("div",{key:b,class:"pu-row"},[C("span",IOe,[C("span",LOe,N(p(dE)(w,p(n))),1),m(w)?(y(),M("span",$Oe,N(m(w)),1)):ee("",!0)]),C("span",NOe,N(p(n)("settings.planUsage.usedPct",{pct:p(Wh)(w.used,w.limit)})),1),C("span",{class:"pu-meter",role:"progressbar","aria-valuenow":w.used,"aria-valuemax":w.limit},[C("i",{class:Re(`sev-${p(C3)(w.used,w.limit)}`),style:Zt({width:`${p(Wh)(w.used,w.limit)}%`})},null,6)],8,FOe)]))),128)):(y(),M("div",EOe,N(p(n)("settings.planUsage.empty")),1))])]),l.value!==null?(y(),M("section",ROe,[C("h3",OOe,N(p(n)("settings.planUsage.boosterTitle")),1),C("div",POe,[C("div",DOe,[C("span",BOe,[C("span",HOe,N(p(n)("settings.planUsage.monthlyUsed")),1)]),C("span",zOe,[qe(N(h(l.value.monthlyUsedCents,l.value.currency)),1),f.value?(y(),M("span",WOe," / "+N(h(l.value.monthlyChargeLimitCents,l.value.currency)),1)):ee("",!0)]),f.value?(y(),M("span",UOe,[C("i",{class:Re(`sev-${p(C3)(l.value.monthlyUsedCents,l.value.monthlyChargeLimitCents)}`),style:Zt({width:`${p(Wh)(l.value.monthlyUsedCents,l.value.monthlyChargeLimitCents)}%`})},null,6)])):ee("",!0)]),C("div",jOe,[C("span",VOe,[C("span",qOe,N(p(n)("settings.planUsage.monthlyLimit")),1)]),C("span",KOe,[f.value?(y(),M(Pe,{key:0},[qe(N(h(l.value.monthlyChargeLimitCents,l.value.currency)),1)],64)):(y(),M(Pe,{key:1},[qe(N(p(n)("settings.planUsage.unlimited")),1)],64))])]),C("div",ZOe,[C("span",GOe,[C("span",YOe,N(p(n)("settings.planUsage.boosterBalance")),1)]),C("span",XOe,[qe(N(h(l.value.balanceCents,l.value.currency)),1),C("span",JOe," / "+N(h(l.value.totalCents,l.value.currency)),1)])])])])):ee("",!0)],64))}}),ePe=ft(QOe,[["__scopeId","data-v-f39cdded"]]),tPe=["aria-expanded","aria-label"],nPe={class:"sm-picker__value-text"},oPe=["aria-label"],sPe=["aria-label"],iPe={class:"sm-picker__group"},rPe=["aria-selected","onMouseenter","onClick"],lPe={class:"sm-picker__option-label"},aPe=["aria-label"],uPe={class:"sm-picker__group"},cPe=["aria-selected","onMouseenter","onClick"],dPe={class:"sm-picker__option-label"},fPe=188,pPe=250,wS=8,hPe=et({__name:"SecondaryModelPicker",props:{modelValue:{},effort:{},groups:{},modelInfoById:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=Z(null),r=Z(null),l=Z(null),a=new Map,u=Z(!1),c=Z(!1),d=Z({}),f=`sm-picker-${Math.random().toString(36).slice(2,9)}`,h=Z(""),m=Z(null),v=Z("right"),k=Z(0),w=Z("models"),b=Z(0),_=Z(0);let g=null;const x=R(()=>n.groups.flatMap(ve=>ve.options)),S=R(()=>n.modelValue?x.value.find(ve=>ve.id===n.modelValue)?.label??n.modelValue:""),T=R(()=>n.modelValue?n.effort?`${S.value} · ${n.effort}`:S.value:s("settings.noSecondaryModel")),A=R(()=>{const ve=m.value;if(ve===null)return[];const oe=Up(n.modelInfoById[ve]),ye=n.effort===""?[null,...oe]:[...oe];return n.modelValue===ve&&n.effort!==""&&!oe.includes(n.effort)&&ye.push(n.effort),ye});function E(ve){return n.modelValue!==m.value?!1:ve===null?n.effort==="":n.effort===ve}function P(){const ve=A.value.findIndex(oe=>E(oe));return ve>=0?ve:0}function D(ve,oe){ve instanceof HTMLElement?a.set(oe,ve):a.delete(oe)}function I(){g!==null&&(clearTimeout(g),g=null)}function $(){I(),g=setTimeout(()=>{m.value=null,w.value==="efforts"&&(w.value="models")},pPe)}function B(ve){ve!==h.value&&(h.value=ve,b.value=Math.max(0,x.value.findIndex(oe=>oe.id===ve)))}function H(){const ve=r.value,oe=l.value;if(!ve||!oe)return;const ye=ve.getBoundingClientRect(),G=oe.offsetHeight,Y=window.innerHeight-ye.bottom;c.value=Y<G+wS&&ye.top>G;const fe=Math.max(wS,window.innerWidth-ye.right);d.value=c.value?{right:`${fe}px`,bottom:`${window.innerHeight-ye.top+4}px`,top:"auto"}:{right:`${fe}px`,top:`${ye.bottom+4}px`,bottom:"auto"}}function O(){const ve=l.value,oe=m.value===null?void 0:a.get(m.value);if(!ve||!oe)return;const ye=ve.getBoundingClientRect(),G=oe.getBoundingClientRect();k.value=Math.max(0,Math.min(G.top-ye.top-4,ve.offsetHeight-40));const Y=window.innerWidth-ye.right,fe=ye.left;v.value=Y>=fPe||Y>=fe?"right":"left"}function F(ve,{moveFocus:oe=!1}={}){B(ve),I(),m.value=ve,oe&&(w.value="efforts",_.value=P()),yt(O)}function U(){m.value=null,w.value="models"}function z(){u.value||(u.value=!0,h.value=n.modelValue||(x.value[0]?.id??""),b.value=Math.max(0,x.value.findIndex(ve=>ve.id===h.value)),m.value=null,w.value="models",yt(H))}function W({restoreFocus:ve=!1}={}){u.value&&(I(),u.value=!1,m.value=null,ve&&yt(()=>r.value?.focus()))}function K(){u.value?W():z()}function V(ve){if(m.value===null)return;const oe={model:m.value,effort:ve??void 0};(oe.model!==n.modelValue||(oe.effort??"")!==n.effort)&&o("select",oe),W({restoreFocus:!0})}function ie(){yt(()=>{l.value?.querySelector(".sm-picker__option.is-kb-active")?.scrollIntoView({block:"nearest"})})}function ne(ve){const oe=x.value;if(oe.length===0)return;const ye=(b.value+ve+oe.length)%oe.length,G=oe[ye].id;B(G),m.value!==null&&F(G),ie()}function X(ve){const oe=A.value;oe.length!==0&&(_.value=(_.value+ve+oe.length)%oe.length,ie())}function le(ve){if(!u.value){(ve.key==="Enter"||ve.key===" "||ve.key==="ArrowDown")&&(ve.preventDefault(),z());return}if(ve.key==="ArrowDown")ve.preventDefault(),w.value==="models"?ne(1):X(1);else if(ve.key==="ArrowUp")ve.preventDefault(),w.value==="models"?ne(-1):X(-1);else if(ve.key==="ArrowRight")ve.preventDefault(),F(h.value,{moveFocus:!0});else if(ve.key==="ArrowLeft")ve.preventDefault(),m.value!==null&&U();else if(ve.key==="Enter"||ve.key===" ")ve.preventDefault(),w.value==="models"?F(h.value,{moveFocus:!0}):V(A.value[_.value]??null);else if(ve.key==="Home"||ve.key==="End"){ve.preventDefault();const oe=ve.key==="Home";if(w.value==="models"){const ye=x.value;if(ye.length===0)return;const G=(oe?ye[0]:ye.at(-1)).id;B(G),m.value!==null&&F(G)}else _.value=oe?0:A.value.length-1;ie()}else ve.key==="Escape"&&(ve.preventDefault(),W({restoreFocus:!0}))}function Ie(ve){const oe=ve.target;i.value?.contains(oe)||l.value?.contains(oe)||W()}function de(ve){if(u.value){if(l.value?.contains(ve.target)){O();return}H(),O()}}function pe(){W()}return dn(()=>{document.addEventListener("pointerdown",Ie),document.addEventListener("scroll",de,!0),window.addEventListener("resize",pe)}),bn(()=>{document.removeEventListener("pointerdown",Ie),document.removeEventListener("scroll",de,!0),window.removeEventListener("resize",pe),I()}),(ve,oe)=>(y(),M("div",{ref_key:"rootRef",ref:i,class:Re(["sm-picker",{"is-open":u.value}])},[C("button",{ref_key:"triggerRef",ref:r,class:"sm-picker__trigger",type:"button",role:"combobox","aria-controls":f,"aria-expanded":u.value,"aria-haspopup":"dialog","aria-label":p(s)("settings.secondaryModel"),onClick:K,onKeydown:le},[C("span",{class:Re(["sm-picker__value",{"is-placeholder":!e.modelValue}])},[C("span",nPe,N(T.value),1)],2),j(p(Te),{class:"sm-picker__chevron",name:"chevron-down",size:"sm"})],40,tPe),(y(),he(Zr,{to:"body"},[u.value?(y(),M("div",{key:0,id:f,ref_key:"menuRef",ref:l,class:Re(["sm-picker__menu",{"sm-picker__menu--up":c.value}]),style:Zt(d.value),role:"dialog","aria-label":p(s)("settings.secondaryModel")},[C("div",{class:"sm-picker__models",role:"listbox","aria-label":p(s)("settings.secondaryModel")},[(y(!0),M(Pe,null,pt(e.groups,ye=>(y(),M(Pe,{key:ye.provider},[C("div",iPe,N(ye.provider),1),(y(!0),M(Pe,null,pt(ye.options,G=>(y(),M("button",{key:G.id,ref_for:!0,ref:Y=>D(Y,G.id),class:Re(["sm-picker__option",{"is-selected":G.id===e.modelValue,"is-active":G.id===h.value,"is-kb-active":w.value==="models"&&G.id===h.value}]),type:"button",role:"option","aria-selected":G.id===e.modelValue,onMouseenter:Y=>F(G.id),onMouseleave:$,onClick:Y=>F(G.id,{moveFocus:!0})},[j(p(Te),{class:"sm-picker__check",name:"check",size:"sm"}),C("span",lPe,N(G.label),1),j(p(Te),{class:"sm-picker__flyout-caret",name:"chevron-right",size:"sm"})],42,rPe))),128))],64))),128))],8,sPe),m.value!==null?(y(),M("div",{key:0,class:Re(["sm-picker__flyout",`sm-picker__flyout--${v.value}`]),style:Zt({top:`${k.value}px`}),role:"listbox","aria-label":p(s)("settings.secondaryModelEffort"),onMouseenter:I,onMouseleave:$},[C("div",uPe,N(p(s)("settings.secondaryModelEffort")),1),(y(!0),M(Pe,null,pt(A.value,(ye,G)=>(y(),M("button",{key:ye??"__default__",class:Re(["sm-picker__option",{"is-selected":E(ye),"is-active":w.value==="efforts"&&G===_.value,"is-kb-active":w.value==="efforts"&&G===_.value,"is-muted":ye===null}]),type:"button",role:"option","aria-selected":E(ye),onMouseenter:Y=>{w.value="efforts",_.value=G},onClick:Y=>V(ye)},[j(p(Te),{class:"sm-picker__check",name:"check",size:"sm"}),C("span",dPe,N(ye??p(s)("settings.secondaryModelEffortAuto")),1)],42,cPe))),128))],46,aPe)):ee("",!0)],14,oPe)):ee("",!0)]))],2))}}),mPe=ft(hPe,[["__scopeId","data-v-f114c246"]]),gPe=["aria-label"],vPe={class:"settings-tabs-header"},yPe={class:"settings-dialog-title"},kPe={class:"settings-tab-list"},bPe=["aria-selected","onClick"],CPe={class:"settings-region"},wPe={class:"settings-region-header"},_Pe={class:"panel"},xPe={class:"sec"},SPe={class:"sec-title"},APe={class:"settings-group"},MPe={class:"row"},TPe={class:"rlabel"},EPe={class:"hint"},IPe={class:"row language-row"},LPe={class:"rlabel"},$Pe={class:"hint"},NPe={class:"row font-size-row"},FPe={class:"rlabel"},RPe={class:"hint"},OPe={class:"sec notification-settings"},PPe={class:"sec-title"},DPe={class:"settings-group"},BPe={class:"row"},HPe={class:"rlabel"},zPe={class:"hint"},WPe={key:0,class:"hint"},UPe={class:"row"},jPe={class:"rlabel"},VPe={class:"hint"},qPe={class:"panel"},KPe={class:"sec"},ZPe={class:"sec-title"},GPe={class:"settings-group"},YPe={class:"account-row"},XPe={class:"account-avatar","aria-hidden":"true"},JPe=["src"],QPe={class:"account-meta"},eDe={class:"account-name-row"},tDe={class:"account-name"},nDe={class:"account-sub"},oDe={key:0,class:"panel"},sDe={class:"panel"},iDe={class:"sec"},rDe={class:"sec-head"},lDe={class:"sec-title"},aDe={class:"settings-group"},uDe={class:"row"},cDe={class:"rlabel"},dDe={class:"hint"},fDe={key:0,class:"select-wrap"},pDe={key:1,class:"rvalue mono"},hDe={class:"row"},mDe={class:"rlabel"},gDe={class:"hint"},vDe={class:"row"},yDe={class:"rlabel"},kDe={class:"hint"},bDe={class:"row"},CDe={class:"rlabel"},wDe={class:"hint"},_De={key:1,class:"empty-config"},xDe={key:0,class:"sec"},SDe={class:"sec-head"},ADe={class:"sec-title"},MDe={class:"settings-group"},TDe={class:"row"},EDe={class:"rlabel"},IDe={class:"hint"},LDe={key:0,class:"select-wrap"},$De={key:1,class:"rvalue mono"},NDe={class:"panel"},FDe={class:"sec"},RDe={class:"sec-title"},ODe={class:"settings-group"},PDe={class:"row"},DDe={class:"rlabel"},BDe={class:"hint"},HDe={class:"rvalue"},zDe={class:"row"},WDe={class:"rlabel"},UDe={class:"hint"},jDe={class:"rvalue"},VDe={class:"row"},qDe={class:"rlabel"},KDe={class:"hint"},ZDe={class:"rvalue"},GDe={key:0,class:"row"},YDe={class:"rlabel"},XDe={key:0,class:"hint"},JDe={key:1,class:"hint"},QDe={key:1,class:"row"},eBe={class:"rlabel"},tBe={class:"hint"},nBe={key:0,class:"sec"},oBe={class:"sec-title"},sBe={class:"settings-group"},iBe={class:"row"},rBe={class:"rlabel"},lBe={class:"hint"},aBe={class:"hint"},uBe={class:"sec"},cBe={class:"sec-title"},dBe={class:"settings-group"},fBe={class:"row"},pBe={class:"rlabel"},hBe={class:"hint"},mBe={key:0,class:"hint"},gBe={class:"panel"},vBe={class:"panel-head"},yBe={class:"panel-title"},kBe={class:"panel-desc"},bBe={class:"archive-toolbar"},CBe={class:"archive-search"},wBe=["placeholder"],_Be={key:0,class:"archive-empty"},xBe={key:0,class:"archive-list"},SBe={class:"archive-workspace"},ABe={class:"path"},MBe={class:"count"},TBe={class:"setting-card"},EBe={class:"archive-meta"},IBe={class:"archive-name"},LBe={class:"archive-time"},$Be={key:1,class:"archive-empty"},NBe=100,FBe=et({__name:"SettingsDialog",props:{colorScheme:{},fontScale:{},initialTab:{},managedProviderStatus:{},managedUserInfo:{},onFetchUsage:{type:Function},notify:{type:Boolean},notifyPermission:{},notifySound:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},experimentalFlags:{}},emits:["setColorScheme","setFontScale","setNotify","setNotifySound","login","logout","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=R(()=>o.managedProviderStatus==="authenticated"),r=R(()=>i.value?o.managedUserInfo?.nickname||n("sidebar.defaultUserName"):n("sidebar.notSignedIn")),l=R(()=>o.managedUserInfo?.userLevelName?.trim()??""),a=Z(!1);Je(()=>o.managedUserInfo?.avatar,()=>{a.value=!1});const u=R(()=>!!o.managedUserInfo?.avatar&&!a.value),c=R(()=>i.value?n("settings.signedIn"):n("settings.signedOutHint")),d=Z(o.initialTab??"general"),f=Z(!1);let h=null;function m(){f.value=!0,h&&clearTimeout(h),h=setTimeout(()=>{f.value=!1,h=null},900)}const v=[{id:"general",labelKey:"settings.tabs.general",icon:"sliders"},{id:"agent",labelKey:"settings.tabs.agent",icon:"robot"},{id:"account",labelKey:"settings.tabs.account",icon:"user"},{id:"providers",labelKey:"settings.tabs.providers",icon:"bolt"},{id:"advanced",labelKey:"settings.tabs.advanced",icon:"microscope"},{id:"archived",labelKey:"settings.tabs.archived",icon:"archive"}],k=G0e(),w=["manual","yolo","auto"],b={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},_=Z(null);gF(_);const{isConfirmOpen:g}=hu();function x(Fe){Fe.key==="Escape"&&!Fe.defaultPrevented&&!g.value&&s("close")}dn(()=>document.addEventListener("keydown",x)),bn(()=>{document.removeEventListener("keydown",x),h&&clearTimeout(h)});function S(){G$()}const T=(()=>{const Fe="0.33.0".trim()?"0.33.0":"";let Oe="";if("2026-08-12T03:30:09.051Z".trim()){const at=new Date("2026-08-12T03:30:09.051Z");if(!Number.isNaN(at.getTime())){const Tt=Bt=>String(Bt).padStart(2,"0");Oe=`${at.getFullYear()}-${Tt(at.getMonth()+1)}-${Tt(at.getDate())} ${Tt(at.getHours())}:${Tt(at.getMinutes())}`}}const Ge=Oe===""?Fe:`${Fe} · ${Oe}`;return Ge===""?"-":Ge})(),A=K$(),E=Z(!1),P=Z(null);async function D(){if(!E.value){E.value=!0,P.value=null;try{P.value=await A.check()}finally{E.value=!1}}}const I=R(()=>{const Fe=P.value;if(Fe===null)return"";switch(Fe.outcome){case"available":return A.status.value.state==="downloaded"?n("settings.updateCheckDownloaded",{version:Fe.version??""}):A.autoDownload.value?n("settings.updateCheckAvailableAuto",{version:Fe.version??""}):n("settings.updateCheckAvailable",{version:Fe.version??""});case"latest":return n("settings.updateCheckLatest");case"unsupported":return n("settings.updateCheckUnsupported");case"error":return n("settings.updateCheckFailed")}}),$=R(()=>{const Fe=new Map;for(const Oe of o.models??[])Fe.set(Oe.id,{id:Oe.id,label:Oe.displayName??Oe.model??Oe.id,provider:Oe.provider});for(const[Oe,Ge]of Object.entries(o.config?.models??{})){if(Fe.has(Oe))continue;const at=F(Ge);Fe.set(Oe,{id:Oe,label:U(Oe,Ge,at),provider:at??Oe})}return Array.from(Fe.values())}),B=R(()=>{const Fe=new Map;for(const Oe of $.value){const Ge=Fe.get(Oe.provider)??[];Ge.push(Oe),Fe.set(Oe.provider,Ge)}for(const Oe of Fe.values())Oe.sort((Ge,at)=>Ge.label.localeCompare(at.label));return Array.from(Fe.entries()).toSorted(([Oe],[Ge])=>Oe.localeCompare(Ge)).map(([Oe,Ge])=>({provider:Oe,options:Ge}))}),H=R(()=>{const Fe=B.value.flatMap(Oe=>Oe.options.map(Ge=>({value:Ge.id,label:Ge.label,group:Oe.provider})));return o.config?.defaultModel||Fe.unshift({value:"",label:n("settings.noDefaultModel"),group:"",disabled:!0}),Fe}),O=R(()=>{const Fe=o.config?.defaultPermissionMode;return Fe==="auto"||Fe==="yolo"||Fe==="manual"?Fe:"manual"});function F(Fe){if(!Fe||typeof Fe!="object")return;const Oe=Fe;return typeof Oe.provider=="string"?Oe.provider:void 0}function U(Fe,Oe,Ge){if(!Oe||typeof Oe!="object")return Fe;const at=Oe,Tt=typeof at.model=="string"?at.model:void 0,Bt=Ge??F(Oe);return Tt&&Bt?`${Fe} (${Bt}/${Tt})`:Tt?`${Fe} (${Tt})`:Fe}function z(Fe){return Fe===!0}function W(Fe){!Fe||Fe===o.config?.defaultModel||s("updateConfig",{defaultModel:Fe})}function K(Fe){Fe!==O.value&&s("updateConfig",{defaultPermissionMode:Fe})}const V=R(()=>(o.experimentalFlags?.["secondary-model"]??o.config?.experimental?.["secondary-model"])===!0),ie=R(()=>o.config?.secondaryModel?.model??""),ne=R(()=>o.config?.secondaryModel?.defaultEffort??""),X=R(()=>Object.fromEntries((o.models??[]).map(Fe=>[Fe.id,Fe])));function le(Fe){Fe.model===ie.value&&(Fe.effort??"")===ne.value||s("updateConfig",{secondaryModel:Fe.effort?{model:Fe.model,defaultEffort:Fe.effort}:{model:Fe.model}})}function Ie(Fe){const Oe=o.config?.[Fe];s("updateConfig",{[Fe]:!z(Oe)})}function de(){const Fe=o.config?.thinking;return!Fe||typeof Fe!="object"?!0:Fe.enabled!==!1}function pe(){s("updateConfig",{thinking:{enabled:!de()}})}function ve(){const Fe=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!Fe})}function oe(Fe){d.value=Fe}const ye=mu(),G=R(()=>i.value&&ye.managedMembership.value==="free"),Y=Z([]),fe=Z(!1),we=Z(!1),ge=Z(""),Q=Z("all"),te=Z("archived-desc");async function ce(){if(!(fe.value||we.value)){fe.value=!0;try{const Fe=[];let Oe;for(;;){const Ge=await ye.loadArchivedSessions({beforeId:Oe,pageSize:NBe});if(Fe.push(...Ge.items),!Ge.hasMore||Ge.items.length===0)break;const at=Ge.items.at(-1)?.id;if(at===void 0)break;Oe=at}Y.value=Fe,we.value=!0}catch(Fe){gl("loadAllArchived failed",Fe)}finally{fe.value=!1}}}Je(d,Fe=>{Fe==="archived"&&!we.value&&ce()},{immediate:!0});const ue=R(()=>{const Fe=new Set;for(const Oe of Y.value)Fe.add(Oe.cwd);return Array.from(Fe).sort((Oe,Ge)=>Oe.localeCompare(Ge))}),Se=R(()=>[{value:"all",label:n("settings.archivedAllWorkspaces")},...ue.value.map(Fe=>({value:Fe,label:Fe}))]),ze=R(()=>{const Fe=ge.value.trim().toLowerCase();let Oe=Y.value.filter(Ge=>Ge.archived===!0);return Q.value!=="all"&&(Oe=Oe.filter(Ge=>Ge.cwd===Q.value)),Fe&&(Oe=Oe.filter(Ge=>Ge.title.toLowerCase().includes(Fe))),Oe=Oe.slice(),te.value==="archived-desc"?Oe.sort((Ge,at)=>at.updatedAt.localeCompare(Ge.updatedAt)):te.value==="created-desc"?Oe.sort((Ge,at)=>at.createdAt.localeCompare(Ge.createdAt)):Oe.sort((Ge,at)=>Ge.title.localeCompare(at.title,"zh")),Oe}),_e=R(()=>{const Fe=new Map;for(const Oe of ze.value){const Ge=Fe.get(Oe.cwd)??[];Ge.push(Oe),Fe.set(Oe.cwd,Ge)}return Array.from(Fe.entries()).map(([Oe,Ge])=>({cwd:Oe,items:Ge}))});async function Ee(Fe){await ye.restoreSession(Fe)&&(Y.value=Y.value.filter(Ge=>Ge.id!==Fe))}function it(Fe){const Oe=new Date(Fe);if(Number.isNaN(Oe.getTime()))return Fe;const Ge=at=>String(at).padStart(2,"0");return`${Oe.getFullYear()}-${Ge(Oe.getMonth()+1)}-${Ge(Oe.getDate())} ${Ge(Oe.getHours())}:${Ge(Oe.getMinutes())}`}return(Fe,Oe)=>(y(),he(p(ua),{open:!0,"close-on-esc":!1,"aria-label":p(n)("settings.title"),size:"xl",height:"fixed",padded:!1,level:"grouped",onClose:Oe[16]||(Oe[16]=Ge=>s("close"))},{default:me(()=>[C("div",{ref_key:"dialogRef",ref:_,class:"sd"},[C("nav",{class:"settings-tabs",role:"tablist","aria-label":p(n)("settings.title")},[C("header",vPe,[C("h2",yPe,N(p(n)("settings.title")),1)]),C("div",kPe,[(y(),M(Pe,null,pt(v,Ge=>C("button",{key:Ge.id,type:"button",class:Re(["tab",{on:d.value===Ge.id}]),role:"tab","aria-selected":d.value===Ge.id,onClick:at=>oe(Ge.id)},[j(p(Te),{name:Ge.icon,size:"md"},null,8,["name"]),C("span",null,N(p(n)(Ge.labelKey)),1)],10,bPe)),64))])],8,gPe),C("section",CPe,[C("header",wPe,[j(p(gn),{size:"sm",label:p(n)("settings.close"),tooltip:p(n)("settings.close"),onClick:Oe[0]||(Oe[0]=Ge=>s("close"))},{default:me(()=>[j(p(Te),{name:"close",size:"md"})]),_:1},8,["label","tooltip"])]),C("div",{class:Re(["body",{scrolling:f.value}]),onScroll:m},[Bn(C("section",_Pe,[C("section",xPe,[C("h3",SPe,N(p(n)("settings.appearance")),1),C("div",APe,[C("div",MPe,[C("span",TPe,[qe(N(p(n)("theme.colorSchemeLabel"))+" ",1),C("span",EPe,N(p(n)("settings.colorSchemeHint")),1)]),j(p(wi),{"model-value":e.colorScheme,options:[{value:"light",label:p(n)("theme.light"),icon:"light-mode"},{value:"dark",label:p(n)("theme.dark"),icon:"dark-mode"},{value:"system",label:p(n)("theme.system")}],"onUpdate:modelValue":Oe[1]||(Oe[1]=Ge=>s("setColorScheme",Ge))},null,8,["model-value","options"])]),C("div",IPe,[C("span",LPe,[qe(N(p(n)("sidebar.language"))+" ",1),C("span",$Pe,N(p(n)("settings.languageHint")),1)]),j(yF)]),C("div",NPe,[C("span",FPe,[qe(N(p(n)("settings.uiFontSize"))+" ",1),C("span",RPe,N(p(n)("settings.uiFontSizeHint")),1)]),j(p(wi),{"model-value":e.fontScale,options:[{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"xlarge",label:"XL"}],"aria-label":p(n)("settings.uiFontSize"),"onUpdate:modelValue":Oe[2]||(Oe[2]=Ge=>s("setFontScale",Ge))},null,8,["model-value","aria-label"])])])]),C("section",OPe,[C("h3",PPe,N(p(n)("settings.notifications")),1),C("div",DPe,[C("div",BPe,[C("span",HPe,[qe(N(p(n)("settings.notifyEnabled"))+" ",1),C("span",zPe,N(p(n)("settings.notifyEnabledHint")),1),e.notifyPermission==="denied"?(y(),M("span",WPe,N(p(n)("settings.notifyDenied")),1)):ee("",!0)]),j(p(ed),{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:p(n)("settings.notifyEnabled"),"onUpdate:modelValue":Oe[3]||(Oe[3]=Ge=>s("setNotify",Ge))},null,8,["model-value","disabled","label"])]),C("div",UPe,[C("span",jPe,[qe(N(p(n)("settings.notifySound"))+" ",1),C("span",VPe,N(p(n)("settings.notifySoundHint")),1)]),j(p(ed),{"model-value":e.notifySound,label:p(n)("settings.notifySound"),"onUpdate:modelValue":Oe[4]||(Oe[4]=Ge=>s("setNotifySound",Ge))},null,8,["model-value","label"])])])])],512),[[qs,d.value==="general"]]),Bn(C("section",qPe,[C("section",KPe,[C("h3",ZPe,N(p(n)("settings.account")),1),C("div",GPe,[C("div",YPe,[C("span",XPe,[u.value?(y(),M("img",{key:0,src:o.managedUserInfo?.avatar,alt:"",onError:Oe[5]||(Oe[5]=Ge=>a.value=!0)},null,40,JPe)):(y(),he(p(Te),{key:1,name:"user",size:"md"}))]),C("span",QPe,[C("span",eDe,[C("span",tDe,N(r.value),1),l.value?(y(),he(p(Vr),{key:0,class:"account-level",variant:"neutral",size:"sm"},{default:me(()=>[qe(N(l.value),1)]),_:1})):ee("",!0)]),C("span",nDe,N(c.value),1)]),i.value?(y(),he(p(Rt),{key:0,variant:"danger-soft",size:"sm",onClick:Oe[6]||(Oe[6]=Ge=>s("logout"))},{default:me(()=>[qe(N(p(n)("sidebar.signOut")),1)]),_:1})):(y(),he(p(Rt),{key:1,variant:"primary",size:"sm",onClick:Oe[7]||(Oe[7]=Ge=>s("login"))},{default:me(()=>[qe(N(p(n)("sidebar.signIn")),1)]),_:1}))])])]),G.value?(y(),he(bF,{key:0})):i.value?(y(),he(ePe,{key:1,"on-fetch-usage":o.onFetchUsage},null,8,["on-fetch-usage"])):ee("",!0)],512),[[qs,d.value==="account"]]),d.value==="providers"?(y(),M("section",oDe,[j(hOe)])):ee("",!0),Bn(C("section",sDe,[C("section",iDe,[C("div",rDe,[C("h3",lDe,N(p(n)("settings.agentDefaults")),1)]),C("div",aDe,[e.config?(y(),M(Pe,{key:0},[C("div",uDe,[C("span",cDe,[qe(N(p(n)("settings.defaultModel"))+" ",1),C("span",dDe,N(p(n)("settings.defaultModelHint")),1)]),B.value.length>0?(y(),M("div",fDe,[j(p(n3),{"model-value":e.config.defaultModel??"",options:H.value,"aria-label":p(n)("settings.defaultModel"),"onUpdate:modelValue":W},null,8,["model-value","options","aria-label"])])):(y(),M("span",pDe,N(e.config.defaultModel??p(n)("settings.noDefaultModel")),1))]),C("div",hDe,[C("span",mDe,[qe(N(p(n)("settings.defaultPermission"))+" ",1),C("span",gDe,N(p(n)("settings.defaultPermissionHint")),1)]),j(p(wi),{"model-value":O.value,options:w.map(Ge=>({value:Ge,label:p(n)(b[Ge])})),"onUpdate:modelValue":Oe[8]||(Oe[8]=Ge=>K(Ge))},null,8,["model-value","options"])]),C("div",vDe,[C("span",yDe,[qe(N(p(n)("settings.defaultThinking"))+" ",1),C("span",kDe,N(p(n)("settings.defaultThinkingHint")),1)]),j(p(ed),{"model-value":de(),label:p(n)("settings.defaultThinking"),"onUpdate:modelValue":Oe[9]||(Oe[9]=Ge=>pe())},null,8,["model-value","label"])]),C("div",bDe,[C("span",CDe,[qe(N(p(n)("settings.defaultPlanMode"))+" ",1),C("span",wDe,N(p(n)("settings.defaultPlanModeHint")),1)]),j(p(ed),{"model-value":z(e.config.defaultPlanMode),label:p(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Oe[10]||(Oe[10]=Ge=>Ie("defaultPlanMode"))},null,8,["model-value","label"])])],64)):(y(),M("div",_De,N(p(n)("settings.configUnavailable")),1))])]),e.config&&V.value?(y(),M("section",xDe,[C("div",SDe,[C("h3",ADe,N(p(n)("settings.secondaryModelSection")),1)]),C("div",MDe,[C("div",TDe,[C("span",EDe,[qe(N(p(n)("settings.secondaryModel"))+" ",1),C("span",IDe,N(p(n)("settings.secondaryModelHint")),1)]),B.value.length>0?(y(),M("div",LDe,[j(mPe,{"model-value":ie.value,effort:ne.value,groups:B.value,"model-info-by-id":X.value,onSelect:le},null,8,["model-value","effort","groups","model-info-by-id"])])):(y(),M("span",$De,N(ie.value||p(n)("settings.noSecondaryModel")),1))])])])):ee("",!0)],512),[[qs,d.value==="agent"]]),Bn(C("section",NDe,[C("section",FDe,[C("h3",RDe,N(p(n)("settings.versionAndUpdates")),1),C("div",ODe,[C("div",PDe,[C("span",DDe,[qe(N(p(n)("settings.appVersion"))+" ",1),C("span",BDe,N(p(n)("settings.appVersionHint")),1)]),C("span",HDe,N(p(T)),1)]),C("div",zDe,[C("span",WDe,[qe(N(p(n)("settings.serverVersion"))+" ",1),C("span",UDe,N(p(n)("settings.serverVersionHint")),1)]),C("span",jDe,N(e.serverVersion||"-"),1)]),C("div",VDe,[C("span",qDe,[qe(N(p(n)("settings.serverAddress"))+" ",1),C("span",KDe,N(p(n)("settings.serverAddressHint")),1)]),C("span",ZDe,N(p(k)),1)]),p(A).canCheck?(y(),M("div",GDe,[C("span",YDe,[qe(N(p(n)("settings.checkUpdate"))+" ",1),I.value?(y(),M("span",XDe,N(I.value),1)):(y(),M("span",JDe,N(p(n)("settings.checkUpdateHint")),1))]),j(p(Rt),{variant:"secondary",size:"sm",disabled:E.value,onClick:D},{default:me(()=>[qe(N(E.value?p(n)("settings.updateChecking"):p(n)("settings.checkUpdateBtn")),1)]),_:1},8,["disabled"])])):ee("",!0),p(A).canToggleAutoDownload?(y(),M("div",QDe,[C("span",eBe,[qe(N(p(n)("settings.autoDownloadUpdate"))+" ",1),C("span",tBe,N(p(n)("settings.autoDownloadUpdateHint")),1)]),j(p(ed),{"model-value":p(A).autoDownload.value,label:p(n)("settings.autoDownloadUpdate"),"onUpdate:modelValue":Oe[11]||(Oe[11]=Ge=>p(A).setAutoDownload(Ge))},null,8,["model-value","label"])])):ee("",!0)])]),e.config?(y(),M("section",nBe,[C("h3",oBe,N(p(n)("settings.privacy")),1),C("div",sBe,[C("div",iBe,[C("span",rBe,[qe(N(p(n)("settings.telemetry"))+" ",1),C("span",lBe,N(p(n)("settings.telemetryHint")),1),C("span",aBe,N(p(n)("settings.telemetryRestartHint")),1)]),j(p(ed),{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:p(n)("settings.telemetry"),"onUpdate:modelValue":Oe[12]||(Oe[12]=Ge=>ve())},null,8,["model-value","disabled","label"])])])])):ee("",!0),C("section",uBe,[C("h3",cBe,N(p(n)("settings.diagnostics")),1),C("div",dBe,[C("div",fBe,[C("span",pBe,[qe(N(p(n)("settings.exportLog"))+" ",1),C("span",hBe,N(p(n)("settings.exportLogHint")),1),p(Qr)()?ee("",!0):(y(),M("span",mBe,N(p(n)("settings.logHint")),1))]),j(p(Rt),{variant:"secondary",size:"sm",onClick:S},{default:me(()=>[qe(N(p(n)("settings.exportLogBtn")),1)]),_:1})])])])],512),[[qs,d.value==="advanced"]]),Bn(C("section",gBe,[C("div",vBe,[C("h4",yBe,N(p(n)("settings.archivedTitle")),1),C("p",kBe,N(p(n)("settings.archivedDesc")),1)]),C("div",bBe,[C("label",CBe,[Oe[17]||(Oe[17]=C("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[C("circle",{cx:"11",cy:"11",r:"7"}),C("path",{d:"m21 21-4.3-4.3"})],-1)),Bn(C("input",{"onUpdate:modelValue":Oe[13]||(Oe[13]=Ge=>ge.value=Ge),placeholder:p(n)("settings.archivedSearch")},null,8,wBe),[[ai,ge.value]])]),j(p(n3),{"model-value":Q.value,options:Se.value,size:"sm","aria-label":p(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Oe[14]||(Oe[14]=Ge=>Q.value=Ge)},null,8,["model-value","options","aria-label"]),j(p(wi),{size:"sm","model-value":te.value,options:[{value:"archived-desc",label:p(n)("settings.archivedSortArchived"),icon:"clock"},{value:"created-desc",label:p(n)("settings.archivedSortCreated"),icon:"calendar-schedule"},{value:"name-asc",label:p(n)("settings.archivedSortName"),icon:"sort"}],"onUpdate:modelValue":Oe[15]||(Oe[15]=Ge=>te.value=Ge)},null,8,["model-value","options"])]),fe.value?(y(),M("div",_Be,N(p(n)("settings.archivedLoadingAll")),1)):(y(),M(Pe,{key:1},[_e.value.length>0?(y(),M("div",xBe,[(y(!0),M(Pe,null,pt(_e.value,Ge=>(y(),M("section",{key:Ge.cwd,class:"archive-card"},[C("div",SBe,[j(p(Te),{name:"folder-closed",size:"md"}),C("span",ABe,N(Ge.cwd),1),C("span",MBe,N(p(n)("settings.archivedSessionsCount",{count:Ge.items.length})),1)]),C("div",TBe,[(y(!0),M(Pe,null,pt(Ge.items,at=>(y(),M("div",{key:at.id,class:"archive-row"},[C("div",EBe,[C("div",IBe,N(at.title),1),C("div",LBe,N(p(n)("settings.archivedAt",{time:it(at.updatedAt)})),1)]),j(p(Rt),{variant:"secondary",size:"sm",onClick:Tt=>Ee(at.id)},{default:me(()=>[j(p(Te),{name:"undo",size:"sm"}),C("span",null,N(p(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(y(),M("div",$Be,N(Y.value.length===0?p(n)("settings.archivedEmpty"):p(n)("settings.archivedNoMatch")),1))],64))],512),[[qs,d.value==="archived"]])],34)])],512)]),_:1},8,["aria-label"]))}}),RBe=ft(FBe,[["__scopeId","data-v-146a8c47"]]),OBe={class:"aw"},PBe={class:"crumbbar"},DBe={class:"crumbs"},BBe={key:0,class:"crumb-sep"},HBe=["onClick"],zBe={key:0,class:"filterbar"},WBe=["placeholder"],UBe={class:"folder-list"},jBe={key:0,class:"fl-loading"},VBe=["onClick"],qBe={class:"folder-name search-rel"},KBe={key:0,class:"fl-empty"},ZBe={key:1,class:"fl-loading"},GBe=["onClick"],YBe={class:"folder-name"},XBe={key:0,class:"fl-empty"},JBe={class:"paste-row"},QBe={class:"paste-input-wrap"},eHe={key:1,class:"add-error",role:"alert"},tHe={class:"actions"},nHe={class:"footer-hint"},oHe=600,sHe=6,_S=150,iHe=et({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z(!0),r=Z(!1),l=Z(!1),a=Z(""),u=Z(null),c=Z([]),d=Z(""),f=Z(!1),h=Z([]),m=R(()=>d.value.trim().length>0);let v=0,k=null;function w(U,z){const W=U.toLowerCase(),K=z.toLowerCase();let V=0;for(let ie=0;ie<K.length&&V<W.length;ie++)K[ie]===W[V]&&V++;return V===W.length}async function b(U){const z=a.value,W=U.trim();if(!z||W===""){h.value=[],f.value=!1;return}const K=++v;f.value=!0;const V=[],ie=[{path:z,depth:0}];let ne=0;for(;ie.length>0&&ne<oHe&&V.length<_S;){if(K!==v)return;const X=ie.shift();ne++;let le;try{le=await o.browseFs(X.path)}catch{continue}if(K!==v)return;for(const Ie of le.entries){if(!Ie.isDir)continue;const de=Ie.path.startsWith(z)?Ie.path.slice(z.length).replace(/^\/+/,""):Ie.path;if(w(W,de||Ie.name)&&(V.push({path:Ie.path,name:Ie.name,rel:de||Ie.name}),V.length>=_S))break;X.depth+1<sHe&&ie.push({path:Ie.path,depth:X.depth+1})}K===v&&(h.value=[...V])}K===v&&(f.value=!1)}Je(d,U=>{if(k&&clearTimeout(k),U.trim()===""){v++,h.value=[],f.value=!1;return}k=setTimeout(()=>void b(U),220)});const _=Z(!1),g=Z(""),x=R(()=>g.value.trim()),S=R(()=>{const U=a.value;if(!U)return[];const z=U.split("/").filter(Boolean),W=[{label:"/",path:"/"}];let K="";for(const V of z)K+=`/${V}`,W.push({label:V,path:K});return W}),T=R(()=>a.value.length>0);async function A(U){r.value=!0;try{const z=await o.browseFs(U);if(!z.path){l.value=!0;return}a.value=z.path,u.value=z.parent,c.value=z.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function E(U){U.isDir&&A(U.path)}function P(){u.value&&A(u.value)}function D(){T.value&&s("add",a.value)}function I(){x.value.length!==0&&s("add",x.value)}const{handleCompositionStart:$,handleCompositionEnd:B,isComposingKeyEvent:H}=Ar();function O(U){H(U)||I()}function F(U){U.key==="Escape"&&H(U)&&U.stopPropagation()}return dn(async()=>{r.value=!0;try{if(o.defaultPath&&(await A(o.defaultPath),!l.value))return;const U=await o.getFsHome();U.home?await A(U.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),bn(()=>{k&&clearTimeout(k)}),(U,z)=>(y(),he(p(ua),{open:i.value,"onUpdate:open":z[5]||(z[5]=W=>i.value=W),title:p(n)("workspace.addTitle"),size:"lg",height:"fixed",padded:!1,onClose:z[6]||(z[6]=W=>s("close"))},{default:me(()=>[C("div",OBe,[l.value?ee("",!0):(y(),M(Pe,{key:0},[C("div",PBe,[j(p(gn),{size:"sm",disabled:!u.value,label:p(n)("workspace.up"),tooltip:p(n)("workspace.up"),onClick:P},{default:me(()=>[j(p(Te),{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label","tooltip"]),C("div",DBe,[(y(!0),M(Pe,null,pt(S.value,(W,K)=>(y(),M(Pe,{key:W.path},[K>1?(y(),M("span",BBe,"/")):ee("",!0),C("button",{class:Re(["crumb",{last:K===S.value.length-1}]),onClick:V=>A(W.path)},N(W.label),11,HBe)],64))),128))])]),r.value?ee("",!0):(y(),M("div",zBe,[j(p(Te),{class:"filter-icon",name:"search",size:"md"}),Bn(C("input",{"onUpdate:modelValue":z[0]||(z[0]=W=>d.value=W),class:"filter-input",type:"text",placeholder:p(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:z[1]||(z[1]=It(()=>{},["stop"]))},null,40,WBe),[[ai,d.value]]),f.value?(y(),he(p(Ao),{key:0,size:"sm"})):ee("",!0)])),C("div",UBe,[r.value?(y(),M("div",jBe,N(p(n)("workspace.browsing")),1)):m.value?(y(),M(Pe,{key:1},[(y(!0),M(Pe,null,pt(h.value,W=>(y(),M("button",{key:W.path,class:"folder-row",onClick:K=>A(W.path)},[j(p(Te),{class:"dir-icon",name:"folder-closed",size:"sm"}),C("span",qBe,N(W.rel),1)],8,VBe))),128)),!f.value&&h.value.length===0?(y(),M("div",KBe,N(p(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(y(),M("div",ZBe,N(p(n)("workspace.searching")),1)):ee("",!0)],64)):(y(),M(Pe,{key:2},[(y(!0),M(Pe,null,pt(c.value,W=>(y(),M("button",{key:W.path,class:"folder-row",onClick:K=>E(W)},[j(p(Te),{class:"dir-icon",name:"folder-closed",size:"sm"}),C("span",YBe,N(W.name),1)],8,GBe))),128)),c.value.length===0?(y(),M("div",XBe,N(p(n)("workspace.noSubfolders")),1)):ee("",!0)],64))])],64)),C("div",{class:Re(["paste-section",{"paste-only":l.value}])},[!l.value&&!_.value?(y(),he(p(Rt),{key:0,variant:"ghost",size:"sm",onClick:z[2]||(z[2]=W=>_.value=!0)},{default:me(()=>[qe(N(p(n)("workspace.pasteToggle")),1)]),_:1})):(y(),he(p(IW),{key:1,label:p(n)("workspace.pathLabel")},{default:me(()=>[C("div",JBe,[C("div",QBe,[j(p(js),{modelValue:g.value,"onUpdate:modelValue":z[3]||(z[3]=W=>g.value=W),placeholder:p(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:[xl(It(O,["stop"]),["enter"]),F],onCompositionstart:p($),onCompositionend:p(B)},null,8,["modelValue","placeholder","onKeydown","onCompositionstart","onCompositionend"])]),j(p(gn),{disabled:x.value.length===0,label:p(n)("workspace.add"),tooltip:p(n)("workspace.add"),onClick:I},{default:me(()=>[j(p(Te),{name:"plus",size:"md"})]),_:1},8,["disabled","label","tooltip"])])]),_:1},8,["label"]))],2),e.error?(y(),M("div",eHe,N(e.error),1)):ee("",!0),C("div",tHe,[j(p(pn),{text:a.value},{default:me(()=>[l.value?ee("",!0):(y(),he(p(Rt),{key:0,variant:"primary",disabled:!T.value,onClick:D},{default:me(()=>[qe(N(p(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),j(p(Rt),{variant:"secondary",onClick:z[4]||(z[4]=W=>s("close"))},{default:me(()=>[qe(N(p(n)("workspace.cancel")),1)]),_:1})]),C("div",nHe,N(p(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),rHe=ft(iHe,[["__scopeId","data-v-fea98be5"]]),lHe={key:0,class:"confirm-dialog__message"},aHe=et({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt();function i(){n.loading||(o("update:open",!1),o("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),o("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),Vn(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(y(),he(p(ua),{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=u=>o("update:open",u)),onClose:i},{foot:me(()=>[j(p(Rt),{variant:"secondary",disabled:e.loading,onClick:i},{default:me(()=>[qe(N(e.cancelLabel??p(s)("common.cancel")),1)]),_:1},8,["disabled"]),j(p(Rt),{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=u=>o("confirm"))},{default:me(()=>[qe(N(e.confirmLabel??p(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:me(()=>[e.message?(y(),M("p",lHe,N(e.message),1)):ee("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),uHe=ft(aHe,[["__scopeId","data-v-aa5422da"]]),cHe=et({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=hu();function i(){s()}return(r,l)=>p(t)!==null?(y(),he(uHe,{key:0,open:!0,title:p(t).title,message:p(t).message,"confirm-label":p(t).confirmLabel,"cancel-label":p(t).cancelLabel,variant:p(t).variant,loading:p(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>p(o)(!1))},null,8,["title","message","confirm-label","cancel-label","variant","loading"])):ee("",!0)}}),dHe={class:"rows"},fHe={class:"row"},pHe={class:"row"},hHe={class:"row"},mHe={class:"row"},gHe={class:"row"},vHe={class:"row"},yHe={class:"ctx-text"},kHe={key:0,class:"bar"},bHe={class:"row"},CHe=et({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z(!0),r=R(()=>o.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100)))),l=R(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:Al(o.status.ctxUsed),max:Al(o.status.ctxMax),pct:r.value}):n("status.statusNone"));function a(m){return n(m==="yolo"?"status.permissionYolo":m==="auto"?"status.permissionAuto":"status.permissionManual")}const u=R(()=>{const m=o.status.permission;return m==="auto"?"var(--color-danger)":m==="yolo"?"var(--color-warning)":"var(--color-text)"}),c=R(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=R(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=R(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=R(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(m,v)=>(y(),he(p(ua),{open:i.value,"onUpdate:open":v[0]||(v[0]=k=>i.value=k),title:p(n)("status.statusPanelTitle"),onClose:v[1]||(v[1]=k=>s("close"))},{default:me(()=>[C("dl",dHe,[C("div",fHe,[C("dt",null,N(p(n)("status.statusModel")),1),C("dd",null,N(e.status.model),1)]),C("div",pHe,[C("dt",null,N(p(n)("status.statusThinking")),1),C("dd",null,N(e.thinking),1)]),C("div",hHe,[C("dt",null,N(p(n)("status.statusPermission")),1),C("dd",{style:Zt({color:u.value})},N(a(e.status.permission)),5)]),C("div",mHe,[C("dt",null,N(p(n)("status.statusPlanMode")),1),C("dd",{class:Re({"plan-on":e.planMode})},N(c.value),3)]),C("div",gHe,[C("dt",null,N(p(n)("status.statusSwarmMode")),1),C("dd",{class:Re({"swarm-on":e.swarmMode})},N(d.value),3)]),C("div",vHe,[C("dt",null,N(p(n)("status.statusContext")),1),C("dd",null,[C("span",yHe,N(l.value),1),e.status.ctxMax>0?(y(),M("span",kHe,[C("i",{style:Zt({width:r.value+"%"})},null,4)])):ee("",!0)])]),C("div",bHe,[C("dt",null,N(p(n)("status.statusCost")),1),C("dd",null,N(h.value),1)])])]),_:1},8,["open","title"]))}}),wHe=ft(CHe,[["__scopeId","data-v-340d1b31"]]),_He={key:0,class:"actions"},xHe=["onClick"],SHe=["onClick"],AHe={key:1,class:"details"},MHe=et({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt();function i(E){return typeof E=="object"&&E!==null}function r(E){return i(E)?E.title:E}function l(E){return i(E)?E.message??"":""}function a(E){return i(E)?E.details:void 0}function u(E){return i(E)?E.severity==="error":E.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(E)}function c(E){return i(E)?E.severity==="error"?"danger":E.severity==="success"?"success":E.severity==="info"?"info":"warning":u(E)?"danger":"warning"}function d(E){return i(E)?`notice:${E.severity}:${E.title}:${E.message??""}:${JSON.stringify(E.details??[])}`:`text:${E}`}function f(E){if(!i(E))return E;const P=[E.title];E.message&&P.push(E.message);const D=E.details??[];if(D.length>0){P.push("",`${s("warnings.diagnostics")}:`);for(const I of D)P.push(`${I.label}: ${I.value}`)}return P.join(`
637
+ `),n.member.summary]){const S=x?.trim();!S||_.has(S)||(_.add(S),g.push(S))}return g});Ln("pinScroll",()=>{r.value&&u()});function v(_){switch(_){case"queued":return s("tools.swarm.phaseQueued");case"working":return s("tools.swarm.phaseWorking");case"suspended":return s("tools.swarm.phaseSuspended");case"completed":return s("tools.swarm.phaseCompleted");case"failed":return s("tools.swarm.phaseFailed")}}const k=nn("modelDisplay"),w=nn("subagentEffort"),b=R(()=>{const _=[n.member.subagentType,k?.(n.member.model),w?.(n.member.thinkingEffort)].filter(g=>!!g);return _.length>0?_.join(" · "):void 0});return(_,g)=>(y(),M("div",bNe,[j(p(pc),{title:e.member.name,subtitle:b.value,"close-label":p(s)("thinking.close"),onClose:g[0]||(g[0]=x=>o("close"))},{default:me(()=>[j(p(Vr),{variant:"neutral",size:"sm"},{default:me(()=>[qe(N(v(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),C("div",{ref_key:"scroller",ref:r,class:"agent-transcript",onScrollPassive:g[6]||(g[6]=(...x)=>p(a)&&p(a)(...x))},[c.value?(y(),M(Pe,{key:0},[e.turns.length===0&&!e.loading&&(e.loadError||m.value.length>0)?(y(),M("div",CNe,[e.loadError?(y(),M("div",wNe,N(p(s)("tasks.transcriptLoadError")),1)):ee("",!0),m.value.length>0?(y(),he(dr,{key:1,lines:m.value},null,8,["lines"])):ee("",!0)])):(y(),he(e6,{key:1,turns:e.turns,"turn-active":e.running,"session-loading":e.loading&&e.turns.length===0,"has-more-messages":e.hasMore,"loading-more":e.loadingMore,"loading-more-error":e.loadMoreError,"is-following":p(l),"read-only":"",onLoadOlderMessages:g[1]||(g[1]=x=>o("loadOlderMessages")),onOpenAgent:g[2]||(g[2]=x=>o("openAgent",x)),onOpenFile:g[3]||(g[3]=x=>o("openFile",x)),onOpenMedia:g[4]||(g[4]=x=>o("openMedia",x)),onOpenTurnDiff:g[5]||(g[5]=x=>o("openTurnDiff",x))},null,8,["turns","turn-active","session-loading","has-more-messages","loading-more","loading-more-error","is-following"]))],64)):ee("",!0)],544)]))}}),xNe=ft(_Ne,[["__scopeId","data-v-95fdb6f0"]]),SNe={class:"sc"},ANe={key:0,class:"sc-empty"},MNe={key:2,class:"sc-loading"},TNe={class:"sc-composer"},ENe=["placeholder"],INe=["disabled"],LNe=et({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close","openMedia"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=R(()=>n.turns.find(x=>x.role==="user")?.text?.trim()??""),r=R(()=>n.title?.trim()||s("sideChat.title")),l=R(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=Z(""),u=Z(null),c=Z(null);function d(){const g=a.value.trim();g&&(o("send",g),a.value="",yt(()=>{u.value&&(u.value.style.height="auto"),f()}))}function f(){const g=c.value;g&&(g.scrollTop=g.scrollHeight)}Ln("pinScroll",g=>{const x=c.value;if(!x)return;const S=g.getBoundingClientRect().top;requestAnimationFrame(()=>{x.scrollTop+=g.getBoundingClientRect().top-S})});const h=R(()=>{const g=n.turns;if(g.length===0)return"0";const x=g.at(-1),S=x.thinking?.length??0,T=x.tools?.reduce((A,E)=>A+E.name.length+(E.arg?.length??0)+(E.output?.join("").length??0),0)??0;return`${g.length}:${x.text.length}:${S}:${T}`});Je(h,async()=>{!n.running&&!n.sending||(await yt(),f())});const m=R(()=>n.sending?n.turns.at(-1)?.role==="user":!1),{handleCompositionStart:v,handleCompositionEnd:k,isComposingKeyEvent:w}=Ar();function b(g){g.key==="Enter"&&!g.shiftKey&&!w(g)&&(g.preventDefault(),d())}function _(){const g=u.value;g&&(g.style.height="auto",g.style.height=`${Math.min(g.scrollHeight,160)}px`)}return(g,x)=>(y(),M("div",SNe,[j(p(pc),{title:r.value,subtitle:l.value,"close-label":p(s)("thinking.close"),onClose:x[0]||(x[0]=S=>o("close"))},null,8,["title","subtitle","close-label"]),C("div",{ref_key:"bodyRef",ref:c,class:"sc-body"},[e.turns.length===0?(y(),M("div",ANe,N(p(s)("sideChat.empty")),1)):(y(),he(e6,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running,"turn-files-interactive":!1,onOpenMedia:x[1]||(x[1]=S=>o("openMedia",S))},null,8,["turns","turn-active","working"])),m.value?(y(),M("div",MNe,[j(aF,{label:p(s)("conversation.requesting")},null,8,["label"])])):ee("",!0)],512),C("div",TNe,[Bn(C("textarea",{ref_key:"inputRef",ref:u,"onUpdate:modelValue":x[2]||(x[2]=S=>a.value=S),class:"sc-input",rows:"1",placeholder:p(s)("sideChat.placeholder"),onInput:_,onKeydown:b,onCompositionstart:x[3]||(x[3]=(...S)=>p(v)&&p(v)(...S)),onCompositionend:x[4]||(x[4]=(...S)=>p(k)&&p(k)(...S))},null,40,ENe),[[ai,a.value]]),j(p(pn),{text:p(s)("sideChat.send")},{default:me(()=>[C("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[j(p(Te),{name:"arrow-right",size:"sm"})],8,INe)]),_:1},8,["text"])])]))}}),$Ne=ft(LNe,[["__scopeId","data-v-753d11f0"]]),NNe={class:"changes-pane"},FNe={class:"dv-path"},RNe={class:"diff-head"},ONe={class:"back-label"},PNe={key:"loading",class:"empty-state diff-loading"},DNe={key:"lines",class:"dv-lines-wrap"},BNe={key:"empty",class:"empty-state"},HNe={class:"dv-change-count"},zNe={class:"ch-head"},WNe={class:"br-heading"},UNe={class:"br-label"},jNe={class:"br-name"},VNe={key:0,class:"sync-info"},qNe={key:0,class:"ahead"},KNe={key:0,class:"behind"},ZNe={key:1,class:"empty-head"},GNe={class:"ch-list-content"},YNe=["onClick"],XNe={class:"fpath"},JNe=["onClick"],QNe={class:"tree-name"},eFe=["onClick"],tFe={class:"tree-name"},nFe={key:2,class:"empty-state"},oFe={class:"empty-state-icon","aria-hidden":"true"},sFe={key:3,class:"empty-state"},iFe=et({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},fullTexts:{},emptyFile:{type:Boolean},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Nt();function o($){return n($===1?"diff.fileCountOne":"diff.fileCountOther",{number:$})}const s=e,i=t;function r($){const B=$.toLowerCase();return B==="modified"?"modified":B==="added"?"added":B==="deleted"?"deleted":B==="renamed"?"renamed":B==="untracked"?"untracked":B==="conflicted"?"conflicted":B==="ignored"?"ignored":B==="clean"?"clean":"unknown"}const l={modified:"M",added:"+",deleted:"−",renamed:"→",untracked:"+",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function a($){return l[r($)]??"?"}function u($,B=60){return $.length<=B?$:"…"+$.slice($.length-B+1)}const c=R(()=>s.gitInfo!==null),d=R(()=>s.changes.length>0),f=R(()=>(s.selectedDiffPath??null)!==null),h=R(()=>s.mode==="detail"||s.mode==="full"&&f.value),m=R(()=>s.fileDiff??[]),v=R(()=>s.fileDiffLoading===!0);function k($){i("open",$)}function w(){i("back")}function b(){i("close")}const _=Z("list");function g($){_.value=$}function x($){const B={children:[]},H=[...$].sort((O,F)=>O.path.localeCompare(F.path));for(const O of H){const F=O.path.endsWith("/"),U=O.path.split("/").filter(Boolean);if(U.length===0)continue;let z=B;for(let W=0;W<U.length;W++){const K=U[W],V=W===U.length-1&&!F,ie=U.slice(0,W+1).join("/");let ne=z.children.find(X=>X.name===K&&X.kind===(V?"file":"folder"));ne||(ne={name:K,path:ie,kind:V?"file":"folder",status:V?O.status:void 0,children:[]},z.children.push(ne)),z=ne}}return B.children}const S=R(()=>x(s.changes)),T=Z(new Set);function A($){return!T.value.has($)}const E=R(()=>{const $=[];function B(H,O){for(const F of H)$.push({node:F,depth:O}),F.kind==="folder"&&A(F.path)&&B(F.children,O+1)}return B(S.value,0),$});function P($){const B=new Set(T.value);B.has($.path)?B.delete($.path):B.add($.path),T.value=B}function D($){return`calc(var(--tree-base-indent) + ${$} * var(--tree-indent-step))`}function I($){return{paddingLeft:D($),"--tree-depth":String($)}}return($,B)=>(y(),M("div",NNe,[h.value?(y(),M(Pe,{key:0},[j(p(pc),{title:p(n)("diff.title"),closable:e.closable,"close-label":p(n)("diff.close"),onClose:b},{default:me(()=>[j(p(pn),{text:e.selectedDiffPath??""},{default:me(()=>[C("span",FNe,N(u(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),C("div",RNe,[e.hideBack?ee("",!0):(y(),he(p(Rt),{key:0,variant:"ghost",size:"sm",onClick:w},{default:me(()=>[j(p(Te),{name:"arrow-left",size:"sm"}),C("span",ONe,N(p(n)("diff.back")),1)]),_:1}))]),j(as,{name:"diff-content",mode:"out-in"},{default:me(()=>[v.value?(y(),M("div",PNe,[j(p(Ao),{size:"md"}),C("span",null,N(p(n)("diff.loading")),1)])):m.value.length>0?(y(),M("div",DNe,[j(Ur,{lines:m.value,path:e.selectedDiffPath??void 0,"line-numbers":"",framed:!1,"full-texts":e.fullTexts??null},null,8,["lines","path","full-texts"])])):(y(),M("div",BNe,N(e.emptyFile?p(n)("diff.emptyFile"):p(n)("diff.noDiff")),1))]),_:1})],64)):(y(),M(Pe,{key:1},[j(p(pc),{title:p(n)("diff.title"),closable:e.closable,"close-label":p(n)("diff.close"),onClose:b},{default:me(()=>[C("span",HNe,N(o(e.changes.length)),1),j(p(wi),{"model-value":_.value,size:"sm",options:[{value:"list",label:p(n)("diff.list"),icon:"list"},{value:"tree",label:p(n)("diff.tree"),icon:"tree-view"}],"onUpdate:modelValue":g},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),C("div",zNe,[c.value?(y(),M(Pe,{key:0},[C("span",WNe,[j(p(Te),{class:"br-icon",name:"git-fork",size:"sm"}),C("span",UNe,N(p(n)("diff.branch")),1)]),C("span",jNe,N(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(y(),M("span",VNe,[j(p(pn),{text:p(n)("diff.aheadTitle")},{default:me(()=>[e.gitInfo.ahead>0?(y(),M("span",qNe,"↑"+N(e.gitInfo.ahead),1)):ee("",!0)]),_:1},8,["text"]),j(p(pn),{text:p(n)("diff.behindTitle")},{default:me(()=>[e.gitInfo.behind>0?(y(),M("span",KNe,"↓"+N(e.gitInfo.behind),1)):ee("",!0)]),_:1},8,["text"])])):ee("",!0)],64)):(y(),M("span",ZNe,N(p(n)("diff.empty")),1))]),d.value&&_.value==="list"?(y(),he(p(Pk),{key:0,class:"ch-list"},{default:me(()=>[C("div",GNe,[(y(!0),M(Pe,null,pt(e.changes,H=>(y(),he(p(pn),{key:H.path,text:H.path},{default:me(()=>[C("button",{type:"button",class:"ch-row",onClick:O=>k(H.path)},[C("span",{class:Re(["badge",r(H.status)])},N(a(H.status)),3),C("span",XNe,N(u(H.path)),1)],8,YNe)]),_:2},1032,["text"]))),128))])]),_:1})):d.value&&_.value==="tree"?(y(),he(p(Pk),{key:1,class:"ch-list ch-tree"},{default:me(()=>[j(YA,{name:"tree-collapse",tag:"ul",class:"tree-list ch-list-content"},{default:me(()=>[(y(!0),M(Pe,null,pt(E.value,({node:H,depth:O})=>(y(),M("li",{key:H.path,class:"tree-node"},[H.kind==="folder"?(y(),M("button",{key:0,type:"button",class:"tree-row tree-folder",style:Zt(I(O)),onClick:F=>P(H)},[j(p(Te),{class:"tree-icon",name:"folder-solid",size:"sm"}),C("span",QNe,N(H.name),1)],12,JNe)):(y(),he(p(pn),{key:1,text:H.path},{default:me(()=>[C("button",{type:"button",class:"tree-row tree-file",style:Zt(I(O)),onClick:F=>k(H.path)},[C("span",{class:Re(["badge",r(H.status)])},N(a(H.status)),3),C("span",tFe,N(H.name),1)],12,eFe)]),_:2},1032,["text"]))]))),128))]),_:1})]),_:1})):c.value?(y(),M("div",nFe,[C("span",oFe,[j(p(Te),{name:"check",size:"lg"})]),qe(" "+N(p(n)("diff.clean")),1)])):(y(),M("div",sFe,N(p(n)("diff.empty")),1))],64))]))}}),rFe=ft(iFe,[["__scopeId","data-v-7d5ab9c7"]]),lFe={class:"td"},aFe={class:"td-path"},uFe={class:"td-body"},cFe={key:1,class:"td-empty"},dFe=et({__name:"TurnDiffPanel",props:{change:{},cwd:{},closable:{type:Boolean}},emits:["close","openFile"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=R(()=>{const a=n.cwd?h2(n.change.path,n.cwd):null;return r(a??n.change.path)});function r(a,u=48){return!a||a.length<=u?a:"…"+a.slice(a.length-u+1)}const l=R(()=>n.change.diff!==null&&n.change.diff.length>0);return(a,u)=>(y(),M("div",lFe,[j(p(pc),{title:p(s)("conversation.turnFiles.diffTitle"),closable:e.closable,"close-label":p(s)("filePreview.close"),onClose:u[1]||(u[1]=c=>o("close"))},{default:me(()=>[j(p(pn),{text:e.change.path},{default:me(()=>[C("span",aFe,N(i.value),1)]),_:1},8,["text"]),j(p(gn),{size:"sm",label:p(s)("conversation.turnFiles.openFile"),tooltip:p(s)("conversation.turnFiles.openFile"),onClick:u[0]||(u[0]=c=>o("openFile",e.change.path))},{default:me(()=>[j(p(Te),{name:"external-link",size:"md"})]),_:1},8,["label","tooltip"])]),_:1},8,["title","closable","close-label"]),C("div",uFe,[l.value?(y(),he(Ur,{key:0,lines:e.change.diff,path:e.change.path,framed:!1},null,8,["lines","path"])):(y(),M("div",cFe,[C("p",null,N(p(s)("conversation.turnFiles.diffUnavailable")),1),j(p(Rt),{variant:"ghost",size:"sm",onClick:u[2]||(u[2]=c=>o("openFile",e.change.path))},{default:me(()=>[qe(N(p(s)("conversation.turnFiles.openFile")),1)]),_:1})]))])]))}}),fFe=ft(dFe,[["__scopeId","data-v-fdd0bc05"]]);function gF(e,t){let n=null;dn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,yt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),Vn(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const pFe={class:"search-wrap"},hFe=["aria-label"],mFe=["aria-label"],gFe=["aria-pressed","onClick"],vFe={key:1,class:"state-row"},yFe={key:2,class:"state-row unavail"},kFe=["aria-label"],bFe=["aria-selected","onClick","onMouseenter"],CFe={class:"model-main"},wFe={class:"model-name"},_Fe={class:"model-meta"},xFe={class:"model-side"},SFe={key:0,class:"empty"},AFe={class:"footer-hint","aria-hidden":"true"},MFe=et({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=R(()=>new Set(o.starredIds??[]));function r(D){return i.value.has(D)}const l=Z(""),a=Z(null),u=Z(null),c=Z(null),d=Z("all"),f={image_in:"model.capabilityImageInput",video_in:"model.capabilityVideoInput",tool_use:"model.capabilityToolUse",thinking:"model.capabilityThinking",always_thinking:"model.capabilityAlwaysThinking"};function h(D){const I=f[D];return I?n(I):D.replaceAll("_"," ")}function m(D){const I=[D.provider,n("model.contextSuffix",{size:Al(D.maxContextSize)})];for(const $ of D.capabilities??[])I.push(h($));return I.join(" · ")}gF(u,a);const v=R(()=>{const D=new Set,I=[{id:"all",label:n("model.allTab")}];for(const $ of o.models)D.has($.provider)||(D.add($.provider),I.push({id:$.provider,label:$.provider}));return I}),k=R(()=>{const D=l.value.toLowerCase().trim(),I=o.models.filter($=>{if(d.value!=="all"&&$.provider!==d.value)return!1;const B=($.displayName??$.model).toLowerCase().includes(D),H=$.provider.toLowerCase().includes(D),O=$.id.toLowerCase().includes(D);return!D||B||H||O});return d.value!=="all"?I:I.sort(($,B)=>{const H=r($.id)?1:0;return(r(B.id)?1:0)-H})}),w=R(()=>k.value),b=Z(0);Je([l,d],()=>{b.value=0}),Je(v,D=>{D.some(I=>I.id===d.value)||(d.value="all")}),Je(w,D=>{b.value=Math.min(b.value,Math.max(D.length-1,0))}),Je(b,async()=>{await yt(),c.value?.querySelector(".model-row.is-selected")?.scrollIntoView({block:"nearest"})});const{handleCompositionStart:_,handleCompositionEnd:g,isComposingKeyEvent:x}=Ar();function S(D){if(!x(D)){if(D.key==="Escape"){s("close");return}if(D.key==="ArrowDown")D.preventDefault(),b.value=Math.min(b.value+1,w.value.length-1);else if(D.key==="ArrowUp")D.preventDefault(),b.value=Math.max(b.value-1,0);else if(D.key==="Enter"){const I=w.value[b.value];I&&s("select",I.id)}}}dn(()=>{document.addEventListener("keydown",S)}),bn(()=>{document.removeEventListener("keydown",S)});function T(D){s("select",D)}function A(){l.value="",a.value?.focus()}function E(D){return w.value.indexOf(D)}function P(D){d.value=D}return(D,I)=>(y(),he(p(ua),{open:!0,"close-on-esc":!1,title:p(n)("model.title"),size:"lg",height:"fixed",padded:!1,onClose:I[1]||(I[1]=$=>s("close"))},{default:me(()=>[C("div",{ref_key:"dialogRef",ref:u,class:"mp"},[C("div",pFe,[j(p(js),{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=$=>l.value=$),placeholder:p(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:"",onCompositionstart:p(_),onCompositionend:p(g)},null,8,["modelValue","placeholder","onCompositionstart","onCompositionend"]),j(p(pn),{text:p(n)("model.clearSearch")},{default:me(()=>[C("button",{type:"button",class:Re(["search-clear",{"is-on":l.value.length>0}]),tabindex:"-1","aria-label":p(n)("model.clearSearch"),onClick:A},[j(p(Te),{name:"close",size:"sm"})],10,hFe)]),_:1},8,["text"])]),v.value.length>1?(y(),M("div",{key:0,class:"chip-strip","aria-label":p(n)("model.providerTabs")},[(y(!0),M(Pe,null,pt(v.value,$=>(y(),M("button",{key:$.id,type:"button",class:Re(["chip",{"is-active":$.id===d.value}]),"aria-pressed":$.id===d.value,onClick:B=>P($.id)},N($.label),11,gFe))),128))],8,mFe)):ee("",!0),e.loading?(y(),M("div",vFe,[j(p(Ao),{size:"sm"}),C("span",null,N(p(n)("model.loading")),1)])):e.unavailable?(y(),M("div",yFe,[j(p(Te),{name:"alert-triangle",size:"lg"}),C("span",null,N(p(n)("model.unavailable")),1)])):(y(),M("div",{key:3,ref_key:"listRef",ref:c,class:"model-list",role:"listbox","aria-label":p(n)("model.title")},[(y(!0),M(Pe,null,pt(w.value,$=>(y(),M("div",{key:$.id,class:Re(["model-row",{"is-current":$.id===e.current,"is-selected":E($)===b.value}]),role:"option","aria-selected":$.id===e.current,onClick:B=>T($.id),onMouseenter:B=>b.value=E($)},[C("span",CFe,[C("span",wFe,N($.displayName??$.model),1),C("span",_Fe,N(m($)),1)]),C("span",xFe,[$.id===e.current?(y(),he(p(Te),{key:0,class:"model-check",name:"check",size:"sm"})):ee("",!0),j(p(gn),{class:Re(["model-star",{"is-starred":r($.id)}]),size:"sm",label:r($.id)?p(n)("model.unstarTitle"):p(n)("model.starTitle"),tooltip:r($.id)?p(n)("model.unstarTitle"):p(n)("model.starTitle"),onClick:It(B=>s("toggle-star",$.id),["stop"])},{default:me(()=>[r($.id)?(y(),he(p(Te),{key:0,name:"star",size:"md"})):(y(),he(p(Te),{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["class","label","tooltip","onClick"])])],42,bFe))),128)),w.value.length===0?(y(),M("div",SFe,N(o.models.length===0?p(n)("model.emptyNoModels"):p(n)("model.emptyNoMatch")),1)):ee("",!0)],8,kFe)),C("div",AFe,[j(p(oa),{keys:["↑","↓"]}),C("span",null,N(p(n)("model.hintNavigate")),1),I[2]||(I[2]=C("span",{class:"hint-dot"},"·",-1)),j(p(oa),{keys:["Enter"]}),C("span",null,N(p(n)("model.hintSelect")),1),I[3]||(I[3]=C("span",{class:"hint-dot"},"·",-1)),j(p(oa),{keys:["Esc"]}),C("span",null,N(p(n)("model.hintClose")),1)])],512)]),_:1},8,["title"]))}}),TFe=ft(MFe,[["__scopeId","data-v-3ba22330"]]),EFe=3;function vF(e){const t=Z("starting"),n=Z(!1),o=Z(null),s=Z(0);let i=null,r=null,l=null,a=0,u=!1,c=!1;function d(){i&&(clearTimeout(i),i=null),r&&(clearInterval(r),r=null),l&&(clearTimeout(l),l=null)}function f(w){d(),t.value="success",l=setTimeout(()=>{l=null,e.onSuccess?.()},w)}function h(){r&&clearInterval(r),r=setInterval(()=>{s.value>0?s.value--:(r&&clearInterval(r),r=null)},1e3)}function m(w){i&&clearTimeout(i),i=setTimeout(async()=>{const b=await e.onPollOAuthLogin();if(!c){if(b===null){if(a+=1,a>=EFe){d(),n.value=!0,t.value="error";return}m(w);return}a=0,b.status==="authenticated"?f(1200):b.status==="expired"||b.status==="cancelled"?(d(),t.value="expired"):m(w)}},w*1e3)}async function v(){d(),o.value=null,n.value=!1,a=0,u=!1,t.value="starting";const w=await e.onStartOAuthLogin();if(c){w!==null&&w.status!=="authenticated"&&e.onCancelOAuthLogin();return}if(!w){t.value="error";return}if(w.status==="authenticated"){f(800);return}o.value={flowId:w.flowId,verificationUri:w.verificationUri,verificationUriComplete:w.verificationUriComplete,userCode:w.userCode,expiresIn:w.expiresIn,interval:w.interval},s.value=w.expiresIn,t.value="device-code",h(),m(w.interval)}function k(){t.value!=="success"&&(d(),t.value==="device-code"&&!u&&(u=!0,e.onCancelOAuthLogin()))}return Kg()&&d1(()=>{c=!0,k()}),{step:t,pollError:n,flow:o,secondsLeft:s,startFlow:v,cancelFlow:k}}const IFe={key:0,class:"center-body"},LFe={class:"center-text"},$Fe={key:1,class:"nb"},NFe={class:"nb-lead"},FFe=["href"],RFe={class:"nb-code-row"},OFe=["title"],PFe={class:"nb-status"},DFe={class:"nb-status-text"},BFe={class:"nb-countdown"},HFe={key:2,class:"center-body"},zFe={class:"center-text success-text"},WFe={class:"center-hint"},UFe={class:"center-body"},jFe={class:"center-text err-text"},VFe={class:"center-hint"},qFe={class:"actions"},KFe={class:"center-body"},ZFe={class:"center-text warn-text"},GFe={class:"center-hint"},YFe={class:"actions"},XFe=et({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=Z(!0),s=t,i=e,{step:r,pollError:l,flow:a,secondsLeft:u,startFlow:c,cancelFlow:d}=vF({onStartOAuthLogin:i.onStartOAuthLogin,onPollOAuthLogin:i.onPollOAuthLogin,onCancelOAuthLogin:i.onCancelOAuthLogin,onSuccess:()=>{s("success"),s("close")}}),f=Z(!1);dn(async()=>{await c()});async function h(){!a.value||!await Zs(a.value.verificationUriComplete)||(f.value=!0,setTimeout(()=>{f.value=!1},2e3))}async function m(){d(),s("close")}function v(k){const w=Math.floor(k/60),b=k%60;return`${w}:${String(b).padStart(2,"0")}`}return(k,w)=>(y(),he(p(ua),{open:o.value,"onUpdate:open":w[0]||(w[0]=b=>o.value=b),title:p(n)("login.title"),"close-on-overlay":!1,onClose:m},{default:me(()=>[p(r)==="starting"?(y(),M("div",IFe,[j(p(Ao),{size:"md"}),C("span",LFe,N(p(n)("login.starting")),1)])):p(r)==="device-code"&&p(a)?(y(),M("div",$Fe,[C("div",NFe,N(p(n)("login.lead")),1),C("a",{class:"nb-primary",href:p(a).verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[qe(N(p(n)("login.authorizeInBrowser"))+" ",1),j(p(Te),{name:"external-link",size:"sm"})],8,FFe),C("div",RFe,[C("span",{class:"nb-link",title:p(a).verificationUriComplete},N(p(a).verificationUriComplete),9,OFe),j(p(Rt),{class:Re(["nb-copy",{"is-copied":f.value}]),variant:"secondary",size:"sm",onClick:h},{default:me(()=>[f.value?(y(),M(Pe,{key:0},[j(p(Te),{name:"check",size:"sm"}),qe(" "+N(p(n)("login.copied")),1)],64)):(y(),M(Pe,{key:1},[j(p(Te),{name:"copy",size:"sm"}),qe(" "+N(p(n)("login.copyLink")),1)],64))]),_:1},8,["class"])]),C("div",PFe,[j(p(Ao),{size:"sm",label:p(n)("login.waitingAuth")},null,8,["label"]),C("span",DFe,N(p(n)("login.waitingAutoClose")),1),C("span",BFe,N(v(p(u))),1)])])):p(r)==="success"?(y(),M("div",HFe,[j(p(Dd),{kind:"success"}),C("span",zFe,N(p(n)("login.success")),1),C("span",WFe,N(p(n)("login.successHint")),1)])):p(r)==="expired"?(y(),M(Pe,{key:3},[C("div",UFe,[j(p(Dd),{kind:"expired"}),C("span",jFe,N(p(n)("login.expiredTitle")),1),C("span",VFe,N(p(n)("login.expiredHint")),1)]),C("div",qFe,[j(p(Rt),{variant:"primary",onClick:p(c)},{default:me(()=>[qe(N(p(n)("login.retry")),1)]),_:1},8,["onClick"]),j(p(Rt),{variant:"secondary",onClick:m},{default:me(()=>[qe(N(p(n)("login.closeBtn")),1)]),_:1})])],64)):p(r)==="error"?(y(),M(Pe,{key:4},[C("div",KFe,[j(p(Dd),{kind:"error"}),C("span",ZFe,N(p(l)?p(n)("login.pollErrorTitle"):p(n)("login.errorTitle")),1),C("span",GFe,N(p(l)?p(n)("login.pollErrorHint"):p(n)("login.errorHint")),1)]),C("div",YFe,[j(p(Rt),{variant:"primary",onClick:p(c)},{default:me(()=>[qe(N(p(n)("login.retry")),1)]),_:1},8,["onClick"]),j(p(Rt),{variant:"secondary",onClick:m},{default:me(()=>[qe(N(p(n)("login.closeBtn")),1)]),_:1})])],64)):ee("",!0)]),_:1},8,["open","title"]))}}),JFe=ft(XFe,[["__scopeId","data-v-c798a107"]]),yF=et({__name:"LanguageSwitcher",props:{size:{default:"md"}},setup(e){const{locale:t}=Nt(),n=yg.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&E5(s)}return(s,i)=>(y(),he(p(wi),{"model-value":p(t),options:p(n),size:e.size,"onUpdate:modelValue":o},null,8,["model-value","options","size"]))}}),QFe={class:"msg"},eRe={class:"pf-field"},tRe={class:"pf-field-label"},nRe={class:"pf-field"},oRe={class:"pf-field-label"},sRe={class:"pf-field"},iRe={class:"pf-field-label"},rRe={class:"pf-key-wrap"},lRe={class:"pf-field"},aRe={class:"pf-field-label"},uRe={class:"pf-field"},cRe={class:"pf-field-label"},dRe={class:"pf-models"},fRe={key:0,class:"pf-models-empty"},pRe={class:"pf-model-grid pf-model-head"},hRe={key:1},mRe={key:0},gRe={class:"pf-foot"},vRe={key:0,class:"pf-managed-note"},yRe={class:"pf-confirm-msg"},kRe=et({__name:"ProviderForm",props:{mode:{},provider:{},guard:{type:Boolean}},emits:["dirtyChange","guardStay","guardDiscard","added","saved","deleting","deleted","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=mu(),r=Go({id:"",type:"openai",apiKey:"",baseUrl:"",models:[rh()]}),l=Z(""),a=Z(!1),u=Z(!1),c=Z(!1),d=R(()=>n.mode==="add"),f=R(()=>n.provider!==void 0&&mE(n.provider)),h=R(()=>{const $=n.provider;return $===void 0?0:w3($,i.config.value?.models).length}),m=R(()=>f.value&&h.value===0),v=R(()=>DJ.map($=>({value:$,label:s(`providers.types.${$}`)}))),k=R(()=>f.value?s("providers.apiKeyManaged"):!d.value&&n.provider?.hasApiKey===!0?s("providers.apiKeySet"):"sk-…");function w(){l.value="",u.value=!1;const $=n.provider;if(d.value||$===void 0){r.id="",r.type="openai",r.apiKey="",r.baseUrl="",r.models=[rh()];return}r.id=$.id,r.type=$.type,r.apiKey="",r.baseUrl=$.baseUrl??"";const B=w3($,i.config.value?.models);r.models=B.length>0?B:[rh()]}dn(()=>{w(),g()});const b=Z(!1),_=Z(!1);async function g(){const $=n.provider;if(!(d.value||$===void 0||f.value||$.hasApiKey!==!0))try{const B=await i.getProvider($.id);if(_.value)return;B.apiKey!==void 0&&B.apiKey!==""&&(r.apiKey=B.apiKey,b.value=!0)}catch{}}function x(){o("dirtyChange",!0)}const S=Z(!1),T=Z();function A($){l.value=$,yt(()=>T.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}async function E(){if(a.value)return;const $=BJ(r,{requireApiKey:d.value,requireBaseUrl:d.value});if($!==null){A(s(`providers.error.${$}`));return}l.value="",a.value=!0;try{if(d.value){const B=await i.addProvider(HJ(r));if(B!==null){A(B);return}o("dirtyChange",!1),i.notify({severity:"success",title:s("providers.added")}),o("added",r.id.trim())}else{const B=n.provider;if(B===void 0)return;const H=i.config.value?.providers?.[B.id]?.defaultModel,O=await i.updateProvider(B.id,zJ(r,B,{includeBlankApiKey:b.value,existingDefaultModel:H}));if(O!==null){A(O);return}await i.checkAuth(),i.notify({severity:"success",title:s("providers.saved")}),o("dirtyChange",!1),o("saved",r.id.trim())}}finally{a.value=!1}}async function P(){const $=n.provider;if(!($===void 0||c.value)){c.value=!0,o("deleting"),await new Promise(B=>setTimeout(B,300));try{if(await i.deleteProvider($.id)===null){u.value=!1;return}o("dirtyChange",!1),o("deleted",$.id)}finally{c.value=!1}}}function D(){r.models.push(rh()),x()}function I($){r.models.length<=1||(r.models.splice($,1),x())}return($,B)=>(y(),M("div",{class:"pf-form",onInput:x},[e.guard?(y(),he(p(qu),{key:0,variant:"warning",class:"pf-guard"},{default:me(()=>[C("span",QFe,N(p(s)("providers.unsavedGuard")),1),j(p(Rt),{variant:"secondary",size:"sm",onClick:B[0]||(B[0]=H=>o("guardStay"))},{default:me(()=>[qe(N(p(s)("providers.guardStay")),1)]),_:1}),j(p(Rt),{variant:"danger",size:"sm",onClick:B[1]||(B[1]=H=>o("guardDiscard"))},{default:me(()=>[qe(N(p(s)("providers.guardDiscard")),1)]),_:1})]),_:1})):ee("",!0),l.value?(y(),M("div",{key:1,ref_key:"errorBox",ref:T},[j(p(qu),{variant:"danger"},{default:me(()=>[qe(N(l.value),1)]),_:1})],512)):ee("",!0),C("div",eRe,[C("label",tRe,[qe(N(p(s)("providers.fieldId")),1),B[11]||(B[11]=C("span",{class:"req"}," *",-1))]),j(p(js),{modelValue:r.id,"onUpdate:modelValue":B[2]||(B[2]=H=>r.id=H),placeholder:"my-openai",disabled:f.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","disabled"])]),C("div",nRe,[C("label",oRe,[qe(N(p(s)("providers.fieldType")),1),B[12]||(B[12]=C("span",{class:"req"}," *",-1))]),j(p(n3),{"model-value":r.type,options:v.value,disabled:f.value,"onUpdate:modelValue":B[3]||(B[3]=H=>{r.type=H,x()})},null,8,["model-value","options","disabled"])]),C("div",sRe,[C("label",iRe,[qe(N(p(s)("providers.fieldApiKey")),1),B[13]||(B[13]=C("span",{class:"req"}," *",-1))]),C("div",rRe,[j(p(js),{modelValue:r.apiKey,"onUpdate:modelValue":B[4]||(B[4]=H=>r.apiKey=H),type:S.value?"text":"password",placeholder:k.value,disabled:f.value,autocomplete:"off",spellcheck:"false",onInput:B[5]||(B[5]=H=>_.value=!0)},null,8,["modelValue","type","placeholder","disabled"]),f.value?ee("",!0):(y(),he(p(gn),{key:0,class:"pf-key-eye",size:"sm",label:p(s)(S.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(s)(S.value?"providers.hideApiKey":"providers.showApiKey"),onClick:B[6]||(B[6]=H=>S.value=!S.value)},{default:me(()=>[j(p(Te),{name:S.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"]))])]),C("div",lRe,[C("label",aRe,[qe(N(p(s)("providers.fieldBaseUrl")),1),B[14]||(B[14]=C("span",{class:"req"}," *",-1))]),j(p(js),{modelValue:r.baseUrl,"onUpdate:modelValue":B[7]||(B[7]=H=>r.baseUrl=H),placeholder:p(s)("providers.baseUrlPlaceholder"),disabled:f.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder","disabled"])]),C("div",uRe,[C("label",cRe,[qe(N(p(s)("providers.fieldModels")),1),B[15]||(B[15]=C("span",{class:"req"}," *",-1))]),C("div",dRe,[m.value?(y(),M("div",fRe,N(p(s)("providers.noModels")),1)):(y(),M(Pe,{key:1},[C("div",pRe,[C("span",null,[qe(N(p(s)("providers.colModelId")),1),B[16]||(B[16]=C("span",{class:"req"}," *",-1))]),C("span",null,[qe(N(p(s)("providers.colContext")),1),B[17]||(B[17]=C("span",{class:"req"}," *",-1))]),C("span",null,N(p(s)("providers.colDisplayName")),1),B[18]||(B[18]=C("span",null,null,-1))]),(y(!0),M(Pe,null,pt(r.models,(H,O)=>(y(),M("div",{key:O,class:"pf-model-grid"},[j(p(js),{modelValue:H.model,"onUpdate:modelValue":F=>H.model=F,placeholder:p(s)("providers.modelIdPlaceholder"),disabled:f.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),j(p(js),{modelValue:H.maxContextSize,"onUpdate:modelValue":F=>H.maxContextSize=F,inputmode:"numeric",placeholder:p(s)("providers.modelContextPlaceholder"),disabled:f.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),j(p(js),{modelValue:H.displayName,"onUpdate:modelValue":F=>H.displayName=F,placeholder:p(s)("providers.modelNamePlaceholder"),disabled:f.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),f.value?(y(),M("span",hRe)):(y(),he(p(gn),{key:0,size:"sm",label:p(s)("providers.removeModel"),tooltip:p(s)("providers.removeModel"),disabled:r.models.length<=1,onClick:F=>I(O)},{default:me(()=>[j(p(Te),{name:"trash",size:"sm"})]),_:1},8,["label","tooltip","disabled","onClick"]))]))),128)),f.value?ee("",!0):(y(),M("div",mRe,[j(p(Rt),{variant:"ghost",size:"sm",onClick:D},{default:me(()=>[j(p(Te),{name:"plus",size:"sm"}),qe(" "+N(p(s)("providers.addModel")),1)]),_:1})]))],64))])]),C("div",gRe,[f.value?(y(),M("span",vRe,N(p(s)("providers.managedHint")),1)):d.value?(y(),M(Pe,{key:1},[j(p(Rt),{variant:"secondary",size:"sm",onClick:B[8]||(B[8]=H=>o("cancel"))},{default:me(()=>[qe(N(p(s)("common.cancel")),1)]),_:1}),j(p(Rt),{variant:"primary",size:"sm",disabled:a.value,onClick:E},{default:me(()=>[qe(N(p(s)("providers.addProvider")),1)]),_:1},8,["disabled"])],64)):u.value&&n.provider!==void 0?(y(),M(Pe,{key:2},[C("span",yRe,N(p(s)("providers.deleteConfirm",{id:n.provider.id,count:h.value})),1),B[19]||(B[19]=C("span",{class:"spacer"},null,-1)),j(p(Rt),{variant:"secondary",size:"sm",disabled:c.value,onClick:B[9]||(B[9]=H=>u.value=!1)},{default:me(()=>[qe(N(p(s)("common.cancel")),1)]),_:1},8,["disabled"]),j(p(Rt),{variant:"danger",size:"sm",disabled:c.value,onClick:P},{default:me(()=>[qe(N(p(s)("providers.deleteConfirmYes")),1)]),_:1},8,["disabled"])],64)):(y(),M(Pe,{key:3},[j(p(Rt),{variant:"danger-soft",size:"sm",onClick:B[10]||(B[10]=H=>u.value=!0)},{default:me(()=>[qe(N(p(s)("providers.deleteProvider")),1)]),_:1}),B[20]||(B[20]=C("span",{class:"spacer"},null,-1)),j(p(Rt),{variant:"primary",size:"sm",disabled:a.value,onClick:E},{default:me(()=>[qe(N(p(s)("providers.save")),1)]),_:1},8,["disabled"])],64))])],32))}}),kF=ft(kRe,[["__scopeId","data-v-ac0597e3"]]),bRe={class:"af"},CRe={class:"msg"},wRe={key:2,class:"af-catalog"},_Re={key:0,class:"af-center"},xRe={key:1,class:"af-error"},SRe={class:"af-list"},ARe=["disabled","onClick"],MRe={class:"af-entry-name"},TRe={key:1,class:"af-entry-reason"},ERe={key:2,class:"af-entry-count"},IRe={key:0,class:"af-empty"},LRe={class:"af-field"},$Re={class:"af-label"},NRe={class:"af-field"},FRe={class:"af-label"},RRe={class:"af-key-wrap"},ORe={key:0,class:"af-field"},PRe={class:"af-label"},DRe={class:"af-note"},BRe={class:"af-foot"},HRe={class:"af-hint"},zRe={class:"af-field"},WRe={class:"af-label"},URe={class:"af-field"},jRe={class:"af-label"},VRe={class:"af-key-wrap"},qRe={class:"af-foot"},KRe={class:"af-manual"},ZRe=et({__name:"AddProviderFlow",props:{guard:{type:Boolean}},emits:["dirtyChange","guardStay","guardDiscard","added","cancel"],setup(e,{emit:t}){const n=t,{t:o,te:s}=Nt(),i=mu(),r=Z("catalog"),l=R(()=>[{value:"catalog",label:o("providers.catalog.sourceCatalog")},{value:"registry",label:o("providers.catalog.sourceRegistry")},{value:"manual",label:o("providers.catalog.sourceManual")}]),a=Z("loading"),u=Z([]);async function c(){a.value="loading";const U=await i.loadCatalogProviders();U.kind==="ok"?(u.value=U.items,a.value="ready"):U.kind==="unsupported"?(a.value="unsupported",r.value==="catalog"&&(r.value="manual")):a.value="error"}dn(c);const d=Z(""),f=R(()=>{const U=d.value.trim().toLowerCase();return U===""?u.value:u.value.filter(z=>z.name.toLowerCase().includes(U)||z.id.toLowerCase().includes(U))});function h(U){const z=U.rejectReason;return z!==null&&s(`providers.catalog.rejectReason.${z}`)?o(`providers.catalog.rejectReason.${z}`):o("providers.catalog.rejected")}const m=Z(null),v=Z({id:"",apiKey:"",baseUrl:""}),k=Z(!1),w=Z(!1),b=Z("");function _(U){m.value=U,v.value={id:U.id,apiKey:"",baseUrl:""},b.value="",k.value=!1}function g(){m.value=null,b.value="",n("dirtyChange",!1)}function x(){n("dirtyChange",!0)}const S=R(()=>{if(m.value===null)return!1;const z=v.value.id.trim();return z!==""&&i.providers.value.some(W=>W.id===z)}),T=Z();function A(U){b.value=U,yt(()=>T.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}function E(){const U=v.value,z=U.id.trim();return z===""?o("providers.error.idRequired"):pE.test(z)?U.apiKey.trim()===""?o("providers.error.apiKeyRequired"):m.value?.needsBaseUrl===!0&&U.baseUrl.trim()===""?o("providers.error.baseUrlRequired"):null:o("providers.error.idInvalid")}async function P(){const U=m.value;if(U===null||w.value)return;const z=E();if(z!==null){A(z);return}b.value="",w.value=!0;try{const W=v.value,K=W.id.trim(),V=W.baseUrl.trim(),ie=await i.importCatalogProvider({catalogId:U.id,apiKey:W.apiKey.trim(),...V===""?{}:{baseUrl:V},...K===U.id?{}:{id:K}});if(ie!==null){A(ie);return}i.notify({severity:"success",title:o("providers.added")}),n("dirtyChange",!1),n("added",K)}finally{w.value=!1}}const D=Z({url:"",apiKey:""}),I=Z(!1),$=Z(!1),B=Z(""),H=Z();function O(U){B.value=U,yt(()=>H.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}async function F(){if($.value)return;const U=D.value.url.trim();if(U===""){O(o("providers.error.registryUrlRequired"));return}B.value="",$.value=!0;try{const z=D.value.apiKey.trim(),W=await i.importCustomRegistry({url:U,...z===""?{}:{apiKey:z}});if(typeof W=="string"){O(W);return}i.notify({severity:"success",title:o("providers.catalog.registryImported",{count:W.providers.length})}),n("dirtyChange",!1);const K=W.providers[0];K!==void 0?n("added",K.id):n("cancel")}finally{$.value=!1}}return(U,z)=>(y(),M("div",bRe,[e.guard?(y(),he(p(qu),{key:0,variant:"warning",class:"af-guard"},{default:me(()=>[C("span",CRe,N(p(o)("providers.unsavedGuard")),1),j(p(Rt),{variant:"secondary",size:"sm",onClick:z[0]||(z[0]=W=>n("guardStay"))},{default:me(()=>[qe(N(p(o)("providers.guardStay")),1)]),_:1}),j(p(Rt),{variant:"danger",size:"sm",onClick:z[1]||(z[1]=W=>n("guardDiscard"))},{default:me(()=>[qe(N(p(o)("providers.guardDiscard")),1)]),_:1})]),_:1})):ee("",!0),a.value!=="unsupported"?(y(),he(p(wi),{key:1,modelValue:r.value,"onUpdate:modelValue":z[2]||(z[2]=W=>r.value=W),size:"sm",options:l.value},null,8,["modelValue","options"])):ee("",!0),a.value!=="unsupported"?Bn((y(),M("div",wRe,[a.value==="loading"?(y(),M("div",_Re,[j(p(Ao),{size:"sm"}),C("span",null,N(p(o)("providers.catalog.loading")),1)])):a.value==="error"?(y(),M("div",xRe,[j(p(qu),{variant:"danger"},{default:me(()=>[qe(N(p(o)("providers.catalog.loadError")),1)]),_:1}),C("div",null,[j(p(Rt),{variant:"secondary",size:"sm",onClick:c},{default:me(()=>[qe(N(p(o)("providers.catalog.retry")),1)]),_:1})])])):m.value===null?(y(),M(Pe,{key:2},[j(p(js),{modelValue:d.value,"onUpdate:modelValue":z[3]||(z[3]=W=>d.value=W),placeholder:p(o)("providers.catalog.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"]),C("div",SRe,[(y(!0),M(Pe,null,pt(f.value,W=>(y(),M("button",{key:W.id,type:"button",class:"af-entry",disabled:W.rejected,onClick:K=>_(W)},[C("span",MRe,N(W.name),1),W.wireType!==null?(y(),he(p(Vr),{key:0,variant:"neutral",size:"sm"},{default:me(()=>[qe(N(W.wireType),1)]),_:2},1024)):ee("",!0),z[16]||(z[16]=C("span",{class:"grow"},null,-1)),W.rejected?(y(),M("span",TRe,N(h(W)),1)):(y(),M("span",ERe,N(p(o)("providers.modelCount",{count:W.models.length})),1))],8,ARe))),128)),f.value.length===0?(y(),M("div",IRe,N(p(o)("providers.catalog.empty")),1)):ee("",!0)])],64)):(y(),M("div",{key:3,class:"af-import",onInput:x},[C("button",{type:"button",class:"af-back",onClick:g},[j(p(Te),{name:"arrow-left",size:"sm"}),qe(" "+N(p(o)("providers.catalog.backToList")),1)]),C("div",LRe,[C("label",$Re,[qe(N(p(o)("providers.fieldId")),1),z[17]||(z[17]=C("span",{class:"req"}," *",-1))]),j(p(js),{modelValue:v.value.id,"onUpdate:modelValue":z[4]||(z[4]=W=>v.value.id=W),autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),C("div",NRe,[C("label",FRe,[qe(N(p(o)("providers.fieldApiKey")),1),z[18]||(z[18]=C("span",{class:"req"}," *",-1))]),C("div",RRe,[j(p(js),{modelValue:v.value.apiKey,"onUpdate:modelValue":z[5]||(z[5]=W=>v.value.apiKey=W),type:k.value?"text":"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue","type"]),j(p(gn),{class:"af-key-eye",size:"sm",label:p(o)(k.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(o)(k.value?"providers.hideApiKey":"providers.showApiKey"),onClick:z[6]||(z[6]=W=>k.value=!k.value)},{default:me(()=>[j(p(Te),{name:k.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"])])]),m.value.needsBaseUrl?(y(),M("div",ORe,[C("label",PRe,[qe(N(p(o)("providers.fieldBaseUrl")),1),z[19]||(z[19]=C("span",{class:"req"}," *",-1))]),j(p(js),{modelValue:v.value.baseUrl,"onUpdate:modelValue":z[7]||(z[7]=W=>v.value.baseUrl=W),placeholder:p(o)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])])):ee("",!0),S.value?(y(),he(p(qu),{key:1,variant:"warning"},{default:me(()=>[qe(N(p(o)("providers.catalog.overwriteWarning")),1)]),_:1})):ee("",!0),C("div",DRe,N(p(o)("providers.catalog.willImport",{count:m.value.models.length})),1),b.value?(y(),M("div",{key:2,ref_key:"importErrorBox",ref:T},[j(p(qu),{variant:"danger"},{default:me(()=>[qe(N(b.value),1)]),_:1})],512)):ee("",!0),C("div",BRe,[j(p(Rt),{variant:"secondary",size:"sm",onClick:z[8]||(z[8]=W=>n("cancel"))},{default:me(()=>[qe(N(p(o)("common.cancel")),1)]),_:1}),j(p(Rt),{variant:"primary",size:"sm",disabled:w.value,onClick:P},{default:me(()=>[qe(N(p(o)("providers.catalog.importAction")),1)]),_:1},8,["disabled"])])],32))],512)),[[qs,r.value==="catalog"]]):ee("",!0),Bn(C("div",{class:"af-registry",onInput:x},[C("div",HRe,N(p(o)("providers.catalog.registryHint")),1),C("div",zRe,[C("label",WRe,[qe(N(p(o)("providers.catalog.registryUrlLabel")),1),z[20]||(z[20]=C("span",{class:"req"}," *",-1))]),j(p(js),{modelValue:D.value.url,"onUpdate:modelValue":z[9]||(z[9]=W=>D.value.url=W),placeholder:"https://example.com/api.json",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),C("div",URe,[C("label",jRe,N(p(o)("providers.fieldApiKey")),1),C("div",VRe,[j(p(js),{modelValue:D.value.apiKey,"onUpdate:modelValue":z[10]||(z[10]=W=>D.value.apiKey=W),type:I.value?"text":"password",placeholder:p(o)("providers.modelNamePlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","type","placeholder"]),j(p(gn),{class:"af-key-eye",size:"sm",label:p(o)(I.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(o)(I.value?"providers.hideApiKey":"providers.showApiKey"),onClick:z[11]||(z[11]=W=>I.value=!I.value)},{default:me(()=>[j(p(Te),{name:I.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"])])]),B.value?(y(),M("div",{key:0,ref_key:"registryErrorBox",ref:H},[j(p(qu),{variant:"danger"},{default:me(()=>[qe(N(B.value),1)]),_:1})],512)):ee("",!0),C("div",qRe,[j(p(Rt),{variant:"secondary",size:"sm",onClick:z[12]||(z[12]=W=>n("cancel"))},{default:me(()=>[qe(N(p(o)("common.cancel")),1)]),_:1}),j(p(Rt),{variant:"primary",size:"sm",disabled:$.value,onClick:F},{default:me(()=>[qe(N(p(o)("providers.catalog.importAction")),1)]),_:1},8,["disabled"])])],544),[[qs,r.value==="registry"]]),Bn(C("div",KRe,[j(kF,{mode:"add",guard:!1,onDirtyChange:z[13]||(z[13]=W=>n("dirtyChange",W)),onAdded:z[14]||(z[14]=W=>n("added",W)),onCancel:z[15]||(z[15]=W=>n("cancel"))})],512),[[qs,r.value==="manual"]])]))}}),GRe=ft(ZRe,[["__scopeId","data-v-9e5ec0a8"]]),YRe={class:"pp"},XRe={class:"pp-head"},JRe={class:"pp-title"},QRe={key:0,class:"pp-loading"},eOe={key:1,class:"pp-group"},tOe={class:"pp-add-label"},nOe={class:"pp-chev"},oOe={class:"pp-acc"},sOe={class:"pp-acc-in"},iOe={key:1,class:"pp-empty"},rOe=["onClick"],lOe={class:"grow"},aOe={class:"pp-id"},uOe={class:"pp-count"},cOe={class:"pp-chev"},dOe={class:"pp-acc"},fOe={class:"pp-acc-in"},Wu="$add",pOe=et({__name:"ProvidersPanel",setup(e){const{t}=Nt(),n=mu(),o=Z(!0),s=Z(null),i=Z(null);let r=0;const l=Z(!1),a=Z(!1),u=Z(null),c=Z("");let d=0;const f=R(()=>[...n.providers.value].sort((S,T)=>S.id.localeCompare(T.id)));function h(S){return w3(S,n.config.value?.models).length}Je(s,(S,T)=>{T!==null&&T!==S&&(i.value=T,window.clearTimeout(r),r=window.setTimeout(()=>{i.value=null},300)),l.value=!1}),Je(l,S=>{S||(a.value=!1,u.value=null)}),bn(()=>{window.clearTimeout(r),window.clearTimeout(d)});const m=Z(!1);Je(s,S=>{S===Wu?(m.value=!1,yt(()=>requestAnimationFrame(()=>{m.value=!0}))):m.value=!1}),dn(async()=>{o.value=!0;try{await Promise.all([n.loadProviders(),n.loadModels(),n.loadConfig()])}finally{o.value=!1}});function v(S){const T=s.value===S?null:S;if(l.value){u.value=T,a.value=!0;return}s.value=T}function k(){a.value=!1,u.value=null}function w(){a.value=!1,s.value=u.value,u.value=null}function b(S){c.value=S,window.clearTimeout(d),d=window.setTimeout(()=>{c.value=""},1200)}function _(S){s.value=S}function g(S){s.value=S,b(S)}function x(){s.value=null}return(S,T)=>(y(),M("section",YRe,[C("div",XRe,[C("h3",JRe,N(p(t)("settings.tabs.providers")),1),j(p(Rt),{variant:"secondary",size:"sm",onClick:T[0]||(T[0]=A=>v(Wu))},{default:me(()=>[j(p(Te),{name:"plus",size:"sm"}),qe(" "+N(p(t)("providers.addProvider")),1)]),_:1})]),o.value?(y(),M("div",QRe,[j(p(Ao),{size:"sm"}),C("span",null,N(p(t)("providers.loading")),1)])):(y(),M("div",eOe,[s.value===Wu||i.value===Wu?(y(),M("div",{key:0,class:Re(["pp-item pp-add-item",{open:s.value===Wu&&m.value}])},[C("button",{type:"button",class:"pp-row pp-add-row",onClick:T[1]||(T[1]=A=>v(Wu))},[C("span",tOe,N(p(t)("providers.addProvider")),1),T[6]||(T[6]=C("span",{class:"grow"},null,-1)),C("span",nOe,[j(p(Te),{name:"chevron-right",size:"sm"})])]),C("div",oOe,[C("div",sOe,[j(GRe,{guard:a.value&&s.value===Wu,onDirtyChange:T[2]||(T[2]=A=>l.value=A),onGuardStay:k,onGuardDiscard:w,onAdded:g,onCancel:T[3]||(T[3]=A=>s.value=null)},null,8,["guard"])])])],2)):ee("",!0),f.value.length===0?(y(),M("div",iOe,N(p(t)("providers.empty")),1)):ee("",!0),(y(!0),M(Pe,null,pt(f.value,A=>(y(),M("div",{key:A.id,class:Re(["pp-item",{open:s.value===A.id,flash:c.value===A.id}])},[C("button",{type:"button",class:"pp-row",onClick:E=>v(A.id)},[C("div",lOe,[C("span",aOe,N(A.id),1),j(p(Vr),{variant:"neutral",size:"sm"},{default:me(()=>[qe(N(A.type),1)]),_:2},1024),p(mE)(A)?(y(),he(p(Vr),{key:0,variant:"info",size:"sm"},{default:me(()=>[qe(N(p(t)("providers.managedBadge")),1)]),_:1})):ee("",!0)]),C("span",uOe,N(p(t)("providers.modelCount",{count:h(A)})),1),C("span",cOe,[j(p(Te),{name:"chevron-right",size:"sm"})])],8,rOe),C("div",dOe,[C("div",fOe,[s.value===A.id||i.value===A.id?(y(),he(kF,{key:0,mode:"edit",provider:A,guard:a.value&&s.value===A.id,onDirtyChange:T[4]||(T[4]=E=>l.value=E),onGuardStay:k,onGuardDiscard:w,onSaved:_,onDeleting:T[5]||(T[5]=E=>s.value=null),onDeleted:x},null,8,["provider","guard"])):ee("",!0)])])],2))),128))]))]))}}),hOe=ft(pOe,[["__scopeId","data-v-9aa0e3a8"]]),mOe={class:"sec"},gOe={class:"sec-title"},vOe={class:"pu-group"},yOe={class:"pu-row"},kOe={class:"pu-main"},bOe={class:"pu-label"},COe={class:"pu-hint"},wOe=et({__name:"PlanUpgradeCard",setup(e){const{t}=Nt();return(n,o)=>(y(),M("section",mOe,[C("h3",gOe,N(p(t)("settings.planUsage.title")),1),C("div",vOe,[C("div",yOe,[C("span",kOe,[C("span",bOe,N(p(t)("settings.planUsage.freeTitle")),1),C("span",COe,N(p(t)("settings.planUsage.freeHint")),1)]),j(p(Rt),{variant:"primary",size:"sm",onClick:o[0]||(o[0]=s=>p(jp)())},{default:me(()=>[qe(N(p(t)("sidebar.upgrade")),1)]),_:1})])])]))}}),bF=ft(wOe,[["__scopeId","data-v-5711dff8"]]),_Oe={class:"sec"},xOe={class:"sec-title"},SOe={class:"pu-group"},AOe={key:0,class:"pu-row pu-state"},MOe={key:1,class:"pu-row pu-state"},TOe={class:"pu-error-text"},EOe={key:2,class:"pu-row pu-state pu-empty"},IOe={class:"pu-main"},LOe={class:"pu-label"},$Oe={key:0,class:"pu-hint"},NOe={class:"pu-value"},FOe=["aria-valuenow","aria-valuemax"],ROe={key:0,class:"sec"},OOe={class:"sec-title"},POe={class:"pu-group"},DOe={class:"pu-row"},BOe={class:"pu-main"},HOe={class:"pu-label"},zOe={class:"pu-value"},WOe={key:0,class:"pu-value-sub"},UOe={key:0,class:"pu-meter"},jOe={class:"pu-row"},VOe={class:"pu-main"},qOe={class:"pu-label"},KOe={class:"pu-value"},ZOe={class:"pu-row"},GOe={class:"pu-main"},YOe={class:"pu-label"},XOe={class:"pu-value"},JOe={class:"pu-value-sub"},QOe=et({__name:"PlanUsageCard",props:{onFetchUsage:{type:Function}},setup(e){const t=e,{t:n}=Nt(),o=Z(!0),s=Z(null);async function i(){o.value=!0;try{s.value=await t.onFetchUsage()}finally{o.value=!1}}dn(i);const r=R(()=>s.value?.kind==="ok"?s.value:null),l=R(()=>r.value?.extraUsage??null),a=R(()=>{const v=r.value;return v===null?[]:v.summary===null?v.limits:[v.summary,...v.limits]}),u=R(()=>a.value.length>0),c=R(()=>s.value?.kind==="error"?s.value.message:n("settings.planUsage.loadFailed")),d=R(()=>s.value?.kind==="error"&&(s.value.status===402||s.value.status===403)),f=R(()=>l.value!==null&&l.value.monthlyChargeLimitEnabled&&l.value.monthlyChargeLimitCents>0);function h(v,k){const w=PJ(v,k);return`${w.symbol}${w.number}`}function m(v){return v.resetAt===void 0?"":fE(v.resetAt,n)}return(v,k)=>d.value?(y(),he(bF,{key:0})):(y(),M(Pe,{key:1},[C("section",_Oe,[C("h3",xOe,N(p(n)("settings.planUsage.title")),1),C("div",SOe,[o.value?(y(),M("div",AOe,[j(p(Ao),{size:"sm"})])):r.value===null?(y(),M("div",MOe,[C("span",TOe,N(c.value),1),j(p(Rt),{variant:"ghost",size:"sm",onClick:i},{default:me(()=>[qe(N(p(n)("settings.planUsage.retry")),1)]),_:1})])):u.value?(y(!0),M(Pe,{key:3},pt(a.value,(w,b)=>(y(),M("div",{key:b,class:"pu-row"},[C("span",IOe,[C("span",LOe,N(p(dE)(w,p(n))),1),m(w)?(y(),M("span",$Oe,N(m(w)),1)):ee("",!0)]),C("span",NOe,N(p(n)("settings.planUsage.usedPct",{pct:p(Wh)(w.used,w.limit)})),1),C("span",{class:"pu-meter",role:"progressbar","aria-valuenow":w.used,"aria-valuemax":w.limit},[C("i",{class:Re(`sev-${p(C3)(w.used,w.limit)}`),style:Zt({width:`${p(Wh)(w.used,w.limit)}%`})},null,6)],8,FOe)]))),128)):(y(),M("div",EOe,N(p(n)("settings.planUsage.empty")),1))])]),l.value!==null?(y(),M("section",ROe,[C("h3",OOe,N(p(n)("settings.planUsage.boosterTitle")),1),C("div",POe,[C("div",DOe,[C("span",BOe,[C("span",HOe,N(p(n)("settings.planUsage.monthlyUsed")),1)]),C("span",zOe,[qe(N(h(l.value.monthlyUsedCents,l.value.currency)),1),f.value?(y(),M("span",WOe," / "+N(h(l.value.monthlyChargeLimitCents,l.value.currency)),1)):ee("",!0)]),f.value?(y(),M("span",UOe,[C("i",{class:Re(`sev-${p(C3)(l.value.monthlyUsedCents,l.value.monthlyChargeLimitCents)}`),style:Zt({width:`${p(Wh)(l.value.monthlyUsedCents,l.value.monthlyChargeLimitCents)}%`})},null,6)])):ee("",!0)]),C("div",jOe,[C("span",VOe,[C("span",qOe,N(p(n)("settings.planUsage.monthlyLimit")),1)]),C("span",KOe,[f.value?(y(),M(Pe,{key:0},[qe(N(h(l.value.monthlyChargeLimitCents,l.value.currency)),1)],64)):(y(),M(Pe,{key:1},[qe(N(p(n)("settings.planUsage.unlimited")),1)],64))])]),C("div",ZOe,[C("span",GOe,[C("span",YOe,N(p(n)("settings.planUsage.boosterBalance")),1)]),C("span",XOe,[qe(N(h(l.value.balanceCents,l.value.currency)),1),C("span",JOe," / "+N(h(l.value.totalCents,l.value.currency)),1)])])])])):ee("",!0)],64))}}),ePe=ft(QOe,[["__scopeId","data-v-f39cdded"]]),tPe=["aria-expanded","aria-label"],nPe={class:"sm-picker__value-text"},oPe=["aria-label"],sPe=["aria-label"],iPe={class:"sm-picker__group"},rPe=["aria-selected","onMouseenter","onClick"],lPe={class:"sm-picker__option-label"},aPe=["aria-label"],uPe={class:"sm-picker__group"},cPe=["aria-selected","onMouseenter","onClick"],dPe={class:"sm-picker__option-label"},fPe=188,pPe=250,wS=8,hPe=et({__name:"SecondaryModelPicker",props:{modelValue:{},effort:{},groups:{},modelInfoById:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=Z(null),r=Z(null),l=Z(null),a=new Map,u=Z(!1),c=Z(!1),d=Z({}),f=`sm-picker-${Math.random().toString(36).slice(2,9)}`,h=Z(""),m=Z(null),v=Z("right"),k=Z(0),w=Z("models"),b=Z(0),_=Z(0);let g=null;const x=R(()=>n.groups.flatMap(ve=>ve.options)),S=R(()=>n.modelValue?x.value.find(ve=>ve.id===n.modelValue)?.label??n.modelValue:""),T=R(()=>n.modelValue?n.effort?`${S.value} · ${n.effort}`:S.value:s("settings.noSecondaryModel")),A=R(()=>{const ve=m.value;if(ve===null)return[];const oe=Up(n.modelInfoById[ve]),ye=n.effort===""?[null,...oe]:[...oe];return n.modelValue===ve&&n.effort!==""&&!oe.includes(n.effort)&&ye.push(n.effort),ye});function E(ve){return n.modelValue!==m.value?!1:ve===null?n.effort==="":n.effort===ve}function P(){const ve=A.value.findIndex(oe=>E(oe));return ve>=0?ve:0}function D(ve,oe){ve instanceof HTMLElement?a.set(oe,ve):a.delete(oe)}function I(){g!==null&&(clearTimeout(g),g=null)}function $(){I(),g=setTimeout(()=>{m.value=null,w.value==="efforts"&&(w.value="models")},pPe)}function B(ve){ve!==h.value&&(h.value=ve,b.value=Math.max(0,x.value.findIndex(oe=>oe.id===ve)))}function H(){const ve=r.value,oe=l.value;if(!ve||!oe)return;const ye=ve.getBoundingClientRect(),G=oe.offsetHeight,Y=window.innerHeight-ye.bottom;c.value=Y<G+wS&&ye.top>G;const fe=Math.max(wS,window.innerWidth-ye.right);d.value=c.value?{right:`${fe}px`,bottom:`${window.innerHeight-ye.top+4}px`,top:"auto"}:{right:`${fe}px`,top:`${ye.bottom+4}px`,bottom:"auto"}}function O(){const ve=l.value,oe=m.value===null?void 0:a.get(m.value);if(!ve||!oe)return;const ye=ve.getBoundingClientRect(),G=oe.getBoundingClientRect();k.value=Math.max(0,Math.min(G.top-ye.top-4,ve.offsetHeight-40));const Y=window.innerWidth-ye.right,fe=ye.left;v.value=Y>=fPe||Y>=fe?"right":"left"}function F(ve,{moveFocus:oe=!1}={}){B(ve),I(),m.value=ve,oe&&(w.value="efforts",_.value=P()),yt(O)}function U(){m.value=null,w.value="models"}function z(){u.value||(u.value=!0,h.value=n.modelValue||(x.value[0]?.id??""),b.value=Math.max(0,x.value.findIndex(ve=>ve.id===h.value)),m.value=null,w.value="models",yt(H))}function W({restoreFocus:ve=!1}={}){u.value&&(I(),u.value=!1,m.value=null,ve&&yt(()=>r.value?.focus()))}function K(){u.value?W():z()}function V(ve){if(m.value===null)return;const oe={model:m.value,effort:ve??void 0};(oe.model!==n.modelValue||(oe.effort??"")!==n.effort)&&o("select",oe),W({restoreFocus:!0})}function ie(){yt(()=>{l.value?.querySelector(".sm-picker__option.is-kb-active")?.scrollIntoView({block:"nearest"})})}function ne(ve){const oe=x.value;if(oe.length===0)return;const ye=(b.value+ve+oe.length)%oe.length,G=oe[ye].id;B(G),m.value!==null&&F(G),ie()}function X(ve){const oe=A.value;oe.length!==0&&(_.value=(_.value+ve+oe.length)%oe.length,ie())}function le(ve){if(!u.value){(ve.key==="Enter"||ve.key===" "||ve.key==="ArrowDown")&&(ve.preventDefault(),z());return}if(ve.key==="ArrowDown")ve.preventDefault(),w.value==="models"?ne(1):X(1);else if(ve.key==="ArrowUp")ve.preventDefault(),w.value==="models"?ne(-1):X(-1);else if(ve.key==="ArrowRight")ve.preventDefault(),F(h.value,{moveFocus:!0});else if(ve.key==="ArrowLeft")ve.preventDefault(),m.value!==null&&U();else if(ve.key==="Enter"||ve.key===" ")ve.preventDefault(),w.value==="models"?F(h.value,{moveFocus:!0}):V(A.value[_.value]??null);else if(ve.key==="Home"||ve.key==="End"){ve.preventDefault();const oe=ve.key==="Home";if(w.value==="models"){const ye=x.value;if(ye.length===0)return;const G=(oe?ye[0]:ye.at(-1)).id;B(G),m.value!==null&&F(G)}else _.value=oe?0:A.value.length-1;ie()}else ve.key==="Escape"&&(ve.preventDefault(),W({restoreFocus:!0}))}function Ie(ve){const oe=ve.target;i.value?.contains(oe)||l.value?.contains(oe)||W()}function de(ve){if(u.value){if(l.value?.contains(ve.target)){O();return}H(),O()}}function pe(){W()}return dn(()=>{document.addEventListener("pointerdown",Ie),document.addEventListener("scroll",de,!0),window.addEventListener("resize",pe)}),bn(()=>{document.removeEventListener("pointerdown",Ie),document.removeEventListener("scroll",de,!0),window.removeEventListener("resize",pe),I()}),(ve,oe)=>(y(),M("div",{ref_key:"rootRef",ref:i,class:Re(["sm-picker",{"is-open":u.value}])},[C("button",{ref_key:"triggerRef",ref:r,class:"sm-picker__trigger",type:"button",role:"combobox","aria-controls":f,"aria-expanded":u.value,"aria-haspopup":"dialog","aria-label":p(s)("settings.secondaryModel"),onClick:K,onKeydown:le},[C("span",{class:Re(["sm-picker__value",{"is-placeholder":!e.modelValue}])},[C("span",nPe,N(T.value),1)],2),j(p(Te),{class:"sm-picker__chevron",name:"chevron-down",size:"sm"})],40,tPe),(y(),he(Zr,{to:"body"},[u.value?(y(),M("div",{key:0,id:f,ref_key:"menuRef",ref:l,class:Re(["sm-picker__menu",{"sm-picker__menu--up":c.value}]),style:Zt(d.value),role:"dialog","aria-label":p(s)("settings.secondaryModel")},[C("div",{class:"sm-picker__models",role:"listbox","aria-label":p(s)("settings.secondaryModel")},[(y(!0),M(Pe,null,pt(e.groups,ye=>(y(),M(Pe,{key:ye.provider},[C("div",iPe,N(ye.provider),1),(y(!0),M(Pe,null,pt(ye.options,G=>(y(),M("button",{key:G.id,ref_for:!0,ref:Y=>D(Y,G.id),class:Re(["sm-picker__option",{"is-selected":G.id===e.modelValue,"is-active":G.id===h.value,"is-kb-active":w.value==="models"&&G.id===h.value}]),type:"button",role:"option","aria-selected":G.id===e.modelValue,onMouseenter:Y=>F(G.id),onMouseleave:$,onClick:Y=>F(G.id,{moveFocus:!0})},[j(p(Te),{class:"sm-picker__check",name:"check",size:"sm"}),C("span",lPe,N(G.label),1),j(p(Te),{class:"sm-picker__flyout-caret",name:"chevron-right",size:"sm"})],42,rPe))),128))],64))),128))],8,sPe),m.value!==null?(y(),M("div",{key:0,class:Re(["sm-picker__flyout",`sm-picker__flyout--${v.value}`]),style:Zt({top:`${k.value}px`}),role:"listbox","aria-label":p(s)("settings.secondaryModelEffort"),onMouseenter:I,onMouseleave:$},[C("div",uPe,N(p(s)("settings.secondaryModelEffort")),1),(y(!0),M(Pe,null,pt(A.value,(ye,G)=>(y(),M("button",{key:ye??"__default__",class:Re(["sm-picker__option",{"is-selected":E(ye),"is-active":w.value==="efforts"&&G===_.value,"is-kb-active":w.value==="efforts"&&G===_.value,"is-muted":ye===null}]),type:"button",role:"option","aria-selected":E(ye),onMouseenter:Y=>{w.value="efforts",_.value=G},onClick:Y=>V(ye)},[j(p(Te),{class:"sm-picker__check",name:"check",size:"sm"}),C("span",dPe,N(ye??p(s)("settings.secondaryModelEffortAuto")),1)],42,cPe))),128))],46,aPe)):ee("",!0)],14,oPe)):ee("",!0)]))],2))}}),mPe=ft(hPe,[["__scopeId","data-v-f114c246"]]),gPe=["aria-label"],vPe={class:"settings-tabs-header"},yPe={class:"settings-dialog-title"},kPe={class:"settings-tab-list"},bPe=["aria-selected","onClick"],CPe={class:"settings-region"},wPe={class:"settings-region-header"},_Pe={class:"panel"},xPe={class:"sec"},SPe={class:"sec-title"},APe={class:"settings-group"},MPe={class:"row"},TPe={class:"rlabel"},EPe={class:"hint"},IPe={class:"row language-row"},LPe={class:"rlabel"},$Pe={class:"hint"},NPe={class:"row font-size-row"},FPe={class:"rlabel"},RPe={class:"hint"},OPe={class:"sec notification-settings"},PPe={class:"sec-title"},DPe={class:"settings-group"},BPe={class:"row"},HPe={class:"rlabel"},zPe={class:"hint"},WPe={key:0,class:"hint"},UPe={class:"row"},jPe={class:"rlabel"},VPe={class:"hint"},qPe={class:"panel"},KPe={class:"sec"},ZPe={class:"sec-title"},GPe={class:"settings-group"},YPe={class:"account-row"},XPe={class:"account-avatar","aria-hidden":"true"},JPe=["src"],QPe={class:"account-meta"},eDe={class:"account-name-row"},tDe={class:"account-name"},nDe={class:"account-sub"},oDe={key:0,class:"panel"},sDe={class:"panel"},iDe={class:"sec"},rDe={class:"sec-head"},lDe={class:"sec-title"},aDe={class:"settings-group"},uDe={class:"row"},cDe={class:"rlabel"},dDe={class:"hint"},fDe={key:0,class:"select-wrap"},pDe={key:1,class:"rvalue mono"},hDe={class:"row"},mDe={class:"rlabel"},gDe={class:"hint"},vDe={class:"row"},yDe={class:"rlabel"},kDe={class:"hint"},bDe={class:"row"},CDe={class:"rlabel"},wDe={class:"hint"},_De={key:1,class:"empty-config"},xDe={key:0,class:"sec"},SDe={class:"sec-head"},ADe={class:"sec-title"},MDe={class:"settings-group"},TDe={class:"row"},EDe={class:"rlabel"},IDe={class:"hint"},LDe={key:0,class:"select-wrap"},$De={key:1,class:"rvalue mono"},NDe={class:"panel"},FDe={class:"sec"},RDe={class:"sec-title"},ODe={class:"settings-group"},PDe={class:"row"},DDe={class:"rlabel"},BDe={class:"hint"},HDe={class:"rvalue"},zDe={class:"row"},WDe={class:"rlabel"},UDe={class:"hint"},jDe={class:"rvalue"},VDe={class:"row"},qDe={class:"rlabel"},KDe={class:"hint"},ZDe={class:"rvalue"},GDe={key:0,class:"row"},YDe={class:"rlabel"},XDe={key:0,class:"hint"},JDe={key:1,class:"hint"},QDe={key:1,class:"row"},eBe={class:"rlabel"},tBe={class:"hint"},nBe={key:0,class:"sec"},oBe={class:"sec-title"},sBe={class:"settings-group"},iBe={class:"row"},rBe={class:"rlabel"},lBe={class:"hint"},aBe={class:"hint"},uBe={class:"sec"},cBe={class:"sec-title"},dBe={class:"settings-group"},fBe={class:"row"},pBe={class:"rlabel"},hBe={class:"hint"},mBe={key:0,class:"hint"},gBe={class:"panel"},vBe={class:"panel-head"},yBe={class:"panel-title"},kBe={class:"panel-desc"},bBe={class:"archive-toolbar"},CBe={class:"archive-search"},wBe=["placeholder"],_Be={key:0,class:"archive-empty"},xBe={key:0,class:"archive-list"},SBe={class:"archive-workspace"},ABe={class:"path"},MBe={class:"count"},TBe={class:"setting-card"},EBe={class:"archive-meta"},IBe={class:"archive-name"},LBe={class:"archive-time"},$Be={key:1,class:"archive-empty"},NBe=100,FBe=et({__name:"SettingsDialog",props:{colorScheme:{},fontScale:{},initialTab:{},managedProviderStatus:{},managedUserInfo:{},onFetchUsage:{type:Function},notify:{type:Boolean},notifyPermission:{},notifySound:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},experimentalFlags:{}},emits:["setColorScheme","setFontScale","setNotify","setNotifySound","login","logout","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=R(()=>o.managedProviderStatus==="authenticated"),r=R(()=>i.value?o.managedUserInfo?.nickname||n("sidebar.defaultUserName"):n("sidebar.notSignedIn")),l=R(()=>o.managedUserInfo?.userLevelName?.trim()??""),a=Z(!1);Je(()=>o.managedUserInfo?.avatar,()=>{a.value=!1});const u=R(()=>!!o.managedUserInfo?.avatar&&!a.value),c=R(()=>i.value?n("settings.signedIn"):n("settings.signedOutHint")),d=Z(o.initialTab??"general"),f=Z(!1);let h=null;function m(){f.value=!0,h&&clearTimeout(h),h=setTimeout(()=>{f.value=!1,h=null},900)}const v=[{id:"general",labelKey:"settings.tabs.general",icon:"sliders"},{id:"agent",labelKey:"settings.tabs.agent",icon:"robot"},{id:"account",labelKey:"settings.tabs.account",icon:"user"},{id:"providers",labelKey:"settings.tabs.providers",icon:"bolt"},{id:"advanced",labelKey:"settings.tabs.advanced",icon:"microscope"},{id:"archived",labelKey:"settings.tabs.archived",icon:"archive"}],k=G0e(),w=["manual","yolo","auto"],b={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},_=Z(null);gF(_);const{isConfirmOpen:g}=hu();function x(Fe){Fe.key==="Escape"&&!Fe.defaultPrevented&&!g.value&&s("close")}dn(()=>document.addEventListener("keydown",x)),bn(()=>{document.removeEventListener("keydown",x),h&&clearTimeout(h)});function S(){G$()}const T=(()=>{const Fe="0.35.0".trim()?"0.35.0":"";let Oe="";if("2026-08-12T09:47:23.869Z".trim()){const at=new Date("2026-08-12T09:47:23.869Z");if(!Number.isNaN(at.getTime())){const Tt=Bt=>String(Bt).padStart(2,"0");Oe=`${at.getFullYear()}-${Tt(at.getMonth()+1)}-${Tt(at.getDate())} ${Tt(at.getHours())}:${Tt(at.getMinutes())}`}}const Ge=Oe===""?Fe:`${Fe} · ${Oe}`;return Ge===""?"-":Ge})(),A=K$(),E=Z(!1),P=Z(null);async function D(){if(!E.value){E.value=!0,P.value=null;try{P.value=await A.check()}finally{E.value=!1}}}const I=R(()=>{const Fe=P.value;if(Fe===null)return"";switch(Fe.outcome){case"available":return A.status.value.state==="downloaded"?n("settings.updateCheckDownloaded",{version:Fe.version??""}):A.autoDownload.value?n("settings.updateCheckAvailableAuto",{version:Fe.version??""}):n("settings.updateCheckAvailable",{version:Fe.version??""});case"latest":return n("settings.updateCheckLatest");case"unsupported":return n("settings.updateCheckUnsupported");case"error":return n("settings.updateCheckFailed")}}),$=R(()=>{const Fe=new Map;for(const Oe of o.models??[])Fe.set(Oe.id,{id:Oe.id,label:Oe.displayName??Oe.model??Oe.id,provider:Oe.provider});for(const[Oe,Ge]of Object.entries(o.config?.models??{})){if(Fe.has(Oe))continue;const at=F(Ge);Fe.set(Oe,{id:Oe,label:U(Oe,Ge,at),provider:at??Oe})}return Array.from(Fe.values())}),B=R(()=>{const Fe=new Map;for(const Oe of $.value){const Ge=Fe.get(Oe.provider)??[];Ge.push(Oe),Fe.set(Oe.provider,Ge)}for(const Oe of Fe.values())Oe.sort((Ge,at)=>Ge.label.localeCompare(at.label));return Array.from(Fe.entries()).toSorted(([Oe],[Ge])=>Oe.localeCompare(Ge)).map(([Oe,Ge])=>({provider:Oe,options:Ge}))}),H=R(()=>{const Fe=B.value.flatMap(Oe=>Oe.options.map(Ge=>({value:Ge.id,label:Ge.label,group:Oe.provider})));return o.config?.defaultModel||Fe.unshift({value:"",label:n("settings.noDefaultModel"),group:"",disabled:!0}),Fe}),O=R(()=>{const Fe=o.config?.defaultPermissionMode;return Fe==="auto"||Fe==="yolo"||Fe==="manual"?Fe:"manual"});function F(Fe){if(!Fe||typeof Fe!="object")return;const Oe=Fe;return typeof Oe.provider=="string"?Oe.provider:void 0}function U(Fe,Oe,Ge){if(!Oe||typeof Oe!="object")return Fe;const at=Oe,Tt=typeof at.model=="string"?at.model:void 0,Bt=Ge??F(Oe);return Tt&&Bt?`${Fe} (${Bt}/${Tt})`:Tt?`${Fe} (${Tt})`:Fe}function z(Fe){return Fe===!0}function W(Fe){!Fe||Fe===o.config?.defaultModel||s("updateConfig",{defaultModel:Fe})}function K(Fe){Fe!==O.value&&s("updateConfig",{defaultPermissionMode:Fe})}const V=R(()=>(o.experimentalFlags?.["secondary-model"]??o.config?.experimental?.["secondary-model"])===!0),ie=R(()=>o.config?.secondaryModel?.model??""),ne=R(()=>o.config?.secondaryModel?.defaultEffort??""),X=R(()=>Object.fromEntries((o.models??[]).map(Fe=>[Fe.id,Fe])));function le(Fe){Fe.model===ie.value&&(Fe.effort??"")===ne.value||s("updateConfig",{secondaryModel:Fe.effort?{model:Fe.model,defaultEffort:Fe.effort}:{model:Fe.model}})}function Ie(Fe){const Oe=o.config?.[Fe];s("updateConfig",{[Fe]:!z(Oe)})}function de(){const Fe=o.config?.thinking;return!Fe||typeof Fe!="object"?!0:Fe.enabled!==!1}function pe(){s("updateConfig",{thinking:{enabled:!de()}})}function ve(){const Fe=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!Fe})}function oe(Fe){d.value=Fe}const ye=mu(),G=R(()=>i.value&&ye.managedMembership.value==="free"),Y=Z([]),fe=Z(!1),we=Z(!1),ge=Z(""),Q=Z("all"),te=Z("archived-desc");async function ce(){if(!(fe.value||we.value)){fe.value=!0;try{const Fe=[];let Oe;for(;;){const Ge=await ye.loadArchivedSessions({beforeId:Oe,pageSize:NBe});if(Fe.push(...Ge.items),!Ge.hasMore||Ge.items.length===0)break;const at=Ge.items.at(-1)?.id;if(at===void 0)break;Oe=at}Y.value=Fe,we.value=!0}catch(Fe){gl("loadAllArchived failed",Fe)}finally{fe.value=!1}}}Je(d,Fe=>{Fe==="archived"&&!we.value&&ce()},{immediate:!0});const ue=R(()=>{const Fe=new Set;for(const Oe of Y.value)Fe.add(Oe.cwd);return Array.from(Fe).sort((Oe,Ge)=>Oe.localeCompare(Ge))}),Se=R(()=>[{value:"all",label:n("settings.archivedAllWorkspaces")},...ue.value.map(Fe=>({value:Fe,label:Fe}))]),ze=R(()=>{const Fe=ge.value.trim().toLowerCase();let Oe=Y.value.filter(Ge=>Ge.archived===!0);return Q.value!=="all"&&(Oe=Oe.filter(Ge=>Ge.cwd===Q.value)),Fe&&(Oe=Oe.filter(Ge=>Ge.title.toLowerCase().includes(Fe))),Oe=Oe.slice(),te.value==="archived-desc"?Oe.sort((Ge,at)=>at.updatedAt.localeCompare(Ge.updatedAt)):te.value==="created-desc"?Oe.sort((Ge,at)=>at.createdAt.localeCompare(Ge.createdAt)):Oe.sort((Ge,at)=>Ge.title.localeCompare(at.title,"zh")),Oe}),_e=R(()=>{const Fe=new Map;for(const Oe of ze.value){const Ge=Fe.get(Oe.cwd)??[];Ge.push(Oe),Fe.set(Oe.cwd,Ge)}return Array.from(Fe.entries()).map(([Oe,Ge])=>({cwd:Oe,items:Ge}))});async function Ee(Fe){await ye.restoreSession(Fe)&&(Y.value=Y.value.filter(Ge=>Ge.id!==Fe))}function it(Fe){const Oe=new Date(Fe);if(Number.isNaN(Oe.getTime()))return Fe;const Ge=at=>String(at).padStart(2,"0");return`${Oe.getFullYear()}-${Ge(Oe.getMonth()+1)}-${Ge(Oe.getDate())} ${Ge(Oe.getHours())}:${Ge(Oe.getMinutes())}`}return(Fe,Oe)=>(y(),he(p(ua),{open:!0,"close-on-esc":!1,"aria-label":p(n)("settings.title"),size:"xl",height:"fixed",padded:!1,level:"grouped",onClose:Oe[16]||(Oe[16]=Ge=>s("close"))},{default:me(()=>[C("div",{ref_key:"dialogRef",ref:_,class:"sd"},[C("nav",{class:"settings-tabs",role:"tablist","aria-label":p(n)("settings.title")},[C("header",vPe,[C("h2",yPe,N(p(n)("settings.title")),1)]),C("div",kPe,[(y(),M(Pe,null,pt(v,Ge=>C("button",{key:Ge.id,type:"button",class:Re(["tab",{on:d.value===Ge.id}]),role:"tab","aria-selected":d.value===Ge.id,onClick:at=>oe(Ge.id)},[j(p(Te),{name:Ge.icon,size:"md"},null,8,["name"]),C("span",null,N(p(n)(Ge.labelKey)),1)],10,bPe)),64))])],8,gPe),C("section",CPe,[C("header",wPe,[j(p(gn),{size:"sm",label:p(n)("settings.close"),tooltip:p(n)("settings.close"),onClick:Oe[0]||(Oe[0]=Ge=>s("close"))},{default:me(()=>[j(p(Te),{name:"close",size:"md"})]),_:1},8,["label","tooltip"])]),C("div",{class:Re(["body",{scrolling:f.value}]),onScroll:m},[Bn(C("section",_Pe,[C("section",xPe,[C("h3",SPe,N(p(n)("settings.appearance")),1),C("div",APe,[C("div",MPe,[C("span",TPe,[qe(N(p(n)("theme.colorSchemeLabel"))+" ",1),C("span",EPe,N(p(n)("settings.colorSchemeHint")),1)]),j(p(wi),{"model-value":e.colorScheme,options:[{value:"light",label:p(n)("theme.light"),icon:"light-mode"},{value:"dark",label:p(n)("theme.dark"),icon:"dark-mode"},{value:"system",label:p(n)("theme.system")}],"onUpdate:modelValue":Oe[1]||(Oe[1]=Ge=>s("setColorScheme",Ge))},null,8,["model-value","options"])]),C("div",IPe,[C("span",LPe,[qe(N(p(n)("sidebar.language"))+" ",1),C("span",$Pe,N(p(n)("settings.languageHint")),1)]),j(yF)]),C("div",NPe,[C("span",FPe,[qe(N(p(n)("settings.uiFontSize"))+" ",1),C("span",RPe,N(p(n)("settings.uiFontSizeHint")),1)]),j(p(wi),{"model-value":e.fontScale,options:[{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"xlarge",label:"XL"}],"aria-label":p(n)("settings.uiFontSize"),"onUpdate:modelValue":Oe[2]||(Oe[2]=Ge=>s("setFontScale",Ge))},null,8,["model-value","aria-label"])])])]),C("section",OPe,[C("h3",PPe,N(p(n)("settings.notifications")),1),C("div",DPe,[C("div",BPe,[C("span",HPe,[qe(N(p(n)("settings.notifyEnabled"))+" ",1),C("span",zPe,N(p(n)("settings.notifyEnabledHint")),1),e.notifyPermission==="denied"?(y(),M("span",WPe,N(p(n)("settings.notifyDenied")),1)):ee("",!0)]),j(p(ed),{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:p(n)("settings.notifyEnabled"),"onUpdate:modelValue":Oe[3]||(Oe[3]=Ge=>s("setNotify",Ge))},null,8,["model-value","disabled","label"])]),C("div",UPe,[C("span",jPe,[qe(N(p(n)("settings.notifySound"))+" ",1),C("span",VPe,N(p(n)("settings.notifySoundHint")),1)]),j(p(ed),{"model-value":e.notifySound,label:p(n)("settings.notifySound"),"onUpdate:modelValue":Oe[4]||(Oe[4]=Ge=>s("setNotifySound",Ge))},null,8,["model-value","label"])])])])],512),[[qs,d.value==="general"]]),Bn(C("section",qPe,[C("section",KPe,[C("h3",ZPe,N(p(n)("settings.account")),1),C("div",GPe,[C("div",YPe,[C("span",XPe,[u.value?(y(),M("img",{key:0,src:o.managedUserInfo?.avatar,alt:"",onError:Oe[5]||(Oe[5]=Ge=>a.value=!0)},null,40,JPe)):(y(),he(p(Te),{key:1,name:"user",size:"md"}))]),C("span",QPe,[C("span",eDe,[C("span",tDe,N(r.value),1),l.value?(y(),he(p(Vr),{key:0,class:"account-level",variant:"neutral",size:"sm"},{default:me(()=>[qe(N(l.value),1)]),_:1})):ee("",!0)]),C("span",nDe,N(c.value),1)]),i.value?(y(),he(p(Rt),{key:0,variant:"danger-soft",size:"sm",onClick:Oe[6]||(Oe[6]=Ge=>s("logout"))},{default:me(()=>[qe(N(p(n)("sidebar.signOut")),1)]),_:1})):(y(),he(p(Rt),{key:1,variant:"primary",size:"sm",onClick:Oe[7]||(Oe[7]=Ge=>s("login"))},{default:me(()=>[qe(N(p(n)("sidebar.signIn")),1)]),_:1}))])])]),G.value?(y(),he(bF,{key:0})):i.value?(y(),he(ePe,{key:1,"on-fetch-usage":o.onFetchUsage},null,8,["on-fetch-usage"])):ee("",!0)],512),[[qs,d.value==="account"]]),d.value==="providers"?(y(),M("section",oDe,[j(hOe)])):ee("",!0),Bn(C("section",sDe,[C("section",iDe,[C("div",rDe,[C("h3",lDe,N(p(n)("settings.agentDefaults")),1)]),C("div",aDe,[e.config?(y(),M(Pe,{key:0},[C("div",uDe,[C("span",cDe,[qe(N(p(n)("settings.defaultModel"))+" ",1),C("span",dDe,N(p(n)("settings.defaultModelHint")),1)]),B.value.length>0?(y(),M("div",fDe,[j(p(n3),{"model-value":e.config.defaultModel??"",options:H.value,"aria-label":p(n)("settings.defaultModel"),"onUpdate:modelValue":W},null,8,["model-value","options","aria-label"])])):(y(),M("span",pDe,N(e.config.defaultModel??p(n)("settings.noDefaultModel")),1))]),C("div",hDe,[C("span",mDe,[qe(N(p(n)("settings.defaultPermission"))+" ",1),C("span",gDe,N(p(n)("settings.defaultPermissionHint")),1)]),j(p(wi),{"model-value":O.value,options:w.map(Ge=>({value:Ge,label:p(n)(b[Ge])})),"onUpdate:modelValue":Oe[8]||(Oe[8]=Ge=>K(Ge))},null,8,["model-value","options"])]),C("div",vDe,[C("span",yDe,[qe(N(p(n)("settings.defaultThinking"))+" ",1),C("span",kDe,N(p(n)("settings.defaultThinkingHint")),1)]),j(p(ed),{"model-value":de(),label:p(n)("settings.defaultThinking"),"onUpdate:modelValue":Oe[9]||(Oe[9]=Ge=>pe())},null,8,["model-value","label"])]),C("div",bDe,[C("span",CDe,[qe(N(p(n)("settings.defaultPlanMode"))+" ",1),C("span",wDe,N(p(n)("settings.defaultPlanModeHint")),1)]),j(p(ed),{"model-value":z(e.config.defaultPlanMode),label:p(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Oe[10]||(Oe[10]=Ge=>Ie("defaultPlanMode"))},null,8,["model-value","label"])])],64)):(y(),M("div",_De,N(p(n)("settings.configUnavailable")),1))])]),e.config&&V.value?(y(),M("section",xDe,[C("div",SDe,[C("h3",ADe,N(p(n)("settings.secondaryModelSection")),1)]),C("div",MDe,[C("div",TDe,[C("span",EDe,[qe(N(p(n)("settings.secondaryModel"))+" ",1),C("span",IDe,N(p(n)("settings.secondaryModelHint")),1)]),B.value.length>0?(y(),M("div",LDe,[j(mPe,{"model-value":ie.value,effort:ne.value,groups:B.value,"model-info-by-id":X.value,onSelect:le},null,8,["model-value","effort","groups","model-info-by-id"])])):(y(),M("span",$De,N(ie.value||p(n)("settings.noSecondaryModel")),1))])])])):ee("",!0)],512),[[qs,d.value==="agent"]]),Bn(C("section",NDe,[C("section",FDe,[C("h3",RDe,N(p(n)("settings.versionAndUpdates")),1),C("div",ODe,[C("div",PDe,[C("span",DDe,[qe(N(p(n)("settings.appVersion"))+" ",1),C("span",BDe,N(p(n)("settings.appVersionHint")),1)]),C("span",HDe,N(p(T)),1)]),C("div",zDe,[C("span",WDe,[qe(N(p(n)("settings.serverVersion"))+" ",1),C("span",UDe,N(p(n)("settings.serverVersionHint")),1)]),C("span",jDe,N(e.serverVersion||"-"),1)]),C("div",VDe,[C("span",qDe,[qe(N(p(n)("settings.serverAddress"))+" ",1),C("span",KDe,N(p(n)("settings.serverAddressHint")),1)]),C("span",ZDe,N(p(k)),1)]),p(A).canCheck?(y(),M("div",GDe,[C("span",YDe,[qe(N(p(n)("settings.checkUpdate"))+" ",1),I.value?(y(),M("span",XDe,N(I.value),1)):(y(),M("span",JDe,N(p(n)("settings.checkUpdateHint")),1))]),j(p(Rt),{variant:"secondary",size:"sm",disabled:E.value,onClick:D},{default:me(()=>[qe(N(E.value?p(n)("settings.updateChecking"):p(n)("settings.checkUpdateBtn")),1)]),_:1},8,["disabled"])])):ee("",!0),p(A).canToggleAutoDownload?(y(),M("div",QDe,[C("span",eBe,[qe(N(p(n)("settings.autoDownloadUpdate"))+" ",1),C("span",tBe,N(p(n)("settings.autoDownloadUpdateHint")),1)]),j(p(ed),{"model-value":p(A).autoDownload.value,label:p(n)("settings.autoDownloadUpdate"),"onUpdate:modelValue":Oe[11]||(Oe[11]=Ge=>p(A).setAutoDownload(Ge))},null,8,["model-value","label"])])):ee("",!0)])]),e.config?(y(),M("section",nBe,[C("h3",oBe,N(p(n)("settings.privacy")),1),C("div",sBe,[C("div",iBe,[C("span",rBe,[qe(N(p(n)("settings.telemetry"))+" ",1),C("span",lBe,N(p(n)("settings.telemetryHint")),1),C("span",aBe,N(p(n)("settings.telemetryRestartHint")),1)]),j(p(ed),{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:p(n)("settings.telemetry"),"onUpdate:modelValue":Oe[12]||(Oe[12]=Ge=>ve())},null,8,["model-value","disabled","label"])])])])):ee("",!0),C("section",uBe,[C("h3",cBe,N(p(n)("settings.diagnostics")),1),C("div",dBe,[C("div",fBe,[C("span",pBe,[qe(N(p(n)("settings.exportLog"))+" ",1),C("span",hBe,N(p(n)("settings.exportLogHint")),1),p(Qr)()?ee("",!0):(y(),M("span",mBe,N(p(n)("settings.logHint")),1))]),j(p(Rt),{variant:"secondary",size:"sm",onClick:S},{default:me(()=>[qe(N(p(n)("settings.exportLogBtn")),1)]),_:1})])])])],512),[[qs,d.value==="advanced"]]),Bn(C("section",gBe,[C("div",vBe,[C("h4",yBe,N(p(n)("settings.archivedTitle")),1),C("p",kBe,N(p(n)("settings.archivedDesc")),1)]),C("div",bBe,[C("label",CBe,[Oe[17]||(Oe[17]=C("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[C("circle",{cx:"11",cy:"11",r:"7"}),C("path",{d:"m21 21-4.3-4.3"})],-1)),Bn(C("input",{"onUpdate:modelValue":Oe[13]||(Oe[13]=Ge=>ge.value=Ge),placeholder:p(n)("settings.archivedSearch")},null,8,wBe),[[ai,ge.value]])]),j(p(n3),{"model-value":Q.value,options:Se.value,size:"sm","aria-label":p(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Oe[14]||(Oe[14]=Ge=>Q.value=Ge)},null,8,["model-value","options","aria-label"]),j(p(wi),{size:"sm","model-value":te.value,options:[{value:"archived-desc",label:p(n)("settings.archivedSortArchived"),icon:"clock"},{value:"created-desc",label:p(n)("settings.archivedSortCreated"),icon:"calendar-schedule"},{value:"name-asc",label:p(n)("settings.archivedSortName"),icon:"sort"}],"onUpdate:modelValue":Oe[15]||(Oe[15]=Ge=>te.value=Ge)},null,8,["model-value","options"])]),fe.value?(y(),M("div",_Be,N(p(n)("settings.archivedLoadingAll")),1)):(y(),M(Pe,{key:1},[_e.value.length>0?(y(),M("div",xBe,[(y(!0),M(Pe,null,pt(_e.value,Ge=>(y(),M("section",{key:Ge.cwd,class:"archive-card"},[C("div",SBe,[j(p(Te),{name:"folder-closed",size:"md"}),C("span",ABe,N(Ge.cwd),1),C("span",MBe,N(p(n)("settings.archivedSessionsCount",{count:Ge.items.length})),1)]),C("div",TBe,[(y(!0),M(Pe,null,pt(Ge.items,at=>(y(),M("div",{key:at.id,class:"archive-row"},[C("div",EBe,[C("div",IBe,N(at.title),1),C("div",LBe,N(p(n)("settings.archivedAt",{time:it(at.updatedAt)})),1)]),j(p(Rt),{variant:"secondary",size:"sm",onClick:Tt=>Ee(at.id)},{default:me(()=>[j(p(Te),{name:"undo",size:"sm"}),C("span",null,N(p(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(y(),M("div",$Be,N(Y.value.length===0?p(n)("settings.archivedEmpty"):p(n)("settings.archivedNoMatch")),1))],64))],512),[[qs,d.value==="archived"]])],34)])],512)]),_:1},8,["aria-label"]))}}),RBe=ft(FBe,[["__scopeId","data-v-146a8c47"]]),OBe={class:"aw"},PBe={class:"crumbbar"},DBe={class:"crumbs"},BBe={key:0,class:"crumb-sep"},HBe=["onClick"],zBe={key:0,class:"filterbar"},WBe=["placeholder"],UBe={class:"folder-list"},jBe={key:0,class:"fl-loading"},VBe=["onClick"],qBe={class:"folder-name search-rel"},KBe={key:0,class:"fl-empty"},ZBe={key:1,class:"fl-loading"},GBe=["onClick"],YBe={class:"folder-name"},XBe={key:0,class:"fl-empty"},JBe={class:"paste-row"},QBe={class:"paste-input-wrap"},eHe={key:1,class:"add-error",role:"alert"},tHe={class:"actions"},nHe={class:"footer-hint"},oHe=600,sHe=6,_S=150,iHe=et({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z(!0),r=Z(!1),l=Z(!1),a=Z(""),u=Z(null),c=Z([]),d=Z(""),f=Z(!1),h=Z([]),m=R(()=>d.value.trim().length>0);let v=0,k=null;function w(U,z){const W=U.toLowerCase(),K=z.toLowerCase();let V=0;for(let ie=0;ie<K.length&&V<W.length;ie++)K[ie]===W[V]&&V++;return V===W.length}async function b(U){const z=a.value,W=U.trim();if(!z||W===""){h.value=[],f.value=!1;return}const K=++v;f.value=!0;const V=[],ie=[{path:z,depth:0}];let ne=0;for(;ie.length>0&&ne<oHe&&V.length<_S;){if(K!==v)return;const X=ie.shift();ne++;let le;try{le=await o.browseFs(X.path)}catch{continue}if(K!==v)return;for(const Ie of le.entries){if(!Ie.isDir)continue;const de=Ie.path.startsWith(z)?Ie.path.slice(z.length).replace(/^\/+/,""):Ie.path;if(w(W,de||Ie.name)&&(V.push({path:Ie.path,name:Ie.name,rel:de||Ie.name}),V.length>=_S))break;X.depth+1<sHe&&ie.push({path:Ie.path,depth:X.depth+1})}K===v&&(h.value=[...V])}K===v&&(f.value=!1)}Je(d,U=>{if(k&&clearTimeout(k),U.trim()===""){v++,h.value=[],f.value=!1;return}k=setTimeout(()=>void b(U),220)});const _=Z(!1),g=Z(""),x=R(()=>g.value.trim()),S=R(()=>{const U=a.value;if(!U)return[];const z=U.split("/").filter(Boolean),W=[{label:"/",path:"/"}];let K="";for(const V of z)K+=`/${V}`,W.push({label:V,path:K});return W}),T=R(()=>a.value.length>0);async function A(U){r.value=!0;try{const z=await o.browseFs(U);if(!z.path){l.value=!0;return}a.value=z.path,u.value=z.parent,c.value=z.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function E(U){U.isDir&&A(U.path)}function P(){u.value&&A(u.value)}function D(){T.value&&s("add",a.value)}function I(){x.value.length!==0&&s("add",x.value)}const{handleCompositionStart:$,handleCompositionEnd:B,isComposingKeyEvent:H}=Ar();function O(U){H(U)||I()}function F(U){U.key==="Escape"&&H(U)&&U.stopPropagation()}return dn(async()=>{r.value=!0;try{if(o.defaultPath&&(await A(o.defaultPath),!l.value))return;const U=await o.getFsHome();U.home?await A(U.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),bn(()=>{k&&clearTimeout(k)}),(U,z)=>(y(),he(p(ua),{open:i.value,"onUpdate:open":z[5]||(z[5]=W=>i.value=W),title:p(n)("workspace.addTitle"),size:"lg",height:"fixed",padded:!1,onClose:z[6]||(z[6]=W=>s("close"))},{default:me(()=>[C("div",OBe,[l.value?ee("",!0):(y(),M(Pe,{key:0},[C("div",PBe,[j(p(gn),{size:"sm",disabled:!u.value,label:p(n)("workspace.up"),tooltip:p(n)("workspace.up"),onClick:P},{default:me(()=>[j(p(Te),{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label","tooltip"]),C("div",DBe,[(y(!0),M(Pe,null,pt(S.value,(W,K)=>(y(),M(Pe,{key:W.path},[K>1?(y(),M("span",BBe,"/")):ee("",!0),C("button",{class:Re(["crumb",{last:K===S.value.length-1}]),onClick:V=>A(W.path)},N(W.label),11,HBe)],64))),128))])]),r.value?ee("",!0):(y(),M("div",zBe,[j(p(Te),{class:"filter-icon",name:"search",size:"md"}),Bn(C("input",{"onUpdate:modelValue":z[0]||(z[0]=W=>d.value=W),class:"filter-input",type:"text",placeholder:p(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:z[1]||(z[1]=It(()=>{},["stop"]))},null,40,WBe),[[ai,d.value]]),f.value?(y(),he(p(Ao),{key:0,size:"sm"})):ee("",!0)])),C("div",UBe,[r.value?(y(),M("div",jBe,N(p(n)("workspace.browsing")),1)):m.value?(y(),M(Pe,{key:1},[(y(!0),M(Pe,null,pt(h.value,W=>(y(),M("button",{key:W.path,class:"folder-row",onClick:K=>A(W.path)},[j(p(Te),{class:"dir-icon",name:"folder-closed",size:"sm"}),C("span",qBe,N(W.rel),1)],8,VBe))),128)),!f.value&&h.value.length===0?(y(),M("div",KBe,N(p(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(y(),M("div",ZBe,N(p(n)("workspace.searching")),1)):ee("",!0)],64)):(y(),M(Pe,{key:2},[(y(!0),M(Pe,null,pt(c.value,W=>(y(),M("button",{key:W.path,class:"folder-row",onClick:K=>E(W)},[j(p(Te),{class:"dir-icon",name:"folder-closed",size:"sm"}),C("span",YBe,N(W.name),1)],8,GBe))),128)),c.value.length===0?(y(),M("div",XBe,N(p(n)("workspace.noSubfolders")),1)):ee("",!0)],64))])],64)),C("div",{class:Re(["paste-section",{"paste-only":l.value}])},[!l.value&&!_.value?(y(),he(p(Rt),{key:0,variant:"ghost",size:"sm",onClick:z[2]||(z[2]=W=>_.value=!0)},{default:me(()=>[qe(N(p(n)("workspace.pasteToggle")),1)]),_:1})):(y(),he(p(IW),{key:1,label:p(n)("workspace.pathLabel")},{default:me(()=>[C("div",JBe,[C("div",QBe,[j(p(js),{modelValue:g.value,"onUpdate:modelValue":z[3]||(z[3]=W=>g.value=W),placeholder:p(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:[xl(It(O,["stop"]),["enter"]),F],onCompositionstart:p($),onCompositionend:p(B)},null,8,["modelValue","placeholder","onKeydown","onCompositionstart","onCompositionend"])]),j(p(gn),{disabled:x.value.length===0,label:p(n)("workspace.add"),tooltip:p(n)("workspace.add"),onClick:I},{default:me(()=>[j(p(Te),{name:"plus",size:"md"})]),_:1},8,["disabled","label","tooltip"])])]),_:1},8,["label"]))],2),e.error?(y(),M("div",eHe,N(e.error),1)):ee("",!0),C("div",tHe,[j(p(pn),{text:a.value},{default:me(()=>[l.value?ee("",!0):(y(),he(p(Rt),{key:0,variant:"primary",disabled:!T.value,onClick:D},{default:me(()=>[qe(N(p(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),j(p(Rt),{variant:"secondary",onClick:z[4]||(z[4]=W=>s("close"))},{default:me(()=>[qe(N(p(n)("workspace.cancel")),1)]),_:1})]),C("div",nHe,N(p(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),rHe=ft(iHe,[["__scopeId","data-v-fea98be5"]]),lHe={key:0,class:"confirm-dialog__message"},aHe=et({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt();function i(){n.loading||(o("update:open",!1),o("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),o("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),Vn(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(y(),he(p(ua),{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=u=>o("update:open",u)),onClose:i},{foot:me(()=>[j(p(Rt),{variant:"secondary",disabled:e.loading,onClick:i},{default:me(()=>[qe(N(e.cancelLabel??p(s)("common.cancel")),1)]),_:1},8,["disabled"]),j(p(Rt),{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=u=>o("confirm"))},{default:me(()=>[qe(N(e.confirmLabel??p(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:me(()=>[e.message?(y(),M("p",lHe,N(e.message),1)):ee("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),uHe=ft(aHe,[["__scopeId","data-v-aa5422da"]]),cHe=et({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=hu();function i(){s()}return(r,l)=>p(t)!==null?(y(),he(uHe,{key:0,open:!0,title:p(t).title,message:p(t).message,"confirm-label":p(t).confirmLabel,"cancel-label":p(t).cancelLabel,variant:p(t).variant,loading:p(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>p(o)(!1))},null,8,["title","message","confirm-label","cancel-label","variant","loading"])):ee("",!0)}}),dHe={class:"rows"},fHe={class:"row"},pHe={class:"row"},hHe={class:"row"},mHe={class:"row"},gHe={class:"row"},vHe={class:"row"},yHe={class:"ctx-text"},kHe={key:0,class:"bar"},bHe={class:"row"},CHe=et({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z(!0),r=R(()=>o.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100)))),l=R(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:Al(o.status.ctxUsed),max:Al(o.status.ctxMax),pct:r.value}):n("status.statusNone"));function a(m){return n(m==="yolo"?"status.permissionYolo":m==="auto"?"status.permissionAuto":"status.permissionManual")}const u=R(()=>{const m=o.status.permission;return m==="auto"?"var(--color-danger)":m==="yolo"?"var(--color-warning)":"var(--color-text)"}),c=R(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=R(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=R(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=R(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(m,v)=>(y(),he(p(ua),{open:i.value,"onUpdate:open":v[0]||(v[0]=k=>i.value=k),title:p(n)("status.statusPanelTitle"),onClose:v[1]||(v[1]=k=>s("close"))},{default:me(()=>[C("dl",dHe,[C("div",fHe,[C("dt",null,N(p(n)("status.statusModel")),1),C("dd",null,N(e.status.model),1)]),C("div",pHe,[C("dt",null,N(p(n)("status.statusThinking")),1),C("dd",null,N(e.thinking),1)]),C("div",hHe,[C("dt",null,N(p(n)("status.statusPermission")),1),C("dd",{style:Zt({color:u.value})},N(a(e.status.permission)),5)]),C("div",mHe,[C("dt",null,N(p(n)("status.statusPlanMode")),1),C("dd",{class:Re({"plan-on":e.planMode})},N(c.value),3)]),C("div",gHe,[C("dt",null,N(p(n)("status.statusSwarmMode")),1),C("dd",{class:Re({"swarm-on":e.swarmMode})},N(d.value),3)]),C("div",vHe,[C("dt",null,N(p(n)("status.statusContext")),1),C("dd",null,[C("span",yHe,N(l.value),1),e.status.ctxMax>0?(y(),M("span",kHe,[C("i",{style:Zt({width:r.value+"%"})},null,4)])):ee("",!0)])]),C("div",bHe,[C("dt",null,N(p(n)("status.statusCost")),1),C("dd",null,N(h.value),1)])])]),_:1},8,["open","title"]))}}),wHe=ft(CHe,[["__scopeId","data-v-340d1b31"]]),_He={key:0,class:"actions"},xHe=["onClick"],SHe=["onClick"],AHe={key:1,class:"details"},MHe=et({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt();function i(E){return typeof E=="object"&&E!==null}function r(E){return i(E)?E.title:E}function l(E){return i(E)?E.message??"":""}function a(E){return i(E)?E.details:void 0}function u(E){return i(E)?E.severity==="error":E.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(E)}function c(E){return i(E)?E.severity==="error"?"danger":E.severity==="success"?"success":E.severity==="info"?"info":"warning":u(E)?"danger":"warning"}function d(E){return i(E)?`notice:${E.severity}:${E.title}:${E.message??""}:${JSON.stringify(E.details??[])}`:`text:${E}`}function f(E){if(!i(E))return E;const P=[E.title];E.message&&P.push(E.message);const D=E.details??[];if(D.length>0){P.push("",`${s("warnings.diagnostics")}:`);for(const I of D)P.push(`${I.label}: ${I.value}`)}return P.join(`
638
638
  `)}let h=1;const m=Z([]),v=new Map,k=new Map;function w(E){const P=u(E)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?P+5e3:P}function b(E,P){const D=v.get(E)??{handle:null,deadline:0,remaining:0};D.handle=setTimeout(()=>A(E),P),D.deadline=Date.now()+P,v.set(E,D)}function _(E){const P=v.get(E);P&&P.handle!==null&&clearTimeout(P.handle),v.delete(E)}function g(E){const P=v.get(E);!P||P.handle===null||(clearTimeout(P.handle),P.handle=null,P.remaining=Math.max(0,P.deadline-Date.now()))}function x(E){if(m.value.find(I=>I.id===E)?.detailsOpen)return;const D=v.get(E);!D||D.handle!==null||b(E,D.remaining)}function S(E){E.detailsOpen=!E.detailsOpen,E.detailsOpen?g(E.id):x(E.id)}async function T(E){if(!await Zs(f(E.warning)))return;E.copied=!0;const D=k.get(E.id);D&&clearTimeout(D),k.set(E.id,setTimeout(()=>{E.copied=!1,k.delete(E.id)},1400))}function A(E){_(E);const P=k.get(E);P&&clearTimeout(P),k.delete(E);const D=m.value.findIndex(I=>I.id===E);D!==-1&&(m.value=m.value.filter(I=>I.id!==E),o("dismiss",D))}return Je(()=>n.warnings,E=>{const P=[...m.value];m.value=E.map(D=>{const I=d(D),$=P.findIndex(O=>O.key===I),B=$===-1?void 0:P.splice($,1)[0];if(B)return B.warning=D,B;const H={id:h++,key:I,warning:D,detailsOpen:!1,copied:!1};return b(H.id,w(D)),H});for(const D of P){_(D.id);const I=k.get(D.id);I&&clearTimeout(I),k.delete(D.id)}},{immediate:!0,flush:"post"}),bn(()=>{v.forEach(E=>{E.handle!==null&&clearTimeout(E.handle)}),v.clear(),k.forEach(E=>clearTimeout(E)),k.clear()}),(E,P)=>(y(),he(YA,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:me(()=>[(y(!0),M(Pe,null,pt(m.value,D=>(y(),he(p(cU),{key:D.id,variant:c(D.warning),title:r(D.warning),message:l(D.warning),"dismiss-label":p(s)("warnings.dismiss"),onDismiss:I=>A(D.id),onPointerenter:I=>g(D.id),onPointerleave:I=>x(D.id)},{default:me(()=>[a(D.warning)?.length?(y(),M("div",_He,[C("button",{class:"link",type:"button",onClick:I=>S(D)},N(D.detailsOpen?p(s)("warnings.hideDetails"):p(s)("warnings.showDetails")),9,xHe),C("button",{class:"link",type:"button",onClick:I=>T(D)},N(D.copied?p(s)("warnings.copied"):p(s)("warnings.copyDetails")),9,SHe)])):ee("",!0),D.detailsOpen&&a(D.warning)?.length?(y(),M("dl",AHe,[(y(!0),M(Pe,null,pt(a(D.warning),I=>(y(),M("div",{key:`${I.label}:${I.value}`,class:"detail-row"},[C("dt",null,N(I.label),1),C("dd",null,N(I.value),1)]))),128))])):ee("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),THe=ft(MHe,[["__scopeId","data-v-ac44e9ef"]]),EHe={class:"topbar"},IHe={class:"wsq"},LHe=["aria-label"],$He={class:"tb-path"},NHe={class:"ws"},FHe={class:"se"},RHe={class:"tb-sub"},OHe=et({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=R(()=>{const a=o.workspace,c=(a?.name||a?.root||"").trim().charAt(0);return c?c.toUpperCase():"K"}),r=R(()=>o.workspace?.name??n("workspace.noWorkspace")),l=R(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,u)=>(y(),M("div",EHe,[C("span",IHe,N(i.value),1),C("button",{type:"button",class:"tb-mid","aria-label":p(n)("mobile.openSwitcher"),onClick:u[0]||(u[0]=c=>s("openSwitcher"))},[C("span",$He,[C("span",NHe,N(r.value),1),e.sessionTitle?(y(),M(Pe,{key:0},[u[2]||(u[2]=C("span",{class:"sl"},"/",-1)),C("span",FHe,N(e.sessionTitle),1)],64)):ee("",!0),u[3]||(u[3]=C("span",{class:"cv"},"⌄",-1))]),C("span",RHe,[C("span",{class:Re(["rd",{on:e.running}])},null,2),C("span",null,N(l.value),1),e.branch?(y(),M(Pe,{key:0},[qe(" · "+N(e.branch),1)],64)):ee("",!0),e.sessionCount>0?(y(),M(Pe,{key:1},[qe(" · "+N(p(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ee("",!0)])],8,LHe),j(p(gn),{size:"lg",label:p(n)("mobile.openSettings"),onClick:u[1]||(u[1]=c=>s("openSettings"))},{default:me(()=>[j(p(Te),{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),PHe=ft(OHe,[["__scopeId","data-v-7f357087"]]),DHe={key:0,class:"sheet-root"},BHe=["aria-label"],HHe=["aria-label"],zHe={key:0,class:"sheet-head"},WHe={class:"sheet-title"},UHe={class:"sheet-body"},jHe=et({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""},closeOnEsc:{type:Boolean,default:!0}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&o.closeOnEsc&&i()}return Je(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),bn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(y(),he(as,{name:"sheet"},{default:me(()=>[e.modelValue?(y(),M("div",DHe,[C("div",{class:"sheet-scrim",onClick:i}),C("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||p(n)("mobile.sheetLabel")},[C("button",{type:"button",class:"sheet-grab","aria-label":p(n)("mobile.closeSheet"),onClick:i},null,8,HHe),e.title?(y(),M("div",zHe,[C("span",WHe,N(e.title),1)])):ee("",!0),C("div",UHe,[xn(l.$slots,"default",{},void 0,!0)])],8,BHe)])):ee("",!0)]),_:3}))}}),CF=ft(jHe,[["__scopeId","data-v-c3d5dadc"]]),VHe={class:"mlist"},qHe={key:0,class:"mempty"},KHe=["onClick"],ZHe={class:"mgh-main"},GHe={class:"mgh-name"},YHe={class:"mgh-path"},XHe={key:2,class:"att"},JHe={key:0,class:"mempty small"},QHe=["onClick"],eze={class:"m"},tze={class:"s"},nze={key:0,class:"att"},oze={key:1,class:"mshow-more-row"},sze=["disabled","onClick"],ize={key:1,class:"mshow-more-sep","aria-hidden":"true"},rze=["onClick"],lze=et({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t;function i(){s("update:modelValue",!1)}function r($){s("select",$),i()}function l($){s("createInWorkspace",$),i()}function a(){s("create"),i()}function u(){s("addWorkspace"),i()}const c=Z(new Set);function d($){return c.value.has($)}function f($){const B=new Set(c.value);B.has($)?B.delete($):B.add($),c.value=B,x.value=null,E.value=null}const h=Z(new Map);function m($){return h.value.get($.workspace.id)??$.initialCount}function v($){const B=$.sessions.slice(0,m($));if(o.activeId&&!B.some(H=>H.id===o.activeId)){const H=$.sessions.find(O=>O.id===o.activeId);if(H)return[...B,H]}return B}function k($){return $.sessions.length>m($)||$.hasMore||$.loadingMore}function w($){return m($)>$.initialCount}function b($){const B=o.groups.find(F=>F.workspace.id===$);if(!B)return;const H=m(B)+O5,O=new Map(h.value);O.set($,H),h.value=O,B.sessions.length<H&&B.hasMore&&s("loadMore",$)}function _($){if(!h.value.has($))return;const B=new Map(h.value);B.delete($),h.value=B}function g($){return o.attentionByWorkspace[$]??0}const x=Z(null);function S($){x.value=x.value===$?null:$,E.value=null}function T($){x.value=null;const H=(typeof window<"u"?window.prompt(n("sidebar.rename"),$.title):null)?.trim();H&&s("rename",$.id,H)}function A($){x.value=null,s("archive",$)}const E=Z(null);function P($){E.value=E.value===$?null:$,x.value=null}function D($){Zs($.root),E.value=null}function I($){E.value=null,s("deleteWorkspace",$.id)}return($,B)=>(y(),he(CF,{"model-value":e.modelValue,"onUpdate:modelValue":B[2]||(B[2]=H=>s("update:modelValue",H))},{default:me(()=>[C("button",{type:"button",class:"newrow",onClick:a},[j(p(Te),{name:"message",size:"sm"}),qe(" "+N(p(n)("sidebar.newChat")),1)]),C("button",{type:"button",class:"newrow secondary",onClick:u},[j(p(Te),{name:"folder",size:"sm"}),qe(" "+N(p(n)("sidebar.newWorkspace")),1)]),C("div",VHe,[e.groups.length===0?(y(),M("div",qHe,N(p(n)("workspace.noWorkspace")),1)):ee("",!0),(y(!0),M(Pe,null,pt(e.groups,H=>(y(),M("div",{key:H.workspace.id,class:"mgroup"},[C("div",{class:Re(["mgh",{on:H.workspace.id===e.activeWorkspaceId}]),onClick:O=>f(H.workspace.id)},[d(H.workspace.id)?(y(),he(p(Te),{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(y(),he(p(Te),{key:1,class:"mgh-folder",name:"folder",size:"sm"})),C("div",ZHe,[C("span",GHe,N(H.workspace.name),1),j(p(pn),{text:H.workspace.root},{default:me(()=>[C("span",YHe,N(H.workspace.shortPath),1)]),_:2},1032,["text"])]),d(H.workspace.id)&&g(H.workspace.id)>0?(y(),M("span",XHe,N(g(H.workspace.id)),1)):ee("",!0),j(p(gn),{size:"lg",class:"mgh-more",label:p(n)("sidebar.options"),onClick:It(O=>P(H.workspace.id),["stop"])},{default:me(()=>[j(p(Te),{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),j(p(gn),{size:"lg",class:"mgh-add",label:p(n)("workspace.newInGroup"),onClick:It(O=>l(H.workspace.id),["stop"])},{default:me(()=>[j(p(Te),{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),E.value===H.workspace.id?(y(),he(p(Cl),{key:3,class:"kmenu wsmenu",onClick:B[0]||(B[0]=It(()=>{},["stop"]))},{default:me(()=>[j(p(hn),{size:"lg",onClick:O=>D(H.workspace)},{default:me(()=>[qe(N(p(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),j(p(hn),{size:"lg",danger:"",onClick:O=>I(H.workspace)},{default:me(()=>[qe(N(p(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ee("",!0)],10,KHe),Bn(C("div",null,[H.sessions.length===0?(y(),M("div",JHe,N(p(n)("sidebar.noSessions")),1)):ee("",!0),(y(!0),M(Pe,null,pt(v(H),O=>(y(),M("div",{key:O.id,class:Re(["srow",{cur:O.id===e.activeId}]),onClick:F=>r(O.id)},[C("div",eze,[C("div",{class:Re(["t",{run:O.busy,aborted:!O.busy&&(e.attentionBySession[O.id]??0)===0&&O.lastTurnReason==="failed"}])},N(O.title),3),C("div",tze,N(O.time),1)]),(e.attentionBySession[O.id]??0)>0?(y(),M("span",nze,N(e.attentionBySession[O.id]),1)):ee("",!0),j(p(gn),{size:"lg",class:"kb",label:p(n)("sidebar.options"),onClick:It(F=>S(O.id),["stop"])},{default:me(()=>[j(p(Te),{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),x.value===O.id?(y(),he(p(Cl),{key:1,class:"kmenu",onClick:B[1]||(B[1]=It(()=>{},["stop"]))},{default:me(()=>[j(p(hn),{size:"lg",onClick:F=>T(O)},{default:me(()=>[qe(N(p(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),j(p(hn),{size:"lg",onClick:F=>A(O.id)},{default:me(()=>[qe(N(p(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ee("",!0)],10,QHe))),128)),k(H)||w(H)?(y(),M("div",oze,[k(H)?(y(),M("button",{key:0,type:"button",class:"mshow-more",disabled:H.loadingMore,onClick:It(O=>b(H.workspace.id),["stop"])},[j(p(Te),{name:"chevron-down",size:"sm"}),qe(" "+N(H.loadingMore?p(n)("sidebar.loadingMore"):p(n)("sidebar.showMore")),1)],8,sze)):ee("",!0),k(H)&&w(H)?(y(),M("span",ize,"·")):ee("",!0),w(H)?(y(),M("button",{key:2,type:"button",class:"mshow-more",onClick:It(O=>_(H.workspace.id),["stop"])},[j(p(Te),{name:"chevron-up",size:"sm"}),qe(" "+N(p(n)("sidebar.showLess")),1)],8,rze)):ee("",!0)])):ee("",!0)],512),[[qs,!d(H.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),aze=ft(lze,[["__scopeId","data-v-67278201"]]),uze={class:"group-title"},cze={class:"srow-main"},dze={class:"srow-label"},fze={class:"srow-sub"},pze={class:"srow read-only"},hze={class:"srow-main"},mze={class:"srow-label"},gze={key:0,class:"srow-sub"},vze={class:"cache-note"},yze={class:"srow-main"},kze={class:"srow-label"},bze={class:"srow-sub"},Cze=["aria-checked"],wze={class:"srow-main"},_ze={class:"srow-label"},xze={class:"srow-sub"},Sze=["aria-checked"],Aze={class:"srow-main"},Mze={class:"srow-label"},Tze={class:"srow read-only"},Eze={class:"srow-main"},Ize={class:"srow-label"},Lze={class:"srow-sub"},$ze=["aria-label"],Nze={class:"group-title"},Fze={class:"srow-main"},Rze={class:"srow-label"},Oze={class:"srow-sub"},Pze={class:"srow read-only pref"},Dze={class:"srow-main"},Bze={class:"srow-label"},Hze={class:"srow read-only pref"},zze={class:"srow-main"},Wze={class:"srow-label"},Uze={class:"srow read-only pref"},jze={class:"srow-main"},Vze={class:"srow-label"},qze={key:0,class:"srow read-only acct-profile"},Kze={class:"acct-avatar","aria-hidden":"true"},Zze=["src"],Gze={class:"srow-main"},Yze={class:"acct-name-row"},Xze={class:"srow-label"},Jze={class:"srow-sub"},Qze={class:"srow-main"},eWe={class:"srow-label"},tWe={class:"srow-main"},nWe={class:"srow-label"},oWe={key:3,class:"srow read-only"},sWe={class:"srow-main"},iWe={class:"srow-label"},rWe={class:"srow-val dim"},lWe={class:"arch-subhead"},aWe={class:"arch-count"},uWe={class:"arch-tools"},cWe={key:0,class:"arch-empty"},dWe={class:"arch-meta"},fWe={class:"arch-name"},pWe={class:"arch-time"},hWe={key:2,class:"arch-empty"},mWe=100,gWe=et({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},initialView:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},fontScale:{default:"medium"},managedProviderStatus:{default:null},managedUserInfo:{default:null},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setFontScale","login","logout"],setup(e,{emit:t}){const{t:n}=Nt(),{isConfirmOpen:o}=hu(),s=e,i=t;function r(X){i("setColorScheme",X)}const l=["manual","yolo","auto"],a=R(()=>s.models?.find(X=>X.id===s.status?.modelId)),u=R(()=>p2(a.value)),c=R(()=>Up(a.value)),d=R(()=>Dm(a.value,s.thinking)),f=R(()=>c.value.includes(d.value)?d.value:""),h=R(()=>c.value.map(X=>({value:X,label:y3(X)}))),m=R(()=>s.planMode===!0),v=R(()=>s.swarmMode===!0),k=Z(!1);Je(()=>s.managedUserInfo?.avatar,()=>{k.value=!1});const w=R(()=>!!s.managedUserInfo?.avatar&&!k.value),b=R(()=>s.managedUserInfo?.userLevelName?.trim()??""),_=R(()=>{const X=s.status.permission;return X==="auto"?"var(--color-danger)":X==="yolo"?"var(--color-warning)":"var(--color-text-muted)"}),g=R(()=>{const X=s.status.permission,le=n(X==="yolo"?"mobile.permYoloSub":X==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${X} · ${le}`}),x=R(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(s.status.ctxUsed/s.status.ctxMax*100))):0),S=R(()=>s.status.ctxMax>0?`${Al(s.status.ctxUsed)}/${Al(s.status.ctxMax)}`:n("status.statusNone"));function T(X){i("setThinking",My(a.value,X))}function A(){const X=l.indexOf(s.status.permission),le=l[(X+1)%l.length];i("setPermission",le)}function E(){i("pickModel"),i("update:modelValue",!1)}function P(){i("login"),i("update:modelValue",!1)}function D(){i("logout"),i("update:modelValue",!1)}const I=mu(),$=Z("main"),B=Z([]),H=Z(!1),O=Z(!1),F=Z(""),U=Z("archived-desc");async function z(){if(!H.value){H.value=!0,O.value=!1;try{const X=[];let le;for(;;){const Ie=await I.loadArchivedSessions({beforeId:le,pageSize:mWe});if(X.push(...Ie.items),!Ie.hasMore||Ie.items.length===0)break;const de=Ie.items.at(-1)?.id;if(de===void 0)break;le=de}B.value=X,O.value=!0}catch(X){gl("loadAllArchived failed",X)}finally{H.value=!1}}}function W(){$.value="archived",F.value="",z()}Je(()=>s.modelValue,X=>{X&&s.initialView==="archived"&&W()});function K(){$.value="main"}const V=R(()=>{const X=F.value.trim().toLowerCase();let le=B.value.filter(Ie=>Ie.archived===!0);return X&&(le=le.filter(Ie=>Ie.title.toLowerCase().includes(X))),le=le.slice(),U.value==="archived-desc"?le.sort((Ie,de)=>de.updatedAt.localeCompare(Ie.updatedAt)):U.value==="created-desc"?le.sort((Ie,de)=>de.createdAt.localeCompare(Ie.createdAt)):le.sort((Ie,de)=>Ie.title.localeCompare(de.title,"zh")),le});async function ie(X){await I.restoreSession(X)&&(B.value=B.value.filter(Ie=>Ie.id!==X))}function ne(X){const le=new Date(X);if(Number.isNaN(le.getTime()))return X;const Ie=de=>String(de).padStart(2,"0");return`${le.getFullYear()}-${Ie(le.getMonth()+1)}-${Ie(le.getDate())} ${Ie(le.getHours())}:${Ie(le.getMinutes())}`}return Je(()=>s.modelValue,X=>{X||($.value="main")}),(X,le)=>(y(),he(CF,{"model-value":e.modelValue,title:p(n)("mobile.settingsTitle"),"close-on-esc":!p(o),"onUpdate:modelValue":le[6]||(le[6]=Ie=>i("update:modelValue",Ie))},{default:me(()=>[$.value==="main"?(y(),M(Pe,{key:0},[C("div",uze,N(p(n)("mobile.groupSession")),1),C("button",{type:"button",class:"srow",onClick:E},[C("span",cze,[C("span",dze,N(p(n)("status.statusModel")),1),C("span",fze,N(e.status.model),1)]),le[7]||(le[7]=C("span",{class:"chev"},"›",-1))]),C("div",pze,[C("span",hze,[C("span",mze,N(p(n)("status.statusThinking")),1),u.value==="unsupported"?(y(),M("span",gze,N(p(n)("status.modeNotSupported")),1)):ee("",!0)]),c.value.length>1?(y(),he(p(wi),{key:0,"model-value":f.value,options:h.value,size:"sm","onUpdate:modelValue":T},null,8,["model-value","options"])):(y(),M("span",{key:1,class:Re(["srow-val",{dim:d.value==="off"}])},N(d.value==="off"?p(n)("status.planOff"):p(y3)(d.value)),3))]),C("div",vze,N(p(n)("status.cacheNote")),1),C("button",{type:"button",class:"srow",onClick:le[0]||(le[0]=Ie=>i("togglePlan"))},[C("span",yze,[C("span",kze,N(p(n)("status.statusPlanMode")),1),C("span",bze,N(p(n)("mobile.planModeSub")),1)]),C("span",{class:Re(["toggle",{on:m.value}]),role:"switch","aria-checked":m.value},null,10,Cze)]),C("button",{type:"button",class:"srow",onClick:le[1]||(le[1]=Ie=>i("toggleSwarm"))},[C("span",wze,[C("span",_ze,N(p(n)("status.statusSwarmMode")),1),C("span",xze,N(p(n)("mobile.swarmModeSub")),1)]),C("span",{class:Re(["toggle",{on:v.value}]),role:"switch","aria-checked":v.value},null,10,Sze)]),C("button",{type:"button",class:"srow",onClick:A},[C("span",Aze,[C("span",Mze,N(p(n)("status.statusPermission")),1),C("span",{class:"srow-sub",style:Zt({color:_.value})},N(g.value),5)]),le[8]||(le[8]=C("span",{class:"chev"},"›",-1))]),C("div",Tze,[C("span",Eze,[C("span",Ize,N(p(n)("status.statusContext")),1),C("span",Lze,N(S.value),1)]),C("span",{class:"ctx-meter","aria-label":S.value},[C("i",{style:Zt({width:x.value+"%"})},null,4)],8,$ze)]),C("div",Nze,N(p(n)("mobile.groupApp")),1),C("button",{type:"button",class:"srow",onClick:W},[C("span",Fze,[C("span",Rze,N(p(n)("mobile.archivedSessions")),1),C("span",Oze,N(p(n)("mobile.archivedSessionsSub")),1)]),le[9]||(le[9]=C("span",{class:"chev"},"›",-1))]),C("div",Pze,[C("span",Dze,[C("span",Bze,N(p(n)("theme.colorSchemeLabel")),1)]),j(p(wi),{"model-value":e.colorScheme??"system",options:[{value:"light",label:p(n)("theme.light"),icon:"light-mode"},{value:"dark",label:p(n)("theme.dark"),icon:"dark-mode"},{value:"system",label:p(n)("theme.system")}],"onUpdate:modelValue":r},null,8,["model-value","options"])]),C("div",Hze,[C("span",zze,[C("span",Wze,N(p(n)("sidebar.language")),1)]),j(yF)]),C("div",Uze,[C("span",jze,[C("span",Vze,N(p(n)("settings.uiFontSize")),1)]),j(p(wi),{"model-value":e.fontScale,options:[{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"xlarge",label:"XL"}],"aria-label":p(n)("settings.uiFontSize"),"onUpdate:modelValue":le[2]||(le[2]=Ie=>i("setFontScale",Ie))},null,8,["model-value","aria-label"])]),e.managedProviderStatus==="authenticated"?(y(),M("div",qze,[C("span",Kze,[w.value?(y(),M("img",{key:0,src:e.managedUserInfo?.avatar,alt:"",onError:le[3]||(le[3]=Ie=>k.value=!0)},null,40,Zze)):(y(),he(p(Te),{key:1,name:"user",size:"md"}))]),C("span",Gze,[C("span",Yze,[C("span",Xze,N(e.managedUserInfo?.nickname||p(n)("sidebar.defaultUserName")),1),b.value?(y(),he(p(Vr),{key:0,class:"acct-level",variant:"neutral",size:"sm"},{default:me(()=>[qe(N(b.value),1)]),_:1})):ee("",!0)]),C("span",Jze,N(p(n)("settings.signedIn")),1)])])):ee("",!0),e.managedProviderStatus==="authenticated"?(y(),M("button",{key:1,type:"button",class:"srow acct out",onClick:D},[C("span",Qze,[C("span",eWe,N(p(n)("sidebar.signOut")),1)])])):(y(),M("button",{key:2,type:"button",class:"srow acct in",onClick:P},[C("span",tWe,[C("span",nWe,N(p(n)("sidebar.signIn")),1)])])),e.serverVersion?(y(),M("div",oWe,[C("span",sWe,[C("span",iWe,N(p(n)("settings.serverVersion")),1)]),C("span",rWe,N(e.serverVersion),1)])):ee("",!0)],64)):(y(),M(Pe,{key:1},[C("div",lWe,[C("button",{type:"button",class:"arch-back",onClick:K},[le[10]||(le[10]=C("span",{class:"chev back"},"‹",-1)),qe(" "+N(p(n)("mobile.archivedBack")),1)]),C("span",aWe,N(p(n)("mobile.sessionCount",{n:V.value.length})),1)]),C("div",uWe,[j(p(js),{class:"arch-search-input","model-value":F.value,size:"sm",placeholder:p(n)("settings.archivedSearch"),"onUpdate:modelValue":le[4]||(le[4]=Ie=>F.value=Ie)},null,8,["model-value","placeholder"]),j(p(wi),{size:"sm","model-value":U.value,options:[{value:"archived-desc",label:p(n)("settings.archivedSortArchived")},{value:"created-desc",label:p(n)("settings.archivedSortCreated")},{value:"name-asc",label:p(n)("settings.archivedSortName")}],"onUpdate:modelValue":le[5]||(le[5]=Ie=>U.value=Ie)},null,8,["model-value","options"])]),H.value?(y(),M("div",cWe,N(p(n)("settings.archivedLoadingAll")),1)):V.value.length>0?(y(!0),M(Pe,{key:1},pt(V.value,Ie=>(y(),M("div",{key:Ie.id,class:"arch-row"},[C("div",dWe,[C("div",fWe,N(Ie.title),1),C("div",pWe,N(p(n)("settings.archivedAt",{time:ne(Ie.updatedAt)})),1)]),j(p(Rt),{variant:"secondary",size:"sm",onClick:de=>ie(Ie.id)},{default:me(()=>[qe(N(p(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(y(),M("div",hWe,N(B.value.length===0?p(n)("settings.archivedEmpty"):p(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title","close-on-esc"]))}}),vWe=ft(gWe,[["__scopeId","data-v-41a9e678"]]),yWe=["mask"],kWe=et({__name:"BrandLogo",props:{size:{default:64}},setup(e){const t=`bl-eyes-${kO()}`,n=Z(null);let o;function s(){const i=n.value;i&&(i.classList.remove("blink-now"),i.getBoundingClientRect(),i.classList.add("blink-now"),clearTimeout(o),o=setTimeout(()=>i.classList.remove("blink-now"),300))}return Vn(()=>clearTimeout(o)),(i,r)=>(y(),M("svg",{ref_key:"logoRef",ref:n,class:"brand-logo",style:Zt({width:`${e.size}px`,height:`${e.size*22/32}px`}),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:s},[C("defs",null,[C("mask",{id:t,maskUnits:"userSpaceOnUse"},[...r[0]||(r[0]=[C("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"},null,-1),C("g",{class:"ch-eyes",fill:"#000"},[C("rect",{class:"ch-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),C("rect",{class:"ch-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})],-1)])])]),C("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--logo)",mask:`url(#${t})`},null,8,yWe)],4))}}),E8=ft(kWe,[["__scopeId","data-v-f04205a8"]]),bWe={key:0,class:"ls-done-card"},CWe={class:"ls-done-badge"},wWe={class:"ls-card-text"},_We={class:"ls-card-title"},xWe={class:"ls-card-hint"},SWe={key:1,class:"ls-cards"},AWe={class:"ls-card-text"},MWe={class:"ls-card-title"},TWe={class:"ls-reco"},EWe={class:"ls-card-hint"},IWe={class:"ls-card-logo ls-card-icon"},LWe={class:"ls-card-text"},$We={class:"ls-card-title"},NWe={class:"ls-card-hint"},FWe={key:2,class:"ls-flow"},RWe={key:0,class:"ls-center"},OWe={class:"ls-center-text"},PWe={key:1,class:"ls-device"},DWe={class:"ls-lead"},BWe=["href"],HWe={class:"ls-code-row"},zWe=["title"],WWe={class:"ls-status"},UWe={class:"ls-status-text"},jWe={class:"ls-countdown"},VWe={key:2,class:"ls-center"},qWe={class:"ls-center-text ls-success-text"},KWe={class:"ls-center-hint"},ZWe={class:"ls-center"},GWe={class:"ls-center-text ls-err-text"},YWe={class:"ls-center-hint"},XWe={class:"ls-actions"},JWe={class:"ls-center"},QWe={class:"ls-center-text ls-warn-text"},eUe={class:"ls-center-hint"},tUe={class:"ls-actions"},nUe=et({__name:"OnboardingLoginStep",props:{authReady:{type:Boolean},onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","addProvider"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z("choice"),{step:r,pollError:l,flow:a,secondsLeft:u,startFlow:c,cancelFlow:d}=vF({onStartOAuthLogin:o.onStartOAuthLogin,onPollOAuthLogin:o.onPollOAuthLogin,onCancelOAuthLogin:o.onCancelOAuthLogin,onSuccess:()=>s("success")}),f=Z(!1);function h(){i.value="flow",c()}function m(){d(),i.value="choice"}async function v(){!a.value||!await Zs(a.value.verificationUriComplete)||(f.value=!0,setTimeout(()=>{f.value=!1},2e3))}function k(w){const b=Math.floor(w/60),_=w%60;return`${b}:${String(_).padStart(2,"0")}`}return(w,b)=>e.authReady?(y(),M("div",bWe,[C("span",CWe,[j(p(Te),{name:"check",size:"sm"})]),C("div",wWe,[C("div",_We,N(p(n)("onboarding.login.loggedInTitle")),1),C("div",xWe,N(p(n)("onboarding.login.loggedInHint")),1)])])):i.value==="choice"?(y(),M("div",SWe,[C("button",{class:"ls-card",type:"button",onClick:h},[j(E8,{size:40,class:"ls-card-logo"}),C("div",AWe,[C("div",MWe,[qe(N(p(n)("onboarding.login.kimiTitle"))+" ",1),C("span",TWe,N(p(n)("onboarding.login.recommended")),1)]),C("div",EWe,N(p(n)("onboarding.login.kimiHint")),1)]),j(p(Te),{name:"chevron-right",size:"lg",class:"ls-card-chevron"})]),C("button",{class:"ls-card",type:"button",onClick:b[0]||(b[0]=_=>s("addProvider"))},[C("span",IWe,[j(p(Te),{name:"bolt",size:"lg"})]),C("div",LWe,[C("div",$We,N(p(n)("onboarding.login.customProviderTitle")),1),C("div",NWe,N(p(n)("onboarding.login.customProviderHint")),1)]),j(p(Te),{name:"chevron-right",size:"lg",class:"ls-card-chevron"})])])):(y(),M("div",FWe,[p(r)==="starting"?(y(),M("div",RWe,[j(p(Ao),{size:"md"}),C("span",OWe,N(p(n)("login.starting")),1)])):p(r)==="device-code"&&p(a)?(y(),M("div",PWe,[C("div",DWe,N(p(n)("login.lead")),1),C("a",{class:"ls-primary",href:p(a).verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[qe(N(p(n)("login.authorizeInBrowser"))+" ",1),j(p(Te),{name:"external-link",size:"sm"})],8,BWe),C("div",HWe,[C("span",{class:"ls-link",title:p(a).verificationUriComplete},N(p(a).verificationUriComplete),9,zWe),j(p(Rt),{class:Re(["ls-copy",{"is-copied":f.value}]),variant:"secondary",size:"sm",onClick:v},{default:me(()=>[f.value?(y(),M(Pe,{key:0},[j(p(Te),{name:"check",size:"sm"}),qe(" "+N(p(n)("login.copied")),1)],64)):(y(),M(Pe,{key:1},[j(p(Te),{name:"copy",size:"sm"}),qe(" "+N(p(n)("login.copyLink")),1)],64))]),_:1},8,["class"])]),C("div",WWe,[j(p(Ao),{size:"sm",label:p(n)("login.waitingAuth")},null,8,["label"]),C("span",UWe,N(p(n)("login.waitingAutoClose")),1),C("span",jWe,N(k(p(u))),1)])])):p(r)==="success"?(y(),M("div",VWe,[j(p(Dd),{kind:"success"}),C("span",qWe,N(p(n)("login.success")),1),C("span",KWe,N(p(n)("login.successHint")),1)])):p(r)==="expired"?(y(),M(Pe,{key:3},[C("div",ZWe,[j(p(Dd),{kind:"expired"}),C("span",GWe,N(p(n)("login.expiredTitle")),1),C("span",YWe,N(p(n)("login.expiredHint")),1)]),C("div",XWe,[j(p(Rt),{variant:"secondary",onClick:m},{default:me(()=>[qe(N(p(n)("onboarding.back")),1)]),_:1}),j(p(Rt),{variant:"primary",onClick:p(c)},{default:me(()=>[qe(N(p(n)("login.retry")),1)]),_:1},8,["onClick"])])],64)):p(r)==="error"?(y(),M(Pe,{key:4},[C("div",JWe,[j(p(Dd),{kind:"error"}),C("span",QWe,N(p(l)?p(n)("login.pollErrorTitle"):p(n)("login.errorTitle")),1),C("span",eUe,N(p(l)?p(n)("login.pollErrorHint"):p(n)("login.errorHint")),1)]),C("div",tUe,[j(p(Rt),{variant:"secondary",onClick:m},{default:me(()=>[qe(N(p(n)("onboarding.back")),1)]),_:1}),j(p(Rt),{variant:"primary",onClick:p(c)},{default:me(()=>[qe(N(p(n)("login.retry")),1)]),_:1},8,["onClick"])])],64)):ee("",!0)]))}}),oUe=ft(nUe,[["__scopeId","data-v-0a67ec7e"]]),sUe=["aria-label"],iUe={class:"wiz-body"},rUe={key:0,class:"wiz-step"},lUe={class:"wiz-title"},aUe={class:"wiz-sub"},uUe={class:"pref-group"},cUe={class:"pref-label"},dUe={class:"lang-cards"},fUe=["onClick"],pUe={class:"opt-label"},hUe={class:"pref-group"},mUe={class:"pref-label"},gUe={class:"theme-cards"},vUe=["onClick"],yUe={class:"opt-label"},kUe={key:1,class:"wiz-step"},bUe={class:"wiz-title"},CUe={class:"wiz-sub"},wUe={class:"wiz-step-fill"},_Ue={class:"wiz-foot"},xUe={class:"wiz-foot-ghost"},SUe=et({__name:"OnboardingWizard",props:{authReady:{type:Boolean},onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["complete","loginSuccess","addProvider"],setup(e,{emit:t}){const{t:n,locale:o}=Nt(),s=e,i=t;function r(){i("addProvider")}const l=["preferences","login"],a=Z(0),u=R(()=>l[a.value]??"preferences");function c(){a.value<l.length-1&&a.value++}function d(){a.value>0&&a.value--}function f(w){o.value!==w&&E5(w)}const{colorScheme:h,setColorScheme:m}=XT(),v=[{value:"system",labelKey:"theme.system"},{value:"light",labelKey:"theme.light"},{value:"dark",labelKey:"theme.dark"}];function k(){i("loginSuccess")}return(w,b)=>(y(),M("div",{class:"wizard",role:"dialog","aria-modal":"true","aria-label":p(n)("onboarding.welcome.title")},[C("div",iUe,[u.value==="preferences"?(y(),M("section",rUe,[j(E8,{size:72}),C("h1",lUe,N(p(n)("onboarding.welcome.title")),1),C("p",aUe,N(p(n)("onboarding.welcome.subtitle")),1),C("div",uUe,[C("div",cUe,N(p(n)("onboarding.welcome.languageLabel")),1),C("div",dUe,[(y(!0),M(Pe,null,pt(p(yg),_=>(y(),M("button",{key:_.code,class:Re(["opt-card lang-card",{selected:p(o)===_.code}]),type:"button",onClick:g=>f(_.code)},[C("span",{class:Re(["opt-radio",{on:p(o)===_.code}])},null,2),C("span",pUe,N(_.label),1)],10,fUe))),128))])]),C("div",hUe,[C("div",mUe,N(p(n)("onboarding.welcome.themeLabel")),1),C("div",gUe,[(y(),M(Pe,null,pt(v,_=>C("button",{key:_.value,class:Re(["opt-card theme-card",{selected:p(h)===_.value}]),type:"button",onClick:g=>p(m)(_.value)},[C("span",{class:Re(["tp",`tp-${_.value}`]),"aria-hidden":"true"},[_.value==="system"?(y(),M(Pe,{key:0},[b[2]||(b[2]=iu('<span class="tp-half tp-half-light" data-v-a665ca6b><span class="tp-side" data-v-a665ca6b></span><span class="tp-lines" data-v-a665ca6b><span data-v-a665ca6b></span><span data-v-a665ca6b></span><span data-v-a665ca6b></span></span></span><span class="tp-half tp-half-dark" data-v-a665ca6b><span class="tp-side" data-v-a665ca6b></span><span class="tp-lines" data-v-a665ca6b><span data-v-a665ca6b></span><span data-v-a665ca6b></span><span data-v-a665ca6b></span></span></span>',2))],64)):(y(),M(Pe,{key:1},[b[3]||(b[3]=C("span",{class:"tp-side"},null,-1)),b[4]||(b[4]=C("span",{class:"tp-lines"},[C("span"),C("span"),C("span")],-1))],64))],2),C("span",yUe,N(p(n)(_.labelKey)),1)],10,vUe)),64))])])])):(y(),M("section",kUe,[j(E8,{size:72}),C("h1",bUe,N(p(n)("onboarding.login.title")),1),C("p",CUe,N(p(n)("onboarding.login.subtitle")),1),C("div",wUe,[j(oUe,{"auth-ready":s.authReady,"on-start-o-auth-login":s.onStartOAuthLogin,"on-poll-o-auth-login":s.onPollOAuthLogin,"on-cancel-o-auth-login":s.onCancelOAuthLogin,onSuccess:k,onAddProvider:r},null,8,["auth-ready","on-start-o-auth-login","on-poll-o-auth-login","on-cancel-o-auth-login"])])])),C("div",_Ue,[u.value==="preferences"?(y(),he(p(Rt),{key:0,variant:"primary",size:"lg",class:"wiz-primary",onClick:c},{default:me(()=>[qe(N(p(n)("onboarding.continue")),1)]),_:1})):u.value==="login"&&s.authReady?(y(),he(p(Rt),{key:1,variant:"primary",size:"lg",class:"wiz-primary",onClick:b[0]||(b[0]=_=>i("complete"))},{default:me(()=>[qe(N(p(n)("onboarding.login.finish")),1)]),_:1})):ee("",!0),C("div",xUe,[a.value>0?(y(),he(p(Rt),{key:0,variant:"ghost",onClick:d},{default:me(()=>[qe(N(p(n)("onboarding.back")),1)]),_:1})):ee("",!0),u.value==="login"&&s.authReady?ee("",!0):(y(),he(p(Rt),{key:1,variant:"ghost",onClick:b[1]||(b[1]=_=>i("complete"))},{default:me(()=>[qe(N(u.value==="login"?p(n)("onboarding.login.skip"):p(n)("onboarding.skip")),1)]),_:1}))])])])],8,sUe))}}),AUe=ft(SUe,[["__scopeId","data-v-a665ca6b"]]),MUe=["aria-label"],TUe={class:"gload-box"},EUe={class:"gload-text"},IUe=et({__name:"GlobalLoading",setup(e){const{t}=Nt();return(n,o)=>(y(),M("div",{class:"gload",role:"status","aria-label":p(t)("app.connecting")},[C("div",TUe,[o[0]||(o[0]=iu('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-ab85ede1><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-ab85ede1></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-ab85ede1></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-ab85ede1></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-ab85ede1></path></svg>',1)),j(p(Ao),{size:"md",label:p(t)("app.connecting")},null,8,["label"]),C("div",EUe,N(p(t)("app.connecting")),1)])],8,MUe))}}),LUe=ft(IUe,[["__scopeId","data-v-ab85ede1"]]),$Ue={class:"kap-root"},NUe={class:"kap-head"},FUe={class:"kap-count"},RUe={class:"kap-head-actions"},OUe={class:"kap-filters"},PUe=["value"],DUe={class:"kap-check"},BUe={class:"kap-check"},HUe={class:"kap-view-toggle",role:"group"},zUe={key:0,class:"kap-empty"},WUe=["onClick"],UUe={class:"kap-ts"},jUe={class:"kap-label"},VUe={key:0,class:"kap-detail"},qUe={class:"kap-detail-actions"},KUe=["onClick"],ZUe={key:1,class:"kap-agg"},GUe={class:"mono"},YUe={class:"mono"},XUe={class:"num"},JUe={class:"num"},QUe={key:0},eje={class:"mono"},tje={class:"num"},nje={class:"num"},oje={key:0},sje=et({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=Z("all"),s=Z(""),i=Z(""),r=Z(!1),l=Z("timeline"),a=R(()=>(I5.value,[...M0e()])),u=R(()=>{const E=new Set;for(const P of a.value)P.sessionId&&E.add(P.sessionId);return[...E].sort()});function c(E){return E.kind==="rest:error"||E.code!==void 0&&E.code!==0||E.eventType==="error"||E.eventType==="parse-error"}const d=R(()=>{const E=s.value.trim().toLowerCase();return a.value.filter(P=>!(o.value!=="all"&&P.source!==o.value||i.value&&P.sessionId!==i.value||r.value&&!c(P)||E&&!`${P.label} ${P.kind} ${P.eventType??""} ${P.sessionId??""} ${P.requestId??""}`.toLowerCase().includes(E)))}),f=R(()=>{const E=new Map;for(const P of d.value){if(P.kind!=="ws:in"&&P.kind!=="ws:out")continue;const D=P.kind==="ws:in"?"←":"→",I=`${D} ${P.eventType??"?"} @ ${P.sessionId??"-"}`,$=E.get(I)??{key:I,sessionId:P.sessionId??"-",eventType:P.eventType??"?",dir:D,count:0};$.count++,P.seq!==void 0&&($.lastSeq=P.seq),E.set(I,$)}return[...E.values()].sort((P,D)=>D.count-P.count)}),h=R(()=>{const E=new Map;for(const P of d.value){if(P.source!=="rest"||P.kind==="rest:request")continue;const D=`${P.method??"?"} ${P.path??"?"}`,I=E.get(D)??{count:0,errors:0,totalMs:0,timed:0};I.count++,c(P)&&I.errors++,P.durationMs!==void 0&&(I.totalMs+=P.durationMs,I.timed++),E.set(D,I)}return[...E.entries()].map(([P,D])=>({key:P,count:D.count,errors:D.errors,avgMs:D.timed>0?Math.round(D.totalMs/D.timed):0})).sort((P,D)=>D.count-P.count)}),m=Z(null),v=Z(!0),k=Z(null),w=Z(null);Je(()=>d.value.length,async()=>{if(!v.value||l.value!=="timeline")return;await yt();const E=k.value;E&&(E.scrollTop=E.scrollHeight)});function b(E){m.value=m.value===E?null:E}function _(E){const P=new Date(E),D=(I,$=2)=>String(I).padStart($,"0");return`${D(P.getHours())}:${D(P.getMinutes())}:${D(P.getSeconds())}.${D(P.getMilliseconds(),3)}`}function g(E){return JSON.stringify(E,null,2)}async function x(E){await Zs(g(E))&&(w.value=E.id,setTimeout(()=>{w.value===E.id&&(w.value=null)},1500))}function S(){G$(d.value)}function T(E){return c(E)||E.source==="client"?"b-err":E.source==="rest"?"b-rest":E.kind==="ws:lifecycle"?"b-life":E.kind==="ws:out"?"b-out":"b-in"}function A(E){return E.source==="rest"?"REST":E.source==="client"?"APP":"WS"}return(E,P)=>(y(),M("section",$Ue,[C("header",NUe,[P[11]||(P[11]=C("strong",null,"KAP debug",-1)),C("span",FUe,N(d.value.length)+"/"+N(a.value.length),1),C("div",RUe,[C("button",{type:"button",class:Re({on:p(Ef)}),onClick:P[0]||(P[0]=D=>Ef.value=!p(Ef))},N(p(Ef)?"resume":"pause"),3),C("button",{type:"button",onClick:P[1]||(P[1]=D=>p(T0e)())},"clear"),C("button",{type:"button",onClick:P[2]||(P[2]=D=>S())},"export jsonl"),j(p(pn),{text:"Close window"},{default:me(()=>[C("button",{type:"button",onClick:P[3]||(P[3]=D=>n("close"))},"✕")]),_:1})])]),C("div",OUe,[Bn(C("select",{"onUpdate:modelValue":P[4]||(P[4]=D=>o.value=D),"aria-label":"Source filter"},[...P[12]||(P[12]=[C("option",{value:"all"},"rest + ws + app",-1),C("option",{value:"rest"},"rest",-1),C("option",{value:"ws"},"ws",-1),C("option",{value:"client"},"app errors",-1)])],512),[[V4,o.value]]),Bn(C("select",{"onUpdate:modelValue":P[5]||(P[5]=D=>i.value=D),"aria-label":"Session filter"},[P[13]||(P[13]=C("option",{value:""},"all sessions",-1)),(y(!0),M(Pe,null,pt(u.value,D=>(y(),M("option",{key:D,value:D},N(D),9,PUe))),128))],512),[[V4,i.value]]),Bn(C("input",{"onUpdate:modelValue":P[6]||(P[6]=D=>s.value=D),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[ai,s.value]]),C("label",DUe,[Bn(C("input",{"onUpdate:modelValue":P[7]||(P[7]=D=>r.value=D),type:"checkbox"},null,512),[[Em,r.value]]),P[14]||(P[14]=qe(" errors",-1))]),C("label",BUe,[Bn(C("input",{"onUpdate:modelValue":P[8]||(P[8]=D=>v.value=D),type:"checkbox"},null,512),[[Em,v.value]]),P[15]||(P[15]=qe(" follow",-1))]),C("div",HUe,[C("button",{type:"button",class:Re({on:l.value==="timeline"}),onClick:P[9]||(P[9]=D=>l.value="timeline")},"timeline",2),C("button",{type:"button",class:Re({on:l.value==="aggregate"}),onClick:P[10]||(P[10]=D=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(y(),M("div",{key:0,ref_key:"listRef",ref:k,class:"kap-list"},[d.value.length===0?(y(),M("div",zUe," No trace entries yet. REST calls and WS frames will appear here. ")):ee("",!0),(y(!0),M(Pe,null,pt(d.value,D=>(y(),M("div",{key:D.id,class:"kap-row-wrap"},[C("button",{type:"button",class:Re(["kap-row",{expanded:m.value===D.id}]),onClick:I=>b(D.id)},[C("span",UUe,N(_(D.ts)),1),C("span",{class:Re(["kap-badge",T(D)])},N(A(D)),3),C("span",jUe,N(D.label),1)],10,WUe),m.value===D.id?(y(),M("div",VUe,[C("div",qUe,[C("button",{type:"button",onClick:I=>x(D)},N(w.value===D.id?"copied ✓":"copy json"),9,KUe)]),C("pre",null,N(g(D)),1)])):ee("",!0)]))),128))],512)):(y(),M("div",ZUe,[P[20]||(P[20]=C("h4",null,"WS frames by session / type",-1)),C("table",null,[P[17]||(P[17]=C("thead",null,[C("tr",null,[C("th",null,"dir"),C("th",null,"type"),C("th",null,"session"),C("th",null,"count"),C("th",null,"last seq")])],-1)),C("tbody",null,[(y(!0),M(Pe,null,pt(f.value,D=>(y(),M("tr",{key:D.key},[C("td",null,N(D.dir),1),C("td",GUe,N(D.eventType),1),C("td",YUe,N(D.sessionId),1),C("td",XUe,N(D.count),1),C("td",JUe,N(D.lastSeq??"—"),1)]))),128)),f.value.length===0?(y(),M("tr",QUe,[...P[16]||(P[16]=[C("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ee("",!0)])]),P[21]||(P[21]=C("h4",null,"REST by endpoint",-1)),C("table",null,[P[19]||(P[19]=C("thead",null,[C("tr",null,[C("th",null,"endpoint"),C("th",null,"count"),C("th",null,"errors"),C("th",null,"avg ms")])],-1)),C("tbody",null,[(y(!0),M(Pe,null,pt(h.value,D=>(y(),M("tr",{key:D.key},[C("td",eje,N(D.key),1),C("td",tje,N(D.count),1),C("td",{class:Re(["num",{err:D.errors>0}])},N(D.errors),3),C("td",nje,N(D.avgMs),1)]))),128)),h.value.length===0?(y(),M("tr",oje,[...P[18]||(P[18]=[C("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ee("",!0)])])]))]))}}),ije=ft(sje,[["__scopeId","data-v-2b13888e"]]),rje=et({__name:"DebugPanel",setup(e){const t=Z(!1);let n=null,o=null,s=null;const i=["data-color-scheme"];function r(c){const d=document.documentElement,f=c.documentElement;for(const h of i){const m=d.getAttribute(h);m!==null?f.setAttribute(h,m):f.removeAttribute(h)}}function l(c){const d=c.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const m of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(m.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=null,n=null,t.value=!1}function u(){if(n&&!n.closed){n.focus();return}const c=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!c)return;n=c;const d=l(c),f=Im(ije,{onClose:()=>c.close()});f.mount(d),o=f,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),c.addEventListener("pagehide",a),c.addEventListener("beforeunload",a)}return dn(()=>{u()}),Vn(()=>{n&&!n.closed&&n.close(),a()}),(c,d)=>(y(),he(p(pn),{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:me(()=>[C("button",{class:"kap-fab",type:"button",onClick:u}," KAP ")]),_:1},8,["text"]))}}),lje=ft(rje,[["__scopeId","data-v-21de79fc"]]),aje=et({__name:"ServerAuthDialog",setup(e){const t=Z(""),n=Z(null),o=Z(!1);dn(()=>{yt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,vE(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(y(),he(p(ua),{open:!0,title:"Server token required","hide-close":!0,"close-on-overlay":!1,"close-on-esc":!1},{foot:me(()=>[j(p(Rt),{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:me(()=>[qe(N(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])]),default:me(()=>[l[1]||(l[1]=C("p",{class:"server-auth-hint"},[qe(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),C("code",null,"KIMI_CODE_PASSWORD"),qe("). ")],-1)),j(p(js),{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:i},null,8,["modelValue","disabled"])]),_:1}))}}),uje=ft(aje,[["__scopeId","data-v-331563ff"]]),cje=["aria-label"],dje=et({__name:"InternalBuildBanner",setup(e){const{t}=Nt(),n=Wp;return(o,s)=>p(n)?(y(),M("span",{key:0,class:"internal-build-tag",role:"note","aria-label":p(t)("app.internalBuildBanner")},[s[0]||(s[0]=C("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[C("path",{d:"M8 2 14 13H2L8 2Z"}),C("path",{d:"M8 6v3.5"}),C("path",{d:"M8 11.5h.01"})],-1)),C("span",null,N(p(t)("app.internalBuildBanner")),1)],8,cje)):ee("",!0)}}),fje=ft(dje,[["__scopeId","data-v-14c3d0e0"]]),pje={class:"app-shell"},hje=["inert"],mje=["aria-label","aria-hidden"],gje=et({__name:"App",setup(e){QJ();const t=Z(!1);let n=null;const o=mu(),s=R(()=>!o.dangerousBypassAuth.value&&t.value);Ln("resolveImage",o.resolveImageUrl),Ln("resolveSwarmMembers",ht=>o.swarmMembersByToolCallId.value.get(ht)??[]),Ln("modelDisplay",ht=>fJ(ht,o.models.value));const{t:i}=Nt();Ln("subagentEffort",ht=>pJ(ht));const{confirm:r}=hu(),l=Qr(),a=khe(),u=Z(!1),c=Z(!1),d=R(()=>{const ht=o.activeSessionId.value;return o.sessions.value.find(Le=>Le.id===ht)?.title??""}),f=R(()=>{const ht=o.activeSessionId.value;return o.sessions.value.find(Le=>Le.id===ht)?.lastTurnReason??null}),h=R(()=>o.visibleWorkspace.value?.sessionCount??0),m=R(()=>o.activity.value!=="idle");jhe({running:m,title:"Kimi Code Web"});function v(ht){const Le=o.models.value.find(di=>di.id===o.status.value.modelId),Ze=Up(Le),Xt=Ze.indexOf(Dm(Le,ht)),gs=Ze[(Xt+1)%Ze.length]??Ze[0]??"off";return My(Le,gs)}const k=R(()=>{const ht=o.models.value.find(Le=>Le.id===o.status.value.modelId);return Dm(ht,o.thinking.value)}),w=Z(!o.onboarded.value);function b(){o.setOnboarded(!0),w.value=!1}function _(){b(),st.value="providers",hs.value=!0}let g=0;function x(){const ht=window.visualViewport,Le=document.documentElement.style;Le.setProperty("--app-height",`${ht?.height??window.innerHeight}px`),Le.setProperty("--app-top",`${ht?.offsetTop??0}px`)}function S(){g||(g=requestAnimationFrame(()=>{g=0,x()}))}dn(()=>{n=oQ(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),oe(),x(),window.visualViewport?.addEventListener("resize",S),window.visualViewport?.addEventListener("scroll",S),window.addEventListener("resize",S),document.addEventListener("keydown",T,!0)}),bn(()=>{document.removeEventListener("keydown",T,!0),window.visualViewport?.removeEventListener("resize",S),window.visualViewport?.removeEventListener("scroll",S),window.removeEventListener("resize",S),g&&(cancelAnimationFrame(g),g=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function T(ht){ht.key==="Escape"&&(Nn.value||qt()&&(ht.stopPropagation(),ht.preventDefault()))}const A=Z(null),{previewTarget:E,previewFile:P,previewLoading:D,previewError:I,previewDownloadUrl:$,previewExternalActions:B,openFilePreview:H,closeFilePreview:O,openPreviewInEditor:F,revealPreviewFile:U}=Uhe({client:o,detailTarget:A,t:(ht,Le)=>Le===void 0?i(ht):i(ht,Le)}),z=R(()=>A.value!==null),W=Z(null),K=Z(null);function V(ht){K.value=ht.originImg??null,W.value=ht.media}const{SIDEBAR_WIDTH_KEY:ie,SIDEBAR_DEFAULT:ne,SIDEBAR_MIN:X,sidebarMax:le,sessionColWidth:Ie,sidebarCollapsed:de,sidebarDragging:pe,sideWidth:ve,loadSidebarCollapsed:oe,toggleSidebarCollapse:ye}=zhe({previewOpen:z}),{PREVIEW_WIDTH_KEY:G,PREVIEW_MIN:Y,previewDefaultWidth:fe,previewMax:we,previewWidth:ge,previewPanelWidth:Q,compactionPanelText:te,compactionPanelVisible:ce,openCompactionPanel:ue,closeCompactionPanel:Se,agentPanelMember:ze,agentPanelTurns:_e,agentPanelLoading:Ee,agentPanelLoadError:it,agentPanelLoadingMore:Fe,agentPanelLoadMoreError:Oe,agentPanelHasMore:Ge,agentPanelRunning:at,openAgentPanel:Tt,closeAgentPanel:Bt,loadOlderAgentMessages:Yt,detailDiffMode:Sn,detailDiffPath:on,openDiffDetail:en,closeDiffDetail:Cn,selectDiffFile:Mn,turnDiffChange:We,openTurnDiff:tt,closeTurnDiff:Ue,btwVisible:Lt,openSideChatTab:gt,closeSideChat:wn,sidePanelVisible:yn,panelDragging:go,closeOpenSidePanel:qt}=Phe({client:o,sideWidth:ve,detailTarget:A,closeFilePreview:O}),ps=Z(null);function xs(ht){ps.value?.style.setProperty("--preview-w",`${ht}px`)}Je([ps,Q],([ht,Le])=>ht?.style.setProperty("--preview-w",`${Le}px`),{immediate:!0});const _n=Z(null),In=Z(!1),To=Z(!1),lo=Z(!1),St=Z(!1),hs=Z(!1);let Jo;dn(()=>{Jo=window.kimiDesktop?.onMenuAction?.(ht=>{ht==="open-settings"?hs.value=!0:ht==="new-chat"&&Fs()})}),bn(()=>{Jo?.()});const uo=Z(null),Ys=Z(null),Nn=R(()=>Ci.value>0||In.value||To.value||lo.value||St.value||hs.value||w.value||u.value||c.value),no=Z(!1),$s=Z(!1),Xs=Z(!1);async function ci(){no.value=!0,$s.value=!1,In.value=!0;try{await o.refreshAllProviders()}catch{$s.value=!0}finally{no.value=!1}}function Oo(){To.value=!0}async function vo(){await r({title:i("sidebar.logoutConfirmTitle"),message:i("sidebar.logoutConfirmMessage"),variant:"danger",action:()=>o.logout()})}async function Po(ht){In.value=!1,await co(ht)}async function co(ht){await o.setModel(ht)&&ht!==o.defaultModel.value&&o.updateConfig({defaultModel:ht})}const Tn=Z(null);async function fo(ht){await o.archiveSession(ht),!o.sessionsForView.value.some(Le=>Le.id===ht)&&(Tn.value={id:ht})}async function Qe(){const ht=Tn.value;ht&&await o.restoreSession(ht.id)&&(Tn.value=null)}const st=Z(void 0),Ct=Z(void 0);Je(c,ht=>{ht||(Ct.value=void 0)});function Qt(){Tn.value=null,a.value?(Ct.value="archived",c.value=!0):(st.value="archived",hs.value=!0)}async function kn(ht){const Le=o.workspacesView.value.find(Ze=>Ze.id===ht)?.name??ht;await r({title:i("sidebar.removeWorkspace"),message:i("workspace.removeWorkspaceConfirm",{name:Le}),variant:"danger",action:()=>o.deleteWorkspace(ht)})}async function Ko(ht){Xs.value=!0;try{await o.updateConfig(ht)&&await o.checkAuth()}finally{Xs.value=!1}}async function Eo(){return o.startOAuthLogin()}async function bo(){return o.pollOAuthLogin()}async function Ns(){return o.cancelOAuthLogin()}async function Do(){To.value=!1,await o.checkAuth(),await o.load()}async function Io(){b(),await o.checkAuth(),await o.load()}async function Qo(ht){await o.undo(1)!==null&&(await yt(),_n.value?.loadComposerForEdit(ht.text,ht.attachments),_n.value?.notifyUndone())}async function sn(){const ht=await o.abortCurrentPrompt();_n.value?.onAbortOutcome(ht)}function es(ht){const Le=_t();return ht.map(Ze=>({kind:Ze.kind,url:Le.getFileUrl(Ze.fileId),fileId:Ze.fileId,name:Ze.name}))}async function ms(ht,Le){if(o.authReady.value)return!0;const Ze=o.managedProviderStatus.value==="authenticated";Ze&&o.managedMembership.value===null&&await o.probeManagedMembership();const Xt=Ze&&o.managedMembership.value==="free",gs=await r(Xt?{title:i("login.upgradeRequiredTitle"),message:i("login.upgradeRequiredMessage"),confirmLabel:i("sidebar.upgrade"),variant:"primary"}:{title:i("login.requiredTitle"),message:i("login.requiredMessage"),confirmLabel:i("login.goToLogin"),variant:"primary"});return _n.value?.loadComposerForEdit(ht,es(Le)),gs&&(Xt?jp():Oo()),!1}async function Tr(ht,Le=[]){if(o.activeSessionId.value||o.activeWorkspaceId.value)return!0;const Ze=await r({title:i("workspace.requiredTitle"),message:i("workspace.requiredMessage"),confirmLabel:i("conversation.pickFolder"),variant:"primary"});return _n.value?.loadComposerForEdit(ht,es(Le)),Ze&&(lo.value=!0),!1}async function ts(ht,Le=[]){return await ms(ht,Le)?Tr(ht,Le):!1}async function Ki(ht){const{cmd:Le,attachments:Ze}=ht;if(Le==="/compact"||Le.startsWith("/compact ")){if(!await ts(Le))return;o.compact(Le.slice(8).trim()||void 0);return}if(Le==="/swarm"||Le.startsWith("/swarm ")){const Xt=Le.slice(6).trim();if(Xt==="on")o.setSwarmMode(!0);else if(Xt==="off")o.setSwarmMode(!1);else if(Xt){if(!await ts(Le))return;o.setSwarmMode(!0),o.sendPrompt(Xt)}else o.toggleSwarmMode();return}if(Le==="/goal"||Le.startsWith("/goal ")){const Xt=Le.slice(5).trim();if(Xt==="pause"||Xt==="resume"||Xt==="cancel")o.controlGoal(Xt);else if(Xt){if(!await ts(Le))return;o.createGoal(Xt)}else o.toggleGoalMode();return}if(Le==="/btw"||Le.startsWith("/btw ")){const Xt=Le.slice(4).trim();if(!Xt&&o.sideChatVisible.value)wn();else{if(Xt&&!await ts(Le))return;gt(Xt||void 0)}return}switch(Le){case"/new":case"/clear":Fs();break;case"/fork":o.forkSession();break;case"/export":o.exportSession();break;case"/undo":o.undo();break;case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(v(o.thinking.value));break;case"/status":St.value=!0;break;case"/login":Oo();break;default:{const Xt=Le.indexOf(" "),gs=hQ((Xt===-1?Le:Le.slice(0,Xt)).slice(1)),di=Xt===-1?void 0:Le.slice(Xt+1).trim()||void 0;if(!gs)break;if(!await ts(Le,Ze))return;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,gs,di,Ze):o.activateSkill(gs,di,Ze);break}}}function Js(ht){o.unqueue(ht)}function Bo(ht){o.unqueue(ht)}function Zo(ht){o.reorderQueue(ht.from,ht.to)}async function Il(ht){if(!await ms(ht.text,ht.attachments))return;const Le=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&Le){await o.startSessionAndSendPrompt(Le,ht.text,ht.attachments);return}if(!o.activeSessionId.value&&!Le){uo.value=ht,await r({title:i("workspace.requiredTitle"),message:i("workspace.requiredMessage"),confirmLabel:i("conversation.pickFolder"),variant:"primary"})?lo.value=!0:Zi();return}o.sendPrompt(ht.text,ht.attachments)}function Zi(){const ht=uo.value;uo.value=null,ht&&_n.value?.loadComposerForEdit(ht.text,es(ht.attachments))}async function tl(ht){if(Ys.value=null,!await o.addWorkspaceByPath(ht)){Ys.value=i("workspace.addFailed");return}lo.value=!1;const Ze=uo.value;uo.value=null;const Xt=o.activeWorkspaceId.value;Ze&&Xt&&await o.startSessionAndSendPrompt(Xt,Ze.text,Ze.attachments)}function Ho(){Zi(),Ys.value=null,lo.value=!1}function Co(){yt(()=>{_n.value?.focusComposer()})}function Fs(){const ht=o.activeWorkspaceId.value;ht?o.openWorkspaceDraft(ht):o.clearActiveSession(),Co()}function Rs(ht){o.openWorkspaceDraft(ht),Co()}function yo(ht){ht&&window.open(ht,"_blank","noopener")}return(ht,Le)=>(y(),M("div",pje,[s.value?(y(),he(uje,{key:0})):ee("",!0),C("div",{class:Re(["app",{mobile:p(a),"sidebar-collapsed":p(de)&&!p(a),"macos-desktop":p(rc)}]),inert:w.value},[p(a)?(y(),he(PHe,{key:1,workspace:p(o).visibleWorkspace.value,"session-title":d.value,running:m.value,branch:p(o).status.value.branch,"session-count":h.value,onOpenSwitcher:Le[22]||(Le[22]=Ze=>u.value=!0),onOpenSettings:Le[23]||(Le[23]=Ze=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(y(),M(Pe,{key:0},[j(r9e,{collapsed:p(de),dragging:p(pe),"col-width":p(ve),"active-workspace":p(o).visibleWorkspace.value,"active-workspace-id":p(o).activeWorkspaceId.value,sessions:p(o).sessionsForView.value,groups:p(o).workspaceGroups.value,"pinned-sessions":p(o).pinnedSessions.value,"flat-sessions":p(o).flatSessions.value,"flat-has-more":p(o).flatSessionsHasMore.value,"flat-loading-more":p(o).flatSessionsLoadingMore.value,initialized:p(o).initialized.value,"active-id":p(o).activeSessionId.value,"attention-by-session":p(o).attentionBySession.value,"pending-by-session":p(o).pendingBySession.value,"unread-by-session":p(o).unreadBySession.value,onSelect:Le[0]||(Le[0]=Ze=>p(o).selectSession(Ze)),onCreate:Fs,onCreateInWorkspace:Le[1]||(Le[1]=Ze=>Rs(Ze)),onSelectWorkspace:Le[2]||(Le[2]=Ze=>p(o).openWorkspace(Ze)),onAddWorkspace:Le[3]||(Le[3]=Ze=>lo.value=!0),onRename:Le[4]||(Le[4]=(Ze,Xt)=>p(o).renameSession(Ze,Xt)),onArchive:Le[5]||(Le[5]=Ze=>fo(Ze)),onFork:Le[6]||(Le[6]=Ze=>p(o).forkSession(Ze)),onExport:Le[7]||(Le[7]=Ze=>p(o).exportSession(Ze)),onPin:Le[8]||(Le[8]=Ze=>p(o).togglePinSession(Ze)),onUnpin:Le[9]||(Le[9]=Ze=>p(o).unpinSession(Ze)),onReorderPinned:Le[10]||(Le[10]=Ze=>p(o).reorderPinnedSessions(Ze)),onPinAt:Le[11]||(Le[11]=(Ze,Xt,gs)=>p(o).pinSessionAt(Ze,Xt,gs)),onRenameWorkspace:Le[12]||(Le[12]=(Ze,Xt)=>p(o).renameWorkspace(Ze,Xt)),onDeleteWorkspace:Le[13]||(Le[13]=Ze=>kn(Ze)),onReorderWorkspaces:Le[14]||(Le[14]=Ze=>p(o).reorderWorkspaces(Ze)),onLoadMoreSessions:Le[15]||(Le[15]=Ze=>void p(o).loadMoreSessions(Ze)),onLoadAllSessions:Le[16]||(Le[16]=Ze=>void p(o).loadAllSessions()),onEnsureFlatSessions:Le[17]||(Le[17]=Ze=>void p(o).ensureFlatSessions()),onLoadMoreFlatSessions:Le[18]||(Le[18]=Ze=>void p(o).loadMoreFlatSessions()),onOpenSettings:Le[19]||(Le[19]=Ze=>hs.value=!0),onLogin:Oo,onCollapse:p(ye)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","pinned-sessions","flat-sessions","flat-has-more","flat-loading-more","initialized","active-id","attention-by-session","pending-by-session","unread-by-session","onCollapse"]),Bn(j(Zx,{class:"side-handle","storage-key":p(ie),"default-width":p(ne),min:p(X),max:p(le),"onUpdate:width":Le[20]||(Le[20]=Ze=>Ie.value=Ze),"onUpdate:dragging":Le[21]||(Le[21]=Ze=>pe.value=Ze)},null,8,["storage-key","default-width","min","max"]),[[qs,!p(de)]])],64)),j(R$e,{ref_key:"conversationPaneRef",ref:_n,mobile:p(a),turns:p(o).turns.value,"session-id":p(o).activeSessionId.value,approvals:p(o).pendingApprovals.value,changes:p(o).changes.value,"git-info":p(o).gitInfo.value,tasks:p(o).tasks.value,todos:p(o).todos.value,goal:p(o).goal.value,"activation-badges":p(o).activationBadges.value,status:p(o).status.value,thinking:p(o).thinking.value,"plan-mode":p(o).planMode.value,"swarm-mode":p(o).swarmMode.value,"goal-mode":p(o).goalMode.value,models:p(o).models.value,"auth-ready":p(o).authReady.value,"managed-signed-in":p(o).managedProviderStatus.value==="authenticated","managed-membership":p(o).managedMembership.value,"starred-ids":p(o).starredModelIds.value,skills:p(o).skills.value,questions:p(o).questions.value,"pending-question-actions":p(o).pendingQuestionActions,"pending-approval-actions":p(o).pendingApprovalActions,running:m.value,"overlay-open":Nn.value,"turn-active":p(o).turnActive.value,queued:p(o).queued.value,"search-files":p(o).searchFiles,"upload-image":p(o).uploadImage,working:p(o).working.value,"last-turn-reason":f.value,"turn-error":p(o).activeTurnError.value??null,"turn-retry":p(o).activeTurnRetry.value??null,starting:p(o).isStartingFirstPrompt.value,"file-reload-key":p(o).activeSessionId.value,"session-loading":p(o).sessionLoading.value,compaction:p(o).compaction.value,"has-more-messages":p(o).hasMoreMessages.value,"loading-more":p(o).loadingMoreMessages.value,"loading-more-error":p(o).loadMoreMessagesError.value,"load-older-messages":p(o).loadOlderMessages,"workspace-name":p(o).visibleWorkspace.value?.name,"workspace-root":p(o).visibleWorkspace.value?.root??p(o).status.value.cwd,"git-diff-stats":p(o).gitDiffStats.value,workspaces:p(o).workspacesView.value,"active-workspace-id":p(o).activeWorkspaceId.value,"session-title":d.value,pr:p(o).activePullRequest.value,onOpenChanges:Le[24]||(Le[24]=Ze=>p(en)()),onSelectWorkspace:Le[25]||(Le[25]=Ze=>Rs(Ze)),onAddWorkspace:Le[26]||(Le[26]=Ze=>lo.value=!0),onOpenPr:yo,onSubmit:Le[27]||(Le[27]=Ze=>Il(Ze)),onLogin:Le[28]||(Le[28]=Ze=>Oo()),onSteer:Le[29]||(Le[29]=Ze=>p(o).steerPrompt(Ze.text,Ze.attachments)),onApproval:Le[30]||(Le[30]=(Ze,Xt)=>p(o).respondApproval(Ze,Xt)),onCancelTask:Le[31]||(Le[31]=Ze=>p(o).cancelTask(Ze)),onAnswer:Le[32]||(Le[32]=(Ze,Xt)=>p(o).respondQuestion(Ze,Xt)),onDismiss:Le[33]||(Le[33]=Ze=>p(o).dismissQuestion(Ze)),onCommand:Ki,onInterrupt:sn,onUnqueue:Js,onEditQueued:Bo,onReorderQueue:Zo,onSetPermission:Le[34]||(Le[34]=Ze=>p(o).setPermission(Ze)),onSetThinking:Le[35]||(Le[35]=Ze=>p(o).setThinking(Ze)),onTogglePlan:Le[36]||(Le[36]=Ze=>p(o).togglePlanMode()),onToggleSwarm:Le[37]||(Le[37]=Ze=>p(o).toggleSwarmMode()),onToggleGoal:Le[38]||(Le[38]=Ze=>p(o).toggleGoalMode()),onCreateGoal:Le[39]||(Le[39]=Ze=>p(o).createGoal(Ze)),onControlGoal:Le[40]||(Le[40]=Ze=>p(o).controlGoal(Ze)),onRefreshGitStatus:Le[41]||(Le[41]=Ze=>p(o).activeSessionId.value&&p(o).loadGitStatus(p(o).activeSessionId.value)),onRenameSession:Le[42]||(Le[42]=(Ze,Xt)=>p(o).renameSession(Ze,Xt)),onForkSession:Le[43]||(Le[43]=Ze=>p(o).forkSession(Ze)),onArchiveSession:Le[44]||(Le[44]=Ze=>fo(Ze)),onExportSession:Le[45]||(Le[45]=Ze=>p(o).exportSession(Ze)),onCompact:Le[46]||(Le[46]=Ze=>p(o).compact()),onPickModel:Le[47]||(Le[47]=Ze=>ci()),onSelectModel:Le[48]||(Le[48]=Ze=>co(Ze)),onOpenFile:Le[49]||(Le[49]=Ze=>p(H)(Ze)),onOpenMedia:V,onOpenTurnDiff:Le[50]||(Le[50]=Ze=>p(tt)(Ze)),onOpenCompaction:Le[51]||(Le[51]=Ze=>p(ue)(Ze)),onOpenAgent:Le[52]||(Le[52]=Ze=>p(Tt)(Ze)),onEditMessage:Qo},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","overlay-open","turn-active","queued","search-files","upload-image","working","last-turn-reason","turn-error","turn-retry","starting","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr"]),!p(a)&&(p(rc)||p(de))?(y(),he(p(gn),{key:2,class:"sidebar-toggle-btn",size:"sm",label:p(de)?p(i)("sidebar.expandSidebar"):p(i)("sidebar.collapseSidebar"),tooltip:p(de)?p(i)("sidebar.expandSidebar"):p(i)("sidebar.collapseSidebar"),onClick:p(ye)},{default:me(()=>[j(p(Te),{name:p(de)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","tooltip","onClick"])):ee("",!0),!p(a)&&p(de)?(y(),he(p(gn),{key:3,class:"new-chat-btn",size:"sm",label:p(i)("sidebar.newChat"),tooltip:p(i)("sidebar.newChat"),onClick:Fs},{default:me(()=>[j(p(Te),{name:"chat-new"})]),_:1},8,["label","tooltip"])):ee("",!0),p(yn)&&!p(a)?(y(),he(Zx,{key:4,class:"preview-handle","storage-key":p(G),"default-width":p(fe),min:p(Y),max:p(we),reverse:"","aria-label":p(i)("layout.resizePreviewAria"),"apply-live":xs,"onUpdate:width":Le[53]||(Le[53]=Ze=>ge.value=Ze),"onUpdate:dragging":Le[54]||(Le[54]=Ze=>go.value=Ze)},null,8,["storage-key","default-width","min","max","aria-label"])):ee("",!0),!p(a)||p(yn)?(y(),M("aside",{key:5,ref_key:"previewPanelEl",ref:ps,class:Re(["global-preview",{open:p(yn),mobile:p(a)}]),role:"complementary","aria-label":p(i)("layout.detailPanelAria"),"aria-hidden":!p(yn)},[A.value==="compaction"&&p(ce)?(y(),he(kNe,{key:0,text:p(te)??"",subtitle:p(i)("conversation.summaryTitle"),onClose:p(Se)},null,8,["text","subtitle","onClose"])):A.value==="agent"&&p(ze)?(y(),he(xNe,{key:1,member:p(ze),turns:p(_e),running:p(at),loading:p(Ee),"load-error":p(it),"has-more":p(Ge),"loading-more":p(Fe),"load-more-error":p(Oe),onClose:p(Bt),onLoadOlderMessages:p(Yt),onOpenAgent:p(Tt),onOpenFile:p(H),onOpenMedia:V,onOpenTurnDiff:Le[55]||(Le[55]=Ze=>p(tt)(Ze))},null,8,["member","turns","running","loading","load-error","has-more","loading-more","load-more-error","onClose","onLoadOlderMessages","onOpenAgent","onOpenFile"])):A.value==="btw"&&p(Lt)?(y(),he($Ne,{key:2,turns:p(o).sideChatTurns.value,running:p(o).sideChatRunning.value,sending:p(o).sideChatSending.value,onSend:Le[56]||(Le[56]=Ze=>p(o).sendSideChatPrompt(Ze)),onClose:p(wn),onOpenMedia:V},null,8,["turns","running","sending","onClose"])):A.value==="diff"?(y(),he(rFe,{key:3,mode:p(Sn),changes:p(o).changes.value,"git-info":p(o).gitInfo.value,"file-diff":p(o).fileDiff.value,"full-texts":p(o).fileDiffTexts.value,"empty-file":p(o).fileDiffEmptyFile.value,"selected-diff-path":p(o).selectedDiffPath.value,"file-diff-loading":p(o).fileDiffLoading.value,closable:"",onOpen:p(Mn),onBack:Le[57]||(Le[57]=Ze=>{Sn.value="list",on.value=null,p(o).clearFileDiff()}),onClose:p(Cn)},null,8,["mode","changes","git-info","file-diff","full-texts","empty-file","selected-diff-path","file-diff-loading","onOpen","onClose"])):A.value==="file"?(y(),he(gNe,{key:4,file:p(P),loading:p(D),error:p(I),line:p(E)?.line,"download-url":p($),closable:"","external-actions":p(B),"open-file":p(H),onClose:p(O),onOpenExternal:p(F),onReveal:p(U)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):A.value==="turn-diff"&&p(We)?(y(),he(fFe,{key:5,change:p(We),cwd:p(o).status.value.cwd,closable:"",onClose:p(Ue),onOpenFile:Le[58]||(Le[58]=Ze=>p(H)({path:Ze}))},null,8,["change","cwd","onClose"])):ee("",!0)],10,mje)):ee("",!0),j(fje,{class:"internal-build-fab"}),In.value?(y(),he(TFe,{key:6,models:p(o).models.value,current:p(o).status.value.modelId,"starred-ids":p(o).starredModelIds.value,loading:no.value,unavailable:$s.value,onSelect:Le[59]||(Le[59]=Ze=>Po(Ze)),onToggleStar:Le[60]||(Le[60]=Ze=>p(o).toggleStarModel(Ze)),onClose:Le[61]||(Le[61]=Ze=>In.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ee("",!0),hs.value?(y(),he(RBe,{key:7,"color-scheme":p(o).colorScheme.value,"font-scale":p(o).fontScale.value,"managed-provider-status":p(o).managedProviderStatus.value,"managed-user-info":p(o).managedUserInfo.value,"on-fetch-usage":p(o).getUsage,notify:p(o).notifyEnabled.value,"notify-permission":p(o).notifyPermission.value,"notify-sound":p(o).notifySound.value,config:p(o).config.value,models:p(o).models.value,"config-saving":Xs.value,"server-version":p(o).serverVersion.value,backend:p(o).backend.value,"experimental-flags":p(o).experimentalFlags.value,"initial-tab":st.value,onSetColorScheme:Le[62]||(Le[62]=Ze=>p(o).setColorScheme(Ze)),onSetFontScale:Le[63]||(Le[63]=Ze=>p(o).setFontScale(Ze)),onSetNotify:Le[64]||(Le[64]=Ze=>p(o).setNotifyEnabled(Ze)),onSetNotifySound:Le[65]||(Le[65]=Ze=>p(o).setNotifySound(Ze)),onUpdateConfig:Le[66]||(Le[66]=Ze=>Ko(Ze)),onLogin:Le[67]||(Le[67]=()=>{hs.value=!1,Oo()}),onLogout:vo,onClose:Le[68]||(Le[68]=Ze=>{hs.value=!1,st.value=void 0})},null,8,["color-scheme","font-scale","managed-provider-status","managed-user-info","on-fetch-usage","notify","notify-permission","notify-sound","config","models","config-saving","server-version","backend","experimental-flags","initial-tab"])):ee("",!0),St.value?(y(),he(wHe,{key:8,status:p(o).status.value,thinking:k.value,"plan-mode":p(o).planMode.value,"swarm-mode":p(o).swarmMode.value,"cost-usd":p(o).sessionCost.value,onClose:Le[69]||(Le[69]=Ze=>St.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ee("",!0),lo.value?(y(),he(rHe,{key:9,"browse-fs":p(o).browseFs,"get-fs-home":p(o).getFsHome,"default-path":p(o).visibleWorkspace.value?.root??p(o).status.value.cwd,error:Ys.value,onAdd:Le[70]||(Le[70]=Ze=>tl(Ze)),onClose:Ho},null,8,["browse-fs","get-fs-home","default-path","error"])):ee("",!0),j(as,{name:"gload-fade"},{default:me(()=>[p(o).initialized.value?ee("",!0):(y(),he(LUe,{key:0,issue:p(o).connectIssue.value},null,8,["issue"]))]),_:1}),j(THe,{warnings:p(o).warnings.value,onDismiss:p(o).dismissWarning},null,8,["warnings","onDismiss"]),(y(),he(Zr,{to:"body"},[j(as,{name:"action-toast"},{default:me(()=>[Tn.value?(y(),he(p(Pz),{key:Tn.value.id,onDismiss:Le[71]||(Le[71]=Ze=>Tn.value=null)},{default:me(()=>[C("button",{type:"button",onClick:Qe},N(p(i)("sidebar.archiveToastUndo")),1),qe(" "+N(p(i)("sidebar.archiveToastMid"))+" ",1),C("button",{type:"button",onClick:Qt},N(p(i)("sidebar.archiveToastSettings")),1),qe(" "+N(p(i)("sidebar.archiveToastTail")),1)]),_:1})):ee("",!0)]),_:1})])),p(l)?(y(),he(lje,{key:10})):ee("",!0),j(cHe),p(a)?(y(),he(aze,{key:11,modelValue:u.value,"onUpdate:modelValue":Le[72]||(Le[72]=Ze=>u.value=Ze),groups:p(o).mobileWorkspaceGroups.value,"active-workspace-id":p(o).activeWorkspaceId.value,"active-id":p(o).activeSessionId.value,"attention-by-session":p(o).attentionBySession.value,"attention-by-workspace":p(o).attentionByWorkspace.value,onSelect:Le[73]||(Le[73]=Ze=>p(o).selectSession(Ze)),onCreate:Fs,onCreateInWorkspace:Le[74]||(Le[74]=Ze=>Rs(Ze)),onAddWorkspace:Le[75]||(Le[75]=Ze=>lo.value=!0),onRename:Le[76]||(Le[76]=(Ze,Xt)=>p(o).renameSession(Ze,Xt)),onArchive:Le[77]||(Le[77]=Ze=>fo(Ze)),onDeleteWorkspace:Le[78]||(Le[78]=Ze=>kn(Ze)),onLoadMore:Le[79]||(Le[79]=Ze=>void p(o).loadMoreSessions(Ze))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ee("",!0),p(a)?(y(),he(vWe,{key:12,modelValue:c.value,"onUpdate:modelValue":Le[80]||(Le[80]=Ze=>c.value=Ze),"initial-view":Ct.value,status:p(o).status.value,thinking:p(o).thinking.value,models:p(o).models.value,"plan-mode":p(o).planMode.value,"swarm-mode":p(o).swarmMode.value,"color-scheme":p(o).colorScheme.value,"font-scale":p(o).fontScale.value,"managed-provider-status":p(o).managedProviderStatus.value,"managed-user-info":p(o).managedUserInfo.value,"server-version":p(o).serverVersion.value,onPickModel:Le[81]||(Le[81]=Ze=>ci()),onSetThinking:Le[82]||(Le[82]=Ze=>p(o).setThinking(Ze)),onTogglePlan:Le[83]||(Le[83]=Ze=>p(o).togglePlanMode()),onToggleSwarm:Le[84]||(Le[84]=Ze=>p(o).toggleSwarmMode()),onSetPermission:Le[85]||(Le[85]=Ze=>p(o).setPermission(Ze)),onSetColorScheme:Le[86]||(Le[86]=Ze=>p(o).setColorScheme(Ze)),onSetFontScale:Le[87]||(Le[87]=Ze=>p(o).setFontScale(Ze)),onLogin:Le[88]||(Le[88]=()=>{c.value=!1,Oo()}),onLogout:vo},null,8,["modelValue","initial-view","status","thinking","models","plan-mode","swarm-mode","color-scheme","font-scale","managed-provider-status","managed-user-info","server-version"])):ee("",!0)],10,hje),p(o).initialized.value&&w.value?(y(),he(AUe,{key:1,"auth-ready":p(o).managedProviderStatus.value==="authenticated","on-start-o-auth-login":Eo,"on-poll-o-auth-login":bo,"on-cancel-o-auth-login":Ns,onComplete:b,onLoginSuccess:Io,onAddProvider:_},null,8,["auth-ready"])):ee("",!0),To.value?(y(),he(JFe,{key:2,"on-start-o-auth-login":Eo,"on-poll-o-auth-login":bo,"on-cancel-o-auth-login":Ns,onSuccess:Do,onClose:Le[89]||(Le[89]=Ze=>To.value=!1)})):ee("",!0),W.value?(y(),he(Q5,{key:3,media:W.value,"origin-img":K.value,onClose:Le[90]||(Le[90]=Ze=>{W.value=null,K.value=null})},null,8,["media","origin-img"])):ee("",!0)]))}}),vje=ft(gje,[["__scopeId","data-v-ac226647"]]);B0e();const W2=Im(vje).use(Hn),yje={t:(e,t)=>Hn.global.t(e,t)};W2.provide(NM,yje);W2.provide(RM,e=>J6e(e)?.component);W2.provide(VX,mu());W2.mount("#app");if(Wp){const e=window.kimiDesktop;if(e){const t=()=>{const n=document.documentElement.dataset.colorScheme;e.setTheme(n==="light"||n==="dark"?n:"system")};new MutationObserver(t).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),t()}}export{ER as $,fA as A,yO as B,rs as C,hVe as D,IS as E,Pe as F,iu as G,qe as H,j as I,JR as J,Bje as K,zr as L,et as M,GP as N,Uje as O,jje as P,Kje as Q,dm as R,Od as S,Zr as T,Vje as U,K8 as V,Wje as W,gVe as X,qje as Y,uVe as Z,kje as _,iA as a,bs as a$,ds as a0,Kg as a1,Aje as a2,O8 as a3,OA as a4,tn as a5,f1 as a6,$je as a7,kVe as a8,Rje as a9,cA as aA,NO as aB,BO as aC,dn as aD,DO as aE,PO as aF,d1 as aG,OO as aH,bn as aI,Dp as aJ,oO as aK,y as aL,qP as aM,Ije as aN,Ln as aO,ZS as aP,Eje as aQ,mm as aR,Go as aS,E4 as aT,Z as aU,oVe as aV,cD as aW,pt as aX,xn as aY,zO as aZ,Hje as a_,Dje as aa,Pje as ab,Oje as ac,iVe as ad,bVe as ae,nn as af,_P as ag,Jg as ah,Wa as ai,ia as aj,Xo as ak,sVe as al,tr as am,Ga as an,kt as ao,Yje as ap,Xje as aq,zn as ar,yt as as,TP as at,Re as au,xR as av,Zt as aw,$O as ax,RO as ay,Vn as az,Tje as b,Lde as b$,fVe as b0,up as b1,wm as b2,cVe as b3,Za as b4,qS as b5,Cje as b6,Xr as b7,cO as b8,dVe as b9,ai as bA,qs as bB,xP as bC,lVe as bD,Je as bE,I4 as bF,Nje as bG,fO as bH,Qje as bI,me as bJ,Zje as bK,Bn as bL,xl as bM,rVe as bN,It as bO,Lje as bP,Gn as bQ,jo as bR,SVe as bS,AVe as bT,l$ as bU,MVe as bV,Yce as bW,r$ as bX,G3 as bY,LVe as bZ,Fde as b_,bje as ba,N as bb,Fh as bc,zje as bd,Pn as be,_je as bf,wje as bg,Rh as bh,nVe as bi,GR as bj,p as bk,p1 as bl,yVe as bm,mVe as bn,XP as bo,kO as bp,eVe as bq,dO as br,vVe as bs,Gje as bt,Fje as bu,sA as bv,Em as bw,iD as bx,JA as by,V4 as bz,aVe as c,g5 as c0,h5 as c1,m5 as c2,NVe as c3,ag as c4,Md as c5,rg as c6,Mde as c7,Tde as c8,FVe as c9,f_e as cA,ft as cB,$Ve as ca,wVe as cb,RVe as cc,T2 as cd,Pi as ce,jde as cf,Ude as cg,Uce as ch,xVe as ci,Bce as cj,Hce as ck,_Ve as cl,v5 as cm,Vde as cn,N_ as co,p_ as cp,Jce as cq,lg as cr,ig as cs,TVe as ct,IVe as cu,CVe as cv,EVe as cw,Te as cx,OVe as cy,aF as cz,tVe as d,Ua as e,xje as f,as as g,YA as h,Sje as i,Mje as j,xr as k,Rp as l,_s as m,Ug as n,ra as o,pVe as p,R as q,Im as r,he as s,ee as t,M as u,C as v,uP as w,Jje as x,aP as y,dD as z};