@moonshot-ai/kimi-code 0.25.0 → 0.27.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 (72) hide show
  1. package/dist/main.mjs +4473 -2078
  2. package/dist-web/assets/{CodeBlockNode-D-Xzv638.js → CodeBlockNode-DDlAJrwY.js} +1 -1
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-CzicEtaS.js → CodeBlockShell.vue_vue_type_style_index_0_lang-DsCFStZn.js} +1 -1
  4. package/dist-web/assets/DesignSystemView-B9X_Wri_.css +1 -0
  5. package/dist-web/assets/DesignSystemView-BbwRX2u4.js +13 -0
  6. package/dist-web/assets/{Tooltip-Dx3D8Bj3.js → Tooltip-BR3ab6GW.js} +1 -1
  7. package/dist-web/assets/{arc-9b70PNbl.js → arc-BhuMeKav.js} +1 -1
  8. package/dist-web/assets/{architectureDiagram-3BPJPVTR-BYCXsJUz.js → architectureDiagram-3BPJPVTR-BnVP5dyo.js} +1 -1
  9. package/dist-web/assets/{blockDiagram-GPEHLZMM-BvXb4xMt.js → blockDiagram-GPEHLZMM-CSgMO2Ha.js} +1 -1
  10. package/dist-web/assets/{c4Diagram-AAUBKEIU-Dycf7RFH.js → c4Diagram-AAUBKEIU-BSAec2JJ.js} +1 -1
  11. package/dist-web/assets/channel-CVqhQnas.js +1 -0
  12. package/dist-web/assets/{chunk-2J33WTMH-DRHg6fyr.js → chunk-2J33WTMH-CWZ6e0xX.js} +1 -1
  13. package/dist-web/assets/{chunk-4BX2VUAB-CGqaafFW.js → chunk-4BX2VUAB-D85JgHDt.js} +1 -1
  14. package/dist-web/assets/{chunk-55IACEB6-DoWHxcjn.js → chunk-55IACEB6-CRAS3mDv.js} +1 -1
  15. package/dist-web/assets/{chunk-727SXJPM-Cx1vq8Jh.js → chunk-727SXJPM-L0fqaAlt.js} +1 -1
  16. package/dist-web/assets/{chunk-AQP2D5EJ-BGRDJbQp.js → chunk-AQP2D5EJ-C15Xm2e2.js} +1 -1
  17. package/dist-web/assets/{chunk-FMBD7UC4-C-jaGe_D.js → chunk-FMBD7UC4-BDbWvCMt.js} +1 -1
  18. package/dist-web/assets/{chunk-ND2GUHAM-BVGFPuZA.js → chunk-ND2GUHAM-DSzhcCso.js} +1 -1
  19. package/dist-web/assets/{chunk-QZHKN3VN-BSizbRaI.js → chunk-QZHKN3VN-FFne1CzC.js} +1 -1
  20. package/dist-web/assets/classDiagram-4FO5ZUOK-D1VGOBF6.js +1 -0
  21. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-D1VGOBF6.js +1 -0
  22. package/dist-web/assets/{cose-bilkent-S5V4N54A-CBHuY8c2.js → cose-bilkent-S5V4N54A-CjO7E22T.js} +1 -1
  23. package/dist-web/assets/{dagre-BM42HDAG-BfowwAru.js → dagre-BM42HDAG-BWYtcSBE.js} +1 -1
  24. package/dist-web/assets/{diagram-2AECGRRQ-BobzsYGD.js → diagram-2AECGRRQ-DyMLsE8L.js} +1 -1
  25. package/dist-web/assets/{diagram-5GNKFQAL-dIYo-MU0.js → diagram-5GNKFQAL-Cd6Po60W.js} +1 -1
  26. package/dist-web/assets/{diagram-KO2AKTUF-DsPoNGcQ.js → diagram-KO2AKTUF-CNupkUrU.js} +1 -1
  27. package/dist-web/assets/{diagram-LMA3HP47-CwKbokzg.js → diagram-LMA3HP47-DoAx9YOA.js} +1 -1
  28. package/dist-web/assets/{diagram-OG6HWLK6-BX5dnWUm.js → diagram-OG6HWLK6-CqrQtLGQ.js} +1 -1
  29. package/dist-web/assets/{erDiagram-TEJ5UH35-CyGyucxN.js → erDiagram-TEJ5UH35-X-6af5GI.js} +1 -1
  30. package/dist-web/assets/{flowDiagram-I6XJVG4X-ByYAVfl1.js → flowDiagram-I6XJVG4X-DfhjR7Ov.js} +1 -1
  31. package/dist-web/assets/{ganttDiagram-6RSMTGT7-BU7U7HVN.js → ganttDiagram-6RSMTGT7-DFHQfE0q.js} +1 -1
  32. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-4BzEpree.js → gitGraphDiagram-PVQCEYII-DOryPD-X.js} +1 -1
  33. package/dist-web/assets/{index-s-YZ1N8r.js → index-C9lkMths.js} +1 -1
  34. package/dist-web/assets/{index-DO8V4TRt.js → index-DQ5XP4c3.js} +2 -2
  35. package/dist-web/assets/index-Dy7xs5tu.js +325 -0
  36. package/dist-web/assets/index-RxoP2ZJI.css +1 -0
  37. package/dist-web/assets/{index10-CPYGci3e.js → index10-Dm7kE2rr.js} +1 -1
  38. package/dist-web/assets/{index11-D6iWwC_8.js → index11-DdA3MM9V.js} +1 -1
  39. package/dist-web/assets/{index5-Bog59TPE.js → index5-BEFSXtVE.js} +1 -1
  40. package/dist-web/assets/{index6-BZ_JSMrz.js → index6-DRC2c8Au.js} +1 -1
  41. package/dist-web/assets/{index7-Bue6SKki.js → index7-BA7Qbpln.js} +1 -1
  42. package/dist-web/assets/{index8-BqCm7dJ1.js → index8-BJFkvY9w.js} +2 -2
  43. package/dist-web/assets/{infoDiagram-5YYISTIA-BDmJQWFA.js → infoDiagram-5YYISTIA-ZsB3ppsA.js} +1 -1
  44. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-ByGBBRBR.js → ishikawaDiagram-YF4QCWOH-B2AYN5_w.js} +1 -1
  45. package/dist-web/assets/{journeyDiagram-JHISSGLW-CNR1wteR.js → journeyDiagram-JHISSGLW-ZRZDTfWd.js} +1 -1
  46. package/dist-web/assets/{kanban-definition-UN3LZRKU-4r01VKm7.js → kanban-definition-UN3LZRKU-C8zrJ_g1.js} +1 -1
  47. package/dist-web/assets/{linear-C9Ejg6z9.js → linear-yzOEoW_K.js} +1 -1
  48. package/dist-web/assets/{mermaid.core-XQ4l3YcE.js → mermaid.core-DKDe9fI9.js} +4 -4
  49. package/dist-web/assets/{mindmap-definition-RKZ34NQL-KPgj1903.js → mindmap-definition-RKZ34NQL-Ba6Dk5CQ.js} +1 -1
  50. package/dist-web/assets/{pieDiagram-4H26LBE5-BLJZ-OSy.js → pieDiagram-4H26LBE5-D9E3TqGb.js} +1 -1
  51. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-C1kVK7ci.js → quadrantDiagram-W4KKPZXB-BQ_noR4u.js} +1 -1
  52. package/dist-web/assets/{requirementDiagram-4Y6WPE33-CDsDsHAT.js → requirementDiagram-4Y6WPE33-XC7rugwi.js} +1 -1
  53. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-DWaQa1cY.js → sankeyDiagram-5OEKKPKP-Df-1d5Vn.js} +1 -1
  54. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-CLodwIYE.js → sequenceDiagram-3UESZ5HK-D82eaP5y.js} +1 -1
  55. package/dist-web/assets/{stateDiagram-AJRCARHV-35tgHlqv.js → stateDiagram-AJRCARHV-Bg5vqbfv.js} +1 -1
  56. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-C5ugWVoF.js +1 -0
  57. package/dist-web/assets/{timeline-definition-PNZ67QCA-ugbzvBQA.js → timeline-definition-PNZ67QCA-aGpihFYz.js} +1 -1
  58. package/dist-web/assets/{vennDiagram-CIIHVFJN-BRHN9x89.js → vennDiagram-CIIHVFJN-1X5A7nOP.js} +1 -1
  59. package/dist-web/assets/{vue.runtime.esm-bundler-NheX_bap.js → vue.runtime.esm-bundler-CPECXINV.js} +1 -1
  60. package/dist-web/assets/{wardley-L42UT6IY-BTb5t8a3.js → wardley-L42UT6IY-8CQt8FsK.js} +1 -1
  61. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-CQ569wwX.js → wardleyDiagram-YWT4CUSO-Dcath5AA.js} +1 -1
  62. package/dist-web/assets/{xychartDiagram-2RQKCTM6-Dh_87v9-.js → xychartDiagram-2RQKCTM6-ztyWzdXI.js} +1 -1
  63. package/dist-web/index.html +2 -2
  64. package/package.json +8 -8
  65. package/dist-web/assets/DesignSystemView-Daj_1mAu.js +0 -13
  66. package/dist-web/assets/DesignSystemView-Dyj5tvMI.css +0 -1
  67. package/dist-web/assets/channel-nqiB9njL.js +0 -1
  68. package/dist-web/assets/classDiagram-4FO5ZUOK-BeD_TBdL.js +0 -1
  69. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-BeD_TBdL.js +0 -1
  70. package/dist-web/assets/index-CB4HyosH.js +0 -325
  71. package/dist-web/assets/index-CWshH9Rs.css +0 -1
  72. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Bs-DGx_Q.js +0 -1
@@ -1,325 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-Daj_1mAu.js","assets/DesignSystemView-Dyj5tvMI.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-D-Xzv638.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-CzicEtaS.js","assets/index8-BqCm7dJ1.js","assets/index11-D6iWwC_8.js"])))=>i.map(i=>d[i]);
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
- * @vue/shared v3.5.35
4
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
- * @license MIT
6
- **/function jp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Gt={},Sc=[],yi=()=>{},l4=()=>!1,Rd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Vp=e=>e.startsWith("onUpdate:"),xn=Object.assign,ny=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},hE=Object.prototype.hasOwnProperty,ln=(e,t)=>hE.call(e,t),xt=Array.isArray,Cc=e=>Qc(e)==="[object Map]",Na=e=>Qc(e)==="[object Set]",Tb=e=>Qc(e)==="[object Date]",pE=e=>Qc(e)==="[object RegExp]",It=e=>typeof e=="function",En=e=>typeof e=="string",ei=e=>typeof e=="symbol",an=e=>e!==null&&typeof e=="object",oy=e=>(an(e)||It(e))&&It(e.then)&&It(e.catch),a4=Object.prototype.toString,Qc=e=>a4.call(e),mE=e=>Qc(e).slice(8,-1),Kp=e=>Qc(e)==="[object Object]",Gp=e=>En(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,va=jp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Yp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},gE=/-\w/g,No=Yp(e=>e.replace(gE,t=>t.slice(1).toUpperCase())),vE=/\B([A-Z])/g,Es=Yp(e=>e.replace(vE,"-$1").toLowerCase()),Zp=Yp(e=>e.charAt(0).toUpperCase()+e.slice(1)),ch=Yp(e=>e?`on${Zp(e)}`:""),Uo=(e,t)=>!Object.is(e,t),Ac=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},c4=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Xp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Lh=e=>{const t=En(e)?Number(e):NaN;return isNaN(t)?e:t};let Nb;const Qp=()=>Nb||(Nb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),yE="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",kE=jp(yE);function qt(e){if(xt(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=En(o)?_E(o):qt(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(En(e)||an(e))return e}const bE=/;(?![^(]*\))/g,xE=/:([^]+)/,wE=/\/\*[^]*?\*\//g;function _E(e){const t={};return e.replace(wE,"").split(bE).forEach(n=>{if(n){const o=n.split(xE);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function We(e){let t="";if(En(e))t=e;else if(xt(e))for(let n=0;n<e.length;n++){const o=We(e[n]);o&&(t+=o+" ")}else if(an(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function zxe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!En(t)&&(e.class=We(t)),n&&(e.style=qt(n)),e}const SE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",CE=jp(SE);function u4(e){return!!e||e===""}function AE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Fr(e[o],t[o]);return n}function Fr(e,t){if(e===t)return!0;let n=Tb(e),o=Tb(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=ei(e),o=ei(t),n||o)return e===t;if(n=xt(e),o=xt(t),n||o)return n&&o?AE(e,t):!1;if(n=an(e),o=an(t),n||o){if(!n||!o)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Fr(e[r],t[r]))return!1}}return String(e)===String(t)}function Jp(e,t){return e.findIndex(n=>Fr(n,t))}const d4=e=>!!(e&&e.__v_isRef===!0),O=e=>En(e)?e:e==null?"":xt(e)||an(e)&&(e.toString===a4||!It(e.toString))?d4(e)?O(e.value):JSON.stringify(e,f4,2):String(e),f4=(e,t)=>d4(t)?f4(e,t.value):Cc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[q1(o,i)+" =>"]=s,n),{})}:Na(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>q1(n))}:ei(t)?q1(t):an(t)&&!xt(t)&&!Kp(t)?String(t):t,q1=(e,t="")=>{var n;return ei(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function ME(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
7
- * @vue/reactivity v3.5.35
8
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
9
- * @license MIT
10
- **/let To;class h4{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&To&&(To.active?(this.parent=To,this.index=(To.scopes||(To.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=To;try{return To=this,t()}finally{To=n}}}on(){++this._on===1&&(this.prevScope=To,To=this)}off(){if(this._on>0&&--this._on===0){if(To===this)To=this.prevScope;else{let t=To;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function EE(e){return new h4(e)}function sy(){return To}function iy(e,t=!1){To&&To.cleanups.push(e)}let Hn;const j1=new WeakSet;class $h{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,To&&(To.active?To.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,j1.has(this)&&(j1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||m4(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ib(this),g4(this);const t=Hn,n=Fi;Hn=this,Fi=!0;try{return this.fn()}finally{v4(this),Hn=t,Fi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ay(t);this.deps=this.depsTail=void 0,Ib(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?j1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){wg(this)&&this.run()}get dirty(){return wg(this)}}let p4=0,ju,Vu;function m4(e,t=!1){if(e.flags|=8,t){e.next=Vu,Vu=e;return}e.next=ju,ju=e}function ry(){p4++}function ly(){if(--p4>0)return;if(Vu){let t=Vu;for(Vu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ju;){let t=ju;for(ju=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function g4(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function v4(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),ay(o),TE(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function wg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(y4(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function y4(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ud)||(e.globalVersion=ud,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!wg(e))))return;e.flags|=2;const t=e.dep,n=Hn,o=Fi;Hn=e,Fi=!0;try{g4(e);const s=e.fn(e._value);(t.version===0||Uo(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Hn=n,Fi=o,v4(e),e.flags&=-3}}function ay(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)ay(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function TE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Uxe(e,t){e.effect instanceof $h&&(e=e.effect.fn);const n=new $h(e);t&&xn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function qxe(e){e.effect.stop()}let Fi=!0;const k4=[];function Or(){k4.push(Fi),Fi=!1}function Rr(){const e=k4.pop();Fi=e===void 0?!0:e}function Ib(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Hn;Hn=void 0;try{t()}finally{Hn=n}}}let ud=0;class NE{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class em{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Hn||!Fi||Hn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Hn)n=this.activeLink=new NE(Hn,this),Hn.deps?(n.prevDep=Hn.depsTail,Hn.depsTail.nextDep=n,Hn.depsTail=n):Hn.deps=Hn.depsTail=n,b4(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Hn.depsTail,n.nextDep=void 0,Hn.depsTail.nextDep=n,Hn.depsTail=n,Hn.deps===n&&(Hn.deps=o)}return n}trigger(t){this.version++,ud++,this.notify(t)}notify(t){ry();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ly()}}}function b4(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)b4(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Fh=new WeakMap,ya=Symbol(""),_g=Symbol(""),dd=Symbol("");function ss(e,t,n){if(Fi&&Hn){let o=Fh.get(e);o||Fh.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new em),s.map=o,s.key=n),s.track()}}function Ar(e,t,n,o,s,i){const r=Fh.get(e);if(!r){ud++;return}const l=a=>{a&&a.trigger()};if(ry(),t==="clear")r.forEach(l);else{const a=xt(e),c=a&&Gp(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===dd||!ei(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(dd)),t){case"add":a?c&&l(r.get("length")):(l(r.get(ya)),Cc(e)&&l(r.get(_g)));break;case"delete":a||(l(r.get(ya)),Cc(e)&&l(r.get(_g)));break;case"set":Cc(e)&&l(r.get(ya));break}}ly()}function IE(e,t){const n=Fh.get(e);return n&&n.get(t)}function Xa(e){const t=en(e);return t===e?t:(ss(t,"iterate",dd),Gs(e)?t:t.map(Ri))}function tm(e){return ss(e=en(e),"iterate",dd),e}function Xi(e,t){return Br(e)?zc(bl(e)?Ri(t):t):Ri(t)}const LE={__proto__:null,[Symbol.iterator](){return V1(this,Symbol.iterator,e=>Xi(this,e))},concat(...e){return Xa(this).concat(...e.map(t=>xt(t)?Xa(t):t))},entries(){return V1(this,"entries",e=>(e[1]=Xi(this,e[1]),e))},every(e,t){return hr(this,"every",e,t,void 0,arguments)},filter(e,t){return hr(this,"filter",e,t,n=>n.map(o=>Xi(this,o)),arguments)},find(e,t){return hr(this,"find",e,t,n=>Xi(this,n),arguments)},findIndex(e,t){return hr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return hr(this,"findLast",e,t,n=>Xi(this,n),arguments)},findLastIndex(e,t){return hr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return hr(this,"forEach",e,t,void 0,arguments)},includes(...e){return K1(this,"includes",e)},indexOf(...e){return K1(this,"indexOf",e)},join(e){return Xa(this).join(e)},lastIndexOf(...e){return K1(this,"lastIndexOf",e)},map(e,t){return hr(this,"map",e,t,void 0,arguments)},pop(){return Su(this,"pop")},push(...e){return Su(this,"push",e)},reduce(e,...t){return Lb(this,"reduce",e,t)},reduceRight(e,...t){return Lb(this,"reduceRight",e,t)},shift(){return Su(this,"shift")},some(e,t){return hr(this,"some",e,t,void 0,arguments)},splice(...e){return Su(this,"splice",e)},toReversed(){return Xa(this).toReversed()},toSorted(e){return Xa(this).toSorted(e)},toSpliced(...e){return Xa(this).toSpliced(...e)},unshift(...e){return Su(this,"unshift",e)},values(){return V1(this,"values",e=>Xi(this,e))}};function V1(e,t,n){const o=tm(e),s=o[t]();return o!==e&&!Gs(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const $E=Array.prototype;function hr(e,t,n,o,s,i){const r=tm(e),l=r!==e&&!Gs(e),a=r[t];if(a!==$E[t]){const d=a.apply(e,i);return l?Ri(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Xi(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function Lb(e,t,n,o){const s=tm(e),i=s!==e&&!Gs(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=Xi(e,c)),n.call(this,c,Xi(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](r,...o);return l?Xi(e,a):a}function K1(e,t,n){const o=en(e);ss(o,"iterate",dd);const s=o[t](...n);return(s===-1||s===!1)&&sm(n[0])?(n[0]=en(n[0]),o[t](...n)):s}function Su(e,t,n=[]){Or(),ry();const o=en(e)[t].apply(e,n);return ly(),Rr(),o}const FE=jp("__proto__,__v_isRef,__isVue"),x4=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ei));function OE(e){ei(e)||(e=String(e));const t=en(this);return ss(t,"has",e),t.hasOwnProperty(e)}class w4{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?E4:M4:i?A4:C4).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=xt(t);if(!s){let a;if(r&&(a=LE[n]))return a;if(n==="hasOwnProperty")return OE}const l=Reflect.get(t,n,ao(t)?t:o);if((ei(n)?x4.has(n):FE(n))||(s||ss(t,"get",n),i))return l;if(ao(l)){const a=r&&Gp(n)?l:l.value;return s&&an(a)?Oh(a):a}return an(l)?s?Oh(l):Oo(l):l}}class _4 extends w4{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=xt(t)&&Gp(n);if(!this._isShallow){const c=Br(i);if(!Gs(o)&&!Br(o)&&(i=en(i),o=en(o)),!r&&ao(i)&&!ao(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:ln(t,n),a=Reflect.set(t,n,o,ao(t)?t:s);return t===en(s)&&(l?Uo(o,i)&&Ar(t,"set",n,o):Ar(t,"add",n,o)),a}deleteProperty(t,n){const o=ln(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&Ar(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!ei(n)||!x4.has(n))&&ss(t,"has",n),o}ownKeys(t){return ss(t,"iterate",xt(t)?"length":ya),Reflect.ownKeys(t)}}class S4 extends w4{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const RE=new _4,BE=new S4,DE=new _4(!0),PE=new S4(!0),Sg=e=>e,_f=e=>Reflect.getPrototypeOf(e);function HE(e,t,n){return function(...o){const s=this.__v_raw,i=en(s),r=Cc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?Sg:t?zc:Ri;return!t&&ss(i,"iterate",a?_g:ya),xn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Sf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function WE(e,t){const n={get(s){const i=this.__v_raw,r=en(i),l=en(s);e||(Uo(s,l)&&ss(r,"get",s),ss(r,"get",l));const{has:a}=_f(r),c=t?Sg:e?zc:Ri;if(a.call(r,s))return c(i.get(s));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&ss(en(s),"iterate",ya),s.size},has(s){const i=this.__v_raw,r=en(i),l=en(s);return e||(Uo(s,l)&&ss(r,"has",s),ss(r,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const r=this,l=r.__v_raw,a=en(l),c=t?Sg:e?zc:Ri;return!e&&ss(a,"iterate",ya),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return xn(n,e?{add:Sf("add"),set:Sf("set"),delete:Sf("delete"),clear:Sf("clear")}:{add(s){const i=en(this),r=_f(i),l=en(s),a=!t&&!Gs(s)&&!Br(s)?l:s;return r.has.call(i,a)||Uo(s,a)&&r.has.call(i,s)||Uo(l,a)&&r.has.call(i,l)||(i.add(a),Ar(i,"add",a,a)),this},set(s,i){!t&&!Gs(i)&&!Br(i)&&(i=en(i));const r=en(this),{has:l,get:a}=_f(r);let c=l.call(r,s);c||(s=en(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?Uo(i,u)&&Ar(r,"set",s,i):Ar(r,"add",s,i),this},delete(s){const i=en(this),{has:r,get:l}=_f(i);let a=r.call(i,s);a||(s=en(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Ar(i,"delete",s,void 0),c},clear(){const s=en(this),i=s.size!==0,r=s.clear();return i&&Ar(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=HE(s,e,t)}),n}function nm(e,t){const n=WE(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(ln(n,s)&&s in o?n:o,s,i)}const zE={get:nm(!1,!1)},UE={get:nm(!1,!0)},qE={get:nm(!0,!1)},jE={get:nm(!0,!0)},C4=new WeakMap,A4=new WeakMap,M4=new WeakMap,E4=new WeakMap;function VE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Oo(e){return Br(e)?e:om(e,!1,RE,zE,C4)}function KE(e){return om(e,!1,DE,UE,A4)}function Oh(e){return om(e,!0,BE,qE,M4)}function jxe(e){return om(e,!0,PE,jE,E4)}function om(e,t,n,o,s){if(!an(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=VE(mE(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function bl(e){return Br(e)?bl(e.__v_raw):!!(e&&e.__v_isReactive)}function Br(e){return!!(e&&e.__v_isReadonly)}function Gs(e){return!!(e&&e.__v_isShallow)}function sm(e){return e?!!e.__v_raw:!1}function en(e){const t=e&&e.__v_raw;return t?en(t):e}function pt(e){return!ln(e,"__v_skip")&&Object.isExtensible(e)&&c4(e,"__v_skip",!0),e}const Ri=e=>an(e)?Oo(e):e,zc=e=>an(e)?Oh(e):e;function ao(e){return e?e.__v_isRef===!0:!1}function Z(e){return T4(e,!1)}function Ia(e){return T4(e,!0)}function T4(e,t){return ao(e)?e:new GE(e,t)}class GE{constructor(t,n){this.dep=new em,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:en(t),this._value=n?t:Ri(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||Gs(t)||Br(t);t=o?t:en(t),Uo(t,n)&&(this._rawValue=t,this._value=o?t:Ri(t),this.dep.trigger())}}function Vxe(e){e.dep&&e.dep.trigger()}function C(e){return ao(e)?e.value:e}function N4(e){return It(e)?e():C(e)}const YE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return ao(s)&&!ao(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function I4(e){return bl(e)?e:new Proxy(e,YE)}class ZE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new em,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function XE(e){return new ZE(e)}function Kxe(e){const t=xt(e)?new Array(e.length):{};for(const n in e)t[n]=L4(e,n);return t}class QE{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=ei(n)?n:String(n),this._raw=en(t);let s=!0,i=t;if(!xt(t)||ei(this._key)||!Gp(this._key))do s=!sm(i)||Gs(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&ao(this._raw[this._key])){const n=this._object[this._key];if(ao(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return IE(this._raw,this._key)}}class JE{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Gxe(e,t,n){return ao(e)?e:It(e)?new JE(e):an(e)&&arguments.length>1?L4(e,t,n):Z(e)}function L4(e,t,n){return new QE(e,t,n)}class eT{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new em(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ud-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Hn!==this)return m4(this,!0),!0}get value(){const t=this.dep.track();return y4(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function tT(e,t,n=!1){let o,s;return It(e)?o=e:(o=e.get,s=e.set),new eT(o,s,n)}const Yxe={GET:"get",HAS:"has",ITERATE:"iterate"},Zxe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Cf={},Rh=new WeakMap;let ul;function Xxe(){return ul}function nT(e,t=!1,n=ul){if(n){let o=Rh.get(n);o||Rh.set(n,o=[]),o.push(e)}}function oT(e,t,n=Gt){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=k=>s?k:Gs(k)||s===!1||s===0?Mr(k,1):Mr(k);let u,d,f,h,p=!1,g=!1;if(ao(e)?(d=()=>e.value,p=Gs(e)):bl(e)?(d=()=>c(e),p=!0):xt(e)?(g=!0,p=e.some(k=>bl(k)||Gs(k)),d=()=>e.map(k=>{if(ao(k))return k.value;if(bl(k))return c(k);if(It(k))return a?a(k,2):k()})):It(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Or();try{f()}finally{Rr()}}const k=ul;ul=u;try{return a?a(e,3,[h]):e(h)}finally{ul=k}}:d=yi,t&&s){const k=d,A=s===!0?1/0:s;d=()=>Mr(k(),A)}const b=sy(),v=()=>{u.stop(),b&&b.active&&ny(b.effects,u)};if(i&&t){const k=t;t=(...A)=>{k(...A),v()}}let m=g?new Array(e.length).fill(Cf):Cf;const y=k=>{if(!(!(u.flags&1)||!u.dirty&&!k))if(t){const A=u.run();if(s||p||(g?A.some(($,L)=>Uo($,m[L])):Uo(A,m))){f&&f();const $=ul;ul=u;try{const L=[A,m===Cf?void 0:g&&m[0]===Cf?[]:m,h];m=A,a?a(t,3,L):t(...L)}finally{ul=$}}}else u.run()};return l&&l(y),u=new $h(d),u.scheduler=r?()=>r(y,!1):y,h=k=>nT(k,!1,u),f=u.onStop=()=>{const k=Rh.get(u);if(k){if(a)a(k,4);else for(const A of k)A();Rh.delete(u)}},t?o?y(!0):m=u.run():r?r(y.bind(null,!0),!0):u.run(),v.pause=u.pause.bind(u),v.resume=u.resume.bind(u),v.stop=v,v}function Mr(e,t=1/0,n){if(t<=0||!an(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ao(e))Mr(e.value,t,n);else if(xt(e))for(let o=0;o<e.length;o++)Mr(e[o],t,n);else if(Na(e)||Cc(e))e.forEach(o=>{Mr(o,t,n)});else if(Kp(e)){for(const o in e)Mr(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Mr(e[o],t,n)}return e}/**
11
- * @vue/runtime-core v3.5.35
12
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
13
- * @license MIT
14
- **/const $4=[];function sT(e){$4.push(e)}function iT(){$4.pop()}function Qxe(e,t){}const Jxe={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},rT={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Bd(e,t,n,o){try{return o?e(...o):e()}catch(s){Jc(s,t,n)}}function xi(e,t,n,o){if(It(e)){const s=Bd(e,t,n,o);return s&&oy(s)&&s.catch(i=>{Jc(i,t,n)}),s}if(xt(e)){const s=[];for(let i=0;i<e.length;i++)s.push(xi(e[i],t,n,o));return s}}function Jc(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Gt;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(i){Or(),Bd(i,null,10,[e,a,c]),Rr();return}}lT(e,n,s,o,r)}function lT(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const hs=[];let Gi=-1;const Mc=[];let dl=null,ac=0;const F4=Promise.resolve();let Bh=null;function mt(e){const t=Bh||F4;return e?t.then(this?e.bind(this):e):t}function aT(e){let t=Gi+1,n=hs.length;for(;t<n;){const o=t+n>>>1,s=hs[o],i=fd(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function cy(e){if(!(e.flags&1)){const t=fd(e),n=hs[hs.length-1];!n||!(e.flags&2)&&t>=fd(n)?hs.push(e):hs.splice(aT(t),0,e),e.flags|=1,O4()}}function O4(){Bh||(Bh=F4.then(R4))}function Dh(e){xt(e)?Mc.push(...e):dl&&e.id===-1?dl.splice(ac+1,0,e):e.flags&1||(Mc.push(e),e.flags|=1),O4()}function $b(e,t,n=Gi+1){for(;n<hs.length;n++){const o=hs[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;hs.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Ph(e){if(Mc.length){const t=[...new Set(Mc)].sort((n,o)=>fd(n)-fd(o));if(Mc.length=0,dl){dl.push(...t);return}for(dl=t,ac=0;ac<dl.length;ac++){const n=dl[ac];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}dl=null,ac=0}}const fd=e=>e.id==null?e.flags&2?-1:1/0:e.id;function R4(e){try{for(Gi=0;Gi<hs.length;Gi++){const t=hs[Gi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Bd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Gi<hs.length;Gi++){const t=hs[Gi];t&&(t.flags&=-2)}Gi=-1,hs.length=0,Ph(),Bh=null,(hs.length||Mc.length)&&R4()}}let cc,Af=[];function B4(e,t){var n,o;cc=e,cc?(cc.enabled=!0,Af.forEach(({event:s,args:i})=>cc.emit(s,...i)),Af=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{B4(i,t)}),setTimeout(()=>{cc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Af=[])},3e3)):Af=[]}let Vo=null,im=null;function hd(e){const t=Vo;return Vo=e,im=e&&e.type.__scopeId||null,t}function ewe(e){im=e}function twe(){im=null}const nwe=e=>Ne;function Ne(e,t=Vo,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&qh(-1);const i=hd(t);let r;try{r=e(...s)}finally{hd(i),o._d&&qh(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function $n(e,t){if(Vo===null)return e;const n=Wd(Vo),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=Gt]=t[s];i&&(It(i)&&(i={mounted:i,updated:i}),i.deep&&Mr(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Yi(e,t,n,o){const s=e.dirs,i=t&&t.dirs;for(let r=0;r<s.length;r++){const l=s[r];i&&(l.oldValue=i[r].value);let a=l.dir[o];a&&(Or(),xi(a,n,8,[e.el,l,e,t]),Rr())}}function In(e,t){if(jo){let n=jo.provides;const o=jo.parent&&jo.parent.provides;o===n&&(n=jo.provides=Object.create(o)),n[e]=t}}function Ut(e,t,n=!1){const o=Go();if(o||ka){let s=ka?ka._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&It(t)?t.call(o&&o.proxy):t}}function owe(){return!!(Go()||ka)}const cT=Symbol.for("v-scx"),uT=()=>Ut(cT);function dT(e,t){return Dd(e,null,t)}function swe(e,t){return Dd(e,null,{flush:"post"})}function fT(e,t){return Dd(e,null,{flush:"sync"})}function Qe(e,t,n){return Dd(e,t,n)}function Dd(e,t,n=Gt){const{immediate:o,deep:s,flush:i,once:r}=n,l=xn({},n),a=t&&o||!t&&i!=="post";let c;if(Sa){if(i==="sync"){const h=uT();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=yi,h.resume=yi,h.pause=yi,h}}const u=jo;l.call=(h,p,g)=>xi(h,u,p,g);let d=!1;i==="post"?l.scheduler=h=>{mo(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():cy(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=oT(e,t,l);return Sa&&(c?c.push(f):a&&f()),f}function hT(e,t,n){const o=this.proxy,s=En(e)?e.includes(".")?D4(o,e):()=>o[e]:e.bind(o,o);let i;It(t)?i=t:(i=t.handler,n=t);const r=eu(this),l=Dd(s,i.bind(o),n);return r(),l}function D4(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const ll=new WeakMap,P4=Symbol("_vte"),H4=e=>e.__isTeleport,la=e=>e&&(e.disabled||e.disabled===""),pT=e=>e&&(e.defer||e.defer===""),Fb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Ob=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Cg=(e,t)=>{const n=e&&e.to;return En(n)?t?t(n):null:n},mT={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:g,createComment:b,parentNode:v}}=c,m=la(t.props);let{dynamicChildren:y}=t;const k=(L,w,E)=>{L.shapeFlag&16&&u(L.children,w,E,s,i,r,l,a)},A=(L=t)=>{const w=la(L.props),E=L.target=Cg(L.props,p),T=Ag(E,L,g,h);E&&(r!=="svg"&&Fb(E)?r="svg":r!=="mathml"&&Ob(E)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(E),w||(k(L,E,T),Ou(L,!1)))},$=L=>{const w=()=>{if(ll.get(L)===w){if(ll.delete(L),la(L.props)){const E=v(L.el)||n;k(L,E,L.anchor),Ou(L,!0)}A(L)}};ll.set(L,w),mo(w,i)};if(e==null){const L=t.el=g(""),w=t.anchor=g("");if(h(L,n,o),h(w,n,o),pT(t.props)||i&&i.pendingBranch){$(t);return}m&&(k(t,n,w),Ou(t,!0)),A()}else{t.el=e.el;const L=t.anchor=e.anchor,w=ll.get(e);if(w){w.flags|=8,ll.delete(e),$(t);return}t.targetStart=e.targetStart;const E=t.target=e.target,T=t.targetAnchor=e.targetAnchor,F=la(e.props),S=F?n:E,I=F?L:T;if(r==="svg"||Fb(E)?r="svg":(r==="mathml"||Ob(E))&&(r="mathml"),y?(f(e.dynamicChildren,y,S,s,i,r,l),ky(e,t,!0)):a||d(e,t,S,I,s,i,r,l,!1),m)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Mf(t,n,L,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const P=t.target=Cg(t.props,p);P&&Mf(t,P,null,c,0)}else F&&Mf(t,E,T,c,1);Ou(t,m)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!la(f),p=ll.get(e);if(p&&(p.flags|=8,ll.delete(e)),d&&(s(c),s(u)),i&&s(a),!p&&r&16)for(let g=0;g<l.length;g++){const b=l[g];o(b,t,n,h,!!b.dynamicChildren)}},move:Mf,hydrate:gT};function Mf(e,t,n,{o:{insert:o},m:s},i=2){i===0&&o(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&o(r,t,n),!ll.has(e)&&(!d||la(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function gT(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(b,v){let m=v;for(;m;){if(m&&m.nodeType===8){if(m.data==="teleport start anchor")t.targetStart=m;else if(m.data==="teleport anchor"){t.targetAnchor=m,b._lpa=t.targetAnchor&&r(t.targetAnchor);break}}m=r(m)}}function h(b,v){v.anchor=d(r(b),v,l(b),n,o,s,i)}const p=t.target=Cg(t.props,a),g=la(t.props);if(p){const b=p._lpa||p.firstChild;t.shapeFlag&16&&(g?(h(e,t),f(p,b),t.targetAnchor||Ag(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,b),t.targetAnchor||Ag(p,t,u,c),d(b&&r(b),t,p,n,o,s,i))),Ou(t,g)}else g&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const rm=mT;function Ou(e,t){const n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function Ag(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[P4]=r,e&&(o(i,e,s),o(r,e,s)),r}const fi=Symbol("_leaveCb"),Cu=Symbol("_enterCb");function W4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return cn(()=>{e.isMounted=!0}),co(()=>{e.isUnmounting=!0}),e}const ri=[Function,Array],z4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ri,onEnter:ri,onAfterEnter:ri,onEnterCancelled:ri,onBeforeLeave:ri,onLeave:ri,onAfterLeave:ri,onLeaveCancelled:ri,onBeforeAppear:ri,onAppear:ri,onAfterAppear:ri,onAppearCancelled:ri},U4=e=>{const t=e.subTree;return t.component?U4(t.component):t},vT={name:"BaseTransition",props:z4,setup(e,{slots:t}){const n=Go(),o=W4();return()=>{const s=t.default&&uy(t.default(),!0),i=s&&s.length?q4(s):n.subTree?le():void 0;if(!i)return;const r=en(e),{mode:l}=r;if(o.isLeaving)return G1(i);const a=Rb(i);if(!a)return G1(i);let c=pd(a,r,o,n,d=>c=d);a.type!==yo&&Al(a,c);let u=n.subTree&&Rb(n.subTree);if(u&&u.type!==yo&&!Ii(u,a)&&U4(n).type!==yo){let d=pd(u,r,o,n);if(Al(u,d),l==="out-in"&&a.type!==yo)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},G1(i);l==="in-out"&&a.type!==yo?d.delayLeave=(f,h,p)=>{const g=j4(o,u);g[String(u.key)]=u,f[fi]=()=>{h(),f[fi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function q4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==yo){t=n;break}}return t}const yT=vT;function j4(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function pd(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:g,onBeforeAppear:b,onAppear:v,onAfterAppear:m,onAppearCancelled:y}=t,k=String(e.key),A=j4(n,e),$=(E,T)=>{E&&xi(E,o,9,T)},L=(E,T)=>{const F=T[1];$(E,T),xt(E)?E.every(S=>S.length<=1)&&F():E.length<=1&&F()},w={mode:r,persisted:l,beforeEnter(E){let T=a;if(!n.isMounted)if(i)T=b||a;else return;E[fi]&&E[fi](!0);const F=A[k];F&&Ii(e,F)&&F.el[fi]&&F.el[fi](),$(T,[E])},enter(E){if(A[k]===e)return;let T=c,F=u,S=d;if(!n.isMounted)if(i)T=v||c,F=m||u,S=y||d;else return;let I=!1;E[Cu]=B=>{I||(I=!0,B?$(S,[E]):$(F,[E]),w.delayedLeave&&w.delayedLeave(),E[Cu]=void 0)};const P=E[Cu].bind(null,!1);T?L(T,[E,P]):P()},leave(E,T){const F=String(e.key);if(E[Cu]&&E[Cu](!0),n.isUnmounting)return T();$(f,[E]);let S=!1;E[fi]=P=>{S||(S=!0,T(),P?$(g,[E]):$(p,[E]),E[fi]=void 0,A[F]===e&&delete A[F])};const I=E[fi].bind(null,!1);A[F]=e,h?L(h,[E,I]):I()},clone(E){const T=pd(E,t,n,o,s);return s&&s(T),T}};return w}function G1(e){if(Pd(e))return e=Dr(e),e.children=null,e}function Rb(e){if(!Pd(e))return H4(e.type)&&e.children?q4(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&It(n.default))return n.default()}}function Al(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Al(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function uy(e,t=!1,n){let o=[],s=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Pe?(r.patchFlag&128&&s++,o=o.concat(uy(r.children,t,l))):(t||r.type!==yo)&&o.push(l!=null?Dr(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Ye(e,t){return It(e)?xn({name:e.name},t,{setup:e}):e}function iwe(){const e=Go();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function dy(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function rwe(e){const t=Go(),n=Ia(null);if(t){const s=t.refs===Gt?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Bb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Hh=new WeakMap;function Ec(e,t,n,o,s=!1){if(xt(e)){e.forEach((g,b)=>Ec(g,t&&(xt(t)?t[b]:t),n,o,s));return}if(Lr(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Ec(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?Wd(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Gt?l.refs={}:l.refs,d=l.setupState,f=en(d),h=d===Gt?l4:g=>Bb(u,g)?!1:ln(f,g),p=(g,b)=>!(b&&Bb(u,b));if(c!=null&&c!==a){if(Db(t),En(c))u[c]=null,h(c)&&(d[c]=null);else if(ao(c)){const g=t;p(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if(It(a))Bd(a,l,12,[r,u]);else{const g=En(a),b=ao(a);if(g||b){const v=()=>{if(e.f){const m=g?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(s)xt(m)&&ny(m,i);else if(xt(m))m.includes(i)||m.push(i);else if(g)u[a]=[i],h(a)&&(d[a]=u[a]);else{const y=[i];p(a,e.k)&&(a.value=y),e.k&&(u[e.k]=y)}}else g?(u[a]=r,h(a)&&(d[a]=r)):b&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const m=()=>{v(),Hh.delete(e)};m.id=-1,Hh.set(e,m),mo(m,n)}else Db(e),v()}}}function Db(e){const t=Hh.get(e);t&&(t.flags|=8,Hh.delete(e))}let Pb=!1;const Qa=()=>{Pb||(console.error("Hydration completed but contains mismatches."),Pb=!0)},kT=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",bT=e=>e.namespaceURI.includes("MathML"),Ef=e=>{if(e.nodeType===1){if(kT(e))return"svg";if(bT(e))return"mathml"}},gc=e=>e.nodeType===8;function xT(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(y,k)=>{if(!k.hasChildNodes()){n(null,y,k),Ph(),k._vnode=y;return}d(k.firstChild,y,null,null,null),Ph(),k._vnode=y},d=(y,k,A,$,L,w=!1)=>{w=w||!!k.dynamicChildren;const E=gc(y)&&y.data==="[",T=()=>g(y,k,A,$,L,E),{type:F,ref:S,shapeFlag:I,patchFlag:P}=k;let B=y.nodeType;k.el=y,P===-2&&(w=!1,k.dynamicChildren=null);let W=null;switch(F){case xl:B!==3?k.children===""?(a(k.el=s(""),r(y),y),W=y):W=T():(y.data!==k.children&&(Qa(),y.data=k.children),W=i(y));break;case yo:m(y)?(W=i(y),v(k.el=y.content.firstChild,y,A)):B!==8||E?W=T():W=i(y);break;case Nc:if(E&&(y=i(y),B=y.nodeType),B===1||B===3){W=y;const z=!k.children.length;for(let D=0;D<k.staticCount;D++)z&&(k.children+=W.nodeType===1?W.outerHTML:W.data),D===k.staticCount-1&&(k.anchor=W),W=i(W);return E?i(W):W}else T();break;case Pe:E?W=p(y,k,A,$,L,w):W=T();break;default:if(I&1)(B!==1||k.type.toLowerCase()!==y.tagName.toLowerCase())&&!m(y)?W=T():W=f(y,k,A,$,L,w);else if(I&6){k.slotScopeIds=L;const z=r(y);if(E?W=b(y):gc(y)&&y.data==="teleport start"?W=b(y,y.data,"teleport end"):W=i(y),t(k,z,null,A,$,Ef(z),w),Lr(k)&&!k.type.__asyncResolved){let D;E?(D=re(Pe),D.anchor=W?W.previousSibling:z.lastChild):D=y.nodeType===3?Xe(""):re("div"),D.el=y,k.component.subTree=D}}else I&64?B!==8?W=T():W=k.type.hydrate(y,k,A,$,L,w,e,h):I&128&&(W=k.type.hydrate(y,k,A,$,Ef(r(y)),L,w,e,d))}return S!=null&&Ec(S,null,$,k),W},f=(y,k,A,$,L,w)=>{w=w||!!k.dynamicChildren;const{type:E,props:T,patchFlag:F,shapeFlag:S,dirs:I,transition:P}=k,B=E==="input"||E==="option";if(B||F!==-1){I&&Yi(k,null,A,"created");let W=!1;if(m(y)){W=d3(null,P)&&A&&A.vnode.props&&A.vnode.props.appear;const D=y.content.firstChild;if(W){const q=D.getAttribute("class");q&&(D.$cls=q),P.beforeEnter(D)}v(D,y,A),k.el=y=D}if(S&16&&!(T&&(T.innerHTML||T.textContent))){let D=h(y.firstChild,k,y,A,$,L,w);for(D&&!Tf(y,1)&&Qa();D;){const q=D;D=D.nextSibling,l(q)}}else if(S&8){let D=k.children;D[0]===`
15
- `&&(y.tagName==="PRE"||y.tagName==="TEXTAREA")&&(D=D.slice(1));const{textContent:q}=y;q!==D&&q!==D.replace(/\r\n|\r/g,`
16
- `)&&(Tf(y,0)||Qa(),y.textContent=k.children)}if(T){if(B||!w||F&48){const D=y.tagName.includes("-");for(const q in T)(B&&(q.endsWith("value")||q==="indeterminate")||Rd(q)&&!va(q)||q[0]==="."||D&&!va(q))&&o(y,q,null,T[q],void 0,A)}else if(T.onClick)o(y,"onClick",null,T.onClick,void 0,A);else if(F&4&&bl(T.style))for(const D in T.style)T.style[D]}let z;(z=T&&T.onVnodeBeforeMount)&&Cs(z,A,k),I&&Yi(k,null,A,"beforeMount"),((z=T&&T.onVnodeMounted)||I||W)&&m3(()=>{z&&Cs(z,A,k),W&&P.enter(y),I&&Yi(k,null,A,"mounted")},$)}return y.nextSibling},h=(y,k,A,$,L,w,E)=>{E=E||!!k.dynamicChildren;const T=k.children,F=T.length;let S=!1;for(let I=0;I<F;I++){const P=E?T[I]:T[I]=Ms(T[I]),B=P.type===xl;y?(B&&!E&&I+1<F&&Ms(T[I+1]).type===xl&&(a(s(y.data.slice(P.children.length)),A,i(y)),y.data=P.children),y=d(y,P,$,L,w,E)):B&&!P.children?a(P.el=s(""),A):(S||(S=!0,Tf(A,1)||Qa()),n(null,P,A,null,$,L,Ef(A),w))}return y},p=(y,k,A,$,L,w)=>{const{slotScopeIds:E}=k;E&&(L=L?L.concat(E):E);const T=r(y),F=h(i(y),k,T,A,$,L,w);return F&&gc(F)&&F.data==="]"?i(k.anchor=F):(Qa(),a(k.anchor=c("]"),T,F),F)},g=(y,k,A,$,L,w)=>{if(Tf(y.parentElement,1)||Qa(),k.el=null,w){const F=b(y);for(;;){const S=i(y);if(S&&S!==F)l(S);else break}}const E=i(y),T=r(y);return l(y),n(null,k,T,E,A,$,Ef(T),L),A&&(A.vnode.el=k.el,cm(A,k.el)),E},b=(y,k="[",A="]")=>{let $=0;for(;y;)if(y=i(y),y&&gc(y)&&(y.data===k&&$++,y.data===A)){if($===0)return i(y);$--}return y},v=(y,k,A)=>{const $=k.parentNode;$&&$.replaceChild(y,k);let L=A;for(;L;)L.vnode.el===k&&(L.vnode.el=L.subTree.el=y),L=L.parent},m=y=>y.nodeType===1&&y.tagName==="TEMPLATE";return[u,d]}const Hb="data-allow-mismatch",wT={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Tf(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Hb);)e=e.parentElement;const n=e&&e.getAttribute(Hb);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(wT[t])}}const _T=Qp().requestIdleCallback||(e=>setTimeout(e,1)),ST=Qp().cancelIdleCallback||(e=>clearTimeout(e)),lwe=(e=1e4)=>t=>{const n=_T(t,{timeout:e});return()=>ST(n)};function CT(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||o>0&&o<i)&&(n>0&&n<r||s>0&&s<r)}const awe=e=>(t,n)=>{const o=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(CT(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},cwe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},uwe=(e=[])=>(t,n)=>{En(e)&&(e=[e]);let o=!1;const s=r=>{o||(o=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,s)})};return n(r=>{for(const l of e)r.addEventListener(l,s,{once:!0})}),i};function AT(e,t){if(gc(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(gc(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Lr=e=>!!e.type.__asyncLoader;function Li(e){It(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((b,v)=>{a(g,()=>b(f()),()=>v(g),d+1)});throw g}).then(g=>p!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Ye({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,g,b){let v=!1;(g.bu||(g.bu=[])).push(()=>v=!0);const m=()=>{v||b()},y=i?()=>{const k=i(m,A=>AT(p,A));k&&(g.bum||(g.bum=[])).push(k)}:m;u?y():h().then(()=>!g.isUnmounted&&y())},get __asyncResolved(){return u},setup(){const p=jo;if(dy(p),u)return()=>Nf(u,p);const g=y=>{c=null,Jc(y,p,13,!o)};if(l&&p.suspense||Sa)return h().then(y=>()=>Nf(y,p)).catch(y=>(g(y),()=>o?re(o,{error:y}):null));const b=Z(!1),v=Z(),m=Z(!!s);return s&&setTimeout(()=>{m.value=!1},s),r!=null&&setTimeout(()=>{if(!b.value&&!v.value){const y=new Error(`Async component timed out after ${r}ms.`);g(y),v.value=y}},r),h().then(()=>{b.value=!0,p.parent&&Pd(p.parent.vnode)&&p.parent.update()}).catch(y=>{g(y),v.value=y}),()=>{if(b.value&&u)return Nf(u,p);if(v.value&&o)return re(o,{error:v.value});if(n&&!m.value)return Nf(n,p)}}})}function Nf(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=re(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Pd=e=>e.type.__isKeepAlive,MT={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Go(),o=n.ctx;if(!o.renderer)return()=>{const m=t.default&&t.default();return m&&m.length===1?m[0]:m};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(m,y,k,A,$)=>{const L=m.component;c(m,y,k,0,l),a(L.vnode,m,y,k,L,l,A,m.slotScopeIds,$),mo(()=>{L.isDeactivated=!1,L.a&&Ac(L.a);const w=m.props&&m.props.onVnodeMounted;w&&Cs(w,L.parent,m)},l)},o.deactivate=m=>{const y=m.component;zh(y.m),zh(y.a),c(m,f,null,1,l),mo(()=>{y.da&&Ac(y.da);const k=m.props&&m.props.onVnodeUnmounted;k&&Cs(k,y.parent,m),y.isDeactivated=!0},l)};function h(m){Y1(m),u(m,n,l,!0)}function p(m){s.forEach((y,k)=>{const A=Og(Lr(y)?y.type.__asyncResolved||{}:y.type);A&&!m(A)&&g(k)})}function g(m){const y=s.get(m);y&&(!r||!Ii(y,r))?h(y):r&&Y1(r),s.delete(m),i.delete(m)}Qe(()=>[e.include,e.exclude],([m,y])=>{m&&p(k=>Ru(m,k)),y&&p(k=>!Ru(y,k))},{flush:"post",deep:!0});let b=null;const v=()=>{b!=null&&(Uh(n.subTree.type)?mo(()=>{s.set(b,If(n.subTree))},n.subTree.suspense):s.set(b,If(n.subTree)))};return cn(v),fy(v),co(()=>{s.forEach(m=>{const{subTree:y,suspense:k}=n,A=If(y);if(m.type===A.type&&m.key===A.key){Y1(A);const $=A.component.da;$&&mo($,k);return}h(m)})}),()=>{if(b=null,!t.default)return r=null;const m=t.default(),y=m[0];if(m.length>1)return r=null,m;if(!Ml(y)||!(y.shapeFlag&4)&&!(y.shapeFlag&128))return r=null,y;let k=If(y);if(k.type===yo)return r=null,k;const A=k.type,$=Og(Lr(k)?k.type.__asyncResolved||{}:A),{include:L,exclude:w,max:E}=e;if(L&&(!$||!Ru(L,$))||w&&$&&Ru(w,$))return k.shapeFlag&=-257,r=k,y;const T=k.key==null?A:k.key,F=s.get(T);return k.el&&(k=Dr(k),y.shapeFlag&128&&(y.ssContent=k)),b=T,F?(k.el=F.el,k.component=F.component,k.transition&&Al(k,k.transition),k.shapeFlag|=512,i.delete(T),i.add(T)):(i.add(T),E&&i.size>parseInt(E,10)&&g(i.values().next().value)),k.shapeFlag|=256,r=k,Uh(y.type)?y:k}}},dwe=MT;function Ru(e,t){return xt(e)?e.some(n=>Ru(n,t)):En(e)?e.split(",").includes(t):pE(e)?(e.lastIndex=0,e.test(t)):!1}function ET(e,t){V4(e,"a",t)}function TT(e,t){V4(e,"da",t)}function V4(e,t,n=jo){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(lm(t,o,n),n){let s=n.parent;for(;s&&s.parent;)Pd(s.parent.vnode)&&NT(o,t,n,s),s=s.parent}}function NT(e,t,n,o){const s=lm(t,e,o,!0);wn(()=>{ny(o[t],s)},n)}function Y1(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function If(e){return e.shapeFlag&128?e.ssContent:e}function lm(e,t,n=jo,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Or();const l=eu(n),a=xi(t,n,e,r);return l(),Rr(),a});return o?s.unshift(i):s.push(i),i}}const Hr=e=>(t,n=jo)=>{(!Sa||e==="sp")&&lm(e,(...o)=>t(...o),n)},IT=Hr("bm"),cn=Hr("m"),K4=Hr("bu"),fy=Hr("u"),co=Hr("bum"),wn=Hr("um"),LT=Hr("sp"),$T=Hr("rtg"),FT=Hr("rtc");function OT(e,t=jo){lm("ec",e,t)}const hy="components",RT="directives";function BT(e,t){return py(hy,e,!0,t)||e}const G4=Symbol.for("v-ndc");function qo(e){return En(e)?py(hy,e,!1)||e:e||G4}function fwe(e){return py(RT,e)}function py(e,t,n=!0,o=!1){const s=Vo||jo;if(s){const i=s.type;if(e===hy){const l=Og(i,!1);if(l&&(l===t||l===No(t)||l===Zp(No(t))))return i}const r=Wb(s[e]||i[e],t)||Wb(s.appContext[e],t);return!r&&o?i:r}}function Wb(e,t){return e&&(e[t]||e[No(t)]||e[Zp(No(t))])}function nt(e,t,n,o){let s;const i=n&&n[o],r=xt(e);if(r||En(e)){const l=r&&bl(e);let a=!1,c=!1;l&&(a=!Gs(e),c=Br(e),e=tm(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?zc(Ri(e[u])):Ri(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,i&&i[l])}else if(an(e))if(e[Symbol.iterator])s=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];s[a]=t(e[u],u,a,i&&i[a])}}else s=[];return n&&(n[o]=s),s}function Y4(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(xt(o))for(let s=0;s<o.length;s++)e[o[s].name]=o[s].fn;else o&&(e[o.name]=o.key?(...s)=>{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function Fn(e,t,n={},o,s){if(Vo.ce||Vo.parent&&Lr(Vo.parent)&&Vo.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),be(Pe,null,[re("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),x();const r=i&&my(i(n)),l=n.key||r&&r.key,a=be(Pe,{key:(l&&!ei(l)?l:`_${t}`)+(!r&&o?"_fb":"")},r||(o?o():[]),r&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function my(e){return e.some(t=>Ml(t)?!(t.type===yo||t.type===Pe&&!my(t.children)):!0)?e:null}function hwe(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:ch(o)]=e[o];return n}const Mg=e=>e?b3(e)?Wd(e):Mg(e.parent):null,Ku=xn(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Mg(e.parent),$root:e=>Mg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>gy(e),$forceUpdate:e=>e.f||(e.f=()=>{cy(e.update)}),$nextTick:e=>e.n||(e.n=mt.bind(e.proxy)),$watch:e=>hT.bind(e)}),Z1=(e,t)=>e!==Gt&&!e.__isScriptSetup&&ln(e,t),Eg={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(Z1(o,t))return r[t]=1,o[t];if(s!==Gt&&ln(s,t))return r[t]=2,s[t];if(ln(i,t))return r[t]=3,i[t];if(n!==Gt&&ln(n,t))return r[t]=4,n[t];Tg&&(r[t]=0)}}const c=Ku[t];let u,d;if(c)return t==="$attrs"&&ss(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Gt&&ln(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,ln(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return Z1(s,t)?(s[t]=n,!0):o!==Gt&&ln(o,t)?(o[t]=n,!0):ln(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:i,type:r}},l){let a;return!!(n[l]||e!==Gt&&l[0]!=="$"&&ln(e,l)||Z1(t,l)||ln(i,l)||ln(o,l)||ln(Ku,l)||ln(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ln(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},DT=xn({},Eg,{get(e,t){if(t!==Symbol.unscopables)return Eg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!kE(t)}});function pwe(){return null}function mwe(){return null}function gwe(e){}function vwe(e){}function ywe(){return null}function kwe(){}function bwe(e,t){return null}function xwe(){return Z4().slots}function Hd(){return Z4().attrs}function Z4(e){const t=Go();return t.setupContext||(t.setupContext=_3(t))}function md(e){return xt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function wwe(e,t){const n=md(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?xt(s)||It(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function _we(e,t){return!e||!t?e||t:xt(e)&&xt(t)?e.concat(t):xn({},md(e),md(t))}function Swe(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function Cwe(e){const t=Go(),n=Sa;let o=e();vd(),n&&Ic(!1);const s=()=>{eu(t),n&&Ic(!0)},i=()=>{Go()!==t&&t.scope.off(),vd(),n&&Ic(!1)};return oy(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Tg=!0;function PT(e){const t=gy(e),n=e.proxy,o=e.ctx;Tg=!1,t.beforeCreate&&zb(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:g,deactivated:b,beforeDestroy:v,beforeUnmount:m,destroyed:y,unmounted:k,render:A,renderTracked:$,renderTriggered:L,errorCaptured:w,serverPrefetch:E,expose:T,inheritAttrs:F,components:S,directives:I,filters:P}=t;if(c&&HT(c,o,null),r)for(const z in r){const D=r[z];It(D)&&(o[z]=D.bind(n))}if(s){const z=s.call(n,n);an(z)&&(e.data=Oo(z))}if(Tg=!0,i)for(const z in i){const D=i[z],q=It(D)?D.bind(n,n):It(D.get)?D.get.bind(n,n):yi,j=!It(D)&&It(D.set)?D.set.bind(n):yi,ie=R({get:q,set:j});Object.defineProperty(o,z,{enumerable:!0,configurable:!0,get:()=>ie.value,set:ue=>ie.value=ue})}if(l)for(const z in l)X4(l[z],o,n,z);if(a){const z=It(a)?a.call(n):a;Reflect.ownKeys(z).forEach(D=>{In(D,z[D])})}u&&zb(u,e,"c");function W(z,D){xt(D)?D.forEach(q=>z(q.bind(n))):D&&z(D.bind(n))}if(W(IT,d),W(cn,f),W(K4,h),W(fy,p),W(ET,g),W(TT,b),W(OT,w),W(FT,$),W($T,L),W(co,m),W(wn,k),W(LT,E),xt(T))if(T.length){const z=e.exposed||(e.exposed={});T.forEach(D=>{Object.defineProperty(z,D,{get:()=>n[D],set:q=>n[D]=q,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===yi&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),I&&(e.directives=I),E&&dy(e)}function HT(e,t,n=yi){xt(e)&&(e=Ng(e));for(const o in e){const s=e[o];let i;an(s)?"default"in s?i=Ut(s.from||o,s.default,!0):i=Ut(s.from||o):i=Ut(s),ao(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function zb(e,t,n){xi(xt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function X4(e,t,n,o){let s=o.includes(".")?D4(n,o):()=>n[o];if(En(e)){const i=t[e];It(i)&&Qe(s,i)}else if(It(e))Qe(s,e.bind(n));else if(an(e))if(xt(e))e.forEach(i=>X4(i,t,n,o));else{const i=It(e.handler)?e.handler.bind(n):t[e.handler];It(i)&&Qe(s,i,e)}}function gy(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>Wh(a,c,r,!0)),Wh(a,t,r)),an(t)&&i.set(t,a),a}function Wh(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&Wh(e,i,n,!0),s&&s.forEach(r=>Wh(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=WT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const WT={data:Ub,props:qb,emits:qb,methods:Bu,computed:Bu,beforeCreate:as,created:as,beforeMount:as,mounted:as,beforeUpdate:as,updated:as,beforeDestroy:as,beforeUnmount:as,destroyed:as,unmounted:as,activated:as,deactivated:as,errorCaptured:as,serverPrefetch:as,components:Bu,directives:Bu,watch:UT,provide:Ub,inject:zT};function Ub(e,t){return t?e?function(){return xn(It(e)?e.call(this,this):e,It(t)?t.call(this,this):t)}:t:e}function zT(e,t){return Bu(Ng(e),Ng(t))}function Ng(e){if(xt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function as(e,t){return e?[...new Set([].concat(e,t))]:t}function Bu(e,t){return e?xn(Object.create(null),e,t):t}function qb(e,t){return e?xt(e)&&xt(t)?[...new Set([...e,...t])]:xn(Object.create(null),md(e),md(t??{})):t}function UT(e,t){if(!e)return t;if(!t)return e;const n=xn(Object.create(null),e);for(const o in t)n[o]=as(e[o],t[o]);return n}function Q4(){return{app:null,config:{isNativeTag:l4,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let qT=0;function jT(e,t){return function(o,s=null){It(o)||(o=xn({},o)),s!=null&&!an(s)&&(s=null);const i=Q4(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:qT++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:x9,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&It(u.install)?(r.add(u),u.install(c,...d)):It(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const h=c._ceVNode||re(o,s);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(h,u):e(h,u,f),a=!0,c._container=u,u.__vue_app__=c,Wd(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(xi(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=ka;ka=c;try{return u()}finally{ka=d}}};return c}}let ka=null;function Awe(e,t,n=Gt){const o=Go(),s=No(t),i=Es(t),r=J4(e,s),l=XE((a,c)=>{let u,d=Gt,f;return fT(()=>{const h=e[s];Uo(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!Uo(p,u)&&!(d!==Gt&&Uo(h,d)))return;const g=o.vnode.props;g&&(t in g||s in g||i in g)&&(`onUpdate:${t}`in g||`onUpdate:${s}`in g||`onUpdate:${i}`in g)||(u=h,c()),o.emit(`update:${t}`,p),Uo(h,p)&&Uo(h,d)&&!Uo(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Gt:l,done:!1}:{done:!0}}}},l}const J4=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${No(t)}Modifiers`]||e[`${Es(t)}Modifiers`];function VT(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Gt;let s=n;const i=t.startsWith("update:"),r=i&&J4(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>En(u)?u.trim():u)),r.number&&(s=n.map(Xp)));let l,a=o[l=ch(t)]||o[l=ch(No(t))];!a&&i&&(a=o[l=ch(Es(t))]),a&&xi(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,xi(c,e,6,s)}}const KT=new WeakMap;function e3(e,t,n=!1){const o=n?KT:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!It(e)){const a=c=>{const u=e3(c,t,!0);u&&(l=!0,xn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(an(e)&&o.set(e,null),null):(xt(i)?i.forEach(a=>r[a]=null):xn(r,i),an(e)&&o.set(e,r),r)}function am(e,t){return!e||!Rd(t)?!1:(t=t.slice(2).replace(/Once$/,""),ln(e,t[0].toLowerCase()+t.slice(1))||ln(e,Es(t))||ln(e,t))}function uh(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:g}=e,b=hd(e);let v,m;try{if(n.shapeFlag&4){const k=s||o,A=k;v=Ms(c.call(A,k,u,d,h,f,p)),m=l}else{const k=t;v=Ms(k.length>1?k(d,{attrs:l,slots:r,emit:a}):k(d,null)),m=t.props?l:YT(l)}}catch(k){Gu.length=0,Jc(k,e,1),v=re(yo)}let y=v;if(m&&g!==!1){const k=Object.keys(m),{shapeFlag:A}=y;k.length&&A&7&&(i&&k.some(Vp)&&(m=ZT(m,i)),y=Dr(y,m,!1,!0))}return n.dirs&&(y=Dr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Al(y,n.transition),v=y,hd(b),v}function GT(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Ml(s)){if(s.type!==yo||s.children==="v-if"){if(n)return;n=s}}else return}return n}const YT=e=>{let t;for(const n in e)(n==="class"||n==="style"||Rd(n))&&((t||(t={}))[n]=e[n]);return t},ZT=(e,t)=>{const n={};for(const o in e)(!Vp(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function XT(e,t,n){const{props:o,children:s,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return o?jb(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(t3(r,o,f)&&!am(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?jb(o,r,c):!0:!!r;return!1}function jb(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(t3(t,e,i)&&!am(n,i))return!0}return!1}function t3(e,t,n){const o=e[n],s=t[n];return n==="style"&&an(o)&&an(s)?!Fr(o,s):o!==s}function cm({vnode:e,parent:t,suspense:n},o){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const n3={},o3=()=>Object.create(n3),s3=e=>Object.getPrototypeOf(e)===n3;function QT(e,t,n,o=!1){const s={},i=o3();e.propsDefaults=Object.create(null),i3(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:KE(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function JT(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=en(s),[a]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(am(e.emitsOptions,f))continue;const h=t[f];if(a)if(ln(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=No(f);s[p]=Ig(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{i3(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!ln(t,d)&&((u=Es(d))===d||!ln(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=Ig(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!ln(t,d))&&(delete i[d],c=!0)}c&&Ar(e.attrs,"set","")}function i3(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(va(a))continue;const c=t[a];let u;s&&ln(s,u=No(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:am(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=en(n),c=l||Gt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Ig(s,a,d,c[d],e,!ln(c,d))}}return r}function Ig(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=ln(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&It(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=eu(s);o=c[n]=a.call(null,t),u()}}else o=a;s.ce&&s.ce._setProp(n,o)}r[0]&&(i&&!l?o=!1:r[1]&&(o===""||o===Es(n))&&(o=!0))}return o}const e9=new WeakMap;function r3(e,t,n=!1){const o=n?e9:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!It(e)){const u=d=>{a=!0;const[f,h]=r3(d,t,!0);xn(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return an(e)&&o.set(e,Sc),Sc;if(xt(i))for(let u=0;u<i.length;u++){const d=No(i[u]);Vb(d)&&(r[d]=Gt)}else if(i)for(const u in i){const d=No(u);if(Vb(d)){const f=i[u],h=r[d]=xt(f)||It(f)?{type:f}:xn({},f),p=h.type;let g=!1,b=!0;if(xt(p))for(let v=0;v<p.length;++v){const m=p[v],y=It(m)&&m.name;if(y==="Boolean"){g=!0;break}else y==="String"&&(b=!1)}else g=It(p)&&p.name==="Boolean";h[0]=g,h[1]=b,(g||ln(h,"default"))&&l.push(d)}}const c=[r,l];return an(e)&&o.set(e,c),c}function Vb(e){return e[0]!=="$"&&!va(e)}const vy=e=>e==="_"||e==="_ctx"||e==="$stable",yy=e=>xt(e)?e.map(Ms):[Ms(e)],t9=(e,t,n)=>{if(t._n)return t;const o=Ne((...s)=>yy(t(...s)),n);return o._c=!1,o},l3=(e,t,n)=>{const o=e._ctx;for(const s in e){if(vy(s))continue;const i=e[s];if(It(i))t[s]=t9(s,i,o);else if(i!=null){const r=yy(i);t[s]=()=>r}}},a3=(e,t)=>{const n=yy(t);e.slots.default=()=>n},c3=(e,t,n)=>{for(const o in t)(n||!vy(o))&&(e[o]=t[o])},n9=(e,t,n)=>{const o=e.slots=o3();if(e.vnode.shapeFlag&32){const s=t._;s?(c3(o,t,n),n&&c4(o,"_",s,!0)):l3(t,o)}else t&&a3(e,t)},o9=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=Gt;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:c3(s,t,n):(i=!t.$stable,l3(t,s)),r=t}else t&&(a3(e,t),r={default:1});if(i)for(const l in s)!vy(l)&&r[l]==null&&delete s[l]},mo=m3;function s9(e){return u3(e)}function i9(e){return u3(e,xT)}function u3(e,t){const n=Qp();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=yi,insertStaticContent:p}=e,g=(V,Q,ke,he=null,ye=null,K=null,J=void 0,me=null,Ee=!!Q.dynamicChildren)=>{if(V===Q)return;V&&!Ii(V,Q)&&(he=Me(V),ue(V,ye,K,!0),V=null),Q.patchFlag===-2&&(Ee=!1,Q.dynamicChildren=null);const{type:Fe,ref:De,shapeFlag:ge}=Q;switch(Fe){case xl:b(V,Q,ke,he);break;case yo:v(V,Q,ke,he);break;case Nc:V==null&&m(Q,ke,he,J);break;case Pe:S(V,Q,ke,he,ye,K,J,me,Ee);break;default:ge&1?A(V,Q,ke,he,ye,K,J,me,Ee):ge&6?I(V,Q,ke,he,ye,K,J,me,Ee):(ge&64||ge&128)&&Fe.process(V,Q,ke,he,ye,K,J,me,Ee,U)}De!=null&&ye?Ec(De,V&&V.ref,K,Q||V,!Q):De==null&&V&&V.ref!=null&&Ec(V.ref,null,K,V,!0)},b=(V,Q,ke,he)=>{if(V==null)o(Q.el=l(Q.children),ke,he);else{const ye=Q.el=V.el;Q.children!==V.children&&c(ye,Q.children)}},v=(V,Q,ke,he)=>{V==null?o(Q.el=a(Q.children||""),ke,he):Q.el=V.el},m=(V,Q,ke,he)=>{[V.el,V.anchor]=p(V.children,Q,ke,he,V.el,V.anchor)},y=({el:V,anchor:Q},ke,he)=>{let ye;for(;V&&V!==Q;)ye=f(V),o(V,ke,he),V=ye;o(Q,ke,he)},k=({el:V,anchor:Q})=>{let ke;for(;V&&V!==Q;)ke=f(V),s(V),V=ke;s(Q)},A=(V,Q,ke,he,ye,K,J,me,Ee)=>{if(Q.type==="svg"?J="svg":Q.type==="math"&&(J="mathml"),V==null)$(Q,ke,he,ye,K,J,me,Ee);else{const Fe=V.el&&V.el._isVueCE?V.el:null;try{Fe&&Fe._beginPatch(),E(V,Q,ye,K,J,me,Ee)}finally{Fe&&Fe._endPatch()}}},$=(V,Q,ke,he,ye,K,J,me)=>{let Ee,Fe;const{props:De,shapeFlag:ge,transition:Ie,dirs:Je}=V;if(Ee=V.el=r(V.type,K,De&&De.is,De),ge&8?u(Ee,V.children):ge&16&&w(V.children,Ee,null,he,ye,X1(V,K),J,me),Je&&Yi(V,null,he,"created"),L(Ee,V,V.scopeId,J,he),De){for(const St in De)St!=="value"&&!va(St)&&i(Ee,St,null,De[St],K,he);"value"in De&&i(Ee,"value",null,De.value,K),(Fe=De.onVnodeBeforeMount)&&Cs(Fe,he,V)}Je&&Yi(V,null,he,"beforeMount");const it=d3(ye,Ie);it&&Ie.beforeEnter(Ee),o(Ee,Q,ke),((Fe=De&&De.onVnodeMounted)||it||Je)&&mo(()=>{try{Fe&&Cs(Fe,he,V),it&&Ie.enter(Ee),Je&&Yi(V,null,he,"mounted")}finally{}},ye)},L=(V,Q,ke,he,ye)=>{if(ke&&h(V,ke),he)for(let K=0;K<he.length;K++)h(V,he[K]);if(ye){let K=ye.subTree;if(Q===K||Uh(K.type)&&(K.ssContent===Q||K.ssFallback===Q)){const J=ye.vnode;L(V,J,J.scopeId,J.slotScopeIds,ye.parent)}}},w=(V,Q,ke,he,ye,K,J,me,Ee=0)=>{for(let Fe=Ee;Fe<V.length;Fe++){const De=V[Fe]=me?Sr(V[Fe]):Ms(V[Fe]);g(null,De,Q,ke,he,ye,K,J,me)}},E=(V,Q,ke,he,ye,K,J)=>{const me=Q.el=V.el;let{patchFlag:Ee,dynamicChildren:Fe,dirs:De}=Q;Ee|=V.patchFlag&16;const ge=V.props||Gt,Ie=Q.props||Gt;let Je;if(ke&&Ql(ke,!1),(Je=Ie.onVnodeBeforeUpdate)&&Cs(Je,ke,Q,V),De&&Yi(Q,V,ke,"beforeUpdate"),ke&&Ql(ke,!0),(ge.innerHTML&&Ie.innerHTML==null||ge.textContent&&Ie.textContent==null)&&u(me,""),Fe?T(V.dynamicChildren,Fe,me,ke,he,X1(Q,ye),K):J||D(V,Q,me,null,ke,he,X1(Q,ye),K,!1),Ee>0){if(Ee&16)F(me,ge,Ie,ke,ye);else if(Ee&2&&ge.class!==Ie.class&&i(me,"class",null,Ie.class,ye),Ee&4&&i(me,"style",ge.style,Ie.style,ye),Ee&8){const it=Q.dynamicProps;for(let St=0;St<it.length;St++){const gt=it[St],Tt=ge[gt],Pt=Ie[gt];(Pt!==Tt||gt==="value")&&i(me,gt,Tt,Pt,ye,ke)}}Ee&1&&V.children!==Q.children&&u(me,Q.children)}else!J&&Fe==null&&F(me,ge,Ie,ke,ye);((Je=Ie.onVnodeUpdated)||De)&&mo(()=>{Je&&Cs(Je,ke,Q,V),De&&Yi(Q,V,ke,"updated")},he)},T=(V,Q,ke,he,ye,K,J)=>{for(let me=0;me<Q.length;me++){const Ee=V[me],Fe=Q[me],De=Ee.el&&(Ee.type===Pe||!Ii(Ee,Fe)||Ee.shapeFlag&198)?d(Ee.el):ke;g(Ee,Fe,De,null,he,ye,K,J,!0)}},F=(V,Q,ke,he,ye)=>{if(Q!==ke){if(Q!==Gt)for(const K in Q)!va(K)&&!(K in ke)&&i(V,K,Q[K],null,ye,he);for(const K in ke){if(va(K))continue;const J=ke[K],me=Q[K];J!==me&&K!=="value"&&i(V,K,me,J,ye,he)}"value"in ke&&i(V,"value",Q.value,ke.value,ye)}},S=(V,Q,ke,he,ye,K,J,me,Ee)=>{const Fe=Q.el=V?V.el:l(""),De=Q.anchor=V?V.anchor:l("");let{patchFlag:ge,dynamicChildren:Ie,slotScopeIds:Je}=Q;Je&&(me=me?me.concat(Je):Je),V==null?(o(Fe,ke,he),o(De,ke,he),w(Q.children||[],ke,De,ye,K,J,me,Ee)):ge>0&&ge&64&&Ie&&V.dynamicChildren&&V.dynamicChildren.length===Ie.length?(T(V.dynamicChildren,Ie,ke,ye,K,J,me),(Q.key!=null||ye&&Q===ye.subTree)&&ky(V,Q,!0)):D(V,Q,ke,De,ye,K,J,me,Ee)},I=(V,Q,ke,he,ye,K,J,me,Ee)=>{Q.slotScopeIds=me,V==null?Q.shapeFlag&512?ye.ctx.activate(Q,ke,he,J,Ee):P(Q,ke,he,ye,K,J,Ee):B(V,Q,Ee)},P=(V,Q,ke,he,ye,K,J)=>{const me=V.component=k3(V,he,ye);if(Pd(V)&&(me.ctx.renderer=U),x3(me,!1,J),me.asyncDep){if(ye&&ye.registerDep(me,W,J),!V.el){const Ee=me.subTree=re(yo);v(null,Ee,Q,ke),V.placeholder=Ee.el}}else W(me,V,Q,ke,ye,K,J)},B=(V,Q,ke)=>{const he=Q.component=V.component;if(XT(V,Q,ke))if(he.asyncDep&&!he.asyncResolved){z(he,Q,ke);return}else he.next=Q,he.update();else Q.el=V.el,he.vnode=Q},W=(V,Q,ke,he,ye,K,J)=>{const me=()=>{if(V.isMounted){let{next:ge,bu:Ie,u:Je,parent:it,vnode:St}=V;{const gn=f3(V);if(gn){ge&&(ge.el=St.el,z(V,ge,J)),gn.asyncDep.then(()=>{mo(()=>{V.isUnmounted||Fe()},ye)});return}}let gt=ge,Tt;Ql(V,!1),ge?(ge.el=St.el,z(V,ge,J)):ge=St,Ie&&Ac(Ie),(Tt=ge.props&&ge.props.onVnodeBeforeUpdate)&&Cs(Tt,it,ge,St),Ql(V,!0);const Pt=uh(V),ft=V.subTree;V.subTree=Pt,g(ft,Pt,d(ft.el),Me(ft),V,ye,K),ge.el=Pt.el,gt===null&&cm(V,Pt.el),Je&&mo(Je,ye),(Tt=ge.props&&ge.props.onVnodeUpdated)&&mo(()=>Cs(Tt,it,ge,St),ye)}else{let ge;const{el:Ie,props:Je}=Q,{bm:it,m:St,parent:gt,root:Tt,type:Pt}=V,ft=Lr(Q);if(Ql(V,!1),it&&Ac(it),!ft&&(ge=Je&&Je.onVnodeBeforeMount)&&Cs(ge,gt,Q),Ql(V,!0),Ie&&se){const gn=()=>{V.subTree=uh(V),se(Ie,V.subTree,V,ye,null)};ft&&Pt.__asyncHydrate?Pt.__asyncHydrate(Ie,V,gn):gn()}else{Tt.ce&&Tt.ce._hasShadowRoot()&&Tt.ce._injectChildStyle(Pt,V.parent?V.parent.type:void 0);const gn=V.subTree=uh(V);g(null,gn,ke,he,V,ye,K),Q.el=gn.el}if(St&&mo(St,ye),!ft&&(ge=Je&&Je.onVnodeMounted)){const gn=Q;mo(()=>Cs(ge,gt,gn),ye)}(Q.shapeFlag&256||gt&&Lr(gt.vnode)&&gt.vnode.shapeFlag&256)&&V.a&&mo(V.a,ye),V.isMounted=!0,Q=ke=he=null}};V.scope.on();const Ee=V.effect=new $h(me);V.scope.off();const Fe=V.update=Ee.run.bind(Ee),De=V.job=Ee.runIfDirty.bind(Ee);De.i=V,De.id=V.uid,Ee.scheduler=()=>cy(De),Ql(V,!0),Fe()},z=(V,Q,ke)=>{Q.component=V;const he=V.vnode.props;V.vnode=Q,V.next=null,JT(V,Q.props,he,ke),o9(V,Q.children,ke),Or(),$b(V),Rr()},D=(V,Q,ke,he,ye,K,J,me,Ee=!1)=>{const Fe=V&&V.children,De=V?V.shapeFlag:0,ge=Q.children,{patchFlag:Ie,shapeFlag:Je}=Q;if(Ie>0){if(Ie&128){j(Fe,ge,ke,he,ye,K,J,me,Ee);return}else if(Ie&256){q(Fe,ge,ke,he,ye,K,J,me,Ee);return}}Je&8?(De&16&&fe(Fe,ye,K),ge!==Fe&&u(ke,ge)):De&16?Je&16?j(Fe,ge,ke,he,ye,K,J,me,Ee):fe(Fe,ye,K,!0):(De&8&&u(ke,""),Je&16&&w(ge,ke,he,ye,K,J,me,Ee))},q=(V,Q,ke,he,ye,K,J,me,Ee)=>{V=V||Sc,Q=Q||Sc;const Fe=V.length,De=Q.length,ge=Math.min(Fe,De);let Ie;for(Ie=0;Ie<ge;Ie++){const Je=Q[Ie]=Ee?Sr(Q[Ie]):Ms(Q[Ie]);g(V[Ie],Je,ke,null,ye,K,J,me,Ee)}Fe>De?fe(V,ye,K,!0,!1,ge):w(Q,ke,he,ye,K,J,me,Ee,ge)},j=(V,Q,ke,he,ye,K,J,me,Ee)=>{let Fe=0;const De=Q.length;let ge=V.length-1,Ie=De-1;for(;Fe<=ge&&Fe<=Ie;){const Je=V[Fe],it=Q[Fe]=Ee?Sr(Q[Fe]):Ms(Q[Fe]);if(Ii(Je,it))g(Je,it,ke,null,ye,K,J,me,Ee);else break;Fe++}for(;Fe<=ge&&Fe<=Ie;){const Je=V[ge],it=Q[Ie]=Ee?Sr(Q[Ie]):Ms(Q[Ie]);if(Ii(Je,it))g(Je,it,ke,null,ye,K,J,me,Ee);else break;ge--,Ie--}if(Fe>ge){if(Fe<=Ie){const Je=Ie+1,it=Je<De?Q[Je].el:he;for(;Fe<=Ie;)g(null,Q[Fe]=Ee?Sr(Q[Fe]):Ms(Q[Fe]),ke,it,ye,K,J,me,Ee),Fe++}}else if(Fe>Ie)for(;Fe<=ge;)ue(V[Fe],ye,K,!0),Fe++;else{const Je=Fe,it=Fe,St=new Map;for(Fe=it;Fe<=Ie;Fe++){const jt=Q[Fe]=Ee?Sr(Q[Fe]):Ms(Q[Fe]);jt.key!=null&&St.set(jt.key,Fe)}let gt,Tt=0;const Pt=Ie-it+1;let ft=!1,gn=0;const sn=new Array(Pt);for(Fe=0;Fe<Pt;Fe++)sn[Fe]=0;for(Fe=Je;Fe<=ge;Fe++){const jt=V[Fe];if(Tt>=Pt){ue(jt,ye,K,!0);continue}let vn;if(jt.key!=null)vn=St.get(jt.key);else for(gt=it;gt<=Ie;gt++)if(sn[gt-it]===0&&Ii(jt,Q[gt])){vn=gt;break}vn===void 0?ue(jt,ye,K,!0):(sn[vn-it]=Fe+1,vn>=gn?gn=vn:ft=!0,g(jt,Q[vn],ke,null,ye,K,J,me,Ee),Tt++)}const Yo=ft?r9(sn):Sc;for(gt=Yo.length-1,Fe=Pt-1;Fe>=0;Fe--){const jt=it+Fe,vn=Q[jt],fo=Q[jt+1],st=jt+1<De?fo.el||h3(fo):he;sn[Fe]===0?g(null,vn,ke,st,ye,K,J,me,Ee):ft&&(gt<0||Fe!==Yo[gt]?ie(vn,ke,st,2):gt--)}}},ie=(V,Q,ke,he,ye=null)=>{const{el:K,type:J,transition:me,children:Ee,shapeFlag:Fe}=V;if(Fe&6){ie(V.component.subTree,Q,ke,he);return}if(Fe&128){V.suspense.move(Q,ke,he);return}if(Fe&64){J.move(V,Q,ke,U);return}if(J===Pe){o(K,Q,ke);for(let ge=0;ge<Ee.length;ge++)ie(Ee[ge],Q,ke,he);o(V.anchor,Q,ke);return}if(J===Nc){y(V,Q,ke);return}if(he!==2&&Fe&1&&me)if(he===0)me.persisted&&!K[fi]?o(K,Q,ke):(me.beforeEnter(K),o(K,Q,ke),mo(()=>me.enter(K),ye));else{const{leave:ge,delayLeave:Ie,afterLeave:Je}=me,it=()=>{V.ctx.isUnmounted?s(K):o(K,Q,ke)},St=()=>{const gt=K._isLeaving||!!K[fi];K._isLeaving&&K[fi](!0),me.persisted&&!gt?it():ge(K,()=>{it(),Je&&Je()})};Ie?Ie(K,it,St):St()}else o(K,Q,ke)},ue=(V,Q,ke,he=!1,ye=!1)=>{const{type:K,props:J,ref:me,children:Ee,dynamicChildren:Fe,shapeFlag:De,patchFlag:ge,dirs:Ie,cacheIndex:Je,memo:it}=V;if(ge===-2&&(ye=!1),me!=null&&(Or(),Ec(me,null,ke,V,!0),Rr()),Je!=null&&(Q.renderCache[Je]=void 0),De&256){Q.ctx.deactivate(V);return}const St=De&1&&Ie,gt=!Lr(V);let Tt;if(gt&&(Tt=J&&J.onVnodeBeforeUnmount)&&Cs(Tt,Q,V),De&6)ne(V.component,ke,he);else{if(De&128){V.suspense.unmount(ke,he);return}St&&Yi(V,null,Q,"beforeUnmount"),De&64?V.type.remove(V,Q,ke,U,he):Fe&&!Fe.hasOnce&&(K!==Pe||ge>0&&ge&64)?fe(Fe,Q,ke,!1,!0):(K===Pe&&ge&384||!ye&&De&16)&&fe(Ee,Q,ke),he&&pe(V)}const Pt=it!=null&&Je==null;(gt&&(Tt=J&&J.onVnodeUnmounted)||St||Pt)&&mo(()=>{Tt&&Cs(Tt,Q,V),St&&Yi(V,null,Q,"unmounted"),Pt&&(V.el=null)},ke)},pe=V=>{const{type:Q,el:ke,anchor:he,transition:ye}=V;if(Q===Pe){ee(ke,he);return}if(Q===Nc){k(V);return}const K=()=>{s(ke),ye&&!ye.persisted&&ye.afterLeave&&ye.afterLeave()};if(V.shapeFlag&1&&ye&&!ye.persisted){const{leave:J,delayLeave:me}=ye,Ee=()=>J(ke,K);me?me(V.el,K,Ee):Ee()}else K()},ee=(V,Q)=>{let ke;for(;V!==Q;)ke=f(V),s(V),V=ke;s(Q)},ne=(V,Q,ke)=>{const{bum:he,scope:ye,job:K,subTree:J,um:me,m:Ee,a:Fe}=V;zh(Ee),zh(Fe),he&&Ac(he),ye.stop(),K&&(K.flags|=8,ue(J,V,Q,ke)),me&&mo(me,Q),mo(()=>{V.isUnmounted=!0},Q)},fe=(V,Q,ke,he=!1,ye=!1,K=0)=>{for(let J=K;J<V.length;J++)ue(V[J],Q,ke,he,ye)},Me=V=>{if(V.shapeFlag&6)return Me(V.component.subTree);if(V.shapeFlag&128)return V.suspense.next();const Q=f(V.anchor||V.el),ke=Q&&Q[P4];return ke?f(ke):Q};let $e=!1;const ae=(V,Q,ke)=>{let he;V==null?Q._vnode&&(ue(Q._vnode,null,null,!0),he=Q._vnode.component):g(Q._vnode||null,V,Q,null,null,null,ke),Q._vnode=V,$e||($e=!0,$b(he),Ph(),$e=!1)},U={p:g,um:ue,m:ie,r:pe,mt:P,mc:w,pc:D,pbc:T,n:Me,o:e};let ce,se;return t&&([ce,se]=t(U)),{render:ae,hydrate:ce,createApp:jT(ae,ce)}}function X1({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Ql({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function d3(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ky(e,t,n=!1){const o=e.children,s=t.children;if(xt(o)&&xt(s))for(let i=0;i<o.length;i++){const r=o[i];let l=s[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[i]=Sr(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&ky(r,l)),l.type===xl&&(l.patchFlag===-1&&(l=s[i]=Sr(l)),l.el=r.el),l.type===yo&&!l.el&&(l.el=r.el)}}function r9(e){const t=e.slice(),n=[0];let o,s,i,r,l;const a=e.length;for(o=0;o<a;o++){const c=e[o];if(c!==0){if(s=n[n.length-1],e[s]<c){t[o]=s,n.push(o);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function f3(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:f3(t)}function zh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function h3(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?h3(t.subTree):null}const Uh=e=>e.__isSuspense;let Lg=0;const l9={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)a9(t,n,o,s,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}c9(e,t,n,o,s,r,l,a,c)}},hydrate:u9,normalize:d9},Mwe=l9;function gd(e,t){const n=e.props&&e.props[t];It(n)&&n()}function a9(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=p3(e,s,o,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,o,f,i,r),f.deps>0?(gd(e,"onPending"),gd(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),Tc(f,e.ssFallback)):f.resolve(!1,!0)}function c9(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:g,isInFallback:b,isHydrating:v}=d;if(g)d.pendingBranch=f,Ii(g,f)?(a(g,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():b&&(v||(a(p,h,n,o,s,null,i,r,l),Tc(d,h)))):(d.pendingId=Lg++,v?(d.isHydrating=!1,d.activeBranch=g):c(g,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),b?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,o,s,null,i,r,l),Tc(d,h))):p&&Ii(p,f)?(a(p,f,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&Ii(p,f))a(p,f,n,o,s,d,i,r,l),Tc(d,f);else if(gd(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Lg++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:m,pendingId:y}=d;m>0?setTimeout(()=>{d.pendingId===y&&d.fallback(h)},m):m===0&&d.fallback(h)}}function p3(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:g,remove:b}}=c;let v;const m=f9(e);m&&t&&t.pendingBranch&&(v=t.pendingId,t.deps++);const y=e.props?Lh(e.props.timeout):void 0,k=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:Lg++,timeout:typeof y=="number"?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve($=!1,L=!1){const{vnode:w,activeBranch:E,pendingBranch:T,pendingId:F,effects:S,parentComponent:I,container:P,isInFallback:B}=A;let W=!1;if(A.isHydrating)A.isHydrating=!1;else if(!$){W=E&&T.transition&&T.transition.mode==="out-in";let q=!1;W&&(E.transition.afterLeave=()=>{F===A.pendingId&&(f(T,P,i===k&&!q?p(E):i,0),Dh(S),B&&w.ssFallback&&(w.ssFallback.el=null))}),E&&!A.isFallbackMountPending&&(g(E.el)===P&&(i=p(E),q=!0),h(E,I,A,!0),!W&&B&&w.ssFallback&&mo(()=>w.ssFallback.el=null,A)),W||f(T,P,i,0)}A.isFallbackMountPending=!1,Tc(A,T),A.pendingBranch=null,A.isInFallback=!1;let z=A.parent,D=!1;for(;z;){if(z.pendingBranch){z.effects.push(...S),D=!0;break}z=z.parent}!D&&!W&&Dh(S),A.effects=[],m&&t&&t.pendingBranch&&v===t.pendingId&&(t.deps--,t.deps===0&&!L&&t.resolve()),gd(w,"onResolve")},fallback($){if(!A.pendingBranch)return;const{vnode:L,activeBranch:w,parentComponent:E,container:T,namespace:F}=A;gd(L,"onFallback");const S=p(w),I=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,$,T,S,E,null,F,l,a),Tc(A,$))},P=$.transition&&$.transition.mode==="out-in";P&&(A.isFallbackMountPending=!0,w.transition.afterLeave=I),A.isInFallback=!0,h(w,E,null,!0),P||I()},move($,L,w){A.activeBranch&&f(A.activeBranch,$,L,w),A.container=$},next(){return A.activeBranch&&p(A.activeBranch)},registerDep($,L,w){const E=!!A.pendingBranch;E&&A.deps++;const T=$.vnode.el;$.asyncDep.catch(F=>{Jc(F,$,0)}).then(F=>{if($.isUnmounted||A.isUnmounted||A.pendingId!==$.suspenseId)return;vd(),$.asyncResolved=!0;const{vnode:S}=$;$g($,F,!1),T&&(S.el=T);const I=!T&&$.subTree.el;L($,S,g(T||$.subTree.el),T?null:p($.subTree),A,r,w),I&&(S.placeholder=null,b(I)),cm($,S.el),E&&--A.deps===0&&A.resolve()})},unmount($,L){A.isUnmounted=!0,A.activeBranch&&h(A.activeBranch,n,$,L),A.pendingBranch&&h(A.pendingBranch,n,$,L)}};return A}function u9(e,t,n,o,s,i,r,l,a){const c=t.suspense=p3(t,o,n,e.parentNode,document.createElement("div"),null,s,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function d9(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=Kb(o?n.default:n),e.ssFallback=o?Kb(n.fallback):re(yo)}function Kb(e){let t;if(It(e)){const n=_a&&e._c;n&&(e._d=!1,x()),e=e(),n&&(e._d=!0,t=is,g3())}return xt(e)&&(e=GT(e)),e=Ms(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function m3(e,t){t&&t.pendingBranch?xt(e)?t.effects.push(...e):t.effects.push(e):Dh(e)}function Tc(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,cm(o,s))}function f9(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),xl=Symbol.for("v-txt"),yo=Symbol.for("v-cmt"),Nc=Symbol.for("v-stc"),Gu=[];let is=null;function x(e=!1){Gu.push(is=e?null:[])}function g3(){Gu.pop(),is=Gu[Gu.length-1]||null}let _a=1;function qh(e,t=!1){_a+=e,e<0&&is&&t&&(is.hasOnce=!0)}function v3(e){return e.dynamicChildren=_a>0?is||Sc:null,g3(),_a>0&&is&&is.push(e),e}function N(e,t,n,o,s,i){return v3(_(e,t,n,o,s,i,!0))}function be(e,t,n,o,s){return v3(re(e,t,n,o,s,!0))}function Ml(e){return e?e.__v_isVNode===!0:!1}function Ii(e,t){return e.type===t.type&&e.key===t.key}function Ewe(e){}const y3=({key:e})=>e??null,dh=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?En(e)||ao(e)||It(e)?{i:Vo,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,o=0,s=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&y3(t),ref:t&&dh(t),scopeId:im,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Vo};return l?(xy(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=En(n)?8:16),_a>0&&!r&&is&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&is.push(a),a}const re=h9;function h9(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===G4)&&(e=yo),Ml(e)){const l=Dr(e,t,!0);return n&&xy(l,n),_a>0&&!i&&is&&(l.shapeFlag&6?is[is.indexOf(e)]=l:is.push(l)),l.patchFlag=-2,l}if(k9(e)&&(e=e.__vccOpts),t){t=p9(t);let{class:l,style:a}=t;l&&!En(l)&&(t.class=We(l)),an(a)&&(sm(a)&&!xt(a)&&(a=xn({},a)),t.style=qt(a))}const r=En(e)?1:Uh(e)?128:H4(e)?64:an(e)?4:It(e)?2:0;return _(e,t,n,o,s,r,i,!0)}function p9(e){return e?sm(e)||s3(e)?xn({},e):e:null}function Dr(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?bn(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&y3(c),ref:t&&t.ref?n&&i?xt(i)?i.concat(dh(t)):[i,dh(t)]:dh(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Pe?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Dr(e.ssContent),ssFallback:e.ssFallback&&Dr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Al(u,a.clone(u)),u}function Xe(e=" ",t=0){return re(xl,null,e,t)}function by(e,t){const n=re(Nc,null,e);return n.staticCount=t,n}function le(e="",t=!1){return t?(x(),be(yo,null,e)):re(yo,null,e)}function Ms(e){return e==null||typeof e=="boolean"?re(yo):xt(e)?re(Pe,null,e.slice()):Ml(e)?Sr(e):re(xl,null,String(e))}function Sr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Dr(e)}function xy(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(xt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),xy(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!s3(t)?t._ctx=Vo:s===3&&Vo&&(Vo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else It(t)?(t={default:t,_ctx:Vo},n=32):(t=String(t),o&64?(n=16,t=[Xe(t)]):n=8);e.children=t,e.shapeFlag|=n}function bn(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=We([t.class,o.class]));else if(s==="style")t.style=qt([t.style,o.style]);else if(Rd(s)){const i=t[s],r=o[s];r&&i!==r&&!(xt(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!Vp(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Cs(e,t,n,o=null){xi(e,t,7,[n,o])}const m9=Q4();let g9=0;function k3(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||m9,i={uid:g9++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new h4(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:r3(o,s),emitsOptions:e3(o,s),emit:null,emitted:null,propsDefaults:Gt,inheritAttrs:o.inheritAttrs,ctx:Gt,data:Gt,props:Gt,attrs:Gt,slots:Gt,refs:Gt,setupState:Gt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=VT.bind(null,i),e.ce&&e.ce(i),i}let jo=null;const Go=()=>jo||Vo;let jh,Ic;{const e=Qp(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};jh=t("__VUE_INSTANCE_SETTERS__",n=>jo=n),Ic=t("__VUE_SSR_SETTERS__",n=>Sa=n)}const eu=e=>{const t=jo;return jh(e),e.scope.on(),()=>{e.scope.off(),jh(t)}},vd=()=>{jo&&jo.scope.off(),jh(null)};function b3(e){return e.vnode.shapeFlag&4}let Sa=!1;function x3(e,t=!1,n=!1){t&&Ic(t);const{props:o,children:s}=e.vnode,i=b3(e);QT(e,o,i,t),n9(e,s,n||t);const r=i?v9(e,t):void 0;return t&&Ic(!1),r}function v9(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Eg);const{setup:o}=n;if(o){Or();const s=e.setupContext=o.length>1?_3(e):null,i=eu(e),r=Bd(o,e,0,[e.props,s]),l=oy(r);if(Rr(),i(),(l||e.sp)&&!Lr(e)&&dy(e),l){if(r.then(vd,vd),t)return r.then(a=>{$g(e,a,t)}).catch(a=>{Jc(a,e,0)});e.asyncDep=r}else $g(e,r,t)}else w3(e,t)}function $g(e,t,n){It(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:an(t)&&(e.setupState=I4(t)),w3(e,n)}let Vh,Fg;function Twe(e){Vh=e,Fg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,DT))}}const Nwe=()=>!Vh;function w3(e,t,n){const o=e.type;if(!e.render){if(!t&&Vh&&!o.render){const s=o.template||gy(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=xn(xn({isCustomElement:i,delimiters:l},r),a);o.render=Vh(s,c)}}e.render=o.render||yi,Fg&&Fg(e)}{const s=eu(e);Or();try{PT(e)}finally{Rr(),s()}}}const y9={get(e,t){return ss(e,"get",""),e[t]}};function _3(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,y9),slots:e.slots,emit:e.emit,expose:t}}function Wd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(I4(pt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ku)return Ku[n](e)},has(t,n){return n in t||n in Ku}})):e.proxy}function Og(e,t=!0){return It(e)?e.displayName||e.name:e.name||t&&e.__name}function k9(e){return It(e)&&"__vccOpts"in e}const R=(e,t)=>tT(e,t,Sa);function pn(e,t,n){try{qh(-1);const o=arguments.length;return o===2?an(t)&&!xt(t)?Ml(t)?re(e,null,[t]):re(e,t):re(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Ml(n)&&(n=[n]),re(e,t,n))}finally{qh(1)}}function Iwe(){}function Lwe(e,t,n,o){const s=n[o];if(s&&b9(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function b9(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(Uo(n[o],t[o]))return!1;return _a>0&&is&&is.push(e),!0}const x9="3.5.35",$we=yi,Fwe=rT,Owe=cc,Rwe=B4,w9={createComponentInstance:k3,setupComponent:x3,renderComponentRoot:uh,setCurrentRenderingInstance:hd,isVNode:Ml,normalizeVNode:Ms,getComponentPublicInstance:Wd,ensureValidVNode:my,pushWarningContext:sT,popWarningContext:iT},Bwe=w9,Dwe=null,Pwe=null,Hwe=null;/**
17
- * @vue/runtime-dom v3.5.35
18
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
- * @license MIT
20
- **/let Rg;const Gb=typeof window<"u"&&window.trustedTypes;if(Gb)try{Rg=Gb.createPolicy("vue",{createHTML:e=>e})}catch{}const S3=Rg?e=>Rg.createHTML(e):e=>e,_9="http://www.w3.org/2000/svg",S9="http://www.w3.org/1998/Math/MathML",kr=typeof document<"u"?document:null,Yb=kr&&kr.createElement("template"),C9={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?kr.createElementNS(_9,e):t==="mathml"?kr.createElementNS(S9,e):n?kr.createElement(e,{is:n}):kr.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>kr.createTextNode(e),createComment:e=>kr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>kr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{Yb.innerHTML=S3(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Yb.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Qr="transition",Au="animation",Uc=Symbol("_vtc"),C3={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},A3=xn({},z4,C3),A9=e=>(e.displayName="Transition",e.props=A3,e),El=A9((e,{slots:t})=>pn(yT,M3(e),t)),Jl=(e,t=[])=>{xt(e)?e.forEach(n=>n(...t)):e&&e(...t)},Zb=e=>e?xt(e)?e.some(t=>t.length>1):e.length>1:!1;function M3(e){const t={};for(const S in e)S in C3||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=M9(s),g=p&&p[0],b=p&&p[1],{onBeforeEnter:v,onEnter:m,onEnterCancelled:y,onLeave:k,onLeaveCancelled:A,onBeforeAppear:$=v,onAppear:L=m,onAppearCancelled:w=y}=t,E=(S,I,P,B)=>{S._enterCancelled=B,al(S,I?u:l),al(S,I?c:r),P&&P()},T=(S,I)=>{S._isLeaving=!1,al(S,d),al(S,h),al(S,f),I&&I()},F=S=>(I,P)=>{const B=S?L:m,W=()=>E(I,S,P);Jl(B,[I,W]),Xb(()=>{al(I,S?a:i),Ki(I,S?u:l),Zb(B)||Qb(I,o,g,W)})};return xn(t,{onBeforeEnter(S){Jl(v,[S]),Ki(S,i),Ki(S,r)},onBeforeAppear(S){Jl($,[S]),Ki(S,a),Ki(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,I){S._isLeaving=!0;const P=()=>T(S,I);Ki(S,d),S._enterCancelled?(Ki(S,f),Bg(S)):(Bg(S),Ki(S,f)),Xb(()=>{S._isLeaving&&(al(S,d),Ki(S,h),Zb(k)||Qb(S,o,b,P))}),Jl(k,[S,P])},onEnterCancelled(S){E(S,!1,void 0,!0),Jl(y,[S])},onAppearCancelled(S){E(S,!0,void 0,!0),Jl(w,[S])},onLeaveCancelled(S){T(S),Jl(A,[S])}})}function M9(e){if(e==null)return null;if(an(e))return[Q1(e.enter),Q1(e.leave)];{const t=Q1(e);return[t,t]}}function Q1(e){return Lh(e)}function Ki(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Uc]||(e[Uc]=new Set)).add(t)}function al(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Uc];n&&(n.delete(t),n.size||(e[Uc]=void 0))}function Xb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let E9=0;function Qb(e,t,n,o){const s=e._endId=++E9,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=E3(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function E3(e,t){const n=window.getComputedStyle(e),o=p=>(n[p]||"").split(", "),s=o(`${Qr}Delay`),i=o(`${Qr}Duration`),r=Jb(s,i),l=o(`${Au}Delay`),a=o(`${Au}Duration`),c=Jb(l,a);let u=null,d=0,f=0;t===Qr?r>0&&(u=Qr,d=r,f=i.length):t===Au?c>0&&(u=Au,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Qr:Au:null,f=u?u===Qr?i.length:a.length:0);const h=u===Qr&&/\b(?:transform|all)(?:,|$)/.test(o(`${Qr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function Jb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>ex(n)+ex(e[o])))}function ex(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Bg(e){return(e?e.ownerDocument:document).body.offsetHeight}function T9(e,t,n){const o=e[Uc];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Kh=Symbol("_vod"),T3=Symbol("_vsh"),mi={name:"show",beforeMount(e,{value:t},{transition:n}){e[Kh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Mu(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Mu(e,!0),o.enter(e)):o.leave(e,()=>{Mu(e,!1)}):Mu(e,t))},beforeUnmount(e,{value:t}){Mu(e,t)}};function Mu(e,t){e.style.display=t?e[Kh]:"none",e[T3]=!t}function N9(){mi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const N3=Symbol("");function Wwe(e){const t=Go();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Gh(i,s))},o=()=>{const s=e(t.proxy);t.ce?Gh(t.ce,s):Dg(t.subTree,s),n(s)};K4(()=>{Dh(o)}),cn(()=>{Qe(o,yi,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),wn(()=>s.disconnect())})}function Dg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Dg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Gh(e.el,t);else if(e.type===Pe)e.children.forEach(n=>Dg(n,t));else if(e.type===Nc){let{el:n,anchor:o}=e;for(;n&&(Gh(n,t),n!==o);)n=n.nextSibling}}function Gh(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=ME(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[N3]=o}}const I9=/(?:^|;)\s*display\s*:/;function L9(e,t,n){const o=e.style,s=En(n);let i=!1;if(n&&!s){if(t)if(En(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Du(o,l,"")}else for(const r in t)n[r]==null&&Du(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?F9(e,r,!En(t)&&t?t[r]:void 0,l)||Du(o,r,l):Du(o,r,"")}}else if(s){if(t!==n){const r=o[N3];r&&(n+=";"+r),o.cssText=n,i=I9.test(n)}}else t&&e.removeAttribute("style");Kh in e&&(e[Kh]=i?o.display:"",e[T3]&&(o.display="none"))}const tx=/\s*!important$/;function Du(e,t,n){if(xt(n))n.forEach(o=>Du(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=$9(e,t);tx.test(n)?e.setProperty(Es(o),n.replace(tx,""),"important"):e[o]=n}}const nx=["Webkit","Moz","ms"],J1={};function $9(e,t){const n=J1[t];if(n)return n;let o=No(t);if(o!=="filter"&&o in e)return J1[t]=o;o=Zp(o);for(let s=0;s<nx.length;s++){const i=nx[s]+o;if(i in e)return J1[t]=i}return t}function F9(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&En(o)&&n===o}const ox="http://www.w3.org/1999/xlink";function sx(e,t,n,o,s,i=CE(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ox,t.slice(6,t.length)):e.setAttributeNS(ox,t,n):n==null||i&&!u4(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ei(n)?String(n):n)}function ix(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?S3(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=u4(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function Er(e,t,n,o){e.addEventListener(t,n,o)}function O9(e,t,n,o){e.removeEventListener(t,n,o)}const rx=Symbol("_vei");function R9(e,t,n,o,s=null){const i=e[rx]||(e[rx]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=B9(t);if(o){const c=i[t]=H9(o,s);Er(e,l,c,a)}else r&&(O9(e,l,r,a),i[t]=void 0)}}const lx=/(?:Once|Passive|Capture)$/;function B9(e){let t;if(lx.test(e)){t={};let o;for(;o=e.match(lx);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Es(e.slice(2)),t]}let e0=0;const D9=Promise.resolve(),P9=()=>e0||(D9.then(()=>e0=0),e0=Date.now());function H9(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(xt(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),l=[o];for(let a=0;a<r.length&&!o._stopped;a++){const c=r[a];c&&xi(c,t,5,l)}}else xi(s,t,5,[o])};return n.value=e,n.attached=P9(),n}const ax=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,W9=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?T9(e,o,r):t==="style"?L9(e,n,o):Rd(t)?Vp(t)||R9(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):z9(e,t,o,r))?(ix(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&sx(e,t,o,r,i,t!=="value")):e._isVueCE&&(U9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!En(o)))?ix(e,No(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),sx(e,t,o,r))};function z9(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&ax(t)&&It(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return ax(t)&&En(n)?!1:t in e}function U9(e,t){const n=e._def.props;if(!n)return!1;const o=No(t);return Array.isArray(n)?n.some(s=>No(s)===o):Object.keys(n).some(s=>No(s)===o)}const cx={};function q9(e,t,n){let o=Ye(e,t);Kp(o)&&(o=xn({},o,t));class s extends wy{constructor(r){super(o,r,n)}}return s.def=o,s}const zwe=((e,t)=>q9(e,t,l7)),j9=typeof HTMLElement<"u"?HTMLElement:class{};class wy extends j9{constructor(t,n={},o=Xh){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&o!==Xh?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(xn({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof wy){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,mt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!xt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Lh(this._props[a])),(l||(l=Object.create(null)))[No(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(r),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)ln(this,o)||Object.defineProperty(this,o,{get:()=>C(n[o])})}_resolveProps(t){const{props:n}=t,o=xt(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(No))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):cx;const s=No(t);n&&this._numberProps&&this._numberProps[s]&&(o=Lh(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===cx?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Es(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Es(t),n+""):n||this.removeAttribute(Es(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),r7(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=re(this._def,xn(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(i,r)=>{this.dispatchEvent(new CustomEvent(i,Kp(r[0])?xn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),Es(i)!==i&&s(Es(i),r)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,r=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(o||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const o=t.childNodes[n];if(!(o instanceof HTMLStyleElement))return o}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const s=t[o],i=s.getAttribute("name")||"default",r=this._slots[i],l=s.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,s)}else for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const s=o.querySelectorAll("slot");for(let i=0;i<s.length;i++)n.add(s[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function V9(e){const t=Go(),n=t&&t.ce;return n||null}function Uwe(){const e=V9();return e&&e.shadowRoot}function qwe(e="$style"){{const t=Go();if(!t)return Gt;const n=t.type.__cssModules;if(!n)return Gt;const o=n[e];return o||Gt}}const I3=new WeakMap,L3=new WeakMap,Yh=Symbol("_moveCb"),ux=Symbol("_enterCb"),K9=e=>(delete e.props.mode,e),G9=K9({name:"TransitionGroup",props:xn({},A3,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Go(),o=W4();let s,i;return fy(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!J9(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(Z9),s.forEach(X9);const l=s.filter(Q9);Bg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Ki(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Yh]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[Yh]=null,al(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=en(e),l=M3(r);let a=r.tag||Pe;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),Al(u,pd(u,l,o,n)),I3.set(u,$3(u.el)))}i=t.default?uy(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Al(u,pd(u,l,o,n))}return re(a,null,i)}}}),Y9=G9;function Z9(e){const t=e.el;t[Yh]&&t[Yh](),t[ux]&&t[ux]()}function X9(e){L3.set(e,$3(e.el))}function Q9(e){const t=I3.get(e),n=L3.get(e),o=t.left-n.left,s=t.top-n.top;if(o||s){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${o/a}px,${s/c}px)`,r.transitionDuration="0s",e}}function $3(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function J9(e,t,n){const o=e.cloneNode(),s=e[Uc];s&&s.forEach(l=>{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=E3(o);return i.removeChild(o),r}const Tl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return xt(t)?n=>Ac(t,n):t};function e7(e){e.target.composing=!0}function dx(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ki=Symbol("_assign");function fx(e,t,n){return t&&(e=e.trim()),n&&(e=Xp(e)),e}const ws={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[ki]=Tl(s);const i=o||s.props&&s.props.type==="number";Er(e,t?"change":"input",r=>{r.target.composing||e[ki](fx(e.value,n,i))}),(n||i)&&Er(e,"change",()=>{e.value=fx(e.value,n,i)}),t||(Er(e,"compositionstart",e7),Er(e,"compositionend",dx),Er(e,"change",dx))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[ki]=Tl(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Xp(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},Zh={deep:!0,created(e,t,n){e[ki]=Tl(n),Er(e,"change",()=>{const o=e._modelValue,s=qc(e),i=e.checked,r=e[ki];if(xt(o)){const l=Jp(o,s),a=l!==-1;if(i&&!a)r(o.concat(s));else if(!i&&a){const c=[...o];c.splice(l,1),r(c)}}else if(Na(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(O3(e,i))})},mounted:hx,beforeUpdate(e,t,n){e[ki]=Tl(n),hx(e,t,n)}};function hx(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(xt(t))s=Jp(t,o.props.value)>-1;else if(Na(t))s=t.has(o.props.value);else{if(t===n)return;s=Fr(t,O3(e,!0))}e.checked!==s&&(e.checked=s)}const F3={created(e,{value:t},n){e.checked=Fr(t,n.props.value),e[ki]=Tl(n),Er(e,"change",()=>{e[ki](qc(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[ki]=Tl(o),t!==n&&(e.checked=Fr(t,o.props.value))}},Pg={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Na(t);Er(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Xp(qc(r)):qc(r));e[ki](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,mt(()=>{e._assigning=!1})}),e[ki]=Tl(o)},mounted(e,{value:t}){px(e,t)},beforeUpdate(e,t,n){e[ki]=Tl(n)},updated(e,{value:t}){e._assigning||px(e,t)}};function px(e,t){const n=e.multiple,o=xt(t);if(!(n&&!o&&!Na(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=qc(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Jp(t,l)>-1}else r.selected=t.has(l);else if(Fr(qc(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function qc(e){return"_value"in e?e._value:e.value}function O3(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const t7={created(e,t,n){Lf(e,t,n,null,"created")},mounted(e,t,n){Lf(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Lf(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Lf(e,t,n,o,"updated")}};function R3(e,t){switch(e){case"SELECT":return Pg;case"TEXTAREA":return ws;default:switch(t){case"checkbox":return Zh;case"radio":return F3;default:return ws}}}function Lf(e,t,n,o,s){const r=R3(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function n7(){ws.getSSRProps=({value:e})=>({value:e}),F3.getSSRProps=({value:e},t)=>{if(t.props&&Fr(t.props.value,e))return{checked:!0}},Zh.getSSRProps=({value:e},t)=>{if(xt(e)){if(t.props&&Jp(e,t.props.value)>-1)return{checked:!0}}else if(Na(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},t7.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=R3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const o7=["ctrl","shift","alt","meta"],s7={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>o7.some(n=>e[`${n}Key`]&&!t.includes(n))},bt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r<t.length;r++){const l=s7[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},i7={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ji=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=Es(s.key);if(t.some(r=>r===i||i7[r]===i))return e(s)}))},B3=xn({patchProp:W9},C9);let Yu,mx=!1;function D3(){return Yu||(Yu=s9(B3))}function P3(){return Yu=mx?Yu:i9(B3),mx=!0,Yu}const r7=((...e)=>{D3().render(...e)}),jwe=((...e)=>{P3().hydrate(...e)}),Xh=((...e)=>{const t=D3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=W3(o);if(!s)return;const i=t._component;!It(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,H3(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),l7=((...e)=>{const t=P3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=W3(o);if(s)return n(s,!0,H3(s))},t});function H3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function W3(e){return En(e)?document.querySelector(e):e}let gx=!1;const Vwe=()=>{gx||(gx=!0,n7(),N9())};/*!
21
- * shared v11.4.5
22
- * (c) 2026 kazuya kawaguchi
23
- * Released under the MIT License.
24
- */function a7(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Qh=typeof window<"u",Fl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),c7=(e,t,n)=>u7({l:e,k:t,s:n}),u7=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),bo=e=>typeof e=="number"&&isFinite(e),z3=e=>Sy(e)==="[object Date]",jc=e=>Sy(e)==="[object RegExp]",um=e=>Zt(e)&&Object.keys(e).length===0,xo=Object.assign,d7=Object.create,Mn=(e=null)=>d7(e);let vx;const ha=()=>vx||(vx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Mn());function yx(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function f7(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const h7=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,p7=/^(?:href|src|action|formaction)$/i;function _y(e){return h7.test(e)}function m7(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const f=e[l];if(c){f===c&&(c=null);continue}if(f==='"'||f==="'")c=f;else if(f==="(")a++;else if(f===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(o,i),n+=_y(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function kx(e,t){if(p7.test(e)&&_y(t))return"about:blank";const n=e.toLowerCase()==="style"?m7(t):t;return f7(n)}function g7(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${kx(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${kx(o,s)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,o,s)=>_y(s)?`${o}about:blank`:n),e}const v7=Object.prototype.hasOwnProperty;function vi(e,t){return v7.call(e,t)}const to=Array.isArray,Vn=e=>typeof e=="function",yt=e=>typeof e=="string",nn=e=>typeof e=="boolean",on=e=>e!==null&&typeof e=="object",y7=e=>on(e)&&Vn(e.then)&&Vn(e.catch),U3=Object.prototype.toString,Sy=e=>U3.call(e),Zt=e=>Sy(e)==="[object Object]",k7=e=>e==null?"":to(e)||Zt(e)&&e.toString===U3?JSON.stringify(e,null,2):String(e);function Cy(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const $f=e=>!on(e)||to(e);function fh(e,t){if($f(e)||$f(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(i=>{i!=="__proto__"&&(on(o[i])&&!on(s[i])&&(s[i]=Array.isArray(o[i])?[]:Mn()),$f(s[i])||$f(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*!
25
- * message-compiler v11.4.5
26
- * (c) 2026 kazuya kawaguchi
27
- * Released under the MIT License.
28
- */function b7(e,t,n){return{line:e,column:t,offset:n}}function Hg(e,t,n){return{start:e,end:t}}const fn={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},x7=17;function dm(e,t,n={}){const{domain:o,messages:s,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=o,l}function w7(e){throw e}const qi=" ",_7="\r",ns=`
29
- `,S7="\u2028",C7="\u2029";function A7(e){const t=e;let n=0,o=1,s=1,i=0;const r=L=>t[L]===_7&&t[L+1]===ns,l=L=>t[L]===ns,a=L=>t[L]===C7,c=L=>t[L]===S7,u=L=>r(L)||l(L)||a(L)||c(L),d=()=>n,f=()=>o,h=()=>s,p=()=>i,g=L=>r(L)||a(L)||c(L)?ns:t[L],b=()=>g(n),v=()=>g(n+i);function m(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function y(){return r(n+i)&&i++,i++,t[n+i]}function k(){n=0,o=1,s=1,i=0}function A(L=0){i=L}function $(){const L=n+i;for(;L!==n;)m();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:g,currentChar:b,currentPeek:v,next:m,peek:y,reset:k,resetPeek:A,skipToPeek:$}}const pr=void 0,M7=".",bx="'",E7="tokenizer";function T7(e,t={}){const n=t.location!==!1,o=A7(e),s=()=>o.index(),i=()=>b7(o.line(),o.column(),o.index()),r=i(),l=s(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(K,J,me,...Ee){const Fe=c();if(J.column+=me,J.offset+=me,u){const De=n?Hg(Fe.startLoc,J):null,ge=dm(K,De,{domain:E7,args:Ee});u(ge)}}function f(K,J,me){K.endLoc=i(),K.currentType=J;const Ee={type:J};return n&&(Ee.loc=Hg(K.startLoc,K.endLoc)),me!=null&&(Ee.value=me),Ee}const h=K=>f(K,13);function p(K,J){return K.currentChar()===J?(K.next(),J):(d(fn.EXPECTED_TOKEN,i(),0,J),"")}function g(K){let J="";for(;K.currentPeek()===qi||K.currentPeek()===ns;)J+=K.currentPeek(),K.peek();return J}function b(K){const J=g(K);return K.skipToPeek(),J}function v(K){if(K===pr)return!1;const J=K.charCodeAt(0);return J>=97&&J<=122||J>=65&&J<=90||J===95}function m(K){if(K===pr)return!1;const J=K.charCodeAt(0);return J>=48&&J<=57}function y(K,J){const{currentType:me}=J;if(me!==2)return!1;g(K);const Ee=v(K.currentPeek());return K.resetPeek(),Ee}function k(K,J){const{currentType:me}=J;if(me!==2)return!1;g(K);const Ee=K.currentPeek()==="-"?K.peek():K.currentPeek(),Fe=m(Ee);return K.resetPeek(),Fe}function A(K,J){const{currentType:me}=J;if(me!==2)return!1;g(K);const Ee=K.currentPeek()===bx;return K.resetPeek(),Ee}function $(K,J){const{currentType:me}=J;if(me!==7)return!1;g(K);const Ee=K.currentPeek()===".";return K.resetPeek(),Ee}function L(K,J){const{currentType:me}=J;if(me!==8)return!1;g(K);const Ee=v(K.currentPeek());return K.resetPeek(),Ee}function w(K,J){const{currentType:me}=J;if(!(me===7||me===11))return!1;g(K);const Ee=K.currentPeek()===":";return K.resetPeek(),Ee}function E(K,J){const{currentType:me}=J;if(me!==9)return!1;const Ee=()=>{const De=K.currentPeek();return De==="{"?v(K.peek()):De==="@"||De==="|"||De===":"||De==="."||De===qi||!De?!1:De===ns?(K.peek(),Ee()):F(K,!1)},Fe=Ee();return K.resetPeek(),Fe}function T(K){g(K);const J=K.currentPeek()==="|";return K.resetPeek(),J}function F(K,J=!0){const me=(Fe=!1,De="")=>{const ge=K.currentPeek();return ge==="{"||ge==="@"||!ge?Fe:ge==="|"?!(De===qi||De===ns):ge===qi?(K.peek(),me(!0,qi)):ge===ns?(K.peek(),me(!0,ns)):!0},Ee=me();return J&&K.resetPeek(),Ee}function S(K,J){const me=K.currentChar();return me===pr?pr:J(me)?(K.next(),me):null}function I(K){const J=K.charCodeAt(0);return J>=97&&J<=122||J>=65&&J<=90||J>=48&&J<=57||J===95||J===36}function P(K){return S(K,I)}function B(K){const J=K.charCodeAt(0);return J>=97&&J<=122||J>=65&&J<=90||J>=48&&J<=57||J===95||J===36||J===45}function W(K){return S(K,B)}function z(K){const J=K.charCodeAt(0);return J>=48&&J<=57}function D(K){return S(K,z)}function q(K){const J=K.charCodeAt(0);return J>=48&&J<=57||J>=65&&J<=70||J>=97&&J<=102}function j(K){return S(K,q)}function ie(K){let J="",me="";for(;J=D(K);)me+=J;return me}function ue(K){let J="";for(;;){const me=K.currentChar();if(me==="\\"){const Ee=K.peek();Ee==="{"||Ee==="}"||Ee==="@"||Ee==="|"||Ee==="\\"?(J+=me+Ee,K.next(),K.next()):(K.resetPeek(),J+=me,K.next())}else{if(me==="{"||me==="}"||me==="@"||me==="|"||!me)break;if(me===qi||me===ns)if(F(K))J+=me,K.next();else{if(T(K))break;J+=me,K.next()}else J+=me,K.next()}}return J}function pe(K){b(K);let J="",me="";for(;J=W(K);)me+=J;const Ee=K.currentChar();if(Ee&&Ee!=="}"&&Ee!==pr&&Ee!==qi&&Ee!==ns&&Ee!==" "){const Fe=U(K);return d(fn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,me+Fe),me+Fe}return K.currentChar()===pr&&d(fn.UNTERMINATED_CLOSING_BRACE,i(),0),me}function ee(K){b(K);let J="";return K.currentChar()==="-"?(K.next(),J+=`-${ie(K)}`):J+=ie(K),K.currentChar()===pr&&d(fn.UNTERMINATED_CLOSING_BRACE,i(),0),J}function ne(K){return K!==bx&&K!==ns}function fe(K){b(K),p(K,"'");let J="",me="";for(;J=S(K,ne);)J==="\\"?me+=Me(K):me+=J;const Ee=K.currentChar();return Ee===ns||Ee===pr?(d(fn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ee===ns&&(K.next(),p(K,"'")),me):(p(K,"'"),me)}function Me(K){const J=K.currentChar();switch(J){case"\\":case"'":return K.next(),`\\${J}`;case"u":return $e(K,J,4);case"U":return $e(K,J,6);default:return d(fn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,J),""}}function $e(K,J,me){p(K,J);let Ee="";for(let Fe=0;Fe<me;Fe++){const De=j(K);if(!De){d(fn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${J}${Ee}${K.currentChar()}`);break}Ee+=De}return`\\${J}${Ee}`}function ae(K){return K!=="{"&&K!=="}"&&K!==qi&&K!==ns}function U(K){b(K);let J="",me="";for(;J=S(K,ae);)me+=J;return me}function ce(K){let J="",me="";for(;J=P(K);)me+=J;return me}function se(K){const J=me=>{const Ee=K.currentChar();return Ee==="{"||Ee==="@"||Ee==="|"||Ee==="("||Ee===")"||!Ee||Ee===qi?me:(me+=Ee,K.next(),J(me))};return J("")}function V(K){b(K);const J=p(K,"|");return b(K),J}function Q(K,J){let me=null;switch(K.currentChar()){case"{":return J.braceNest>=1&&d(fn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),K.next(),me=f(J,2,"{"),b(K),J.braceNest++,me;case"}":return J.braceNest>0&&J.currentType===2&&d(fn.EMPTY_PLACEHOLDER,i(),0),K.next(),me=f(J,3,"}"),J.braceNest--,J.braceNest>0&&b(K),J.inLinked&&J.braceNest===0&&(J.inLinked=!1),me;case"@":return J.braceNest>0&&d(fn.UNTERMINATED_CLOSING_BRACE,i(),0),me=ke(K,J)||h(J),J.braceNest=0,me;default:{let Fe=!0,De=!0,ge=!0;if(T(K))return J.braceNest>0&&d(fn.UNTERMINATED_CLOSING_BRACE,i(),0),me=f(J,1,V(K)),J.braceNest=0,J.inLinked=!1,me;if(J.braceNest>0&&(J.currentType===4||J.currentType===5||J.currentType===6))return d(fn.UNTERMINATED_CLOSING_BRACE,i(),0),J.braceNest=0,he(K,J);if(Fe=y(K,J))return me=f(J,4,pe(K)),b(K),me;if(De=k(K,J))return me=f(J,5,ee(K)),b(K),me;if(ge=A(K,J))return me=f(J,6,fe(K)),b(K),me;if(!Fe&&!De&&!ge)return me=f(J,12,U(K)),d(fn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,me.value),b(K),me;break}}return me}function ke(K,J){const{currentType:me}=J;let Ee=null;const Fe=K.currentChar();switch((me===7||me===8||me===11||me===9)&&(Fe===ns||Fe===qi)&&d(fn.INVALID_LINKED_FORMAT,i(),0),Fe){case"@":return K.next(),Ee=f(J,7,"@"),J.inLinked=!0,Ee;case".":return b(K),K.next(),f(J,8,".");case":":return b(K),K.next(),f(J,9,":");default:return T(K)?(Ee=f(J,1,V(K)),J.braceNest=0,J.inLinked=!1,Ee):$(K,J)||w(K,J)?(b(K),ke(K,J)):L(K,J)?(b(K),f(J,11,ce(K))):E(K,J)?(b(K),Fe==="{"?Q(K,J)||Ee:f(J,10,se(K))):(me===7&&d(fn.INVALID_LINKED_FORMAT,i(),0),J.braceNest=0,J.inLinked=!1,he(K,J))}}function he(K,J){let me={type:13};if(J.braceNest>0)return Q(K,J)||h(J);if(J.inLinked)return ke(K,J)||h(J);switch(K.currentChar()){case"{":return Q(K,J)||h(J);case"}":return d(fn.UNBALANCED_CLOSING_BRACE,i(),0),K.next(),f(J,3,"}");case"@":return ke(K,J)||h(J);default:{if(T(K))return me=f(J,1,V(K)),J.braceNest=0,J.inLinked=!1,me;if(F(K))return f(J,0,ue(K));break}}return me}function ye(){const{currentType:K,offset:J,startLoc:me,endLoc:Ee}=a;return a.lastType=K,a.lastOffset=J,a.lastStartLoc=me,a.lastEndLoc=Ee,a.offset=s(),a.startLoc=i(),o.currentChar()===pr?f(a,13):he(o,a)}return{nextToken:ye,currentOffset:s,currentPosition:i,context:c}}const N7="parser",I7=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,L7=/\\([\\@{}|])/g;function $7(e,t){return t}function F7(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function O7(e={}){const t=e.location!==!1,{onError:n}=e;function o(v,m,y,k,...A){const $=v.currentPosition();if($.offset+=k,$.column+=k,n){const L=t?Hg(y,$):null,w=dm(m,L,{domain:N7,args:A});n(w)}}function s(v,m,y){const k={type:v};return t&&(k.start=m,k.end=m,k.loc={start:y,end:y}),k}function i(v,m,y,k){t&&(v.end=m,v.loc&&(v.loc.end=y))}function r(v,m){const y=v.context(),k=s(3,y.offset,y.startLoc);return k.value=m.replace(L7,$7),i(k,v.currentOffset(),v.currentPosition()),k}function l(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(5,k,A);return $.index=parseInt(m,10),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function a(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(4,k,A);return $.key=m,v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function c(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(9,k,A);return $.value=m.replace(I7,F7),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function u(v){const m=v.nextToken(),y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(8,k,A);return m.type!==11?(o(v,fn.UNEXPECTED_EMPTY_LINKED_MODIFIER,y.lastStartLoc,0),$.value="",i($,k,A),{nextConsumeToken:m,node:$}):(m.value==null&&o(v,fn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ji(m)),$.value=m.value||"",i($,v.currentOffset(),v.currentPosition()),{node:$})}function d(v,m){const y=v.context(),k=s(7,y.offset,y.startLoc);return k.value=m,i(k,v.currentOffset(),v.currentPosition()),k}function f(v){const m=v.context(),y=s(6,m.offset,m.startLoc);let k=v.nextToken();if(k.type===8){const A=u(v);y.modifier=A.node,k=A.nextConsumeToken||v.nextToken()}switch(k.type!==9&&o(v,fn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(k)),k=v.nextToken(),k.type===2&&(k=v.nextToken()),k.type){case 10:k.value==null&&o(v,fn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(k)),y.key=d(v,k.value||"");break;case 4:k.value==null&&o(v,fn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(k)),y.key=a(v,k.value||"");break;case 5:k.value==null&&o(v,fn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(k)),y.key=l(v,k.value||"");break;case 6:k.value==null&&o(v,fn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(k)),y.key=c(v,k.value||"");break;default:{o(v,fn.UNEXPECTED_EMPTY_LINKED_KEY,m.lastStartLoc,0);const A=v.context(),$=s(7,A.offset,A.startLoc);return $.value="",i($,A.offset,A.startLoc),y.key=$,i(y,A.offset,A.startLoc),{nextConsumeToken:k,node:y}}}return i(y,v.currentOffset(),v.currentPosition()),{node:y}}function h(v){const m=v.context(),y=m.currentType===1?v.currentOffset():m.offset,k=m.currentType===1?m.endLoc:m.startLoc,A=s(2,y,k);A.items=[];let $=null;do{const E=$||v.nextToken();switch($=null,E.type){case 0:E.value==null&&o(v,fn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(E)),A.items.push(r(v,E.value||""));break;case 5:E.value==null&&o(v,fn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(E)),A.items.push(l(v,E.value||""));break;case 4:E.value==null&&o(v,fn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(E)),A.items.push(a(v,E.value||""));break;case 6:E.value==null&&o(v,fn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,ji(E)),A.items.push(c(v,E.value||""));break;case 7:{const T=f(v);A.items.push(T.node),$=T.nextConsumeToken||null;break}}}while(m.currentType!==13&&m.currentType!==1);const L=m.currentType===1?m.lastOffset:v.currentOffset(),w=m.currentType===1?m.lastEndLoc:v.currentPosition();return i(A,L,w),A}function p(v,m,y,k){const A=v.context();let $=k.items.length===0;const L=s(1,m,y);L.cases=[],L.cases.push(k);do{const w=h(v);$||($=w.items.length===0),L.cases.push(w)}while(A.currentType!==13);return $&&o(v,fn.MUST_HAVE_MESSAGES_IN_PLURAL,y,0),i(L,v.currentOffset(),v.currentPosition()),L}function g(v){const m=v.context(),{offset:y,startLoc:k}=m,A=h(v);return m.currentType===13?A:p(v,y,k,A)}function b(v){const m=T7(v,xo({},e)),y=m.context(),k=s(0,y.offset,y.startLoc);return t&&k.loc&&(k.loc.source=v),k.body=g(m),e.onCacheKey&&(k.cacheKey=e.onCacheKey(v)),y.currentType!==13&&o(m,fn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,v[y.offset]||""),i(k,m.currentOffset(),m.currentPosition()),k}return{parse:b}}function ji(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function R7(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function xx(e,t){for(let n=0;n<e.length;n++)Ay(e[n],t)}function Ay(e,t){switch(e.type){case 1:xx(e.cases,t),t.helper("plural");break;case 2:xx(e.items,t);break;case 6:{Ay(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function B7(e,t={}){const n=R7(e);n.helper("normalize"),e.body&&Ay(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function D7(e){const t=e.body;return t.type===2?wx(t):t.cases.forEach(n=>wx(n)),e}function wx(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const o=e.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;t.push(o.value)}if(t.length===e.items.length){e.static=Cy(t);for(let n=0;n<e.items.length;n++){const o=e.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function uc(e){switch(e.t=e.type,e.type){case 0:{const t=e;uc(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let o=0;o<n.length;o++)uc(n[o]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let o=0;o<n.length;o++)uc(n[o]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;uc(t.key),t.k=t.key,delete t.key,t.modifier&&(uc(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function P7(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(g,b){r.code+=g}function c(g,b=!0){const v=b?o:"";a(s?v+" ".repeat(g):v)}function u(g=!0){const b=++r.indentLevel;g&&c(b)}function d(g=!0){const b=--r.indentLevel;g&&c(b)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function H7(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Vc(e,t.key),t.modifier?(e.push(", "),Vc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function W7(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let i=0;i<s&&(Vc(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function z7(e,t){const{helper:n,needIndent:o}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let i=0;i<s&&(Vc(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function U7(e,t){t.body?Vc(e,t.body):e.push("null")}function Vc(e,t){const{helper:n}=e;switch(t.type){case 0:U7(e,t);break;case 1:z7(e,t);break;case 2:W7(e,t);break;case 6:H7(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break}}const q7=(e,t={})=>{const n=yt(t.mode)?t.mode:"normal",o=yt(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
30
- `,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=P7(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Cy(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Vc(l,e),l.deindent(i),l.push("}"),delete e.helpers;const{code:a,map:c}=l.context();return{ast:e,code:a,map:c?c.toJSON():void 0}};function j7(e,t={}){const n=xo({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=O7(n).parse(e);return o?(i&&D7(l),s&&uc(l),{ast:l,code:""}):(B7(l,n),q7(l,n))}/*!
31
- * core-base v11.4.5
32
- * (c) 2026 kazuya kawaguchi
33
- * Released under the MIT License.
34
- */function V7(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ha().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ha().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function tr(e){return on(e)&&My(e)===0&&(vi(e,"b")||vi(e,"body"))}const q3=["b","body"];function K7(e){return Ol(e,q3)}const j3=["c","cases"];function G7(e){return Ol(e,j3,[])}const V3=["s","static"];function Y7(e){return Ol(e,V3)}const K3=["i","items"];function Z7(e){return Ol(e,K3,[])}const G3=["t","type"];function My(e){return Ol(e,G3)}const Y3=["v","value"];function Ff(e,t){const n=Ol(e,Y3);if(n!=null)return n;throw yd(t)}const Z3=["m","modifier"];function X7(e){return Ol(e,Z3)}const X3=["k","key"];function Q7(e){const t=Ol(e,X3);if(t)return t;throw yd(6)}function Ol(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(vi(e,s)&&e[s]!=null)return e[s]}return n}const Q3=[...q3,...j3,...V3,...K3,...X3,...Z3,...Y3,...G3];function yd(e){return new Error(`unhandled node type: ${e}`)}function t0(e){return n=>J7(n,e)}function J7(e,t){const n=K7(t);if(n==null)throw yd(0);if(My(n)===1){const i=G7(n);return e.plural(i.reduce((r,l)=>[...r,_x(e,l)],[]))}else return _x(e,n)}function _x(e,t){const n=Y7(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=Z7(t).reduce((s,i)=>[...s,Wg(e,i)],[]);return e.normalize(o)}}function Wg(e,t){const n=My(t);switch(n){case 3:return Ff(t,n);case 9:return Ff(t,n);case 4:{const o=t;if(vi(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(vi(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw yd(n)}case 5:{const o=t;if(vi(o,"i")&&bo(o.i))return e.interpolate(e.list(o.i));if(vi(o,"index")&&bo(o.index))return e.interpolate(e.list(o.index));throw yd(n)}case 6:{const o=t,s=X7(o),i=Q7(o);return e.linked(Wg(e,i),s?Wg(e,s):void 0,e.type)}case 7:return Ff(t,n);case 8:return Ff(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const eN=e=>e;let Of=Mn();function tN(e,t={}){let n=!1;const o=t.onError||w7;return t.onError=s=>{n=!0,o(s)},{...j7(e,t),detectError:n}}function nN(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&yt(e)){nn(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||eN)(e),s=Of[o];if(s)return s;const{ast:i,detectError:r}=tN(e,{...t,location:!1,jit:!0}),l=t0(i);return r?l:Of[o]=l}else{const n=e.cacheKey;if(n){const o=Of[n];return o||(Of[n]=t0(e))}else return t0(e)}}let kd=null;function oN(e){kd=e}function sN(e,t,n){kd&&kd.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const iN=rN("function:translate");function rN(e){return t=>kd&&kd.emit(e,t)}const Tr={INVALID_ARGUMENT:x7,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},lN=24;function Nr(e){return dm(e,null,void 0)}function Ey(e,t){return t.locale!=null?Sx(t.locale):Sx(e.locale)}let n0;function Sx(e){if(yt(e))return e;if(Vn(e)){if(e.resolvedOnce&&n0!=null)return n0;if(e.constructor.name==="Function"){const t=e();if(y7(t))throw Nr(Tr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return n0=t}else throw Nr(Tr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Nr(Tr.NOT_SUPPORT_LOCALE_TYPE)}function aN(e,t,n){return[...new Set([n,...to(t)?t:on(t)?Object.keys(t):yt(t)?[t]:[n]])]}function zg(e,t,n){const o=yt(n)?n:bd,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;to(r);)r=Cx(i,r,t);const l=to(t)||!Zt(t)?t:t.default?t.default:null;r=yt(l)?[l]:l,to(r)&&Cx(i,r,!1),s.__localeChainCache.set(o,i)}return i}function Cx(e,t,n){let o=!0;for(let s=0;s<t.length&&nn(o);s++){const i=t[s];yt(i)&&(o=cN(e,t[s],n))}return o}function cN(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=uN(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function uN(e,t,n){let o=!1;if(!e.includes(t)&&(o=!0,t)){o=t[t.length-1]!=="!";const s=t.replace(/!/g,"");e.push(s),(to(n)||Zt(n))&&n[s]&&(o=n[s])}return o}const Rl=[];Rl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Rl[1]={w:[1],".":[2],"[":[4],o:[7]};Rl[2]={w:[2],i:[3,0],0:[3,0]};Rl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Rl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Rl[5]={"'":[4,0],o:8,l:[5,0]};Rl[6]={'"':[4,0],o:8,l:[6,0]};const dN=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function fN(e){return dN.test(e)}function hN(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function pN(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function mN(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:fN(t)?hN(t):"*"+t}function gN(e){const t=[];let n=-1,o=0,s=0,i,r,l,a,c,u,d;const f=[];f[0]=()=>{r===void 0?r=l:r+=l},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),s++},f[3]=()=>{if(s>0)s--,o=4,f[0]();else{if(s=0,r===void 0||(r=mN(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(o===5&&p==="'"||o===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=pN(i),d=Rl[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const Ax=new Map;function vN(e,t){return on(e)?e[t]:null}function yN(e,t){if(!on(e))return null;let n=Ax.get(t);if(n||(n=gN(t),n&&Ax.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(Q3.includes(r)&&tr(s)||!on(s)||!vi(s,r))return null;const l=s[r];if(l===void 0||Vn(s))return null;s=l,i++}return s}const kN="11.4.5",fm=-1,bd="en-US",Jh="",Mx=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function bN(){return{upper:(e,t)=>t==="text"&&yt(e)?e.toUpperCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&yt(e)?e.toLowerCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&yt(e)?Mx(e):t==="vnode"&&on(e)&&"__v_isVNode"in e?Mx(e.children):e}}let J3;function xN(e){J3=e}let eA;function wN(e){eA=e}let tA;function _N(e){tA=e}let nA=null;const SN=e=>{nA=e},CN=()=>nA;let oA=null;const Ex=e=>{oA=e},AN=()=>oA;let Tx=0;function MN(e={}){const t=Vn(e.onWarn)?e.onWarn:a7,n=yt(e.version)?e.version:kN,o=yt(e.locale)||Vn(e.locale)?e.locale:bd,s=Vn(o)?bd:o,i=to(e.fallbackLocale)||Zt(e.fallbackLocale)||yt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=Zt(e.messages)?e.messages:o0(s),l=Zt(e.datetimeFormats)?e.datetimeFormats:o0(s),a=Zt(e.numberFormats)?e.numberFormats:o0(s),c=xo(Mn(),e.modifiers,bN()),u=e.pluralRules||Mn(),d=Vn(e.missing)?e.missing:null,f=nn(e.missingWarn)||jc(e.missingWarn)?e.missingWarn:!0,h=nn(e.fallbackWarn)||jc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,g=!!e.unresolving,b=Vn(e.postTranslation)?e.postTranslation:null,v=Zt(e.processor)?e.processor:null,m=nn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter,k=Vn(e.messageCompiler)?e.messageCompiler:J3,A=Vn(e.messageResolver)?e.messageResolver:eA||vN,$=Vn(e.localeFallbacker)?e.localeFallbacker:tA||aN,L=on(e.fallbackContext)?e.fallbackContext:void 0,w=e,E=on(w.__datetimeFormatters)?w.__datetimeFormatters:new Map,T=on(w.__numberFormatters)?w.__numberFormatters:new Map,F=on(w.__meta)?w.__meta:{};Tx++;const S={version:n,cid:Tx,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:g,postTranslation:b,processor:v,warnHtmlMessage:m,escapeParameter:y,messageCompiler:k,messageResolver:A,localeFallbacker:$,fallbackContext:L,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=E,S.__numberFormatters=T,__INTLIFY_PROD_DEVTOOLS__&&sN(S,n,F),S}const o0=e=>({[e]:Mn()});function Ty(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return yt(l)?l:t}else return t}function Eu(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function EN(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function TN(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(EN(e,t[o]))return!0;return!1}function Nx(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!yt(t[0])&&!z3(t[0])&&!bo(t[0]))return Jh;const[a,c,u,d]=Ug(...t),f=nn(u.missingWarn)?u.missingWarn:e.missingWarn;nn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Ey(e,u),g=r(e,s,p);if(!yt(a)||a===""){const $=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?$.formatToParts(c):$.format(c)}let b={},v,m=null;const y="datetime format";for(let $=0;$<g.length&&(v=g[$],b=n[v]||{},m=b[a],!Zt(m));$++)Ty(e,a,v,f,y);if(!Zt(m)||!yt(v))return o?fm:a;let k=`${v}__${a}`;um(d)||(k=`${k}__${JSON.stringify(d)}`);let A=l.get(k);return A||(A=new Intl.DateTimeFormat(v,xo({},m,d)),l.set(k,A)),h?A.formatToParts(c):A.format(c)}const sA=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Ug(...e){const[t,n,o,s]=e,i=Mn();let r=Mn(),l;if(yt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Nr(Tr.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw Nr(Tr.INVALID_ISO_DATE_ARGUMENT)}}else if(z3(t)){if(isNaN(t.getTime()))throw Nr(Tr.INVALID_DATE_ARGUMENT);l=t}else if(bo(t))l=t;else throw Nr(Tr.INVALID_ARGUMENT);return yt(n)?i.key=n:Zt(n)&&Object.keys(n).forEach(a=>{sA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(o)?i.locale=o:Zt(o)&&(r=o),Zt(s)&&(r=s),[i.key||"",l,i,r]}function Ix(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function Lx(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!bo(t[0]))return Jh;const[a,c,u,d]=qg(...t),f=nn(u.missingWarn)?u.missingWarn:e.missingWarn;nn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Ey(e,u),g=r(e,s,p);if(!yt(a)||a===""){const $=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?$.formatToParts(c):$.format(c)}let b={},v,m=null;const y="number format";for(let $=0;$<g.length&&(v=g[$],b=n[v]||{},m=b[a],!Zt(m));$++)Ty(e,a,v,f,y);if(!Zt(m)||!yt(v))return o?fm:a;let k=`${v}__${a}`;um(d)||(k=`${k}__${JSON.stringify(d)}`);let A=l.get(k);return A||(A=new Intl.NumberFormat(v,xo({},m,d)),l.set(k,A)),h?A.formatToParts(c):A.format(c)}const iA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function qg(...e){const[t,n,o,s]=e,i=Mn();let r=Mn();if(!bo(t))throw Nr(Tr.INVALID_ARGUMENT);const l=t;return yt(n)?i.key=n:Zt(n)&&Object.keys(n).forEach(a=>{iA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(o)?i.locale=o:Zt(o)&&(r=o),Zt(s)&&(r=s),[i.key||"",l,i,r]}function $x(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const NN=e=>e,IN=e=>"",LN="text",$N=e=>e.length===0?"":Cy(e),FN=k7;function s0(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function ON(e){const t=bo(e.pluralIndex)?e.pluralIndex:-1;return bo(e.named?.count)?e.named.count:bo(e.named?.n)?e.named.n:t}function RN(e={}){const t=e.locale,n=ON(e),o=yt(t)&&Vn(e.pluralRules?.[t])?e.pluralRules[t]:s0,s=o===s0?void 0:s0,i=v=>v[o(n,v.length,s)],r=e.list||[],l=v=>r[v],a=e.named||Mn();bo(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=v=>a[v];function u(v,m){const y=Vn(e.messages)?e.messages(v,!!m):on(e.messages)?e.messages[v]:!1;return y||(e.parent?e.parent.message(v):IN)}const d=v=>e.modifiers?e.modifiers[v]:NN,f=Vn(e.processor?.normalize)?e.processor.normalize:$N,h=Vn(e.processor?.interpolate)?e.processor.interpolate:FN,p=yt(e.processor?.type)?e.processor.type:LN,b={list:l,named:c,plural:i,linked:(v,...m)=>{const[y,k]=m;let A="text",$="";m.length===1?on(y)?($=y.modifier||$,A=y.type||A):yt(y)&&($=y||$):m.length===2&&(yt(y)&&($=y||$),yt(k)&&(A=k||A));const L=u(v,!0)(b),w=L===""||L===void 0?v:L,E=A==="vnode"&&to(w)&&$?w[0]:w;return $?d($)(E,A):E},message:u,type:p,interpolate:h,normalize:f,values:xo(Mn(),r,a)};return b}const Fx=()=>"",hi=e=>Vn(e);function Ox(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=jg(...t),u=nn(c.missingWarn)?c.missingWarn:e.missingWarn,d=nn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=nn(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=yt(c.default)||nn(c.default)?nn(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,g=n||p!=null&&(yt(p)||Vn(p)),b=Ey(e,c);f&&BN(c);let[v,m,y]=h?[a,b,l[b]||Mn()]:rA(e,a,b,r,d,u),k=v,A=a;if(!h&&!(yt(k)||tr(k)||hi(k))&&g&&(k=p,A=k),!h&&(!(yt(k)||tr(k)||hi(k))||!yt(m)))return s?fm:a;let $=!1;const L=()=>{$=!0},w=hi(k)?k:lA(e,a,m,k,A,L);if($)return k;const E=HN(e,m,y,c),T=RN(E),F=DN(e,w,T);let S=o?o(F,a):F;if(f&&yt(S)&&(S=g7(S)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:yt(a)?a:hi(k)?k.key:"",locale:m||(hi(k)?k.locale:""),format:yt(k)?k:hi(k)?k.source:"",message:S};I.meta=xo({},e.__meta,CN()||{}),iN(I)}return S}function BN(e){to(e.list)?e.list=e.list.map(t=>yt(t)?yx(t):t):on(e.named)&&Object.keys(e.named).forEach(t=>{yt(e.named[t])&&(e.named[t]=yx(e.named[t]))})}function rA(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=Mn(),f,h=null;const p="translate";for(let g=0;g<u.length&&(f=u[g],d=r[f]||Mn(),(h=a(d,t))===null&&(h=d[t]),!(yt(h)||tr(h)||hi(h)));g++)if(!TN(f,u)){const b=Ty(e,t,f,i,p);b!==t&&(h=b)}return[h,f,d]}function lA(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(hi(o)){const c=o;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>o);return c.locale=n,c.key=t,c}const a=r(o,PN(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function DN(e,t,n){return t(n)}function jg(...e){const[t,n,o]=e,s=Mn();if(!yt(t)&&!bo(t)&&!hi(t)&&!tr(t))throw Nr(Tr.INVALID_ARGUMENT);const i=bo(t)?String(t):(hi(t),t);return bo(n)?s.plural=n:yt(n)?s.default=n:Zt(n)&&!um(n)?s.named=n:to(n)&&(s.list=n),bo(o)?s.plural=o:yt(o)?s.default=o:Zt(o)&&xo(s,o),[i,s]}function PN(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>c7(t,n,r)}}function HN(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:i,messages:(h,p)=>{let g=r(n,h);if(g==null&&(u||p)){const[b,,v]=rA(u||e,h,t,l,a,c);g=b??r(v,h)}if(yt(g)||tr(g)){let b=!1;const m=lA(e,h,t,g,h,()=>{b=!0});return b?Fx:m}else return hi(g)?g:Fx}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),bo(o.plural)&&(f.pluralIndex=o.plural),f}V7();/*!
35
- * vue-i18n v11.4.5
36
- * (c) 2026 kazuya kawaguchi
37
- * Released under the MIT License.
38
- */const WN="11.4.5";function zN(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ha().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ha().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ha().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ha().__INTLIFY_PROD_DEVTOOLS__=!1)}const gs={UNEXPECTED_RETURN_TYPE:lN,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Ts(e,...t){return dm(e,null,void 0)}const Vg=Fl("__translateVNode"),Kg=Fl("__datetimeParts"),Gg=Fl("__numberParts"),aA=Fl("__setPluralRules"),cA=Fl("__injectWithOption"),vc=Fl("__dispose");function xd(e){if(!on(e)||tr(e))return e;for(const t in e)if(vi(e,t))if(!t.includes("."))on(e[t])&&xd(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,i=!1;for(let r=0;r<o;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in s||(s[n[r]]=Mn()),!on(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(tr(s)?Q3.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!tr(s)){const r=s[n[o]];on(r)&&xd(r)}}return e}function Ny(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=Zt(n)?n:to(o)?Mn():{[e]:Mn()};if(to(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Mn(),fh(c,r[a])):fh(c,r)}else yt(l)&&fh(JSON.parse(l),r)}),s==null&&i)for(const l in r)vi(r,l)&&xd(r[l]);return r}function uA(e){return e.type}function dA(e,t,n){let o=on(t.messages)?t.messages:Mn();"__i18nGlobal"in n&&(o=Ny(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(on(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(on(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Rx(e){return re(xl,null,e,0)}function wd(){return Go()}const Bx="__INTLIFY_META__",Dx=()=>[],UN=()=>!1;let Px=0;function Hx(e){return((t,n,o,s)=>e(n,o,wd()||void 0,s))}const qN=()=>{const e=wd();let t=null;return e&&(t=uA(e)[Bx])?{[Bx]:t}:null};function ep(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=Qh?Z:Ia;let r=nn(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:yt(e.locale)?e.locale:bd),a=i(t&&r?t.fallbackLocale.value:yt(e.fallbackLocale)||to(e.fallbackLocale)||Zt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Ny(l.value,e)),u=i(Zt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Zt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:nn(e.missingWarn)||jc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:nn(e.fallbackWarn)||jc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:nn(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,b=Vn(e.missing)?e.missing:null,v=Vn(e.missing)?Hx(e.missing):null,m=Vn(e.postTranslation)?e.postTranslation:null,y=t?t.warnHtmlMessage:nn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,k=!!e.escapeParameter;const A=t?t.modifiers:Zt(e.modifiers)?e.modifiers:{};let $=e.pluralRules||t&&t.pluralRules,L;L=(()=>{o&&Ex(null);const ge={version:WN,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:$,missing:v===null?void 0:v,missingWarn:f,fallbackWarn:h,fallbackFormat:g,unresolving:!0,postTranslation:m===null?void 0:m,warnHtmlMessage:y,escapeParameter:k,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ge.datetimeFormats=u.value,ge.numberFormats=d.value,ge.__datetimeFormatters=Zt(L)?L.__datetimeFormatters:void 0,ge.__numberFormatters=Zt(L)?L.__numberFormatters:void 0;const Ie=MN(ge);return o&&Ex(Ie),Ie})(),Eu(L,l.value,a.value);function E(){return[l.value,a.value,c.value,u.value,d.value]}const T=R({get:()=>l.value,set:ge=>{L.locale=ge,l.value=ge}}),F=R({get:()=>a.value,set:ge=>{L.fallbackLocale=ge,a.value=ge,Eu(L,l.value,ge)}}),S=R(()=>c.value),I=R(()=>u.value),P=R(()=>d.value);function B(){return Vn(m)?m:null}function W(ge){m=ge,L.postTranslation=ge}function z(){return b}function D(ge){ge!==null&&(v=Hx(ge)),b=ge,L.missing=v}const q=(ge,Ie,Je,it,St,gt)=>{E();let Tt;try{__INTLIFY_PROD_DEVTOOLS__,o||(L.fallbackContext=t?AN():void 0),Tt=ge(L)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(L.fallbackContext=void 0)}if(Je!=="translate exists"&&bo(Tt)&&Tt===fm||Je==="translate exists"&&!Tt){const[Pt,ft]=Ie();return t&&p?it(t):St(Pt)}else{if(gt(Tt))return Tt;throw Ts(gs.UNEXPECTED_RETURN_TYPE)}};function j(...ge){return q(Ie=>Reflect.apply(Ox,null,[Ie,...ge]),()=>jg(...ge),"translate",Ie=>Reflect.apply(Ie.t,Ie,[...ge]),Ie=>Ie,Ie=>yt(Ie))}function ie(...ge){const[Ie,Je,it]=ge;if(it&&!on(it))throw Ts(gs.INVALID_ARGUMENT);return j(Ie,Je,xo({resolvedMessage:!0},it||{}))}function ue(...ge){return q(Ie=>Reflect.apply(Nx,null,[Ie,...ge]),()=>Ug(...ge),"datetime format",Ie=>Reflect.apply(Ie.d,Ie,[...ge]),()=>Jh,Ie=>yt(Ie)||to(Ie))}function pe(...ge){return q(Ie=>Reflect.apply(Lx,null,[Ie,...ge]),()=>qg(...ge),"number format",Ie=>Reflect.apply(Ie.n,Ie,[...ge]),()=>Jh,Ie=>yt(Ie)||to(Ie))}function ee(ge){return ge.map(Ie=>yt(Ie)||bo(Ie)||nn(Ie)?Rx(String(Ie)):Ie)}const fe={normalize:ee,interpolate:ge=>ge,type:"vnode"};function Me(...ge){return q(Ie=>{let Je;const it=Ie;try{it.processor=fe,Je=Reflect.apply(Ox,null,[it,...ge])}finally{it.processor=null}return Je},()=>jg(...ge),"translate",Ie=>Ie[Vg](...ge),Ie=>[Rx(Ie)],Ie=>to(Ie))}function $e(...ge){return q(Ie=>Reflect.apply(Lx,null,[Ie,...ge]),()=>qg(...ge),"number format",Ie=>Ie[Gg](...ge),Dx,Ie=>yt(Ie)||to(Ie))}function ae(...ge){return q(Ie=>Reflect.apply(Nx,null,[Ie,...ge]),()=>Ug(...ge),"datetime format",Ie=>Ie[Kg](...ge),Dx,Ie=>yt(Ie)||to(Ie))}function U(ge){$=ge,L.pluralRules=$}function ce(ge,Ie){return q(()=>{if(!ge)return!1;const Je=yt(Ie)?Ie:l.value,it=yt(Ie)?[Je]:zg(L,a.value,Je);for(let St=0;St<it.length;St++){const gt=Q(it[St]);let Tt=L.messageResolver(gt,ge);if(Tt===null&&(Tt=gt[ge]),tr(Tt)||hi(Tt)||yt(Tt))return!0}return!1},()=>[ge],"translate exists",Je=>Reflect.apply(Je.te,Je,[ge,Ie]),UN,Je=>nn(Je))}function se(ge){let Ie=null;const Je=zg(L,a.value,l.value);for(let it=0;it<Je.length;it++){const St=c.value[Je[it]]||{},gt=L.messageResolver(St,ge);if(gt!=null){Ie=gt;break}}return Ie}function V(ge){const Ie=se(ge);return Ie??(t?t.tm(ge)||{}:{})}function Q(ge){return c.value[ge]||{}}function ke(ge,Ie){if(s){const Je={[ge]:Ie};for(const it in Je)vi(Je,it)&&xd(Je[it]);Ie=Je[ge]}c.value[ge]=Ie,L.messages=c.value}function he(ge,Ie){c.value[ge]=c.value[ge]||{};const Je={[ge]:Ie};if(s)for(const it in Je)vi(Je,it)&&xd(Je[it]);Ie=Je[ge],fh(Ie,c.value[ge]),L.messages=c.value}function ye(ge){return u.value[ge]||{}}function K(ge,Ie){u.value[ge]=Ie,L.datetimeFormats=u.value,Ix(L,ge,Ie)}function J(ge,Ie){u.value[ge]=xo(u.value[ge]||{},Ie),L.datetimeFormats=u.value,Ix(L,ge,Ie)}function me(ge){return d.value[ge]||{}}function Ee(ge,Ie){d.value[ge]=Ie,L.numberFormats=d.value,$x(L,ge,Ie)}function Fe(ge,Ie){d.value[ge]=xo(d.value[ge]||{},Ie),L.numberFormats=d.value,$x(L,ge,Ie)}Px++,t&&Qh&&(Qe(t.locale,ge=>{r&&(l.value=ge,L.locale=ge,Eu(L,l.value,a.value))}),Qe(t.fallbackLocale,ge=>{r&&(a.value=ge,L.fallbackLocale=ge,Eu(L,l.value,a.value))}));const De={id:Px,locale:T,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(ge){r=ge,ge&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Eu(L,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return $||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(ge){f=ge,L.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(ge){h=ge,L.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(ge){p=ge},get fallbackFormat(){return g},set fallbackFormat(ge){g=ge,L.fallbackFormat=g},get warnHtmlMessage(){return y},set warnHtmlMessage(ge){y=ge,L.warnHtmlMessage=ge},get escapeParameter(){return k},set escapeParameter(ge){k=ge,L.escapeParameter=ge},t:j,getLocaleMessage:Q,setLocaleMessage:ke,mergeLocaleMessage:he,getPostTranslationHandler:B,setPostTranslationHandler:W,getMissingHandler:z,setMissingHandler:D,[aA]:U};return De.datetimeFormats=I,De.numberFormats=P,De.rt=ie,De.te=ce,De.tm=V,De.d=ue,De.n=pe,De.getDateTimeFormat=ye,De.setDateTimeFormat=K,De.mergeDateTimeFormat=J,De.getNumberFormat=me,De.setNumberFormat=Ee,De.mergeNumberFormat=Fe,De[cA]=n,De[Vg]=Me,De[Kg]=ae,De[Gg]=$e,De}function jN(e){const t=yt(e.locale)?e.locale:bd,n=yt(e.fallbackLocale)||to(e.fallbackLocale)||Zt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Vn(e.missing)?e.missing:void 0,s=nn(e.silentTranslationWarn)||jc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=nn(e.silentFallbackWarn)||jc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=nn(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Zt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Vn(e.postTranslation)?e.postTranslation:void 0,d=yt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=nn(e.sync)?e.sync:!0;let p=e.messages;if(Zt(e.sharedMessages)){const A=e.sharedMessages;p=Object.keys(A).reduce((L,w)=>{const E=L[w]||(L[w]={});return xo(E,A[w]),L},p||{})}const{__i18n:g,__root:b,__injectWithOption:v}=e,m=e.datetimeFormats,y=e.numberFormats,k=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:k,datetimeFormats:m,numberFormats:y,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:g,__root:b,__injectWithOption:v}}function Yg(e={}){const t=ep(jN(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(s){t.setMissingHandler(s)},get silentTranslationWarn(){return nn(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=nn(s)?!s:s},get silentFallbackWarn(){return nn(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=nn(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){return Reflect.apply(t.t,t,[...s])},rt(...s){return Reflect.apply(t.rt,t,[...s])},te(s,i){return t.te(s,i)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,i){t.setLocaleMessage(s,i)},mergeLocaleMessage(s,i){t.mergeLocaleMessage(s,i)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,i){t.setDateTimeFormat(s,i)},mergeDateTimeFormat(s,i){t.mergeDateTimeFormat(s,i)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,i){t.setNumberFormat(s,i)},mergeNumberFormat(s,i){t.mergeNumberFormat(s,i)}};return o.__extender=n,o}function VN(e,t,n){return{beforeCreate(){const o=wd();if(!o)throw Ts(gs.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=Wx(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Yg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=Wx(e,s);else{this.$i18n=Yg({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&dA(t,s,s),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(o,this.$i18n)},mounted(){},unmounted(){const o=wd();if(!o)throw Ts(gs.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function Wx(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[aA](t.pluralizationRules||e.pluralizationRules);const n=Ny(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const Iy={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function KN({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Pe?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},Mn())}function fA(){return Pe}const GN=Ye({name:"i18n-t",props:xo({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>bo(e)||!isNaN(e)}},Iy),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||Mt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Mn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=yt(e.plural)?+e.plural:e.plural);const u=KN(t,a);return s[Vg](e.keypath,u,c)},r=xo(Mn(),o),l=yt(e.tag)||on(e.tag)?e.tag:fA();return on(l)?pn(l,r,{default:i}):pn(l,r,i())}}}),zx=GN;function YN(e){return to(e)&&!yt(e[0])}function hA(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Mn();e.locale&&(c.locale=e.locale),yt(e.format)?c.key=e.format:on(e.format)&&(yt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?xo(Mn(),h,{[p]:e.format[p]}):h,Mn()));const d=o(e.value,c,u);let f=[c.key];return to(d)?f=d.map((h,p)=>{const g=s[h.type],b=g?g({[h.type]:h.value,index:p,parts:d}):[h.value];return YN(b)&&(b[0].key=`${h.type}-${p}`),b}):yt(d)&&(f=[d]),f},l=xo(Mn(),i),a=yt(e.tag)||on(e.tag)?e.tag:fA();return on(a)?pn(a,l,{default:r}):pn(a,l,r())}}const ZN=Ye({name:"i18n-n",props:xo({value:{type:Number,required:!0},format:{type:[String,Object]}},Iy),setup(e,t){const n=e.i18n||Mt({useScope:e.scope,__useComponent:!0});return hA(e,t,iA,(...o)=>n[Gg](...o))}}),Ux=ZN;function XN(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function QN(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Ts(gs.UNEXPECTED_ERROR);const c=XN(e,l.$),u=qx(a);return[Reflect.apply(c.t,c,[...jx(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);Qh&&(r.__i18nWatcher=Qe(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{Qh&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:l})=>{if(r.__composer){const a=r.__composer,c=qx(l);r.textContent=Reflect.apply(a.t,a,[...jx(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function qx(e){if(yt(e))return{path:e};if(Zt(e)){if(!("path"in e))throw Ts(gs.REQUIRED_VALUE,"path");return e}else throw Ts(gs.INVALID_VALUE)}function jx(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return yt(n)&&(r.locale=n),bo(s)&&(r.plural=s),bo(i)&&(r.plural=i),[t,l,r]}function JN(e,t,...n){const o=Zt(n[0])?n[0]:{};(nn(o.globalInstall)?o.globalInstall:!0)&&([zx.name,"I18nT"].forEach(i=>e.component(i,zx)),[Ux.name,"I18nN"].forEach(i=>e.component(i,Ux)),[Gx.name,"I18nD"].forEach(i=>e.component(i,Gx))),e.directive("t",QN(t))}const eI=Fl("global-vue-i18n");function tI(e={}){const t=__VUE_I18N_LEGACY_API__&&nn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=nn(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=nI(e,t),r=Fl("");function l(d){return o.get(d)||null}function a(d,f){o.set(d,f)}function c(d){o.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Zt(f[0])){const g=f[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let h=null;!t&&n&&(h=cI(d,u.global)),__VUE_I18N_FULL_INSTALL__&&JN(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(VN(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Mt(e={}){const t=wd();if(t==null)throw Ts(gs.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ts(gs.NOT_INSTALLED);const n=oI(t),o=iI(n),s=uA(t),i=sI(e,s);if(i==="global")return dA(o,e,s),o;if(i==="parent"){let a=Vx(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw Ts(gs.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=xo({},e),u=Vx(n,t);c.__root=u||o;const d=ep(c);return a.__composerExtend&&(d[vc]=a.__composerExtend(d)),sy()&&iy(()=>{const h=d[vc];h&&(h(),delete d[vc])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=xo({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=ep(a),r.__composerExtend&&(l[vc]=r.__composerExtend(l)),lI(r,t,l),r.__setInstance(t,l)}return l}function nI(e,t){const n=EE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Yg(e)):n.run(()=>ep(e));if(o==null)throw Ts(gs.UNEXPECTED_ERROR);return[n,o]}function oI(e){const t=Ut(e.isCE?eI:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ts(e.isCE?gs.NOT_INSTALLED_WITH_PROVIDE:gs.UNEXPECTED_ERROR);return t}function sI(e,t){return um(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function iI(e){return e.mode==="composition"?e.global:e.global.__composer}function Vx(e,t,n=!1){let o=null;const s=t.root;let i=rI(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")o=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(o=l.__composer,n&&o&&!o[cA]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function rI(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function lI(e,t,n){cn(()=>{},t),wn(()=>{const o=n;e.__deleteInstance(t);const s=o[vc];s&&(s(),delete o[vc])},t)}const aI=["locale","fallbackLocale","availableLocales"],Kx=["t","rt","d","n","tm","te"];function cI(e,t){const n=Object.create(null);return aI.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Ts(gs.UNEXPECTED_ERROR);const r=ao(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,r)}),e.config.globalProperties.$i18n=n,Kx.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Ts(gs.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,Kx.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const uI=Ye({name:"i18n-d",props:xo({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Iy),setup(e,t){const n=e.i18n||Mt({useScope:e.scope,__useComponent:!0});return hA(e,t,sA,(...o)=>n[Kg](...o))}}),Gx=uI;zN();xN(nN);wN(yN);_N(zg);if(__INTLIFY_PROD_DEVTOOLS__){const e=ha();e.__INTLIFY__=!0,oN(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const dI="modulepreload",fI=function(e){return"/"+e},Yx={},ps=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");s=r(n.map(c=>{if(c=fI(c),c in Yx)return;Yx[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":dI,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Lt={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme"};function Zx(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function oo(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function uo(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Kc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function hm(e){const t=oo(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function zd(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Ly(){const e=oo(Lt.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function $y(e){const n={...Ly()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];uo(Lt.unread,JSON.stringify(n))}function hI(){const e=hm(Lt.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function i0(e){zd(Lt.collapsedWorkspaces,Array.from(e))}function pI(){const e=hm(Lt.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function pA(e){zd(Lt.workspaceOrder,Array.from(e))}function Rf(){const e=hm(Lt.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&(t[n]=o);return t}function Xx(e){zd(Lt.workspaceNameOverrides,e)}function mI(){return oo(Lt.workspaceSort)}function mA(e){uo(Lt.workspaceSort,e)}const Qx=Lt.clientId,gI="kimi-code-web",vI="web";function yI(){return{serverHttpUrl:bI(),clientId:SI(),clientName:gI,clientVersion:CI(),clientUiMode:vI}}function kI(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function bI(e){const t=kI(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function xI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function wI(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return xI(e)}function yc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function _I(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}function SI(){const e=oo(Qx);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return uo(Qx,t),t}function CI(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function AI(e){try{const t=await fetch("/__kimi-dev/backend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return t.ok?await t.json():null}catch{return null}}function MI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}async function Ko(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 EI(e)}function EI(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}function TI(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(i=>n.has(i)),s=e.filter(i=>!t.includes(i));return s.length===0&&o.length===t.length?null:[...s,...o]}function NI(e,t){const n=new Map(t.map((o,s)=>[o,s]));return e.toSorted((o,s)=>(n.get(o.id)??-1)-(n.get(s.id)??-1))}function II(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s<i?i-1:i,a=o==="before"?l:l+1;return r.splice(a,0,t),r}function LI(e,t){return e.toSorted((n,o)=>(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const $I={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Jx(e){return e.replace(/[&<>"']/g,t=>$I[t]??t)}function FI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function OI(e,t,n=40){const o=e.replace(/\s+/g," ").trim();if(o.length===0)return"";const s=t.trim();if(s.length===0)return ew(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return ew(o,n*2);const r=Math.max(0,i-n),l=Math.min(o.length,i+s.length+n),a=r>0,c=l<o.length;return`${a?"…":""}${o.slice(r,l)}${c?"…":""}`}function ew(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function r0(e,t){const n=Jx(e),o=t.trim();if(o.length===0)return n;const s=new RegExp(FI(Jx(o)),"gi");return n.replace(s,i=>`<mark>${i}</mark>`)}const dc=Z(0),RI=["type","disabled","aria-label"],BI=Ye({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=Z();return t({el:n}),(o,s)=>(x(),N("button",{ref_key:"el",ref:n,class:We(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Fn(o.$slots,"default",{},void 0,!0)],10,RI))}}),at=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Wn=at(BI,[["__scopeId","data-v-c9e67023"]]),DI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function PI(e,t){return x(),N("svg",DI,[...t[0]||(t[0]=[_("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),_("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const HI=pt({name:"kimi-add-conversation",render:PI}),WI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zI(e,t){return x(),N("svg",WI,[...t[0]||(t[0]=[_("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 UI=pt({name:"kimi-folder",render:zI}),qI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},jI=["clip-path"],VI=["id"];function KI(e,t){return x(),N("svg",qI,[_("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[_("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"},null,-1)])],8,jI),_("defs",null,[_("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[_("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,VI)])])}const GI=pt({name:"kimi-folder-open",render:KI,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),YI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ZI(e,t){return x(),N("svg",YI,[...t[0]||(t[0]=[_("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),_("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),_("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 XI=pt({name:"kimi-more",render:ZI}),QI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function JI(e,t){return x(),N("svg",QI,[...t[0]||(t[0]=[_("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 eL=pt({name:"kimi-search",render:JI}),tL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function nL(e,t){return x(),N("svg",tL,[...t[0]||(t[0]=[_("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),_("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 oL=pt({name:"kimi-setting",render:nL}),sL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iL(e,t){return x(),N("svg",sL,[...t[0]||(t[0]=[_("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-2zm5-2v16"}),_("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const rL=pt({name:"tabler-layout-sidebar-left-collapse",render:iL}),lL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aL(e,t){return x(),N("svg",lL,[...t[0]||(t[0]=[_("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-2zm5-2v16"}),_("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const cL=pt({name:"tabler-layout-sidebar-left-expand",render:aL}),uL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dL(e,t){return x(),N("svg",uL,[...t[0]||(t[0]=[_("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 fL=pt({name:"tabler-paperclip",render:dL}),hL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pL(e,t){return x(),N("svg",hL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const mL=pt({name:"ri-add-line",render:pL}),gL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vL(e,t){return x(),N("svg",gL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const yL=pt({name:"ri-alert-line",render:vL}),kL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bL(e,t){return x(),N("svg",kL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"},null,-1)])])}const xL=pt({name:"ri-archive-line",render:bL}),wL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _L(e,t){return x(),N("svg",wL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const SL=pt({name:"ri-arrow-down-line",render:_L}),CL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AL(e,t){return x(),N("svg",CL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const ML=pt({name:"ri-arrow-down-s-line",render:AL}),EL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function TL(e,t){return x(),N("svg",EL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const NL=pt({name:"ri-arrow-go-back-line",render:TL}),IL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LL(e,t){return x(),N("svg",IL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const $L=pt({name:"ri-arrow-right-line",render:LL}),FL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function OL(e,t){return x(),N("svg",FL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const RL=pt({name:"ri-arrow-right-s-line",render:OL}),BL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function DL(e,t){return x(),N("svg",BL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const tw=pt({name:"ri-arrow-up-line",render:DL}),PL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function HL(e,t){return x(),N("svg",PL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)])])}const WL=pt({name:"ri-arrow-up-s-line",render:HL}),zL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function UL(e,t){return x(),N("svg",zL,[...t[0]||(t[0]=[_("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 qL=pt({name:"ri-braces-line",render:UL}),jL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VL(e,t){return x(),N("svg",jL,[...t[0]||(t[0]=[_("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 KL=pt({name:"ri-calendar-close-line",render:VL}),GL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YL(e,t){return x(),N("svg",GL,[...t[0]||(t[0]=[_("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 ZL=pt({name:"ri-calendar-schedule-line",render:YL}),XL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QL(e,t){return x(),N("svg",XL,[...t[0]||(t[0]=[_("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 JL=pt({name:"ri-calendar-todo-line",render:QL}),e$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function t$(e,t){return x(),N("svg",e$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const n$=pt({name:"ri-check-line",render:t$}),o$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function s$(e,t){return x(),N("svg",o$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const i$=pt({name:"ri-close-line",render:s$}),r$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function l$(e,t){return x(),N("svg",r$,[...t[0]||(t[0]=[_("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 a$=pt({name:"ri-code-line",render:l$}),c$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u$(e,t){return x(),N("svg",c$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const d$=pt({name:"ri-collapse-diagonal-line",render:u$}),f$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function h$(e,t){return x(),N("svg",f$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const p$=pt({name:"ri-download-line",render:h$}),m$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g$(e,t){return x(),N("svg",m$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const v$=pt({name:"ri-draggable",render:g$}),y$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function k$(e,t){return x(),N("svg",y$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const b$=pt({name:"ri-equalizer-line",render:k$}),x$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w$(e,t){return x(),N("svg",x$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const _$=pt({name:"ri-expand-diagonal-line",render:w$}),S$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function C$(e,t){return x(),N("svg",S$,[...t[0]||(t[0]=[_("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 A$=pt({name:"ri-external-link-line",render:C$}),M$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function E$(e,t){return x(),N("svg",M$,[...t[0]||(t[0]=[_("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 T$=pt({name:"ri-file-add-line",render:E$}),N$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function I$(e,t){return x(),N("svg",N$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const L$=pt({name:"ri-file-copy-line",render:I$}),$$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function F$(e,t){return x(),N("svg",$$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const O$=pt({name:"ri-file-edit-line",render:F$}),R$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function B$(e,t){return x(),N("svg",R$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const nw=pt({name:"ri-file-line",render:B$}),D$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function P$(e,t){return x(),N("svg",D$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const H$=pt({name:"ri-file-text-line",render:P$}),W$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z$(e,t){return x(),N("svg",W$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const U$=pt({name:"ri-flashlight-line",render:z$}),q$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function j$(e,t){return x(),N("svg",q$,[...t[0]||(t[0]=[_("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.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const V$=pt({name:"ri-folder-add-line",render:j$}),K$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G$(e,t){return x(),N("svg",K$,[...t[0]||(t[0]=[_("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 Y$=pt({name:"ri-folder-fill",render:G$}),Z$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function X$(e,t){return x(),N("svg",Z$,[...t[0]||(t[0]=[_("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 Q$=pt({name:"ri-git-fork-line",render:X$}),J$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eF(e,t){return x(),N("svg",J$,[...t[0]||(t[0]=[_("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 tF=pt({name:"ri-git-pull-request-line",render:eF}),nF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oF(e,t){return x(),N("svg",nF,[...t[0]||(t[0]=[_("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 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const sF=pt({name:"ri-global-line",render:oF}),iF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rF(e,t){return x(),N("svg",iF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const ow=pt({name:"ri-image-line",render:rF}),lF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aF(e,t){return x(),N("svg",lF,[...t[0]||(t[0]=[_("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 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const cF=pt({name:"ri-information-line",render:aF}),uF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dF(e,t){return x(),N("svg",uF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const fF=pt({name:"ri-links-line",render:dF}),hF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pF(e,t){return x(),N("svg",hF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const mF=pt({name:"ri-list-check",render:pF}),gF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vF(e,t){return x(),N("svg",gF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const yF=pt({name:"ri-list-unordered",render:vF}),kF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bF(e,t){return x(),N("svg",kF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const xF=pt({name:"ri-login-box-line",render:bF}),wF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _F(e,t){return x(),N("svg",wF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const SF=pt({name:"ri-mail-line",render:_F}),CF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AF(e,t){return x(),N("svg",CF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const MF=pt({name:"ri-message-line",render:AF}),EF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function TF(e,t){return x(),N("svg",EF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const NF=pt({name:"ri-pause-fill",render:TF}),IF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LF(e,t){return x(),N("svg",IF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const $F=pt({name:"ri-pencil-line",render:LF}),FF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function OF(e,t){return x(),N("svg",FF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const RF=pt({name:"ri-play-fill",render:OF}),BF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function DF(e,t){return x(),N("svg",BF,[...t[0]||(t[0]=[_("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-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const PF=pt({name:"ri-question-line",render:DF}),HF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WF(e,t){return x(),N("svg",HF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const zF=pt({name:"ri-sort-desc",render:WF}),UF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qF(e,t){return x(),N("svg",UF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const jF=pt({name:"ri-sparkling-line",render:qF}),VF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function KF(e,t){return x(),N("svg",VF,[...t[0]||(t[0]=[_("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 GF=pt({name:"ri-star-fill",render:KF}),YF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ZF(e,t){return x(),N("svg",YF,[...t[0]||(t[0]=[_("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 XF=pt({name:"ri-star-line",render:ZF}),QF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JF(e,t){return x(),N("svg",QF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const eO=pt({name:"ri-stop-fill",render:JF}),tO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nO(e,t){return x(),N("svg",tO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const oO=pt({name:"ri-subtract-line",render:nO}),sO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iO(e,t){return x(),N("svg",sO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const rO=pt({name:"ri-target-line",render:iO}),lO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aO(e,t){return x(),N("svg",lO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const cO=pt({name:"ri-terminal-box-line",render:aO}),uO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dO(e,t){return x(),N("svg",uO,[...t[0]||(t[0]=[_("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 16m1-8h4v2h-6V7h2z"},null,-1)])])}const fO=pt({name:"ri-time-line",render:dO}),hO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pO(e,t){return x(),N("svg",hO,[...t[0]||(t[0]=[_("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 mO=pt({name:"ri-tools-line",render:pO}),gO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vO(e,t){return x(),N("svg",gO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const yO=pt({name:"ri-user-line",render:vO}),kO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
39
- <path d="M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z" fill="currentColor"/>
40
- <path fill-rule="evenodd" clip-rule="evenodd" d="M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z" fill="currentColor"/>
41
- </svg>
42
- `,bO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
43
- <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"/>
44
- </svg>
45
- `,xO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
46
- <g clip-path="url(#clip0_4626_2033)">
47
- <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"/>
48
- </g>
49
- <defs>
50
- <clipPath id="clip0_4626_2033">
51
- <rect width="24" height="24" fill="white"/>
52
- </clipPath>
53
- </defs>
54
- </svg>
55
- `,wO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
56
- <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"/>
57
- <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"/>
58
- <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"/>
59
- </svg>
60
- `,_O=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
61
- <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"/>
62
- </svg>
63
- `,SO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
64
- <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"/>
65
- <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"/>
66
- </svg>
67
- `,CO='<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-2zm5-2v16"/><path d="m15 10l-2 2l2 2"/></g></svg>',AO='<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-2zm5-2v16"/><path d="m14 10l2 2l-2 2"/></g></svg>',MO='<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>',EO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',TO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/></svg>',NO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"/></svg>',IO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/></svg>',LO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/></svg>',$O='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/></svg>',FO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/></svg>',OO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/></svg>',sw='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/></svg>',RO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"/></svg>',BO='<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>',DO='<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>',PO='<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>',HO='<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>',WO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/></svg>',zO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/></svg>',UO='<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>',qO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/></svg>',jO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/></svg>',VO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/></svg>',KO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',GO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/></svg>',YO='<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>',ZO='<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>',XO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/></svg>',QO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"/></svg>',iw='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/></svg>',JO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/></svg>',eR='<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>',tR='<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.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',nR='<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>',oR='<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>',sR='<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>',iR='<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 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/></svg>',rw='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/></svg>',rR='<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 16M11 7h2v2h-2zm0 4h2v6h-2z"/></svg>',lR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/></svg>',aR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/></svg>',cR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/></svg>',uR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/></svg>',dR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/></svg>',fR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/></svg>',hR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',pR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/></svg>',mR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/></svg>',gR='<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-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/></svg>',vR='<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>',yR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/></svg>',kR='<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>',bR='<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>',xR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/></svg>',wR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',_R='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"/></svg>',SR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/></svg>',CR='<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 16m1-8h4v2h-6V7h2z"/></svg>',AR='<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>',MR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/></svg>',gA={sm:14,md:16,lg:20};function vt(e,t){return{component:e,svg:t}}const vA={plus:vt(mL,EO),"chat-new":vt(HI,kO),"calendar-close":vt(KL,DO),"calendar-schedule":vt(ZL,PO),"calendar-todo":vt(JL,HO),close:vt(i$,zO),check:vt(n$,WO),archive:vt(xL,NO),search:vt(eL,_O),copy:vt(L$,XO),link:vt(fF,lR),"external-link":vt(A$,YO),download:vt(p$,jO),undo:vt(NL,$O),send:vt(tw,sw),image:vt(ow,rw),settings:vt(oL,SO),sliders:vt(b$,KO),"log-in":vt(xF,uR),"chevron-down":vt(ML,LO),"chevron-right":vt(RL,OO),"chevron-up":vt(WL,RO),"arrow-up":vt(tw,sw),"arrow-down":vt(SL,IO),"arrow-right":vt($L,FO),minus:vt(oO,wR),"panel-collapse":vt(rL,CO),"panel-expand":vt(cL,AO),expand:vt(_$,GO),collapse:vt(d$,qO),list:vt(yF,cR),sort:vt(zF,vR),grip:vt(v$,VO),folder:vt(GI,xO),"folder-closed":vt(UI,bO),"folder-plus":vt(V$,tR),"folder-solid":vt(Y$,nR),file:vt(nw,iw),"file-text":vt(H$,JO),"file-edit":vt(O$,QO),"file-plus":vt(T$,ZO),"file-off":vt(nw,iw),attachment:vt(fL,MO),"image-off":vt(ow,rw),code:vt(a$,UO),terminal:vt(cO,SR),pencil:vt($F,pR),tool:vt(mO,AR),glob:vt(qL,BO),globe:vt(sF,iR),"check-list":vt(mF,aR),bolt:vt(U$,eR),"git-fork":vt(Q$,oR),"git-pull-request":vt(tF,sR),message:vt(MF,fR),mail:vt(SF,dR),user:vt(yO,MR),info:vt(cF,rR),"help-circle":vt(PF,gR),"alert-triangle":vt(yL,TO),clock:vt(fO,CR),sparkles:vt(jF,yR),target:vt(rO,_R),pause:vt(NF,hR),play:vt(RF,mR),stop:vt(eO,xR),star:vt(GF,kR),"star-outline":vt(XF,bR),"dots-horizontal":vt(XI,wO)};function ER(e){return vA[e]}function TR(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function fc(e,t="md"){const n=vA[e];return n?TR(n.svg,gA[t]):""}const Kwe=[["Actions",["plus","attachment","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","chevron-up","arrow-up","arrow-down","arrow-right","minus","panel-collapse","panel-expand","expand","collapse","list","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","target","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","pause","play","stop","star","star-outline","dots-horizontal"]]],je=Ye({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=R(()=>ER(t.name)),o=R(()=>gA[t.size]);return(s,i)=>n.value?(x(),be(qo(n.value.component),{key:0,class:"kw-icon",width:o.value,height:o.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):le("",!0)}}),NR={key:0,class:"ui-dialog__head"},IR={class:"ui-dialog__titles"},LR={key:0,class:"ui-dialog__title"},$R={key:1,class:"ui-dialog__desc"},FR={class:"ui-dialog__body"},OR={key:1,class:"ui-dialog__foot"},RR='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',BR=Ye({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,o=t,s=Z(null);let i=null;function r(){o("update:open",!1),o("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(RR)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?s.value?.querySelector(d)??null:s.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),h=f[0],p=f[f.length-1];if(!h||!p){d.preventDefault(),s.value?.focus();return}const g=document.activeElement;d.shiftKey&&g===h?(d.preventDefault(),p.focus()):!d.shiftKey&&g===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Qe(()=>n.open,async d=>{if(d){dc.value+=1,i=document.activeElement,await mt();const f=a(),h=l();(f??h[0]??s.value)?.focus()}else dc.value=Math.max(0,dc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),co(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(dc.value=Math.max(0,dc.value-1))}),(d,f)=>(x(),be(rm,{to:"body"},[e.open?(x(),N("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[_("div",{ref_key:"panel",ref:s,class:We(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(x(),N("div",NR,[Fn(d.$slots,"head",{},()=>[_("div",IR,[e.title?(x(),N("div",LR,O(e.title),1)):le("",!0),e.description?(x(),N("div",$R,O(e.description),1)):le("",!0)])],!0),re(Wn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ne(()=>[re(je,{name:"close",size:"md"})]),_:1})])):le("",!0),_("div",FR,[Fn(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(x(),N("div",OR,[Fn(d.$slots,"foot",{},void 0,!0)])):le("",!0)],2)],32)):le("",!0)]))}}),Wr=at(BR,[["__scopeId","data-v-3dce23a4"]]),DR={class:"sd-head"},PR=["placeholder","aria-label"],HR=["aria-selected","onClick","onMousemove"],WR={class:"sd-meta"},zR=["innerHTML"],UR={class:"sd-time"},qR=["innerHTML"],jR=["innerHTML"],VR={key:1,class:"sd-empty"},KR={class:"sd-hint"},GR=200,YR=Ye({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Mt(),o=e,s=t,i=Z(!0),r=Z(""),l=Z(null),a=Z(null),c=R(()=>{const v=r.value.trim().toLowerCase(),m=[];for(const y of o.sessions){const k=y.title??"",A=y.lastPrompt??"",$=y.workspaceName??"",L=v.length>0&&k.toLowerCase().includes(v),w=v.length>0&&A.toLowerCase().includes(v),E=v.length>0&&$.toLowerCase().includes(v);if(!(v.length>0&&!L&&!w&&!E)&&(m.push({session:y,inTitle:L,inWorkspace:E,snippetText:A?OI(A,r.value):""}),m.length>=GR))break}return m}),u=Z(0);Qe(r,()=>{u.value=0});function d(v){const m=c.value.length;return m===0?0:Math.max(0,Math.min(m-1,v))}async function f(){await mt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(v){u.value=d(u.value+v),f()}function p(v){s("select",v),s("close")}function g(){const v=c.value[u.value];v&&p(v.session.id)}function b(v){v.key==="ArrowDown"?(v.preventDefault(),h(1)):v.key==="ArrowUp"?(v.preventDefault(),h(-1)):v.key==="Enter"&&(v.preventDefault(),g())}return cn(()=>{l.value?.focus()}),(v,m)=>(x(),be(Wr,{open:i.value,"onUpdate:open":m[1]||(m[1]=y=>i.value=y),size:"lg",height:"fixed",padded:!1,onClose:m[2]||(m[2]=y=>s("close"))},{head:Ne(()=>[_("div",DR,[re(je,{class:"sd-search-icon",name:"search",size:"md"}),$n(_("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":m[0]||(m[0]=y=>r.value=y),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:b},null,40,PR),[[ws,r.value]])])]),foot:Ne(()=>[_("span",KR,O(C(n)("sidebar.searchHint")),1)]),default:Ne(()=>[_("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(x(!0),N(Pe,{key:0},nt(c.value,(y,k)=>(x(),N("button",{key:y.session.id,class:We(["sd-row",{on:k===u.value,active:y.session.id===e.activeId}]),role:"option","aria-selected":k===u.value,onClick:A=>p(y.session.id),onMousemove:A=>u.value=k},[_("span",WR,[re(je,{class:"sd-folder",name:"folder-closed",size:"sm"}),_("span",{class:"sd-ws",innerHTML:C(r0)(y.session.workspaceName??y.session.workspaceId??"",y.inWorkspace?r.value:"")},null,8,zR),_("span",UR,O(y.session.time),1)]),_("span",{class:"sd-title",innerHTML:C(r0)(y.session.title,y.inTitle?r.value:"")},null,8,qR),y.snippetText?(x(),N("span",{key:0,class:"sd-snippet",innerHTML:C(r0)(y.snippetText,r.value)},null,8,jR)):le("",!0)],42,HR))),128)):(x(),N("div",VR,O(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),ZR=at(YR,[["__scopeId","data-v-a678f802"]]),XR=["aria-label"],QR=Ye({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(x(),N("span",{class:We(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[_("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[_("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),_("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,XR))}}),Rs=at(QR,[["__scopeId","data-v-e5c5b17d"]]),JR={key:0,class:"ui-badge__dot","aria-hidden":"true"},eB=Ye({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(x(),N("span",{class:We(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(x(),N("span",JR)):le("",!0),Fn(t.$slots,"default",{},void 0,!0)],2))}}),Ns=at(eB,[["__scopeId","data-v-5bc5cd6d"]]),tB=Ye({__name:"Menu",setup(e,{expose:t}){const n=Z();return t({el:n}),(o,s)=>(x(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Fn(o.$slots,"default",{},void 0,!0)],512))}}),gl=at(tB,[["__scopeId","data-v-60e6cd8d"]]),nB={key:0,class:"ui-menu-sep",role:"separator"},oB=["disabled"],sB=Ye({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(x(),N("div",nB)):(x(),N("button",{key:1,class:We(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[Fn(t.$slots,"default",{},void 0,!0)],10,oB))}}),hn=at(sB,[["__scopeId","data-v-f940771a"]]),Jr=6,el=8,iB=150,rB=Ye({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Z(),o=Z(),s=Z(!1),i=Z(!1),r=Z({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const g=o.value;if(!a||!g)return;const b=a.getBoundingClientRect(),v=g.offsetWidth,m=g.offsetHeight,y=window.innerWidth,k=window.innerHeight;let A=t.placement;A==="top"&&b.top-Jr-m<el?A="bottom":A==="bottom"&&b.bottom+Jr+m>k-el?A="top":A==="left"&&b.left-Jr-v<el?A="right":A==="right"&&b.right+Jr+v>y-el&&(A="left");let $=0,L=0;A==="top"?($=b.top-Jr-m,L=b.left+b.width/2-v/2):A==="bottom"?($=b.bottom+Jr,L=b.left+b.width/2-v/2):A==="left"?($=b.top+b.height/2-m/2,L=b.left-Jr-v):($=b.top+b.height/2-m/2,L=b.right+Jr),L=Math.min(Math.max(L,el),y-el-v),$=Math.min(Math.max($,el),k-el-m),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round($)}px`,left:`${Math.round(L)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{s.value=!0,i.value=!1,mt(()=>{u(),i.value=!0})},iB))}function f(){window.clearTimeout(l),s.value=!1,i.value=!1}function h(){s.value&&f()}function p(g){g!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=g,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return cn(()=>{const g=n.value??null;p(g?.firstElementChild??g),g&&(c=new MutationObserver(()=>{const b=g.firstElementChild??null;b!==a&&(f(),p(b??g))}),c.observe(g,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),co(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(g,b)=>(x(),N(Pe,null,[_("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Fn(g.$slots,"default",{},void 0,!0)],512),(x(),be(rm,{to:"body"},[$n(_("div",{ref_key:"bubble",ref:o,class:We(["ui-tip__bubble",{positioned:i.value}]),style:qt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[mi,s.value]])]))],64))}}),Yt=at(rB,[["__scopeId","data-v-4c261eb6"]]),lB={class:"row"},aB={class:"lead","aria-hidden":"true"},cB={key:1,class:"unread-dot"},uB={class:"left"},dB=["onKeydown"],fB={class:"act"},hB={class:"ts"},pB={class:"menu-time"},mB=Ye({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork","export"],setup(e,{expose:t,emit:n}){const{t:o}=Mt(),s=e,i=n;function r(S){const I=new Date(S);if(Number.isNaN(I.getTime()))return S;const P=B=>String(B).padStart(2,"0");return`${I.getFullYear()}-${P(I.getMonth()+1)}-${P(I.getDate())} ${P(I.getHours())}:${P(I.getMinutes())}`}const l=R(()=>s.session.updatedAt?r(s.session.updatedAt):s.session.time),a=Z(!1),c=Z(null),u=Z(null),d=Z({});function f(S){const I=S.target;u.value?.el?.contains(I)||c.value?.el?.contains(I)||g()}function h(){const S=c.value?.el;if(!S)return;const I=u.value?.el,P=S.getBoundingClientRect(),B=4,W=8,z=I?.offsetHeight??0,D=I?.offsetWidth??0;let q=P.bottom+B;q+z>window.innerHeight-W&&(q=Math.max(W,P.top-z-B));let j=P.right-D;j<W&&(j=W),d.value={top:`${Math.round(q)}px`,left:`${Math.round(j)}px`}}async function p(S){if(S.stopPropagation(),a.value){g();return}a.value=!0,setTimeout(()=>document.addEventListener("mousedown",f),0),window.addEventListener("resize",g),await mt(),h()}function g(){a.value=!1,document.removeEventListener("mousedown",f),window.removeEventListener("resize",g)}wn(()=>{document.removeEventListener("mousedown",f),window.removeEventListener("resize",g)});const b=Z(!1),v=Z(""),m=Z(null);async function y(){g(),b.value=!0,v.value=s.session.title,await mt();try{m.value?.focus(),m.value?.select()}catch{}}function k(){const S=v.value.trim();S&&i("rename",s.session.id,S),b.value=!1}function A(){b.value=!1}const $=Z(!1),L=Z(!1);async function w(){const S=await Ko(s.session.id);$.value=S,L.value=!S,setTimeout(()=>{$.value=!1,L.value=!1,g()},1500)}function E(){g(),i("fork",s.session.id)}function T(){g(),i("export",s.session.id)}function F(){g(),i("archive",s.session.id)}return t({closeMenu:g}),(S,I)=>(x(),N("div",{class:We(["se",{on:e.active}]),onClick:I[4]||(I[4]=P=>i("select",e.session.id))},[_("div",lB,[_("span",aB,[e.session.busy?(x(),be(Rs,{key:0,size:"sm"})):e.unread?(x(),N("span",cB)):le("",!0)]),_("div",uB,[b.value?$n((x(),N("input",{key:0,ref_key:"renameInputRef",ref:m,"onUpdate:modelValue":I[0]||(I[0]=P=>v.value=P),class:"rename-input",onClick:I[1]||(I[1]=bt(()=>{},["stop"])),onKeydown:[Ji(bt(k,["stop"]),["enter"]),Ji(bt(A,["stop"]),["esc"])],onBlur:k},null,40,dB)),[[ws,v.value]]):(x(),N("span",{key:1,class:"t",onDblclick:bt(y,["stop"])},O(e.session.title),33))]),re(Yt,{text:C(o)("workspace.awaitingAnswerTitle")},{default:Ne(()=>[!b.value&&(e.questionCount>0||e.session.pendingInteraction==="question")?(x(),be(Ns,{key:0,variant:"info",size:"sm"},{default:Ne(()=>[Xe(O(C(o)("workspace.awaitingAnswer")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),re(Yt,{text:C(o)("workspace.awaitingPermissionTitle")},{default:Ne(()=>[!b.value&&(e.approvalCount>0||e.session.pendingInteraction==="approval")?(x(),be(Ns,{key:0,variant:"warning",size:"sm"},{default:Ne(()=>[Xe(O(C(o)("workspace.awaitingPermission")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),re(Yt,{text:C(o)("workspace.abortedTitle")},{default:Ne(()=>[!b.value&&!e.session.busy&&e.session.pendingInteraction!=="question"&&e.session.pendingInteraction!=="approval"&&e.questionCount===0&&e.approvalCount===0&&(e.session.lastTurnReason==="cancelled"||e.session.lastTurnReason==="failed")?(x(),be(Ns,{key:0,variant:"danger",size:"sm"},{default:Ne(()=>[Xe(O(C(o)("workspace.aborted")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),_("span",fB,[_("span",hB,O(e.session.time),1),b.value?le("",!0):(x(),be(Wn,{key:0,ref_key:"kebabRef",ref:c,class:We(["kebab",{open:a.value}]),size:"sm",label:C(o)("sidebar.options"),onClick:I[2]||(I[2]=bt(P=>p(P),["stop"]))},{default:Ne(()=>[re(je,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(x(),be(rm,{to:"body"},[a.value?(x(),be(gl,{key:0,ref_key:"menuRef",ref:u,class:"menu",style:qt(d.value),onClick:I[3]||(I[3]=bt(()=>{},["stop"]))},{default:Ne(()=>[re(hn,{danger:L.value,onClick:w},{default:Ne(()=>[re(je,{name:$.value?"check":"copy",size:"sm"},null,8,["name"]),Xe(" "+O(L.value?C(o)("sidebar.copyFailed"):$.value?C(o)("sidebar.copied"):C(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),re(hn,{separator:""}),re(hn,{onClick:y},{default:Ne(()=>[re(je,{name:"pencil",size:"sm"}),Xe(" "+O(C(o)("sidebar.rename")),1)]),_:1}),re(hn,{onClick:E},{default:Ne(()=>[re(je,{name:"git-fork",size:"sm"}),Xe(" "+O(C(o)("sidebar.fork")),1)]),_:1}),re(hn,{onClick:T},{default:Ne(()=>[re(je,{name:"download",size:"sm"}),Xe(" "+O(C(o)("sidebar.export")),1)]),_:1}),re(hn,{danger:"",onClick:F},{default:Ne(()=>[re(je,{name:"archive",size:"sm"}),Xe(" "+O(C(o)("sidebar.archive")),1)]),_:1}),re(hn,{separator:""}),_("div",pB,O(l.value),1)]),_:1},8,["style"])):le("",!0)]))],2))}}),gB=at(mB,[["__scopeId","data-v-c1a3c877"]]),vB={class:"gh-top"},yB={class:"gh-name"},kB=["inert"],bB=["disabled"],xB={class:"show-more-label"},wB={class:"show-more-label"},_B={key:2,class:"group-empty"},SB=Ye({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Mt(),o=e,s=t,i=R({get:()=>o.renameValue,set:f=>s("updateRenameValue",f)}),r=R(()=>{if(o.isExpanded(o.group.workspace.id))return o.group.sessions;const f=o.group.sessions.slice(0,o.group.initialCount);if(o.activeId&&!f.some(h=>h.id===o.activeId)){const h=o.group.sessions.find(p=>p.id===o.activeId);if(h)return[...f,h]}return f}),l=R(()=>o.group.sessions.length>o.group.initialCount);function a(){return Math.max(0,o.group.workspace.sessionCount-o.group.sessions.length)}function c(){return o.group.sessions.length-o.group.initialCount}function u(f){o.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}return(f,h)=>(x(),N("div",{class:We(["group",{dragging:e.dragging}])},[_("div",{class:We(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=bt(p=>s("groupClick",e.group.workspace.id,p),["stop"])),onContextmenu:h[8]||(h[8]=p=>s("groupContextmenu",e.group.workspace,p)),onDragstart:d,onDragend:h[9]||(h[9]=p=>s("wsDragend"))},[_("div",vB,[e.isCollapsed(e.group.workspace.id)?(x(),be(je,{key:0,class:"gh-folder",name:"folder-closed"})):(x(),be(je,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(x(),be(Yt,{key:2,text:e.group.workspace.root},{default:Ne(()=>[_("span",yB,O(e.group.workspace.name),1)]),_:1},8,["text"])):$n((x(),N("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=Ji(p=>s("confirmRename"),["enter"])),h[2]||(h[2]=Ji(p=>s("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>s("cancelRename")),onClick:h[4]||(h[4]=bt(()=>{},["stop"]))},null,544)),[[ws,i.value]]),e.renamingId!==e.group.workspace.id?(x(),N("div",{key:4,class:We(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[re(Wn,{class:We(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=bt(p=>s("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Ne(()=>[re(je,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),re(Wn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=bt(p=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ne(()=>[re(je,{name:"chat-new"})]),_:1},8,["label"])],2)):le("",!0)])],34),_("div",{class:We(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(x(!0),N(Pe,null,nt(r.value,p=>(x(),be(gB,{key:p.id,session:p,active:p.id===e.activeId,"approval-count":e.pendingBySession[p.id]?.approvals??0,"question-count":e.pendingBySession[p.id]?.questions??0,unread:e.unreadBySession[p.id]??!1,onSelect:h[10]||(h[10]=g=>s("selectSession",g)),onRename:h[11]||(h[11]=(g,b)=>s("renameSession",g,b)),onArchive:h[12]||(h[12]=g=>s("archiveSession",g)),onFork:h[13]||(h[13]=g=>s("forkSession",g)),onExport:h[14]||(h[14]=g=>s("exportSession",g))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(x(),N("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=bt(p=>s("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",xB,O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,bB)):le("",!0),l.value?(x(),N("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=bt(p=>s("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",wB,O(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):le("",!0),e.group.sessions.length===0?(x(),N("div",_B,O(C(n)("sidebar.noSessions")),1)):le("",!0)],10,kB)],2))}}),CB=at(SB,[["__scopeId","data-v-cdac739a"]]),AB="kimi_desktop",MB="platform",lw="kimi-desktop",aw="kimi-desktop-platform";function EB(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(AB)?(sessionStorage.setItem(lw,"1"),e=!0):e=e||sessionStorage.getItem(lw)==="1";const o=n.get(MB);o?(sessionStorage.setItem(aw,o),t=o):t=sessionStorage.getItem(aw)}catch{}return{isDesktop:e,platform:t}}const Zg=EB(),TB=Zg.isDesktop,Lc=Zg.isDesktop&&Zg.platform==="darwin",NB={class:"ui-kbd"},IB=Ye({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(x(),N("span",NB,[(x(!0),N(Pe,null,nt(e.keys,o=>(x(),N("kbd",{key:o,class:"ui-kbd__key"},O(o),1))),128))]))}}),gr=at(IB,[["__scopeId","data-v-32292ed8"]]),LB=["disabled","aria-pressed"],$B=Ye({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(x(),N("button",{key:0,class:We(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[Fn(t.$slots,"default",{},void 0,!0)],10,LB)):(x(),N("span",{key:1,class:We(["ui-pill",{"is-active":e.active}])},[Fn(t.$slots,"default",{},void 0,!0)],2))}}),hh=at($B,[["__scopeId","data-v-317ace1a"]]),FB={class:"ch"},OB={class:"ch-brand"},RB={class:"ch-backend-ep"},BB={class:"btn-wrap"},DB={class:"search-input"},PB={key:0,class:"empty"},HB={class:"side-section-label"},WB={class:"side-section-title"},zB={class:"side-section-actions"},UB=["onDragover","onDrop"],qB={class:"side-footer"},jB={class:"section-menu-check"},VB={class:"section-menu-check"},KB={class:"section-menu-check"},GB={class:"backend-menu-name"},YB={class:"backend-menu-url"},ZB=1e3,XB=Ye({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},backend:{default:"v1"},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","rename","archive","fork","export","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Mt(),o=!1,s=Z(null),i=R(()=>""),r=["default","multi"];function l(ze){const Ze=s.value?.presets[ze]??"";return Ze?MI(Ze):""}function a(ze){const Ze=s.value;return Ze!==null&&Ze.current===Ze.presets[ze]}const c=e,u=t,d=Z(!1),f=g()?["⌘","K"]:["Ctrl","K"];function h(){u("loadAllSessions"),d.value=!0}function p(ze){(ze.metaKey||ze.ctrlKey)&&ze.key.toLowerCase()==="k"&&(ze.preventDefault(),h())}cn(()=>window.addEventListener("keydown",p)),co(()=>window.removeEventListener("keydown",p));function g(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const ze=navigator.userAgentData;return ze?.platform==="macOS"||ze?.platform==="iOS"}const b=Z(!1);function v(ze){b.value=ze.target.scrollTop>0}const m=Z(new Set(hI()));function y(ze){return m.value.has(ze)}function k(ze){const Ze=new Set(m.value);Ze.has(ze)?Ze.delete(ze):Ze.add(ze),m.value=Ze,i0(Ze)}function A(){const ze=new Set(c.groups.map(Ze=>Ze.workspace.id));m.value=ze,i0(ze)}function $(){const ze=new Set;m.value=ze,i0(ze)}const L=R(()=>c.groups.length>0&&c.groups.every(ze=>m.value.has(ze.workspace.id))),w=Z(new Set);function E(ze){return w.value.has(ze)}function T(ze){const Ze=new Set(w.value);Ze.has(ze)?Ze.delete(ze):Ze.add(ze),w.value=Ze}function F(ze){if(!w.value.has(ze)){const Ze=new Set(w.value);Ze.add(ze),w.value=Ze}u("loadMoreSessions",ze)}const S=Z(null),I=Z(null);function P(ze){S.value=ze}function B(){S.value=null,I.value=null}function W(ze){const Ze=ze.currentTarget.getBoundingClientRect();return ze.clientY<Ze.top+Ze.height/2?"before":"after"}function z(ze,Ze){S.value===null||S.value===Ze||(ze.preventDefault(),ze.dataTransfer&&(ze.dataTransfer.dropEffect="move"),I.value={id:Ze,position:W(ze)})}function D(ze){const Ze=S.value,kt=I.value?.id===ze?I.value.position:"before";if(I.value=null,S.value=null,!Ze||Ze===ze)return;const Bt=II(c.groups.map(Rn=>Rn.workspace.id),Ze,ze,kt);u("reorderWorkspaces",Bt)}function q(ze,Ze){Ze.target.closest(".gh-more, .gh-add")||k(ze)}function j(ze){u("select",ze)}const ie=Z(null),ue=Z(""),pe=Z(null);function ee(){return pe}function ne(ze,Ze){ie.value=ze,ue.value=Ze,mt().then(()=>pe.value?.focus())}function fe(){const ze=ie.value,Ze=ue.value.trim();ze&&Ze&&u("renameWorkspace",ze,Ze),ie.value=null}function Me(){ie.value=null}function $e(ze){ue.value=ze}const ae=Z(!1),U=Z(null),ce=Z({}),se=Z(null);function V(ze){se.value?.el&&!se.value.el.contains(ze.target)&&ke()}function Q(ze,Ze){Ze.preventDefault(),Ze.stopPropagation(),U.value=ze,ce.value={top:`${Ze.clientY}px`,left:`${Ze.clientX}px`},ae.value=!0,document.addEventListener("mousedown",V,!0)}function ke(){ae.value=!1,document.removeEventListener("mousedown",V,!0),U.value=null}function he(){U.value&&Ko(U.value.root),ke()}function ye(){U.value&&ne(U.value.id,U.value.name),ke()}function K(){const ze=U.value;ze&&(ke(),u("deleteWorkspace",ze.id))}const J=Z(null),me=Z(null),Ee=Z({}),Fe=Z(null);function De(ze){const Ze=ze.target;Ze.closest(".gh-more")||Ze.closest(".ws-menu")||Ie()}async function ge(ze,Ze){if(J.value===ze.id){Ie();return}const kt=Ze.currentTarget;me.value=ze,J.value=ze.id,document.addEventListener("mousedown",De),window.addEventListener("resize",Ie),await mt();const Bt=Fe.value?.el,Rn=kt.getBoundingClientRect(),Cn=4,Wt=8,kn=Bt?.offsetHeight??0,Qn=Bt?.offsetWidth??0;let wt=Rn.bottom+Cn;wt+kn>window.innerHeight-Wt&&(wt=Math.max(Wt,Rn.top-kn-Cn));let Xo=Rn.right-Qn;Xo<Wt&&(Xo=Wt),Ee.value={top:`${Math.round(wt)}px`,left:`${Math.round(Xo)}px`}}function Ie(){J.value=null,me.value=null,document.removeEventListener("mousedown",De),window.removeEventListener("resize",Ie)}function Je(ze){Ko(ze.root),Ie()}function it(ze){ne(ze.id,ze.name),Ie()}function St(ze){Ie(),u("deleteWorkspace",ze.id)}const gt=Z(!1),Tt=Z({}),Pt=Z(null);function ft(ze){const Ze=ze.target;Ze.closest(".side-section-kebab")||Ze.closest(".section-menu")||sn()}async function gn(ze){if(gt.value){sn();return}const Ze=ze.currentTarget;gt.value=!0,document.addEventListener("mousedown",ft),window.addEventListener("resize",sn),await mt();const kt=Pt.value?.el,Bt=Ze.getBoundingClientRect(),Rn=4,Cn=8,Wt=kt?.offsetHeight??0,kn=kt?.offsetWidth??0;let Qn=Bt.bottom+Rn;Qn+Wt>window.innerHeight-Cn&&(Qn=Math.max(Cn,Bt.top-Wt-Rn));let wt=Bt.right-kn;wt<Cn&&(wt=Cn),Tt.value={top:`${Math.round(Qn)}px`,left:`${Math.round(wt)}px`}}function sn(){gt.value=!1,document.removeEventListener("mousedown",ft),window.removeEventListener("resize",sn)}function Yo(ze){u("setWorkspaceSortMode",ze),sn()}const jt=Z(!1),vn=Z({}),fo=Z(null);function st(ze){const Ze=ze.target;Ze.closest(".ch-backend")||Ze.closest(".backend-menu")||so()}async function On(ze){if(s.value===null)return;if(jt.value){so();return}const Ze=ze.currentTarget;jt.value=!0,document.addEventListener("mousedown",st),window.addEventListener("resize",so),await mt();const kt=fo.value?.el,Bt=Ze.getBoundingClientRect(),Rn=4,Cn=8,Wt=kt?.offsetHeight??0;let kn=Bt.bottom+Rn;kn+Wt>window.innerHeight-Cn&&(kn=Math.max(Cn,Bt.top-Wt-Rn)),vn.value={top:`${Math.round(kn)}px`,left:`${Math.round(Math.max(Cn,Bt.left))}px`}}function so(){jt.value=!1,document.removeEventListener("mousedown",st),window.removeEventListener("resize",so)}async function io(ze){if(a(ze)){so();return}if(await AI(ze)===null){console.warn("[kimi-web] dev backend switch failed:",ze),so();return}window.location.reload()}co(()=>{document.removeEventListener("mousedown",V,!0),document.removeEventListener("mousedown",De),document.removeEventListener("mousedown",ft),document.removeEventListener("mousedown",st),window.removeEventListener("resize",Ie),window.removeEventListener("resize",sn),window.removeEventListener("resize",so)});const ro=Z(null);let Zo;function Un(){const ze=ro.value;ze&&(ze.classList.remove("blink-now"),ze.getBoundingClientRect(),ze.classList.add("blink-now"),clearTimeout(Zo),Zo=setTimeout(()=>ze.classList.remove("blink-now"),300))}const _o=Li(()=>ps(()=>import("./DesignSystemView-Daj_1mAu.js"),__vite__mapDeps([0,1]))),yn=Z(!1);let Xn,_n=!1;function un(ze){_n=!1,clearTimeout(Xn),ze.currentTarget.setPointerCapture?.(ze.pointerId),Xn=setTimeout(()=>{_n=!0,yn.value=!0},ZB)}function Sn(ze){clearTimeout(Xn);const Ze=ze.currentTarget;Ze.hasPointerCapture?.(ze.pointerId)&&Ze.releasePointerCapture(ze.pointerId)}function Ro(){if(_n){_n=!1;return}Un()}return co(()=>{clearTimeout(Xn)}),(ze,Ze)=>(x(),N("aside",{class:We(["side",{"macos-desktop":C(Lc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:qt({width:e.collapsed?"0px":e.colWidth+"px"})},[_("div",{class:"col",style:qt({width:e.colWidth+"px"})},[_("div",FB,[_("div",OB,[C(Lc)?le("",!0):(x(),N(Pe,{key:0},[(x(),N("svg",{ref_key:"logoRef",ref:ro,class:We(["ch-logo",{"is-dev":C(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:Ro,onPointerdown:un,onPointerup:Sn,onPointercancel:Sn},[...Ze[22]||(Ze[22]=[by('<defs data-v-1b04ce05><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-1b04ce05><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-1b04ce05></rect><g class="ch-eyes" fill="#000" data-v-1b04ce05><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-1b04ce05></rect>',2)])],34)),Ze[23]||(Ze[23]=_("span",{class:"ch-name"},"Kimi Code",-1)),C(o)?(x(),be(hh,{key:0,class:"ch-backend",clickable:s.value!==null,title:C(n)("sidebar.backendTitle",{backend:e.backend,endpoint:i.value}),onClick:On},{default:Ne(()=>[_("span",{class:We(["ch-backend-kind",`is-${e.backend}`])},O(e.backend),3),_("span",RB," · "+O(i.value),1),s.value!==null?(x(),be(je,{key:0,name:"chevron-down",size:"sm"})):le("",!0)]),_:1},8,["clickable","title"])):le("",!0)],64))]),C(Lc)?le("",!0):(x(),be(Wn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Ze[0]||(Ze[0]=bt(kt=>u("collapse"),["stop"]))},{default:Ne(()=>[re(je,{name:"panel-collapse"})]),_:1},8,["label"]))]),_("div",BB,[_("button",{class:"btn-new-chat",type:"button",onClick:Ze[1]||(Ze[1]=bt(kt=>u("create"),["stop"]))},[re(je,{name:"chat-new"}),_("span",null,O(C(n)("sidebar.newChat")),1)]),le("",!0)]),_("div",{class:We(["search-wrap",{"search-wrap--scrolled":b.value}])},[_("button",{class:"search",type:"button",onClick:h},[re(je,{class:"search-icon",name:"search"}),_("span",DB,O(C(n)("sidebar.search")),1),re(gr,{keys:C(f)},null,8,["keys"])])],2),_("div",{class:"sessions",onScroll:v},[e.groups.length===0?(x(),N("div",PB,O(C(n)("workspace.noWorkspace")),1)):(x(),N(Pe,{key:1},[_("div",HB,[_("span",WB,O(C(n)("sidebar.workspaces")),1),_("div",zB,[re(Wn,{class:"side-section-toggle",size:"sm",label:L.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Ze[3]||(Ze[3]=bt(kt=>L.value?$():A(),["stop"]))},{default:Ne(()=>[L.value?(x(),be(je,{key:0,name:"expand"})):(x(),be(je,{key:1,name:"collapse"}))]),_:1},8,["label"]),re(Wn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":gt.value,onClick:Ze[4]||(Ze[4]=bt(kt=>gn(kt),["stop"]))},{default:Ne(()=>[re(je,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(x(!0),N(Pe,null,nt(e.groups,kt=>(x(),N("div",{key:kt.workspace.id,class:We(["ws-drop-target",{"drop-before":I.value?.id===kt.workspace.id&&I.value.position==="before","drop-after":I.value?.id===kt.workspace.id&&I.value.position==="after"}]),onDragover:Bt=>z(Bt,kt.workspace.id),onDrop:Bt=>D(kt.workspace.id)},[re(CB,{group:kt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":ie.value,"rename-value":ue.value,"rename-input-ref":ee(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":J.value,dragging:S.value===kt.workspace.id,"is-collapsed":y,"is-expanded":E,onGroupClick:q,onGroupContextmenu:Q,onToggleWsMenu:ge,onCreateInWorkspace:Ze[5]||(Ze[5]=Bt=>u("createInWorkspace",Bt)),onSelectSession:j,onRenameSession:Ze[6]||(Ze[6]=(Bt,Rn)=>u("rename",Bt,Rn)),onArchiveSession:Ze[7]||(Ze[7]=Bt=>u("archive",Bt)),onForkSession:Ze[8]||(Ze[8]=Bt=>u("fork",Bt)),onExportSession:Ze[9]||(Ze[9]=Bt=>u("export",Bt)),onLoadMore:F,onToggleExpand:T,onConfirmRename:fe,onCancelRename:Me,onUpdateRenameValue:$e,onWsDragstart:P,onWsDragend:B},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"])],42,UB))),128))],64))],32),_("div",qB,[_("button",{class:"btn-settings",type:"button",onClick:Ze[10]||(Ze[10]=bt(kt=>u("openSettings"),["stop"]))},[re(je,{name:"settings"}),_("span",null,O(C(n)("settings.title")),1)])])],4),ae.value?(x(),be(gl,{key:0,ref_key:"ghMenuRef",ref:se,class:"gh-menu",style:qt(ce.value),onClick:Ze[11]||(Ze[11]=bt(()=>{},["stop"]))},{default:Ne(()=>[re(hn,{onClick:he},{default:Ne(()=>[Xe(O(C(n)("sidebar.copyPath")),1)]),_:1}),re(hn,{onClick:ye},{default:Ne(()=>[Xe(O(C(n)("sidebar.rename")),1)]),_:1}),re(hn,{danger:"",onClick:K},{default:Ne(()=>[Xe(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),J.value!==null&&me.value?(x(),be(gl,{key:1,ref_key:"wsMenuRef",ref:Fe,class:"ws-menu",style:qt(Ee.value),onClick:Ze[15]||(Ze[15]=bt(()=>{},["stop"]))},{default:Ne(()=>[re(hn,{onClick:Ze[12]||(Ze[12]=kt=>Je(me.value))},{default:Ne(()=>[Xe(O(C(n)("sidebar.copyPath")),1)]),_:1}),re(hn,{separator:""}),re(hn,{onClick:Ze[13]||(Ze[13]=kt=>it(me.value))},{default:Ne(()=>[Xe(O(C(n)("sidebar.rename")),1)]),_:1}),re(hn,{separator:""}),re(hn,{danger:"",onClick:Ze[14]||(Ze[14]=kt=>St(me.value))},{default:Ne(()=>[Xe(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),gt.value?(x(),be(gl,{key:2,ref_key:"sectionMenuRef",ref:Pt,class:"section-menu",style:qt(Tt.value),onClick:Ze[18]||(Ze[18]=bt(()=>{},["stop"]))},{default:Ne(()=>[re(hn,{onClick:Ze[16]||(Ze[16]=kt=>Yo("manual"))},{default:Ne(()=>[_("span",jB,[e.workspaceSortMode==="manual"?(x(),be(je,{key:0,name:"check",size:"sm"})):le("",!0)]),Xe(" "+O(C(n)("sidebar.sortManual")),1)]),_:1}),re(hn,{onClick:Ze[17]||(Ze[17]=kt=>Yo("recent"))},{default:Ne(()=>[_("span",VB,[e.workspaceSortMode==="recent"?(x(),be(je,{key:0,name:"check",size:"sm"})):le("",!0)]),Xe(" "+O(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):le("",!0),jt.value?(x(),be(gl,{key:3,ref_key:"backendMenuRef",ref:fo,class:"backend-menu",style:qt(vn.value),onClick:Ze[19]||(Ze[19]=bt(()=>{},["stop"]))},{default:Ne(()=>[(x(),N(Pe,null,nt(r,kt=>re(hn,{key:kt,onClick:Bt=>io(kt)},{default:Ne(()=>[_("span",KB,[a(kt)?(x(),be(je,{key:0,name:"check",size:"sm"})):le("",!0)]),_("span",GB,O(kt),1),_("span",YB,O(l(kt)),1)]),_:2},1032,["onClick"])),64))]),_:1},8,["style"])):le("",!0),d.value?(x(),be(ZR,{key:4,sessions:e.sessions,"active-id":e.activeId,onSelect:j,onClose:Ze[20]||(Ze[20]=kt=>d.value=!1)},null,8,["sessions","active-id"])):le("",!0),(x(),be(rm,{to:"body"},[yn.value?(x(),be(C(_o),{key:0,onClose:Ze[21]||(Ze[21]=kt=>yn.value=!1)})):le("",!0)]))],6))}}),QB=at(XB,[["__scopeId","data-v-1b04ce05"]]);function JB(e){try{const t=oo(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function eD(e,t){try{uo(e,String(t))}catch{}}function tD(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(v){return Number.isFinite(v)?Math.min(N4(s),Math.max(o,Math.round(v))):n}const l=Z(r(JB(t)??n)),a=Z(!1);function c(v){const m=r(v);l.value=m,eD(t,m)}let u=0,d=0,f=null,h=-1;function p(v){if(!a.value)return;const m=v.clientX-u;c(d+(i?-m:m))}function g(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",g),f.removeEventListener("pointercancel",g)}f=null,h=-1}}function b(v){v.preventDefault(),a.value=!0,u=v.clientX,d=r(l.value),f=v.currentTarget,h=v.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(h)}catch{}f.addEventListener("pointermove",p),f.addEventListener("pointerup",g),f.addEventListener("pointercancel",g)}return co(g),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:b}}const nD=["aria-label"],oD=Ye({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Mt(),{width:i,dragging:r,onPointerDown:l}=tD({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),Qe(i,a=>o("update:width",a)),Qe(r,a=>o("update:dragging",a)),(a,c)=>(x(),N("div",{class:We(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[_("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,nD))}}),cw=at(oD,[["__scopeId","data-v-ad762f1c"]]),sD={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},iD={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",connectRetrying:"Cannot reach the server — retrying…",internalBuildBanner:"Internal testing only"},rD={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",export:"Export session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},lD={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",recentLabel:"Recent folders",cancel:"Cancel",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search subfolders, or paste an absolute path…",searching:"Searching…",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',checkingPath:"Checking path…",pathPickHint:"Path not found — did you mean:",noPathMatch:"Path not found — no matching folders under {parent}",badParent:"Parent directory does not exist: {parent}",pathFollowHint:'Folder located — press Enter or "Open this folder" to add it.',degradedPlaceholder:"Type an absolute path, press Enter to add…",degradedHint:"File browsing is unavailable — type an absolute path and press Enter to add.",attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},aD={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",everyMinute:"Every minute",everyNMinutes:"Every {n} minutes",everyHour:"Every hour",everyNHours:"Every {n} hours",dailyAt:"Daily at {time}",weekdaysAt:"Weekdays at {time}",expand:"Show more",collapse:"Show less"}},cD={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",goalDesc:"Track one objective until it is complete",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},uD={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedAttachments:"attachment ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",attachmentImage:"Image",attachmentVideo:"Video",attachmentFile:"File",attachmentOpenUnsupported:"Can’t open {name} — this file type isn’t supported",dropToAttach:"Drop files to attach",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachFile:"Attach file",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}"},dD={title:"Sign in to Kimi Code",close:"Close (Esc)",starting:"Starting authorization flow…",lead:"Click the button below to authorize in a new browser tab.",authorizeInBrowser:"Authorize in browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAutoClose:"Waiting for authorization, signs in automatically…",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade kimi-code and try again",pollErrorTitle:"Lost connection to the daemon",pollErrorHint:"Authorization polling failed repeatedly. Check the kimi-code process and try again."},fD={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},hD={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},pD={justNow:"just now"},mD={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",plan_review:"Ready to build with this plan?",generic:"Approve action?"},subagentBadge:"sub agent · {name}",required:"APPROVAL REQUIRED",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Esc to cancel)",feedbackHint:"Enter to submit · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"+Feedback",approvePlan:"Approve plan",revise:"Revise",rejectAndExit:"Reject and Exit"},gD={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},vD={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",openDetail:"Open",collapse:"Collapse",expand:"Expand"},yD={panelTitle:"Thinking",close:"Close"},kD={title:"Changes",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} changes",empty:"No git changes / not provided by daemon",clean:"Working tree clean, no changes",back:"Back",loading:"Loading diff…",noDiff:"No line changes for this file",list:"List",tree:"Tree",close:"Close"},bD={},xD={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",enlargeImage:"Enlarge image",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},wD={searching:"Searching…",noMatch:"No matches"},_D={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",agentError:{title:"Model request failed",connection:"Cannot connect to the model service",auth:"Model authentication failed",rateLimit:"Model rate limit reached",overloaded:"Model overloaded",filtered:"Response filtered by the provider",api:"Model API error",contextOverflow:"Context size exceeded"},details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},SD={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it."},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},CD={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)"}},AD={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},MD={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back"},ED={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},TD={preview:"预览",confirm:"确认",cancel:"取消"},ND={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},ID={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",export:"导出会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},LD={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",recentLabel:"最近的文件夹",cancel:"取消",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"模糊搜索子文件夹,或粘贴绝对路径…",searching:"搜索中…",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',checkingPath:"检查路径…",pathPickHint:"此路径不存在,你是不是想找:",noPathMatch:"此路径不存在,「{parent}」下没有匹配的文件夹",badParent:"上级目录不存在:{parent}",pathFollowHint:'已定位到目标文件夹,按回车或点击"打开此文件夹"完成添加。',degradedPlaceholder:"输入绝对路径,回车添加…",degradedHint:"守护进程无法浏览文件系统,请直接输入绝对路径后回车添加。",attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},$D={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",everyMinute:"每分钟",everyNMinutes:"每 {n} 分钟",everyHour:"每小时",everyNHours:"每 {n} 小时",dailyAt:"每天 {time}",weekdaysAt:"工作日 {time}",expand:"展开",collapse:"收起"}},FD={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",goalDesc:"持续跟踪一个目标,直到任务完成",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},OD={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedAttachments:"附件 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",attachmentImage:"图片",attachmentVideo:"视频",attachmentFile:"文件",attachmentOpenUnsupported:"无法打开 {name}:暂不支持此文件类型",dropToAttach:"松开鼠标添加附件",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachFile:"添加附件",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}"},RD={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试",pollErrorTitle:"与 daemon 的连接已断开",pollErrorHint:"授权轮询连续失败,请检查 kimi-code 进程后重试"},BD={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},DD={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},PD={justNow:"刚刚"},HD={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},WD={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},zD={tag:"任务",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",collapse:"折叠",expand:"展开"},UD={panelTitle:"思考过程",close:"关闭"},qD={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},jD={},VD={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},KD={searching:"搜索中…",noMatch:"无匹配"},GD={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",agentError:{title:"模型请求失败",connection:"无法连接模型服务",auth:"模型认证失败",rateLimit:"模型请求被限流",overloaded:"模型服务过载",filtered:"响应被提供方过滤",api:"模型接口返回错误",contextOverflow:"上下文超出模型限制"},details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},YD={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},ZD={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},XD={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},QD={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},JD={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},eP={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},tP={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},nP={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",notifyOnApproval:"Notify when a tool needs approval",soundOnComplete:"Play a sound when a turn completes, needs an answer, or needs approval",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",backend:"Backend",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},oP={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",backend:"后端",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},sP={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",exportSession:"Export session"},iP={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",exportSession:"导出会话"},rP={title:"Side chat",subtitle:"forked from this session",empty:"Ask a quick question on the side — it shares this session’s context.",placeholder:"Ask the side chat…",send:"Send"},lP={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},aP={en:{common:sD,app:iD,sidebar:rD,workspace:lD,conversation:aD,status:cD,composer:uD,login:dD,providers:fD,model:hD,sessions:pD,approval:mD,question:gD,tasks:vD,thinking:yD,diff:kD,fileTree:bD,filePreview:xD,mention:wD,warnings:_D,commands:SD,tools:CD,layout:AD,mobile:MD,theme:ED,onboarding:eP,settings:nP,header:sP,sideChat:rP},zh:{common:TD,app:ND,sidebar:ID,workspace:LD,conversation:$D,status:FD,composer:OD,login:RD,providers:BD,model:DD,sessions:PD,approval:HD,question:WD,tasks:zD,thinking:UD,diff:qD,fileTree:jD,filePreview:VD,mention:KD,warnings:GD,commands:YD,tools:ZD,layout:XD,mobile:QD,theme:JD,onboarding:tP,settings:oP,header:iP,sideChat:lP}},yA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function cP(){const e=oo(Lt.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const An=tI({legacy:!1,locale:cP(),fallbackLocale:"en",messages:aP});function kA(e){An.global.locale.value=e,uo(Lt.locale,e)}const os=An.global.t,uP={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update"},dP={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal"};function La(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return dP[t]??t}function $a(e){const t=uP[La(e)];return t?os(t):e}const fP={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:"git-pull-request",askuserquestion:"help-circle",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function pm(e){const t=La(e);let n=fP[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),fc(n,"sm")}const bA=80;function hP(e,t=bA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function pP(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function mP(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 Kt(e){return typeof e=="string"&&e.length>0?e:void 0}function cl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function gP(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?:\/\//,"")}}function l0(e){return Kt(e.path)??Kt(e.file_path)??Kt(e.filePath)??Kt(e.filename)}const vP={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function yP(e){const t=Kt(e);if(!t)return;const n=vP[t];return n?os(n):t}function kP(e){const t=cl(e.value),n=Kt(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return os("tools.goal.turns",{value:t});case"tokens":return os("tools.goal.tokens",{value:t});case"milliseconds":return os("tools.goal.milliseconds",{value:t});case"seconds":return os("tools.goal.seconds",{value:t});case"minutes":return os("tools.goal.minutes",{value:t});case"hours":return os("tools.goal.hours",{value:t});default:return os("tools.goal.budget",{value:t,unit:n})}}const bP=64;function _d(e,t,n=!1){const o=(s,i=bA)=>n?s.trim():hP(s,i);try{const s=mP(t);if(!n&&pP(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(La(e)){case"read":{const r=l0(s);if(!r)return i();const l=cl(s.offset)??cl(s.line_start)??cl(s.start_line),a=cl(s.limit)??cl(s.length),c=cl(s.line_end)??cl(s.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return o(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=l0(s);return r?o(`${r} ${os("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=l0(s);return r?o(r):i()}case"bash":{const r=Kt(s.command)??Kt(s.cmd)??Kt(s.script);return r?o(r,bP):i()}case"grep":case"search":{const r=Kt(s.pattern)??Kt(s.query)??Kt(s.regex),l=Kt(s.path)??Kt(s.glob)??Kt(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=Kt(s.pattern)??Kt(s.glob)??Kt(s.query),l=Kt(s.path)??Kt(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):Kt(s.path)?o(Kt(s.path)):i()}case"ls":{const r=Kt(s.path)??Kt(s.dir)??Kt(s.directory)??Kt(s.cwd);return r?o(r):i()}case"web_fetch":{const r=Kt(s.url)??Kt(s.uri);return r?o(gP(r)):i()}case"todo":case"task":{const r=Kt(s.description)??Kt(s.title)??Kt(s.prompt)??Kt(s.name)??Kt(s.subagent_type);if(r)return o(r);const l=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return l?o(os("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=Kt(s.objective),l=Kt(s.completionCriterion);return r&&l?o(os("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?o(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=kP(s);return r?o(r):i()}case"updategoal":{if(n)return i();const r=yP(s.status);return r?o(os("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function xP(e){try{switch(La(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return os("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const o=n.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),o=t.match(/[-−](\d+)/);if(n||o)return`${n?`+${n[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(e.status!=="error")return os("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?os("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const wP=Ye({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(s){switch(s){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const o=R(()=>n(t.status));return(s,i)=>(x(),N("span",{class:We(["kw-dot",`kw-dot--${o.value}`]),"aria-hidden":"true"},null,2))}}),Sd=at(wP,[["__scopeId","data-v-e36198e5"]]),_P=["innerHTML"],SP={class:"bh-text"},CP={class:"a"},AP={key:0,class:"p"},MP={class:"rt"},EP=["aria-label"],TP={key:0,class:"tm"},NP=["inert"],IP={class:"bb-pad"},LP=Ye({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,o=Ut("pinScroll",()=>{}),s=Z(null);function i(){n("toggle");const r=s.value;r&&mt(()=>o(r))}return(r,l)=>(x(),N("div",{class:We(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[_("div",{class:"bh",ref_key:"bhEl",ref:s,onClick:i},[e.icon?(x(),N("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,_P)):le("",!0),_("span",SP,[_("span",CP,O(e.name),1),re(Yt,{text:e.arg},{default:Ne(()=>[e.arg?(x(),N("span",AP,O(e.arg),1)):le("",!0)]),_:1},8,["text"])]),_("span",MP,[_("span",{class:We(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(x(),be(je,{key:0,name:"check",size:"sm"})):e.status==="error"?(x(),be(je,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(x(),be(Sd,{key:2,status:"suspended"})):(x(),be(Sd,{key:3,status:"running"}))],10,EP),Fn(r.$slots,"trailing"),e.time?(x(),N("span",TP,O(e.time),1)):le("",!0)]),e.expandable?(x(),be(je,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):le("",!0)],512),_("div",{class:We(["bb",{open:e.open}]),inert:!e.open},[_("div",IP,[Fn(r.$slots,"default")])],10,NP)],2))}}),mm=at(LP,[["__scopeId","data-v-fef8aad2"]]),$P={key:0,class:"at-type"},FP={key:1,class:"at-task"},OP={key:2,class:"bb-code"},RP=Ye({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=Mt(),o=e,s=t;function i(v){if(!v)return{};try{const m=JSON.parse(v);return{description:typeof m.description=="string"?m.description:void 0,subagentType:typeof m.subagent_type=="string"?m.subagent_type:void 0,prompt:typeof m.prompt=="string"?m.prompt:void 0}}catch{return{}}}const r=R(()=>i(o.tool.arg)),l=R(()=>!!o.tool.output&&o.tool.output.length>0),a=R(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=Z(o.tool.defaultExpanded===!0&&a.value),u=R(()=>o.tool.status),d=R(()=>$a(o.tool.name)),f=R(()=>pm(o.tool.name)),h=R(()=>r.value.description||r.value.subagentType||""),p=Ut("resolveAgentTaskId"),g=R(()=>p?p(o.tool.id)!==void 0:!0);function b(){a.value&&(c.value=!c.value)}return Qe(()=>[o.tool.defaultExpanded,o.tool.output?.length,o.tool.status],()=>{o.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(v,m)=>(x(),be(mm,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:b},{trailing:Ne(()=>[g.value?(x(),N("button",{key:0,type:"button",class:"at-open",onClick:m[0]||(m[0]=bt(y=>s("openAgent",e.tool.id),["stop"]))},O(C(n)("tasks.openDetail")),1)):le("",!0)]),default:Ne(()=>[r.value.subagentType?(x(),N("div",$P,O(r.value.subagentType),1)):le("",!0),r.value.prompt?(x(),N("div",FP,O(r.value.prompt),1)):le("",!0),l.value?(x(),N("div",OP,[(x(!0),N(Pe,null,nt(e.tool.output??[],(y,k)=>(x(),N("div",{key:k},O(y),1))),128))])):le("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),BP=at(RP,[["__scopeId","data-v-14ef8750"]]);function DP(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 Bf={recognized:!1,answers:{},note:""};function PP(e){const t=e?.[0];if(!t)return Bf;let n;try{n=JSON.parse(t)}catch{return Bf}if(!n||typeof n!="object"||Array.isArray(n))return Bf;const o=n.answers;if(!o||typeof o!="object"||Array.isArray(o))return Bf;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 HP(e,t,n){return e[t]??e[`q_${n}`]}const WP=/^opt_\d+_(\d+)$/;function zP(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 c=WP.exec(l);c?s.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:s,otherText:i.join(", "),indeterminate:!1}}const UP={key:0,class:"chip"},qP={key:0,class:"au-dismissed"},jP={key:1,class:"au-list"},VP={class:"au-q"},KP={key:0,class:"au-hdr"},GP={class:"au-qtext"},YP={class:"au-opts"},ZP={class:"au-glyph"},XP={class:"au-label"},QP={key:0,class:"au-desc"},JP={key:0,class:"au-opt sel"},eH={class:"au-glyph"},tH={class:"au-label"},nH={key:1,class:"au-opt sel"},oH={class:"au-label"},sH={key:2,class:"au-raw"},iH=80,rH=Ye({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=Mt();function o(L,w=iH){const E=L.trim();return E.length>w?E.slice(0,w-1)+"…":E}const s=R(()=>DP(t.tool.arg)),i=R(()=>PP(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((L,w)=>zP(HP(i.value.answers,L.question,w),L.options))),c=R(()=>Object.keys(i.value.answers).length);function u(L,w){return a.value[L]?.selected.has(w)??!1}function d(L){return a.value[L]?.otherText??""}function f(L){return a.value[L]?.indeterminate??!1}function h(L,w){return L?w?"■":"□":w?"●":"○"}const p=R(()=>{if(!r.value)return o(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const L=s.value[0]?.question??"",w=o(L);return s.value.length<=1?w:`${w} ${n("tools.ask.more",{count:s.value.length-1})}`}),g=R(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),b=R(()=>!!t.tool.output&&t.tool.output.length>0),v=R(()=>r.value&&(s.value.length>0||l.value)||b.value),m=Z(t.tool.defaultExpanded===!0&&v.value),y=R(()=>t.tool.status),k=R(()=>$a(t.tool.name)),A=R(()=>pm(t.tool.name));function $(){v.value&&(m.value=!m.value)}return Qe(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&v.value&&(m.value=!0)}),(L,w)=>(x(),be(mm,{status:y.value,icon:A.value,name:k.value,arg:m.value?"":p.value,time:e.tool.timing,open:m.value,expandable:v.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:$},{trailing:Ne(()=>[g.value?(x(),N("span",UP,O(g.value),1)):le("",!0)]),default:Ne(()=>[l.value?(x(),N("div",qP,O(i.value.note),1)):r.value?(x(),N("div",jP,[(x(!0),N(Pe,null,nt(s.value,(E,T)=>(x(),N("div",{key:T,class:"au-block"},[_("div",VP,[E.header?(x(),N("span",KP,O(E.header),1)):le("",!0),_("span",GP,O(E.question),1)]),_("div",YP,[(x(!0),N(Pe,null,nt(E.options,(F,S)=>(x(),N("div",{key:S,class:We(["au-opt",{sel:u(T,S)}])},[_("span",ZP,O(h(E.multiSelect,u(T,S))),1),_("span",XP,O(F.label),1),F.description?(x(),N("span",QP,O(F.description),1)):le("",!0)],2))),128)),d(T)?(x(),N("div",JP,[_("span",eH,O(h(E.multiSelect,!0)),1),_("span",tH,O(d(T)),1)])):le("",!0),f(T)?(x(),N("div",nH,[w[0]||(w[0]=_("span",{class:"au-glyph"},"●",-1)),_("span",oH,O(C(n)("tools.ask.answered")),1)])):le("",!0)])]))),128))])):(x(),N("div",sH,[(x(!0),N(Pe,null,nt(e.tool.output??[],(E,T)=>(x(),N("div",{key:T},O(E),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),lH=at(rH,[["__scopeId","data-v-a9a0f259"]]),aH=1e6,uw=5e3;function dw(e){if(e==="")return[];const t=e.split(`
68
- `);return t.at(-1)===""&&t.pop(),t}function cH(e,t){const n=dw(e),o=dw(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>uw||i>uw||(s+1)*(i+1)>aH)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=s;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===o[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:f}),f++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function uH(e){let t=0,n=0;for(const o of e)o.type==="add"?t++:o.type==="del"&&n++;return{added:t,removed:n}}function xA(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 wA(e){const t=La(e.name);if(t!=="edit"&&t!=="write")return null;const n=xA(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const o=typeof n.old_string=="string"?n.old_string:void 0,s=typeof n.new_string=="string"?n.new_string:void 0;return o===void 0||s===void 0?null:cH(o,s)}return null}function dH(e){const t=xA(e);return t&&typeof t.path=="string"?t.path:void 0}function fH(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const hH={key:0,class:"bb-empty"},fw=50,pH=Ye({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=R(()=>t.lines??[]),o=R(()=>n.value.length>fw),s={"--tool-output-visible-lines":String(fw)};return(i,r)=>(x(),N("div",{class:We(["bb-code tool-output-block",{scroll:o.value}]),style:s},[n.value.length===0&&e.emptyText?(x(),N("div",hH,O(e.emptyText),1)):le("",!0),(x(!0),N(Pe,null,nt(n.value,(l,a)=>(x(),N("div",{key:a},O(l),1))),128))],2))}}),_A=at(pH,[["__scopeId","data-v-262bbea0"]]),mH={key:0,class:"chip"},gH={key:0,class:"bb-summary"},vH=Ye({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>n.tool.status),i=R(()=>$a(n.tool.name)),r=R(()=>pm(n.tool.name)),l=R(()=>_d(n.tool.name,n.tool.arg)),a=R(()=>_d(n.tool.name,n.tool.arg,!0)),c=R(()=>wA(n.tool)),u=R(()=>{const g=c.value;if(g&&n.tool.status!=="error"){const{added:b,removed:v}=uH(g);if(b||v)return`+${b} −${v}`}return""}),d=R(()=>!!n.tool.output&&n.tool.output.length>0),f=Z(!1),h=R(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){o("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(g,b)=>(x(),be(mm,{status:s.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:Ne(()=>[u.value?(x(),N("span",mH,O(u.value),1)):le("",!0)]),default:Ne(()=>[a.value?(x(),N("div",gH,O(a.value),1)):le("",!0),re(_A,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),yH=at(vH,[["__scopeId","data-v-74e1da99"]]),kH={key:0,class:"chip"},bH={key:0,class:"bb-summary"},xH=Ye({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=R(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),o=R(()=>!!t.tool.output&&t.tool.output.length>0),s=R(()=>o.value||n.value),i=Z(t.tool.defaultExpanded===!0&&s.value),r=R(()=>t.tool.status),l=R(()=>$a(t.tool.name)),a=R(()=>pm(t.tool.name)),c=R(()=>_d(t.tool.name,t.tool.arg)),u=R(()=>_d(t.tool.name,t.tool.arg,!0)),d=R(()=>xP({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){s.value&&(i.value=!i.value)}return Qe(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&s.value&&(i.value=!0)}),(h,p)=>(x(),be(mm,{status:r.value,icon:a.value,name:l.value,arg:i.value?"":c.value,time:e.tool.name!=="bash"?e.tool.timing:"",open:i.value,expandable:s.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:Ne(()=>[d.value?(x(),N("span",kH,O(d.value),1)):le("",!0)]),default:Ne(()=>[u.value?(x(),N("div",bH,O(u.value),1)):le("",!0),re(_A,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),wH=at(xH,[["__scopeId","data-v-aa4edcb0"]]),_H={class:"media-title"},SH=["src","alt"],CH=["src"],AH=["src"],MH=Ye({__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(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=R(()=>{const c=s.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=s.value;c?.kind==="image"&&o("openMedia",c)}return(c,u)=>s.value?(x(),N("div",{key:0,class:We(["media-tool",{mob:e.mobile}])},[re(Yt,{text:s.value.path||l.value},{default:Ne(()=>[_("div",_H,O(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(x(),be(Yt,{key:0,text:s.value.path||l.value},{default:Ne(()=>[_("button",{type:"button",class:"media-image-button",onClick:a},[_("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,SH)])]),_:1},8,["text"])):s.value.kind==="video"?(x(),N("video",{key:1,class:"media-video",src:s.value.url,controls:"",preload:"metadata"},null,8,CH)):(x(),N("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,AH))],2)):le("",!0)}}),EH=at(MH,[["__scopeId","data-v-bec13b73"]]),TH=/<summary>([\s\S]*?)<\/summary>/,NH=/<resume_hint>([\s\S]*?)<\/resume_hint>/,a0=/<subagent\b([^>]*)>|<\/subagent>/g,IH="</subagent>",hw=/(completed|failed|aborted):\s*(\d+)/g,pw=/([a-z_]+)="([^"]*)"/g;function LH(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function $H(e){const t={};pw.lastIndex=0;let n;for(;(n=pw.exec(e))!==null;)t[n[1]]=LH(n[2]);return t}function FH(e){const t={completed:0,failed:0,aborted:0};hw.lastIndex=0;let n;for(;(n=hw.exec(e))!==null;){const o=n[1];t[o]=Number(n[2])}return t}function OH(e,t){const n=$H(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function RH(e){const t=[],n=[];a0.lastIndex=0;let o;for(;(o=a0.exec(e))!==null;)if(o[0]===IH){if(n.length===0)continue;const s=n.pop();s&&n.length===0&&t.push(OH(s.attrs,e.slice(s.bodyStart,o.index)))}else n.length===0?n.push({attrs:o[1]??"",bodyStart:a0.lastIndex}):n.push(null);return t}function BH(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
69
- `):e;if(!t.includes("<agent_swarm_result>"))return null;const n=TH.exec(t)?.[1]?.trim()??"",{completed:o,failed:s,aborted:i}=FH(n),r=NH.exec(t)?.[1]?.trim(),l=RH(t),a=o+s+i;return{summary:n,completed:o,failed:s,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function mw(e){return e?e.split(`
70
- `).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function DH(e){return e.suspendedReason||mw(e.text)||mw(e.outputLines?.join(`
71
- `))||e.summary||""}function PH(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
72
- `):e.summary??""}function HH(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function gw(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
73
- `)[0]??"",phase:HH(e.outcome),body:e.body}}function WH(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function zH(e,t){const n=e.map(s=>({id:s.id,name:s.name,activity:DH(s),phase:s.phase,body:PH(s)}));if(!t)return n;const o=t.subagents.filter(s=>(s.outcome==="aborted"||s.state==="not_started")&&!e.some(i=>WH(i,s))).map((s,i)=>gw(s,i));return n.length>0?[...n,...o]:t.subagents.map((s,i)=>gw(s,i))}const UH=["aria-expanded"],qH={class:"title"},jH={key:0,class:"meta"},VH={key:1,class:"sum-txt"},KH={class:"rt"},GH={class:"status"},YH={key:0,class:"chip"},ZH={key:1,class:"tm"},XH={class:"body"},QH={class:"overview"},JH={class:"overview-line"},eW={class:"big"},tW={key:0,class:"lbl"},nW={key:1,class:"lbl"},oW={key:2,class:"lbl"},sW={key:0,class:"seg","aria-hidden":"true"},iW={key:1,class:"legend"},rW=["aria-expanded","onClick"],lW={class:"mname"},aW={class:"mact"},cW={class:"mphase"},uW={key:1,class:"fallback-output"},dW={key:2,class:"waiting"},fW=Ye({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=Mt(),n=e;function o(T){if(!T)return{};try{const F=JSON.parse(T),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const s=Ut("resolveSwarmMembers"),i=R(()=>o(n.tool.arg)),r=R(()=>$a(n.tool.name)),l=R(()=>i.value.description??""),a=R(()=>s?.(n.tool.id)??[]),c=R(()=>BH(n.tool.output)),u=R(()=>n.tool.status),d=R(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=R(()=>zH(a.value,c.value)),h=R(()=>{const T={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)T[F.phase]++;return T}),p=R(()=>f.value.length||i.value.itemCount||0),g=R(()=>h.value.completed+h.value.failed),b=R(()=>h.value.working+h.value.suspended+h.value.queued),v=[{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"}],m=R(()=>v.map(({phase:T,cls:F})=>({phase:T,count:h.value[T],cls:F})).filter(T=>T.count>0)),y=Z(u.value==="running"||b.value>0);function k(){y.value=!y.value}const A=R(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
74
- `).trim()),$=Z(new Set);function L(T){const F=new Set($.value);F.has(T)?F.delete(T):F.add(T),$.value=F}function w(T){return $.value.has(T)}function E(T){return t(`tools.swarm.phase${T[0].toUpperCase()}${T.slice(1)}`)}return(T,F)=>(x(),N("div",{class:We(["swarm-card",{open:y.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[_("button",{class:"head",type:"button","aria-expanded":y.value,onClick:k},[re(je,{class:"ic",name:"git-pull-request",size:"sm"}),_("span",qH,O(r.value),1),l.value?(x(),N("span",jH,"·")):le("",!0),l.value?(x(),N("span",VH,O(l.value),1)):le("",!0),_("span",KH,[_("span",GH,[d.value==="ok"?(x(),be(je,{key:0,name:"check",size:"sm"})):d.value==="error"?(x(),be(je,{key:1,name:"close",size:"sm"})):(x(),be(Sd,{key:2,status:"running"}))]),g.value>0||p.value>0?(x(),N("span",YH,O(g.value)+" / "+O(p.value),1)):le("",!0),e.tool.timing?(x(),N("span",ZH,O(e.tool.timing),1)):le("",!0)]),re(je,{class:"car",name:y.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,UH),$n(_("div",XH,[_("div",QH,[_("div",JH,[_("span",eW,O(C(t)("tools.swarm.progress",{done:g.value,total:p.value})),1),d.value==="running"&&p.value>0?(x(),N("span",tW,O(C(t)("tools.swarm.runningSub",{count:b.value})),1)):c.value?(x(),N("span",nW,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(x(),N("span",oW,O(C(t)("tools.swarm.waiting")),1))]),p.value>0&&m.value.length>0?(x(),N("div",sW,[(x(!0),N(Pe,null,nt(m.value,S=>(x(),N("span",{key:S.phase,class:We(S.cls),style:qt({flex:S.count})},null,6))),128))])):le("",!0),m.value.length>1?(x(),N("div",iW,[(x(!0),N(Pe,null,nt(m.value,S=>(x(),N("span",{key:S.phase},[_("i",{class:We(["lg-dot",S.cls])},null,2),Xe(O(E(S.phase))+" "+O(S.count),1)]))),128))])):le("",!0)]),f.value.length>0?(x(!0),N(Pe,{key:0},nt(f.value,S=>(x(),N("div",{key:S.id,class:We(["member",[`phase-${S.phase}`,{open:w(S.id)}]])},[_("button",{class:"member-head",type:"button","aria-expanded":w(S.id),onClick:I=>L(S.id)},[re(Sd,{class:"row-dot",status:S.phase},null,8,["status"]),re(Yt,{text:S.name},{default:Ne(()=>[_("span",lW,O(S.name),1)]),_:2},1032,["text"]),S.activity?(x(),be(Yt,{key:0,text:S.activity},{default:Ne(()=>[_("span",aW,O(S.activity),1)]),_:2},1032,["text"])):le("",!0),_("span",cW,O(E(S.phase)),1),re(je,{class:"mcar",name:w(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,rW),$n(_("div",{class:"member-body"},O(S.body),513),[[mi,w(S.id)]])],2))),128)):A.value?(x(),N("div",uW,O(A.value),1)):(x(),N("div",dW,O(C(t)("tools.swarm.waiting")),1))],512),[[mi,y.value]])],2))}}),hW=at(fW,[["__scopeId","data-v-4b58e128"]]);function pW(e){if(e.media&&e.status==="ok")return EH;const t=La(e.name);return t==="edit"||t==="write"||t==="multi_edit"?yH:t==="task"?BP:t==="agentswarm"?hW:t==="askuserquestion"?lH:wH}const SA=Ye({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>pW(n.tool));return(i,r)=>(x(),be(qo(s.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>o("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>o("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>o("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>o("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel","data-scroll-anchor-id"]))}});function vw(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function mW(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=(e%6e4/1e3).toFixed(1);return`${t}m${n}s`}function gm(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 gW(e){return!(e.tool.status==="ok"&&e.tool.media)}function vW(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function yW(e){const t=gm(e),n=[];let o=[];const s=()=>{if(o.length===1){const[i]=o;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else o.length>1&&n.push({kind:"tool-stack",tools:o});o=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(gW(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),s(),n}function kW(e){return gm(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
75
-
76
- `)}function bW(e){const t=[];for(const n of gm(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
77
- > ${n.thinking.split(`
78
- `).join(`
79
- > `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const o=n.tool.output.join(`
80
- `);t.push(`\`\`\`
81
- [${n.tool.name}]
82
- ${o}
83
- \`\`\``)}return t.join(`
84
-
85
- `)}function CA(e){return e.tool.id||`tool-${e.sourceIndex}`}function xW(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?CA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const wW=["aria-expanded"],_W={class:"tg-title"},SW={class:"tg-meta"},CW=["inert"],AW={class:"tool-group-body-inner"},MW=Ye({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=Z(!0),i=R(()=>n.tools.length),r=R(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=Mt(),a=R(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){s.value=!s.value}const u=Ut("pinScroll",()=>{}),d=Z(null);function f(){c();const h=d.value;h&&mt(()=>u(h))}return(h,p)=>(x(),N("div",{class:We(["tool-group",{open:s.value}])},[_("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":s.value,onClick:f},[re(Sd,{status:r.value},null,8,["status"]),re(je,{class:"tg-ic",name:"list",size:"sm"}),_("span",_W,O(C(l)("tools.group.title",i.value)),1),_("span",SW,"· "+O(a.value),1),re(je,{class:"tg-car",name:"chevron-right",size:"sm"})],8,wW),_("div",{class:We(["tool-group-body",{open:s.value}]),inert:!s.value},[_("div",AW,[(x(!0),N(Pe,null,nt(e.tools,(g,b)=>(x(),be(SA,{key:C(CA)(g),tool:g.tool,mobile:e.mobile,"stack-position":C(vW)(b,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=v=>o("openMedia",v)),onOpenFile:p[1]||(p[1]=v=>o("openFile",v)),onOpenToolDiff:p[2]||(p[2]=v=>o("openToolDiff",v)),onOpenAgent:p[3]||(p[3]=v=>o("openAgent",v))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,CW)],2))}}),EW=at(MW,[["__scopeId","data-v-37eb334f"]]);var TW=Object.create,Fy=Object.defineProperty,NW=Object.getOwnPropertyDescriptor,AA=Object.getOwnPropertyNames,IW=Object.getPrototypeOf,LW=Object.prototype.hasOwnProperty,MA=(e,t)=>function(){return t||(0,e[AA(e)[0]])((t={exports:{}}).exports,t),t.exports},EA=e=>{let t={};for(var n in e)Fy(t,n,{get:e[n],enumerable:!0});return t},$W=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=AA(t),i=0,r=s.length,l;i<r;i++)l=s[i],!LW.call(e,l)&&l!==n&&Fy(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=NW(t,l))||o.enumerable});return e},TA=(e,t,n)=>(n=e!=null?TW(IW(e)):{},$W(Fy(n,"default",{value:e,enumerable:!0}),e));function FW(e,t,n,o){const s=Number(e[t].meta.id+1).toString();let i="";return typeof o.docId=="string"&&(i=`-${o.docId}-`),i+s}function OW(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function RW(e,t,n,o,s){const i=s.rules.footnote_anchor_name(e,t,n,o,s),r=s.rules.footnote_caption(e,t,n,o,s);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function BW(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
86
- `:`<hr class="footnotes-sep">
87
- `)+`<section class="footnotes">
88
- <ol class="footnotes-list">
89
- `}function DW(){return`</ol>
90
- </section>
91
- `}function PW(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function HW(){return`</li>
92
- `}function WW(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function zW(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=RW,e.renderer.rules.footnote_block_open=BW,e.renderer.rules.footnote_block_close=DW,e.renderer.rules.footnote_open=PW,e.renderer.rules.footnote_close=HW,e.renderer.rules.footnote_anchor=WW,e.renderer.rules.footnote_caption=OW,e.renderer.rules.footnote_anchor_name=FW;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h<f;h++){if(l.src.charCodeAt(h)===32)return!1;if(l.src.charCodeAt(h)===93)break}if(h===d+2||h+1>=f||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const p=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${p}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:p},g.level=l.level++,l.tokens.push(g);const b=l.bMarks[a],v=l.tShift[a],m=l.sCount[a],y=l.parentType,k=h,A=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let $=A;for(;h<f;){const w=l.src.charCodeAt(h);if(n(w))w===9?$+=4-$%4:$++;else break;h++}l.tShift[a]=h-k,l.sCount[a]=$-A,l.bMarks[a]=k,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=y,l.blkIndent-=4,l.tShift[a]=v,l.sCount[a]=m,l.bMarks[a]=b;const L=new l.Token("footnote_reference_close","",-1);return L.level=--l.level,l.tokens.push(L),!0}function s(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,g=h.length;p<g;p++){const b=new l.Token("footnote_open","",1);if(b.meta={id:p,label:h[p].label},l.tokens.push(b),h[p].tokens){a=[];const y=new l.Token("paragraph_open","p",1);y.block=!0,a.push(y);const k=new l.Token("inline","",0);k.children=h[p].tokens,k.content=h[p].content,a.push(k);const A=new l.Token("paragraph_close","p",-1);A.block=!0,a.push(A)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let v;l.tokens[l.tokens.length-1].type==="paragraph_close"?v=l.tokens.pop():v=null;const m=h[p].count>0?h[p].count:1;for(let y=0;y<m;y++){const k=new l.Token("footnote_anchor","",0);k.meta={id:p,subId:y,label:h[p].label},l.tokens.push(k)}v&&l.tokens.push(v),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",o,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",s),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function UW(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==43)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){let i;const r=[],l=s.length;for(let a=0;a<l;a++){const c=s[a];if(c.marker!==43||c.end===-1)continue;const u=s[c.end];i=o.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=o.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",o.tokens[u.token-1].type==="text"&&o.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<o.tokens.length&&o.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=o.tokens[c],o.tokens[c]=o.tokens[a],o.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(o){const s=o.tokens_meta,i=(o.tokens_meta||[]).length;n(o,o.delimiters);for(let r=0;r<i;r++)s[r]&&s[r].delimiters&&n(o,s[r].delimiters)})}function qW(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==61)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){const i=[],r=s.length;for(let l=0;l<r;l++){const a=s[l];if(a.marker!==61||a.end===-1)continue;const c=s[a.end],u=o.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=o.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",o.tokens[c.token-1].type==="text"&&o.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<o.tokens.length&&o.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=o.tokens[a];o.tokens[a]=o.tokens[l],o.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(o){let s;const i=o.tokens_meta,r=(o.tokens_meta||[]).length;for(n(o,o.delimiters),s=0;s<r;s++)i[s]&&i[s].delimiters&&n(o,i[s].delimiters)})}const jW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function VW(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==126||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(jW,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function KW(e){e.inline.ruler.after("emphasis","sub",VW)}const GW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function YW(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==94||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(GW,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function ZW(e){e.inline.ruler.after("emphasis","sup",YW)}var XW=MA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(g,b){b=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},b),g.core.ruler.after("inline","github-task-lists",function(v){for(var m=v.tokens,y=0,k=2;k<m.length;k++)s(m,k)&&(i(m[k],y,b,v.Token),y+=1,n(m[k-2],"class",b.liClass),n(m[o(m,k-2)],"class",b.ulClass))})};function n(g,b,v){var m=g.attrIndex(b),y=[b,v];m<0?g.attrPush(y):g.attrs[m]=y}function o(g,b){for(var v=g[b].level-1,m=b-1;m>=0;m--)if(g[m].level===v)return m;return-1}function s(g,b){return d(g[b])&&f(g[b-1])&&h(g[b-2])&&p(g[b])}function i(g,b,v,m){var y=v.idPrefix+b;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(y,m)),g.children.push(a(m)),g.children.unshift(r(g,y,v,m)),v.divWrap&&(g.children.unshift(c(v,m)),g.children.push(u(m)))}function r(g,b,v,m){var y=new m("checkbox_input","input",0);return y.attrs=[["type","checkbox"],["id",b]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&y.attrs.push(["checked","true"]),v.disabled===!0&&y.attrs.push(["disabled","true"]),y}function l(g,b){var v=new b("label_open","label",1);return v.attrs=[["for",g]],v}function a(g){return new g("label_close","label",-1)}function c(g,b){var v=new b("checkbox_open","div",0);return v.attrs=[["class",g.divClass]],v}function u(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function p(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})}),QW=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),JW=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),c0;const ez=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),tz=(c0=String.fromCodePoint)!==null&&c0!==void 0?c0:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function nz(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=ez.get(e))!==null&&t!==void 0?t:e}var Fo;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Fo||(Fo={}));const oz=32;var vl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(vl||(vl={}));function Xg(e){return e>=Fo.ZERO&&e<=Fo.NINE}function sz(e){return e>=Fo.UPPER_A&&e<=Fo.UPPER_F||e>=Fo.LOWER_A&&e<=Fo.LOWER_F}function iz(e){return e>=Fo.UPPER_A&&e<=Fo.UPPER_Z||e>=Fo.LOWER_A&&e<=Fo.LOWER_Z||Xg(e)}function rz(e){return e===Fo.EQUALS||iz(e)}var $o;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})($o||($o={}));var pl;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(pl||(pl={}));var lz=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=$o.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=pl.Strict}startEntity(e){this.decodeMode=e,this.state=$o.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case $o.EntityStart:return e.charCodeAt(t)===Fo.NUM?(this.state=$o.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=$o.NamedEntity,this.stateNamedEntity(e,t));case $o.NumericStart:return this.stateNumericStart(e,t);case $o.NumericDecimal:return this.stateNumericDecimal(e,t);case $o.NumericHex:return this.stateNumericHex(e,t);case $o.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|oz)===Fo.LOWER_X?(this.state=$o.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=$o.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,o){if(t!==n){const s=n-t;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(t,s),o),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(Xg(o)||sz(o))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(Xg(o))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Fo.SEMI)this.consumed+=1;else if(this.decodeMode===pl.Strict)return 0;return this.emitCodePoint(nz(this.result),this.consumed),this.errors&&(e!==Fo.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let o=n[this.treeIndex],s=(o&vl.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=az(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===pl.Attribute&&(s===0||rz(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&vl.VALUE_LENGTH)>>14,s!==0){if(i===Fo.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==pl.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,o=(n[t]&vl.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[e]&~vl.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case $o.NamedEntity:return this.result!==0&&(this.decodeMode!==pl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case $o.NumericDecimal:return this.emitNumericEntity(0,2);case $o.NumericHex:return this.emitNumericEntity(0,3);case $o.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case $o.EntityStart:return 0}}};function NA(e){let t="";const n=new lz(e,o=>t+=tz(o));return function(s,i){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(i);const c=n.write(s,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+s.slice(r);return t="",a}}function az(e,t,n,o){const s=(t&vl.BRANCH_LENGTH)>>7,i=t&vl.JUMP_TABLE;if(s===0)return i!==0&&o===i?n:-1;if(i){const a=o-i;return a<0||a>=s?-1:e[n+a]-1}let r=n,l=r+s-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<o)r=a+1;else if(c>o)l=a-1;else return e[a+s]}return-1}const cz=NA(QW);NA(JW);function Oy(e,t=pl.Legacy){return cz(e,t)}var uz=TA(XW());const yw={};function dz(e){let t=yw[e];if(t)return t;t=yw[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function vm(e,t){typeof t!="string"&&(t=vm.defaultChars);const n=dz(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let s="";for(let i=0,r=o.length;i<r;i+=3){const l=parseInt(o.slice(i+1,i+3),16);if(l<128){s+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(o.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?s+="��":s+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16),u=parseInt(o.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}vm.defaultChars=";/?:@&=+$,#";vm.componentChars="";var Qg=vm;const kw={};function fz(e){let t=kw[e];if(t)return t;t=kw[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function ym(e,t,n){typeof t!="string"&&(n=t,t=ym.defaultChars),typeof n>"u"&&(n=!0);const o=fz(t);let s="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){s+=e.slice(i,i+3),i+=2;continue}if(l<128){s+=o[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}ym.defaultChars=";/?:@&=+$,-_.!~*'()#";ym.componentChars="-_.!~*'()";var IA=ym;function Ry(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function tp(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const hz=/^([a-z0-9.+-]+:)/i,pz=/:[0-9]*$/,mz=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,gz=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
93
- `," "]),vz=["'"].concat(gz),bw=["%","/","?",";","#"].concat(vz),xw=["/","?","#"],yz=255,ww=/^[+a-z0-9A-Z_-]{0,63}$/,kz=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_w={javascript:!0,"javascript:":!0},Sw={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function bz(e,t){if(e&&e instanceof tp)return e;const n=new tp;return n.parse(e,t),n}tp.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=mz.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=hz.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&_w[r])&&(i=i.substr(2),this.slashes=!0)),!_w[r]&&(s||r&&!Sw[r])){let c=-1;for(let p=0;p<xw.length;p++)o=i.indexOf(xw[p]),o!==-1&&(c===-1||o<c)&&(c=o);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let p=0;p<bw.length;p++)o=i.indexOf(bw[p]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let g=0,b=p.length;g<b;g++){const v=p[g];if(v&&!v.match(ww)){let m="";for(let y=0,k=v.length;y<k;y++)v.charCodeAt(y)>127?m+="x":m+=v[y];if(!m.match(ww)){const y=p.slice(0,g),k=p.slice(g+1),A=v.match(kz);A&&(y.push(A[1]),k.unshift(A[2])),k.length&&(i=k.join(".")+i),this.hostname=y.join(".");break}}}}this.hostname.length>yz&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),Sw[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};tp.prototype.parseHost=function(e){let t=pz.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var By=bz,LA=EA({decode:()=>Qg,encode:()=>IA,format:()=>Ry,parse:()=>By}),$A=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,FA=/[\0-\x1F\x7F-\x9F]/,xz=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,OA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,wz=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,RA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,_z=EA({Any:()=>$A,Cc:()=>FA,Cf:()=>xz,P:()=>OA,S:()=>wz,Z:()=>RA}),Sz=Object.defineProperty,BA=e=>{let t={};for(var n in e)Sz(t,n,{get:e[n],enumerable:!0});return t},ko=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,o=t.length;n<o;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Cz=BA({arrayReplaceAt:()=>Lz,assign:()=>Nz,countLines:()=>eo,escapeHtml:()=>Wz,escapeRE:()=>Uz,fromCodePoint:()=>Ad,has:()=>Tz,isMdAsciiPunct:()=>sp,isPunctChar:()=>op,isPunctCode:()=>Jg,isSpace:()=>Iz,isString:()=>Mz,isValidEntityCode:()=>bm,isWhiteSpace:()=>Cd,lib:()=>qz,mdurl:()=>LA,normalizeReference:()=>km,ucmicro:()=>np,unescapeAll:()=>Md,unescapeMd:()=>Rz});const np=_z;function Az(e){return Object.prototype.toString.call(e)}function Mz(e){return Az(e)==="[object String]"}const Ez=Object.prototype.hasOwnProperty;function Tz(e,t){return Ez.call(e,t)}function Nz(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(o=>{e[o]=n[o]})}}),e}function Iz(e){return e===9||e===32}function Cd(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function op(e){return np.P.test(e)||np.S.test(e)}const Cw=new Map;function Jg(e){if(sp(e))return!0;const t=Cw.get(e);if(t!==void 0)return t;const n=op(String.fromCharCode(e));return Cw.set(e,n),n}function sp(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function km(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Lz(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function bm(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Ad(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const DA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,$z=new RegExp(`${DA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Fz=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Oz(e,t){if(t.charCodeAt(0)===35&&Fz.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return bm(o)?Ad(o):e}const n=Oy(e);return n!==e?n:e}function Rz(e){return e.includes("\\")?e.replace(DA,"$1"):e}function Md(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace($z,(t,n,o)=>n||Oz(t,o))}const Bz=/[&<>"]/,Dz=/[&<>"]/g,Pz={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Hz(e){return Pz[e]}function Wz(e){return Bz.test(e)?e.replace(Dz,Hz):e}const zz=/[.?*+^$[\]\\(){}|-]/g;function Uz(e){return e.replace(zz,"\\$&")}const qz={mdurl:LA,ucmicro:np};function eo(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
94
- `,n+1))!==-1;)t++;return t}const jz=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Vz=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Kz=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,Dy=["references","footnotes","abbreviations","abbr","abbrs"],Py=Symbol.for("markdown-it-ts.global-state"),Hy=Object.prototype.hasOwnProperty;function Aw(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $i(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function wl(e){if(Array.isArray(e))return e.map(t=>wl(t));if($i(e)){const t={};for(const n of Object.keys(e))t[n]=wl(e[n]);return t}return e}function ip(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$i(e)?Object.keys(e):[]}function ev(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ev(e[n],t[n]))return!1;return!0}if($i(e)||$i(t)){if(!$i(e)||!$i(t))return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n)if(!Hy.call(t,s)||!ev(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function PA(e,t){if(Array.isArray(e))return e[Number(t)];if($i(e))return e[t]}function Gz(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=wl(t[n]);return e}if($i(e)&&$i(t)){for(const n of Object.keys(e))Hy.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=wl(t[n]);return e}return wl(t)}function Yz(e,t,n){const o=n.ownedKeys??[],s=e[t];if($i(s)||Array.isArray(s)){const i=new Set(ip(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=wl(PA(n.value,r)):delete s[r];!n.existed&&ip(s).length===0&&delete e[t];return}n.existed?e[t]=wl(n.value):delete e[t]}function Wy(e){const t=e[Py];return Aw(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Aw(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function Zz(e,t){Object.defineProperty(e,Py,{value:t,enumerable:!1,configurable:!0,writable:!0})}function As(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:jz.test(e)?"footnote-definition":Vz.test(e)?"abbreviation-definition":Kz.test(e)?"reference-definition":null}function Ud(e){return Wy(e)?.reason??null}function $c(e,t,n){if(Ud(e)&&Pr(e),!t)return n();zy(e,t);try{const o=n();return Uy(e),o}catch(o){throw Pr(e),o}}function zy(e,t){try{Pr(e);const n={};for(const o of Dy)n[o]=Hy.call(e,o)?{existed:!0,value:wl(e[o])}:{existed:!1};Zz(e,{reason:t,snapshot:n})}catch{}}function Uy(e){const t=Wy(e);if(t)for(const n of Dy){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!$i(s)&&!Array.isArray(s))continue;const i=new Set(ip(o.existed?o.value:void 0));o.ownedKeys=ip(s).filter(r=>i.has(r)?!ev(s[r],PA(o.value,r)):!0)}}function Pr(e){const t=Wy(e);if(t){for(const n of Dy){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){Yz(e,n,o);continue}o.existed?e[n]=Gz(e[n],o.value):delete e[n]}delete e[Py]}}const tv=Symbol.for("markdown-it-ts.diagnostics");function xm(e,t){if(e)try{const n=e[tv];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[tv]=o,o}catch{return}}function br(e){return xm(e,!1)}function Xz(e){if(e)try{const t=e[tv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function cs(e){Xz(e)}function go(e,t){const n=xm(e,!0);n&&(n.strategy=t)}function u0(e,t){const n=xm(e,!0);n&&(n.chunk=t)}function HA(e,t){const n=xm(e,!0);n&&(n.unbounded=t)}function Qz(e){const t={};e=e||{},t.src_Any=$A.source,t.src_Cc=FA.source,t.src_Z=RA.source,t.src_P=OA.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function nv(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function wm(e){return Object.prototype.toString.call(e)}function Jz(e){return wm(e)==="[object String]"}function eU(e){return wm(e)==="[object Object]"}function tU(e){return wm(e)==="[object RegExp]"}function Mw(e){return wm(e)==="[object Function]"}function nU(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const WA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function oU(e){return Object.keys(e||{}).reduce(function(t,n){return t||WA.hasOwnProperty(n)},!1)}const sU={"http:":{validate:function(e,t,n){const o=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},iU="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",rU="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function lU(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function Ew(){return function(e,t){t.normalize(e)}}function rp(e){const t=e.re=Qz(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(iU),n.push(t.src_xn),t.src_tlds=n.join("|");function o(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const s=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,eU(a)){tU(a.validate)?c.validate=lU(a.validate):Mw(a.validate)?c.validate=a.validate:i(l,a),Mw(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Ew();return}if(Jz(a)){s.push(l);return}i(l,a)}),s.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:Ew()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(nU).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function zA(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function ti(e,t){if(!(this instanceof ti))return new ti(e,t);t||oU(e)&&(t=e,e={}),this.__opts__=nv({},WA,t),this.__schemas__=nv({},sU,e),this.__compiled__={},this.__tlds__=rU,this.__tlds_replaced__=!1,this.re={},rp(this)}ti.prototype.add=function(t,n){return this.__schemas__[t]=n,rp(this),this};ti.prototype.set=function(t){return this.__opts__=nv(this.__opts__,t),this};ti.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};ti.prototype.pretest=function(t){return this.re.pretest.test(t)};ti.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};ti.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,h){return f?h?f.index!==h.index?f.index<h.index?f:h:f.lastIndex>=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[o[u[0]],i[u[1]],s[u[2]]],h=c(c(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?u[0]++:h===f[1]?u[1]++:u[2]++,h.index<d)continue;const p=new zA(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};ti.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;const s=new zA(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};ti.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,s,i){return o!==i[s-1]}).reverse(),rp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,rp(this),this)};ti.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ti.prototype.onCompile=function(){};var UA=ti,aU=MA({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,b=Math.floor,v=String.fromCharCode;function m(B){throw new RangeError(p[B])}function y(B,W){const z=[];let D=B.length;for(;D--;)z[D]=W(B[D]);return z}function k(B,W){const z=B.split("@");let D="";z.length>1&&(D=z[0]+"@",B=z[1]),B=B.replace(h,".");const q=y(B.split("."),W).join(".");return D+q}function A(B){const W=[];let z=0;const D=B.length;for(;z<D;){const q=B.charCodeAt(z++);if(q>=55296&&q<=56319&&z<D){const j=B.charCodeAt(z++);(j&64512)==56320?W.push(((q&1023)<<10)+(j&1023)+65536):(W.push(q),z--)}else W.push(q)}return W}const $=B=>String.fromCodePoint(...B),L=function(B){return B>=48&&B<58?26+(B-48):B>=65&&B<91?B-65:B>=97&&B<123?B-97:36},w=function(B,W){return B+22+75*(B<26)-((W!=0)<<5)},E=function(B,W,z){let D=0;for(B=z?b(B/700):B>>1,B+=b(B/W);B>g*26>>1;D+=36)B=b(B/g);return b(D+(g+1)*B/(B+38))},T=function(B){const W=[],z=B.length;let D=0,q=128,j=72,ie=B.lastIndexOf("-");ie<0&&(ie=0);for(let ue=0;ue<ie;++ue)B.charCodeAt(ue)>=128&&m("not-basic"),W.push(B.charCodeAt(ue));for(let ue=ie>0?ie+1:0;ue<z;){const pe=D;for(let ne=1,fe=36;;fe+=36){ue>=z&&m("invalid-input");const Me=L(B.charCodeAt(ue++));Me>=36&&m("invalid-input"),Me>b((2147483647-D)/ne)&&m("overflow"),D+=Me*ne;const $e=fe<=j?1:fe>=j+26?26:fe-j;if(Me<$e)break;const ae=36-$e;ne>b(2147483647/ae)&&m("overflow"),ne*=ae}const ee=W.length+1;j=E(D-pe,ee,pe==0),b(D/ee)>2147483647-q&&m("overflow"),q+=b(D/ee),D%=ee,W.splice(D++,0,q)}return String.fromCodePoint(...W)},F=function(B){const W=[];B=A(B);const z=B.length;let D=128,q=0,j=72;for(const pe of B)pe<128&&W.push(v(pe));const ie=W.length;let ue=ie;for(ie&&W.push("-");ue<z;){let pe=2147483647;for(const ne of B)ne>=D&&ne<pe&&(pe=ne);const ee=ue+1;pe-D>b((2147483647-q)/ee)&&m("overflow"),q+=(pe-D)*ee,D=pe;for(const ne of B)if(ne<D&&++q>2147483647&&m("overflow"),ne===D){let fe=q;for(let Me=36;;Me+=36){const $e=Me<=j?1:Me>=j+26?26:Me-j;if(fe<$e)break;const ae=fe-$e,U=36-$e;W.push(v(w($e+ae%U,0))),fe=b(ae/U)}W.push(v(w(fe,0))),j=E(q,ee,ue===ie),q=0,++ue}++q,++D}return W.join("")},P={version:"2.3.1",ucs2:{decode:A,encode:$},decode:T,encode:F,toASCII:function(B){return k(B,function(W){return f.test(W)?"xn--"+F(W):W})},toUnicode:function(B){return k(B,function(W){return d.test(W)?T(W.slice(4).toLowerCase()):W})}};t.exports=P})}),qA=TA(aU());function qy(e,t,n){let o,s=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<n;){if(o=e.charCodeAt(s),o===10||o===60)return i;if(o===62)return i.pos=s+1,i.str=Md(e.slice(t+1,s)),i.ok=!0,i;if(o===92&&s+1<n){s+=2;continue}s++}return i}let r=0;for(;s<n&&(o=e.charCodeAt(s),!(o===32||o<32||o===127));){if(o===92&&s+1<n){if(e.charCodeAt(s+1)===32)break;s+=2;continue}if(o===40&&(r++,r>32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=Md(e.slice(t,s)),i.pos=s,i.ok=!0),i}var jA=qy;const ph=-2;function cU(e,t,n,o){let s=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(s--,s===0)return i;if(o){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return ph}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return ph;if(r===91){s++,i++;continue}i++}return-1}function jy(e,t,n){let o=1,s=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=cU(l,t,a,n);if(f!==ph)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let h=-1;return s&&(h=e.pos),e.pos=c,h}var lp=jy;function Vy(e,t,n,o){let s,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)r.str=o.str,r.marker=o.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(s=e.charCodeAt(i),s===r.marker)return r.pos=i+1,r.str+=Md(e.slice(t,i)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Md(e.slice(t,i)),r}var VA=Vy;function _m(e,t){if(!e.attrs)return-1;for(let n=0;n<e.attrs.length;n++)if(e.attrs[n][0]===t)return n;return-1}function Ky(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function uU(e,t,n){const o=_m(e,t),s=[t,n];o<0?Ky(e,s):e.attrs[o]=s}function dU(e,t){const n=_m(e,t);return n>=0?e.attrs[n][1]:null}function fU(e,t,n){const o=_m(e,t);o<0?Ky(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var hU=BA({attrGet:()=>dU,attrIndex:()=>_m,attrJoin:()=>fU,attrPush:()=>Ky,attrSet:()=>uU,parseLinkDestination:()=>qy,parseLinkLabel:()=>jy,parseLinkTitle:()=>Vy});function pU(e){return e.includes("\r")||e.includes("\0")}function KA(e){return typeof e=="string"?e:e.toString()}function mU(e){if(e.inlineMode){const t=new ko("inline","",0);t.content=KA(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const gU=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,vU=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function yU(e,t){let n=e.pos;const o=e.src;if(o.charCodeAt(n)!==60)return!1;const s=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=o.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=o.slice(s+1,n);if(vU.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}if(gU.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}return!1}var kU=yU;function bU(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o<i&&n.charCodeAt(o)===96;)o++;const r=n.slice(s,o),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=s)return t||(e.pending+=r),e.pos+=l,!0;let a=o,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let f=n.slice(o,c);f.includes(`
95
- `)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var xU=bU;function Tw(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=o-i[o]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function wU(e){const t=e.tokens_meta,n=e.tokens_meta.length;Tw(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Tw(t[o].delimiters)}var _U=wU;function SU(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;const s=e.scanDelims(e.pos,o===42);if(!s||s.length===0)return!1;for(let i=0;i<s.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return e.pos+=s.length,!0}function Nw(e,t){const n=t.length;for(let o=n-1;o>=0;o--){const s=t[o];if(s.marker!==95&&s.marker!==42||s.end===-1)continue;const i=t[s.end],r=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===s.marker&&t[o-1].token===s.token-1&&t[s.end+1].token===i.token+1,l=String.fromCharCode(s.marker),a=e.tokens[s.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[o-1].token].content="",e.tokens[t[s.end+1].token].content="",o--)}}function CU(e){const t=e.tokens_meta,n=e.tokens_meta.length;Nw(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Nw(e,t[o].delimiters)}const Iw={tokenize:SU,postProcess:CU};function GA(e){return Oy(e)}function Gy(e){return e>=48&&e<=57}function AU(e){const t=e|32;return Gy(e)||t>=97&&t<=102}function YA(e){const t=e|32;return t>=97&&t<=122}function MU(e){return YA(e)||Gy(e)}function EU(e,t,n){let o=t+2;if(o>=n)return null;let s=!1,i=7,r=o;for((e.charCodeAt(o)|32)===120&&(s=!0,i=6,o++,r=o);o<n&&o-r<i;){const l=e.charCodeAt(o);if(!(s?AU(l):Gy(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function TU(e,t,n){let o=t+1;if(o>=n||!YA(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&MU(e.charCodeAt(o));)o++;if(o-t-1<2||o>=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return GA(s)!==s?s:null}function NU(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=EU(e.src,n,o);if(s){if(!t){const i=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=bm(i)?Ad(i):Ad(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=TU(e.src,n,o);if(s){const i=GA(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var IU=NU;const ZA=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),ov=new Array(128),XA=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);ov[e]=`\\${t}`,XA[e]=ZA[e]?t:ov[e]}function Lw(e,t,n){e.pending&&e.pushPending();const o=new ko("text_special","",0);o.level=e.level,o.content=t,o.markup=n,o.info="escape",e.pendingLevel=e.level,e.tokens.push(o),e.tokens_meta.push(null)}function LU(e,t){let n=e.pos;const o=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=s.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(i=s.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(Lw(e,XA[i],ov[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return Lw(e,i<256&&ZA[i]?r:l,l),e.pos=n+1,!0}var $U=LU;function FU(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=s[t];r&&(r.nesting&&r.nesting<0&&o--,r.level=o,r.nesting&&r.nesting>0&&o++,r.type==="text"&&t+1<i&&s[t+1]?.type==="text"?s[t+1].content=r.content+s[t+1].content:(t!==n&&(s[n]=r),n++))}t!==n&&(s.length=n)}var OU=FU;const QA=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,JA="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",RU=new RegExp(`^(?:${QA}|${JA}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),BU=new RegExp(`^(?:${QA}|${JA})`);function e6(e){return e===32||e===9||e===10||e===12||e===13}function DU(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||e6(t)}function PU(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t<e.length;t++){const n=e.charCodeAt(t);if(n===62)return!0;if(!e6(n))return!1}return!1}function HU(e){const t=e|32;return t>=97&&t<=122}function WU(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos,s=e.src;if(s.charCodeAt(o)!==60||o+2>=n)return!1;const i=s.charCodeAt(o+1);if(i!==33&&i!==63&&i!==47&&!HU(i))return!1;const r=s.slice(o).match(RU);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,DU(l)&&e.linkLevel++,PU(l)&&e.linkLevel--}return e.pos+=l.length,!0}var zU=WU;function UU(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=lp(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=jA(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=VA(e.src,i,e.posMax),i<f&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(c=i+1,i=lp(e,i),i>=0?s=e.src.slice(c,i++):i=p+1):i=p+1,s||(s=e.src.slice(h,p)),r=e.env.references[km(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(h,p);const g=[];e.md.inline.parse(o,e.md,e.env,g);const b=e.push("image","img",0);b.attrs=[["src",u],["alt",""]],b.children=g,b.content=o,a&&b.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var qU=UU;function jU(e,t){let n,o,s,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=lp(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&e.src.charCodeAt(p)===40){for(c=!1,p++;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(p>=d)return!1;if(s=jA(e.src,p,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?p=s.pos:r="",a=p;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(s=VA(e.src,p,e.posMax),p<d&&a!==p&&s.ok)for(l=s.str,p=s.pos;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);}(p>=d||e.src.charCodeAt(p)!==41)&&(c=!0),p++}if(c){if(typeof e.env.references>"u")return!1;if(p<d&&e.src.charCodeAt(p)===91?(a=p+1,p=lp(e,p),p>=0?o=e.src.slice(a,p++):p=h+1):p=h+1,o||(o=e.src.slice(f,h)),i=e.env.references[km(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const g=e.push("link_open","a",1),b=[["href",r]];g.attrs=b,l&&b.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var VU=jU;function t6(e){const t=e|32;return t>=97&&t<=122}function KU(e){return e>=48&&e<=57}function GU(e){return t6(e)||KU(e)||e===43||e===45||e===46}function YU(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&GU(e.charCodeAt(t));)t--;return t++,t>=e.length||!t6(e.charCodeAt(t))?null:e.slice(t)}function ZU(e,t,n){let o=t;for(;o<n;){const s=e.charCodeAt(o);if(s<=32||s===127||s===60)break;o++}return e.slice(t,o)}function XU(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=YU(e.pending);if(!s)return!1;const i=ZU(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-s.length,!0}function QU(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<s;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var JU=QU;function eq(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const s=e.scanDelims(e.pos,!0);if(!s)return!1;let i=s.length;const r=String.fromCharCode(o);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function $w(e,t){let n;const o=[],s=t.length;for(let i=0;i<s;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&o.push(l.token-1)}for(;o.length;){const i=o.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function tq(e){const t=e.delimiters;$w(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&$w(e,n[o].delimiters)}const Fw={tokenize:eq,postProcess:tq};function Ow(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function nq(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||Ow(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!Ow(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var oq=nq;function Yy(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function sq(e){if(e.length===0)return 0;const t=e.slice().sort((o,s)=>o-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function iq(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function n6(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,o={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:Yy(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function Fc(e,t,n,o,s,i){const r=n6(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=iq(t,n));a.calls++,a.inclusiveMs+=o,o>a.maxMs&&(a.maxMs=o),a.samples.push(o),i?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=Yy()}function rq(e){const t=n6(e);if(!t)return null;const n=Object.keys(t.records);for(let o=0;o<n.length;o++){const s=t.records[n[o]];s.medianMs=sq(s.samples)}return t.completedAt=Yy(),t}var Rw=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const o=this.rules.findIndex(s=>s.name===e);o>=0&&this.rules.splice(o,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const o=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(o<0)return;const s=this.rules[o];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(o<0)throw new Error(`Parser rule not found: ${e}`);this.rules[o].fn=t,n?.alt!==void 0&&(this.rules[o].alt=n.alt),this.invalidateCache()}before(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s+1,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const o of this.rules)if(o.enabled&&o.alt)for(const s of o.alt)e.add(s);const t=new Map,n=new Map;for(const o of e){const s=[],i=[];for(const r of this.rules)r.enabled&&(o!==""&&!r.alt?.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(o,s),n.set(o,i)}this.cache=t,this.namedCache=n}},o6=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.tokens_meta=new Array(o.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new ko("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new ko(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const o=new ko(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const{src:n,posMax:o}=this,s=n.charCodeAt(e);let i=e;for(;i<o&&n.charCodeAt(i)===s;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<o?n.charCodeAt(i):32,c=Cd(l),u=Cd(a),d=Jg(l),f=Jg(a),h=!u&&(!f||c||d),p=!c&&(!d||u||f);return{can_open:h&&(t||!p||d),can_close:p&&(t||!h||f),length:r}}};o6.prototype.Token=ko;const lq=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function s6(e){return!lq.test(e)}var aq=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new Rw,this.ruler2=new Rw,this.ruler.push("text",oq),this.ruler.push("linkify",XU),this.ruler.push("newline",JU),this.ruler.push("escape",$U),this.ruler.push("backticks",xU),this.ruler.push("strikethrough",Fw.tokenize),this.ruler.push("emphasis",Iw.tokenize),this.ruler.push("link",VU),this.ruler.push("image",qU),this.ruler.push("autolink",kU),this.ruler.push("html_inline",zU),this.ruler.push("entity",IU),this.ruler2.push("balance_pairs",_U),this.ruler2.push("strikethrough",Fw.postProcess),this.ruler2.push("emphasis",Iw.postProcess),this.ruler2.push("fragments_join",OU),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),o=n.length,s=e.cache,i=s[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<o;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Fc(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<o;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,o=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=s[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Fc(e.env,"inline",s[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,o){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&s6(e)){const a=new ko("text","",0);a.content=e,o.push(a);return}const s=new o6(e,t,n,o);this.tokenize(s);const i=this.getRules2(),r=i.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](s,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(s,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Fc(s.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,o){this.parseSource(e,t,n,o)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function cq(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let o=0,s=t.length;o<s;o++){const i=t[o];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&s6(i.content)){const r=new ko("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const uq=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,dq=/[0-9a-z]/i;function fq(e){return/^<a[>\s]/i.test(e)}function hq(e){return/^<\/a\s*>/i.test(e)}function pq(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const o=t.raw[n-1],s=t.raw[n];if(!uq.test(o)||!dq.test(s))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function mq(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const o=t[n];if(o.type!=="inline"||!e.md.linkify.pretest(o.content))continue;let s=o.children;s||(s=[],o.children=s);let i=0;for(let r=s.length-1;r>=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(fq(l.content)&&i>0&&i--,hq(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(h=>pq(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],g=e.md.normalizeLink(p.url);if(!e.md.validateLink(g))continue;let b=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText(`mailto:${b}`).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText(`http://${b}`).replace(/^http:\/\//,"");const v=p.index;if(v>f){const A=new ko("text","",0);A.content=a.slice(f,v),A.level=d,u.push(A)}const m=new ko("link_open","a",1);m.attrs=[["href",g]],m.level=d++,m.markup="linkify",m.info="auto",u.push(m);const y=new ko("text","",0);y.content=b,y.level=d,u.push(y);const k=new ko("link_close","a",-1);k.level=--d,k.markup="linkify",k.info="auto",u.push(k),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new ko("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}s.splice(r,1,...u)}}}}const gq=/\r\n?|\n/g,vq=/\0/g;function yq(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),o=t.includes("\0");if(!n&&!o)return;let s=t;n&&(s=s.replace(gq,`
96
- `)),o&&(s=s.replace(vq,"�")),e.src=s}const i6=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,kq=/\((?:c|tm|r)\)/i,bq=/\((c|tm|r)\)/gi,xq={c:"©",r:"®",tm:"™"};function wq(e,t){return xq[t.toLowerCase()]}function _q(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(bq,wq)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function Sq(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&i6.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function Cq(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");kq.test(o)&&_q(n.children||[]),i6.test(o)&&Sq(n.children||[])}}var Aq=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(o=>o.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(o=>o.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const Mq=/['"]/,Bw=/['"]/g,Dw="’";function Df(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Eq(e,t){let n;const o=[],s=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=o.length-1;n>=0&&!(o[n].level<=l);n--);if(o.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){Bw.lastIndex=c;const d=Bw.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=d[0]==="'";let g=32;if(d.index-1>=0)g=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let b=32;if(c<u)b=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}const v=sp(g)||op(String.fromCharCode(g)),m=sp(b)||op(String.fromCharCode(b)),y=Cd(g),k=Cd(b);if(k?f=!1:m&&(y||v||(f=!1)),y?h=!1:v&&(k||m||(h=!1)),b===34&&d[0]==='"'&&g>=48&&g<=57&&(h=f=!1),f&&h&&(f=v,h=m),!f&&!h){p&&(r.content=Df(r.content,d.index,Dw));continue}if(h)for(n=o.length-1;n>=0;n--){let A=o[n];if(o[n].level<l)break;if(A.single===p&&o[n].level===l){A=o[n];let $,L;p?($=s[2]||"‘",L=s[3]||"’"):($=s[0]||"“",L=s[1]||"”"),r.content=Df(r.content,d.index,L),e[A.token].content=Df(e[A.token].content,A.pos,$),c+=L.length-1,A.token===i&&(c+=$.length-1),a=r.content,u=a.length,o.length=n;continue e}}f?o.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=Df(r.content,d.index,Dw))}}}function Tq(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!Mq.test(o)||!n.children||Eq(n.children,e)}}function Nq(e){const t=e.tokens||[],n=t.length;for(let o=0;o<n;o++){const s=t[o];if(s.type!=="inline"||!Array.isArray(s.children))continue;const i=s.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const Iq=/^(?:vbscript|javascript|file|data):/,Lq=/^data:image\/(?:gif|png|jpeg|webp);/,r6=["http:","https:","mailto:"];function l6(e){const t=e.trim().toLowerCase();return Iq.test(t)?Lq.test(t):!0}function a6(e){const t=By(e,!0);if(t.hostname&&(!t.protocol||r6.includes(t.protocol)))try{t.hostname=qA.default.toASCII(t.hostname)}catch{}return IA(Ry(t))}function c6(e){const t=By(e,!0);if(t.hostname&&(!t.protocol||r6.includes(t.protocol)))try{t.hostname=qA.default.toUnicode(t.hostname)}catch{}return Qg(Ry(t),`${Qg.defaultChars}%`)}function $q(e){switch(e){case 9:case 32:return!0}return!1}function Fq(e,t,n,o){const s=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const f=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const h=[],p=[],g=[],b=[],v=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.parentType;e.parentType="blockquote";let y=!1,k;for(k=t;k<n;k++){const E=a[k]<e.blkIndent;if(u=i[k]+l[k],d=r[k],u>=d)break;if(s.charCodeAt(u++)===62&&!E){let F=a[k]+1,S,I;s.charCodeAt(u)===32?(u++,F++,I=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[k]+F)%4===3?(u++,F++,I=!1):I=!0):S=!1;let P=F;for(h.push(i[k]),i[k]=u;u<d;){const B=s.charCodeAt(u);if($q(B))B===9?P+=4-(P+c[k]+(I?1:0))%4:P++;else break;u++}y=u>=d,p.push(c[k]),c[k]=a[k]+1+(S?1:0),g.push(a[k]),a[k]=P-F,b.push(l[k]),l[k]=u-i[k];continue}if(y)break;let T=!1;for(let F=0,S=v.length;F<S;F++)if(v[F](e,k,n,!0)){T=!0;break}if(T){e.lineMax=k,e.blkIndent!==0&&(h.push(i[k]),p.push(c[k]),b.push(l[k]),g.push(a[k]),a[k]-=e.blkIndent);break}h.push(i[k]),p.push(c[k]),b.push(l[k]),g.push(a[k]),a[k]=-1}const A=e.blkIndent;e.blkIndent=0;const $=e.push("blockquote_open","blockquote",1);$.markup=">";const L=[t,0];$.map=L,e.md.block.tokenize(e,t,k);const w=e.push("blockquote_close","blockquote",-1);w.markup=">",e.lineMax=f,e.parentType=m,L[1]=e.line;for(let E=0;E<b.length;E++)i[E+t]=h[E],l[E+t]=b[E],a[E+t]=g[E],c[E+t]=p[E];return e.blkIndent=A,!0}function Oq(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,s=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,s,4+e.blkIndent,!1)}
97
- `,i.map=[t,e.line],!0}function Rq(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,a,!0),h.markup=c,h.map=[t,e.line],!0}const Pw=["","h1","h2","h3","h4","h5","h6"],Hw=["","#","##","###","####","#####","######"];function Ww(e){switch(e){case 9:case 32:return!0}return!1}function Bq(e,t,n,o){const s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=s.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=s.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=s.charCodeAt(++a);if(d>6||a<c&&!Ww(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&Ww(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",Pw[d],1);h.markup=Hw[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=s.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const g=e.push("heading_close",Pw[d],-1);return g.markup=Hw[d],!0}function Dq(e){switch(e){case 9:case 32:return!0}return!1}function Pq(e,t,n,o){const s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<s;){const c=e.src.charCodeAt(i++);if(c!==r&&!Dq(c))return!1;c===r&&l++}if(l<3)return!1;if(o)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const Ja=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${BU.source}\\s*$`),/^$/,!1]];function Hq(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),l=0;for(;l<Ja.length&&!Ja[l][0].test(r);l++);if(l===Ja.length)return!1;if(o)return Ja[l][2];let a=t+1;if(!Ja[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(s=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(s,i),Ja[l][1].test(r)){r.length!==0&&a++;break}}e.line=a;const c=e.push("html_block","",0);return c.map=[t,a],c.content=e.getLines(t,a,e.blkIndent,!0),!0}function zw(e){switch(e){case 9:case 32:return!0}return!1}const Zu={Pipe:1,ParagraphTerminator:2};function Wq(e){switch(e){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 124:case 126:return!0}return e>=48&&e<=57}var u6=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u<d;u++){const f=s.charCodeAt(u);if(f===124&&(c|=Zu.Pipe|Zu.ParagraphTerminator),!a)if(zw(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,Wq(f)&&(c|=Zu.ParagraphTerminator);(f===10||u===d-1)&&(f!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineFlags.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const s=new ko(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new ko(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;e<s&&!(t[e]+n[e]<o[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const o=t.charCodeAt(e);if(o!==9&&o!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;e<o&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const o=this.src;for(;e>n;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=o?this.eMarks[u]+1:this.eMarks[u];let p=0;const g=this.src,b=this.bsCount,v=this.tShift;for(;f<h&&p<n;){const m=g.charCodeAt(f);if(m===9||m===32)m===9?p+=4-(p+b[u])%4:p++;else if(f-d<v[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const s=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let f=0;const h=r[d];let p=h,g;for(d+1<t||o?g=l[d]+1:g=l[d];p<g&&f<n;){const b=i.charCodeAt(p);if(zw(b))b===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?s[u]=new Array(f-n+1).join(" ")+i.slice(p,g):s[u]=i.slice(p,g)}return s.join("")}};u6.prototype.Token=ko;function zq(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function d6(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function f6(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&Zu.ParagraphTerminator)===0||o>=s)return!1;const i=n.charCodeAt(o);switch(i){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return i>=48&&i<=57?!0:zq(n,o,s)}const Uw=["","h1","h2"];function Uq(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=d6(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p<n;p++){const k=i[p]+r[p],A=l[p];if(k>=A)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=s.charCodeAt(k),h===45||h===61)){let L=k+1,w=L;for(;L<A&&s.charCodeAt(L)===h;)L++;for(w=L;L<A;){const E=s.charCodeAt(L);if(E!==9&&E!==32)break;L++}if(L>=A){f=h===61?1:2;break}if(w-k>1)continue}if(a[p]<0||u&&!f6(e,p,s,k,A))continue;let $=!1;for(let L=0,w=o.length;L<w;L++)if(o[L](e,p,n,!0)){$=!0;break}if($)break}if(!f)return!1;let g;if(p===t+1){const k=i[t]+r[t];let A=l[t];for(;A>k;){const $=s.charCodeAt(A-1);if($!==9&&$!==32)break;A--}g=s.slice(k,A)}else g=e.getLines(t,p,c,!1).trim();e.line=p+1;const b=h===61?"=":"-",v=e.push("heading_open",Uw[f],1);v.markup=b,v.map=[t,e.line];const m=e.push("inline","",0);m.content=g,m.map=[t,e.line-1],m.children=[];const y=e.push("heading_close",Uw[f],-1);return y.markup=b,e.parentType=d,!0}function h6(e){switch(e){case 9:case 32:return!0}return!1}function qw(e,t){const n=e.eMarks,o=e.bMarks,s=e.tShift,i=e.src,r=n[t];let l=o[t]+s[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!h6(i.charCodeAt(l))?-1:l}function jw(e,t){const n=e.bMarks,o=e.tShift,s=e.eMarks,i=e.src,r=n[t]+o[t],l=s[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!h6(c))?-1:a}function qq(e,t,n){const o=e.bMarks,s=e.tShift,i=e.src,r=o[t]+s[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const jq=["0","1","2","3","4","5","6","7","8","9"];function Vq(e,t){const n=e.level+2,o=e.tokens;for(let s=t+2,i=o.length-2;s<i;s++){const r=o[s];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,o[s+2].hidden=!0,s+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++s<i;)l+=o[s].nesting}}}}function Kq(e,t,n,o){let s,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,g=e.tShift,b=e.eMarks,v=e.sCount,m=e.bsCount,y=p[l]+g[l];if(y>=b[l])return!1;const k=h.charCodeAt(y);if(k>=48&&k<=57){if(f=jw(e,l),f<0||(u=!0,r=y,d=qq(e,l,f),c&&d!==1))return!1}else if(k===42||k===45||k===43){if(f=qw(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=b[l])return!1;if(o)return!0;const A=h.charCodeAt(f-1),$=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const L=[l,0];e.tokens[e.tokens.length-1].map=L,e.tokens[e.tokens.length-1].markup=$;let w=!1;const E=e.tokens.length-1,T=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,s=b[l];const S=v[l]+f-(p[l]+g[l]);let I=S;for(;i<s;){const ee=h.charCodeAt(i);if(ee===9)I+=4-(I+m[l])%4;else if(ee===32)I++;else break;i++}const P=i;let B;P>=s?B=1:B=I-S,B>4&&(B=1);const W=S+B,z=e.push("list_item_open","li",1);z.markup=$;const D=[l,0];z.map=D,u&&(z.info=f-r-1===1?jq[h.charCodeAt(r)-48]:h.slice(r,f-1));const q=e.tight,j=e.tShift[l],ie=e.sCount[l],ue=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=W,e.tight=!0,e.tShift[l]=P-p[l],e.sCount[l]=I,P>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||w)&&(a=!1),w=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ue,e.tShift[l]=j,e.sCount[l]=ie,e.tight=q,e.push("list_item_close","li",-1).markup=$,l=e.line,D[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let pe=!1;for(let ee=0,ne=T.length;ee<ne;ee++)if(T[ee](e,l,n,!0)){pe=!0;break}if(pe)break;if(u){if(f=jw(e,l),f<0)break;r=p[l]+g[l]}else if(f=qw(e,l),f<0)break;if(A!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=$:e.push("bullet_list_close","ul",-1).markup=$,L[1]=l,e.line=l,e.parentType=F,a&&Vq(e,E),!0}function Vw(e){return e===9||e===32}function Gq(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=d6(e);let f=t+1;for(e.parentType="paragraph";f<n&&!e.isEmpty(f);f++){if(c[f]-u>3||c[f]<0)continue;if(s==="list"&&c[f]>=u){const y=r[f]+l[f],k=a[f];if(y<k){const A=i.charCodeAt(y);if(A===42||A===45||A===43){if(y+1>=k||Vw(i.charCodeAt(y+1)))break}else if(A>=48&&A<=57&&y+1<k){let $=y+1;for(;;){if($>=k){$=-1;break}const L=i.charCodeAt($++);if(L>=48&&L<=57){if($-y>=10){$=-1;break}continue}if((L===41||L===46)&&($>=k||Vw(i.charCodeAt($))))break;$=-1;break}if($>=0)break}}}const b=r[f]+l[f],v=a[f];if(d&&!f6(e,f,i,b,v))continue;let m=!1;for(let y=0,k=o.length;y<k;y++)if(o[y](e,f,n,!0)){m=!0;break}if(m)break}const h=e.getLines(t,f,u,!1).trim();e.line=f;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const g=e.push("inline","",0);return g.content=h,g.map=[t,e.line],g.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function Pf(e){switch(e){case 9:case 32:return!0}return!1}function Yq(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(s)!==91)return!1;function a(y){const k=e.lineMax;if(y>=k||e.isEmpty(y))return null;let A=!1;if(e.sCount[y]-e.blkIndent>3&&(A=!0),e.sCount[y]<0&&(A=!0),!A){const w=e.parentType;e.parentType="reference";let E=!1;for(let T=0,F=l.length;T<F;T++)if(l[T](e,y,k,!0)){E=!0;break}if(e.parentType=w,E)return null}const $=e.bMarks[y]+e.tShift[y],L=e.eMarks[y];return e.src.slice($,L+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const y=c.charCodeAt(s);if(y===91)return!1;if(y===93){u=s;break}else if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(y===92&&(s++,s<i&&c.charCodeAt(s)===10)){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const y=c.charCodeAt(s);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!Pf(y))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;s=d.pos;const h=s,p=r,g=s;for(;s<i;s++){const y=c.charCodeAt(s);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!Pf(y))break}let b=e.md.helpers.parseLinkTitle(c,s,i);for(;b.can_continue;){const y=a(r);if(y===null)break;c+=y,s=i,i=c.length,r++,b=e.md.helpers.parseLinkTitle(c,s,i,b)}let v;for(s<i&&g!==s&&b.ok?(v=b.str,s=b.pos):(v="",s=h,r=p);s<i&&Pf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&v)for(v="",s=h,r=p;s<i&&Pf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const m=km(c.slice(1,u));return m?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[m]>"u"&&(e.env.references[m]={title:v,href:f}),e.line=r),!0):!1}function d0(e){switch(e){case 9:case 32:return!0}return!1}const Zq=65536;function f0(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function Xq(e,t){if(e.lineFlags)return(e.lineFlags[t]&Zu.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];n<o;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function Kw(e){const t=[],n=e.length;let o=0,s=e.charCodeAt(o),i=!1,r=0,l="";for(;o<n;)s===124&&(i?(l+=e.substring(r,o-1),r=o):(t.push(l+e.substring(r,o)),l="",r=o+1)),i=s===92,o++,s=e.charCodeAt(o);return t.push(l+e.substring(r)),t}function Qq(e,t,n,o){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!d0(l)||r===45&&d0(l)||!Xq(e,t))return!1;for(;i<e.eMarks[s];){const k=e.src.charCodeAt(i);if(k!==124&&k!==45&&k!==58&&!d0(k))return!1;i++}let a=f0(e,t+1),c=a.split("|");const u=[];for(let k=0;k<c.length;k++){const A=c[k].trim();if(!A){if(k===0||k===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?u.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=f0(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=Kw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),g=[t,0];p.map=g;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let k=0;k<c.length;k++){const A=e.push("th_open","th",1);u[k]&&(A.attrs=[["style",`text-align:${u[k]}`]]);const $=e.push("inline","",0);$.content=c[k].trim(),$.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let m,y=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let k=!1;for(let $=0,L=h.length;$<L;$++)if(h[$](e,s,n,!0)){k=!0;break}if(k||(a=f0(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=Kw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),y+=d-c.length,y>Zq))break;if(s===t+2){const $=e.push("tbody_open","tbody",1);$.map=m=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[s,s+1];for(let $=0;$<d;$++){const L=e.push("td_open","td",1);u[$]&&(L.attrs=[["style",`text-align:${u[$]}`]]);const w=e.push("inline","",0);w.content=c[$]?c[$].trim():"",w.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return m&&(e.push("tbody_close","tbody",-1),m[1]=s),e.push("table_close","table",-1),g[1]=s,e.parentType=f,e.line=s,!0}var Jq=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}after(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s+1,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:o,fn:s})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=s(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return Fc(i?.env,"block",o,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const o=this._rules.findIndex(s=>s.name===e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[o].fn=t,n?.alt&&(this._rules[o].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this._rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const o of this._rules)if(o.enabled)for(const s of o.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const o of e){const s=[],i=[];for(const r of this._rules)r.enabled&&(o!==""&&!r.alt.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t[o]=s,n[o]=i}this.cache=t,this.namedCache=n}};const Hf=[["table",Qq,["paragraph","reference"]],["code",Oq],["fence",Rq,["paragraph","reference","blockquote","list"]],["blockquote",Fq,["paragraph","reference","blockquote","list"]],["hr",Pq,["paragraph","reference","blockquote","list"]],["list",Kq,["paragraph","reference","blockquote"]],["reference",Yq],["html_block",Hq,["paragraph","reference","blockquote"]],["heading",Bq,["paragraph","reference","blockquote"]],["lheading",Uq],["paragraph",Gq]];var ej=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Jq;for(let e=0;e<Hf.length;e++)this.ruler.push(Hf[e][0],Hf[e][1],{alt:(Hf[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const o=this.getRules(),s=o.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let g=0;g<s;g++)if(p=o[g](e,u,n,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const f=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let g=0;g<s;g++){const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[g].fn(e,u,n,!1);const v=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Fc(e.env,"block",f[g].name,v-b,p,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,o){if(!e||e.length===0)return;const s=new u6(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},p6=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};p6.prototype.Token=ko;const Gw=[["normalize",yq],["block",mU],["inline",cq],["linkify",mq],["replacements",Cq],["smartquotes",Tq],["text_join",Nq]],tj={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},nj={parseLinkLabel:jy,parseLinkDestination:qy,parseLinkTitle:Vy};function oj(){return{...tj}}function sj(){return{...nj}}var ij=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new ej,this.inline=new aq,this.ruler=new Aq;for(let e=0;e<Gw.length;e++){const[t,n]=Gw[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:oj(),helpers:sj(),normalizeLink:a6,normalizeLinkText:c6,validateLink:l6,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new UA),this.fallbackParser.block!==this.block&&(this.fallbackParser.block=this.block),this.fallbackParser.inline!==this.inline&&(this.fallbackParser.inline=this.inline),this.fallbackParser.core=this,this.fallbackParser.linkify=this.linkifyInstance,this.fallbackParser)}createState(e,t={},n){return new p6(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let o=0;o<n.length;o++)n[o](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Fc(e.env,"core",t[n].name,s-o,!0,!1)}rq(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&pU(e))return this.parse(KA(e),t,n);const o=this.createState(e,t,n);return this.process(o),this.lastState=o,o}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const rj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function ap(e){return!rj.test(e)}function Pu(e,t){const n=e.indexOf(`
98
- `,t);return n===-1?e.length:n}function mh(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function Yw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function h0(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function lj(e){if(e.length>3)return ap(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!1}return!0}const aj=["","h1","h2","h3","h4","h5","h6"],cj=["","#","##","###","####","#####","######"],Zw=0,p0=1,m0=2;function Ks(e,t,n,o){const s=new ko(e,t,n);return s.level=o,s.block=!0,s}function m6(e,t,n){const o=Ks("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new ko("text","",0);return s.content=e,o.children=[s],o}function uj(e,t,n,o,s){let i=0,r=n;for(;r<o&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=o||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<o&&t.charCodeAt(l)===32;)l++;let a=o;for(;a>l&&t.charCodeAt(a-1)===32;)a--;let c=a;for(;c>l&&t.charCodeAt(c-1)===35;)c--;if(c>l&&t.charCodeAt(c-1)===32)for(a=c-1;a>l&&t.charCodeAt(a-1)===32;)a--;const u=t.slice(l,a);if(!ap(u))return!1;const d=aj[i],f=cj[i],h=Ks("heading_open",d,1,0);h.map=[s,s+1],h.markup=f,e.push(h),e.push(m6(u,s,1));const p=Ks("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function dj(e,t,n){const o=Ks("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(m6(t,n,1)),e.push(Ks("paragraph_close","p",-1,0))}function fj(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function g0(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function hj(e,t){const n=Ks("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function pj(e,t,n){const o=Ks("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=Ks("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=Ks("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new ko("text","",0);r.content=t,i.children=[r],e.push(i);const l=Ks("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Ks("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function mj(e){const t=Ks("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function gj(e,t,n,o){if(!Yw(e,t,n))return null;const s=e.slice(t+3,n);if(s.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=o+1;for(;l<e.length;){const c=Pu(e,l);if(Yw(e,l,c)&&mh(e,l+3,c)){const u=Ks("fence","code",0,0);return u.map=[o,a+1],u.markup="```",u.info=s,u.content=e.slice(i,r),{token:u,nextPos:c<e.length?c+1:c,nextLine:a+1}}l=c<e.length?c+1:c,r=l,a++}return null}function vj(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?Zw:m0,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=Pu(e,r);if(r===a){r=a<e.length?a+1:a,l++;continue}const c=e.charCodeAt(r);if(c===32||c===9){if(!mh(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!uj(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=g0(e,h),l+=1+r-h;continue}if(c===45){if(!h0(e,r,a))return null;const h=l;let p=r,g=l,b=null,v=null;for(;p<e.length;){const k=Pu(e,p);if(!h0(e,p,k))break;const A=p+2,$=k===A+1?e[A]:e.slice(A,k);if(!lj($))return null;b===null&&(b=hj(t,h)),v=pj(t,$,g),p=k<e.length?k+1:k,g++}if(b===null||v===null)return null;let m=p,y=g;for(;m<e.length;){if(e.charCodeAt(m)===10){m++,y++;continue}const k=Pu(e,m);if(!mh(e,m,k)){if(h0(e,m,k))return null;break}m=k<e.length?k+1:k,y++}b.map[1]=y,v.map[1]=y,mj(t),r=m,l=y;continue}if(c===96){const h=gj(e,r,a,l);if(!h)return null;t.push(h.token),r=g0(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=fj(e,r,a);let d;if(n===m0?d=ap(u):n===p0&&u===o?d=s:(d=ap(u),n===Zw?(i&&(n=u===o?p0:m0),o=u,s=d,i=!0):n===p0&&(o=u,s=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!mh(e,f,Pu(e,f)))return null;dj(t,u,l),r=g0(e,f),l+=1+r-f}return t}const yj=/[&<>"]/,Xw=/[&<>"]/g,kj=/&/g,bj=/[<>"]/g,xj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function v0(e){return xj[e]||e}function Ln(e){if(e.length===0)return"";if(e.length<32)return yj.test(e)?e.replace(Xw,v0):e;const t=e.includes("&"),n=e.includes("<"),o=e.includes(">"),s=e.includes('"');return!t&&!n&&!o&&!s?e:t&&!n&&!o&&!s?e.replace(kj,"&amp;"):t?e.replace(Xw,v0):e.replace(bj,v0)}const wj=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),_j=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function g6(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(wj,(t,n,o)=>{if(n)return n;if(_j.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return bm(i)?Ad(i):"�"}const s=Oy(t);return s!==t?s:t})}const Sj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Cj=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,Aj=/"/g;function kc(e,t){const n=e.indexOf(`
99
- `,t);return n===-1?e.length:n}function cp(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function Wf(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function Mj(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!cp(e,t,kc(e,t))}function Qw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function Ej(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function Zy(e){return Cj.test(e)?Sj.test(e)?null:e.replace(Aj,"&quot;"):e}function Tj(e,t,n){let o=0,s=t;for(;s<n&&e.charCodeAt(s)===35&&o<6;)s++,o++;if(o===0||s>=n||e.charCodeAt(s)!==32)return null;let i=s+1;for(;i<n&&e.charCodeAt(i)===32;)i++;let r=n;for(;r>i&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>i&&e.charCodeAt(l-1)===35;)l--;if(l>i&&e.charCodeAt(l-1)===32)for(r=l-1;r>i&&e.charCodeAt(r-1)===32;)r--;const a=Zy(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
100
- `}function Jw(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function Nj(e,t){switch(e.charCodeAt(t)){case 34:return`<li>&quot;</li>
101
- `;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`<li>${e[t]}</li>
102
- `}function Ij(e,t,n){const o=t+2;if(n===o+1)return Nj(e,o);const s=Zy(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
103
- `}function Lj(e,t,n){for(;t<n;){const s=e.charCodeAt(t);if(s!==32&&s!==9)break;t++}for(;n>t;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let o=n;for(let s=t;s<n;s++){const i=e.charCodeAt(s);if(i===96)return null;if(i===32||i===9){o=s;break}}return e.slice(t,o)}function $j(e,t,n,o){if(!Qw(e,t,n))return null;const s=Lj(e,t+3,n);if(s===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=kc(e,l);if(Qw(e,l,a)&&cp(e,l+3,a)){const c=e.slice(i,r);let u;return s===o.lang?u=o.open:(u=s?`<pre><code class="language-${Ln(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${Ln(c)}</code></pre>
104
- `,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function e_(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const o=e.length>=25e4,s=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=kc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!cp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const g=Tj(e,t,u);if(g===null)return null;o?s.push(g):n+=g,t=Wf(e,u<e.length?u+1:u);continue}if(d===45){let g=t;for(;g<e.length;){const y=kc(e,g);if(!Jw(e,g,y))break;g=y<e.length?y+1:y}if(g===t)return null;const b=e.slice(t,g);let v;if(b===r)v=l;else{let y=t;for(v=`<ul>
105
- `;y<g;){const k=kc(e,y),A=Ij(e,y,k);if(A===null)return null;v+=A,y=k<e.length?k+1:k}v+=`</ul>
106
- `,r=b,l=v}let m=Wf(e,g);for(;m<e.length;){if(e.charCodeAt(m)===10){m++;continue}const y=kc(e,m);if(!cp(e,m,y)){if(Jw(e,m,y))return null;break}m=y<e.length?y+1:y}o?s.push(v):n+=v,t=m;continue}if(d===96){const g=$j(e,t,u,i);if(!g)return null;o?s.push(g.html):n+=g.html,t=Wf(e,g.nextPos);continue}const f=Ej(e,t,u);let h;if(f===a)h=c;else{const g=Zy(f);if(g===null)return null;h=`<p>${g}</p>
107
- `,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&Mj(e,p))return null;o?s.push(h):n+=h,t=Wf(e,p)}return o?s.join(""):n}const Fj={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function up(e,t,n={},o){cs(n);const s={...Fj,...o||{}},i=As(t);if(s.fallbackOnGlobalState!==!1&&i)return u0(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),$c(n,i,()=>e.core.parse(t,n,e).tokens);let r=gh(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=Dj(r,s.maxChunks)),vh(t,r))return u0(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),$c(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return u0(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),$c(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),f=e.core.parse(d,n,e).tokens;l!==0&&f.length&&Rj(f,l),Bj(a,f),l+=u.lineCount}return a})}function gh(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(o.push({start:r,end:f,lineCount:l}),r=f,s=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
108
- `,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const g=Pj(e,f,h);if(t.fenceAware){let m=f;for(;m<h;){const k=e.charCodeAt(m);if(k===32||k===9)m++;else break}const y=e[m];if(y==="`"||y==="~"){let k=m;for(;k<h&&e[k]===y;)k++;const A=k-m;A>=3&&(u?u.marker===y&&A>=u.length&&(u=null):u={marker:y,length:A})}}const b=p-f;s+=b,i+=1,l+=1,g?(a=0,c=0):(a+=1,c+=b);const v=g;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(v)d(p);else{const m=Math.max(10,Math.floor(t.maxChunkLines*.5)),y=Math.max(t.maxChunkChars,8e3);(a>=m||c>=y)&&d(p)}f=p}return n&&d(e.length),o}function vh(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!Oj(e,t[s].end))return!0;return!1}function Oj(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let o=n+1;o<t-1;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function Rj(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function Bj(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Dj(e,t){if(e.length<=t)return e;const n=[];let o=0;for(let s=0;s<t;s++){const i=t-s,r=e.length-o,l=Math.ceil(r/i),a=e.slice(o,o+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),o+=l}return n}function Pj(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}const v6=4e6,y6=8e4,Hj=1e4,Wj=200,zj=1e4,Uj=200;function k6(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function qj(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function tl(e){return e.length===0?0:eo(e)+(e.charCodeAt(e.length-1)===10?0:1)}function jj(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function Vj(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
109
- `,o);s===-1&&(s=e.length);let i=o;for(;i<s;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<s&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}o=s===e.length?e.length:s+1}return n!==null}function Kj(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return jj(e,n+1,e.length-1)?!Vj(e,t):!1}function Gj(e,t,n,o={}){const s=o.mode??"full",i=o.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(o.maxChunkChars!==void 0||o.maxChunkLines!==void 0||o.autoTune===!1){const r=o.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??zj:e.options.fullChunkSizeChars??Hj),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??Uj:e.options.fullChunkSizeLines??Wj);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return s==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var qd=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=tl(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=gh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(vh(this.pending,o,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const s=this.commitRanges(o,e);return this.pending=this.pending.slice(s),this.updateEnvDiagnostics(e,t,tl(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!Kj(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,tl(this.pending)),null;const n=gh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,tl(this.pending)),null;const o=vh(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:tl(this.pending)}]:n;return this.commitRanges(o,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const o=this.resolveWindow();return this.updateEnvDiagnostics(e,o,0),this.tokens}const t=this.resolveWindow(),n=gh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=vh(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:tl(this.pending)}]:n;this.commitRanges(o,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:tl(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+tl(this.pending);return Gj(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Ud(e)&&Pr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=As(t);n&&(zy(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let o=0;o<e.length;o++){const s=e[o],i=this.pending.slice(s.start,s.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&qj(r,a),this.options.retainTokens!==!1&&k6(this.tokens,r),this.committedChars+=i.length,this.committedLines+=s.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:s.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=s.end}return this.markedGlobalStateReason&&Uy(t),n}catch(o){throw this.markedGlobalStateReason&&(Pr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){HA(e,{mode:this.options.mode??"full",maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:n,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,globalStateDetected:this.markedGlobalStateReason||void 0})}};function Yj(e,t,n={},o={}){cs(n);const s=new qd(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function Zj(e,t,n={},o={}){cs(n);const s=new qd(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function Xj(e,t,n,o={},s={}){cs(o);const i=new qd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}async function Qj(e,t,n,o={},s={}){cs(o);const i=new qd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}function b6(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??v6,s=e.options.autoUnboundedThresholdLines??y6;return t>=o||n>=s}function x6(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??v6))return"yes";const o=e.options.autoUnboundedThresholdLines??y6;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function Xu(e,t,n={},o={}){cs(n);const s=As(t);if(Ud(n)&&Pr(n),o.fallbackOnGlobalState!==!1&&s)return HA(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:eo(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),$c(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new qd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){k6(i,l)}});if(s&&zy(n,s),r.feed(t),r.flushForce(n),s&&(Uy(n),o.fallbackOnGlobalState===!1)){const l=br(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const Oc=(e,t,n)=>e<t?t:e>n?n:e;function w6(e){return e.experimental?{...e,...e.experimental}:e}const t_=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],n_=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function _6(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function Jj(e,t=Math.max(0,e/40|0),n={}){const o=w6(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<t_.length;l++){const a=t_[l];if(e<=a.max){if(a.strategy!=="adaptive")return _6(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Oc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Oc(Math.ceil(t/i),150,700),maxChunks:Oc(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function o_(e,t=Math.max(0,e/40|0),n={}){const o=w6(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<n_.length;l++){const a=n_[l];if(e<=a.max){if(a.strategy!=="adaptive")return _6(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Oc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Oc(Math.ceil(t/i),150,700),maxChunks:Oc(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var eV={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},tV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},nV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Sm(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function yh(e,t){if(Sm(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const s_=e=>Sm(e)?e:Promise.resolve(e);function Qu(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Ln(e)}}function Nl(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Qu(t[0])}="${Ln(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${Qu(s[0])}="${Ln(s[1])}"`}return n}function S6(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const o=e.charCodeAt(t);if(o===32||o===9||o===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const o=e.charCodeAt(n);if(o!==32&&o!==9&&o!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function Ju(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
110
- `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Ln(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
111
- `;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Nl(r)}>${t}</code></pre>
112
- `}return`<pre><code${Nl(e.attrs)}>${t}</code></pre>
113
- `}function dp(e){return!e.attrs||e.attrs.length===0?`<code>${Ln(e.content)}</code>`:`<code${Nl(e.attrs)}>${Ln(e.content)}</code>`}function sv(e){const t=Ln(e.content);return e.attrs?`<pre${Nl(e.attrs)}><code>${t}</code></pre>
114
- `:`<pre><code>${t}</code></pre>
115
- `}function oV(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}<p>`;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}<td>`;case"th_open":return`${t}<th>`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}<td style="${Ln(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${Ln(n[0][1])}">`}return null}function i_(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Qu(t[0][0])}="${Ln(t[0][1])}">`:t.length===2?`<a ${Qu(t[0][0])}="${Ln(t[0][1])}" ${Qu(t[1][0])}="${Ln(t[1][1])}">`:`<a${Nl(t)}>`}function sV(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function r_(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function fp(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?`</${s}>`:`<${s}>`;let i=(o===-1?"</":"<")+s+Nl(n);return o===0&&t&&(i+=" /"),`${i}>`}const iV={langPrefix:"language-",xhtmlOut:!1,breaks:!1},zf=Object.prototype.hasOwnProperty,Tn={code_inline(e,t){return dp(e[t])},code_block(e,t){return sv(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?g6(i.info).trim():"",{langName:l,langAttrs:a}=S6(r),c=n.highlight,u=Ln(i.content);if(!c)return Ju(i,u,r,l,n);const d=c(i.content,l,a);return Sm(d)?d.then(f=>Ju(i,f||u,r,l,n)):Ju(i,d||u,r,l,n)},image(e,t,n,o,s){const i=e[t],r=s.renderInlineAsText(i.children||[],n,o),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],fp(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
116
- `:`<br>
117
- `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
118
- `:`<br>
119
- `:`
120
- `},text(e,t){return Ln(e[t].content)},text_special(e,t){return Ln(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function l_(e,t,n){const o=e.info?g6(e.info).trim():"",{langName:s,langAttrs:i}=S6(o),r=t.highlight,l=Ln(e.content);if(!r)return Ju(e,l,o,s,t);const a=r(e.content,s,i);if(Sm(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Ju(e,a||l,o,s,t)}function Uf(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===Tn.text)return l.content.length===0?"":Ln(l.content);break;case"text_special":if(s.text_special===Tn.text_special)return l.content.length===0?"":Ln(l.content);break;case"softbreak":if(s.softbreak===Tn.softbreak)return r;break;case"hardbreak":if(s.hardbreak===Tn.hardbreak)return i;break;case"html_inline":if(s.html_inline===Tn.html_inline)return l.content;break;case"code_inline":if(s.code_inline===Tn.code_inline)return dp(l);break}const a=s[l.type];if(!a)return fp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:yh(c,l.type)}var rV=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Tn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",g=!1,b="";for(let v=0;v<e.length;v++){const m=e[v],y=m.type,k=v>0&&e[v-1].hidden?`
121
- `:"";if(y==="list_item_open"&&(!m.attrs||m.attrs.length===0)&&v+3<e.length){const L=e[v+1],w=e[v+2],E=e[v+3];if(L.type==="paragraph_open"&&L.hidden&&w.type==="inline"&&E.type==="paragraph_close"&&E.hidden){b+=`${k}<li>${this.renderInlineTokens(w.children||[],o,s)}`,v+=3;continue}}if(v+2<e.length){const L=e[v+1],w=e[v+2];if(L.type==="inline"&&w.nesting===-1&&w.tag===m.tag&&!w.hidden){const E=oV(m,k);if(E!==null){b+=`${E+this.renderInlineTokens(L.children||[],o,s)}</${m.tag}>
122
- `,v+=2;continue}}}if(y==="inline"){const L=m.children||[];if(L.length===1){g||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=o.xhtmlOut?`<br />
123
- `:`<br>
124
- `,p=o.breaks?h:`
125
- `,g=!0);const w=L[0];switch(w.type){case"text":if(l===Tn.text){b+=Ln(w.content);continue}break;case"text_special":if(a===Tn.text_special){b+=Ln(w.content);continue}break;case"softbreak":if(c===Tn.softbreak){b+=p;continue}break;case"hardbreak":if(u===Tn.hardbreak){b+=h;continue}break;case"html_inline":if(d===Tn.html_inline){b+=w.content;continue}break;case"code_inline":if(f===Tn.code_inline){b+=dp(w);continue}break}}b+=this.renderInlineTokens(L,o,s);continue}const A=i[y];if(!A){const L=m.attrs;if(!m.hidden){if(!L||L.length===0)switch(y){case"hr":b+=r?`<hr />
126
- `:`<hr>
127
- `;continue;case"heading_open":b+=`<${m.tag}>`;continue;case"heading_close":b+=`</${m.tag}>
128
- `;continue;case"paragraph_open":b+=`${k}<p>`;continue;case"paragraph_close":b+=`</p>
129
- `;continue;case"list_item_open":{const w=e[v+1];b+=k+(w&&(w.type==="inline"||w.hidden||w.nesting===-1&&w.tag==="li")?"<li>":`<li>
130
- `);continue}case"list_item_close":b+=`</li>
131
- `;continue;case"bullet_list_open":b+=`${k}<ul>
132
- `;continue;case"bullet_list_close":b+=`</ul>
133
- `;continue;case"blockquote_open":b+=k+(e[v+1]&&e[v+1].nesting===-1&&e[v+1].tag==="blockquote"?"<blockquote>":`<blockquote>
134
- `);continue;case"blockquote_close":b+=`</blockquote>
135
- `;continue;case"ordered_list_open":b+=`${k}<ol>
136
- `;continue;case"ordered_list_close":b+=`</ol>
137
- `;continue;case"table_open":b+=`${k}<table>
138
- `;continue;case"table_close":b+=`</table>
139
- `;continue;case"thead_open":b+=`${k}<thead>
140
- `;continue;case"thead_close":b+=`</thead>
141
- `;continue;case"tbody_open":b+=`${k}<tbody>
142
- `;continue;case"tbody_close":b+=`</tbody>
143
- `;continue;case"tr_open":b+=`${k}<tr>
144
- `;continue;case"tr_close":b+=`</tr>
145
- `;continue;case"td_open":b+=`${k}<td>`;continue;case"td_close":b+=`</td>
146
- `;continue;case"th_open":b+=`${k}<th>`;continue;case"th_close":b+=`</th>
147
- `;continue}else if(L.length===1){const w=L[0];if(y==="ordered_list_open"&&w[0]==="start"){b+=`${k}<ol start="${Ln(w[1])}">
148
- `;continue}if(y==="td_open"&&w[0]==="style"){b+=`${k}<td style="${Ln(w[1])}">`;continue}if(y==="th_open"&&w[0]==="style"){b+=`${k}<th style="${Ln(w[1])}">`;continue}}}b+=this.renderToken(e,v,o);continue}if(y==="code_block"&&A===Tn.code_block){b+=sv(m);continue}if(y==="fence"&&A===Tn.fence){b+=l_(m,o);continue}if(y==="html_block"&&A===Tn.html_block){b+=m.content;continue}const $=A(e,v,o,s,this);typeof $=="string"?b+=$:b+=yh($,m.type)}return b}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],o,s);continue}const c=i[a.type];c?r+=await s_(c(e,l,o,s,this)):r+=this.renderToken(e,l,o)}return r}renderInline(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokens(e,o,s)}async renderInlineAsync(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokensAsync(e,o,s)}renderInlineAsText(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineAsTextInternal(e,o,s)}renderAttrs(e){return Nl(e.attrs)}renderToken(e,t,n){const o=e[t];if(o.hidden)return"";const s=o.block,i=o.nesting,r=o.tag,l=o.attrs;let a=!1;if(s&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=s&&i!==-1&&t>0&&e[t-1].hidden?`
149
- `:"",u=a?`>
150
- `:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+Nl(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const o=()=>(n||(n={...t}),n);if(zf.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),zf.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(zf.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(zf.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...iV,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===Tn.code_block)return sv(t);if(i==="html_block"&&s.html_block===Tn.html_block)return t.content;const r=this.mergeOptions(n),l=o??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[i];if(!a)return t.block?this.renderToken(e,0,r):fp(t,r.xhtmlOut===!0);if(i==="fence"&&a===Tn.fence)return l_(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:yh(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,f=o.em_open,h=o.em_close,p=o.strong_open,g=o.strong_close,b=t.xhtmlOut===!0,v=b?`<br />
151
- `:`<br>
152
- `,m=t.breaks?v:`
153
- `;if(e.length===1)return Uf(e,t,n,this,o,v,m);let y="";for(let k=0;k<e.length;k++){const A=e[k];if(A.type==="link_open"&&!u&&!d&&k+2<e.length){const w=e[k+1];if(e[k+2].type==="link_close"&&sV(w)){const E=`${i_(A)+Uf([w],t,n,this,o,v,m)}</a>`;if(r===Tn.softbreak&&k+3<e.length&&e[k+3].type==="softbreak"){y+=E+m,k+=3;continue}y+=E,k+=2;continue}}if(A.type==="link_open"&&!u&&!d&&k+1<e.length&&e[k+1].type==="link_close"){y+=`${i_(A)}</a>`,k+=1;continue}if(A.type==="em_open"&&!f&&!h&&k+2<e.length){const w=e[k+1];if(e[k+2].type==="em_close"&&r_(w)){y+=`<em>${Uf([w],t,n,this,o,v,m)}</em>`,k+=2;continue}}if(A.type==="strong_open"&&!p&&!g&&k+2<e.length){const w=e[k+1];if(e[k+2].type==="strong_close"&&r_(w)){y+=`<strong>${Uf([w],t,n,this,o,v,m)}</strong>`,k+=2;continue}}switch(A.type){case"text":if(s===Tn.text){const w=A.content.length===0?"":Ln(A.content);if(a===Tn.html_inline&&k+1<e.length&&e[k+1].type==="html_inline"){for(y+=w+e[++k].content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}y+=w;continue}break;case"text_special":if(i===Tn.text_special){A.content.length!==0&&(y+=Ln(A.content));continue}break;case"softbreak":if(r===Tn.softbreak){y+=m;continue}break;case"hardbreak":if(l===Tn.hardbreak){y+=v;continue}break;case"html_inline":if(a===Tn.html_inline){for(y+=A.content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}break;case"code_inline":if(c===Tn.code_inline){y+=dp(A);continue}break}const $=o[A.type];if(!$){y+=A.block?this.renderToken(e,k,t):fp(A,b);continue}const L=$(e,k,t,n,this);typeof L=="string"?y+=L:y+=yh(L,A.type)}return y}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const o=this.rules;let s="";for(let i=0;i<e.length;i++){const r=o[e[i].type];r?s+=await s_(r(e,i,t,n,this)):s+=this.renderToken(e,i,t)}return s}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let o="";for(let s=0;s<e.length;s++){const i=e[s];switch(i.type){case"text":case"text_special":o+=i.content;break;case"image":o+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":o+=i.content;break;case"softbreak":case"hardbreak":o+=`
154
- `;break}}return o}},lV=rV;const aV=[],y0=4096;function cV(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
155
- `,n);o===-1&&(o=t);const s=o<t;let i=n,r=0;for(;i<o;){const l=e.charCodeAt(i);if(l===32){if(r++,i++,r>=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i<o){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<o&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<o){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===o&&s)return!0}break}case 62:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 96:case 126:{let a=i;for(;a<o&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<o;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<o&&e.charCodeAt(a)===46){const c=a+1;if(c<o){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===o&&s)return!0}}break}}if(o===t)break;n=o+1}return!1}function uV(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function dV(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!C6(e[n],t[n]))return!1;return!0}function C6(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,o=t.map;return!!n!=!!o||n&&o&&(n[0]!==o[0]||n[1]!==o[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!uV(e.attrs,t.attrs)||!dV(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function a_(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var fV=class{core;cache=null;stats=a_();MIN_SIZE_FOR_OPTIMIZATION=1e3;DEFAULT_SKIP_CACHE_CHARS=1e6;DEFAULT_SKIP_CACHE_LINES=1e5;IMPLICIT_STREAM_CHUNK_MIN_CHARS=16e4;MIN_LIST_LINES_FOR_MERGE=80;MIN_LIST_CHARS_FOR_MERGE=800;MIN_TABLE_LINES_FOR_MERGE=48;MIN_TABLE_CHARS_FOR_MERGE=1200;MIN_UNBOUNDED_APPEND_TOTAL_CHARS=5e5;MIN_UNBOUNDED_APPEND_CHARS=64e3;MIN_UNBOUNDED_APPEND_LINES=700;constructor(e){this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode="reset"}resetStats(){const{resets:e}=this.stats;this.stats=a_(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(cs(o??s?.env),!s||o&&o!==s.env){const I=o??{},P=!!n.__explicitStreamChunkFallbackSetting,B=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,W=!!n.options?.streamChunkedFallback,z=!P&&B,D=W||z,q=n.options?.streamChunkAdaptive!==!1,j=n.options?.streamChunkTargetChunks??8,ie=n.options?.streamChunkSizeChars,ue=n.options?.streamChunkSizeLines,pe=n.options?.streamChunkMaxChunks,ee=!!n.__explicitStreamChunkConfig,ne=n.options?.autoTuneChunks!==!1,fe=n.options?.streamChunkFenceAware??!0,Me=n.options?.streamLargeCachePolicy??"retain",$e=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,ae=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let U,ce=!1;if(Me==="skip"&&(ce=e.length>=$e,!ce&&ae!==void 0&&(U=eo(e),ce=U>=ae)),ce){const V=this.parseFullDocument(e,I,n,U,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",go(I,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!br(I)?.unbounded}),V.tokens}else if(D){const V=(me,Ee,Fe)=>me<Ee?Ee:me>Fe?Fe:me;U===void 0&&(U=eo(e));const Q=ne&&!ee?o_(e.length,U,n.options):null,ke=Q?.maxChunkChars??(q?V(Math.ceil(e.length/j),8e3,64e3):ie??1e4),he=Q?.maxChunkLines??(q?V(Math.ceil(U/j),150,700):ue??200),ye=Q?.maxChunks??(q?V(Math.ceil(e.length/64e3),j,32):pe),K=e.length>0&&e.charCodeAt(e.length-1)===10,J=z&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Q?.strategy!=="plain";if((W||J)&&(e.length>=ke*2||U>=he*2)&&K){const me=up(n,e,I,{maxChunkChars:ke,maxChunkLines:he,fenceAware:Q?.fenceAware??fe,maxChunks:ye});return this.cache={src:e,tokens:me,env:I,lineCount:U,lastSegment:void 0,globalStateReason:As(e)},this.updateCacheLineCount(this.cache,U),this.recordChunkedParseResult(I,W?"explicit-initial-large-doc":"default-initial-large-doc"),me}}const se=this.parseFullDocument(e,I,n,U);return U=se.lineCount,this.cache={src:e,tokens:se.tokens,env:I,lineCount:U,lastSegment:void 0,globalStateReason:As(e)},this.updateCacheLineCount(this.cache,U),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",go(I,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!br(I)?.unbounded}),se.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",go(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const i=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=As(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):As(e),a=r||l;if(a){const I=o??s.env;Pr(I);const P=As(e),B=this.parseFullDocument(e,I,n),W=B.tokens,z=B.lineCount;return this.cache={src:e,tokens:W,env:I,lineCount:z,lastSegment:void 0,globalStateReason:P},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",go(I,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!br(I)?.unbounded}),W}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length<c&&e.length<c*1.5&&!e.startsWith(s.src)){const I=o??s.env,P=this.parseFullDocument(e,I,n),B=P.tokens,W=P.lineCount;return this.cache={src:e,tokens:B,env:I,lineCount:W,lastSegment:void 0,globalStateReason:As(e)},this.updateCacheLineCount(this.cache,W),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",go(I,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!br(I)?.unbounded}),B}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const I=s.lineCount??eo(s.src);let P=3;u.length>5e3?P=8:u.length>1e3?P=6:u.length>200&&(P=4),P=Math.min(P,I);let B=null;const W=n.options?.streamContextParseStrategy??"chars",z=n.options?.streamContextParseMinChars??200,D=n.options?.streamContextParseMinLines??2;let q;const j=()=>(q===void 0&&(q=eo(u)),q),ie=this.canDirectlyParseAppend(s),ue=ie&&this.shouldUseUnboundedAppend(e,s,u);let pe=!1;if(!ie)switch(W){case"lines":pe=j()>=D;break;case"constructs":if(u.length>=z){pe=!0;break}if(cV(u)){pe=!0;break}pe=j()>=D;break;case"chars":default:pe=u.length>=z}if(P>0&&pe){const fe=this.getTailLines(s.src,P)+u;try{const Me=this.core.parse(fe,s.env,n).tokens,$e=Me.findIndex(ae=>ae.map&&typeof ae.map[1]=="number"&&ae.map[1]>P);if($e!==-1){const ae=Me.slice($e),U=I-P;U!==0&&this.shiftTokenLines(ae,U),B={tokens:ae}}}catch{B=null}}else B=null;if(!B){const fe=I;if(ue)B={tokens:Xu(n,u,s.env,{mode:"stream"})},fe>0&&this.shiftTokenLines(B.tokens,fe);else{const Me=this.core.parse(u,s.env,n);fe>0&&this.shiftTokenLines(Me.tokens,fe),B=Me}}let ee=0;if(s.tokens.length>0&&B.tokens.length>0){const fe=s.tokens[s.tokens.length-1],Me=B.tokens[0];try{fe.type==="inline"&&Me.type==="inline"&&(Me.children&&Me.children.length>0&&(fe.children||(fe.children=[]),this.appendTokens(fe.children,Me.children)),fe.content=(fe.content||"")+(Me.content||""),ee=1)}catch{ee=0}}const ne=s.tokens.length;if(B.tokens.length>ee){const fe=s.tokens,Me=B.tokens,$e=Math.min(fe.length,Me.length-ee);let ae=0;for(let U=$e;U>0;U--){let ce=!0;for(let se=0;se<U;se++){const V=fe[fe.length-U+se],Q=Me[ee+se];if(!C6(V,Q)){ce=!1;break}}if(ce){ae=U;break}}ae>0&&(ee+=ae),Me.length>ee&&this.appendTokens(s.tokens,Me,ee)}if(s.src=e,s.globalStateReason=null,s.lineCount=I+(q??j()),s.tokens.length>ne){const fe=this.getLastSegment(s.tokens,e,ne,s.tokens.length,e.length-u.length,I);fe?s.lastSegment=fe:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ue&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",go(s.env,{area:"stream",path:ue?"stream-unbounded-append":"stream-append",reason:ue?"large-delta":"safe-append",unbounded:ue}),s.tokens}const d=o??s.env,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",go(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,b=!h&&!u&&p,v=g||b,m=n.options?.streamChunkAdaptive!==!1,y=n.options?.streamChunkTargetChunks??8,k=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,$=n.options?.streamChunkMaxChunks,L=!!n.__explicitStreamChunkConfig,w=n.options?.autoTuneChunks!==!1,E=n.options?.streamChunkFenceAware??!0;let T=u&&s.lineCount!==void 0?s.lineCount+eo(u):void 0;if(v){T===void 0&&(T=eo(e));const I=(j,ie,ue)=>j<ie?ie:j>ue?ue:j,P=w&&!L?o_(e.length,T,n.options):null,B=P?.maxChunkChars??(m?I(Math.ceil(e.length/y),8e3,64e3):k??1e4),W=P?.maxChunkLines??(m?I(Math.ceil(T/y),150,700):A??200),z=P?.maxChunks??(m?I(Math.ceil(e.length/64e3),y,32):$),D=e.length>0&&e.charCodeAt(e.length-1)===10,q=b&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&P?.strategy!=="plain";if((g||q)&&(e.length>=B*2||T>=W*2)&&D){const j=up(n,e,d,{maxChunkChars:B,maxChunkLines:W,fenceAware:P?.fenceAware??E,maxChunks:z});return this.cache={src:e,tokens:j,env:d,lineCount:T,lastSegment:void 0,globalStateReason:As(e)},this.updateCacheLineCount(this.cache,T),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),j}}const F=this.parseFullDocument(e,d,n,T),S=F.tokens;return T=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:T,lastSegment:void 0,globalStateReason:As(e)},this.updateCacheLineCount(this.cache,T),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",go(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!br(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=br(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",go(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!br(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",go(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=As(e);Ud(t)&&Pr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?x6(n,e.length,o):"no";if(r==="yes"){const a=Xu(n,e,t);return go(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?eo(e):0)}}let l=o;if(r==="need-lines"&&(l=eo(e),b6(n,e.length,l))){const a=Xu(n,e,t);return go(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?eo(e):0),{tokens:$c(t,i,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length<this.MIN_UNBOUNDED_APPEND_TOTAL_CHARS&&n.length<this.MIN_UNBOUNDED_APPEND_CHARS?!1:n.length>=this.MIN_UNBOUNDED_APPEND_CHARS?!0:eo(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
156
- `))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let i=0,r=-1;for(let a=0;a<s&&!(o.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?o:o.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
157
- `);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const i=t.src.slice(0,s.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+eo(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let i=null,r=0;for(;r<=s;){let l=o.indexOf(`
158
- `,r);l===-1&&(l=s);let a=r;for(;a<l;){const c=o.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=o.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&o.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===s)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??aV}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;s<o;s++)e.push(t[s])}updateCacheLineCount(e,t){e.lineCount=t??eo(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-y0))+t,o=As(n);return e.globalStateCarry=n.length>y0?n.slice(n.length-y0):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(`
159
- `,i+1),i===-1)return e.length;s--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(`
160
- `,s+1),s===-1)return e.length;o--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,o,s,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,i,r);default:return null}}tryListTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const f=t.lineCount??eo(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+eo(i);t.lineCount=g;const b=this.getDocLineCount(e,g);return r.map&&(r.map[1]=b),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:b,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(s.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!f||!h||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const p=h.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(p.length===0)return null;const g=s.lineEnd-2;g!==0&&this.shiftTokenLines(p,g);const b=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,v=t.lineCount??eo(t.src);t.tokens.splice(b,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const m=v+eo(i);t.lineCount=m;const y=this.getDocLineCount(e,m);if(r.map&&(r.map[1]=y),h.tbodyOpenIndex>=0){const k=t.tokens[h.tbodyOpenIndex];k?.map&&(k.map[1]=y)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:y,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
161
- `);if(t<0)return null;const n=e.indexOf(`
162
- `,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let i=-1,r=-1;for(let l=t+1;l<s;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===o+1){i=l;break}}if(i>=0){for(let l=s-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],i=e[e.length-1];if(s.type!==t||i.type!==n||s.level!==0||i.level!==0||o!==void 0&&s.markup!==o)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,o){let s=!1,i=!1;const r=o+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?s=!0:i=!0,s&&i))return"loose"}return i?"loose":s?"tight":"none"}setListParagraphVisibility(e,t,n,o,s){const i=o+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=s)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=eo(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o<e.length;o++){const s=e[o];if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children){n??=[];for(let i=s.children.length-1;i>=0;i--)n.push(s.children[i]);for(;n.length>0;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let r=i.children.length-1;r>=0;r--)n.push(i.children[r])}}}}};const c_={default:tV,zero:nV,commonmark:eV};function hV(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function pV(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function u_(e){return e.experimental?{...e,...e.experimental}:e}function ui(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function d_(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(ui(t,s)||ui(e,s))return!0}return!1}function f_(e,t,n){return ui(t,n)||ui(e,n)}function h_(e,t){const n=br(e)?.chunk;if(n?.fallback){go(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}go(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function mV(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamLargeCachePolicy:"retain",streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},o="default",s;!t&&typeof e!="string"?(s=e,o="default"):typeof e=="string"&&(o=e,s=t);const i=c_[o];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${o}", check name`);if(i?.options&&(n={...n,...i.options}),s&&(n={...n,...s}),n=u_(n),typeof n.quotes=="string"){const w=n.quotes;w.length>=4?n.quotes=[w[0],w[1],w[2],w[3]]:n.quotes=["“","”","‘","’"]}let r=d_(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=d_(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=f_(i?.options,s,"fullChunkedFallback"),c=f_(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new ij;let p=null;const g=()=>(p||(p=new lV(n)),p);let b=null;const v=()=>(b||(b=new fV(h)),b);let m=null;const y=()=>(m||(m=new UA),m),k=w=>!u&&!!d&&!pV(w,d),A=(w,E)=>o==="default"&&!u&&p===null&&f!==null&&w.parse===f&&k(w)&&!w.stream.enabled&&E<(w.options.autoUnboundedThresholdChars??4e6)&&w.options.html===!1&&w.options.xhtmlOut===!1&&w.options.breaks===!1&&w.options.langPrefix==="language-"&&w.options.linkify===!1&&w.options.typographer===!1&&w.options.highlight===null,$=(w,E)=>o==="default"&&!u&&k(w)&&!w.stream.enabled&&!w.options.fullChunkedFallback&&E<(w.options.autoUnboundedThresholdChars??4e6)&&w.options.html===!1&&w.options.linkify===!1&&w.options.typographer===!1,L={core:h,block:h.block,inline:h.inline,get linkify(){const w=y();return Object.defineProperty(this,"linkify",{value:w,writable:!0,configurable:!0}),w},get renderer(){const w=g();return Object.defineProperty(this,"renderer",{value:w,writable:!0,configurable:!0}),w},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return k(this)},set(w){const E=u_(w);return this.options={...this.options,...E},(ui(w,"fullChunkSizeChars")||ui(w,"fullChunkSizeLines")||ui(w,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ui(w,"streamChunkSizeChars")||ui(w,"streamChunkSizeLines")||ui(w,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ui(w,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ui(w,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(E),typeof E.stream=="boolean"&&(this.stream.enabled=E.stream,b&&(b.reset(),b.resetStats())),this},configure(w){const E=typeof w=="string"?c_[w]:w;if(!E)throw new Error("Wrong `markdown-it` preset, can't be empty");if(E.options&&this.set(E.options),E.components){const T=E.components;T.core?.rules&&this.core.ruler.enableOnly(T.core.rules),T.block?.rules&&this.block.ruler.enableOnly(T.block.rules),T.inline?.rules&&this.inline.ruler.enableOnly(T.inline.rules),T.inline2?.rules&&this.inline.ruler2.enableOnly(T.inline2.rules)}return this},enable(w,E){const T=Array.isArray(w)?w:[w],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of F){if(!I)continue;const P=I.enable(T,!0);for(let B=0;B<P.length;B++)S.add(P[B])}if(!E){const I=T.filter(P=>!S.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(w,E){const T=Array.isArray(w)?w:[w],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of F){if(!I)continue;const P=I.disable(T,!0);for(let B=0;B<P.length;B++)S.add(P[B])}if(!E){const I=T.filter(P=>!S.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(w,...E){const T=typeof w=="function"?w:w&&typeof w.default=="function"?w.default:void 0;if(!T)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...E],S=w;return u=!0,T.apply(S,F),this},render(w,E){if(A(this,w.length)){E!==void 0&&cs(E);const S=e_(w);if(S!==null)return E!==void 0&&go(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const T=E??{},F=this.parse(w,T);return g().render(F,this.options,T)},async renderAsync(w,E){if(A(this,w.length)){E!==void 0&&cs(E);const S=e_(w);if(S!==null)return E!==void 0&&go(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const T=E??{},F=this.parse(w,T);return g().renderAsync(F,this.options,T)},renderIterable(w,E={}){const T=this.parseIterable(w,E);return g().render(T,this.options,E)},async renderAsyncIterable(w,E={}){const T=await this.parseAsyncIterable(w,E);return g().renderAsync(T,this.options,E)},renderInline(w,E={}){const T=this.parseInline(w,E);return g().render(T,this.options,E)},validateLink:l6,normalizeLink:a6,normalizeLinkText:c6,utils:Cz,helpers:{...hU},parse(w,E){if(typeof w!="string")throw new TypeError("Input data should be a String");if(E!==void 0&&cs(E),$(this,w.length)){const I=vj(w);if(I!==null)return E!==void 0&&go(E,{area:"parse",path:"stock-fast",reason:"stock-subset"}),I}const T=E??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&k(this)){const I=x6(this,w.length);if(I==="yes"){const P=Xu(this,w,T);return go(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),P}I==="need-lines"&&(F=eo(w))}if(!this.stream.enabled){const I=w.length,P=this.options.autoTuneChunks!==!1,B=r,W=!a&&k(this),z=!!this.options.fullChunkedFallback,D=W&&I>=2e5;let q;(z||D||F!==void 0)&&(q=F??eo(w));const j=(z||D)&&P&&!B?Jj(I,q,this.options):null;if(z||D){const ie=q??0;if(z?I>=(this.options.fullChunkThresholdChars??2e4)||ie>=(this.options.fullChunkThresholdLines??400):D){if(j&&j.strategy!=="plain"){const ue=up(this,w,T,{maxChunkChars:j.maxChunkChars,maxChunkLines:j.maxChunkLines,fenceAware:j.fenceAware,maxChunks:j.maxChunks});return E&&h_(E,z?"explicit-full-chunk":"default-large-string"),ue}if(z){const ue=(ce,se,V)=>ce<se?se:ce>V?V:ce,pe=this.options.fullChunkAdaptive!==!1,ee=this.options.fullChunkTargetChunks??8,ne=ue(Math.ceil(I/ee),8e3,64e3),fe=ue(Math.ceil(ie/ee),150,700),Me=pe?ne:this.options.fullChunkSizeChars??1e4,$e=pe?fe:this.options.fullChunkSizeLines??200,ae=pe?ue(Math.ceil(I/64e3),ee,32):this.options.fullChunkMaxChunks,U=up(this,w,T,{maxChunkChars:Me,maxChunkLines:$e,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:ae});return E&&h_(E,"explicit-full-chunk"),U}}}if(F!==void 0&&k(this)&&b6(this,I,q??F)){const ie=Xu(this,w,T);return go(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),ie}}const S=As(w);return go(E,{area:"parse",path:"plain",reason:"default-plain"}),$c(T,S,()=>h.parse(w,T,this).tokens)},parseIterable(w,E={}){return cs(E),Yj(this,w,E)},parseAsyncIterable(w,E={}){return cs(E),Zj(this,w,E)},parseIterableToSink(w,E,T={}){return cs(T),Xj(this,w,E,T)},parseAsyncIterableToSink(w,E,T={}){return cs(T),Qj(this,w,E,T)},parseInline(w,E={}){if(typeof w!="string")throw new TypeError("Input data should be a String");cs(E),Ud(E)&&Pr(E);const T=h.createState(w,E,this);return T.inlineMode=!0,h.process(T),T.tokens}};if(L.stream={enabled:!!n.stream,parse(w,E){return L.stream.enabled?v().parse(w,E,L):L.parse(w,E??{})},reset(){v().reset()},peek(){return b?b.peek():[]},stats(){return b?b.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){b&&b.resetStats()}},i?.components){const w=i.components;w.core?.rules&&L.core.ruler.enableOnly(w.core.rules),w.block?.rules&&L.block.ruler.enableOnly(w.block.rules),w.inline?.rules&&L.inline.ruler.enableOnly(w.inline.rules),w.inline2?.rules&&L.inline.ruler2.enableOnly(w.inline2.rules)}return d=hV(L),f=L.parse,L}var gV=mV;const A6=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],vV=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],M6=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],yV=["svg","g","path"],kV=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],bV=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","srcdoc","ping"],xV=["action","data","href","src","srcset","poster","xlink:href","formaction"],wV=["script"],_V=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Fa=new Set(A6),SV=new Set(M6),Ed=new Set([...A6,...vV,...M6,...yV]),E6=new Set([...Ed,...kV]),CV=new Set(bV),AV=new Set(xV),jd=new Set(wV),T6=new Set(_V);function N6(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const MV={amp:"&",bsol:"\\",colon:":",newline:`
163
- `,sol:"/",tab:" "};function I6(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const i=n??o;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return MV[String(s??"").toLowerCase()]??t})}const qf=new Set(["http","https","mailto","tel"]),EV=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),ea=new Set(["http","https"]);function L6(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function TV(e,t,n){if(!ed(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function ed(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function NV(e,t){return t==="href"||t==="xlink:href"?ed(e,t)?qf:ea:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?ea:(ed(e,t),qf)}function ba(e,t={}){const n=N6(I6(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return o==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=L6(n);return i?i==="file"?!TV(n,o,s):ed(o,s)?EV.has(i):!NV(o,s).has(i):!1}function IV(e){const t=I6(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=L6(N6(t).toLowerCase());return n==="http"||n==="https"}function LV(e,t={}){const n=String(e??"").trim();return n?ba(n,t)?"":n:""}function p_(e){return LV(e,{tagName:"img",attrName:"src"})}function $V(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,h,p,g,b){return f[h].nesting===1&&f[h].attrJoin("class",t),b.renderToken(f,h,p,g,b)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(f,h,p,g){let b,v=!1,m=f.bMarks[h]+f.tShift[h],y=f.eMarks[h];if(l!==f.src.charCodeAt(m))return!1;for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);const k=Math.floor((b-m)/a);if(k<i)return!1;b-=(b-m)%a;const A=f.src.slice(m,b),$=f.src.slice(b,y);if(!c($,A))return!1;if(g)return!0;let L=h;for(;L++,!(L>=p||(m=f.bMarks[L]+f.tShift[L],y=f.eMarks[L],m<y&&f.sCount[L]<f.blkIndent));)if(l===f.src.charCodeAt(m)&&!(f.sCount[L]-f.blkIndent>=4)){for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);if(!(Math.floor((b-m)/a)<k)&&(b-=(b-m)%a,b=f.skipSpaces(b),!(b<y))){v=!0;break}}const w=f.parentType,E=f.lineMax;f.parentType="container",f.lineMax=L;const T=f.push("container_"+t+"_open","div",1);T.markup=A,T.block=!0,T.info=$,T.map=[h,L],f.md.block.tokenize(f,h+1,L);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(m,b),F.block=!0,f.parentType=w,f.lineMax=E,f.line=L+(v?1:0),!0}e.block.ruler.before("fence","container_"+t,d,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+t+"_open"]=u,e.renderer.rules["container_"+t+"_close"]=u}function FV(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const o=[];let s="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){s+=c,a+1<n.length&&(s+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,s+=c;continue}if(!i&&c==='"'){r=!r,s+=c;continue}if(!i&&!r&&c===","){o.push(s.trim()),s="";continue}s+=c}s.trim()&&o.push(s.trim());const l={};for(const a of o){if(!a)continue;let c=!1,u=!1,d=-1;for(let b=0;b<a.length;b++){const v=a[b];if(v==="\\"){b++;continue}if(!u&&v==="'"){c=!c;continue}if(!c&&v==='"'){u=!u;continue}if(!c&&!u&&v===":"){d=b;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!f)return null;let p=f;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let g;if(!h)g="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{g=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{g=h}else/^-?\d+(?:\.\d+)?$/.test(h)?g=Number(h):h==="true"||h==="false"?g=h==="true":h==="null"?g=null:g=h;l[p]=g}return l}function OV(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use($V,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
164
- `}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,h;const p=d.indexOf("{"),g=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,g?.startsWith("{")){let A=0,$=-1;for(let L=0;L<g.length;L++)if(g[L]==="{"?A++:g[L]==="}"&&A--,A===0){$=L+1;break}$>0&&(h=g.slice(0,$))}h||(f=d||void 0)}if(s)return!0;const b=!!i.env.__markstreamFinal;let v=n+1,m=!1;for(;v<=o;){const A=i.bMarks[v]+i.tShift[v],$=i.eMarks[v];if(i.src.slice(A,$).trim()===":::"){m=!0;break}v++}m||(v=o);const y=i.push("vmr_container_open","div",1);if(y.attrSet("class",`vmr-container vmr-container-${u}`),y.meta={...y.meta??{},unclosed:!m&&!b},f&&y.attrSet("data-args",f),h)try{const A=JSON.parse(h);for(const[$,L]of Object.entries(A)){const w=L!=null&&typeof L=="object";y.attrSet(`data-${$}`,w?JSON.stringify(L):String(L))}}catch{const A=FV(h);if(A)for(const[$,L]of Object.entries(A)){const w=L!=null&&typeof L=="object";y.attrSet(`data-${$}`,w?JSON.stringify(L):String(L))}else y.attrSet("data-attrs",h)}const k=[];for(let A=n+1;A<v;A++){const $=i.bMarks[A]+i.tShift[A],L=i.eMarks[A];k.push(i.src.slice($,L))}if(k.some(A=>A.trim().length>0)){let A=k.join(`
165
- `);A.endsWith(`
166
- `)||(A+=`
167
- `),A.endsWith(`
168
-
169
- `)||(A+=`
170
- `);const $=i.tokens[i.tokens.length-1];$&&($.raw=A);const L=[];i.md.block.parse(A,i.md,i.env,L),i.tokens.push(...L)}return m&&i.push("vmr_container_close","div",-1),i.line=m?v+1:v,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ys(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yn(e){let t=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="\\"){o++;continue}if(!n&&s==="'"){t=!t;continue}if(!t&&s==='"'){n=!n;continue}if(!t&&!n&&s===">")return o}return-1}function Cm(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=o[2]||o[3]||o[4]||"";t.push([s,i])}return t}const RV=/^[a-z][a-z0-9_-]*$/;function m_(e){return RV.test(String(e??"").trim().toLowerCase())}function wi(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return m_(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const o=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const s=t.slice(o,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":m_(s)?s:""}function tu(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=wi(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function BV(...e){const t=new Set,n=[];for(const o of e)for(const s of tu(o))t.has(s)||(t.add(s),n.push(s));return n}function DV(e){const t=tu(e);return{key:t.join(","),tags:t}}function $6(e){return wi(e)}function PV(e,t){const n=String(e??""),o=wi(t);if(!o)return!1;const s=Ys(o),i=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function F6(e,t){const n=wi(t);return!!n&&!Ed.has(n)&&!PV(e,n)}function HV(e,t){const n=String(e??""),o=wi(t);if(!o)return n;const s=Ys(o),i=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const O6=Fa,WV=Ed,R6=new Set(SV);R6.delete("details");const zV=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,UV=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,iv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,qV=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function hp(e){return(e.match(iv)?.[1]??"").toLowerCase()}function Xy(e){return/^\s*<\s*\//.test(e)}function Qy(e,t){return O6.has(t)||/\/\s*>\s*$/.test(e)}function jV(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(!s||s.type!=="html_inline")continue;const i=String(s.content??""),r=hp(i);if(r===t){if(Xy(i)){if(n===0)return o;n--;continue}Qy(i,r)||n++}}return-1}function VV(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=hp(s);if(i===t){if(Xy(s)){n>0&&n--;continue}Qy(s,i)||n++}}return n}function g_(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Ys(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,i;for(;(i=o.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:i.index,end:i.index+r.length};s--;continue}a||s++}return null}function KV(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ys(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const i=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(i);if(r){o>0&&o--;continue}l||o++}return o}function pp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function GV(e){const t=e;return t.meta||(t.meta={}),t.meta}function k0(e,t,n){const o=GV(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function YV(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ys(h)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!o.length))for(const p of o)p.raw+=h,p.inner+=h},l=()=>{!o.length||!s||(r(`
171
- `),s=!1)},a=h=>{r(h)},c=h=>{for(let g=0;g<o.length;g++)o[g].raw+=h,g<o.length-1&&(o[g].inner+=h);const p=o.pop();k0(p.token,p.raw,p.inner)},u=h=>{const p=o[o.length-1]?.tag;if(!p)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Ys(p)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!u(h),f=(h,p,g)=>{const b=g??(h.type==="html_inline"?hp(p):"");if(!(b&&t.has(b))){r(p);return}const v=Xy(p),m=!v&&Qy(p,b);if(v){if(!o.length||o[o.length-1].tag!==b){r(p);return}c(p);return}if(r(p),m){k0(h,p,"");return}o.push({tag:b,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?s=!1:l(),!o.length&&!i(p)){s=!1;continue}let g=0,b=!0;for(const v of h.children){const m=pp(v),y=v.type==="html_inline"?hp(m):"",k=y&&t.has(y);let A=m;if(b&&p&&m&&(o.length||k)){const $=p.indexOf(m,g);if($!==-1)a(p.slice(g,$)),A=p.slice($,$+m.length),g=$+m.length;else{if(o.length&&!k)continue;b=!1}}f(v,A,y)}b&&p&&g<p.length&&o.length&&a(p.slice(g)),s=o.length>0;continue}if(o.length&&typeof h.content=="string"){const p=pp(h),g=h.type==="html_block"?u(p):null;if(g){c(`${s?`
172
- `:""}${g}`),s=o.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of o)k0(h.token,h.raw,h.inner)}function ZV(e){return/^\s*<\s*[!?]/.test(e)}function XV(e){const t=new Set(WV);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function v_(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function QV(e,t){let n=null;for(const i of e.matchAll(zV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();v_(l,t)&&Yn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(UV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();v_(l,t)&&Yn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const o=/<\/\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const s=/<\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function JV(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function eK(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(JV(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const f=a.slice(d),h=f.match(iv);if(!h){i("<",c),u=d+1;continue}const p=Yn(f);if(p===-1){i("<",c),u=d+1;continue}const g=f.slice(0,p+1),b=(h[1]??"").toLowerCase();t.has(b)?n.push({type:"html_inline",tag:"",content:g,raw:g}):i(g,c),u=d+g.length}}function l(a,c){if(!a)return;const u=QV(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),o={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},s=o.buffer}for(const a of e){if(o){o.buffer+=pp(a),s=o.buffer;const c=Yn(o.buffer);if(c===-1)continue;const u=o.buffer.slice(0,c+1),d=o.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),o=null,s=null,d&&l(d);continue}if(a.type==="html_inline"){const c=pp(a),u=(c.match(iv)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Yn(c)===-1){o={tag:u,buffer:c,closing:/^<\s*\//.test(c)},s=o.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:s??void 0}}const tK=["a","span","strong","em","b","i","u"];function nK(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=wi(f);h&&n.add(h)}const o=f=>{const h=f,p=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const y of g){const k=wi(String(y??""));k&&p.add(k)}const b=XV(Array.from(p)),v=new Set(tK);for(const y of p)v.add(y);return{autoCloseInlineTagSet:v,commonHtmlTags:b,customTagSet:p,shouldMergeHtmlBlockTag:y=>p.has(y)||!b.has(y)||R6.has(y)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},i=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,h)=>{const p=r(f);if(!/\S/.test(p))return[];if(l(p))return[{type:"code_block",content:a(p),raw:p}];const g=p.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const b={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},b,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[b]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:g}=o(f);for(const b of h){const v=b;if(v.type!=="inline"||!Array.isArray(v.children))continue;const m=String(v.content??""),y=v.children.length?v.children:m.includes("<")?[{type:"text",content:m,raw:m}]:null;if(y)try{const k=eK(y,p);if(v.children=k.children,k.pendingBuffer){const A=m.lastIndexOf(k.pendingBuffer);if(A!==-1){const $=m.slice(0,A);v.content=$,typeof v.raw=="string"&&(v.raw=$)}}}catch(k){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",k)}}YV(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:g,shouldMergeHtmlBlockTag:b}=o(f),v=[];for(let m=0;m<h.length;m++){const y=h[m];if(v.length>0){const[A,$]=v[v.length-1];if(m!==$){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const L=String(y.content??y.raw??"");if(L){const w=h[$],E=`${String(w.content||"")}
173
- ${L}`,T=Yn(E),F=T===-1?null:g_(E,A,T+1);if(F){const S=E.slice(0,F.end),I=E.slice(F.end);w.content=S,w.loading=!1,h.splice(m,1),v.pop();const P=d(w,I)?[]:c(I,u(h,m,"paragraph"));P.length&&h.splice(m,0,...P),m--;continue}w.content=E,w.loading!==!1&&(w.loading=!0)}h.splice(m,1),m--;continue}}const k=s(y);if(k){if(ZV(k))continue;const A=(k.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),$=/^\s*<\s*\//.test(k);if(!A||!b(A))continue;if(i(y,k),!$)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(k)&&KV(k,A)>0&&v.push([A,m]);else if(v.length>0&&A&&v[v.length-1][0]===A){const[,L]=v[v.length-1],w=h[L];w.content=`${String(w.content||"")}
174
- ${k}`,w.loading=!1,v.pop(),h.splice(m,1),m--}continue}else if(v.length>0){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const A=y.content||"",$=new RegExp(`<\\s*\\/\\s*${v[v.length-1][0]}\\s*>`,"i").test(A);if(A){const[,L]=v[v.length-1],w=h[L];w.content=`${w.content||""}
175
- ${A}`,w.loading!==!1&&(w.loading=!$)}$&&v.pop(),h.splice(m,1),m--}else continue}if(g.size>0){const m=new Map,y=new Map,k=L=>{let w=m.get(L);return w||(w=new RegExp(`<\\s*${L}\\b`,"i"),m.set(L,w)),w},A=L=>{let w=y.get(L);return w||(w=new RegExp(`<\\s*\\/\\s*${L}\\s*>`,"i"),y.set(L,w)),w},$=[];for(let L=0;L<h.length;L++){const w=h[L],E=String(w.content??"");if($.length>0){const F=$[$.length-1],S=h[F.index],I=w.type==="html_block"?A(F.tag).exec(E):null;if(I){const W=I.index+I[0].length,z=E.slice(0,W),D=E.slice(W);S.content=`${String(S.content??"")}
176
- ${z}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),$.pop();const q=d(S,D)?[]:c(D,u(h,L,"paragraph"));q.length?h.splice(L,1,...q):(h.splice(L,1),L--);continue}if(w.type!=="inline")continue;const P=Array.isArray(w.children)?w.children:[],B=jV(P,F.tag);if(B!==-1){const W=P.slice(0,B+1),z=P.slice(B+1),D=W.map(q=>String(q?.content??q?.raw??"")).join("");if(S.content=`${String(S.content??"")}
177
- ${D}`,Array.isArray(S.children)&&S.children.push(...W),z.length){const q=z.map(j=>String(j.content??j.raw??"")).join("");if(q.trim()){const j=q.replace(/^\s+/,"");if(d(S,q))h.splice(L,1),L--;else if(j.startsWith("<"))h.splice(L,1,{type:"html_block",content:j});else{const ie=c(q,u(h,L,"paragraph"));h.splice(L,1,...ie)}}else h.splice(L,1),L--}else h.splice(L,1),L--;$.pop();continue}S.content=`${String(S.content??"")}
178
- ${E}`,Array.isArray(S.children)&&S.children.push(...P),h.splice(L,1),L--;continue}if(w.type!=="inline")continue;const T=Array.isArray(w.children)?w.children:[];for(const F of g)if((T.length?VV(T,F):k(F).test(E)&&!A(F).test(E)?1:0)>0){$.push({tag:F,index:L});break}}}{let m=0;for(let y=0;y<h.length;y++){const k=h[y];if(k.type==="paragraph_open"){m++;continue}k.type==="paragraph_close"&&(m>0?m--:(h.splice(y,1),y--))}}for(let m=0;m<h.length;m++){const y=h[m];if(y.type==="html_block"){const w=(y.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(w.startsWith("!")||w.startsWith("?")){y.loading=!1;continue}if(g.has(w)){const B=String(y.content??""),W=Yn(B),z=W===-1?null:g_(B,w,W+1);y.loading=z?!1:y.loading!==void 0?y.loading:!0;const D=z?.start??-1,q=z?z.end-z.start:0;if(D!==-1){const j=B.slice(0,D+q);let ie="";W!==-1&&W<D&&(ie=B.slice(W+1,D)),y.children=[{type:w,content:ie,raw:j,attrs:[],tag:w,loading:!1}],y.content=j,y.raw=j;const ue=c(B.slice(D+q)||"","text");ue.length&&h.splice(m+1,0,...ue)}else y.children=[{type:w,content:"",raw:B,attrs:[],tag:w,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(w))continue;y.type="inline";const E=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let T;for(;(T=E.exec(y.content||""))!==null;)T[1],T[2]||T[3]||T[4];const F=String(y.content??""),S=new RegExp(`<\\/\\s*${w}\\s*>`,"i").exec(F),I=S?S.index:-1,P=S?S[0].length:0;if(I!==-1){const B=F.slice(0,I+P),W=(F.slice(I+P)||"").replace(/^\s+/,"");y.children=[{type:"html_block",content:B,tag:w,loading:!1}],y.content=B,y.raw=B,W&&h.splice(m+1,0,W.startsWith("<")?{type:"html_block",content:W}:{type:"text",content:W,raw:W})}else y.children=[{type:"html_block",content:y.content,tag:w,loading:!0}];continue}if(!y||y.type!=="inline")continue;if(y.children.length===2&&y.children[0].type==="html_inline"){const w=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),E=y.children[1],T=String(E?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(E?.type==="html_inline"&&T===w)continue;p.has(w)?(y.children[0].loading=!0,y.children[0].tag=w,y.children.push({type:"html_inline",tag:w,loading:!0,content:`</${w}>`})):y.children=[{type:"html_block",loading:!0,tag:w,content:String(y.children[0]?.content??"")+String(y.children[1]?.content??"")}];continue}else if(y.children.length===3&&y.children[0].type==="html_inline"&&y.children[2].type==="html_inline"){const w=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(w))continue;y.children=[{type:"html_block",loading:!1,tag:w,content:y.children.map(E=>E.content).join("")}];continue}if(!y.content?.startsWith("<")||y.children?.length!==1)continue;const k=String(y.content),A=y,$=A.children[0];if($?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(k)&&(A.children.length=0);continue}const L=String($.content??k).match(qV)?.[1]?.toLowerCase()??"";if(L){if(/\/\s*>\s*$/.test(k)||O6.has(L)){A.children=[{type:"html_inline",content:k}];continue}A.children.length=0}}})}function oK(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|<!--|-->)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function sK(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;s<o.length;s++){const i=o[s];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!oK(l[0]??"")){const a=l[0]??"",c=i.level??0;o.splice(s,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),s+=2}}})}const B6=/\.([a-z0-9]{1,15})$/i,iK=/[_()[\]{}<>]/u,rK=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,lK=/[?#@]/u,aK=/[\\/]/u,cK=/^[\p{L}\p{N}./\\-]+$/u,uK=/^[A-Za-z0-9-]{1,63}$/u,dK=/^xn--[a-z0-9-]{2,59}$/i,fK=/^(?:[A-Z]{1,6}|\d{1,8})$/u,hK=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,pK=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,mK=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,gK=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,vK=new Set(["ai","md","py","rs","sh","zip"]),D6=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),yK=new Set([...D6,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),kK=new Set(["com","dev","io","page","site"]),bK=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),xK=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]);function Td(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function b0(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Td(n)?n:void 0}function y_(e,t){if(!Td(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function k_(e){const t=Vd(e);return Td(t)?t:void 0}function wK(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function b_(e,t){if(!Td(t))return;const n=String(e??"").trim().split(/\s+/u).map(wK).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>mp(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>mp(s,{marketTicker:!0}))&&(o.marketTicker=!0),Td(o)?o:void 0}function Bl(e,t=!1){let n;return{options(o){return t||o==null?y_(e,n):y_(e,b0(k_(o),b_(o,n)))},remember(o){const s=k_(o);n=t?b0(n,s):b0(s,b_(o,n))},reset(){n=void 0}}}function x_(e){return uK.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function _K(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return x_(n)||dK.test(n)?t.every(x_):!1}function P6(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function SK(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function CK(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function H6(e,t,n){const o=SK(t);return P6(e)&&CK(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function Vd(e){const t=String(e??"");return{explicitFilename:pK.test(t),filename:mK.test(t),marketTicker:gK.test(t)}}function AK(e){return _K(e.split(/[\\/]/)[0]??"")}function MK(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function EK(e){if(iK.test(e)||!cK.test(e))return!0;if(aK.test(e))return!AK(e);const t=e.replace(B6,"");return P6(t)?!0:t.split(".").filter(Boolean).some(MK)}function TK(e,t,n){if(!(n?yK:D6).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?hK:fK).test(o)}function mp(e,t={}){if(!e||rK.test(e)||lK.test(e))return!1;const n=e.match(B6);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return TK(e,o,t.marketTicker===!0)?!0:xK.has(o)?!vK.has(o)||t.filename?!0:EK(e):!!(t.explicitFilename&&kK.has(o)||t.filename&&bK.has(o))}const w_=["!"];function Ss(e){return{type:"text",content:e,raw:e}}function ta(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function na(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function nl(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function NK(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(Ss(t))}}function __(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||s<n)&&(n=s)}return n}function IK(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function LK(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function $K(e,t,n){let o="";for(let s=t+1;s<n;s++){const i=e[s];if(i?.type!=="text"||typeof i.content!="string")return null;o+=i.content}return o||null}function FK(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=OK(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function OK(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=Vd(t);for(let o=0;o<=e.length-1;o++){o<0&&(o=0);const s=e[o];if(!s)break;if(s.type==="link_open"&&(s.markup==="linkify"||s.markup==="autolink")){let i=-1;for(let r=o+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=$K(e,o,i),l=IK(s);if(s.markup==="linkify"&&r&&!H6(r,l,t)&&mp(r,n)){e.splice(o,i-o+1,Ss(r));continue}const a=__(l,w_);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=__(u.content,w_);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let v=c+1;v<i;v++){const m=e[v];m?.type==="text"&&typeof m.content=="string"&&(p+=m.content)}u.content=h,u.raw=h;const g=i-(c+1);g>0&&(e.splice(c+1,g),i=c+1);let b=l;if(a!==-1)b=l.slice(0,a);else if(p){const v=encodeURI(p);if(v&&l.endsWith(v))b=l.slice(0,l.length-v.length);else{const m=f?encodeURI(f):"",y=m?l.indexOf(m):-1;y!==-1&&(b=l.slice(0,y))}}b!==l&&LK(s,b),p&&e.splice(i+1,0,Ss(p));break}}}if(s?.type==="em_open"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("*")){const i=e[o-1].content?.replace(/(\*+)$/,"")||"";e[o-1].content=i,s.type="strong_open",s.tag="strong",s.markup="**";for(let r=o+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(s?.type==="text"&&s.content?.endsWith("(")&&e[o+1]?.type==="link_open"){const i=s.content.match(/\[([^\]]+)\]/);if(i){let r=s.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Ss(r));const c=i[1],u=l[1].length;ta(a,u);let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(nl(c,d,!e[o+4]?.content?.startsWith(")"))),na(a,u),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)\**/,"");f&&a.push(Ss(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(Ss(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(h+=e[o+4]?.content||"",e[o+4].content=""),ta(a,f),a.push(nl(c,h,!e[o+4]?.content?.startsWith(")"))),na(a,f),e[o+4]?.type==="text"){const p=e[o+4].content?.replace(/^\)/,"");p&&a.push(Ss(p)),e.splice(o,5,...a)}else e.splice(o,4,...a);o===0?o=a.length-1:o-=a.length+1;continue}let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(nl(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(Ss(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}o-=a.length+1;continue}}else if(s.type==="link_open"&&s.markup==="linkify"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("(")){if(e[o-2]?.type==="link_close"){const i=[],r=e[o-3].content||"";let l=s.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[o+3]?.type==="text"){const a=(e[o+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[o+3]?.content?.slice(0,a)||"",e[o+3].content=""),i.push(nl(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(Ss(u)),e.splice(o-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(o-4,7,...i);continue}else if(e[o-1].content==="]("&&e[o-3]?.type==="text"&&e[o-3].content?.endsWith(")"))if(e[o-2]?.type==="strong_open"){const[i,r]=e[o-3].content?.split("[**")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else if(e[o-2]?.type==="em_open"){const[i,r]=e[o-3].content?.split("[*")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else{const[i,r]=e[o-3].content?.split("[")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}}if(s.type==="link_close"&&s.nesting===-1&&e[o-2]?.type==="link_open"&&e[o+1]?.type==="text"&&e[o-1]?.type==="text"){const i=e[o-1].content||"",r=e[o-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;ta(f,p)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let p=o+1;p<e.length;p++){const g=d?d[1].length:e[o-3].markup.length,b=e[p];if(g===1&&b.type==="em_close")break;if(g===2&&b.type==="strong_close")break;if(g===3&&(b.type==="em_close"||b.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(h),d){const p=d[1].length;na(f,p)}e.splice(o-u,c,...f),o-=f.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].markup?.includes("*")&&e[o-4]?.type==="text"&&e[o-4].content?.endsWith("[")){const i=e[o-1].markup.length,r=[],l=e[o-4].content.slice(0,e[o-4].content.length-i);l&&r.push(Ss(l)),ta(r,i);const a=e[o-2].content||"";let c=s.content.slice(2),u=!0;if(e[o+1]?.type==="text"){const d=(e[o+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[o+1]?.content?.slice(0,d)||"",e[o+1].content="")}if(r.push(nl(a,c,u)),na(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(Ss(d)),e.splice(o-4,8,...r)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...r):e.splice(o-4,7,...r);o-=r.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].type==="strong_close"&&e[o-4]?.type==="text"&&e[o-4]?.content?.includes("**[")){const i=[],r=e[o-4].content.split("**[")[0];r&&i.push(Ss(r)),ta(i,2);const l=e[o-2].content||"";let a=s.content.slice(2),c=!0;if(e[o+1]?.type==="text"){const u=(e[o+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[o+1]?.content?.slice(0,u)||"",e[o+1].content="")}if(i.push(nl(l,a,c)),na(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(Ss(u)),e.splice(o-4,8,...i)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...i):e.splice(o-4,7,...i);o-=i.length+1;continue}else if(s.type==="strong_close"&&e[o+1]?.type==="text"&&e[o+1].content?.includes("](")&&e[o-1].type==="text"&&/\[.*$/.test(e[o-1].content||"")){const i=[],[r,l]=e[o-1].content?.split("[")||["",""];r&&i.push(Ss(r)),ta(i,2);let[a,c]=e[o+1].content.split("](");a=l+a;let u=4;if(e[o+2]?.type==="link_open"){const f=e[o+2].attrs?.find(h=>h[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(f||c)+e[o+5].content,e[o+5].content=""):c=f||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const f=(e[o+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[o+2]?.content?.slice(0,f)||"",e[o+2].content="")}i.push(nl(a,c,d)),na(i,2),e.splice(o-2,u,...i)}if(s.type==="text"&&/\*+\[[^\]]*$/.test(s.content||"")&&e[o+1]?.type==="strong_open"&&e[o+2]?.type==="text"&&e[o+2].content==="]("&&e[o+3]?.type==="link_open"&&e[o+5]?.type==="link_close"&&e[o+6]?.type==="text"&&e[o+6].content===")"&&e[o+7]?.type==="strong_close"){const i=(s.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[o+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[o+4]?.type==="text"&&(l=e[o+4].content||"");const a=[];ta(a,2),a.push(nl(r,l,!1)),na(a,2),e.splice(o,9,...a),o-=a.length-1;continue}}}for(let o=0;o<e.length-1;o++){const s=e[o],i=e[o+1];if(s?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(s.href??"");if(String(s.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;NK(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function RK(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=BK(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function BK(e){const t=e[e.length-1],n=String(t?.content??"");return t?.type==="text"&&/^\s*\d+\.\s*$/.test(n)&&e[e.length-2]?.tag==="br"&&e.splice(e.length-1,1),e}function DK(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=PK(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function PK(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const g=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="__"&&(g?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(f==="em_open"){s++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const g=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="_"&&(g?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else f==="em_close"&&(o.has(s)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),s--,s<0&&(s=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,f=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],h=c.slice(0,-1);h&&f.unshift({type:"text",content:h,raw:h}),l.splice(i,d,...f)}return l=HK(l),l}function HK(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const f=u.slice(0,d),h=u.slice(d+2);t.push(o),t.push(s),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=WK(e,n+6);if(u){t.push(o),t.push(s),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(o)}return t}function WK(e,t){for(let n=t;n<e.length;n++){const o=e[n];if(o?.type==="strong_open")return null;if(o?.type!=="text")continue;const s=String(o.content??""),i=s.indexOf("**");if(i!==-1)return{index:n,beforeClose:s.slice(0,i),afterClose:s.slice(i+2)}}return null}function zK(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=GK(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function S_(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function C_(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function A_(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function W6(e,t){if(!e.startsWith("|")||e.includes(`
179
- `)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function x0(e){return W6(e)!==null}function z6(e){return/^:?-+:?$/.test(e.trim())}function UK(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(z6)}function qK(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function jK(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(z6)&&qK(n)}function VK(e){return e==="|"||e==="|:"}function KK(e){const t=W6(e);return t!==null&&t.every(n=>!n.includes(":"))}function GK(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,i=e[s];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
180
- `)[0]??"",[a="",c="",...u]=r.split(`
181
- `),d=!t&&!r.includes(`
182
- `)&&/\r?\n$/.test(n)&&x0(r);if(!t&&(r.includes(`
183
- `)&&u.length===0&&x0(a)&&jK(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>A_(p)),h=[...S_(),...f,...C_()];o.splice(s-1,3,...h)}else if(r.includes(`
184
- `)&&u.length===0&&x0(a)&&UK(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>A_(p)),h=[...S_(),...f,...C_()];o.splice(s-1,3,...h)}else r.includes(`
185
- `)&&u.length===0&&KK(a)&&VK(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function YK(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c<s-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=o;let l=0,a=t;for(;a<s;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var ZK=YK;const XK=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],gp=XK.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),QK=/\\[a-z]+/i,U6="(?:\\\\|\\u0008)",JK=new RegExp(String.raw`${U6}(?:${gp})\s*\{[^}]+\}`,"i"),eG=new RegExp(String.raw`(?:${U6})?(?:${gp})\s*\{`,"i"),tG=/\\(?:text|frac|left|right|times)/,nG=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,oG=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,sG=/[A-Z]+\s*\([^)]+\)/i,iG=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,rG=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,lG=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,aG={"\b":"\\b","\v":"\\v","\f":"\\f"};function cG(e){let t="";for(const n of e)t+=aG[n]??n;return t}function bc(e){if(!e)return!1;const t=cG(e),n=t.trim();if(lG.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=QK.test(t),s=JK.test(t),i=eG.test(t),r=tG.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=nG.test(t)&&!oG.test(t),c=sG.test(t),u=iG.test(n),d=rG.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||h}const q6="__markstreamMathPluginApplied",rv=80,j6=2e4,M_=j6+4096;function V6(e){return!!e[q6]}function uG(e){e[q6]=!0}const K6=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],dG=["cdot","mathbf{","partial","mu_{"],G6=K6.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Y6="[ \r\b\f\v]",fG=new RegExp(`([^\\\\])(${dG.map(e=>e).join("|")})+`,"g"),hG=/span\{([^}]+)\}/,pG=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,mG=/(^|[^\\])\\\r?\n/g,gG=/(^|[^\\])\\$/g,vG=new RegExp(`(${Y6})|(${G6})\\b`,"g"),E_=new Map,T_=new Map;function yG(e){if(!e)return vG;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=E_.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${Y6})|(${s})\\b`,"g");return E_.set(n,i),i}function kG(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=T_.get(o);if(s)return s;const i=e?[gp,G6].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),gp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return T_.set(o,r),r}const N_={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function I_(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function L_(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function ol(e,t){const n=t?.commands??K6,o=t?.escapeExclamation??!0,s=t?.commands==null,i=yG(s?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&N_[u]!==void 0)return`\\${N_[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});o&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=kG(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(hG,"span\\{$1\\}").replace(pG,"\\operatorname{span}\\{$1\\}"),l=l.replace(mG,`$1\\\\
186
- `),l=l.replace(gG,"$1\\\\"),l=l.replace(fG,"$1\\$2"),l}function $_(e){const t=e.trim();return!(!bc(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function Z6(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const o=n;let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;let i=o+s,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===s){r=i;break}i+=l}if(r!==-1){t.push([o,r+s]),n=r+s;continue}n=o+s}return t}function vp(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function bG(e,t=!1){const n=[];let o=0;for(;o<e.length-1;){if(e[o]==="!"&&e[o+1]==="["){const s=o;let i=o+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([s,l]),o=l;continue}if(t){n.push([s,e.length]),o=e.length;continue}}}o++}return n}function Kd(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function lv(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(Kd(e,o)){n=o+1;continue}return o}return-1}function w0(e,t){let n=t;for(;n<e.length;){const o=lv(e,n);if(o===-1)return-1;if(o>0&&e[o-1]==="$"||o+1<e.length&&e[o+1]==="$"){n=o+1;continue}return o}return-1}function Hu(e,t,n=0){let o=Math.max(0,n);for(;o<e.length;){const s=e.indexOf(t,o);if(s===-1)return-1;if(!Kd(e,s))return s;o=s+Math.max(1,t.length)}return-1}function F_(e,t,n=0,o=e.length,s=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,o));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=vp(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Kd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function Jy(e,t,n){const o=Id(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!Id(o.slice(0,s)).trim()||Kd(o,s))return-1;const i=Z6(o);if(vp(i,s))return-1;const r=F_(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>F_(o,n,0,s,i))return-1;return s}function Nd(e){return e===" "||e===" "}function Id(e){let t=e.length;for(;t>0&&Nd(e[t-1]);)t--;return e.slice(0,t)}function O_(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
187
- `&&t++;return t}function R_(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function xG(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s===t){n++;continue}if(!Nd(s))return!1}return n>=3}function wG(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function _G(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(wG)}function SG(e){let t=0;if(!R_(e[t]))return!1;for(;R_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Nd(e[t+1])}function X6(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&Nd(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Nd(t[1])||SG(t)||xG(t)||_G(t))}function B_(e,t){return e?t?`${e}
188
- ${t}`:e:t}function av(e){const t=String(e??"").trim();return t?bc(t):!1}function D_(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function Q6(e){if(e.length<=M_)return{source:e,lineOffset:0};let t=e.length-M_;const n=e.indexOf(`
189
- `,t);return n===-1?{source:"",lineOffset:O_(e)}:(t=n+1,{source:e.slice(t),lineOffset:O_(e.slice(0,t))})}function J6(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=Q6(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-rv-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=Id(o[r]);if(l&&!X6(l)){for(const[a,c]of i)if(Jy(l,a,c)!==-1)return!0}}return!1}function CG(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=Q6(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-rv-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=Id(s[l]);for(const[c,u]of r){const d=Jy(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<s.length;p++){if(p-l>rv){h=!0;break}const g=s[p],b=Hu(g,u);if(b!==-1){const v=B_(f,g.slice(0,b));if(!av(v)){h=!0;break}const m=g.slice(b+u.length),y=m.trim()?`suffix:${D_(m)}`:"nosuffix";return["closed",c,o+l,d,o+p,b,D_(v),y].join(":")}if(X6(g)){h=!0;break}if(f=B_(f,g),f.length>j6){h=!0;break}}if(!h&&av(f))return["pending",c,o+l,d].join(":")}}return null}function _0(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function AG(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function S0(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function MG(e,t){uG(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},o=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(m,y)=>{let k=y;for(;k<m.length&&(m[k]===" "||m[k]===" ");)k++;if(k===y||!(m[k]===`
190
- `||m[k]==="\r"&&m[k+1]===`
191
- `))return y;const A=m.slice(y,k),$=a.push("text","",0);return $.content=A,k};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let m=a.pos+1;for(;a.src[m]==="$";)m++;const y=m-a.pos,k=a.src[m];if(y>=3&&(!k||/\s/.test(k))){const A=a.push("text","",0);return A.content=a.src.slice(a.pos,m),a.pos=m,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let g=p,b=p;const v=p;for(const[m,y]of f){const k=a.src,A=Z6(k),$=bG(k,u);let L=!1;m==="$$"&&g!==v&&(g=v);let w=-1,E=-1,T=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,g=a.pos;return}if(S==="\\)"||S==="\\("){const B=a.push("text_special","",0);B.content=S==="\\)"?")":"(",B.markup=S,a.pos=a.pos+S.length,g=a.pos;return}if(!S)return;if(m==="$$"&&S.includes("$")){let B=0;for(;B<S.length;){const W=lv(S,B);if(W===-1){const fe=S.slice(B);if(fe){const Me=a.push("text","",0);Me.content=fe,a.pos=a.pos+fe.length,g=a.pos}break}if(W>0&&S[W-1]==="$"||W+1<S.length&&S[W+1]==="$"){const fe=S.slice(B,W+1);if(fe){const Me=a.push("text","",0);Me.content=fe,a.pos=a.pos+fe.length,g=a.pos}B=W+1;continue}const z=S.slice(B,W);if(z){const fe=a.push("text","",0);fe.content=z,a.pos=a.pos+z.length,g=a.pos}const D=w0(S,W+1);if(D===-1){const fe=S.slice(W),Me=a.push("text","",0);Me.content=fe,a.pos=a.pos+fe.length,g=a.pos;break}const q=S.slice(W+1,D),j=q.includes("`"),ie=!q||!q.trim(),ue=S[D+1],pe=_0(q,ue),ee=S0(q);if(!j&&!ie&&!pe&&!ee){const fe=a.push("math_inline","math",0);fe.content=ol(q,t),fe.markup="$",fe.raw=`$${q}$`,fe.loading=!1,a.pos=a.pos+(D-W+1),g=a.pos,B=D+1;continue}const ne=a.push("text","",0);ne.content="$",a.pos=a.pos+1,g=a.pos,B=W+1}return}const I=S.indexOf("![");if(I!==-1){if(I>0){const z=S.slice(0,I),D=a.push("text","",0);D.content=z,a.pos=a.pos+z.length,g=a.pos}const B=S.slice(I).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(B){const[,z,D]=B,q=D.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),j=q?q[1]:D,ie=q&&q[2]?q[2]:null,ue=a.push("image","img",0);ue.attrs=[["src",j],["alt",z]],ie&&ue.attrs.push(["title",ie]),ue.content=z,ue.children=[{type:"text",content:z,tag:""}],a.pos=a.pos+B[0].length,g=a.pos;const pe=S.slice(I+B[0].length);pe&&F(pe);return}const W=a.push("text","",0);W.content=S,a.pos=a.pos+S.length,g=a.pos;return}const P=a.push("text","",0);P.content=S,a.pos=a.pos+S.length,g=a.pos};for(;!(g>=k.length);){const S=k.indexOf(m,g);if(S===-1)break;if(Kd(k,S)){g=S+Math.max(1,m.length);continue}const I=vp(A,S);if(I){g=I[1];continue}const P=vp($,S);if(P){g=P[1];continue}if(S===w&&g===E){if(T++,T>2){g=S+Math.max(1,m.length);continue}}else T=0,w=S,E=g;if(m==="("&&S>0){let pe=S-1;for(;pe>=0&&k[pe]===" ";)pe--;if(pe>=0&&k[pe]==="]"){g=S+m.length;continue}}if(m==="$"&&S>0&&k[S-1]==="$"){g=S+1;continue}if(m==="$"&&S<k.length-1&&k[S+1]==="$"){g=S+2;continue}const B=m==="$"?w0(k,S+m.length):ZK(k,S+m.length,m,y);if(B===-1){const pe=k.slice(S+m.length);if(pe.includes(m)){g=k.indexOf(m,S+m.length);continue}if(B===-1){const ee=m==="$"&&AG(pe);if(u&&!c&&!ee&&bc(pe)&&!pe.includes("`")){if(g=S+m.length,L=!0,!l){a.pending="";const ne=b?k.slice(b,g):k.slice(0,g),fe=I_(ne)%2===1;if(b)F(k.slice(b,g));else{let Me=k.slice(0,g);Me.endsWith(m)&&(Me=Me.slice(0,Me.length-m.length)),F(Me)}if(fe){const Me=L_(ne)?.marker??"**",$e=a.push("strong_open","",0);$e.markup=Me;const ae=a.push("math_inline","math",0);ae.content=ol(pe,t),ae.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",ae.raw=`${m}${pe}${y}`,ae.loading=!0,$e.content=pe,a.push("strong_close","",0)}else{const Me=a.push("math_inline","math",0);Me.content=ol(pe,t),Me.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Me.raw=`${m}${pe}${y}`,Me.loading=!0}a.pos=k.length}g=k.length,b=g}break}}const W=k.slice(S+m.length,B),z=W.includes("`"),D=!W||!W.trim(),q=m==="$",j=k[B+y.length],ie=q&&_0(W,j),ue=q&&S0(W);if(c?z||D||ie||ue:z||D||ie||ue||!q&&!bc(W)){g=B+y.length;const pe=k.slice(a.pos,g);a.pending||(F(pe),b=g);continue}if(L=!0,!l){const pe=k.slice(a.pos-(a.pending??"").length,S);let ee=k.slice(0,g)?k.slice(b,S):pe;const ne=I_(ee)%2===1;S!==a.pos&&ne&&(ee=a.pending+k.slice(a.pos,S));const fe=ne?L_(ee):null,Me=fe?.marker??"**";if(a.pending!==ee)if(a.pending="",ne)if(fe){const $e=ee.slice(fe.index+Me.length);F(ee.slice(0,fe.index));const ae=a.push("strong_open","",0);ae.markup=Me;const U=a.push("text","",0);U.content=$e,a.push("strong_close","",0)}else F(ee);else F(ee);if(ne){const $e=a.push("strong_open","",0);$e.markup=Me;const ae=a.push("math_inline","math",0);ae.content=ol(W,t),ae.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",ae.raw=`${m}${W}${y}`,ae.loading=!1;const U=k.slice(B+y.length).startsWith(Me);return U&&a.push("strong_close","",0),a.pos=d(k,B+y.length),g=a.pos,b=g,U||a.push("strong_close","",0),!0}else{const $e=a.push("math_inline","math",0);$e.content=ol(W,t),$e.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",$e.raw=`${m}${W}${y}`,$e.loading=!1}}return g=d(k,B+y.length),b=g,a.pos=g,!0}if(L){if(l)a.pos=g;else{if(m==="$$"&&g<k.length&&k.slice(g).includes("$")){let S=g;for(;!(S>=k.length);){const I=lv(k,S);if(I===-1)break;if(I+1<k.length&&k[I+1]==="$"){S=I+2;continue}if(I>0&&k[I-1]==="$"){S=I+1;continue}const P=w0(k,I+1);if(P===-1)break;const B=k.slice(I+1,P),W=B.includes("`"),z=!B||!B.trim(),D=k[P+1],q=_0(B,D),j=S0(B);if(!W&&!z&&!q&&!j){const ie=k.slice(g,I);ie&&F(ie);const ue=a.push("math_inline","math",0);ue.content=ol(B,t),ue.markup="$",ue.raw=`$${B}$`,ue.loading=!1,g=P+1,S=P+1}else F("$"),S=I+1}S<k.length&&F(k.slice(S))}else g<k.length&&F(k.slice(g));a.pos=k.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let g=u.src.slice(p,u.eMarks[l]).trim(),b=!1,v="",m="",y=!1,k="",A=!1;for(const[ie,ue]of h)if(g.startsWith(ie))if(ie.includes("["))if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1<a){b=!0,v=ie,m=ue;break}continue}}else if(g.replace("\\","")==="["){if(l+1<a){b=!0,v=ie,m=ue;break}continue}else{const pe=u.tokens[u.tokens.length-1];if(pe&&pe.type==="list_item_open"&&pe.mark==="-"&&g.slice(ie.length,g.indexOf("]")).trim()==="x")continue;if(g.replace("\\","").startsWith("[")&&!g.includes("](")){const ee=g.indexOf("]");if(g.slice(ee).trim()!=="]")continue;const ne=g.slice(ie.length,ee);if(ie==="["?$_(ne):bc(ne)){b=!0,v=ie,m=ue;break}continue}}else{b=!0,v=ie,m=ue;break}else if((ie==="$$"||ie==="\\[")&&g.endsWith(ie)&&l+1<a){const pe=Jy(g,ie,ue);if(pe===-1)continue;k=Id(g.slice(0,pe)),A=!0;const ee=u.bMarks[l+1]+u.tShift[l+1];g=u.src.slice(ee,u.eMarks[l+1]).trim(),y=!0,b=!0,v=ie,m=ue;break}if(!b)return!1;if(c&&!A)return!0;const $=g.indexOf(v),L=$+v.length,w=!f&&v==="["?g.indexOf("\\]",L):-1,E=w>=0?"\\]":m,T=w>=0?w:Hu(g,m,L);if(!y&&T>v.length){const ie=g.slice($+v.length,T),ue=u.push("math_block","math",0);ue.content=ol(ie),ue.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",ue.map=[l,l+1],ue.raw=`${v}${ie}${E}`,ue.block=!0,ue.loading=!1,u.line=l+1;const pe=g.slice(T+E.length);return pe.trim()&&n(u,pe,l),!0}let F=l,S="",I=!1,P="",B=l;const W=y?g:g===v?"":g.slice(v.length),z=!f&&v==="\\["?"]":"",D=Hu(W,m);if(D!==-1){const ie=D;S=W.slice(0,ie),P=W.slice(ie+m.length),B=y?l+1:l,I=!0,F=B}else for(W&&!y&&(S=W),F=l+1;F<a;F++){const ie=u.bMarks[F]+u.tShift[F],ue=u.eMarks[F],pe=u.src.slice(ie,ue),ee=pe.trim();if(!f&&v==="["&&ee==="\\]"){m="\\]",I=!0;break}if(z&&pe.trim()===z){m=z,I=!0;break}if(ee===m){I=!0;break}else if(!f&&v==="["&&pe.includes("\\]")){I=!0;const ne=pe.indexOf("\\]");m="\\]";const fe=pe.slice(0,ne);fe&&(S+=(S?`
192
- `:"")+fe),P=pe.slice(ne+m.length),B=F;break}else if(Hu(pe,m)!==-1){I=!0;const ne=Hu(pe,m),fe=pe.slice(0,ne);fe&&(S+=(S?`
193
- `:"")+fe),P=pe.slice(ne+m.length),B=F;break}S+=(S?`
194
- `:"")+pe}if((!d||f)&&!I)return!1;const q=/^\s*!\[/.test(S);if(!(A?!q&&av(S):v==="$$"?!q:v==="["?$_(S):bc(S)))return!1;if(c)return!0;k&&n(u,k,l);const j=u.push("math_block","math",0);return j.content=ol(S),j.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",j.raw=`${v}${S}${S.startsWith(`
195
- `)?`
196
- `:""}${m}`,j.map=[l,F+1],j.block=!0,j.loading=!I,u.line=F+1,P.trim()&&n(u,P,B),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function EG(e){const t=e.renderer.rules.image||function(n,o,s,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,i,r)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],i=String(s.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(s.content??""))}</code></pre>`})}function TG(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new gV({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!ba(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&MG(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&OV(i),e.enableFixIndentedCodeBlock!==!1&&sK(i),FK(i),DK(i),RK(i),zK(i),EG(i),nK(i,{customHtmlTags:e.customHtmlTags}),i}function xa(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>xa(n))),t}function NG(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function IG(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function LG(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function jf(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];s+=String(e[i].content??l.text??""),r.push(e[i]),i++}return o.push(...Zn(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const P_=/\r?\n[ \t]*`+\s*$/,eM=["diff ","index ","--- ","+++ ","@@ "],$G=/\r?\n/;function FG(e){const t=String(e??"");return t?eM.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function H_(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function OG(e,t){const n=[],o=[],s=[],i=[],r=e.split($G),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!eM.some(g=>p.startsWith(g)))if(p.startsWith("-")){const g=p.slice(1);s.push(!a&&g.startsWith(" ")?` ${g}`:g)}else if(p.startsWith("+")){const g=p.slice(1);i.push(!a&&g.startsWith(" ")?` ${g}`:g)}else{H_(n,o,s,i);const g=a&&p.startsWith(" ")?p.slice(1):p;n.push(g),o.push(g)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h<u;h++){const p=r[h]??"";!t&&!l&&h===u-1&&FG(p)||c(p)}(t||s.length>0||i.length>0)&&H_(n,o,s,i);const d=n.join(`
197
- `),f=o.join(`
198
- `);return{original:t&&l&&d?`${d}
199
- `:d,updated:t&&l&&f?`${f}
200
- `:f}}function ek(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},o=typeof n.closed=="boolean"?n.closed:void 0,s=o===!0||o!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(P_.test(a)&&(a=a.replace(P_,"")),r){const{original:c,updated:u}=OG(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t}}function RG(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function BG(){return{type:"hardbreak",raw:`\\
201
- `}}function DG(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Zn(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let C0=null;const A0=new WeakMap;function W_(){return C0||(C0={customTagSet:null,allowedTagSet:Em()}),C0}function tM(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function nM(e){return/^<\s*\//.test(e)}function oM(e,t){return/\/\s*>\s*$/.test(t)||Fa.has(e)}function PG(e){if(!e||e.length===0)return W_();const t=A0.get(e);if(t)return t;const n=e.map(wi).filter(Boolean);if(!n.length){const s=W_();return A0.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:Em({customHtmlTags:e})};return A0.set(e,o),o}function sM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function HG(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function yp(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function WG(e,t,n){const o=e.slice();return yp(o,"href")||o.push(["href",t]),n!=null&&!yp(o,"title")&&o.push(["title",n]),o}function cv(e){return e.map(sM).join("")}function kh(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${s}`,i.raw=`${i.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:kh(o.children)});continue}t.push(o)}return t}function zG(e,t,n){let o=0;for(let s=t;s<e.length;s++){const i=e[s];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=tM(r),a=nM(r),c=oM(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function M0(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?zG(e,t+1,n):-1;return l!==-1?(s=e.slice(t+1,l),o.push(...s,e[l]),i=l+1,r=!0):(s=e.slice(t+1),s.length&&o.push(...s),i=e.length),{closed:r,html:cv(o),innerTokens:s,nextIndex:i}}function UG(e,t,n,o,s,i,r){const l=String(e.content??""),a=tM(l),{customTagSet:c,allowedTagSet:u}=PG(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!M0(t,n,a).closed){const A=sM(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=nM(l),f=oM(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=M0(t,n,a),$=Cm(l),L=A.innerTokens,w=String(yp($,"href")??""),E=yp($,"title"),T=E==null?null:String(E),F=WG($,w,T),S=kh(L.length?o(L,s,i,r):[]),I=L.length?cv(L):w||"";return!S.length&&I&&S.push({type:"text",content:I,raw:I}),[{type:"link",href:w,title:T,text:I,attrs:F,children:S,loading:!A.closed,raw:A.html||l},A.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=M0(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:kh(h.innerTokens.length?o(h.innerTokens,s,i,r):[]),raw:h.html},h.nextIndex];const p=kh(h.innerTokens.length?o(h.innerTokens,s,i,r):[]);let g=h.html||l,b=!h.closed,v=!1;if(!h.closed){const A=`</${a}>`;g.toLowerCase().includes(A.toLowerCase())||(g+=A),v=!0,b=!0}const m=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(l))!==null;){const A=k[1],$=k[2]||k[3]||k[4]||"";m.push([A,$])}if(c?.has(a)){const A=HG(e);return[{type:a,tag:a,attrs:m,content:A?A.inner:h.innerTokens.length?cv(h.innerTokens):"",children:h.innerTokens.length?o(h.innerTokens,s,i,r):[],raw:A?.raw??g,loading:e.loading||b,autoClosed:v},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:m,content:g,children:p,raw:g,loading:b,autoClosed:v},h.nextIndex]}function iM(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>iM(t)).join(""):String(e.content??"")}function qG(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>iM(t)).join("")}function z_(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=qG(o??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:s,alt:l,title:c,raw:u,loading:t}}function jG(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function VG(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Zn(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function KG(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const o=n?.[0];o&&t.push([String(o),String(n?.[1]??"")])}return t}function kp(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function GG(e,t,n){const o=e.slice();return kp(o,"href")||o.push(["href",t]),n!=null&&!kp(o,"title")&&o.push(["title",n]),o}function Vf(e,t,n){const o=e[t],s=KG(o.attrs),i=String(kp(s,"href")??""),r=kp(s,"title"),l=r==null?null:String(r),a=GG(s,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let f=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(b=>b.type==="strong_open")){const b=String(h.content??""),v=String(h.raw??b),m=xa(h);m.content=b.slice(0,-2),m.raw=v.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=m}const p=Zn(f,void 0,void 0,n),g=p.map(b=>{const v=b;return"content"in b?String(v.content??""):String(v.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:g,children:p,raw:`[${g}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function U_(e){const t=e.content??"",n=e.raw==="$$"?`$${t}$`:e.raw||"";return{type:"math_inline",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function YG(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function q_(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Zn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const ZG=/\\([\\()[\]`$|*_\-!])/g;function XG(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(ZG,"$1")===t))return n}function Tu(e,t,n,o){const s=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...o,__insideStrong:!0};return s.push(...Zn(l,XG(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function QG(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)s+=String(e[i].content??""),r.push(e[i]),i++;o.push(...Zn(r,void 0,void 0,n));const l=String(e[t].content??""),a=s||l;return{node:{type:"subscript",children:o.length>0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function JG(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Zn(r,void 0,void 0,n)),{node:{type:"superscript",children:o.length>0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function eY(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const tY=/[^~]*~{2,}[^~]+/,nY=/\*\*/,oY=/[[_*^~]/,sY=/\\([\\()[\]`$|*_\-!])/g,tk=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),iY=/\s/u,rY=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,lY=/\p{P}/u,aY=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,cY=/:\/\//;function uY(e){let t=0,n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="*"){n+=2;continue}e[n]==="*"&&t++,n++}return t}function rM(e,t=0){if(!e)return-1;let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&tk.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function Il(e){return!!e&&iY.test(e)}function Ll(e){return!!e&&(rY.test(e)||lY.test(e))}function dY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||Il(o)?!1:!(Ll(o)&&n&&!Il(n)&&!Ll(n))}function fY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||Il(n)?!1:!(Ll(n)&&o&&!Il(o)&&!Ll(o))}function hY(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?rM(e,o):t.indexOf("*",o);if(i===-1)break;if(fY(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function pY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||Il(o)?!1:!(Ll(o)&&n&&!Il(n)&&!Ll(n))}function mY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||Il(n)?!1:!(Ll(n)&&o&&!Il(o)&&!Ll(o))}function gY(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(mY(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function vY(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let o=0;for(;n+o<e.length&&e[n+o]==="\\";)o++;const s=e[n+o];if(t+="\\".repeat(Math.floor(o/2)),o%2===1){if(s&&tk.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function yY(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&tk.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function kY(e,t,n){const o=yY(e,t);if(o===-1||e[o]!==n)return!1;let s=0;for(let i=o-1;i>=0&&e[i]==="\\";i--)s++;return s%2===1}const bY=/[\p{L}\p{N}]/u,xY=/^[\p{L}\p{N}]+$/u;function uv(e){return e?bY.test(e):!1}function lM(e){return e?xY.test(e):!1}function td(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const o=t>0?e[t-1]:void 0,s=n<e.length?e[n]:void 0;return{len:n-t,prev:o,next:s,intraword:uv(o)&&uv(s)}}function wY(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=td(e,n),s=n+o.len;o.len>=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n<t.length-1;n++){const o=t[n],s=t[n+1];if(!lM(e.slice(o.end,s.start)))return s.end}return-1}function _Y(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function SY(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=td(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function CY(e){return e?aY.test(e)||cY.test(e):!1}function AY(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Zn(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=Vd(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function g(U,ce){const se=e.length===1?t:String(ce.content??""),V=[],Q=wY(U);if(Q!==-1){A(U.slice(0,Q),U.slice(0,Q));const he=U.slice(Q);return he&&(T({type:"text",content:he,raw:he}),u--),u++,!0}if(tY.test(U)){const he=U.indexOf("~~");he!==-1&&V.push({type:"strikethrough",index:he})}if(nY.test(U)){const he=U.indexOf("**");he!==-1&&V.push({type:"strong",index:he})}if(/[^*]*\*[^*]+/.test(U)){const he=se?rM(se,0):U.indexOf("*");if(se&&he===-1)return!1;he!==-1&&V.push({type:"emphasis",index:he})}V.sort((he,ye)=>he.index!==ye.index?he.index-ye.index:he.type===ye.type?0:he.type==="strong"?-1:ye.type==="strong"?1:0);const ke=V[0];if(!ke)return!1;if(ke.type==="strikethrough"){const he=ke.index,ye=he>-1?U.slice(0,he):"";if(ye&&A(ye,ye),he===-1)return u++,!0;const K=U.indexOf("~~",he+2),J=K===-1?U.slice(he+2):U.slice(he+2,K),me=K===-1?"":U.slice(K+2),{node:Ee}=q_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:J,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return p(),k(Ee),me&&(T({type:"text",content:me,raw:me}),u--),u++,!0}if(ke.type==="strong"){const he=ke.index,ye=he>-1?U.slice(0,he):"";if(ye&&A(ye,ye),he===-1)return u++,!0;if(t&&he===0){let De=!1,ge=0;for(;ge<U.length&&U[ge]==="*";)ge++;if(t.startsWith("\\*")&&(De=!0),De){let Ie=0,Je=0;for(;Je<t.length&&Ie<ge;)if(t[Je]==="\\"&&Je+1<t.length&&t[Je+1]==="*")Ie+=1,Je+=2;else{if(t[Je]==="*")break;Je++}if(Ie>=2)return A(U,U),u++,!0}}if(t&&(U.match(/\*/g)||[]).length>uY(t))return A(U.slice(ye.length),U.slice(ye.length)),u++,!0;const K=td(U,he);if(K.len>=3){const De=SY(U,he+K.len);if(De!==-1){const ge=U.slice(he+K.len,De);if(_Y(ge)){const{node:Ie}=Tu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ge,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);p(),k(Ie);const Je=U.slice(De+3);return Je&&(T({type:"text",content:Je,raw:Je}),u--),u++,!0}}}if(!pY(U,he)){const De=U.slice(he,he+K.len);A(De,De);const ge=U.slice(he+K.len);return ge&&(T({type:"text",content:ge,raw:ge}),u--),u++,!0}const J=gY(U,he+2);let me="",Ee="";if(J.index!==-1){me=U.slice(he+2,J.index),Ee=U.slice(J.index+2);const De=J.index,ge=td(U,De);if(K.intraword&&ge.intraword&&!lM(me)||!me&&K.len>=4&&K.intraword)return A(U.slice(ye.length),U.slice(ye.length)),u++,!0}else{if(d||J.sawInvalidClose||K.intraword)return A(U.slice(ye.length),U.slice(ye.length)),u++,!0;me=U.slice(he+2),Ee=""}if(!me&&/^\*+$/.test(Ee))return A(U,U),u++,!0;const{node:Fe}=Tu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:me,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return p(),k(Fe),Ee&&(T({type:"text",content:Ee,raw:Ee}),u--),u++,!0}if(ke.type==="emphasis"){let he=ke.index;he===-1&&(he=0);const ye=U.slice(0,he);if(ye&&A(ye,ye),!dY(U,he)){A(U[he],U[he]);const De=U.slice(he+1);return De&&(T({type:"text",content:De,raw:De}),u--),u++,!0}const K=td(U,he),J=hY(se,U,he+1),me=J.index,Ee=e[u+1];if(o?.final&&Ee?.type==="em_open"&&me!==-1&&U.slice(he+1,me).trim()!==U.slice(he+1,me)||me===-1&&(J.sawInvalidClose||o?.final||K.intraword||!uv(U[he+1])))return A(U.slice(he),U.slice(he)),u++,!0;const{node:Fe}=jf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:me>-1?U.slice(he+1,me):U.slice(he+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(p(),k(Fe),me!==-1&&me<U.length-1){const De=U.slice(me+1);De&&(T({type:"text",content:De,raw:De}),u--)}return u++,!0}return!1}function b(U,ce){if(!U.includes("`"))return!1;const V=(Ee=>{for(let Fe=0;Fe<Ee.length;Fe++){if(Ee[Fe]!=="`")continue;let De=0;for(let ge=Fe-1;ge>=0&&Ee[ge]==="\\";ge--)De++;if(De%2===0)return Fe}return-1})(U);if(V===-1)return!1;let Q=1;for(let Ee=V+1;Ee<U.length&&U[Ee]==="`";Ee++)Q++;const ke="`".repeat(Q),he=V+Q,ye=U.indexOf(ke,he);if(ye===-1){if(Q===1){const Fe=U.slice(0,V),De=U.slice(V+1);return Fe&&(g(Fe,ce)?u--:A(Fe,Fe)),m({type:"inline_code",code:De,raw:String(De)}),u++,!0}let Ee=U;for(let Fe=u+1;Fe<e.length;Fe++)Ee+=String((e[Fe].content??"")+(e[Fe].markup??""));return u=e.length-1,A(Ee,Ee),u++,!0}p();const K=U.slice(0,V),J=U.slice(V+Q,ye),me=U.slice(ye+Q);return K&&(g(K,ce)?u--:A(K,K)),m({type:"inline_code",code:J,raw:String(J??"")}),me&&(T({type:"text",content:me,raw:me}),u--),u++,!0}function v(U){const ce=l?.__markdownIt;if(!ce||e.length<=1||!e.some(ke=>ke?.type==="math_inline")||!oY.test(U))return null;const se=ce.parseInline(U,{__markstreamFinal:!!o?.final});if(!Array.isArray(se)||se.length===0)return null;const V=(se.find(ke=>ke?.type==="inline")?.children??[]).filter(ke=>!(ke?.type==="text"&&String(ke.content??"")===""));if(!V.length||!V.some(ke=>ke?.type!=="text")||V.length===1&&V[0]?.type==="text"&&String(V[0].content??"")===U)return null;const Q=Zn(V,U,n,o);return Q.length?Q:null}function m(U){p(),a.push(U)}function y(U){p();const ce=xa(U);a.push(ce)}function k(U){m(U)}function A(U,ce){c?(c.content+=U,c.raw+=ce??U):(c={type:"text",content:String(U??""),raw:String(ce??U??"")},a.push(c))}function $(U,ce){if(!U)return;const se=Zn([{...ce,type:"text",content:U,raw:U}],U,n,o);if(se.length===1&&se[0]?.type==="text"){const V=se[0];A(String(V.content??""),String(V.raw??V.content??""));return}for(const V of se)k(V)}function L(U,ce){return String(U.markup??"").startsWith(ce)}function w(U){return U.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function E(U,ce){let se=U;const V=String(ce.content??"");return se.endsWith("\\")&&!L(ce,"\\\\")&&!V.endsWith("\\\\")&&(se=se.slice(0,-1)),se.endsWith("(")&&!L(ce,"\\(")&&!V.endsWith("\\(")&&(se=se.slice(0,-1)),/\*+$/.test(se)&&!L(ce,"\\*")&&!V.endsWith("\\*")&&(se=se.replace(/\*+$/,"")),se}for(;u<e.length;){const U=e[u];T(U)}function T(U){switch(U.type){case"text":S(U);break;case"softbreak":c?(c.content+=`
202
- `,c.raw+=`
203
- `):(c={type:"text",content:`
204
- `,raw:`
205
- `},a.push(c)),u++;break;case"code_inline":k(jG(U)),u++;break;case"html_inline":{const[ce,se]=UG(U,e,u,Zn,t,n,o);k(ce),u=se;break}case"link_open":I(U);break;case"image":pe(U)||(p(),k(z_(U)),u++);break;case"strong_open":{p();const{node:ce,nextIndex:se}=Tu(e,u,U.content,o);k(ce),u=se;break}case"em_open":{p();const{node:ce,nextIndex:se}=jf(e,u,o);k(ce),u=se;break}case"s_open":{p();const{node:ce,nextIndex:se}=q_(e,u,o);k(ce),u=se;break}case"mark_open":{p();const{node:ce,nextIndex:se}=DG(e,u,o);k(ce),u=se;break}case"ins_open":{p();const{node:ce,nextIndex:se}=VG(e,u,o);k(ce),u=se;break}case"sub_open":{p();const{node:ce,nextIndex:se}=QG(e,u,o);k(ce),u=se;break}case"sup_open":{p();const{node:ce,nextIndex:se}=JG(e,u,o);k(ce),u=se;break}case"sub":p(),k({type:"subscript",children:[{type:"text",content:String(U.content??""),raw:String(U.content??"")}],raw:`~${String(U.content??"")}~`}),u++;break;case"sup":p(),k({type:"superscript",children:[{type:"text",content:String(U.content??""),raw:String(U.content??"")}],raw:`^${String(U.content??"")}^`}),u++;break;case"emoji":{p();const ce=e[u-1];ce?.type==="text"&&/\|:-+/.test(String(ce.content??""))?A("",""):k(LG(U)),u++;break}case"checkbox":p(),k(NG(U)),u++;break;case"checkbox_input":p(),k(IG(U)),u++;break;case"footnote_ref":p(),k(RG(U)),u++;break;case"footnote_anchor":{p();const ce=U.meta??{};m({type:"footnote_anchor",id:String(ce.label??U.content??""),raw:String(U.content??"")}),u++;break}case"hardbreak":p(),k(BG()),u++;break;case"fence":p(),k(ek(e[u])),u++;break;case"math_inline":p(),!U.content&&U.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(k(U_({...U,content:e[u+1].content})),u+=2):k(U_(U)),u++;break;case"reference":B(U);break;case"text_special":A(String(U.content??""),String(U.content??"")),u++;break;default:{const ce=U;if(U.type==="link"&&ce.href!=null&&o?.validateLink&&!o.validateLink(String(ce.href))){p();const se=String(ce.text??"");A(se,se),u++}else ee(U)||z(U)||q(U)||W(U)||y(U),u++;break}}}function F(U,ce,se,V){const Q=eY({...ce,content:U});if(c){c.content+=E(Q.content,ce),c.raw+=Q.raw;return}const ke=se?.tag==="br"&&e[u-2]?.content==="[";V||(Q.content=E(Q.content,ce)),c=Q,c.center=ke,a.push(c)}function S(U){const ce=String(U.content??""),se=e.length===1&&ce.includes("\\")&&typeof t=="string"?String(t):"";let V=se?vY(se):ce.replace(sY,"$1");if(U.content==="<"||V==="1"&&e[u-1]?.tag==="br"){u++;return}const Q=V.indexOf("$");Q!==-1&&Q===V.lastIndexOf("$")&&V.endsWith("$")&&(V=V.slice(0,-1)),V.endsWith("undefined")&&!t?.endsWith("undefined")&&(V=V.slice(0,-9));let ke=a.length,he="";for(let me=a.length-1;me>=0;me--){const Ee=a[me];if(Ee.type!=="text")break;ke=me,he=String(Ee.content??"")+he}ke<a.length&&(V.startsWith(he)?(c=null,a.length=ke):c=a[a.length-1]);const ye=e[u+1];if((V==="`"||V==="|"||V==="$")&&!L(U,`\\${V}`)||/^\*+$/.test(V)&&!L(U,"\\*")){u++;return}if(!ye&&/[^\]]\s*\(\s*$/.test(V)&&(V=V.replace(/\(\s*$/,"")),!V){u++;return}if(ue(V)||ne(V))return;if(!(V.includes("*")||V.includes("_")||V.includes("~")||V.includes("`")||V.includes("[")||V.includes("!")||V.includes("$")||V.includes("|")||V.includes("("))){F(V,U,e[u-1],ye),u++;return}if(ae(V))return;const K=e[u-1];if(V==="["&&!ye?.markup?.includes("*")&&!L(U,"\\[")||V==="]"&&!K?.markup?.includes("*")&&!L(U,"\\]")){u++;return}if(b(ce,U)||$e(V)||(e[u+1]?.type!=="link_open"||w(V))&&Me(V,U))return;const J=v(ce);if(J){p();for(const me of J)k(me);u++;return}g(V,U)||(F(V,U,K,ye),u++)}function I(U){if(P(U))return;if(fe()){const{node:ye,nextIndex:K}=Vf(e,u,o),J=String(ye.text||ye.href||"");A(J,J),u=K;return}p();const{node:ce,nextIndex:se}=Vf(e,u,o);u=se;const V=ce.text||ce.href||"";if(U.markup==="linkify"&&!H6(V,ce.href,t)&&mp(V,l?.__linkifyDemotionContext)){A(V,V);return}const Q=ce.children.length===1&&ce.children[0]?.type==="text";if(ce.loading&&t&&ce.text===ce.href&&Q){const ye=AY(t,ce.href);ye&&(ce.text=ye,ce.children=[{type:"text",content:ye,raw:ye}],ce.raw=`[${ye}](${ce.href}${ce.title?` "${ce.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(ce.href)){A(ce.text,ce.text);return}const ke=U.attrs?.find(([ye])=>ye==="href")?.[1],he=String(ke??"");if(t&&he){const ye=t.indexOf("](");if(ye!==-1){const K=t.indexOf(")",ye+2);K===-1?ce.loading=!0:ce.loading&&t.slice(ye+2,K).includes(he)&&(ce.loading=!1)}}W(ce)||m(ce)}function P(U){if(U.markup!=="linkify")return!1;const{node:ce,nextIndex:se}=Vf(e,u,o);return D(ce,se)?(u=se,!0):!1}function B(U){p(),k(YG(U)),u++}function W(U){if(U.type!=="link")return!1;const ce=a[a.length-1];if(!ce||ce.type!=="text")return!1;const se=String(ce.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!se)return!1;const V=U,Q=String(V.href??""),ke=String(V.text??""),he=String(se[2]??""),ye=Q.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Q||!(ke===Q||ke===ye||CY(ke)))return!1;const K=String(se[1]??"");return K?(ce.content=K,ce.raw=K):a.pop(),m({...U,text:he,children:[{type:"text",content:he,raw:he}],raw:`[${he}](${Q}${V.title?` "${V.title}"`:""})`}),!0}function z(U){if(U.type!=="link")return!1;const ce=U,se=String(ce.href??"");return se?D({href:se,title:ce.title==null||ce.title===""?null:String(ce.title),loading:!!ce.loading},u+1):!1}function D(U,ce){const se=a[a.length-1];if(se?.type!=="image"||se.src||!se.loading||!String(se.raw??"").endsWith("]("))return!1;const V=e[ce],Q=String(V?.content??"");if(V?.type!=="text"||!Q.startsWith(")"))return!1;a.pop(),c=null;const ke=String(se.alt??"");m({type:"image",src:U.href,alt:ke,title:U.title,raw:`![${ke}](${U.href}${U.title?` "${U.title}"`:""})`,loading:!!U.loading});const he=Q.slice(1),ye=xa(V);return ye.content=he,ye.raw=he,h()[ce]=ye,!0}function q(U){if(U.type!=="link")return!1;const ce=a[a.length-1],se=e[u-1];if(!ce||ce.type!=="text"||se?.type!=="text")return!1;const V=String(ce.content??""),Q=String(se.content??"");if(!V.endsWith("!")||!Q.endsWith("!")||L(se,"\\!"))return!1;const ke=V.slice(0,-1);ke?(ce.content=ke,ce.raw=ke,c=ce):(a.pop(),c=null);const he=U,ye=String(he.text??he.children?.map(me=>String(me?.content??me?.raw??"")).join("")??""),K=String(he.href??""),J=he.title==null||he.title===""?null:String(he.title);return m({type:"image",src:K,alt:ye,title:J,raw:`![${ye}](${K}${J?` "${J}"`:""})`,loading:!!he.loading}),!0}function j(U,ce="",se=null){const V=String(U.alt??U.raw??"");return{type:"link",href:ce,title:se,text:V,children:[U],raw:`[${V}](${ce}${se?` "${se}"`:""})`,loading:!0}}function ie(U){const ce=U.startsWith("![")?U:`![${U}`,se=ce.slice(2),V=se.indexOf("](");return{type:"image",src:"",alt:V===-1?se.replace(/\]$/,""):se.slice(0,V),title:null,raw:ce,loading:!0}}function ue(U){const ce=U.indexOf("[![");if(ce===-1||typeof t=="string"&&e.length===1&&kY(t,ce,"["))return!1;const se=U.slice(0,ce);return se&&A(se,se),m(j(ie(U.slice(ce+1)))),u++,!0}function pe(U){if(o?.final)return!1;const ce=e[u-1];if(ce?.type!=="text"||!String(ce.content??"").endsWith("[")||L(ce,"\\["))return!1;const se=a[a.length-1];if(se?.type==="text"&&se.content.endsWith("[")){const V=se.content.slice(0,-1);V?(se.content=V,se.raw=V,c=se):(a.pop(),c=null)}return m(j(z_(U))),u++,!0}function ee(U){if(U.type!=="link")return!1;const ce=U,se=String(ce.raw??""),V=String(ce.text??"");if(!se.startsWith("[![")&&!V.startsWith("!["))return!1;const Q=ce.title==null||ce.title===""?null:String(ce.title);return m(j({type:"image",src:String(ce.href??""),alt:V.replace(/^!\[/,"").replace(/\]$/,""),title:Q,raw:se.startsWith("[![")?se.slice(1):se,loading:!0})),!0}function ne(U){if(!U.startsWith("]("))return!1;const ce=e[u-2];if(ce?.type==="text"&&String(ce.content??"").endsWith("[")&&L(ce,"\\["))return!1;const se=a[a.length-1];if(se?.type!=="image"&&se?.type!=="link")return!1;const V=se,Q=se?.type==="link"&&Array.isArray(V.children)&&V.children.length===1&&V.children[0]?.type==="image"?a.pop():null,ke=Q?Q.children[0]:a.pop();if(!ke||ke.type!=="image")return!1;const he=e[u+1];let ye=String(Q?.href??""),K=Q?.title==null?null:String(Q.title),J=!0;if(he?.type==="link_open"){const{node:Ee,nextIndex:Fe}=Vf(e,u+1,o);ye=Ee.href,K=Ee.title,J=!0,u=Fe}else{if(ye=U.slice(2),ye.includes('"')){const Ee=ye.split('"');ye=String(Ee[0]??"").trim(),K=Ee[1]==null?null:String(Ee[1]).trim()}u++}const me=j(ke,ye,K);return me.loading=J,m(me),!0}function fe(){const U=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&U?.type==="text"&&String(U.content??"").endsWith("[")&&L(U,"\\[")}function Me(U,ce){const se=U.indexOf("[");if(se===-1)return!1;let V=U.slice(0,se);const Q=U.indexOf("](",se);if(Q!==-1){const ke=e[u+2];let he=U.slice(se+1,Q);if(he.includes("[")){const De=he.indexOf("[");V+=U.slice(0,se+De+1);const ge=se+De+1;he=U.slice(ge+1,Q)}const ye=e[u+1];if(U.endsWith("](")&&ye?.type==="link_open"&&ke){const De=e[u+4];let ge=4,Ie=!0;if(De?.type==="text"){const it=String(De.content??"");if(it.startsWith(")")){Ie=!1;const St=it.slice(1);if(St){const gt=xa(De);gt.content=St,gt.raw=St,h()[u+4]=gt}else ge++}else it==="."&&ge++}$(V,ce);const Je=String(ke.content??"");return o?.validateLink&&!o.validateLink(Je)?A(he,he):m({type:"link",href:Je,title:null,text:he,children:[{type:"text",content:he,raw:he}],loading:Ie}),u+=ge,!0}const K=U.indexOf(")",Q),J=K!==-1?U.slice(Q+2,K):"",me=K===-1;let Ee=V.match(/\*+$/);if(Ee&&(V=V.replace(/\*+$/,"")),$(V,ce),Ee||(Ee=he.match(/^\*+/)),!d&&Ee){const De=Ee[0].length;he=he.replace(/^\*+/,"").replace(/\*+$/,"");const ge=[];if(De===1?ge.push({type:"em_open",tag:"em",nesting:1}):De===2?ge.push({type:"strong_open",tag:"strong",nesting:1}):De===3&&(ge.push({type:"strong_open",tag:"strong",nesting:1}),ge.push({type:"em_open",tag:"em",nesting:1})),ge.push({type:"link",href:J,title:null,text:he,children:[{type:"text",content:he,raw:he}],loading:me}),De===1){ge.push({type:"em_close",tag:"em",nesting:-1});const{node:Ie}=jf(ge,0,o);k(Ie)}else if(De===2){ge.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=Tu(ge,0,void 0,o);k(Ie)}else if(De===3){ge.push({type:"em_close",tag:"em",nesting:-1}),ge.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=Tu(ge,0,void 0,o);k(Ie)}else{const{node:Ie}=jf(ge,0,o);k(Ie)}}else o?.validateLink&&!o.validateLink(J)?A(he,he):m({type:"link",href:J,title:null,text:he,children:[{type:"text",content:he,raw:he}],loading:me});const Fe=K!==-1?U.slice(K+1):"";return Fe&&(T({type:"text",content:Fe,raw:Fe}),u--),u++,!0}return!1}function $e(U){const ce=U.indexOf("![");if(ce===-1)return!1;const se=U.slice(0,ce);return se&&!c?c={type:"text",content:se,raw:se}:se&&c&&(c.content+=se),c&&(a.push(c),c=null),m(ie(U.slice(ce))),u++,!0}function ae(U){if(!(U?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ce=U.slice(1).match(/[^\s\]]/);if(ce===null)return u++,!0;if(ce&&/x/i.test(ce[0])){const se=ce[0]==="x"||ce[0]==="X";return m({type:"checkbox_input",checked:se,raw:se?"[x]":"[ ]"}),u++,!0}return!1}return a}function MY(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){s.content=r;break}o.pop();continue}break}}function EY(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){o.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?s.content=r:o.pop())}break}}function TY(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function nu(e,t,n){const o=e[t],s=[],i=Bl(n,!0);let r=t+1;for(;r<e.length&&e[r].type!=="bullet_list_close"&&e[r].type!=="ordered_list_close";)if(e[r].type==="list_item_open"){const l=[];let a=r+1;for(;a<e.length&&e[a].type!=="list_item_close";)if(e[a].type==="paragraph_open"){const c=e[a+1],u=TY(c)?xa(c):c,d=e[a-1];u!==c&&(EY(u),MY(u));const f=String(u.content??"");l.push({type:"paragraph",children:Zn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=ou(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=nu(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=ok(e,a,i.options(),nk);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}s.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const l=o.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:s,raw:s.map(l=>l.raw).join(`
206
- `)},r+1]}function NY(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=Bl(o,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:Zn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};r.push(u),l.remember(u.raw)}a+=3}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=nu(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=ou(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Am(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:s,title:i,children:r,raw:`:::${s} ${i}
207
- ${r.map(c=>c.raw).join(`
208
- `)}
209
- :::`},a+1]}const IY=new Set(["warning","info","note","tip","danger","caution"]);function LY(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const o=n.search(/\s/),s=(o===-1?n:n.slice(0,o)).toLowerCase();return IY.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function $Y(e,t,n){const o=e[t];let s="note",i="";const r=o.type.match(/^container_(\w+)_open$/);if(r){s=r[1];const d=String(o.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(s)){const f=d.slice(s.length).trim();f&&(i=f)}}else{const d=LY(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=Bl(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let h=-1;for(let g=f.length-1;g>=0;g--){const b=f[g];if(b.type==="text"&&/:+/.test(b.content)){h=g;break}}const p={type:"paragraph",children:Zn((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=nu(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=ou(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Am(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:i,children:l,raw:`:::${s} ${i}
210
- ${l.map(d=>d.raw).join(`
211
- `)}
212
- :::`},c+1]}const FY=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function OY(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=FY.exec(String(o.info??""));return s?NY(e,t,s,n):null}const nk={parseContainer:(e,t,n)=>$Y(e,t,n),matchAdmonition:OY};function ou(e,t,n){const o=[],s=Bl(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";)switch(e[i].type){case"paragraph_open":{const r=e[i+1],l={type:"paragraph",children:Zn(r.children||[],String(r.content??""),void 0,s.options()),raw:String(r.content??"")};o.push(l),s.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=nu(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=ou(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}default:{const r=ok(e,i,s.options(),nk);r?(o.push(r[0]),s.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:o,raw:o.map(r=>r.raw).join(`
213
- `)},i+1]}function RY(e){if(e.info?.startsWith("diff"))return ek(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let o=t;n?.[1]&&(o=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:o,raw:o,loading:!s}}function BY(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=Bl(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=Zn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:Zn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(o.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
214
- `)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
215
- `)},s+1]}function DY(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=Bl(n,!0);let l=t+1;for(;l<e.length&&e[l].type!=="footnote_close";)if(e[l].type==="paragraph_open"){const a=e[l+1],c=a.children?[...a.children]:[];e[l+2].type==="footnote_anchor"&&c.push(e[l+2]);const u={type:"paragraph",children:Zn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:s,children:i,raw:`[^${s}]: ${i.map(a=>a.raw).join(`
216
- `)}`},l+1]}function PY(e,t,n){const o=e[t],s=o.attrs,i=Array.isArray(s)&&s.length?Object.fromEntries(s.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(o.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:Zn(a.children||[],c,void 0,n),raw:c}}function HY(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=Yn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(s.test(c)){const u=Yn(c);if(u===-1)return-1;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return-1}function aM(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const o=Yn(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=Fa.has(n),l=Cm(s),a=(o===-1?-1:HY(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
217
- </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function WY(e){const t=String(e.content??""),n=e.raw==="$$"?`$$${t}$$`:String(e.raw??"");return{type:"math_block",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function zY(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,o]=t;if(!o)continue;const s=String(o).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(s);if(i)return i[1].toLowerCase()}}return"left"}function cM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function uM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return cM(n)?n:void 0}function UY(e,t,n){const o=uM(Vd(t),n);if(!cM(o))return e;const s=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:s?.filename||o?.filename,explicitFilename:s?.explicitFilename||o?.explicitFilename,marketTicker:s?.marketTicker||o?.marketTicker}}}function qY(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",h=e[c+1],p=String(h.content??""),g=zY(e[c].attrs),b=a.length,v=!f&&!r,m=v?s?.cells[b]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Zn(h.children||[],p,void 0,UY(n,m,v?u:void 0)),raw:p,align:g}),v&&(u=uM(u,Vd(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
218
- `)},o+1]}function jY(){return{type:"thematic_break",raw:"---"}}let E0=null;const T0=new WeakMap;function j_(){return E0||(E0={allowedTagSet:Em(),customTagSet:null}),E0}function VY(e){if(!e||e.length===0)return j_();const t=T0.get(e);if(t)return t;const n=e.map(wi).filter(Boolean);if(!n.length){const s=j_();return T0.set(e,s),s}const o={allowedTagSet:Em({customHtmlTags:e}),customTagSet:new Set(n)};return T0.set(e,o),o}function KY(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[h,p]of s)if(h==="class"){const g=p.match(/(?:\s|^)vmr-container-(\S+)/);g&&(i=g[1])}else if(h.startsWith("data-")){const g=h.slice(5);try{r[g]=JSON.parse(p)}catch{r[g]=p}}}const l=[],a=Bl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const p={type:"paragraph",children:Zn(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[h,p]=nu(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=ou(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=Am(e,c,a.options());h?(l.push(h[0]),a.remember(h[0].raw),c=h[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
219
- `,l.length>0&&(f+=o.raw??l.map(h=>h.raw).join(`
220
- `),f+=`
221
- `),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function GY(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function YY(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function ZY(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${Ys(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Ys(o)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=Yn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(s.test(c)){const u=Yn(c);if(u===-1)return null;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return null}function XY(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=Yn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const p=c+1;return{raw:e.slice(r,p),end:p}}let u=1,d=c+1;const f=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),end:e.length};if(h(p)){const g=e.indexOf(">",p);if(g===-1)return null;if(u--,u===0){const b=g+1;return{raw:e.slice(r,b),end:b}}d=g+1;continue}if(f(p)){const g=Yn(e.slice(p));if(g===-1)return null;u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),end:e.length}}function dv(e){return Number.isFinite(e)&&e>0?e:0}function QY(e,t){const n=dv(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
222
- `&&(o++,o===n))return s+1;return e.length}function Am(e,t,n){const o=e[t];switch(o.type){case"heading_open":return[PY(e,t,n),t+3];case"code_block":return[RY(o),t+1];case"fence":return[ek(o),t+1];case"math_block":return[WY(o),t+1];case"html_block":{const s=aM(o),i=s.tag?VY(n?.customHtmlTags):null;if(s.tag&&s.loading&&i&&!i.allowedTagSet.has(s.tag)){const r=String(o.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(s.tag&&i?.customTagSet?.has(s.tag)){const r=s.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(o.map)?QY(l,Number(o.map?.[0]??0)):0,u=XY(l,r,Math.max(dv(a),dv(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??s.raw??""),f=Yn(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),g=f===-1?null:ZY(d,r,f+1),b=g?.start??-1;let v="";f!==-1&&(b!==-1&&f<b?v=d.slice(f+1,b):v=d.slice(f+1)),b===-1&&(v=YY(v,r));const m=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(h))!==null;){const $=k[1];if(!$||$.toLowerCase()===r)continue;const L=k[2]||k[3]||k[4]||"";m.push([$,L])}const A=!n?.final&&!p&&g==null;return[{type:r,tag:r,content:GY(v),raw:String(u?.raw??s.raw??d),loading:A,attrs:m.length?m:void 0},t+1]}return[s,t+1]}case"table_open":{const[s,i]=qY(e,t,n);return[s,i]}case"dl_open":{const[s,i]=BY(e,t,n);return[s,i]}case"footnote_open":{const[s,i]=DY(e,t,n);return[s,i]}case"hr":return[jY(),t+1]}return null}function ok(e,t,n,o){const s=Am(e,t,n);if(s)return s;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(o?.parseContainer)return o.parseContainer(e,t,n);break;case"container_open":if(o?.matchAdmonition){const i=o.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return KY(e,t,n)}return null}function JY(){return{type:"hardbreak",raw:`\\
223
- `}}function eZ(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:Zn(o.children||[],s,void 0,n),raw:s}}const V_=new WeakMap,Mm=new WeakMap,tZ=["$$","\\["];function Gc(){return typeof performance<"u"?performance.now():Date.now()}function sk(e,t,n){e&&(e[t]=(e[t]??0)+n)}function dM(e){return e.__timing}function N0(e,t,n){return t&&sk(t,"parseMarkdownToStructureTotalMs",Gc()-n),e}function K_(e,t,n){if(!n)return tS(e,t);const o=Gc(),s=tS(e,t);return sk(n,"processTokensMs",Gc()-o),s}function nZ(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=tu(t);return n.length?new Set(n):null}function oZ(e,t){const n=e;let o=V_.get(n);o||(o=new Map,V_.set(n,o));const s=t.__markstreamFinal===!0?"final":"streaming";let i=o.get(s);i||(i={},o.set(s,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function sZ(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Kf(e,t,n){for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!("value"in s))continue;const i=Object.getOwnPropertyDescriptor(t,o);i&&(!("value"in i)||i.writable===!1)||(t[o]=aa(s.value,n))}}function aa(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,o=t.get(n);if(o)return o;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(aa(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(aa(l,t),aa(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(aa(l,t));return r}if(e instanceof Date){const r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){const r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<"u"&&e instanceof URL){const r=new URL(e.href);return t.set(n,r),Kf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Kf(n,r,t),r}if(e instanceof Error){let r;const l=e.constructor;try{r=new l(e.message)}catch{r=new Error(e.message)}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),t.set(n,r),Kf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!sZ(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Kf(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=aa(i[r],t);return s}function fM(e,t=!0){if(!t)return xa(e);const n=Object.create(Object.getPrototypeOf(e)),o=new WeakMap;for(const s of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,s);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,s,i);continue}const r=i.value;let l=r;s==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):s==="map"&&Array.isArray(r)?l=[...r]:s==="children"&&Array.isArray(r)?l=r.map(a=>fM(a,t)):t&&r&&typeof r=="object"&&(l=aa(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function G_(e,t=!0){return e.map(n=>fM(n,t))}function hM(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function iZ(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function rZ(e){Mm.delete(e)}function lZ(e,t,n){Mm.set(e,{source:t,key:n,pendingCandidate:n===null&&J6(t)})}function aZ(e){return e.endsWith("$")||e.endsWith("\\")}function cZ(e){const t=Math.max(e.lastIndexOf(`
224
- `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return tZ.some(o=>n.endsWith(o))}function uZ(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||cZ(e)&&/[\r\n]/.test(t)):!1}function dZ(e,t){if(!V6(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=Mm.get(o);if(s?.source===t)return;if(s&&t.startsWith(s.source)){const l=t.slice(s.source.length);if(s.key===null&&s.pendingCandidate===!1&&!uZ(s.source,l)&&!aZ(t)){s.source=t;return}}const i=CG(t),r=s?!t.startsWith(s.source):!1;(s&&(r||s.key!==i)||!s&&i)&&n.reset(),lZ(e,t,i)}function fZ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function hZ(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,i)=>s===o[i])}function I0(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&hZ(e,t)}function Y_(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function pZ(e){for(let t=0;t+5<e.length;t++)if(Y_(e,t)&&Y_(e,t+3)&&I0(e[t],e[t+3])&&I0(e[t+1],e[t+4])&&I0(e[t+2],e[t+5]))return!0;return!1}function mZ(e,t,n){return V6(e)&&J6(t)&&pZ(n)}function gZ(e){const t=Mm.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function Z_(e,t,n,o){if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!hM(e,o)||(dZ(e,t),gZ(e)))return e.parse(t,n);const s=e.stream.parse(t,oZ(e,n));if(mZ(e,t,s))return e.stream?.reset?.(),e.parse(t,n);if(!fZ(o))return s;const i=dM(o);if(!i)return G_(s,!0);const r=Gc(),l=G_(s,!0);return sk(i,"tokenCloneMs",Gc()-r),l}function Em(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Ed;const n=new Set(Ed);for(const o of tu(t))o&&n.add(o);return n}function vZ(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:e.type==="hardbreak"?"<br>":""}function X_(e){return{type:"paragraph",children:e,raw:e.map(vZ).join("")}}function Q_(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=nZ(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const f=o.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(X_(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(X_(c)),a}function yZ(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function nd(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function kZ(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Ys(t)}\s*>\s*$`,"i").test(n)}function ik(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${Ys(o)}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=Yn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(Fa.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*${Ys(o)}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${Ys(o)}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(h(p)){const g=Yn(e.slice(p));if(g===-1)return null;u--;const b=p+g+1;if(u===0)return{raw:e.slice(r,b),start:r,end:b,closed:!0};d=b;continue}if(f(p)){const g=Yn(e.slice(p));if(g===-1)return null;const b=e.slice(p,p+g+1);/\/\s*>$/.test(b)||u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function bZ(e,t){if(!t)return 0;let n=0,o=0;for(;n<e.length&&o<t.length;){if(e[n]===t[o]){n++,o++;continue}if(e[n]==="\r"||e[n]===`
225
- `){n++;continue}return-1}return o===t.length?n:-1}function xZ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
226
- </${t}>`}function J_(e){return e.replace(/\r\n/g,`
227
- `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function wZ(e,t,n){return n?e.includes(n,t)?!0:J_(e.slice(Math.max(0,t))).includes(J_(n)):!1}function _Z(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
228
- `&&n++,n):e[n]===`
229
- `?n+1:t}function eS(e){if(e.type!=="html_block"||String(e.tag??"").toLowerCase()!=="details")return!1;const t=String(e.raw??e.content??"");return/^\s*<details\b/i.test(t)}function SZ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function rk(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Ys(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function pM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const CZ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),AZ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function MZ(e){return/\n\s*\n/.test(e)||AZ.test(e)}function EZ(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>CZ.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!MZ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function TZ(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const i=s,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||T6.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=Yn(l);if(a===-1)return s;const c=rk(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return s;const d=od(u,t,pM(n,o));return EZ(u,d)?{...s,children:d}:s})}function od(e,t,n){return e.trim()?gM(e,t,{...n,__disableStreamParse:!0}):[]}function NZ(e,t,n){const o=od(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function IZ(e,t,n){const o=aM({content:e}),s=Yn(e),i=rk(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=NZ(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function LZ(e,t,n){const o=Yn(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=ik(s,"summary",0);if(!i)return od(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...od(r,t,n),IZ(i.raw,t,n),...od(l,t,n)]}function mM(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=nd(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!eS(c)){r.push(c);continue}const f=String(c.raw??nd(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,g=-1;for(let q=a+1;q<e.length;q++){const j=e[q];if(eS(j)){p++;continue}if(SZ(j)&&(p--,p===0)){g=q;break}}const b=ik(t,"details",h),v=g===-1&&b?.closed===!0,m=v?(()=>{const q=rk(f,"details");return q!==-1?f.slice(0,q):f})():f,[y]=mM(v?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,o,s,h+f.length),k=LZ(m,n,pM(o,s)),A=g===-1?"</details>":String(e[g].raw??nd(e[g])??"</details>"),$=v||g!==-1&&b?.closed===!0,L=A.replace(/[\t\r\n ]+$/,""),w=$?(()=>{const q=(b?.raw??"").lastIndexOf(L);return q===-1?t.length:h+q})():t.length,E=Yn(f),T=v&&E!==-1?h+E+1:h+f.length,F=t.slice(T,w===-1?t.length:w),S=n.parse(F,{__markstreamFinal:s}),I=n.renderer.render(S,n.options,{__markstreamFinal:s}),P=w+L.length,B=$?Math.max(w+A.length,_Z(t,P)):t.length,W=$?t.slice(w,B):A,z=$?t.slice(h,B):t.slice(h),D=v&&E!==-1?f.slice(0,E+1):f;if(r.push({...c,tag:"details",attrs:Cm(f.slice(0,E+1)),raw:z,content:`${D}${I}${W}`,children:[...k,...y],loading:!s&&!$}),l=$?B:t.length,g===-1&&!v)break;g!==-1&&(a=g)}return[r,l]}function $Z(e,t,n){if(!n)return e;const o=e.slice();let s=0;for(let i=0;i<o.length;i++){const r=o[i],l=nd(r),a=l?n.indexOf(l,s):-1;if(r?.type!=="html_block"){a!==-1&&(s=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(s=a+l.length);continue}const u=ik(n,c,a!==-1?a:s);if(!u)continue;s=u.end;const d=String(r.content??l),f=String(r.raw??d),h=xZ(u.raw,c,u.closed),p=!t&&!u.closed,g=d!==h||f!==u.raw||!!r.loading!==p,b=Yn(u.raw),v=b===-1?"":u.raw.slice(0,b+1),m=v?Cm(v):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=m.length?m:void 0,!g)continue;let y=bZ(u.raw,f);y===-1&&(y=0);const k=i+1;for(;k<o.length;){if(u.closed&&kZ(o[k],c)){o.splice(k,1);continue}const A=nd(o[k]);if(!A)break;const $=u.raw.indexOf(A,y);if($===-1){if(wZ(n,u.end,A))break;o.splice(k,1);continue}y=$+A.length,o.splice(k,1)}}return o}function FZ(e){const t=l=>l===" "||l===" "||l===`
230
- `||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=g=>{const b=g.charCodeAt(0);return b>=65&&b<=90||b>=97&&b<=122},u=g=>{const b=g.charCodeAt(0);return b>=48&&b<=57},d=g=>g==="!"||c(g),f=g=>c(g)||u(g)||g===":"||g==="-",h=g=>c(g)||u(g)||g==="_"||g==="."||g===":"||g==="-",p=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!h(l[a]))return!1;for(a++;a<l.length&&p(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a<l.length&&l[a]!==g;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const b=l[a];if(t(b)||b==="<"||b===">"||b==='"'||b==="'"||b==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=m=>m===" "||m===" ",h=m=>{let y=0;for(;y<m.length&&f(m[y]);)y++;const k=m[y];if(k!=="`"&&k!=="~")return null;let A=y;for(;A<m.length&&m[A]===k;)A++;const $=A-y;return $<3?null:{markerChar:k,markerLen:$,rest:m.slice(A)}},p=m=>{let y=0;for(;y<m.length&&f(m[y]);)y++;let k=!1;for(;y<m.length&&m[y]===">";)for(k=!0,y++;y<m.length&&f(m[y]);)y++;return k?m.slice(y):null},g=m=>{const y=h(m);if(y)return y;const k=p(m);return k==null?null:h(k)};let b=0;const v=l.split(/\r?\n/);for(const m of v){const y=b,k=b+m.length;if(a<y)break;const A=g(m);if(A){const $=A.markerChar,L=A.markerLen;c?$===u&&L>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=$,d=L)}if(a<=k)break;b=k+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===`
231
- `||l==="\r",c=s[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const r=s.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
232
- `||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function OZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=p=>p===" "||p===" ",s=p=>{const g=p.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let g=0;for(let b=0;b<p.length;b++){const v=p[b];if(v===" "){if(g++,g>=4)return!0;continue}if(v===" ")return!0;break}return!1},r=p=>{let g=!1,b=!1;for(let v=0;v<p.length;v++){const m=p[v];if(m==="\\"){v++;continue}if(!b&&m==="'"){g=!g;continue}if(!g&&m==='"'){b=!b;continue}if(!g&&!b&&m===">")return v}return-1},l=p=>{let g=0;for(;g<p.length&&o(p[g]);)g++;const b=p[g];if(b!=="`"&&b!=="~")return null;let v=g;for(;v<p.length&&p[v]===b;)v++;const m=v-g;return m<3?null:{markerChar:b,markerLen:m,rest:p.slice(v)}},a=(p,g)=>{if(i(p))return-1;const b=p.replace(/^[ \t]+/,"");if(!b||b.startsWith(">")||b.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(b))return-1;let v=!1,m=0;for(;m<p.length;){const y=p[m];if(y!=="<"){o(y)||(v=!0),m++;continue}const k=r(p.slice(m));if(k===-1){v=!0,m++;continue}const A=p.slice(m,m+k+1);let $=1;for(;$<A.length&&o(A[$]);)$++;if($>=A.length){v=!0,m++;continue}const L=A[$];if(L==="!"||L==="?"){v=!0,m+=k+1;continue}if(L==="/"){v=!0,m+=k+1;continue}const w=$;for(;$<A.length&&s(A[$]);)$++;if($===w){v=!0,m++;continue}const E=A.slice(w,$).toLowerCase(),T=A[$];if(T&&T!==" "&&T!==" "&&T!==">"&&T!=="/"){v=!0,m++;continue}const F=new RegExp(String.raw`<\s*\/\s*${E}\s*>`,"i"),S=/\/\s*>$/.test(A),I=F.test(p.slice(m+k+1)),P=F.test(e.slice(g+m+k+1)),B=/[\r\n]/.test(e.slice(g+m+k+1));if(v&&n.has(E)&&!S&&!I&&(P||B))return m;v=!0,m+=k+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
233
- `,h),g=p!==-1,b=g&&p>h&&e[p-1]==="\r",v=g?b?p-1:p:e.length,m=e.slice(h,v),y=g?b?`\r
234
- `:`
235
- `:"",k=l(m);let A=m;if(!c&&!k){const $=a(m,h);if($!==-1){const L=y||`
236
- `;A=`${m.slice(0,$).replace(/[ \t]+$/,"")}${L}${L}${m.slice($).replace(/^[ \t]+/,"")}`}}f+=A,f+=y,k&&(c?k.markerChar===u&&k.markerLen>=d&&/^\s*$/.test(k.rest)&&(c=!1,u="",d=0):(c=!0,u=k.markerChar,d=k.markerLen)),h=g?p+1:e.length}return f}function RZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},i=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const g=d[p];if(g==="\\"){p++;continue}if(!h&&g==="'"){f=!f;continue}if(!f&&g==='"'){h=!h;continue}if(!f&&!h&&g===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let b=g+1;for(;b<d.length&&o(d[b]);)b++;if(b>=d.length||d[b]!=="/"){g=d.indexOf("<",g+1);continue}for(b++;b<d.length&&o(d[b]);)b++;if(b+p.length>d.length){g=d.indexOf("<",g+1);continue}let v=!0;for(let y=0;y<p.length;y++){const k=d[b+y];if((k>="A"&&k<="Z"?String.fromCharCode(k.charCodeAt(0)+32):k)!==p[y]){v=!1;break}}if(!v){g=d.indexOf("<",g+1);continue}let m=b+p.length;if(m<d.length&&s(d[m])){g=d.indexOf("<",g+1);continue}for(;m<d.length&&o(d[m]);)m++;if(m<d.length&&d[m]===">")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&s(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const g=r(d.slice(f));if(g===-1)return d;const b=f+g;if(l(d,b+1,p))return d;const v=i(d.slice(b+1));return v?`${d.slice(0,b+1)}
237
- ${v}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
238
- `,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
239
- `:`
240
- `,u=d+1}return c}function BZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let h=0,p=!1,g=0;for(;h<f.length;){for(;h<f.length&&o(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&o(f[h]);)h++;g=h}return p?{prefix:f.slice(0,g),content:f.slice(g)}:null},i=f=>{let h=0;for(;h<f.length&&o(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let g=h;for(;g<f.length&&f[g]===p;)g++;const b=g-h;return b<3?null:{markerChar:p,markerLen:b,rest:f.slice(g)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
241
- `,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",g=h?p?f-1:f:e.length,b=e.slice(d,g),v=h?p?`\r
242
- `:`
243
- `:"",m=s(b),y=m?.prefix??"",k=m?.content??b,A=i(k);A&&(l?A.markerChar===a&&A.markerLen>=c&&/^\s*$/.test(A.rest)&&(l=!1,a="",c=0):(l=!0,a=A.markerChar,c=A.markerLen));let $=k;if(!l&&$.includes("</"))for(const L of r)$=$.replace(L,(w,E,T,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return w;const S=F.slice(0,T).replace(/^[\t ]+/,"");if(S.length>0){const I=E.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",P=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!I||!P||I!==P)return w}return`${E}
244
-
245
- `});if(y){const L=y+$.split(`
246
- `).join(`
247
- ${y}`);u+=L}else u+=$;u+=v,d=h?f+1:e.length}return u}function DZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const o=S=>S===" "||S===" ",s=S=>{if(!S)return!1;if(S[0]===" ")return!0;let I=0;for(let P=0;P<S.length;P++){const B=S[P];if(B===" "){if(I++,I>=4)return!0;continue}if(B===" ")return!0;break}return!1},i=S=>{const I=S.charCodeAt(0);return I>=65&&I<=90||I>=97&&I<=122||I>=48&&I<=57||S==="_"||S==="-"||S===":"},r=S=>{let I=0;for(;I<S.length&&o(S[I]);)I++;return S.slice(I)},l=S=>{let I=0,P=!1,B=0;for(;I<S.length;){for(;I<S.length&&o(S[I]);)I++;if(I>=S.length||S[I]!==">")break;for(P=!0,I++;I<S.length&&o(S[I]);)I++;B=I}if(!P)return null;const W=S.slice(0,B);return{prefix:W,key:W.replace(/[ \t]+$/,""),content:S.slice(B)}},a=S=>r(S).startsWith("<"),c=S=>{for(let I=0;I<S.length;I++){const P=S[I];if(P!==" "&&P!==" ")return!1}return!0},u=S=>{if(s(S))return"";const I=r(S);if(!I.startsWith("<"))return"";let P=1;for(;P<I.length&&o(I[P]);)P++;if(P>=I.length||I[P]==="/"||I[P]==="!"||I[P]==="?")return"";const B=P;for(;P<I.length&&i(I[P]);)P++;if(P===B)return"";const W=I.slice(B,P).toLowerCase();if(!n.has(W))return"";const z=I[P];return z&&z!==" "&&z!==" "&&z!==">"&&z!=="/"?"":W},d=S=>{if(s(S))return null;const I=r(S);if(!I.startsWith("<"))return null;let P=1;for(;P<I.length&&o(I[P]);)P++;if(P>=I.length)return null;const B=I[P]==="/";if(B)for(P++;P<I.length&&o(I[P]);)P++;const W=I[P];if(!W||W==="!"||W==="?")return null;const z=P;for(;P<I.length&&i(I[P]);)P++;if(P===z)return null;const D=I.slice(z,P).toLowerCase();if(!n.has(D))return null;const q=I[P];if(q&&q!==" "&&q!==" "&&q!==">"&&q!=="/")return null;if(B)return{type:"close",name:D};if(/\/\s*>\s*$/.test(I))return{type:"open",name:D,complete:!0};const j=I.indexOf(">",P);if(j!==-1){const ie=I.slice(j+1);if(new RegExp(`<\\s*\\/\\s*${D}\\s*>`,"i").test(ie))return{type:"open",name:D,complete:!0}}return{type:"open",name:D,complete:!1}},f=S=>{if(s(S))return null;const I=r(S).replace(/[ \t]+$/,"");if(!I.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(I))return null;const P=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(P?.[1])return P[1].toLowerCase();const B=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!B?.[1]||!B[2])return null;const W=B[1].toLowerCase();return W===B[2].toLowerCase()?W:null};let h=!1,p="",g=0;const b=S=>{let I=0;for(;I<S.length&&o(S[I]);)I++;const P=S[I];if(P!=="`"&&P!=="~")return null;let B=I;for(;B<S.length&&S[B]===P;)B++;const W=B-I;return W<3?null:{markerChar:P,markerLen:W,rest:S.slice(B)}},v=S=>b(S),m=S=>{const I=r(S);return I?s(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(I):!1},y=(S,I,P)=>{let B=S,W=0;for(;B<e.length;){const z=e.indexOf(`
248
- `,B),D=z!==-1,q=D&&z>B&&e[z-1]==="\r",j=D?q?z-1:z:e.length,ie=e.slice(B,j),ue=l(ie),pe=ue?.key??"";if(W>0&&I&&pe!==I)break;const ee=ue?.content??ie,ne=d(ee);if(ne?.name===P){if(ne.type==="open")ne.complete||W++;else if(W>0&&(W--,W===0))return!1}else if(W>0&&(c(ee)||m(ee)))return!0;if(D)B=z+1;else break}return!1};let k="",A=0,$=!0,L=!1,w=!1,E=`
249
- `;const T=[];let F="";for(;A<e.length;){const S=e.indexOf(`
250
- `,A),I=S!==-1,P=I&&S>A&&e[S-1]==="\r",B=I?P?S-1:S:e.length,W=e.slice(A,B),z=I?P?`\r
251
- `:`
252
- `:"",D=l(W),q=D?.key??"",j=D?.content??W,ie=v(j);ie&&(h?ie.markerChar===p&&ie.markerLen>=g&&/^\s*$/.test(ie.rest)&&(h=!1,p="",g=0):(h=!0,p=ie.markerChar,g=ie.markerLen));const ue=T.length>0;if(!h&&!ue){const ee=u(j),ne=!!ee&&!$&&L&&w&&y(A,q,ee);ee&&!$&&(!L||ne)&&(q&&F&&q===F?k+=`${q}${E}`:q||(k+=E))}if(k+=W,k+=z,z&&(E=z),!h){const ee=d(j);if(ee){if(ee.type==="open")ee.complete||T.push(ee.name);else for(let ne=T.length-1;ne>=0;ne--)if(T[ne]===ee.name){T.length=ne;break}}}const pe=c(j);$=pe,L=!pe&&a(j),w=!pe&&!!f(j),F=q,A=I?S+1:e.length}return k}function gM(e,t,n={}){const o=dM(n),s=o?Gc():0,i=!!n.final;let r=(e??"").toString().replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\n(abla|eq|ot|exists)/g,"$1\\n$2");if(iZ(t,n)&&(t.stream.reset(),rZ(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,b=>b.startsWith(`
253
- `)?`
254
- `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,b=>b.startsWith(`
255
- `)?`
256
- `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,b=>b.startsWith(`
257
- `)?`
258
- `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
259
- `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,b=>b.startsWith(`
260
- `)?`
261
- `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(b,v,m)=>`${v}${m.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,b=>b.startsWith(`
262
- `)?`
263
- `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
264
- `))),n.customHtmlTags?.length&&r.includes("<")){const b=tu(n.customHtmlTags);if(b.length&&(r=OZ(r,b),r=RZ(r,b),r=DZ(r,b),r=BZ(r,b),r.includes("</")))for(const v of b){const m=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${v}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(m,"$1$2$2")}}i||(r=FZ(r));const l=yZ(r);if(l){const b=n.preTransformTokens,v=n.postTransformTokens;if(hM(t,n)||typeof b=="function"||typeof v=="function"){const m=Z_(t,r,{__markstreamFinal:i},n),y=typeof b=="function"&&b(m)||m;typeof v=="function"&&v(y)}return N0(l,o,s)}const a=Z_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return N0([],o,s);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,h=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),p={...n,validateLink:h,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let g=K_(d,p,o);if(u&&typeof u=="function"){const b=u(d);if(Array.isArray(b)){const v=b[0],m=v?.type;v&&typeof m=="string"?g=K_(b,void 0,o):g=b}}if(g=$Z(g,i,r),g=mM(g,r,t,n,i)[0],g=TZ(g,t,n,i),i){const b=new WeakSet,v=m=>{if(!m||typeof m!="object"||b.has(m))return;if(b.add(m),Array.isArray(m)){for(const k of m)v(k);return}const y=m;y.type==="html_block"&&y.loading===!0&&(y.loading=!1);for(const k of Object.values(y))v(k)};v(g)}return n.debug&&console.log("Parsed Markdown Tree Structure:",g),N0(g,o,s)}function tS(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=Bl(t);let s=0;for(;s<e.length;){const i=ok(e,s,o.options(),nk);if(i){n.push(i[0]),o.remember(i[0].raw),s=i[1];continue}const r=e[s];switch(r.type){case"paragraph_open":{const l=String(e[s+1]?.content??""),a=eZ(e,s,o.options(l)),c=Q_(a,t);c?n.push(...c):n.push(a),o.remember(a.raw),s+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=nu(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"blockquote_open":{const[l,a]=ou(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),o.remember(String(r.content??"")),s++;break}case"hardbreak":n.push(JY()),o.reset(),s++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),o.remember(l),s++;break}case"inline":{const l=String(r.content??""),a=Zn(r.children||[],l,void 0,o.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=Q_(c,t);u?n.push(...u):n.push(c)}o.remember(l)}s+=1;break;default:s+=1;break}}return n}const PZ=new Set([...jd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),HZ=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","s","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]),nS=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function oS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function WZ(e){return typeof e=="string"?e:e==null?"":String(e)}function vM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function ml(e){return WZ(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function yM(e){return ml(e).replace(/`/g,"&#96;")}function Tm(e){return String(e??"").trim().toLowerCase()}function lk(e,t="safe"){const n=Tm(e);return n?t==="escape"?!0:t==="trusted"?jd.has(n):!HZ.has(n):!1}function kM(e,t="safe"){const n=Tm(e);return n?t==="escape"?!0:t==="trusted"?jd.has(n):PZ.has(n):!1}function sS(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${yM(o)}"`).join("")}function zZ(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||ba(s,{tagName:t,attrName:"srcset"})})}function bM(e,t,n,o){return CV.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?zZ(t,o):!!(AV.has(e)&&t&&ba(t,{tagName:o,attrName:e}))}function ca(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function xM(e,t,n,o=!1){if(t!=="safe"||Tm(n)!=="a")return e;const s=ca(e,"href");if(o&&(!s||!e[s])){const a=ca(e,"target"),c=ca(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=ca(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=ca(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function iS(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!vM(r)||bM(l,i,t,n)||(o[r]=i)}return xM(o,t,n,!!ca(e,"href"))}function wM(e,t){const n=e.toLowerCase();return E6.has(n)?!1:oS(t,n)||oS(t,e)}function ak(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!vM(r)||bM(l,i,t,n)||(o[r]=i)}return xM(o,t,n,!!ca(e,"href"))}function bp(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function fv(e,t="safe",n){const o=ak(bp(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function UZ(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function qZ(e){const t={};for(const[n,o]of Object.entries(e))t[n]=UZ(o,n);return t}function rS(e){return e.trim().length>0}function jZ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(n<e.length){const a=e.slice(n);rS(a)&&t.push({type:"text",content:a})}break}if(o>n){const a=e.slice(n,o);rS(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",o+1)){const a=e.indexOf("]]>",o);if(a!==-1){t.push({type:"text",content:e.slice(o,a+3)}),n=a+3;continue}break}if(e.startsWith("!",o+1)){const a=e.indexOf(">",o);if(a!==-1){n=a+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Fa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=s+1}return t}function VZ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const f=e.indexOf("-->",n);if(f!==-1){n=f+3;continue}break}const o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const f=e.indexOf("]]>",o);if(f!==-1){t.push({type:"text",content:e.slice(o,f+3)}),n=f+3;continue}break}if(e.startsWith("!",o+1)){const f=e.indexOf(">",o);if(f!==-1){n=f+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim();if(!i){n=s+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=s+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Fa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function KZ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${ml(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${ml(o)}`:` ${ml(o)}="${yM(s)}"`).join("");return e.type==="self_closing"?`&lt;${ml(t)}${n} /&gt;`:`&lt;${ml(t)}${n}&gt;`}function GZ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;nS.lastIndex=0;let n;for(;(n=nS.exec(e))!==null;)if(wM(n[1],t))return!0;return!1}function Rc(e,t="safe"){if(!e)return"";if(t==="escape")return ml(e);const n=VZ(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(ml(r.content??""));continue}const l=Tm(r.tagName);if(!l)continue;if(kM(l,t)){r.type==="tag_open"?i.push(l):r.type==="tag_close"&&i[i.length-1]===l&&i.pop();continue}if(i.length>0)continue;if(t==="safe"&&lk(l,t)){s.push(KZ(r));continue}if(r.type==="self_closing"){s.push(`<${l}${sS(iS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${sS(iS(r.attrs??{},t,l))}>`),Fa.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(`</${u}>`)}const c=o.pop();c&&s.push(`</${c}>`)}for(;o.length>0;){const r=o.pop();r&&s.push(`</${r}>`)}return s.join("")}const YZ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],lS="http://www.w3.org/2000/svg",ZZ=new Set(["script","style","iframe","object","embed","link","meta"]),XZ=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),QZ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),JZ=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),eX=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function tX(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function nX(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function oX(e){const t=e.nodeName.toLowerCase();return t==="use"?tX(e):t==="image"?nX(e):t==="text"||t==="tspan"?!!e.textContent?.trim():eX.has(t)}function sX(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function iX(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),i=String(n??"").trim();return i?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?i.startsWith("#")?i:"":o==="a"&&(s==="href"||s==="xlink:href")?ba(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?ba(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":ba(i,{tagName:o,attrName:s})?"":i:""}function rX(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const o=e[n];if(o==='"'||o==="'"){const i=n+1,r=e.indexOf(o,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const s=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(s,n)}}function _M(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function SM(e){const t=_M(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=rX(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function aS(e){const t=_M(e);return YZ.some(n=>n.test(t))||SM(t)}function lX(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function Gf(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function CM(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!ZZ.has(o)){if(o==="br"){t.push(`
265
- `);return}for(const s of Array.from(n.childNodes))CM(s,t)}}function aX(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];CM(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=Gf(t.getAttribute("width")),i=Gf(t.getAttribute("height")),r=Gf(t.getAttribute("x")),l=Gf(t.getAttribute("y")),a=e.ownerDocument.createElementNS(lS,"text");a.setAttribute("x",String(r+s/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const h=e.ownerDocument.createElementNS(lS,"tspan");h.setAttribute("x",String(r+s/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function cX(e){aX(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!XZ.has(o)){n.remove();continue}if(o==="style"&&aS(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const i of s){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&aS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(QZ.has(r)&&i.value){const l=iX(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(JZ.has(r)&&i.value&&SM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=sX(i.value);l!==i.value&&n.setAttribute(i.name,l)}}lX(n)}}function Gwe(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return cX(n),uX(n)?null:n}catch{return null}}function uX(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const i=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){oX(s)&&(o=!0);for(const i of Array.from(s.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!o}const cS=[];function L0(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function dX(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function fX(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function uS(e=`editor-${Date.now()}`,t={}){const n=TG(t),o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;s=h=>f[h]??o[h]??h}else s=f=>o[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...g]=h;typeof p=="function"&&n.use(p,...g)}else typeof h=="function"&&n.use(h)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(h){console.error("[getMarkdown] apply function threw an error",h)}if(cS.length)for(const f of cS)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(KW),n.use(ZW),n.use(qW);const i=uz,r=i.default??i;n.use(r),n.use(UW),n.use(zW),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,g=!!h.env?.__markstreamFinal,b=p.split(/\r?\n/);for(const v of h.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const m=v.map[0],y=v.map[1],k=v.markup,A=k[0],$=k.length,L=b[Math.max(0,y-1)]??"";let w=0;for(;w<L.length&&(L[w]===" "||L[w]===" ");)w++;let E=0;for(;w+E<L.length&&L[w+E]===A;)E++;let T=w+E;for(;T<L.length&&(L[T]===" "||L[T]===" ");)T++;const F=g?!0:y>m+1&&E>=$&&T===L.length,S=v;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,h)=>{const p=f,g=p.pos;if(p.src[g]!=="~")return!1;const b=p.src[g-1],v=p.src[g+1];if(/\d/.test(b)&&/\d/.test(v)){if(!h){const m=p.push("text","",0);m.content="~"}return p.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,h)=>{const p=f[h],g=String(p.info??"").trim(),b=String(p.content??""),v=btoa(unescape(encodeURIComponent(b))),m=dX(g),y=L0(m),k=fX(`editor-${e}-${h}-${m}`),A=L0(s("common.copy"));return`<div class="code-block" data-code="${v}" data-lang="${y}" id="${k}">
266
- <div class="code-header">
267
- <span class="code-lang">${L0(m.toUpperCase())}</span>
268
- <button class="copy-button" data-code="${v}">${A}</button>
269
- </div>
270
- <div class="code-editor"></div>
271
- </div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const h=c.exec(f);if(!h)return f!=="["&&!/^\[\d+$/.test(f);const p=String(h[1]??"");return f.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(p)},d=(f,h)=>{const p=f;if(p.src[p.pos]!=="[")return!1;const g=a.exec(p.src.slice(p.pos));if(!g)return!1;const b=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const v=p.src.slice(p.pos+g[0].length);if(v.startsWith("](")||v.startsWith("(")||u(v))return!1;if(!h){const m=g[1],y=p.push("reference","span",0);y.content=m,y.markup=g[0],y.raw=g[0]}return p.pos+=g[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const g=String(f[h].content??"");return`<span class="reference-link" data-reference-id="${g}" role="button" tabindex="0" title="Click to view reference">${g}</span>`},n}function hX({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 AM({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}:hX({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const dS=new WeakMap;function pX(e){let t=dS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},dS.set(e,t)),t}function fS(e,t){if(!t?.length)return[...e];const n=[...e],o=new Set(n);for(const s of t)o.has(s)||(o.add(s),n.push(s));return n}function ck(e){return!!(e.themes?.length||e.langs?.length)}function MM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function mX(e,t){return!t?.length||e.registeredAllLangs?!0:MM(e.registeredLangs,t)}function $0(e,t){return ck(t)&&MM(e.registeredThemes,t.themes)&&mX(e,t.langs)}function gX(e,t){if(!ck(t))return t;const n=fS(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:fS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const vX={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 yX(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function EM(e){const t=yX(e);return vX[t]??t}function TM(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>EM(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function NM(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 kX(e){return NM(e)?.join("\0")??""}function IM(e,t){const n=NM(e),o=TM(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function xp(e,t){return`${kX(e)}\0\0${TM(t)?.join("\0")??""}`}function Ywe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=IM(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:xp(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function Zwe(e,t={},n){if(!e)return"ready";const o=IM(t.themes,t.langs),s=xp(o.themes,o.langs),i=n&&n===s?n:s,r=pX(e);if(r.completed.has(i))return"ready";if($0(r,o))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||$0(r,o))return r.completed.add(i),"ready";const c=gX(r,o),u=xp(c.themes,c.langs);return r.completed.has(u)||$0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(ck(c)?(r.registeredThemes=c.themes?[...c.themes]:r.registeredThemes,r.registeredLangs=c.langs?[...c.langs]:r.registeredLangs):r.registeredAllLangs=!0,r.completed.add(u),"ready"))}).then(()=>(r.completed.add(i),"ready")).finally(()=>{r.inFlight.get(i)===a&&r.inFlight.delete(i)});return r.inFlight.set(i,a),r.tail=a.catch(()=>{}),a}function ec(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function hS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var bX=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 p=pS();this.startedAt=f&&this.hasStarted?p-this.normalizedStartDelayMs:p,this.lastTick=p,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=pS();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 p=this.pendingChars,g=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,b=SX(p/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(b-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const v=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),m=_X(this.source.slice(this.visible.length),v,this.segmenter);m.text&&(this.visible+=m.text,this.charBudget=Math.max(0,this.charBudget-m.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:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=ec(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,ec(o,1e3,1)),this.normalizedTargetLatencyMs=ec(s,900,1),this.normalizedCatchUpLatencyMs=ec(i,350,1),this.normalizedCatchUpThreshold=hS(r,600),this.normalizedStartDelayMs=hS(a,80),this.maxCommitFps=Math.trunc(ec(l,30,1)),this.maxCharsPerCommit=Math.trunc(ec(c,80,1)),this.flushOnFinish=u,this.segmenter=wX(),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 xX(e={},t){const n=new bX(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 wX(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function _X(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 pS(){return typeof performance<"u"?performance.now():Date.now()}function SX(e,t,n){return Math.min(n,Math.max(t,e))}var CX=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const hv=Symbol.for("markstream-vue:node-lifecycle"),mS='<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>',gS='<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>',AX={id:"material",core:{"":gS,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:gS,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:mS,csharp:mS,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:()=>ps(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},pv=new Map;let vS="material";const xc=new Map,yS=new Map;let mv=null;function MX(e){pv.set(e.id,e)}function EX(e){return CX(this,null,function*(){var t,n,o;if(xc.has(e.id))return(t=xc.get(e.id))!=null?t:null;let s=yS.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(xc.set(e.id,i),mv?.(),i)).catch(()=>(xc.set(e.id,null),null)),yS.set(e.id,s)),s})}const TX=Ia(0);mv=()=>{TX.value++},MX(AX);const NX={"":"",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 uk(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=NX[n])!=null?t:n}function Xwe(e){const t=uk(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Qwe(e){return(function(o){const s=pv.get(vS);if(!s)return;const i=s.core[o];if(i)return i;const r=xc.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!xc.has(s.id)&&EX(s)})(uk(e))||((n=(t=pv.get(vS))==null?void 0:t.fallback)!=null?n:"");var t,n}const Jwe={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"};let LM=!1;function e_e(){return LM}function t_e(){LM=!0}var Nm=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let Vs=null,bh=!1,Im=fk;function Lm(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function dk(){try{const e=globalThis;return Lm(e?.katex)}catch{return null}}function fk(){return Nm(null,null,function*(){const e=dk();if(e)return e;const t=yield ps(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ps(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Lm(t)})}function IX(e){Im=e,Vs=null,bh=!1}function LX(e){IX(fk)}function $M(){return typeof Im=="function"}function n_e(){var e;const t=Im;if(!t||t===fk)return null;if(Vs)return Vs;const n=dk();if(n)return Vs=n,Vs;try{const o=t();return o&&typeof o?.then!="function"?(Vs=(e=Lm(o))!=null?e:o,Vs):null}catch{return null}}function hk(){return Nm(this,null,function*(){var e;const t=dk();if(t)return Vs=t,Vs;if(Vs)return Vs;if(bh)return null;const n=Im;if(!n)return bh=!0,null;try{const o=yield n();if(o)return Vs=(e=Lm(o))!=null?e:o,Vs}catch{}return bh=!0,null})}function FM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let yl=null,fl=null;const pi=new Map,Ir=new Map;let wp=5;const pa=new Set;function Ld(){if(pi.size<wp&&pa.size){const e=Array.from(pa);pa.clear();for(const t of e)try{t()}catch{}}}function $X(e){yl=e,fl=null,yl.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=pi.get(n);if(i)if(pi.delete(n),clearTimeout(i.timeoutId),Ld(),s)i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Ir.set(a,o),Ir.size>200){const c=Ir.keys().next().value;Ir.delete(c)}}i.resolve(o)}},yl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of pi.entries())clearTimeout(o.timeoutId),o.reject(new Error(`Worker error: ${t.message}`));pi.clear(),Ld()}}function FX(){var e;yl&&((e=yl.terminate)==null||e.call(yl)),yl=null,fl=null}function OX(e,t=!0,n=2e3,o){return Nm(this,null,function*(){performance.now();const s=FM(e);if(!$M()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(fl)return Promise.reject(fl);const i=`${t?"d":"i"}:${s}`,r=Ir.get(i);if(r)return Promise.resolve(r);const l=yl||(fl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),fl.name="WorkerInitError",fl.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(fl);if(pi.size>=wp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=pi.size,a.max=wp,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const p=new Error("Aborted");return p.name="AbortError",void c(p)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{pi.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),Ld()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(d),pi.has(u)&&pi.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),Ld()},{once:!0});const f=a,h=c;pi.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:s,displayMode:t})})})}function o_e(e,t=!0,n){const o=`${t?"d":"i"}:${FM(e)}`;if(Ir.set(o,n),Ir.size>200){const s=Ir.keys().next().value;Ir.delete(s)}}const RX="WORKER_BUSY";function BX(e=2e3,t){return pi.size<wp?Promise.resolve():new Promise((n,o)=>{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),pa.delete(r),n())};if(pa.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,pa.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>Ld()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),pa.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Nu={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function s_e(e){return Nm(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!$M()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(s=o.timeout)!=null?s:Nu.timeout,c=(i=o.waitTimeout)!=null?i:Nu.waitTimeout,u=(r=o.backoffMs)!=null?r:Nu.backoffMs,d=(l=o.maxRetries)!=null?l:Nu.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Nu.maxRetries,h=o.signal;let p=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield OX(t,n,a,h)}catch(g){if(g?.code!==RX||p>=f)throw g;if(p++,yield BX(c,h).catch(()=>{}),h?.aborted){const b=new Error("Aborted");throw b.name="AbortError",b}u>0&&(yield new Promise(b=>globalThis.setTimeout(b,u*p)))}}})}function wc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function DX(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 gv(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=DX(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 vv(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 OM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function yv(e,t=360,n=500){return OM(e,t,n)}function kv(e,t=360,n=500){return OM(e,t,n)}var PX=Object.defineProperty,HX=Object.defineProperties,WX=Object.getOwnPropertyDescriptors,kS=Object.getOwnPropertySymbols,zX=Object.prototype.hasOwnProperty,UX=Object.prototype.propertyIsEnumerable,bS=(e,t,n)=>t in e?PX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RM=(e,t)=>{for(var n in t||(t={}))zX.call(t,n)&&bS(e,n,t[n]);if(kS)for(var n of kS(t))UX.call(t,n)&&bS(e,n,t[n]);return e},pk=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const mk=()=>ps(()=>import("./mermaid.core-XQ4l3YcE.js").then(e=>e.bn),[]);let vr=null,gk=mk;function qX(e){gk=e,vr=null}function jX(e){qX(mk)}function VX(){return typeof gk=="function"}function xS(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=RM({},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},HX(n,WX(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function wS(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=RM({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 i_e(){return pk(this,null,function*(){if(vr)return vr;const e=(function(){try{const o=globalThis;return xS(o?.mermaid)}catch{return null}})();if(e)return vr=e,wS(vr),vr;const t=gk;if(!t)return null;let n;try{n=yield t()}catch(o){throw t===mk?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):o}return n?(vr=xS(n),wS(vr),vr):null})}let fs=null,hl=null;const zo=new Map;let _S=5,SS=!1;const KX="WORKER_BUSY",GX="MERMAID_DISABLED";function YX(e){fs=e,hl=null;const t=e;fs.onmessage=n=>{if(fs!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=zo.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},fs.onerror=n=>{var o,s;if(fs===t)if(zo.size!==0){try{SS?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of zo.entries())r.reject(new Error(`Worker error: ${n.message}`));zo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},fs.onmessageerror=n=>{var o,s;if(fs===t)if(zo.size!==0){try{SS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of zo.entries())r.reject(new Error("Worker messageerror"));zo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function ZX(){var e;if(fs)try{for(const[t,n]of zo.entries())n.reject(new Error("Worker cleared"));zo.clear(),(e=fs.terminate)==null||e.call(fs)}catch{}fs=null,hl=null}function BM(e,t,n=1400){if(!VX()){const s=new Error("Mermaid rendering disabled");return s.name="MermaidDisabled",s.code=GX,Promise.reject(s)}if(hl)return Promise.reject(hl);const o=fs||(hl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),hl.name="WorkerInitError",hl.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(hl);if(zo.size>=_S){const s=new Error("Worker busy");return s.name="WorkerBusy",s.code=KX,s.inFlight=zo.size,s.max=_S,Promise.reject(s)}return new Promise((s,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),zo.delete(r))},u={resolve:d=>{c(),s(d)},reject:d=>{c(),i(d)}};zo.set(r,u);try{o.postMessage({id:r,action:e,payload:t})}catch(d){return zo.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const f=zo.get(r);f&&f.reject(d)},n)})}function r_e(e,t,n=1400){return pk(this,null,function*(){try{return yield BM("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function l_e(e,t,n=1400){return pk(this,null,function*(){try{return yield BM("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function a_e(){if(fs)try{for(const[e,t]of zo.entries())t.reject(new Error("Worker terminated"));zo.clear(),fs.terminate()}finally{fs=null}}var XX=Object.defineProperty,QX=Object.defineProperties,JX=Object.getOwnPropertyDescriptors,CS=Object.getOwnPropertySymbols,eQ=Object.prototype.hasOwnProperty,tQ=Object.prototype.propertyIsEnumerable,AS=(e,t,n)=>t in e?XX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rt=(e,t)=>{for(var n in t||(t={}))eQ.call(t,n)&&AS(e,n,t[n]);if(CS)for(var n of CS(t))tQ.call(t,n)&&AS(e,n,t[n]);return e},Rt=(e,t)=>QX(e,JX(t)),Gn=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const nQ="__global__",F0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",bv=(()=>{const e=globalThis;if(e[F0])return e[F0];const t={scopedCustomComponents:{},revision:Ia(0)};return e[F0]=t,t})(),MS=bv.revision,oQ=Symbol("markstreamCustomComponents"),sQ=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 Gd(e){return sQ.has(String(e).trim().toLowerCase())}function iQ(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function O0(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([wi(n),wi(iQ(n))]))!s||Gd(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function wo(e){const t=Ut(oQ,null);return R(()=>{var n;return MS.value,(function(o,s={}){return MS.value,rt(rt(rt({},O0(bv.scopedCustomComponents[nQ]||{})),O0(s)),O0((function(i){return i&&bv.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const rQ=["aria-label"],lQ={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"},aQ={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"},mn=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Zs=mn(Ye({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(x(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(x(),N("svg",aQ,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(x(),N("svg",lQ,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,rQ))}),[["__scopeId","data-v-be21ab83"]]);Zs.install=e=>{e.component(Zs.__name,Zs)};const cQ={class:"emoji-node"},Is=mn(Ye({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(x(),N("span",cQ,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Is.install=e=>{e.component(Is.__name,Is)};const uQ=["id"],dQ=["title"],Xs=mn(Ye({__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)=>(x(),N("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,dQ)],8,uQ))}}),[["__scopeId","data-v-c1463a29"]]);Xs.install=e=>{e.component(Xs.__name,Xs)};const DM=(()=>{try{return!1}catch{}return!1})();function R0(e){DM&&console.warn(e)}function ES(e,t="safe",n){return ak(e,t,n)}function PM(e){return qZ(e)}function B0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function vk(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=fv((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),B0(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),B0(r.value)]):Object.entries(s).map(([r,l])=>[r,B0(l)]):null,t,n);var s;if(!o)return;const i=PM(bp(o));return Object.keys(i).length>0?i:void 0}function TS(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 Iu(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function D0(e,t,n,o,s,i,r=!1){const l=(function(d,f){return wM(d,f)})(e,o);if(jd.has(e.toLowerCase())||!l&&kM(e,i))return null;if(!l&&lk(e,i))return r?[TS(e,t,!0)]:[TS(e,t),...n,`</${e}>`];const a=ak(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=PM(a);return pn(d,Rt(rt({},f),{key:u}),n.length>0?n:void 0)}return pn(e,Rt(rt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function HM(e,t){return GZ(e,t)}function _p(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const f=D0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Iu(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.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 p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),g=D0(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?Iu(c[c.length-1].children,g):Iu(u,g),p.tagName.toLowerCase()!==f&&c.length>h&&R0(`Auto-closing unclosed tag: <${p.tagName}>`)}else R0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=D0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Iu(c[c.length-1].children,f):Iu(u,f),R0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(jZ(e),t,n)}catch(s){return o=s,DM&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const fQ=["innerHTML"],Qs=mn(Ye({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),o=R(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=wo(()=>t.customId),i=Ye({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:Rc(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=_p(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!HM(l,s.value))return{mode:"html",content:Rc(l,o.value)};const a=_p(l,s.value,o.value);return a===null?{mode:"html",content:Rc(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(x(),N("span",{key:0,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[re(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(x(),N("span",{key:1,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(x(),N("span",{key:2,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,fQ))}}),[["__scopeId","data-v-d17f12b0"]]);Qs.install=e=>{e.component(Qs.__name,Qs)};const hQ={class:"inline-code"},pQ={key:0},rs=mn(Ye({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Hd(),o=Ut("markstreamFade",void 0),s=Ut("markstreamTextStreamState",void 0),i=Ut("markstreamStreamVersion",void 0),r=R(()=>{const m=n.fade;return m===""||m===!0||m==="true"||m!==!1&&m!=="false"&&void 0}),l=R(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=R(()=>{var m;return String((m=t.node.code)!=null?m:"")}),c=R(()=>!l.value),u=R(()=>{var m;const y=(m=n["index-key"])!=null?m:n.indexKey;return y==null||y===""?"":String(y)}),d=Z(t.node.code),f=Z("");let h=i?.value;const p=Z(0);function g(){return d.value+f.value}function b(){f.value&&(d.value=g(),f.value="")}Qe([()=>t.node.code,u,l,()=>i?.value],([m,y,k,A])=>{const $=String(m??""),L=u.value,w=A!==h;h=A;const E=AM({nextContent:$,persistedContent:L?s?.get(L):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:w});d.value=E.settledContent,f.value=E.streamedDelta,E.appended&&(p.value+=1),L&&s?.set(L,$)},{immediate:!0}),Qe(l,m=>{var y;m||(y=g(),d.value=y,f.value="")});const v=R(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(m,y)=>(x(),N("code",hQ,[c.value?(x(),N(Pe,{key:0},[Xe(O(a.value),1)],64)):(x(),N(Pe,{key:1},[d.value?(x(),N("span",pQ,O(d.value),1)):le("",!0),f.value?(x(),N("span",{key:1,class:We(["inline-code-stream-delta",[v.value]]),onAnimationend:b},O(f.value),35)):le("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);rs.install=e=>{e.component(rs.__name,rs)};const xv=Z(!1),NS=Z(""),IS=Z("top"),sd=Z(null),id=Z(null),wv=Z(null),_v=Z(null),LS=Z(null);let xh=null,wh=null,Sv=0;function WM(){xh&&(clearTimeout(xh),xh=null),wh&&(clearTimeout(wh),wh=null)}let Yf=!1,Zf=null,$S=!1;function mQ(e,t,n="top",o=!1,s,i){if(!e)return;const r=++Sv;WM();const l=()=>Gn(null,null,function*(){var a,c;if(yield(function(){return Gn(this,null,function*(){if(!Yf&&!$S&&typeof document<"u"){Zf!=null||(Zf=Gn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([ps(()=>import("./vue.runtime.esm-bundler-NheX_bap.js"),[]),ps(()=>import("./Tooltip-Dx3D8Bj3.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:xv.value,"anchor-el":sd.value,content:NS.value,placement:IS.value,id:id.value,originX:wv.value,originY:_v.value,isDark:(p=LS.value)!=null?p:void 0})}}).mount(h),Yf=!0}));try{yield Zf}catch(u){Yf=!1,Zf=null,$S=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Yf&&r===Sv){id.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,sd.value=e,NS.value=t,IS.value=n,wv.value=(a=s?.x)!=null?a:null,_v.value=(c=s?.y)!=null?c:null,LS.value=typeof i=="boolean"?i:null,xv.value=!0;try{e.setAttribute("aria-describedby",id.value)}catch{}}});o?l():xh=setTimeout(l,80)}function gQ(e=!1){Sv+=1,WM();const t=()=>{if(sd.value&&id.value)try{sd.value.removeAttribute("aria-describedby")}catch{}xv.value=!1,sd.value=null,id.value=null,wv.value=null,_v.value=null};e?t():wh=setTimeout(t,120)}const Cv={"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..."},Av=e=>{var t;return(t=Cv[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function FS(e){return{t(t){if(e.te&&Cv[t]&&!e.te(t))return Av(t);const n=e.t(t);return n===t&&Cv[t]?Av(t):n}}}function vQ(){const e=(function(){var t,n;try{const o=Go(),s=o?.proxy,i=s?.$t;if(typeof i=="function"){const a=s?.$te;return{t:i.bind(s),te:typeof a=="function"?a.bind(s):void 0}}const r=(n=(t=o?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return FS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return FS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Av}}function yQ(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 kQ=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],bQ={key:1,class:"image-placeholder"},xQ={key:1,class:"image-node__raw-text"},wQ={key:0,class:"image-shimmer-overlay"},_Q={key:1,class:"image-node__raw-text"},SQ={key:2,class:"image-error"},_l=mn(Ye({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=t,s=Z(!1),i=Z(!1),r=Z(""),l=Z("primary"),a=Z(null),c=Hd(),u=Ut(hv,null);let d="",f=null;const h=R(()=>p_(n.node.src)),p=R(()=>p_(n.fallbackSrc)),g=R(()=>r.value),b=R(()=>!n.lazy),v=R(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),m=R(()=>l.value==="failed"),y=R(()=>!b.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),k=R(()=>yQ(n,c));function A(P=k.value){P&&a.value&&u?.reportHeight(P,a.value.offsetHeight)}function $(P=k.value){P&&mt(()=>{A(P)})}function L(){f&&(clearTimeout(f),f=null)}function w(){const P=k.value;P&&d!==P&&(d&&u?.markSettled(d),L(),d=P,u?.markPending(P),typeof window<"u"&&(f=window.setTimeout(()=>{d===P&&($(P),E())},8e3)))}function E(){return Gn(this,null,function*(){const P=d;P&&(L(),d="",yield mt(),A(P),u?.markSettled(P))})}function T(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,s.value=!1,i.value=!1,void $();l.value="failed",i.value=!0,o("error",r.value),$()}function F(){s.value=!0,i.value=!1,o("load",g.value),$()}function S(P){P.preventDefault(),s.value&&!i.value&&o("click",[P,g.value])}const{t:I}=vQ();return Qe([h,p,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):p.value?(r.value=p.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Qe([v,s,i,g,()=>n.lazy],([P,B,W,z,D])=>P&&z&&!W?B?(E(),void $()):D?(w(),void $()):void(B||W||w()):(E(),void $()),{flush:"post",immediate:!0}),co(()=>{(function(){const P=d;P&&(L(),d="",u?.markSettled(P))})()}),(P,B)=>{var W,z,D,q,j;return x(),N("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[v.value?(x(),N("img",{key:0,src:g.value,alt:String((z=(W=n.node.alt)!=null?W:n.node.title)!=null?z:""),title:String((q=(D=n.node.title)!=null?D:n.node.alt)!=null?q:""),class:We(["image-node__img",{"is-loading":!b.value&&!s.value,"is-loaded":b.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(j=n.node.alt)!=null?j:C(I)("image.preview"),onError:T,onLoad:F,onClick:S},null,42,kQ)):le("",!0),e.node.loading&&!i.value?(x(),N("span",bQ,[n.usePlaceholder?Fn(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[0]||(B[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(x(),N("span",xQ,O(e.node.raw),1))])):le("",!0),re(El,{name:"shimmer-fade"},{default:Ne(()=>[y.value&&!e.node.loading?(x(),N("span",wQ,[n.usePlaceholder?Fn(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[1]||(B[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(x(),N("span",_Q,O(e.node.raw),1))])):le("",!0)]),_:3}),m.value?(x(),N("span",SQ,[Fn(P.$slots,"error",{node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[2]||(B[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("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)),_("span",null,O(C(I)("image.loadError")),1)],!0)])):le("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);_l.install=e=>{e.component(_l.__name,_l)};const CQ={key:2},sr=Ye({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=wo(()=>t.customId),o=Ut("markstreamHtmlPolicy",void 0),s=Ut("markstreamNestedRendererProps",void 0),i=R(()=>{var p;return(p=o?.value)!=null?p:"safe"}),r=R(()=>{var p,g;const b=(p=s?.value)!=null?p:{};return Rt(rt({},b),{customId:(g=t.customId)!=null?g:b.customId,htmlPolicy:i.value})}),l=Li({loader:()=>Promise.resolve().then(()=>Sk),suspensible:!1}),a=R(()=>t.components[String(t.node.type)]),c=R(()=>!!(a.value&&n.value[t.node.type]&&!Gd(String(t.node.type)))),u=R(()=>c.value?vk(t.node,i.value):void 0),d=R(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=R(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=R(()=>{var p,g;return String((g=(p=t.node.content)!=null?p:t.node.raw)!=null?g:"")});return(p,g)=>a.value&&c.value?(x(),be(qo(a.value),bn({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:Ne(()=>[d.value?(x(),be(C(l),bn({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?(x(),be(C(l),bn({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"])):le("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(x(),be(qo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(x(),N("span",CQ,O(h.value),1)):le("",!0)}}),AQ=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],MQ={key:0,translate:"no",class:"markstream-pre__diff-code"},EQ={class:"markstream-pre__diff-number","aria-hidden":"true"},TQ={class:"markstream-pre__diff-content"},NQ={class:"markstream-pre__diff-content-inner"},IQ={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},LQ=["textContent"],js=Ye({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=R(()=>{var S,I,P;const B=String((I=(S=t.node)==null?void 0:S.language)!=null?I:"");return String((P=String(B).split(/\s+/g)[0])!=null?P:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=R(()=>`language-${n.value}`),s=R(()=>{var S,I,P,B,W;return((S=t.node)==null?void 0:S.diff)===!0?String((P=(I=t.node)==null?void 0:I.code)!=null?P:""):(function(z,D){const q=String(z??"");return D?q:q.replace(/\r\n$|\n$|\r$/,"")})((B=t.node)==null?void 0:B.code,((W=t.node)==null?void 0:W.loading)===!0)}),i=R(()=>s.value.split(/\r\n|\n|\r/)),r=R(()=>Array.from({length:Math.max(1,i.value.length)},(S,I)=>I+1)),l=R(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=R(()=>l.value&&t.diffInline===!0),c=R(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const I=`${Math.ceil(S)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,I="context",P={}){const B=u(S);return{code:S,kind:B&&I!=="hunk"&&!P.preserveBlankKind?"context":I,empty:B}}function f(S){const I=String(S??"");return I?I.split(/\r\n|\n|\r/):[]}function h(S,I){return!u(S[I])||I<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function g(S){return S.startsWith("+")&&!S.startsWith("+++")}function b(S,I){const P=f(S),B=f(I),W=(function(ue,pe){const ee=ue.length,ne=pe.length;if((ee+1)*(ne+1)>15e5)return null;const fe=ne+1,Me=new Uint32Array((ee+1)*(ne+1));for(let ce=1;ce<=ee;ce++)for(let se=1;se<=ne;se++){const V=ce*fe+se;if(ue[ce-1]===pe[se-1])Me[V]=Me[(ce-1)*fe+(se-1)]+1;else{const Q=Me[(ce-1)*fe+se],ke=Me[ce*fe+(se-1)];Me[V]=Q>=ke?Q:ke}}const $e=[];let ae=ee,U=ne;for(;ae>0&&U>0;)ue[ae-1]===pe[U-1]?($e.push({originalIndex:ae-1,modifiedIndex:U-1}),ae--,U--):Me[(ae-1)*fe+U]>=Me[ae*fe+(U-1)]?ae--:U--;return $e.reverse(),$e})(P,B);if(W){const ue=[];let pe=0,ee=0;for(const ne of W){for(;pe<ne.originalIndex;)ue.push(Rt(rt({},d(P[pe],"removed",{preserveBlankKind:h(P,pe)})),{key:`inline-removed-source-${pe}`,number:""})),pe++;for(;ee<ne.modifiedIndex;)ue.push(Rt(rt({},d(B[ee],"added",{preserveBlankKind:h(B,ee)})),{key:`inline-added-source-${ee}`,number:ee+1})),ee++;ue.push(Rt(rt({},d(B[ne.modifiedIndex])),{key:`inline-context-source-${ne.originalIndex}-${ne.modifiedIndex}`,number:ne.modifiedIndex+1})),pe=ne.originalIndex+1,ee=ne.modifiedIndex+1}for(;pe<P.length;)ue.push(Rt(rt({},d(P[pe],"removed",{preserveBlankKind:h(P,pe)})),{key:`inline-removed-source-${pe}`,number:""})),pe++;for(;ee<B.length;)ue.push(Rt(rt({},d(B[ee],"added",{preserveBlankKind:h(B,ee)})),{key:`inline-added-source-${ee}`,number:ee+1})),ee++;return ue}const z=[];let D=0,q=P.length-1,j=B.length-1;for(;D<=q&&D<=j&&P[D]===B[D];)z.push(Rt(rt({},d(B[D])),{key:`inline-prefix-${D}`,number:D+1})),D++;const ie=[];for(;q>=D&&j>=D&&P[q]===B[j];)ie.unshift(Rt(rt({},d(B[j])),{key:`inline-suffix-${j}`,number:j+1})),q--,j--;for(let ue=D;ue<=q;ue++)z.push(Rt(rt({},d(P[ue],"removed",{preserveBlankKind:h(P,ue)})),{key:`inline-removed-source-${ue}`,number:""}));for(let ue=D;ue<=j;ue++)z.push(Rt(rt({},d(B[ue],"added",{preserveBlankKind:h(B,ue)})),{key:`inline-added-source-${ue}`,number:ue+1}));return z.concat(ie)}const v=R(()=>{var S,I,P,B;const W=(function(j){const ie=j.some(pe=>p(pe)),ue=j.some(pe=>g(pe));return ie&&ue||(function(){var pe,ee,ne,fe;if(n.value==="diff")return!0;const Me=(fe=(ne=String((ee=(pe=t.node)==null?void 0:pe.raw)!=null?ee:"").split(/\r?\n/,1)[0])==null?void 0:ne.trim())!=null?fe:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Me)})()&&(ie||ue)})(i.value),z=(function(){var j,ie;return((j=t.node)==null?void 0:j.originalCode)!=null||((ie=t.node)==null?void 0:ie.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:W?(function(j){const ie=[];let ue=1;for(const[pe,ee]of j.entries())if(ee.startsWith("@@"))ie.push(Rt(rt({},d(ee,"hunk")),{key:`inline-hunk-${pe}`,number:""}));else if(p(ee))ie.push(Rt(rt({},d(ee.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${pe}`,number:""}));else if(g(ee))ie.push(Rt(rt({},d(ee.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${pe}`,number:ue++}));else{const ne=ee.startsWith(" ")?ee.slice(1):ee;ie.push(Rt(rt({},d(ne)),{key:`inline-context-${pe}`,number:ue})),ue++}return ie})(i.value):b((S=t.node)==null?void 0:S.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!W&&z){const j=f((P=t.node)==null?void 0:P.originalCode),ie=f((B=t.node)==null?void 0:B.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:j.map((ue,pe)=>{const ee=ie[pe]===ue?"context":"removed";return Rt(rt({},d(ue,ee,{preserveBlankKind:h(j,pe)})),{key:`original-${pe}`,number:pe+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ie.map((ue,pe)=>{const ee=j[pe]===ue?"context":"added";return Rt(rt({},d(ue,ee,{preserveBlankKind:h(ie,pe)})),{key:`modified-${pe}`,number:pe+1})})}]}const D=[],q=[];for(const j of i.value)if(j.startsWith("@@"))D.push(d(j,"hunk")),q.push(d(j,"hunk"));else if(j.startsWith("-")&&!j.startsWith("---"))D.push(d(j.slice(1),"removed",{preserveBlankKind:!0}));else if(j.startsWith("+")&&!j.startsWith("+++"))q.push(d(j.slice(1),"added",{preserveBlankKind:!0}));else{const ie=j.startsWith(" ")?j.slice(1):j;D.push(d(ie)),q.push(d(ie))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:D.map((j,ie)=>Rt(rt({},j),{key:`original-${ie}`,number:ie+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:q.map((j,ie)=>Rt(rt({},j),{key:`modified-${ie}`,number:ie+1}))}]}),m=R(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),y=Z(null),k=Z([]);let A=null,$=null;function L(S){const I=Number.parseFloat(String(S??""));return Number.isFinite(I)&&I>0?I:0}function w(S,I){var P;if(!S)return I;const B=S.querySelector(".markstream-pre__diff-content"),W=B?.getBoundingClientRect(),z=(P=W?.height)!=null?P:0;return Math.max(I,Math.ceil(z))}function E(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,I;A=null;const P=y.value;if(!P||!l.value)return void(k.value.length&&(k.value=[]));const B=(function(ue){const pe=window.getComputedStyle(ue),ee=L(pe.getPropertyValue("--markstream-pre-diff-line-height"));if(ee>0)return ee;const ne=L(pe.lineHeight);return ne>0?ne:18})(P),W=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),D=Math.max(W.length,z.length),q=[];for(let ue=0;ue<D;ue++){const pe=w((S=W[ue])!=null?S:null,B),ee=w((I=z[ue])!=null?I:null,B),ne=Math.max(B,pe,ee);q.push({rowHeight:ne,originalHeight:pe,modifiedHeight:ee})}var j,ie;j=k.value,ie=q,j.length===ie.length&&j.every((ue,pe)=>{const ee=ie[pe];return ee&&Math.abs(ue.rowHeight-ee.rowHeight)<=.5&&Math.abs(ue.originalHeight-ee.originalHeight)<=.5&&Math.abs(ue.modifiedHeight-ee.modifiedHeight)<=.5})||(k.value=q)})()}))}function T(S){$?.disconnect(),$=null,S&&l.value&&typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{E()}),$.observe(S))}function F(S,I){const P=k.value[S];if(!P)return;const B=I==="original"?P.originalHeight:P.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(P.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(B)}px`}}return Qe(y,S=>{T(S),mt(()=>E())},{flush:"post"}),Qe([l,v],()=>{T(y.value),mt(()=>E())},{flush:"post",immediate:!0}),co(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),$?.disconnect(),$=null}),(S,I)=>(x(),N("pre",{ref_key:"preRef",ref:y,style:qt(c.value),class:We([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":m.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(x(),N("code",MQ,[(x(!0),N(Pe,null,nt(v.value,P=>(x(),N("span",{key:P.key,class:We(["markstream-pre__diff-pane",P.className])},[(x(!0),N(Pe,null,nt(P.lines,(B,W)=>(x(),N("span",{key:B.key,class:We(["markstream-pre__diff-line",[`markstream-pre__diff-line--${B.kind}`,{"markstream-pre__diff-line--empty":B.empty}]]),style:qt(F(W,P.key))},[I[0]||(I[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",EQ,O(B.number),1),_("span",TQ,[_("span",NQ,O(B.code),1)])],6))),128))],2))),128))])):(x(),N(Pe,{key:1},[t.showLineNumbers?(x(),N("span",IQ,[(x(!0),N(Pe,null,nt(r.value,P=>(x(),N("span",{key:P,class:"markstream-pre__line-number"},O(P),1))),128))])):le("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:O(s.value)},null,8,LQ)],64))],14,AQ))}});js.install=e=>{e.component(js.__name,js)};const P0=Ia(!1);let OS=null;const $Q={key:0},no=mn(Ye({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(OS||(OS=hk().then(v=>{P0.value=!!v}).catch(()=>{P0.value=!1})),Oh(P0)),o=Hd(),s=Ut("markstreamFade",void 0),i=Ut("markstreamTextStreamState",void 0),r=Ut("markstreamStreamVersion",void 0),l=R(()=>{const v=o.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),a=R(()=>typeof l.value=="boolean"?l.value:typeof s?.value!="boolean"||s.value),c=R(()=>{var v;const m=(v=o["index-key"])!=null?v:o.indexKey;return m==null||m===""?"":String(m)}),u=Z(t.node.content),d=Z("");let f=r?.value;const h=Z(0);function p(){return u.value+d.value}function g(){d.value&&(u.value=p(),d.value="")}Qe([()=>t.node.content,c,a,()=>r?.value],([v,m,y,k])=>{const A=String(v??""),$=c.value,L=k!==f;f=k;const w=AM({nextContent:A,persistedContent:$?i?.get($):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:L});u.value=w.settledContent,d.value=w.streamedDelta,w.appended&&(h.value+=1),$&&i?.set($,A)},{immediate:!0}),Qe(a,v=>{var m;v||(m=p(),u.value=m,d.value="")});const b=R(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(v,m)=>(x(),N("span",{class:We([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(x(),N("span",$Q,O(u.value),1)):le("",!0),d.value?(x(),N("span",{key:1,class:We(["text-node-stream-delta",[b.value]]),onAnimationend:g},O(d.value),35)):le("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);no.install=e=>{e.component(no.__name,no)};const zM=Ye({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return pn(js,Rt(rt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(o=n.estimatedHeightPx)!=null?o:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),H0=Li({loader:()=>Gn(null,null,function*(){try{return(yield ps(()=>import("./CodeBlockNode-D-Xzv638.js"),__vite__mapDeps([4,5,6]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),js}}),loadingComponent:zM,delay:0,suspensible:!1}),Bi=Li(()=>Gn(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 pn(no,Rt(rt({},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{if(yield hk())return(yield ps(()=>import("./index6-BZ_JSMrz.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 pn(no,Rt(rt({},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:""}$`}}))}})),UM=Li(()=>Gn(null,null,function*(){try{if(yield hk())return(yield ps(()=>import("./index5-Bog59TPE.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 pn(no,Rt(rt({},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:""}$$`}}))}})),vs=mn(Ye({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(x(),N("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))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);vs.install=e=>{e.component(vs.__name,vs)};const FQ={class:"superscript-node"},Ls=mn(Ye({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=R(()=>rt({text:no,inline_code:rs,link:bs,html_inline:Qs,strong:ys,emphasis:xs,footnote_reference:Xs,strikethrough:ks,highlight:Js,insert:Fs,subscript:$s,emoji:Is,math_inline:Bi,reference:vs},n.value));return(s,i)=>(x(),N("sup",FQ,[(x(!0),N(Pe,null,nt(e.node.children,(r,l)=>(x(),be(C(sr),{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"]]);Ls.install=e=>{e.component(Ls.__name,Ls)};const OQ={class:"subscript-node"},$s=mn(Ye({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=R(()=>rt({text:no,inline_code:rs,link:bs,html_inline:Qs,strong:ys,emphasis:xs,footnote_reference:Xs,strikethrough:ks,highlight:Js,insert:Fs,superscript:Ls,emoji:Is,math_inline:Bi,reference:vs},n.value));return(s,i)=>(x(),N("sub",OQ,[(x(!0),N(Pe,null,nt(e.node.children,(r,l)=>(x(),be(C(sr),{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"]]);$s.install=e=>{e.component($s.__name,$s)};const RQ={class:"strong-node"},ys=mn(Ye({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=R(()=>rt({text:no,inline_code:rs,link:bs,html_inline:Qs,emphasis:xs,strikethrough:ks,highlight:Js,insert:Fs,subscript:$s,superscript:Ls,emoji:Is,footnote_reference:Xs,math_inline:Bi,reference:vs},n.value));return(s,i)=>(x(),N("strong",RQ,[(x(!0),N(Pe,null,nt(e.node.children,(r,l)=>(x(),be(C(sr),{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"]]);ys.install=e=>{e.component(ys.__name,ys)};const BQ={class:"strikethrough-node"},ks=mn(Ye({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=R(()=>rt({text:no,inline_code:rs,link:bs,html_inline:Qs,strong:ys,emphasis:xs,highlight:Js,insert:Fs,subscript:$s,superscript:Ls,emoji:Is,footnote_reference:Xs,math_inline:Bi,reference:vs},n.value));return(s,i)=>(x(),N("del",BQ,[(x(!0),N(Pe,null,nt(e.node.children,(r,l)=>(x(),be(C(sr),{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"]]);ks.install=e=>{e.component(ks.__name,ks)};const DQ=["href","title","aria-label","aria-hidden","target","rel"],PQ=["aria-hidden"],HQ={class:"link-text-wrapper relative inline-flex"},WQ={class:"leading-[normal] link-text"},bs=mn(Ye({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Ut("markstreamShowTooltips",void 0),o=R(()=>{const v=n?.value;return typeof v=="boolean"?v:t.showTooltip}),s=R(()=>{var v,m,y,k,A;const $=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",L=(v=t.animationOpacity)!=null?v:.35,w=Math.max(.12,Math.min(.5*L,L)),E={"--underline-height":`${(m=t.underlineHeight)!=null?m:2}px`,"--underline-bottom":$,"--underline-opacity":String(L),"--underline-rest-opacity":String(w),"--underline-duration":`${(y=t.animationDuration)!=null?y:1.6}s`,"--underline-timing":(k=t.animationTiming)!=null?k:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=wo(()=>t.customId),r=R(()=>rt({text:no,strong:ys,strikethrough:ks,emphasis:xs,image:_l,html_inline:Qs,inline_code:rs},i.value)),l=Hd(),a=R(()=>{var v,m;const y=(v=t.node)==null?void 0:v.attrs;if(!y||typeof y!="object")return{};const k={};if(Array.isArray(y))for(const A of y)Array.isArray(A)&&A[0]&&(k[String(A[0])]=String((m=A[1])!=null?m:""));else for(const[A,$]of Object.entries(y))A&&$!=null&&$!==!1&&(k[A]=$===!0?"":String($));return ES(k,"safe","a")}),c=R(()=>rt(rt({},l),a.value)),u=R(()=>{var v,m;return ES({href:String((m=(v=t.node)==null?void 0:v.href)!=null?m:"")},"safe","a").href}),d=R(()=>{if(!u.value)return;const v=c.value.target;return(typeof v=="string"?v.trim():String(v??"").trim())||(IV(u.value)?"_blank":void 0)}),f=R(()=>{var v;return String((v=d.value)!=null?v:"").trim().toLowerCase()==="_blank"}),h=R(()=>{if(!u.value)return;const v=c.value.rel,m=new Set((typeof v=="string"?v:String(v??"")).split(/\s+/).filter(Boolean)),y=new Set(Array.from(m).filter(k=>k.toLowerCase()!=="opener"));return f.value&&(y.add("noopener"),y.add("noreferrer")),y.size>0?Array.from(y).join(" "):void 0}),p=R(()=>{const v=rt({},c.value);return delete v.title,delete v.href,delete v.target,delete v.rel,v});function g(){o.value&&gQ()}const b=R(()=>{var v,m;const y=(v=t.node)==null?void 0:v.title;return typeof y=="string"&&y.trim().length>0?y:String((m=u.value)!=null?m:"")});return(v,m)=>{var y,k;return e.node.loading?(x(),N("span",bn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:s.value}),[_("span",HQ,[_("span",WQ,[re(C(no),{class:"leading-[normal] link-text",node:{type:"text",content:String((y=e.node.text)!=null?y:""),raw:String((k=e.node.text)!=null?k:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),m[1]||(m[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,PQ)):(x(),N("a",bn({key:0,class:"link-node",href:u.value,title:o.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:s.value,onMouseenter:m[0]||(m[0]=A=>(function($){var L,w,E,T;if(!o.value)return;const F=$,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,I=((L=t.node)==null?void 0:L.title)||((w=u.value)!=null&&w.includes("xn--")&&((T=(E=t.node)==null?void 0:E.text)!=null&&T.includes("://"))?t.node.text:u.value)||"";mQ($.currentTarget,I,"top",!1,S)})(A)),onMouseleave:g}),[(x(!0),N(Pe,null,nt(e.node.children,(A,$)=>(x(),be(C(sr),{key:`${e.indexKey||"emphasis"}-${$}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${$}`},null,8,["components","node","custom-id","index-key"]))),128))],16,DQ))}}}),[["__scopeId","data-v-367e6ca4"]]);bs.install=e=>{e.component(bs.__name,bs)};const zQ={class:"insert-node"},Fs=mn(Ye({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=R(()=>rt({text:no,inline_code:rs,link:bs,html_inline:Qs,strong:ys,emphasis:xs,strikethrough:ks,highlight:Js,subscript:$s,superscript:Ls,emoji:Is,footnote_reference:Xs,math_inline:Bi,reference:vs},n.value));return(s,i)=>(x(),N("ins",zQ,[(x(!0),N(Pe,null,nt(e.node.children,(r,l)=>(x(),be(C(sr),{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"]]);Fs.install=e=>{e.component(Fs.__name,Fs)};const UQ={class:"highlight-node"},Js=mn(Ye({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=R(()=>rt({text:no,inline_code:rs,link:bs,html_inline:Qs,strong:ys,emphasis:xs,strikethrough:ks,insert:Fs,subscript:$s,superscript:Ls,emoji:Is,footnote_reference:Xs,math_inline:Bi,reference:vs},n.value));return(s,i)=>(x(),N("mark",UQ,[(x(!0),N(Pe,null,nt(e.node.children,(r,l)=>(x(),be(C(sr),{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"]]);Js.install=e=>{e.component(Js.__name,Js)};const qQ={class:"emphasis-node"},xs=mn(Ye({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=R(()=>rt({text:no,inline_code:rs,link:bs,html_inline:Qs,strong:ys,strikethrough:ks,highlight:Js,insert:Fs,subscript:$s,superscript:Ls,emoji:Is,footnote_reference:Xs,math_inline:Bi,reference:vs},n.value));return(s,i)=>(x(),N("em",qQ,[(x(!0),N(Pe,null,nt(e.node.children,(r,l)=>(x(),be(C(sr),{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"]]);xs.install=e=>{e.component(xs.__name,xs)};const jQ={class:"hard-break"},Sl=mn(Ye({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(x(),N("br",jQ))}),[["__scopeId","data-v-50c58f70"]]);Sl.install=e=>{e.component(Sl.__name,Sl)};const $d=Ye({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=pt({checkbox:Zs,checkbox_input:Zs,emoji:Is,emphasis:xs,hardbreak:Sl,highlight:Js,inline_code:rs,insert:Fs,link:bs,reference:vs,strikethrough:ks,strong:ys,subscript:$s,superscript:Ls,text:no}),o=wo(()=>t.customId),s=R(()=>{const i=o.value;return Object.keys(i).length>0?rt(rt({},n),i):n});return(i,r)=>(x(!0),N(Pe,null,nt(e.nodes,(l,a)=>(x(),be(C(sr),{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 Mv(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(Mv)}function Sp(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Mv))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(Mv)?s:null}function Yc(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 VQ=["cite"],KQ={key:0,dir:"auto",class:"paragraph-node"},GQ=["custom-id"],_h=mn(Ye({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=wo(()=>t.customId),o=R(()=>!!n.value.paragraph),s=R(()=>!!n.value.text),i=R(()=>Sp(t.node.children,!o.value)),r=R(()=>t.fade!==!1||s.value?null:Yc(i.value));return In("markstreamShowTooltips",R(()=>t.showTooltips)),In("markstreamFade",R(()=>t.fade)),(l,a)=>(x(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(x(),N("p",KQ,[r.value!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,GQ)):(x(),be(C($d),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(x(),be(C(Os),{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]=c=>l.$emit("copy",c))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,VQ))}}),[["__scopeId","data-v-abfecebc"]]);_h.install=e=>{e.component(_h.__name,_h)};const YQ={class:"definition-list"},ZQ={class:"definition-term"},XQ={class:"definition-desc"},Sh=mn(Ye({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(x(),N("dl",YQ,[(x(!0),N(Pe,null,nt(t.node.items,(s,i)=>(x(),N(Pe,{key:i},[_("dt",ZQ,[re(C(Os),{"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"])]),_("dd",XQ,[re(C(Os),{"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"]]);Sh.install=e=>{e.component(Sh.__name,Sh)};const QQ=["href","title"],rd=mn(Ye({__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)=>(x(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,QQ))}}),[["__scopeId","data-v-e1eb37b6"]]);rd.install=e=>{e.component(rd.__name,rd)};const JQ=["id"],eJ={class:"flex-1"},Ch=Ye({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(x(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",eJ,[re(C(Os),{"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,JQ))}});Ch.install=e=>{e.component(Ch.__name,Ch)};const tJ=["custom-id"],Ev=mn(Ye({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=Ut("markstreamFade",void 0),s=R(()=>o?.value!==!1||n.value.text?null:Yc(t.node.children)),i=R(()=>rt({text:no,inline_code:rs,link:bs,image:_l,strong:ys,emphasis:xs,strikethrough:ks,highlight:Js,insert:Fs,subscript:$s,superscript:Ls,emoji:Is,checkbox:Zs,checkbox_input:Zs,footnote_reference:Xs,hardbreak:Sl,math_inline:Bi,reference:vs},n.value));return(r,l)=>(x(),be(qo(`h${e.node.level}`),bn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ne(()=>[s.value!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(s.value),9,tJ)):(x(!0),N(Pe,{key:1},nt(e.node.children,(a,c)=>(x(),be(C(sr),{key:c,components:i.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${c}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),Cp=Ev;Cp.install=e=>{e.component(Ev.__name,Ev)};const nJ={key:0,dir:"auto",class:"paragraph-node"},oJ=["custom-id"],sJ={dir:"auto",class:"paragraph-node"},iJ=["custom-id"],Bc=mn(Ye({__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=wo(()=>t.customId),s=R(()=>!!o.value.paragraph),i=R(()=>!!o.value.text),r=R(()=>{var h;return Sp((h=n.value)==null?void 0:h.children,!s.value)}),l=R(()=>{var h;if(s.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const g=p[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const b=p.slice(1);if(!b.every(m=>m?.type==="list"))return null;const v=Sp([g]);return v?{paragraphChildren:v,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=R(()=>a()?Yc(r.value):null),u=R(()=>{var h;return a()?Yc((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 In("markstreamShowTooltips",R(()=>t.showTooltips)),In("markstreamFade",R(()=>t.fade)),(h,p)=>{var g,b;return x(),N("li",bn({class:"list-item",dir:"auto"},f.value),[r.value?(x(),N("p",nJ,[c.value!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,oJ)):(x(),be(C($d),{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?(x(),N(Pe,{key:1},[_("p",sJ,[u.value!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,iJ)):(x(),be(C($d),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(x(!0),N(Pe,null,nt(l.value.nestedLists,(v,m)=>(x(),be(C(Os),{key:m,nodes:[v],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${m}`,"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:p[0]||(p[0]=y=>h.$emit("copy",y))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(x(),be(C(Os),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(g=n.value)==null?void 0:g.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=v=>h.$emit("copy",v))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Bc.install=e=>{e.component(Bc.__name,Bc)};const Dc=mn(Ye({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=wo(()=>e.customId),n=R(()=>t.value.list_item||Bc);return(o,s)=>(x(),be(qo(e.node.ordered?"ol":"ul"),{class:We(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ne(()=>[(x(!0),N(Pe,null,nt(e.node.items,(i,r)=>{var l;return x(),be(qo(n.value),bn({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"]]);Dc.install=e=>{e.component(Dc.__name,Dc)};const qM=Symbol("ViewportPriority");function rJ(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:m=>window.setTimeout(()=>m({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:m=>window.clearTimeout(m):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function h(){if(f!=null){try{l?.(f)}catch{}f=null}}function p(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function g(m){const y=u.get(m);if(y){if(!y.visible.value){y.visible.value=!0;try{y.resolve()}catch{}}try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()}}function b(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const m=d.values().next().value;m&&(d.delete(m),g(m),d.size&&b())},{timeout:1200}))}Qe(i,m=>{if(!m){for(const y of Array.from(u.keys()))g(y);h()}},{flush:"sync"});const v=(m,y)=>{const k=Z(!1);let A,$=!1;const L=new Promise(T=>{A=()=>{$||($=!0,T())}}),w=()=>{try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()};if(!s||!i.value)return k.value=!0,A(),{isVisible:k,whenVisible:L,destroy:w};const E=(function(T,F){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(B,W){var z,D,q;return{root:(z=e?.(B??null))!=null?z:null,rootMargin:(D=W?.rootMargin)!=null?D:"300px",threshold:(q=W?.threshold)!=null?q:0}})(T,F);if(a&&(P=S,(I=c)&&I.root===P.root&&I.rootMargin===P.rootMargin&&I.threshold===P.threshold))return a;var I,P;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(B=>{for(const W of B)(W.isIntersecting||W.intersectionRatio>0)&&g(W.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const B of u.keys())a.observe(B);return a})(m,y);return E?(u.set(m,{resolve:A,visible:k}),E.observe(m),d.add(m),b(),{isVisible:k,whenVisible:L,destroy:w}):(k.value=!0,A(),{isVisible:k,whenVisible:L,destroy:w})};return In(qM,v),v}function lJ(){var e,t;const n=Ut(qM,void 0);if(n)return n;const o=new WeakMap;let s=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const h=o.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const h=Z(!1);let p,g=!1;const b=new Promise(y=>{p=()=>{g||(g=!0,y())}}),v=()=>{try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()},m=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(y=>{for(const k of y)(k.isIntersecting||k.intersectionRatio>0)&&u(k.target)},{root:null,rootMargin:"300px",threshold:0}),s));return m?(o.set(f,{resolve:p,visible:h}),m.observe(f),i.add(f),d(),{isVisible:h,whenVisible:b,destroy:v}):(h.value=!0,p(),{isVisible:h,whenVisible:b,destroy:v})}}const aJ={key:2,class:"html-block-node__raw"},cJ=["innerHTML"],uJ={key:1,class:"html-block-node__placeholder"},ld=mn(Ye({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamNestedRendererProps",void 0),s=R(()=>{var $,L;return(L=($=t.htmlPolicy)!=null?$:n?.value)!=null?L:"safe"}),i=R(()=>{var $,L;const w=($=o?.value)!=null?$:{};return Rt(rt({},w),{customId:(L=t.customId)!=null?L:w.customId,htmlPolicy:s.value})}),r=Li({loader:()=>Promise.resolve().then(()=>Sk),suspensible:!1}),l=R(()=>{const $=fv(t.node.attrs,s.value);if(!$)return;const L=bp($);return Object.keys(L).length>0?L:void 0}),a=R(()=>{const $=String(t.node.tag||"").trim(),L=fv(t.node.attrs,s.value,$);if(!L)return;const w=bp(L);return Object.keys(w).length>0?w:void 0}),c=wo(()=>t.customId),u=Ye({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),p=R(()=>Array.isArray(t.node.children)?t.node.children:[]),g=R(()=>String(t.node.tag||"div")),b=R(()=>{const $=g.value.trim().toLowerCase();return T6.has($)||lk($,s.value)}),v=R(()=>p.value.length>0&&!!t.node.tag&&!b.value),m=R(()=>{var $,L,w;if(v.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:($=h.value)!=null?$:""};const E=(L=h.value)!=null?L:t.node.content;if(!E)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Rc(E,s.value)};if(t.node.loading){const F=_p(E,c.value,s.value);return F===null?{mode:"text",content:(w=t.node.raw)!=null?w:E}:{mode:"dynamic",nodes:F}}if(!HM(E,c.value))return{mode:"html",content:Rc(E,s.value)};const T=_p(E,c.value,s.value);return T===null?{mode:"html",content:Rc(E,s.value)}:{mode:"dynamic",nodes:T}}),y=lJ(),k=Z(null),A=!!t.node.loading;return typeof window<"u"?(Qe(d,$=>{var L,w;if((w=(L=k.value)==null?void 0:L.destroy)==null||w.call(L),k.value=null,!A)return f.value=!0,void(h.value=t.node.content);if(!$)return void(f.value=!1);const E=y($,{rootMargin:"400px"});k.value=E,f.value=E.isVisible.value,E.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Qe(()=>t.node.content,$=>{A&&!f.value||(h.value=$)})):f.value=!0,co(()=>{var $,L;(L=($=k.value)==null?void 0:$.destroy)==null||L.call($),k.value=null}),($,L)=>(x(),be(qo(v.value?g.value:"div"),bn({ref_key:"htmlRef",ref:d,class:"html-block-node"},v.value?a.value:void 0),{default:Ne(()=>[f.value?(x(),N(Pe,{key:0},[m.value.mode==="structured"?(x(),be(C(r),bn({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):m.value.mode==="dynamic"?(x(),be(C(u),{key:1,nodes:m.value.nodes},null,8,["nodes"])):m.value.mode==="text"?(x(),N("pre",aJ,O(m.value.content),1)):(x(),N("div",bn({key:3},l.value,{innerHTML:m.value.content}),null,16,cJ))],64)):(x(),N("div",uJ,[Fn($.$slots,"placeholder",{node:e.node},()=>[L[0]||(L[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),L[1]||(L[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),L[2]||(L[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);ld.install=e=>{e.component(ld.__name,ld)};const dJ={dir:"auto",class:"paragraph-node"},fJ=["custom-id"],wa=mn(Ye({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=wo(()=>t.customId),o=Ut("markstreamHtmlPolicy",void 0),s=Ut("markstreamFade",void 0),i=Ut("markstreamParseOptions",void 0),r=Ut("markstreamCustomMarkdownIt",void 0),l=Ut("markstreamNestedRendererProps",void 0),a=R(()=>{var w;return(w=o?.value)!=null?w:"safe"}),c=R(()=>{var w;return(w=t.parseOptions)!=null?w:i?.value}),u=R(()=>{var w;return(w=t.customMarkdownIt)!=null?w:r?.value}),d=R(()=>{var w,E;return(E=t.customHtmlTags)!=null?E:(w=l?.value)==null?void 0:w.customHtmlTags}),f=R(()=>{var w,E;const T=(w=l?.value)!=null?w:{};return Rt(rt({},T),{customId:(E=t.customId)!=null?E:T.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Li({loader:()=>Promise.resolve().then(()=>Sk),suspensible:!1});function p(w){var E;return w.type==="text"&&String((E=w.content)!=null?E:"").trim()===""}const g=R(()=>t.node.children.filter(w=>!p(w))),b=R(()=>g.value.length>0&&g.value.every(w=>w.type==="image"||(function(E){var T;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(I=>!p(I)):[]})(E);return F.length===1&&((T=F[0])==null?void 0:T.type)==="image"})(w))),v=R(()=>new Set(tu(d.value))),m=R(()=>{if(!b.value||g.value.length<=1)return t.node.children;const w=[];for(let E=0;E<t.node.children.length;E++){const T=t.node.children[E];if(!p(T)){w.push(T);continue}const F=w.length>0,S=t.node.children.slice(E+1).some(I=>!p(I));F&&S&&w.push(Rt(rt({},T),{content:" ",raw:" "}))}return w}),y=R(()=>s?.value===!1&&!n.value.text),k=R(()=>y.value?Yc(m.value):null);function A(w,E){return{node:w,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const $=R(()=>rt({inline_code:rs,image:_l,link:bs,hardbreak:Sl,emphasis:xs,strong:ys,strikethrough:ks,highlight:Js,insert:Fs,subscript:$s,superscript:Ls,html_inline:Qs,html_block:ld,emoji:Is,checkbox:Zs,math_inline:Bi,checkbox_input:Zs,reference:vs,footnote_anchor:rd,footnote_reference:Xs,text:no},n.value)),L=R(()=>m.value.map((w,E)=>{var T;const F=(function(S){var I,P,B,W;if(S.type==="html_block"||S.type==="html_inline"){const z=String((I=S.tag)!=null?I:"").trim().toLowerCase()||$6(S.content);if(z&&!v.value.has(z)&&F6((P=S.content)!=null?P:S.raw,z)){const D=String((W=(B=S.content)!=null?B:S.raw)!=null?W:"");return{child:{type:"text",content:D,raw:D},component:no,isCustomComponent:!1}}}return{child:S,component:$.value[S.type],isCustomComponent:!!(n.value[S.type]&&!Gd(String(S.type)))}})(w);return Rt(rt({},F),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:F.isCustomComponent?vk(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((T=F.child.content)!=null?T:""),originalChild:w})}));return(w,E)=>(x(),N("p",dJ,[k.value!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(k.value),9,fJ)):(x(!0),N(Pe,{key:1},nt(L.value,T=>{return x(),N(Pe,{key:T.key},[b.value&&p(T.originalChild)?(x(),N(Pe,{key:0},[Xe(O((F=T.originalChild,String((S=F.content)!=null?S:""))),1)],64)):T.isCustomComponent?(x(),be(qo(T.component),bn({key:1,ref_for:!0},T.customAttrs,{node:T.child,loading:T.child.loading,"index-key":T.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ne(()=>[T.hasSlotChildren?(x(),be(C(h),bn({key:0,ref_for:!0},f.value,{nodes:T.child.children,"index-key":T.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):T.slotContent?(x(),be(C(h),bn({key:1,ref_for:!0},f.value,{content:T.slotContent,final:!T.child.loading,"index-key":`${T.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(x(),be(qo(T.component),bn({key:2,ref_for:!0},A(T.child,T.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);wa.install=e=>{e.component(wa.__name,wa)};const hJ={class:"table-node-wrapper"},pJ=["aria-busy"],mJ={key:0},gJ=["custom-id"],vJ=["aria-label","onPointerdown"],yJ=["custom-id"],kJ={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},ad=mn(Ye({__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 v;return(v=t.node.loading)!=null&&v}),o=R(()=>{var v;return(v=t.node.rows)!=null?v:[]}),s=Z(null),i=Z([]);let r=null;const l=R(()=>t.node.header.cells.length),a=R(()=>i.value.some(v=>Number.isFinite(v)&&v>0)),c=R(()=>a.value?i.value.map(v=>v>0?{width:`${v}px`}:void 0):[]);In("markstreamShowTooltips",R(()=>t.showTooltips)),In("markstreamFade",R(()=>t.fade));const u=wo(()=>t.customId),d=R(()=>!!u.value.text),f=R(()=>!!u.value.paragraph),h=new WeakMap;function p(v){const m=t.fade===!1&&!d.value,y=!f.value,k=h.get(v);if(k?.children===v.children&&k.textFastPath===m&&k.paragraphFastPath===y)return k.info;const A=Sp(v.children,y,!0),$={simpleChildren:A,plainText:A&&m?Yc(A):null};return h.set(v,{children:v.children,textFastPath:m,paragraphFastPath:y,info:$}),$}function g(v){if(!r)return;v.preventDefault();const m=r.startWidth+r.nextStartWidth,y=Math.min(48,Math.floor(m/2)),k=Math.max(y,Math.min(m-y,Math.round(r.startWidth+v.clientX-r.startX))),A=[...r.widths];A[r.index]=k,A[r.index+1]=m-k,i.value=A}function b(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Qe(l,()=>{b(),i.value=[]}),co(b),(v,m)=>(x(),N("div",hJ,[_("table",{ref_key:"tableRef",ref:s,class:We(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(x(),N("colgroup",mJ,[(x(!0),N(Pe,null,nt(e.node.header.cells,(y,k)=>(x(),N("col",{key:k,style:qt(c.value[k])},null,4))),128))])):le("",!0),_("thead",null,[_("tr",null,[(x(!0),N(Pe,null,nt(e.node.header.cells,(y,k)=>(x(),N("th",{key:k,dir:"auto",class:We([y.align==="right"?"text-right":y.align==="center"?"text-center":"text-left"])},[p(y).plainText!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(p(y).plainText),9,gJ)):p(y).simpleChildren?(x(),be(C($d),{key:1,nodes:p(y).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${k}`},null,8,["nodes","custom-id","index-key"])):(x(),be(C(Os),{key:2,nodes:y.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:m[0]||(m[0]=A=>v.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),k<e.node.header.cells.length-1?(x(),N("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${k+1} and ${k+2}`,onPointerdown:A=>(function($,L){if(L.button!==0)return;const w=(function(){var F;const S=(F=s.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],I=>Math.round(I.getBoundingClientRect().width))})(),E=w[$],T=w[$+1];E&&T&&(L.preventDefault(),r={index:$,startX:L.clientX,startWidth:E,nextStartWidth:T,widths:w},i.value=w,window.addEventListener("pointermove",g),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(k,A)},null,40,vJ)):le("",!0)],2))),128))])]),_("tbody",null,[(x(!0),N(Pe,null,nt(o.value,(y,k)=>(x(),N("tr",{key:k},[(x(!0),N(Pe,null,nt(y.cells,(A,$)=>(x(),N("td",{key:$,class:We([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(A).plainText!==null?(x(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(p(A).plainText),9,yJ)):p(A).simpleChildren?(x(),be(C($d),{key:1,nodes:p(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${k}-${$}`},null,8,["nodes","custom-id","index-key"])):(x(),be(C(Os),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:m[1]||(m[1]=L=>v.$emit("copy",L))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,pJ),re(El,{name:"table-node-fade"},{default:Ne(()=>[n.value?(x(),N("div",kJ,[Fn(v.$slots,"loading",{isLoading:n.value},()=>[m[2]||(m[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),m[3]||(m[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):le("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);ad.install=e=>{e.component(ad.__name,ad)};const bJ={class:"hr-node"},Ah=mn({},[["render",function(e,t){return x(),N("hr",bJ)}],["__scopeId","data-v-39b2349c"]]);Ah.install=e=>{e.component(Ah.__name,Ah)};const xJ={class:"unknown-node"},Tv=Ye({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(x(),N("div",xJ,O(e.node.raw),1))}),Mh=mn(Ye({__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=wo(()=>t.customId),s=R(()=>rt({text:no,paragraph:wa,heading:Cp,inline_code:rs,link:bs,image:_l,strong:ys,emphasis:xs,strikethrough:ks,insert:Fs,subscript:$s,superscript:Ls,checkbox:Zs,checkbox_input:Zs,hardbreak:Sl,math_inline:Bi,reference:vs,list:Dc,math_block:UM,table:ad},o.value));return(i,r)=>(x(),N("div",bn({class:n.value},e.node.attrs),[(x(!0),N(Pe,null,nt(e.node.children,(l,a)=>{return x(),be(qo((c=l.type,s.value[c]||Tv)),{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 c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Mh.install=e=>{e.component(Mh.__name,Mh)};const wJ=["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"],RS=[[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 _J(e){if(e<=255)return wJ[e];let t=0,n=RS.length-1;for(;t<=n;){const o=t+n>>1,s=RS[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const SJ=/[ \t\n\r\f]+/g,CJ=/[\t\n\r\f]| {2,}|^ | $/;let W0=null;const AJ=new RegExp("\\p{Script=Arabic}","u"),$m=new RegExp("\\p{M}","u"),jM=new RegExp("\\p{Nd}","u");function BS(e){return AJ.test(e)}function DS(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>=44032&&e<=55215||e>=65280&&e<=65519}function $r(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(DS(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(DS(n))return!0}}return!1}const MJ=new Set([" "," ","⁠","\uFEFF"]);function EJ(e){return $r(e)}function Nv(e){return!(function(t){const n=Ap(t);return n!==null&&(yk.has(n)||Ca.has(n))})(e)&&!(function(t){const n=Ap(t);return n!==null&&MJ.has(n)})(e)}const yk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Fm=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),kk=new Set(["'","’"]),Ca=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),TJ=new Set([":",".","،","؛"]),NJ=new Set(["၏"]),IJ=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function LJ(e){if(bk(e))return!0;let t=!1;for(const n of e)if(Ca.has(n))t=!0;else if(!t||!$m.test(n))return!1;return t}function $J(e){for(const t of e)if(!yk.has(t)&&!Ca.has(t))return!1;return e.length>0}function FJ(e){if(bk(e))return!0;for(const t of e)if(!Fm.has(t)&&!kk.has(t)&&!$m.test(t))return!1;return e.length>0}function bk(e){let t=!1;for(const n of e)if(n!=="\\"&&!$m.test(n)){if(!(Fm.has(n)||Ca.has(n)||kk.has(n)))return!1;t=!0}return t}function VM(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 Ap(e){if(e.length===0)return null;const t=VM(e,e.length);return e.slice(t)}function OJ(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if($m.test(o))n--;else{if(!Fm.has(o)&&!kk.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function RJ(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function PS(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 HS(e,t){return e&&t!==null&&TJ.has(t)}function BJ(e){const t=Ap(e);return t!==null&&NJ.has(t)}function DJ(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 Iv(e){let t=e.length;for(;t>0;){const n=VM(e,t),o=e.slice(n,t);if(IJ.has(o))return!0;if(!Ca.has(o))return!1;t=n}return!1}function PJ(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
272
- `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const HJ=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function di(e){return e.length===1?e[0]:e.join("")}function WJ(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),di(n)}function zJ(e,t,n,o){if(!HJ.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=PJ(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:di(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&s.push({text:di(r),isWordLike:a,kind:i,start:l}),s}function z0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const UJ=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function qJ(e,t){const n=e.texts[t];return!!n.startsWith("www.")||UJ.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function jJ(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const VJ=new Set([":","-","/","×",",",".","+","–","—"]),WS=/^[A-Za-z0-9_]+[,:;]*$/,zS=/[,:;]+$/;function US(e){for(const t of e)if(jM.test(t))return!0;return!1}function Eh(e){if(e.length===0)return!1;for(const t of e)if(!jM.test(t)&&!VJ.has(t))return!1;return!0}function qS(e,t,n){var o,s,i;const r=(W0===null&&(W0=new Intl.Segmenter(void 0,{granularity:"word"})),W0);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],b=[],v=[],m=[],y=[];for(const w of r.segment(e))for(const E of zJ(w.segment,(o=w.isWordLike)!=null&&o,w.index,n)){let T=function(){h[D]!==null&&(c[D]=[PS(a,h,p,D)],h[D]=null),c[D].push(E.text),u[D]=u[D]||E.isWordLike,g[D]=g[D]||I,b[D]=b[D]||P,v[D]=W,m[D]=z,y[D]=HS(b[D],B)};const F=E.kind==="text",S=RJ(E.text,E.isWordLike,E.kind),I=$r(E.text),P=BS(E.text),B=Ap(E.text),W=Iv(E.text),z=BJ(E.text),D=l-1;t.carryCJKAfterClosingQuote&&F&&l>0&&d[D]==="text"&&I&&g[D]&&v[D]||F&&l>0&&d[D]==="text"&&$J(E.text)&&g[D]||F&&l>0&&d[D]==="text"&&m[D]?T():F&&l>0&&d[D]==="text"&&E.isWordLike&&P&&y[D]?(T(),u[D]=!0):S!==null&&l>0&&d[D]==="text"&&h[D]===S?p[D]=((s=p[D])!=null?s:1)+1:F&&!E.isWordLike&&l>0&&d[D]==="text"&&(LJ(E.text)||E.text==="-"&&u[D])?T():(a[l]=E.text,c[l]=[E.text],u[l]=E.isWordLike,d[l]=E.kind,f[l]=E.start,h[l]=S,p[l]=S===null?0:1,g[l]=I,b[l]=P,v[l]=W,m[l]=z,y[l]=HS(P,B),l++)}for(let w=0;w<l;w++)h[w]===null?a[w]=di(c[w]):a[w]=PS(a,h,p,w);for(let w=1;w<l;w++)d[w]==="text"&&!u[w]&&bk(a[w])&&d[w-1]==="text"&&(a[w-1]+=a[w],u[w-1]=u[w-1]||u[w],a[w]="");const k=Array.from({length:l},()=>null);let A=-1;for(let w=l-1;w>=0;w--){const E=a[w];if(E.length!==0){if(d[w]==="text"&&!u[w]&&FJ(E)&&A>=0&&d[A]==="text"){const T=(i=k[A])!=null?i:[];T.push(E),k[A]=T,f[A]=f[w],a[w]="";continue}A=w}}for(let w=0;w<l;w++){const E=k[w];E!=null&&(a[w]=WJ(E,a[w]))}let $=0;for(let w=0;w<l;w++){const E=a[w];E.length!==0&&($!==w&&(a[$]=E,u[$]=u[w],d[$]=d[w],f[$]=f[w]),$++)}a.length=$,u.length=$,d.length=$,f.length=$;const L=(function(w){const E=w.texts.slice(),T=w.isWordLike.slice(),F=w.kinds.slice(),S=w.starts.slice();for(let I=0;I<E.length-1;I++){if(F[I]!=="text"||F[I+1]!=="text"||!$r(E[I])||!$r(E[I+1]))continue;const P=OJ(E[I]);P!==null&&(E[I]=P.head,E[I+1]=P.tail+E[I+1],S[I+1]=S[I]+P.head.length)}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=[],T=[],F=[],S=[];for(let I=0;I<w.len;I++){const P=w.texts[I],B=w.kinds[I],W=w.isWordLike[I];if(B==="text"&&W&&WS.test(P)){const z=[P];let D=zS.test(P),q=I+1;for(;D&&q<w.len&&w.kinds[q]==="text"&&w.isWordLike[q]&&WS.test(w.texts[q]);){const j=w.texts[q];z.push(j),D=zS.test(j),q++}E.push(di(z)),T.push(!0),F.push("text"),S.push(w.starts[I]),I=q-1;continue}E.push(P),T.push(W),F.push(B),S.push(w.starts[I])}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=[],T=[],F=[],S=[];for(let I=0;I<w.len;I++){const P=w.texts[I];if(w.kinds[I]==="text"&&P.includes("-")){const B=P.split("-");let W=B.length>1;for(let z=0;z<B.length;z++){const D=B[z];if(!W)break;D.length!==0&&US(D)&&Eh(D)||(W=!1)}if(W){let z=0;for(let D=0;D<B.length;D++){const q=B[D],j=D<B.length-1?`${q}-`:q;E.push(j),T.push(!0),F.push("text"),S.push(w.starts[I]+z),z+=j.length}continue}}E.push(P),T.push(w.isWordLike[I]),F.push(w.kinds[I]),S.push(w.starts[I])}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=[],T=[],F=[],S=[];for(let I=0;I<w.len;I++){const P=w.texts[I],B=w.kinds[I];if(B==="text"&&Eh(P)&&US(P)){const W=[P];let z=I+1;for(;z<w.len&&w.kinds[z]==="text"&&Eh(w.texts[z]);)W.push(w.texts[z]),z++;E.push(di(W)),T.push(!0),F.push("text"),S.push(w.starts[I]),I=z-1;continue}E.push(P),T.push(w.isWordLike[I]),F.push(B),S.push(w.starts[I])}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=[],T=[],F=[],S=[];for(let I=0;I<w.len;I++){const P=w.texts[I];if(E.push(P),T.push(w.isWordLike[I]),F.push(w.kinds[I]),S.push(w.starts[I]),!jJ(P))continue;const B=I+1;if(B>=w.len||z0(w.kinds[B]))continue;const W=[],z=w.starts[B];let D=B;for(;D<w.len&&!z0(w.kinds[D]);)W.push(w.texts[D]),D++;W.length>0&&(E.push(di(W)),T.push(!0),F.push("text"),S.push(z),I=D-1)}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=w.texts.slice(),T=w.isWordLike.slice(),F=w.kinds.slice(),S=w.starts.slice();for(let P=0;P<w.len;P++){if(F[P]!=="text"||!qJ(w,P))continue;const B=[E[P]];let W=P+1;for(;W<w.len&&!z0(F[W]);){B.push(E[W]),T[P]=!0;const z=E[W].includes("?");if(F[W]="text",E[W]="",W++,z)break}E[P]=di(B)}let I=0;for(let P=0;P<E.length;P++){const B=E[P];B.length!==0&&(I!==P&&(E[I]=B,T[I]=T[P],F[I]=F[P],S[I]=S[P]),I++)}return E.length=I,T.length=I,F.length=I,S.length=I,{len:I,texts:E,isWordLike:T,kinds:F,starts:S}})((function(w){const E=[],T=[],F=[],S=[];let I=0;for(;I<w.len;){const P=[w.texts[I]];let B=w.isWordLike[I],W=w.kinds[I],z=w.starts[I];if(W==="glue"){const D=[P[0]],q=z;for(I++;I<w.len&&w.kinds[I]==="glue";)D.push(w.texts[I]),I++;const j=di(D);if(!(I<w.len&&w.kinds[I]==="text")){E.push(j),T.push(!1),F.push("glue"),S.push(q);continue}P[0]=j,P.push(w.texts[I]),B=w.isWordLike[I],W="text",z=q,I++}else I++;if(W==="text")for(;I<w.len&&w.kinds[I]==="glue";){const D=[];for(;I<w.len&&w.kinds[I]==="glue";)D.push(w.texts[I]),I++;const q=di(D);I<w.len&&w.kinds[I]==="text"?(P.push(q,w.texts[I]),B=B||w.isWordLike[I],I++):P.push(q)}E.push(di(P)),T.push(B),F.push(W),S.push(z)}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})({len:$,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let w=0;w<L.len-1;w++){const E=DJ(L.texts[w]);E!==null&&(L.kinds[w]!=="space"&&L.kinds[w]!=="preserved-space"||L.kinds[w+1]!=="text"||!BS(L.texts[w+1])||(L.texts[w]=E.space,L.isWordLike[w]=!1,L.kinds[w]=L.kinds[w]==="preserved-space"?"preserved-space":"space",L.texts[w+1]=E.marks+L.texts[w+1],L.starts[w+1]=L.starts[w]+E.space.length))}return L}function KJ(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}let tc=null;const jS=new Map;let nc=null;const GJ=new RegExp("\\p{Emoji_Presentation}","u"),YJ=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let U0=null;const VS=new Map;function Lv(){if(tc!==null)return tc;if(typeof OffscreenCanvas<"u")return tc=new OffscreenCanvas(1,1).getContext("2d"),tc;if(typeof document<"u")return tc=document.createElement("canvas").getContext("2d"),tc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function sl(e,t){let n=t.get(e);return n===void 0&&(n={width:Lv().measureText(e).width,containsCJK:$r(e)},t.set(e,n)),n}function Om(){if(nc!==null)return nc;if(typeof navigator>"u")return nc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},nc;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 nc={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},nc}function KM(){return U0===null&&(U0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),U0}function ZJ(e){return GJ.test(e)||e.includes("️")}function oa(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=KM();for(const a of l.segment(i))ZJ(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function XJ(e,t){for(;t<e.widths.length;){const n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function QJ(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function KS(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i}=e;if(o.length===0)return 0;const r=t+Om().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(k=u,A=d,$=a){l++,a=0,c=!1,f=-1,h=0}function g(k,A){c=!0,u=k+1,d=0,a=A}function b(k,A,$){c=!0,u=k,d=A+1,a=$}function v(k,A){c?(a+=A,u=k+1,d=0):g(k,A)}function m(k,A){const $=i[k];for(let L=A;L<$.length;L++){const w=$[L];c?a+w>r?(p(),b(k,L,w)):(a+=w,u=k,d=L+1):b(k,L,w)}c&&u===k&&d===$.length&&(u=k+1,d=0)}let y=0;for(;y<o.length&&(c||(y=XJ(e,y),!(y>=o.length)));){const k=o[y],A=s[y],$=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+k>r){if($){v(y,k),p(y+1,0,a-k),y++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(k>t&&i[y]!==null){p(),m(y,0),y++;continue}p()}else v(y,k),$&&(f=y+1,h=a-k),y++;else k>t&&i[y]!==null?m(y,0):g(y,k),$&&(f=y+1,h=a-k),y++}return c&&p(),l}let q0=null;function JJ(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 c(d,f,h){o=[d],s=f,i=h,r=Iv(d),l=Fm.has(d)}function u(d,f){o.push(d),i=i||f;const h=Iv(d);r=d.length===1&&Ca.has(d)&&r||h,l=!1}for(const d of(q0===null&&(q0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),q0).segment(e)){const f=d.segment,h=$r(f);o.length!==0?l||yk.has(f)||Ca.has(f)||t.carryCJKAfterClosingQuote&&h&&r?u(f,h):i||h?(a(),c(f,d.index,h)):u(f,h):c(f,d.index,h)}return a(),n}function eee(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=$r(e[0].text),i=Nv(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:o})}for(let l=1;l<e.length;l++){const a=e[l],c=$r(a.text),u=Nv(a.text);s&&i?(n.push(a.text),s=s||c,i=u):(r(),n=[a.text],o=a.start,s=c,i=u)}return r(),t}function tee(e,t,n,o){const s=Om(),{cache:i,emojiCorrection:r}=(function(L,w){Lv().font=L;const E=(function(S){let I=jS.get(S);return I||(I=new Map,jS.set(S,I)),I})(L),T=(function(S){const I=S.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})(L),F=w?(function(S,I){let P=VS.get(S);if(P!==void 0)return P;const B=Lv();B.font=S;const W=B.measureText("😀").width;if(P=0,W>I+.5&&typeof document<"u"&&document.body!==null){const z=document.createElement("span");z.style.font=S,z.style.display="inline-block",z.style.visibility="hidden",z.style.position="absolute",z.textContent="😀",document.body.appendChild(z);const D=z.getBoundingClientRect().width;document.body.removeChild(z),W-D>.5&&(P=W-D)}return VS.set(S,P),P})(L,T):0;return{cache:E,fontSize:T,emojiCorrection:F}})(t,(l=e.normalized,YJ.test(l)));var l;const a=oa("-",sl("-",i),r),c=8*oa(" ",sl(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],h=[];let p=e.chunks.length<=1;const g=null,b=[],v=n?[]:null,m=Array.from({length:e.len});function y(L,w,E,T,F,S,I){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(p=!1),u.push(w),d.push(E),f.push(T),h.push(F),b.push(I),v!==null&&v.push(L)}function k(L,w,E,T,F){const S=sl(L,i),I=oa(L,S,r),P=w==="space"||w==="preserved-space"||w==="zero-width-break"?0:I,B=w==="space"||w==="zero-width-break"?0:I;if(F&&T&&L.length>1){let W="sum-graphemes";Eh(L)?W="pair-context":s.preferPrefixWidthsForBreakableRuns&&(W="segment-prefixes");const z=(function(D,q,j,ie,ue){if(q.breakableFitAdvances!==void 0)return q.breakableFitAdvances;const pe=KM(),ee=[];for(const $e of pe.segment(D))ee.push($e.segment);if(ee.length<=1)return q.breakableFitAdvances=null,q.breakableFitAdvances;if(ue==="sum-graphemes"){const $e=[];for(const ae of ee){const U=sl(ae,j);$e.push(oa(ae,U,ie))}return q.breakableFitAdvances=$e,q.breakableFitAdvances}if(ue==="pair-context"||ee.length>96){const $e=[];let ae=null,U=0;for(const ce of ee){const se=oa(ce,sl(ce,j),ie);if(ae===null)$e.push(se);else{const V=ae+ce,Q=sl(V,j);$e.push(oa(V,Q,ie)-U)}ae=ce,U=se}return q.breakableFitAdvances=$e,q.breakableFitAdvances}const ne=[];let fe="",Me=0;for(const $e of ee){fe+=$e;const ae=oa(fe,sl(fe,j),ie);ne.push(ae-Me),Me=ae}return q.breakableFitAdvances=ne,q.breakableFitAdvances})(L,S,i,r,W);return void y(L,I,P,B,w,E,z)}y(L,I,P,B,w,E,null)}for(let L=0;L<e.len;L++){m[L]=u.length;const w=e.texts[L],E=e.isWordLike[L],T=e.kinds[L],F=e.starts[L];if(T==="soft-hyphen"){y(w,0,a,a,T,F,null);continue}if(T==="hard-break"){y(w,0,0,0,T,F,null);continue}if(T==="tab"){y(w,0,0,0,T,F,null);continue}const S=sl(w,i);if(T==="text"&&S.containsCJK){const I=JJ(w,s),P=o==="keep-all"?eee(I):I;for(let B=0;B<P.length;B++){const W=P[B];k(W.text,"text",F+W.start,E,o==="keep-all"||!$r(W.text))}continue}k(w,T,F,E,!0)}const A=(function(L,w,E){const T=[];for(let F=0;F<L.length;F++){const S=L[F],I=S.startSegmentIndex<w.length?w[S.startSegmentIndex]:E,P=S.endSegmentIndex<w.length?w[S.endSegmentIndex]:E,B=S.consumedEndSegmentIndex<w.length?w[S.consumedEndSegmentIndex]:E;T.push({startSegmentIndex:I,endSegmentIndex:P,consumedEndSegmentIndex:B})}return T})(e.chunks,m,u.length),$=g===null?null:(function(L,w){const E=(function(F){const S=F.length;if(S===0)return null;const I=new Array(S);let P=!1;for(let j=0;j<S;){const ie=F.charCodeAt(j);let ue=ie,pe=1;if(ie>=55296&&ie<=56319&&j+1<S){const ne=F.charCodeAt(j+1);ne>=56320&&ne<=57343&&(ue=ne-56320+(ie-55296<<10)+65536,pe=2)}const ee=_J(ue);ee!=="R"&&ee!=="AL"&&ee!=="AN"||(P=!0);for(let ne=0;ne<pe;ne++)I[j+ne]=ee;j+=pe}if(!P)return null;let B=0;for(let j=0;j<S;j++){const ie=I[j];if(ie==="L"){B=0;break}if(ie==="R"||ie==="AL"){B=1;break}}const W=new Int8Array(S);for(let j=0;j<S;j++)W[j]=B;const z=1&B?"R":"L",D=z;let q=D;for(let j=0;j<S;j++)I[j]==="NSM"?I[j]=q:q=I[j];q=D;for(let j=0;j<S;j++){const ie=I[j];ie==="EN"?I[j]=q==="AL"?"AN":"EN":ie!=="R"&&ie!=="L"&&ie!=="AL"||(q=ie)}for(let j=0;j<S;j++)I[j]==="AL"&&(I[j]="R");for(let j=1;j<S-1;j++)I[j]==="ES"&&I[j-1]==="EN"&&I[j+1]==="EN"&&(I[j]="EN"),I[j]!=="CS"||I[j-1]!=="EN"&&I[j-1]!=="AN"||I[j+1]!==I[j-1]||(I[j]=I[j-1]);for(let j=0;j<S;j++){if(I[j]!=="EN")continue;let ie;for(ie=j-1;ie>=0&&I[ie]==="ET";ie--)I[ie]="EN";for(ie=j+1;ie<S&&I[ie]==="ET";ie++)I[ie]="EN"}for(let j=0;j<S;j++){const ie=I[j];ie!=="WS"&&ie!=="ES"&&ie!=="ET"&&ie!=="CS"||(I[j]="ON")}q=D;for(let j=0;j<S;j++){const ie=I[j];ie==="EN"?I[j]=q==="L"?"L":"EN":ie!=="R"&&ie!=="L"||(q=ie)}for(let j=0;j<S;j++){if(I[j]!=="ON")continue;let ie=j+1;for(;ie<S&&I[ie]==="ON";)ie++;const ue=(j>0?I[j-1]:D)!=="L"?"R":"L";if(ue===((ie<S?I[ie]:D)!=="L"?"R":"L"))for(let pe=j;pe<ie;pe++)I[pe]=ue;j=ie-1}for(let j=0;j<S;j++)I[j]==="ON"&&(I[j]=z);for(let j=0;j<S;j++){const ie=I[j];1&W[j]?ie!=="L"&&ie!=="AN"&&ie!=="EN"||W[j]++:ie==="R"?W[j]++:ie!=="AN"&&ie!=="EN"||(W[j]+=2)}return W})(L);if(E===null)return null;const T=new Int8Array(w.length);for(let F=0;F<w.length;F++)T[F]=E[w[F]];return T})(e.normalized,g);return v!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:$,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A,segments:v}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:$,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A}}function nee(e,t,n){return(function(o,s,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return tee((function(c,u,d="normal",f="normal"){const h=(function(b){const v=b??"normal";return v==="pre-wrap"?{mode:v,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:v,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(b){return/[\r\f]/.test(b)?b.replace(/\r\n/g,`
273
- `).replace(/[\r\f]/g,`
274
- `):b.replace(/\r\n/g,`
275
- `)})(c):(function(b){if(!CJ.test(b))return b;let v=b.replace(SJ," ");return v.charCodeAt(0)===32&&(v=v.slice(1)),v.length>0&&v.charCodeAt(v.length-1)===32&&(v=v.slice(0,-1)),v})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const g=f==="keep-all"?(function(b){if(b.len<=1)return b;const v=[],m=[],y=[],k=[];let A=null,$=!1,L=0,w=!1,E=!1;function T(){A!==null&&(v.push(di(A)),m.push($),y.push("text"),k.push(L),A=null)}for(let F=0;F<b.len;F++){const S=b.texts[F],I=b.kinds[F],P=b.isWordLike[F],B=b.starts[F];if(I==="text"){const W=EJ(S),z=Nv(S);if(A!==null&&w&&E){A.push(S),$=$||P,w=w||W,E=z;continue}T(),A=[S],$=P,L=B,w=W,E=z;continue}T(),v.push(S),m.push(P),y.push(I),k.push(B)}return T(),{len:v.length,texts:v,isWordLike:m,kinds:y,starts:k}})(qS(p,u,h)):qS(p,u,h);return rt({normalized:p,chunks:KJ(g,h)},g)})(o,Om(),r?.whiteSpace,a),s,!1,a)})(e,t,0,n)}const j0="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Eo=(()=>{const e=globalThis;if(e[j0])return e[j0];const t={configs:{},controllers:{},revision:Ia(0),preparedCache:new Map,blockEstimateCache:new Map};return e[j0]=t,t})();let Lu=null;const GS=Eo.revision;function YS(e){var t;return e&&(t=Eo.configs[e])!=null?t:null}function ZS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function oee(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function V0(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!oee(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+=`
276
- `)}return s.length>0?s:null}function K0(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(Lu!=null)return Lu;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Lu=!!((i=r.getContext)!=null&&i.call(r,"2d")),Lu}catch{return Lu=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Eo.blockEstimateCache.get(r);if(l)return Eo.blockEstimateCache.delete(r),Eo.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(h,p,g){const b=`${g}\0${p}\0${h}`,v=Eo.preparedCache.get(b);if(v)return Eo.preparedCache.delete(b),Eo.preparedCache.set(b,v),v.prepared;const m=nee(h,p,{whiteSpace:g});for(Eo.preparedCache.set(b,{prepared:m});Eo.preparedCache.size>240;){const y=Eo.preparedCache.keys().next().value;if(!y)break;Eo.preparedCache.delete(y)}return m})(e,n.font,a),u=(function(h,p,g){const b=(function(v,m){return v.simpleLineWalkFastPath?KS(v,m):(function(y,k){if(y.simpleLineWalkFastPath)return KS(y,k);const{widths:A,lineEndFitAdvances:$,lineEndPaintAdvances:L,kinds:w,breakableFitAdvances:E,discretionaryHyphenWidth:T,tabStopAdvance:F,chunks:S}=y;if(A.length===0||S.length===0)return 0;const I=Om(),P=I.lineFitEpsilon,B=k+P;let W=0,z=0,D=!1,q=0,j=0,ie=-1,ue=0,pe=0,ee=null;function ne(){ie=-1,ue=0,pe=0,ee=null}function fe(Q=q,ke=j,he=z){W++,z=0,D=!1,ne()}function Me(Q,ke){D=!0,q=Q+1,j=0,z=ke}function $e(Q,ke,he){D=!0,q=Q,j=ke+1,z=he}function ae(Q,ke){D?(z+=ke,q=Q+1,j=0):Me(Q,ke)}function U(Q,ke,he,ye){if(!ke)return;const K=Q==="tab"?0:$[he],J=Q==="tab"?ye:L[he];ie=he+1,ue=z-ye+K,pe=z-ye+J,ee=Q}function ce(Q,ke){const he=E[Q];for(let ye=ke;ye<he.length;ye++){const K=he[ye];D?z+K>B?(fe(),$e(Q,ye,K)):(z+=K,q=Q,j=ye+1):$e(Q,ye,K)}D&&q===Q&&j===he.length&&(q=Q+1,j=0)}function se(Q){if(ee!=="soft-hyphen")return!1;const ke=E[Q];if(ke==null)return!1;const{fitCount:he,fittedWidth:ye}=(function(K,J,me,Ee,Fe){let De=0,ge=J;for(;De<K.length;){const Ie=ge+K[De];if((De+1<K.length?Ie+Fe:Ie)>me+Ee)break;ge=Ie,De++}return{fitCount:De,fittedWidth:ge}})(ke,z,k,P,T);return he!==0&&(z=ye,q=Q,j=he,ne(),he===ke.length?(q=Q+1,j=0,!0):(fe(Q,he,ye+T),ce(Q,he),!0))}function V(Q){W++,ne()}for(let Q=0;Q<S.length;Q++){const ke=S[Q];if(ke.startSegmentIndex===ke.endSegmentIndex){V();continue}D=!1,z=0,ke.startSegmentIndex,q=ke.startSegmentIndex,j=0,ne();let he=ke.startSegmentIndex;for(;he<ke.endSegmentIndex;){const ye=w[he],K=ye==="space"||ye==="preserved-space"||ye==="tab"||ye==="zero-width-break"||ye==="soft-hyphen",J=ye==="tab"?QJ(z,F):A[he];if(ye!=="soft-hyphen")if(D){if(z+J>B){const me=z+(ye==="tab"?0:$[he]),Ee=z+(ye==="tab"?J:L[he]);if(ee==="soft-hyphen"&&I.preferEarlySoftHyphenBreak&&ue<=B){fe(ie,0,pe);continue}if(ee==="soft-hyphen"&&se(he)){he++;continue}if(K&&me<=B){ae(he,J),fe(he+1,0,Ee),he++;continue}if(ie>=0&&ue<=B){if(q>ie||q===ie&&j>0){fe();continue}const Fe=ie;fe(Fe,0,pe),he=Fe;continue}if(J>k&&E[he]!==null){fe(),ce(he,0),he++;continue}fe();continue}ae(he,J),U(ye,K,he,J),he++}else J>k&&E[he]!==null?ce(he,0):Me(he,J),U(ye,K,he,J),he++;else D&&(q=he+1,j=0,ie=he+1,ue=z+T,pe=z+T,ee=ye),he++}if(D){const ye=ie===ke.consumedEndSegmentIndex?pe:z;fe(ke.consumedEndSegmentIndex,0,ye)}}return W})(v,m)})(h,p);return{lineCount:b,height:b*g}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Eo.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Eo.blockEstimateCache.size>4e3;){const h=Eo.blockEstimateCache.keys().next().value;if(!h)break;Eo.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function GM(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=V0(e.children);return i&&n.paragraph?K0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=V0(e.children),l=n.headings[i];return r&&l?K0(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((o=i[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const r=V0((s=i[0])==null?void 0:s.children);return r?K0(r,t,n.listItem):null}if(e.type==="list"){const i=Array.isArray(e.items)?e.items:[];if(!i.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of i){const a=GM(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function Xf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function see(e,t){var n;if(!e||e.type!=="code_block")return null;const o=t.rendererKind,s=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(Xf(String((d=u.originalCode)!=null?d:"")),Xf(String((f=u.updatedCode)!=null?f:"")),Xf(String((h=u.code)!=null?h:""))):Xf((function(p,g){const b=String(p??"");return g?b:b.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(o==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const g=typeof h?.fontSize=="number"&&h.fontSize>0?h.fontSize:p?13:12;return typeof h?.lineHeight=="number"&&h.lineHeight>0?h.lineHeight:p?30:Math.round(1.5*g)})(u,r),f=(function(h,p){var g,b;if(!p)return 0;const v=typeof((g=h?.padding)==null?void 0:g.top)=="number"?h.padding.top:10,m=typeof((b=h?.padding)==null?void 0:b.bottom)=="number"?h.padding.bottom:22;return Math.max(0,v)+Math.max(0,m)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else o==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(s?40:0)),contentHeight:c,rendererKind:o}}function iee(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function G0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=ZS(o.lineHeight,1.5*ZS(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:iee(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const ree=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function XS(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))ree.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const lee=!1;function c_e(){return lee}function QS(e,t,n,o){var s;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!o.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=o.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const YM=Symbol("MarkstreamMathBlockMinHeightCache");function u_e(){return Ut(YM,null)}const aee=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],cee=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],uee=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),ZM=["raw","content","code","originalCode","updatedCode"],JS=new WeakMap,eC=new WeakMap;let dee=1;function Ti(){return typeof performance<"u"?performance.now():Date.now()}function tC(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function gi(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=JS.get(t);return n||(n=dee++,JS.set(t,n)),String(n)}function nC(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:gi(t),customMarkdownIt:gi(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:gi(e.validateLink),preTransformTokens:gi(e.preTransformTokens),postTransformTokens:gi(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function oC(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
277
- `,t-1)+1;return e.slice(n,t).trim()}function sC(e){const t=XM(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function XM(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function QM(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 xk(e){const t=String(e??"");return`${t.length}:${QM(t)}`}function $v(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?xk(r):`${r.length}:${QM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${gi(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:${gi(o)}`;const i=gi(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>$v(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(c=>`${c}:${$v(r[c],t,n+1)}`).join(";")}`}return typeof e}function Mp(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function JM(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>Mp(o)?$l(o,t,n+1):JM(o,t,n+1)).join(",")}`:Mp(e)?$l(e,t,n):$v(e,t,n)}function fee(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!ZM.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${xk(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${gi(s)}`:uee.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${JM(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${gi(s)}`:""}).filter(Boolean).join(";")}function hee(e){return ZM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${xk(n)}`:""}).filter(Boolean).join(";")}function $l(e,t=new WeakMap,n=0){const o=eC.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}:${gi(s)}`;const r=gi(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>$l(p,c,u+1)).join("|"):"";return[a.type,hee(d),fee(d,c,u),f.length,h].join(":")})(e,t,n);return eC.set(s,l),l}function e5(e,t){return $l(e)===$l(t)}function wk(e,t,n){const o=Ti(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ti()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function iC(e,t,n){return wk(t,n,()=>$l(e))}function t5(e,t,n){return iC(e,n,"stabilizeSignatureMs")===iC(t,n,"stabilizeSignatureMs")}function Y0(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function rC(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function pee(e,t){return e.length===t.length&&e===t}function _k(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(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])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"||!pee(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,c=s.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!Mp(d)||!Mp(f))return null;const h=_k(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function mee(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=_k(e,t);return n??e5(e,t)}function gee(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return wk(n,"stabilizeSignatureMs",()=>{o=_k(e,t)}),o??t5(e,t,n)}function vee(e,t){const n={};for(const o of aee){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function yee(e,t){var n;const o=uS(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:R(()=>!1),r=Z(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=Ti();function g(){l&&(clearTimeout(l),l=void 0)}function b(){g();const E=t.renderContent.value;r.value!==E&&(r.value=E),p=Ti()}Qe([t.renderContent,t.effectiveFinal,i],([E,T,F])=>{r.value!==E&&(!F||T||(function(S,I){if(!S&&I||I.length<=80||I.length<S.length||!I.startsWith(S))return!0;const P=I.slice(S.length);return!!P&&(!!sC(oC(I))||!(!P.includes(`
278
-
279
- `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(P))||P.endsWith(`
280
- `)&&!(function(B){const W=oC(B);if(sC(W))return!1;const z=XM(W);return z.length>=2&&z.some(D=>D.trim())})(I))})(r.value,E)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(I){const P=I.parseCoalesceMs;return typeof P=="number"&&Number.isFinite(P)&&P>=0?P:80})(e)-(Ti()-p));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),iy(g);const v=R(()=>{var E,T,F,S;return BV(e.customHtmlTags,(E=e.parseOptions)==null?void 0:E.customHtmlTags,(S=(F=(T=t.customComponentsMap)==null?void 0:T.value)!=null?F:{},Object.entries(S).map(([I,P])=>{const B=wi(I);return P==null||!B||Gd(B)||E6.has(B)||jd.has(B)?"":B}).filter(Boolean)))}),m=R(()=>{const{key:E,tags:T}=DV(v.value);if(!E)return o;const F=s.get(E);if(F)return F;const S=uS(t.instanceMsgId,{customHtmlTags:T});return s.set(E,S),S}),y=R(()=>{const E=m.value;return e.customMarkdownIt?e.customMarkdownIt(E):E}),k=R(()=>{var E,T;const F=(E=e.parseOptions)!=null?E:{},S=t.effectiveFinal.value,I=v.value,P=S!=null,B=I.length>0;return P||B||F.streamParse==null?rt(rt(Rt(rt({},F),{streamParse:(T=F.streamParse)==null||T}),P?{final:S}:{}),B?{customHtmlTags:I}:{}):F}),A=R(()=>{var E;return new Set(((E=k.value.customHtmlTags)!=null?E:[]).map(T=>String(T).trim().toLowerCase()).filter(Boolean))}),$=R(()=>nC(k.value,y.value,e.customMarkdownIt,{includeFinal:!0})),L=R(()=>nC(k.value,y.value,e.customMarkdownIt,{includeFinal:!1}));Qe([$,L],([E,T],[F,S])=>{F&&(E===F&&T===S||(b(),T!==S&&(a=[],d="")))},{flush:"sync"});const w=R(()=>{var E,T,F,S,I,P,B,W;if((E=e.nodes)!=null&&E.length)return a=[],d="",pt(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const D=t.debugPerformanceEnabled.value,q=D?Ti():0,j=y.value,ie=$.value,ue=L.value;c&&ie!==c&&(function(ke){var he,ye;(ye=(he=ke.stream)==null?void 0:he.reset)==null||ye.call(he)})(j),u&&ue!==u&&(a=[],d="");const pe=a.length>0&&z.startsWith(d)&&ue===u,ee=D?tC(j):null,ne=D?{}:void 0,fe=ne?Rt(rt({},k.value),{__timing:ne}):k.value,Me=gM(z,j,fe),$e=D?Ti():0,ae=D?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let U,ce=D?Y0(Me.length):void 0,se=0,V=0;if(pe){const ke=D?Ti():0;if(ae){const he=(function(ye,K,J){if(!K.length)return{nodes:ye,metrics:Y0(ye.length)};const me=(function(De,ge,Ie){const Je=Math.min(De.length,ge.length);for(let it=0;it<Je;it++)if(!gee(ge[it],De[it],Ie))return it;return De.length===ge.length?-1:Je})(ye,K,J);if(me<0)return{nodes:K,metrics:{reusedNodeCount:ye.length,dirtyStartIndex:me,stablePrefixNodeCount:ye.length,dirtyTailNodeCount:0}};const Ee=ye.slice();let Fe=me;for(let De=0;De<me;De++)Ee[De]=K[De];for(let De=me;De<ye.length;De++){const ge=K[De],Ie=ye[De];ge&&t5(ge,Ie,J)&&(Ee[De]=ge,Fe+=1)}return{nodes:Ee,metrics:{reusedNodeCount:Fe,dirtyStartIndex:me,stablePrefixNodeCount:me,dirtyTailNodeCount:rC(me,ye,K)}}})(Me,a,ae);U=he.nodes,ce=he.metrics}else{const he=(function(ye,K){if(!K.length)return{nodes:ye,metrics:Y0(ye.length)};const J=(function(Fe,De){const ge=Math.min(Fe.length,De.length);for(let Ie=0;Ie<ge;Ie++)if(!mee(De[Ie],Fe[Ie]))return Ie;return Fe.length===De.length?-1:ge})(ye,K);if(J<0)return{nodes:K,metrics:{reusedNodeCount:ye.length,dirtyStartIndex:J,stablePrefixNodeCount:ye.length,dirtyTailNodeCount:0}};const me=ye.slice();let Ee=J;for(let Fe=0;Fe<J;Fe++)me[Fe]=K[Fe];for(let Fe=J;Fe<ye.length;Fe++){const De=K[Fe],ge=ye[Fe];De&&e5(De,ge)&&(me[Fe]=De,Ee+=1)}return{nodes:me,metrics:{reusedNodeCount:Ee,dirtyStartIndex:J,stablePrefixNodeCount:J,dirtyTailNodeCount:rC(J,ye,K)}}})(Me,a);U=he.nodes,ce=he.metrics}se=D?Ti()-ke:0,V=ce?.dirtyStartIndex==null||ce.dirtyStartIndex<0?U.length:ce.dirtyStartIndex}else U=Me;ae?(function(ke,he,ye=0){for(let K=Math.max(0,ye);K<ke.length;K++)wk(he,"primeSignatureMs",()=>$l(ke[K]))})(U,ae,V):(function(ke,he=0){for(let ye=Math.max(0,he);ye<ke.length;ye++)$l(ke[ye])})(U,V);const Q=D?Ti()-$e:0;if(f+=1,d=z,c=ie,u=ue,a=U,D){const ke=tC(j),he=typeof ke?.total=="number"&&ke.total>((T=ee?.total)!=null?T:0);t.logPerf(he?"parse(stream)":"parse(sync)",rt(rt(rt({rendererId:t.instanceMsgId,ms:Math.round(Ti()-q),nodes:U.length,contentLength:z.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:Q,signatureMs:(F=ae?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=ae?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(I=ae?.primeSignatureMs)!=null?I:0,signatureCallCount:(P=ae?.signatureCallCount)!=null?P:0,stabilizeSignatureCallCount:(B=ae?.stabilizeSignatureCallCount)!=null?B:0,primeSignatureCallCount:(W=ae?.primeSignatureCallCount)!=null?W:0,stabilizeMs:se},ce??{}),ne?Object.fromEntries(cee.map(ye=>{var K;return[ye,(K=ne[ye])!=null?K:0]})):{}),ke?{streamMode:ke.lastMode,streamDelta:vee(ke,ee),streamStats:ke}:{}))}return pt(U)});return{effectiveCustomHtmlTags:v,effectiveCustomHtmlTagsSet:A,mdBase:m,mdInstance:y,mergedParseOptions:k,parsedNodes:w}}function kee(e){const{isClient:t}=e,n=Z(new Set),o=new Map,s=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((g=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!g)return;var p,g;const b=n.value,v=b.has(f);if(h){if(v)return;const y=new Set(b);return y.add(f),void(n.value=y)}if(!v)return;const m=new Set(b);m.delete(f),n.value=m})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of s.entries())f<c||(h(),s.delete(f));for(const[f,h]of o.entries())f<c||(h.destroy(),o.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function bee(e={}){const t=Z(""),n=Z(""),o=Z(!1),s=xX(e),i=()=>{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},r=s.subscribe(i);i();const l=R(()=>Math.max(0,t.value.length-n.value.length)),a=R(()=>l.value===0),c=R(()=>o.value&&a.value);return sy()&&iy(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const lC=/auto|scroll|overlay/i;function xee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return lC.test(t)||lC.test(n)}function wee(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 _ee=Ye({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 kv((o=wc(e.estimatedPreviewHeightPx))!=null?o:vv(String((n=e.node.code)!=null?n:"")))});return()=>pn("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?pn("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)"}},[pn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[pn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),pn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),pn("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},()=>pn("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,pn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[pn("div",{class:"absolute inset-0"},[pn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),See=Ye({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 yv((o=wc(e.estimatedPreviewHeightPx))!=null?o:gv(String((n=e.node.code)!=null?n:"")))});return()=>pn("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?pn("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)"}},[pn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[pn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),pn("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},()=>pn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[pn("span",{class:"action-icon block"})])))]):null,pn("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)"}},[pn("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"}})])])}}),Cee=["data-custom-id"],Aee={class:"m-0 p-0"},Mee=["data-probe"],Eee=["data-node-index","data-node-type"],n5=mn(Ye(Rt(rt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},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,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","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,i=Go(),r=Ut("markstreamNestedRendererProps",void 0);function l(M){var H,G;const Y=o[M];return(function(oe){const Se=i?.vnode.props;return!!Se&&(Object.prototype.hasOwnProperty.call(Se,oe)||Object.prototype.hasOwnProperty.call(Se,String(oe).replace(/[A-Z]/g,Te=>`-${Te.toLowerCase()}`)))})(M)?Y:(G=(H=r?.value)==null?void 0:H[M])!=null?G:Y}const a={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:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=R(()=>{return(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=R(()=>{const M=l("renderCodeBlocksAsPre"),H=l("codeRenderer");return M===!0?"pre":H==="pre"||H==="shiki"||H==="monaco"?H:M===!1||c.value==="docs"?"monaco":"pre"}),d=R(()=>a[c.value]),f=R(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),h=R(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),p=R(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),g=R(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),b=R(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),v=R(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),m=R(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),y=R(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),k=R(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),A=R(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),$=R(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),L=R(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),w={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return o.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return g.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return v.value},get renderBatchBudgetMs(){return m.value},get renderBatchIdleTimeoutMs(){return y.value},get deferNodesUntilVisible(){return k.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return $.value},get nodeVirtual(){return L.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function E(M){s("height-change",M)}function T(M){s("virtual-state-change",M)}function F(M){s("anchor-change",M)}const S=Z(),I=Z(null),P=Z(null),B=Z(null),W=Oo({1:null,2:null,3:null,4:null,5:null,6:null}),z=Z(!1),D=new Map,q=Z(0),j=Z(0),ie=Z({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ue(){var M,H;if(((M=o.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const G=(H=o.virtualScroll)==null?void 0:H.scrollRoot;return pe(typeof G=="function"?G():G)}function pe(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?pe(M.value):typeof M=="object"&&"$el"in M?pe(M.$el):null:null}const{isClient:ee,renderAsFragment:ne,debugPerformanceEnabled:fe,resolvedShowTooltips:Me,resolvedHtmlPolicy:$e,inheritedSmoothStreaming:ae,ownsTypewriterCursor:U}=(function(M){const H=typeof window<"u",G=Hd(),Y=Ut("markstreamHtmlPolicy",void 0),oe=Ut("markstreamTypewriterCursor",void 0),Se=Ut("markstreamSmoothStreaming",void 0),Te=R(()=>M.renderAsFragment===!0),Le=R(()=>!!(M.debugPerformance&&H&&typeof console<"u")),Ue=R(()=>{var qe;if(typeof M.showTooltips=="boolean")return M.showTooltips;const Be=(qe=G.showTooltips)!=null?qe:G["show-tooltips"];return Be===""||Be===!0||Be==="true"||Be!==!1&&Be!=="false"&&void 0}),Re=R(()=>{var qe,Be;return(Be=(qe=M.htmlPolicy)!=null?qe:Y?.value)!=null?Be:"safe"}),Ke=R(()=>oe?.value!==!0);return{isClient:H,renderAsFragment:Te,debugPerformanceEnabled:Le,resolvedShowTooltips:Ue,resolvedHtmlPolicy:Re,inheritedSmoothStreaming:Se,inheritedTypewriterCursor:oe,ownsTypewriterCursor:Ke}})(w),{resolveViewportRoot:ce,resolveScrollContainer:se,isReverseFlexScrollRoot:V,getNormalizedScrollTop:Q,getOffsetTopWithinRoot:ke}=(function(M,H){function G(){var Le,Ue;return(Ue=(Le=H.scrollRoot)==null?void 0:Le.call(H))!=null?Ue:null}function Y(Le){if(typeof window>"u")return null;const Ue=G();if(Ue)return Ue;const Re=Le??M.value;if(!Re)return null;const Ke=Re.ownerDocument||document,qe=Ke.scrollingElement||Ke.documentElement;let Be=Re;for(;Be&&Be!==Ke.body&&Be!==qe;){if(xee(window.getComputedStyle(Be))&&wee(Be))return Be;Be=Be.parentElement}return null}function oe(Le){if(!H.isClient)return!1;try{const Ue=window.getComputedStyle(Le);return!!(Ue.display||"").toLowerCase().includes("flex")&&(Ue.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Se(Le,Ue,Re){var Ke,qe;if(Re)return Te(Ue);const Be=Le.scrollTop;if(!oe(Le))return Be;const Ve=Be<0?-Be:Be;return Math.max(0,((Ke=Le.scrollHeight)!=null?Ke:0)-((qe=Le.clientHeight)!=null?qe:0))-Ve}function Te(Le){var Ue,Re,Ke,qe,Be;const Ve=Number((Ue=Le.scrollingElement)==null?void 0:Ue.scrollTop),et=Number((Ke=(Re=Le.documentElement)==null?void 0:Re.scrollTop)!=null?Ke:0),tt=Number((Be=(qe=Le.body)==null?void 0:qe.scrollTop)!=null?Be:0);return Math.max(0,Number.isFinite(Ve)?Ve:0,Number.isFinite(et)?et:0,Number.isFinite(tt)?tt:0)}return{resolveViewportRoot:Y,resolveScrollContainer:function(Le){var Ue,Re,Ke,qe;const Be=G();if(Be)return Be;const Ve=Y((Ue=Le??M.value)!=null?Ue:null);if(Ve)return Ve;const et=(qe=(Ke=Le?.ownerDocument)!=null?Ke:(Re=M.value)==null?void 0:Re.ownerDocument)!=null?qe:typeof document<"u"?document:null;return et?.scrollingElement||et?.documentElement||null},isReverseFlexScrollRoot:oe,getNormalizedScrollTop:Se,getOffsetTopWithinRoot:function(Le,Ue){const Re=Ue.ownerDocument||Le.ownerDocument||document;if((function(Ve,et){return Ve===et.documentElement||Ve===et.body||Ve===et.scrollingElement})(Ue,Re))return Le.getBoundingClientRect().top+Te(Re);const Ke=Ue.getBoundingClientRect(),qe=Le.getBoundingClientRect(),Be=Se(Ue,Re,!1);return qe.top-Ke.top+Be}}})(S,{isClient:ee,scrollRoot:ue});In("markstreamShowTooltips",Me),In("markstreamHtmlPolicy",$e),In("markstreamTypewriter",R(()=>w.typewriter!==!1)),In("markstreamFade",R(()=>w.fade!==!1)),In("markstreamTypewriterCursor",R(()=>!0)),In("markstreamTextStreamState",D),In("markstreamStreamVersion",q),In("markstreamParseOptions",R(()=>w.parseOptions)),In("markstreamCustomMarkdownIt",R(()=>w.customMarkdownIt));const{smoothStreamingEnabled:he,renderContent:ye,effectiveFinal:K}=(function(M,H){const G=bee(M.smoothStreamingOptions),Y=R(()=>{var Re,Ke,qe;return M.smoothStreaming!==!1&&!((Re=M.nodes)!=null&&Re.length)&&(M.smoothStreaming===!0||!((Ke=H.inheritedSmoothStreaming)!=null&&Ke.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((qe=M.maxLiveNodes)!=null?qe:0)<=0)}),oe=Z(!H.isClient||M.smoothStreaming===!0);cn(()=>{oe.value=!0});const Se=R(()=>oe.value&&Y.value),Te=R(()=>{var Re;return Se.value?G.visible.value:(Re=M.content)!=null?Re:""}),Le=R(()=>{var Re,Ke;const qe=(Re=M.parseOptions)!=null?Re:{};return(Ke=M.final)!=null?Ke:qe.final}),Ue=R(()=>{const Re=Le.value;return Se.value&&Re!=null?!!Re&&G.caughtUp.value:Re});return Qe([()=>M.content,()=>M.nodes,Se,Le],([Re,Ke,qe,Be])=>{if(Ke?.length)return void G.reset("");const Ve=Re??"";if(!qe)return G.reset(Ve),void(Be&&G.finish({flush:!0}));const et=G.source.value;Ve?Ve===et||(Ve.startsWith(et)?G.enqueue(Ve.slice(et.length)):G.reset(Ve)):G.reset(""),Be&&G.finish()},{immediate:!0}),{smoothStream:G,smoothStreamingEligible:Y,smoothStreamingEnabled:Se,renderContent:Te,requestedFinal:Le,effectiveFinal:Ue}})(w,{isClient:ee,inheritedSmoothStreaming:ae});In("markstreamSmoothStreaming",he);const J=Z(!1);let me="",Ee=!1,Fe=null;function De(){ee&&Fe!=null&&(window.clearTimeout(Fe),Fe=null)}function ge(){J.value=!1,De()}function Ie(M,H){if(!fe.value)return;const G=(function(){if(!fe.value)return null;const Y=Tt(Je),oe=Tt(it),Se=Math.max(gt,oe);if(Y<=0&&Se<=0)return null;const Te={total:Y,maxPerFrame:Se,byLabel:(Le=Je,Object.fromEntries(Array.from(Le.entries()).sort((Ue,Re)=>Re[1]-Ue[1]||Ue[0].localeCompare(Re[0]))))};var Le;return Je.clear(),it.clear(),gt=0,Te})();console.info(`[markstream-vue][perf] ${M}`,G?Rt(rt({},H),{layoutReads:G}):H)}Qe([ye,()=>o.nodes,K],([M,H,G])=>{const Y=M??"";return H?.length||G===!0?(ge(),me=Y,void(Ee=!0)):Ee?(me&&Y.length>me.length&&Y.startsWith(me)?(J.value=!0,ee&&(De(),Fe=window.setTimeout(()=>{var oe;Fe=null,K.value===!0||(oe=o.nodes)!=null&&oe.length||(ja(),J.value=!1,ar())},1200))):(Y.length<me.length||!Y.startsWith(me))&&ge(),void(me=Y)):(me=Y,void(Ee=!0))},{flush:"sync",immediate:!0});const Je=new Map,it=new Map;let St=!1,gt=0;function Tt(M){let H=0;for(const G of M.values())H+=G;return H}function Pt(){gt=Math.max(gt,Tt(it)),it.clear(),St=!1}function ft(M,H){return(function(G){var Y,oe;fe.value&&(Je.set(G,((Y=Je.get(G))!=null?Y:0)+1),it.set(G,((oe=it.get(G))!=null?oe:0)+1),St||(St=!0,ee&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Pt):typeof queueMicrotask!="function"?setTimeout(Pt,0):queueMicrotask(Pt)))})(M),H()}const gn=w.customId?`renderer-${w.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,sn=(function(M){const H=new Map;return{scope:M,cache:H,clear:()=>H.clear()}})(gn),Yo=R(()=>`${gn}:${q.value}`);In(YM,sn);const jt=wo(()=>w.customId),{effectiveCustomHtmlTagsSet:vn,mergedParseOptions:fo,parsedNodes:st}=yee(w,{instanceMsgId:gn,renderContent:ye,effectiveFinal:K,smoothStreamingEnabled:he,debugPerformanceEnabled:fe,customComponentsMap:jt,logPerf:Ie});Qe(st,()=>{sn.clear(),q.value+=1},{immediate:!0});const On=R(()=>({customId:w.customId,customHtmlTags:fo.value.customHtmlTags,parseOptions:w.parseOptions,customMarkdownIt:w.customMarkdownIt,htmlPolicy:$e.value,viewportPriority:w.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:w.codeBlockStream,codeBlockDarkTheme:w.codeBlockDarkTheme,codeBlockLightTheme:w.codeBlockLightTheme,codeBlockMonacoOptions:w.codeBlockMonacoOptions,renderCodeBlocksAsPre:w.renderCodeBlocksAsPre,codeBlockMinWidth:w.codeBlockMinWidth,codeBlockMaxWidth:w.codeBlockMaxWidth,codeBlockProps:w.codeBlockProps,mermaidProps:w.mermaidProps,d2Props:w.d2Props,infographicProps:w.infographicProps,showTooltips:Me.value,themes:w.themes,langs:w.langs,isDark:w.isDark,typewriter:w.typewriter,smoothStreamingOptions:w.smoothStreamingOptions,parseCoalesceMs:w.parseCoalesceMs,fade:w.fade}));In("markstreamNestedRendererProps",On);const so=R(()=>st.value),io=R(()=>st.value.length),ro=Z(null),Zo=Z(null),Un=Z(null),_o=Z(null),yn=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),Xn=!yn&&w.customId?YS(w.customId):null,_n=R(()=>Xn?(GS.value,YS(w.customId)):null),un=R(()=>{var M;return!!(ee&&!ne.value&&w.customId&&!yn&&((M=_n.value)!=null&&M.enabled))}),Sn=R(()=>{var M;return!!(!ne.value&&((M=o.virtualScroll)!=null&&M.enabled))}),Ro=Z(!1);cn(()=>{Ro.value=!0});const ze=R(()=>!!(ee&&Sn.value));In("markstreamHostScrollManaged",ze);const Ze=R(()=>!!(Ro.value&&ze.value)),kt=R(()=>un.value||ze.value),Bt=R(()=>un.value||Ze.value),Rn=R(()=>{var M;return kt.value&&((M=_n.value)==null?void 0:M.textEstimation)!==!1}),Cn=R(()=>{var M;return kt.value&&((M=_n.value)==null?void 0:M.codeBlockEstimation)!==!1});function Wt(){const M=j.value||ft("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=S.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const kn=R(()=>{const M=Wt();return M>0?Math.max(1,Math.round(M)):640}),Qn=R(()=>{var M;return Math.max(1,(M=w.maxLiveNodes)!=null?M:320)}),wt=R(()=>{var M;return!ne.value&&w.nodeVirtual!==!1&&!(((M=w.maxLiveNodes)!=null?M:0)<=0)&&(w.nodeVirtual===!0?st.value.length>0:st.value.length>Qn.value)}),Xo=R(()=>wt.value||un.value||ze.value),So=R(()=>w.viewportPriority!==!1&&!z.value),Qo=rJ(M=>{var H;return ce((H=M??S.value)!=null?H:null)},So),{requestFrame:Bn,cancelFrame:Dn,hasIdleCallback:ni,isTestEnv:Bs}=(function(M){const H=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,G=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,Y=M.isClient&&typeof window.requestIdleCallback=="function",oe=(function(){var Se;if(typeof globalThis>"u"||!("process"in globalThis))return;const Te=(Se=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Se.value;return Te?.env})();return{requestFrame:H,cancelFrame:G,hasIdleCallback:Y,isTestEnv:oe?.NODE_ENV==="test"}})({isClient:ee}),{resolvedBatchSize:_i,resolvedInitialBatch:ho,batchingEnabled:Pi,incrementalRenderingActive:Si,renderedCount:po,previousRenderContext:Ds,adaptiveBatchSize:ir,previousBatchConfig:Ci}=(function(M,H){var G;const Y=R(()=>{var qe;const Be=Math.trunc((qe=M.renderBatchSize)!=null?qe:80);return Number.isFinite(Be)?Math.max(0,Be):0}),oe=R(()=>{var qe;const Be=Math.trunc((qe=M.initialRenderBatchSize)!=null?qe:Y.value);return Number.isFinite(Be)?Math.max(0,Be):Y.value}),Se=R(()=>!H.renderAsFragment.value&&M.batchRendering!==!1&&Y.value>0&&H.isClient&&!H.isTestEnv),Te=Z(0),Le=Z({key:M.indexKey,total:0}),Ue=Z(Math.max(1,Y.value||1)),Re=R(()=>{var qe;return Se.value&&((qe=M.maxLiveNodes)!=null?qe:0)<=0}),Ke=Z({batchSize:Y.value,initial:oe.value,delay:(G=M.renderBatchDelay)!=null?G:16,enabled:Re.value});return{resolvedBatchSize:Y,resolvedInitialBatch:oe,batchingEnabled:Se,incrementalRenderingActive:Re,renderedCount:Te,previousRenderContext:Le,adaptiveBatchSize:Ue,previousBatchConfig:Ke}})(w,{isClient:ee,isTestEnv:Bs,renderAsFragment:ne}),lo=new Map,Jo=new Map,oi=new WeakMap;let Co=null;const Ps=new WeakMap,qn=new Map,Bo=Z(0),Hs=R(()=>(Bo.value,Array.from(lo.entries()).sort((M,H)=>M[0]-H[0]))),es=Z(null),Ce=Z(null);let te=null,ve=0,de=null;const{activeRestoreAnchor:_e,getRelativeScrollTopWithinContainer:He,setRelativeScrollTopWithinContainer:$t,resolveAnchorOffset:Ot,clearRestoreReconcile:rn,scheduleRestoreReconcile:zn,captureRestoreAnchor:X,restoreAnchor:xe,getAnchorDrift:Ae}=(function(M){const{isClient:H,containerRef:G,parsedNodeCount:Y,requestFrame:oe,cancelFrame:Se,resolveScrollContainer:Te,getNormalizedScrollTop:Le,getOffsetTopWithinRoot:Ue,isReverseFlexScrollRoot:Re,estimateIndexForOffset:Ke,estimateHeightRange:qe,getFallbackNodeHeight:Be,clamp:Ve}=M,et=Z(null);let tt=null,_t=[];function lt(){const Nt=Te(),Ht=G.value;if(!Nt||!Ht)return null;const Dt=Nt.ownerDocument||Ht.ownerDocument||document;if(Nt===Dt.documentElement||Nt===Dt.body||Nt===Dt.scrollingElement){const dn=Ht.getBoundingClientRect();return Math.max(0,-dn.top)}return Math.max(0,Le(Nt,Dt,!1)-Ue(Ht,Nt))}function dt(Nt){var Ht;const Dt=Te(),dn=G.value;if(!Dt||!dn)return;const qs=Math.max(0,Nt),ls=Dt.ownerDocument||dn.ownerDocument||document,Mi=ls.defaultView||(typeof window<"u"?window:null);if(Dt===ls.documentElement||Dt===ls.body||Dt===ls.scrollingElement){const Gr=Le(Dt,ls,!0)+dn.getBoundingClientRect().top;return void((Ht=Mi?.scrollTo)==null||Ht.call(Mi,0,Math.max(0,Gr+qs)))}QS(Dt,ls,Ue(dn,Dt)+qs,{isReverseFlexScrollRoot:Gr=>{var Yr;return(Yr=Re?.(Gr))!=null&&Yr},getNormalizedScrollTop:Le})}function At(Nt){const Ht=Y.value,Dt=Ve(Nt.nodeIndex,0,Math.max(0,Ht-1));return qe(0,Dt)+Math.max(0,Nt.offsetWithinNodePx)}function Ct(){if(tt!=null&&(Se?.(tt),tt=null),H)for(const Nt of _t)window.clearTimeout(Nt);_t=[]}function tn(Nt){const Ht=At(Nt),Dt=lt();Dt!=null&&Math.abs(Dt-Ht)<=.5||dt(Ht)}return{activeRestoreAnchor:et,getRelativeScrollTopWithinContainer:lt,setRelativeScrollTopWithinContainer:dt,resolveAnchorOffset:At,clearRestoreReconcile:Ct,applyRestoreAnchor:tn,scheduleRestoreReconcile:function(){et.value&&H&&tt==null&&(tt=oe?oe(()=>{tt=null,et.value&&tn(et.value)}):null,tt==null&&et.value&&tn(et.value))},captureRestoreAnchor:function(){const Nt=lt(),Ht=Y.value;if(Nt==null||Ht<=0)return null;const Dt=Ve(Ke(Nt+1),0,Ht-1),dn=qe(0,Dt),qs=Be(Dt);return{nodeIndex:Dt,offsetWithinNodePx:Ve(Nt-dn,0,Math.max(0,qs-1))}},restoreAnchor:function(Nt){const Ht=Y.value;if(et.value={nodeIndex:Ve(Nt.nodeIndex,0,Math.max(0,Ht-1)),offsetWithinNodePx:Math.max(0,Nt.offsetWithinNodePx)},Ct(),tn(et.value),H)for(const Dt of[0,120,280,480])_t.push(window.setTimeout(()=>{et.value&&tn(et.value)},Dt))},getAnchorDrift:function(Nt){const Ht=lt();return Ht==null?null:Ht-At(Nt)}}})({isClient:ee,containerRef:S,parsedNodeCount:io,requestFrame:Bn,cancelFrame:Dn,resolveScrollContainer:()=>es.value||se(),getNormalizedScrollTop:Q,getOffsetTopWithinRoot:ke,isReverseFlexScrollRoot:V,estimateIndexForOffset:I1,estimateHeightRange:Kr,getFallbackNodeHeight:af,clamp:Ho}),{nodeHeights:Oe,heightStats:Ge,heightTreeSize:ot,heightSumTree:Et,heightKnownTree:Xt,averageNodeHeight:Vt,resetHeightMeasurements:Qt,pruneHeightMeasurements:Do,rebuildHeightTrees:Io,recordNodeHeight:ht,removeNodeHeights:zt,exportHeightCache:Jt,importHeightCache:Ao,fenwickRangeSum:Jn}=(function(M={}){const H=Oo({}),G=Oo({total:0,count:0}),Y=Z(0),oe=Z([]),Se=Z([]);function Te(){for(const Be of Object.keys(H))delete H[Number(Be)];G.total=0,G.count=0,Y.value=0,oe.value=[],Se.value=[]}function Le(Be,Ve,et){for(let tt=Ve+1;tt<Be.length;tt+=tt&-tt)Be[tt]+=et}function Ue(Be,Ve){let et=0;for(let tt=Ve+1;tt>0;tt-=tt&-tt)et+=Be[tt];return et}function Re(Be){Y.value=Be;const Ve=new Array(Be+1).fill(0),et=new Array(Be+1).fill(0);for(const[tt,_t]of Object.entries(H)){const lt=Number(tt),dt=Number(_t);!Number.isFinite(lt)||lt<0||lt>=Be||!Number.isFinite(dt)||dt<=0||(Le(Ve,lt,dt),Le(et,lt,1))}oe.value=Ve,Se.value=et}function Ke(Be){if(!Number.isInteger(Be)||Be<0)return!1;const Ve=H[Be];if(!Number.isFinite(Ve)||Ve<=0)return!1;if(delete H[Be],G.total=Math.max(0,G.total-Ve),G.count=Math.max(0,G.count-1),Y.value>Be){const et=oe.value,tt=Se.value;et.length&&tt.length&&(Le(et,Be,-Ve),Le(tt,Be,-1))}return!0}const qe=R(()=>G.count>0?Math.max(12,G.total/G.count):32);return{nodeHeights:H,heightStats:G,heightTreeSize:Y,heightSumTree:oe,heightKnownTree:Se,averageNodeHeight:qe,resetHeightMeasurements:Te,pruneHeightMeasurements:function(Be){if(Be<=0)return void Te();let Ve=0,et=0;for(const[tt,_t]of Object.entries(H)){const lt=Number(tt),dt=Number(_t);!Number.isFinite(lt)||lt<0||lt>=Be||!Number.isFinite(dt)||dt<=0?delete H[lt]:(Ve+=dt,et++)}G.total=Ve,G.count=et},rebuildHeightTrees:Re,recordNodeHeight:function(Be,Ve,et={}){(function(tt,_t,lt={}){var dt;if(!Number.isFinite(_t)||_t<=0)return!1;const At=H[tt];if(At&&(lt.allowShrink===!1&&_t<At||Math.abs(_t-At)<=1))return!1;if(H[tt]=_t,At?G.total+=_t-At:(G.total+=_t,G.count++),Y.value>tt){const Ct=oe.value,tn=Se.value;if(Ct.length&&tn.length)if(At){const Nt=_t-At;Nt!==0&&Le(Ct,tt,Nt)}else Le(Ct,tt,_t),Le(tn,tt,1)}lt.notify!==!1&&((dt=M.onHeightRecorded)==null||dt.call(M))})(Be,Ve,Rt(rt({},et),{notify:!0}))},removeNodeHeight:function(Be,Ve={}){var et;const tt=Ke(Be);return tt&&Ve.notify!==!1&&((et=M.onHeightRecorded)==null||et.call(M)),tt},removeNodeHeights:function(Be,Ve={}){var et;let tt=0;for(const _t of Be)Ke(Number(_t))&&tt++;return tt>0&&Ve.notify!==!1&&((et=M.onHeightRecorded)==null||et.call(M)),tt},exportHeightCache:function(){return Object.entries(H).map(([Be,Ve])=>({index:Number(Be),height:Number(Ve)})).filter(Be=>Number.isFinite(Be.index)&&Be.index>=0&&Number.isFinite(Be.height)&&Be.height>0).sort((Be,Ve)=>Be.index-Ve.index)},importHeightCache:function(Be,Ve={}){var et;if(!Array.isArray(Be))return;const tt=Y.value;let _t=!1;if(Ve.mode!=="merge"){const lt=Object.keys(H);if(lt.length>0){for(const dt of lt)delete H[Number(dt)];_t=!0}}for(const lt of Be){const dt=Number(lt.index),At=Number(lt.height);if(!Number.isInteger(dt)||dt<0||tt>0&&dt>=tt||!Number.isFinite(At)||At<=0)continue;const Ct=H[dt];Ct&&Math.abs(Ct-At)<=1||(H[dt]=At,_t=!0)}_t&&((function(){let lt=0,dt=0;const At=Y.value;for(const[Ct,tn]of Object.entries(H)){const Nt=Number(Ct),Ht=Number(tn);!Number.isFinite(Nt)||Nt<0||At>0&&Nt>=At||!Number.isFinite(Ht)||Ht<=0?delete H[Nt]:(lt+=Ht,dt++)}G.total=lt,G.count=dt})(),tt>0&&Re(tt),(et=M.onHeightRecorded)==null||et.call(M))},fenwickRangeSum:function(Be,Ve,et){if(et<=Ve)return 0;const tt=Ue(Be,et-1);return Ve<=0?tt:tt-Ue(Be,Ve-1)}}})({onHeightRecorded:()=>{ii(),ze.value&&bu(),_e.value&&zn(),Ce.value&&za(),Pn("node-resize")}});function Ai(){Qt(),qn.clear()}function Hl(M){!Number.isInteger(M)||M<0||M>=st.value.length||qn.set(M,cu(M))}function ef(M,H,G={}){const Y=Oe[M];ht(M,H,G);const oe=Oe[M];oe&&oe>0?Hl(M):Y&&qn.delete(M)}function d2(M,H){const G=ft("getNodeLayoutHeight.slot.offsetHeight",()=>{var Y,oe;return(oe=(Y=lo.get(M))==null?void 0:Y.offsetHeight)!=null?oe:0});return G>0?G:ft("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function f2(M,H={}){Ao(M,H),w1()}const Ur=R(()=>{var M;return!ne.value&&w.deferNodesUntilVisible!==!1&&!(((M=w.maxLiveNodes)!=null?M:0)<=0)&&!wt.value&&!(st.value.length>900)&&So.value}),h2=R(()=>!!Qo&&(Ur.value||wt.value)),p2=R(()=>wt.value||ze.value),{liveNodeBufferResolved:iu,focusIndex:si,liveRange:Po,updateLiveRange:Wl}=(function(M,H){const{parsedNodeCount:G,virtualizationEnabled:Y,maxLiveNodesResolved:oe,clamp:Se}=H,Te=R(()=>{var Re;return Math.max(0,(Re=M.liveNodeBuffer)!=null?Re:60)}),Le=Z(0),Ue=Oo({start:0,end:0});return{liveNodeBufferResolved:Te,focusIndex:Le,liveRange:Ue,updateLiveRange:function(){const Re=G.value;if(!Y.value||Re===0)return Ue.start=0,void(Ue.end=Re);const Ke=Math.min(oe.value,Re),qe=Te.value,Be=Se(Le.value-qe,0,Math.max(0,Re-Ke));Ue.start=Be,Ue.end=Math.min(Re,Be+Ke)}}})(w,{parsedNodeCount:io,virtualizationEnabled:wt,maxLiveNodesResolved:Qn,clamp:Ho}),Hi=new Map,zl=new Map,qr=new Map,tf=[],rr=new Map,jr=new Set,m2=Z(0);let Ym=!1;const g2=R(()=>(m2.value,jr.size)),Ws=new Map,Wi=new Map,v2=Z(0),Zm=R(()=>{v2.value;let M=0;for(const H of Ws.values())M+=Math.max(0,H);return M});let zs=null,Xm=!0,y2=[0],k2="";function ii(){Xm=!0}const nf=R(()=>{if(!wt.value)return st.value.length;const M=iu.value,H=Math.max(Po.end+M,ho.value),G=Math.min(st.value.length,H);return Math.max(po.value,G)});function of(){Ym||(Ym=!0,queueMicrotask(()=>{Ym=!1,m2.value+=1}))}function b2(M,H,G="node-resize"){if(!ee||typeof window>"u")return null;const Y=window.setTimeout(()=>{jr.delete(Y)&&of();try{H()}finally{Pn(G)}},Math.max(0,M));return jr.add(Y),of(),Y}function sf(M){ee&&M!=null&&(jr.delete(M)&&of(),window.clearTimeout(M))}function x2(){if(ee&&typeof window<"u")for(const M of jr)window.clearTimeout(M);jr.size&&(jr.clear(),of()),tf.length=0,qr.clear()}function N8(M){var H,G;return(G=(H=_o.value)==null?void 0:H[M])!=null?G:null}const{cancelScheduledFocusSync:Qm,scheduleFocusSync:zi}=(function(M){const{isClient:H,containerRef:G,virtualizationEnabled:Y,requestFrame:oe,cancelFrame:Se,syncFocusToScroll:Te}=M;let Le=null;function Ue(){var Ke,qe,Be;return(Be=(qe=(Ke=G.value)==null?void 0:Ke.ownerDocument)==null?void 0:qe.defaultView)!=null?Be:typeof window<"u"?window:null}function Re(){if(!Le)return;const Ke=Ue();Le.viaTimeout?Ke?Ke.clearTimeout(Le.id):clearTimeout(Le.id):Se?.(Le.id),Le=null}return{cancelScheduledFocusSync:Re,scheduleFocusSync:function(Ke={}){if(!Y.value)return;if(!H)return void Te(!0);if(Ke.immediate)return Re(),void Te(!0);if(Le)return;const qe=()=>{Le=null,Te()};if(oe)return void(Le={id:oe(qe),viaTimeout:!1});const Be=Ue();Le={id:Be?Be.setTimeout(qe,16):setTimeout(qe,16),viaTimeout:!0}}}})({isClient:ee,containerRef:S,virtualizationEnabled:wt,requestFrame:Bn,cancelFrame:Dn,syncFocusToScroll:function(M=!1){var H;if(!wt.value)return;const G=es.value||se();if(!G)return;const Y=G.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,oe=Y?.defaultView||(typeof window<"u"?window:null),Se=G===Y?.documentElement||G===Y?.body,Te=st.value.length;if(!Se&&Te>0&&V(G)){const et=ft("syncFocusToScroll.clientHeight",()=>G.clientHeight||0),tt=ft("syncFocusToScroll.scrollTop",()=>G.scrollTop),_t=tt<0?-tt:tt,lt=(function(At){var Ct,tn;const Nt=st.value;if(!Nt.length)return 0;if(At<=0)return Math.max(0,Nt.length-1);if(kt.value){const Dt=(Ct=o1()[Nt.length])!=null?Ct:0;return T2(Math.max(0,Dt-At))}if(ot.value===Nt.length){const Dt=Kr(0,Nt.length);return I1(Math.max(0,Dt-At))}let Ht=At;for(let Dt=Nt.length-1;Dt>=0;Dt--){const dn=(tn=Oe[Dt])!=null?tn:Vt.value;if(Ht<=dn)return Dt;Ht-=dn}return 0})(Math.max(0,_t)+.5*Math.max(0,et)),dt=Ho(lt,0,Math.max(0,Te-1));return void((M||Math.abs(dt-si.value)>1)&&(si.value=dt,Wl()))}const Le=Se?null:ft("syncFocusToScroll.root.getBoundingClientRect",()=>G.getBoundingClientRect()),Ue=Se?0:Le.top,Re=Se?ft("syncFocusToScroll.viewport.clientHeight",()=>{var et,tt;return(tt=(et=oe?.innerHeight)!=null?et:G.clientHeight)!=null?tt:0}):Le.bottom,Ke=Hs.value;let qe=null,Be=null;for(const[et,tt]of Ke){if(!tt)continue;const _t=ft("syncFocusToScroll.slot.getBoundingClientRect",()=>tt.getBoundingClientRect());_t.bottom<=Ue||_t.top>=Re||(qe==null&&(qe=et),Be=et)}if(qe==null||Be==null){const et=S.value;if(!et)return;const tt=Se?{top:0}:ft("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>G.getBoundingClientRect()),_t=ft("syncFocusToScroll.fallback.scrollTop",()=>Q(G,Y,Se)),lt=Se?(()=>{const Ct=ft("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>et.getBoundingClientRect()),tn=(Se?0:tt.top)-Ct.top;return Math.max(0,tn)})():(()=>{const Ct=ke(et,G);return Math.max(0,_t-Ct)})(),dt=Se?ft("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Ct,tn,Nt,Ht;return(Ht=(Nt=(tn=oe?.innerHeight)!=null?tn:(Ct=Y?.documentElement)==null?void 0:Ct.clientHeight)!=null?Nt:G.clientHeight)!=null?Ht:0}):ft("syncFocusToScroll.fallback.root.clientHeight",()=>G.clientHeight),At=I1(lt+.5*Math.max(0,dt));return si.value=Ho(At,0,Math.max(0,st.value.length-1)),void Wl()}const Ve=Math.round((qe+Be)/2);!M&&Math.abs(Ve-si.value)<=1||(si.value=Ho(Ve,0,Math.max(0,st.value.length-1)),Wl())}}),{visibleNodeIndices:Jm,nodeVisibilityHandles:Oa,nodeVisibilityWatchStops:rf,nodeVisibilityFallbackTimers:w2,clearVisibilityFallback:lf,markNodeVisible:Vr,cleanupNodeVisibility:I8,destroyNodeVisibilityState:e1}=kee({isClient:ee,shouldTrackVisibleNodeIndices:()=>Ur.value,shouldCleanupNodeVisibility:()=>wt.value,onNodeMarkedVisible:M=>{wt.value?zi():si.value=Ho(M,0,Math.max(0,st.value.length-1))},onNodeVisibilityCleaned:M=>{lo.delete(M)&&X2()}}),{cleanupScrollListener:_2,setupScrollListener:L8}=(function(M){const{isClient:H,virtualizationEnabled:G,listenerEnabled:Y,scrollRootElement:oe,resolveScrollContainer:Se,scheduleFocusSync:Te,onScroll:Le}=M;let Ue=null,Re=null;function Ke(){Ue&&(Ue(),Ue=null),Re=null,oe.value=null}function qe(Be){const Ve=M.getScrollTop?M.getScrollTop(Be):Be.scrollTop;return Math.max(0,Number.isFinite(Ve)?Math.abs(Ve):0)}return{cleanupScrollListener:Ke,setupScrollListener:function(){if(!H)return;if(!((Be=Y?.value)!=null?Be:G.value))return void Ke();var Be;const Ve=Se();if(!Ve)return void Ke();if(oe.value===Ve&&Ue)return;Ke(),Re=qe(Ve);const et=()=>{if(Le?.(),G.value){const tt=(function(_t){const lt=qe(_t),dt=Re;Re=lt;const At=Math.max(480,.75*(_t.clientHeight||0));return dt==null?lt>At?{immediate:!0}:void 0:Math.abs(lt-dt)>At?{immediate:!0}:void 0})(Ve);tt?Te(tt):Te()}};Ve.addEventListener("scroll",et,{passive:!0}),oe.value=Ve,Ue=()=>{Ve.removeEventListener("scroll",et)}}}})({isClient:ee,virtualizationEnabled:wt,listenerEnabled:p2,scrollRootElement:es,resolveScrollContainer:se,scheduleFocusSync:zi,onScroll:function(){const M=Ce.value;if(!M)return;const H=au();if(!H||(function(Y){if(pu()>=ve)return de=null,!1;const oe=de;if(oe==null)return!0;const Se=Math.abs(Y.scrollTop-oe)<=2;return Se||(de=null),Se})(H))return;const G=D2(H);G!=null?(G<-32||Math.abs(Math.max(0,G)-Math.max(0,M.distanceFromBottomPx))>32)&&Wa("restore"):Wa("restore")},getScrollTop:M=>{var H;const G=M.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement;return ft("scrollListener.getScrollTop",()=>Q(M,G,Y))}});function Ho(M,H,G){return Math.min(Math.max(M,H),G)}function t1(M){return M?.firstElementChild}function S2(M,H){var G;return M?(G=M.matches)!=null&&G.call(M,H)?M:M.querySelector(H):null}function C2(){if(!kt.value)return void(j.value=0);const M=ft("updateExperimentContainerWidth.clientWidth",()=>{var H,G;return(G=(H=S.value)==null?void 0:H.clientWidth)!=null?G:0});j.value=M>0?M:0}let ru=null;function n1(){ru?.disconnect(),ru=null}const A2=Li({loader:()=>Gn(null,null,function*(){return(yield ps(()=>import("./index8-BqCm7dJ1.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:zM,delay:0,suspensible:!1});function M2(M){return M===A2}const E2=R(()=>u.value==="pre"?js:u.value==="shiki"?A2:H0),Ul=R(()=>{const M=st.value;if(!M.length||!kt.value)return M.map(()=>null);const H=j.value||ft("estimatedNodeHeights.clientWidth",()=>{var G;return((G=S.value)==null?void 0:G.clientWidth)||0});return!Number.isFinite(H)||H<=0?M.map(()=>null):M.map((G,Y)=>{const oe=Oe[Y],Se=typeof oe=="number"&&oe>0;if(Rn.value&&!Se){const Le=GM(G,H,ie.value);if(Le)return Le}if(Cn.value&&G.type==="code_block"){const Le=(function(Ue){if(Ue.type!=="code_block")return null;const Re=ub(Ue,mf(Ue));return M2(Re)?"markdown":Re===js?"pre":Re===E2.value||Re===H0?"monaco":null})(G);if(Le==="monaco"||Le==="markdown"||Le==="pre")return see(G,{rendererKind:Le,monacoOptions:w.codeBlockMonacoOptions,showHeader:((Te=w.codeBlockProps)==null?void 0:Te.showHeader)!==!1})}var Te;return null})});function af(M){var H;const G=Oe[M];if(Number.isFinite(G)&&G>0)return G;const Y=(H=Ul.value[M])==null?void 0:H.height;return Number.isFinite(Y)&&Y>0?Y:Math.max(Vt.value,(function(oe){var Se,Te,Le,Ue,Re,Ke,qe,Be,Ve,et,tt,_t,lt;const dt=st.value[oe];if(!dt||typeof dt!="object")return 32;const At=String((Se=dt.type)!=null?Se:""),Ct=Wt()||640;switch(At){case"heading":return 44;case"paragraph":return Ra(String((Le=(Te=dt.raw)!=null?Te:dt.content)!=null?Le:""),Ct,34);case"list":{const tn=Array.isArray(dt.items)?dt.items.length:1;return Math.max(48,30*tn+12)}case"list_item":return Ra(String((Re=(Ue=dt.raw)!=null?Ue:dt.content)!=null?Re:""),Ct,34);case"blockquote":return Ra(String((qe=(Ke=dt.raw)!=null?Ke:dt.content)!=null?qe:""),Ct,56);case"table":{const tn=Array.isArray(dt.rows)?dt.rows.length:Array.isArray(dt.children)?dt.children.length:3;return Math.max(120,38*tn+48)}case"code_block":return Ra(String((Ve=(Be=dt.code)!=null?Be:dt.raw)!=null?Ve:""),Ct,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return Ra(String((tt=(et=dt.raw)!=null?et:dt.content)!=null?tt:""),Ct,96);case"thematic_break":return 24;default:return Ra(String((lt=(_t=dt.raw)!=null?_t:dt.content)!=null?lt:""),Ct,40)}})(M))}function Ra(M,H,G,Y=22){const oe=String(M??"");if(!oe)return G;const Se=Math.max(18,Math.floor(Math.max(320,H)/8)),Te=oe.split(/\r?\n/).length,Le=Math.ceil(oe.length/Se),Ue=Math.max(1,Te,Le);return Math.max(G,Math.ceil(Ue*Y+12))}function lu(M){const H=Number(M);return!Number.isFinite(H)||H<=0?-1:Math.round(H/32)}function o1(){var M,H;const G=st.value.length,Y=lu(j.value||ft("getFallbackHeightPrefix.clientWidth",()=>{var Le;return((Le=S.value)==null?void 0:Le.clientWidth)||0})),oe=((M=o.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(o.virtualScroll.measurementKey),Se=[G,Ge.count,Math.round(Ge.total),Math.round(100*Vt.value),oe,Y,kt.value?1:0,GS.value,q.value].join(":");if(!Xm&&k2===Se)return y2;const Te=new Array(G+1);Te[0]=0;for(let Le=0;Le<G;Le++)Te[Le+1]=Te[Le]+(kt.value?af(Le):(H=Oe[Le])!=null?H:Vt.value);return y2=Te,k2=Se,Xm=!1,Te}function T2(M){var H,G;const Y=st.value.length;if(Y<=0||M<=0)return 0;const oe=o1();if(M>=((H=oe[Y])!=null?H:0))return Y-1;let Se=0,Te=Y-1,Le=Y-1;for(;Se<=Te;){const Ue=Se+Te>>1;((G=oe[Ue+1])!=null?G:0)>=M?(Le=Ue,Te=Ue-1):Se=Ue+1}return Le}function Kr(M,H){var G,Y;if(M>=H)return 0;if(kt.value)return(function(Te,Le){var Ue,Re;const Ke=st.value.length,qe=Ho(Math.trunc(Te),0,Ke),Be=Ho(Math.trunc(Le),qe,Ke);if(qe>=Be)return 0;const Ve=o1();return((Ue=Ve[Be])!=null?Ue:0)-((Re=Ve[qe])!=null?Re:0)})(M,H);if(ot.value!==st.value.length){let Te=0;for(let Le=M;Le<H;Le++)Te+=(G=Oe[Le])!=null?G:Vt.value;return Te}const oe=Et.value,Se=Xt.value;if(!oe.length||!Se.length){let Te=0;for(let Le=M;Le<H;Le++)Te+=(Y=Oe[Le])!=null?Y:Vt.value;return Te}return Jn(oe,M,H)+(H-M-Jn(Se,M,H))*Vt.value}Qe(()=>st.value.length,M=>{ii(),M<=0?Ai():(M<ot.value&&Do(M),M!==ot.value&&Io(M))},{immediate:!0});const $8=R(()=>{if(!wt.value)return st.value.map((Y,oe)=>({node:Y,index:oe}));const M=st.value.length,H=Ho(Po.start,0,M),G=Ho(Po.end,H,M);return st.value.slice(H,G).map((Y,oe)=>({node:Y,index:H+oe}))}),s1=R(()=>wt.value?Kr(0,Math.min(Po.start,st.value.length)):0),i1=R(()=>{if(!wt.value)return 0;const M=st.value.length;return Kr(Math.min(Po.end,M),M)});function N2(){if(!kt.value)return 0;let M=0;const H=Ul.value;for(let G=0;G<H.length;G++){if(!H[G])continue;const Y=Oe[G];Number.isFinite(Y)&&Y>0||M++}return M}function I2(){const M=st.value.length;return{totalNodes:M,measuredCount:Ge.count,estimatedCount:N2(),averageNodeHeight:Vt.value,topSpacerHeight:s1.value,bottomSpacerHeight:i1.value,estimatedTotalHeight:Kr(0,M),width:ql()}}function F8(){const M=st.value,H=I2();return Rt(rt({},H),{probe:{paragraphReady:!!ie.value.paragraph,listItemReady:!!ie.value.listItem,listWrapperOverhead:ie.value.listWrapperOverhead,headingReadyLevels:Object.entries(ie.value.headings).filter(([,G])=>!!G).map(([G])=>Number(G))},nodes:M.map((G,Y)=>{var oe,Se,Te,Le,Ue,Re,Ke,qe,Be;return{index:Y,type:G.type,estimateKind:(Se=(oe=Ul.value[Y])==null?void 0:oe.kind)!=null?Se:null,rendererKind:(Le=(Te=Ul.value[Y])==null?void 0:Te.rendererKind)!=null?Le:null,estimatedHeight:(Re=(Ue=Ul.value[Y])==null?void 0:Ue.height)!=null?Re:null,estimatedContentHeight:(qe=(Ke=Ul.value[Y])==null?void 0:Ke.contentHeight)!=null?qe:null,measuredHeight:(Be=Oe[Y])!=null?Be:null}})})}function r1(){return o.indexKey!=null?String(o.indexKey):Sn.value?`virtual-${jn()}`:"markdown-renderer"}function L2(M){const H=String(M),G=`${r1()}-`;if(!H.startsWith(G))return null;const Y=H.slice(G.length).match(/^(\d+)(?:$|-)/);if(!Y)return null;const oe=Number(Y[1]);return!Number.isInteger(oe)||oe<0||oe>=st.value.length?null:oe}function jn(){var M,H,G;const Y=(M=o.virtualScroll)==null?void 0:M.sessionKey;return String(Y!=null&&Y!==""?Y:(G=(H=o.indexKey)!=null?H:w.customId)!=null?G:gn)}function Mo(){var M;const H=(M=o.virtualScroll)==null?void 0:M.threadKey;return H==null||H===""?void 0:String(H)}function l1(M){var H;return(M??"")===((H=Mo())!=null?H:"")}function O8(){var M;const H=(M=o.virtualScroll)==null?void 0:M.measurementKey;return H==null?"":String(H)}function R8(){var M,H;const G=u.value,Y=G==="monaco"?w.codeBlockMonacoOptions:void 0,oe=w.codeBlockProps,Se=G==="shiki";return[w.isDark?"dark":"light",G==="monaco"?"code-rich":G==="pre"?"code-pre":"code-shiki",w.codeBlockStream===!1?"code-static":"code-stream",Lo(w.codeBlockMinWidth),Lo(w.codeBlockMaxWidth),...Se?[xp((M=oe?.themes)!=null?M:w.themes,(H=oe?.langs)!=null?H:w.langs)]:[],Lo(Y?.fontSize),Lo(Y?.lineHeight),Lo(Y?.fontFamily),Lo(Y?.tabSize),Lo(Y?.MAX_HEIGHT),Lo(Y?.wordWrap),Lo(Y?.wrappingIndent),Lo(Y?.padding),Lo(oe?.showHeader),Lo(oe?.showCopyButton),Lo(oe?.showExpandButton),Lo(oe?.showPreviewButton),Lo(oe?.showCollapseButton),Lo(oe?.showFontSizeButtons)].join("\0")}function lr(){return[O8(),R8()].join("\0")}function ql(){return Wt()}const cf=R(()=>lu(ql())),Us=R(()=>[lr(),cf.value].join("\0")),B8=R(()=>{var M;return Sn.value?["virtual",(M=Mo())!=null?M:"",jn(),Us.value].join("\0"):o.indexKey});function Ba(){v2.value+=1}function a1(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=st.value.length||M.sessionKey!==jn()||M.threadKey!==Mo()||M.layoutEpochKey!==Us.value)}function $2(M){const H=String(M),G=Wi.get(H);return G?a1(G)?G.index:null:L2(H)}function F2(M="async-node"){(Ws.size||Wi.size)&&(Ws.clear(),Wi.clear(),Ba(),Pn(M))}const Da=Ut(hv,null),c1={reportHeight(M,H){if(!ze.value)return;const G=$2(M);if(G==null)return;const Y=Hi.get(G);if(!Y)return;const oe=Number(H),Se=d2(G,Y);ef(G,Number.isFinite(oe)&&oe>0?Math.max(oe,Se||0):Se)},markPending(M){if(!ze.value)return;const H=L2(M);H!=null&&(function(G,Y){var oe;const Se=Wi.get(G);if(Se&&a1(Se))return Ws.set(G,Math.max(0,(oe=Ws.get(G))!=null?oe:0)+1),Ba(),void Pn("async-node");Ws.set(G,1),Wi.set(G,(function(Te){return{index:Te,sessionKey:jn(),threadKey:Mo(),layoutEpochKey:Us.value}})(Y)),Ba(),Pn("async-node")})(String(M),H)},markSettled(M){if(!ze.value)return;const H=String(M),G=$2(M);(G!=null||(function(Y){return Ws.has(String(Y))})(H))&&(function(Y){var oe;const Se=(oe=Ws.get(Y))!=null?oe:0;return!(Se<=0||(Se<=1?(Ws.delete(Y),Wi.delete(Y)):Ws.set(Y,Se-1),Ba(),Se===1&&Pn("async-node"),0))})(H)&&G!=null&&ar()}};function D8(){let M=0;for(const H of Hi.values())M+=ft("getVisibleDomHeight.offsetHeight",()=>{var G;return(G=H?.offsetHeight)!=null?G:0});return Math.ceil(Math.max(0,M))}In(hv,{reportHeight(M,H){c1.reportHeight(M,H),Da?.reportHeight(M,H)},markPending(M){c1.markPending(M),Da?.markPending(M)},markSettled(M){c1.markSettled(M),Da?.markSettled(M)}});let u1,d1=null,Pa=null;function uf(M){return M!==!1&&M!=null&&M!==""}function O2(){return wt.value?(function(){if(!wt.value)return!0;const M=st.value.length,H=Ho(Po.start,0,M),G=Ho(Po.end,H,M);if(H>=G)return!0;for(let Y=H;Y<G;Y++)if(!lo.has(Y)||L1(Y)&&!Hi.has(Y))return!1;return!0})():po.value>=nf.value}function f1(){return K.value===!0&&!J.value&&Zm.value===0&&jr.size===0&&rr.size===0&&zs==null&&O2()}function R2(){var M,H;if(((M=o.virtualScroll)==null?void 0:M.settleMode)!=="manual"||d1===jn()&&u1===Mo())return!0;const G=(H=o.virtualScroll)==null?void 0:H.settledToken;return!!uf(G)&&Pa===xu(G)}function h1(){return f1()&&R2()}function P8(M,H){return H.totalNodes<=0?M==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?M==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function jl(M="manual",H){const G=I2(),Y=(function(oe){return oe||(K.value!==!0?st.value.length>0?"streaming":"estimating":!O2()||rr.size>0||zs!=null?"measuring":h1()?"settled":"settling")})(H);return{sessionKey:jn(),threadKey:Mo(),phase:Y,nodeCount:G.totalNodes,liveRange:{start:Po.start,end:Po.end},renderedCount:po.value,measuredCount:G.measuredCount,estimatedCount:G.estimatedCount,averageNodeHeight:G.averageNodeHeight,topSpacerHeight:G.topSpacerHeight,bottomSpacerHeight:G.bottomSpacerHeight,visibleDomHeight:D8(),totalHeight:B2(),width:G.width,final:K.value===!0,stable:h1(),confidence:P8(Y,G),reason:M}}function au(){const M=es.value||se(),H=S.value;if(!M||!H)return null;const G=M.ownerDocument||H.ownerDocument||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement,oe=ft("getScrollBox.scrollTop",()=>Q(M,G,Y)),Se=ft("getScrollBox.scrollHeight",()=>{var Le,Ue,Re,Ke,qe;return Y?Math.max((Ue=(Le=G.documentElement)==null?void 0:Le.scrollHeight)!=null?Ue:0,(Ke=(Re=G.body)==null?void 0:Re.scrollHeight)!=null?Ke:0,(qe=M.scrollHeight)!=null?qe:0):M.scrollHeight}),Te=ft("getScrollBox.clientHeight",()=>{var Le;return Y?((Le=G.documentElement)==null?void 0:Le.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:G,isViewportRoot:Y,scrollTop:oe,scrollHeight:Se,clientHeight:Te}}function B2(){const M=st.value.length,H=Math.max(0,Kr(0,M)),G=ft("getRendererLogicalHeight.offsetHeight",()=>{var oe,Se;return(Se=(oe=S.value)==null?void 0:oe.offsetHeight)!=null?Se:0}),Y=Math.max(0,G>0?G:ft("getRendererLogicalHeight.scrollHeight",()=>{var oe,Se;return(Se=(oe=S.value)==null?void 0:oe.scrollHeight)!=null?Se:0}));return M<=0?Math.ceil(G):wt.value?H>0?Math.max(1,Math.ceil(H),(function(){let oe=s1.value+i1.value;for(const Se of lo.values())Se&&(oe+=Math.max(0,ft("getVirtualizedDomLogicalHeight.offsetHeight",()=>Se.offsetHeight||0)));return Math.ceil(Math.max(0,oe))})(),(function(oe,Se){return oe<=0||Se<=0?0:Se<=oe+Math.max(512,.05*oe)?Math.ceil(Se):0})(H,Y)):Math.max(1,Math.ceil(Y)):ze.value?H>0||Ge.count>0||N2()>0?(Si.value&&po.value,Math.max(1,Math.ceil(Y),Math.ceil(H))):Math.ceil(Y):Math.max(1,Math.ceil(Y),Math.ceil(H))}function D2(M){const H=S.value;if(!H)return null;const G=ft("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(oe){return oe.isViewportRoot?oe.clientHeight:ft("getViewportBottomInRoot.getBoundingClientRect",()=>oe.root.getBoundingClientRect().bottom)})(M)-G.bottom}function H8(M={}){const H=M.requireViewport!==!1,G=(function(Se=64){const Te=au(),Le=S.value;if(!Te||!Le)return!1;const Ue=(function(Ke){if(Ke.isViewportRoot)return{top:0,bottom:Ke.clientHeight};const qe=ft("getVirtualViewportRect.getBoundingClientRect",()=>Ke.root.getBoundingClientRect());return{top:qe.top,bottom:qe.bottom}})(Te),Re=ft("isRendererNearVirtualViewport.getBoundingClientRect",()=>Le.getBoundingClientRect());return Re.bottom>=Ue.top-Se&&Re.top<=Ue.bottom+Se})();if(H&&!G)return null;const Y=(function(){const Se=au(),Te=S.value;if(!Se||!Te||Math.max(0,Se.scrollHeight-Se.scrollTop-Se.clientHeight)>64)return null;const Le=D2(Se);return Le==null?null:Le>=-8&&Le<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Le)}:null})();if(Y)return{anchor:Y,captured:!0};const oe=X();if(oe)return{anchor:{type:"node",nodeIndex:oe.nodeIndex,offsetWithinNodePx:oe.offsetWithinNodePx},captured:G};if(M.allowFallback===!0){const Se=(function(){const Te=st.value.length;return Te<=0?null:{type:"node",nodeIndex:Ho(si.value,0,Math.max(0,Te-1)),offsetWithinNodePx:0}})();return Se?{anchor:Se,captured:!1}:null}return null}function p1(M){let H=2166136261;for(let G=0;G<M.length;G++)H^=M.charCodeAt(G),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function W8(M,H){let G=M;for(let Y=0;Y<H.length;Y++)G^=H.charCodeAt(Y),G=Math.imul(G,16777619);return G^=31,G=Math.imul(G,16777619),G}const z8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function df(M,H=new WeakSet,G=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(Y){const oe=Y.length>8192?`${Y.slice(0,8192)}...${Y.length}`:Y;return`${Y.length}:${p1(oe)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(H.has(M))return"cycle";if(G>=6)return"max-depth";H.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Re=[];for(let Ke=0;Ke<M.length;Ke++)Re.push(df(M[Ke],H,G+1));return`a:${M.length}:${Re.join(",")}`}const Se=[],Te=[],Le=Math.max(0,M.length-32);let Ue=2166136261;for(let Re=0;Re<M.length;Re++){const Ke=df(M[Re],H,G+1);Ue=W8(Ue,Ke),Re<32&&Se.push(Ke),Re>=Le&&Te.push(Ke)}return[`a:${M.length}`,`h=${Se.join(",")}`,`t=${Te.join(",")}`,`all=${(Ue>>>0).toString(36)}`].join(":")}const Y=M,oe=Object.keys(Y).filter(Se=>{const Te=Y[Se];return Se!=="parent"&&Se!=="el"&&Se!=="component"&&(Te==null||typeof Te=="string"||typeof Te=="number"||typeof Te=="boolean"||z8.has(Se))}).sort();return`o:${oe.length}:${oe.map(Se=>`${Se}=${df(Y[Se],H,G+1)}`).join(";")}`}finally{H.delete(M)}}let P2=-1,m1="";function cu(M){const H=st.value[M];return H?p1(df(H)):""}function g1(){const M=q.value;if(P2===M)return m1;let H=2166136261;for(let G=0;G<st.value.length;G++){const Y=cu(G);for(let oe=0;oe<Y.length;oe++)H^=Y.charCodeAt(oe),H=Math.imul(H,16777619)}return m1=(H>>>0).toString(36),P2=M,m1}function Ha(M,H={}){var G;const Y=H.includeHeightCache===!0,oe=(G=H.includeContentHash)!=null?G:Y,Se=Y?(function(Le){const Ue=(function(){var tt,_t;const lt=Number((_t=(tt=o.virtualScroll)==null?void 0:tt.heightCacheLimit)!=null?_t:5e3);return!Number.isFinite(lt)||lt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(lt))})();if(!Number.isFinite(Ue)||Le.length<=Ue)return Le;const Re=new Map,Ke=tt=>{!tt||Re.size>=Ue||Re.set(tt.index,tt)},qe=st.value.length,Be=Ho(Po.start-2*iu.value,0,qe),Ve=Ho(Po.end+2*iu.value,Be,qe);for(const tt of Le)tt.index>=Be&&tt.index<Ve&&Ke(tt);const et=Math.max(1,Math.ceil(Le.length/Ue));for(let tt=0;tt<Le.length&&Re.size<Ue;tt+=et)Ke(Le[tt]);for(let tt=Le.length-1;tt>=0&&Re.size<Ue;tt-=et)Ke(Le[tt]);return Array.from(Re.values()).sort((tt,_t)=>tt.index-_t.index).slice(0,Ue)})(Jt().map(Le=>{var Ue;const Re=st.value[Le.index];return Re?Rt(rt({},Le),{nodeType:String((Ue=Re.type)!=null?Ue:""),signature:cu(Le.index)}):null}).filter(Le=>!!Le)):[],Te=H8({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Te||Se.length||H.includeEmptyState===!0?Rt(rt({sessionKey:M.sessionKey,threadKey:M.threadKey},Te?{anchor:Te.anchor,anchorCaptured:Te.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:oe?g1():void 0,measurementKey:lr()||void 0,heightCache:Se.length?Se:void 0}):null}function v1(M){var H,G;const Y=au();if(!Y)return;const oe=(function(Le){const Ue=S.value;if(!Ue)return null;const Re=ke(Ue,Le.root),Ke=st.value.length,qe=ft("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Ue.offsetHeight||0),Be=Math.max(0,qe>0?qe:Ke>0?ft("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Ue.scrollHeight||0):0),Ve=B2();return Re+Math.max(Be,Ve)})(Y);if(oe==null)return;const Se=Math.max(0,M.distanceFromBottomPx),Te=Math.max(0,oe-Y.clientHeight-Se);(function(Le){ve=pu()+120,de=Le})(Te),Y.isViewportRoot?(G=(H=Y.doc.defaultView)==null?void 0:H.scrollTo)==null||G.call(H,0,Te):QS(Y.root,Y.doc,Te,{isReverseFlexScrollRoot:V,getNormalizedScrollTop:Q})}const y1=[];function H2(){if(ee)for(te!=null&&(Dn?.(te),te=null);y1.length;){const M=y1.pop();M!=null&&window.clearTimeout(M)}}function Wa(M){const H=!!Ce.value;Ce.value=null,ve=0,de=null,H2(),H&&M&&Pn(M)}function za(){if(!Ce.value||!ee||te!=null)return;const M=()=>{te=null;const H=Ce.value;H&&v1(H)};te=Bn?Bn(M):null,te==null&&M()}function W2(M,H={}){const G=st.value.length;return G<=0?[]:M.filter(Y=>!(!Number.isInteger(Y.index)||Y.index<0||Y.index>=G)&&!(!Number.isFinite(Y.height)||Y.height<=0)&&!(H.requireSignature&&!Y.signature)&&!(H.requireCompatibilityMetadata&&!Y.nodeType&&!Y.signature)&&(function(oe){var Se;const Te=st.value[oe.index];return!(!Te||oe.nodeType&&oe.nodeType!==String((Se=Te.type)!=null?Se:"")||oe.signature&&oe.signature!==cu(oe.index))})(Y))}function z2(M){const H=lu(ql()),G=lu(M);return H!==-1&&G!==-1&&H===G}function k1(M){var H;const G=Number(M?.width);if(Number.isFinite(G)&&G>0)return G;const Y=Number((H=M?.metrics)==null?void 0:H.width);return Number.isFinite(Y)&&Y>0?Y:null}function U2(M){var H;return M.sessionKey===jn()&&!!l1(M.threadKey)&&((H=M.measurementKey)!=null?H:"")===lr()&&!!z2(k1(M))&&!!(function(G){const Y=G.heightCache;return!!Y?.length&&(q2(G)?Y.some(oe=>!!(oe.nodeType||oe.signature)):Y.some(oe=>!!oe.signature))})(M)}function q2(M){return!!(M.contentHash&&M.contentHash===g1())}function U8(M){return!q2(M)}let Vl=null,Kl=null,ff=null,uu=null,du=null;function b1(M){var H;const G=M.map(oe=>{var Se,Te;return[oe.index,Math.round(10*oe.height),(Se=oe.nodeType)!=null?Se:"",(Te=oe.signature)!=null?Te:""].join("")}).join(""),Y=lu(ql());return[(H=Mo())!=null?H:"",jn(),lr(),st.value.length,Y,M.length,p1(G)].join(":")}function j2(M=(H=>(H=o.virtualScroll)==null?void 0:H.heightCache)()){if(!ze.value||!M?.length||st.value.length<=0||!z2((H=o.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const G=W2(M,{requireSignature:!0});if(!G.length)return!1;const Y=b1(G);return Y===Vl?(Kl="standalone",!0):(f2(G,{mode:"merge"}),ii(),Vl=Y,Kl="standalone",gu(),Pn("restore"),!0)}function x1(M,H={}){var G,Y,oe;if(!ze.value||!M||M.sessionKey!==jn()||!l1(M.threadKey)||st.value.length<=0)return!1;const Se=!!((G=M.heightCache)!=null&&G.length)&&!hf(),Te=!M.anchor||M.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:M.anchor,Le=H.restoreAnchor===!0&&!!Te&&!hf()&&Number(k1(M))>0;let Ue=!1;if((Y=M.heightCache)!=null&&Y.length&&U2(M)){const Ke=W2(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:U8(M)});Ke.length&&(f2(Ke,{mode:"merge"}),ii(),Vl=b1(Ke),Kl="restore",gu(),Ue=!0)}if(Se||Le)return!1;if(!H.restoreAnchor||!Te)return Ue&&Pn("restore"),!0;const Re=(function(Ke,qe){var Be;const Ve=Ke.anchor,et=Ve?Ve.type==="bottom"?`bottom:${Math.round(Ve.distanceFromBottomPx)}`:`node:${Ve.nodeIndex}:${Math.round(Ve.offsetWithinNodePx)}`:"none";return[(Be=Mo())!=null?Be:"",jn(),lr(),cf.value,qe,et].join(":")})(M,(oe=H.restoreToken)!=null?oe:"imperative");return ff===Re?(Ue&&Pn("restore"),!0):(ff=Re,(function(Ke){const qe=()=>{if(Ke.type==="node")return Wa(),void xe({nodeIndex:Ke.nodeIndex,offsetWithinNodePx:Ke.offsetWithinNodePx});if(rn(),_e.value=null,Ce.value=Ke,H2(),v1(Ke),ee)for(const Be of[0,120,280,480])y1.push(window.setTimeout(()=>{const Ve=Ce.value;Ve&&v1(Ve)},Be))};(function(Be){if(!wt.value)return!1;const Ve=st.value.length;return!(Ve<=0||(si.value=Be.type==="node"?Ho(Be.nodeIndex,0,Ve-1):Ve-1,Wl(),0))})(Ke)?mt(qe):qe()})(Te),Pn("restore"),!0)}function hf(){const M=ql();return Number.isFinite(M)&&M>0}function V2(M){var H;return M.sessionKey===jn()&&!!l1(M.threadKey)&&(st.value.length<=0||!(!((H=M.heightCache)!=null&&H.length)||hf())||!(!(M.anchor&&Number(k1(M))>0)||hf()))}function w1(){qn.clear();for(const M of Object.keys(Oe)){const H=Number(M);Number.isInteger(H)&&H>=0&&H<st.value.length&&Hl(H)}}function fu(){zs!=null&&(Dn?.(zs),zs=null),$1()}function K2(){return!ee||Bs?Promise.resolve():new Promise(M=>{let H=!1,G=null;const Y=()=>{H||(H=!0,G!=null&&window.clearTimeout(G),M())};if(Bn)return Bn(Y),void(G=window.setTimeout(Y,50));G=window.setTimeout(Y,0)})}function _1(M,H=Mo(),G=Us.value){return jn()===M&&Mo()===H&&Us.value===G}function S1(){return Gn(this,arguments,function*(M={}){var H,G,Y,oe,Se;const Te=jn(),Le=Mo(),Ue=Us.value,Re=(H=M.frames)!=null?H:2,Ke=(G=M.timeoutMs)!=null?G:120,qe=(Y=M.reason)!=null?Y:"manual",Be=M.expectedSettledTokenKey,Ve=M.flushPendingTimers===!0,et=jl(qe),tt=()=>Rt(rt({},et),{phase:et.final?"settling":et.phase,stable:!1,confidence:et.confidence==="final"?"mixed":et.confidence,reason:qe}),_t=()=>_1(Te,Le,Ue)&&(Be==null||mu()===Be);for(let Ct=0;Ct<Re;Ct++){if(yield mt(),!_t()||(yield K2(),!_t()))return tt();ar(),fu()}if(yield(function(Ct){return!ee||Ct<=0?Promise.resolve():new Promise(tn=>window.setTimeout(tn,Ct))})(Ke),!_t()||(Ve&&x2(),ar(),fu(),!_t()))return tt();const lt=f1();lt&&(d1=Te,u1=Le,((oe=o.virtualScroll)==null?void 0:oe.settleMode)==="manual"&&Be!=null&&uf((Se=o.virtualScroll)==null?void 0:Se.settledToken)&&mu()===Be&&(Pa=xu(o.virtualScroll.settledToken)));const dt=_t()&&lt&&R2(),At=jl(qe,dt?"final":void 0);return T1(At,!0),At})}let C1="content",Gl=null,Yl=null,A1=0,hu=null,Ua=null,M1=null,E1=null;function pu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function G2(M){var H,G;const Y=hu;if(!Y)return!0;const oe=(G=(H=o.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?G:1;return Math.abs(M.totalHeight-Y.totalHeight)>oe||M.sessionKey!==Y.sessionKey||M.phase!==Y.phase||M.stable!==Y.stable||M.final!==Y.final||M.threadKey!==Y.threadKey||M.nodeCount!==Y.nodeCount||M.measuredCount!==Y.measuredCount||M.width!==Y.width}function Lo(M){if(M==null)return"";if(typeof M=="string"||typeof M=="number"||typeof M=="boolean")return String(M);try{return JSON.stringify(M)}catch{return String(M)}}function mu(M=(H=>(H=o.virtualScroll)==null?void 0:H.settledToken)()){return Lo(M)}function Y2(M,H){var G,Y;return[M,H.sessionKey,(G=H.threadKey)!=null?G:"",lr(),g1(),Lo((Y=o.virtualScroll)==null?void 0:Y.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function gu(){M1=null,E1=null,Ua=null}function q8(M){const H=M.heightCache;return H?.length?b1(H):""}function vu(M){var H,G,Y;const oe=M.metrics,Se=M.anchor?(Te=M.anchor).type==="bottom"?`bottom:${Math.round(Te.distanceFromBottomPx)}`:`node:${Te.nodeIndex}:${Math.round(Te.offsetWithinNodePx)}`:"none";var Te;return[M.sessionKey,(H=M.threadKey)!=null?H:"",(G=M.measurementKey)!=null?G:lr(),(Y=M.contentHash)!=null?Y:"",q8(M),Se,M.anchorCaptured?1:0,oe.liveRange.start,oe.liveRange.end,oe.renderedCount,oe.nodeCount,Math.round(oe.totalHeight),Math.round(oe.width),oe.phase,oe.stable?1:0].join("\0")}function T1(M,H=!1){if(!ze.value||(function(Te=!1){return!Te&&Sn.value&&!Ze.value})(H))return;const G=H||G2(M),Y=(function(Te,Le=!1){return Le||Te.stable||Te.phase==="final"?{state:Ha(Te,{includeHeightCache:!0})}:{state:Ha(Te)}})(M,H),oe=Y.state,Se=!!(oe&&(G||(function(Te,Le=!1){return!!Le||vu(Te)!==Ua})(oe,H)));if(G&&(E(M),hu=M,A1=pu()),oe&&Se&&(T(oe),oe.anchor&&F(oe.anchor),Ua=vu(oe)),M.stable){const Te=Y2("settled",M);if(Te!==M1){M1=Te;const Le=Ha(M,{includeHeightCache:!0});Le&&(T(Le),Ua=vu(Le)),(function(Ue){s("render-settled",Ue)})(M)}}if(M.phase==="final"){const Te=Y2("final",M);if(Te!==E1){E1=Te;const Le=Ha(M,{includeHeightCache:!0});Le&&(T(Le),Ua=vu(Le)),(function(Ue){s("render-final",Ue)})(M)}}}function N1(){Gl!=null&&(Dn?.(Gl),Gl=null),Yl!=null&&ee&&(window.clearTimeout(Yl),Yl=null)}function Z2(){Gl=null,Yl=null,(function(M){if(rr.size>0||zs!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(C1)&&(ar(),fu()),T1(jl(C1))}function Pn(M){var H,G;if(!ze.value||(C1=M,Gl!=null||Yl!=null))return;const Y=Math.max(0,(G=(H=o.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?G:32),oe=Math.max(0,Y-(pu()-A1)),Se=()=>{Yl=null,Gl=Bn?Bn(Z2):null,Gl==null&&Z2()};ee&&oe>0?Yl=window.setTimeout(Se,oe):Se()}function I1(M){var H;if(M<=0)return 0;const G=st.value;if(kt.value)return T2(M);if(ot.value===G.length&&Et.value.length&&Xt.value.length){const oe=Vt.value,Se=Et.value,Te=Xt.value,Le=qe=>qe<=0?0:Jn(Se,0,qe)+(qe-Jn(Te,0,qe))*oe;let Ue=0,Re=G.length-1,Ke=G.length-1;for(;Ue<=Re;){const qe=Ue+Re>>1;Le(qe+1)>=M?(Ke=qe,Re=qe-1):Ue=qe+1}return Ke}let Y=M;for(let oe=0;oe<G.length;oe++){const Se=(H=Oe[oe])!=null?H:Vt.value;if(Y<=Se)return oe;Y-=Se}return Math.max(0,G.length-1)}function X2(){Bo.value+=1}function L1(M){return!(Si.value&&M>=po.value)&&(!Ur.value||M<ho.value||Jm.value.has(M))}function qa(M){const H=rf.get(M);H&&(H(),rf.delete(M));const G=Oa.get(M);G&&(G.destroy(),Oa.delete(M)),lf(M)}function Q2(M,H){let G=!1;if(H){const Se=lo.get(M);lo.set(M,H),Se!==H&&(G=!0)}else lo.delete(M)&&(G=!0);if(G&&X2(),H||lf(M),!h2.value||!Qo||!wt.value&&Ur.value&&!z.value&&Oa.size>=640&&(z.value||(z.value=!0,e1()),!h2.value||!Qo))return qa(M),void(H&&Vr(M,!0));if(M<ho.value&&!wt.value||Jm.value.has(M))return qa(M),void Vr(M,!0);if(!H)return void qa(M);qa(M);const Y=Qo(H,{rootMargin:"400px"});if(!Y)return;Oa.set(M,Y),Vr(M,Y.isVisible.value),Ur.value&&(function(Se){if(!ee||!Ur.value)return;lf(Se);const Te=Se%17*23,Le=window.setTimeout(()=>{if(w2.delete(Se),!Ur.value||Jm.value.has(Se))return;const Ue=lo.get(Se);if(!Ue)return;const Re=se(Ue),Ke=Ue.ownerDocument||document,qe=Ke.defaultView||window,Be=!Re||Re===Ke.documentElement||Re===Ke.body,Ve=!Be&&Re?ft("nodeVisibilityFallback.root.getBoundingClientRect",()=>Re.getBoundingClientRect()):null,et=Be?0:Ve.top,tt=Be?ft("nodeVisibilityFallback.clientHeight",()=>{var lt,dt;return(dt=(lt=qe.innerHeight)!=null?lt:Re?.clientHeight)!=null?dt:0}):Ve.bottom,_t=ft("nodeVisibilityFallback.node.getBoundingClientRect",()=>Ue.getBoundingClientRect());_t.bottom>=et-500&&_t.top<=tt+500&&Vr(Se,!0)},1800+Te);w2.set(Se,Le)})(M);let oe=null;oe=Qe(()=>Y.isVisible.value,Se=>{if(Se){lf(M),Vr(M,!0),oe?.(),rf.delete(M),Oa.get(M)===Y&&Oa.delete(M);try{Y.destroy()}catch{}}},{immediate:!0}),rf.set(M,oe),wt.value&&zi()}function $1(){zs=null;for(const[M,H]of rr)rr.delete(M),Hi.get(M)===H.el&&zl.get(M)===H.version&&ef(M,H.height,{allowShrink:H.allowShrink})}function ja(){zs!=null&&(Dn?.(zs),zs=null),rr.clear()}function pf(M,H){(function(G,Y,oe){var Se;if(!Number.isFinite(oe)||oe<=0||Hi.get(G)!==Y)return;const Te=zl.get(G);if(Te==null)return;const Le=st.value[G],Ue=J.value&&K.value!==!0&&!((Se=o.nodes)!=null&&Se.length)&&G>=st.value.length-2,Re=!(Le?.loading===!0||Ue),Ke=rr.get(G),qe=Ke?Ke.allowShrink&&Re:Re,Be=Ke&&!qe?Math.max(Ke.height,oe):oe;rr.set(G,{height:Be,allowShrink:qe,version:Te,el:Y}),zs==null&&(zs=Bn?Bn($1):null,zs==null&&$1())})(M,H,d2(M,H))}function ar(){for(const[M,H]of Hi)H&&pf(M,H)}function J2(){Co?.disconnect(),Co=null,Jo.clear()}function F1(){for(;tf.length;)sf(tf.pop())}Qe(Ze,M=>{M&&Pn("content")},{flush:"post"}),t({getVirtualMetrics:jl,captureVirtualState:function(M={}){var H;return Ha(jl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(H=M.includeEmptyState)==null||H})},restoreVirtualState:function(M,H={}){const G=H.restoreAnchor===!0,Y=H.restoreToken==null?"imperative":String(H.restoreToken);uu=M,du={restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!x1(M,{restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&V2(M)||(uu=null,du=null)},forceMeasure:function(M="manual"){return Gn(this,null,function*(){yield mt(),yield K2(),ar(),fu(),yield mt();const H=jl(M);return T1(H,!0),H})},settle:S1,scrollToNode:function(M,H="start"){Wa(),rn();const G=st.value.length;if(G<=0)return;const Y=Ho(M,0,G-1),oe=()=>{var Se;const Te=Ot({nodeIndex:Y,offsetWithinNodePx:0}),Le=af(Y),Ue=au(),Re=(Se=Ue?.clientHeight)!=null?Se:0,Ke=He();let qe=Te;if(H==="center")qe=Te-Re/2+Le/2;else if(H==="end")qe=Te-Re+Le;else if(H==="nearest"&&Ke!=null){if(Te>=Ke&&Te+Le<=Ke+Re)return;qe=Te<Ke?Te:Te-Re+Le}$t(Math.max(0,qe)),zi({immediate:!0}),wt.value&&(si.value=Y,Wl())};if(wt.value)return si.value=Y,Wl(),void mt(oe);oe()}}),Qe(()=>Xo.value,M=>{if(!M){J2();for(const H of qr.values())for(const G of H)sf(G);qr.clear(),zl.clear(),F1(),ja()}},{immediate:!0}),Qe(K,M=>{M&&(function(){if(ee&&K.value&&Hi.size){F1();for(const H of[80,240,640]){const G=b2(H,()=>{for(const[Y,oe]of Hi)oe&&pf(Y,oe)},"final");G!=null&&tf.push(G)}}})(),Pn(M?"final":"content")}),Qe([()=>st.value.length,()=>po.value],()=>{Ce.value&&za(),Pn("content")},{flush:"post",immediate:!0}),Qe([()=>Po.start,()=>Po.end],()=>{Pn("batch")},{flush:"post"});const{cleanupBatchScheduler:j8}=(function(M){const{props:H,isClient:G,isTestEnv:Y,parsedNodesIdentity:oe,parsedNodeCount:Se,desiredRenderedCount:Te,datasetKey:Le,batchingEnabled:Ue,incrementalRenderingActive:Re,resolvedBatchSize:Ke,resolvedInitialBatch:qe,renderedCount:Be,adaptiveBatchSize:Ve,previousRenderContext:et,previousBatchConfig:tt,requestFrame:_t,cancelFrame:lt,hasIdleCallback:dt,cleanupNodeVisibility:At,onDatasetKeyChanged:Ct,onDatasetChanged:tn}=M;let Nt=null,Ht=null,Dt=!1,dn=null,qs=null,ls=0,Mi=!1,Gr=!1;const Yr=new Set,Xl=new Set;function vb(){if(G){Nt!=null&&(lt?.(Nt),Nt=null),Ht!=null&&(window.clearTimeout(Ht),Ht=null),qs!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(qs),qs=null),ls+=1;for(const ts of Yr)lt?.(ts);Yr.clear();for(const ts of Xl)window.clearTimeout(ts);Xl.clear(),Dt=!1,dn=null,Mi=!1,Gr=!1}}function xf(){return typeof performance<"u"?performance.now():Date.now()}function yb(ts){(function(cr){var Zr;if(!Re.value)return;const ur=Math.max(2,(Zr=H.renderBatchBudgetMs)!=null?Zr:6),dr=Math.max(1,Ke.value||1),Ei=Math.max(1,Math.floor(dr/4));cr>1.2*ur?Ve.value=Math.max(Ei,Math.floor(.7*Ve.value)):cr<.5*ur&&Ve.value<dr&&(Ve.value=Math.min(dr,Math.ceil(1.2*Ve.value)))})(ts),Mi=!1;const _s=Gr||Be.value<Te.value;Gr=!1,_s&&xb()}function kb(ts,_s={}){var cr,Zr;if(!Re.value)return;const ur=Te.value;if(Be.value>=ur)return;const dr=Math.max(1,ts),Ei=()=>{const Ga=xf();let Ya=0;Nt=null,Ht=null,qs=null,Dt=!1;const Za=dn??dr;dn=null;const z1=xf();Be.value=Math.min(ur,Be.value+Za),At(Be.value),Ya=xf()-z1,(function(U1,wb){if(!G)return void yb(wb);Mi=!0;const _b=++ls;mt().then(()=>{var Sb;if(_b!==ls)return;const dE=xf(),fE=Math.max(wb,dE-U1),Cb=()=>{_b===ls&&yb(fE)};if(_t){let Mb=!1,fr=null;const Eb=()=>{Mb||(Mb=!0,Cb())},wf=_t(()=>{Yr.delete(wf),fr!=null&&(window.clearTimeout(fr),Xl.delete(fr),fr=null),Eb()});return Yr.add(wf),fr=window.setTimeout(()=>{fr!=null&&Xl.delete(fr),fr=null,lt?.(wf),Yr.delete(wf),Eb()},Math.max(32,(Sb=H.renderBatchIdleTimeoutMs)!=null?Sb:120)),void Xl.add(fr)}const Ab=window.setTimeout(()=>{Xl.delete(Ab),Cb()},0);Xl.add(Ab)})})(Ga,Ya)};if(!G||_s.immediate)return void Ei();const Xr=Math.max(0,(cr=H.renderBatchDelay)!=null?cr:16);if(dn=dn!=null?Math.max(dn,dr):dr,!Dt){if(Dt=!0,!Y&&dt&&window.requestIdleCallback){const Ga=Math.max(0,(Zr=H.renderBatchIdleTimeoutMs)!=null?Zr:120);return void(qs=window.requestIdleCallback(()=>Ei(),{timeout:Ga}))}_t&&!Y?Nt=_t(()=>{Xr!==0?Ht=window.setTimeout(()=>Ei(),Xr):Ei()}):Ht=window.setTimeout(()=>Ei(),Xr)}}function bb(ts,_s={}){Mi?Gr=!0:ts==null?xb():kb(ts,_s)}function xb(){Re.value&&kb(Ue.value?Math.max(1,Math.round(Ve.value)):Math.max(1,Ke.value))}return Qe([oe,Se,Le,Re,Ke,qe,()=>H.renderBatchDelay],()=>{var ts;const _s=Se.value,cr=et.value,Zr=Le.value,ur=!Object.is(Zr,cr.key),dr=_s!==cr.total,Ei=ur||dr;et.value={key:Zr,total:_s};const Xr=tt.value,Ga=(ts=H.renderBatchDelay)!=null?ts:16,Ya=Xr.batchSize!==Ke.value||Xr.initial!==qe.value||Xr.delay!==Ga||Xr.enabled!==Re.value;tt.value={batchSize:Ke.value,initial:qe.value,delay:Ga,enabled:Re.value},ur&&Ct(_s),(Ei||Ya||!Re.value)&&vb(),(Ei||Ya)&&(Ve.value=Math.max(1,Ke.value||1)),Ei&&tn();const Za=Te.value;if(!_s)return Be.value=0,void At(0);if(!Re.value)return Be.value=Za,void At(Be.value);const z1=ur||cr.total===0;Be.value=z1||Ya?Math.min(Za,qe.value):Math.min(Be.value,Za);const U1=Math.max(1,qe.value||Ke.value||_s);Be.value<Za?bb(U1,{immediate:!G}):At(Be.value)},{immediate:!0}),Qe(Te,(ts,_s)=>{Re.value&&(typeof _s=="number"&&ts<=_s||ts>Be.value&&bb())}),{cleanupBatchScheduler:vb}})({props:w,isClient:ee,isTestEnv:Bs,parsedNodesIdentity:so,parsedNodeCount:io,desiredRenderedCount:nf,datasetKey:B8,batchingEnabled:Pi,incrementalRenderingActive:Si,resolvedBatchSize:_i,resolvedInitialBatch:ho,renderedCount:po,adaptiveBatchSize:ir,previousRenderContext:Ds,previousBatchConfig:Ci,requestFrame:Bn,cancelFrame:Dn,hasIdleCallback:ni,cleanupNodeVisibility:I8,onDatasetKeyChanged:M=>{ja(),Ai(),ii(),gu(),M>0&&Io(M)},onDatasetChanged:()=>{wt.value&&zi({immediate:!0})}});Qe([p2,wt,()=>S.value,()=>ue()],([M,H])=>{if(!M)return _2(),void Qm();L8(),H?zi({immediate:!0}):Qm()},{flush:"post",immediate:!0}),Qe([()=>st.value.length,()=>wt.value],M=>Gn(null,[M],function*([H,G]){G&&H&&ee&&(yield mt(),zi({immediate:!0}))}),{flush:"post"}),Qe(kt,M=>{M&&(function(){var H;if(ro.value&&Zo.value&&Un.value&&((H=_o.value)!=null&&H[1]))return;const G=pt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),Y=pt({type:"list_item",children:[G],raw:"- Probe paragraph text"}),oe=pt({type:"list",ordered:!1,items:[Y],raw:"- Probe paragraph text"});ro.value=G,Zo.value=Y,Un.value=oe;const Se={1:null,2:null,3:null,4:null,5:null,6:null};for(let Te=1;Te<=6;Te++)Se[Te]=pt({type:"heading",level:Te,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Te)} Probe heading`});_o.value=Se})()},{immediate:!0}),Qe([()=>S.value,kt],()=>{if(!kt.value)return n1(),void(j.value=0);C2(),n1(),kt.value&&S.value&&typeof ResizeObserver<"u"&&(ru=new ResizeObserver(()=>{C2(),_e.value&&zn(),Ce.value&&za(),Pn("resize")}),ru.observe(S.value))},{immediate:!0}),Qe([kt,kn,Us],()=>Gn(null,null,function*(){if(!kt.value)return ie.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();yield mt(),(function(){if(!kt.value||typeof window>"u")return ie.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=S2(t1(I.value),".paragraph-node");M.paragraph=G0(I.value,H,"pre-wrap");const G=t1(P.value),Y=G?.querySelector(".paragraph-node");M.listItem=G0(P.value,Y,"pre-wrap");const oe=ft("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Te,Le;return(Le=(Te=B.value)==null?void 0:Te.offsetHeight)!=null?Le:0}),Se=ft("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Te,Le;return(Le=(Te=P.value)==null?void 0:Te.offsetHeight)!=null?Le:0});M.listWrapperOverhead=Math.max(0,oe-Se);for(let Te=1;Te<=6;Te++){const Le=S2(t1(W[Te]),`h${Te}`);M.headings[Te]=G0(W[Te],Le,"pre-wrap")}ie.value=M,ii()})()}),{flush:"post",immediate:!0}),Qe(()=>st.value.length,()=>{wt.value&&zi({immediate:!0})}),Qe([kt,j],()=>{ii(),wt.value&&zi({immediate:!0}),_e.value&&zn(),Ce.value&&za(),Pn("resize")},{immediate:!1}),Qe(()=>Ur.value,M=>{if(M)for(const[H,G]of lo)Q2(H,G);else{e1();for(const[H,G]of lo)G&&Vr(H,!0)}},{immediate:!1}),Qe([()=>w.viewportPriority,()=>st.value.length],([M,H])=>{M!==!1?z.value&&H<=200&&(z.value=!1):z.value=!1}),Qe(()=>po.value,()=>{wt.value&&zi({immediate:!0})}),Qe([si,Qn,iu,()=>st.value.length,wt],()=>{Wl()},{immediate:!0});let yu=null,ku=!1,Va=null;function bu(){yu=null,d1=null,u1=void 0,Pa=null,gu()}function O1(){ja(),Ai(),ii(),qn.clear();const M=st.value.length;M>0&&Io(M),w1()}function R1(){N1(),x2(),hu=null,Vl=null,Kl=null,ff=null,uu=null,du=null,ku=!1,bu(),F2("restore"),rn(),Wa()}function xu(M){var H;return[(H=Mo())!=null?H:"",jn(),lr(),cf.value,mu(M),st.value.length,Math.round(Kr(0,st.value.length)),Math.round(ql()),Ge.count,Math.round(Ge.total)].join(":")}function eb(){return Gn(this,null,function*(){var M,H,G,Y;const oe=(M=o.virtualScroll)==null?void 0:M.settledToken,Se=mu(oe),Te=jn(),Le=Mo(),Ue=Us.value;if(ze.value&&((H=o.virtualScroll)==null?void 0:H.settleMode)==="manual"&&uf(oe))if(f1()){if(xu(oe)!==Pa&&!ku){ku=!0;try{const Re=yield S1({reason:"manual",expectedSettledTokenKey:Se}),Ke=mu()===Se;_1(Te,Le,Ue)&&Re.sessionKey===Te&&Re.threadKey===Le&&Ke&&Re.stable&&Re.phase==="final"&&(Pa=xu((G=o.virtualScroll)==null?void 0:G.settledToken))}finally{ku=!1,yield mt();const Re=(Y=o.virtualScroll)==null?void 0:Y.settledToken,Ke=uf(Re)?xu(Re):"";_1(Te,Le,Ue)&&Ke&&Pa!==Ke&&eb()}}}else Pn("manual")})}Qe(ze,(M,H)=>{if(M!==H){if(!M)return R1(),void N1();R1(),O1(),Va=Us.value,Pn("content")}},{flush:"post"}),Qe([ze,Us],([M,H])=>{M?Va!=null?Va!==H&&(Va=H,(function(G="resize"){ja(),Ai(),ii(),qn.clear();const Y=st.value.length;Y>0&&Io(Y),w1(),Vl=null,Kl=null,ff=null,hu=null,ku=!1,bu(),j2(),mt(()=>{ar(),_e.value&&zn(),Ce.value&&za(),Pn(G)})})("resize")):Va=H:Va=null},{flush:"post",immediate:!0}),Qe([ze,()=>jn(),()=>Mo()],([M])=>{M&&(R1(),O1(),F2("content"),Pn("content"))}),Qe([ze,()=>jn(),()=>Mo(),Us,()=>st.value.length],([M])=>{M&&(function(H="async-node"){let G=!1;for(const[Y,oe]of Array.from(Wi.entries()))a1(oe)||(Wi.delete(Y),Ws.delete(Y),G=!0);G&&(Ba(),Pn(H))})("async-node")},{flush:"post"}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>o.indexKey,()=>q.value],([M])=>{M&&(gu(),(function(H="content"){if(!ze.value)return;const G=[],Y=st.value.length;for(const oe of Array.from(qn.keys())){if(oe>=Y){G.push(oe);continue}const Se=cu(oe),Te=qn.get(oe);Te!=null&&Te!==Se&&G.push(oe),qn.set(oe,Se)}for(const oe of Array.from(qn.keys()))oe>=Y&&qn.delete(oe);G.length&&((function(oe,Se={}){const Te=Array.from(oe,Number);zt(Te,Se)>0&&(function(Ue){for(const Re of Ue)qn.delete(Re)})(Te)})(G,{notify:!1}),ii(),bu(),_e.value&&zn(),Ce.value&&za(),Pn(H))})("content"))},{flush:"post",immediate:!0}),Qe([ze,()=>st.value.length,()=>jn(),()=>Mo()],([M,H,G,Y],[oe,Se,Te,Le])=>{M&&oe&&G===Te&&Y===Le&&H!==Se&&bu()},{flush:"post"}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>st.value.length,()=>jn(),j],()=>{j2()},{flush:"post",immediate:!0}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>st.value.length,()=>jn(),j],M=>Gn(null,[M],function*([H,G]){if(!H||!G)return;yield mt();const Y=(function(){var oe;const Se=(oe=o.virtualScroll)==null?void 0:oe.restoreAnchor;return Se==null||Se===!1?null:Se===!0?"true":String(Se)})();x1(G,{restoreAnchor:Y!=null,restoreToken:Y??void 0})}),{flush:"post",immediate:!0}),Qe([ze,j,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var H;if(!M)return;const G=(H=o.virtualScroll)==null?void 0:H.restoreState;G&&Vl&&Kl==="restore"&&(U2(G)||(O1(),Vl=null,Kl=null,Pn("resize")))},{flush:"post"}),Qe([ze,()=>st.value.length,()=>jn(),j],M=>Gn(null,[M],function*([H]){var G;const Y=uu,oe=du;H&&Y&&(yield mt(),!x1(Y,{restoreAnchor:oe?.restoreAnchor===!0,restoreToken:(G=oe?.restoreToken)!=null?G:"imperative",allowUncapturedAnchor:oe?.allowUncapturedAnchor===!0})&&V2(Y)||(uu=null,du=null))}),{flush:"post",immediate:!0}),Qe([ze,K,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>jn(),()=>Mo(),Us,Zm,g2,()=>po.value,nf,()=>Ge.count,()=>Ge.total],([M,H,G])=>{if(!M||H!==!0||G==="manual"||!h1())return;const Y=(function(){var oe;const Se=st.value.length;return[(oe=Mo())!=null?oe:"",jn(),lr(),cf.value,Se,Math.round(Kr(0,Se)),Math.round(ql()),Ge.count,Math.round(Ge.total)].join(":")})();yu!==Y&&(yu=Y,S1({reason:"final"}).then(oe=>{oe.stable||yu!==Y||(yu=null)}))},{flush:"post",immediate:!0}),Qe([ze,K,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settledToken},()=>jn(),()=>Mo(),Us,Zm,g2,()=>po.value,nf,()=>st.value.length,()=>Ge.count,()=>Ge.total],()=>{eb()},{flush:"post",immediate:!0}),Qe([()=>st.value.length,wt,Qn,iu,()=>Po.start,()=>Po.end],([M,H,G,Y,oe,Se])=>{fe.value&&Ie("virtualization",{nodes:M,virtualization:H,maxLiveNodes:G,buffer:Y,focusIndex:si.value,scroll:H?(()=>{const Te=es.value||se();return Te?{reverse:V(Te),scrollTop:Math.round(Te.scrollTop),scrollTopAbs:Math.round(Math.abs(Te.scrollTop)),scrollHeight:Math.round(Te.scrollHeight),clientHeight:Math.round(Te.clientHeight)}:null})():null,liveRange:{start:oe,end:Se},rendered:po.value})}),Qe([()=>w.customId],([M],H,G)=>{if(!M||yn)return;const Y=(function(oe,Se){return oe?(Eo.controllers[oe]=Se,()=>{Eo.controllers[oe]===Se&&delete Eo.controllers[oe]}):()=>{}})(M,{captureRestoreAnchor:X,restoreAnchor:xe,getAnchorDrift:Ae,getReport:F8});G(()=>{Y()})},{immediate:!0}),co(()=>{(function(){if(ze.value)try{ar(),fu();const M=jl("manual");G2(M)&&(E(M),hu=M,A1=pu());const H=Ha(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(T(H),H.anchor&&F(H.anchor),Ua=vu(H))}catch{}})(),j8(),e1(),De(),J2();for(const M of qr.values())for(const H of M)sf(H);qr.clear(),zl.clear(),qn.clear(),F1(),ja(),n1(),rn(),Wa(),N1(),_2(),Qm()});const V8=Li({loader:()=>Gn(null,null,function*(){try{return(yield ps(()=>import("./index11-D6iWwC_8.js"),__vite__mapDeps([8,5]))).default}catch(M){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".',M),js}}),loadingComponent:See,delay:0}),K8=Li({loader:()=>Gn(null,null,function*(){try{return(yield ps(()=>import("./index10-CPYGci3e.js"),[])).default}catch(M){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.',M),js}}),loadingComponent:_ee,delay:0}),G8=Li(()=>Gn(null,null,function*(){try{return(yield ps(()=>import("./index7-Bue6SKki.js"),[])).default}catch(M){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".',M),js}})),tb={text:no,paragraph:wa,heading:Cp,code_block:H0,list:Dc,list_item:Bc,blockquote:_h,table:ad,definition_list:Sh,footnote:Ch,footnote_reference:Xs,footnote_anchor:rd,admonition:Th,vmr_container:Mh,hardbreak:Sl,link:bs,image:_l,thematic_break:Ah,math_inline:Bi,math_block:UM,strong:ys,emphasis:xs,strikethrough:ks,highlight:Js,insert:Fs,subscript:$s,superscript:Ls,emoji:Is,checkbox:Zs,checkbox_input:Zs,inline_code:rs,html_inline:Qs,reference:vs,html_block:ld},Y8=R(()=>r1()),nb=R(()=>XS(w.codeBlockProps)),Z8=R(()=>XS(w.codeBlockProps,{omit:["langs"]})),ob=R(()=>rt(rt({stream:w.codeBlockStream,darkTheme:w.codeBlockDarkTheme,lightTheme:w.codeBlockLightTheme,monacoOptions:w.codeBlockMonacoOptions,themes:w.themes,langs:u.value==="shiki"?w.langs:void 0,minWidth:w.codeBlockMinWidth,maxWidth:w.codeBlockMaxWidth},typeof Me.value=="boolean"?{showTooltips:Me.value}:{}),Z8.value)),sb=R(()=>rt(Rt(rt({},ob.value),{langs:w.langs}),nb.value));function ib(M){return typeof M=="boolean"?M:void 0}const X8=R(()=>{const M=w.codeBlockProps||{},H={},G=ib(M.showLineNumbers);G!==void 0&&(H.showLineNumbers=G);const Y=ib(M.diffInline);Y!==void 0&&(H.diffInline=Y);const oe=(function(Se){const Te=Number(Se);return Number.isFinite(Te)&&Te>0?Te:void 0})(M.reservedHeightPx);return oe!==void 0&&(H.reservedHeightPx=oe),H}),Q8=R(()=>rt(rt({stream:w.codeBlockStream,darkTheme:w.codeBlockDarkTheme,lightTheme:w.codeBlockLightTheme,themes:w.themes,langs:w.langs,minWidth:w.codeBlockMinWidth,maxWidth:w.codeBlockMaxWidth},typeof Me.value=="boolean"?{showTooltips:Me.value}:{}),nb.value)),J8=R(()=>rt({},w.mermaidProps||{})),rb=R(()=>rt({},w.d2Props||{})),eE=R(()=>rt({},w.infographicProps||{})),wu=R(()=>({typewriter:w.typewriter,fade:w.fade,customHtmlTags:fo.value.customHtmlTags})),tE=R(()=>rt(rt({},wu.value),typeof Me.value=="boolean"?{showTooltip:Me.value}:{})),nE=R(()=>rt(rt({},wu.value),typeof Me.value=="boolean"?{showTooltips:Me.value}:{})),oE=R(()=>rt(rt({},wu.value),typeof Me.value=="boolean"?{showTooltips:Me.value}:{})),sE=R(()=>rt(rt({},wu.value),typeof Me.value=="boolean"?{showTooltips:Me.value}:{}));function iE(M){return Array.isArray(M.children)&&M.children.length>0}const B1=R(()=>$8.value.map(M=>{var H,G,Y,oe,Se,Te,Le,Ue;let Re=(function(lt){var dt,At,Ct,tn,Nt,Ht,Dt;if(lt.type!=="code_block")return lt;const dn=lt,qs=[String((dt=dn.language)!=null?dt:""),String((At=dn.loading)!=null?At:""),String((Ct=dn.diff)!=null?Ct:""),String((tn=dn.code)!=null?tn:""),String((Nt=dn.originalCode)!=null?Nt:""),String((Ht=dn.updatedCode)!=null?Ht:""),String((Dt=dn.raw)!=null?Dt:"")].join("\0"),ls=Ps.get(dn);if(ls&&ls.signature===qs)return ls.node;const Mi=rt({},dn);return Ps.set(dn,{signature:qs,node:Mi}),Mi})(M.node);const Ke=mf(Re);let qe=ub(Re,Ke);if((Re.type==="html_block"||Re.type==="html_inline")&&qe===tb[Re.type]){const lt=Re,dt=String((H=lt.tag)!=null?H:"").trim().toLowerCase()||$6(lt.content);if(dt){const At=jt.value[dt];if(vn.value.has(dt)&&At)qe=At,Re=Rt(rt({},lt),{type:dt,tag:dt,content:HV(lt.content,dt)});else if(F6((G=lt.content)!=null?G:lt.raw,dt)){const Ct=String((oe=(Y=lt.content)!=null?Y:lt.raw)!=null?oe:"");Re.type==="html_inline"?(qe=no,Re={type:"text",content:Ct,raw:Ct}):(qe=wa,Re={type:"paragraph",children:[{type:"text",content:Ct,raw:Ct}],raw:Ct})}}}const Be=Re.type==="code_block"&&u.value==="pre"&&qe===js&&!D1(jt.value,Ke);let Ve=rt({},(function(lt,dt,At){const Ct=dt??mf(lt);if(lt.type==="code_block"){const tn=Ct?D1(jt.value,Ct):void 0;if(At&&u.value==="pre"&&!tn&&At===js)return X8.value;if(At&&Ct&&At===tn)return Ct==="mermaid"?ab(lt):Ct==="infographic"?cb(lt):Ct==="d2"||Ct==="d2lang"?rb.value:sb.value;if(At&&At===jt.value.code_block)return sb.value;if(M2(At))return Q8.value}return Ct==="mermaid"?ab(lt):Ct==="infographic"?cb(lt):Ct==="d2"||Ct==="d2lang"?rb.value:lt.type==="link"?tE.value:lt.type==="list"?nE.value:lt.type==="blockquote"?oE.value:lt.type==="table"?sE.value:lt.type==="code_block"?ob.value:wu.value})(Re,Ke,qe));const et=Ul.value[M.index];Re.type==="code_block"&&et?.kind==="code-block"&&(Ve=Rt(rt({},Ve),Be?{reservedHeightPx:(Se=et.height)!=null?Se:et.contentHeight}:{estimatedHeightPx:et.height,estimatedContentHeightPx:et.contentHeight})),Be||Re.type!=="code_block"||Ke!=="mermaid"||wc(Ve.estimatedPreviewHeightPx)!=null||(Ve=Rt(rt({},Ve),{estimatedPreviewHeightPx:yv(gv(String((Te=Re.code)!=null?Te:"")))})),Be||Re.type!=="code_block"||Ke!=="infographic"||wc(Ve.estimatedPreviewHeightPx)!=null||(Ve=Rt(rt({},Ve),{estimatedPreviewHeightPx:kv(vv(String((Le=Re.code)!=null?Le:"")))})),Re.type==="math_block"&&(Ve=Rt(rt({},Ve),{cacheScope:Yo.value}));const tt=(function(lt,dt){const At=String(lt.type);return!Gd(At)&&jt.value[At]===dt})(Re,qe),_t=tt?vk(Re,$e.value):void 0;return Rt(rt({},M),{node:Re,component:qe,bindings:Ve,customBindings:rt(rt({},_t??{}),Ve),rendersCustomNode:tt,hasSlotChildren:iE(Re),slotContent:String((Ue=Re.content)!=null?Ue:""),isCodeBlock:Re.type==="code_block",indexKey:`${Y8.value}-${M.index}`})}));function mf(M){var H;return M?.type==="code_block"?String((H=M.language)!=null?H:"").trim().toLowerCase():""}function D1(M,H){const G=H.trim().toLowerCase();if(G)for(const Y of[G,uk(G),EM(G)]){const oe=Y&&M[Y];if(oe)return oe}}function lb(M,H,G,Y){var oe,Se;const Te=rt({},M.value);return wc(Te.estimatedPreviewHeightPx)==null&&(Te.estimatedPreviewHeightPx=Y(G(String((oe=H?.code)!=null?oe:"")),void 0,Te.maxHeight==="none"?null:(Se=wc(Te.maxHeight))!=null?Se:void 0)),Te}function ab(M){return lb(J8,M,gv,yv)}function cb(M){return lb(eE,M,vv,kv)}function ub(M,H){if(!M)return Tv;const G=jt.value,Y=G[String(M.type)];if(M.type==="code_block"){const oe=H??mf(M),Se=oe?D1(G,oe):void 0;return Se||(u.value==="pre"?G.code_block||js:oe==="mermaid"?G.mermaid||V8:oe==="infographic"?G.infographic||K8:oe==="d2"||oe==="d2lang"?G.d2||G8:Y||G.code_block||E2.value)}return Y||tb[String(M.type)]||Tv}function P1(M){s("click",M)}function rE(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&s("mouseover",M)}function lE(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&s("mouseout",M)}function db(M){s("mouseover",M)}function fb(M){s("mouseout",M)}const Zl=Z(null),Ui=Z(!1);let _u,Ka=null,H1=0,gf=0,vf=0;const hb=["code_block","admonition","table","math_block","html_block","image","thematic_break"],aE=new Set(hb),pb=[".typewriter-cursor",".height-estimation-probes",...hb.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function mb(M){if(!M||typeof M!="object")return!1;const H=M.type;return typeof H=="string"&&aE.has(H)}function yf(M){var H,G;if(!M||typeof M!="object")return 0;const Y=M,oe=(G=(H=Y.raw)!=null?H:Y.content)!=null?G:Y.code;if(typeof oe=="string")return oe.length;const Se=Y.children;if(Array.isArray(Se))return Se.reduce((Le,Ue)=>Le+yf(Ue),0);const Te=Y.items;return Array.isArray(Te)?Te.reduce((Le,Ue)=>Le+yf(Ue),0):0}function kf(){_u&&(clearTimeout(_u),_u=void 0)}function gb(){H1+=1,Ka!=null&&(Dn?.(Ka),Ka=null)}function bf(){gb(),Zl.value&&(Zl.value.style.visibility="hidden")}function cE(M){var H;if(M.nodeType!==Node.TEXT_NODE||!((H=M.textContent)!=null?H:"").trim())return!1;const G=M.parentElement;return!!G&&!G.closest(pb)}function uE(M){let H=M.lastChild;for(;H;){if(cE(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const G=H;if(!G.matches(pb)&&G.lastChild){H=G.lastChild;continue}}for(;H&&H!==M&&!H.previousSibling;)H=H.parentNode;if(!H||H===M)break;H=H.previousSibling}return null}function W1(){if(!ee||!Ui.value||Ka!=null)return;const M=H1,H=()=>{Ka=null,M===H1&&(function(){var G,Y;if(!(ee&&Ui.value&&S.value&&Zl.value))return;const oe=S.value,Se=Zl.value;Se.style.visibility="hidden";const Te=(function(){const qe=B1.value;for(let Be=qe.length-1;Be>=0;Be--){const Ve=qe[Be];if(!Ve||mb(Ve.node)||!L1(Ve.index))continue;const et=lo.get(Ve.index);if(!et)continue;const tt=uE(et);if(tt)return tt}return null})();if(!Te)return;let Le=0,Ue=0,Re=20,Ke=!1;if(Te?.textContent){const qe=Te.textContent.length,Be=document.createRange();Be.setStart(Te,Math.max(0,qe-1)),Be.setEnd(Te,qe);const Ve=typeof Be.getClientRects=="function"?Be.getClientRects():void 0,et=(Y=Ve?.[Ve.length-1])!=null?Y:(G=Te.parentElement)==null?void 0:G.getBoundingClientRect();if(et){const tt=ft("typewriterCursor.root.getBoundingClientRect",()=>oe.getBoundingClientRect());Le=et.right-tt.left+oe.scrollLeft,Ue=et.top-tt.top+oe.scrollTop,Re=et.height||Re,Ke=!0}Be.detach()}Ke&&(Se.style.transform=`translate(${Math.max(0,Le)}px, ${Math.max(0,Ue)}px)`,Se.style.height=`${Re}px`,Se.style.visibility="visible")})()};Bn?Ka=Bn(H):H()}return Qe([ye,()=>o.content,()=>o.nodes,()=>w.typewriter,K],()=>Gn(null,null,function*(){var M,H;if(!ee||ne.value||!U.value)return;if(K.value)return Ui.value=!1,kf(),void bf();if((M=o.nodes)!=null&&M.length)return Ui.value=!1,kf(),bf(),gf=((H=o.content)!=null?H:"").length,void(vf=ye.value.length);const G=(function(){var Le,Ue;return(Le=o.nodes)!=null&&Le.length?o.nodes.reduce((Re,Ke)=>Re+yf(Ke),0):((Ue=o.content)!=null?Ue:"").length})(),Y=(function(){var Le;return(Le=o.nodes)!=null&&Le.length?o.nodes.reduce((Ue,Re)=>Ue+yf(Re),0):ye.value.length})(),oe=!mb(st.value[st.value.length-1]),Se=G>gf,Te=Y>vf;if(w.typewriter===!1||!oe||!Se&&!Te)return w.typewriter!==!1&&oe||(Ui.value=!1,bf()),gf=G,void(vf=Y);gf=G,vf=Y,Ui.value=!0,Zl.value&&(Zl.value.style.visibility="hidden"),kf(),yield mt(),W1(),_u=setTimeout(()=>{_u=void 0,Ui.value=!1},3e3)}),{flush:"post",immediate:!0}),Qe(Ui,M=>Gn(null,null,function*(){M?(yield mt(),W1()):bf()}),{flush:"post"}),Qe([()=>po.value,()=>Po.start,()=>Po.end],()=>Gn(null,null,function*(){ee&&!ne.value&&U.value&&Ui.value&&(yield mt(),W1())}),{flush:"post"}),co(()=>{kf(),gb(),sn.clear()}),(M,H)=>{const G=BT("NodeRenderer",!0);return C(ne)?(x(!0),N(Pe,{key:0},nt(B1.value,Y=>(x(),N(Pe,{key:Y.index},[Y.rendersCustomNode?(x(),be(qo(Y.component),bn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":w.customId,"is-dark":w.isDark,onClick:P1,onMouseover:db,onMouseout:fb,onCopy:H[0]||(H[0]=oe=>s("copy",oe)),onHandleArtifactClick:H[1]||(H[1]=oe=>s("handleArtifactClick",oe))}),{default:Ne(()=>[Y.hasSlotChildren?(x(),be(G,bn({key:0,ref_for:!0},On.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(x(),be(G,bn({key:1,ref_for:!0},On.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),be(qo(Y.component),bn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":w.customId,"is-dark":w.isDark,onClick:P1,onMouseover:db,onMouseout:fb,onCopy:H[2]||(H[2]=oe=>s("copy",oe)),onHandleArtifactClick:H[3]||(H[3]=oe=>s("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(x(),N("div",{key:1,ref_key:"containerRef",ref:S,class:We(["markstream-vue markdown-renderer",[{dark:w.isDark},{virtualized:wt.value},{"virtual-scroll-coordinated":Ze.value}]]),"data-custom-id":w.customId,onClick:P1,onMouseover:rE,onMouseout:lE},[Bt.value||wt.value?(x(),N(Pe,{key:0},[Bt.value?(x(),N("div",{key:0,class:"height-estimation-probes",style:qt({width:`${kn.value}px`}),"aria-hidden":"true"},[_("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[re(C(wa),{node:ro.value,"index-key":"probe-paragraph"},null,8,["node"])],512),_("div",{ref_key:"listItemProbeWrapperRef",ref:P,class:"node-content","data-probe":"list-item"},[_("ul",Aee,[re(C(Bc),{node:Zo.value,"index-key":"probe-list-item"},null,8,["node"])])],512),_("div",{ref_key:"listProbeWrapperRef",ref:B,class:"node-content","data-probe":"list"},[re(C(Dc),{node:Un.value,"index-key":"probe-list"},null,8,["node"])],512),(x(),N(Pe,null,nt(6,Y=>_("div",{key:`probe-heading-${Y}`,ref_for:!0,ref:oe=>(function(Se,Te){Se<1||Se>6||(W[Se]=Te)})(Y,oe),class:"node-content","data-probe":`heading-${Y}`},[re(C(Cp),{node:N8(Y),"index-key":`probe-heading-${Y}`},null,8,["node","index-key"])],8,Mee)),64))],4)):le("",!0),wt.value?(x(),N("div",{key:1,class:"node-spacer",style:qt({height:`${s1.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],64)):le("",!0),(x(!0),N(Pe,null,nt(B1.value,Y=>(x(),N("div",{key:Y.index,ref_for:!0,ref:oe=>Q2(Y.index,oe),class:"node-slot","data-node-index":Y.index,"data-node-type":Y.node.type},[L1(Y.index)?(x(),N("div",{key:0,ref_for:!0,ref:oe=>(function(Se,Te){var Le;Te||(function(qe){const Be=`${r1()}-${qe}`;let Ve=!1;for(const et of Array.from(Ws.keys())){const tt=Wi.get(et);(tt?.index===qe||et===Be||et.startsWith(`${Be}-`))&&(Ws.delete(et),Wi.delete(et),Ve=!0)}Ve&&(Ba(),Pn("async-node"))})(Se),rr.delete(Se),(function(qe){var Be;const Ve=((Be=zl.get(qe))!=null?Be:0)+1;zl.set(qe,Ve)})(Se);const Ue=qr.get(Se);if(Ue){for(const qe of Ue)sf(qe);qr.delete(Se)}if((function(qe){const Be=Jo.get(qe);Be&&(Co?.unobserve(Be),oi.delete(Be),Jo.delete(qe))})(Se),!Te||!Xo.value)return Hi.delete(Se),void zl.delete(Se);Hi.set(Se,Te);const Re=()=>{pf(Se,Te)};queueMicrotask(Re);const Ke=(Co||typeof ResizeObserver>"u"||(Co=new ResizeObserver(qe=>{if(qe.length)for(const Be of qe){const Ve=oi.get(Be.target),et=Jo.get(Ve??-1);Ve!=null&&et&&pf(Ve,et)}else ar()})),Co);if(Ke&&(Jo.set(Se,Te),oi.set(Te,Se),Ke.observe(Te)),typeof window<"u"){const qe=((Le=st.value[Se])==null?void 0:Le.type)==="code_block"?[16,80,240,800]:K.value?[80]:[];if(qe.length){const Be=qe.map(Ve=>b2(Ve,Re,"node-resize")).filter(Ve=>Ve!=null);Be.length&&qr.set(Se,Be)}}})(Y.index,oe),class:"node-content"},[Y.isCodeBlock?Y.rendersCustomNode?(x(),be(qo(Y.component),bn({key:1,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[8]||(H[8]=oe=>s("copy",oe)),onHandleArtifactClick:H[9]||(H[9]=oe=>s("handleArtifactClick",oe))}),{default:Ne(()=>[Y.hasSlotChildren?(x(),be(G,bn({key:0,ref_for:!0},On.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(x(),be(G,bn({key:1,ref_for:!0},On.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),be(qo(Y.component),bn({key:2,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[10]||(H[10]=oe=>s("copy",oe)),onHandleArtifactClick:H[11]||(H[11]=oe=>s("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(x(),be(El,{key:0,name:"fade",css:w.fade!==!1,appear:w.fade!==!1},{default:Ne(()=>[Y.rendersCustomNode?(x(),be(qo(Y.component),bn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[4]||(H[4]=oe=>s("copy",oe)),onHandleArtifactClick:H[5]||(H[5]=oe=>s("handleArtifactClick",oe))}),{default:Ne(()=>[Y.hasSlotChildren?(x(),be(G,bn({key:0,ref_for:!0},On.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(x(),be(G,bn({key:1,ref_for:!0},On.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),be(qo(Y.component),bn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[6]||(H[6]=oe=>s("copy",oe)),onHandleArtifactClick:H[7]||(H[7]=oe=>s("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(x(),N("div",{key:1,class:"node-placeholder",style:qt({height:`${af(Y.index)}px`})},null,4))],8,Eee))),128)),Ui.value?(x(),N("span",{key:1,ref_key:"typewriterCursorRef",ref:Zl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):le("",!0),wt.value?(x(),N("div",{key:2,class:"node-spacer",style:qt({height:`${i1.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],42,Cee))}}})),[["__scopeId","data-v-2e8e6e17"]]),Os=n5;Os.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Os.__name,Os.name].filter(n=>!!n));for(const n of t)e.component(n,n5)};const Sk=Object.freeze(Object.defineProperty({__proto__:null,default:Os},Symbol.toStringTag,{value:"Module"})),Tee={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"},Nee={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"},Iee={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"},Lee={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"},$ee={class:"admonition-title"},Fee=["aria-expanded","aria-controls"],Oee=["id"],Th=mn(Ye({__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 c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.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(c,u)=>(x(),N("div",{class:We(["admonition",[`admonition-${o.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(x(),N("svg",Tee,[...u[1]||(u[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(x(),N("svg",Nee,[...u[2]||(u[2]=[_("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),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(x(),N("svg",Iee,[...u[3]||(u[3]=[_("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),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(x(),N("svg",Lee,[...u[4]||(u[4]=[_("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),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):le("",!0),_("span",$ee,O(i.value),1),o.node.collapsible?(x(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(x(),N("svg",{style:qt({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"},[...u[5]||(u[5]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Fee)):le("",!0)]),$n(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[re(C(Os),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Oee),[[mi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Th.install=e=>{e.component(Th.__name,Th)};const o5=()=>ps(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Qf=null,Ree=o5;function d_e(){return Gn(this,null,function*(){if(Qf)return Qf;const e=Ree;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===o5?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(Qf=(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),Qf):null})}function f_e(){return!1}function h_e(){return Gn(this,null,function*(){return null})}const Jf=Z(!1);let aC=!1;function Z0(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Bee(){return!aC&&typeof window<"u"&&typeof document<"u"&&(aC=!0,Jf.value=Z0(),new MutationObserver(()=>{Jf.value=Z0()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Jf.value=Z0()})),Jf}const s5=["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"],Dee=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Fv=[...s5].sort((e,t)=>t.length-e.length).join("|"),X0=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Fv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Fv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),i5=/[),.;!?,。;!?)]+$/;function Pee(e){const t=e.toLowerCase();return s5.some(n=>t.endsWith(`.${n}`))}function Hee(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Fv}))["']`,"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 Wee(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(i5,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=Dee.has(i),a=Pee(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function zee(e,t={}){const n=[];X0.lastIndex=0;let o;for(;(o=X0.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 c=a.replace(i5,""),u=a.length-c.length;a=c;const d=Wee(a,t);if(!d)continue;const f=o.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(X0.lastIndex-=u)}return n}const Uee=12e4,qee=6e4,jee=32,Vee=3e4,cC=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Kee(e){let t=0,n=0,o=0;cC.lastIndex=0;let s;for(;(s=cC.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=Uee||n>=qee||t>=jee||o>=Vee?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Gee(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Yee(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const Zee={key:1,class:"diff-wrap"},Xee={class:"diff-bar"},Qee=["aria-label","onClick"],Jee={class:"diff-pre"},ete={key:0,class:"diff-sign"},tte={class:"diff-text"},nte="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",uC="github-light",dC="github-dark",ote=Ye({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){LX(),jX(),FX(),ZX(),$X(new Gee),YX(new Yee);function t(B){return B.inline.ruler.disable("math"),B}const{t:n}=Mt(),o=Ut("resolveImage"),s=Z(null),i=e,r=R(()=>!i.streaming),l=R(()=>Hee(i.text??"")),a=R(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Kee(i.text??"")),c=Bee(),u=R(()=>!i.streaming),d=Oo(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function g(B){return!/^(https?:|data:|blob:)/i.test(B)}function b(B){if(!o)return;const W=[];for(const z of[h,p]){z.lastIndex=0;let D;for(;(D=z.exec(B))!==null;)W.push(D[2]??"")}for(const z of W)!z||!g(z)||d.has(z)||f.has(z)||(f.add(z),o(z).then(D=>{d.set(z,D!==z?D:"")}).catch(()=>{d.set(z,"")}).finally(()=>{f.delete(z)}))}function v(B){if(!o)return B;const W=z=>{if(!g(z))return null;const D=d.get(z);return D===void 0?nte:D===""?null:D};return B.replace(h,(z,D,q,j)=>{const ie=W(q);return ie===null?z:`${D}${ie}${j}`}).replace(p,(z,D,q,j)=>{const ie=W(q);return ie===null?z:`${D}${ie}${j}`})}Qe(()=>i.text,B=>b(B??""),{immediate:!0});function m(){if(!s.value||!i.openFile||i.streaming)return;const B=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),W=[];let z=B.nextNode();for(;z;){const D=z,q=D.parentElement;q&&!q.closest("a, pre, .md-file-link, svg")&&D.data.trim().length>0&&W.push(D),z=B.nextNode()}for(const D of W){const q=zee(D.data,{aliases:l.value});if(q.length===0||!D.parentNode)continue;const j=document.createDocumentFragment();let ie=0;for(const ue of q){ue.start>ie&&j.append(document.createTextNode(D.data.slice(ie,ue.start)));const pe=document.createElement("button");pe.type="button",pe.className="md-file-link",pe.textContent=ue.text,pe.title=ue.line?`${ue.path}:${ue.line}`:ue.path,pe.addEventListener("click",ee=>{ee.preventDefault(),ee.stopPropagation(),i.openFile?.({path:ue.path,line:ue.line})}),j.append(pe),ie=ue.end}ie<D.data.length&&j.append(document.createTextNode(D.data.slice(ie))),D.parentNode.replaceChild(j,D)}}function y(B){return!(!B||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(B))}function k(B){let W=B.length;for(const z of["#","?"]){const D=B.indexOf(z);D!==-1&&D<W&&(W=D)}return B.slice(0,W)}function A(){if(!s.value||!i.openFile||i.streaming)return;const B=s.value.querySelectorAll("a[href]");for(const W of B){if(W.dataset.mdLinkHandled==="true"||W.closest("svg"))continue;const z=W.getAttribute("href")??"";y(z)&&(W.dataset.mdLinkHandled="true",W.addEventListener("click",D=>{D.preventDefault(),D.stopPropagation(),i.openFile?.({path:k(z)})}))}}function $(){mt().then(()=>{m(),A()})}Qe(()=>i.text,$),Qe(()=>i.streaming,$);let L=null;cn(()=>{$(),s.value&&(L=new MutationObserver($),L.observe(s.value,{childList:!0,subtree:!0}))}),wn(()=>{L?.disconnect()});const w={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1};function E(B){const W=typeof navigator<"u"?navigator.clipboard:void 0;W&&typeof W.writeText=="function"||Ko(B)}const T=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,F=R(()=>{const B=v(i.text??""),W=[];let z=0;T.lastIndex=0;let D;for(;(D=T.exec(B))!==null;){const j=D[1]??"",ie=B.slice(z,D.index)+(j||"");ie.trim()&&W.push({kind:"md",text:ie}),W.push({kind:"diff",code:D[2]??""}),z=T.lastIndex}const q=B.slice(z);return(q.trim()||W.length===0)&&W.push({kind:"md",text:q}),W});function S(B){return B.split(`
281
- `).map(W=>W.startsWith("@@")?{type:"hunk",sign:"",text:W}:/^\+(?!\+\+)/.test(W)?{type:"add",sign:"+",text:W.slice(1)}:/^-(?!--)/.test(W)?{type:"del",sign:"-",text:W.slice(1)}:W.startsWith(" ")?{type:"ctx",sign:"",text:W.slice(1)}:{type:"ctx",sign:"",text:W})}const I=Z(null);function P(B,W){Ko(B).then(z=>{z&&(I.value=W,setTimeout(()=>{I.value=null},1400))})}return(B,W)=>(x(),N("div",{ref_key:"mdRef",ref:s,class:"md"},[(x(!0),N(Pe,null,nt(F.value,(z,D)=>(x(),N(Pe,{key:D},[z.kind==="md"?(x(),be(C(Os),{key:0,content:z.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":uC,"code-block-dark-theme":dC,themes:[uC,dC],"code-block-props":w,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:E},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(x(),N("div",Zee,[_("div",Xee,[W[0]||(W[0]=_("span",{class:"diff-lang"},"diff",-1)),re(Yt,{text:C(n)("filePreview.copyCode")},{default:Ne(()=>[_("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:q=>P(z.code,D)},[re(je,{name:I.value===D?"check":"copy",size:"sm"},null,8,["name"])],8,Qee)]),_:2},1032,["text"])]),_("pre",Jee,[_("code",null,[(x(!0),N(Pe,null,nt(S(z.code),(q,j)=>(x(),N("span",{key:j,class:We(["diff-line",`diff-${q.type}`])},[q.type!=="hunk"?(x(),N("span",ete,O(q.sign),1)):le("",!0),_("span",tte,O(q.text),1)],2))),128))])])]))],64))),128))],512))}}),Rm=at(ote,[["__scopeId","data-v-fbd17874"]]),ste={class:"tc-anim"},ite={class:"prev-anim"},rte={class:"prev"},lte=Ye({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=R(()=>n.foldable&&s.value.length>1),r=R(()=>n.streaming||!i.value),l=R(()=>s.value.at(-1)??""),a=Z(null);return cn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Qe(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||mt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(x(),N("div",{class:We(["think",{mob:e.mobile}])},[i.value?(x(),N("div",{key:0,class:We(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[_("div",ste,[_("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),_("div",ite,[_("span",rte,O(l.value),1)])],2)):(x(),N("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),ate=at(lte,[["__scopeId","data-v-fdc551ea"]]),cte={class:"activity-notice",role:"status"},ute={"aria-hidden":"true"},dte={class:"an-label"},fte=Ye({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(x(),N("div",cte,[_("span",ute,[re(Rs,{size:"sm"})]),_("span",dte,O(e.label),1)]))}}),hte=at(fte,[["__scopeId","data-v-0d497074"]]);function pte(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}const mte=Ye({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Mt(),o=Z(!1),s=R(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),i=R(()=>o.value?s.value:pte(t.time,n("conversation.yesterday")));function r(){o.value=!o.value}return(l,a)=>(x(),N("button",{type:"button",class:"msg-time",onClick:bt(r,["stop"])},O(i.value),1))}}),r5=at(mte,[["__scopeId","data-v-9672fbd5"]]);function gte(e){return e.length===1?`0${e}`:e}function vte(e,t){return`${String(Number(e))}:${gte(t)}`}const fC=e=>/^\d+$/.test(e);function yte(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[o,s,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(o==="*"&&s==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(o);if(u&&s==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(o==="0"&&s==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(s);if(o==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(fC(o)&&fC(s)&&c){const f=vte(s,o);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const kte=["data-turn-id"],bte={class:"cn-bubble"},xte={class:"cn-title"},wte={key:0,class:"cn-prompt"},_te={class:"cn-meta"},Ste={key:0,class:"cn-meta-item"},Cte={key:1,class:"cn-meta-item"},Ate=["aria-label"],Mte=["title"],Ete=Ye({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Mt(),o=R(()=>t.cron),s=R(()=>o.value?.missedCount!==void 0),i=R(()=>s.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=R(()=>{const u=o.value?.cron;return u?yte(u,n):""}),l=R(()=>s.value?"error":"ok"),a=R(()=>{const u=o.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=R(()=>t.text??"");return(u,d)=>(x(),N("div",{class:We(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[_("div",bte,[_("span",xte,O(i.value),1),c.value?(x(),N("span",wte,O(c.value),1)):le("",!0)]),_("div",_te,[re(je,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(x(),N("span",Ste,O(r.value),1)):le("",!0),a.value?(x(),N("span",Cte,O(a.value),1)):le("",!0),_("span",{class:We(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(x(),be(je,{key:0,name:"check",size:"sm"})):(x(),be(je,{key:1,name:"close",size:"sm"}))],10,Ate),o.value?.jobId?(x(),N("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:o.value.jobId})},O(o.value.jobId),9,Mte)):le("",!0),e.createdAt?(x(),be(r5,{key:3,time:e.createdAt},null,8,["time"])):le("",!0)])],10,kte))}}),Tte=at(Ete,[["__scopeId","data-v-a62a6587"]]),Nte=["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"],l5=500,Ep=256*1024,hC=200,Q0=16384,J0=500,eg=50,tg=50,Ite=6,Lte=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,$te=/^[A-Za-z0-9+/=_-]{200,}$/;let ng=null;function Di(){if(ng!==null)return ng;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=oo(Lt.debug)==="1"),ng=e,e}const Cl=[],_c=[];let Wu=0;const ua=[];let zu=0,Fte=1;const Tp=new TextEncoder,Ote=new Set(Nte),Ck=Z(0),Uu=Ia(!1);function Rte(){return Cl}function Bte(){Cl.length=0,_c.length=0,Wu=0,ua.length=0,zu=0,Ck.value++}function zr(e){if(!Uu.value){try{const t={id:Fte++,ts:Date.now(),source:e.source,kind:String(Pc(e.kind)),label:String(Pc(e.label)),sessionId:e.sessionId===void 0?void 0:String(Pc(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:Dl(e.detail)},n=JSON.stringify(t),o=Tp.encode(n).byteLength;if(o>Ep)return;for(Cl.push(t),_c.push(n),Wu+=o+(_c.length>1?1:0);Cl.length>l5||Wu>Ep;){const s=_c.shift();Cl.shift(),s!==void 0&&(Wu-=Tp.encode(s).byteLength,_c.length>0&&(Wu-=1))}}catch{return}Ck.value++}}function sa(e){if(typeof e=="string")return e.length<=hC?e:e.slice(0,hC)}function li(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Dte(e,t){if(Ote.has(e))try{const n={ts:Date.now(),event:e,sessionId:sa(t?.sessionId),status:sa(t?.status),operation:sa(t?.operation),seq:li(t?.seq),durationMs:li(t?.durationMs),messageCount:li(t?.messageCount),contentCount:li(t?.contentCount),mediaCount:li(t?.mediaCount),sessionCount:li(t?.sessionCount),workspaceCount:li(t?.workspaceCount),promptId:sa(t?.promptId),zipBytes:li(t?.zipBytes),errorName:sa(t?.errorName),errorCode:li(t?.errorCode),requestId:sa(t?.requestId),phase:sa(t?.phase),httpStatus:li(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:li(t?.line),col:li(t?.col)},o=JSON.stringify(n),s=Tp.encode(o).byteLength;if(s>Ep)return;for(ua.push(o),zu+=s+(ua.length>1?1:0);ua.length>l5||zu>Ep;){const i=ua.shift();i!==void 0&&(zu-=Tp.encode(i).byteLength,ua.length>0&&(zu-=1))}}catch{return}}function Pc(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 $te.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>J0?`${i.slice(0,J0)}… [+${i.length-J0} chars]`:i}if(n!=="object")return String(e);if(t>=Ite)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,eg).map(r=>Pc(r,t+1));return e.length>eg&&i.push(`[+${e.length-eg} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,tg))o[i]=Lte.test(i)?"[redacted]":Pc(r,t+1);return s.length>tg&&(o._truncatedKeys=s.length-tg),o}function Dl(e){if(e===void 0)return;const t=Pc(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>Q0)return{_truncated:`detail JSON was ${n.length} chars; first ${Q0} kept`,preview:n.slice(0,Q0)}}catch{return"[unserializable detail]"}return t}function eh(e){Di()&&zr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Dl(e.body)}})}function oc(e){if(!Di())return;const t=e.code!==0;zr({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:Dl(e.data)}})}function il(e){Di()&&zr({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 sc(e,t){Di()&&zr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Dl(t)})}function Pte(e){if(!Di())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;zr({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:Dl(e)})}function Hte(e){if(!Di())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);zr({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Dl(t.payload)})}const Wte={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function zte(e,t,n){Di()&&zr({source:"client",kind:`client:${e}`,label:`${Wte[e]} ${t}`,detail:Dl(n)})}function Cr(e,t){Di()&&zr({source:"client",kind:"client:event",label:`· ${e}`,detail:Dl(t)})}function vo(e,t){Dte(e,t),zr({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 og=!1,th=null;function Ute(){if(og)return()=>th?.();og=!0;const e=[];try{if(typeof window<"u"){const n=s=>{vo("window:error",{status:"failed",errorName:s.error instanceof Error?s.error.name:"Error",line:s.lineno,col:s.colno})},o=s=>{const i=s.reason;vo("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",o),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",o)})}}catch{}if(Di())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{zte(n,i.map(qte).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(th===t){for(const n of e.toReversed())n();th=null,og=!1}};return th=t,t}function qte(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 a5(e=Cl){if(typeof document>"u")return;const t=new Blob([jte(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 jte(e=Cl){return e===Cl?_c.join(`
282
- `):e.map(t=>JSON.stringify(t)).join(`
283
- `)}function Vte(){return ua.join(`
284
- `)}function c5(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function Ov(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Ni(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:c5(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function cd(e){return{id:e.id,root:e.root,name:e.name,isGitRepo:e.is_git_repo,branch:e.branch??void 0,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function pC(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:{kind:"url",url:e.url}}function Ak(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:pC(e.source)};case"video":return{type:"video",source:pC(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function Rv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Ak),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Kte(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function Gte(e){return{content:e.content.map(Kte),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function Yte(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function u5(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function Zte(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Xte(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Zte),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function d5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Xte),createdAt:e.created_at}}function Qte(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function Jte(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=Qte(o);return{answers:t,method:e.method,note:e.note}}function Nh(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background??(e.kind==="subagent"?!0:void 0)}}function mC(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function rl(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ic(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ai(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function f5(e){if(!e||typeof e!="object")return null;const t=e,n=rl(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:rl(t,"goalId")??rl(t,"goal_id")??"goal",objective:rl(t,"objective")??"",completionCriterion:rl(t,"completionCriterion")??rl(t,"completion_criterion"),status:n,turnsUsed:ic(t,"turnsUsed")??ic(t,"turns_used")??0,tokensUsed:ic(t,"tokensUsed")??ic(t,"tokens_used")??0,wallClockMs:ic(t,"wallClockMs")??ic(t,"wall_clock_ms")??0,terminalReason:rl(t,"terminalReason")??rl(t,"terminal_reason"),budget:{tokenBudget:ai(s,"tokenBudget")??ai(s,"token_budget"),remainingTokens:ai(s,"remainingTokens")??ai(s,"remaining_tokens"),turnBudget:ai(s,"turnBudget")??ai(s,"turn_budget"),remainingTurns:ai(s,"remainingTurns")??ai(s,"remaining_turns"),wallClockBudgetMs:ai(s,"wallClockBudgetMs")??ai(s,"wall_clock_budget_ms"),remainingWallClockMs:ai(s,"remainingWallClockMs")??ai(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function ene(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ni(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ni(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:cd(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:cd(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:c5(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=f5(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:Rv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Ak),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:u5(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:d5(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:Nh(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:Bv(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function tne(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function gC(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function Bv(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function nne(e){return e.session_id}function one(e){return e.seq}const sne="main",ine=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function xr(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function rne(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function vC(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map,retryReuseMsgId:void 0}}function us(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ra(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ci(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function lne(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=us(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=us(t,"goalId")??us(t,"goal_id")??"goal",r=us(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:us(t,"completionCriterion")??us(t,"completion_criterion"),status:s,turnsUsed:ra(t,"turnsUsed")??ra(t,"turns_used")??0,tokensUsed:ra(t,"tokensUsed")??ra(t,"tokens_used")??0,wallClockMs:ra(t,"wallClockMs")??ra(t,"wall_clock_ms")??0,terminalReason:us(t,"terminalReason")??us(t,"terminal_reason"),budget:{tokenBudget:ci(o,"tokenBudget")??ci(o,"token_budget"),remainingTokens:ci(o,"remainingTokens")??ci(o,"remaining_tokens"),turnBudget:ci(o,"turnBudget")??ci(o,"turn_budget"),remainingTurns:ci(o,"remainingTurns")??ci(o,"remaining_turns"),wallClockBudgetMs:ci(o,"wallClockBudgetMs")??ci(o,"wall_clock_budget_ms"),remainingWallClockMs:ci(o,"remainingWallClockMs")??ci(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function da(e,t,n,o){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function ane(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=us(t,"name")??us(t,"toolName")??"tool",o=$a(cne(n)),s=une(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=us(n,"text");if(s)return sg(s);const i=us(n,"message");if(i)return sg(i)}const o=us(t,"message");if(o)return sg(o)}return null}function cne(e){return e.replace(/_\d+$/,"")}const yC=2e3;function sg(e){return e.length>yC?`${e.slice(0,yC)}…`:e}function une(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return _d(e,n)}function dne(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=us(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=da(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return f&&h.push({type:"taskCreated",sessionId:t,task:f}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=ane(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=da(e,t,n,{status:"running",subagentPhase:"working",startedAt:l?.startedAt??new Date().toISOString()}),c=[];return a&&c.push({type:"taskCreated",sessionId:t,task:a}),c.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:r,stream:"stdout"}),c}function $u(e){return{...e,content:e.content.map(t=>({...t}))}}function kC(e,t,n){const o={id:xr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function fne(e,t,n,o,s,i){const r={id:o,sessionId:t,role:"user",content:s,createdAt:i,promptId:n};return e.messages.push(r),r}function hne(e){return Array.isArray(e)?e.map(t=>Ak(t)):[]}function bC(e,t,n,o){const s=e.messages.find(r=>r.id===t);if(!s)return-1;const i=s.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=o:i.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function pne(e,t,n,o,s,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:i})}function mne(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:s}:null}function xC(e,t){e.messages.find(n=>n.id===t)}function gne(e,t,n,o,s,i){const r={id:xr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Fu(e,t){return e.messages.find(n=>n.id===t)}function wC(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}function vne(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=vC(),e.set(u,d)),d}function o(u){e.set(u,vC())}function s(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){o(u);const f=n(u),h=d.promptId??xr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=kC(f,u,h);d.thinkingText.length>0&&p.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&p.content.push({type:"text",text:d.assistantText});for(const g of d.runningTools){const b=typeof g.lastProgress?.text=="string"&&g.lastProgress.text.length>0?[g.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:g.toolCallId,toolName:g.name,input:g.args??{},outputLines:b}),f.toolStartTimes.set(g.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:$u(p)}]}function l(u,d,f,h){try{return c(u,d,f,h)}catch(p){return console.error("[agentProjector] Error projecting event:",u,p instanceof Error?p.message:p),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,h){const p=n(f),g=d,b=[],v=g?.agentId;if(typeof v=="string"&&v!==sne){const m=t.has(v);if(m&&(u==="thinking.delta"||u==="assistant.delta")){const y=g?.delta??"";return y?[{type:"agentDelta",sessionId:f,agentId:v,delta:{[u==="thinking.delta"?"thinking":"text"]:y}}]:[]}if(m&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:v,reason:g?.reason}];if(ine.has(u))return dne(p,f,v,u,g??{},t)}switch(u){case"session.meta.updated":{const m=g?.patch?.title??g?.title,y=g?.patch?.lastPrompt,k={};typeof m=="string"&&m.length>0&&(k.title=m),typeof y=="string"&&(k.lastPrompt=y),(k.title!==void 0||k.lastPrompt!==void 0)&&b.push({type:"sessionMetaUpdated",sessionId:f,...k});break}case"prompt.submitted":{const m=g?.promptId,y=g?.userMessageId;if(!m||!y)break;const k=hne(g?.content);if(k.length===0)break;p.currentPromptId=m;const A=fne(p,f,m,y,k,typeof g?.createdAt=="string"?g.createdAt:new Date().toISOString());b.push({type:"messageCreated",message:$u(A)});break}case"turn.started":{const m=g?.turnId,y=p.currentPromptId??xr("pr_");p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y),p.turnTextLen=0,p.turnThinkLen=0,b.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;if(y||(y=xr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y)),p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId!==void 0){const A=p.retryReuseMsgId;if(p.retryReuseMsgId=void 0,Fu(p,A)!==void 0){p.currentAssistantMsgId=A;break}}const k=kC(p,f,y);p.currentAssistantMsgId=k.id,b.push({type:"messageCreated",message:$u(k)});break}case"thinking.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const k=a(p.turnThinkLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=bC(p,m,"thinking",y);if(A<0)break;p.turnThinkLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{thinking:y}});break}case"assistant.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const k=a(p.turnTextLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=bC(p,m,"text",y);if(A<0)break;p.turnTextLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{text:y}});break}case"tool.use":case"tool.call.started":{const m=p.currentAssistantMsgId,y=g?.turnId,k=p.turnPromptId.get(y)??p.currentPromptId;if(!m||!k)break;const A=g?.toolCallId,$=g?.name??g?.toolName??"",L=g?.args??g?.input??{};pne(p,m,A,$,L);const w=Fu(p,m);w&&w.content.length-1,p.toolStartTimes.set(A,Date.now()),w&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:w.content.map(E=>({...E})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const m=g?.toolCallId,y=mne(g??{});m&&y&&b.push({type:"toolOutput",sessionId:f,toolCallId:m,outputChunk:y.outputChunk,stream:y.stream});break}case"tool.result":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;y||(y=xr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y));const k=g?.toolCallId,A=g?.output,$=g?.isError??!1;p.toolStartTimes.get(k)??Date.now(),p.toolStartTimes.delete(k);const L=gne(p,f,k,A,$,y);b.push({type:"messageCreated",message:$u(L)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const m=p.currentAssistantMsgId,y=rne(g?.usage);if(p.totalInput+=y.input,p.totalOutput+=y.output,p.totalCacheRead+=y.cacheRead,p.totalCacheCreate+=y.cacheCreate,m){xC(p,m);const k=Fu(p,m);k&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:k.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{g?.model&&(p.model=g.model),g?.contextTokens!==void 0&&(p.contextTokens=g.contextTokens),g?.maxContextTokens!==void 0&&(p.contextLimit=g.maxContextTokens),b.push({type:"sessionUsageUpdated",sessionId:f,usage:wC(p),model:p.model||void 0,swarmMode:g?.swarmMode===!0?!0:g?.swarmMode===!1?!1:void 0,planMode:g?.planMode===!0?!0:g?.planMode===!1?!1:void 0});break}case"turn.ended":{const m=p.currentAssistantMsgId,y=g?.reason??"completed",k=ra(g??{},"durationMs");if(b.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:g?.reason}),m){xC(p,m);const $=Fu(p,m);$&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:$.content.map(L=>({...L})),status:y==="failed"||y==="blocked"?"error":"completed",durationMs:k})}p.turnCount++;const A=wC(p);b.push({type:"sessionUsageUpdated",sessionId:f,usage:A}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId=void 0;break}case"prompt.completed":{const m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptCompleted",sessionId:f,promptId:m,reason:g?.reason??"completed"});break}case"prompt.aborted":{const m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptAborted",sessionId:f,promptId:m});break}case"turn.step.retrying":{const m=p.currentAssistantMsgId;if(m!==void 0){const y=Fu(p,m);y!==void 0&&(y.content=y.content.filter(k=>k.type!=="text"&&k.type!=="thinking"&&k.type!=="toolUse"),b.push({type:"messageUpdated",sessionId:f,messageId:m,content:y.content.map(k=>({...k})),status:"pending"}),p.retryReuseMsgId=m)}p.turnTextLen=0,p.turnThinkLen=0,p.toolStartTimes.clear();break}case"turn.step.interrupted":{p.currentAssistantMsgId=void 0,p.retryReuseMsgId=void 0;break}case"subagent.spawned":{const y={id:typeof g?.subagentId=="string"&&g.subagentId.length>0?g.subagentId:xr("task_"),sessionId:f,kind:"subagent",description:typeof g?.description=="string"?g.description:g?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof g?.subagentName=="string"?g.subagentName:void 0,parentToolCallId:typeof g?.parentToolCallId=="string"?g.parentToolCallId:void 0,swarmIndex:typeof g?.swarmIndex=="number"?g.swarmIndex:void 0,runInBackground:g?.runInBackground===!0};p.subagentMeta.set(y.id,y),b.push({type:"taskCreated",sessionId:f,task:y});break}case"subagent.started":{const m=da(p,f,g?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.suspended":{const m=da(p,f,g?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof g?.reason=="string"?g.reason:void 0});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.completed":{const m=typeof g?.resultSummary=="string"?g.resultSummary:void 0,y=da(p,f,g?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"completed",outputPreview:m});break}case"subagent.failed":{const m=typeof g?.error=="string"?g.error:void 0,y=da(p,f,g?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"failed",outputPreview:m});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:g?.code,message:g?.message,name:g?.name,details:g?.details,retryable:g?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:g?.message}});break}case"task.started":{const m=g?.info??{},y=typeof m.startedAt=="number"?new Date(m.startedAt).toISOString():void 0,k=typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):xr("task_"),A=typeof m.description=="string"?m.description:typeof m.command=="string"?m.command:An.global.t("tasks.defaultDescription");if(m.kind==="agent"){const L=typeof m.agentId=="string"&&m.agentId.length>0?m.agentId:void 0;if(L!==void 0){const w=da(p,f,L,{description:A,backgroundTaskId:k,runInBackground:!0});w&&b.push({type:"taskCreated",sessionId:f,task:w})}else b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"subagent",description:A,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,subagentPhase:"queued",runInBackground:!0}});break}const $=typeof m.command=="string"?m.command:void 0;b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"bash",description:A,command:$,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,outputPreview:$!==void 0?`$ ${$}`:void 0}});break}case"task.terminated":{const m=g?.info??{},y=m.status==="failed"||typeof m.exitCode=="number"&&m.exitCode!==0;b.push({type:"taskCompleted",sessionId:f,taskId:typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):"",status:y?"failed":"completed"});break}case"compaction.completed":{const m=g?.result??{};b.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof m.tokensBefore=="number"?m.tokensBefore:void 0,tokensAfter:typeof m.tokensAfter=="number"?m.tokensAfter:void 0,summary:typeof m.summary=="string"?m.summary:void 0}),b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{b.push({type:"compactionStarted",sessionId:f,trigger:g?.trigger==="manual"?"manual":"auto",instruction:typeof g?.instruction=="string"?g.instruction:void 0});break}case"compaction.cancelled":{b.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const m=lne(g?.snapshot??null);b.push({type:"goalUpdated",sessionId:f,goal:m?.status==="complete"?null:m});break}case"cron.fired":{const m=g?.origin,y=us(g??{},"prompt");if(m&&typeof m=="object"&&m.kind==="cron_job"&&y){const k={id:xr("cron_"),sessionId:f,role:"user",content:[{type:"text",text:y}],createdAt:new Date().toISOString(),metadata:{origin:m}};p.messages.push(k),b.push({type:"messageCreated",message:$u(k)})}break}}return b}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const yne=new Set(["server_hello","ack","ping","resync_required","error","pong"]),_C=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),kne=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),bne=new Set(["assistant.delta","thinking.delta"]);function xne(e,t){if(yne.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return bne.has(o)?wne(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?kne.has(o)?{route:"protocol"}:_C.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:_C.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function wne(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}class qu extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class yr extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function nr(e){return e instanceof qu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Mk(e){return e instanceof yr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const Wo="kimi-web.server-credential",_ne="token",Sne=10080*60*1e3;let er;const Dv=new Set;function Cne(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(_ne);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function Pv(e){return{version:1,credential:e,expiresAt:Date.now()+Sne}}function Ane(e){return JSON.stringify(e)}function Ek(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function Hv(e){globalThis.localStorage?.setItem(Wo,Ane(e))}function Mne(){try{const e=globalThis.localStorage?.getItem(Wo);if(e){const n=Ek(e);if(n===void 0){const o=Pv(e);let s=!1;try{Hv(o),s=!0}catch{}if(!s)try{globalThis.localStorage?.getItem(Wo)===e&&globalThis.localStorage?.removeItem(Wo),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(Wo)}catch{}return s?o:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Wo),globalThis.localStorage?.getItem(Wo)===e&&globalThis.localStorage?.removeItem(Wo);return}const t=globalThis.sessionStorage?.getItem(Wo);if(t){const n=Pv(t);let o=!1;try{Hv(n),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Wo),o=!0}catch{}return o?n:void 0}return}catch{return}}function Ene(){const e=Cne();return e?(p5(e),!0):(er=Mne(),er!==void 0)}function h5(){if(er!==void 0){if(er.expiresAt<=Date.now()){Tne(er);return}return er.credential}}function Tne(e){er=void 0;try{globalThis.sessionStorage?.removeItem(Wo);const t=globalThis.localStorage?.getItem(Wo),n=t==null?void 0:Ek(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Wo)}catch{}}function p5(e){const t=Pv(e);er=t;try{Hv(t)}catch{}try{globalThis.sessionStorage?.removeItem(Wo)}catch{}}function Nne(){const e=er;er=void 0;try{const t=globalThis.localStorage?.getItem(Wo),o=(t==null?void 0:Ek(t))?.credential??t;e!==void 0&&o===e.credential&&globalThis.localStorage?.removeItem(Wo),globalThis.sessionStorage?.removeItem(Wo)}catch{}}function Ine(e){return Dv.add(e),()=>{Dv.delete(e)}}function Lne(){Nne();for(const e of Dv)try{e()}catch{}}const hc=3e4,nh=5*6e4,m5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",SC=500,g5=40101;function oh(e=hc){try{return AbortSignal.timeout(e)}catch{return}}function $ne(e,t){let n="",o=e;for(let s=0;s<t;s++)n=m5[o%32]+n,o=Math.floor(o/32);return n}function Fne(e){const t=new Uint8Array(e);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(t);else for(let n=0;n<t.length;n++)t[n]=Math.floor(Math.random()*256);return Array.from(t,n=>m5[n%32]).join("")}function sh(){return`${$ne(Date.now(),10)}${Fne(16)}`}function One(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function ig(e){try{const t=await e.text();return t?t.length>SC?`${t.slice(0,SC)}...`:t:void 0}catch{return}}class Rne{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=yc(this.origin,t),o=sh(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();eh({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:oh()})}catch(a){throw il({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new yr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:hc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return oc({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),oc({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new qu({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??o,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postZip(t,n,o){const s="POST",i=yc(this.origin,t),r=sh(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();eh({method:s,path:t,url:i,requestId:r,body:o});let c;try{c=await fetch(i,{method:s,headers:l,body:JSON.stringify(n),signal:oh(nh)})}catch(h){throw il({method:s,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new yr({message:`Network error calling ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:nh,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let h;try{h=await c.clone().json()}catch{}if(this.checkAuthRequired(c,h?.code??0),!c.ok||h!==void 0&&h.code!==0){const b=h?.code??c.status,v=h?.msg??c.statusText;throw oc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:b,msg:v,envelopeRequestId:h?.request_id}),new qu({code:b,msg:v,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),g=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw il({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:g}),new yr({message:`Invalid ZIP response from ${s} ${t}`,cause:g,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:nh,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await ig(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw il({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new yr({message:`Failed to read ZIP response from ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:nh,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return oc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const o=yc(this.origin,t),s=sh(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();eh({method:"POST",path:t,url:o,requestId:s,body:One(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:oh()})}catch(u){throw il({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new yr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:hc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw il({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new yr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:hc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await ig(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(oc({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new qu({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,o,s,i=[]){let r=yc(this.origin,n);if(s){const h=new URLSearchParams;for(const[g,b]of Object.entries(s))b!==void 0&&h.set(g,String(b));const p=h.toString();p&&(r=`${r}?${p}`)}const l=sh(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();eh({method:t,path:n,url:r,requestId:l,body:o});let u;try{u=await fetch(r,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:oh()})}catch(h){throw il({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new yr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:hc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw il({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new yr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:hc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await ig(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(oc({method:t,path:n,requestId:l,status:u.status,durationMs:Date.now()-c,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthRequired(u,d.code),d.code!==0&&!i.includes(d.code))throw new qu({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=h5();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Kimi-Client-Id"]=this.identity.clientId,t["X-Kimi-Client-Name"]=this.identity.clientName,t["X-Kimi-Client-Version"]=this.identity.clientVersion,t["X-Kimi-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===g5)&&Lne()}}const Bne="kimi-code.bearer.",Dne=3e4;class Pne{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),sc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=h5(),n=t!==void 0?[`${Bne}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{sc("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(s.data));Hte(i),this.handleFrame(i)}catch(i){sc("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{sc("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{sc("close",s?{code:s.code,reason:s.reason,wasClean:s.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,sc("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,o){const s=ih(t,n),i=this.terminalAttachments.get(s),r=o??i?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(ih(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(ih(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,Dne),o=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:o}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t;switch(t.type){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,i=n.seq,r=ih(o,s),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(o,s,a,i);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(o,s,r);break}default:{this.trackCursor(n);const o=n.type,s=xne(o,n.payload);if(s.route==="protocol"){this.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:s.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Pte(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function ih(e,t){return`${e}\0${t}`}function Hne(e,t){if(e===void 0)return t;let n;const o=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(o!==void 0)try{n=decodeURIComponent(o.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function CC(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function rg(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function AC(e){return e==="auto_compact"||e==="manual_compact"}class Wne{http;config;constructor(t){this.config=t,this.http=new Rne(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,backend:t.backend==="v2"?"v2":"v1"}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(Ni),hasMore:o.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const o=await this.http.post("/sessions",n);return Ni(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ni(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.swarmMode!==void 0&&(s.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return Ni(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return f5(n)}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Ni(n)}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(Rv),hasMore:s.has_more}}async getSessionSnapshot(t){const n=Date.now();vo("session:snapshot:start",{sessionId:t});try{const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),s={asOfSeq:o.as_of_seq,epoch:o.epoch,session:Ni(o.session),messages:o.messages.items.map(Rv),hasMoreMessages:o.messages.has_more,inFlightTurn:o.in_flight_turn===null?null:{turnId:o.in_flight_turn.turn_id,assistantText:o.in_flight_turn.assistant_text,thinkingText:o.in_flight_turn.thinking_text,runningTools:o.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:o.in_flight_turn.current_prompt_id},pendingApprovals:o.pending_approvals.map(u5),pendingQuestions:o.pending_questions.map(d5),subagents:(o.subagents??[]).map(Nh)};return vo("session:snapshot:accepted",{sessionId:t,busy:s.session.busy,seq:s.asOfSeq,messageCount:s.messages.length,durationMs:Date.now()-n}),s}catch(o){throw vo("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...CC(o)}),o}}async exportSession(t,n){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(`
285
- `).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:o,web_log_entries:s}),r=`${t}.zip`;return{blob:i.blob,fileName:Hne(i.contentDisposition,r)}}async submitPrompt(t,n){const o=Date.now();vo("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(s=>s.type==="image"||s.type==="video"||s.type==="file").length});try{const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Gte(n));return vo("prompt:accepted",{sessionId:t,promptId:s.prompt_id,status:s.status,durationMs:Date.now()-o}),{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}catch(s){throw vo("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-o,...CC(s)}),s}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return Ni(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return Ni(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ni)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Yte(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,Jte(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(Nh)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return Nh(i)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(rg)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return rg(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return rg(o)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),i=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([r,l])=>[r,l.map(mC)])):void 0;return{items:s.items.map(mC),childrenByPath:i,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async searchFiles(t,n){const o={query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,o);return{items:s.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return yc(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,o,s){const i={app_id:n,path:o};s!==void 0&&(i.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(cd)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return cd(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return cd(o)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(o=>({name:o.name,path:o.path,isDir:o.is_dir,isGitRepo:o.is_git_repo,branch:o.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(tne)}async listProviders(){return(await this.http.get("/providers")).items.map(gC)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const o=await this.http.post("/providers",n);return gC(o)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return lg(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return lg(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return lg(t)}async getConfig(){const t=await this.http.get("/config");return Bv(t)}async setConfig(t){const n={},o={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return Bv(s)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return t.status==="authenticated"?{flowId:t.flow_id,provider:t.provider,status:"authenticated"}:{flowId:t.flow_id,provider:t.provider,status:"pending",verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return yc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=_I(this.config.serverHttpUrl,this.config.clientId),o=vne(),s=new Pne(n,this.config.clientId,{onWireEvent:i=>{const r=nne(i),l=one(i),a=ene(i);a.type==="historyCompacted"&&!AC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=o.project(r,c,a,{offset:u});for(const f of d){const h=c?.turnId,p=f.type==="assistantDelta"&&typeof h=="number"&&typeof u=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:u,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!AC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:p})}},onResync:(i,r,l)=>{o.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},health(){return s.health()},reconnect(){s.reconnect()},close(){s.close()}}}}function lg(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}let MC;function ct(){return MC??=new Wne(yI()),MC}const zne=["src","controls","muted"],Une=["src","alt"],v5=Ye({__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 c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(s.value)try{const f=await ct().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 Qe(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),cn(()=>{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}),co(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(x(),N("video",{key:0,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,zne)):(x(),N("img",{key:1,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,Une))}}),qne=["title","data-kind"],jne=["aria-label"],Vne={class:"att-tile"},Kne={class:"att-name"},Gne={key:1,class:"att-err"},Yne=["aria-label"],Zne=Ye({__name:"AttachmentChip",props:{kind:{},name:{},url:{},fileId:{},mediaType:{},size:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Mt(),i=R(()=>{const d=n.name?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]??n.mediaType?.split("/")[1]?.split("+")[0];return d?d.toUpperCase():void 0}),r=R(()=>{const u=i.value??"";return/^(txt|md|doc|docx|rtf|log)$/i.test(u)?"file-text":"file"}),l=R(()=>n.name?n.name:n.kind==="image"?s("composer.attachmentImage"):n.kind==="video"?s("composer.attachmentVideo"):s("composer.attachmentFile"));function a(u){return u<1024?`${u} B`:u<1024*1024?`${Math.round(u/1024)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}const c=R(()=>{const u=[l.value];return n.size!==void 0&&u.push(a(n.size)),u.join(" · ")});return(u,d)=>(x(),N("span",{class:We(["att-chip",{"is-error":e.error,uploading:e.uploading}]),title:c.value,"data-kind":e.kind},[_("button",{type:"button",class:"att-activate","aria-label":c.value,onClick:d[0]||(d[0]=f=>o("activate"))},[_("span",Vne,[e.kind==="image"&&e.url?(x(),be(v5,{key:0,url:e.url,kind:"image",alt:e.name,"file-id":e.fileId,"media-class":"att-thumb"},null,8,["url","alt","file-id"])):e.kind==="video"?(x(),be(je,{key:1,name:"play",size:"sm"})):e.kind==="image"?(x(),be(je,{key:2,name:"image",size:"sm"})):(x(),be(je,{key:3,name:r.value,size:"sm"},null,8,["name"]))]),_("span",Kne,O(l.value),1),e.uploading?(x(),be(Rs,{key:0,size:"sm",label:C(s)("composer.uploading")},null,8,["label"])):e.error?(x(),N("span",Gne,[re(je,{name:"info",size:"sm"})])):le("",!0)],8,jne),e.removable?(x(),be(Yt,{key:0,text:e.removeLabel??C(s)("composer.remove")},{default:Ne(()=>[_("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??C(s)("composer.remove"),onClick:d[1]||(d[1]=f=>o("remove"))},[re(je,{name:"close",size:"sm"})],8,Yne)]),_:1},8,["text"])):le("",!0)],10,qne))}}),y5=at(Zne,[["__scopeId","data-v-12ec975b"]]),Xne=["aria-label"],Qne=120,Jne=60,eoe=Ye({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*Qne}ms`,"--moon-frame-fast-delay":`${o*Jne}ms`}}return(o,s)=>(x(),N("span",{class:We(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(x(),N(Pe,null,nt(t,(i,r)=>_("span",{key:i,class:"ui-moon__frame",style:qt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,Xne))}}),k5=at(eoe,[["__scopeId","data-v-a6b7ec07"]]),Qi=Z(null),Hc=Z(!1);function Tk(e){const t=Qi.value;!t||Hc.value||(Qi.value=null,t.resolve(e))}async function toe(){const e=Qi.value;if(!(!e||Hc.value)){if(!e.action){Tk(!0);return}Hc.value=!0;try{await e.action(),Qi.value===e&&(Qi.value=null),e.resolve(!0)}catch(t){Qi.value===e&&(Qi.value=null),e.reject(t)}finally{Hc.value=!1}}}function noe(e){return Hc.value?Promise.resolve(!1):(Qi.value&&Tk(!1),new Promise((t,n)=>{Qi.value={...e,resolve:t,reject:n}}))}function Yd(){return{current:Qi,busy:Hc,confirm:noe,settle:Tk,runAction:toe}}const ooe=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,soe=/^(txt|md|markdown|log|json|ya?ml|csv|tsv|ts|mts|tsx|jsx|css|py|go|rs|java|c|h|cc|cpp|hpp|sh|zsh|sql|toml|ini|cfg|conf|vue)$/i,ioe=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,EC="text/plain;charset=utf-8";function roe(e,t){const n=(t??"").toLowerCase();if(ooe.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:EC;const o=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return o===void 0?null:soe.test(o)?EC:ioe.test(o)?`image/${o==="jpg"?"jpeg":o==="ico"?"x-icon":o}`:o==="pdf"?"application/pdf":null}async function b5(e,t,n){const o=roe(t,n);if(o===null)return"unsupported";const s=window.open("","_blank");s!==null&&(s.opener=null);const i=await ct().getFileBlob(e).catch(()=>null);if(i===null)return s?.close(),"failed";const r=URL.createObjectURL(new Blob([i],{type:o}));if(s!==null)s.location.href=r;else{const l=document.createElement("a");l.href=r,l.download=t??e,l.click()}return setTimeout(()=>{URL.revokeObjectURL(r)},6e4),"previewed"}const loe={class:"chat"},aoe={key:0,class:"chat-loading"},coe={class:"chat-loading-text"},uoe={key:1,class:"chat-empty"},doe={key:1,class:"top-sentinel-text"},foe={key:0,class:"u-turn"},hoe=["data-turn-id"],poe={key:0,class:"u-atts"},moe={key:1,class:"skill-act"},goe={class:"skill-act-head"},voe={key:0,class:"skill-act-args"},yoe={key:2,class:"skill-act"},koe={class:"skill-act-head"},boe={key:0,class:"skill-act-args"},xoe={key:3,class:"u-text"},woe={key:0,class:"u-meta"},_oe=["aria-label","onClick"],Soe=["aria-label","onClick"],Coe=["data-turn-id"],Aoe=["onClick"],Moe={class:"cd-view"},Eoe={key:1,class:"cd-label"},Toe=["data-turn-id"],Noe={key:1,class:"msg"},Ioe={key:0,class:"a-msg-ft"},Loe={key:0,class:"a-duration"},$oe=["aria-label","onClick"],Foe={key:4,class:"sending-placeholder"},Ooe={key:5,class:"q-stack"},Roe={class:"q-head"},Boe={class:"q-title"},Doe={class:"q-hint"},Poe=["onDragover","onDrop"],Hoe={class:"u-bub q-bub"},Woe=["title","onDragstart"],zoe=["title","onClick"],Uoe={key:0,class:"u-text q-text"},qoe={key:1,class:"q-text q-text-placeholder"},joe={key:0,class:"q-imgs"},Voe={key:0,class:"q-file"},Koe={key:1,class:"q-tag q-tag-next"},Goe={key:2,class:"q-tag q-tag-idx"},Yoe=["aria-label","onClick"],Zoe={key:0,class:"open-unsupported",role:"status"},Xoe=2500,Qoe=Ye({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:o}=Mt(),{confirm:s}=Yd();wn(()=>{j!==null&&(clearTimeout(j),j=null),I!==null&&(clearTimeout(I),I=null),E!==null&&(clearTimeout(E),E=null),ne!==null&&(clearTimeout(ne),ne=null)});const i=e,r=Z(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver($e=>{$e[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}cn(a),wn(()=>{l?.disconnect(),l=null}),Qe(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{mt().then(a)});const c=R(()=>{if(!i.turnActive||i.turns.length===0)return null;const $e=i.turns.at(-1);return $e.role==="assistant"?$e.id:null}),u=R(()=>i.working),d=n,f=Z(null),h=Z(null);function p($e){return($e.attachments?.length??0)>0}function g($e){d("editQueued",$e)}function b($e,ae){if(f.value=$e,!ae.dataTransfer)return;ae.dataTransfer.effectAllowed="move",ae.dataTransfer.setData("text/plain",String($e));const U=ae.currentTarget?.closest(".q-turn");U&&ae.dataTransfer.setDragImage(U,24,24)}function v($e,ae){if(f.value===null)return;ae.preventDefault(),ae.dataTransfer&&(ae.dataTransfer.dropEffect="move");const U=ae.currentTarget.getBoundingClientRect(),ce=ae.clientY<U.top+U.height/2?"before":"after";h.value={index:$e,position:ce}}function m($e,ae){ae.preventDefault();const U=f.value,ce=h.value?.position??"before";if(f.value=null,h.value=null,U===null)return;let se=ce==="before"?$e:$e+1;U<se&&(se-=1),U!==se&&d("reorderQueue",{from:U,to:se})}function y(){f.value=null,h.value=null}const k=R(()=>{for(let $e=i.turns.length-1;$e>=0;$e--)if(i.turns[$e].role==="user")return i.turns[$e].id;return null});function A($e){return $e.role==="user"&&$e.id===k.value&&!i.working&&!$e.skillActivation&&!$e.pluginCommand}function $($e){const ae=$e.compaction,U=ae?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof ae?.tokensBefore=="number"&&typeof ae?.tokensAfter=="number"?U+o("conversation.compactedTokens",{before:vw(ae.tokensBefore),after:vw(ae.tokensAfter)}):U}const L=Z(null),w=Z(null);let E=null;async function T($e){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&F($e)}function F($e){w.value===null&&(w.value=$e.id,d("editMessage",{text:$e.text,attachments:$e.attachments}),E=setTimeout(()=>{E=null,w.value=null},Xoe))}Qe(()=>i.turns,$e=>{w.value!==null&&($e.some(ae=>ae.id===w.value)||(w.value=null,E!==null&&(clearTimeout(E),E=null)))},{flush:"post"});const S=Z(!1);let I=null;function P(){if(i.turns.length===0)return;const $e=[];for(const U of i.turns){if(U.role==="compaction"||U.role==="cron")continue;const ce=U.role==="user"?"User":"Assistant",se=bW(U);se.trim()&&$e.push(`**${ce}**
286
-
287
- ${se}`)}const ae=$e.join(`
288
-
289
- ---
290
-
291
- `);Ko(ae).then(U=>{U&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}function B($e){const ae=[];for(let U=$e;U>=0;U--){const ce=i.turns[U];if(!ce||ce.role!=="assistant")break;ae.unshift(ce)}return ae}function W($e){return B($e).map(ae=>kW(ae)).filter(Boolean).join(`
292
-
293
- `)}function z(){for(let $e=i.turns.length-1;$e>=0;$e-=1)if(i.turns[$e]?.role==="assistant")return W($e);return""}function D(){const $e=z();$e.trim()&&Ko($e).then(ae=>{ae&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:P,copyFinalSummary:D});function q($e){const ae=i.turns[$e];if(!ae||ae.role!=="assistant")return!1;const U=i.turns[$e+1];return!U||U.role!=="assistant"}let j=null;function ie($e){const ae=i.turns[$e];if(!ae)return;const U=W($e);U.trim()&&Ko(U).then(ce=>{ce&&(L.value=ae.id,j!==null&&clearTimeout(j),j=setTimeout(()=>{j=null,L.value=null},1400))}).catch(()=>{})}function ue($e){const ae=$e.text;ae.trim()&&Ko(ae).then(U=>{U&&(L.value=$e.id,j!==null&&clearTimeout(j),j=setTimeout(()=>{j=null,L.value=null},1400))}).catch(()=>{})}function pe($e){return{kind:$e.kind==="video"?"video":"image",url:$e.url,path:$e.name,fileId:$e.fileId}}const ee=Z(null);let ne=null;function fe($e){if($e.kind==="image"||$e.kind==="video"){d("openMedia",pe($e));return}$e.fileId!==void 0&&b5($e.fileId,$e.name,$e.mediaType).then(ae=>{ae==="unsupported"&&(ee.value=$e.name??$e.fileId??"",ne!==null&&clearTimeout(ne),ne=setTimeout(()=>{ne=null,ee.value=null},2400))})}function Me($e,ae){return $e.id!==c.value?!1:ae.sourceIndex===gm($e).length-1}return($e,ae)=>(x(),N(Pe,null,[_("div",loe,[e.sessionLoading?(x(),N("div",aoe,[re(Rs,{size:"sm"}),_("span",coe,O(C(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),N("div",uoe)):le("",!0),e.hasMoreMessages||e.loadingMore?(x(),N("div",{key:2,ref_key:"topSentinelRef",ref:r,class:We(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),N("span",doe,[re(Rs,{size:"sm"}),Xe(" "+O(C(o)("conversation.loadingOlder")),1)])):(x(),N("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:ae[0]||(ae[0]=U=>d("loadOlderMessages"))},O(C(o)("conversation.loadOlder")),1))],2)):le("",!0),(x(!0),N(Pe,null,nt(e.turns,(U,ce)=>(x(),N(Pe,{key:U.id},[U.role==="user"?(x(),N("div",foe,[_("div",{class:We(["u-bub turn-anchor",{undoing:w.value===U.id}]),"data-turn-id":U.id},[U.attachments&&U.attachments.length>0?(x(),N("div",poe,[(x(!0),N(Pe,null,nt(U.attachments,(se,V)=>(x(),be(y5,{key:V,kind:se.kind,name:se.name,url:se.url,"file-id":se.fileId,"media-type":se.mediaType,size:se.size,onActivate:Q=>fe(se)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):le("",!0),U.skillActivation?(x(),N("div",moe,[_("div",goe,[ae[9]||(ae[9]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,O(C(o)("conversation.activatedSkill",{name:U.skillActivation.name})),1)]),U.skillActivation.args?(x(),N("div",voe,O(U.skillActivation.args),1)):le("",!0)])):U.pluginCommand?(x(),N("div",yoe,[_("div",koe,[ae[10]||(ae[10]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,"/"+O(U.pluginCommand.pluginId)+":"+O(U.pluginCommand.commandName),1)]),U.pluginCommand.args?(x(),N("div",boe,O(U.pluginCommand.args),1)):le("",!0)])):(x(),N("div",xoe,O(U.text),1))],10,hoe),U.createdAt||A(U)?(x(),N("div",woe,[A(U)?(x(),N("div",{key:0,class:We(["u-edit-wrap",{undoing:w.value===U.id}])},[_("button",{type:"button",class:"u-edit","aria-label":C(o)("conversation.undoTooltip"),onClick:se=>T(U)},[re(je,{name:"undo",size:"sm"})],8,_oe)],2)):le("",!0),U.text.trim().length>0?(x(),N("button",{key:1,type:"button",class:"u-copy","aria-label":C(o)("filePreview.copy"),onClick:bt(se=>ue(U),["stop"])},[L.value!==U.id?(x(),be(je,{key:0,name:"copy",size:"sm"})):(x(),be(je,{key:1,name:"check",size:"sm"}))],8,Soe)):le("",!0),U.createdAt?(x(),be(r5,{key:2,time:U.createdAt},null,8,["time"])):le("",!0)])):le("",!0)])):U.role==="compaction"?(x(),N("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":U.id,role:"separator"},[ae[11]||(ae[11]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1)),U.text?(x(),N("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:se=>d("openCompaction",{turnId:U.id})},[_("span",null,O($(U)),1),_("span",Moe,O(C(o)("conversation.viewSummary")),1)],8,Aoe)):(x(),N("span",Eoe,O($(U)),1)),ae[12]||(ae[12]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Coe)):U.role==="cron"?(x(),be(Tte,{key:2,text:U.text,cron:U.cron,"turn-id":U.id,"created-at":U.createdAt},null,8,["text","cron","turn-id","created-at"])):(x(),N("div",{key:3,class:"a-msg turn-anchor","data-turn-id":U.id},[(x(!0),N(Pe,null,nt(C(yW)(U),(se,V)=>(x(),N(Pe,{key:C(xW)(se,V)},[se.kind==="thinking"?(x(),be(ate,{key:0,text:se.thinking,mobile:"",streaming:Me(U,se),onOpen:Q=>d("openThinking",{turnId:U.id,blockIndex:se.sourceIndex})},null,8,["text","streaming","onOpen"])):se.kind==="text"&&se.text?(x(),N("div",Noe,[re(Rm,{text:se.text,streaming:Me(U,se),"open-file":Q=>d("openFile",Q)},null,8,["text","streaming","open-file"])])):se.kind==="tool-stack"?(x(),be(EW,{key:2,tools:se.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:ae[1]||(ae[1]=Q=>d("openMedia",Q)),onOpenFile:ae[2]||(ae[2]=Q=>d("openFile",Q)),onOpenToolDiff:ae[3]||(ae[3]=Q=>d("openToolDiff",Q)),onOpenAgent:ae[4]||(ae[4]=Q=>d("openAgent",Q))},null,8,["tools","tool-diff-panel"])):se.kind==="tool"?(x(),be(SA,{key:3,tool:se.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:ae[5]||(ae[5]=Q=>d("openMedia",Q)),onOpenFile:ae[6]||(ae[6]=Q=>d("openFile",Q)),onOpenToolDiff:ae[7]||(ae[7]=Q=>d("openToolDiff",Q)),onOpenAgent:ae[8]||(ae[8]=Q=>d("openAgent",Q))},null,8,["tool","tool-diff-panel"])):le("",!0)],64))),128)),U.id!==c.value&&q(ce)&&(W(ce).trim().length>0||U.durationMs!==void 0)?(x(),N("div",Ioe,[re(Yt,{text:`${U.durationMs} ms`},{default:Ne(()=>[U.durationMs!==void 0?(x(),N("span",Loe,O(C(mW)(U.durationMs)),1)):le("",!0)]),_:2},1032,["text"]),W(ce).trim().length>0?(x(),N("button",{key:0,class:"a-cpbtn","aria-label":C(o)("filePreview.copy"),onClick:se=>ie(ce)},[L.value!==U.id?(x(),be(je,{key:0,name:"copy",size:"sm"})):(x(),be(je,{key:1,name:"check",size:"sm"}))],8,$oe)):le("",!0)])):le("",!0)],8,Toe))],64))),128)),e.compaction?(x(),be(hte,{key:3,label:C(o)("conversation.compacting")},null,8,["label"])):le("",!0),u.value?(x(),N("div",Foe,[re(k5,{fast:e.fastMoon},null,8,["fast"])])):le("",!0),e.queued.length>0?(x(),N("div",Ooe,[_("div",Roe,[_("span",Boe,[re(je,{name:"mail",size:"sm"}),Xe(" "+O(C(o)("composer.queueLabel"))+" · ",1),_("b",null,O(e.queued.length),1)]),_("span",Doe,O(C(o)("composer.queueAutoDrain")),1)]),(x(!0),N(Pe,null,nt(e.queued,(U,ce)=>(x(),N("div",{key:ce,class:We(["u-turn q-turn",{"q-dragging":f.value===ce,"drop-before":h.value?.index===ce&&h.value.position==="before","drop-after":h.value?.index===ce&&h.value.position==="after"}]),onDragover:se=>v(ce,se),onDrop:se=>m(ce,se)},[_("div",Hoe,[_("span",{class:"q-grip",title:C(o)("composer.queueDragTitle"),draggable:"true",onDragstart:se=>b(ce,se),onDragend:y},[re(je,{name:"grip",size:"sm"})],40,Woe),_("button",{type:"button",class:"q-body",title:C(o)("composer.editQueued"),onClick:se=>g(ce)},[U.text?(x(),N("span",Uoe,O(U.text),1)):(x(),N("span",qoe,[re(je,{name:"file",size:"sm"}),Xe(" "+O(C(o)("composer.queuedAttachments",{n:U.attachments?.length??0})),1)]))],8,zoe),p(U)?(x(),N("div",joe,[(x(!0),N(Pe,null,nt(U.attachments,(se,V)=>(x(),N(Pe,{key:V},[se.kind==="file"?(x(),N("span",Voe,[re(je,{name:"file",size:"sm"}),Xe(" "+O(se.name??se.fileId),1)])):(x(),be(v5,{key:1,url:se.url,kind:se.kind,"file-id":se.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):le("",!0),ce===0?(x(),N("span",Koe,O(C(o)("composer.queueNext")),1)):(x(),N("span",Goe,"#"+O(ce+1),1)),_("button",{type:"button",class:"q-rm","aria-label":C(o)("composer.remove"),onClick:bt(se=>d("unqueue",ce),["stop"])},[re(je,{name:"close",size:"sm"})],8,Yoe)])],42,Poe))),128))])):le("",!0)]),ee.value!==null?(x(),N("div",Zoe,O(C(o)("composer.attachmentOpenUnsupported",{name:ee.value})),1)):le("",!0)],64))}}),x5=at(Qoe,[["__scopeId","data-v-7c31d582"]]),Joe={class:"ch-id"},ese={key:0,class:"ch-ws"},tse={key:1,class:"ch-sep"},nse=["onKeydown"],ose={class:"ch-ses"},sse={key:0,class:"ch-pill ch-sync-pill"},ise={key:0,class:"ch-ahead"},rse={key:1,class:"ch-behind"},lse={key:1,class:"ch-pill ch-diff-pill"},ase={key:0,class:"ch-add"},cse={key:1,class:"ch-del"},use=Ye({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{emit:t}){const{t:n}=Mt(),o=e,s=t,i=R(()=>o.ahead??0),r=R(()=>o.behind??0),l=R(()=>o.gitDiffStats?.totalAdditions??0),a=R(()=>o.gitDiffStats?.totalDeletions??0),c=R(()=>l.value>0||a.value>0),u={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function d(q){return q.trim().toLowerCase().replaceAll("_","-")}function f(q){const j=d(q);return u[j]?`pr-${j}`:"pr-unknown"}function h(q){return n(u[d(q)]??"header.prStatusUnknown")}const p=Z(!1),g=Z(null),b=Z(null),v=Z({});function m(q){const j=q.target;b.value?.el?.contains(j)||g.value?.el?.contains(j)||A()}function y(){A()}async function k(q){if(q.stopPropagation(),p.value){A();return}p.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",y),await mt();const j=g.value?.el,ie=b.value?.el;if(!j||!ie)return;const ue=j.getBoundingClientRect(),pe=4,ee=8,ne=ie.offsetWidth,fe=ie.offsetHeight;let Me=ue.bottom+pe;Me+fe>window.innerHeight-ee&&(Me=Math.max(ee,ue.top-fe-pe));let $e=ue.left;$e+ne>window.innerWidth-ee&&($e=Math.max(ee,ue.right-ne)),v.value={top:`${Math.round(Me)}px`,left:`${Math.round($e)}px`}}function A(){p.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)}wn(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)});function $(){s("copyAll"),A()}function L(){s("copyFinalSummary"),A()}const w=Z(!1);function E(){o.sessionId&&Ko(o.sessionId).then(q=>{q&&(w.value=!0,setTimeout(()=>{w.value=!1},1200))})}const T=Z(!1),F=Z(""),S=Z(null);async function I(){if(A(),!!o.sessionId){T.value=!0,F.value=o.sessionTitle??"",await mt();try{S.value?.focus(),S.value?.select()}catch{}}}function P(){const q=F.value.trim();q&&o.sessionId&&q!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,q),T.value=!1}function B(){T.value=!1}function W(){o.sessionId&&(A(),s("forkSession",o.sessionId))}function z(){o.sessionId&&(A(),s("exportSession",o.sessionId))}function D(){o.sessionId&&(A(),s("archiveSession",o.sessionId))}return(q,j)=>(x(),N("header",{class:We(["chat-header",{"macos-desktop":C(Lc)}])},[_("div",Joe,[e.workspaceName?(x(),N("span",ese,O(e.workspaceName),1)):le("",!0),e.workspaceName&&e.sessionTitle?(x(),N("span",tse,"/")):le("",!0),T.value?$n((x(),N("input",{key:2,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":j[0]||(j[0]=ie=>F.value=ie),class:"ch-rename",type:"text",onKeydown:[Ji(bt(P,["stop"]),["enter"]),Ji(bt(B,["stop"]),["esc"])],onBlur:P,onClick:j[1]||(j[1]=bt(()=>{},["stop"]))},null,40,nse)),[[ws,F.value]]):e.sessionTitle?(x(),be(Yt,{key:3,text:e.sessionTitle},{default:Ne(()=>[_("span",ose,O(e.sessionTitle),1)]),_:1},8,["text"])):le("",!0)]),re(Wn,{ref_key:"kebabRef",ref:g,class:We(["ch-act-more",{open:p.value}]),label:C(n)("header.options"),"aria-expanded":p.value,"aria-haspopup":"menu",onClick:j[2]||(j[2]=bt(ie=>k(ie),["stop"]))},{default:Ne(()=>[re(je,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),p.value?(x(),be(gl,{key:0,ref_key:"menuRef",ref:b,class:"ch-menu",style:qt(v.value),onClick:j[3]||(j[3]=bt(()=>{},["stop"]))},{default:Ne(()=>[re(hn,{onClick:$},{default:Ne(()=>[re(je,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),Xe(" "+O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),re(hn,{onClick:L},{default:Ne(()=>[re(je,{name:"file-text",size:"sm"}),Xe(" "+O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(x(),N(Pe,{key:0},[re(hn,{separator:""}),re(hn,{onClick:E},{default:Ne(()=>[re(je,{name:w.value?"check":"copy",size:"sm"},null,8,["name"]),Xe(" "+O(w.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),re(hn,{onClick:I},{default:Ne(()=>[re(je,{name:"pencil",size:"sm"}),Xe(" "+O(C(n)("header.renameSession")),1)]),_:1}),re(hn,{onClick:W},{default:Ne(()=>[re(je,{name:"git-fork",size:"sm"}),Xe(" "+O(C(n)("header.forkSession")),1)]),_:1}),re(hn,{onClick:z},{default:Ne(()=>[re(je,{name:"download",size:"sm"}),Xe(" "+O(C(n)("header.exportSession")),1)]),_:1}),re(hn,{danger:"",onClick:D},{default:Ne(()=>[re(je,{name:"archive",size:"sm"}),Xe(" "+O(C(n)("header.archiveSession")),1)]),_:1})],64)):le("",!0)]),_:1},8,["style"])):le("",!0),j[6]||(j[6]=_("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(x(),N("button",{key:1,type:"button",class:"ch-git",onClick:j[4]||(j[4]=ie=>s("openChanges"))},[_("span",{class:We(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||C(n)("header.detached")),3),i.value>0||r.value>0?(x(),N("span",sse,[i.value>0?(x(),N("span",ise,"↑"+O(i.value),1)):le("",!0),r.value>0?(x(),N("span",rse,"↓"+O(r.value),1)):le("",!0)])):le("",!0),c.value?(x(),N("span",lse,[l.value>0?(x(),N("span",ase,"+"+O(l.value),1)):le("",!0),a.value>0?(x(),N("span",cse,"-"+O(a.value),1)):le("",!0)])):le("",!0)])):le("",!0),e.pr?(x(),N("button",{key:2,type:"button",class:We(["ch-pill ch-pr",f(e.pr.state)]),onClick:j[5]||(j[5]=ie=>e.pr&&s("openPr",e.pr.url))},[re(je,{name:"git-pull-request",size:"sm"}),_("span",null,"PR #"+O(e.pr.number)+" · "+O(h(e.pr.state)),1)],2)):le("",!0)],2))}}),dse=at(use,[["__scopeId","data-v-fa4451d4"]]),fse=["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"],TC=[[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 hse(e){if(e<=255)return fse[e];let t=0,n=TC.length-1;for(;t<=n;){const o=t+n>>1,s=TC[o];if(e<s[0]){n=o-1;continue}if(e>s[1]){t=o+1;continue}return s[2]}return"L"}function pse(e){const t=e.length;if(t===0)return null;const n=new Array(t);let o=!1;for(let c=0;c<t;){const u=e.charCodeAt(c);let d=u,f=1;if(u>=55296&&u<=56319&&c+1<t){const p=e.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+(p-56320)+65536,f=2)}const h=hse(d);(h==="R"||h==="AL"||h==="AN")&&(o=!0);for(let p=0;p<f;p++)n[c+p]=h;c+=f}if(!o)return null;let s=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){s=0;break}if(u==="R"||u==="AL"){s=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=s;const r=s&1?"R":"L",l=r;let a=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<t;c++){const u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<t&&n[u]==="ON";)u++;const d=c>0?n[c-1]:l,f=u<t?n[u]:l,h=d!=="L"?"R":"L";if(h===(f!=="L"?"R":"L"))for(let g=c;g<u;g++)n[g]=h;c=u-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=r);for(let c=0;c<t;c++){const u=n[c];(i[c]&1)===0?u==="R"?i[c]++:(u==="AN"||u==="EN")&&(i[c]+=2):(u==="L"||u==="AN"||u==="EN")&&i[c]++}return i}function mse(e,t){const n=pse(e);if(n===null)return null;const o=new Int8Array(t.length);for(let s=0;s<t.length;s++)o[s]=n[t[s]];return o}const gse=/[ \t\n\r\f]+/g,vse=/[\t\n\r\f]| {2,}|^ | $/;function yse(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function kse(e){if(!vse.test(e))return e;let t=e.replace(gse," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function bse(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
294
- `).replace(/[\r\f]/g,`
295
- `):e}let ag=null,xse;function wse(){return ag===null&&(ag=new Intl.Segmenter(xse,{granularity:"word"})),ag}const _se=/\p{Script=Arabic}/u,Pl=/\p{M}/u,Nk=/\p{Nd}/u;function NC(e){return _se.test(e)}function IC(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 or(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){const s=(n-55296<<10)+(o-56320)+65536;if(IC(s))return!0;t++;continue}}if(IC(n))return!0}}return!1}function Sse(e){const t=Zd(e);return t!==null&&(Ik.has(t)||Aa.has(t))}const Cse=new Set([" "," ","⁠","\uFEFF"]),Ase=new Set(["-","‐","–","—"]);function Mse(e){const t=Zd(e);return t!==null&&Cse.has(t)}function Ese(e){const t=Zd(e);return t!==null&&Ase.has(t)}function w5(e,t){return Mse(e)?!1:t?!(Sse(e)||Ese(e)):!0}const Ik=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Bm=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Lk=new Set(["'","’"]),Aa=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Tse=new Set([":",".","،","؛"]),Nse=new Set(["၏"]),Ise=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Lse(e){if($k(e))return!0;let t=!1;for(const n of e){if(Aa.has(n)||Pm(n)){t=!0;continue}if(!(t&&Pl.test(n)))return!1}return t}function $se(e){for(const t of e)if(!Ik.has(t)&&!Aa.has(t))return!1;return e.length>0}function Fse(e){if($k(e))return!0;for(const t of e)if(!Bm.has(t)&&!Lk.has(t)&&!Pl.test(t)&&!Pm(t))return!1;return e.length>0}function $k(e){let t=!1;for(const n of e)if(!(n==="\\"||Pl.test(n))){if(Bm.has(n)||Aa.has(n)||Lk.has(n)){t=!0;continue}return!1}return t}function Dm(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 Zd(e){if(e.length===0)return null;const t=Dm(e,e.length);return e.slice(t)}function Ose(e){for(const t of e)if(!Pl.test(t))return t;return null}function Rse(e){for(let t=e.length;t>0;){const n=Dm(e,t),o=e.slice(n,t);if(!Pl.test(o))return o;t=n}return null}const Bse=[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 Dse(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function Pm(e){const t=e.codePointAt(0);return t!==void 0&&Dse(t,Bse)}function Pse(e){const t=Rse(e);return t!==null&&Pm(t)}function Hse(e){const t=Ose(e);return t!==null&&Nk.test(t)}function Wse(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Pl.test(o)){n--;continue}if(Bm.has(o)||Lk.has(o)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function zse(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function LC(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 $C(e,t){return e&&t!==null&&Tse.has(t)}function Use(e){const t=Zd(e);return t!==null&&Nse.has(t)}function qse(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function Wv(e){let t=e.length;for(;t>0;){const n=Dm(e,t),o=e.slice(n,t);if(Ise.has(o))return!0;if(!Aa.has(o))return!1;t=n}return!1}function jse(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
296
- `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const Vse=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Oi(e){return e.length===1?e[0]:e.join("")}function Kse(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Oi(n)}function Gse(e,t,n,o){if(!Vse.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=jse(u,o),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&s.push({text:Oi(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&s.push({text:Oi(r),isWordLike:a,kind:i,start:l}),s}function zv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Yse=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Zse(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:Yse.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Xse(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Qse(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let r=0;r<e.len;r++){if(o[r]!=="text"||!Zse(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!zv(o[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(o[a]="text",t[a]="",a++,c)break}t[r]=Oi(l)}let i=0;for(let r=0;r<t.length;r++){const l=t[r];l.length!==0&&(i!==r&&(t[i]=l,n[i]=n[r],o[i]=o[r],s[i]=s[r]),i++)}return t.length=i,n.length=i,o.length=i,s.length=i,{len:i,texts:t,isWordLike:n,kinds:o,starts:s}}function Jse(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i]),!Xse(r))continue;const l=i+1;if(l>=e.len||zv(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!zv(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(Oi(a)),n.push(!0),o.push("text"),s.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}const eie=new Set([":","-","/","×",",",".","+","–","—"]),tie=/[\p{P}\p{S}\p{Co}]/u,nie=/\p{Emoji_Presentation}/u,oie=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function sie(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function _5(e){const t=e.charCodeAt(0);return t<128?sie(t):!oie.has(e)&&!nie.test(e)&&tie.test(e)}function FC(e){let t=!1;for(const n of e)if(!Pl.test(n)){if(!_5(n))return!1;t=!0}return t}function iie(e){for(let t=e.length;t>0;){const n=Dm(e,t),o=e.slice(n,t);if(Pl.test(o)){t=n;continue}return _5(o)||Pm(o)}return!1}function rie(e,t,n,o){const s=!t&&FC(e),i=!o&&FC(n),r=Pse(e),l=(t||r)&&iie(e);return!s&&!i&&!l||or(e)||or(n)?!1:(t||s||r)&&(o||i)}function S5(e){for(const t of e)if(Nk.test(t))return!0;return!1}function Np(e){if(e.length===0)return!1;for(const t of e)if(!(Nk.test(t)||eie.has(t)))return!1;return!0}function lie(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&Np(r)&&S5(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Np(e.texts[c]);)a.push(e.texts[c]),c++;t.push(Oi(a)),n.push(!0),o.push("text"),s.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),o.push(l),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function aie(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=e.texts[i],l=e.kinds[i],a=e.isWordLike[i];if(l==="text"){const c=[r];let u=i+1,d=a;for(;u<e.len&&e.kinds[u]==="text"&&rie(e.texts[u-1],e.isWordLike[u-1],e.texts[u],e.isWordLike[u]);){const f=e.texts[u];c.push(f),d=d||e.isWordLike[u],u++}if(u>i+1){t.push(Oi(c)),n.push(d),o.push("text"),s.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),o.push(l),s.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function cie(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(e.kinds[i]==="text"&&r.includes("-")){const l=r.split("-");let a=l.length>1;for(let c=0;c<l.length;c++){const u=l[c];if(!a)break;(u.length===0||!S5(u)||!Np(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){const d=l[u],f=u<l.length-1?`${d}-`:d;t.push(f),n.push(!0),o.push("text"),s.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function uie(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=[e.texts[i]];let l=e.isWordLike[i],a=e.kinds[i],c=e.starts[i];if(a==="glue"){const u=[r[0]],d=c;for(i++;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const f=Oi(u);if(i<e.len&&e.kinds[i]==="text")r[0]=f,r.push(e.texts[i]),l=e.isWordLike[i],a="text",c=d,i++;else{t.push(f),n.push(!1),o.push("glue"),s.push(d);continue}}else i++;if(a==="text")for(;i<e.len&&e.kinds[i]==="glue";){const u=[];for(;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const d=Oi(u);if(i<e.len&&e.kinds[i]==="text"){r.push(d,e.texts[i]),l=l||e.isWordLike[i],i++;continue}r.push(d)}t.push(Oi(r)),n.push(l),o.push(a),s.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function die(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let i=0;i<t.length-1;i++){if(o[i]!=="text"||o[i+1]!=="text"||!or(t[i])||!or(t[i+1]))continue;const r=Wse(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],s[i+1]=s[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function fie(e,t,n){const o=wse();let s=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],b=[];for(const $ of o.segment(e))for(const L of Gse($.segment,$.isWordLike??!1,$.index,n)){let W=function(){u[B]!==null&&(r[B]=[LC(i,u,d,B)],u[B]=null),r[B].push(L.text),l[B]=l[B]||L.isWordLike,f[B]=f[B]||T,h[B]=h[B]||F,p[B]=I,g[B]=P,b[B]=$C(h[B],S)};const w=L.kind==="text",E=zse(L.text,L.isWordLike,L.kind),T=or(L.text),F=NC(L.text),S=Zd(L.text),I=Wv(L.text),P=Use(L.text),B=s-1;t.carryCJKAfterClosingQuote&&w&&s>0&&a[B]==="text"&&T&&f[B]&&p[B]||w&&s>0&&a[B]==="text"&&$se(L.text)&&f[B]||w&&s>0&&a[B]==="text"&&g[B]?W():w&&s>0&&a[B]==="text"&&L.isWordLike&&F&&b[B]?(W(),l[B]=!0):E!==null&&s>0&&a[B]==="text"&&u[B]===E?d[B]=(d[B]??1)+1:w&&!L.isWordLike&&s>0&&a[B]==="text"&&!f[B]&&(Lse(L.text)||L.text==="-"&&l[B])?W():(i[s]=L.text,r[s]=[L.text],l[s]=L.isWordLike,a[s]=L.kind,c[s]=L.start,u[s]=E,d[s]=E===null?0:1,f[s]=T,h[s]=F,p[s]=I,g[s]=P,b[s]=$C(F,S),s++)}for(let $=0;$<s;$++){if(u[$]!==null){i[$]=LC(i,u,d,$);continue}i[$]=Oi(r[$])}for(let $=1;$<s;$++)a[$]==="text"&&!l[$]&&$k(i[$])&&a[$-1]==="text"&&!f[$-1]&&(i[$-1]+=i[$],l[$-1]=l[$-1]||l[$],i[$]="");const v=Array.from({length:s},()=>null);let m=-1;for(let $=s-1;$>=0;$--){const L=i[$];if(L.length!==0){if(a[$]==="text"&&!l[$]&&m>=0&&a[m]==="text"&&(Fse(L)||L==="-"&&Hse(i[m]))){const w=v[m]??[];w.push(L),v[m]=w,c[m]=c[$],i[$]="";continue}m=$}}for(let $=0;$<s;$++){const L=v[$];L!=null&&(i[$]=Kse(L,i[$]))}let y=0;for(let $=0;$<s;$++){const L=i[$];L.length!==0&&(y!==$&&(i[y]=L,l[y]=l[$],a[y]=a[$],c[y]=c[$]),y++)}i.length=y,l.length=y,a.length=y,c.length=y;const k=uie({len:y,texts:i,isWordLike:l,kinds:a,starts:c}),A=die(aie(cie(lie(Jse(Qse(k))))));for(let $=0;$<A.len-1;$++){const L=qse(A.texts[$]);L!==null&&(A.kinds[$]!=="space"&&A.kinds[$]!=="preserved-space"||A.kinds[$+1]!=="text"||!NC(A.texts[$+1])||(A.texts[$]=L.space,A.isWordLike[$]=!1,A.kinds[$]=A.kinds[$]==="preserved-space"?"preserved-space":"space",A.texts[$+1]=L.marks+A.texts[$+1],A.starts[$+1]=A.starts[$]+L.space.length))}return A}function hie(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 pie(e,t,n){if(t.len<=1)return t;const o=[],s=[],i=[],r=[];let l=-1,a=!1;function c(f){o.push(t.texts[f]),s.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,h){let p=!1;for(let v=f;v<h;v++)p=p||t.isWordLike[v];const g=t.starts[f],b=h<t.len?t.starts[h]:e.length;o.push(e.slice(g,b)),s.push(p),i.push("text"),r.push(g)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let h=l;h<f;h++)c(h);l=-1,a=!1}}for(let f=0;f<t.len;f++){const h=t.texts[f],p=t.kinds[f];if(p==="text"){l>=0&&!w5(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||or(h);continue}d(f),o.push(h),s.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:o.length,texts:o,isWordLike:s,kinds:i,starts:r}}function mie(e,t,n="normal",o="normal"){const s=yse(n),i=s.mode==="pre-wrap"?bse(e):kse(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=fie(i,t,s),l=o==="keep-all"?pie(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:hie(l,s),...l}}let rc=null;const OC=new Map;let lc=null;const gie=96,vie=/\p{Emoji_Presentation}/u,yie=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let cg=null;const RC=new Map;function Fk(){if(rc!==null)return rc;if(typeof OffscreenCanvas<"u")return rc=new OffscreenCanvas(1,1).getContext("2d"),rc;if(typeof document<"u")return rc=document.createElement("canvas").getContext("2d"),rc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function kie(e){let t=OC.get(e);return t||(t=new Map,OC.set(e,t)),t}function kl(e,t){let n=t.get(e);return n===void 0&&(n={width:Fk().measureText(e).width,containsCJK:or(e)},t.set(e,n)),n}function Hm(){if(lc!==null)return lc;if(typeof navigator>"u")return lc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},lc;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),o=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return lc={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:o,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},lc}function bie(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function C5(){return cg===null&&(cg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),cg}function xie(e){return vie.test(e)||e.includes("️")}function wie(e){return yie.test(e)}function _ie(e,t){let n=RC.get(e);if(n!==void 0)return n;const o=Fk();o.font=e;const s=o.measureText("😀").width;if(n=0,s>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),s-r>.5&&(n=s-r)}return RC.set(e,n),n}function Sie(e){let t=0;const n=C5();for(const o of n.segment(e))xie(o.segment)&&t++;return t}function Cie(e,t){return t.emojiCount===void 0&&(t.emojiCount=Sie(e)),t.emojiCount}function ma(e,t,n){return n===0?t.width:t.width-Cie(e,t)*n}function Aie(e,t,n,o,s){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===s)return t.breakableFitAdvances;t.breakableFitMode=s;const i=C5(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(s==="sum-graphemes"){const u=[];for(const d of r){const f=kl(d,n);u.push(ma(d,f,o))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(s==="pair-context"||r.length>gie){const u=[];let d=null,f=0;for(const h of r){const p=kl(h,n),g=ma(h,p,o);if(d===null)u.push(g);else{const b=d+h,v=kl(b,n);u.push(ma(b,v,o)-f)}d=h,f=g}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=kl(a,n),f=ma(a,d,o);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Mie(e,t){const n=Fk();n.font=e;const o=kie(e),s=bie(e),i=t?_ie(e,s):0;return{cache:o,fontSize:s,emojiCorrection:i}}function Eie(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function A5(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function M5(e,t,n=e.widths.length){for(;t<n;){const o=e.kinds[t];if(!Eie(o))break;t++}return t}function Tie(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Nie(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Ok(e,t){return t===0?0:e+t}function Iie(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function Lie(e,t,n,o,s){const i=t==="tab"?s+Iie(e,n):e.lineEndFitAdvances[n];return Ok(o,i)}function BC(e,t,n,o){const s=t==="tab"?0:e.lineEndFitAdvances[n];return Ok(o,s)}function DC(e,t,n,o,s){const i=t==="tab"?s:e.lineEndPaintAdvances[n];return Ok(o,i)}function $ie(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Fie(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Ip(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function Oie(e,t,n,o,s){if(e.letterSpacing===0)return 0;if(s>0)return e.spacingGraphemeCounts[o]>0?e.letterSpacing:0;for(let i=o-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===o-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function Rie(e,t,n,o,s,i){return t+Oie(e,n,o,s,i)}function Bie(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(o.length===0)return 0;const a=Hm().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,g=0,b=0,v=-1,m=0;function y(){v=-1,m=0}function k(T=g,F=b,S=d){u++,n?.(S,h,p,T,F),d=0,f=!1,y()}function A(T,F){f=!0,h=T,p=0,g=T+1,b=0,d=F}function $(T,F,S){f=!0,h=T,p=F,g=T,b=F+1,d=S}function L(T,F){if(!f){A(T,F);return}d+=F,g=T+1,b=0}function w(T,F){const S=i[T],I=r[T]??null;let P=I===null?-1:Ip(I,0,F+1),B=-1,W=0,z=F;for(;z<S.length;){const D=S[z];if(!f)$(T,z,D);else if(d+D>c){if(I!==null&&B>F){k(T,B,W),z=B,P=Ip(I,P,z+1),B=-1,W=0;continue}k(),$(T,z,D)}else d+=D,g=T,b=z+1;const q=z+1;I!==null&&I[P]===q&&(B=q,W=d,P++),z++}f&&g===T&&b===S.length&&(g=T+1,b=0)}let E=0;for(;E<o.length&&!(!f&&(E=M5(e,E),E>=o.length));){const T=o[E],F=s[E],S=A5(F);if(!f){T>c&&i[E]!==null?w(E,0):A(E,T),S&&(v=E+1,m=d-T),E++;continue}if(d+T>c){if(S){L(E,T),k(E+1,0,d-T),E++;continue}if(v>=0){if(g>v||g===v&&b>0){k();continue}k(v,0,m);continue}if(T>c&&i[E]!==null){k(),w(E,0),E++;continue}k();continue}L(E,T),S&&(v=E+1,m=d-T),E++}return f&&k(),u}function Die(e,t,n){if(e.simpleLineWalkFastPath)return Bie(e,t,n);const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(o.length===0||a.length===0)return 0;const c=Hm(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,g=0,b=0,v=0,m=0,y=-1,k=0,A=0,$=null;function L(){y=-1,k=0,A=0,$=null}function w(){return $==="soft-hyphen"&&y===v&&m===0?A:h}function E(W=v,z=m,D){f++,n!==void 0&&n(Rie(e,D??w(),g,b,W,z),g,b,W,z),h=0,p=!1,L()}function T(W,z){p=!0,g=W,b=0,v=W+1,m=0,h=z}function F(W,z,D){p=!0,g=W,b=z,v=W,m=z+1,h=D}function S(W,z){if(!p){T(W,z);return}h+=z,v=W+1,m=0}function I(W,z,D,q,j,ie){if(!z)return;const ue=BC(e,W,D,j),pe=DC(e,W,D,j,q);y=D+1,k=h-ie+ue,A=h-ie+pe,$=W}function P(W,z){const D=i[W],q=r[W]??null;let j=q===null?-1:Ip(q,0,z+1),ie=-1,ue=0,pe=z;for(;pe<D.length;){const ee=D[pe];if(!p)F(W,pe,ee);else{const fe=$ie(e,!0,ee),Me=h+fe;if(Fie(e,Me)>d){if(q!==null&&ie>z){E(W,ie,ue),pe=ie,j=Ip(q,j,pe+1),ie=-1,ue=0;continue}E(),F(W,pe,ee)}else h=Me,v=W,m=pe+1}const ne=pe+1;q!==null&&q[j]===ne&&(ie=ne,ue=h,j++),pe++}p&&v===W&&m===D.length&&(v=W+1,m=0)}function B(W){f++,n?.(0,W.startSegmentIndex,0,W.consumedEndSegmentIndex,0),L()}for(let W=0;W<a.length;W++){const z=a[W];if(z.startSegmentIndex===z.endSegmentIndex){B(z);continue}p=!1,h=0,g=z.startSegmentIndex,b=0,v=z.startSegmentIndex,m=0,L();let D=z.startSegmentIndex;for(;D<z.endSegmentIndex&&!(!p&&(D=M5(e,D,z.endSegmentIndex),D>=z.endSegmentIndex));){const q=s[D],j=A5(q),ie=Nie(e,p,D),ue=q==="tab"?Tie(h+ie,e.tabStopAdvance):o[D],pe=ie+ue,ee=Lie(e,q,D,ie,ue);if(q==="soft-hyphen"){p&&(v=D+1,m=0,y=D+1,k=h+l,A=h+l,$=q),D++;continue}if(!p){ee>d&&i[D]!==null?P(D,0):T(D,ue),I(q,j,D,ue,ie,pe),D++;continue}if(h+ee>d){const fe=h+BC(e,q,D,ie),Me=h+DC(e,q,D,ie,ue);if($==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&k<=d){E(y,0,A);continue}if(j&&fe<=d){S(D,pe),E(D+1,0,Me),D++;continue}if(y>=0&&k<=d){if(v>y||v===y&&m>0){E();continue}const $e=y;E($e,0,A),D=$e;continue}if(ee>d&&i[D]!==null){E(),P(D,0),D++;continue}E();continue}S(D,pe),I(q,j,D,ue,ie,pe),D++}if(p){const q=y===z.consumedEndSegmentIndex?A:h;E(z.consumedEndSegmentIndex,0,q)}}return f}let ug=null;function Rk(){return ug===null&&(ug=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ug}function Pie(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function Hie(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 c(d,f,h){o=[d],s=f,i=h,r=Wv(d),l=Bm.has(d)}function u(d,f){o.push(d),i=i||f;const h=Wv(d);d.length===1&&Aa.has(d)?r=r||h:r=h,l=!1}for(const d of Rk().segment(e)){const f=d.segment,h=or(f);if(o.length===0){c(f,d.index,h);continue}if(l||Ik.has(f)||Aa.has(f)||t.carryCJKAfterClosingQuote&&h&&r){u(f,h);continue}if(!i&&!h){u(f,h);continue}a(),c(f,d.index,h)}return a(),n}function Wie(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;o.push({text:e.slice(u,d),start:u})}function l(a){if(!(s<0)){if(i)s+1===a?o.push(t[s]):r(s,a);else for(let c=s;c<a;c++)o.push(t[c]);s=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];s>=0&&!w5(t[a-1].text,n)&&l(a),s<0&&(s=a),i=i||or(c.text)}return l(t.length),o}function PC(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=Rk();for(const s of o.segment(e))n++;return n}function zie(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Uie(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const o of Rk().segment(e))n++,zie(o.segment)&&t.push(n);return t.length===0?null:t}function qie(e,t,n){return t>1?e+(t-1)*n:e}function jie(e,t,n,o,s){const i=Hm(),{cache:r,emojiCorrection:l}=Mie(t,wie(e.normalized)),a=ma("-",kl("-",r),l)+(s===0?0:s*2),u=ma(" ",kl(" ",r),l)*8,d=s!==0;if(e.len===0)return Pie();const f=[],h=[],p=[],g=[];let b=e.chunks.length<=1&&!d;const v=n?[]:null,m=[],y=[],k=[],A=n?[]:null,$=Array.from({length:e.len});function L(F,S,I,P,B,W,z,D,q){B!=="text"&&B!=="space"&&B!=="zero-width-break"&&(b=!1),f.push(S),h.push(I),p.push(P),g.push(B),v?.push(W),m.push(z),y.push(D),d&&k.push(q),A!==null&&A.push(F)}function w(F,S,I,P,B){const W=kl(F,r),z=d?PC(F,S):0,D=qie(ma(F,W,l),z,s),q=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:D,j=q===0?0:q+(z>0?s:0),ie=S==="space"||S==="zero-width-break"?0:D;if(B&&P&&F.length>1){let ue="sum-graphemes";s!==0?ue="segment-prefixes":Np(F)?ue="pair-context":i.preferPrefixWidthsForBreakableRuns&&(ue="segment-prefixes");const pe=Aie(F,W,r,l,ue),ee=pe===null||o==="keep-all"?null:Uie(F);L(F,D,j,ie,S,I,pe,ee,z);return}L(F,D,j,ie,S,I,null,null,z)}for(let F=0;F<e.len;F++){$[F]=f.length;const S=e.texts[F],I=e.isWordLike[F],P=e.kinds[F],B=e.starts[F];if(P==="soft-hyphen"){L(S,0,a,a,P,B,null,null,0);continue}if(P==="hard-break"){L(S,0,0,0,P,B,null,null,0);continue}if(P==="tab"){L(S,0,0,0,P,B,null,null,d?PC(S,P):0);continue}const W=kl(S,r);if(P==="text"&&W.containsCJK){const z=Hie(S,i),D=o==="keep-all"?Wie(S,z,i.breakKeepAllAfterPunctuation):z;for(let q=0;q<D.length;q++){const j=D[q];w(j.text,"text",B+j.start,I,o==="keep-all"||!or(j.text))}continue}w(S,P,B,I,!0)}const E=Vie(e.chunks,$,f.length),T=v===null?null:mse(e.normalized,v);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:g,simpleLineWalkFastPath:b,segLevels:T,breakableFitAdvances:m,breakablePreferredBreaks:y,letterSpacing:s,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:g,simpleLineWalkFastPath:b,segLevels:T,breakableFitAdvances:m,breakablePreferredBreaks:y,letterSpacing:s,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E}}function Vie(e,t,n){const o=[];for(let s=0;s<e.length;s++){const i=e[s],r=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,a=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;o.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return o}function Kie(e,t,n,o){const s=o?.wordBreak??"normal",i=o?.letterSpacing??0,r=mie(e,Hm(),o?.whiteSpace,s);return jie(r,t,n,s,i)}function Gie(e,t,n){return Kie(e,t,!0,n)}function Yie(e){let t=0;return Die(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const Zie={key:0,class:"slash-menu",role:"listbox"},Xie=["aria-selected","onMouseenter","onMousedown"],Qie={class:"slash-name"},Jie={class:"slash-desc"},ere=Ye({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Mt(),o=e,s=t,i=Z([]);return Qe(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(x(),N("div",Zie,[(x(!0),N(Pe,null,nt(e.items,(a,c)=>(x(),N("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:We(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:bt(u=>s("select",a),["prevent"])},[_("span",Qie,O(a.name),1),_("span",Jie,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,Xie))),128))])):le("",!0)}}),tre=at(ere,[["__scopeId","data-v-f60b70d9"]]),nre={class:"mention-menu",role:"listbox"},ore={key:0,class:"mention-state dim"},sre={key:1,class:"mention-state dim"},ire=["aria-selected","onMouseenter","onMousedown"],rre=["innerHTML"],lre={class:"mention-name"},are={class:"mention-path"},cre=Ye({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Mt(),i=fc("folder","sm"),r=fc("code","sm"),l=fc("file-text","sm"),a=fc("image","sm"),c=fc("file","sm"),u=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const g=p.path;if(g.endsWith("/"))return i;const b=p.name||g.split("/").pop()||g,v=b.lastIndexOf("."),m=v>0?b.slice(v+1).toLowerCase():"";return m?u.has(m)?r:d.has(m)?l:f.has(m)?a:c:c}return(p,g)=>(x(),N("div",nre,[n.loading?(x(),N("div",ore,O(C(s)("mention.searching")),1)):n.items.length===0?(x(),N("div",sre,O(C(s)("mention.noMatch")),1)):(x(!0),N(Pe,{key:2},nt(n.items,(b,v)=>(x(),N("div",{key:b.path,class:We(["mention-item",{active:v===n.activeIndex}]),role:"option","aria-selected":v===n.activeIndex,onMouseenter:m=>o("hover",v),onMousedown:bt(m=>o("select",b),["prevent"])},[_("span",{class:"mention-icon",innerHTML:h(b),"aria-hidden":"true"},null,8,rre),_("span",lre,O(b.name),1),_("span",are,O(b.path),1)],42,ire))),128))]))}}),ure=at(cre,[["__scopeId","data-v-f4d6b958"]]),E5=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function dre(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const Lp="skill:";function fre(e){return e.startsWith(Lp)?e.slice(Lp.length):e}function T5(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Lp}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...E5,...t]}function hre(e,t=E5){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const i=o.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:o,index:s,score:r}}).filter(({score:o})=>o>0).sort((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function Wm(e){if(e===void 0)return"toggle";const t=e.capabilities??[];return t.includes("always_thinking")?"always-on":t.includes("thinking")||e.adaptiveThinking===!0?"toggle":"unsupported"}function N5(e){return e?.supportEfforts??[]}function pre(e){return e[Math.floor(e.length/2)]}function zm(e){if(Wm(e)==="unsupported")return"off";const t=N5(e);return t.length>0?e?.defaultEffort??pre(t):"on"}function Bk(e){const t=N5(e),n=Wm(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Uv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function mre(e){return e!=="off"}function Dk(e,t){return t==="off"?"off":t==="on"?zm(e):t}function $p(e,t){return t??zm(e)}function gre(e){return e==="off"?{enabled:!1}:e==="on"?{enabled:!0}:{enabled:!0,effort:e}}function vre(e,t,n){return!n||e===void 0?t:zm(e)}const Fp=100;function yre(e){const t=hm(Lt.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>Fp?n.slice(-Fp):n,s={[e]:o};return zd(Lt.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function kre(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=Z(yre(s())),r=R(()=>i.value[s()??""]??[]);let l=-1,a="";function c(v){const m=s();if(l=-1,!m)return;const y=v.trim();if(!y)return;const k=i.value[m]??[];if(k.at(-1)===y)return;const A=[...k,y],$=A.length>Fp?A.slice(-Fp):A;i.value={...i.value,[m]:$},zd(Lt.inputHistory,i.value)}function u(){const v=n.value;return v?(v.selectionStart??0)===0:!1}function d(v){t.value=v,mt(()=>{const m=n.value;if(!m)return;o();const y=v.length;m.setSelectionRange(y,y)})}function f(){const v=r.value;if(v.length!==0){if(l===-1)a=t.value,l=v.length-1;else if(l>0)l-=1;else return;d(v[l])}}function h(){if(l===-1)return;const v=r.value;l<v.length-1?(l+=1,d(v[l])):(l=-1,d(a))}function p(){l=-1}function g(){return l!==-1}function b(){return r.value.length>0}return Qe(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:g,hasHistory:b}}function bre(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=Z(!1),c=Z([]),u=Z(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=hre(h,T5(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,mt(()=>{const p=n.value;if(!p)return;const g=t.value.length;p.setSelectionRange(g,g),p.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function xre(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=Z(!1),r=Z([]),l=Z(0),a=Z(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let g=p-1;for(;g>=0&&!/\s/.test(h[g]);)g--;g++;const b=h.slice(g,p);return b.startsWith("@")?{token:b.slice(1),start:g,end:p}:null}function d(){const h=u(),p=s();if(!h||!p){i.value=!1;return}const g=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(g)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const g=t.value;t.value=g.slice(0,p.start)+h.path+g.slice(p.end),i.value=!1,mt(()=>{const b=n.value;if(!b)return;const v=p.start+h.path.length;b.setSelectionRange(v,v),b.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function wre(e){const{sessionId:t}=e;function n(c){return oo(Zx(c))??""}function o(c,u){const d=Zx(c);u?uo(d,u):Kc(d)}const s=Z(n(t())),i=Z(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Qe(s,c=>{mt(r),o(t(),c)}),Qe(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),mt(r))});function l(c){s.value=c,mt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function _re(e){const{uploadImage:t,sessionId:n}=e,o=Z({}),s=R(()=>o.value[n()??""]??[]),i=Z(null),r=Z(null),l=Z(!1);let a=0;function c(){return`att_${++a}`}function u(z,D){o.value={...o.value,[z]:D}}function d(z){if(z.previewUrl!==void 0)try{URL.revokeObjectURL(z.previewUrl)}catch{}}function f(z){return z.startsWith("image/")?"image":z.startsWith("video/")?"video":"file"}async function h(z){const D=t();if(!D)return;const q=n()??"";if(z.length!==0)for(const j of z){const ie=f(j.type),ue=c(),pe=ie==="file"?void 0:URL.createObjectURL(j),ee={localId:ue,name:j.name,kind:ie,previewUrl:pe,mediaType:j.type||"application/octet-stream",size:j.size,uploading:!0};u(q,[...o.value[q]??[],ee]),D(j,j.name).then(ne=>{const fe=o.value[q]??[];u(q,fe.map(Me=>Me.localId===ue?{...Me,uploading:!1,fileId:ne?.fileId,mediaType:ne?.mediaType??Me.mediaType,error:ne===null}:Me))}).catch(()=>{const ne=o.value[q]??[];u(q,ne.map(fe=>fe.localId===ue?{...fe,uploading:!1,error:!0}:fe))})}}function p(z){const D=n()??"",q=o.value[D]??[],j=q.find(ie=>ie.localId===z);i.value?.localId===z&&(i.value=null),j&&d(j),u(D,q.filter(ie=>ie.localId!==z))}function g(z){i.value=z}function b(){i.value=null}function v(){r.value?.click()}function m(z){const D=z.target,q=Array.from(D.files??[]);h(q),D.value=""}function y(z){if(!t())return;const D=z.clipboardData;if(!D)return;const q=[],j=new Set,ie=(ue,pe)=>{const ee=`${ue.size}:${ue.type}:${pe}`;if(j.has(ee))return;j.add(ee);const ne=ue.type.split("/")[1]??"png",fe=pe.includes(".")?pe:`paste-${Date.now()}.${ne}`;q.push(ue instanceof File?ue:new File([ue],fe,{type:ue.type}))};for(const ue of Array.from(D.items))if(ue.kind==="file"){const pe=ue.getAsFile();pe&&ie(pe,pe.name||`paste-${Date.now()}.${ue.type.split("/")[1]??"png"}`)}for(const ue of Array.from(D.files))ie(ue,ue.name);q.length!==0&&(z.preventDefault(),h(q))}let k=0;function A(z){!t()||!Array.from(z.dataTransfer?.items??[]).some(q=>q.kind==="file")||(z.preventDefault(),z.stopPropagation(),l.value=!0)}function $(){l.value=!1}function L(z){if(k=0,l.value=!1,!t())return;z.preventDefault(),z.stopPropagation();const D=Array.from(z.dataTransfer?.files??[]);h(D)}function w(z){return Array.from(z.dataTransfer?.items??[]).some(D=>D.kind==="file")}function E(z){!t()||!w(z)||(z.preventDefault(),k+=1,l.value=!0)}function T(z){!t()||!w(z)||z.preventDefault()}function F(z){!t()||!w(z)||(k=Math.max(0,k-1),k===0&&(l.value=!1))}function S(z){if(k=0,l.value=!1,!t())return;z.preventDefault();const D=Array.from(z.dataTransfer?.files??[]);h(D)}function I(){const z=n()??"";for(const D of o.value[z]??[])d(D);u(z,[])}function P(z,D,q){const j=o.value[z]??[];j.some(ie=>ie.localId===D)&&u(z,j.map(ie=>ie.localId===D?{...ie,...q}:ie))}function B(z){return fetch(z).then(D=>{if(!D.ok)throw new Error(`fetch failed: ${D.status}`);return D.blob()})}function W(z){const D=n()??"";for(const q of o.value[D]??[])d(q);u(D,[]);for(const q of z){const j=c(),ie=/^data:/i.test(q.url),ue=/^blob:/i.test(q.url),pe=q.name??q.kind;if(q.fileId){const ee={localId:j,name:pe,kind:q.kind,previewUrl:q.kind==="file"?void 0:q.url,uploading:!1,fileId:q.fileId};u(D,[...o.value[D]??[],ee]),q.kind!=="file"&&!ie&&!ue&&ct().getFileBlob(q.fileId).then(ne=>{const fe=URL.createObjectURL(ne);if(!(o.value[D]??[]).some($e=>$e.localId===j)){URL.revokeObjectURL(fe);return}P(D,j,{previewUrl:fe})}).catch(()=>{})}else{if(!q.url)continue;const ee=t();if(!ee)continue;const ne={localId:j,name:pe,kind:q.kind,previewUrl:q.url,uploading:!0};u(D,[...o.value[D]??[],ne]),B(q.url).then(fe=>{const Me=pe.includes(".")?pe:`${pe}.${fe.type.split("/")[1]??"bin"}`;return ee(fe,Me)}).then(fe=>{if(fe===null){const Me=o.value[D]??[];u(D,Me.filter($e=>$e.localId!==j));return}P(D,j,{uploading:!1,fileId:fe.fileId})}).catch(()=>{const fe=o.value[D]??[];u(D,fe.filter(Me=>Me.localId!==j))})}}}return Qe(n,()=>{i.value=null}),cn(()=>{document.addEventListener("paste",y),document.addEventListener("dragenter",E),document.addEventListener("dragover",T),document.addEventListener("dragleave",F),document.addEventListener("drop",S)}),wn(()=>{document.removeEventListener("paste",y),document.removeEventListener("dragenter",E),document.removeEventListener("dragover",T),document.removeEventListener("dragleave",F),document.removeEventListener("drop",S);for(const z of Object.values(o.value))for(const D of z)d(D);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:g,closeAttachmentPreview:b,openFilePicker:v,handleFileInputChange:m,handleDragOver:A,handleDragLeave:$,handleDrop:L,clearAfterSubmit:I,loadAttachments:W}}const Sre=["type","disabled"],Cre={class:"ui-button__content"},Are=Ye({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(x(),N("button",{class:We(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(x(),be(Rs,{key:0,size:"sm",class:"ui-button__spinner"})):le("",!0),_("span",Cre,[Fn(t.$slots,"default",{},void 0,!0)])],10,Sre))}}),Ft=at(Are,[["__scopeId","data-v-e58393a8"]]),Mre={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},Ere=["stroke-dasharray","stroke-dashoffset"],dg=7,Tre=Ye({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*dg;return(o,s)=>(x(),N("svg",Mre,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:dg,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:dg,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,Ere)]))}}),Nre=at(Tre,[["__scopeId","data-v-a364f1f1"]]),Ire={key:0,class:"att-strip"},Lre={class:"att-lightbox-card"},$re=["src"],Fre=["src","alt"],Ore={class:"att-lightbox-name"},Rre={class:"composer-card"},Bre={class:"cin-wrap"},Dre={class:"input-row"},Pre=["placeholder","disabled"],Hre=["aria-label"],Wre={class:"toolbar-left"},zre=["onKeydown"],Ure=["onClick"],qre={class:"pd-check"},jre={class:"pd-info"},Vre={class:"pd-desc"},Kre={class:"mode-label"},Gre={key:0,class:"mode-tag"},Yre={key:1,class:"mode-tag"},Zre={key:2,class:"mode-tag"},Xre={class:"mode-row-icon"},Qre={class:"mode-row-info"},Jre={class:"mode-row-name"},ele={class:"mode-row-desc"},tle={class:"mode-row-icon"},nle={class:"mode-row-info"},ole={class:"mode-row-name"},sle={class:"mode-row-desc"},ile={class:"mode-row-icon"},rle={class:"mode-row-info"},lle={class:"mode-row-name"},ale={class:"mode-row-desc"},cle={key:0,class:"mode-row-actions"},ule={class:"toolbar-right"},dle=["aria-label"],fle={class:"ctx-num"},hle=["onKeydown"],ple={key:0,class:"think-suffix"},mle=["aria-label"],gle=["aria-label","disabled"],vle={key:0,class:"md-section"},yle=["onClick"],kle={class:"md-check"},ble={class:"md-name"},xle={class:"md-provider"},wle={key:1,class:"md-divider"},_le={key:2,class:"md-section"},Sle=["onClick"],Cle={class:"md-check"},Ale={class:"md-name"},Mle={key:3,class:"md-divider"},Ele={class:"md-name"},Tle={key:0,class:"md-note"},Nle=["aria-label"],Ile=["disabled","onClick"],Lle={class:"md-name"},$le={class:"drop-card"},HC=36,Fle=Ye({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const o=e,s=R(()=>o.starting?r("composer.starting"):o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=Mt(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=wre({sessionId:()=>o.sessionId}),h=Z(!1);function p(){h.value=!h.value,mt(()=>{u(),m(),c.value?.focus()})}function g(){h.value&&(h.value=!1,mt(u))}function b(Ce){if(typeof getComputedStyle>"u")return HC;const te=Number.parseFloat(getComputedStyle(Ce).minHeight);return Number.isFinite(te)&&te>0?te:HC}const v=Z(!1);function m(){const Ce=c.value;v.value=!!Ce&&Ce.scrollHeight>b(Ce)}Qe(a,()=>{mt(m)}),Qe(()=>o.sessionId,()=>{h.value=!1});const y=kre({text:a,textareaRef:c,autosize:u,sessionId:()=>o.sessionId}),{open:k,items:A,active:$,update:L,select:w}=bre({text:a,textareaRef:c,autosize:u,skills:()=>o.skills,emitCommand:Ce=>i("command",Ce),historyPush:Ce=>y.push(Ce),clearDraft:f}),{open:E,items:T,active:F,loading:S,update:I,select:P}=xre({text:a,textareaRef:c,autosize:u,searchFiles:()=>o.searchFiles});function B(){y.resetBrowsing(),L(),I()}const{attachments:W,previewAttachment:z,fileInputRef:D,isDragOver:q,removeAttachment:j,openAttachmentPreview:ie,closeAttachmentPreview:ue,openFilePicker:pe,handleFileInputChange:ee,handleDragOver:ne,handleDragLeave:fe,handleDrop:Me,clearAfterSubmit:$e,loadAttachments:ae}=_re({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});cn(()=>{a.value&&mt(()=>{u(),m()})}),wn(()=>{document.removeEventListener("mousedown",kn),K()});function U(){c.value?.focus({preventScroll:!0})}function ce(Ce){ae(Ce)}t({loadForEdit:d,loadAttachmentsForEdit:ce,focus:U});function se(Ce){return{fileId:Ce.fileId,kind:Ce.kind,name:Ce.name,mediaType:Ce.mediaType,size:Ce.size}}function V(Ce){if(Ce.kind==="file"){Ce.fileId!==void 0&&b5(Ce.fileId,Ce.name,Ce.mediaType);return}ie(Ce)}function Q(){const Ce=a.value.trim();if(W.value.some(de=>de.uploading))return;const te=W.value.filter(de=>!de.uploading&&!de.error&&de.fileId);if(!Ce&&te.length===0)return;if(y.push(Ce),Ce){const de=dre(Ce),_e=de?T5(o.skills).some(He=>He.name===de.cmd||He.name===`/${Lp}${de.cmd.slice(1)}`):!1;if(de&&_e){a.value="",f(),k.value=!1,g(),i("command",de.arg?`${de.cmd} ${de.arg}`:de.cmd);return}}const ve={text:Ce,attachments:te.map(de=>se(de))};z.value=null,$e(),a.value="",f(),k.value=!1,E.value=!1,g(),i("submit",ve)}function ke(){if(!o.running||W.value.some(de=>de.uploading))return;const Ce=a.value.trim(),te=W.value.filter(de=>!de.uploading&&!de.error&&de.fileId);if(!Ce&&te.length===0&&o.queued.length===0)return;const ve={text:Ce,attachments:te.map(de=>se(de))};$e(),y.push(Ce),a.value="",f(),k.value=!1,E.value=!1,g(),i("steer",ve)}let he=!1,ye=null;function K(){ye!==null&&(clearTimeout(ye),ye=null)}function J(){K(),he=!0}function me(){K(),ye=setTimeout(()=>{ye=null,he=!1},0)}function Ee(Ce){return he||Ce.isComposing||Ce.keyCode===229}function Fe(Ce){if(!Ee(Ce)){if(Ce.key==="Escape"){if(Ie.value){Ce.preventDefault(),gt();return}if(Je.value){Ce.preventDefault(),Pt();return}}if(k.value){if(Ce.key==="ArrowDown"){Ce.preventDefault(),$.value=($.value+1)%A.value.length;return}if(Ce.key==="ArrowUp"){Ce.preventDefault(),$.value=($.value-1+A.value.length)%A.value.length;return}if(Ce.key==="Enter"||Ce.key==="Tab"){Ce.preventDefault();const te=A.value[$.value];te&&w(te);return}if(Ce.key==="Escape"){Ce.preventDefault(),k.value=!1;return}}if(E.value&&!S.value){if(Ce.key==="ArrowDown"){Ce.preventDefault(),F.value=(F.value+1)%Math.max(1,T.value.length);return}if(Ce.key==="ArrowUp"){Ce.preventDefault(),F.value=(F.value-1+Math.max(1,T.value.length))%Math.max(1,T.value.length);return}if(Ce.key==="Enter"||Ce.key==="Tab"){Ce.preventDefault();const te=T.value[F.value];te&&P(te);return}if(Ce.key==="Escape"){Ce.preventDefault(),E.value=!1;return}}if(Ce.key==="s"&&(Ce.ctrlKey||Ce.metaKey)&&!Ce.shiftKey&&!Ce.altKey){o.running&&(Ce.preventDefault(),ke());return}if(!h.value&&!k.value&&!E.value&&!Ce.shiftKey&&!Ce.altKey&&!Ce.metaKey&&!Ce.ctrlKey){const te=y.isBrowsing();if(Ce.key==="ArrowUp"&&y.hasHistory()&&(te||y.caretAtTextStart())){Ce.preventDefault(),y.recallOlder();return}if(Ce.key==="ArrowDown"&&te){Ce.preventDefault(),y.recallNewer();return}}if(Ce.key==="Enter"&&!Ce.shiftKey){if(h.value&&!(Ce.metaKey||Ce.ctrlKey))return;Ce.preventDefault(),Q()}}}const De=R(()=>r("composer.send")),ge=R(()=>!!o.uploadImage),Ie=Z(!1),Je=Z(!1),it=Z(null);function St(){Ie.value=!Ie.value,Ie.value?(Je.value=!1,Wt(),document.addEventListener("click",ft,!0)):document.removeEventListener("click",ft,!0)}function gt(){Ie.value=!1,Je.value||document.removeEventListener("click",ft,!0)}function Tt(){Je.value=!Je.value,Je.value?(Ie.value=!1,Wt(),document.addEventListener("click",ft,!0)):document.removeEventListener("click",ft,!0)}function Pt(){Je.value=!1,Ie.value||document.removeEventListener("click",ft,!0)}function ft(Ce){it.value&&!it.value.contains(Ce.target)&&(gt(),Pt())}wn(()=>{document.removeEventListener("click",ft,!0)});const gn=Ce=>`${Math.round(Ce/1e3)}k`,sn=R(()=>{const Ce=o.status?.ctxMax??0;return Ce<=0?0:Math.min(100,Math.max(0,Math.round((o.status?.ctxUsed??0)/Ce*100)))}),Yo=R(()=>{const Ce=(o.status?.ctxUsed??0).toLocaleString(),te=(o.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ce,max:te,pct:sn.value})}),jt=R(()=>sn.value>=80),vn=R(()=>o.models?.find(Ce=>Ce.id===o.status?.modelId)),fo=R(()=>Wm(vn.value)),st=R(()=>Bk(vn.value)),On=R(()=>$p(vn.value,o.thinking)),so=R(()=>st.value.includes(On.value)?On.value:""),io=R(()=>mre(On.value)),ro=R(()=>fo.value==="unsupported"||st.value.length<=1),Zo=R(()=>{if(!io.value)return"";const Ce=(vn.value?.supportEfforts?.length??0)>0,te=On.value;return Ce&&te!=="on"?r("composer.thinkingSuffixEffort",{level:te}):r("composer.thinkingSuffix")});function Un(Ce){ro.value||i("setThinking",Dk(vn.value,Ce))}function _o(Ce){return Ce==="on"?r("status.thinkingOn"):Ce==="off"?r("status.thinkingOff"):Uv(Ce)}const yn=R(()=>o.planMode===!0),Xn=R(()=>o.swarmMode===!0),_n=R(()=>o.goal?.status??o.activationBadges?.goal?.status??null),un=R(()=>_n.value!==null&&_n.value!=="complete"),Sn=R(()=>un.value||o.goalMode===!0),Ro=R(()=>_n.value==="active"),ze=R(()=>_n.value==="paused"||_n.value==="blocked"),Ze=Z(!1),kt=Z(null),Bt=Z(null),Rn=Z({}),Cn=R(()=>yn.value||Xn.value||Sn.value);function Wt(){Ze.value=!1,document.removeEventListener("mousedown",kn)}function kn(Ce){const te=Ce.target;kt.value?.contains(te)||Bt.value?.contains(te)||Wt()}function Qn(){if(Ze.value){Wt();return}gt(),Pt();const Ce=kt.value?.getBoundingClientRect();Ce&&(Rn.value={left:`${Math.round(Ce.left)}px`,bottom:`${Math.round(window.innerHeight-Ce.top+8)}px`}),Ze.value=!0,setTimeout(()=>document.addEventListener("mousedown",kn),0)}const wt=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],Xo=["status.planDesc","status.swarmDesc","status.goalDesc"],So=Z(null),Qo=Z(""),Bn=Z("");function Dn(Ce){const te={};return Ce&&(te["--composer-menu-desc-width"]=Ce),te}const ni=R(()=>Dn(Qo.value)),Bs=R(()=>Dn(Bn.value)),_i=R(()=>({...Rn.value,...Bs.value}));let ho=null;function Pi(Ce){const te=Number.parseFloat(Ce);return Number.isFinite(te)?te:0}function Si(Ce){return`${Ce.fontStyle||"normal"} ${Ce.fontWeight||"400"} ${Ce.fontSize} ${Ce.fontFamily}`}function po(Ce){return Ce.letterSpacing==="normal"?0:Pi(Ce.letterSpacing)}function Ds(Ce,te){if(!Ce)return 0;const ve=Gie(Ce,Si(te),{letterSpacing:po(te)});return Yie(ve)}function ir(){const Ce=So.value?.querySelector(".pd-desc");if(!Ce)return;const te=getComputedStyle(Ce),ve=Math.max(0,...wt.map(_e=>Ds(r(_e.descKey),te))),de=Math.max(0,...Xo.map(_e=>Ds(r(_e),te)));Qo.value=ve>0?`${Math.ceil(ve)}px`:"",Bn.value=de>0?`${Math.ceil(de)}px`:""}function Ci(){typeof window>"u"||(ho!==null&&window.cancelAnimationFrame(ho),mt(()=>{ho=window.requestAnimationFrame(()=>{ho=null,ir()})}))}Qe(l,Ci,{immediate:!0}),cn(()=>{Ci(),document.fonts?.ready.then(Ci)}),wn(()=>{ho!==null&&(window.cancelAnimationFrame(ho),ho=null)});function lo(Ce){i("setPermission",Ce),Pt()}const Jo=R(()=>wt.find(Ce=>Ce.mode===o.status?.permission)),oi=R(()=>Jo.value?r(Jo.value.labelKey):""),Co=R(()=>vn.value?.provider??""),Ps=R(()=>!Co.value||!o.models?.length?[]:o.models.filter(Ce=>Ce.provider===Co.value)),qn=R(()=>new Set(o.starredIds??[]));function Bo(Ce){return qn.value.has(Ce)}const Hs=R(()=>o.models?.length?o.models.filter(Ce=>Bo(Ce.id)&&Ce.provider!==Co.value):[]);function es(Ce){i("selectModel",Ce),gt()}return(Ce,te)=>(x(),N("div",{class:We(["composer",{"drag-over":C(q),expanded:h.value}]),onDragover:te[18]||(te[18]=(...ve)=>C(ne)&&C(ne)(...ve)),onDragleave:te[19]||(te[19]=(...ve)=>C(fe)&&C(fe)(...ve)),onDrop:te[20]||(te[20]=(...ve)=>C(Me)&&C(Me)(...ve))},[C(W).length>0?(x(),N("div",Ire,[(x(!0),N(Pe,null,nt(C(W),ve=>(x(),be(y5,{key:ve.localId,kind:ve.kind,name:ve.name,url:ve.previewUrl,"file-id":ve.fileId,"media-type":ve.mediaType,size:ve.size,uploading:ve.uploading,error:ve.error,removable:"","remove-label":C(r)("composer.removeNamed",{name:ve.name}),onActivate:de=>V(ve),onRemove:de=>C(j)(ve.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):le("",!0),C(z)?(x(),N("div",{key:1,class:"att-lightbox",onClick:te[1]||(te[1]=bt((...ve)=>C(ue)&&C(ue)(...ve),["self"]))},[_("div",Lre,[re(Yt,{text:C(r)("model.close")},{default:Ne(()=>[_("button",{type:"button",class:"att-lightbox-close",onClick:te[0]||(te[0]=(...ve)=>C(ue)&&C(ue)(...ve))},"✕")]),_:1},8,["text"]),C(z).kind==="video"?(x(),N("video",{key:0,class:"att-lightbox-media",src:C(z).previewUrl,controls:"",playsinline:""},null,8,$re)):(x(),N("img",{key:1,class:"att-lightbox-media",src:C(z).previewUrl,alt:C(z).name},null,8,Fre)),_("div",Ore,O(C(z).name),1)])])):le("",!0),_("div",Rre,[_("div",Bre,[C(k)?(x(),be(tre,{key:0,items:C(A),"active-index":C($),onSelect:C(w),onHover:te[2]||(te[2]=ve=>$.value=ve)},null,8,["items","active-index","onSelect"])):le("",!0),C(E)?(x(),be(ure,{key:1,items:C(T),"active-index":C(F),loading:C(S),onSelect:C(P),onHover:te[3]||(te[3]=ve=>F.value=ve)},null,8,["items","active-index","loading","onSelect"])):le("",!0),_("div",Dre,[$n(_("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":te[4]||(te[4]=ve=>ao(a)?a.value=ve:null),class:"ph",placeholder:s.value,disabled:e.starting,rows:"1",onKeydown:Fe,onCompositionstart:J,onCompositionend:me,onInput:B},null,40,Pre),[[ws,C(a)]]),h.value||v.value?(x(),N("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(x(),be(je,{key:0,name:"collapse",size:"sm"})):(x(),be(je,{key:1,name:"expand",size:"sm"}))],8,Hre)):le("",!0)])]),ge.value?(x(),N("input",{key:0,ref_key:"fileInputRef",ref:D,type:"file",multiple:"",class:"file-input-hidden",onChange:te[5]||(te[5]=(...ve)=>C(ee)&&C(ee)(...ve))},null,544)):le("",!0),_("div",{ref_key:"toolbarRef",ref:it,class:"toolbar"},[_("div",{ref_key:"menuMeasureRef",ref:So,class:"menu-measure","aria-hidden":"true"},[...te[21]||(te[21]=[_("span",{class:"pd-desc"},null,-1)])],512),_("div",Wre,[ge.value?(x(),be(Wn,{key:0,size:"md",label:C(r)("composer.attachFile"),onClick:C(pe)},{default:Ne(()=>[re(je,{name:"attachment"})]),_:1},8,["label","onClick"])):le("",!0),e.status?(x(),N("span",{key:1,class:We(["perm-pill",["perm-"+e.status.permission,{open:Je.value}]]),role:"button",tabindex:"0",onClick:bt(Tt,["stop"]),onKeydown:[Ji(Tt,["enter"]),Ji(bt(Tt,["prevent"]),["space"])]},O(oi.value),43,zre)):le("",!0),Je.value&&e.status?(x(),N("div",{key:2,class:"perm-dropdown",style:qt(ni.value),role:"menu",onClick:te[6]||(te[6]=bt(()=>{},["stop"]))},[(x(),N(Pe,null,nt(wt,ve=>_("button",{key:ve.mode,class:We(["pd-row",{"is-current":ve.mode===e.status.permission}]),role:"menuitem",onClick:de=>lo(ve.mode)},[_("span",qre,[ve.mode===e.status.permission?(x(),be(je,{key:0,name:"check",size:"sm"})):le("",!0)]),_("span",jre,[_("span",{class:"pd-name",style:qt({color:ve.color})},O(C(r)(ve.labelKey)),5),_("span",Vre,O(C(r)(ve.descKey)),1)])],10,Ure)),64))],4)):le("",!0),e.status?(x(),N("div",{key:3,ref_key:"modesRef",ref:kt,class:"modes"},[_("button",{type:"button",class:We(["mode-pill",{on:Cn.value,open:Ze.value}]),onClick:bt(Qn,["stop"])},[_("span",Kre,O(C(r)("status.modesLabel")),1),yn.value?(x(),N("span",Gre,O(C(r)("status.planLabel")),1)):le("",!0),Xn.value?(x(),N("span",Yre,O(C(r)("status.swarmLabel")),1)):le("",!0),Sn.value?(x(),N("span",Zre,O(C(r)("status.goalLabel")),1)):le("",!0)],2),Ze.value?(x(),N("div",{key:0,ref_key:"modesMenuRef",ref:Bt,class:"modes-menu",style:qt(_i.value),role:"menu"},[_("button",{type:"button",class:We(["mode-row",{on:yn.value}]),role:"menuitem",onClick:te[7]||(te[7]=ve=>i("togglePlan"))},[_("span",Xre,[re(je,{name:"file-edit",size:"sm"})]),_("span",Qre,[_("span",Jre,O(C(r)("status.planLabel")),1),_("span",ele,O(C(r)("status.planDesc")),1)]),_("span",{class:We(["mode-switch",{on:yn.value}])},[...te[22]||(te[22]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("button",{type:"button",class:We(["mode-row",{on:Xn.value}]),role:"menuitem",onClick:te[8]||(te[8]=ve=>i("toggleSwarm"))},[_("span",tle,[re(je,{name:"sparkles",size:"sm"})]),_("span",nle,[_("span",ole,O(C(r)("status.swarmLabel")),1),_("span",sle,O(C(r)("status.swarmDesc")),1)]),_("span",{class:We(["mode-switch",{on:Xn.value}])},[...te[23]||(te[23]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("div",{class:We(["mode-row mode-row-goal",{on:un.value||o.goalMode}])},[_("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:te[9]||(te[9]=ve=>un.value?i("focusGoal"):i("toggleGoal"))},[_("span",ile,[re(je,{name:"target",size:"sm"})]),_("span",rle,[_("span",lle,O(C(r)("status.goalLabel")),1),_("span",ale,O(C(r)("status.goalDesc")),1)]),un.value?le("",!0):(x(),N("span",{key:0,class:We(["mode-switch",{on:o.goalMode}])},[...te[24]||(te[24]=[_("span",{class:"mode-knob"},null,-1)])],2))]),un.value?(x(),N("div",cle,[Ro.value?(x(),be(Ft,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:te[10]||(te[10]=ve=>i("controlGoal","pause"))},{default:Ne(()=>[re(je,{name:"pause",size:"sm"}),_("span",null,O(C(r)("status.goalPause")),1)]),_:1})):le("",!0),ze.value?(x(),be(Ft,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:te[11]||(te[11]=ve=>i("controlGoal","resume"))},{default:Ne(()=>[re(je,{name:"play",size:"sm"}),_("span",null,O(C(r)("status.goalResume")),1)]),_:1})):le("",!0),re(Ft,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:te[12]||(te[12]=ve=>i("controlGoal","cancel"))},{default:Ne(()=>[re(je,{name:"close",size:"sm"}),_("span",null,O(C(r)("status.goalCancel")),1)]),_:1})])):le("",!0)],2)],4)):le("",!0)],512)):le("",!0)]),_("div",ule,[jt.value?(x(),N("button",{key:0,class:"compact-chip",onClick:te[13]||(te[13]=bt(ve=>i("compact"),["stop"]))},"/compact")):le("",!0),re(Yt,{text:Yo.value},{default:Ne(()=>[e.status&&!e.hideContext?(x(),N("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":Yo.value},[re(Nre,{pct:sn.value},null,8,["pct"]),_("span",fle,O(gn(e.status.ctxUsed))+"/"+O(gn(e.status.ctxMax)),1)],8,dle)):le("",!0)]),_:1},8,["text"]),e.status?(x(),N("span",{key:1,class:We(["model-pill",{open:Ie.value}]),role:"button",tabindex:"0",onClick:bt(St,["stop"]),onKeydown:[Ji(St,["enter"]),Ji(bt(St,["prevent"]),["space"])]},[_("b",null,O(e.status.model),1),Zo.value?(x(),N("span",ple,O(Zo.value),1)):le("",!0),re(je,{class:"cv",name:"chevron-down",size:"sm"})],42,hle)):le("",!0),e.running?(x(),be(Yt,{key:2,text:C(r)("composer.interruptTitle")},{default:Ne(()=>[_("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:te[14]||(te[14]=ve=>i("interrupt"))},[re(je,{name:"stop",size:"sm"})],8,mle)]),_:1},8,["text"])):le("",!0),_("button",{class:We(["send",{"is-starting":e.starting}]),"aria-label":De.value,disabled:e.starting,onClick:te[15]||(te[15]=ve=>Q())},[e.starting?(x(),be(Rs,{key:0,size:"sm"})):(x(),be(je,{key:1,name:"send",size:"sm"}))],10,gle)]),Ie.value&&e.status?(x(),N("div",{key:0,class:"model-dropdown",role:"menu",onClick:te[17]||(te[17]=bt(()=>{},["stop"]))},[Hs.value.length>0?(x(),N("div",vle,O(C(r)("status.starredModels")),1)):le("",!0),(x(!0),N(Pe,null,nt(Hs.value,ve=>(x(),N("button",{key:ve.id,class:We(["md-row",{"is-current":ve.id===e.status.modelId}]),role:"menuitem",onClick:de=>es(ve.id)},[_("span",kle,[ve.id===e.status.modelId?(x(),be(je,{key:0,name:"check",size:"sm"})):le("",!0)]),_("span",ble,O(ve.displayName??ve.model),1),_("span",xle,O(ve.provider),1),re(je,{class:"md-star",name:"star",size:"sm"})],10,yle))),128)),Hs.value.length>0?(x(),N("div",wle)):le("",!0),Ps.value.length>0?(x(),N("div",_le,O(Co.value),1)):le("",!0),(x(!0),N(Pe,null,nt(Ps.value,ve=>(x(),N("button",{key:ve.id,class:We(["md-row",{"is-current":ve.id===e.status.modelId}]),role:"menuitem",onClick:de=>es(ve.id)},[_("span",Cle,[ve.id===e.status.modelId?(x(),be(je,{key:0,name:"check",size:"sm"})):le("",!0)]),_("span",Ale,O(ve.displayName??ve.model),1),Bo(ve.id)?(x(),be(je,{key:0,class:"md-star",name:"star",size:"sm"})):le("",!0)],10,Sle))),128)),Ps.value.length>0?(x(),N("div",Mle)):le("",!0),_("div",{class:We(["md-thinking",{"is-readonly":ro.value}])},[_("span",Ele,O(C(r)("status.thinkingLabel")),1),fo.value==="unsupported"?(x(),N("span",Tle,O(C(r)("status.modeNotSupported")),1)):(x(),N("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(x(!0),N(Pe,null,nt(st.value,ve=>(x(),N("button",{key:ve,type:"button",class:We(["effort-seg",{"is-active":ve===so.value}]),disabled:ro.value,onClick:de=>Un(ve)},O(_o(ve)),11,Ile))),128))],8,Nle))],2),te[25]||(te[25]=_("div",{class:"md-divider"},null,-1)),_("button",{class:"md-row md-row-more",role:"menuitem",onClick:te[16]||(te[16]=ve=>{gt(),i("pickModel")})},[_("span",Lle,O(C(r)("status.moreModels")),1)])])):le("",!0)],512)]),_("div",{class:We(["drop-overlay",{show:C(q)}]),"aria-hidden":"true"},[_("div",$le,[re(je,{name:"file-plus",size:"lg"}),_("span",null,O(C(r)("composer.dropToAttach")),1)])],2)],34))}}),I5=at(Fle,[["__scopeId","data-v-e0c10eed"]]),Ole={key:0,class:"ui-card__head"},Rle={class:"ui-card__body"},Ble={key:1,class:"ui-card__foot"},Dle=Ye({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(x(),N("div",{class:We(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(x(),N("div",Ole,[Fn(t.$slots,"head",{},void 0,!0)])):le("",!0),_("div",Rle,[Fn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(x(),N("div",Ble,[Fn(t.$slots,"foot",{},void 0,!0)])):le("",!0)],2))}}),Pk=at(Dle,[["__scopeId","data-v-9c9f9a9a"]]),Ple={class:"goal-kicker"},Hle={key:0,class:"goal-progress","aria-hidden":"true"},Wle={class:"goal-full"},zle={key:0,class:"goal-criterion"},Ule=["inert","aria-hidden"],qle={class:"goal-meta"},jle={key:0},Vle={class:"goal-actions"},Kle=Ye({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Mt(),{confirm:i}=Yd(),r=Z(!1);Qe(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=R(()=>{const d=n.goal.budget.tokenBudget;return!d||d<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/d*100)))});function a(d){switch(d){case"active":return s("status.goalStatusActive");case"paused":return s("status.goalStatusPaused");case"blocked":return s("status.goalStatusBlocked");case"complete":return s("status.goalStatusComplete")}}function c(d){const f=Math.max(0,Math.round(d/1e3)),h=Math.floor(f/60),p=f%60;return h<=0?`${p}s`:h<60?`${h}m ${p}s`:`${Math.floor(h/60)}h ${h%60}m`}async function u(){await i({title:s("status.goalCancel"),message:s("status.goalCancelConfirm"),confirmLabel:s("status.goalCancelConfirmYes"),cancelLabel:s("status.goalCancelConfirmNo"),variant:"danger"})&&o("controlGoal","cancel")}return(d,f)=>(x(),be(Pk,{class:We(["goal-strip",{expanded:r.value}])},{head:Ne(()=>[_("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[re(je,{class:"goal-icon",name:"target",size:"md"}),_("span",Ple,O(C(s)("status.goalLabel")),1),_("span",{class:We(["goal-objective",{"expanded-hidden":r.value}])},O(e.goal.objective),3),re(Ns,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Ne(()=>[Xe(O(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(x(),N("span",Hle,[_("span",{class:"goal-progress-fill",style:qt({width:`${l.value}%`})},null,4)])):le("",!0),re(je,{class:We(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Ne(()=>[_("div",Wle,O(e.goal.objective),1),e.goal.completionCriterion?(x(),N("div",zle,[f[3]||(f[3]=_("span",null,"Done when",-1)),_("p",null,O(e.goal.completionCriterion),1)])):le("",!0)]),foot:Ne(()=>[_("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[_("div",qle,[_("span",null,O(e.goal.turnsUsed)+" turns",1),_("span",null,O(e.goal.tokensUsed.toLocaleString())+" tokens",1),_("span",null,O(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(x(),N("span",jle,O(l.value)+"% token budget",1)):le("",!0)]),_("div",Vle,[e.goal.status==="active"?(x(),be(Ft,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=bt(h=>o("controlGoal","pause"),["stop"]))},{default:Ne(()=>[re(je,{name:"pause",size:"md"}),_("span",null,O(C(s)("status.goalPause")),1)]),_:1})):le("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(x(),be(Ft,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=bt(h=>o("controlGoal","resume"),["stop"]))},{default:Ne(()=>[re(je,{name:"play",size:"md"}),_("span",null,O(C(s)("status.goalResume")),1)]),_:1})):le("",!0),re(Ft,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:bt(u,["stop"])},{default:Ne(()=>[re(je,{name:"close",size:"md"}),_("span",null,O(C(s)("status.goalCancel")),1)]),_:1})])],8,Ule)]),_:1},8,["class"]))}}),Gle=at(Kle,[["__scopeId","data-v-353c73e2"]]),Yle={class:"qh"},Zle={class:"qtitle"},Xle={key:0,class:"qstep"},Qle={key:1,class:"qmin-peek"},Jle={class:"qbody"},eae=["aria-label"],tae=["aria-selected","aria-label","onClick"],nae={class:"qstep-num"},oae={key:1,class:"qheader-chip"},sae={class:"qtext"},iae={class:"qopts"},rae=["onClick"],lae={class:"qopt-key"},aae={class:"qopt-glyph"},cae={key:0,class:"chk"},uae={key:1,class:"rad"},dae={class:"qopt-text"},fae={class:"qopt-label"},hae={key:0,class:"qopt-desc"},pae={class:"qopt-glyph"},mae={key:0,class:"chk"},gae={key:1,class:"rad"},vae={class:"qopt-label"},yae=["placeholder"],kae={class:"qfoot"},bae=Ye({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=Mt(),s=t,i=Z(0),r=Z(!1),l=R(()=>n.question.questions[i.value]),a=R(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(W){W>=0&&W<a.value&&(i.value=W)}function f(W){const z=p.value[W];return z?z.kind==="multi"?z.optionIds.length>0:z.kind==="multiWithOther"?z.optionIds.length>0||z.otherText.trim().length>0:z.kind==="other"?z.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=Z({});function g(W){return W.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${W.label} ${W.description??""}`.toLowerCase())}function b(){const W={...p.value};let z=!1;for(const D of n.question.questions){if(W[D.id])continue;const q=D.options.filter(g);q.length!==0&&(W[D.id]=D.multiSelect?{kind:"multi",optionIds:q.map(j=>j.id)}:{kind:"single",optionId:q[0].id},z=!0)}z&&(p.value=W)}Qe(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},y.value={}}),Qe(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),b()},{immediate:!0,deep:!0});function v(W,z){const D=p.value[W];if(D&&D.kind==="single"&&D.optionId===z){const q={...p.value};delete q[W],p.value=q}else p.value={...p.value,[W]:{kind:"single",optionId:z}}}function m(W,z){const D=p.value[W],q=D&&(D.kind==="multi"||D.kind==="multiWithOther")?D.kind==="multi"?[...D.optionIds]:[...D.optionIds]:[],j=q.indexOf(z);j>=0?q.splice(j,1):q.push(z);const ie=p.value[W],ue=ie&&ie.kind==="multiWithOther"?ie.otherText:"";ue?p.value={...p.value,[W]:{kind:"multiWithOther",optionIds:q,otherText:ue}}:p.value={...p.value,[W]:{kind:"multi",optionIds:q}}}const y=Z({}),k=Z(null);function A(W){const z=n.question.questions.find(q=>q.id===W),D=y.value[W]??"";if(z.multiSelect){const q=p.value[W],j=q&&(q.kind==="multi"||q.kind==="multiWithOther")?q.kind==="multi"?[...q.optionIds]:[...q.optionIds]:[];p.value={...p.value,[W]:{kind:"multiWithOther",optionIds:j,otherText:D}}}else p.value={...p.value,[W]:{kind:"other",text:D}}}function $(W){A(W),mt(()=>k.value?.focus())}function L(W,z){const D=p.value[W];return D?D.kind==="single"?D.optionId===z:D.kind==="multi"||D.kind==="multiWithOther"?D.optionIds.includes(z):!1:!1}function w(W){const z=p.value[W];return!!(z&&(z.kind==="other"||z.kind==="multiWithOther"))}function E(){return n.question.questions.every(W=>f(W.id))}const T=R(()=>n.busyKind==="answer"),F=R(()=>n.busyKind==="dismiss"),S=R(()=>!!n.busyKind);function I(){if(S.value||!E())return;const W={answers:p.value,method:"click"};s("answer",n.question.questionId,W)}function P(){S.value||s("dismiss",n.question.questionId)}function B(W){const z=(document.activeElement?.tagName??"").toLowerCase(),D=z==="input"||z==="textarea";if(S.value)return;if(W.key==="Enter"){if(W.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():E()&&I();return}if(D)return;if(W.key==="Escape"){W.preventDefault(),P();return}if(r.value)return;const q=parseInt(W.key,10);if(!isNaN(q)&&q>=1&&q<=9){W.preventDefault();const j=l.value,ie=q-1,ue=j.options[ie];ue&&(j.multiSelect?m(j.id,ue.id):v(j.id,ue.id))}}return cn(()=>document.addEventListener("keydown",B)),wn(()=>document.removeEventListener("keydown",B)),(W,z)=>(x(),be(Pk,{class:We(["qcard",{minimized:r.value}])},Y4({head:Ne(()=>[_("div",Yle,[z[5]||(z[5]=_("span",{class:"qh-ic"},"?",-1)),_("span",Zle,O(C(o)("question.title")),1),a.value>1&&!r.value?(x(),N("span",Xle,O(C(o)("question.step",{current:i.value+1,total:a.value})),1)):le("",!0),r.value?(x(),N("span",Qle,O(l.value.question),1)):le("",!0),re(Wn,{class:"qmin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:z[0]||(z[0]=D=>r.value=!r.value)},{default:Ne(()=>[r.value?(x(),be(je,{key:0,name:"chevron-up",size:"md"})):(x(),be(je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ne(()=>[_("div",Jle,[a.value>1?(x(),N("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(o)("question.step",{current:i.value+1,total:a.value})},[(x(!0),N(Pe,null,nt(n.question.questions,(D,q)=>(x(),N("button",{key:D.id,type:"button",class:We(["qstep-dot",{active:q===i.value,answered:f(D.id)}]),"aria-selected":q===i.value,"aria-label":C(o)("question.step",{current:q+1,total:a.value}),onClick:j=>d(q)},[_("span",nae,O(q+1),1)],10,tae))),128))],8,eae)):le("",!0),l.value.header?(x(),N("div",oae,[re(Ns,{variant:"neutral",size:"sm"},{default:Ne(()=>[Xe(O(l.value.header),1)]),_:1})])):le("",!0),_("div",sae,O(l.value.question),1),l.value.body?(x(),be(Rm,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):le("",!0),_("div",iae,[(x(!0),N(Pe,null,nt(l.value.options,(D,q)=>(x(),N("label",{key:D.id,class:We(["qopt",{selected:L(l.value.id,D.id)}]),onClick:bt(j=>l.value.multiSelect?m(l.value.id,D.id):v(l.value.id,D.id),["prevent"])},[_("span",lae,O(q+1),1),_("span",aae,[l.value.multiSelect?(x(),N("span",cae,O(L(l.value.id,D.id)?"■":"□"),1)):(x(),N("span",uae,O(L(l.value.id,D.id)?"●":"○"),1))]),_("span",dae,[_("span",fae,O(D.label),1),D.description?(x(),N("span",hae,O(D.description),1)):le("",!0)])],10,rae))),128)),l.value.allowOther?(x(),N("label",{key:0,class:We(["qopt",{selected:w(l.value.id)}]),onClick:z[4]||(z[4]=bt(D=>$(l.value.id),["prevent"]))},[z[6]||(z[6]=_("span",{class:"qopt-key"},null,-1)),_("span",pae,[l.value.multiSelect?(x(),N("span",mae,O(w(l.value.id)?"■":"□"),1)):(x(),N("span",gae,O(w(l.value.id)?"●":"○"),1))]),_("span",vae,O(l.value.otherLabel??C(o)("question.otherDefault")),1),$n(_("input",{ref_key:"otherInputEl",ref:k,"onUpdate:modelValue":z[1]||(z[1]=D=>y.value[l.value.id]=D),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(o)("question.otherDefault"),onInput:z[2]||(z[2]=D=>A(l.value.id)),onFocus:z[3]||(z[3]=D=>A(l.value.id))},null,40,yae),[[ws,y.value[l.value.id]]])],2)):le("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Ne(()=>[_("div",kae,[i.value<a.value-1?(x(),be(Ft,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Ne(()=>[Xe(O(C(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(x(),be(Ft,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!E(),loading:T.value,onClick:I},{default:Ne(()=>[Xe(O(C(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(x(),be(Ft,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Ne(()=>[Xe(O(C(o)("question.back")),1)]),_:1},8,["disabled"])):le("",!0),re(Ft,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:P},{default:Ne(()=>[Xe(O(C(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),xae=at(bae,[["__scopeId","data-v-14c58ac1"]]),wae={class:"ah"},_ae={class:"akind"},Sae={class:"apath"},Cae={class:"ah-path"},Aae={key:1,class:"diff"},Mae={class:"dg"},Eae={class:"dc"},Tae={key:2,class:"body-shell"},Nae={class:"shell-cmd"},Iae={key:0,class:"shell-cwd"},Lae={key:1,class:"shell-danger"},$ae={key:3,class:"body-file"},Fae={class:"file-bar"},Oae={class:"file-lang"},Rae={class:"file-content"},Bae={class:"file-ln"},Dae={class:"file-text"},Pae={key:4,class:"body-chip"},Hae={class:"chip-label"},Wae={class:"chip-value"},zae={key:0,class:"chip-detail"},Uae={key:5,class:"body-chip"},qae={key:0,class:"chip-label"},jae={class:"chip-value"},Vae={key:6,class:"body-chip"},Kae={class:"chip-label"},Gae={class:"chip-value"},Yae={key:0,class:"chip-detail"},Zae={key:7,class:"body-chip"},Xae={class:"chip-label"},Qae={class:"chip-value"},Jae={key:0,class:"chip-detail"},ece={key:8,class:"body-todo"},tce={class:"todo-glyph"},nce={key:9,class:"body-plan"},oce={key:10,class:"body-generic"},sce={class:"gen-text"},ice={key:11,class:"feedback-wrap"},rce=["placeholder"],lce={class:"feedback-hint"},ace={key:0,class:"plan-actions"},cce={key:1,class:"abtn"},uce=Ye({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Mt(),i=R(()=>{const T=n.block;return T.kind!=="plan_review"?null:{plan:T.plan,path:T.path,options:T.options??[]}}),r=Z(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const T=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${T}`)}const c=Z(!1),u=Z(""),d=Z(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const T=u.value.trim();i.value?v("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:T||void 0}):v("feedback",{decision:"rejected",feedback:T||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function g(T){T.key==="Enter"&&!T.shiftKey?(T.preventDefault(),h()):T.key==="Escape"&&(T.preventDefault(),p())}const b=Z(null);Qe(()=>n.busy,T=>{T||(b.value=null)});function v(T,F){n.busy||(b.value=T,o("decide",F))}function m(){v("approve",{decision:"approved"})}function y(){v("approveSession",{decision:"approved",scope:"session"})}function k(){v("reject",{decision:"rejected"})}function A(){v("approvePlan",{decision:"approved"})}function $(T){v(`option:${T}`,{decision:"approved",selectedLabel:T})}function L(){n.busy||f()}function w(){v("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function E(T){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){T.key==="1"?(T.preventDefault(),A()):T.key==="2"?(T.preventDefault(),L()):T.key==="3"&&(T.preventDefault(),w());return}T.key==="1"&&S.options[0]?(T.preventDefault(),$(S.options[0].label)):T.key==="2"&&S.options[1]?(T.preventDefault(),$(S.options[1].label)):T.key==="3"&&S.options[2]&&(T.preventDefault(),$(S.options[2].label));return}T.key==="1"?(T.preventDefault(),m()):T.key==="2"?(T.preventDefault(),y()):T.key==="3"?(T.preventDefault(),k()):T.key==="4"&&(T.preventDefault(),f())}return cn(()=>document.addEventListener("keydown",E)),wn(()=>document.removeEventListener("keydown",E)),(T,F)=>(x(),be(Pk,{class:We(["appr",{minimized:r.value}])},Y4({head:Ne(()=>[_("div",wae,[F[2]||(F[2]=_("span",{class:"ah-ic"},"!",-1)),_("span",_ae,O(a()),1),_("span",Sae,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(x(),N(Pe,{key:0},[Xe(O(e.block.path),1)],64)):e.block.kind==="shell"?(x(),N(Pe,{key:1},[Xe(O(e.block.command),1)],64)):e.block.kind==="url"?(x(),N(Pe,{key:2},[Xe(O(e.block.url),1)],64)):e.block.kind==="search"?(x(),N(Pe,{key:3},[Xe(O(e.block.query),1)],64)):e.block.kind==="invocation"?(x(),N(Pe,{key:4},[Xe(O(e.block.name),1)],64)):e.block.kind==="generic"?(x(),N(Pe,{key:5},[Xe(O(e.block.summary),1)],64)):le("",!0)]),e.agentName&&!r.value?(x(),be(Ns,{key:0,variant:"neutral",size:"sm"},{default:Ne(()=>[Xe(O(C(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):le("",!0),r.value?le("",!0):(x(),be(Ns,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Ne(()=>[Xe(O(C(s)("approval.required")),1)]),_:1})),re(Wn,{class:"amin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Ne(()=>[r.value?(x(),be(je,{key:0,name:"chevron-up",size:"md"})):(x(),be(je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ne(()=>[e.block.kind==="plan_review"&&e.block.path?(x(),be(Yt,{key:0,text:e.block.path},{default:Ne(()=>[_("div",Cae,O(e.block.path),1)]),_:1},8,["text"])):le("",!0),e.block.kind==="diff"?(x(),N("div",Aae,[(x(!0),N(Pe,null,nt(e.block.diff,(S,I)=>(x(),N("div",{key:I,class:We(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[_("span",Mae,O(S.gutter),1),_("span",Eae,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(x(),N("div",Tae,[_("div",Nae,[F[3]||(F[3]=_("span",{class:"shell-dollar"},"$",-1)),Xe(" "+O(e.block.command),1)]),e.block.cwd?(x(),N("div",Iae,"cwd: "+O(e.block.cwd),1)):le("",!0),e.block.danger?(x(),N("div",Lae,O(C(s)("approval.danger",{detail:e.block.danger})),1)):le("",!0)])):e.block.kind==="file"?(x(),N("div",$ae,[_("div",Fae,[_("span",Oae,O(e.block.language??""),1)]),_("div",Rae,[(x(!0),N(Pe,null,nt(e.block.content.split(`
297
- `),(S,I)=>(x(),N("div",{key:I,class:"file-line"},[_("span",Bae,O(I+1),1),_("span",Dae,O(S),1)]))),128))])])):e.block.kind==="fileop"?(x(),N("div",Pae,[_("span",Hae,O(e.block.op),1),_("span",Wae,O(e.block.path),1),e.block.detail?(x(),N("span",zae,O(e.block.detail),1)):le("",!0)])):e.block.kind==="url"?(x(),N("div",Uae,[e.block.method?(x(),N("span",qae,O(e.block.method),1)):le("",!0),_("span",jae,O(e.block.url),1)])):e.block.kind==="search"?(x(),N("div",Vae,[_("span",Kae,O(C(s)("approval.searchQueryLabel")),1),_("span",Gae,O(e.block.query),1),e.block.scope?(x(),N("span",Yae,O(C(s)("approval.searchScope",{scope:e.block.scope})),1)):le("",!0)])):e.block.kind==="invocation"?(x(),N("div",Zae,[_("span",Xae,O(e.block.kind2),1),_("span",Qae,O(e.block.name),1),e.block.description?(x(),N("span",Jae,O(e.block.description),1)):le("",!0)])):e.block.kind==="todo"?(x(),N("div",ece,[(x(!0),N(Pe,null,nt(e.block.items,(S,I)=>(x(),N("div",{key:I,class:"todo-item"},[_("span",tce,O(S.status==="done"||S.status==="completed"?"✓":"○"),1),_("span",{class:We(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},O(S.title),3)]))),128))])):e.block.kind==="plan_review"?(x(),N("div",nce,[re(Rm,{text:e.block.plan},null,8,["text"])])):(x(),N("div",oce,[_("span",sce,O(e.block.summary),1)])),c.value?(x(),N("div",ice,[$n(_("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:g},null,40,rce),[[ws,u.value]]),_("div",lce,O(C(s)("approval.feedbackHint")),1)])):le("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Ne(()=>[i.value?(x(),N("div",ace,[i.value.options.length>0?(x(!0),N(Pe,{key:0},nt(i.value.options,(S,I)=>(x(),be(Yt,{key:I,text:S.description},{default:Ne(()=>[re(Ft,{class:"kbtn",size:"sm",variant:"primary",loading:b.value===`option:${S.label}`,disabled:e.busy,onClick:P=>$(S.label)},{default:Ne(()=>[Xe(O(S.label),1),re(gr,{class:"k",keys:[String(I+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(x(),be(Ft,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approvePlan",disabled:e.busy,onClick:A},{default:Ne(()=>[Xe(O(C(s)("approval.approvePlan")),1),re(gr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),re(Ft,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:L},{default:Ne(()=>[Xe(O(C(s)("approval.revise")),1),i.value.options.length===0?(x(),be(gr,{key:0,class:"k",keys:["2"]})):le("",!0)]),_:1},8,["disabled"]),re(Ft,{class:"kbtn",size:"sm",variant:"danger-soft",loading:b.value==="rejectAndExit",disabled:e.busy,onClick:w},{default:Ne(()=>[Xe(O(C(s)("approval.rejectAndExit")),1),i.value.options.length===0?(x(),be(gr,{key:0,class:"k",keys:["3"]})):le("",!0)]),_:1},8,["loading","disabled"])])):(x(),N("div",cce,[re(Ft,{class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approve",disabled:e.busy,onClick:m},{default:Ne(()=>[Xe(O(C(s)("approval.approve")),1),re(gr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),re(Ft,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="approveSession",disabled:e.busy,onClick:y},{default:Ne(()=>[Xe(O(C(s)("approval.approveSession")),1),re(gr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),re(Ft,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="reject",disabled:e.busy,onClick:k},{default:Ne(()=>[Xe(O(C(s)("approval.reject")),1),re(gr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),re(Ft,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Ne(()=>[Xe(O(C(s)("approval.feedback")),1),re(gr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),dce=at(uce,[["__scopeId","data-v-458a9d7d"]]),fce=Ye({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(x(),N("span",{class:We(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),L5=at(fce,[["__scopeId","data-v-f595d935"]]),hce={class:"taskspane"},pce={class:"tp-head"},mce={class:"tp-title"},gce={class:"tp-count"},vce={class:"tp-list"},yce={key:0,class:"tp-empty"},kce=["role","onClick"],bce={class:"tp-name"},xce={class:"tp-time"},wce=["onClick"],_ce={key:0,class:"tp-detail"},Sce={key:0,class:"tp-codebox"},Cce=["onClick"],Ace={class:"tp-pre"},Mce={class:"tp-cmd"},Ece={key:1,class:"tp-codebox"},Tce=["onClick"],Nce={class:"tp-pre"},Ice=Ye({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Mt(),s=Oo(new Set),i=Oo(new Set),r=Oo(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){if(p.kind==="subagent"){n("open",p.id);return}l(p)&&(s.has(p.id)?s.delete(p.id):s.add(p.id))}function c(p){return p.kind==="subagent"||l(p)}function u(p){return p==="run"||p==="done"||p==="fail"?p:"pending"}async function d(p,g,b){await Ko(p)&&(b.add(g),setTimeout(()=>b.delete(g),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const g=p.output?.join(`
298
- `)??"";g&&await d(g,p.id,r)}return(p,g)=>(x(),N("div",hce,[_("div",pce,[_("span",mce,O(C(o)("tasks.tag")),1),_("span",gce,O(e.tasks.length),1)]),_("div",vce,[e.tasks.length===0?(x(),N("div",yce,O(C(o)("tasks.emptyTasks")),1)):(x(!0),N(Pe,{key:1},nt(e.tasks,b=>(x(),N("div",{key:b.id,class:We(["tp-row",{done:b.state==="done",fail:b.state==="fail",expandable:c(b)}])},[_("div",{class:"tp-main",role:c(b)?"button":void 0,onClick:v=>a(b)},[re(L5,{status:u(b.state)},null,8,["status"]),_("span",bce,O(b.name),1),re(Ns,{variant:"neutral",size:"sm"},{default:Ne(()=>[Xe(O(b.kind),1)]),_:2},1024),_("span",xce,O(b.timing),1),b.state==="run"?(x(),N("button",{key:0,class:"tp-stop",onClick:bt(v=>n("cancel",b.id),["stop"])},O(C(o)("tasks.stop")),9,wce)):le("",!0),b.kind==="subagent"?(x(),be(je,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(b)?(x(),be(je,{key:2,class:We(["tp-chevron",{open:s.has(b.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):le("",!0)],8,kce),s.has(b.id)&&l(b)?(x(),N("div",_ce,[b.meta?(x(),N("div",Sce,[_("button",{class:We(["tp-copy",{copied:i.has(b.id)}]),onClick:bt(v=>f(b),["stop"])},O(i.has(b.id)?"已复制":"复制"),11,Cce),_("pre",Ace,[_("code",null,[_("span",Mce,O(b.meta),1)])])])):le("",!0),b.output&&b.output.length>0?(x(),N("div",Ece,[_("button",{class:We(["tp-copy",{copied:r.has(b.id)}]),onClick:bt(v=>h(b),["stop"])},O(r.has(b.id)?"已复制":"复制"),11,Tce),_("pre",Nce,[_("code",null,[g[0]||(g[0]=Xe(`
299
- `,-1)),(x(!0),N(Pe,null,nt(b.output,(v,m)=>(x(),N("span",{key:m,class:"tp-line"},O(v),1))),128)),g[1]||(g[1]=Xe(`
300
- `,-1))])])])):le("",!0)])):le("",!0)],2))),128))])]))}}),WC=at(Ice,[["__scopeId","data-v-28fd5fc0"]]),Lce={class:"todo-card"},$ce={key:0,class:"tc-empty"},Fce={class:"tc-name"},Oce=Ye({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Mt();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(x(),N("div",Lce,[t.todos.length===0?(x(),N("div",$ce,[i[0]||(i[0]=_("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"},[_("path",{d:"M9 11l2 2 4-4"}),_("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),_("span",null,O(C(n)("tasks.emptyTodo")),1)])):le("",!0),(x(!0),N(Pe,null,nt(t.todos,(r,l)=>(x(),N("div",{key:l,class:We(["tc-row",`s-${r.status}`])},[re(L5,{status:o(r.status)},null,8,["status"]),_("span",Fce,O(r.title),1)],2))),128))]))}}),Rce=at(Oce,[["__scopeId","data-v-01c65735"]]),Bce={class:"dock-work-head"},Dce={key:0,class:"dock-work-tab static"},Pce={key:1,class:"dock-work-tab static"},Hce={key:2,class:"dock-work-tab static"},Wce={class:"dock-work-body"},zce={class:"dw-count"},Uce={class:"dw-count"},qce={class:"dw-count"},jce=Ye({__name:"ChatDock",props:{sessionId:{},running:{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:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=Mt(),r=Z(null),l=Z(null),a=Z(null),c=Z(null);function u(b){return r.value?(r.value.loadForEdit(b),!0):!1}function d(b){r.value?.loadAttachmentsForEdit(b)}function f(){r.value?.focus()}function h(b){if(!o.dockPanel)return;const v=b.target;v&&(l.value?.contains(v)||a.value?.contains(v)||s("close-dock-panel"))}Qe(()=>o.dockPanel,b=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),b&&document.addEventListener("mousedown",h,!0))},{immediate:!0});let p=null;function g(){const b=c.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${b}px`)}return cn(()=>{typeof ResizeObserver!="function"||!c.value||(p=new ResizeObserver(g),p.observe(c.value),g())}),wn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0),p?.disconnect(),p=null}),t({loadForEdit:u,loadAttachmentsForEdit:d,focus:f}),(b,v)=>(x(),N("div",{ref_key:"dockRef",ref:c,class:We(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:v[28]||(v[28]=bt(()=>{},["stop"]))},[re(El,{name:"dock-panel"},{default:Ne(()=>[e.dockPanel?(x(),N("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:v[3]||(v[3]=bt(()=>{},["stop"]))},[_("div",Bce,[e.dockPanel==="bash"?(x(),N("span",Dce,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(x(),N("span",Pce,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(x(),N("span",Hce,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):le("",!0)]),_("div",Wce,[e.dockPanel==="bash"?(x(),be(WC,{key:0,tasks:e.bashTasks,onCancel:v[0]||(v[0]=m=>s("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(x(),be(WC,{key:1,tasks:e.subagentTasks,onCancel:v[1]||(v[1]=m=>s("cancelTask",m)),onOpen:v[2]||(v[2]=m=>s("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(x(),be(Rce,{key:2,todos:e.todos??[]},null,8,["todos"])):le("",!0)])],512)):le("",!0)]),_:1}),e.goal?(x(),be(Gle,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:v[4]||(v[4]=m=>s("controlGoal",m))},null,8,["goal","force-expanded"])):le("",!0),e.hasDockWork?(x(),N("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(x(),be(hh,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:v[5]||(v[5]=m=>s("toggle-dock-panel","bash"))},{default:Ne(()=>[re(je,{name:"clock",size:"md"}),_("span",null,O(C(i)("tasks.dockBash")),1),_("span",zce,[v[29]||(v[29]=Xe("(",-1)),_("b",null,O(e.bashTasks.length),1),v[30]||(v[30]=Xe(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0),e.subagentTasks.length>0?(x(),be(hh,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:v[6]||(v[6]=m=>s("toggle-dock-panel","subagent"))},{default:Ne(()=>[re(je,{name:"sparkles",size:"md"}),_("span",null,O(C(i)("tasks.dockSubagent")),1),_("span",Uce,[v[31]||(v[31]=Xe("(",-1)),_("b",null,O(e.subagentTasks.length),1),v[32]||(v[32]=Xe(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0),(e.todos?.length??0)>0?(x(),be(hh,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:v[7]||(v[7]=m=>s("toggle-dock-panel","todos"))},{default:Ne(()=>[re(je,{name:"check-list",size:"md"}),_("span",null,O(C(i)("tasks.dockTodos")),1),_("span",qce,[v[33]||(v[33]=Xe("(",-1)),_("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),v[34]||(v[34]=Xe(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0)],512)):le("",!0),e.pendingQuestion?(x(),be(xae,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:v[8]||(v[8]=(m,y)=>s("answer",m,y)),onDismiss:v[9]||(v[9]=m=>s("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(x(),be(dce,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:v[10]||(v[10]=m=>s("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(x(),be(I5,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,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,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:v[11]||(v[11]=m=>s("submit",m)),onSteer:v[12]||(v[12]=m=>s("steer",m)),onCommand:v[13]||(v[13]=m=>s("command",m)),onInterrupt:v[14]||(v[14]=m=>s("interrupt")),onSetPermission:v[15]||(v[15]=m=>s("setPermission",m)),onSetThinking:v[16]||(v[16]=m=>s("setThinking",m)),onTogglePlan:v[17]||(v[17]=m=>s("togglePlan")),onToggleSwarm:v[18]||(v[18]=m=>s("toggleSwarm")),onToggleGoal:v[19]||(v[19]=m=>s("toggleGoal")),onOpenBtw:v[20]||(v[20]=m=>s("openBtw")),onCreateGoal:v[21]||(v[21]=m=>s("createGoal",m)),onControlGoal:v[22]||(v[22]=m=>s("controlGoal",m)),onFocusGoal:v[23]||(v[23]=m=>s("focusGoal")),onFocusSwarm:v[24]||(v[24]=m=>s("focusSwarm")),onCompact:v[25]||(v[25]=m=>s("compact")),onPickModel:v[26]||(v[26]=m=>s("pickModel")),onSelectModel:v[27]||(v[27]=m=>s("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),Vce=at(jce,[["__scopeId","data-v-9e5ec0f2"]]),Kce=["aria-label","aria-hidden"],Gce={class:"toc-scroll"},Yce=["onClick"],Zce={class:"toc-label"},Xce=240,Qce=Ye({__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}=Mt(),i=Z(null),r=Z(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=Xce}const c=R(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Qe(c,u=>{l?.disconnect(),l=null,u&&mt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),co(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(x(),N("nav",{key:0,ref_key:"navRef",ref:i,class:We(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(s)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[_("div",Gce,[(x(!0),N(Pe,null,nt(e.items,f=>(x(),N("button",{key:f.id,type:"button",class:We(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>o("select",f.id)},[d[0]||(d[0]=_("span",{class:"toc-bar"},null,-1)),_("span",Zce,O(f.title),1)],10,Yce))),128))])],10,Kce)):le("",!0)}}),Jce=at(Qce,[["__scopeId","data-v-3f1c1f66"]]),eue=5;function tue(e,t,n,o=eue){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(s[o-1]=i)}return s}const nue={class:"chat-layout"},oue={class:"empty-hint"},sue={key:0,class:"empty-hint-text"},iue={key:1,class:"ws-pick"},rue={class:"ws-pick-name"},lue={key:1,class:"ws-pick-menu"},aue=["onClick"],cue={class:"ws-pick-item-name"},uue={class:"ws-pick-item-path"},due=["aria-label"],fue={key:0,class:"abort-toast",role:"status","aria-live":"polite"},hue={class:"abort-toast-text"},fg=80,zC=1e3,pue=420,mue=3e3,gue=Ye({__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},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:o}=Mt(),s=e,i=n,r=Z(!1),l=Z(!1),a=R(()=>s.workspaces?.find(_e=>_e.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=R(()=>(s.workspaces?.length??0)>0),u=R(()=>tue(s.workspaces??[],s.activeWorkspaceId,l.value)),d=R(()=>(s.workspaces?.length??0)-u.value.length);Qe(r,de=>{de||(l.value=!1)});function f(de){r.value=!1,de!==s.activeWorkspaceId&&i("selectWorkspace",de)}Kc(Lt.contentAlign);const h=Z(null),p=Z(null),g=Z(null),b=Z(!1),v=Z(0);let m=null;function y(de,_e){const He=g.value??p.value;return!He||He.loadForEdit(de)===!1?!1:(He.loadAttachmentsForEdit(_e??[]),!0)}function k(){b.value=!0,m!==null&&clearTimeout(m),m=setTimeout(()=>{m=null,b.value=!1},2e3)}function A(){v.value++}const $=R(()=>s.tasks.filter(de=>de.kind!=="subagent")),L=R(()=>s.tasks.filter(de=>de.kind==="subagent"&&de.runInBackground)),w=R(()=>$.value.filter(de=>de.state==="run").length),E=R(()=>L.value.filter(de=>de.state==="run").length);function T(de){const _e=s.tasks,He=_e.find(Ot=>Ot.id===de)??_e.find(Ot=>Ot.parentToolCallId===de);if(He)return He.id;const $t=_e.filter(Ot=>Ot.kind==="subagent"&&!Ot.parentToolCallId);if($t.length===1)return $t[0].id}In("resolveAgentTaskId",T),In("pinScroll",_o);const F=R(()=>(s.todos??[]).filter(de=>de.status==="done").length),S=R(()=>$.value.length>0||L.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),I=Z(null),P=R(()=>s.gitInfo?s.changes?.length??0:0);function B(de){I.value=I.value===de?null:de}function W(){I.value=null}Qe(S,de=>{de||W()});function z(de){if(de.role==="compaction")return o("conversation.compactedPlain");if(de.role==="user"){if(de.skillActivation)return`/${de.skillActivation.name}`;if(de.pluginCommand)return`/${de.pluginCommand.pluginId}:${de.pluginCommand.commandName}`;const He=de.text.trim().replaceAll(/\s+/g," ");return He.length>0?He:"user"}const _e=(de.text||de.thinking||"").trim().replaceAll(/\s+/g," ");return _e.length>0?_e:(de.tools?.length??0)>0?`${de.tools.length} tools`:"kimi"}const D=R(()=>s.turns.filter(de=>de.role==="user").map((de,_e)=>({id:de.id,role:de.role,no:_e+1,title:z(de)}))),q=Z(null);function j(){const de=ae.value;if(!de)return;const _e=de.querySelectorAll(".turn-anchor[data-turn-id]");if(_e.length===0)return;const He=D.value;if(He.length===0)return;const $t=new Set(He.map(X=>X.id));if(me()<=fg){q.value=He[He.length-1].id;return}const Ot=de.getBoundingClientRect(),rn=Ot.height/2;let zn=null;_e.forEach(X=>{const xe=X.dataset.turnId;if(!xe||!$t.has(xe))return;X.getBoundingClientRect().top-Ot.top<=rn&&(zn=xe)}),q.value=zn??He[0].id}const ie=Z(!1);let ue=0;function pe(){ue||(ue=st(()=>{ue=0,ee()}))}function ee(){const de=ae.value,_e=!s.mobile&&s.conversationToc&&de?de.closest(".con")?.querySelector(".conversation-toc"):null,He=_e?.querySelector(".toc-bar");let $t=!1;if(de&&_e&&He){const Ot=He.getBoundingClientRect(),rn=_e.getBoundingClientRect(),zn=Ot.left+Ot.width/2;$t=Array.from(de.querySelectorAll(".table-node-wrapper")).some(X=>{const xe=X.getBoundingClientRect();return xe.left<=zn&&zn<=xe.right&&xe.top<rn.bottom&&xe.bottom>rn.top})}ie.value!==$t&&(ie.value=$t)}const ne=R(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),fe=R(()=>{const de=ne.value;if(de)return s.pendingQuestionActions?.[de.questionId]}),Me=R(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),$e=R(()=>{const de=Me.value;return de?!!s.pendingApprovalActions?.[de.approvalId]:!1}),ae=Z(null),U=Z(null),ce=Z(0),se=Z(0),V=R(()=>({"--panes-scrollbar-width":`${ce.value}px`}));function Q(de){return de instanceof HTMLElement?de:de&&"$el"in de&&de.$el instanceof HTMLElement?de.$el:null}function ke(){const de=ae.value;ce.value=de?Math.max(0,de.offsetWidth-de.clientWidth):0,se.value=U.value?.offsetHeight??0}function he(de){const _e=Q(de);ae.value=_e,_e&&oi()}function ye(de){const _e=Q(de);U.value=_e??null,de&&"loadForEdit"in de&&typeof de.loadForEdit=="function"&&"focus"in de&&typeof de.focus=="function"?g.value={loadForEdit:de.loadForEdit.bind(de),loadAttachmentsForEdit:"loadAttachmentsForEdit"in de&&typeof de.loadAttachmentsForEdit=="function"?de.loadAttachmentsForEdit.bind(de):()=>{},focus:de.focus.bind(de)}:g.value=null,Jo()}const K=Z(!0),J=Z(!1);function me(){const de=ae.value;return de?de.scrollHeight-de.scrollTop-de.clientHeight:0}let Ee=0,Fe=0,De=0,ge=0,Ie=0,Je=0;function it(){return Date.now()<Fe}function St(){pe();const de=ae.value;if(!de)return;const _e=de.scrollTop;if(Un()){Ee=_e;return}if(performance.now()-De<100){Ee=_e;return}const He=me();if(it()){K.value=!0,J.value=!1,Ee=_e;return}_e<Ee-1&&He>1?(K.value=!1,J.value=!0):He<=fg&&_e>Ee+1&&(K.value=!0,J.value=!1),Ee=_e,j()}function gt(de=!1){const _e=ae.value;K.value=!0,J.value=!1,_e&&(!de&&performance.now()<ge||(de&&typeof _e.scrollTo=="function"?(De=performance.now(),ge=performance.now()+pue,_e.scrollTo({top:_e.scrollHeight,behavior:"smooth"})):_e.scrollTop=_e.scrollHeight,Ee=_e.scrollTop))}function Tt(de,_e){return(_e.closest("[inert]")?.closest(".tool-group")??_e).getBoundingClientRect().top-de.getBoundingClientRect().top+de.scrollTop}function Pt(de,_e){const He=Array.from(de.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(rn=>({node:rn,top:Tt(de,rn)})),$t=He.findIndex(rn=>rn.top>=_e),Ot=$t<0?Math.max(0,He.length-1):$t;return He.slice(Ot,Ot+2).flatMap(rn=>{const zn=rn.node.dataset.scrollAnchorId,X=zn??rn.node.dataset.turnId;return X?[{kind:zn?"tool":"turn",id:X,top:rn.top}]:[]})}const ft=new Map;function gn(de,_e){for(const He of _e.anchors){const $t=He.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Ot=de.querySelector(`[${$t}="${jt(He.id)}"]`);if(Ot)return Tt(de,Ot)-He.top}return de.scrollHeight-_e.oldHeight}function sn(de,_e,He=de.scrollTop){return de.scrollTop=He+gn(de,_e),Ee=de.scrollTop,de.scrollTop}async function Yo(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||Bn.value||!s.hasMoreMessages)return;const de=s.sessionId,_e=ae.value,He=_e?.scrollTop??0,$t={anchors:_e?Pt(_e,He):[],oldHeight:_e?.scrollHeight??0};Dn(de,!0),Bs();try{if(await mt(),await s.loadOlderMessages(de),await mt(),s.sessionId!==de){ft.set(de,$t);return}const Ot=ae.value;if(!Ot)return;sn(Ot,$t),ft.delete(de)}finally{Dn(de,!1)}}function jt(de){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(de):de.replaceAll(/["\\]/g,"\\$&")}function vn(de){const _e=ae.value;if(!_e)return;const He=_e.querySelector(`.turn-anchor[data-turn-id="${jt(de)}"]`);He&&(_i(),K.value=!1,J.value=me()>fg,He.scrollIntoView({behavior:"smooth",block:"center"}))}function fo(){const de=ae.value;if(!de)return"none";const _e=de.firstElementChild,He=_e instanceof HTMLElement?_e.offsetHeight:0,$t=U.value?.offsetHeight??0;return`${de.scrollHeight}:${de.clientHeight}:${He}:${$t}`}function st(de){return typeof requestAnimationFrame=="function"?requestAnimationFrame(de):setTimeout(de,16)}function On(de){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(de):clearTimeout(de)}let so=0,io=0,ro=null,Zo=0;function Un(){return performance.now()<so}function _o(de,_e=260){const He=ae.value;if(!He||(ro=de,Zo=de.getBoundingClientRect().top,so=performance.now()+_e,io))return;const $t=()=>{if(io=0,performance.now()>=so||!ro){ro=null;return}const Ot=ro.getBoundingClientRect().top-Zo;Ot&&(He.scrollTop+=Ot),io=st($t)};io=st($t)}function yn(de=36){if(!K.value&&!it())return;const _e=++Je;let He="",$t=0,Ot=0;Ie&&(On(Ie),Ie=0);const rn=()=>{if(Ie=0,_e!==Je||!K.value&&!it())return;gt(!1);const zn=fo();$t=zn===He?$t+1:0,He=zn,Ot++,$t<3&&Ot<de&&(Ie=st(rn))};Ie=st(rn)}function Xn(de,_e){return de!==void 0&&de.length>0&&_e.length>=de.length&&de.firstId!==_e.firstId&&de.lastId===_e.lastId&&de.lastTextLen===_e.lastTextLen&&de.lastThinkingLen===_e.lastThinkingLen&&de.lastToolsLen===_e.lastToolsLen&&de.approvalIds===_e.approvalIds}const _n=R(()=>{const de=(s.approvals??[]).map(rn=>rn.approvalId).join(","),_e=s.turns,He=_e.at(-1),$t=He?.thinking?.length??0,Ot=He?.tools?.reduce((rn,zn)=>rn+zn.name.length+(zn.arg?.length??0)+(zn.output?.join("").length??0),0)??0;return{length:_e.length,firstId:_e[0]?.id??"",lastId:He?.id??"",lastTextLen:He?.text.length??0,lastThinkingLen:$t,lastToolsLen:Ot,approvalIds:de}});Qe(_n,async(de,_e)=>{if(Bn.value&&Xn(_e,de)){j();return}await mt(),K.value||it()?gt(de.length<_e.length):J.value=!0,j()}),Qe(U,()=>{Jo()}),Qe(()=>s.mobile,async()=>{await mt(),ke()});const un=new Map;Qe(()=>s.fileReloadKey,async(de,_e)=>{const He=ae.value;_e&&He&&un.set(String(_e),{top:He.scrollTop,following:K.value}),_i(),await mt();const $t=ae.value,Ot=de?un.get(String(de)):void 0;if(Ot&&$t){const rn=ft.get(String(de)),zn=rn?sn($t,rn,Ot.top):Ot.top;rn&&ft.delete(String(de)),K.value=Ot.following,$t.scrollTop=zn,Ee=$t.scrollTop,J.value=!Ot.following&&me()>1,Ot.following&&yn()}else K.value=!0,Ee=0,gt(!1),yn();j()}),Qe(()=>s.sessionLoading,async(de,_e)=>{de||!_e||(K.value=!0,await mt(),yn(),j())}),Qe(()=>s.turnActive,async(de,_e)=>{de||!_e||!K.value&&!it()||(await mt(),yn(48),j())});function Sn(){K.value=!0,J.value=!1,Fe=Date.now()+zC,mt(()=>{gt(!0),yn(16)})}function Ro(de){Sn(),i("submit",de)}function ze(de){K.value=!0,J.value=!1,Fe=Date.now()+zC,i("editMessage",de)}function Ze(de){const _e=s.queued?.[de],He=_e?.text??"";y(He,_e?.attachments)&&i("editQueued",de)}function kt(de){i("reorderQueue",de)}function Bt(de,_e){Sn(),i("answer",de,_e)}function Rn(de,_e){!de||!_e||i("approval",de,_e)}let Cn=null,Wt=null,kn=null,Qn=null,wt=0,Xo=0,So=0;const Qo=Z(new Set),Bn=R(()=>!!s.sessionId&&Qo.value.has(s.sessionId));function Dn(de,_e){const He=new Set(Qo.value);_e?He.add(de):He.delete(de),Qo.value=He}function ni(){Bn.value||So||(So=st(()=>{So=0,!Bn.value&&(Un()||(K.value||it())&&gt(!1))}))}function Bs(){Je++,Ie&&(On(Ie),Ie=0),So&&(On(So),So=0)}function _i(){const de=ae.value;if(Fe=0,Bs(),so=0,ro=null,de){const _e=de.scrollTop;typeof de.scrollTo=="function"?de.scrollTo({top:_e,behavior:"auto"}):de.scrollTop=_e}ge=0,De=Number.NEGATIVE_INFINITY,de&&(Ee=de.scrollTop)}function ho(){const de=ae.value;!de||de.scrollHeight-de.clientHeight<=1&&!s.hasMoreMessages||(K.value=!1,_i(),de.scrollHeight-de.clientHeight>1&&(J.value=!0))}function Pi(de){const _e=ae.value;if(!_e)return!1;for(const He of de.composedPath()){if(He===_e)return!1;if(He instanceof HTMLElement&&He.scrollHeight>He.clientHeight+1&&He.scrollTop>1)return!0}return!1}function Si(de){de.defaultPrevented||de.ctrlKey||de.shiftKey||de.deltaY>=0||Pi(de)||ho()}function po(de){const _e=ae.value;if(!_e||de.defaultPrevented||de.button!==0||de.pointerType==="touch")return;const He=_e.getBoundingClientRect(),$t=_e.offsetWidth-_e.clientWidth,Ot=$t>0?$t:12;de.target===_e&&de.clientX>=He.right-Ot&&ho()}let Ds=null;function ir(de){Ds=de.touches.length===1?de.touches[0].clientY:null}function Ci(de){const _e=de.touches.length===1?de.touches[0].clientY:null;_e!==null&&Ds!==null&&_e>Ds+2&&!Pi(de)&&ho(),Ds=_e}function lo(){if(!Wt)return;const de=ae.value?.firstElementChild??null;de!==kn&&(kn&&Wt.unobserve(kn),kn=de,de&&Wt.observe(de))}function Jo(){if(!Wt)return;const de=U.value;de!==Qn&&(Qn&&Wt.unobserve(Qn),Qn=de,de&&Wt.observe(de))}function oi(){const de=ae.value;ke(),Cn&&(Cn.disconnect(),de&&Cn.observe(de,{childList:!0,subtree:!0,characterData:!0})),Wt&&(Wt.disconnect(),kn=null,Qn=null,de&&Wt.observe(de),lo(),Jo()),wt=de?.scrollHeight??0,Xo=de?.clientHeight??0,pe()}function Co(){lo(),ni(),pe()}function Ps(){typeof document>"u"||document.visibilityState==="visible"&&K.value&&yn()}const qn=Z(!1);let Bo=null;function Hs(){qn.value=!0,Bo!==null&&clearTimeout(Bo),Bo=setTimeout(()=>{qn.value=!1},mue)}function es(){Hs(),i("interrupt")}function Ce(de){de.key==="Escape"&&(s.running||s.working)&&(de.preventDefault(),es())}function te(){K.value&&ni()}cn(()=>{mt(()=>{typeof MutationObserver=="function"&&(Cn=new MutationObserver(Co)),typeof ResizeObserver=="function"&&(Wt=new ResizeObserver(()=>{pe(),ke();const de=ae.value;if(!de)return;const{scrollHeight:_e,clientHeight:He}=de,$t=_e>wt+1,Ot=He<Xo-1;wt=_e,Xo=He,!Un()&&($t||Ot)&&ni()})),oi(),yn(48),j(),typeof document<"u"&&(document.addEventListener("visibilitychange",Ps),document.addEventListener("keydown",Ce)),window.visualViewport?.addEventListener("resize",te)})}),wn(()=>{Cn&&Cn.disconnect(),Wt&&Wt.disconnect(),So&&On(So),Ie&&On(Ie),io&&On(io),ue&&On(ue),Bo!==null&&clearTimeout(Bo),m!==null&&(clearTimeout(m),m=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ps),document.removeEventListener("keydown",Ce)),window.visualViewport?.removeEventListener("resize",te)});function ve(){(g.value??p.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:ve}),(de,_e)=>(x(),N("section",{class:We(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(x(),be(dse,{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":P.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:b.value,onOpenChanges:_e[0]||(_e[0]=He=>i("openChanges")),onCopyAll:_e[1]||(_e[1]=He=>h.value?.copyConversation()),onCopyFinalSummary:_e[2]||(_e[2]=He=>h.value?.copyFinalSummary()),onOpenPr:_e[3]||(_e[3]=He=>e.pr&&i("openPr",e.pr.url)),onRenameSession:_e[4]||(_e[4]=(He,$t)=>i("renameSession",He,$t)),onForkSession:_e[5]||(_e[5]=He=>i("forkSession",He)),onArchiveSession:_e[6]||(_e[6]=He=>i("archiveSession",He)),onExportSession:_e[7]||(_e[7]=He=>i("exportSession",He))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):le("",!0),e.conversationToc?(x(),be(Jce,{key:1,items:D.value,"active-turn-id":q.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:ie.value,onSelect:vn},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):le("",!0),_("div",nue,[_("div",{ref:he,class:We(["panes chat-scroll",{"is-following":K.value,"history-prepending":Bn.value}]),onScrollPassive:St,onWheelPassive:Si,onPointerdownPassive:po,onTouchstartPassive:ir,onTouchmovePassive:Ci},[_("div",{class:We(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(x(),N(Pe,{key:0},[_e[55]||(_e[55]=_("div",{class:"empty-spacer"},null,-1)),_("div",oue,[_("span",{class:We(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(x(),be(Rs,{key:0,size:"sm"})):le("",!0),_("span",null,O(e.starting?C(o)("conversation.starting"):C(o)("composer.emptyConversationTitle")),1)],2),e.starting?le("",!0):(x(),N("span",sue,O(C(o)("composer.emptyConversation")),1)),c.value&&!e.starting?(x(),N("div",iue,[re(Yt,{text:C(o)("conversation.switchWorkspace")},{default:Ne(()=>[_("button",{type:"button",class:"ws-pick-btn",onClick:_e[8]||(_e[8]=bt(He=>r.value=!r.value,["stop"]))},[re(je,{name:"folder",size:"sm"}),_("span",rue,O(a.value),1),re(je,{class:We(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(x(),N("div",{key:0,class:"ws-pick-backdrop",onClick:_e[9]||(_e[9]=He=>r.value=!1)})):le("",!0),r.value?(x(),N("div",lue,[(x(!0),N(Pe,null,nt(u.value,He=>(x(),N("button",{key:He.id,type:"button",class:We(["ws-pick-item",{on:He.id===e.activeWorkspaceId}]),onClick:bt($t=>f(He.id),["stop"])},[_("span",cue,O(He.name),1),_("span",uue,O(He.shortPath),1)],10,aue))),128)),d.value>0?(x(),N("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:_e[10]||(_e[10]=bt(He=>l.value=!l.value,["stop"]))},[_("span",null,O(C(o)("conversation.moreWorkspaces",{count:d.value})),1)])):le("",!0),_e[54]||(_e[54]=_("div",{class:"ws-pick-divider"},null,-1)),_("button",{type:"button",class:"ws-pick-action",onClick:_e[11]||(_e[11]=bt(He=>{r.value=!1,i("addWorkspace")},["stop"]))},[re(je,{name:"plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)])])):le("",!0)])):e.starting?le("",!0):(x(),N("button",{key:2,type:"button",class:"empty-add-workspace",onClick:_e[12]||(_e[12]=He=>i("addWorkspace"))},[re(je,{name:"folder-plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)]))]),re(I5,{ref_key:"emptyComposerRef",ref:p,class:"empty-composer","session-id":e.sessionId,running:e.running,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,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Ro,onSteer:_e[13]||(_e[13]=He=>i("steer",He)),onCommand:_e[14]||(_e[14]=He=>i("command",He)),onInterrupt:es,onUnqueue:_e[15]||(_e[15]=He=>i("unqueue",He)),onEditQueued:_e[16]||(_e[16]=He=>i("editQueued",He)),onSetPermission:_e[17]||(_e[17]=He=>i("setPermission",He)),onSetThinking:_e[18]||(_e[18]=He=>i("setThinking",He)),onTogglePlan:_e[19]||(_e[19]=He=>i("togglePlan")),onToggleSwarm:_e[20]||(_e[20]=He=>i("toggleSwarm")),onToggleGoal:_e[21]||(_e[21]=He=>i("toggleGoal")),onOpenBtw:_e[22]||(_e[22]=He=>i("command","/btw")),onCreateGoal:_e[23]||(_e[23]=He=>i("createGoal",He)),onControlGoal:_e[24]||(_e[24]=He=>i("controlGoal",He)),onFocusGoal:A,onCompact:_e[25]||(_e[25]=He=>i("compact")),onPickModel:_e[26]||(_e[26]=He=>i("pickModel")),onSelectModel:_e[27]||(_e[27]=He=>i("selectModel",He))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),_e[56]||(_e[56]=_("div",{class:"empty-spacer"},null,-1))],64)):(x(),be(x5,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,"turn-active":e.turnActive,working:e.working,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":K.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:_e[28]||(_e[28]=He=>i("openFile",He)),onOpenMedia:_e[29]||(_e[29]=He=>i("openMedia",He)),onCopyConversationCopied:k,onOpenThinking:_e[30]||(_e[30]=He=>i("openThinking",He)),onOpenCompaction:_e[31]||(_e[31]=He=>i("openCompaction",He)),onOpenAgent:_e[32]||(_e[32]=He=>i("openAgent",He)),onOpenToolDiff:_e[33]||(_e[33]=He=>i("openToolDiff",He)),onEditMessage:ze,onLoadOlderMessages:Yo,onUnqueue:_e[34]||(_e[34]=He=>i("unqueue",He)),onEditQueued:Ze,onReorderQueue:kt},null,8,["turns","approvals","turn-active","working","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?le("",!0):(x(),be(Vce,{key:0,ref:ye,style:qt(V.value),"session-id":e.sessionId,running:e.running,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,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":v.value,"dock-panel":I.value,"bash-tasks":$.value,"subagent-tasks":L.value,"bash-running":w.value,"subagent-running":E.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":ne.value,"question-busy-kind":fe.value,"pending-approval":Me.value,"approval-busy":$e.value,mobile:e.mobile,onToggleDockPanel:_e[35]||(_e[35]=He=>B(He)),onCloseDockPanel:_e[36]||(_e[36]=He=>W()),onOpenAgent:_e[37]||(_e[37]=He=>i("openAgent",He)),onAnswer:Bt,onDismiss:_e[38]||(_e[38]=He=>i("dismiss",He)),onApproval:Rn,onCancelTask:_e[39]||(_e[39]=He=>i("cancelTask",He)),onControlGoal:_e[40]||(_e[40]=He=>i("controlGoal",He)),onSubmit:Ro,onSteer:_e[41]||(_e[41]=He=>i("steer",He)),onCommand:_e[42]||(_e[42]=He=>i("command",He)),onInterrupt:es,onSetPermission:_e[43]||(_e[43]=He=>i("setPermission",He)),onSetThinking:_e[44]||(_e[44]=He=>i("setThinking",He)),onTogglePlan:_e[45]||(_e[45]=He=>i("togglePlan")),onToggleSwarm:_e[46]||(_e[46]=He=>i("toggleSwarm")),onToggleGoal:_e[47]||(_e[47]=He=>i("toggleGoal")),onOpenBtw:_e[48]||(_e[48]=He=>i("command","/btw")),onCreateGoal:_e[49]||(_e[49]=He=>i("createGoal",He)),onFocusGoal:A,onCompact:_e[50]||(_e[50]=He=>i("compact")),onPickModel:_e[51]||(_e[51]=He=>i("pickModel")),onSelectModel:_e[52]||(_e[52]=He=>i("selectModel",He))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","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"]))]),re(El,{name:"pill"},{default:Ne(()=>[J.value?(x(),N("button",{key:0,class:"newmsg-pill",style:qt({bottom:`${se.value+12}px`}),"aria-label":C(o)("conversation.jumpToLatestAria"),onClick:_e[53]||(_e[53]=He=>gt(!0))},[re(je,{class:"pill-chevron",name:"chevron-down",size:"md"}),Xe(" "+O(C(o)("conversation.newMessages")),1)],12,due)):le("",!0)]),_:1}),re(El,{name:"abort-toast"},{default:Ne(()=>[qn.value?(x(),N("div",fue,[_("span",hue,O(C(o)("conversation.manuallyAborted")),1)])):le("",!0)]),_:1})],2))}}),vue=at(gue,[["__scopeId","data-v-0bbe2565"]]),yue=["aria-selected","onClick"],kue=Ye({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(x(),N("div",{class:We(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(x(!0),N(Pe,null,nt(e.options,i=>(x(),N("button",{key:i.value,class:We(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},O(i.label),11,yue))),128))],2))}}),ms=at(kue,[["__scopeId","data-v-d1aaccd7"]]),bue={class:"ui-panel-header__title"},xue={key:0,class:"ui-panel-header__sub"},wue=Ye({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(x(),N("div",{class:We(["ui-panel-header",{wrap:e.wrap}])},[_("span",bue,O(e.title),1),re(Yt,{text:e.subtitle},{default:Ne(()=>[e.subtitle?(x(),N("span",xue,O(e.subtitle),1)):le("",!0)]),_:1},8,["text"]),Fn(t.$slots,"default",{},void 0,!0),e.closable?(x(),be(Wn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:Ne(()=>[re(je,{name:"close",size:"sm"})]),_:1},8,["label"])):le("",!0)],2))}}),Ma=at(wue,[["__scopeId","data-v-c47879ad"]]),_ue={key:0,class:"fp-empty fp-error"},Sue={key:1,class:"fp-empty"},Cue={key:2,class:"fp-loading"},Aue={class:"fp-path"},Mue={class:"fp-meta"},Eue={key:0,class:"fp-lines"},Tue={class:"fp-size"},Nue={key:3,class:"fp-search"},Iue=["placeholder"],Lue={key:0,class:"fp-search-count"},$ue=["href","aria-label"],Fue={key:1,class:"fp-code"},Oue={class:"fp-line-table"},Rue=["data-line"],Bue={class:"fp-gutter"},Due=["innerHTML"],Pue={key:1,class:"fp-body fp-code"},Hue={class:"fp-line-table"},Wue=["data-line"],zue={class:"fp-gutter"},Uue=["innerHTML"],que={key:2,class:"fp-body"},jue=["srcdoc","title"],Vue={key:1,class:"fp-code"},Kue={class:"fp-line-table"},Gue=["data-line"],Yue={class:"fp-gutter"},Zue=["innerHTML"],Xue={key:3,class:"fp-body fp-pdf-wrap"},Que=["src","title"],Jue={key:1,class:"fp-binary-card"},ede={class:"fp-binary-label"},tde={key:4,class:"fp-body fp-table-wrap"},nde={class:"fp-table"},ode=["data-line"],sde={key:5,class:"fp-body fp-image-wrap"},ide=["src","alt"],rde={key:1,class:"fp-binary-card"},lde={class:"fp-binary-icon"},ade={class:"fp-binary-label"},cde={key:6,class:"fp-body fp-code"},ude={class:"fp-line-table"},dde=["data-line"],fde={class:"fp-gutter"},hde=["innerHTML"],pde={key:7,class:"fp-body fp-binary-wrap"},mde={class:"fp-binary-card"},gde={class:"fp-binary-icon"},vde={class:"fp-binary-label"},yde=Ye({__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}=Mt();function o(ae,U){const ce=U?U.split("/").filter(Boolean):[];for(const se of ae.split("/"))se===""||se==="."||(se===".."?ce.pop():ce.push(se));return ce.join("/")}const s=Ut("resolveImage",async ae=>ae),i=R(()=>{const ae=c.file?.path??"",U=ae.lastIndexOf("/");return U>0?ae.slice(0,U):""});function r(ae){if(/^(https?:|data:|blob:)/i.test(ae)||ae.startsWith("/"))return ae;const U=i.value;return U?o(ae,U):ae}async function l(ae){const U=r(ae);return s?s(U):U}In("resolveImage",l);function a(ae){let U=ae.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(U)||U.startsWith("/"))return ae;for(const se of["#","?"]){const V=U.indexOf(se);V!==-1&&(U=U.slice(0,V))}const ce=i.value;return{...ae,path:o(U,ce)}}const c=e,u=t;function d(ae){c.openFile?.(a(ae))}const f=Z(null),h=R(()=>{const ae=c.file;if(!ae)return"binary";const U=ae.mime??"",ce=ae.languageId??"",se=ae.path.toLowerCase();return U==="text/markdown"||ce==="markdown"||ce==="md"||se.endsWith(".mdx")?"markdown":U==="application/json"||ce==="json"?"json":U==="text/html"||ce==="html"||se.endsWith(".html")||se.endsWith(".htm")?"html":U==="application/pdf"||se.endsWith(".pdf")?"pdf":U==="text/csv"||ce==="csv"||se.endsWith(".csv")?"csv":U.startsWith("image/")?"image":ae.isBinary?"binary":U.startsWith("text/")||ce!==""?"text":"binary"});function p(ae){const U=atob(ae),ce=Uint8Array.from(U,se=>se.charCodeAt(0));return new TextDecoder().decode(ce)}const g=R(()=>{const ae=c.file;if(!ae)return"";if(ae.encoding==="base64")try{return p(ae.content)}catch{return ae.content}return ae.content}),b=R(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),v=R(()=>c.file?(h.value==="json"?b.value:g.value).split(`
301
- `):[]),m=R(()=>c.file?h.value==="json"?b.value:g.value:""),y=Z(""),k=Z(0),A=R(()=>{const ae=y.value.trim().toLowerCase();if(!ae)return[];const U=[];return v.value.forEach((ce,se)=>{ce.toLowerCase().includes(ae)&&U.push(se+1)}),U});Qe(y,()=>{k.value=0});function $(ae,U=!1){ae&&mt(()=>{const ce=f.value?.querySelector(".fp-body"),se=ce?.querySelector(`[data-line="${ae}"]`);if(!ce||!se)return;U&&(ce.scrollTop=0);const V=ce.getBoundingClientRect(),Q=se.getBoundingClientRect(),ke=Q.top-V.top+ce.scrollTop;ce.scrollTop=ke-ce.clientHeight/2+Q.height/2})}Qe(()=>[c.file?.path,c.line],()=>$(c.line,!0),{immediate:!0});function L(ae){const U=A.value;U.length!==0&&(k.value=(k.value+ae+U.length)%U.length,$(U[k.value]))}function w(ae){const U=A.value;return{target:c.line===ae,hit:U.includes(ae),active:U[k.value]===ae}}function E(ae){return ae<1024?`${ae} B`:ae<1024*1024?`${(ae/1024).toFixed(1)} KB`:`${(ae/(1024*1024)).toFixed(1)} MB`}const T=Z(!1),F=Z(!1);function S(){c.file&&Ko(m.value).then(ae=>{ae&&(T.value=!0,setTimeout(()=>{T.value=!1},1400))})}function I(){c.file&&Ko(c.file.path).then(ae=>{ae&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const P=Z("preview"),B=Z("preview"),W=Z("fit");function z(ae){P.value=ae}function D(ae){B.value=ae}function q(ae){W.value=ae}Qe(h,ae=>{P.value=ae==="html"?"preview":"source",B.value="preview",W.value="fit"});const j=R(()=>{const ae=c.file;return!ae||h.value!=="image"?null:ae.sourceUrl?ae.sourceUrl:ae.encoding==="base64"?`data:${ae.mime};base64,${ae.content}`:ae.mime==="image/svg+xml"?`data:${ae.mime};charset=utf-8,${encodeURIComponent(ae.content)}`:null}),ie=R(()=>{const ae=c.file;return!ae||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ae.encoding==="base64"?`data:${ae.mime};base64,${ae.content}`:null}),ue=R(()=>c.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:;">`,g.value].join(""):"");function pe(ae){const U=[];let ce="",se=!1;for(let V=0;V<ae.length;V++){const Q=ae[V];Q==='"'&&ae[V+1]==='"'?(ce+='"',V++):Q==='"'?se=!se:Q===","&&!se?(U.push(ce),ce=""):ce+=Q}return U.push(ce),U}const ee=R(()=>v.value.slice(0,200).map(pe));function ne(ae){return ae.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function fe(){const ae=c.file;if(!ae)return"";const U=ae.languageId?.toLowerCase();return U||(ae.path.split(".").pop()?.toLowerCase()??"")}function Me(ae){const U=fe();let ce=ne(ae);return h.value==="json"||U==="json"||U==="jsonc"?(ce=ce.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),ce=ce.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),ce=ce.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ce=ce.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ce):h.value==="html"||U==="html"||U==="xml"||U==="svg"?(ce=ce.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ce=ce.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),ce=ce.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ce):(ce=ce.replace(/\b(async|await|break|case|catch|class|const|continue|else|export|extends|finally|for|from|function|if|import|interface|let|new|return|switch|throw|try|type|while)\b/g,'<span class="tok-keyword">$1</span>'),ce=ce.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),ce=ce.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ce)}function $e(ae,U=55){return!ae||ae.length<=U?ae:"…"+ae.slice(ae.length-U+1)}return(ae,U)=>(x(),N("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(x(),N("div",_ue,[_("span",null,O(e.error),1),e.closable?(x(),be(Ft,{key:0,variant:"secondary",size:"sm",onClick:U[0]||(U[0]=ce=>u("close"))},{default:Ne(()=>[Xe(O(C(n)("filePreview.close")),1)]),_:1})):le("",!0)])):!e.file&&!e.loading?(x(),N("div",Sue,O(C(n)("filePreview.empty")),1)):e.loading?(x(),N("div",Cue,[U[7]||(U[7]=_("span",{class:"spinner"},null,-1)),_("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(x(),N(Pe,{key:3},[re(Ma,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:U[6]||(U[6]=ce=>u("close"))},{default:Ne(()=>[re(Yt,{text:e.file.path},{default:Ne(()=>[_("span",Aue,O($e(e.file.path)),1)]),_:1},8,["text"]),_("span",Mue,[e.file.lineCount?(x(),N("span",Eue,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):le("",!0),_("span",Tue,O(E(e.file.size)),1)]),h.value==="html"?(x(),be(ms,{key:0,"model-value":P.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":z},null,8,["model-value","options"])):le("",!0),h.value==="markdown"?(x(),be(ms,{key:1,"model-value":B.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":D},null,8,["model-value","options"])):le("",!0),h.value==="image"?(x(),be(ms,{key:2,"model-value":W.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":q},null,8,["model-value","options"])):le("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(x(),N("div",Nue,[$n(_("input",{"onUpdate:modelValue":U[1]||(U[1]=ce=>y.value=ce),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,Iue),[[ws,y.value]]),y.value.trim()?(x(),N("span",Lue,O(A.value.length),1)):le("",!0),re(Wn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:U[2]||(U[2]=ce=>L(-1))},{default:Ne(()=>[re(je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),re(Wn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:U[3]||(U[3]=ce=>L(1))},{default:Ne(()=>[re(je,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):le("",!0),re(Wn,{size:"sm",class:We({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:I},{default:Ne(()=>[F.value?(x(),be(je,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),be(je,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(x(),be(Wn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:U[4]||(U[4]=ce=>u("openExternal"))},{default:Ne(()=>[re(je,{name:"external-link",size:"md"})]),_:1},8,["label"])):le("",!0),e.externalActions?(x(),be(Wn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:U[5]||(U[5]=ce=>u("reveal"))},{default:Ne(()=>[re(je,{name:"folder",size:"md"})]),_:1},8,["label"])):le("",!0),e.downloadUrl?(x(),N("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[re(je,{name:"download",size:"md"})],8,$ue)):le("",!0),!e.file.isBinary&&h.value!=="image"?(x(),be(Wn,{key:7,size:"sm",class:We({copied:T.value}),label:T.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ne(()=>[T.value?(x(),be(je,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),be(je,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):le("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(x(),N("div",{key:0,class:We(["fp-body",{"fp-markdown":B.value==="preview"}])},[B.value==="preview"?(x(),be(Rm,{key:0,text:g.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(x(),N("div",Fue,[_("div",Oue,[(x(!0),N(Pe,null,nt(v.value,(ce,se)=>(x(),N("div",{key:se,class:We(["fp-line-row",w(se+1)]),"data-line":se+1},[_("span",Bue,O(se+1),1),_("span",{class:"fp-line-text",innerHTML:Me(ce)},null,8,Due)],10,Rue))),128))])]))],2)):h.value==="json"?(x(),N("div",Pue,[_("div",Hue,[(x(!0),N(Pe,null,nt(v.value,(ce,se)=>(x(),N("div",{key:se,class:We(["fp-line-row",w(se+1)]),"data-line":se+1},[_("span",zue,O(se+1),1),_("span",{class:"fp-line-text",innerHTML:Me(ce)},null,8,Uue)],10,Wue))),128))])])):h.value==="html"?(x(),N("div",que,[P.value==="preview"?(x(),N("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ue.value,title:e.file.path},null,8,jue)):(x(),N("div",Vue,[_("div",Kue,[(x(!0),N(Pe,null,nt(v.value,(ce,se)=>(x(),N("div",{key:se,class:We(["fp-line-row",w(se+1)]),"data-line":se+1},[_("span",Yue,O(se+1),1),_("span",{class:"fp-line-text",innerHTML:Me(ce)},null,8,Zue)],10,Gue))),128))])]))])):h.value==="pdf"?(x(),N("div",Xue,[ie.value?(x(),N("iframe",{key:0,class:"fp-pdf-frame",src:ie.value,title:e.file.path},null,8,Que)):(x(),N("div",Jue,[_("span",ede,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(x(),N("div",tde,[_("table",nde,[_("tbody",null,[(x(!0),N(Pe,null,nt(ee.value,(ce,se)=>(x(),N("tr",{key:se,class:We(w(se+1)),"data-line":se+1},[_("th",null,O(se+1),1),(x(!0),N(Pe,null,nt(ce,(V,Q)=>(x(),N("td",{key:Q},O(V),1))),128))],10,ode))),128))])])])):h.value==="image"?(x(),N("div",sde,[j.value?(x(),N("img",{key:0,src:j.value,alt:e.file.path,class:We(["fp-image",{actual:W.value==="actual"}])},null,10,ide)):(x(),N("div",rde,[_("span",lde,[re(je,{name:"image-off",size:"lg"})]),_("span",ade,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:E(e.file.size)})),1)]))])):h.value==="text"?(x(),N("div",cde,[_("div",ude,[(x(!0),N(Pe,null,nt(v.value,(ce,se)=>(x(),N("div",{key:se,class:We(["fp-line-row",w(se+1)]),"data-line":se+1},[_("span",fde,O(se+1),1),_("span",{class:"fp-line-text",innerHTML:Me(ce)},null,8,hde)],10,dde))),128))])])):(x(),N("div",pde,[_("div",mde,[_("span",gde,[re(je,{name:"file-off",size:"lg"})]),_("span",vde,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:E(e.file.size)})),1)])]))],64)):le("",!0)],512))}}),kde=at(yde,[["__scopeId","data-v-62bfaf2d"]]),bde={class:"tp"},xde=Ye({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Mt(),i=Z(null);return Qe(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||mt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(x(),N("div",bde,[re(Ma,{title:C(s)("common.preview"),subtitle:e.subtitle??C(s)("thinking.panelTitle"),"close-label":C(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),_("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),UC=at(xde,[["__scopeId","data-v-cf9c560b"]]),wde={class:"ap"},_de={key:0,class:"ap-type"},Sde={key:1,class:"ap-reason"},Cde={key:2,class:"ap-field"},Ade={class:"ap-field-body"},Mde={key:3,class:"ap-field"},Ede={class:"ap-field-body ap-live"},Tde={key:4,class:"ap-field"},Nde={class:"ap-field-body ap-progress"},Ide={key:0,class:"ap-call"},Lde={key:1,class:"ap-output"},$de=["onClick"],Fde={key:5,class:"ap-field"},Ode={class:"ap-field-body"},Rde=8,qC=5,jC=2,Bde=Ye({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Mt(),i=R(()=>(n.member.outputLines??[]).map(g=>g.trimEnd()).filter(g=>g.length>0)),r=R(()=>(n.member.text??"").trimEnd());function l(g){const b=[];let v=null,m=0;for(const y of g)y.startsWith("Calling ")?(v={key:`g${m++}`,call:y,output:[]},b.push(v)):v?v.output.push(y):(v={key:`g${m++}`,call:"",output:[y]},b.push(v));return b}const a=R(()=>l(i.value)),c=Z(new Set);function u(g){return c.value.has(g)}function d(g){const b=new Set(c.value);b.has(g)?b.delete(g):b.add(g),c.value=b}function f(g){return g.output.length-qC-jC}function h(g){switch(g){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=Z(null);return Qe(()=>i.value.length+r.value.length,()=>{const g=p.value;!g||!(g.scrollHeight-g.scrollTop-g.clientHeight<24)||mt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(g,b)=>(x(),N("div",wde,[re(Ma,{title:C(s)("common.preview"),subtitle:e.member.name,"close-label":C(s)("thinking.close"),onClose:b[0]||(b[0]=v=>o("close"))},{default:Ne(()=>[re(Ns,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ne(()=>[Xe(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(x(),N("div",_de,O(e.member.subagentType),1)):le("",!0),e.member.suspendedReason?(x(),N("div",Sde,O(e.member.suspendedReason),1)):le("",!0),e.member.prompt?(x(),N("div",Cde,[b[1]||(b[1]=_("span",{class:"ap-field-label"},"Task",-1)),_("div",Ade,O(e.member.prompt),1)])):le("",!0),r.value?(x(),N("div",Mde,[b[2]||(b[2]=_("span",{class:"ap-field-label"},"Output",-1)),_("div",Ede,O(r.value),1)])):le("",!0),a.value.length>0?(x(),N("div",Tde,[b[4]||(b[4]=_("span",{class:"ap-field-label"},"Progress",-1)),_("div",Nde,[(x(!0),N(Pe,null,nt(a.value,v=>(x(),N("div",{key:v.key,class:"ap-group"},[v.call?(x(),N("div",Ide,[b[3]||(b[3]=_("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Xe(" "+O(v.call),1)])):le("",!0),v.output.length>0?(x(),N("div",Lde,[v.output.length<=Rde||u(v.key)?(x(!0),N(Pe,{key:0},nt(v.output,(m,y)=>(x(),N("div",{key:y,class:"ap-out-line"},O(m),1))),128)):(x(),N(Pe,{key:1},[(x(!0),N(Pe,null,nt(v.output.slice(0,qC),(m,y)=>(x(),N("div",{key:y,class:"ap-out-line"},O(m),1))),128)),_("button",{type:"button",class:"ap-fold",onClick:m=>d(v.key)}," … ("+O(f(v))+" more) ",9,$de),(x(!0),N(Pe,null,nt(v.output.slice(-jC),(m,y)=>(x(),N("div",{key:"t"+y,class:"ap-out-line"},O(m),1))),128))],64))])):le("",!0)]))),128))])])):le("",!0),e.member.summary?(x(),N("div",Fde,[b[5]||(b[5]=_("span",{class:"ap-field-label"},"Result",-1)),_("div",Ode,O(e.member.summary),1)])):le("",!0)],512)]))}}),Dde=at(Bde,[["__scopeId","data-v-715bd93e"]]),Pde={class:"diff-lines"},Hde={key:0,class:"hunk-text"},Wde={class:"dl-gutter old"},zde={class:"dl-gutter new"},Ude={class:"dl-sign"},qde={class:"dl-text"},jde=Ye({__name:"DiffLines",props:{lines:{}},setup(e){function t(s){return s.oldNo!==void 0?String(s.oldNo):""}function n(s){return s.newNo!==void 0?String(s.newNo):""}function o(s){return`dl-${s.type}`}return(s,i)=>(x(),N("div",Pde,[(x(!0),N(Pe,null,nt(e.lines,(r,l)=>(x(),N("div",{key:l,class:We(["dl",o(r)])},[r.type==="hunk"?(x(),N("span",Hde,O(r.text),1)):(x(),N(Pe,{key:1},[_("span",Wde,O(t(r)),1),_("span",zde,O(n(r)),1),_("span",Ude,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),_("span",qde,O(r.text),1)],64))],2))),128))]))}}),$5=at(jde,[["__scopeId","data-v-2f6bc1cc"]]),Vde={class:"tdp"},Kde={class:"tdp-body"},Gde={key:1,class:"tdp-output"},Yde={key:2,class:"tdp-empty"},Zde=Ye({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=Mt();return(s,i)=>(x(),N("div",Vde,[re(Ma,{title:e.target.title,subtitle:e.target.path,"close-label":C(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),_("div",Kde,[e.target.lines&&e.target.lines.length>0?(x(),be($5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(x(),N("div",Gde,[(x(!0),N(Pe,null,nt(e.target.output,(r,l)=>(x(),N("div",{key:l},O(r),1))),128))])):(x(),N("div",Yde,O(C(o)("diff.noDiff")),1))])]))}}),Xde=at(Zde,[["__scopeId","data-v-76f2fbca"]]),Qde={class:"sc"},Jde={key:0,class:"sc-empty"},efe={key:2,class:"sc-loading","aria-hidden":"true"},tfe={class:"sc-composer"},nfe=["placeholder"],ofe=["disabled"],sfe=Ye({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Mt(),i=R(()=>n.turns.find(m=>m.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(""),c=Z(null),u=Z(null);function d(){const v=a.value.trim();v&&(o("send",v),a.value="",mt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const v=u.value;v&&(v.scrollTop=v.scrollHeight)}const h=R(()=>{const v=n.turns;if(v.length===0)return"0";const m=v.at(-1),y=m.thinking?.length??0,k=m.tools?.reduce((A,$)=>A+$.name.length+($.arg?.length??0)+($.output?.join("").length??0),0)??0;return`${v.length}:${m.text.length}:${y}:${k}`});Qe(h,async()=>{!n.running&&!n.sending||(await mt(),f())});const p=R(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function g(v){v.key==="Enter"&&!v.shiftKey&&!v.isComposing&&(v.preventDefault(),d())}function b(){const v=c.value;v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,160)}px`)}return(v,m)=>(x(),N("div",Qde,[re(Ma,{title:r.value,subtitle:l.value,"close-label":C(s)("thinking.close"),onClose:m[0]||(m[0]=y=>o("close"))},null,8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(x(),N("div",Jde,O(C(s)("sideChat.empty")),1)):(x(),be(x5,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),p.value?(x(),N("div",efe,[re(k5)])):le("",!0)],512),_("div",tfe,[$n(_("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":m[1]||(m[1]=y=>a.value=y),class:"sc-input",rows:"1",placeholder:C(s)("sideChat.placeholder"),onInput:b,onKeydown:g},null,40,nfe),[[ws,a.value]]),re(Yt,{text:C(s)("sideChat.send")},{default:Ne(()=>[_("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[re(je,{name:"arrow-right",size:"sm"})],8,ofe)]),_:1},8,["text"])])]))}}),ife=at(sfe,[["__scopeId","data-v-f973798f"]]),rfe={class:"changes-pane"},lfe={class:"dv-path"},afe={class:"diff-head"},cfe={class:"back-label"},ufe={key:0,class:"empty-state"},dfe={key:1,class:"dv-lines-wrap"},ffe={key:2,class:"empty-state"},hfe={class:"dv-change-count"},pfe={class:"ch-head"},mfe={class:"br-label"},gfe={class:"br-name"},vfe={key:0,class:"sync-info"},yfe={key:0,class:"ahead"},kfe={key:0,class:"behind"},bfe={key:1,class:"empty-head"},xfe={key:0,class:"ch-list"},wfe=["onClick"],_fe={class:"fpath"},Sfe={key:1,class:"ch-list ch-tree"},Cfe={class:"tree-list"},Afe=["onClick"],Mfe={class:"tree-name"},Efe=["onClick"],Tfe={class:"tree-name"},Nfe={key:2,class:"empty-state"},Ife={key:3,class:"empty-state"},Lfe=Ye({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},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}=Mt(),o=e,s=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+1)}const c=R(()=>o.gitInfo!==null),u=R(()=>o.changes.length>0),d=R(()=>(o.selectedDiffPath??null)!==null),f=R(()=>o.mode==="detail"||o.mode==="full"&&d.value),h=R(()=>o.fileDiff??[]),p=R(()=>o.fileDiffLoading===!0);function g(F){s("open",F)}function b(){s("back")}function v(){s("close")}const m=Z("list");function y(F){m.value=F}function k(F){const S={children:[]},I=[...F].sort((P,B)=>P.path.localeCompare(B.path));for(const P of I){const B=P.path.split("/");let W=S;for(let z=0;z<B.length;z++){const D=B[z],q=z===B.length-1,j=B.slice(0,z+1).join("/");let ie=W.children.find(ue=>ue.name===D&&ue.kind===(q?"file":"folder"));ie||(ie={name:D,path:j,kind:q?"file":"folder",status:q?P.status:void 0,children:[]},W.children.push(ie)),W=ie}}return S.children}const A=R(()=>k(o.changes)),$=Z(new Set);function L(F){return!$.value.has(F)}const w=R(()=>{const F=[];function S(I,P){for(const B of I)F.push({node:B,depth:P}),B.kind==="folder"&&L(B.path)&&S(B.children,P+1)}return S(A.value,0),F});function E(F){const S=new Set($.value);S.has(F.path)?S.delete(F.path):S.add(F.path),$.value=S}function T(F){return`${16+F*16}px`}return(F,S)=>(x(),N("div",rfe,[f.value?(x(),N(Pe,{key:0},[re(Ma,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ne(()=>[re(Yt,{text:e.selectedDiffPath??""},{default:Ne(()=>[_("span",lfe,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),_("div",afe,[e.hideBack?le("",!0):(x(),be(Ft,{key:0,variant:"ghost",size:"sm",onClick:b},{default:Ne(()=>[S[0]||(S[0]=_("span",{"aria-hidden":"true"},"←",-1)),_("span",cfe,O(C(n)("diff.back")),1)]),_:1}))]),p.value?(x(),N("div",ufe,O(C(n)("diff.loading")),1)):h.value.length>0?(x(),N("div",dfe,[re($5,{lines:h.value},null,8,["lines"])])):(x(),N("div",ffe,O(C(n)("diff.noDiff")),1))],64)):(x(),N(Pe,{key:1},[re(Ma,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ne(()=>[_("span",hfe,O(C(n)("diff.changeCount",{count:e.changes.length})),1),re(ms,{"model-value":m.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":y},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),_("div",pfe,[c.value?(x(),N(Pe,{key:0},[_("span",mfe,O(C(n)("diff.branch")),1),_("span",gfe,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(x(),N("span",vfe,[re(Yt,{text:C(n)("diff.aheadTitle")},{default:Ne(()=>[e.gitInfo.ahead>0?(x(),N("span",yfe,"↑"+O(e.gitInfo.ahead),1)):le("",!0)]),_:1},8,["text"]),re(Yt,{text:C(n)("diff.behindTitle")},{default:Ne(()=>[e.gitInfo.behind>0?(x(),N("span",kfe,"↓"+O(e.gitInfo.behind),1)):le("",!0)]),_:1},8,["text"])])):le("",!0)],64)):(x(),N("span",bfe,O(C(n)("diff.empty")),1))]),u.value&&m.value==="list"?(x(),N("div",xfe,[(x(!0),N(Pe,null,nt(e.changes,I=>(x(),be(Yt,{key:I.path,text:I.path},{default:Ne(()=>[_("button",{type:"button",class:"ch-row",onClick:P=>g(I.path)},[_("span",{class:We(["badge",i(I.status)])},O(l(I.status)),3),_("span",_fe,O(a(I.path)),1)],8,wfe)]),_:2},1032,["text"]))),128))])):u.value&&m.value==="tree"?(x(),N("div",Sfe,[_("ul",Cfe,[(x(!0),N(Pe,null,nt(w.value,({node:I,depth:P})=>(x(),N("li",{key:I.path,class:"tree-node"},[I.kind==="folder"?(x(),N("button",{key:0,type:"button",class:"tree-row tree-folder",style:qt({paddingLeft:T(P)}),onClick:B=>E(I)},[re(je,{class:"tree-icon",name:"folder-solid",size:"sm"}),_("span",Mfe,O(I.name),1)],12,Afe)):(x(),be(Yt,{key:1,text:I.path},{default:Ne(()=>[_("button",{type:"button",class:"tree-row tree-file",style:qt({paddingLeft:T(P)}),onClick:B=>g(I.path)},[_("span",{class:We(["badge",i(I.status)])},O(l(I.status)),3),_("span",Tfe,O(I.name),1)],12,Efe)]),_:2},1032,["text"]))]))),128))])])):c.value?(x(),N("div",Nfe,O(C(n)("diff.clean")),1)):(x(),N("div",Ife,O(C(n)("diff.empty")),1))],64))]))}}),$fe=at(Lfe,[["__scopeId","data-v-7778610a"]]);function Hk(e,t){let n=null;cn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,mt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),co(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const Ffe=["type","value","placeholder","disabled","readonly"],Ofe=Ye({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const o=n,s=Z();function i(a){o("update:modelValue",a.target.value)}function r(){s.value?.focus()}function l(){s.value?.select()}return t({focus:r,select:l,el:s}),(a,c)=>(x(),N("input",{ref_key:"el",ref:s,class:We(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,Ffe))}}),Wc=at(Ofe,[["__scopeId","data-v-340f0da2"]]),Rfe={class:"search-wrap"},Bfe={key:0,class:"tab-strip"},Dfe={key:1,class:"state-row"},Pfe={key:2,class:"state-row unavail"},Hfe={key:3,class:"model-list"},Wfe=["aria-selected","onClick","onMouseenter"],zfe={class:"check"},Ufe={class:"model-main"},qfe={class:"model-name"},jfe={class:"model-id"},Vfe={key:0,class:"caps"},Kfe={class:"model-provider"},Gfe={class:"model-ctx"},Yfe={key:0,class:"empty"},Zfe={class:"footer-hint"},Xfe=Ye({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Mt(),o=e,s=t,i=R(()=>new Set(o.starredIds??[]));function r(y){return i.value.has(y)}const l=Z(""),a=Z(null),c=Z(null),u=Z("all");Hk(c,a);const d=R(()=>{const y=new Set,k=[{id:"all",label:n("model.allTab")}];for(const A of o.models)y.has(A.provider)||(y.add(A.provider),k.push({id:A.provider,label:A.provider}));return k}),f=R(()=>{const y=l.value.toLowerCase().trim(),k=o.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const $=(A.displayName??A.model).toLowerCase().includes(y),L=A.provider.toLowerCase().includes(y),w=A.id.toLowerCase().includes(y);return!y||$||L||w});return u.value!=="all"?k:k.sort((A,$)=>{const L=r(A.id)?1:0;return(r($.id)?1:0)-L})}),h=R(()=>f.value),p=Z(0);Qe([l,u],()=>{p.value=0}),Qe(d,y=>{y.some(k=>k.id===u.value)||(u.value="all")}),Qe(h,y=>{p.value=Math.min(p.value,Math.max(y.length-1,0))});function g(y){if(y.key==="Escape"){s("close");return}if(y.key==="ArrowDown")y.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(y.key==="ArrowUp")y.preventDefault(),p.value=Math.max(p.value-1,0);else if(y.key==="Enter"){const k=h.value[p.value];k&&s("select",k.id)}}cn(()=>{document.addEventListener("keydown",g)}),wn(()=>{document.removeEventListener("keydown",g)});function b(y){s("select",y)}function v(y){return h.value.indexOf(y)}function m(y){u.value=y}return(y,k)=>(x(),be(Wr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:k[1]||(k[1]=A=>s("close"))},{default:Ne(()=>[_("div",{ref_key:"dialogRef",ref:c,class:"mp"},[_("div",Rfe,[re(Wc,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(x(),N("div",Bfe,[(x(!0),N(Pe,null,nt(d.value,A=>(x(),be(Ft,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:$=>m(A.id)},{default:Ne(()=>[Xe(O(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):le("",!0),e.loading?(x(),N("div",Dfe,[re(Rs,{size:"sm"}),_("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(x(),N("div",Pfe,[re(je,{name:"alert-triangle",size:"lg"}),_("span",null,O(C(n)("model.unavailable")),1)])):(x(),N("div",Hfe,[(x(!0),N(Pe,null,nt(h.value,A=>(x(),N("div",{key:A.id,class:We(["model-row",{"is-current":A.id===e.current,"is-selected":v(A)===p.value}]),role:"option","aria-selected":A.id===e.current,onClick:$=>b(A.id),onMouseenter:$=>p.value=v(A)},[_("span",zfe,[A.id===e.current?(x(),be(je,{key:0,name:"check",size:"sm"})):le("",!0)]),_("span",Ufe,[_("span",qfe,O(A.displayName??A.model),1),_("span",jfe,O(A.id),1),A.capabilities&&A.capabilities.length>0?(x(),N("span",Vfe,[(x(!0),N(Pe,null,nt(A.capabilities,$=>(x(),be(Ns,{key:$,variant:"info",size:"sm"},{default:Ne(()=>[Xe(O($),1)]),_:2},1024))),128))])):le("",!0)]),_("span",Kfe,O(A.provider),1),_("span",Gfe,O(C(n)("model.contextSuffix",{size:Math.round(A.maxContextSize/1e3)})),1),re(Wn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:bt($=>s("toggle-star",A.id),["stop"])},{default:Ne(()=>[r(A.id)?(x(),be(je,{key:0,name:"star",size:"md"})):(x(),be(je,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Wfe))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(x(),N("div",Yfe,O(o.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):le("",!0)])),_("div",Zfe,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Qfe=at(Xfe,[["__scopeId","data-v-e93073d7"]]),Jfe={key:0,class:"ui-field__label"},ehe={key:1,class:"ui-field__error"},the={key:2,class:"ui-field__hint"},nhe=Ye({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(x(),N("div",{class:We(["ui-field",{"has-error":!!e.error}])},[e.label?(x(),N("label",Jfe,O(e.label),1)):le("",!0),Fn(t.$slots,"default",{},void 0,!0),e.error?(x(),N("span",ehe,O(e.error),1)):e.hint?(x(),N("span",the,O(e.hint),1)):le("",!0)],2))}}),rh=at(nhe,[["__scopeId","data-v-49bce958"]]),ohe=["value","disabled"],she=Ye({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function o(s){n("update:modelValue",s.target.value)}return(s,i)=>(x(),N("select",{class:We(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[Fn(s.$slots,"default",{},void 0,!0)],42,ohe))}}),qv=at(she,[["__scopeId","data-v-92a040fd"]]),ihe={class:"prov-list"},rhe={key:0,class:"state-row"},lhe={key:1,class:"state-row unavail"},ahe={key:2,class:"empty"},che={class:"prov-info"},uhe={class:"prov-type"},dhe={key:0,class:"prov-url"},fhe={class:"prov-meta"},hhe={key:0},phe={class:"prov-actions"},mhe={key:0,class:"add-section"},ghe={key:0,class:"add-btns"},vhe={key:1,class:"add-form"},yhe=["value"],khe={key:0,class:"add-error"},bhe={class:"form-btns"},xhe={class:"footer-hint"},whe=Ye({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Mt(),o=Z(null);Hk(o);const s=t;function i(b){s("delete",b)}const r=Z(!1),l=Oo({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),a=Z(""),c=["moonshot","anthropic","openai","custom"];function u(){l.type="moonshot",l.apiKey="",l.baseUrl="",l.defaultModel="",a.value="",r.value=!0}function d(){r.value=!1}function f(){if(!l.apiKey.trim()){a.value=n("providers.apiKeyRequired");return}a.value="",s("add",{type:l.type,apiKey:l.apiKey.trim()||void 0,baseUrl:l.baseUrl.trim()||void 0,defaultModel:l.defaultModel.trim()||void 0}),r.value=!1}function h(b){if(b.key==="Escape"){if(r.value){d();return}s("close")}}cn(()=>document.addEventListener("keydown",h)),wn(()=>document.removeEventListener("keydown",h));function p(b){return b==="connected"?"var(--color-success)":b==="error"?"var(--color-danger)":"var(--color-text-faint)"}function g(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,v)=>(x(),be(Wr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:v[6]||(v[6]=m=>s("close"))},{default:Ne(()=>[_("div",{ref_key:"dialogRef",ref:o,class:"pm"},[_("div",ihe,[e.loading?(x(),N("div",rhe,[re(Rs,{size:"sm"}),_("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(x(),N("div",lhe,[re(je,{name:"alert-triangle",size:"md"}),_("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(x(),N("div",ahe,O(C(n)("providers.empty")),1)):(x(!0),N(Pe,{key:3},nt(e.providers,m=>(x(),N("div",{key:m.id,class:"prov-row"},[re(Yt,{text:g(m.status)},{default:Ne(()=>[_("span",{class:We(["status-dot",{"status-dot--empty":m.status!=="connected"&&m.status!=="error"}]),style:qt(m.status==="connected"||m.status==="error"?{background:p(m.status)}:void 0)},null,6)]),_:2},1032,["text"]),_("div",che,[_("span",uhe,O(m.type),1),m.baseUrl?(x(),N("span",dhe,O(m.baseUrl),1)):le("",!0),_("span",fhe,[re(Ns,{variant:m.hasApiKey?"success":"neutral",size:"sm"},{default:Ne(()=>[Xe(O(m.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),m.models&&m.models.length>0?(x(),N("span",hhe," · "+O(C(n)("providers.modelCount",{count:m.models.length})),1)):le("",!0)])]),_("div",phe,[re(Yt,{text:C(n)("providers.refreshTitle",{type:m.type})},{default:Ne(()=>[re(Ft,{variant:"secondary",size:"sm",onClick:y=>s("refresh",m.id)},{default:Ne(()=>[Xe(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),re(Yt,{text:C(n)("providers.deleteTitle",{type:m.type})},{default:Ne(()=>[re(Ft,{variant:"danger-soft",size:"sm",onClick:y=>i(m.id)},{default:Ne(()=>[Xe(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?le("",!0):(x(),N("div",mhe,[r.value?(x(),N("div",vhe,[re(rh,{label:C(n)("providers.fieldType")},{default:Ne(()=>[re(qv,{modelValue:l.type,"onUpdate:modelValue":v[2]||(v[2]=m=>l.type=m)},{default:Ne(()=>[(x(),N(Pe,null,nt(c,m=>_("option",{key:m,value:m},O(m),9,yhe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),re(rh,{label:C(n)("providers.fieldApiKey")},{default:Ne(()=>[re(Wc,{modelValue:l.apiKey,"onUpdate:modelValue":v[3]||(v[3]=m=>l.apiKey=m),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),re(rh,{label:C(n)("providers.fieldBaseUrl")},{default:Ne(()=>[re(Wc,{modelValue:l.baseUrl,"onUpdate:modelValue":v[4]||(v[4]=m=>l.baseUrl=m),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),re(rh,{label:C(n)("providers.fieldDefaultModel")},{default:Ne(()=>[re(Wc,{modelValue:l.defaultModel,"onUpdate:modelValue":v[5]||(v[5]=m=>l.defaultModel=m),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a.value?(x(),N("div",khe,O(a.value),1)):le("",!0),_("div",bhe,[re(Ft,{variant:"primary",size:"sm",onClick:f},{default:Ne(()=>[Xe(O(C(n)("providers.add")),1)]),_:1}),re(Ft,{variant:"secondary",size:"sm",onClick:d},{default:Ne(()=>[Xe(O(C(n)("common.cancel")),1)]),_:1})])])):(x(),N("div",ghe,[re(Ft,{variant:"secondary",size:"sm",onClick:v[0]||(v[0]=m=>s("openLogin","moonshot"))},{default:Ne(()=>[re(je,{name:"user",size:"sm"}),Xe(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),re(Ft,{variant:"secondary",size:"sm",onClick:v[1]||(v[1]=m=>s("openLogin","anthropic"))},{default:Ne(()=>[re(je,{name:"user",size:"sm"}),Xe(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),re(Ft,{variant:"primary",size:"sm",onClick:u},{default:Ne(()=>[re(je,{name:"plus",size:"sm"}),Xe(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),_("div",xhe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),_he=at(whe,[["__scopeId","data-v-cf73278e"]]),She={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Che={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Ahe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},hg=Ye({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(x(),N("svg",She,[...n[0]||(n[0]=[_("circle",{cx:"18",cy:"18",r:"15"},null,-1),_("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(x(),N("svg",Che,[...n[1]||(n[1]=[_("circle",{cx:"14",cy:"14",r:"12"},null,-1),_("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),_("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(x(),N("svg",Ahe,[...n[2]||(n[2]=[_("path",{d:"M14 3 L26 24 H2 Z"},null,-1),_("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),_("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),Mhe={key:0,class:"center-body"},Ehe={class:"center-text"},The={key:1,class:"nb"},Nhe={class:"nb-lead"},Ihe=["href"],Lhe={class:"nb-or"},$he={class:"nb-fallback"},Fhe={class:"nb-fb-text"},Ohe=["href"],Rhe={class:"nb-code-row"},Bhe={class:"nb-code"},Dhe={class:"nb-status"},Phe={class:"nb-status-text"},Hhe={class:"nb-countdown"},Whe={key:2,class:"center-body"},zhe={class:"center-text success-text"},Uhe={class:"center-hint"},qhe={class:"center-body"},jhe={class:"center-text err-text"},Vhe={class:"center-hint"},Khe={class:"actions"},Ghe={class:"center-body"},Yhe={class:"center-text warn-text"},Zhe={class:"center-hint"},Xhe={class:"actions"},Qhe=3,Jhe=Ye({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Mt(),o=Z(!0),s=t,i=e,r=Z("starting"),l=Z(!1),a=Z(null),c=Z(0),u=Z(!1);let d=null,f=null,h=0;cn(async()=>{await p()}),wn(()=>{v()});async function p(){v(),a.value=null,l.value=!1,h=0,r.value="starting";const $=await i.onStartOAuthLogin();if(!$){r.value="error";return}if($.status==="authenticated"){v(),r.value="success",setTimeout(()=>{s("success"),s("close")},800);return}a.value={flowId:$.flowId,verificationUri:$.verificationUri,verificationUriComplete:$.verificationUriComplete,userCode:$.userCode,expiresIn:$.expiresIn,interval:$.interval},c.value=$.expiresIn,r.value="device-code",g(),b($.interval)}function g(){f&&clearInterval(f),f=setInterval(()=>{c.value>0?c.value--:(f&&clearInterval(f),f=null)},1e3)}function b($){d&&clearTimeout(d),d=setTimeout(async()=>{const L=await i.onPollOAuthLogin();if(L===null){if(h+=1,h>=Qhe){v(),l.value=!0,r.value="error";return}b($);return}h=0,L.status==="authenticated"?(v(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):L.status==="expired"||L.status==="cancelled"?(v(),r.value="expired"):b($)},$*1e3)}function v(){d&&(clearTimeout(d),d=null),f&&(clearInterval(f),f=null)}async function m(){await p()}async function y(){!a.value||!await Ko(a.value.userCode)||(u.value=!0,setTimeout(()=>{u.value=!1},2e3))}async function k(){v(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function A($){const L=Math.floor($/60),w=$%60;return`${L}:${String(w).padStart(2,"0")}`}return($,L)=>(x(),be(Wr,{open:o.value,"onUpdate:open":L[0]||(L[0]=w=>o.value=w),title:C(n)("login.title"),"close-on-overlay":!1,onClose:k},{default:Ne(()=>[r.value==="starting"?(x(),N("div",Mhe,[re(Rs,{size:"md"}),_("span",Ehe,O(C(n)("login.starting")),1)])):r.value==="device-code"&&a.value?(x(),N("div",The,[_("div",Nhe,O(C(n)("login.lead")),1),_("a",{class:"nb-primary",href:a.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Xe(O(C(n)("login.authorizeInBrowser"))+" ",1),re(je,{name:"external-link",size:"sm"})],8,Ihe),_("div",Lhe,O(C(n)("login.orDivider")),1),_("div",$he,[_("div",Fhe,[Xe(O(C(n)("login.fallbackPrefix")),1),_("a",{class:"nb-fb-link",href:a.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(a.value.verificationUri),9,Ohe),Xe(O(C(n)("login.fallbackSuffix")),1)]),_("div",Rhe,[_("span",Bhe,O(a.value.userCode),1),re(Ft,{class:We(["nb-copy",{"is-copied":u.value}]),variant:"secondary",size:"sm",onClick:y},{default:Ne(()=>[u.value?(x(),N(Pe,{key:0},[re(je,{name:"check",size:"sm"}),Xe(" "+O(C(n)("login.copied")),1)],64)):(x(),N(Pe,{key:1},[re(je,{name:"copy",size:"sm"}),Xe(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),_("div",Dhe,[re(Rs,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),_("span",Phe,O(C(n)("login.waitingAutoClose")),1),_("span",Hhe,O(A(c.value)),1)])])):r.value==="success"?(x(),N("div",Whe,[re(hg,{kind:"success"}),_("span",zhe,O(C(n)("login.success")),1),_("span",Uhe,O(C(n)("login.successHint")),1)])):r.value==="expired"?(x(),N(Pe,{key:3},[_("div",qhe,[re(hg,{kind:"expired"}),_("span",jhe,O(C(n)("login.expiredTitle")),1),_("span",Vhe,O(C(n)("login.expiredHint")),1)]),_("div",Khe,[re(Ft,{variant:"primary",onClick:m},{default:Ne(()=>[Xe(O(C(n)("login.retry")),1)]),_:1}),re(Ft,{variant:"secondary",onClick:k},{default:Ne(()=>[Xe(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(x(),N(Pe,{key:4},[_("div",Ghe,[re(hg,{kind:"error"}),_("span",Yhe,O(l.value?C(n)("login.pollErrorTitle"):C(n)("login.errorTitle")),1),_("span",Zhe,O(l.value?C(n)("login.pollErrorHint"):C(n)("login.errorHint")),1)]),_("div",Xhe,[re(Ft,{variant:"primary",onClick:m},{default:Ne(()=>[Xe(O(C(n)("login.retry")),1)]),_:1}),re(Ft,{variant:"secondary",onClick:k},{default:Ne(()=>[Xe(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):le("",!0)]),_:1},8,["open","title"]))}}),epe=at(Jhe,[["__scopeId","data-v-8308a28f"]]);function tpe(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function npe(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function ope(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,activeRoot:s,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(o),a=new Map;for(const h of t)l.has(h.root)||a.has(h.root)||a.set(h.root,{...h});for(const h of n){const p=h.cwd;p&&(l.has(p)||a.has(p)||a.set(p,{id:h.workspaceId??p,root:p,name:tpe(p),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const h of n){const p=npe(t,h);c.set(p,(c.get(p)??0)+1)}const u=[...new Set(t.filter(h=>!l.has(h.root)).map(h=>h.root))],d=[...a.keys()].filter(h=>!u.includes(h));d.sort((h,p)=>h.localeCompare(p));const f=[];for(const h of[...u,...d]){const p=a.get(h),g=c.get(p.id)??c.get(p.root)??0,b=r[p.id]===!1?g:Math.max(p.sessionCount,g);let v=p.branch;!v&&i&&s===p.root&&(v=i),f.push({...p,sessionCount:b,branch:v})}return f}function spe(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const o=new Set(t.map(r=>r.id)),s=new Set(t.filter(r=>r.role==="user").map(r=>r.id)),i=e.filter(r=>{const l=Date.parse(r.createdAt);return!(Number.isNaN(l)||l>=n||o.has(r.id)||r.role==="user"&&r.promptId!==void 0&&s.has(r.promptId))});return i.length>0?[...i,...t]:t}function VC(e,t){const n=new Set(e.map(a=>a.id)),o=t.filter(a=>a.kind==="subagent"&&!n.has(a.id));if(o.length===0)return e;const s=new Map(e.map(a=>[a.id,a])),i=new Set,r=o.map(a=>{const c=a.backgroundTaskId!==void 0?s.get(a.backgroundTaskId):void 0;if(c===void 0)return a;i.add(c.id);const u=a.status==="running"&&c.status!=="running";return{...a,status:a.status==="running"?c.status:a.status,subagentPhase:u?c.status==="completed"?"completed":"failed":a.subagentPhase,completedAt:a.completedAt??c.completedAt,outputPreview:c.outputPreview??a.outputPreview,outputBytes:c.outputBytes??a.outputBytes}});return[...e.filter(a=>!i.has(a.id)),...r]}function ipe(e,t){if(e.length===0)return t;const n=new Map(t.map(r=>[r.id,r])),o=new Set(e.map(r=>r.id)),s=e.map(r=>{const l=n.get(r.id);return l?{...r,outputLines:l.outputLines,text:l.text}:r}),i=t.filter(r=>!o.has(r.id));return i.length===0?s:[...s,...i]}function rpe(e){const t=new Map,n=new Set;function o(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&o(i)});return t.set(i,l),l}function s(i){if(t.has(i)){n.add(i);return}o(i)}return{run:o,request:s}}const lpe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function ape(e){return lpe.has(e.type)}const cpe=50,upe=100,jv=32*1024,dpe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,cpe)},cancelTask(e){clearTimeout(e)}};function fpe(e,t,n={}){const o=n.scheduler??dpe,s=Math.max(1,Math.floor(n.maxItemsPerSlice??upe)),i=[];let r=0,l=null,a=null,c=0,u=!1;const d=()=>i.length-r,f=()=>{c+=1,l!==null&&(o.cancelFrame(l),l=null),a!==null&&(o.cancelTask(a),a=null)},h=()=>{r===i.length?(i.length=0,r=0):r>=1024&&(i.splice(0,r),r=0)};let p;const g=()=>{if(u||l!==null||a!==null||d()===0)return;const v=++c,m=()=>{v===c&&p()};l=o.requestFrame(m),a=o.requestTask(m)};p=()=>{f();let v=0;for(;!u&&v<s&&r<i.length;){const m=i[r++];e(m),v+=1}h(),g()};const b=(v=>{if(!u){if(t(v)){const m=i.length>r?i.at(-1):void 0,y=m===void 0?void 0:n.coalesce?.(m,v);y===void 0?i.push(v):i[i.length-1]=y,g();return}if(d()===0){e(v);return}i.push(v),p()}});return b.flush=()=>{if(!u){for(f();!u&&r<i.length;)e(i[r++]);h()}},b.discard=v=>{if(u||d()===0)return;let m=r;for(let y=r;y<i.length;y+=1){const k=i[y];v(k)||(i[m++]=k)}i.length=m,h(),d()===0?f():g()},b.dispose=()=>{u||(u=!0,f(),i.length=0,r=0)},b}function Vv(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function hpe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,o=Vv(t);if(n===void 0||o===void 0||n.kind!==o.kind||o.value.length<=jv)return[e];const s=[];let i=0;for(;i<o.value.length;){let r=Math.min(i+jv,o.value.length);r<o.value.length&&r>i&&/[\uD800-\uDBFF]/u.test(o.value[r-1])&&/[\uDC00-\uDFFF]/u.test(o.value[r])&&(r-=1);const l=o.value.slice(i,r);s.push({appEvent:{...t,delta:o.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+i}}}),i=r}return s}function ppe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,o=t.meta.stream,s=Vv(e.appEvent),i=Vv(t.appEvent);if(n===void 0||o===void 0||s===void 0||i===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==o.turnId||n.kind!==o.kind||s.kind!==i.kind||n.kind!==s.kind||o.kind!==i.kind||o.offset!==n.offset+s.value.length||s.value.length+i.value.length>jv)return;const r=s.value+i.value;return{appEvent:{...e.appEvent,delta:s.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}const F5=["blue","mono"],O5=["light","dark","system"],R5=14,mpe=12,gpe=20;function vpe(){const e=oo(Lt.accent);return e&&F5.includes(e)?e:"blue"}function ype(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function kpe(){const e=oo(Lt.colorScheme);return e&&O5.includes(e)?e:"system"}function bpe(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";o.setAttribute("content",n??i)})}function Wk(e){return Number.isFinite(e)?Math.min(gpe,Math.max(mpe,Math.round(e))):R5}function xpe(){const e=oo(Lt.uiFontSize);return e===null?R5:Wk(Number(e))}function wpe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Wk(e)}px`)}const zk=Z(kpe()),Uk=Z(vpe()),qk=Z(xpe());Qe(zk,bpe,{immediate:!0});Qe(Uk,ype,{immediate:!0});Qe(qk,wpe,{immediate:!0});function _pe(e){O5.includes(e)&&(zk.value=e,uo(Lt.colorScheme,e))}function Spe(e){F5.includes(e)&&(Uk.value=e,uo(Lt.accent,e))}function Cpe(e){const t=Wk(e);qk.value=t,uo(Lt.uiFontSize,String(t))}const Ape=600,Mpe=250,Um=250,Epe=1e3,Tpe=160,Op=Z(!1);let fa=[],ga=null,Rp=-Um;function Npe(){fa=[],Rp=-Um,Op.value=!1,ga!==null&&(clearTimeout(ga),ga=null)}function Ipe(){Op.value=!0,ga!==null&&clearTimeout(ga),ga=setTimeout(()=>{ga=null,fa=[],Rp=-Um,Op.value=!1},Epe)}function Lpe(e){if(e<=0)return;const t=Date.now();fa.push({time:t,chars:e});const n=t-Ape;if(fa=fa.filter(l=>l.time>=n),t-Rp<Um)return;Rp=t;const o=fa[0]?.time??t,s=Math.max(t-o,Mpe);fa.reduce((l,a)=>l+a.chars,0)/s*1e3>=Tpe&&Ipe()}function B5(){return{colorScheme:zk,accent:Uk,uiFontSize:qk,fastMoon:Op,setColorScheme:_pe,setAccent:Spe,setUiFontSize:Cpe,resetFastMoon:Npe,recordMoonDelta:Lpe}}function $pe(e,t,n){return e==="idle"&&!t&&!n}function jk(e,t){const n=oo(e);return n===null?t:n==="1"}const Vk=Z(jk(Lt.notifyOnComplete,!0)),Kk=Z(jk(Lt.notifyOnQuestion,!1)),Gk=Z(jk(Lt.notifyOnApproval,!1)),Yk=Z(typeof Notification<"u"?Notification.permission:"denied"),Fpe="/favicon.ico";async function Zk(e,t,n){if(!n){e.value=!1,uo(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}Yk.value=o,o==="granted"&&(e.value=!0,uo(t,"1"))}function Ope(e){return Zk(Vk,Lt.notifyOnComplete,e)}function Rpe(e){return Zk(Kk,Lt.notifyOnQuestion,e)}function Bpe(e){return Zk(Gk,Lt.notifyOnApproval,e)}function Xk(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function Dpe(e){return{title:An.global.t("settings.notifyTitle"),body:Xk(e,An.global.t("settings.notifyFallback"))}}function Ppe(e,t){return{title:An.global.t("settings.notifyQuestionTitle"),body:Xk(t,e,An.global.t("settings.notifyQuestionFallback"))}}function Hpe(e,t){return{title:An.global.t("settings.notifyApprovalTitle"),body:Xk(t,e,An.global.t("settings.notifyApprovalFallback"))}}function Qk(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{Yk.value=i,i==="granted"&&KC(t,n,o)});return}KC(t,n,o)}}function KC(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:Fpe});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function Wpe(e,t){Qk(Vk.value,t,Dpe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function zpe(e){Qk(Kk.value,e,Ppe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function Upe(e){Qk(Gk.value,e,Hpe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function qpe(){return{notifyOnComplete:Vk,notifyOnQuestion:Kk,notifyOnApproval:Gk,notifyPermission:Yk,setNotifyOnComplete:Ope,setNotifyOnQuestion:Rpe,setNotifyOnApproval:Bpe,maybeNotifyCompletion:Wpe,maybeNotifyQuestion:zpe,maybeNotifyApproval:Upe}}function jpe(){return oo(Lt.soundOnComplete)==="1"}const su=Z(jpe());function Vpe(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let pg=null;function D5(){const e=Vpe();if(!e)return null;if(pg===null)try{pg=new e}catch{return null}return pg}function P5(){if(!su.value)return;const e=D5();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Cr("sound: audio context resumed",{state:e.state})},t=>{Cr("sound: audio context resume rejected",{error:String(t)})})}let GC=!1;function Kpe(){if(GC||typeof window>"u")return;GC=!0;const e=()=>{P5()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}Kpe();function Gpe(e){su.value=e,uo(Lt.soundOnComplete,e?"1":"0"),e&&P5()}function YC(e,t,n,o,s){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(s,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+o),i.start(l),i.stop(l+o+.02)}function Jk(){const e=D5();if(e===null){Cr("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Cr("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Cr("sound: context resumed for next time",{state:e.state})},t=>{Cr("sound: resume rejected",{error:String(t)})});return}try{YC(e,880,0,.16,.18),YC(e,1320,.1,.22,.16),Cr("sound: chime scheduled",{state:e.state})}catch(t){Cr("sound: failed to play",{error:String(t)})}}function Ype(){su.value&&Jk()}function Zpe(){su.value&&Jk()}function Xpe(){su.value&&Jk()}function Qpe(){return{soundOnComplete:su,setSoundOnComplete:Gpe,maybePlayCompletionSound:Ype,maybePlayQuestionSound:Zpe,maybePlayApprovalSound:Xpe}}const Jpe=1e3,eme=4096,ZC=32*1024;function tme(e,t){let n=null,o;const s=new Set;async function i(f){try{const p=await ct().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:VC(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],g=ct(),b=new Map;if(await Promise.all(p.map(async m=>{if((m.status==="completed"||m.status==="failed"||m.status==="cancelled")&&!s.has(m.id)&&!((m.outputLines?.length??0)>0))try{const k=await g.getTask(f,m.id,{withOutput:!0,outputBytes:ZC});k.outputPreview!==void 0&&b.set(m.id,{preview:k.outputPreview,bytes:k.outputBytes}),s.add(m.id)}catch{}})),b.size===0)return;const v=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:v.map(m=>{const y=b.get(m.id)??(m.backgroundTaskId!==void 0?b.get(m.backgroundTaskId):void 0);return y?{...m,outputPreview:y.preview,outputBytes:y.bytes}:m})}}async function l(f){if(e.activeSessionId!==f)return;const h=ct();let p;try{p=await h.listTasks(f)}catch{return}const g=new Map;await Promise.all(p.map(async y=>{const k=y.status==="running",A=y.status==="completed"||y.status==="failed"||y.status==="cancelled";if(!(!k&&!A)&&!(A&&(s.has(y.id)||(y.outputLines?.length??0)>0)))try{const $=await h.getTask(f,y.id,{withOutput:!0,outputBytes:k?eme:ZC});$.outputPreview!==void 0&&g.set(y.id,{preview:$.outputPreview,bytes:$.outputBytes}),A&&s.add(y.id)}catch{}}));const b=e.tasksBySession[f]??[],v=new Map(b.map(y=>[y.id,y])),m=p.map(y=>{const k=v.get(y.id),A=g.get(y.id);return{...y,outputLines:k?.outputLines,text:k?.text,outputPreview:A?.preview??k?.outputPreview,outputBytes:A?.bytes??k?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:VC(m,b)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Jpe))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=Z(0);let d=null;return Qe(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Qe(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,g)=>{let b;h&&f!==void 0?a(f):f!==void 0?b=setTimeout(()=>{(e.tasksBySession[f]??[]).some(m=>m.status==="running")||c()},1500):c(),g(()=>{b!==void 0&&clearTimeout(b)})},{deep:!0,immediate:!0}),{taskClock:R(()=>u.value),loadTasksForSession:i}}function nme(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function ome(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
302
- `)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&nme(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:i});continue}if(!s||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const Kv="/sessions/";function XC(e){const{pathname:t}=e;if(!t.startsWith(Kv))return;const n=t.slice(Kv.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function sme(e){return e===void 0||e.length===0?"/":`${Kv}${encodeURIComponent(e)}`}const ime=50,Gv=5,rme=40402,lme=40410,ame=40902,cme=2e3;function mg(e){return nr(e)&&e.code===ame}const ume=40904;function dme(e){return nr(e)&&e.code===ume}const ia=Oo({}),lh=Oo({}),gg=Oo({}),Vi=Oo(new Set),qm=new Map,Ea=new Map,Bp=new Map;let fme=0;function hme(e){return{generation:qm.get(e)??0,pending:(Ea.get(e)?.size??0)>0}}function Yv(e){const t=++fme;qm.set(e,t);const n=Ea.get(e)??new Set;return n.add(t),Ea.set(e,n),t}function Zv(e,t){const n=Ea.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Ea.delete(e);const o=Bp.get(e);Bp.delete(e),o?.()}function pme(e){qm.delete(e),Ea.delete(e),Bp.delete(e)}function mme(e,t){return!t.pending&&t.generation===(qm.get(e)??0)}function gme(e,t){if((Ea.get(e)?.size??0)===0){t();return}Bp.set(e,t)}function vme(e,t){const{t:n}=An.global,{confirm:o}=Yd(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:p,setActiveSessionId:g,updateSessionMessages:b,nextOptimisticMsgId:v,getEventConn:m,syncSessionFromSnapshot:y,reopenSession:k,hasLoadedMessages:A,refreshSessionStatus:$,refreshSessionGoal:L,persistSessionProfile:w,mergedWorkspaces:E,workspacesView:T,status:F,workspaceIdForSession:S,savePermissionToStorage:I,savePlanModeToStorage:P,saveSwarmModeToStorage:B,saveGoalModeToStorage:W,draftModes:z,saveUnread:D,saveActiveWorkspaceToStorage:q,saveHiddenWorkspacesToStorage:j,goalErrorMessage:ie,resetFastMoon:ue,initialized:pe,connectIssue:ee,selectedDiffPath:ne,fileDiffLines:fe,fileDiffLoading:Me}=t;let $e=!1;async function ae(X){if(e.messagesLoadingMoreBySession[X])return;const xe=e.messagesBySession[X];if(!xe||xe.length===0)return;const Ae=xe[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[X]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[X]:!1};try{const Oe=await ct().listMessages(X,{beforeId:Ae,pageSize:ime}),Ge=[...Oe.items].reverse();b(X,ot=>[...Ge,...ot]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[X]:Oe.hasMore}}catch(Oe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[X]:!0},l("loadOlderMessages",Oe,{sessionId:X})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[X]:!1}}}function U(X){s.loadTasksForSession(X),V(X),$(X),L(X),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,X)||r.loadSkillsForSession(X)}async function ce(X){const xe=e.activeSessionId;if(xe){ne.value=X,fe.value=[],Me.value=!0;try{const Oe=await ct().getFileDiff(xe,X);if(ne.value!==X)return;fe.value=ome(Oe.diff)}catch(Ae){ne.value===X&&(fe.value=[]),console.warn("[loadFileDiff] diff unavailable for",X,Ae)}finally{ne.value===X&&(Me.value=!1)}}}function se(){ne.value=null,fe.value=[],Me.value=!1}async function V(X){try{const Ae=await ct().getGitStatus(X);e.gitStatusBySession={...e.gitStatusBySession,[X]:Ae}}catch{}}async function Q(){try{const xe=await ct().getAuth();return e.authReady=xe.ready,e.defaultModel=xe.defaultModel,e.managedProviderStatus=xe.managedProvider?.status??null,ee.value=null,"proceed"}catch(X){return nr(X)&&(X.code===401||X.code===g5)?(ee.value=null,"server-auth-required"):(ee.value=(X instanceof Error?X.message:String(X)).slice(0,140),"retry")}}async function ke(){let X=!0;for(;;){const xe=await Q();if(xe!=="retry")return xe;X&&(ee.value=null,X=!1),await new Promise(Ae=>{setTimeout(Ae,cme)})}}async function he(){try{const X=ct();e.config=await X.getConfig()}catch{}}async function ye(X){try{const Ae=await ct().setConfig(X);return e.config=Ae,e.defaultModel=Ae.defaultModel??null,!0}catch(xe){return l("setConfig",xe),!1}}const K=100,J=30,me=720*60*1e3;async function Ee(){const X=ct(),xe=[];let Ae,Oe;for(;;){let Ge;try{Ge=await X.listSessions({pageSize:K,beforeId:Ae,excludeEmpty:!0})}catch(ot){if(xe.length===0)throw ot;Oe=ot;break}if(xe.push(...Ge.items),!Ge.hasMore||Ge.items.length===0)break;Ae=Ge.items[Ge.items.length-1].id}return{sessions:xe,error:Oe}}function Fe(X){const xe=new Map(e.sessions.map(Ae=>[Ae.id,Ae.usage]));u(X.map(Ae=>{const Oe=xe.get(Ae.id);return Oe!==void 0&&Ov(Ae.usage)&&!Ov(Oe)?{...Ae,usage:Oe}:Ae}))}function De(X){const xe=[...X],Ae=new Set(xe.map(Oe=>Oe.id));for(const Oe of e.sessions)Ae.has(Oe.id)||(xe.push(Oe),Ae.add(Oe.id));return xe.sort((Oe,Ge)=>new Date(Ge.updatedAt).getTime()-new Date(Oe.updatedAt).getTime()),xe}async function ge(X){const xe=ct(),Ae=[],Oe=Date.now(),Ge=Qt=>Oe-new Date(Qt.updatedAt).getTime();let ot,Et=!1,Xt=!0,Vt;for(;;){let Qt;try{Qt=await xe.listSessions({workspaceId:X,pageSize:Gv,beforeId:ot,excludeEmpty:!0})}catch(ht){if(Xt)throw ht;Vt=ht,Et=!0;break}if(Et=Qt.hasMore,Qt.items.length===0)break;const Do=Qt.items[Qt.items.length-1],Io=Ge(Do)>=me;if(!Xt&&Io){const ht=Qt.items.findIndex(Jt=>Ge(Jt)>=me),zt=ht>=0?ht+1:Qt.items.length;Ae.push(...Qt.items.slice(0,zt)),Et=Qt.hasMore||zt<Qt.items.length;break}if(Ae.push(...Qt.items),Xt=!1,!Qt.hasMore||Io)break;ot=Do.id}return{workspaceId:X,page:{items:Ae,hasMore:Et},error:Vt}}async function Ie(){const X=e.workspaces;if(X.length===0){const ht=await Ee(),zt=ht.error===void 0?ht.sessions:De(ht.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=ht.error===void 0,ht.error!==void 0&&l("load",ht.error),zt}const xe=await Promise.allSettled(X.map(ht=>ge(ht.id))),Ae=[],Oe=new Set,Ge=new Map,ot=new Set;let Et;for(let ht=0;ht<xe.length;ht++){const zt=xe[ht];if(zt.status==="fulfilled"){Ge.set(zt.value.workspaceId,zt.value.page),zt.value.error!==void 0&&(ot.size===0&&(Et=zt.value.error),ot.add(zt.value.workspaceId));for(const Jt of zt.value.page.items)Oe.has(Jt.id)||(Ae.push(Jt),Oe.add(Jt.id));continue}ot.size===0&&(Et=zt.reason),ot.add(X[ht].id)}if(Ge.size===0){l("load",Et);return}const Xt=new Set(X.filter(ht=>ot.has(ht.id)).map(ht=>ht.root)),Vt=new Set(X.map(ht=>ht.id));for(const ht of e.sessions)!(ht.workspaceId!==void 0&&Vt.has(ht.workspaceId)?ot.has(ht.workspaceId):Xt.has(ht.cwd)||ot.has(S(ht)))||Oe.has(ht.id)||(Ae.push(ht),Oe.add(ht.id));const Qt={},Do={},Io={};for(const{id:ht}of X){const zt=Ge.get(ht);if(zt===void 0){const Jt=e.sessionsHasMoreByWorkspace[ht],Ao=e.sessionsCursorByWorkspace[ht],Jn=e.sessionsInitialCountByWorkspace[ht];Jt!==void 0&&(Qt[ht]=Jt),Ao!==void 0&&(Do[ht]=Ao),Jn!==void 0&&(Io[ht]=Jn);continue}Qt[ht]=zt.hasMore,Do[ht]=zt.items.length>0?zt.items[zt.items.length-1].id:void 0,Io[ht]=Math.max(zt.items.length,Gv)}return e.sessionsHasMoreByWorkspace=Qt,e.sessionsCursorByWorkspace=Do,e.sessionsInitialCountByWorkspace=Io,e.sessionsFullyLoaded=!1,Ae.sort((ht,zt)=>new Date(zt.updatedAt).getTime()-new Date(ht.updatedAt).getTime()),ot.size>0&&l("load",Et),Ae}async function Je(X){if(e.sessionsLoadingMoreByWorkspace[X]||e.sessionsHasMoreByWorkspace[X]===!1)return;const xe=e.sessionsCursorByWorkspace[X];if(xe!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[X]:!0};try{const Ae=await ct().listSessions({workspaceId:X,pageSize:J,beforeId:xe,excludeEmpty:!0}),Oe=new Set(e.sessions.map(ot=>ot.id)),Ge=Ae.items.filter(ot=>!Oe.has(ot.id));Ge.length>0&&u([...e.sessions,...Ge]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[X]:Ae.items.length>0?Ae.items[Ae.items.length-1].id:xe},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[X]:Ae.hasMore}}catch(Ae){l("loadMoreSessions",Ae)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[X]:!1}}}}async function it(){if(e.sessionsFullyLoaded)return;const X=await Ee().catch(Oe=>(console.warn("[kimi-web] loadAllSessions failed; search covers only loaded sessions",Oe),null));if(X===null)return;const xe=X.error===void 0?X.sessions:De(X.sessions);if(Fe(xe),e.sessionsFullyLoaded=X.error===void 0,X.error!==void 0)return;const Ae={};for(const Oe of e.workspaces)Ae[Oe.id]=!1;e.sessionsHasMoreByWorkspace=Ae}async function St(){const X=await ct().getMeta().catch(()=>null);X!==null&&(e.serverVersion=X.serverVersion,e.availableOpenInApps=X.openInApps,e.dangerousBypassAuth=X.dangerousBypassAuth,e.backend=X.backend)}async function gt(){const X=Date.now();let xe="accepted";vo("app:load:start"),e.loading=!0;const Ae=!pe.value;let Oe=!0;try{if(Ae&&await ke()==="server-auth-required"){Oe=!1,xe="auth-required";return}const Ge=ct();await Promise.all([Ge.getHealth().catch(()=>null),St(),r.loadModels()]),Ae||await Q(),await he(),await Tt();const ot=await Ie(),Et=ot??e.sessions;ot!==void 0&&Fe(ot);const Xt=Et[0],Vt=e.activeWorkspaceId;!(Vt!==null&&E.value.some(Io=>Io.id===Vt))&&Xt&&ft(S(Xt)),_n();const Do=typeof window<"u"?XC(window.location):void 0;!e.activeSessionId&&Do!==void 0&&(e.sessions.some(ht=>ht.id===Do)||await _o(Do))&&await un(Do,{urlMode:"replace"}),!e.activeSessionId&&Et.length>0&&await un(Et[0].id,{urlMode:"replace"})}catch(Ge){xe="failed",l("load",Ge)}finally{e.loading=!1,Oe&&(pe.value=!0),vo("app:load:complete",{status:xe,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-X})}}async function Tt(){try{const X=ct(),[xe,Ae]=await Promise.all([X.listWorkspaces().catch(()=>[]),X.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Pt(xe),e.fsHome=Ae.home||null,e.recentRoots=Ae.recentRoots}catch{}}function Pt(X){const xe=Rf();return Object.keys(xe).length===0?X:X.map(Ae=>{const Oe=xe[Ae.root];return Oe!==void 0?{...Ae,name:Oe}:Ae})}function ft(X){e.activeWorkspaceId=X,q(X)}function gn(X){ft(X);const xe=e.sessions.filter(Ae=>S(Ae)===X);if(xe.length>0){const Ae=xe[0];Ae&&Ae.id!==e.activeSessionId&&un(Ae.id)}else g(void 0),Un(void 0,"push")}function sn(X){const xe=Rf()[X.root],Ae=xe!==void 0?{...X,name:xe}:X;e.hiddenWorkspaceRoots.includes(Ae.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(ot=>ot!==Ae.root),j(e.hiddenWorkspaceRoots));const Oe=e.workspaces.findIndex(ot=>ot.id===Ae.id||ot.root===Ae.root);if(Oe===-1){e.workspaces=[Ae,...e.workspaces];return}const Ge=[...e.workspaces];Ge[Oe]=Ae,e.workspaces=Ge}function Yo(X){if(X.type==="workspaceCreated"||X.type==="workspaceUpdated"){sn(X.workspace);return}const xe=e.workspaces.find(Oe=>Oe.id===X.workspaceId)?.root??X.root;if(xe&&!e.hiddenWorkspaceRoots.includes(xe)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,xe],j(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Oe=>Oe.id!==X.workspaceId&&Oe.root!==xe),e.activeWorkspaceId===X.workspaceId||e.activeWorkspaceId===xe){const Oe=T.value[0]?.id??null;if(e.activeWorkspaceId=Oe,Oe)q(Oe);else try{Kc(Lt.activeWorkspace)}catch{}g(void 0),e.sessionLoading=!1,se(),Un(void 0,"replace")}}function jt(){g(void 0),Un(void 0,"push")}function vn(X){ft(X),jt(),se()}async function fo(X){const xe=E.value.find(Qt=>Qt.id===X);if(!xe)return null;const Ae=ct();let Oe,Ge=xe.root;try{const Qt=await Ae.addWorkspace({root:xe.root});Oe=Qt.id,Ge=Qt.root,sn(Qt)}catch{}const ot=r.draftModel.value??void 0,Et=await Ae.createSession({workspaceId:Oe,cwd:Ge,model:ot});r.draftModel.value=null;const Xt=ot!==void 0&&(!Et.model||Et.model.length===0)?{...Et,model:ot}:Et;f(Xt),ft(Et.workspaceId??Oe??X),await un(Et.id);const Vt=Et.id;return z.planMode&&(e.planModeBySession={...e.planModeBySession,[Vt]:!0},P()),z.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Vt]:!0},B()),z.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Vt]:!0},W()),z.planMode=!1,z.swarmMode=!1,z.goalMode=!1,Vt}async function st(X,xe,Ae){if(!Vi.has(X)){Vi.add(X);try{const Oe=await fo(X);if(!Oe)return;await Sn(Oe,xe,Ae)}catch(Oe){l("startSessionAndSendPrompt",Oe)}finally{Vi.delete(X)}}}async function On(X,xe,Ae){if(!Vi.has(X)){Vi.add(X);try{const Oe=await fo(X);if(!Oe)return;const Ge=e.planModeBySession[Oe]??!1,ot=e.swarmModeBySession[Oe]??!1,Et=e.sessions.find(Vt=>Vt.id===Oe),Xt=(Et?.model&&Et.model.length>0?Et.model:e.defaultModel)??void 0;await w({model:Xt,planMode:Ge,swarmMode:ot,permissionMode:e.permission,thinking:e.thinking},Oe),await r.activateSkill(xe,Ae,Oe)}catch(Oe){l("startSessionAndActivateSkill",Oe)}finally{Vi.delete(X)}}}async function so(X,xe){if(!Vi.has(X)){Vi.add(X);try{const Ae=await fo(X);if(!Ae)return;await i.openSideChatOn(Ae,xe)}catch(Ae){l("startSessionAndOpenSideChat",Ae)}finally{Vi.delete(X)}}}async function io(X){const xe=X.trim();if(!xe)return!1;const Ae=ct();try{const Oe=await Ae.addWorkspace({root:xe});return sn(Oe),vn(Oe.id),!0}catch(Oe){return console.warn("[kimi-web] addWorkspaceByPath failed for",xe,Oe),!1}}async function ro(X){try{return await ct().browseFs(X)}catch{return{path:"",parent:null,entries:[]}}}async function Zo(){try{return await ct().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Un(X,xe){if(xe==="none"||typeof window>"u"||!window.history)return;const Ae=sme(X);if(window.location.pathname!==Ae)try{xe==="push"?window.history.pushState(null,"",Ae):window.history.replaceState(null,"",Ae)}catch{}}async function _o(X){try{const xe=await ct().getSession(X);return e.sessions.some(Ae=>Ae.id===xe.id)||h(xe),!0}catch{return!1}}function yn(){const X=XC(window.location);if(X===void 0){g(void 0);return}if(X!==e.activeSessionId){if(e.sessions.some(xe=>xe.id===X)){un(X,{urlMode:"none"});return}(async()=>{if(await _o(X)){await un(X,{urlMode:"none"});return}const xe=e.sessions[0];xe?await un(xe.id,{urlMode:"replace"}):(g(void 0),Un(void 0,"replace"))})()}}let Xn=!1;function _n(){Xn||typeof window>"u"||(Xn=!0,window.addEventListener("popstate",yn))}async function un(X,xe){const Ae=A(X),Oe=!Ae&&c.has(X);c.delete(X);try{Un(X,xe?.urlMode??"push"),e.sessionLoading=!Ae&&!Oe,g(X),ue(),e.unreadBySession[X]&&(e.unreadBySession={...e.unreadBySession,[X]:!1},D({[X]:!1})),se();const Ge=e.sessions.find(ot=>ot.id===X);if(Ge){const ot=S(Ge);e.activeWorkspaceId!==ot&&ft(ot)}if(Ae){if(await k(X)==="not-found")return}else if(await y(X)==="not-found")return;U(X)}catch(Ge){l("selectSession",Ge,{sessionId:X})}finally{e.activeSessionId===X&&(e.sessionLoading=!1)}}async function Sn(X,xe,Ae){const Oe=Yv(X);e.inFlightBySession={...e.inFlightBySession,[X]:!0};const Ge=v();try{const ot=ct(),Et=[];xe&&Et.push({type:"text",text:xe});for(const Jt of Ae??[])Jt.kind==="video"?Et.push({type:"video",source:{kind:"file",fileId:Jt.fileId}}):Jt.kind==="file"?Et.push({type:"file",fileId:Jt.fileId,name:Jt.name??"",mediaType:Jt.mediaType||"application/octet-stream",size:Jt.size??0}):Et.push({type:"image",source:{kind:"file",fileId:Jt.fileId}});if(Et.length===0)return e.inFlightBySession={...e.inFlightBySession,[X]:!1},!1;const Xt={id:Ge,sessionId:X,role:"user",content:Et,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(X,Jt=>[...Jt,Xt]);const Vt=e.sessions.find(Jt=>Jt.id===X),Qt=(Vt?.model&&Vt.model.length>0?Vt.model:e.defaultModel)??void 0,Do=e.planModeBySession[X]??!1,Io=e.swarmModeBySession[X]??!1,ht=e.goalModeBySession[X]??!1;if(ht&&xe)try{await ot.updateSession(X,{goalObjective:xe.trim()})}catch(Jt){return l("createGoal",Jt,{sessionId:X}),e.inFlightBySession={...e.inFlightBySession,[X]:!1},b(X,Ao=>Ao.some(Jn=>Jn.id===Ge)?Ao.filter(Jn=>Jn.id!==Ge):Ao),!1}const zt=await ot.submitPrompt(X,{content:Et,model:Qt,thinking:e.thinking,permissionMode:e.permission,planMode:Do,swarmMode:Io});return ht&&(e.goalModeBySession={...e.goalModeBySession,[X]:!1},W()),e.promptIdBySession={...e.promptIdBySession,[X]:zt.promptId},b(X,Jt=>{const Ao=Jt.findIndex(Ai=>Ai.id===Ge);if(Ao===-1)return Jt;const Jn=[...Jt];return Jn[Ao]={...Jn[Ao],promptId:Jn[Ao].promptId??zt.promptId},Jn}),m()?.bindNextPromptId(X,zt.promptId),!0}catch(ot){return e.inFlightBySession={...e.inFlightBySession,[X]:!1},b(X,Et=>Et.some(Xt=>Xt.id===Ge)?Et.filter(Xt=>Xt.id!==Ge):Et),l("sendPrompt",ot,{sessionId:X}),!1}finally{Zv(X,Oe)}}async function Ro(X,xe){const Ae=e.activeSessionId;if(Ae){if(a.value!=="idle"||e.inFlightBySession[Ae]){kt(X,xe);return}await Sn(Ae,X,xe)}}async function ze(X,xe){const Ae=e.activeSessionId;if(!Ae)return;const Oe=e.queuedBySession[Ae]??[],Ge=[],ot=[];for(const ht of Oe){const zt=ht.text.trim();zt&&Ge.push(zt),ht.attachments?.length&&ot.push(...ht.attachments)}const Et=X.trim();if(Et&&Ge.push(Et),xe?.length&&ot.push(...xe),Ge.length===0&&ot.length===0)return;Oe.length>0&&(e.queuedBySession={...e.queuedBySession,[Ae]:[]});const Xt=Ge.join(`
303
-
304
- `);if(a.value==="idle"&&!e.inFlightBySession[Ae]){await Sn(Ae,Xt,ot);return}const Vt=[];Xt&&Vt.push({type:"text",text:Xt});for(const ht of ot)ht.kind==="video"?Vt.push({type:"video",source:{kind:"file",fileId:ht.fileId}}):ht.kind==="file"?Vt.push({type:"file",fileId:ht.fileId,name:ht.name??"",mediaType:ht.mediaType||"application/octet-stream",size:ht.size??0}):Vt.push({type:"image",source:{kind:"file",fileId:ht.fileId}});const Qt=v(),Do={id:Qt,sessionId:Ae,role:"user",content:Vt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(Ae,ht=>[...ht,Do]);const Io=Yv(Ae);try{const ht=ct(),zt=e.sessions.find(Jn=>Jn.id===Ae),Jt=(zt?.model&&zt.model.length>0?zt.model:e.defaultModel)??void 0,Ao=await ht.submitPrompt(Ae,{content:Vt,model:Jt,thinking:e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[Ae]??!1,swarmMode:e.swarmModeBySession[Ae]??!1});if(b(Ae,Jn=>{const Ai=Jn.findIndex(ef=>ef.id===Qt);if(Ai===-1)return Jn;const Hl=[...Jn];return Hl[Ai]={...Hl[Ai],promptId:Hl[Ai].promptId??Ao.promptId},Hl}),Ao.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Ae]:Ao.promptId},m()?.bindNextPromptId(Ae,Ao.promptId);return}try{await ht.steerPrompts(Ae,[Ao.promptId])}catch{}}catch(ht){b(Ae,zt=>zt.filter(Jt=>Jt.id!==Qt)),l("steer",ht,{sessionId:Ae})}finally{Zv(Ae,Io)}}async function Ze(X,xe){try{const Oe=await ct().uploadFile({file:X,name:xe});return{fileId:Oe.id,name:Oe.name,mediaType:Oe.mediaType}}catch(Ae){return l("uploadImage",Ae),null}}function kt(X,xe){const Ae=e.activeSessionId;if(!Ae)return;const Oe=e.queuedBySession[Ae]??[];e.queuedBySession={...e.queuedBySession,[Ae]:[...Oe,{text:X,attachments:xe}]}}function Bt(X){const xe=e.inFlightBySession[X]===!0;if(e.inFlightBySession={...e.inFlightBySession,[X]:!1},e.promptIdBySession[X]!==void 0){const Oe={...e.promptIdBySession};delete Oe[X],e.promptIdBySession=Oe}X===e.activeSessionId&&ue();const Ae=e.queuedBySession[X]??[];if(Ae.length>0){const[Oe,...Ge]=Ae;e.queuedBySession={...e.queuedBySession,[X]:Ge},Oe!==void 0&&Sn(X,Oe.text,Oe.attachments).then(ot=>{if(!ot){const Et=e.queuedBySession[X]??[];e.queuedBySession={...e.queuedBySession,[X]:[Oe,...Et]}}})}return xe}function Rn(X,xe){xe.inFlightTurn!==null&&xe.busy||Bt(X)}async function Cn(){const X=e.activeSessionId;if(!X)return;const xe=e.sessions.find(Ge=>Ge.id===X);let Ae=e.promptIdBySession[X];if(Ae===void 0){const Ge=xe?.currentPromptId;Ge!==void 0&&Ge.length>0&&!Ge.startsWith("pr_")&&(Ae=Ge)}const Oe=ct();if(Ae!==void 0)try{if((await Oe.abortPrompt(X,Ae)).aborted)return;const ot={...e.promptIdBySession};delete ot[X],e.promptIdBySession=ot}catch(Ge){if(nr(Ge)&&Ge.code===rme){const ot={...e.promptIdBySession};delete ot[X],e.promptIdBySession=ot}else{l("abortCurrentPrompt",Ge,{sessionId:X});return}}try{await Oe.abortSession(X)}catch(Ge){l("abortCurrentPrompt",Ge,{sessionId:X})}}function Wt(X,xe){const Ae=e.approvalsBySession[X]??[];e.approvalsBySession={...e.approvalsBySession,[X]:Ae.filter(Oe=>Oe.approvalId!==xe)}}function kn(X,xe){const Ae=e.questionsBySession[X]??[];e.questionsBySession={...e.questionsBySession,[X]:Ae.filter(Oe=>Oe.questionId!==xe)}}async function Qn(X,xe){const Ae=e.activeSessionId;if(Ae&&!lh[X]){lh[X]=!0;try{const Oe=ct(),Ge={decision:xe.decision,scope:xe.scope,feedback:xe.feedback,selectedLabel:xe.selectedLabel};await Oe.respondApproval(Ae,X,Ge),Wt(Ae,X)}catch(Oe){mg(Oe)?Wt(Ae,X):l("respondApproval",Oe,{sessionId:Ae})}finally{delete lh[X]}}}async function wt(X,xe){const Ae=e.activeSessionId;if(Ae&&!ia[X]){ia[X]="answer";try{await ct().respondQuestion(Ae,X,xe),kn(Ae,X)}catch(Oe){mg(Oe)?kn(Ae,X):l("respondQuestion",Oe,{sessionId:Ae})}finally{delete ia[X]}}}async function Xo(X){const xe=e.activeSessionId;if(xe&&!ia[X]){ia[X]="dismiss";try{await ct().dismissQuestion(xe,X),kn(xe,X)}catch(Ae){mg(Ae)?kn(xe,X):l("dismissQuestion",Ae,{sessionId:xe})}finally{delete ia[X]}}}async function So(X){const xe=e.activeSessionId;if(xe&&!gg[X]){gg[X]=!0;try{const Ae=ct(),Oe=(e.tasksBySession[xe]??[]).find(ot=>ot.id===X)?.backgroundTaskId;await Ae.cancelTask(xe,Oe??X);const Ge=e.tasksBySession[xe]??[];e.tasksBySession={...e.tasksBySession,[xe]:Ge.map(ot=>ot.id===X?{...ot,status:"cancelled"}:ot)}}catch(Ae){dme(Ae)||l("cancelTask",Ae,{sessionId:xe})}finally{delete gg[X]}}}function Qo(X){const xe=e.activeSessionId;xe?(e.planModeBySession={...e.planModeBySession,[xe]:X},P(),w({planMode:X})):z.planMode=X}function Bn(){const X=e.activeSessionId,xe=X?e.planModeBySession[X]??!1:z.planMode;Qo(!xe)}function Dn(X){const xe=e.activeSessionId;xe?(e.swarmModeBySession={...e.swarmModeBySession,[xe]:X},B(),w({swarmMode:X})):z.swarmMode=X}async function ni(){const X=e.activeSessionId,Ae=!(X?e.swarmModeBySession[X]??!1:z.swarmMode);Ae&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||Dn(Ae)}function Bs(X){const xe=e.activeSessionId;xe?(e.goalModeBySession={...e.goalModeBySession,[xe]:X},W()):z.goalMode=X}function _i(){const X=e.activeSessionId,xe=X?e.goalModeBySession[X]??!1:z.goalMode;Bs(!xe)}async function ho(X){const xe=X.trim();if(!xe||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:xe}),variant:"primary"}))return;let Ae=e.activeSessionId;if(!Ae){const Oe=e.activeWorkspaceId,Ge=Oe&&T.value.some(ot=>ot.id===Oe)?Oe:T.value[0]?.id??null;if(!Ge)return;try{Ae=await fo(Ge)??void 0}catch(ot){l("createGoal",ot);return}if(!Ae)return}try{await ct().updateSession(Ae,{goalObjective:xe})}catch(Oe){l("createGoal",Oe,{sessionId:Ae,message:ie(Oe)});return}e.goalModeBySession[Ae]&&(e.goalModeBySession={...e.goalModeBySession,[Ae]:!1},W()),e.activeSessionId===Ae?await Ro(xe):await Sn(Ae,xe)}function Pi(X){const xe=e.activeSessionId;xe&&Promise.resolve(ct().updateSession(xe,{goalControl:X})).catch(Ae=>{l("controlGoal",Ae,{sessionId:xe,message:ie(Ae)})})}function Si(X){e.permission=X,I(X),w({permissionMode:X})}function po(X){const xe=[...e.warnings];xe.splice(X,1),e.warnings=xe}async function Ds(X,xe){try{await ct().updateSession(X,{title:xe}),d(X,Oe=>({...Oe,title:xe}))}catch(Ae){l("renameSession",Ae,{sessionId:X})}}async function ir(X,xe){const Ae=e.workspaces.find(Ge=>Ge.id===X)?.root,Oe=()=>{e.workspaces=e.workspaces.map(Ge=>Ge.id===X?{...Ge,name:xe}:Ge)};try{if(await ct().updateWorkspace(X,{name:xe}),Ae!==void 0){const Ge=Rf();Ae in Ge&&(delete Ge[Ae],Xx(Ge))}Oe()}catch(Ge){if(Ae!==void 0&&nr(Ge)&&Ge.code===lme){Xx({...Rf(),[Ae]:xe}),Oe();return}l("renameWorkspace",Ge)}}async function Ci(X){const xe=e.workspaces.find(ot=>ot.id===X)?.root??E.value.find(ot=>ot.id===X)?.root??X,Ae=e.activeSessionId?e.sessions.find(ot=>ot.id===e.activeSessionId):void 0,Oe=e.activeWorkspaceId===X||e.activeWorkspaceId===xe,Ge=!!(Ae&&(Ae.cwd===xe||Ae.workspaceId===X||S(Ae)===X));xe&&!e.hiddenWorkspaceRoots.includes(xe)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,xe],j(e.hiddenWorkspaceRoots));try{await ct().deleteWorkspace(X)}catch(ot){console.warn("[kimi-web] deleteWorkspace registry cleanup failed for",X,ot)}if(e.workspaces=e.workspaces.filter(ot=>ot.id!==X&&ot.root!==xe),Oe||Ge){const ot=T.value[0]?.id??null;if(e.activeWorkspaceId=ot,ot)q(ot);else try{Kc(Lt.activeWorkspace)}catch{}}(Oe||Ge)&&(g(void 0),e.sessionLoading=!1,se(),Un(void 0,"replace"))}async function lo(X){try{await ct().archiveSession(X),p(X),i.clearSideChatForSession(X);const{[X]:Ae,...Oe}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Oe,e.activeSessionId===X){const Ge=e.sessions[0];Ge?await un(Ge.id,{urlMode:"replace"}):(g(void 0),Un(void 0,"replace"))}}catch(xe){l("archiveSession",xe,{sessionId:X})}}async function Jo(X){if($e)return;const xe=X??e.activeSessionId;if(!xe){const Oe=n("commands.export.noSession");vo("export:failed",{status:"no-session"}),l("exportSession",new Error(Oe),{message:Oe});return}$e=!0;const Ae=Date.now();vo("export:start",{sessionId:xe});try{const Oe=Vte(),{blob:Ge,fileName:ot}=await ct().exportSession(xe,Oe);if(typeof document>"u")throw new Error("Document is unavailable");const Et=URL.createObjectURL(Ge);let Xt;try{Xt=document.createElement("a"),Xt.href=Et,Xt.download=ot,document.body.append(Xt),Xt.click()}finally{Xt?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(Et)}catch{}},0)}vo("export:accepted",{sessionId:xe,status:"accepted",zipBytes:Ge.size,durationMs:Date.now()-Ae})}catch(Oe){const Ge=typeof Oe=="object"&&Oe!==null?Oe:void 0;vo("export:failed",{sessionId:xe,status:"failed",durationMs:Date.now()-Ae,errorName:typeof Ge?.name=="string"?Ge.name:typeof Oe,errorCode:typeof Ge?.code=="number"?Ge.code:void 0,requestId:typeof Ge?.requestId=="string"?Ge.requestId:void 0,phase:typeof Ge?.phase=="string"?Ge.phase:void 0,httpStatus:typeof Ge?.status=="number"?Ge.status:void 0}),l("exportSession",Oe,{sessionId:xe})}finally{$e=!1}}async function oi(X){try{const xe=await ct().restoreSession(X);return f(xe),!0}catch(xe){return l("restoreSession",xe,{sessionId:X}),!1}}function Co(X){return ct().listSessions({archivedOnly:!0,beforeId:X?.beforeId,pageSize:X?.pageSize??50})}async function Ps(){try{await ct().logout(),await Q(),await gt()}catch(X){l("logout",X)}}function qn(X){const xe=e.activeSessionId;xe&&ct().compactSession(xe,X).catch(Ae=>{l("compact",Ae,{sessionId:xe})})}async function Bo(X){const xe=X??e.activeSessionId;if(xe)try{const Ae=await ct().forkSession(xe);f(Ae),await un(Ae.id)}catch(Ae){l("fork",Ae,{sessionId:xe})}}async function Hs(X=1){const xe=e.activeSessionId;if(!xe)return null;const Ae=(()=>{const Oe=e.messagesBySession[xe]??[];for(let Ge=Oe.length-1;Ge>=0;Ge--){const ot=Oe[Ge];if(ot.role==="user"&&!(ot.metadata?.origin&&ot.metadata.origin.kind!=="user"))return ot.content.filter(Et=>Et.type==="text").map(Et=>Et.text).join(`
305
- `)}return null})();try{return await ct().undoSession(xe,X),await y(xe),Ae}catch(Oe){return l("undo",Oe,{sessionId:xe}),null}}function es(X){const xe=e.activeSessionId;if(!xe)return;const Ae=e.queuedBySession[xe]??[];if(X<0||X>=Ae.length)return;const Oe=[...Ae];Oe.splice(X,1),e.queuedBySession={...e.queuedBySession,[xe]:Oe}}function Ce(X,xe){const Ae=e.activeSessionId;if(!Ae)return;const Oe=e.queuedBySession[Ae]??[];if(X===xe||X<0||X>=Oe.length||xe<0||xe>=Oe.length)return;const Ge=[...Oe],[ot]=Ge.splice(X,1);ot!==void 0&&(Ge.splice(xe,0,ot),e.queuedBySession={...e.queuedBySession,[Ae]:Ge})}async function te(X){const xe=e.activeSessionId;if(!xe)return[];try{return(await ct().listDirectory(xe,{path:X,includeGitStatus:!0})).items}catch{return[]}}async function ve(X){const xe=e.activeSessionId;if(!xe)return null;try{const Oe=await ct().readFile(xe,{path:X});return{path:Oe.path,content:Oe.content,encoding:Oe.encoding,mime:Oe.mime,languageId:Oe.languageId,isBinary:Oe.isBinary,size:Oe.size,lineCount:Oe.lineCount}}catch(Ae){return console.warn("[kimi-web] readFileContent failed for",X,Ae),null}}const de=10485760;function _e(X){const xe=e.activeSessionId;return xe?ct().getFileDownloadUrl(xe,X):null}async function He(X,xe){const Ae=e.activeSessionId;if(!Ae)return!1;try{return await ct().openFile(Ae,{path:X,line:xe}),!0}catch(Oe){return l("openFile",Oe,{sessionId:Ae}),!1}}async function $t(X){const xe=e.activeSessionId;if(!xe)return;const Ae=F.value.cwd||".";try{await ct().openInApp(xe,X,Ae)}catch(Oe){l("openInApp",Oe,{sessionId:xe})}}async function Ot(X){const xe=e.activeSessionId;if(!xe)return!1;try{return await ct().revealFile(xe,{path:X}),!0}catch(Ae){return l("revealFile",Ae,{sessionId:xe}),!1}}async function rn(X){if(/^(https?:|data:|blob:)/i.test(X))return X;const xe=e.activeSessionId;if(!xe)return X;let Ae=X;if(Ae.startsWith("/")){const Oe=e.sessions.find(Ge=>Ge.id===xe)?.cwd;if(Oe&&(Ae===Oe||Ae.startsWith(Oe.endsWith("/")?Oe:`${Oe}/`))){if(Ae=Ae.slice(Oe.length).replace(/^\//,""),!Ae)return X}else return X}try{const Ge=await ct().readFile(xe,{path:Ae,length:de});return!Ge.isBinary||Ge.encoding!=="base64"||Ge.truncated?X:`data:${Ge.mime};base64,${Ge.content}`}catch{return X}}async function zn(X){const xe=e.activeSessionId;if(!xe)return[];try{return(await ct().searchFiles(xe,{query:X,limit:20})).items.map(Ge=>({path:Ge.path,name:Ge.name}))}catch{return[]}}return{loadFileDiff:ce,clearFileDiff:se,loadGitStatus:V,checkAuth:Q,loadConfig:he,updateConfig:ye,listAllSessionsGlobal:Ee,load:gt,refreshServerMeta:St,loadWorkspaces:Tt,loadMoreSessions:Je,loadAllSessions:it,selectWorkspace:ft,openWorkspace:gn,upsertWorkspacePreserveOrder:sn,applyWorkspaceEvent:Yo,clearActiveSession:jt,openWorkspaceDraft:vn,startSessionAndSendPrompt:st,startSessionAndActivateSkill:On,startSessionAndOpenSideChat:so,addWorkspaceByPath:io,browseFs:ro,getFsHome:Zo,writeSessionUrl:Un,fetchSessionIntoList:_o,onSessionRoutePopState:yn,bindSessionRoute:_n,selectSession:un,submitPromptInternal:Sn,finishPromptLocal:Bt,localTurnStartState:hme,isLocalTurnSnapshotCurrent:mme,afterLocalTurnStartsSettle:gme,handleSessionSnapshot:Rn,sendPrompt:Ro,steerPrompt:ze,uploadImage:Ze,enqueue:kt,unqueue:es,reorderQueue:Ce,abortCurrentPrompt:Cn,respondApproval:Qn,respondQuestion:wt,dismissQuestion:Xo,pendingQuestionActions:ia,pendingApprovalActions:lh,cancelTask:So,setPlanMode:Qo,togglePlanMode:Bn,setSwarmMode:Dn,toggleSwarmMode:ni,setGoalMode:Bs,toggleGoalMode:_i,createGoal:ho,controlGoal:Pi,setPermission:Si,dismissWarning:po,renameSession:Ds,renameWorkspace:ir,deleteWorkspace:Ci,archiveSession:lo,exportSession:Jo,restoreSession:oi,loadArchivedSessions:Co,logout:Ps,compact:qn,forkSession:Bo,undo:Hs,listDir:te,readFileContent:ve,getFileDownloadUrl:_e,openWorkspaceFile:He,openInApp:$t,revealWorkspaceFile:Ot,resolveImageUrl:rn,searchFiles:zn,loadOlderMessages:ae,refreshSessionSidecars:U,isStartingFirstPrompt:()=>Vi.size>0}}const H5=Lt.starredModels;function yme(){try{const e=oo(H5);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function kme(e){try{uo(H5,JSON.stringify(e))}catch{}}function bme(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,saveThinkingToStorage:r,updateSession:l,updateSessionMessages:a}=t,c=Z([]),u=Z(yme()),d=Z({}),f=Z({}),h=Z([]),p=Z(null);function g(q){if(!(q==null||q.length===0))return c.value.find(j=>j.id===q)??c.value.find(j=>j.model===q)}function b(){const q=e.activeSessionId?e.sessions.find(ie=>ie.id===e.activeSessionId):void 0,j=q===void 0?p.value??e.defaultModel:q.model||e.defaultModel;return g(j)?.id??j??void 0}function v(q){return e.thinking=q,q!==void 0&&r(q),q}function m(q){ct().setConfig({thinking:gre(q)}).catch(j=>n("setConfig",j))}async function y(q){try{const ie=await ct().listSkills(q);d.value={...d.value,[q]:ie}}catch{}}async function k(q){try{const ie=await ct().listSkillsForWorkspace(q);f.value={...f.value,[q]:ie}}catch{}}async function A(){try{const q=ct();if(c.value=await q.listModels(),e.thinking===void 0){const j=g(b());j!==void 0&&(e.thinking=zm(j))}}catch(q){n("loadModels",q)}}async function $(){try{const q=await ct().refreshOAuthProviderModels();for(const j of q.failed)n("refreshOAuthProviderModels",new Error(j.reason),{message:j.provider})}catch{}}async function L(){try{const q=ct();h.value=await q.listProviders()}catch(q){n("loadProviders",q)}}async function w(q){const j=e.activeSessionId,ie=g(q),ue=e.thinking,pe=j?e.sessions.find(fe=>fe.id===j)?.model:void 0,ee=b()!==(ie?.id??q),ne=vre(ie,ue,ee);if(!j)return p.value=q,v(ne),ne!==ue&&ne!==void 0&&m(ne),!0;l(j,fe=>({...fe,model:q})),ne!==ue&&v(ne);try{await ct().updateSession(j,{model:q,thinking:ne!==ue?ne:void 0})}catch(fe){return l(j,Me=>({...Me,model:pe??Me.model})),ne!==ue&&v(ue),n("setModel",fe,{sessionId:j}),!1}return ne!==ue&&ne!==void 0&&m(ne),await o(j),!0}function E(q){const j=new Set(u.value);j.has(q)?j.delete(q):j.add(q),u.value=Array.from(j),kme(u.value)}async function T(q,j,ie){const ue=ie??e.activeSessionId;if(!ue)return;const pe=i.value==="idle"&&!e.inFlightBySession[ue],ee=`msg_skill_opt_${Date.now().toString(36)}`,ne=pe?Yv(ue):void 0;if(pe){e.inFlightBySession={...e.inFlightBySession,[ue]:!0};const fe={id:ee,sessionId:ue,role:"user",content:[{type:"text",text:`/${q}${j?` ${j}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:q,skillArgs:j}}};a(ue,Me=>[...Me,fe])}try{await ct().activateSkill(ue,q,j)}catch(fe){pe&&(e.inFlightBySession={...e.inFlightBySession,[ue]:!1},a(ue,Me=>Me.filter($e=>$e.id!==ee))),n("activateSkill",fe,{sessionId:ue})}finally{ne!==void 0&&Zv(ue,ne)}}async function F(q){try{await ct().addProvider(q),await Promise.all([L(),A()])}catch(j){n("addProvider",j)}}async function S(q){try{await ct().deleteProvider(q),await Promise.all([L(),A()])}catch(j){n("deleteProvider",j)}}async function I(q){try{const j=await ct().refreshProvider(q);for(const ie of j.failed)n("refreshProvider",new Error(ie.reason),{message:ie.provider});await Promise.all([L(),A()])}catch(j){n("refreshProvider",j)}}async function P(){try{const q=await ct().refreshAllProviders();for(const j of q.failed)n("refreshAllProviders",new Error(j.reason),{message:j.provider});await Promise.all([L(),A()])}catch(q){n("refreshAllProviders",q)}}async function B(){try{return await ct().startOAuthLogin()}catch{return null}}async function W(){try{return await ct().pollOAuthLogin()}catch(q){return console.warn("[kimi-web] pollOAuthLogin failed",q),null}}async function z(){try{await ct().cancelOAuthLogin()}catch{}}function D(q){const j=v(q);s({thinking:j}),j!==void 0&&m(j)}return{models:c,starredModelIds:u,providers:h,draftModel:p,skillsBySession:d,skillsByWorkspace:f,loadSkillsForSession:y,loadSkillsForWorkspace:k,loadModels:A,refreshOAuthProviderModels:$,loadProviders:L,setModel:w,toggleStarModel:E,activateSkill:T,addProvider:F,deleteProvider:S,refreshProvider:I,refreshAllProviders:P,startOAuthLogin:B,pollOAuthLogin:W,cancelOAuthLogin:z,setThinking:D}}const W5="kimiWeb.compaction",xme=/^read[_-]?media(?:file)?$/i,wme=/^data:([^;]+);base64,(.*)$/s,_me=/^<(image|video|audio)\s+path="([^"]+)">$/,Sme=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Cme=/Mime type:\s*([^.\s]+)/i,Ame=/Size:\s*(\d+)\s*bytes/i,Mme=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,Eme="<system>Image compressed to fit model limits:",Tme=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function Nme(e){return e.includes(Eme)?e.replace(Tme,""):e}function Ime(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function Lme(e){const t=Sme.exec(e.trim());return t?{kind:t[1],path:Ime(t[2])}:null}const z5=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,$me=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function Fme(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return z5.test(o)?o:void 0}const Ome=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function Rme(e){const t=Ome.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",o=$me.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:o!==void 0&&z5.test(o)?o:void 0}}function Bme(e){if(e.length===0)return 0;const t=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-t}function Dme(e){if(Array.isArray(e))return e;if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t:null}catch{return null}}function Pme(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const i=s.url;return typeof i=="string"?{kind:n,url:i}:null}function Hme(e,t){if(!xme.test(e))return;const n=Dme(t);if(n===null)return;let o,s,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const h=d.text,p=_me.exec(h);p&&(s=p[1],o=p[2]);const g=Cme.exec(h);g?.[1]&&(i=g[1]);const b=Ame.exec(h);b?.[1]&&(r=Number(b[1]));const v=Mme.exec(h);v?.[1]&&v[2]&&(l=`${v[1]}x${v[2]}`);continue}const f=Pme(d);f&&(a=f)}if(a===null)return;const c=wme.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Bme(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Wme(e){if(e!=null){if(typeof e=="string")return e.split(`
306
- `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
307
- `));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
308
- `)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
309
- `)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function zme(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Ume(e,t){const n=e.split(`
310
- `),o=t.split(`
311
- `),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function qme(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:Ume(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0};if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};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??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).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 jme(e){const t=`<prompt>
312
- `,n=`
313
- </prompt>`,o=e.indexOf(t),s=e.lastIndexOf(n);return o>=0&&s>=o+t.length?e.slice(o+t.length,s):Vme(e)}function Vme(e){const t=e.split(`
314
- `);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
315
- `):e}function Kme(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function Gme(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
316
- `);return jme(t)}function Yme(e,t){const n=e.metadata?.origin??{},o=Gme(e);return t==="cron_missed"?{text:o,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:o,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function Zme(e,t,n){const{text:o,cron:s}=Yme(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function Xme(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function Qme(e){return e.metadata?.origin?.kind==="compaction_summary"}function Jme(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function e1e(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function t1e(e){let t="",n="";const o=[],s=[];for(const i of e)i.type==="text"?t+=i.text:i.type==="thinking"?n+=i.thinking:i.type==="toolUse"?o.push(i.toolCallId):s.push(JSON.stringify(i));return o.sort(),s.sort(),{text:t,thinking:n,toolIds:o,rest:s}}function n1e(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function U5(e,t,n,o=!0,s={}){const i=[];let r=1;const l=new Map;for(const h of t)l.set(h.toolCallId,h);let a=null;function c(h=!1){if(!a)return;const p=a;if(a=null,!h||!o)for(let g=0;g<p.tools.length;g++){const b=p.tools[g];if(b.status!=="running")continue;const v={...b,status:"ok"};p.tools[g]=v;const m=p.blocks.find(y=>y.kind==="tool"&&y.tool.id===v.id);m&&m.kind==="tool"&&(m.tool=v)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
317
- `),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
318
- `):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const g of p)if(g.type==="text"){if(g.text){h.textParts.push(g.text);const b=h.blocks.at(-1);b&&b.kind==="text"?b.text+=`
319
- `+g.text:h.blocks.push({kind:"text",text:g.text})}}else if(g.type==="thinking"){if(g.thinking){h.thinkingParts.push(g.thinking);const b=h.blocks.at(-1);b&&b.kind==="thinking"?b.thinking+=`
320
- `+g.thinking:h.blocks.push({kind:"thinking",thinking:g.thinking})}}else if(g.type==="toolUse"){const b=l.get(g.toolCallId),v={id:g.toolCallId,name:g.toolName,arg:typeof g.input=="string"?g.input:JSON.stringify(g.input),status:"running",output:g.outputLines,planPath:g.toolName==="ExitPlanMode"?s[g.toolCallId]?.path:void 0};h.tools.push(v),h.blocks.push({kind:"tool",tool:v}),b&&(h.approval=qme(b),h.approvalId=b.approvalId)}else if(g.type==="toolResult"){const b=h.tools.findIndex(v=>v.id===g.toolCallId);if(b!==-1){const v=h.tools[b],m={...v,status:g.isError?"error":"ok",output:Wme(g.output),media:g.isError?void 0:Hme(v.name,g.output)};m.name==="ExitPlanMode"&&!m.planPath&&(m.planPath=e1e(m.output)),h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}}function d(h,p){for(const g of p){if(g.type!=="toolUse"||!g.outputLines?.length)continue;const b=h.tools.findIndex(k=>k.id===g.toolCallId);if(b===-1)continue;const v=h.tools[b];if(v.output!==void 0)continue;const m={...v,output:g.outputLines};h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,g=h.source;if(g.kind==="url")return{url:g.url,kind:p};if(g.kind==="base64")return{url:`data:${g.mediaType};base64,${g.data}`,kind:p};if(g.kind==="file"&&n)return{url:n(g.fileId),kind:p,fileId:g.fileId}}if(h.type==="file"&&n){if(h.mediaType.startsWith("image/"))return{url:n(h.fileId),kind:"image",fileId:h.fileId};if(h.mediaType.startsWith("video/"))return{url:n(h.fileId),kind:"video",fileId:h.fileId}}}for(const h of e){if(h.role==="system")continue;if(Qme(h)){c();const m=h.metadata?.[W5];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(y=>y.type==="text").map(y=>y.text).join(`
321
- `),compaction:{trigger:m?.trigger,tokensBefore:m?.tokensBefore,tokensAfter:m?.tokensAfter}});continue}if(h.role==="user"){const m=Kme(h);if(c(),m!==void 0){i.push(Zme(h,r++,m));continue}if(!Xme(h))continue;const y=h.metadata?.origin,k=y?.kind==="skill_activation"&&y?.trigger==="user-slash",A=y?.kind==="plugin_command"&&y?.trigger==="user-slash",$=[],L=[];for(const w of h.content){if(w.type==="text")if(k)$.push(y.skillArgs??"");else if(A)$.push(y.commandArgs??"");else{const T=Lme(w.text);if(T&&(T.kind==="video"||T.kind==="image")&&n){const I=Fme(T.path);if(I){L.push({url:n(I),kind:T.kind,fileId:I});continue}}const F=Rme(w.text);if(F){L.push({kind:"file",url:F.fileId&&n?n(F.fileId):"",fileId:F.fileId,name:F.name,mediaType:F.mediaType,size:F.size});continue}const S=Nme(w.text);if(S!==w.text&&S.trim().length===0)continue;$.push(S)}const E=f(w);if(E){L.push({url:E.url,kind:E.kind,name:w.type==="file"?w.name:void 0,fileId:E.fileId});continue}w.type==="file"&&n&&L.push({kind:"file",url:n(w.fileId),fileId:w.fileId,name:w.name,mediaType:w.mediaType||void 0,size:w.size})}i.push({id:h.id,role:"user",no:r++,text:$.join(`
322
- `),attachments:L.length>0?L:void 0,skillActivation:k?{name:y.skillName,args:y.skillArgs}:void 0,pluginCommand:A?{pluginId:y.pluginId,commandName:y.commandName,args:y.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;Jme(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:h.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:h.durationMs});const b=a;if(b===null)continue;const v=t1e(h.content);if(b.promptId!==void 0&&b.foldedSigs.some(m=>n1e(m,v))){d(b,h.content);continue}b.foldedSigs.push(v),u(b,h.content)}return c(!0),i}function o1e(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i}=t,r=Z({}),l=R(()=>{const E=e.activeSessionId;if(!E)return null;const T=r.value[E];return T?{parentId:E,agentId:T.agentId}:null}),a=R(()=>l.value?.parentId??null),c=R(()=>l.value!==null),u=R(()=>{const E=l.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),d=R(()=>{const E=l.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(T=>T.id===E.agentId&&T.status==="running"):!1}),f=R(()=>{const E=l.value;if(!E)return[];const T=e.sideChatMessagesByAgent[E.agentId]??[];return U5(T,[],F=>ct().getFileUrl(F),d.value)});function h(E,T){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:T(e.sideChatMessagesByAgent[E]??[])}}function p(E,T){h(E,F=>[...F,T])}function g(E){h(E,T=>{const F=[...T].reverse().findIndex(I=>I.role==="user");if(F===-1)return T;const S=T.length-1-F;return T.filter((I,P)=>P!==S)})}function b(E,T){h(E,F=>{const S=[...F];for(let I=S.length-1;I>=0;I-=1){const P=S[I];if(P.role==="user")return S[I]={...P,promptId:P.promptId??T},S}return F})}function v(E,T,F){F&&h(E,S=>{const I=S.at(-1);if(I?.role==="assistant"){const P=I.content[0],B=P?.type==="text"?P.text:"";return[...S.slice(0,-1),{...I,content:[{type:"text",text:`${B}${F}`}]}]}return[...S,{id:o(),sessionId:T,role:"assistant",content:[{type:"text",text:F}],createdAt:new Date().toISOString()}]})}function m(E,T,F){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!F)return;const I=(e.sideChatMessagesByAgent[E]??[]).at(-1);(I?.role==="assistant"&&I.content[0]?.type==="text"?I.content[0].text:"").trim().length>0||v(E,T,F)}async function y(E){const T=e.activeSessionId;T&&await k(T,E)}async function k(E,T){if(!r.value[E]){let F;try{({agentId:F}=await ct().startBtw(E))}catch(S){n("openSideChat",S,{sessionId:E});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[F]:e.sideChatMessagesByAgent[F]??[]},r.value={...r.value,[E]:{agentId:F}},s(),i()?.markSideChannelAgent(F)}T&&T.trim()&&await A(E,T.trim())}async function A(E,T){const F=r.value[E],S=T.trim();if(!F||!S)return;const I=E,P=F.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!0};const B={id:o(),sessionId:I,role:"user",content:[{type:"text",text:S}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};p(P,B);try{const W=e.sessions.find(q=>q.id===I),z=(W?.model&&W.model.length>0?W.model:e.defaultModel)??void 0,D=await ct().submitPrompt(I,{content:[{type:"text",text:S}],agentId:P,model:z,thinking:e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[I]??!1,swarmMode:e.swarmModeBySession[I]??!1});b(P,D.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[I]:[...e.sideChatUserMessageIdsBySession[I]??[],D.userMessageId]}}catch(W){n("sendSideChatPrompt",W,{sessionId:I}),g(P),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!1}}}function $(){const E=e.activeSessionId;if(!E)return;const{[E]:T,...F}=r.value;r.value=F}async function L(E){const T=l.value;T&&await A(T.parentId,E)}function w(E){if(!r.value[E])return;const{[E]:T,...F}=r.value;r.value=F}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:v,finishSideChatAgent:m,openSideChat:y,openSideChatOn:k,closeSideChat:$,sendSideChatPrompt:L,clearSideChatForSession:w}}const s1e="kimiWeb.optimisticUserMessage",QC="Sub Agent";function i1e(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function r1e(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function l1e(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function vg(e){return e.role==="user"&&e.metadata?.[s1e]===!0}function a1e(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function c1e(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const u1e=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function JC(e){let t="",n=0;for(const o of e.content)o.type==="text"?u1e.test(o.text.trim())?n+=1:t+=o.text:(o.type==="image"||o.type==="video"||o.type==="file")&&(n+=1);return{text:t,media:n}}function d1e(e,t){const n=JC(e),o=JC(t);return n.text===o.text&&n.media===o.media}function f1e(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(vg(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(vg(s)&&c1e(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(vg(s)&&d1e(s,t))return o}return-1}function h1e(e,t,n){let o=!1;const s=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(o=!0,{...i,content:l}):i});return o?s:e}const p1e={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function m1e(e){const t=An.global.t,n=[],o=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};o(t("warnings.details.code"),e.code);const s=e.details??{};o(t("warnings.details.status"),s.statusCode),o(t("warnings.details.requestId"),s.requestId),o(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(s))r==="statusCode"||r==="requestId"||o(r,l);const i=(e.code!==void 0?p1e[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${i}`),message:e.message,details:n.length>0?n:void 0}}function g1e(e,t,n){const o=r1e(e);switch(l1e(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(i=>i.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?s.mainTurnActive:!1),pendingInteraction:t.pendingInteraction??s.pendingInteraction,lastTurnReason:t.lastTurnReason}),t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&delete o.turnActiveBySession[t.sessionId];break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const i=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,i=o.compactionBySession[s],{[s]:r,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[W5]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...i}=o.compactionBySession;o.compactionBySession=i;break}case"messageCreated":{const s=t.message.sessionId,i=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=o.messagesBySession[s]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"&&!a1e(t.message)){const a=f1e(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...r,t.message]}break}case"messageUpdated":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=h1e(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,i=o.approvalsBySession[s]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,i=t.approvalId,r=o.approvalsBySession[s]??[];o.approvalsBySession[s]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const s=t.sessionId,i=o.questionsBySession[s]??[];i.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,i=t.questionId,r=o.questionsBySession[s]??[];o.questionsBySession[s]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const s=t.sessionId,i=o.tasksBySession[s]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)o.tasksBySession[s]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,description:t.task.description===QC&&a.description!==QC?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground,backgroundTaskId:t.task.backgroundTaskId??a.backgroundTaskId},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active?o.turnActiveBySession[t.sessionId]=!0:delete o.turnActiveBySession[t.sessionId];break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError)o.warnings=[...o.warnings,m1e(s)];else if(s&&s._agentWarning){const i=s.message??s.code??"agent warning";o.warnings=[...o.warnings,`${An.global.t("warnings.noteLabel")}: ${i}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function v1e(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function y1e(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||La(s.toolName)!=="todo")continue;let i=s.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:v1e(a.status)}]:[]})}}return[]}const k1e=["queued","working","suspended","completed","failed"];function q5(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function b1e(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function x1e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const o=n.parentToolCallId??"swarm",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:q5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=b1e();for(const r of s)i[r.phase]++;return{id:n,members:s,counts:i}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.swarmIndex??0,i=o.members.at(0)?.swarmIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function w1e(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of k1e)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}function _1e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const o=t.get(n.parentToolCallId)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:q5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,o)}for(const[n,o]of t)t.set(n,o.toSorted((s,i)=>s.swarmIndex-i.swarmIndex||s.id.localeCompare(i.id)));return t}const wr=B5(),Zi=qpe(),Fd=Qpe(),j5=Lt.permission,V5=Lt.activeWorkspace,K5=Lt.thinking,G5=Lt.planMode,Y5=Lt.swarmMode,Z5=Lt.goalMode,e4=40401,X5=Lt.onboarded,S1e=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;Kc(Lt.codeFont);Kc(Lt.theme);function C1e(){try{const e=oo(j5);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function A1e(e){try{uo(j5,e)}catch{}}function M1e(){try{const e=oo(K5);if(e&&S1e.test(e))return e}catch{}}function E1e(e){try{uo(K5,e)}catch{}}function yg(e){const t=oo(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 e2(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);uo(e,JSON.stringify(n))}catch{}}function Q5(){e2(G5,we.planModeBySession)}function J5(){e2(Y5,we.swarmModeBySession)}function e8(){e2(Z5,we.goalModeBySession)}function T1e(){try{return oo(V5)}catch{return null}}const t8=Lt.hiddenWorkspaces;function N1e(){try{const e=oo(t8);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function I1e(e){try{uo(t8,JSON.stringify(e))}catch{}}function L1e(e){try{uo(V5,e)}catch{}}function $1e(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 we=Oo({...i1e(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",workspaceName:"kimi-web",connection:"disconnected",permission:C1e(),thinking:M1e(),planModeBySession:yg(G5),swarmModeBySession:yg(Y5),goalModeBySession:yg(Z5),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:Ly(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:T1e(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:N1e(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),jm=Oo({planMode:!1,swarmMode:!1,goalMode:!1});function n8(e){we.sessions=e}function Vm(e,t){we.sessions=we.sessions.map(n=>n.id===e?t(n):n)}function F1e(e){we.sessions=[e,...we.sessions.filter(t=>t.id!==e.id)]}function O1e(e){we.sessions=[...we.sessions,e]}function R1e(e){we.sessions=we.sessions.filter(t=>t.id!==e)}function o8(){const e=we.activeSessionId;e&&we.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(we.unreadBySession={...we.unreadBySession,[e]:!1},$y({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Lt.unread&&(we.unreadBySession=Ly(),o8())});function Xv(){if(bi===null||!bi.health().stale)return;vo("ws:stale-reconnect",{sessionId:we.activeSessionId,status:"stale"}),Cr("ws: stale socket on focus, reconnecting",{activeSessionId:we.activeSessionId}),bi.reconnect();const e=we.activeSessionId;e&&Hp.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(o8(),Xv())});typeof window<"u"&&(window.addEventListener("focus",Xv),window.addEventListener("online",Xv));function t2(e){we.activeSessionId=e}function B1e(e){we.messagesBySession=e}function D1e(e,t){we.messagesBySession={...we.messagesBySession,[e]:t}}function s8(e,t){we.messagesBySession={...we.messagesBySession,[e]:t(we.messagesBySession[e]??[])}}function P1e(e){const{[e]:t,...n}=we.messagesBySession;we.messagesBySession=n}function i8(e){bi?.unsubscribe(e),c0e(e),Dp.discard(({meta:t})=>t.sessionId===e),R1e(e),P1e(e),delete we.approvalsBySession[e],delete we.questionsBySession[e],delete we.tasksBySession[e],delete we.goalBySession[e],delete we.gitStatusBySession[e],delete we.lastSeqBySession[e],delete we.compactionBySession[e],delete we.messagesLoadingMoreBySession[e],delete we.messagesHasMoreBySession[e],delete we.messagesLoadMoreErrorBySession[e],delete Qv[e],Pp.delete(e),Ih.delete(e),v8.delete(e),pme(e),delete we.queuedBySession[e],delete we.promptIdBySession[e],delete we.inFlightBySession[e],delete we.turnActiveBySession[e],delete we.planModeBySession[e],delete we.swarmModeBySession[e],delete we.goalModeBySession[e],Q5(),J5(),e8()}const r8=Z(null),l8=Z([]),a8=Z(!1),c8=Z(!1),u8=Z(null);async function Xd(e){let t;try{t=await ct().getSessionStatus(e)}catch{return}Vm(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),we.swarmModeBySession={...we.swarmModeBySession,[e]:t.swarmMode},we.planModeBySession={...we.planModeBySession,[e]:t.planMode}}async function H1e(e){const t=we.goalVersionBySession[e]??0;let n;try{n=await ct().getSessionGoal(e)}catch{return}if((we.goalVersionBySession[e]??0)!==t)return;const o={...we.goalBySession};n===null||n.status==="complete"?delete o[e]:o[e]=n,we.goalBySession=o}function d8(e,t){const n=t??we.activeSessionId;return n?Promise.resolve(ct().updateSession(n,e)).then(()=>Xd(n)).catch(o=>{Qd("persistSessionProfile",o,{sessionId:n})}):Promise.resolve()}const f8=Lt.conversationToc;function W1e(){try{const e=oo(f8);return e===null?!0:e==="true"}catch{return!0}}function z1e(e){try{uo(f8,e?"true":"false")}catch{}}const h8=Z(W1e());function U1e(e){h8.value=e,z1e(e)}function q1e(e){try{return oo(e)??""}catch{return""}}const p8=Z(q1e(X5)==="1");function j1e(e){p8.value=e;try{uo(X5,e?"1":"0")}catch{}}let bi=null,t4=0;function m8(){return t4+=1,`msg_opt_${Date.now().toString(36)}_${t4}`}function V1e(e,t,n){const o={sessions:we.sessions,activeSessionId:we.activeSessionId,messagesBySession:we.messagesBySession,approvalsBySession:we.approvalsBySession,planReviewByToolCallId:we.planReviewByToolCallId,questionsBySession:we.questionsBySession,tasksBySession:we.tasksBySession,goalBySession:we.goalBySession,goalVersionBySession:we.goalVersionBySession,lastSeqBySession:we.lastSeqBySession,turnActiveBySession:we.turnActiveBySession,compactionBySession:we.compactionBySession,config:we.config,warnings:we.warnings},s=g1e(o,e,{sessionId:t,seq:n});n8(s.sessions),t2(s.activeSessionId),B1e(s.messagesBySession),we.approvalsBySession=s.approvalsBySession,we.planReviewByToolCallId=s.planReviewByToolCallId,we.questionsBySession=s.questionsBySession,we.tasksBySession=s.tasksBySession,we.goalBySession=s.goalBySession,we.goalVersionBySession=s.goalVersionBySession,we.lastSeqBySession=s.lastSeqBySession,we.turnActiveBySession=s.turnActiveBySession,we.compactionBySession=s.compactionBySession,we.config=s.config??null,we.warnings=s.warnings,e.type==="configChanged"&&(we.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Nn.loadModels(),Nn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(we.swarmModeBySession={...we.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(we.planModeBySession={...we.planModeBySession,[e.sessionId]:e.planMode}))}function K1e(e,t){const n=we.lastSeqBySession[t.sessionId]??0,o=we.turnActiveBySession[t.sessionId]??!1;V1e(e,t.sessionId,t.seq);const s=ds.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:i}=s,r=t.sessionId;e.type==="agentDelta"&&e.agentId===i?e.delta.text&&ds.appendSideChatAssistantText(i,r,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===i?ds.finishSideChatAgent(i,r):e.type==="taskProgress"&&e.taskId===i?ds.appendSideChatAssistantText(i,r,e.outputChunk):e.type==="taskCompleted"&&e.taskId===i&&ds.finishSideChatAgent(i,r,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const i=e.message.sessionId;we.promptIdBySession[i]!==e.message.promptId&&(we.promptIdBySession={...we.promptIdBySession,[i]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===we.activeSessionId&&wr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const i=e.reason;mge(e.sessionId,i==="cancelled"||i==="failed"||i==="blocked"?"aborted":"idle")}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&o||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&pge(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&we.promptIdBySession[e.sessionId]===e.promptId&&ut.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&gge(e.sessionId,e.question),e.type==="approvalRequested"&&vge(e.sessionId,e.approval)}const Dp=fpe(({appEvent:e,meta:t})=>K1e(e,t),({appEvent:e})=>ape(e),{coalesce:ppe});function g8(){if(bi!==null||typeof WebSocket>"u")return;vo("ws:connection",{status:"connecting"}),we.connection="connecting",bi=ct().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ut.applyWorkspaceEvent(t);return}for(const o of hpe({appEvent:t,meta:n}))Dp(o)},onResync(t,n,o){vo("ws:resync",{sessionId:t,status:"required",seq:n}),Dp.flush(),Pp.add(t),Hp.request(t)},onError(t,n,o){vo("ws:error",{status:"failed",errorCode:t,fatal:o}),n2({severity:"error",title:An.global.t("warnings.wsTitle"),message:n,details:[Kn("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){vo("ws:connection",{status:t?"connected":"disconnected"}),we.connected=t,we.connection=t?"connected":"disconnected",t&&(t0e(),ut.refreshServerMeta())}})}const Qv={},Pp=new Set,Ih=new Set,v8=new Set;function G1e(e){return nr(e)&&e.code===e4?!0:typeof e=="object"&&e!==null&&e.code===e4}function Kn(e,t){if(!(t==null||t===""))return{label:An.global.t(`warnings.details.${e}`),value:y8(t)}}function y8(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 Y1e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Z1e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function X1e(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function Q1e(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function n4(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function J1e(e,t,n){const o=Mk(t),s=nr(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Kn("operation",e),Kn("sessionId",n??we.activeSessionId),Kn("connection",we.connection),Kn("timestamp",Q1e(i??Date.now()))];return o?l.push(Kn("duration",n4(r)),Kn("request",`${t.method} ${t.path}`),Kn("endpoint",t.url),Kn("requestId",t.requestId),Kn("phase",t.phase),Kn("timeout",`${t.timeoutMs}ms`),Kn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Kn("contentType",t.contentType),Kn("responsePreview",t.bodyPreview),Kn("cause",t.cause)):s?l.push(Kn("duration",n4(r)),Kn("code",t.code),Kn("requestId",t.requestId),Kn("message",t.message),Kn("details",t.details)):l.push(Kn("errorName",Y1e(t)),Kn("message",Z1e(t)??y8(t)),Kn("stack",X1e(t))),l.filter(a=>a!==void 0)}function e0e(e,t,n={}){const o=Mk(t),s=nr(t),i=n.title??(o?An.global.t("warnings.daemonNetworkTitle"):s?An.global.t("warnings.daemonApiTitle"):An.global.t("warnings.operationFailedTitle")),r=n.message??(o?An.global.t("warnings.daemonNetworkMessage"):s?t.message:An.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:J1e(e,t,n.sessionId)}}function n2(e){we.warnings=[...we.warnings,e]}function t0e(){const e=An.global.t("warnings.wsTitle"),t=we.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==we.warnings.length&&(we.warnings=t)}function Qd(e,t,n){console.error(`[kimi-web] operation failed: ${e}`,t);const o=nr(t),s=Mk(t);vo("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}),n2(e0e(e,t,n))}const n0e={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function o0e(e){if(!nr(e))return;const t=n0e[e.code];return t?An.global.t(t):void 0}async function s0e(e){if(i8(e),we.activeSessionId!==e)return;const t=we.sessions[0];t?await ut.selectSession(t.id,{urlMode:"replace"}):(t2(void 0),we.sessionLoading=!1,ut.writeSessionUrl(void 0,"replace"))}const o4=new Set;async function i0e(e){if(!o4.has(e)){o4.add(e);try{const t=await ct().getSessionWarnings(e),n=An.global.t("warnings.noteLabel");for(const o of t)n2(`${n}: ${o.message}`)}catch{}}}async function o2(e){const t=ut.localTurnStartState(e);try{const o=await ct().getSessionSnapshot(e);if(!we.sessions.some(a=>a.id===e))return"ok";Dp.flush();const s=we.lastSeqBySession[e]??0,i=Qv[e];if(!(Pp.has(e)||Wp.has(e))&&i!==void 0&&i===o.epoch&&s>o.asOfSeq)return Ih.delete(e)||(Ih.add(e),Hp.request(e)),"ok";if(!ut.isLocalTurnSnapshotCurrent(e,t))return ut.afterLocalTurnStartsSettle(e,()=>{Hp.request(e)}),"ok";const l=Ov(o.session.usage);Vm(e,a=>({...o.session,model:o.session.model&&o.session.model.length>0?o.session.model:a.model,usage:l?a.usage:o.session.usage})),D1e(e,spe(we.messagesBySession[e]??[],o.messages)),we.tasksBySession={...we.tasksBySession,[e]:ipe(o.subagents,we.tasksBySession[e]??[])},we.messagesHasMoreBySession={...we.messagesHasMoreBySession,[e]:o.hasMoreMessages},we.approvalsBySession={...we.approvalsBySession,[e]:o.pendingApprovals};for(const a of o.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(we.planReviewByToolCallId={...we.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}we.questionsBySession={...we.questionsBySession,[e]:o.pendingQuestions},we.lastSeqBySession={...we.lastSeqBySession,[e]:o.asOfSeq},Qv[e]=o.epoch,Pp.delete(e),Ih.delete(e),ut.handleSessionSnapshot(e,{inFlightTurn:o.inFlightTurn,busy:o.session.busy});{const a={...we.turnActiveBySession};o.session.mainTurnActive??(o.inFlightTurn!==null&&o.session.busy)?a[e]=!0:delete a[e],we.turnActiveBySession=a}return g8(),bi&&(bi.seedSnapshot(e,o),bi.subscribe(e,{seq:o.asOfSeq,epoch:o.epoch}),a0e(e)),Wp.delete(e),l&&Xd(e),i0e(e),"ok"}catch(n){return G1e(n)?(await s0e(e),"not-found"):(Qd("getSessionSnapshot",n,{title:An.global.t("warnings.sessionSnapshotTitle"),message:An.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Hp=rpe(o2);function r0e(e){return Object.prototype.hasOwnProperty.call(we.messagesBySession,e)}const l0e=4,_r=[],Wp=new Set;function a0e(e){const t=_r.indexOf(e);for(t!==-1&&_r.splice(t,1),_r.unshift(e);_r.length>l0e;){let n=-1;for(let s=_r.length-1;s>=0;s--)if(_r[s]!==we.activeSessionId){n=s;break}if(n===-1)break;const[o]=_r.splice(n,1);if(o===void 0)break;bi?.unsubscribe(o),Wp.add(o)}}function c0e(e){const t=_r.indexOf(e);t!==-1&&_r.splice(t,1),Wp.delete(e)}async function u0e(e){return o2(e)}function s2(e,t){return(we.inFlightBySession[e]??!1)||(we.turnActiveBySession[e]??!1)||(t??we.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function i2(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return An.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 d0e=3e4,Od=Z(0);let kg=null;function f0e(){kg===null&&(kg=setInterval(()=>{Od.value=(Od.value+1)%Number.MAX_SAFE_INTEGER},d0e),kg.unref?.())}function h0e(e,t){const n=e.split(`
323
- `),o=t.split(`
324
- `),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function p0e(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:h0e(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}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:void 0;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??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).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 m0e(e){return{questionId:e.questionId,sessionId:e.sessionId,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 g0e(e){const t=we.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 v0e(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=An.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=An.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??g0e(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const y0e=R(()=>{const e=we.sessions.find(n=>n.id===we.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:we.workspaceName,branch:t}}),k0e=R(()=>(Od.value,we.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:i2(e.updatedAt),busy:s2(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),b0e=R(()=>we.activeSessionId??""),x0e=R(()=>{const e=we.activeSessionId;if(e)return Nn.skillsBySession.value[e]??[];const t=Gm.value;return t?Nn.skillsByWorkspace.value[t]??[]:[]}),r2=R(()=>{const e=we.activeSessionId;return e?we.inFlightBySession[e]??!1:!1}),w0e=R(()=>ut.isStartingFirstPrompt()),ds=o1e(we,{pushOperationFailure:Qd,nextOptimisticMsgId:m8,connectEventsIfNeeded:g8,getEventConn:()=>bi}),Jd=R(()=>{const e=we.activeSessionId;if(!e)return[];const t=ds.sideChatTargetBySession.value[e]?.agentId;return(we.tasksBySession[e]??[]).filter(n=>n.id!==t)}),k8=tme(we,Jd),_0e=R(()=>{const e=we.activeSessionId;if(!e)return[];const t=new Set(we.sideChatUserMessageIdsBySession[e]??[]),n=(we.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=we.approvalsBySession[e]??[];return U5(n,o,s=>ct().getFileUrl(s),Km.value,we.planReviewByToolCallId)}),Km=R(()=>{const e=we.activeSessionId;return e?(we.turnActiveBySession[e]??!1)||(we.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),S0e=R(()=>r2.value||Km.value),C0e=R(()=>(k8.taskClock.value,Jd.value.map(v0e))),b8=R(()=>x1e(Jd.value)),A0e=R(()=>_1e(Jd.value)),pc=R(()=>{const e=we.activeSessionId;return e?we.goalBySession[e]??null:null}),M0e=R(()=>{const e=we.activeSessionId;return e?y1e(we.messagesBySession[e]??[]):[]}),E0e=R(()=>{const e=we.activeSessionId;return e?we.compactionBySession[e]??null:null}),T0e=R(()=>we.connection),N0e=R(()=>we.loading),I0e=R(()=>we.sessionLoading),L0e=R(()=>{const e=we.activeSessionId;return e?we.messagesLoadingMoreBySession[e]??!1:!1}),$0e=R(()=>{const e=we.activeSessionId;return e?we.messagesHasMoreBySession[e]??!1:!1}),F0e=R(()=>{const e=we.activeSessionId;return e?we.messagesLoadMoreErrorBySession[e]??!1:!1}),O0e=R(()=>we.serverVersion),R0e=R(()=>we.backend),B0e=R(()=>we.dangerousBypassAuth);function D0e(){we.dangerousBypassAuth=!1}const P0e=R(()=>we.permission),H0e=R(()=>we.thinking),x8=R(()=>{const e=we.activeSessionId;return e?we.planModeBySession[e]??!1:jm.planMode}),W0e=R(()=>{const e=we.activeSessionId;return e?we.swarmModeBySession[e]??!1:jm.swarmMode}),z0e=R(()=>{const e=we.activeSessionId;return e?we.goalModeBySession[e]??!1:jm.goalMode}),U0e=R(()=>{const e=w1e(b8.value);return{plan:x8.value,goal:pc.value&&pc.value.status!=="complete"?{status:pc.value.status,turnsUsed:pc.value.turnsUsed,elapsedMs:pc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),q0e=R(()=>{const e=we.activeSessionId;if(!e)return[];const t=ct();return(we.queuedBySession[e]??[]).map(n=>({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}))}))}),j0e=R(()=>we.warnings),V0e=R(()=>{const e=we.activeSessionId;return e?(we.questionsBySession[e]??[]).map(m0e):[]}),K0e=R(()=>{const e=we.activeSessionId;return e?(we.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:p0e(t),agentName:t.agentName})):[]}),l2=R(()=>{const e=we.activeSessionId;return e?(we.approvalsBySession[e]??[]).length>0?"awaiting-approval":(we.questionsBySession[e]??[]).length>0?"awaiting-question":r2.value||Km.value?"running":"idle":"idle"}),Nn=bme(we,{pushOperationFailure:Qd,refreshSessionStatus:Xd,persistSessionProfile:d8,activity:l2,saveThinkingToStorage:E1e,updateSession:Vm,updateSessionMessages:s8}),zp=R(()=>{const e=we.activeSessionId;if(!e)return null;const t=we.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),G0e=R(()=>{const e=we.activeSessionId;return e?we.gitStatusBySession[e]?.pullRequest??null:null}),Y0e=R(()=>{const e=we.activeSessionId;if(!e)return[];const t=we.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),Z0e=R(()=>{const e=we.activeSessionId;if(!e)return null;const t=we.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),w8=R(()=>{const e=we.sessions.find(r=>r.id===we.activeSessionId),t=zp.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Nn.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??we.defaultModel)??"—",s=Nn.models.value.find(r=>r.id===o)??Nn.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:we.permission,branch:t,cwd:e?.cwd??"",isGitRepo:zp.value!==null}}),X0e=R(()=>l8.value),Q0e=R(()=>we.sessions.find(t=>t.id===we.activeSessionId)?.usage.totalCostUsd??0),J0e=R(()=>we.authReady),ege=R(()=>we.defaultModel),tge=R(()=>we.managedProviderStatus),nge=R(()=>we.config),oge=R(()=>{const e=we.activeSessionId;if(!e)return{};const t=we.gitStatusBySession[e];return t?{...t.entries}:{}});function Zc(e){return we.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const a2=R(()=>ope({workspaces:we.workspaces,sessions:we.sessions,hiddenWorkspaceRoots:we.hiddenWorkspaceRoots,activeRoot:we.sessions.find(e=>e.id===we.activeSessionId)?.cwd,activeBranch:zp.value?.branch??null,sessionsHasMoreByWorkspace:we.sessionsHasMoreByWorkspace})),Up=Z(pI()),Xc=Z(mI()==="manual"?"manual":"recent");Qe(()=>[a2.value.map(e=>e.id).join("\0"),we.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=TI(n,Up.value);o!==null&&(Up.value=o,pA(o))});const Ta=R(()=>{const e=a2.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:$1e(t.root,we.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(Xc.value==="recent"){const t=new Map;for(const n of we.sessions){if(n.parentSessionId)continue;const o=Zc(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return LI(e,t)}return NI(e,Up.value)}),Gm=R(()=>{const e=we.activeWorkspaceId,t=Ta.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Qe(Gm,e=>{e&&(Object.prototype.hasOwnProperty.call(Nn.skillsByWorkspace.value,e)||Nn.loadSkillsForWorkspace(e))},{immediate:!0});const sge=R(()=>{const e=Gm.value;return e?Ta.value.find(t=>t.id===e)??null:null}),ige=R(()=>{Od.value;const e=new Set(Ta.value.map(n=>n.id)),t=new Map(Ta.value.map(n=>[n.id,n.name]));return we.sessions.filter(n=>!n.parentSessionId&&e.has(Zc(n))).map(n=>{const o=Zc(n);return{id:n.id,title:n.title,time:i2(n.updatedAt),busy:s2(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),rge=R(()=>{Od.value;const e=new Map;for(const t of we.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=Zc(t),o={id:t.id,title:t.title,time:i2(t.updatedAt),busy:s2(t.id,t.mainTurnActive),pendingInteraction:t.pendingInteraction,lastTurnReason:t.lastTurnReason,updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return Ta.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:we.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:we.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:we.sessionsInitialCountByWorkspace[t.id]??Gv}))});function lge(e){Up.value=e,pA(e),Xc.value!=="manual"&&(Xc.value="manual",mA("manual"))}function age(e){Xc.value!==e&&(Xc.value=e,mA(e))}const _8=R(()=>{const e={};for(const[t,n]of Object.entries(we.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(we.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),cge=R(()=>{const e={};for(const[t,n]of Object.entries(we.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(we.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),uge=R(()=>{const e={};for(const[t,n]of Object.entries(we.unreadBySession))n&&(e[t]=!0);return e}),dge=R(()=>{const e={},t=_8.value;for(const n of we.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=Zc(n);e[s]=(e[s]??0)+o}return e}),fge=R(()=>we.recentRoots),hge=R(()=>we.availableOpenInApps),ut=vme(we,{taskPoller:k8,sideChat:ds,modelProvider:Nn,pushOperationFailure:Qd,activity:l2,sessionsKnownEmpty:v8,setSessions:n8,updateSession:Vm,upsertSessionFront:F1e,appendSession:O1e,forgetSession:i8,setActiveSessionId:t2,updateSessionMessages:s8,nextOptimisticMsgId:m8,getEventConn:()=>bi,syncSessionFromSnapshot:o2,reopenSession:u0e,hasLoadedMessages:r0e,refreshSessionStatus:Xd,refreshSessionGoal:H1e,persistSessionProfile:d8,mergedWorkspaces:a2,workspacesView:Ta,status:w8,workspaceIdForSession:Zc,savePermissionToStorage:A1e,savePlanModeToStorage:Q5,saveSwarmModeToStorage:J5,saveGoalModeToStorage:e8,draftModes:jm,saveUnread:$y,saveActiveWorkspaceToStorage:L1e,saveHiddenWorkspacesToStorage:I1e,goalErrorMessage:o0e,resetFastMoon:wr.resetFastMoon,initialized:c8,connectIssue:u8,selectedDiffPath:r8,fileDiffLines:l8,fileDiffLoading:a8});function c2(e){return e===we.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function pge(e){if(we.turnActiveBySession[e]){const t={...we.turnActiveBySession};delete t[e],we.turnActiveBySession=t}we.inFlightBySession[e]&&(we.inFlightBySession={...we.inFlightBySession,[e]:!1})}function mge(e,t){const n=we.promptIdBySession[e];ut.finishPromptLocal(e),e===we.activeSessionId?(ut.loadGitStatus(e),Xd(e)):t==="idle"&&(we.unreadBySession={...we.unreadBySession,[e]:!0},$y({[e]:!0}));const o=(we.approvalsBySession[e]??[]).length>0,s=(we.questionsBySession[e]??[]).length>0;$pe(t,o,s)&&Zi.maybeNotifyCompletion(e,{isUserWatching:c2(e),sessionTitle:we.sessions.find(i=>i.id===e)?.title??"",promptId:n,onClick:()=>{ut.selectSession(e)}}),t==="idle"&&Fd.maybePlayCompletionSound()}function gge(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;Zi.maybeNotifyQuestion({isUserWatching:c2(e),sessionTitle:we.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ut.selectSession(e)}}),Fd.maybePlayQuestionSound()}function vge(e,t){Zi.maybeNotifyApproval({isUserWatching:c2(e),sessionTitle:we.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ut.selectSession(e)}}),Fd.maybePlayApprovalSound()}function u2(){return f0e(),{workspace:y0e,sessions:k0e,activeSessionId:b0e,workspacesView:Ta,workspaceSortMode:Xc,visibleWorkspace:sge,activeWorkspaceId:Gm,sessionsForView:ige,workspaceGroups:rge,attentionBySession:_8,pendingBySession:cge,attentionByWorkspace:dge,unreadBySession:uge,recentRoots:fge,turns:_0e,tasks:C0e,activeAppTasks:Jd,todos:M0e,goal:pc,swarms:b8,swarmMembersByToolCallId:A0e,activationBadges:U0e,compaction:E0e,status:w8,sessionCost:Q0e,fileDiff:X0e,selectedDiffPath:r8,fileDiffLoading:a8,changes:Y0e,gitInfo:zp,gitDiffStats:Z0e,activePullRequest:G0e,changesByPath:oge,pendingApprovals:K0e,availableOpenInApps:hge,connection:T0e,loading:N0e,sessionLoading:I0e,loadingMoreMessages:L0e,hasMoreMessages:$0e,loadMoreMessagesError:F0e,serverVersion:O0e,backend:R0e,dangerousBypassAuth:B0e,clearDangerousBypassAuth:D0e,initialized:c8,connectIssue:u8,permission:P0e,thinking:H0e,planMode:x8,swarmMode:W0e,goalMode:z0e,queued:q0e,warnings:j0e,questions:V0e,activity:l2,turnActive:Km,inFlight:r2,working:S0e,isStartingFirstPrompt:w0e,fastMoon:wr.fastMoon,models:Nn.models,starredModelIds:Nn.starredModelIds,providers:Nn.providers,uiFontSize:wr.uiFontSize,setUiFontSize:wr.setUiFontSize,conversationToc:h8,setConversationToc:U1e,colorScheme:wr.colorScheme,setColorScheme:wr.setColorScheme,accent:wr.accent,setAccent:wr.setAccent,notifyOnComplete:Zi.notifyOnComplete,notifyOnQuestion:Zi.notifyOnQuestion,notifyOnApproval:Zi.notifyOnApproval,notifyPermission:Zi.notifyPermission,setNotifyOnComplete:Zi.setNotifyOnComplete,setNotifyOnQuestion:Zi.setNotifyOnQuestion,setNotifyOnApproval:Zi.setNotifyOnApproval,soundOnComplete:Fd.soundOnComplete,setSoundOnComplete:Fd.setSoundOnComplete,onboarded:p8,setOnboarded:j1e,load:ut.load,selectSession:ut.selectSession,clearActiveSession:ut.clearActiveSession,loadOlderMessages:ut.loadOlderMessages,loadWorkspaces:ut.loadWorkspaces,loadMoreSessions:ut.loadMoreSessions,loadAllSessions:ut.loadAllSessions,selectWorkspace:ut.selectWorkspace,openWorkspace:ut.openWorkspace,openWorkspaceDraft:ut.openWorkspaceDraft,startSessionAndSendPrompt:ut.startSessionAndSendPrompt,startSessionAndActivateSkill:ut.startSessionAndActivateSkill,startSessionAndOpenSideChat:ut.startSessionAndOpenSideChat,addWorkspaceByPath:ut.addWorkspaceByPath,browseFs:ut.browseFs,getFsHome:ut.getFsHome,sendPrompt:ut.sendPrompt,steerPrompt:ut.steerPrompt,sideChatVisible:ds.sideChatVisible,sideChatSessionId:ds.sideChatSessionId,sideChatTurns:ds.sideChatTurns,sideChatRunning:ds.sideChatRunning,sideChatSending:ds.sideChatSending,openSideChat:ds.openSideChat,closeSideChat:ds.closeSideChat,sendSideChatPrompt:ds.sendSideChatPrompt,uploadImage:ut.uploadImage,abortCurrentPrompt:ut.abortCurrentPrompt,respondApproval:ut.respondApproval,respondQuestion:ut.respondQuestion,dismissQuestion:ut.dismissQuestion,pendingQuestionActions:ut.pendingQuestionActions,pendingApprovalActions:ut.pendingApprovalActions,cancelTask:ut.cancelTask,setPermission:ut.setPermission,setThinking:Nn.setThinking,setPlanMode:ut.setPlanMode,togglePlanMode:ut.togglePlanMode,setSwarmMode:ut.setSwarmMode,toggleSwarmMode:ut.toggleSwarmMode,setGoalMode:ut.setGoalMode,toggleGoalMode:ut.toggleGoalMode,createGoal:ut.createGoal,controlGoal:ut.controlGoal,enqueue:ut.enqueue,dismissWarning:ut.dismissWarning,renameSession:ut.renameSession,renameWorkspace:ut.renameWorkspace,deleteWorkspace:ut.deleteWorkspace,reorderWorkspaces:lge,setWorkspaceSortMode:age,archiveSession:ut.archiveSession,exportSession:ut.exportSession,restoreSession:ut.restoreSession,loadArchivedSessions:ut.loadArchivedSessions,compact:ut.compact,forkSession:ut.forkSession,undo:ut.undo,unqueue:ut.unqueue,reorderQueue:ut.reorderQueue,searchFiles:ut.searchFiles,loadGitStatus:ut.loadGitStatus,loadFileDiff:ut.loadFileDiff,clearFileDiff:ut.clearFileDiff,listDir:ut.listDir,readFileContent:ut.readFileContent,getFileDownloadUrl:ut.getFileDownloadUrl,openWorkspaceFile:ut.openWorkspaceFile,openInApp:ut.openInApp,revealWorkspaceFile:ut.revealWorkspaceFile,resolveImageUrl:ut.resolveImageUrl,refreshOAuthProviderModels:Nn.refreshOAuthProviderModels,loadModels:Nn.loadModels,loadProviders:Nn.loadProviders,skills:x0e,activateSkill:Nn.activateSkill,setModel:Nn.setModel,toggleStarModel:Nn.toggleStarModel,addProvider:Nn.addProvider,deleteProvider:Nn.deleteProvider,refreshProvider:Nn.refreshProvider,refreshAllProviders:Nn.refreshAllProviders,authReady:J0e,defaultModel:ege,managedProviderStatus:tge,config:nge,updateConfig:ut.updateConfig,checkAuth:ut.checkAuth,startOAuthLogin:Nn.startOAuthLogin,pollOAuthLogin:Nn.pollOAuthLogin,cancelOAuthLogin:Nn.cancelOAuthLogin,logout:ut.logout}}const S8=Ye({__name:"LanguageSwitcher",setup(e){const{locale:t}=Mt(),n=yA.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&kA(s)}return(s,i)=>(x(),be(ms,{"model-value":C(t),options:C(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),yge=["aria-checked","aria-label","disabled"],kge=Ye({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(x(),N("button",{class:We(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:s[0]||(s[0]=i=>n("update:modelValue",!e.modelValue))},[...s[1]||(s[1]=[_("span",{class:"ui-switch__thumb"},null,-1)])],10,yge))}}),mr=at(kge,[["__scopeId","data-v-dbe22dc4"]]),bge=["aria-label"],xge=["aria-selected","onClick"],wge={class:"body"},_ge={class:"panel"},Sge={class:"sec"},Cge={class:"sec-title"},Age={class:"row"},Mge={class:"rlabel"},Ege={class:"row"},Tge={class:"rlabel"},Nge={class:"row"},Ige={class:"rlabel"},Lge={class:"num-field"},$ge=["value","aria-label"],Fge={class:"row"},Oge={class:"rlabel"},Rge={class:"row"},Bge={class:"rlabel"},Dge={class:"hint"},Pge={class:"sec"},Hge={class:"sec-title"},Wge={class:"row"},zge={class:"rlabel"},Uge={key:0,class:"hint"},qge={class:"row"},jge={class:"rlabel"},Vge={key:0,class:"hint"},Kge={class:"row"},Gge={class:"rlabel"},Yge={key:0,class:"hint"},Zge={class:"row"},Xge={class:"rlabel"},Qge={class:"panel"},Jge={class:"sec"},eve={class:"sec-title"},tve={class:"row"},nve={class:"rlabel"},ove={key:0,class:"rvalue"},sve={class:"actions"},ive={class:"panel"},rve={class:"sec"},lve={class:"sec-head"},ave={class:"sec-title"},cve={key:0,class:"saving"},uve={class:"row"},dve={class:"rlabel"},fve={class:"hint"},hve={key:0,class:"select-wrap"},pve={key:0,value:"",disabled:""},mve=["label"],gve=["value"],vve={key:1,class:"rvalue mono"},yve={class:"row"},kve={class:"rlabel"},bve={class:"hint"},xve={class:"row"},wve={class:"rlabel"},_ve={class:"hint"},Sve={class:"row"},Cve={class:"rlabel"},Ave={class:"hint"},Mve={class:"row"},Eve={class:"rlabel"},Tve={class:"hint"},Nve={key:1,class:"empty-config"},Ive={class:"panel"},Lve={class:"sec"},$ve={class:"sec-title"},Fve={class:"row"},Ove={class:"rlabel"},Rve={class:"rvalue mono"},Bve={class:"row"},Dve={class:"rlabel"},Pve={class:"rvalue mono"},Hve={class:"row"},Wve={class:"rlabel"},zve={class:"rvalue mono"},Uve={key:0,class:"row"},qve={class:"rlabel"},jve={class:"hint"},Vve={class:"hint"},Kve={class:"row"},Gve={class:"rlabel"},Yve={key:0,class:"hint"},Zve={class:"panel"},Xve={class:"panel-head"},Qve={class:"panel-title"},Jve={class:"panel-desc"},eye={class:"archive-toolbar"},tye={class:"archive-search"},nye=["placeholder"],oye={value:"all"},sye=["value"],iye={key:0,class:"archive-empty"},rye={key:0,class:"archive-list"},lye={class:"archive-workspace"},aye={class:"path"},cye={class:"count"},uye={class:"setting-card"},dye={class:"archive-meta"},fye={class:"archive-name"},hye={class:"archive-time"},pye={key:1,class:"archive-empty"},mye=100,gye=Ye({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},backend:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Mt(),o=e,s=t,i=Z("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"archived",labelKey:"settings.tabs.archived"}],l=wI(),a=R(()=>o.backend==="v2"?"v2 (kap-server)":"v1 (server)"),c=["manual","auto","yolo"],u={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},d=Z(null);Hk(d);function f(ee){ee.key==="Escape"&&s("close")}cn(()=>document.addEventListener("keydown",f)),wn(()=>document.removeEventListener("keydown",f));function h(){a5()}const p=R(()=>{const ee=new Map;for(const ne of o.models??[])ee.set(ne.id,{id:ne.id,label:ne.displayName??ne.model??ne.id,provider:ne.provider});for(const[ne,fe]of Object.entries(o.config?.models??{})){if(ee.has(ne))continue;const Me=v(fe);ee.set(ne,{id:ne,label:m(ne,fe,Me),provider:Me??ne})}return Array.from(ee.values())}),g=R(()=>{const ee=new Map;for(const ne of p.value){const fe=ee.get(ne.provider)??[];fe.push(ne),ee.set(ne.provider,fe)}for(const ne of ee.values())ne.sort((fe,Me)=>fe.label.localeCompare(Me.label));return Array.from(ee.entries()).toSorted(([ne],[fe])=>ne.localeCompare(fe)).map(([ne,fe])=>({provider:ne,options:fe}))}),b=R(()=>{const ee=o.config?.defaultPermissionMode;return ee==="auto"||ee==="yolo"||ee==="manual"?ee:"manual"});function v(ee){if(!ee||typeof ee!="object")return;const ne=ee;return typeof ne.provider=="string"?ne.provider:void 0}function m(ee,ne,fe){if(!ne||typeof ne!="object")return ee;const Me=ne,$e=typeof Me.model=="string"?Me.model:void 0,ae=fe??v(ne);return $e&&ae?`${ee} (${ae}/${$e})`:$e?`${ee} (${$e})`:ee}function y(ee){return ee===!0}function k(ee){!ee||ee===o.config?.defaultModel||s("updateConfig",{defaultModel:ee})}function A(ee){ee!==b.value&&s("updateConfig",{defaultPermissionMode:ee})}function $(ee){const ne=o.config?.[ee];s("updateConfig",{[ee]:!y(ne)})}function L(){const ee=o.config?.thinking;return!ee||typeof ee!="object"?!0:ee.enabled!==!1}function w(){s("updateConfig",{thinking:{enabled:!L()}})}function E(){const ee=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!ee})}function T(ee){i.value=ee}const F=u2(),S=Z([]),I=Z(!1),P=Z(!1),B=Z(""),W=Z("all"),z=Z("archived-desc");async function D(){if(!(I.value||P.value)){I.value=!0;try{const ee=[];let ne;for(;;){const fe=await F.loadArchivedSessions({beforeId:ne,pageSize:mye});if(ee.push(...fe.items),!fe.hasMore||fe.items.length===0)break;const Me=fe.items.at(-1)?.id;if(Me===void 0)break;ne=Me}S.value=ee,P.value=!0}catch(ee){console.warn("loadAllArchived failed",ee)}finally{I.value=!1}}}Qe(i,ee=>{ee==="archived"&&!P.value&&D()});const q=R(()=>{const ee=new Set;for(const ne of S.value)ee.add(ne.cwd);return Array.from(ee).sort((ne,fe)=>ne.localeCompare(fe))}),j=R(()=>{const ee=B.value.trim().toLowerCase();let ne=S.value.filter(fe=>fe.archived===!0);return W.value!=="all"&&(ne=ne.filter(fe=>fe.cwd===W.value)),ee&&(ne=ne.filter(fe=>fe.title.toLowerCase().includes(ee))),ne=ne.slice(),z.value==="archived-desc"?ne.sort((fe,Me)=>Me.updatedAt.localeCompare(fe.updatedAt)):z.value==="created-desc"?ne.sort((fe,Me)=>Me.createdAt.localeCompare(fe.createdAt)):ne.sort((fe,Me)=>fe.title.localeCompare(Me.title,"zh")),ne}),ie=R(()=>{const ee=new Map;for(const ne of j.value){const fe=ee.get(ne.cwd)??[];fe.push(ne),ee.set(ne.cwd,fe)}return Array.from(ee.entries()).map(([ne,fe])=>({cwd:ne,items:fe}))});async function ue(ee){await F.restoreSession(ee)&&(S.value=S.value.filter(fe=>fe.id!==ee))}function pe(ee){const ne=new Date(ee);if(Number.isNaN(ne.getTime()))return ee;const fe=Me=>String(Me).padStart(2,"0");return`${ne.getFullYear()}-${fe(ne.getMonth()+1)}-${fe(ne.getDate())} ${fe(ne.getHours())}:${fe(ne.getMinutes())}`}return(ee,ne)=>(x(),be(Wr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:ne[19]||(ne[19]=fe=>s("close"))},{default:Ne(()=>[_("div",{ref_key:"dialogRef",ref:d,class:"sd"},[_("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(x(),N(Pe,null,nt(r,fe=>_("button",{key:fe.id,type:"button",class:We(["tab",{on:i.value===fe.id}]),role:"tab","aria-selected":i.value===fe.id,onClick:Me=>T(fe.id)},O(C(n)(fe.labelKey)),11,xge)),64))],8,bge),_("div",wge,[$n(_("section",_ge,[_("section",Sge,[_("h3",Cge,O(C(n)("settings.appearance")),1),_("div",Age,[_("span",Mge,O(C(n)("theme.colorSchemeLabel")),1),re(ms,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":ne[0]||(ne[0]=fe=>s("setColorScheme",fe))},null,8,["model-value","options"])]),_("div",Ege,[_("span",Tge,O(C(n)("theme.accentLabel")),1),re(ms,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":ne[1]||(ne[1]=fe=>s("setAccent",fe))},null,8,["model-value","options"])]),_("div",Nge,[_("span",Ige,O(C(n)("settings.uiFontSize")),1),_("label",Lge,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:ne[2]||(ne[2]=fe=>s("setUiFontSize",Number(fe.target.value)))},null,40,$ge),ne[20]||(ne[20]=_("span",{class:"num-unit"},"px",-1))])]),_("div",Fge,[_("span",Oge,O(C(n)("sidebar.language")),1),re(S8)]),_("div",Rge,[_("span",Bge,[Xe(O(C(n)("settings.conversationToc"))+" ",1),_("span",Dge,O(C(n)("settings.conversationTocHint")),1)]),re(mr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":ne[3]||(ne[3]=fe=>s("setConversationToc",fe))},null,8,["model-value","label"])])]),_("section",Pge,[_("h3",Hge,O(C(n)("settings.notifications")),1),_("div",Wge,[_("span",zge,[Xe(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(x(),N("span",Uge,O(C(n)("settings.notifyDenied")),1)):le("",!0)]),re(mr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":ne[4]||(ne[4]=fe=>s("setNotify",fe))},null,8,["model-value","disabled","label"])]),_("div",qge,[_("span",jge,[Xe(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(x(),N("span",Vge,O(C(n)("settings.notifyDenied")),1)):le("",!0)]),re(mr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":ne[5]||(ne[5]=fe=>s("setNotifyQuestion",fe))},null,8,["model-value","disabled","label"])]),_("div",Kge,[_("span",Gge,[Xe(O(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(x(),N("span",Yge,O(C(n)("settings.notifyDenied")),1)):le("",!0)]),re(mr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":ne[6]||(ne[6]=fe=>s("setNotifyApproval",fe))},null,8,["model-value","disabled","label"])]),_("div",Zge,[_("span",Xge,O(C(n)("settings.soundOnComplete")),1),re(mr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":ne[7]||(ne[7]=fe=>s("setSound",fe))},null,8,["model-value","label"])])])],512),[[mi,i.value==="general"]]),$n(_("section",Qge,[_("section",Jge,[_("h3",eve,O(C(n)("settings.account")),1),_("div",tve,[_("span",nve,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),re(Yt,{text:e.accountModel},{default:Ne(()=>[e.authReady&&e.accountModel?(x(),N("span",ove,O(e.accountModel),1)):le("",!0)]),_:1},8,["text"])]),_("div",sve,[re(Ft,{variant:"secondary",size:"sm",onClick:ne[8]||(ne[8]=fe=>{s("openOnboarding"),s("close")})},{default:Ne(()=>[Xe(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(x(),be(Ft,{key:0,variant:"danger-soft",size:"sm",onClick:ne[9]||(ne[9]=fe=>s("logout"))},{default:Ne(()=>[Xe(O(C(n)("sidebar.signOut")),1)]),_:1})):(x(),be(Ft,{key:1,variant:"primary",size:"sm",onClick:ne[10]||(ne[10]=fe=>s("login"))},{default:Ne(()=>[Xe(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[mi,i.value==="account"]]),$n(_("section",ive,[_("section",rve,[_("div",lve,[_("h3",ave,O(C(n)("settings.agentDefaults")),1),e.configSaving?(x(),N("span",cve,O(C(n)("settings.saving")),1)):le("",!0)]),e.config?(x(),N(Pe,{key:0},[_("div",uve,[_("span",dve,[Xe(O(C(n)("settings.defaultModel"))+" ",1),_("span",fve,O(C(n)("settings.defaultModelHint")),1)]),g.value.length>0?(x(),N("div",hve,[re(qv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":k},{default:Ne(()=>[e.config.defaultModel?le("",!0):(x(),N("option",pve,O(C(n)("settings.noDefaultModel")),1)),(x(!0),N(Pe,null,nt(g.value,fe=>(x(),N("optgroup",{key:fe.provider,label:fe.provider},[(x(!0),N(Pe,null,nt(fe.options,Me=>(x(),N("option",{key:Me.id,value:Me.id},O(Me.label),9,gve))),128))],8,mve))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(x(),N("span",vve,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),_("div",yve,[_("span",kve,[Xe(O(C(n)("settings.defaultPermission"))+" ",1),_("span",bve,O(C(n)("settings.defaultPermissionHint")),1)]),re(ms,{"model-value":b.value,options:c.map(fe=>({value:fe,label:C(n)(u[fe])})),"onUpdate:modelValue":ne[11]||(ne[11]=fe=>A(fe))},null,8,["model-value","options"])]),_("div",xve,[_("span",wve,[Xe(O(C(n)("settings.defaultThinking"))+" ",1),_("span",_ve,O(C(n)("settings.defaultThinkingHint")),1)]),re(mr,{"model-value":L(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":ne[12]||(ne[12]=fe=>w())},null,8,["model-value","disabled","label"])]),_("div",Sve,[_("span",Cve,[Xe(O(C(n)("settings.defaultPlanMode"))+" ",1),_("span",Ave,O(C(n)("settings.defaultPlanModeHint")),1)]),re(mr,{"model-value":y(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":ne[13]||(ne[13]=fe=>$("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),_("div",Mve,[_("span",Eve,[Xe(O(C(n)("settings.mergeSkills"))+" ",1),_("span",Tve,O(C(n)("settings.mergeSkillsHint")),1)]),re(mr,{"model-value":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":ne[14]||(ne[14]=fe=>$("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(x(),N("div",Nve,O(C(n)("settings.configUnavailable")),1))])],512),[[mi,i.value==="agent"]]),$n(_("section",Ive,[_("section",Lve,[_("h3",$ve,O(C(n)("settings.advanced")),1),_("div",Fve,[_("span",Ove,O(C(n)("sidebar.daemon")),1),_("span",Rve,O(C(l)),1)]),_("div",Bve,[_("span",Dve,O(C(n)("settings.backend")),1),_("span",Pve,O(a.value),1)]),_("div",Hve,[_("span",Wve,O(C(n)("settings.serverVersion")),1),_("span",zve,O(e.serverVersion||"-"),1)]),e.config?(x(),N("div",Uve,[_("span",qve,[Xe(O(C(n)("settings.telemetry"))+" ",1),_("span",jve,O(C(n)("settings.telemetryHint")),1),_("span",Vve,O(C(n)("settings.telemetryRestartHint")),1)]),re(mr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":ne[15]||(ne[15]=fe=>E())},null,8,["model-value","disabled","label"])])):le("",!0),_("div",Kve,[_("span",Gve,[Xe(O(C(n)("settings.exportLog"))+" ",1),C(Di)()?le("",!0):(x(),N("span",Yve,O(C(n)("settings.logHint")),1))]),re(Ft,{variant:"secondary",size:"sm",onClick:h},{default:Ne(()=>[Xe(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[mi,i.value==="advanced"]]),$n(_("section",Zve,[_("div",Xve,[ne[21]||(ne[21]=_("div",{class:"panel-kicker"},"Archived sessions",-1)),_("h4",Qve,O(C(n)("settings.archivedTitle")),1),_("p",Jve,O(C(n)("settings.archivedDesc")),1)]),_("div",eye,[_("label",tye,[ne[22]||(ne[22]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("circle",{cx:"11",cy:"11",r:"7"}),_("path",{d:"m21 21-4.3-4.3"})],-1)),$n(_("input",{"onUpdate:modelValue":ne[16]||(ne[16]=fe=>B.value=fe),placeholder:C(n)("settings.archivedSearch")},null,8,nye),[[ws,B.value]])]),re(qv,{"model-value":W.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":ne[17]||(ne[17]=fe=>W.value=fe)},{default:Ne(()=>[_("option",oye,O(C(n)("settings.archivedAllWorkspaces")),1),(x(!0),N(Pe,null,nt(q.value,fe=>(x(),N("option",{key:fe,value:fe},O(fe),9,sye))),128))]),_:1},8,["model-value","aria-label"]),re(ms,{size:"sm","model-value":z.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":ne[18]||(ne[18]=fe=>z.value=fe)},null,8,["model-value","options"])]),I.value?(x(),N("div",iye,O(C(n)("settings.archivedLoadingAll")),1)):(x(),N(Pe,{key:1},[ie.value.length>0?(x(),N("div",rye,[(x(!0),N(Pe,null,nt(ie.value,fe=>(x(),N("section",{key:fe.cwd,class:"archive-card"},[_("div",lye,[ne[23]||(ne[23]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("path",{d:"M3 7h6l2 2h10v9H3z"}),_("path",{d:"M3 7V5h6l2 2"})],-1)),_("span",aye,O(fe.cwd),1),_("span",cye,O(C(n)("settings.archivedSessionsCount",{count:fe.items.length})),1)]),_("div",uye,[(x(!0),N(Pe,null,nt(fe.items,Me=>(x(),N("div",{key:Me.id,class:"archive-row"},[_("div",dye,[_("div",fye,O(Me.title),1),_("div",hye,O(C(n)("settings.archivedAt",{time:pe(Me.updatedAt)})),1)]),re(Ft,{variant:"secondary",size:"sm",onClick:$e=>ue(Me.id)},{default:Ne(()=>[Xe(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(x(),N("div",pye,O(S.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[mi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),vye=at(gye,[["__scopeId","data-v-2377814f"]]),yye=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,C8=/^[A-Za-z]:[\\/]/,kye=/^\/\/(?!\/)/;function bg(e){return yye.test(e.trim())}function bye(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function xye(e){return kye.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function wye(e){return C8.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function _ye(e){return C8.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function Jv(e,t){let n=xye(bye(e.trim(),t));const o=wye(n),s=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),i=o?/[\\/]$/.test(n):n.endsWith("/");!s&&i&&(n=n.slice(0,-1));const r=n.lastIndexOf("/"),l=o?n.lastIndexOf("\\"):-1,a=Math.max(r,l),c=l>r?"\\":"/",u=_ye(n),d=a<u?n.slice(0,u)||"/":n.slice(0,a)||"/";return{target:n,parent:d,base:n.slice(a+1),separator:c}}function Sye(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function Cye(e,t,n){if(n===null)return null;const{target:o}=Jv(e,t);return o===n?n:null}const Aye={class:"aw"},Mye={key:0,class:"crumbbar"},Eye={class:"crumbs"},Tye={key:0,class:"crumb-sep"},Nye=["onClick"],Iye=["placeholder"],Lye={key:2,class:"folder-list"},$ye={key:0,class:"fl-loading"},Fye={key:0,class:"fl-loading"},Oye={key:0,class:"fl-note"},Rye=["onClick"],Bye={class:"folder-name"},Dye={key:0,class:"git-branch"},Pye={key:1,class:"fl-empty fl-error"},Hye={key:2,class:"fl-empty fl-error"},Wye=["onClick"],zye={class:"folder-name search-rel"},Uye={key:0,class:"git-branch"},qye={key:0,class:"fl-empty"},jye={key:1,class:"fl-loading"},Vye=["onClick"],Kye={class:"folder-name"},Gye={key:0,class:"git-branch"},Yye={key:0,class:"fl-empty"},Zye={key:3,class:"degraded-hint"},Xye={key:4,class:"add-error",role:"alert"},Qye={class:"actions"},Jye={class:"footer-hint"},eke=600,tke=6,s4=150,nke=Ye({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Mt(),o=e,s=t,i=Z(!0),r=Z(!1),l=Z(!1),a=Z(""),c=Z(null),u=Z([]),d=Z(""),f=Z(!1),h=Z([]),p=R(()=>d.value.trim().length>0);let g=0,b=null;const v=R(()=>bg(d.value)),m=Z("idle"),y=Z(""),k=Z("/"),A=Z([]),$=Z(""),L=Z(null),w=Z(null),E=R(()=>m.value!=="valid"?null:Cye(d.value,$.value,w.value));let T=0,F=null;function S(ne,fe){const Me=ne.toLowerCase(),$e=fe.toLowerCase();let ae=0;for(let U=0;U<$e.length&&ae<Me.length;U++)$e[U]===Me[ae]&&ae++;return ae===Me.length}async function I(ne){const fe=a.value,Me=ne.trim();if(!fe||Me===""){h.value=[],f.value=!1;return}const $e=++g;f.value=!0;const ae=[],U=[{path:fe,depth:0}];let ce=0;for(;U.length>0&&ce<eke&&ae.length<s4;){if($e!==g)return;const se=U.shift();ce++;let V;try{V=await o.browseFs(se.path)}catch{continue}if($e!==g)return;for(const Q of V.entries){if(!Q.isDir)continue;const ke=Q.path.startsWith(fe)?Q.path.slice(fe.length).replace(/^\/+/,""):Q.path;if(S(Me,ke||Q.name)&&(ae.push({path:Q.path,name:Q.name,rel:ke||Q.name,isGitRepo:Q.isGitRepo,branch:Q.branch}),ae.length>=s4))break;se.depth+1<tke&&U.push({path:Q.path,depth:se.depth+1})}$e===g&&(h.value=[...ae])}$e===g&&(f.value=!1)}Qe(d,ne=>{b&&clearTimeout(b),F&&clearTimeout(F),T++,m.value="idle",A.value=[],w.value=null;const fe=ne.trim();if(fe===""){g++,h.value=[],f.value=!1;return}if(bg(fe)){if(g++,h.value=[],f.value=!1,l.value)return;m.value="checking",F=setTimeout(()=>void P(fe),150);return}b=setTimeout(()=>void I(ne),220)});async function P(ne){const fe=++T;m.value="checking",w.value=null;const Me=Jv(ne,$.value),{target:$e}=Me;try{const U=await o.browseFs($e);if(fe!==T)return;if(U.path){m.value="valid",A.value=[],w.value=$e,a.value=U.path,c.value=U.parent,u.value=U.entries,l.value=!1;return}}catch{}if(fe!==T)return;const ae=Me.base.toLowerCase();y.value=Me.parent,k.value=Me.separator;try{const U=await o.browseFs(Me.parent);if(fe!==T)return;if(U.path){A.value=U.entries.filter(ce=>ce.isDir&&ce.name.toLowerCase().startsWith(ae)),m.value="not-found";return}}catch{}fe===T&&(A.value=[],m.value="bad-parent")}function B(ne){d.value=Sye(y.value,ne,k.value),L.value?.focus()}const W=R(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),z=R(()=>l.value?n("workspace.degradedHint"):v.value&&m.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function D(ne){if(ne.key==="Escape"){d.value?d.value="":s("close");return}if(ne.key!=="Enter")return;const fe=d.value.trim();if(bg(fe)){if(ne.preventDefault(),l.value){const{target:Me}=Jv(fe,$.value);Me&&s("add",Me);return}m.value==="valid"?ee():m.value==="not-found"&&A.value[0]&&B(A.value[0].name)}}const q=R(()=>{const ne=a.value;if(!ne)return[];const fe=ne.split("/").filter(Boolean),Me=[{label:"/",path:"/"}];let $e="";for(const ae of fe)$e+=`/${ae}`,Me.push({label:ae,path:$e});return Me}),j=R(()=>!(a.value.length===0||v.value&&E.value===null));async function ie(ne){r.value=!0;try{const fe=await o.browseFs(ne);if(!fe.path){l.value=!0;return}a.value=fe.path,c.value=fe.parent,u.value=fe.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function ue(ne){ne.isDir&&ie(ne.path)}function pe(){c.value&&ie(c.value)}function ee(){j.value&&s("add",E.value??a.value)}return cn(async()=>{r.value=!0;try{const ne=await o.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(ne.home&&($.value=ne.home),o.defaultPath&&(await ie(o.defaultPath),!l.value))return;$.value?await ie($.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),wn(()=>{b&&clearTimeout(b),F&&clearTimeout(F)}),(ne,fe)=>(x(),be(Wr,{open:i.value,"onUpdate:open":fe[2]||(fe[2]=Me=>i.value=Me),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:fe[3]||(fe[3]=Me=>s("close"))},{default:Ne(()=>[_("div",Aye,[l.value?le("",!0):(x(),N("div",Mye,[re(Wn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:pe},{default:Ne(()=>[re(je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),_("div",Eye,[(x(!0),N(Pe,null,nt(q.value,(Me,$e)=>(x(),N(Pe,{key:Me.path},[$e>1?(x(),N("span",Tye,"/")):le("",!0),_("button",{class:We(["crumb",{last:$e===q.value.length-1}]),onClick:ae=>ie(Me.path)},O(Me.label),11,Nye)],64))),128))])])),!r.value||l.value?(x(),N("div",{key:1,class:We(["filterbar",{"has-error":m.value==="not-found"||m.value==="bad-parent"}])},[re(je,{class:"filter-icon",name:"search",size:"md"}),$n(_("input",{ref_key:"filterEl",ref:L,"onUpdate:modelValue":fe[0]||(fe[0]=Me=>d.value=Me),class:"filter-input",type:"text",placeholder:W.value,autocomplete:"off",spellcheck:"false",onKeydown:bt(D,["stop"])},null,40,Iye),[[ws,d.value]]),f.value||m.value==="checking"?(x(),be(Rs,{key:0,size:"sm"})):le("",!0)],2)):le("",!0),l.value?(x(),N("div",Zye,O(C(n)("workspace.degradedHint")),1)):(x(),N("div",Lye,[r.value?(x(),N("div",$ye,O(C(n)("workspace.browsing")),1)):v.value&&m.value!=="valid"?(x(),N(Pe,{key:1},[m.value==="checking"?(x(),N("div",Fye,O(C(n)("workspace.checkingPath")),1)):m.value==="not-found"?(x(),N(Pe,{key:1},[A.value.length>0?(x(),N("div",Oye,O(C(n)("workspace.pathPickHint")),1)):le("",!0),(x(!0),N(Pe,null,nt(A.value,Me=>(x(),N("button",{key:Me.path,class:"folder-row",onClick:$e=>B(Me.name)},[re(je,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Bye,O(Me.name),1),Me.isGitRepo?(x(),be(Ns,{key:0,variant:"info",size:"sm"},{default:Ne(()=>[Xe(O(C(n)("workspace.gitTag")),1),Me.branch?(x(),N("span",Dye,O(Me.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,Rye))),128)),A.value.length===0?(x(),N("div",Pye,O(C(n)("workspace.noPathMatch",{parent:y.value})),1)):le("",!0)],64)):m.value==="bad-parent"?(x(),N("div",Hye,O(C(n)("workspace.badParent",{parent:y.value})),1)):le("",!0)],64)):p.value&&!v.value?(x(),N(Pe,{key:2},[(x(!0),N(Pe,null,nt(h.value,Me=>(x(),N("button",{key:Me.path,class:"folder-row",onClick:$e=>ie(Me.path)},[re(je,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",zye,O(Me.rel),1),Me.isGitRepo?(x(),be(Ns,{key:0,variant:"info",size:"sm"},{default:Ne(()=>[Xe(O(C(n)("workspace.gitTag")),1),Me.branch?(x(),N("span",Uye,O(Me.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,Wye))),128)),!f.value&&h.value.length===0?(x(),N("div",qye,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(x(),N("div",jye,O(C(n)("workspace.searching")),1)):le("",!0)],64)):(x(),N(Pe,{key:3},[(x(!0),N(Pe,null,nt(u.value,Me=>(x(),N("button",{key:Me.path,class:"folder-row",onClick:$e=>ue(Me)},[re(je,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Kye,O(Me.name),1),Me.isGitRepo?(x(),be(Ns,{key:0,variant:"info",size:"sm"},{default:Ne(()=>[Xe(O(C(n)("workspace.gitTag")),1),Me.branch?(x(),N("span",Gye,O(Me.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,Vye))),128)),u.value.length===0?(x(),N("div",Yye,O(C(n)("workspace.noSubfolders")),1)):le("",!0)],64))])),e.error?(x(),N("div",Xye,O(e.error),1)):le("",!0),_("div",Qye,[re(Yt,{text:a.value},{default:Ne(()=>[l.value?le("",!0):(x(),be(Ft,{key:0,variant:"primary",disabled:!j.value,onClick:ee},{default:Ne(()=>[Xe(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),re(Ft,{variant:"secondary",onClick:fe[1]||(fe[1]=Me=>s("close"))},{default:Ne(()=>[Xe(O(C(n)("workspace.cancel")),1)]),_:1})]),_("div",Jye,O(z.value),1)])]),_:1},8,["open","title"]))}}),oke=at(nke,[["__scopeId","data-v-b24b02ce"]]),ske={key:0,class:"confirm-dialog__message"},ike=Ye({__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}=Mt();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),co(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(x(),be(Wr,{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]=c=>o("update:open",c)),onClose:i},{foot:Ne(()=>[re(Ft,{variant:"secondary",disabled:e.loading,onClick:i},{default:Ne(()=>[Xe(O(e.cancelLabel??C(s)("common.cancel")),1)]),_:1},8,["disabled"]),re(Ft,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>o("confirm"))},{default:Ne(()=>[Xe(O(e.confirmLabel??C(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ne(()=>[e.message?(x(),N("p",ske,O(e.message),1)):le("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),rke=at(ike,[["__scopeId","data-v-2e719024"]]),lke=Ye({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=Yd();function i(){s()}return(r,l)=>(x(),be(rke,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,loading:C(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>C(o)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant","loading"]))}}),ake={class:"rows"},cke={class:"row"},uke={class:"row"},dke={class:"row"},fke={class:"row"},hke={class:"row"},pke={class:"row"},mke={class:"ctx-text"},gke={key:0,class:"bar"},vke={class:"row"},yke=Ye({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Mt(),o=e,s=t,i=Z(!0),r=R(()=>o.status.ctxMax>0?Math.round(o.status.ctxUsed/o.status.ctxMax*100):0),l=R(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:o.status.ctxUsed.toLocaleString(),max:o.status.ctxMax.toLocaleString(),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=R(()=>{const p=o.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=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(p,g)=>(x(),be(Wr,{open:i.value,"onUpdate:open":g[0]||(g[0]=b=>i.value=b),title:C(n)("status.statusPanelTitle"),onClose:g[1]||(g[1]=b=>s("close"))},{default:Ne(()=>[_("dl",ake,[_("div",cke,[_("dt",null,O(C(n)("status.statusModel")),1),_("dd",null,O(e.status.model),1)]),_("div",uke,[_("dt",null,O(C(n)("status.statusThinking")),1),_("dd",null,O(e.thinking),1)]),_("div",dke,[_("dt",null,O(C(n)("status.statusPermission")),1),_("dd",{style:qt({color:c.value})},O(a(e.status.permission)),5)]),_("div",fke,[_("dt",null,O(C(n)("status.statusPlanMode")),1),_("dd",{class:We({"plan-on":e.planMode})},O(u.value),3)]),_("div",hke,[_("dt",null,O(C(n)("status.statusSwarmMode")),1),_("dd",{class:We({"swarm-on":e.swarmMode})},O(d.value),3)]),_("div",pke,[_("dt",null,O(C(n)("status.statusContext")),1),_("dd",null,[_("span",mke,O(l.value),1),e.status.ctxMax>0?(x(),N("span",gke,[_("i",{style:qt({width:r.value+"%"})},null,4)])):le("",!0)])]),_("div",vke,[_("dt",null,O(C(n)("status.statusCost")),1),_("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),kke=at(yke,[["__scopeId","data-v-59dd31f3"]]),bke={class:"ui-toast__icon","aria-hidden":"true"},xke={class:"ui-toast__body"},wke={class:"ui-toast__title"},_ke={key:0,class:"ui-toast__msg"},Ske=Ye({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(x(),N("div",{class:We(["ui-toast",`ui-toast--${e.variant}`])},[_("span",bke,[Fn(t.$slots,"icon",{},()=>[e.variant==="success"?(x(),be(je,{key:0,name:"check"})):e.variant==="danger"?(x(),be(je,{key:1,name:"close"})):e.variant==="warning"?(x(),be(je,{key:2,name:"alert-triangle"})):(x(),be(je,{key:3,name:"info"}))],!0)]),_("div",xke,[_("div",wke,O(e.title),1),e.message?(x(),N("div",_ke,O(e.message),1)):le("",!0),Fn(t.$slots,"default",{},void 0,!0)]),re(Wn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:Ne(()=>[re(je,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Cke=at(Ske,[["__scopeId","data-v-adc6f346"]]),Ake={key:0,class:"actions"},Mke=["onClick"],Eke=["onClick"],Tke={key:1,class:"details"},Nke=Ye({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Mt();function i(w){return typeof w=="object"&&w!==null}function r(w){return i(w)?w.title:w}function l(w){return i(w)?w.message??"":""}function a(w){return i(w)?w.details:void 0}function c(w){return i(w)?w.severity==="error":w.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(w)}function u(w){return i(w)?`notice:${w.severity}:${w.title}:${w.message??""}:${JSON.stringify(w.details??[])}`:`text:${w}`}function d(w){if(!i(w))return w;const E=[w.title];w.message&&E.push(w.message);const T=w.details??[];if(T.length>0){E.push("",`${s("warnings.diagnostics")}:`);for(const F of T)E.push(`${F.label}: ${F.value}`)}return E.join(`
325
- `)}let f=1;const h=Z([]),p=new Map,g=new Map;function b(w){const E=c(w)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function v(w,E){const T=p.get(w)??{handle:null,deadline:0,remaining:0};T.handle=setTimeout(()=>L(w),E),T.deadline=Date.now()+E,p.set(w,T)}function m(w){const E=p.get(w);E&&E.handle!==null&&clearTimeout(E.handle),p.delete(w)}function y(w){const E=p.get(w);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function k(w){if(h.value.find(F=>F.id===w)?.detailsOpen)return;const T=p.get(w);!T||T.handle!==null||v(w,T.remaining)}function A(w){w.detailsOpen=!w.detailsOpen,w.detailsOpen?y(w.id):k(w.id)}async function $(w){if(!await Ko(d(w.warning)))return;w.copied=!0;const T=g.get(w.id);T&&clearTimeout(T),g.set(w.id,setTimeout(()=>{w.copied=!1,g.delete(w.id)},1400))}function L(w){m(w);const E=g.get(w);E&&clearTimeout(E),g.delete(w);const T=h.value.findIndex(F=>F.id===w);T!==-1&&(h.value=h.value.filter(F=>F.id!==w),o("dismiss",T))}return Qe(()=>n.warnings,w=>{const E=[...h.value];h.value=w.map(T=>{const F=u(T),S=E.findIndex(B=>B.key===F),I=S===-1?void 0:E.splice(S,1)[0];if(I)return I.warning=T,I;const P={id:f++,key:F,warning:T,detailsOpen:!1,copied:!1};return v(P.id,b(T)),P});for(const T of E){m(T.id);const F=g.get(T.id);F&&clearTimeout(F),g.delete(T.id)}},{immediate:!0,flush:"post"}),wn(()=>{p.forEach(w=>{w.handle!==null&&clearTimeout(w.handle)}),p.clear(),g.forEach(w=>clearTimeout(w)),g.clear()}),(w,E)=>(x(),be(Y9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ne(()=>[(x(!0),N(Pe,null,nt(h.value,T=>(x(),be(Cke,{key:T.id,variant:c(T.warning)?"danger":"warning",title:r(T.warning),message:l(T.warning),"dismiss-label":C(s)("warnings.dismiss"),onDismiss:F=>L(T.id),onPointerenter:F=>y(T.id),onPointerleave:F=>k(T.id)},{default:Ne(()=>[a(T.warning)?.length?(x(),N("div",Ake,[_("button",{class:"link",type:"button",onClick:F=>A(T)},O(T.detailsOpen?C(s)("warnings.hideDetails"):C(s)("warnings.showDetails")),9,Mke),_("button",{class:"link",type:"button",onClick:F=>$(T)},O(T.copied?C(s)("warnings.copied"):C(s)("warnings.copyDetails")),9,Eke)])):le("",!0),T.detailsOpen&&a(T.warning)?.length?(x(),N("dl",Tke,[(x(!0),N(Pe,null,nt(a(T.warning),F=>(x(),N("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[_("dt",null,O(F.label),1),_("dd",null,O(F.value),1)]))),128))])):le("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Ike=at(Nke,[["__scopeId","data-v-6cc72bd4"]]),Lke={class:"topbar"},$ke={class:"wsq"},Fke=["aria-label"],Oke={class:"tb-path"},Rke={class:"ws"},Bke={class:"se"},Dke={class:"tb-sub"},Pke=Ye({__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}=Mt(),o=e,s=t,i=R(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=R(()=>o.workspace?.name??n("workspace.noWorkspace")),l=R(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(x(),N("div",Lke,[_("span",$ke,O(i.value),1),_("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[_("span",Oke,[_("span",Rke,O(r.value),1),e.sessionTitle?(x(),N(Pe,{key:0},[c[2]||(c[2]=_("span",{class:"sl"},"/",-1)),_("span",Bke,O(e.sessionTitle),1)],64)):le("",!0),c[3]||(c[3]=_("span",{class:"cv"},"⌄",-1))]),_("span",Dke,[_("span",{class:We(["rd",{on:e.running}])},null,2),_("span",null,O(l.value),1),e.branch?(x(),N(Pe,{key:0},[Xe(" · "+O(e.branch),1)],64)):le("",!0),e.sessionCount>0?(x(),N(Pe,{key:1},[Xe(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):le("",!0)])],8,Fke),re(Wn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:Ne(()=>[re(je,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Hke=at(Pke,[["__scopeId","data-v-6b4b901f"]]),Wke={key:0,class:"sheet-root"},zke=["aria-label"],Uke=["aria-label"],qke={key:0,class:"sheet-head"},jke={class:"sheet-title"},Vke={class:"sheet-body"},Kke=Ye({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Mt(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return Qe(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),wn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(x(),be(El,{name:"sheet"},{default:Ne(()=>[e.modelValue?(x(),N("div",Wke,[_("div",{class:"sheet-scrim",onClick:i}),_("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[_("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,Uke),e.title?(x(),N("div",qke,[_("span",jke,O(e.title),1)])):le("",!0),_("div",Vke,[Fn(l.$slots,"default",{},void 0,!0)])],8,zke)])):le("",!0)]),_:3}))}}),A8=at(Kke,[["__scopeId","data-v-745ee5a2"]]),Gke={class:"mlist"},Yke={key:0,class:"mempty"},Zke=["onClick"],Xke={class:"mgh-main"},Qke={class:"mgh-name"},Jke={class:"mgh-path"},e2e={key:2,class:"att"},t2e={key:0,class:"mempty small"},n2e=["onClick"],o2e={class:"m"},s2e={class:"s"},i2e={key:0,class:"att"},r2e=["disabled","onClick"],l2e=["onClick"],a2e=Ye({__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}=Mt(),o=e,s=t;function i(){s("update:modelValue",!1)}function r(F){s("select",F),i()}function l(F){s("createInWorkspace",F),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=Z(new Set);function d(F){return u.value.has(F)}function f(F){const S=new Set(u.value);S.has(F)?S.delete(F):S.add(F),u.value=S,y.value=null,L.value=null}const h=Z(new Set);function p(F){return h.value.has(F)}function g(F){const S=new Set(h.value);S.has(F)?S.delete(F):S.add(F),h.value=S}function b(F){if(p(F.workspace.id))return F.sessions;const S=F.sessions.slice(0,F.initialCount);if(o.activeId&&!S.some(I=>I.id===o.activeId)){const I=F.sessions.find(P=>P.id===o.activeId);if(I)return[...S,I]}return S}function v(F){if(!h.value.has(F)){const S=new Set(h.value);S.add(F),h.value=S}s("loadMore",F)}function m(F){return o.attentionByWorkspace[F]??0}const y=Z(null);function k(F){y.value=y.value===F?null:F,L.value=null}function A(F){y.value=null;const I=(typeof window<"u"?window.prompt(n("sidebar.rename"),F.title):null)?.trim();I&&s("rename",F.id,I)}function $(F){y.value=null,s("archive",F)}const L=Z(null);function w(F){L.value=L.value===F?null:F,y.value=null}function E(F){Ko(F.root),L.value=null}function T(F){L.value=null,s("deleteWorkspace",F.id)}return(F,S)=>(x(),be(A8,{"model-value":e.modelValue,"onUpdate:modelValue":S[2]||(S[2]=I=>s("update:modelValue",I))},{default:Ne(()=>[_("button",{type:"button",class:"newrow",onClick:a},[re(je,{name:"message",size:"sm"}),Xe(" "+O(C(n)("sidebar.newChat")),1)]),_("button",{type:"button",class:"newrow secondary",onClick:c},[re(je,{name:"folder",size:"sm"}),Xe(" "+O(C(n)("sidebar.newWorkspace")),1)]),_("div",Gke,[e.groups.length===0?(x(),N("div",Yke,O(C(n)("workspace.noWorkspace")),1)):le("",!0),(x(!0),N(Pe,null,nt(e.groups,I=>(x(),N("div",{key:I.workspace.id,class:"mgroup"},[_("div",{class:We(["mgh",{on:I.workspace.id===e.activeWorkspaceId}]),onClick:P=>f(I.workspace.id)},[d(I.workspace.id)?(x(),be(je,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(x(),be(je,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),_("div",Xke,[_("span",Qke,O(I.workspace.name),1),re(Yt,{text:I.workspace.root},{default:Ne(()=>[_("span",Jke,O(I.workspace.branch||I.workspace.shortPath),1)]),_:2},1032,["text"])]),d(I.workspace.id)&&m(I.workspace.id)>0?(x(),N("span",e2e,O(m(I.workspace.id)),1)):le("",!0),re(Wn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:bt(P=>w(I.workspace.id),["stop"])},{default:Ne(()=>[re(je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),re(Wn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:bt(P=>l(I.workspace.id),["stop"])},{default:Ne(()=>[re(je,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),L.value===I.workspace.id?(x(),be(gl,{key:3,class:"kmenu wsmenu",onClick:S[0]||(S[0]=bt(()=>{},["stop"]))},{default:Ne(()=>[re(hn,{size:"lg",onClick:P=>E(I.workspace)},{default:Ne(()=>[Xe(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),re(hn,{size:"lg",danger:"",onClick:P=>T(I.workspace)},{default:Ne(()=>[Xe(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,Zke),$n(_("div",null,[I.sessions.length===0?(x(),N("div",t2e,O(C(n)("sidebar.noSessions")),1)):le("",!0),(x(!0),N(Pe,null,nt(b(I),P=>(x(),N("div",{key:P.id,class:We(["srow",{cur:P.id===e.activeId}]),onClick:B=>r(P.id)},[_("div",o2e,[_("div",{class:We(["t",{run:P.busy,aborted:!P.busy&&(e.attentionBySession[P.id]??0)===0&&(P.lastTurnReason==="cancelled"||P.lastTurnReason==="failed")}])},O(P.title),3),_("div",s2e,O(P.time),1)]),(e.attentionBySession[P.id]??0)>0?(x(),N("span",i2e,O(e.attentionBySession[P.id]),1)):le("",!0),re(Wn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:bt(B=>k(P.id),["stop"])},{default:Ne(()=>[re(je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===P.id?(x(),be(gl,{key:1,class:"kmenu",onClick:S[1]||(S[1]=bt(()=>{},["stop"]))},{default:Ne(()=>[re(hn,{size:"lg",onClick:B=>A(P)},{default:Ne(()=>[Xe(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),re(hn,{size:"lg",danger:"",onClick:B=>$(P.id)},{default:Ne(()=>[Xe(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,n2e))),128)),I.hasMore||I.loadingMore?(x(),N("button",{key:1,type:"button",class:"mshow-more",disabled:I.loadingMore,onClick:bt(P=>v(I.workspace.id),["stop"])},O(I.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,I.workspace.sessionCount-I.sessions.length)})),9,r2e)):le("",!0),I.sessions.length>I.initialCount?(x(),N("button",{key:2,type:"button",class:"mshow-more",onClick:bt(P=>g(I.workspace.id),["stop"])},O(p(I.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:I.sessions.length-I.initialCount})),9,l2e)):le("",!0)],512),[[mi,!d(I.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),c2e=at(a2e,[["__scopeId","data-v-d10be77a"]]),u2e={class:"group-title"},d2e={class:"srow-main"},f2e={class:"srow-label"},h2e={class:"srow-sub"},p2e={class:"srow read-only"},m2e={class:"srow-main"},g2e={class:"srow-label"},v2e={key:0,class:"srow-sub"},y2e={class:"srow-main"},k2e={class:"srow-label"},b2e={class:"srow-sub"},x2e=["aria-checked"],w2e={class:"srow-main"},_2e={class:"srow-label"},S2e={class:"srow-sub"},C2e=["aria-checked"],A2e={class:"srow-main"},M2e={class:"srow-label"},E2e={class:"srow read-only"},T2e={class:"srow-main"},N2e={class:"srow-label"},I2e={class:"srow-sub"},L2e=["aria-label"],$2e={class:"group-title"},F2e={class:"srow-main"},O2e={class:"srow-label"},R2e={class:"srow-sub"},B2e={class:"srow read-only pref"},D2e={class:"srow-main"},P2e={class:"srow-label"},H2e={class:"srow read-only pref"},W2e={class:"srow-main"},z2e={class:"srow-label"},U2e={class:"srow read-only pref"},q2e={class:"srow-main"},j2e={class:"srow-label"},V2e={class:"num-field"},K2e=["value","aria-label"],G2e={class:"srow-main"},Y2e={class:"srow-label"},Z2e={class:"srow-sub"},X2e=["aria-checked"],Q2e={class:"srow-main"},J2e={class:"srow-label"},ebe={class:"srow-main"},tbe={class:"srow-label"},nbe={key:2,class:"srow read-only"},obe={class:"srow-main"},sbe={class:"srow-label"},ibe={class:"srow-val dim"},rbe={class:"arch-subhead"},lbe={class:"arch-count"},abe={class:"arch-tools"},cbe={key:0,class:"arch-empty"},ube={class:"arch-meta"},dbe={class:"arch-name"},fbe={class:"arch-time"},hbe={key:2,class:"arch-empty"},pbe=100,mbe=Ye({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Mt(),o=e,s=t;function i(ue){s("setColorScheme",ue)}const r=["manual","auto","yolo"],l=R(()=>o.models?.find(ue=>ue.id===o.status?.modelId)),a=R(()=>Wm(l.value)),c=R(()=>Bk(l.value)),u=R(()=>$p(l.value,o.thinking)),d=R(()=>c.value.includes(u.value)?u.value:""),f=R(()=>c.value.map(ue=>({value:ue,label:Uv(ue)}))),h=R(()=>o.planMode===!0),p=R(()=>o.swarmMode===!0),g=R(()=>{const ue=o.status.permission;return ue==="yolo"?"var(--color-danger)":ue==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),b=R(()=>{const ue=o.status.permission,pe=n(ue==="yolo"?"mobile.permYoloSub":ue==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${ue} · ${pe}`}),v=ue=>`${Math.round(ue/1e3)}k`,m=R(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(o.status.ctxUsed/o.status.ctxMax*100))):0),y=R(()=>o.status.ctxMax>0?`${v(o.status.ctxUsed)}/${v(o.status.ctxMax)}`:n("status.statusNone"));function k(ue){s("setThinking",Dk(l.value,ue))}function A(){const ue=r.indexOf(o.status.permission),pe=r[(ue+1)%r.length];s("setPermission",pe)}function $(){s("pickModel"),s("update:modelValue",!1)}function L(){s("login"),s("update:modelValue",!1)}function w(){s("logout"),s("update:modelValue",!1)}const E=u2(),T=Z("main"),F=Z([]),S=Z(!1),I=Z(!1),P=Z(""),B=Z("archived-desc");async function W(){if(!S.value){S.value=!0,I.value=!1;try{const ue=[];let pe;for(;;){const ee=await E.loadArchivedSessions({beforeId:pe,pageSize:pbe});if(ue.push(...ee.items),!ee.hasMore||ee.items.length===0)break;const ne=ee.items.at(-1)?.id;if(ne===void 0)break;pe=ne}F.value=ue,I.value=!0}catch(ue){console.warn("loadAllArchived failed",ue)}finally{S.value=!1}}}function z(){T.value="archived",P.value="",W()}function D(){T.value="main"}const q=R(()=>{const ue=P.value.trim().toLowerCase();let pe=F.value.filter(ee=>ee.archived===!0);return ue&&(pe=pe.filter(ee=>ee.title.toLowerCase().includes(ue))),pe=pe.slice(),B.value==="archived-desc"?pe.sort((ee,ne)=>ne.updatedAt.localeCompare(ee.updatedAt)):B.value==="created-desc"?pe.sort((ee,ne)=>ne.createdAt.localeCompare(ee.createdAt)):pe.sort((ee,ne)=>ee.title.localeCompare(ne.title,"zh")),pe});async function j(ue){await E.restoreSession(ue)&&(F.value=F.value.filter(ee=>ee.id!==ue))}function ie(ue){const pe=new Date(ue);if(Number.isNaN(pe.getTime()))return ue;const ee=ne=>String(ne).padStart(2,"0");return`${pe.getFullYear()}-${ee(pe.getMonth()+1)}-${ee(pe.getDate())} ${ee(pe.getHours())}:${ee(pe.getMinutes())}`}return Qe(()=>o.modelValue,ue=>{ue||(T.value="main")}),(ue,pe)=>(x(),be(A8,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":pe[6]||(pe[6]=ee=>s("update:modelValue",ee))},{default:Ne(()=>[T.value==="main"?(x(),N(Pe,{key:0},[_("div",u2e,O(C(n)("mobile.groupSession")),1),_("button",{type:"button",class:"srow",onClick:$},[_("span",d2e,[_("span",f2e,O(C(n)("status.statusModel")),1),_("span",h2e,O(e.status.model),1)]),pe[7]||(pe[7]=_("span",{class:"chev"},"›",-1))]),_("div",p2e,[_("span",m2e,[_("span",g2e,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(x(),N("span",v2e,O(C(n)("status.modeNotSupported")),1)):le("",!0)]),c.value.length>1?(x(),be(ms,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":k},null,8,["model-value","options"])):(x(),N("span",{key:1,class:We(["srow-val",{dim:u.value==="off"}])},O(u.value==="off"?C(n)("status.planOff"):C(Uv)(u.value)),3))]),_("button",{type:"button",class:"srow",onClick:pe[0]||(pe[0]=ee=>s("togglePlan"))},[_("span",y2e,[_("span",k2e,O(C(n)("status.statusPlanMode")),1),_("span",b2e,O(C(n)("mobile.planModeSub")),1)]),_("span",{class:We(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,x2e)]),_("button",{type:"button",class:"srow",onClick:pe[1]||(pe[1]=ee=>s("toggleSwarm"))},[_("span",w2e,[_("span",_2e,O(C(n)("status.statusSwarmMode")),1),_("span",S2e,O(C(n)("mobile.swarmModeSub")),1)]),_("span",{class:We(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,C2e)]),_("button",{type:"button",class:"srow",onClick:A},[_("span",A2e,[_("span",M2e,O(C(n)("status.statusPermission")),1),_("span",{class:"srow-sub",style:qt({color:g.value})},O(b.value),5)]),pe[8]||(pe[8]=_("span",{class:"chev"},"›",-1))]),_("div",E2e,[_("span",T2e,[_("span",N2e,O(C(n)("status.statusContext")),1),_("span",I2e,O(y.value),1)]),_("span",{class:"ctx-meter","aria-label":y.value},[_("i",{style:qt({width:m.value+"%"})},null,4)],8,L2e)]),_("div",$2e,O(C(n)("mobile.groupApp")),1),_("button",{type:"button",class:"srow",onClick:z},[_("span",F2e,[_("span",O2e,O(C(n)("mobile.archivedSessions")),1),_("span",R2e,O(C(n)("mobile.archivedSessionsSub")),1)]),pe[9]||(pe[9]=_("span",{class:"chev"},"›",-1))]),_("div",B2e,[_("span",D2e,[_("span",P2e,O(C(n)("theme.colorSchemeLabel")),1)]),re(ms,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),_("div",H2e,[_("span",W2e,[_("span",z2e,O(C(n)("sidebar.language")),1)]),re(S8)]),_("div",U2e,[_("span",q2e,[_("span",j2e,O(C(n)("settings.uiFontSize")),1)]),_("label",V2e,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:pe[2]||(pe[2]=ee=>s("setUiFontSize",Number(ee.target.value)))},null,40,K2e),pe[10]||(pe[10]=_("span",{class:"num-unit"},"px",-1))])]),_("button",{type:"button",class:"srow",onClick:pe[3]||(pe[3]=ee=>s("setConversationToc",!e.conversationToc))},[_("span",G2e,[_("span",Y2e,O(C(n)("settings.conversationToc")),1),_("span",Z2e,O(C(n)("settings.conversationTocHint")),1)]),_("span",{class:We(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,X2e)]),e.authReady?(x(),N("button",{key:0,type:"button",class:"srow acct out",onClick:w},[_("span",Q2e,[_("span",J2e,O(C(n)("sidebar.signOut")),1)])])):(x(),N("button",{key:1,type:"button",class:"srow acct in",onClick:L},[_("span",ebe,[_("span",tbe,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(x(),N("div",nbe,[_("span",obe,[_("span",sbe,O(C(n)("settings.serverVersion")),1)]),_("span",ibe,O(e.serverVersion),1)])):le("",!0)],64)):(x(),N(Pe,{key:1},[_("div",rbe,[_("button",{type:"button",class:"arch-back",onClick:D},[pe[11]||(pe[11]=_("span",{class:"chev back"},"‹",-1)),Xe(" "+O(C(n)("mobile.archivedBack")),1)]),_("span",lbe,O(C(n)("mobile.sessionCount",{n:q.value.length})),1)]),_("div",abe,[re(Wc,{class:"arch-search-input","model-value":P.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":pe[4]||(pe[4]=ee=>P.value=ee)},null,8,["model-value","placeholder"]),re(ms,{size:"sm","model-value":B.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":pe[5]||(pe[5]=ee=>B.value=ee)},null,8,["model-value","options"])]),S.value?(x(),N("div",cbe,O(C(n)("settings.archivedLoadingAll")),1)):q.value.length>0?(x(!0),N(Pe,{key:1},nt(q.value,ee=>(x(),N("div",{key:ee.id,class:"arch-row"},[_("div",ube,[_("div",dbe,O(ee.title),1),_("div",fbe,O(C(n)("settings.archivedAt",{time:ie(ee.updatedAt)})),1)]),re(Ft,{variant:"secondary",size:"sm",onClick:ne=>j(ee.id)},{default:Ne(()=>[Xe(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(x(),N("div",hbe,O(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),gbe=at(mbe,[["__scopeId","data-v-83a012a5"]]),vbe={class:"ob-brand"},ybe={class:"ob-brand-text"},kbe={class:"ob-title"},bbe={class:"ob-sub"},xbe={class:"ob-sec"},wbe={class:"ob-label"},_be={class:"ob-sec"},Sbe={class:"ob-label"},Cbe={class:"ob-sec"},Abe={class:"ob-label"},Mbe=Ye({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=Mt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=B5();function c(d){s.value!==d&&kA(d)}function u(){n("complete")}return(d,f)=>(x(),be(Wr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Ne(()=>[_("div",vbe,[f[4]||(f[4]=_("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[_("defs",null,[_("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[_("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),_("g",{class:"ob-eyes",fill:"#000"},[_("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),_("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),_("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),_("div",ybe,[_("div",kbe,O(C(o)("onboarding.title")),1),_("div",bbe,O(C(o)("onboarding.subtitle")),1)])])]),default:Ne(()=>[_("section",xbe,[_("div",wbe,O(C(o)("onboarding.languageLabel")),1),re(ms,{"model-value":C(s),options:C(yA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),_("section",_be,[_("div",Sbe,O(C(o)("theme.colorSchemeLabel")),1),re(ms,{"model-value":C(i),options:[{value:"light",label:C(o)("theme.light")},{value:"dark",label:C(o)("theme.dark")},{value:"system",label:C(o)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),_("section",Cbe,[_("div",Abe,O(C(o)("theme.accentLabel")),1),re(ms,{"model-value":C(r),options:[{value:"blue",label:C(o)("theme.accentBlue")},{value:"mono",label:C(o)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),re(Ft,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ne(()=>[Xe(O(C(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),Ebe=at(Mbe,[["__scopeId","data-v-fbdd3eab"]]),Tbe=["aria-label"],Nbe={class:"gload-box"},Ibe={class:"gload-text"},Lbe={key:0,class:"gload-issue"},$be={class:"gload-issue-detail"},Fbe=Ye({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Mt();return(n,o)=>(x(),N("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[_("div",Nbe,[o[0]||(o[0]=by('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-0b6dec6a><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-0b6dec6a></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-0b6dec6a></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-0b6dec6a></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-0b6dec6a></path></svg>',1)),re(Rs,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),_("div",Ibe,O(C(t)("app.connecting")),1),e.issue?(x(),N("div",Lbe,[_("div",null,O(C(t)("app.connectRetrying")),1),_("div",$be,O(e.issue),1)])):le("",!0)])],8,Tbe))}}),Obe=at(Fbe,[["__scopeId","data-v-0b6dec6a"]]),Rbe={class:"kap-root"},Bbe={class:"kap-head"},Dbe={class:"kap-count"},Pbe={class:"kap-head-actions"},Hbe={class:"kap-filters"},Wbe=["value"],zbe={class:"kap-check"},Ube={class:"kap-check"},qbe={class:"kap-view-toggle",role:"group"},jbe={key:0,class:"kap-empty"},Vbe=["onClick"],Kbe={class:"kap-ts"},Gbe={class:"kap-label"},Ybe={key:0,class:"kap-detail"},Zbe={class:"kap-detail-actions"},Xbe=["onClick"],Qbe={key:1,class:"kap-agg"},Jbe={class:"mono"},exe={class:"mono"},txe={class:"num"},nxe={class:"num"},oxe={key:0},sxe={class:"mono"},ixe={class:"num"},rxe={class:"num"},lxe={key:0},axe=Ye({__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(()=>(Ck.value,[...Rte()])),c=R(()=>{const E=new Set;for(const T of a.value)T.sessionId&&E.add(T.sessionId);return[...E].sort()});function u(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(T=>!(o.value!=="all"&&T.source!==o.value||i.value&&T.sessionId!==i.value||r.value&&!u(T)||E&&!`${T.label} ${T.kind} ${T.eventType??""} ${T.sessionId??""} ${T.requestId??""}`.toLowerCase().includes(E)))}),f=R(()=>{const E=new Map;for(const T of d.value){if(T.kind!=="ws:in"&&T.kind!=="ws:out")continue;const F=T.kind==="ws:in"?"←":"→",S=`${F} ${T.eventType??"?"} @ ${T.sessionId??"-"}`,I=E.get(S)??{key:S,sessionId:T.sessionId??"-",eventType:T.eventType??"?",dir:F,count:0};I.count++,T.seq!==void 0&&(I.lastSeq=T.seq),E.set(S,I)}return[...E.values()].sort((T,F)=>F.count-T.count)}),h=R(()=>{const E=new Map;for(const T of d.value){if(T.source!=="rest"||T.kind==="rest:request")continue;const F=`${T.method??"?"} ${T.path??"?"}`,S=E.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(T)&&S.errors++,T.durationMs!==void 0&&(S.totalMs+=T.durationMs,S.timed++),E.set(F,S)}return[...E.entries()].map(([T,F])=>({key:T,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((T,F)=>F.count-T.count)}),p=Z(null),g=Z(!0),b=Z(null),v=Z(null);Qe(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await mt();const E=b.value;E&&(E.scrollTop=E.scrollHeight)});function m(E){p.value=p.value===E?null:E}function y(E){const T=new Date(E),F=(S,I=2)=>String(S).padStart(I,"0");return`${F(T.getHours())}:${F(T.getMinutes())}:${F(T.getSeconds())}.${F(T.getMilliseconds(),3)}`}function k(E){return JSON.stringify(E,null,2)}async function A(E){await Ko(k(E))&&(v.value=E.id,setTimeout(()=>{v.value===E.id&&(v.value=null)},1500))}function $(){a5(d.value)}function L(E){return u(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 w(E){return E.source==="rest"?"REST":E.source==="client"?"APP":"WS"}return(E,T)=>(x(),N("section",Rbe,[_("header",Bbe,[T[11]||(T[11]=_("strong",null,"KAP debug",-1)),_("span",Dbe,O(d.value.length)+"/"+O(a.value.length),1),_("div",Pbe,[_("button",{type:"button",class:We({on:C(Uu)}),onClick:T[0]||(T[0]=F=>Uu.value=!C(Uu))},O(C(Uu)?"resume":"pause"),3),_("button",{type:"button",onClick:T[1]||(T[1]=F=>C(Bte)())},"clear"),_("button",{type:"button",onClick:T[2]||(T[2]=F=>$())},"export jsonl"),re(Yt,{text:"Close window"},{default:Ne(()=>[_("button",{type:"button",onClick:T[3]||(T[3]=F=>n("close"))},"✕")]),_:1})])]),_("div",Hbe,[$n(_("select",{"onUpdate:modelValue":T[4]||(T[4]=F=>o.value=F),"aria-label":"Source filter"},[...T[12]||(T[12]=[_("option",{value:"all"},"rest + ws + app",-1),_("option",{value:"rest"},"rest",-1),_("option",{value:"ws"},"ws",-1),_("option",{value:"client"},"app errors",-1)])],512),[[Pg,o.value]]),$n(_("select",{"onUpdate:modelValue":T[5]||(T[5]=F=>i.value=F),"aria-label":"Session filter"},[T[13]||(T[13]=_("option",{value:""},"all sessions",-1)),(x(!0),N(Pe,null,nt(c.value,F=>(x(),N("option",{key:F,value:F},O(F),9,Wbe))),128))],512),[[Pg,i.value]]),$n(_("input",{"onUpdate:modelValue":T[6]||(T[6]=F=>s.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[ws,s.value]]),_("label",zbe,[$n(_("input",{"onUpdate:modelValue":T[7]||(T[7]=F=>r.value=F),type:"checkbox"},null,512),[[Zh,r.value]]),T[14]||(T[14]=Xe(" errors",-1))]),_("label",Ube,[$n(_("input",{"onUpdate:modelValue":T[8]||(T[8]=F=>g.value=F),type:"checkbox"},null,512),[[Zh,g.value]]),T[15]||(T[15]=Xe(" follow",-1))]),_("div",qbe,[_("button",{type:"button",class:We({on:l.value==="timeline"}),onClick:T[9]||(T[9]=F=>l.value="timeline")},"timeline",2),_("button",{type:"button",class:We({on:l.value==="aggregate"}),onClick:T[10]||(T[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(x(),N("div",{key:0,ref_key:"listRef",ref:b,class:"kap-list"},[d.value.length===0?(x(),N("div",jbe," No trace entries yet. REST calls and WS frames will appear here. ")):le("",!0),(x(!0),N(Pe,null,nt(d.value,F=>(x(),N("div",{key:F.id,class:"kap-row-wrap"},[_("button",{type:"button",class:We(["kap-row",{expanded:p.value===F.id}]),onClick:S=>m(F.id)},[_("span",Kbe,O(y(F.ts)),1),_("span",{class:We(["kap-badge",L(F)])},O(w(F)),3),_("span",Gbe,O(F.label),1)],10,Vbe),p.value===F.id?(x(),N("div",Ybe,[_("div",Zbe,[_("button",{type:"button",onClick:S=>A(F)},O(v.value===F.id?"copied ✓":"copy json"),9,Xbe)]),_("pre",null,O(k(F)),1)])):le("",!0)]))),128))],512)):(x(),N("div",Qbe,[T[20]||(T[20]=_("h4",null,"WS frames by session / type",-1)),_("table",null,[T[17]||(T[17]=_("thead",null,[_("tr",null,[_("th",null,"dir"),_("th",null,"type"),_("th",null,"session"),_("th",null,"count"),_("th",null,"last seq")])],-1)),_("tbody",null,[(x(!0),N(Pe,null,nt(f.value,F=>(x(),N("tr",{key:F.key},[_("td",null,O(F.dir),1),_("td",Jbe,O(F.eventType),1),_("td",exe,O(F.sessionId),1),_("td",txe,O(F.count),1),_("td",nxe,O(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(x(),N("tr",oxe,[...T[16]||(T[16]=[_("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):le("",!0)])]),T[21]||(T[21]=_("h4",null,"REST by endpoint",-1)),_("table",null,[T[19]||(T[19]=_("thead",null,[_("tr",null,[_("th",null,"endpoint"),_("th",null,"count"),_("th",null,"errors"),_("th",null,"avg ms")])],-1)),_("tbody",null,[(x(!0),N(Pe,null,nt(h.value,F=>(x(),N("tr",{key:F.key},[_("td",sxe,O(F.key),1),_("td",ixe,O(F.count),1),_("td",{class:We(["num",{err:F.errors>0}])},O(F.errors),3),_("td",rxe,O(F.avgMs),1)]))),128)),h.value.length===0?(x(),N("tr",lxe,[...T[18]||(T[18]=[_("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):le("",!0)])])]))]))}}),cxe=at(axe,[["__scopeId","data-v-3cda6fe3"]]),uxe=Ye({__name:"DebugPanel",setup(e){const t=Z(!1);let n=null,o=null,s=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const h of i){const p=d.getAttribute(h);p!==null?f.setAttribute(h,p):f.removeAttribute(h)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const p of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(p.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 c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=Xh(cxe,{onClose:()=>u.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]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return cn(()=>{c()}),co(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(x(),be(Yt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ne(()=>[_("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),dxe=at(uxe,[["__scopeId","data-v-21346738"]]);function fxe({client:e,authLogoRef:t}){const n=R(()=>e.authReady.value),o=R(()=>e.initialized.value&&!n.value),s="/login",i=Z(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Qe(o,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==s&&(i.value=l(),a(s));return}window.location.pathname===s&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return wn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function hxe({running:e,showAuthGate:t}){const{t:n}=Mt(),o=["◐","◓","◑","◒"],s=Z(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}Qe(e,c=>{c?r():l()},{immediate:!0});const a=R(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});dT(()=>{typeof document<"u"&&(document.title=a.value)}),wn(()=>{l()})}const M8=Z(typeof window>"u"?0:window.innerWidth);let ah=0,qp=!1;function ey(){M8.value=window.innerWidth}function pxe(){qp||typeof window>"u"||(window.addEventListener("resize",ey),qp=!0,ey())}function mxe(){!qp||typeof window>"u"||(window.removeEventListener("resize",ey),qp=!1)}function E8(e,t,n){return Math.max(t,e-n)}function ty(e,t,n){return Math.min(n,Math.max(t,e))}function T8(){return cn(()=>{ah+=1,pxe()}),co(()=>{ah=Math.max(0,ah-1),ah===0&&mxe()}),{viewportWidth:M8}}const gxe="kimi-web.file-preview-width",mc=320;function vxe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=T8(),i=R(()=>Math.max(0,s.value-t.value)),r=R(()=>E8(i.value,mc,mc));function l(se){return ty(Math.round(se),mc,r.value)}function a(){return l(i.value/2)}const c=R(()=>a()),u=Z(c.value),d=R(()=>ty(u.value,mc,r.value)),f=Z(null),h=R(()=>{const se=f.value;if(!se)return null;const Q=e.turns.value.find(ke=>ke.id===se.turnId)?.blocks?.[se.blockIndex];return Q?.kind==="thinking"?Q.thinking:null}),p=R(()=>h.value!==null);function g(se){const V=f.value;if(V&&V.turnId===se.turnId&&V.blockIndex===se.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=se}function b(){f.value=null,n.value==="thinking"&&(n.value=null)}const v=Z(null),m=R(()=>{const se=v.value;if(!se)return null;const V=e.turns.value.find(Q=>Q.id===se.turnId);return V?.role==="compaction"&&V.text?V.text:null}),y=R(()=>m.value!==null);function k(se){if(v.value?.turnId===se.turnId){v.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",v.value=se}function A(){v.value=null,n.value==="compaction"&&(n.value=null)}const $=Z(null);function L(se){const V=e.activeAppTasks.value,Q=V.find(he=>he.id===se)??V.find(he=>he.parentToolCallId===se);if(Q)return Q.id;const ke=V.filter(he=>he.kind==="subagent"&&!he.parentToolCallId);if(ke.length===1)return ke[0].id}const w=R(()=>{const se=$.value;if(!se)return null;const V=e.activeAppTasks.value.find(Q=>Q.id===se.subagentId);return V?zme(V):null}),E=R(()=>w.value!==null);function T(se){const V=L(se);if(V){if($.value?.subagentId===V){$.value=null,n.value==="agent"&&(n.value=null);return}$.value={subagentId:V},n.value="agent"}}function F(){$.value=null,n.value==="agent"&&(n.value=null)}const S=Z(null),I=R(()=>{const se=S.value;if(!se)return null;const V=fH(e.turns.value,se);return V?{id:se,title:$a(V.name),path:dH(V.arg),lines:V.status==="error"?null:wA(V),output:V.output}:null}),P=R(()=>I.value!==null);function B(se){if(n.value==="toolDiff"&&S.value===se){W();return}n.value="toolDiff",S.value=se}function W(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const z=Z("list"),D=Z(null);function q(){if(n.value==="diff"){j();return}n.value="diff",z.value="list",D.value=null,e.loadGitStatus(e.activeSessionId.value)}function j(){n.value==="diff"&&(n.value=null),z.value="list",D.value=null,e.clearFileDiff()}async function ie(se){z.value="detail",D.value=se,await e.loadFileDiff(se)}async function ue(se){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,se):await e.openSideChat(se),n.value="btw"}function pe(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function ee(){n.value==="btw"&&(n.value=null)}const ne=R(()=>e.sideChatVisible.value),fe=R(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||y.value)&&(n.value!=="agent"||E.value)&&(n.value!=="toolDiff"||P.value)&&(n.value!=="btw"||ne.value)),Me=Z(!1),$e=Z({});function ae(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return v.value?{kind:"compaction",...v.value}:null;case"agent":return $.value?{kind:"agent",...$.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function U(se){if(se)switch(se.kind){case"thinking":f.value={turnId:se.turnId,blockIndex:se.blockIndex},n.value="thinking";break;case"compaction":v.value={turnId:se.turnId},n.value="compaction";break;case"agent":$.value={subagentId:se.subagentId},n.value="agent";break;case"toolDiff":S.value=se.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ce(){return n.value==="thinking"&&p.value?(b(),!0):n.value==="compaction"&&y.value?(A(),!0):n.value==="agent"&&E.value?(F(),!0):n.value==="toolDiff"&&P.value?(W(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(j(),!0):n.value==="btw"?(pe(),!0):!1}return Qe(e.activeSessionId,(se,V)=>{if(V){const Q=ae();Q?$e.value[V]=Q:delete $e.value[V]}o(),b(),A(),F(),W(),j(),ee(),se&&U($e.value[se])}),{PREVIEW_WIDTH_KEY:gxe,PREVIEW_MIN:mc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:g,closeThinkingPanel:b,compactionPanelText:m,compactionPanelVisible:y,openCompactionPanel:k,closeCompactionPanel:A,agentPanelMember:w,agentPanelVisible:E,openAgentPanel:T,closeAgentPanel:F,toolDiffTarget:I,toolDiffVisible:P,openToolDiff:B,closeToolDiff:W,detailDiffMode:z,detailDiffPath:D,openDiffDetail:q,closeDiffDetail:j,selectDiffFile:ie,btwVisible:ne,openSideChatTab:ue,closeSideChat:pe,hideSideChatPanel:ee,sidePanelVisible:fe,panelDragging:Me,closeOpenSidePanel:ce}}const yxe=Lt.sidebarWidth,i4=Lt.sidebarCollapsed,r4=270,xg=170,kxe=480,bxe=320;function xxe(e={}){const{viewportWidth:t}=T8(),n=Z(r4),o=Z(!1),s=Z(!1),i=R(()=>{const u=bxe+(N4(e.previewOpen)?mc:0);return Math.min(kxe,E8(t.value,xg,u))}),r=R(()=>ty(n.value,xg,i.value));function l(){try{o.value=oo(i4)==="true"}catch{o.value=!1}}function a(){try{uo(i4,String(o.value))}catch{}}function c(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:yxe,SIDEBAR_DEFAULT:r4,SIDEBAR_MIN:xg,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function wxe({client:e,detailTarget:t}){const{t:n}=Mt(),o=Z(null),s=Z(null),i=Z(!1),r=Z(null),l=Z(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=R(()=>{const L=l.value;return L?e.getFileDownloadUrl(L):null}),f=R(()=>o.value!==null);function h(L){return L.length>1?L.replace(/\/+$/,""):L}function p(L){const w=[];for(const E of L.split(/[\\/]+/))if(!(!E||E===".")){if(E===".."){w.pop();continue}w.push(E)}return w.join("/")}function g(L){const w=L.trim();if(!w)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(w))return{error:n("filePreview.errors.unsupportedPath")};if(w.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const E=h(e.status.value.cwd);if(w.startsWith("/")){if(!E||w!==E&&!w.startsWith(`${E}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=w===E?"":w.slice(E.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(w.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const T=p(w);return T?{path:T}:{error:n("filePreview.errors.emptyPath")}}async function b(L){const w=o.value;if(t.value==="file"&&w&&w.path===L.path&&w.line===L.line){k();return}const E=++a;u(),t.value="file",s.value=null,r.value=null,i.value=!0,o.value=L,l.value=null;const T=g(L.path);if("error"in T){i.value=!1,r.value=T.error;return}l.value=T.path;try{const F=await e.readFileContent(T.path);if(E!==a)return;F?s.value={...F,path:F.path||T.path}:r.value=n("filePreview.errors.loadFailed")}catch(F){if(E!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{E===a&&(i.value=!1)}}function v(L){return/^data:([^;,]+)/i.exec(L)?.[1]}function m(L){if(L.kind!=="image")return;const w=++a;u(),t.value="file",o.value=null,l.value=null,r.value=null;const E={path:L.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:L.mimeType??v(L.url)??"image/*",isBinary:!0,size:L.bytes??0};L.fileId?(i.value=!0,s.value=E,ct().getFileBlob(L.fileId).then(T=>{if(w===a){if(t.value!=="file"||!s.value){i.value=!1;return}c=URL.createObjectURL(T),s.value={...s.value,sourceUrl:c},i.value=!1}}).catch(()=>{w===a&&(s.value&&(s.value={...s.value,sourceUrl:L.url}),i.value=!1)})):(i.value=!1,s.value={...E,sourceUrl:L.url})}function y(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,u()}function k(){y(),t.value==="file"&&(t.value=null)}Qe(t,(L,w)=>{w==="file"&&L!=="file"&&y()});function A(){const L=s.value?.path??o.value?.path;L&&e.openWorkspaceFile(L,o.value?.line)}function $(){const L=s.value?.path??o.value?.path;L&&e.revealWorkspaceFile(L)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:b,openMediaPreview:m,closeFilePreview:k,openPreviewInEditor:A,revealPreviewFile:$}}const _xe=640,Sxe=`(max-width: ${_xe}px)`;function Cxe(){const e=Z(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Sxe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),wn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),wn(()=>t.removeListener(n))),e}const Axe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Mxe={class:"server-auth-card"},Exe={class:"server-auth-body"},Txe={class:"server-auth-foot"},Nxe=Ye({__name:"ServerAuthDialog",setup(e){const t=Z(""),n=Z(null),o=Z(!1);cn(()=>{mt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,p5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(x(),N("div",Axe,[_("div",Mxe,[l[1]||(l[1]=_("div",{class:"server-auth-head"},[_("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),_("p",{class:"server-auth-hint"},[Xe(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),_("code",null,"KIMI_CODE_PASSWORD"),Xe("). ")])],-1)),_("div",Exe,[re(Wc,{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"])]),_("div",Txe,[re(Ft,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:Ne(()=>[Xe(O(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),Ixe=at(Nxe,[["__scopeId","data-v-6f624612"]]),Lxe=["aria-label"],$xe=Ye({__name:"InternalBuildBanner",setup(e){const{t}=Mt(),n=TB;return(o,s)=>C(n)?(x(),N("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[s[0]||(s[0]=_("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"},[_("path",{d:"M8 2 14 13H2L8 2Z"}),_("path",{d:"M8 6v3.5"}),_("path",{d:"M8 11.5h.01"})],-1)),_("span",null,O(C(t)("app.internalBuildBanner")),1)],8,Lxe)):le("",!0)}}),Fxe=at($xe,[["__scopeId","data-v-166b3735"]]),Oxe={class:"app-shell"},Rxe={key:1,class:"auth-page"},Bxe={class:"auth-page-inner"},Dxe={class:"auth-page-copy"},Pxe=["aria-label","aria-hidden"],Hxe=Ye({__name:"App",setup(e){Ene();const t=Z(!1);let n=null;const o=u2(),s=R(()=>!o.dangerousBypassAuth.value&&t.value);In("resolveImage",o.resolveImageUrl),In("resolveSwarmMembers",Ce=>o.swarmMembersByToolCallId.value.get(Ce)??[]);const{t:i}=Mt(),{confirm:r}=Yd(),l=Di(),a=Cxe(),c=Z(!1),u=Z(!1),d=R(()=>{const Ce=o.activeSessionId.value;return o.sessions.value.find(te=>te.id===Ce)?.title??""}),f=R(()=>o.visibleWorkspace.value?.sessionCount??0),h=R(()=>o.activity.value!=="idle"),p=Z(null),{showAuthGate:g,blinkAuthLogo:b}=fxe({client:o,authLogoRef:p});hxe({running:h,showAuthGate:g});function v(Ce){const te=o.models.value.find(He=>He.id===o.status.value.modelId),ve=Bk(te),de=ve.indexOf($p(te,Ce)),_e=ve[(de+1)%ve.length]??ve[0]??"off";return Dk(te,_e)}const m=R(()=>{const Ce=o.models.value.find(te=>te.id===o.status.value.modelId);return $p(Ce,o.thinking.value)}),y=Z(!o.onboarded.value);function k(){o.setOnboarded(!0),y.value=!1}function A(){y.value=!0}let $=0;function L(){const Ce=window.visualViewport,te=document.documentElement.style;te.setProperty("--app-height",`${Ce?.height??window.innerHeight}px`),te.setProperty("--app-top",`${Ce?.offsetTop??0}px`)}function w(){$||($=requestAnimationFrame(()=>{$=0,L()}))}cn(()=>{n=Ine(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),se(),L(),window.visualViewport?.addEventListener("resize",w),window.visualViewport?.addEventListener("scroll",w),window.addEventListener("resize",w),document.addEventListener("keydown",E,!0)}),wn(()=>{document.removeEventListener("keydown",E,!0),window.visualViewport?.removeEventListener("resize",w),window.visualViewport?.removeEventListener("scroll",w),window.removeEventListener("resize",w),$&&(cancelAnimationFrame($),$=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function E(Ce){Ce.key==="Escape"&&(Ze.value||Zo()&&(Ce.stopPropagation(),Ce.preventDefault()))}const T=Z(null),F=Z(!1);Qe(o.activeSessionId,()=>{F.value=!0,mt(()=>{F.value=!1})});const{previewTarget:S,previewFile:I,previewLoading:P,previewError:B,previewDownloadUrl:W,previewExternalActions:z,openFilePreview:D,openMediaPreview:q,closeFilePreview:j,openPreviewInEditor:ie,revealPreviewFile:ue}=wxe({client:o,detailTarget:T}),pe=R(()=>T.value!==null),{SIDEBAR_WIDTH_KEY:ee,SIDEBAR_DEFAULT:ne,SIDEBAR_MIN:fe,sidebarMax:Me,sessionColWidth:$e,sidebarCollapsed:ae,sidebarDragging:U,sideWidth:ce,loadSidebarCollapsed:se,toggleSidebarCollapse:V}=xxe({previewOpen:pe}),{PREVIEW_WIDTH_KEY:Q,PREVIEW_MIN:ke,previewDefaultWidth:he,previewMax:ye,previewWidth:K,previewPanelWidth:J,thinkingPanelText:me,thinkingVisible:Ee,openThinkingPanel:Fe,closeThinkingPanel:De,compactionPanelText:ge,compactionPanelVisible:Ie,openCompactionPanel:Je,closeCompactionPanel:it,agentPanelMember:St,openAgentPanel:gt,closeAgentPanel:Tt,toolDiffTarget:Pt,openToolDiff:ft,closeToolDiff:gn,detailDiffMode:sn,detailDiffPath:Yo,openDiffDetail:jt,closeDiffDetail:vn,selectDiffFile:fo,btwVisible:st,openSideChatTab:On,closeSideChat:so,sidePanelVisible:io,panelDragging:ro,closeOpenSidePanel:Zo}=vxe({client:o,sideWidth:ce,detailTarget:T,closeFilePreview:j}),Un=Z(null),_o=Z(!1),yn=Z(!1),Xn=Z(!1),_n=Z(!1),un=Z(!1),Sn=Z(!1),Ro=Z(null),ze=Z(null),Ze=R(()=>dc.value>0||_o.value||yn.value||Xn.value||_n.value||un.value||Sn.value||y.value||c.value||u.value),kt=Z(!1),Bt=Z(!1),Rn=Z(!1),Cn=Z(!1),Wt=Z(!1);async function kn(){kt.value=!0,Bt.value=!1,_o.value=!0;try{await o.refreshOAuthProviderModels(),await o.loadModels()}catch{Bt.value=!0}finally{kt.value=!1}}async function Qn(){Rn.value=!0,Cn.value=!1,yn.value=!0;try{await o.loadProviders()}catch{Cn.value=!0}finally{Rn.value=!1}}function wt(){Xn.value=!0}async function Xo(Ce){_o.value=!1,await So(Ce)}async function So(Ce){await o.setModel(Ce)&&Ce!==o.defaultModel.value&&o.updateConfig({defaultModel:Ce})}async function Qo(Ce){await o.addProvider(Ce)}async function Bn(Ce){await o.refreshProvider(Ce)}async function Dn(Ce){await r({title:i("sidebar.archive"),message:i("sidebar.archiveConfirm"),variant:"danger",action:()=>o.archiveSession(Ce)})}async function ni(Ce){const te=o.workspacesView.value.find(ve=>ve.id===Ce)?.name??Ce;await r({title:i("sidebar.removeWorkspace"),message:i("workspace.removeWorkspaceConfirm",{name:te}),variant:"danger",action:()=>o.deleteWorkspace(Ce)})}async function Bs(Ce){await r({title:i("providers.delete"),message:i("providers.confirmDelete"),variant:"danger",action:()=>o.deleteProvider(Ce)})}async function _i(Ce){Wt.value=!0;try{await o.updateConfig(Ce)&&await o.checkAuth()}finally{Wt.value=!1}}async function ho(){return o.startOAuthLogin()}async function Pi(){return o.pollOAuthLogin()}async function Si(){return o.cancelOAuthLogin()}async function po(){Xn.value=!1,await o.checkAuth(),await o.load()}async function Ds(Ce){await o.undo(1),await mt(),Un.value?.loadComposerForEdit(Ce.text,Ce.attachments)}function ir(Ce){if(Ce==="/compact"||Ce.startsWith("/compact ")){o.compact(Ce.slice(8).trim()||void 0);return}if(Ce==="/swarm"||Ce.startsWith("/swarm ")){const te=Ce.slice(6).trim();te==="on"?o.setSwarmMode(!0):te==="off"?o.setSwarmMode(!1):te?(o.setSwarmMode(!0),o.sendPrompt(te)):o.toggleSwarmMode();return}if(Ce==="/goal"||Ce.startsWith("/goal ")){const te=Ce.slice(5).trim();te==="pause"||te==="resume"||te==="cancel"?o.controlGoal(te):te?o.createGoal(te):o.toggleGoalMode();return}if(Ce==="/btw"||Ce.startsWith("/btw ")){const te=Ce.slice(4).trim();!te&&o.sideChatVisible.value?so():On(te||void 0);return}switch(Ce){case"/new":case"/clear":Bo();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":un.value=!0;break;case"/login":wt();break;default:{const te=Ce.indexOf(" "),ve=fre((te===-1?Ce:Ce.slice(0,te)).slice(1)),de=te===-1?void 0:Ce.slice(te+1).trim()||void 0;if(!ve)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,ve,de):o.activateSkill(ve,de);break}}}function Ci(Ce){o.unqueue(Ce)}function lo(Ce){o.unqueue(Ce)}function Jo(Ce){o.reorderQueue(Ce.from,Ce.to)}async function oi(Ce){const te=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&te){await o.startSessionAndSendPrompt(te,Ce.text,Ce.attachments);return}if(!o.activeSessionId.value&&!te){Ro.value=Ce,_n.value=!0;return}o.sendPrompt(Ce.text,Ce.attachments)}async function Co(Ce){if(ze.value=null,!await o.addWorkspaceByPath(Ce)){ze.value=i("workspace.addFailed");return}_n.value=!1;const ve=Ro.value;Ro.value=null;const de=o.activeWorkspaceId.value;ve&&de&&await o.startSessionAndSendPrompt(de,ve.text,ve.attachments)}function Ps(){Ro.value=null,ze.value=null,_n.value=!1}function qn(){mt(()=>{Un.value?.focusComposer()})}function Bo(){const Ce=o.activeWorkspaceId.value;Ce?o.openWorkspaceDraft(Ce):o.clearActiveSession(),qn()}function Hs(Ce){o.openWorkspaceDraft(Ce),qn()}function es(Ce){Ce&&window.open(Ce,"_blank","noopener")}return(Ce,te)=>(x(),N("div",Oxe,[s.value?(x(),be(Ixe,{key:0})):le("",!0),C(g)?(x(),N("section",Rxe,[_("div",Bxe,[(x(),N("svg",{ref_key:"authLogoRef",ref:p,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:te[0]||(te[0]=bt(()=>{},["prevent"])),onClick:te[1]||(te[1]=(...ve)=>C(b)&&C(b)(...ve))},[...te[98]||(te[98]=[by('<defs data-v-52415c67><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-52415c67><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-52415c67></rect><g class="ch-eyes" fill="#000" data-v-52415c67><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-52415c67></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-52415c67></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-52415c67></rect>',2)])],544)),_("div",Dxe,[_("h1",null,O(C(i)("app.authPageTitle")),1),_("p",null,O(C(i)("app.authPageMessage")),1)]),re(Ft,{class:"auth-page-btn",variant:"primary",onClick:wt},{default:Ne(()=>[re(je,{name:"log-in",size:"md"}),_("span",null,O(C(i)("app.authPageLogin")),1)]),_:1})])])):(x(),N("div",{key:2,class:We(["app",{mobile:C(a),"sidebar-collapsed":C(ae)&&!C(a),"macos-desktop":C(Lc)}]),style:qt({"--preview-w":C(J)+"px"})},[C(a)?(x(),be(Hke,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:h.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:te[19]||(te[19]=ve=>c.value=!0),onOpenSettings:te[20]||(te[20]=ve=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(x(),N(Pe,{key:0},[re(QB,{collapsed:C(ae),dragging:C(U),"col-width":C(ce),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,"workspace-sort-mode":C(o).workspaceSortMode.value,backend:C(o).backend.value,onSelect:te[2]||(te[2]=ve=>C(o).selectSession(ve)),onCreate:Bo,onCreateInWorkspace:te[3]||(te[3]=ve=>Hs(ve)),onSelectWorkspace:te[4]||(te[4]=ve=>C(o).openWorkspace(ve)),onAddWorkspace:te[5]||(te[5]=ve=>_n.value=!0),onRename:te[6]||(te[6]=(ve,de)=>C(o).renameSession(ve,de)),onArchive:te[7]||(te[7]=ve=>Dn(ve)),onFork:te[8]||(te[8]=ve=>C(o).forkSession(ve)),onExport:te[9]||(te[9]=ve=>C(o).exportSession(ve)),onRenameWorkspace:te[10]||(te[10]=(ve,de)=>C(o).renameWorkspace(ve,de)),onDeleteWorkspace:te[11]||(te[11]=ve=>ni(ve)),onReorderWorkspaces:te[12]||(te[12]=ve=>C(o).reorderWorkspaces(ve)),onSetWorkspaceSortMode:te[13]||(te[13]=ve=>C(o).setWorkspaceSortMode(ve)),onLoadMoreSessions:te[14]||(te[14]=ve=>void C(o).loadMoreSessions(ve)),onLoadAllSessions:te[15]||(te[15]=ve=>void C(o).loadAllSessions()),onOpenSettings:te[16]||(te[16]=ve=>Sn.value=!0),onCollapse:C(V)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","backend","onCollapse"]),$n(re(cw,{class:"side-handle","storage-key":C(ee),"default-width":C(ne),min:C(fe),max:C(Me),"onUpdate:width":te[17]||(te[17]=ve=>$e.value=ve),"onUpdate:dragging":te[18]||(te[18]=ve=>U.value=ve)},null,8,["storage-key","default-width","min","max"]),[[mi,!C(ae)]])],64)),re(vue,{ref_key:"conversationPaneRef",ref:Un,mobile:C(a),turns:C(o).turns.value,"session-id":C(o).activeSessionId.value,approvals:C(o).pendingApprovals.value,changes:C(o).changes.value,"git-info":C(o).gitInfo.value,tasks:C(o).tasks.value,todos:C(o).todos.value,goal:C(o).goal.value,"activation-badges":C(o).activationBadges.value,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"goal-mode":C(o).goalMode.value,models:C(o).models.value,"starred-ids":C(o).starredModelIds.value,skills:C(o).skills.value,questions:C(o).questions.value,"pending-question-actions":C(o).pendingQuestionActions,"pending-approval-actions":C(o).pendingApprovalActions,running:h.value,"turn-active":C(o).turnActive.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,working:C(o).working.value,starting:C(o).isStartingFirstPrompt.value,"fast-moon":C(o).fastMoon.value,"file-reload-key":C(o).activeSessionId.value,"session-loading":C(o).sessionLoading.value,compaction:C(o).compaction.value,"has-more-messages":C(o).hasMoreMessages.value,"loading-more":C(o).loadingMoreMessages.value,"loading-more-error":C(o).loadMoreMessagesError.value,"load-older-messages":C(o).loadOlderMessages,"workspace-name":C(o).visibleWorkspace.value?.name,"workspace-root":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,"git-diff-stats":C(o).gitDiffStats.value,workspaces:C(o).workspacesView.value,"active-workspace-id":C(o).activeWorkspaceId.value,"session-title":d.value,pr:C(o).activePullRequest.value,"conversation-toc":C(o).conversationToc.value,onOpenChanges:te[21]||(te[21]=ve=>C(jt)()),onSelectWorkspace:te[22]||(te[22]=ve=>Hs(ve)),onAddWorkspace:te[23]||(te[23]=ve=>_n.value=!0),onOpenPr:es,onSubmit:te[24]||(te[24]=ve=>oi(ve)),onSteer:te[25]||(te[25]=ve=>C(o).steerPrompt(ve.text,ve.attachments)),onApproval:te[26]||(te[26]=(ve,de)=>C(o).respondApproval(ve,de)),onCancelTask:te[27]||(te[27]=ve=>C(o).cancelTask(ve)),onAnswer:te[28]||(te[28]=(ve,de)=>C(o).respondQuestion(ve,de)),onDismiss:te[29]||(te[29]=ve=>C(o).dismissQuestion(ve)),onCommand:ir,onInterrupt:te[30]||(te[30]=ve=>C(o).abortCurrentPrompt()),onUnqueue:Ci,onEditQueued:lo,onReorderQueue:Jo,onSetPermission:te[31]||(te[31]=ve=>C(o).setPermission(ve)),onSetThinking:te[32]||(te[32]=ve=>C(o).setThinking(ve)),onTogglePlan:te[33]||(te[33]=ve=>C(o).togglePlanMode()),onToggleSwarm:te[34]||(te[34]=ve=>C(o).toggleSwarmMode()),onToggleGoal:te[35]||(te[35]=ve=>C(o).toggleGoalMode()),onCreateGoal:te[36]||(te[36]=ve=>C(o).createGoal(ve)),onControlGoal:te[37]||(te[37]=ve=>C(o).controlGoal(ve)),onRefreshGitStatus:te[38]||(te[38]=ve=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:te[39]||(te[39]=(ve,de)=>C(o).renameSession(ve,de)),onForkSession:te[40]||(te[40]=ve=>C(o).forkSession(ve)),onArchiveSession:te[41]||(te[41]=ve=>Dn(ve)),onExportSession:te[42]||(te[42]=ve=>C(o).exportSession(ve)),onCompact:te[43]||(te[43]=ve=>C(o).compact()),onPickModel:te[44]||(te[44]=ve=>kn()),onSelectModel:te[45]||(te[45]=ve=>So(ve)),onOpenFile:te[46]||(te[46]=ve=>C(D)(ve)),onOpenMedia:te[47]||(te[47]=ve=>C(q)(ve)),onOpenThinking:te[48]||(te[48]=ve=>C(Fe)(ve)),onOpenCompaction:te[49]||(te[49]=ve=>C(Je)(ve)),onOpenAgent:te[50]||(te[50]=ve=>C(gt)(ve)),onOpenToolDiff:te[51]||(te[51]=ve=>C(ft)(ve)),onEditMessage:Ds},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","turn-active","queued","search-files","upload-image","working","starting","fast-moon","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","conversation-toc"]),!C(a)&&(C(Lc)||C(ae))?(x(),be(Wn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(ae)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(V)},{default:Ne(()=>[re(je,{name:C(ae)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):le("",!0),C(io)&&!C(a)?(x(),be(cw,{key:3,class:"preview-handle","storage-key":C(Q),"default-width":C(he),min:C(ke),max:C(ye),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":te[52]||(te[52]=ve=>K.value=ve),"onUpdate:dragging":te[53]||(te[53]=ve=>ro.value=ve)},null,8,["storage-key","default-width","min","max","aria-label"])):le("",!0),!C(a)||C(io)?(x(),N("aside",{key:4,class:We(["global-preview",{open:C(io),mobile:C(a),"no-anim":C(ro)||F.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(io)},[T.value==="thinking"&&C(Ee)?(x(),be(UC,{key:0,text:C(me)??"",onClose:C(De)},null,8,["text","onClose"])):T.value==="compaction"&&C(Ie)?(x(),be(UC,{key:1,text:C(ge)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(it)},null,8,["text","subtitle","onClose"])):T.value==="agent"&&C(St)?(x(),be(Dde,{key:2,member:C(St),onClose:C(Tt)},null,8,["member","onClose"])):T.value==="btw"&&C(st)?(x(),be(ife,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:te[54]||(te[54]=ve=>C(o).sendSideChatPrompt(ve)),onClose:C(so)},null,8,["turns","running","sending","onClose"])):T.value==="diff"?(x(),be($fe,{key:4,mode:C(sn),changes:C(o).changes.value,"git-info":C(o).gitInfo.value,"file-diff":C(o).fileDiff.value,"selected-diff-path":C(o).selectedDiffPath.value,"file-diff-loading":C(o).fileDiffLoading.value,closable:"",onOpen:C(fo),onBack:te[55]||(te[55]=ve=>{sn.value="list",Yo.value=null,C(o).clearFileDiff()}),onClose:C(vn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):T.value==="toolDiff"&&C(Pt)?(x(),be(Xde,{key:5,target:C(Pt),onClose:C(gn)},null,8,["target","onClose"])):T.value==="file"?(x(),be(kde,{key:6,file:C(I),loading:C(P),error:C(B),line:C(S)?.line,"download-url":C(W),closable:"","external-actions":C(z),"open-file":C(D),onClose:C(j),onOpenExternal:C(ie),onReveal:C(ue)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):le("",!0)],10,Pxe)):le("",!0),re(Fxe,{class:"internal-build-fab"}),_o.value?(x(),be(Qfe,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:kt.value,unavailable:Bt.value,onSelect:te[56]||(te[56]=ve=>Xo(ve)),onToggleStar:te[57]||(te[57]=ve=>C(o).toggleStarModel(ve)),onClose:te[58]||(te[58]=ve=>_o.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):le("",!0),Sn.value?(x(),be(vye,{key:6,"color-scheme":C(o).colorScheme.value,accent:C(o).accent.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"account-model":C(o).defaultModel.value,notify:C(o).notifyOnComplete.value,"notify-question":C(o).notifyOnQuestion.value,"notify-approval":C(o).notifyOnApproval.value,"notify-permission":C(o).notifyPermission.value,sound:C(o).soundOnComplete.value,"conversation-toc":C(o).conversationToc.value,config:C(o).config.value,models:C(o).models.value,"config-saving":Wt.value,"server-version":C(o).serverVersion.value,backend:C(o).backend.value,onSetColorScheme:te[59]||(te[59]=ve=>C(o).setColorScheme(ve)),onSetAccent:te[60]||(te[60]=ve=>C(o).setAccent(ve)),onSetUiFontSize:te[61]||(te[61]=ve=>C(o).setUiFontSize(ve)),onSetNotify:te[62]||(te[62]=ve=>C(o).setNotifyOnComplete(ve)),onSetNotifyQuestion:te[63]||(te[63]=ve=>C(o).setNotifyOnQuestion(ve)),onSetNotifyApproval:te[64]||(te[64]=ve=>C(o).setNotifyOnApproval(ve)),onSetSound:te[65]||(te[65]=ve=>C(o).setSoundOnComplete(ve)),onSetConversationToc:te[66]||(te[66]=ve=>C(o).setConversationToc(ve)),onUpdateConfig:te[67]||(te[67]=ve=>_i(ve)),onLogin:te[68]||(te[68]=()=>{Sn.value=!1,wt()}),onLogout:C(o).logout,onOpenOnboarding:te[69]||(te[69]=()=>{Sn.value=!1,A()}),onOpenProviders:te[70]||(te[70]=()=>{Sn.value=!1,Qn()}),onClose:te[71]||(te[71]=ve=>Sn.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","backend","onLogout"])):le("",!0),yn.value?(x(),be(_he,{key:7,providers:C(o).providers.value,loading:Rn.value,unavailable:Cn.value,onAdd:te[72]||(te[72]=ve=>Qo(ve)),onRefresh:te[73]||(te[73]=ve=>Bn(ve)),onDelete:te[74]||(te[74]=ve=>Bs(ve)),onOpenLogin:te[75]||(te[75]=()=>{yn.value=!1,wt()}),onClose:te[76]||(te[76]=ve=>yn.value=!1)},null,8,["providers","loading","unavailable"])):le("",!0),un.value?(x(),be(kke,{key:8,status:C(o).status.value,thinking:m.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:te[77]||(te[77]=ve=>un.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):le("",!0),_n.value?(x(),be(oke,{key:9,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,error:ze.value,onAdd:te[78]||(te[78]=ve=>Co(ve)),onClose:Ps},null,8,["browse-fs","get-fs-home","default-path","error"])):le("",!0),re(El,{name:"gload-fade"},{default:Ne(()=>[C(o).initialized.value?le("",!0):(x(),be(Obe,{key:0,issue:C(o).connectIssue.value},null,8,["issue"]))]),_:1}),C(o).initialized.value&&y.value&&!C(g)?(x(),be(Ebe,{key:10,onComplete:k,onSkip:k})):le("",!0),re(Ike,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(x(),be(dxe,{key:11})):le("",!0),re(lke),C(a)?(x(),be(c2e,{key:12,modelValue:c.value,"onUpdate:modelValue":te[79]||(te[79]=ve=>c.value=ve),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:te[80]||(te[80]=ve=>C(o).selectSession(ve)),onCreate:Bo,onCreateInWorkspace:te[81]||(te[81]=ve=>Hs(ve)),onAddWorkspace:te[82]||(te[82]=ve=>_n.value=!0),onRename:te[83]||(te[83]=(ve,de)=>C(o).renameSession(ve,de)),onArchive:te[84]||(te[84]=ve=>Dn(ve)),onDeleteWorkspace:te[85]||(te[85]=ve=>ni(ve)),onLoadMore:te[86]||(te[86]=ve=>void C(o).loadMoreSessions(ve))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):le("",!0),C(a)?(x(),be(gbe,{key:13,modelValue:u.value,"onUpdate:modelValue":te[87]||(te[87]=ve=>u.value=ve),status:C(o).status.value,thinking:C(o).thinking.value,models:C(o).models.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"conversation-toc":C(o).conversationToc.value,"server-version":C(o).serverVersion.value,onPickModel:te[88]||(te[88]=ve=>kn()),onSetThinking:te[89]||(te[89]=ve=>C(o).setThinking(ve)),onTogglePlan:te[90]||(te[90]=ve=>C(o).togglePlanMode()),onToggleSwarm:te[91]||(te[91]=ve=>C(o).toggleSwarmMode()),onSetPermission:te[92]||(te[92]=ve=>C(o).setPermission(ve)),onSetColorScheme:te[93]||(te[93]=ve=>C(o).setColorScheme(ve)),onSetUiFontSize:te[94]||(te[94]=ve=>C(o).setUiFontSize(ve)),onSetConversationToc:te[95]||(te[95]=ve=>C(o).setConversationToc(ve)),onLogin:te[96]||(te[96]=()=>{u.value=!1,wt()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):le("",!0)],6)),Xn.value?(x(),be(epe,{key:3,"on-start-o-auth-login":ho,"on-poll-o-auth-login":Pi,"on-cancel-o-auth-login":Si,onSuccess:po,onClose:te[97]||(te[97]=ve=>Xn.value=!1)})):le("",!0)]))}}),Wxe=at(Hxe,[["__scopeId","data-v-52415c67"]]);Ute();Xh(Wxe).use(An).mount("#app");export{EE as $,Y4 as A,yT as B,yo as C,Hwe as D,h4 as E,Pe as F,by as G,Xe as H,re as I,XE as J,dwe as K,Li as L,Ye as M,q9 as N,mwe as O,gwe as P,kwe as Q,$h as R,Nc as S,rm as T,vwe as U,wy as V,pwe as W,zwe as X,ywe as Y,Owe as Z,Uxe as _,z4 as a,qo as a$,Go as a0,sy as a1,Xxe as a2,uy as a3,p9 as a4,pn as a5,Jc as a6,owe as a7,jwe as a8,lwe as a9,K4 as aA,TT as aB,OT as aC,cn as aD,FT as aE,$T as aF,iy as aG,LT as aH,wn as aI,fy as aJ,nT as aK,x as aL,W9 as aM,twe as aN,In as aO,I4 as aP,ewe as aQ,Dh as aR,Oo as aS,Oh as aT,Z as aU,Twe as aV,r7 as aW,nt as aX,Fn as aY,BT as aZ,fwe as a_,uwe as aa,cwe as ab,awe as ac,Iwe as ad,Vwe as ae,Ut as af,b9 as ag,sm as ah,bl as ai,Br as aj,ao as ak,Nwe as al,Gs as am,Ml as an,pt as ao,wwe as ap,_we as aq,bn as ar,mt as as,C9 as at,We as au,zxe as av,qt as aw,ET as ax,IT as ay,co as az,Jxe as b,yQ as b$,Dwe as b0,pd as b1,qh as b2,Rwe as b3,Al as b4,KE as b5,jxe as b6,Ia as b7,cT as b8,Bwe as b9,ws as bA,mi as bB,x9 as bC,$we as bD,Qe as bE,dT as bF,swe as bG,fT as bH,Cwe as bI,Ne as bJ,bwe as bK,$n as bL,Ji as bM,Lwe as bN,bt as bO,nwe as bP,mn as bQ,ps as bR,n_e as bS,lJ as bT,FM as bU,s_e as bV,RX as bW,hk as bX,o_e as bY,hv as bZ,u_e as b_,qxe as ba,O as bb,ch as bc,hwe as bd,en as be,Gxe as bf,Kxe as bg,N4 as bh,Ewe as bi,Vxe as bj,C as bk,Hd as bl,qwe as bm,Wwe as bn,V9 as bo,iwe as bp,Awe as bq,uT as br,Uwe as bs,xwe as bt,rwe as bu,W4 as bv,Zh as bw,t7 as bx,F3 as by,Pg as bz,Fwe as c,vQ as c0,uk as c1,gQ as c2,Jwe as c3,TX as c4,Qwe as c5,xp as c6,Ywe as c7,mQ as c8,EM as c9,c_e as ca,Zwe as cb,f_e as cc,kv as cd,wc as ce,vv as cf,h_e as cg,d_e as ch,t_e as ci,js as cj,Xwe as ck,e_e as cl,DX as cm,a_e as cn,yv as co,gv as cp,l_e as cq,Gwe as cr,r_e as cs,i_e as ct,je as cu,Kwe as cv,at as cw,Mwe as d,xl as e,Yxe as f,El as g,Y9 as h,Zxe as i,Qxe as j,xi as k,Bd as l,No as m,Zp as n,Dr as o,Pwe as p,R as q,Xh as r,be as s,le as t,N as u,_ as v,i9 as w,Swe as x,s9 as y,l7 as z};