@moonshot-ai/kimi-code 0.23.1 → 0.23.3

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 (71) hide show
  1. package/dist/main.mjs +427 -206
  2. package/dist-web/assets/{CodeBlockNode-C3v9L5tu.js → CodeBlockNode-EM_kCY-N.js} +1 -1
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-OER_lgTH.js → CodeBlockShell.vue_vue_type_style_index_0_lang-CRgIOeOQ.js} +1 -1
  4. package/dist-web/assets/DesignSystemView-CHgJ_72D.css +1 -0
  5. package/dist-web/assets/DesignSystemView-CcrMrQZg.js +12 -0
  6. package/dist-web/assets/{Tooltip-C12yteht.js → Tooltip-CzU8Fz35.js} +1 -1
  7. package/dist-web/assets/{arc-06Rz4VQ-.js → arc-DJW0hKnH.js} +1 -1
  8. package/dist-web/assets/{architectureDiagram-3BPJPVTR-SukqShtR.js → architectureDiagram-3BPJPVTR-BugvyD1E.js} +1 -1
  9. package/dist-web/assets/{blockDiagram-GPEHLZMM-BNJEVQuc.js → blockDiagram-GPEHLZMM-CYo-sII1.js} +1 -1
  10. package/dist-web/assets/{c4Diagram-AAUBKEIU-C9SPPZVL.js → c4Diagram-AAUBKEIU-D5-N6MBf.js} +1 -1
  11. package/dist-web/assets/channel-CC7oTf8I.js +1 -0
  12. package/dist-web/assets/{chunk-2J33WTMH-BzX0gLZp.js → chunk-2J33WTMH-B3rIAyxG.js} +1 -1
  13. package/dist-web/assets/{chunk-4BX2VUAB-2tV0t7rP.js → chunk-4BX2VUAB-BqE5MO-d.js} +1 -1
  14. package/dist-web/assets/{chunk-55IACEB6-0TgNLC_z.js → chunk-55IACEB6-CLF660V6.js} +1 -1
  15. package/dist-web/assets/{chunk-727SXJPM-BSFCho5K.js → chunk-727SXJPM-B0BhWK0K.js} +1 -1
  16. package/dist-web/assets/{chunk-AQP2D5EJ-XiSvZi9j.js → chunk-AQP2D5EJ-DPjMnAJ0.js} +1 -1
  17. package/dist-web/assets/{chunk-FMBD7UC4-C_jrUP7r.js → chunk-FMBD7UC4-D5PTPUwg.js} +1 -1
  18. package/dist-web/assets/{chunk-ND2GUHAM-B6mTBYIB.js → chunk-ND2GUHAM-kAaY_4Vl.js} +1 -1
  19. package/dist-web/assets/{chunk-QZHKN3VN-DSY_ClX7.js → chunk-QZHKN3VN-C9evXZPa.js} +1 -1
  20. package/dist-web/assets/classDiagram-4FO5ZUOK-Khrb0akV.js +1 -0
  21. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Khrb0akV.js +1 -0
  22. package/dist-web/assets/{cose-bilkent-S5V4N54A-BJEsiRfG.js → cose-bilkent-S5V4N54A-CLouiVVi.js} +1 -1
  23. package/dist-web/assets/{dagre-BM42HDAG-CBrTyMup.js → dagre-BM42HDAG-DzxOlw1n.js} +1 -1
  24. package/dist-web/assets/{diagram-2AECGRRQ-C5TmGHID.js → diagram-2AECGRRQ-BByJ2hb_.js} +1 -1
  25. package/dist-web/assets/{diagram-5GNKFQAL-DNiKwHCr.js → diagram-5GNKFQAL-IRsTcFso.js} +1 -1
  26. package/dist-web/assets/{diagram-KO2AKTUF-Dd35hxfq.js → diagram-KO2AKTUF-OnKw1-KB.js} +1 -1
  27. package/dist-web/assets/{diagram-LMA3HP47-WrOo32AA.js → diagram-LMA3HP47-BDxe5igX.js} +1 -1
  28. package/dist-web/assets/{diagram-OG6HWLK6-DR3kJpcY.js → diagram-OG6HWLK6-C8HfQ_tC.js} +1 -1
  29. package/dist-web/assets/{erDiagram-TEJ5UH35-BmSLh1fo.js → erDiagram-TEJ5UH35-9GqhMJHB.js} +1 -1
  30. package/dist-web/assets/{flowDiagram-I6XJVG4X-zQFT0Hxs.js → flowDiagram-I6XJVG4X-BxnUU20J.js} +1 -1
  31. package/dist-web/assets/{ganttDiagram-6RSMTGT7-CG2RzgSV.js → ganttDiagram-6RSMTGT7-BvvI2pVg.js} +1 -1
  32. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-FepYh7HV.js → gitGraphDiagram-PVQCEYII-B7iu5op7.js} +1 -1
  33. package/dist-web/assets/{index-CMuCGyH1.js → index-BCLn8KKh.js} +2 -2
  34. package/dist-web/assets/{index-BUWl4lsr.js → index-Bi8oHSIr.js} +1 -1
  35. package/dist-web/assets/{index-_6Mhj8Rj.css → index-D-9xA0Nc.css} +1 -1
  36. package/dist-web/assets/index-e04Pgjfa.js +290 -0
  37. package/dist-web/assets/{index10-09ZlQIpo.js → index10-CCuAby3p.js} +1 -1
  38. package/dist-web/assets/{index11-C8YlETLm.js → index11-Dfvs1Rhd.js} +1 -1
  39. package/dist-web/assets/{index5-Dvc9jUB7.js → index5-iCBVHj23.js} +1 -1
  40. package/dist-web/assets/{index6-UocCE6Lj.js → index6-pl4U4MZe.js} +1 -1
  41. package/dist-web/assets/{index7-E3VgrKiQ.js → index7-DHIAb9rr.js} +1 -1
  42. package/dist-web/assets/{index8-Bxb-Xjem.js → index8-f7_g7Sdt.js} +2 -2
  43. package/dist-web/assets/{infoDiagram-5YYISTIA-BbI2KCTX.js → infoDiagram-5YYISTIA-CyYBC3kA.js} +1 -1
  44. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-BzZLnVVK.js → ishikawaDiagram-YF4QCWOH-Jlcx9xTb.js} +1 -1
  45. package/dist-web/assets/{journeyDiagram-JHISSGLW-1f5fa5m5.js → journeyDiagram-JHISSGLW-CL5Yb_5k.js} +1 -1
  46. package/dist-web/assets/{kanban-definition-UN3LZRKU-BQhnYXtD.js → kanban-definition-UN3LZRKU-BqnauHAF.js} +1 -1
  47. package/dist-web/assets/{linear-CPygMVCd.js → linear-CMWGjNOi.js} +1 -1
  48. package/dist-web/assets/{mermaid.core-DzyMX8Ld.js → mermaid.core-KmcIQ1Ur.js} +66 -66
  49. package/dist-web/assets/{mindmap-definition-RKZ34NQL-B35GhhQo.js → mindmap-definition-RKZ34NQL-CVr19Hb0.js} +1 -1
  50. package/dist-web/assets/{pieDiagram-4H26LBE5-BxCyeEvP.js → pieDiagram-4H26LBE5-DJkmgpkl.js} +1 -1
  51. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-C-sg-PQj.js → quadrantDiagram-W4KKPZXB-Q6FJUxUg.js} +1 -1
  52. package/dist-web/assets/{requirementDiagram-4Y6WPE33-RGkLcART.js → requirementDiagram-4Y6WPE33-CQTp7wfD.js} +1 -1
  53. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-ZDy9_EXn.js → sankeyDiagram-5OEKKPKP-CyNSPnTi.js} +1 -1
  54. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-9faAsd9D.js → sequenceDiagram-3UESZ5HK-DoC6yllg.js} +1 -1
  55. package/dist-web/assets/{stateDiagram-AJRCARHV-JM7V6DDb.js → stateDiagram-AJRCARHV-DJPyh7eE.js} +1 -1
  56. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-D6D0vb-i.js +1 -0
  57. package/dist-web/assets/{timeline-definition-PNZ67QCA-DBNxjfbt.js → timeline-definition-PNZ67QCA-C3cofncr.js} +1 -1
  58. package/dist-web/assets/{vennDiagram-CIIHVFJN-DHTh4JLY.js → vennDiagram-CIIHVFJN-D9J8WcHA.js} +1 -1
  59. package/dist-web/assets/{vue.runtime.esm-bundler-Cuefls6q.js → vue.runtime.esm-bundler-C14m1nnd.js} +1 -1
  60. package/dist-web/assets/{wardley-L42UT6IY-D70FWw9B.js → wardley-L42UT6IY-DkNDXFdt.js} +1 -1
  61. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-BPHoDdFV.js → wardleyDiagram-YWT4CUSO-BHgVdx4X.js} +1 -1
  62. package/dist-web/assets/{xychartDiagram-2RQKCTM6-U3-Pc0An.js → xychartDiagram-2RQKCTM6-eziUIMuM.js} +1 -1
  63. package/dist-web/index.html +2 -2
  64. package/package.json +5 -5
  65. package/dist-web/assets/DesignSystemView-Bm5-sKT3.js +0 -12
  66. package/dist-web/assets/DesignSystemView-CxzrbiS1.css +0 -1
  67. package/dist-web/assets/channel-8SRtyypN.js +0 -1
  68. package/dist-web/assets/classDiagram-4FO5ZUOK-BICc9PAJ.js +0 -1
  69. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-BICc9PAJ.js +0 -1
  70. package/dist-web/assets/index-BCQoQ7Uo.js +0 -292
  71. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-B_V1QY7S.js +0 -1
@@ -0,0 +1,290 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-CcrMrQZg.js","assets/DesignSystemView-CHgJ_72D.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-EM_kCY-N.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-CRgIOeOQ.js","assets/index8-f7_g7Sdt.js","assets/index11-Dfvs1Rhd.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 Zh(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Xt={},Ga=[],si=()=>{},$C=()=>!1,sd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Jh=e=>e.startsWith("onUpdate:"),wn=Object.assign,Zv=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},LE=Object.prototype.hasOwnProperty,fn=(e,t)=>LE.call(e,t),wt=Array.isArray,Ya=e=>kc(e)==="[object Map]",ea=e=>kc(e)==="[object Set]",fb=e=>kc(e)==="[object Date]",NE=e=>kc(e)==="[object RegExp]",Lt=e=>typeof e=="function",En=e=>typeof e=="string",zs=e=>typeof e=="symbol",hn=e=>e!==null&&typeof e=="object",Jv=e=>(hn(e)||Lt(e))&&Lt(e.then)&&Lt(e.catch),LC=Object.prototype.toString,kc=e=>LC.call(e),RE=e=>kc(e).slice(8,-1),ep=e=>kc(e)==="[object Object]",tp=e=>En(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Hl=Zh(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),np=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},OE=/-\w/g,_o=np(e=>e.replace(OE,t=>t.slice(1).toUpperCase())),PE=/\B([A-Z])/g,ys=np(e=>e.replace(PE,"-$1").toLowerCase()),op=np(e=>e.charAt(0).toUpperCase()+e.slice(1)),Af=np(e=>e?`on${op(e)}`:""),Ro=(e,t)=>!Object.is(e,t),Qa=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},NC=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},sp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Kf=e=>{const t=En(e)?Number(e):NaN;return isNaN(t)?e:t};let hb;const ip=()=>hb||(hb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),DE="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",BE=Zh(DE);function en(e){if(wt(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=En(o)?WE(o):en(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(En(e)||hn(e))return e}const FE=/;(?![^(]*\))/g,HE=/:([^]+)/,zE=/\/\*[^]*?\*\//g;function WE(e){const t={};return e.replace(zE,"").split(FE).forEach(n=>{if(n){const o=n.split(HE);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function De(e){let t="";if(En(e))t=e;else if(wt(e))for(let n=0;n<e.length;n++){const o=De(e[n]);o&&(t+=o+" ")}else if(hn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function w0e(e){if(!e)return null;let{class:t,style:n}=e;return t&&!En(t)&&(e.class=De(t)),n&&(e.style=en(n)),e}const UE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",qE=Zh(UE);function RC(e){return!!e||e===""}function jE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=ar(e[o],t[o]);return n}function ar(e,t){if(e===t)return!0;let n=fb(e),o=fb(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=zs(e),o=zs(t),n||o)return e===t;if(n=wt(e),o=wt(t),n||o)return n&&o?jE(e,t):!1;if(n=hn(e),o=hn(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||!ar(e[r],t[r]))return!1}}return String(e)===String(t)}function rp(e,t){return e.findIndex(n=>ar(n,t))}const OC=e=>!!(e&&e.__v_isRef===!0),R=e=>En(e)?e:e==null?"":wt(e)||hn(e)&&(e.toString===LC||!Lt(e.toString))?OC(e)?R(e.value):JSON.stringify(e,PC,2):String(e),PC=(e,t)=>OC(t)?PC(e,t.value):Ya(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[Gm(o,i)+" =>"]=s,n),{})}:ea(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Gm(n))}:zs(t)?Gm(t):hn(t)&&!wt(t)&&!ep(t)?String(t):t,Gm=(e,t="")=>{var n;return zs(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function VE(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 bo;class DC{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&&bo&&(bo.active?(this.parent=bo,this.index=(bo.scopes||(bo.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=bo;try{return bo=this,t()}finally{bo=n}}}on(){++this._on===1&&(this.prevScope=bo,bo=this)}off(){if(this._on>0&&--this._on===0){if(bo===this)bo=this.prevScope;else{let t=bo;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 KE(e){return new DC(e)}function e0(){return bo}function t0(e,t=!1){bo&&bo.cleanups.push(e)}let Fn;const Ym=new WeakSet;class Gf{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,bo&&(bo.active?bo.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ym.has(this)&&(Ym.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||FC(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,pb(this),HC(this);const t=Fn,n=yi;Fn=this,yi=!0;try{return this.fn()}finally{zC(this),Fn=t,yi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)s0(t);this.deps=this.depsTail=void 0,pb(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ym.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){A1(this)&&this.run()}get dirty(){return A1(this)}}let BC=0,du,fu;function FC(e,t=!1){if(e.flags|=8,t){e.next=fu,fu=e;return}e.next=du,du=e}function n0(){BC++}function o0(){if(--BC>0)return;if(fu){let t=fu;for(fu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;du;){let t=du;for(du=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 HC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function zC(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),s0(o),GE(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function A1(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(WC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function WC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===$u)||(e.globalVersion=$u,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!A1(e))))return;e.flags|=2;const t=e.dep,n=Fn,o=yi;Fn=e,yi=!0;try{HC(e);const s=e.fn(e._value);(t.version===0||Ro(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Fn=n,yi=o,zC(e),e.flags&=-3}}function s0(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)s0(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function GE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function S0e(e,t){e.effect instanceof Gf&&(e=e.effect.fn);const n=new Gf(e);t&&wn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function C0e(e){e.effect.stop()}let yi=!0;const UC=[];function cr(){UC.push(yi),yi=!1}function ur(){const e=UC.pop();yi=e===void 0?!0:e}function pb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Fn;Fn=void 0;try{t()}finally{Fn=n}}}let $u=0;class YE{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 lp{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(!Fn||!yi||Fn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Fn)n=this.activeLink=new YE(Fn,this),Fn.deps?(n.prevDep=Fn.depsTail,Fn.depsTail.nextDep=n,Fn.depsTail=n):Fn.deps=Fn.depsTail=n,qC(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=Fn.depsTail,n.nextDep=void 0,Fn.depsTail.nextDep=n,Fn.depsTail=n,Fn.deps===n&&(Fn.deps=o)}return n}trigger(t){this.version++,$u++,this.notify(t)}notify(t){n0();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{o0()}}}function qC(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)qC(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Yf=new WeakMap,zl=Symbol(""),M1=Symbol(""),Lu=Symbol("");function Vo(e,t,n){if(yi&&Fn){let o=Yf.get(e);o||Yf.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new lp),s.map=o,s.key=n),s.track()}}function er(e,t,n,o,s,i){const r=Yf.get(e);if(!r){$u++;return}const l=a=>{a&&a.trigger()};if(n0(),t==="clear")r.forEach(l);else{const a=wt(e),c=a&&tp(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===Lu||!zs(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Lu)),t){case"add":a?c&&l(r.get("length")):(l(r.get(zl)),Ya(e)&&l(r.get(M1)));break;case"delete":a||(l(r.get(zl)),Ya(e)&&l(r.get(M1)));break;case"set":Ya(e)&&l(r.get(zl));break}}o0()}function QE(e,t){const n=Yf.get(e);return n&&n.get(t)}function Ca(e){const t=on(e);return t===e?t:(Vo(t,"iterate",Lu),Os(e)?t:t.map(ki))}function ap(e){return Vo(e=on(e),"iterate",Lu),e}function Ni(e,t){return dr(e)?cc(Vr(e)?ki(t):t):ki(t)}const XE={__proto__:null,[Symbol.iterator](){return Qm(this,Symbol.iterator,e=>Ni(this,e))},concat(...e){return Ca(this).concat(...e.map(t=>wt(t)?Ca(t):t))},entries(){return Qm(this,"entries",e=>(e[1]=Ni(this,e[1]),e))},every(e,t){return ji(this,"every",e,t,void 0,arguments)},filter(e,t){return ji(this,"filter",e,t,n=>n.map(o=>Ni(this,o)),arguments)},find(e,t){return ji(this,"find",e,t,n=>Ni(this,n),arguments)},findIndex(e,t){return ji(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ji(this,"findLast",e,t,n=>Ni(this,n),arguments)},findLastIndex(e,t){return ji(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ji(this,"forEach",e,t,void 0,arguments)},includes(...e){return Xm(this,"includes",e)},indexOf(...e){return Xm(this,"indexOf",e)},join(e){return Ca(this).join(e)},lastIndexOf(...e){return Xm(this,"lastIndexOf",e)},map(e,t){return ji(this,"map",e,t,void 0,arguments)},pop(){return Vc(this,"pop")},push(...e){return Vc(this,"push",e)},reduce(e,...t){return mb(this,"reduce",e,t)},reduceRight(e,...t){return mb(this,"reduceRight",e,t)},shift(){return Vc(this,"shift")},some(e,t){return ji(this,"some",e,t,void 0,arguments)},splice(...e){return Vc(this,"splice",e)},toReversed(){return Ca(this).toReversed()},toSorted(e){return Ca(this).toSorted(e)},toSpliced(...e){return Ca(this).toSpliced(...e)},unshift(...e){return Vc(this,"unshift",e)},values(){return Qm(this,"values",e=>Ni(this,e))}};function Qm(e,t,n){const o=ap(e),s=o[t]();return o!==e&&!Os(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const ZE=Array.prototype;function ji(e,t,n,o,s,i){const r=ap(e),l=r!==e&&!Os(e),a=r[t];if(a!==ZE[t]){const d=a.apply(e,i);return l?ki(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Ni(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 mb(e,t,n,o){const s=ap(e),i=s!==e&&!Os(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=Ni(e,c)),n.call(this,c,Ni(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?Ni(e,a):a}function Xm(e,t,n){const o=on(e);Vo(o,"iterate",Lu);const s=o[t](...n);return(s===-1||s===!1)&&dp(n[0])?(n[0]=on(n[0]),o[t](...n)):s}function Vc(e,t,n=[]){cr(),n0();const o=on(e)[t].apply(e,n);return o0(),ur(),o}const JE=Zh("__proto__,__v_isRef,__isVue"),jC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zs));function eI(e){zs(e)||(e=String(e));const t=on(this);return Vo(t,"has",e),t.hasOwnProperty(e)}class VC{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?ZC:XC:i?QC:YC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=wt(t);if(!s){let a;if(r&&(a=XE[n]))return a;if(n==="hasOwnProperty")return eI}const l=Reflect.get(t,n,oo(t)?t:o);if((zs(n)?jC.has(n):JE(n))||(s||Vo(t,"get",n),i))return l;if(oo(l)){const a=r&&tp(n)?l:l.value;return s&&hn(a)?Qf(a):a}return hn(l)?s?Qf(l):Bo(l):l}}class KC extends VC{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=wt(t)&&tp(n);if(!this._isShallow){const c=dr(i);if(!Os(o)&&!dr(o)&&(i=on(i),o=on(o)),!r&&oo(i)&&!oo(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:fn(t,n),a=Reflect.set(t,n,o,oo(t)?t:s);return t===on(s)&&(l?Ro(o,i)&&er(t,"set",n,o):er(t,"add",n,o)),a}deleteProperty(t,n){const o=fn(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&er(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!zs(n)||!jC.has(n))&&Vo(t,"has",n),o}ownKeys(t){return Vo(t,"iterate",wt(t)?"length":zl),Reflect.ownKeys(t)}}class GC extends VC{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const tI=new KC,nI=new GC,oI=new KC(!0),sI=new GC(!0),T1=e=>e,qd=e=>Reflect.getPrototypeOf(e);function iI(e,t,n){return function(...o){const s=this.__v_raw,i=on(s),r=Ya(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?T1:t?cc:ki;return!t&&Vo(i,"iterate",a?M1:zl),wn(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 jd(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function rI(e,t){const n={get(s){const i=this.__v_raw,r=on(i),l=on(s);e||(Ro(s,l)&&Vo(r,"get",s),Vo(r,"get",l));const{has:a}=qd(r),c=t?T1:e?cc:ki;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&&Vo(on(s),"iterate",zl),s.size},has(s){const i=this.__v_raw,r=on(i),l=on(s);return e||(Ro(s,l)&&Vo(r,"has",s),Vo(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=on(l),c=t?T1:e?cc:ki;return!e&&Vo(a,"iterate",zl),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return wn(n,e?{add:jd("add"),set:jd("set"),delete:jd("delete"),clear:jd("clear")}:{add(s){const i=on(this),r=qd(i),l=on(s),a=!t&&!Os(s)&&!dr(s)?l:s;return r.has.call(i,a)||Ro(s,a)&&r.has.call(i,s)||Ro(l,a)&&r.has.call(i,l)||(i.add(a),er(i,"add",a,a)),this},set(s,i){!t&&!Os(i)&&!dr(i)&&(i=on(i));const r=on(this),{has:l,get:a}=qd(r);let c=l.call(r,s);c||(s=on(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?Ro(i,u)&&er(r,"set",s,i):er(r,"add",s,i),this},delete(s){const i=on(this),{has:r,get:l}=qd(i);let a=r.call(i,s);a||(s=on(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&er(i,"delete",s,void 0),c},clear(){const s=on(this),i=s.size!==0,r=s.clear();return i&&er(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=iI(s,e,t)}),n}function cp(e,t){const n=rI(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(fn(n,s)&&s in o?n:o,s,i)}const lI={get:cp(!1,!1)},aI={get:cp(!1,!0)},cI={get:cp(!0,!1)},uI={get:cp(!0,!0)},YC=new WeakMap,QC=new WeakMap,XC=new WeakMap,ZC=new WeakMap;function dI(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Bo(e){return dr(e)?e:up(e,!1,tI,lI,YC)}function fI(e){return up(e,!1,oI,aI,QC)}function Qf(e){return up(e,!0,nI,cI,XC)}function x0e(e){return up(e,!0,sI,uI,ZC)}function up(e,t,n,o,s){if(!hn(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=dI(RE(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function Vr(e){return dr(e)?Vr(e.__v_raw):!!(e&&e.__v_isReactive)}function dr(e){return!!(e&&e.__v_isReadonly)}function Os(e){return!!(e&&e.__v_isShallow)}function dp(e){return e?!!e.__v_raw:!1}function on(e){const t=e&&e.__v_raw;return t?on(t):e}function vt(e){return!fn(e,"__v_skip")&&Object.isExtensible(e)&&NC(e,"__v_skip",!0),e}const ki=e=>hn(e)?Bo(e):e,cc=e=>hn(e)?Qf(e):e;function oo(e){return e?e.__v_isRef===!0:!1}function X(e){return JC(e,!1)}function ta(e){return JC(e,!0)}function JC(e,t){return oo(e)?e:new hI(e,t)}class hI{constructor(t,n){this.dep=new lp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:on(t),this._value=n?t:ki(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||Os(t)||dr(t);t=o?t:on(t),Ro(t,n)&&(this._rawValue=t,this._value=o?t:ki(t),this.dep.trigger())}}function A0e(e){e.dep&&e.dep.trigger()}function x(e){return oo(e)?e.value:e}function ex(e){return Lt(e)?e():x(e)}const pI={get:(e,t,n)=>t==="__v_raw"?e:x(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return oo(s)&&!oo(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function tx(e){return Vr(e)?e:new Proxy(e,pI)}class mI{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new lp,{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 gI(e){return new mI(e)}function M0e(e){const t=wt(e)?new Array(e.length):{};for(const n in e)t[n]=nx(e,n);return t}class vI{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=zs(n)?n:String(n),this._raw=on(t);let s=!0,i=t;if(!wt(t)||zs(this._key)||!tp(this._key))do s=!dp(i)||Os(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=x(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&oo(this._raw[this._key])){const n=this._object[this._key];if(oo(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return QE(this._raw,this._key)}}class yI{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 T0e(e,t,n){return oo(e)?e:Lt(e)?new yI(e):hn(e)&&arguments.length>1?nx(e,t,n):X(e)}function nx(e,t,n){return new vI(e,t,n)}class kI{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new lp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=$u-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Fn!==this)return FC(this,!0),!0}get value(){const t=this.dep.track();return WC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function bI(e,t,n=!1){let o,s;return Lt(e)?o=e:(o=e.get,s=e.set),new kI(o,s,n)}const E0e={GET:"get",HAS:"has",ITERATE:"iterate"},I0e={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Vd={},Xf=new WeakMap;let Dr;function $0e(){return Dr}function _I(e,t=!1,n=Dr){if(n){let o=Xf.get(n);o||Xf.set(n,o=[]),o.push(e)}}function wI(e,t,n=Xt){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>s?y:Os(y)||s===!1||s===0?tr(y,1):tr(y);let u,d,f,p,h=!1,m=!1;if(oo(e)?(d=()=>e.value,h=Os(e)):Vr(e)?(d=()=>c(e),h=!0):wt(e)?(m=!0,h=e.some(y=>Vr(y)||Os(y)),d=()=>e.map(y=>{if(oo(y))return y.value;if(Vr(y))return c(y);if(Lt(y))return a?a(y,2):y()})):Lt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){cr();try{f()}finally{ur()}}const y=Dr;Dr=u;try{return a?a(e,3,[p]):e(p)}finally{Dr=y}}:d=si,t&&s){const y=d,M=s===!0?1/0:s;d=()=>tr(y(),M)}const w=e0(),k=()=>{u.stop(),w&&w.active&&Zv(w.effects,u)};if(i&&t){const y=t;t=(...M)=>{y(...M),k()}}let g=m?new Array(e.length).fill(Vd):Vd;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const M=u.run();if(s||h||(m?M.some((O,L)=>Ro(O,g[L])):Ro(M,g))){f&&f();const O=Dr;Dr=u;try{const L=[M,g===Vd?void 0:m&&g[0]===Vd?[]:g,p];g=M,a?a(t,3,L):t(...L)}finally{Dr=O}}}else u.run()};return l&&l(v),u=new Gf(d),u.scheduler=r?()=>r(v,!1):v,p=y=>_I(y,!1,u),f=u.onStop=()=>{const y=Xf.get(u);if(y){if(a)a(y,4);else for(const M of y)M();Xf.delete(u)}},t?o?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),k.pause=u.pause.bind(u),k.resume=u.resume.bind(u),k.stop=k,k}function tr(e,t=1/0,n){if(t<=0||!hn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,oo(e))tr(e.value,t,n);else if(wt(e))for(let o=0;o<e.length;o++)tr(e[o],t,n);else if(ea(e)||Ya(e))e.forEach(o=>{tr(o,t,n)});else if(ep(e)){for(const o in e)tr(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&tr(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 ox=[];function SI(e){ox.push(e)}function CI(){ox.pop()}function L0e(e,t){}const N0e={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"},xI={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 id(e,t,n,o){try{return o?e(...o):e()}catch(s){bc(s,t,n)}}function li(e,t,n,o){if(Lt(e)){const s=id(e,t,n,o);return s&&Jv(s)&&s.catch(i=>{bc(i,t,n)}),s}if(wt(e)){const s=[];for(let i=0;i<e.length;i++)s.push(li(e[i],t,n,o));return s}}function bc(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Xt;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){cr(),id(i,null,10,[e,a,c]),ur();return}}AI(e,n,s,o,r)}function AI(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const ts=[];let Ii=-1;const Xa=[];let Br=null,La=0;const sx=Promise.resolve();let Zf=null;function gt(e){const t=Zf||sx;return e?t.then(this?e.bind(this):e):t}function MI(e){let t=Ii+1,n=ts.length;for(;t<n;){const o=t+n>>>1,s=ts[o],i=Nu(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function i0(e){if(!(e.flags&1)){const t=Nu(e),n=ts[ts.length-1];!n||!(e.flags&2)&&t>=Nu(n)?ts.push(e):ts.splice(MI(t),0,e),e.flags|=1,ix()}}function ix(){Zf||(Zf=sx.then(rx))}function Jf(e){wt(e)?Xa.push(...e):Br&&e.id===-1?Br.splice(La+1,0,e):e.flags&1||(Xa.push(e),e.flags|=1),ix()}function gb(e,t,n=Ii+1){for(;n<ts.length;n++){const o=ts[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;ts.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function eh(e){if(Xa.length){const t=[...new Set(Xa)].sort((n,o)=>Nu(n)-Nu(o));if(Xa.length=0,Br){Br.push(...t);return}for(Br=t,La=0;La<Br.length;La++){const n=Br[La];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Br=null,La=0}}const Nu=e=>e.id==null?e.flags&2?-1:1/0:e.id;function rx(e){try{for(Ii=0;Ii<ts.length;Ii++){const t=ts[Ii];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),id(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ii<ts.length;Ii++){const t=ts[Ii];t&&(t.flags&=-2)}Ii=-1,ts.length=0,eh(),Zf=null,(ts.length||Xa.length)&&rx()}}let Na,Kd=[];function lx(e,t){var n,o;Na=e,Na?(Na.enabled=!0,Kd.forEach(({event:s,args:i})=>Na.emit(s,...i)),Kd=[]):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=>{lx(i,t)}),setTimeout(()=>{Na||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Kd=[])},3e3)):Kd=[]}let Fo=null,fp=null;function Ru(e){const t=Fo;return Fo=e,fp=e&&e.type.__scopeId||null,t}function R0e(e){fp=e}function O0e(){fp=null}const P0e=e=>we;function we(e,t=Fo,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&ih(-1);const i=Ru(t);let r;try{r=e(...s)}finally{Ru(i),o._d&&ih(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function An(e,t){if(Fo===null)return e;const n=cd(Fo),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=Xt]=t[s];i&&(Lt(i)&&(i={mounted:i,updated:i}),i.deep&&tr(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function $i(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&&(cr(),li(a,n,8,[e.el,l,e,t]),ur())}}function Nn(e,t){if(Po){let n=Po.provides;const o=Po.parent&&Po.parent.provides;o===n&&(n=Po.provides=Object.create(o)),n[e]=t}}function Vt(e,t,n=!1){const o=Ho();if(o||Wl){let s=Wl?Wl._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&&Lt(t)?t.call(o&&o.proxy):t}}function D0e(){return!!(Ho()||Wl)}const TI=Symbol.for("v-scx"),EI=()=>Vt(TI);function II(e,t){return rd(e,null,t)}function B0e(e,t){return rd(e,null,{flush:"post"})}function $I(e,t){return rd(e,null,{flush:"sync"})}function Ve(e,t,n){return rd(e,t,n)}function rd(e,t,n=Xt){const{immediate:o,deep:s,flush:i,once:r}=n,l=wn({},n),a=t&&o||!t&&i!=="post";let c;if(Yl){if(i==="sync"){const p=EI();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=si,p.resume=si,p.pause=si,p}}const u=Po;l.call=(p,h,m)=>li(p,u,h,m);let d=!1;i==="post"?l.scheduler=p=>{co(p,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(p,h)=>{h?p():i0(p)}),l.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const f=wI(e,t,l);return Yl&&(c?c.push(f):a&&f()),f}function LI(e,t,n){const o=this.proxy,s=En(e)?e.includes(".")?ax(o,e):()=>o[e]:e.bind(o,o);let i;Lt(t)?i=t:(i=t.handler,n=t);const r=_c(this),l=rd(s,i.bind(o),n);return r(),l}function ax(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 Or=new WeakMap,cx=Symbol("_vte"),ux=e=>e.__isTeleport,Ll=e=>e&&(e.disabled||e.disabled===""),NI=e=>e&&(e.defer||e.defer===""),vb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,yb=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,E1=(e,t)=>{const n=e&&e.to;return En(n)?t?t(n):null:n},RI={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:h,createText:m,createComment:w,parentNode:k}}=c,g=Ll(t.props);let{dynamicChildren:v}=t;const y=(L,b,T)=>{L.shapeFlag&16&&u(L.children,b,T,s,i,r,l,a)},M=(L=t)=>{const b=Ll(L.props),T=L.target=E1(L.props,h),$=I1(T,L,m,p);T&&(r!=="svg"&&vb(T)?r="svg":r!=="mathml"&&yb(T)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(T),b||(y(L,T,$),ou(L,!1)))},O=L=>{const b=()=>{if(Or.get(L)===b){if(Or.delete(L),Ll(L.props)){const T=k(L.el)||n;y(L,T,L.anchor),ou(L,!0)}M(L)}};Or.set(L,b),co(b,i)};if(e==null){const L=t.el=m(""),b=t.anchor=m("");if(p(L,n,o),p(b,n,o),NI(t.props)||i&&i.pendingBranch){O(t);return}g&&(y(t,n,b),ou(t,!0)),M()}else{t.el=e.el;const L=t.anchor=e.anchor,b=Or.get(e);if(b){b.flags|=8,Or.delete(e),O(t);return}t.targetStart=e.targetStart;const T=t.target=e.target,$=t.targetAnchor=e.targetAnchor,N=Ll(e.props),S=N?n:T,E=N?L:$;if(r==="svg"||vb(T)?r="svg":(r==="mathml"||yb(T))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,s,i,r,l),g0(e,t,!0)):a||d(e,t,S,E,s,i,r,l,!1),g)N?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Gd(t,n,L,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const P=t.target=E1(t.props,h);P&&Gd(t,P,null,c,0)}else N&&Gd(t,T,$,c,1);ou(t,g)}},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,p=i||!Ll(f),h=Or.get(e);if(h&&(h.flags|=8,Or.delete(e)),d&&(s(c),s(u)),i&&s(a),!h&&r&16)for(let m=0;m<l.length;m++){const w=l[m];o(w,t,n,p,!!w.dynamicChildren)}},move:Gd,hydrate:OI};function Gd(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),!Or.has(e)&&(!d||Ll(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function OI(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(w,k){let g=k;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,w._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function p(w,k){k.anchor=d(r(w),k,l(w),n,o,s,i)}const h=t.target=E1(t.props,a),m=Ll(t.props);if(h){const w=h._lpa||h.firstChild;t.shapeFlag&16&&(m?(p(e,t),f(h,w),t.targetAnchor||I1(h,t,u,c,l(e)===h?e:null)):(t.anchor=r(e),f(h,w),t.targetAnchor||I1(h,t,u,c),d(w&&r(w),t,h,n,o,s,i))),ou(t,m)}else m&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const hp=RI;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 I1(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[cx]=r,e&&(o(i,e,s),o(r,e,s)),r}const Js=Symbol("_leaveCb"),Kc=Symbol("_enterCb");function dx(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Sn(()=>{e.isMounted=!0}),so(()=>{e.isUnmounting=!0}),e}const Gs=[Function,Array],fx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Gs,onEnter:Gs,onAfterEnter:Gs,onEnterCancelled:Gs,onBeforeLeave:Gs,onLeave:Gs,onAfterLeave:Gs,onLeaveCancelled:Gs,onBeforeAppear:Gs,onAppear:Gs,onAfterAppear:Gs,onAppearCancelled:Gs},hx=e=>{const t=e.subTree;return t.component?hx(t.component):t},PI={name:"BaseTransition",props:fx,setup(e,{slots:t}){const n=Ho(),o=dx();return()=>{const s=t.default&&r0(t.default(),!0),i=s&&s.length?px(s):n.subTree?re():void 0;if(!i)return;const r=on(e),{mode:l}=r;if(o.isLeaving)return Zm(i);const a=kb(i);if(!a)return Zm(i);let c=Ou(a,r,o,n,d=>c=d);a.type!==fo&&Xr(a,c);let u=n.subTree&&kb(n.subTree);if(u&&u.type!==fo&&!pi(u,a)&&hx(n).type!==fo){let d=Ou(u,r,o,n);if(Xr(u,d),l==="out-in"&&a.type!==fo)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Zm(i);l==="in-out"&&a.type!==fo?d.delayLeave=(f,p,h)=>{const m=mx(o,u);m[String(u.key)]=u,f[Js]=()=>{p(),f[Js]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{h(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function px(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==fo){t=n;break}}return t}const DI=PI;function mx(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 Ou(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:w,onAppear:k,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),M=mx(n,e),O=(T,$)=>{T&&li(T,o,9,$)},L=(T,$)=>{const N=$[1];O(T,$),wt(T)?T.every(S=>S.length<=1)&&N():T.length<=1&&N()},b={mode:r,persisted:l,beforeEnter(T){let $=a;if(!n.isMounted)if(i)$=w||a;else return;T[Js]&&T[Js](!0);const N=M[y];N&&pi(e,N)&&N.el[Js]&&N.el[Js](),O($,[T])},enter(T){if(M[y]===e)return;let $=c,N=u,S=d;if(!n.isMounted)if(i)$=k||c,N=g||u,S=v||d;else return;let E=!1;T[Kc]=D=>{E||(E=!0,D?O(S,[T]):O(N,[T]),b.delayedLeave&&b.delayedLeave(),T[Kc]=void 0)};const P=T[Kc].bind(null,!1);$?L($,[T,P]):P()},leave(T,$){const N=String(e.key);if(T[Kc]&&T[Kc](!0),n.isUnmounting)return $();O(f,[T]);let S=!1;T[Js]=P=>{S||(S=!0,$(),P?O(m,[T]):O(h,[T]),T[Js]=void 0,M[N]===e&&delete M[N])};const E=T[Js].bind(null,!1);M[N]=e,p?L(p,[T,E]):E()},clone(T){const $=Ou(T,t,n,o,s);return s&&s($),$}};return b}function Zm(e){if(ld(e))return e=fr(e),e.children=null,e}function kb(e){if(!ld(e))return ux(e.type)&&e.children?px(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&&Lt(n.default))return n.default()}}function Xr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Xr(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 r0(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(r0(r.children,t,l))):(t||r.type!==fo)&&o.push(l!=null?fr(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function je(e,t){return Lt(e)?wn({name:e.name},t,{setup:e}):e}function F0e(){const e=Ho();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function l0(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function H0e(e){const t=Ho(),n=ta(null);if(t){const s=t.refs===Xt?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 th=new WeakMap;function Za(e,t,n,o,s=!1){if(wt(e)){e.forEach((m,w)=>Za(m,t&&(wt(t)?t[w]:t),n,o,s));return}if(rr(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Za(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?cd(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Xt?l.refs={}:l.refs,d=l.setupState,f=on(d),p=d===Xt?$C:m=>bb(u,m)?!1:fn(f,m),h=(m,w)=>!(w&&bb(u,w));if(c!=null&&c!==a){if(_b(t),En(c))u[c]=null,p(c)&&(d[c]=null);else if(oo(c)){const m=t;h(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(Lt(a))id(a,l,12,[r,u]);else{const m=En(a),w=oo(a);if(m||w){const k=()=>{if(e.f){const g=m?p(a)?d[a]:u[a]:h()||!e.k?a.value:u[e.k];if(s)wt(g)&&Zv(g,i);else if(wt(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],p(a)&&(d[a]=u[a]);else{const v=[i];h(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,p(a)&&(d[a]=r)):w&&(h(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{k(),th.delete(e)};g.id=-1,th.set(e,g),co(g,n)}else _b(e),k()}}}function _b(e){const t=th.get(e);t&&(t.flags|=8,th.delete(e))}let wb=!1;const xa=()=>{wb||(console.error("Hydration completed but contains mismatches."),wb=!0)},BI=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",FI=e=>e.namespaceURI.includes("MathML"),Yd=e=>{if(e.nodeType===1){if(BI(e))return"svg";if(FI(e))return"mathml"}},za=e=>e.nodeType===8;function HI(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,y)=>{if(!y.hasChildNodes()){n(null,v,y),eh(),y._vnode=v;return}d(y.firstChild,v,null,null,null),eh(),y._vnode=v},d=(v,y,M,O,L,b=!1)=>{b=b||!!y.dynamicChildren;const T=za(v)&&v.data==="[",$=()=>m(v,y,M,O,L,T),{type:N,ref:S,shapeFlag:E,patchFlag:P}=y;let D=v.nodeType;y.el=v,P===-2&&(b=!1,y.dynamicChildren=null);let F=null;switch(N){case Kr:D!==3?y.children===""?(a(y.el=s(""),r(v),v),F=v):F=$():(v.data!==y.children&&(xa(),v.data=y.children),F=i(v));break;case fo:g(v)?(F=i(v),k(y.el=v.content.firstChild,v,M)):D!==8||T?F=$():F=i(v);break;case ec:if(T&&(v=i(v),D=v.nodeType),D===1||D===3){F=v;const W=!y.children.length;for(let K=0;K<y.staticCount;K++)W&&(y.children+=F.nodeType===1?F.outerHTML:F.data),K===y.staticCount-1&&(y.anchor=F),F=i(F);return T?i(F):F}else $();break;case Pe:T?F=h(v,y,M,O,L,b):F=$();break;default:if(E&1)(D!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?F=$():F=f(v,y,M,O,L,b);else if(E&6){y.slotScopeIds=L;const W=r(v);if(T?F=w(v):za(v)&&v.data==="teleport start"?F=w(v,v.data,"teleport end"):F=i(v),t(y,W,null,M,O,Yd(W),b),rr(y)&&!y.type.__asyncResolved){let K;T?(K=se(Pe),K.anchor=F?F.previousSibling:W.lastChild):K=v.nodeType===3?qe(""):se("div"),K.el=v,y.component.subTree=K}}else E&64?D!==8?F=$():F=y.type.hydrate(v,y,M,O,L,b,e,p):E&128&&(F=y.type.hydrate(v,y,M,O,Yd(r(v)),L,b,e,d))}return S!=null&&Za(S,null,O,y),F},f=(v,y,M,O,L,b)=>{b=b||!!y.dynamicChildren;const{type:T,props:$,patchFlag:N,shapeFlag:S,dirs:E,transition:P}=y,D=T==="input"||T==="option";if(D||N!==-1){E&&$i(y,null,M,"created");let F=!1;if(g(v)){F=Rx(null,P)&&M&&M.vnode.props&&M.vnode.props.appear;const K=v.content.firstChild;if(F){const Y=K.getAttribute("class");Y&&(K.$cls=Y),P.beforeEnter(K)}k(K,v,M),y.el=v=K}if(S&16&&!($&&($.innerHTML||$.textContent))){let K=p(v.firstChild,y,v,M,O,L,b);for(K&&!Qd(v,1)&&xa();K;){const Y=K;K=K.nextSibling,l(Y)}}else if(S&8){let K=y.children;K[0]===`
15
+ `&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(K=K.slice(1));const{textContent:Y}=v;Y!==K&&Y!==K.replace(/\r\n|\r/g,`
16
+ `)&&(Qd(v,0)||xa(),v.textContent=y.children)}if($){if(D||!b||N&48){const K=v.tagName.includes("-");for(const Y in $)(D&&(Y.endsWith("value")||Y==="indeterminate")||sd(Y)&&!Hl(Y)||Y[0]==="."||K&&!Hl(Y))&&o(v,Y,null,$[Y],void 0,M)}else if($.onClick)o(v,"onClick",null,$.onClick,void 0,M);else if(N&4&&Vr($.style))for(const K in $.style)$.style[K]}let W;(W=$&&$.onVnodeBeforeMount)&&ms(W,M,y),E&&$i(y,null,M,"beforeMount"),((W=$&&$.onVnodeMounted)||E||F)&&Bx(()=>{W&&ms(W,M,y),F&&P.enter(v),E&&$i(y,null,M,"mounted")},O)}return v.nextSibling},p=(v,y,M,O,L,b,T)=>{T=T||!!y.dynamicChildren;const $=y.children,N=$.length;let S=!1;for(let E=0;E<N;E++){const P=T?$[E]:$[E]=vs($[E]),D=P.type===Kr;v?(D&&!T&&E+1<N&&vs($[E+1]).type===Kr&&(a(s(v.data.slice(P.children.length)),M,i(v)),v.data=P.children),v=d(v,P,O,L,b,T)):D&&!P.children?a(P.el=s(""),M):(S||(S=!0,Qd(M,1)||xa()),n(null,P,M,null,O,L,Yd(M),b))}return v},h=(v,y,M,O,L,b)=>{const{slotScopeIds:T}=y;T&&(L=L?L.concat(T):T);const $=r(v),N=p(i(v),y,$,M,O,L,b);return N&&za(N)&&N.data==="]"?i(y.anchor=N):(xa(),a(y.anchor=c("]"),$,N),N)},m=(v,y,M,O,L,b)=>{if(Qd(v.parentElement,1)||xa(),y.el=null,b){const N=w(v);for(;;){const S=i(v);if(S&&S!==N)l(S);else break}}const T=i(v),$=r(v);return l(v),n(null,y,$,T,M,O,Yd($),L),M&&(M.vnode.el=y.el,gp(M,y.el)),T},w=(v,y="[",M="]")=>{let O=0;for(;v;)if(v=i(v),v&&za(v)&&(v.data===y&&O++,v.data===M)){if(O===0)return i(v);O--}return v},k=(v,y,M)=>{const O=y.parentNode;O&&O.replaceChild(v,y);let L=M;for(;L;)L.vnode.el===y&&(L.vnode.el=L.subTree.el=v),L=L.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const Sb="data-allow-mismatch",zI={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Qd(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Sb);)e=e.parentElement;const n=e&&e.getAttribute(Sb);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(zI[t])}}const WI=ip().requestIdleCallback||(e=>setTimeout(e,1)),UI=ip().cancelIdleCallback||(e=>clearTimeout(e)),z0e=(e=1e4)=>t=>{const n=WI(t,{timeout:e});return()=>UI(n)};function qI(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 W0e=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(qI(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},U0e=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},q0e=(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 jI(e,t){if(za(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(za(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const rr=e=>!!e.type.__asyncLoader;function mi(e){Lt(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,p()),p=()=>{let h;return c||(h=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((w,k)=>{a(m,()=>w(f()),()=>k(m),d+1)});throw m}).then(m=>h!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return je({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(h,m,w){let k=!1;(m.bu||(m.bu=[])).push(()=>k=!0);const g=()=>{k||w()},v=i?()=>{const y=i(g,M=>jI(h,M));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():p().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const h=Po;if(l0(h),u)return()=>Xd(u,h);const m=v=>{c=null,bc(v,h,13,!o)};if(l&&h.suspense||Yl)return p().then(v=>()=>Xd(v,h)).catch(v=>(m(v),()=>o?se(o,{error:v}):null));const w=X(!1),k=X(),g=X(!!s);return s&&setTimeout(()=>{g.value=!1},s),r!=null&&setTimeout(()=>{if(!w.value&&!k.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),k.value=v}},r),p().then(()=>{w.value=!0,h.parent&&ld(h.parent.vnode)&&h.parent.update()}).catch(v=>{m(v),k.value=v}),()=>{if(w.value&&u)return Xd(u,h);if(k.value&&o)return se(o,{error:k.value});if(n&&!g.value)return Xd(n,h)}}})}function Xd(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=se(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const ld=e=>e.type.__isKeepAlive,VI={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Ho(),o=n.ctx;if(!o.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};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=(g,v,y,M,O)=>{const L=g.component;c(g,v,y,0,l),a(L.vnode,g,v,y,L,l,M,g.slotScopeIds,O),co(()=>{L.isDeactivated=!1,L.a&&Qa(L.a);const b=g.props&&g.props.onVnodeMounted;b&&ms(b,L.parent,g)},l)},o.deactivate=g=>{const v=g.component;oh(v.m),oh(v.a),c(g,f,null,1,l),co(()=>{v.da&&Qa(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&ms(y,v.parent,g),v.isDeactivated=!0},l)};function p(g){Jm(g),u(g,n,l,!0)}function h(g){s.forEach((v,y)=>{const M=F1(rr(v)?v.type.__asyncResolved||{}:v.type);M&&!g(M)&&m(y)})}function m(g){const v=s.get(g);v&&(!r||!pi(v,r))?p(v):r&&Jm(r),s.delete(g),i.delete(g)}Ve(()=>[e.include,e.exclude],([g,v])=>{g&&h(y=>su(g,y)),v&&h(y=>!su(v,y))},{flush:"post",deep:!0});let w=null;const k=()=>{w!=null&&(sh(n.subTree.type)?co(()=>{s.set(w,Zd(n.subTree))},n.subTree.suspense):s.set(w,Zd(n.subTree)))};return Sn(k),a0(k),so(()=>{s.forEach(g=>{const{subTree:v,suspense:y}=n,M=Zd(v);if(g.type===M.type&&g.key===M.key){Jm(M);const O=M.component.da;O&&co(O,y);return}p(g)})}),()=>{if(w=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!Zr(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=Zd(v);if(y.type===fo)return r=null,y;const M=y.type,O=F1(rr(y)?y.type.__asyncResolved||{}:M),{include:L,exclude:b,max:T}=e;if(L&&(!O||!su(L,O))||b&&O&&su(b,O))return y.shapeFlag&=-257,r=y,v;const $=y.key==null?M:y.key,N=s.get($);return y.el&&(y=fr(y),v.shapeFlag&128&&(v.ssContent=y)),w=$,N?(y.el=N.el,y.component=N.component,y.transition&&Xr(y,y.transition),y.shapeFlag|=512,i.delete($),i.add($)):(i.add($),T&&i.size>parseInt(T,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,sh(v.type)?v:y}}},j0e=VI;function su(e,t){return wt(e)?e.some(n=>su(n,t)):En(e)?e.split(",").includes(t):NE(e)?(e.lastIndex=0,e.test(t)):!1}function KI(e,t){gx(e,"a",t)}function GI(e,t){gx(e,"da",t)}function gx(e,t,n=Po){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(pp(t,o,n),n){let s=n.parent;for(;s&&s.parent;)ld(s.parent.vnode)&&YI(o,t,n,s),s=s.parent}}function YI(e,t,n,o){const s=pp(t,e,o,!0);In(()=>{Zv(o[t],s)},n)}function Jm(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Zd(e){return e.shapeFlag&128?e.ssContent:e}function pp(e,t,n=Po,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{cr();const l=_c(n),a=li(t,n,e,r);return l(),ur(),a});return o?s.unshift(i):s.push(i),i}}const pr=e=>(t,n=Po)=>{(!Yl||e==="sp")&&pp(e,(...o)=>t(...o),n)},QI=pr("bm"),Sn=pr("m"),vx=pr("bu"),a0=pr("u"),so=pr("bum"),In=pr("um"),XI=pr("sp"),ZI=pr("rtg"),JI=pr("rtc");function e5(e,t=Po){pp("ec",e,t)}const c0="components",t5="directives";function n5(e,t){return u0(c0,e,!0,t)||e}const yx=Symbol.for("v-ndc");function Oo(e){return En(e)?u0(c0,e,!1)||e:e||yx}function V0e(e){return u0(t5,e)}function u0(e,t,n=!0,o=!1){const s=Fo||Po;if(s){const i=s.type;if(e===c0){const l=F1(i,!1);if(l&&(l===t||l===_o(t)||l===op(_o(t))))return i}const r=Cb(s[e]||i[e],t)||Cb(s.appContext[e],t);return!r&&o?i:r}}function Cb(e,t){return e&&(e[t]||e[_o(t)]||e[op(_o(t))])}function nt(e,t,n,o){let s;const i=n&&n[o],r=wt(e);if(r||En(e)){const l=r&&Vr(e);let a=!1,c=!1;l&&(a=!Os(e),c=dr(e),e=ap(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?cc(ki(e[u])):ki(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(hn(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 d0(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(wt(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 On(e,t,n={},o,s){if(Fo.ce||Fo.parent&&rr(Fo.parent)&&Fo.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),_(),ke(Pe,null,[se("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),_();const r=i&&f0(i(n)),l=n.key||r&&r.key,a=ke(Pe,{key:(l&&!zs(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 f0(e){return e.some(t=>Zr(t)?!(t.type===fo||t.type===Pe&&!f0(t.children)):!0)?e:null}function K0e(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:Af(o)]=e[o];return n}const $1=e=>e?Ux(e)?cd(e):$1(e.parent):null,hu=wn(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=>$1(e.parent),$root:e=>$1(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>h0(e),$forceUpdate:e=>e.f||(e.f=()=>{i0(e.update)}),$nextTick:e=>e.n||(e.n=gt.bind(e.proxy)),$watch:e=>LI.bind(e)}),eg=(e,t)=>e!==Xt&&!e.__isScriptSetup&&fn(e,t),L1={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(eg(o,t))return r[t]=1,o[t];if(s!==Xt&&fn(s,t))return r[t]=2,s[t];if(fn(i,t))return r[t]=3,i[t];if(n!==Xt&&fn(n,t))return r[t]=4,n[t];N1&&(r[t]=0)}}const c=hu[t];let u,d;if(c)return t==="$attrs"&&Vo(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Xt&&fn(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,fn(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return eg(s,t)?(s[t]=n,!0):o!==Xt&&fn(o,t)?(o[t]=n,!0):fn(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!==Xt&&l[0]!=="$"&&fn(e,l)||eg(t,l)||fn(i,l)||fn(o,l)||fn(hu,l)||fn(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:fn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},o5=wn({},L1,{get(e,t){if(t!==Symbol.unscopables)return L1.get(e,t,e)},has(e,t){return t[0]!=="_"&&!BE(t)}});function G0e(){return null}function Y0e(){return null}function Q0e(e){}function X0e(e){}function Z0e(){return null}function J0e(){}function eye(e,t){return null}function tye(){return kx().slots}function ad(){return kx().attrs}function kx(e){const t=Ho();return t.setupContext||(t.setupContext=Vx(t))}function Pu(e){return wt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function nye(e,t){const n=Pu(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?wt(s)||Lt(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 oye(e,t){return!e||!t?e||t:wt(e)&&wt(t)?e.concat(t):wn({},Pu(e),Pu(t))}function sye(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function iye(e){const t=Ho(),n=Yl;let o=e();Bu(),n&&tc(!1);const s=()=>{_c(t),n&&tc(!0)},i=()=>{Ho()!==t&&t.scope.off(),Bu(),n&&tc(!1)};return Jv(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let N1=!0;function s5(e){const t=h0(e),n=e.proxy,o=e.ctx;N1=!1,t.beforeCreate&&xb(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:m,deactivated:w,beforeDestroy:k,beforeUnmount:g,destroyed:v,unmounted:y,render:M,renderTracked:O,renderTriggered:L,errorCaptured:b,serverPrefetch:T,expose:$,inheritAttrs:N,components:S,directives:E,filters:P}=t;if(c&&i5(c,o,null),r)for(const W in r){const K=r[W];Lt(K)&&(o[W]=K.bind(n))}if(s){const W=s.call(n,n);hn(W)&&(e.data=Bo(W))}if(N1=!0,i)for(const W in i){const K=i[W],Y=Lt(K)?K.bind(n,n):Lt(K.get)?K.get.bind(n,n):si,q=!Lt(K)&&Lt(K.set)?K.set.bind(n):si,ae=B({get:Y,set:q});Object.defineProperty(o,W,{enumerable:!0,configurable:!0,get:()=>ae.value,set:ce=>ae.value=ce})}if(l)for(const W in l)bx(l[W],o,n,W);if(a){const W=Lt(a)?a.call(n):a;Reflect.ownKeys(W).forEach(K=>{Nn(K,W[K])})}u&&xb(u,e,"c");function F(W,K){wt(K)?K.forEach(Y=>W(Y.bind(n))):K&&W(K.bind(n))}if(F(QI,d),F(Sn,f),F(vx,p),F(a0,h),F(KI,m),F(GI,w),F(e5,b),F(JI,O),F(ZI,L),F(so,g),F(In,y),F(XI,T),wt($))if($.length){const W=e.exposed||(e.exposed={});$.forEach(K=>{Object.defineProperty(W,K,{get:()=>n[K],set:Y=>n[K]=Y,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===si&&(e.render=M),N!=null&&(e.inheritAttrs=N),S&&(e.components=S),E&&(e.directives=E),T&&l0(e)}function i5(e,t,n=si){wt(e)&&(e=R1(e));for(const o in e){const s=e[o];let i;hn(s)?"default"in s?i=Vt(s.from||o,s.default,!0):i=Vt(s.from||o):i=Vt(s),oo(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function xb(e,t,n){li(wt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function bx(e,t,n,o){let s=o.includes(".")?ax(n,o):()=>n[o];if(En(e)){const i=t[e];Lt(i)&&Ve(s,i)}else if(Lt(e))Ve(s,e.bind(n));else if(hn(e))if(wt(e))e.forEach(i=>bx(i,t,n,o));else{const i=Lt(e.handler)?e.handler.bind(n):t[e.handler];Lt(i)&&Ve(s,i,e)}}function h0(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=>nh(a,c,r,!0)),nh(a,t,r)),hn(t)&&i.set(t,a),a}function nh(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&nh(e,i,n,!0),s&&s.forEach(r=>nh(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=r5[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const r5={data:Ab,props:Mb,emits:Mb,methods:iu,computed:iu,beforeCreate:Xo,created:Xo,beforeMount:Xo,mounted:Xo,beforeUpdate:Xo,updated:Xo,beforeDestroy:Xo,beforeUnmount:Xo,destroyed:Xo,unmounted:Xo,activated:Xo,deactivated:Xo,errorCaptured:Xo,serverPrefetch:Xo,components:iu,directives:iu,watch:a5,provide:Ab,inject:l5};function Ab(e,t){return t?e?function(){return wn(Lt(e)?e.call(this,this):e,Lt(t)?t.call(this,this):t)}:t:e}function l5(e,t){return iu(R1(e),R1(t))}function R1(e){if(wt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Xo(e,t){return e?[...new Set([].concat(e,t))]:t}function iu(e,t){return e?wn(Object.create(null),e,t):t}function Mb(e,t){return e?wt(e)&&wt(t)?[...new Set([...e,...t])]:wn(Object.create(null),Pu(e),Pu(t??{})):t}function a5(e,t){if(!e)return t;if(!t)return e;const n=wn(Object.create(null),e);for(const o in t)n[o]=Xo(e[o],t[o]);return n}function _x(){return{app:null,config:{isNativeTag:$C,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 c5=0;function u5(e,t){return function(o,s=null){Lt(o)||(o=wn({},o)),s!=null&&!hn(s)&&(s=null);const i=_x(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:c5++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:H5,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Lt(u.install)?(r.add(u),u.install(c,...d)):Lt(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 p=c._ceVNode||se(o,s);return p.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(p,u):e(p,u,f),a=!0,c._container=u,u.__vue_app__=c,cd(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&(li(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=Wl;Wl=c;try{return u()}finally{Wl=d}}};return c}}let Wl=null;function rye(e,t,n=Xt){const o=Ho(),s=_o(t),i=ys(t),r=wx(e,s),l=gI((a,c)=>{let u,d=Xt,f;return $I(()=>{const p=e[s];Ro(u,p)&&(u=p,c())}),{get(){return a(),n.get?n.get(u):u},set(p){const h=n.set?n.set(p):p;if(!Ro(h,u)&&!(d!==Xt&&Ro(p,d)))return;const m=o.vnode.props;m&&(t in m||s in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${s}`in m||`onUpdate:${i}`in m)||(u=p,c()),o.emit(`update:${t}`,h),Ro(p,h)&&Ro(p,d)&&!Ro(h,f)&&c(),d=p,f=h}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Xt:l,done:!1}:{done:!0}}}},l}const wx=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${_o(t)}Modifiers`]||e[`${ys(t)}Modifiers`];function d5(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Xt;let s=n;const i=t.startsWith("update:"),r=i&&wx(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>En(u)?u.trim():u)),r.number&&(s=n.map(sp)));let l,a=o[l=Af(t)]||o[l=Af(_o(t))];!a&&i&&(a=o[l=Af(ys(t))]),a&&li(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,li(c,e,6,s)}}const f5=new WeakMap;function Sx(e,t,n=!1){const o=n?f5:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!Lt(e)){const a=c=>{const u=Sx(c,t,!0);u&&(l=!0,wn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(hn(e)&&o.set(e,null),null):(wt(i)?i.forEach(a=>r[a]=null):wn(r,i),hn(e)&&o.set(e,r),r)}function mp(e,t){return!e||!sd(t)?!1:(t=t.slice(2).replace(/Once$/,""),fn(e,t[0].toLowerCase()+t.slice(1))||fn(e,ys(t))||fn(e,t))}function Mf(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:p,ctx:h,inheritAttrs:m}=e,w=Ru(e);let k,g;try{if(n.shapeFlag&4){const y=s||o,M=y;k=vs(c.call(M,y,u,d,p,f,h)),g=l}else{const y=t;k=vs(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:p5(l)}}catch(y){pu.length=0,bc(y,e,1),k=se(fo)}let v=k;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:M}=v;y.length&&M&7&&(i&&y.some(Jh)&&(g=m5(g,i)),v=fr(v,g,!1,!0))}return n.dirs&&(v=fr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Xr(v,n.transition),k=v,Ru(w),k}function h5(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Zr(s)){if(s.type!==fo||s.children==="v-if"){if(n)return;n=s}}else return}return n}const p5=e=>{let t;for(const n in e)(n==="class"||n==="style"||sd(n))&&((t||(t={}))[n]=e[n]);return t},m5=(e,t)=>{const n={};for(const o in e)(!Jh(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function g5(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?Tb(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(Cx(r,o,f)&&!mp(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?Tb(o,r,c):!0:!!r;return!1}function Tb(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(Cx(t,e,i)&&!mp(n,i))return!0}return!1}function Cx(e,t,n){const o=e[n],s=t[n];return n==="style"&&hn(o)&&hn(s)?!ar(o,s):o!==s}function gp({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 xx={},Ax=()=>Object.create(xx),Mx=e=>Object.getPrototypeOf(e)===xx;function v5(e,t,n,o=!1){const s={},i=Ax();e.propsDefaults=Object.create(null),Tx(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:fI(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function y5(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=on(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(mp(e.emitsOptions,f))continue;const p=t[f];if(a)if(fn(i,f))p!==i[f]&&(i[f]=p,c=!0);else{const h=_o(f);s[h]=O1(a,l,h,p,e,!1)}else p!==i[f]&&(i[f]=p,c=!0)}}}else{Tx(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!fn(t,d)&&((u=ys(d))===d||!fn(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=O1(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!fn(t,d))&&(delete i[d],c=!0)}c&&er(e.attrs,"set","")}function Tx(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Hl(a))continue;const c=t[a];let u;s&&fn(s,u=_o(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:mp(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=on(n),c=l||Xt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=O1(s,a,d,c[d],e,!fn(c,d))}}return r}function O1(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=fn(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&Lt(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=_c(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===ys(n))&&(o=!0))}return o}const k5=new WeakMap;function Ex(e,t,n=!1){const o=n?k5:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!Lt(e)){const u=d=>{a=!0;const[f,p]=Ex(d,t,!0);wn(r,f),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return hn(e)&&o.set(e,Ga),Ga;if(wt(i))for(let u=0;u<i.length;u++){const d=_o(i[u]);Eb(d)&&(r[d]=Xt)}else if(i)for(const u in i){const d=_o(u);if(Eb(d)){const f=i[u],p=r[d]=wt(f)||Lt(f)?{type:f}:wn({},f),h=p.type;let m=!1,w=!0;if(wt(h))for(let k=0;k<h.length;++k){const g=h[k],v=Lt(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(w=!1)}else m=Lt(h)&&h.name==="Boolean";p[0]=m,p[1]=w,(m||fn(p,"default"))&&l.push(d)}}const c=[r,l];return hn(e)&&o.set(e,c),c}function Eb(e){return e[0]!=="$"&&!Hl(e)}const p0=e=>e==="_"||e==="_ctx"||e==="$stable",m0=e=>wt(e)?e.map(vs):[vs(e)],b5=(e,t,n)=>{if(t._n)return t;const o=we((...s)=>m0(t(...s)),n);return o._c=!1,o},Ix=(e,t,n)=>{const o=e._ctx;for(const s in e){if(p0(s))continue;const i=e[s];if(Lt(i))t[s]=b5(s,i,o);else if(i!=null){const r=m0(i);t[s]=()=>r}}},$x=(e,t)=>{const n=m0(t);e.slots.default=()=>n},Lx=(e,t,n)=>{for(const o in t)(n||!p0(o))&&(e[o]=t[o])},_5=(e,t,n)=>{const o=e.slots=Ax();if(e.vnode.shapeFlag&32){const s=t._;s?(Lx(o,t,n),n&&NC(o,"_",s,!0)):Ix(t,o)}else t&&$x(e,t)},w5=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=Xt;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:Lx(s,t,n):(i=!t.$stable,Ix(t,s)),r=t}else t&&($x(e,t),r={default:1});if(i)for(const l in s)!p0(l)&&r[l]==null&&delete s[l]},co=Bx;function S5(e){return Nx(e)}function C5(e){return Nx(e,HI)}function Nx(e,t){const n=ip();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:p=si,insertStaticContent:h}=e,m=(z,Z,pe,le=null,he=null,U=null,J=void 0,fe=null,be=!!Z.dynamicChildren)=>{if(z===Z)return;z&&!pi(z,Z)&&(le=xe(z),ce(z,he,U,!0),z=null),Z.patchFlag===-2&&(be=!1,Z.dynamicChildren=null);const{type:Ee,ref:Le,shapeFlag:ue}=Z;switch(Ee){case Kr:w(z,Z,pe,le);break;case fo:k(z,Z,pe,le);break;case ec:z==null&&g(Z,pe,le,J);break;case Pe:S(z,Z,pe,le,he,U,J,fe,be);break;default:ue&1?M(z,Z,pe,le,he,U,J,fe,be):ue&6?E(z,Z,pe,le,he,U,J,fe,be):(ue&64||ue&128)&&Ee.process(z,Z,pe,le,he,U,J,fe,be,G)}Le!=null&&he?Za(Le,z&&z.ref,U,Z||z,!Z):Le==null&&z&&z.ref!=null&&Za(z.ref,null,U,z,!0)},w=(z,Z,pe,le)=>{if(z==null)o(Z.el=l(Z.children),pe,le);else{const he=Z.el=z.el;Z.children!==z.children&&c(he,Z.children)}},k=(z,Z,pe,le)=>{z==null?o(Z.el=a(Z.children||""),pe,le):Z.el=z.el},g=(z,Z,pe,le)=>{[z.el,z.anchor]=h(z.children,Z,pe,le,z.el,z.anchor)},v=({el:z,anchor:Z},pe,le)=>{let he;for(;z&&z!==Z;)he=f(z),o(z,pe,le),z=he;o(Z,pe,le)},y=({el:z,anchor:Z})=>{let pe;for(;z&&z!==Z;)pe=f(z),s(z),z=pe;s(Z)},M=(z,Z,pe,le,he,U,J,fe,be)=>{if(Z.type==="svg"?J="svg":Z.type==="math"&&(J="mathml"),z==null)O(Z,pe,le,he,U,J,fe,be);else{const Ee=z.el&&z.el._isVueCE?z.el:null;try{Ee&&Ee._beginPatch(),T(z,Z,he,U,J,fe,be)}finally{Ee&&Ee._endPatch()}}},O=(z,Z,pe,le,he,U,J,fe)=>{let be,Ee;const{props:Le,shapeFlag:ue,transition:Ie,dirs:Ge}=z;if(be=z.el=r(z.type,U,Le&&Le.is,Le),ue&8?u(be,z.children):ue&16&&b(z.children,be,null,le,he,tg(z,U),J,fe),Ge&&$i(z,null,le,"created"),L(be,z,z.scopeId,J,le),Le){for(const bt in Le)bt!=="value"&&!Hl(bt)&&i(be,bt,null,Le[bt],U,le);"value"in Le&&i(be,"value",null,Le.value,U),(Ee=Le.onVnodeBeforeMount)&&ms(Ee,le,z)}Ge&&$i(z,null,le,"beforeMount");const lt=Rx(he,Ie);lt&&Ie.beforeEnter(be),o(be,Z,pe),((Ee=Le&&Le.onVnodeMounted)||lt||Ge)&&co(()=>{try{Ee&&ms(Ee,le,z),lt&&Ie.enter(be),Ge&&$i(z,null,le,"mounted")}finally{}},he)},L=(z,Z,pe,le,he)=>{if(pe&&p(z,pe),le)for(let U=0;U<le.length;U++)p(z,le[U]);if(he){let U=he.subTree;if(Z===U||sh(U.type)&&(U.ssContent===Z||U.ssFallback===Z)){const J=he.vnode;L(z,J,J.scopeId,J.slotScopeIds,he.parent)}}},b=(z,Z,pe,le,he,U,J,fe,be=0)=>{for(let Ee=be;Ee<z.length;Ee++){const Le=z[Ee]=fe?Zi(z[Ee]):vs(z[Ee]);m(null,Le,Z,pe,le,he,U,J,fe)}},T=(z,Z,pe,le,he,U,J)=>{const fe=Z.el=z.el;let{patchFlag:be,dynamicChildren:Ee,dirs:Le}=Z;be|=z.patchFlag&16;const ue=z.props||Xt,Ie=Z.props||Xt;let Ge;if(pe&&Sl(pe,!1),(Ge=Ie.onVnodeBeforeUpdate)&&ms(Ge,pe,Z,z),Le&&$i(Z,z,pe,"beforeUpdate"),pe&&Sl(pe,!0),(ue.innerHTML&&Ie.innerHTML==null||ue.textContent&&Ie.textContent==null)&&u(fe,""),Ee?$(z.dynamicChildren,Ee,fe,pe,le,tg(Z,he),U):J||K(z,Z,fe,null,pe,le,tg(Z,he),U,!1),be>0){if(be&16)N(fe,ue,Ie,pe,he);else if(be&2&&ue.class!==Ie.class&&i(fe,"class",null,Ie.class,he),be&4&&i(fe,"style",ue.style,Ie.style,he),be&8){const lt=Z.dynamicProps;for(let bt=0;bt<lt.length;bt++){const _t=lt[bt],$t=ue[_t],Bt=Ie[_t];(Bt!==$t||_t==="value")&&i(fe,_t,$t,Bt,he,pe)}}be&1&&z.children!==Z.children&&u(fe,Z.children)}else!J&&Ee==null&&N(fe,ue,Ie,pe,he);((Ge=Ie.onVnodeUpdated)||Le)&&co(()=>{Ge&&ms(Ge,pe,Z,z),Le&&$i(Z,z,pe,"updated")},le)},$=(z,Z,pe,le,he,U,J)=>{for(let fe=0;fe<Z.length;fe++){const be=z[fe],Ee=Z[fe],Le=be.el&&(be.type===Pe||!pi(be,Ee)||be.shapeFlag&198)?d(be.el):pe;m(be,Ee,Le,null,le,he,U,J,!0)}},N=(z,Z,pe,le,he)=>{if(Z!==pe){if(Z!==Xt)for(const U in Z)!Hl(U)&&!(U in pe)&&i(z,U,Z[U],null,he,le);for(const U in pe){if(Hl(U))continue;const J=pe[U],fe=Z[U];J!==fe&&U!=="value"&&i(z,U,fe,J,he,le)}"value"in pe&&i(z,"value",Z.value,pe.value,he)}},S=(z,Z,pe,le,he,U,J,fe,be)=>{const Ee=Z.el=z?z.el:l(""),Le=Z.anchor=z?z.anchor:l("");let{patchFlag:ue,dynamicChildren:Ie,slotScopeIds:Ge}=Z;Ge&&(fe=fe?fe.concat(Ge):Ge),z==null?(o(Ee,pe,le),o(Le,pe,le),b(Z.children||[],pe,Le,he,U,J,fe,be)):ue>0&&ue&64&&Ie&&z.dynamicChildren&&z.dynamicChildren.length===Ie.length?($(z.dynamicChildren,Ie,pe,he,U,J,fe),(Z.key!=null||he&&Z===he.subTree)&&g0(z,Z,!0)):K(z,Z,pe,Le,he,U,J,fe,be)},E=(z,Z,pe,le,he,U,J,fe,be)=>{Z.slotScopeIds=fe,z==null?Z.shapeFlag&512?he.ctx.activate(Z,pe,le,J,be):P(Z,pe,le,he,U,J,be):D(z,Z,be)},P=(z,Z,pe,le,he,U,J)=>{const fe=z.component=Wx(z,le,he);if(ld(z)&&(fe.ctx.renderer=G),qx(fe,!1,J),fe.asyncDep){if(he&&he.registerDep(fe,F,J),!z.el){const be=fe.subTree=se(fo);k(null,be,Z,pe),z.placeholder=be.el}}else F(fe,z,Z,pe,he,U,J)},D=(z,Z,pe)=>{const le=Z.component=z.component;if(g5(z,Z,pe))if(le.asyncDep&&!le.asyncResolved){W(le,Z,pe);return}else le.next=Z,le.update();else Z.el=z.el,le.vnode=Z},F=(z,Z,pe,le,he,U,J)=>{const fe=()=>{if(z.isMounted){let{next:ue,bu:Ie,u:Ge,parent:lt,vnode:bt}=z;{const Gt=Ox(z);if(Gt){ue&&(ue.el=bt.el,W(z,ue,J)),Gt.asyncDep.then(()=>{co(()=>{z.isUnmounted||Ee()},he)});return}}let _t=ue,$t;Sl(z,!1),ue?(ue.el=bt.el,W(z,ue,J)):ue=bt,Ie&&Qa(Ie),($t=ue.props&&ue.props.onVnodeBeforeUpdate)&&ms($t,lt,ue,bt),Sl(z,!0);const Bt=Mf(z),yt=z.subTree;z.subTree=Bt,m(yt,Bt,d(yt.el),xe(yt),z,he,U),ue.el=Bt.el,_t===null&&gp(z,Bt.el),Ge&&co(Ge,he),($t=ue.props&&ue.props.onVnodeUpdated)&&co(()=>ms($t,lt,ue,bt),he)}else{let ue;const{el:Ie,props:Ge}=Z,{bm:lt,m:bt,parent:_t,root:$t,type:Bt}=z,yt=rr(Z);if(Sl(z,!1),lt&&Qa(lt),!yt&&(ue=Ge&&Ge.onVnodeBeforeMount)&&ms(ue,_t,Z),Sl(z,!0),Ie&&de){const Gt=()=>{z.subTree=Mf(z),de(Ie,z.subTree,z,he,null)};yt&&Bt.__asyncHydrate?Bt.__asyncHydrate(Ie,z,Gt):Gt()}else{$t.ce&&$t.ce._hasShadowRoot()&&$t.ce._injectChildStyle(Bt,z.parent?z.parent.type:void 0);const Gt=z.subTree=Mf(z);m(null,Gt,pe,le,z,he,U),Z.el=Gt.el}if(bt&&co(bt,he),!yt&&(ue=Ge&&Ge.onVnodeMounted)){const Gt=Z;co(()=>ms(ue,_t,Gt),he)}(Z.shapeFlag&256||_t&&rr(_t.vnode)&&_t.vnode.shapeFlag&256)&&z.a&&co(z.a,he),z.isMounted=!0,Z=pe=le=null}};z.scope.on();const be=z.effect=new Gf(fe);z.scope.off();const Ee=z.update=be.run.bind(be),Le=z.job=be.runIfDirty.bind(be);Le.i=z,Le.id=z.uid,be.scheduler=()=>i0(Le),Sl(z,!0),Ee()},W=(z,Z,pe)=>{Z.component=z;const le=z.vnode.props;z.vnode=Z,z.next=null,y5(z,Z.props,le,pe),w5(z,Z.children,pe),cr(),gb(z),ur()},K=(z,Z,pe,le,he,U,J,fe,be=!1)=>{const Ee=z&&z.children,Le=z?z.shapeFlag:0,ue=Z.children,{patchFlag:Ie,shapeFlag:Ge}=Z;if(Ie>0){if(Ie&128){q(Ee,ue,pe,le,he,U,J,fe,be);return}else if(Ie&256){Y(Ee,ue,pe,le,he,U,J,fe,be);return}}Ge&8?(Le&16&&ye(Ee,he,U),ue!==Ee&&u(pe,ue)):Le&16?Ge&16?q(Ee,ue,pe,le,he,U,J,fe,be):ye(Ee,he,U,!0):(Le&8&&u(pe,""),Ge&16&&b(ue,pe,le,he,U,J,fe,be))},Y=(z,Z,pe,le,he,U,J,fe,be)=>{z=z||Ga,Z=Z||Ga;const Ee=z.length,Le=Z.length,ue=Math.min(Ee,Le);let Ie;for(Ie=0;Ie<ue;Ie++){const Ge=Z[Ie]=be?Zi(Z[Ie]):vs(Z[Ie]);m(z[Ie],Ge,pe,null,he,U,J,fe,be)}Ee>Le?ye(z,he,U,!0,!1,ue):b(Z,pe,le,he,U,J,fe,be,ue)},q=(z,Z,pe,le,he,U,J,fe,be)=>{let Ee=0;const Le=Z.length;let ue=z.length-1,Ie=Le-1;for(;Ee<=ue&&Ee<=Ie;){const Ge=z[Ee],lt=Z[Ee]=be?Zi(Z[Ee]):vs(Z[Ee]);if(pi(Ge,lt))m(Ge,lt,pe,null,he,U,J,fe,be);else break;Ee++}for(;Ee<=ue&&Ee<=Ie;){const Ge=z[ue],lt=Z[Ie]=be?Zi(Z[Ie]):vs(Z[Ie]);if(pi(Ge,lt))m(Ge,lt,pe,null,he,U,J,fe,be);else break;ue--,Ie--}if(Ee>ue){if(Ee<=Ie){const Ge=Ie+1,lt=Ge<Le?Z[Ge].el:le;for(;Ee<=Ie;)m(null,Z[Ee]=be?Zi(Z[Ee]):vs(Z[Ee]),pe,lt,he,U,J,fe,be),Ee++}}else if(Ee>Ie)for(;Ee<=ue;)ce(z[Ee],he,U,!0),Ee++;else{const Ge=Ee,lt=Ee,bt=new Map;for(Ee=lt;Ee<=Ie;Ee++){const Yt=Z[Ee]=be?Zi(Z[Ee]):vs(Z[Ee]);Yt.key!=null&&bt.set(Yt.key,Ee)}let _t,$t=0;const Bt=Ie-lt+1;let yt=!1,Gt=0;const pn=new Array(Bt);for(Ee=0;Ee<Bt;Ee++)pn[Ee]=0;for(Ee=Ge;Ee<=ue;Ee++){const Yt=z[Ee];if($t>=Bt){ce(Yt,he,U,!0);continue}let mn;if(Yt.key!=null)mn=bt.get(Yt.key);else for(_t=lt;_t<=Ie;_t++)if(pn[_t-lt]===0&&pi(Yt,Z[_t])){mn=_t;break}mn===void 0?ce(Yt,he,U,!0):(pn[mn-lt]=Ee+1,mn>=Gt?Gt=mn:yt=!0,m(Yt,Z[mn],pe,null,he,U,J,fe,be),$t++)}const ro=yt?x5(pn):Ga;for(_t=ro.length-1,Ee=Bt-1;Ee>=0;Ee--){const Yt=lt+Ee,mn=Z[Yt],zo=Z[Yt+1],ot=Yt+1<Le?zo.el||Px(zo):le;pn[Ee]===0?m(null,mn,pe,ot,he,U,J,fe,be):yt&&(_t<0||Ee!==ro[_t]?ae(mn,pe,ot,2):_t--)}}},ae=(z,Z,pe,le,he=null)=>{const{el:U,type:J,transition:fe,children:be,shapeFlag:Ee}=z;if(Ee&6){ae(z.component.subTree,Z,pe,le);return}if(Ee&128){z.suspense.move(Z,pe,le);return}if(Ee&64){J.move(z,Z,pe,G);return}if(J===Pe){o(U,Z,pe);for(let ue=0;ue<be.length;ue++)ae(be[ue],Z,pe,le);o(z.anchor,Z,pe);return}if(J===ec){v(z,Z,pe);return}if(le!==2&&Ee&1&&fe)if(le===0)fe.persisted&&!U[Js]?o(U,Z,pe):(fe.beforeEnter(U),o(U,Z,pe),co(()=>fe.enter(U),he));else{const{leave:ue,delayLeave:Ie,afterLeave:Ge}=fe,lt=()=>{z.ctx.isUnmounted?s(U):o(U,Z,pe)},bt=()=>{const _t=U._isLeaving||!!U[Js];U._isLeaving&&U[Js](!0),fe.persisted&&!_t?lt():ue(U,()=>{lt(),Ge&&Ge()})};Ie?Ie(U,lt,bt):bt()}else o(U,Z,pe)},ce=(z,Z,pe,le=!1,he=!1)=>{const{type:U,props:J,ref:fe,children:be,dynamicChildren:Ee,shapeFlag:Le,patchFlag:ue,dirs:Ie,cacheIndex:Ge,memo:lt}=z;if(ue===-2&&(he=!1),fe!=null&&(cr(),Za(fe,null,pe,z,!0),ur()),Ge!=null&&(Z.renderCache[Ge]=void 0),Le&256){Z.ctx.deactivate(z);return}const bt=Le&1&&Ie,_t=!rr(z);let $t;if(_t&&($t=J&&J.onVnodeBeforeUnmount)&&ms($t,Z,z),Le&6)ee(z.component,pe,le);else{if(Le&128){z.suspense.unmount(pe,le);return}bt&&$i(z,null,Z,"beforeUnmount"),Le&64?z.type.remove(z,Z,pe,G,le):Ee&&!Ee.hasOnce&&(U!==Pe||ue>0&&ue&64)?ye(Ee,Z,pe,!1,!0):(U===Pe&&ue&384||!he&&Le&16)&&ye(be,Z,pe),le&&ne(z)}const Bt=lt!=null&&Ge==null;(_t&&($t=J&&J.onVnodeUnmounted)||bt||Bt)&&co(()=>{$t&&ms($t,Z,z),bt&&$i(z,null,Z,"unmounted"),Bt&&(z.el=null)},pe)},ne=z=>{const{type:Z,el:pe,anchor:le,transition:he}=z;if(Z===Pe){Q(pe,le);return}if(Z===ec){y(z);return}const U=()=>{s(pe),he&&!he.persisted&&he.afterLeave&&he.afterLeave()};if(z.shapeFlag&1&&he&&!he.persisted){const{leave:J,delayLeave:fe}=he,be=()=>J(pe,U);fe?fe(z.el,U,be):be()}else U()},Q=(z,Z)=>{let pe;for(;z!==Z;)pe=f(z),s(z),z=pe;s(Z)},ee=(z,Z,pe)=>{const{bum:le,scope:he,job:U,subTree:J,um:fe,m:be,a:Ee}=z;oh(be),oh(Ee),le&&Qa(le),he.stop(),U&&(U.flags|=8,ce(J,z,Z,pe)),fe&&co(fe,Z),co(()=>{z.isUnmounted=!0},Z)},ye=(z,Z,pe,le=!1,he=!1,U=0)=>{for(let J=U;J<z.length;J++)ce(z[J],Z,pe,le,he)},xe=z=>{if(z.shapeFlag&6)return xe(z.component.subTree);if(z.shapeFlag&128)return z.suspense.next();const Z=f(z.anchor||z.el),pe=Z&&Z[cx];return pe?f(pe):Z};let Xe=!1;const me=(z,Z,pe)=>{let le;z==null?Z._vnode&&(ce(Z._vnode,null,null,!0),le=Z._vnode.component):m(Z._vnode||null,z,Z,null,null,null,pe),Z._vnode=z,Xe||(Xe=!0,gb(le),eh(),Xe=!1)},G={p:m,um:ce,m:ae,r:ne,mt:P,mc:b,pc:K,pbc:$,n:xe,o:e};let ie,de;return t&&([ie,de]=t(G)),{render:me,hydrate:ie,createApp:u5(me,ie)}}function tg({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 Sl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Rx(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function g0(e,t,n=!1){const o=e.children,s=t.children;if(wt(o)&&wt(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]=Zi(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&g0(r,l)),l.type===Kr&&(l.patchFlag===-1&&(l=s[i]=Zi(l)),l.el=r.el),l.type===fo&&!l.el&&(l.el=r.el)}}function x5(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 Ox(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ox(t)}function oh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Px(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Px(t.subTree):null}const sh=e=>e.__isSuspense;let P1=0;const A5={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)M5(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}T5(e,t,n,o,s,r,l,a,c)}},hydrate:E5,normalize:I5},lye=A5;function Du(e,t){const n=e.props&&e.props[t];Lt(n)&&n()}function M5(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=Dx(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?(Du(e,"onPending"),Du(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),Ja(f,e.ssFallback)):f.resolve(!1,!0)}function T5(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,p=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:w,isHydrating:k}=d;if(m)d.pendingBranch=f,pi(m,f)?(a(m,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():w&&(k||(a(h,p,n,o,s,null,i,r,l),Ja(d,p)))):(d.pendingId=P1++,k?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),w?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(h,p,n,o,s,null,i,r,l),Ja(d,p))):h&&pi(h,f)?(a(h,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(h&&pi(h,f))a(h,f,n,o,s,d,i,r,l),Ja(d,f);else if(Du(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=P1++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(p)},g):g===0&&d.fallback(p)}}function Dx(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:p,n:h,o:{parentNode:m,remove:w}}=c;let k;const g=$5(e);g&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const v=e.props?Kf(e.props.timeout):void 0,y=i,M={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:P1++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(O=!1,L=!1){const{vnode:b,activeBranch:T,pendingBranch:$,pendingId:N,effects:S,parentComponent:E,container:P,isInFallback:D}=M;let F=!1;if(M.isHydrating)M.isHydrating=!1;else if(!O){F=T&&$.transition&&$.transition.mode==="out-in";let Y=!1;F&&(T.transition.afterLeave=()=>{N===M.pendingId&&(f($,P,i===y&&!Y?h(T):i,0),Jf(S),D&&b.ssFallback&&(b.ssFallback.el=null))}),T&&!M.isFallbackMountPending&&(m(T.el)===P&&(i=h(T),Y=!0),p(T,E,M,!0),!F&&D&&b.ssFallback&&co(()=>b.ssFallback.el=null,M)),F||f($,P,i,0)}M.isFallbackMountPending=!1,Ja(M,$),M.pendingBranch=null,M.isInFallback=!1;let W=M.parent,K=!1;for(;W;){if(W.pendingBranch){W.effects.push(...S),K=!0;break}W=W.parent}!K&&!F&&Jf(S),M.effects=[],g&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!L&&t.resolve()),Du(b,"onResolve")},fallback(O){if(!M.pendingBranch)return;const{vnode:L,activeBranch:b,parentComponent:T,container:$,namespace:N}=M;Du(L,"onFallback");const S=h(b),E=()=>{M.isFallbackMountPending=!1,M.isInFallback&&(d(null,O,$,S,T,null,N,l,a),Ja(M,O))},P=O.transition&&O.transition.mode==="out-in";P&&(M.isFallbackMountPending=!0,b.transition.afterLeave=E),M.isInFallback=!0,p(b,T,null,!0),P||E()},move(O,L,b){M.activeBranch&&f(M.activeBranch,O,L,b),M.container=O},next(){return M.activeBranch&&h(M.activeBranch)},registerDep(O,L,b){const T=!!M.pendingBranch;T&&M.deps++;const $=O.vnode.el;O.asyncDep.catch(N=>{bc(N,O,0)}).then(N=>{if(O.isUnmounted||M.isUnmounted||M.pendingId!==O.suspenseId)return;Bu(),O.asyncResolved=!0;const{vnode:S}=O;D1(O,N,!1),$&&(S.el=$);const E=!$&&O.subTree.el;L(O,S,m($||O.subTree.el),$?null:h(O.subTree),M,r,b),E&&(S.placeholder=null,w(E)),gp(O,S.el),T&&--M.deps===0&&M.resolve()})},unmount(O,L){M.isUnmounted=!0,M.activeBranch&&p(M.activeBranch,n,O,L),M.pendingBranch&&p(M.pendingBranch,n,O,L)}};return M}function E5(e,t,n,o,s,i,r,l,a){const c=t.suspense=Dx(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 I5(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=Ib(o?n.default:n),e.ssFallback=o?Ib(n.fallback):se(fo)}function Ib(e){let t;if(Lt(e)){const n=Gl&&e._c;n&&(e._d=!1,_()),e=e(),n&&(e._d=!0,t=Ko,Fx())}return wt(e)&&(e=h5(e)),e=vs(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function Bx(e,t){t&&t.pendingBranch?wt(e)?t.effects.push(...e):t.effects.push(e):Jf(e)}function Ja(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,gp(o,s))}function $5(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),Kr=Symbol.for("v-txt"),fo=Symbol.for("v-cmt"),ec=Symbol.for("v-stc"),pu=[];let Ko=null;function _(e=!1){pu.push(Ko=e?null:[])}function Fx(){pu.pop(),Ko=pu[pu.length-1]||null}let Gl=1;function ih(e,t=!1){Gl+=e,e<0&&Ko&&t&&(Ko.hasOnce=!0)}function Hx(e){return e.dynamicChildren=Gl>0?Ko||Ga:null,Fx(),Gl>0&&Ko&&Ko.push(e),e}function I(e,t,n,o,s,i){return Hx(C(e,t,n,o,s,i,!0))}function ke(e,t,n,o,s){return Hx(se(e,t,n,o,s,!0))}function Zr(e){return e?e.__v_isVNode===!0:!1}function pi(e,t){return e.type===t.type&&e.key===t.key}function aye(e){}const zx=({key:e})=>e??null,Tf=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?En(e)||oo(e)||Lt(e)?{i:Fo,r:e,k:t,f:!!n}:e:null);function C(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&&zx(t),ref:t&&Tf(t),scopeId:fp,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:Fo};return l?(y0(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=En(n)?8:16),Gl>0&&!r&&Ko&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Ko.push(a),a}const se=L5;function L5(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===yx)&&(e=fo),Zr(e)){const l=fr(e,t,!0);return n&&y0(l,n),Gl>0&&!i&&Ko&&(l.shapeFlag&6?Ko[Ko.indexOf(e)]=l:Ko.push(l)),l.patchFlag=-2,l}if(B5(e)&&(e=e.__vccOpts),t){t=N5(t);let{class:l,style:a}=t;l&&!En(l)&&(t.class=De(l)),hn(a)&&(dp(a)&&!wt(a)&&(a=wn({},a)),t.style=en(a))}const r=En(e)?1:sh(e)?128:ux(e)?64:hn(e)?4:Lt(e)?2:0;return C(e,t,n,o,s,r,i,!0)}function N5(e){return e?dp(e)||Mx(e)?wn({},e):e:null}function fr(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&&zx(c),ref:t&&t.ref?n&&i?wt(i)?i.concat(Tf(t)):[i,Tf(t)]:Tf(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&&fr(e.ssContent),ssFallback:e.ssFallback&&fr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Xr(u,a.clone(u)),u}function qe(e=" ",t=0){return se(Kr,null,e,t)}function v0(e,t){const n=se(ec,null,e);return n.staticCount=t,n}function re(e="",t=!1){return t?(_(),ke(fo,null,e)):se(fo,null,e)}function vs(e){return e==null||typeof e=="boolean"?se(fo):wt(e)?se(Pe,null,e.slice()):Zr(e)?Zi(e):se(Kr,null,String(e))}function Zi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:fr(e)}function y0(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(wt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),y0(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Mx(t)?t._ctx=Fo:s===3&&Fo&&(Fo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Lt(t)?(t={default:t,_ctx:Fo},n=32):(t=String(t),o&64?(n=16,t=[qe(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=De([t.class,o.class]));else if(s==="style")t.style=en([t.style,o.style]);else if(sd(s)){const i=t[s],r=o[s];r&&i!==r&&!(wt(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!Jh(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function ms(e,t,n,o=null){li(e,t,7,[n,o])}const R5=_x();let O5=0;function Wx(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||R5,i={uid:O5++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new DC(!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:Ex(o,s),emitsOptions:Sx(o,s),emit:null,emitted:null,propsDefaults:Xt,inheritAttrs:o.inheritAttrs,ctx:Xt,data:Xt,props:Xt,attrs:Xt,slots:Xt,refs:Xt,setupState:Xt,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=d5.bind(null,i),e.ce&&e.ce(i),i}let Po=null;const Ho=()=>Po||Fo;let rh,tc;{const e=ip(),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)}};rh=t("__VUE_INSTANCE_SETTERS__",n=>Po=n),tc=t("__VUE_SSR_SETTERS__",n=>Yl=n)}const _c=e=>{const t=Po;return rh(e),e.scope.on(),()=>{e.scope.off(),rh(t)}},Bu=()=>{Po&&Po.scope.off(),rh(null)};function Ux(e){return e.vnode.shapeFlag&4}let Yl=!1;function qx(e,t=!1,n=!1){t&&tc(t);const{props:o,children:s}=e.vnode,i=Ux(e);v5(e,o,i,t),_5(e,s,n||t);const r=i?P5(e,t):void 0;return t&&tc(!1),r}function P5(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,L1);const{setup:o}=n;if(o){cr();const s=e.setupContext=o.length>1?Vx(e):null,i=_c(e),r=id(o,e,0,[e.props,s]),l=Jv(r);if(ur(),i(),(l||e.sp)&&!rr(e)&&l0(e),l){if(r.then(Bu,Bu),t)return r.then(a=>{D1(e,a,t)}).catch(a=>{bc(a,e,0)});e.asyncDep=r}else D1(e,r,t)}else jx(e,t)}function D1(e,t,n){Lt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:hn(t)&&(e.setupState=tx(t)),jx(e,n)}let lh,B1;function cye(e){lh=e,B1=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,o5))}}const uye=()=>!lh;function jx(e,t,n){const o=e.type;if(!e.render){if(!t&&lh&&!o.render){const s=o.template||h0(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=wn(wn({isCustomElement:i,delimiters:l},r),a);o.render=lh(s,c)}}e.render=o.render||si,B1&&B1(e)}{const s=_c(e);cr();try{s5(e)}finally{ur(),s()}}}const D5={get(e,t){return Vo(e,"get",""),e[t]}};function Vx(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,D5),slots:e.slots,emit:e.emit,expose:t}}function cd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tx(vt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in hu)return hu[n](e)},has(t,n){return n in t||n in hu}})):e.proxy}function F1(e,t=!0){return Lt(e)?e.displayName||e.name:e.name||t&&e.__name}function B5(e){return Lt(e)&&"__vccOpts"in e}const B=(e,t)=>bI(e,t,Yl);function yn(e,t,n){try{ih(-1);const o=arguments.length;return o===2?hn(t)&&!wt(t)?Zr(t)?se(e,null,[t]):se(e,t):se(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Zr(n)&&(n=[n]),se(e,t,n))}finally{ih(1)}}function dye(){}function fye(e,t,n,o){const s=n[o];if(s&&F5(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function F5(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(Ro(n[o],t[o]))return!1;return Gl>0&&Ko&&Ko.push(e),!0}const H5="3.5.35",hye=si,pye=xI,mye=Na,gye=lx,z5={createComponentInstance:Wx,setupComponent:qx,renderComponentRoot:Mf,setCurrentRenderingInstance:Ru,isVNode:Zr,normalizeVNode:vs,getComponentPublicInstance:cd,ensureValidVNode:f0,pushWarningContext:SI,popWarningContext:CI},vye=z5,yye=null,kye=null,bye=null;/**
17
+ * @vue/runtime-dom v3.5.35
18
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
+ * @license MIT
20
+ **/let H1;const $b=typeof window<"u"&&window.trustedTypes;if($b)try{H1=$b.createPolicy("vue",{createHTML:e=>e})}catch{}const Kx=H1?e=>H1.createHTML(e):e=>e,W5="http://www.w3.org/2000/svg",U5="http://www.w3.org/1998/Math/MathML",Gi=typeof document<"u"?document:null,Lb=Gi&&Gi.createElement("template"),q5={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"?Gi.createElementNS(W5,e):t==="mathml"?Gi.createElementNS(U5,e):n?Gi.createElement(e,{is:n}):Gi.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>Gi.createTextNode(e),createComment:e=>Gi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Gi.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{Lb.innerHTML=Kx(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Lb.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]}},Ar="transition",Gc="animation",uc=Symbol("_vtc"),Gx={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},Yx=wn({},fx,Gx),j5=e=>(e.displayName="Transition",e.props=Yx,e),Jr=j5((e,{slots:t})=>yn(DI,Qx(e),t)),Cl=(e,t=[])=>{wt(e)?e.forEach(n=>n(...t)):e&&e(...t)},Nb=e=>e?wt(e)?e.some(t=>t.length>1):e.length>1:!1;function Qx(e){const t={};for(const S in e)S in Gx||(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:p=`${n}-leave-to`}=e,h=V5(s),m=h&&h[0],w=h&&h[1],{onBeforeEnter:k,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:M,onBeforeAppear:O=k,onAppear:L=g,onAppearCancelled:b=v}=t,T=(S,E,P,D)=>{S._enterCancelled=D,Pr(S,E?u:l),Pr(S,E?c:r),P&&P()},$=(S,E)=>{S._isLeaving=!1,Pr(S,d),Pr(S,p),Pr(S,f),E&&E()},N=S=>(E,P)=>{const D=S?L:g,F=()=>T(E,S,P);Cl(D,[E,F]),Rb(()=>{Pr(E,S?a:i),Ei(E,S?u:l),Nb(D)||Ob(E,o,m,F)})};return wn(t,{onBeforeEnter(S){Cl(k,[S]),Ei(S,i),Ei(S,r)},onBeforeAppear(S){Cl(O,[S]),Ei(S,a),Ei(S,c)},onEnter:N(!1),onAppear:N(!0),onLeave(S,E){S._isLeaving=!0;const P=()=>$(S,E);Ei(S,d),S._enterCancelled?(Ei(S,f),z1(S)):(z1(S),Ei(S,f)),Rb(()=>{S._isLeaving&&(Pr(S,d),Ei(S,p),Nb(y)||Ob(S,o,w,P))}),Cl(y,[S,P])},onEnterCancelled(S){T(S,!1,void 0,!0),Cl(v,[S])},onAppearCancelled(S){T(S,!0,void 0,!0),Cl(b,[S])},onLeaveCancelled(S){$(S),Cl(M,[S])}})}function V5(e){if(e==null)return null;if(hn(e))return[ng(e.enter),ng(e.leave)];{const t=ng(e);return[t,t]}}function ng(e){return Kf(e)}function Ei(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[uc]||(e[uc]=new Set)).add(t)}function Pr(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 Rb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let K5=0;function Ob(e,t,n,o){const s=e._endId=++K5,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=Xx(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=p=>{p.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function Xx(e,t){const n=window.getComputedStyle(e),o=h=>(n[h]||"").split(", "),s=o(`${Ar}Delay`),i=o(`${Ar}Duration`),r=Pb(s,i),l=o(`${Gc}Delay`),a=o(`${Gc}Duration`),c=Pb(l,a);let u=null,d=0,f=0;t===Ar?r>0&&(u=Ar,d=r,f=i.length):t===Gc?c>0&&(u=Gc,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Ar:Gc:null,f=u?u===Ar?i.length:a.length:0);const p=u===Ar&&/\b(?:transform|all)(?:,|$)/.test(o(`${Ar}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Pb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>Db(n)+Db(e[o])))}function Db(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function z1(e){return(e?e.ownerDocument:document).body.offsetHeight}function G5(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 ah=Symbol("_vod"),Zx=Symbol("_vsh"),Ns={name:"show",beforeMount(e,{value:t},{transition:n}){e[ah]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Yc(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),Yc(e,!0),o.enter(e)):o.leave(e,()=>{Yc(e,!1)}):Yc(e,t))},beforeUnmount(e,{value:t}){Yc(e,t)}};function Yc(e,t){e.style.display=t?e[ah]:"none",e[Zx]=!t}function Y5(){Ns.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const Jx=Symbol("");function _ye(e){const t=Ho();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>ch(i,s))},o=()=>{const s=e(t.proxy);t.ce?ch(t.ce,s):W1(t.subTree,s),n(s)};vx(()=>{Jf(o)}),Sn(()=>{Ve(o,si,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),In(()=>s.disconnect())})}function W1(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{W1(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)ch(e.el,t);else if(e.type===Pe)e.children.forEach(n=>W1(n,t));else if(e.type===ec){let{el:n,anchor:o}=e;for(;n&&(ch(n,t),n!==o);)n=n.nextSibling}}function ch(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=VE(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[Jx]=o}}const Q5=/(?:^|;)\s*display\s*:/;function X5(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&&ru(o,l,"")}else for(const r in t)n[r]==null&&ru(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?J5(e,r,!En(t)&&t?t[r]:void 0,l)||ru(o,r,l):ru(o,r,"")}}else if(s){if(t!==n){const r=o[Jx];r&&(n+=";"+r),o.cssText=n,i=Q5.test(n)}}else t&&e.removeAttribute("style");ah in e&&(e[ah]=i?o.display:"",e[Zx]&&(o.display="none"))}const Bb=/\s*!important$/;function ru(e,t,n){if(wt(n))n.forEach(o=>ru(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=Z5(e,t);Bb.test(n)?e.setProperty(ys(o),n.replace(Bb,""),"important"):e[o]=n}}const Fb=["Webkit","Moz","ms"],og={};function Z5(e,t){const n=og[t];if(n)return n;let o=_o(t);if(o!=="filter"&&o in e)return og[t]=o;o=op(o);for(let s=0;s<Fb.length;s++){const i=Fb[s]+o;if(i in e)return og[t]=i}return t}function J5(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&En(o)&&n===o}const Hb="http://www.w3.org/1999/xlink";function zb(e,t,n,o,s,i=qE(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Hb,t.slice(6,t.length)):e.setAttributeNS(Hb,t,n):n==null||i&&!RC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":zs(n)?String(n):n)}function Wb(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Kx(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=RC(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 nr(e,t,n,o){e.addEventListener(t,n,o)}function e$(e,t,n,o){e.removeEventListener(t,n,o)}const Ub=Symbol("_vei");function t$(e,t,n,o,s=null){const i=e[Ub]||(e[Ub]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=n$(t);if(o){const c=i[t]=i$(o,s);nr(e,l,c,a)}else r&&(e$(e,l,r,a),i[t]=void 0)}}const qb=/(?:Once|Passive|Capture)$/;function n$(e){let t;if(qb.test(e)){t={};let o;for(;o=e.match(qb);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):ys(e.slice(2)),t]}let sg=0;const o$=Promise.resolve(),s$=()=>sg||(o$.then(()=>sg=0),sg=Date.now());function i$(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(wt(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&&li(c,t,5,l)}}else li(s,t,5,[o])};return n.value=e,n.attached=s$(),n}const jb=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,r$=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?G5(e,o,r):t==="style"?X5(e,n,o):sd(t)?Jh(t)||t$(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):l$(e,t,o,r))?(Wb(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&zb(e,t,o,r,i,t!=="value")):e._isVueCE&&(a$(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!En(o)))?Wb(e,_o(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),zb(e,t,o,r))};function l$(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&jb(t)&&Lt(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 jb(t)&&En(n)?!1:t in e}function a$(e,t){const n=e._def.props;if(!n)return!1;const o=_o(t);return Array.isArray(n)?n.some(s=>_o(s)===o):Object.keys(n).some(s=>_o(s)===o)}const Vb={};function c$(e,t,n){let o=je(e,t);ep(o)&&(o=wn({},o,t));class s extends k0{constructor(r){super(o,r,n)}}return s.def=o,s}const wye=((e,t)=>c$(e,t,A$)),u$=typeof HTMLElement<"u"?HTMLElement:class{};class k0 extends u${constructor(t,n={},o=fh){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!==fh?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(wn({},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 k0){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,gt(()=>{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&&!wt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Kf(this._props[a])),(l||(l=Object.create(null)))[_o(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)fn(this,o)||Object.defineProperty(this,o,{get:()=>x(n[o])})}_resolveProps(t){const{props:n}=t,o=wt(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(_o))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):Vb;const s=_o(t);n&&this._numberProps&&this._numberProps[s]&&(o=Kf(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===Vb?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(ys(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(ys(t),n+""):n||this.removeAttribute(ys(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),x$(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=se(this._def,wn(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,ep(r[0])?wn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),ys(i)!==i&&s(ys(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 d$(e){const t=Ho(),n=t&&t.ce;return n||null}function Sye(){const e=d$();return e&&e.shadowRoot}function Cye(e="$style"){{const t=Ho();if(!t)return Xt;const n=t.type.__cssModules;if(!n)return Xt;const o=n[e];return o||Xt}}const e4=new WeakMap,t4=new WeakMap,uh=Symbol("_moveCb"),Kb=Symbol("_enterCb"),f$=e=>(delete e.props.mode,e),h$=f$({name:"TransitionGroup",props:wn({},Yx,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Ho(),o=dx();let s,i;return a0(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!y$(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(m$),s.forEach(g$);const l=s.filter(v$);z1(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Ei(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[uh]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[uh]=null,Pr(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=on(e),l=Qx(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),Xr(u,Ou(u,l,o,n)),e4.set(u,n4(u.el)))}i=t.default?r0(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Xr(u,Ou(u,l,o,n))}return se(a,null,i)}}}),p$=h$;function m$(e){const t=e.el;t[uh]&&t[uh](),t[Kb]&&t[Kb]()}function g$(e){t4.set(e,n4(e.el))}function v$(e){const t=e4.get(e),n=t4.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 n4(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function y$(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}=Xx(o);return i.removeChild(o),r}const el=e=>{const t=e.props["onUpdate:modelValue"]||!1;return wt(t)?n=>Qa(t,n):t};function k$(e){e.target.composing=!0}function Gb(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ii=Symbol("_assign");function Yb(e,t,n){return t&&(e=e.trim()),n&&(e=sp(e)),e}const us={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[ii]=el(s);const i=o||s.props&&s.props.type==="number";nr(e,t?"change":"input",r=>{r.target.composing||e[ii](Yb(e.value,n,i))}),(n||i)&&nr(e,"change",()=>{e.value=Yb(e.value,n,i)}),t||(nr(e,"compositionstart",k$),nr(e,"compositionend",Gb),nr(e,"change",Gb))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[ii]=el(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?sp(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)}},dh={deep:!0,created(e,t,n){e[ii]=el(n),nr(e,"change",()=>{const o=e._modelValue,s=dc(e),i=e.checked,r=e[ii];if(wt(o)){const l=rp(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(ea(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(s4(e,i))})},mounted:Qb,beforeUpdate(e,t,n){e[ii]=el(n),Qb(e,t,n)}};function Qb(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(wt(t))s=rp(t,o.props.value)>-1;else if(ea(t))s=t.has(o.props.value);else{if(t===n)return;s=ar(t,s4(e,!0))}e.checked!==s&&(e.checked=s)}const o4={created(e,{value:t},n){e.checked=ar(t,n.props.value),e[ii]=el(n),nr(e,"change",()=>{e[ii](dc(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[ii]=el(o),t!==n&&(e.checked=ar(t,o.props.value))}},U1={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=ea(t);nr(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?sp(dc(r)):dc(r));e[ii](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,gt(()=>{e._assigning=!1})}),e[ii]=el(o)},mounted(e,{value:t}){Xb(e,t)},beforeUpdate(e,t,n){e[ii]=el(n)},updated(e,{value:t}){e._assigning||Xb(e,t)}};function Xb(e,t){const n=e.multiple,o=wt(t);if(!(n&&!o&&!ea(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=dc(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=rp(t,l)>-1}else r.selected=t.has(l);else if(ar(dc(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function dc(e){return"_value"in e?e._value:e.value}function s4(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const b$={created(e,t,n){Jd(e,t,n,null,"created")},mounted(e,t,n){Jd(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Jd(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Jd(e,t,n,o,"updated")}};function i4(e,t){switch(e){case"SELECT":return U1;case"TEXTAREA":return us;default:switch(t){case"checkbox":return dh;case"radio":return o4;default:return us}}}function Jd(e,t,n,o,s){const r=i4(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function _$(){us.getSSRProps=({value:e})=>({value:e}),o4.getSSRProps=({value:e},t)=>{if(t.props&&ar(t.props.value,e))return{checked:!0}},dh.getSSRProps=({value:e},t)=>{if(wt(e)){if(t.props&&rp(e,t.props.value)>-1)return{checked:!0}}else if(ea(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},b$.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=i4(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const w$=["ctrl","shift","alt","meta"],S$={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)=>w$.some(n=>e[`${n}Key`]&&!t.includes(n))},kt=(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=S$[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},C$={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},gi=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=ys(s.key);if(t.some(r=>r===i||C$[r]===i))return e(s)}))},r4=wn({patchProp:r$},q5);let mu,Zb=!1;function l4(){return mu||(mu=S5(r4))}function a4(){return mu=Zb?mu:C5(r4),Zb=!0,mu}const x$=((...e)=>{l4().render(...e)}),xye=((...e)=>{a4().hydrate(...e)}),fh=((...e)=>{const t=l4().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=u4(o);if(!s)return;const i=t._component;!Lt(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,c4(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),A$=((...e)=>{const t=a4().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=u4(o);if(s)return n(s,!0,c4(s))},t});function c4(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function u4(e){return En(e)?document.querySelector(e):e}let Jb=!1;const Aye=()=>{Jb||(Jb=!0,_$(),Y5())};/*!
21
+ * shared v11.4.5
22
+ * (c) 2026 kazuya kawaguchi
23
+ * Released under the MIT License.
24
+ */function M$(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const hh=typeof window<"u",rl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),T$=(e,t,n)=>E$({l:e,k:t,s:n}),E$=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),po=e=>typeof e=="number"&&isFinite(e),d4=e=>_0(e)==="[object Date]",fc=e=>_0(e)==="[object RegExp]",vp=e=>Jt(e)&&Object.keys(e).length===0,mo=Object.assign,I$=Object.create,Tn=(e=null)=>I$(e);let e2;const Dl=()=>e2||(e2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Tn());function t2(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 $$(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 L$=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,N$=/^(?:href|src|action|formaction)$/i;function b0(e){return L$.test(e)}function R$(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+=b0(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function n2(e,t){if(N$.test(e)&&b0(t))return"about:blank";const n=e.toLowerCase()==="style"?R$(t):t;return $$(n)}function O$(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${n2(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${n2(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)=>b0(s)?`${o}about:blank`:n),e}const P$=Object.prototype.hasOwnProperty;function oi(e,t){return P$.call(e,t)}const eo=Array.isArray,Un=e=>typeof e=="function",mt=e=>typeof e=="string",an=e=>typeof e=="boolean",cn=e=>e!==null&&typeof e=="object",D$=e=>cn(e)&&Un(e.then)&&Un(e.catch),f4=Object.prototype.toString,_0=e=>f4.call(e),Jt=e=>_0(e)==="[object Object]",B$=e=>e==null?"":eo(e)||Jt(e)&&e.toString===f4?JSON.stringify(e,null,2):String(e);function w0(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const ef=e=>!cn(e)||eo(e);function Ef(e,t){if(ef(e)||ef(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__"&&(cn(o[i])&&!cn(s[i])&&(s[i]=Array.isArray(o[i])?[]:Tn()),ef(s[i])||ef(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 F$(e,t,n){return{line:e,column:t,offset:n}}function q1(e,t,n){return{start:e,end:t}}const vn={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},H$=17;function yp(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 z$(e){throw e}const Mi=" ",W$="\r",qo=`
29
+ `,U$="\u2028",q$="\u2029";function j$(e){const t=e;let n=0,o=1,s=1,i=0;const r=L=>t[L]===W$&&t[L+1]===qo,l=L=>t[L]===qo,a=L=>t[L]===q$,c=L=>t[L]===U$,u=L=>r(L)||l(L)||a(L)||c(L),d=()=>n,f=()=>o,p=()=>s,h=()=>i,m=L=>r(L)||a(L)||c(L)?qo:t[L],w=()=>m(n),k=()=>m(n+i);function g(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function y(){n=0,o=1,s=1,i=0}function M(L=0){i=L}function O(){const L=n+i;for(;L!==n;)g();i=0}return{index:d,line:f,column:p,peekOffset:h,charAt:m,currentChar:w,currentPeek:k,next:g,peek:v,reset:y,resetPeek:M,skipToPeek:O}}const Vi=void 0,V$=".",o2="'",K$="tokenizer";function G$(e,t={}){const n=t.location!==!1,o=j$(e),s=()=>o.index(),i=()=>F$(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(U,J,fe,...be){const Ee=c();if(J.column+=fe,J.offset+=fe,u){const Le=n?q1(Ee.startLoc,J):null,ue=yp(U,Le,{domain:K$,args:be});u(ue)}}function f(U,J,fe){U.endLoc=i(),U.currentType=J;const be={type:J};return n&&(be.loc=q1(U.startLoc,U.endLoc)),fe!=null&&(be.value=fe),be}const p=U=>f(U,13);function h(U,J){return U.currentChar()===J?(U.next(),J):(d(vn.EXPECTED_TOKEN,i(),0,J),"")}function m(U){let J="";for(;U.currentPeek()===Mi||U.currentPeek()===qo;)J+=U.currentPeek(),U.peek();return J}function w(U){const J=m(U);return U.skipToPeek(),J}function k(U){if(U===Vi)return!1;const J=U.charCodeAt(0);return J>=97&&J<=122||J>=65&&J<=90||J===95}function g(U){if(U===Vi)return!1;const J=U.charCodeAt(0);return J>=48&&J<=57}function v(U,J){const{currentType:fe}=J;if(fe!==2)return!1;m(U);const be=k(U.currentPeek());return U.resetPeek(),be}function y(U,J){const{currentType:fe}=J;if(fe!==2)return!1;m(U);const be=U.currentPeek()==="-"?U.peek():U.currentPeek(),Ee=g(be);return U.resetPeek(),Ee}function M(U,J){const{currentType:fe}=J;if(fe!==2)return!1;m(U);const be=U.currentPeek()===o2;return U.resetPeek(),be}function O(U,J){const{currentType:fe}=J;if(fe!==7)return!1;m(U);const be=U.currentPeek()===".";return U.resetPeek(),be}function L(U,J){const{currentType:fe}=J;if(fe!==8)return!1;m(U);const be=k(U.currentPeek());return U.resetPeek(),be}function b(U,J){const{currentType:fe}=J;if(!(fe===7||fe===11))return!1;m(U);const be=U.currentPeek()===":";return U.resetPeek(),be}function T(U,J){const{currentType:fe}=J;if(fe!==9)return!1;const be=()=>{const Le=U.currentPeek();return Le==="{"?k(U.peek()):Le==="@"||Le==="|"||Le===":"||Le==="."||Le===Mi||!Le?!1:Le===qo?(U.peek(),be()):N(U,!1)},Ee=be();return U.resetPeek(),Ee}function $(U){m(U);const J=U.currentPeek()==="|";return U.resetPeek(),J}function N(U,J=!0){const fe=(Ee=!1,Le="")=>{const ue=U.currentPeek();return ue==="{"||ue==="@"||!ue?Ee:ue==="|"?!(Le===Mi||Le===qo):ue===Mi?(U.peek(),fe(!0,Mi)):ue===qo?(U.peek(),fe(!0,qo)):!0},be=fe();return J&&U.resetPeek(),be}function S(U,J){const fe=U.currentChar();return fe===Vi?Vi:J(fe)?(U.next(),fe):null}function E(U){const J=U.charCodeAt(0);return J>=97&&J<=122||J>=65&&J<=90||J>=48&&J<=57||J===95||J===36}function P(U){return S(U,E)}function D(U){const J=U.charCodeAt(0);return J>=97&&J<=122||J>=65&&J<=90||J>=48&&J<=57||J===95||J===36||J===45}function F(U){return S(U,D)}function W(U){const J=U.charCodeAt(0);return J>=48&&J<=57}function K(U){return S(U,W)}function Y(U){const J=U.charCodeAt(0);return J>=48&&J<=57||J>=65&&J<=70||J>=97&&J<=102}function q(U){return S(U,Y)}function ae(U){let J="",fe="";for(;J=K(U);)fe+=J;return fe}function ce(U){let J="";for(;;){const fe=U.currentChar();if(fe==="\\"){const be=U.peek();be==="{"||be==="}"||be==="@"||be==="|"||be==="\\"?(J+=fe+be,U.next(),U.next()):(U.resetPeek(),J+=fe,U.next())}else{if(fe==="{"||fe==="}"||fe==="@"||fe==="|"||!fe)break;if(fe===Mi||fe===qo)if(N(U))J+=fe,U.next();else{if($(U))break;J+=fe,U.next()}else J+=fe,U.next()}}return J}function ne(U){w(U);let J="",fe="";for(;J=F(U);)fe+=J;const be=U.currentChar();if(be&&be!=="}"&&be!==Vi&&be!==Mi&&be!==qo&&be!==" "){const Ee=G(U);return d(vn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,fe+Ee),fe+Ee}return U.currentChar()===Vi&&d(vn.UNTERMINATED_CLOSING_BRACE,i(),0),fe}function Q(U){w(U);let J="";return U.currentChar()==="-"?(U.next(),J+=`-${ae(U)}`):J+=ae(U),U.currentChar()===Vi&&d(vn.UNTERMINATED_CLOSING_BRACE,i(),0),J}function ee(U){return U!==o2&&U!==qo}function ye(U){w(U),h(U,"'");let J="",fe="";for(;J=S(U,ee);)J==="\\"?fe+=xe(U):fe+=J;const be=U.currentChar();return be===qo||be===Vi?(d(vn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),be===qo&&(U.next(),h(U,"'")),fe):(h(U,"'"),fe)}function xe(U){const J=U.currentChar();switch(J){case"\\":case"'":return U.next(),`\\${J}`;case"u":return Xe(U,J,4);case"U":return Xe(U,J,6);default:return d(vn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,J),""}}function Xe(U,J,fe){h(U,J);let be="";for(let Ee=0;Ee<fe;Ee++){const Le=q(U);if(!Le){d(vn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${J}${be}${U.currentChar()}`);break}be+=Le}return`\\${J}${be}`}function me(U){return U!=="{"&&U!=="}"&&U!==Mi&&U!==qo}function G(U){w(U);let J="",fe="";for(;J=S(U,me);)fe+=J;return fe}function ie(U){let J="",fe="";for(;J=P(U);)fe+=J;return fe}function de(U){const J=fe=>{const be=U.currentChar();return be==="{"||be==="@"||be==="|"||be==="("||be===")"||!be||be===Mi?fe:(fe+=be,U.next(),J(fe))};return J("")}function z(U){w(U);const J=h(U,"|");return w(U),J}function Z(U,J){let fe=null;switch(U.currentChar()){case"{":return J.braceNest>=1&&d(vn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),U.next(),fe=f(J,2,"{"),w(U),J.braceNest++,fe;case"}":return J.braceNest>0&&J.currentType===2&&d(vn.EMPTY_PLACEHOLDER,i(),0),U.next(),fe=f(J,3,"}"),J.braceNest--,J.braceNest>0&&w(U),J.inLinked&&J.braceNest===0&&(J.inLinked=!1),fe;case"@":return J.braceNest>0&&d(vn.UNTERMINATED_CLOSING_BRACE,i(),0),fe=pe(U,J)||p(J),J.braceNest=0,fe;default:{let Ee=!0,Le=!0,ue=!0;if($(U))return J.braceNest>0&&d(vn.UNTERMINATED_CLOSING_BRACE,i(),0),fe=f(J,1,z(U)),J.braceNest=0,J.inLinked=!1,fe;if(J.braceNest>0&&(J.currentType===4||J.currentType===5||J.currentType===6))return d(vn.UNTERMINATED_CLOSING_BRACE,i(),0),J.braceNest=0,le(U,J);if(Ee=v(U,J))return fe=f(J,4,ne(U)),w(U),fe;if(Le=y(U,J))return fe=f(J,5,Q(U)),w(U),fe;if(ue=M(U,J))return fe=f(J,6,ye(U)),w(U),fe;if(!Ee&&!Le&&!ue)return fe=f(J,12,G(U)),d(vn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,fe.value),w(U),fe;break}}return fe}function pe(U,J){const{currentType:fe}=J;let be=null;const Ee=U.currentChar();switch((fe===7||fe===8||fe===11||fe===9)&&(Ee===qo||Ee===Mi)&&d(vn.INVALID_LINKED_FORMAT,i(),0),Ee){case"@":return U.next(),be=f(J,7,"@"),J.inLinked=!0,be;case".":return w(U),U.next(),f(J,8,".");case":":return w(U),U.next(),f(J,9,":");default:return $(U)?(be=f(J,1,z(U)),J.braceNest=0,J.inLinked=!1,be):O(U,J)||b(U,J)?(w(U),pe(U,J)):L(U,J)?(w(U),f(J,11,ie(U))):T(U,J)?(w(U),Ee==="{"?Z(U,J)||be:f(J,10,de(U))):(fe===7&&d(vn.INVALID_LINKED_FORMAT,i(),0),J.braceNest=0,J.inLinked=!1,le(U,J))}}function le(U,J){let fe={type:13};if(J.braceNest>0)return Z(U,J)||p(J);if(J.inLinked)return pe(U,J)||p(J);switch(U.currentChar()){case"{":return Z(U,J)||p(J);case"}":return d(vn.UNBALANCED_CLOSING_BRACE,i(),0),U.next(),f(J,3,"}");case"@":return pe(U,J)||p(J);default:{if($(U))return fe=f(J,1,z(U)),J.braceNest=0,J.inLinked=!1,fe;if(N(U))return f(J,0,ce(U));break}}return fe}function he(){const{currentType:U,offset:J,startLoc:fe,endLoc:be}=a;return a.lastType=U,a.lastOffset=J,a.lastStartLoc=fe,a.lastEndLoc=be,a.offset=s(),a.startLoc=i(),o.currentChar()===Vi?f(a,13):le(o,a)}return{nextToken:he,currentOffset:s,currentPosition:i,context:c}}const Y$="parser",Q$=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,X$=/\\([\\@{}|])/g;function Z$(e,t){return t}function J$(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 e6(e={}){const t=e.location!==!1,{onError:n}=e;function o(k,g,v,y,...M){const O=k.currentPosition();if(O.offset+=y,O.column+=y,n){const L=t?q1(v,O):null,b=yp(g,L,{domain:Y$,args:M});n(b)}}function s(k,g,v){const y={type:k};return t&&(y.start=g,y.end=g,y.loc={start:v,end:v}),y}function i(k,g,v,y){t&&(k.end=g,k.loc&&(k.loc.end=v))}function r(k,g){const v=k.context(),y=s(3,v.offset,v.startLoc);return y.value=g.replace(X$,Z$),i(y,k.currentOffset(),k.currentPosition()),y}function l(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:M}=v,O=s(5,y,M);return O.index=parseInt(g,10),k.nextToken(),i(O,k.currentOffset(),k.currentPosition()),O}function a(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:M}=v,O=s(4,y,M);return O.key=g,k.nextToken(),i(O,k.currentOffset(),k.currentPosition()),O}function c(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:M}=v,O=s(9,y,M);return O.value=g.replace(Q$,J$),k.nextToken(),i(O,k.currentOffset(),k.currentPosition()),O}function u(k){const g=k.nextToken(),v=k.context(),{lastOffset:y,lastStartLoc:M}=v,O=s(8,y,M);return g.type!==11?(o(k,vn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),O.value="",i(O,y,M),{nextConsumeToken:g,node:O}):(g.value==null&&o(k,vn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ti(g)),O.value=g.value||"",i(O,k.currentOffset(),k.currentPosition()),{node:O})}function d(k,g){const v=k.context(),y=s(7,v.offset,v.startLoc);return y.value=g,i(y,k.currentOffset(),k.currentPosition()),y}function f(k){const g=k.context(),v=s(6,g.offset,g.startLoc);let y=k.nextToken();if(y.type===8){const M=u(k);v.modifier=M.node,y=M.nextConsumeToken||k.nextToken()}switch(y.type!==9&&o(k,vn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ti(y)),y=k.nextToken(),y.type===2&&(y=k.nextToken()),y.type){case 10:y.value==null&&o(k,vn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ti(y)),v.key=d(k,y.value||"");break;case 4:y.value==null&&o(k,vn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ti(y)),v.key=a(k,y.value||"");break;case 5:y.value==null&&o(k,vn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ti(y)),v.key=l(k,y.value||"");break;case 6:y.value==null&&o(k,vn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ti(y)),v.key=c(k,y.value||"");break;default:{o(k,vn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const M=k.context(),O=s(7,M.offset,M.startLoc);return O.value="",i(O,M.offset,M.startLoc),v.key=O,i(v,M.offset,M.startLoc),{nextConsumeToken:y,node:v}}}return i(v,k.currentOffset(),k.currentPosition()),{node:v}}function p(k){const g=k.context(),v=g.currentType===1?k.currentOffset():g.offset,y=g.currentType===1?g.endLoc:g.startLoc,M=s(2,v,y);M.items=[];let O=null;do{const T=O||k.nextToken();switch(O=null,T.type){case 0:T.value==null&&o(k,vn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ti(T)),M.items.push(r(k,T.value||""));break;case 5:T.value==null&&o(k,vn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ti(T)),M.items.push(l(k,T.value||""));break;case 4:T.value==null&&o(k,vn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ti(T)),M.items.push(a(k,T.value||""));break;case 6:T.value==null&&o(k,vn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ti(T)),M.items.push(c(k,T.value||""));break;case 7:{const $=f(k);M.items.push($.node),O=$.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const L=g.currentType===1?g.lastOffset:k.currentOffset(),b=g.currentType===1?g.lastEndLoc:k.currentPosition();return i(M,L,b),M}function h(k,g,v,y){const M=k.context();let O=y.items.length===0;const L=s(1,g,v);L.cases=[],L.cases.push(y);do{const b=p(k);O||(O=b.items.length===0),L.cases.push(b)}while(M.currentType!==13);return O&&o(k,vn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i(L,k.currentOffset(),k.currentPosition()),L}function m(k){const g=k.context(),{offset:v,startLoc:y}=g,M=p(k);return g.currentType===13?M:h(k,v,y,M)}function w(k){const g=G$(k,mo({},e)),v=g.context(),y=s(0,v.offset,v.startLoc);return t&&y.loc&&(y.loc.source=k),y.body=m(g),e.onCacheKey&&(y.cacheKey=e.onCacheKey(k)),v.currentType!==13&&o(g,vn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,k[v.offset]||""),i(y,g.currentOffset(),g.currentPosition()),y}return{parse:w}}function Ti(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 t6(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function s2(e,t){for(let n=0;n<e.length;n++)S0(e[n],t)}function S0(e,t){switch(e.type){case 1:s2(e.cases,t),t.helper("plural");break;case 2:s2(e.items,t);break;case 6:{S0(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 n6(e,t={}){const n=t6(e);n.helper("normalize"),e.body&&S0(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function o6(e){const t=e.body;return t.type===2?i2(t):t.cases.forEach(n=>i2(n)),e}function i2(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=w0(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 Ra(e){switch(e.t=e.type,e.type){case 0:{const t=e;Ra(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++)Ra(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++)Ra(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;Ra(t.key),t.k=t.key,delete t.key,t.modifier&&(Ra(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 s6(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(m,w){r.code+=m}function c(m,w=!0){const k=w?o:"";a(s?k+" ".repeat(m):k)}function u(m=!0){const w=++r.indentLevel;m&&c(w)}function d(m=!0){const w=--r.indentLevel;m&&c(w)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function i6(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),hc(e,t.key),t.modifier?(e.push(", "),hc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function r6(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&&(hc(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function l6(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&&(hc(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function a6(e,t){t.body?hc(e,t.body):e.push("null")}function hc(e,t){const{helper:n}=e;switch(t.type){case 0:a6(e,t);break;case 1:l6(e,t);break;case 2:r6(e,t);break;case 6:i6(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 c6=(e,t={})=>{const n=mt(t.mode)?t.mode:"normal",o=mt(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=s6(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${w0(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),hc(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 u6(e,t={}){const n=mo({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=e6(n).parse(e);return o?(i&&o6(l),s&&Ra(l),{ast:l,code:""}):(n6(l,n),c6(l,n))}/*!
31
+ * core-base v11.4.5
32
+ * (c) 2026 kazuya kawaguchi
33
+ * Released under the MIT License.
34
+ */function d6(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Dl().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Dl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Ri(e){return cn(e)&&C0(e)===0&&(oi(e,"b")||oi(e,"body"))}const h4=["b","body"];function f6(e){return ll(e,h4)}const p4=["c","cases"];function h6(e){return ll(e,p4,[])}const m4=["s","static"];function p6(e){return ll(e,m4)}const g4=["i","items"];function m6(e){return ll(e,g4,[])}const v4=["t","type"];function C0(e){return ll(e,v4)}const y4=["v","value"];function tf(e,t){const n=ll(e,y4);if(n!=null)return n;throw Fu(t)}const k4=["m","modifier"];function g6(e){return ll(e,k4)}const b4=["k","key"];function v6(e){const t=ll(e,b4);if(t)return t;throw Fu(6)}function ll(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(oi(e,s)&&e[s]!=null)return e[s]}return n}const _4=[...h4,...p4,...m4,...g4,...b4,...k4,...y4,...v4];function Fu(e){return new Error(`unhandled node type: ${e}`)}function ig(e){return n=>y6(n,e)}function y6(e,t){const n=f6(t);if(n==null)throw Fu(0);if(C0(n)===1){const i=h6(n);return e.plural(i.reduce((r,l)=>[...r,r2(e,l)],[]))}else return r2(e,n)}function r2(e,t){const n=p6(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=m6(t).reduce((s,i)=>[...s,j1(e,i)],[]);return e.normalize(o)}}function j1(e,t){const n=C0(t);switch(n){case 3:return tf(t,n);case 9:return tf(t,n);case 4:{const o=t;if(oi(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(oi(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw Fu(n)}case 5:{const o=t;if(oi(o,"i")&&po(o.i))return e.interpolate(e.list(o.i));if(oi(o,"index")&&po(o.index))return e.interpolate(e.list(o.index));throw Fu(n)}case 6:{const o=t,s=g6(o),i=v6(o);return e.linked(j1(e,i),s?j1(e,s):void 0,e.type)}case 7:return tf(t,n);case 8:return tf(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const k6=e=>e;let nf=Tn();function b6(e,t={}){let n=!1;const o=t.onError||z$;return t.onError=s=>{n=!0,o(s)},{...u6(e,t),detectError:n}}function _6(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&mt(e)){an(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||k6)(e),s=nf[o];if(s)return s;const{ast:i,detectError:r}=b6(e,{...t,location:!1,jit:!0}),l=ig(i);return r?l:nf[o]=l}else{const n=e.cacheKey;if(n){const o=nf[n];return o||(nf[n]=ig(e))}else return ig(e)}}let Hu=null;function w6(e){Hu=e}function S6(e,t,n){Hu&&Hu.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const C6=x6("function:translate");function x6(e){return t=>Hu&&Hu.emit(e,t)}const or={INVALID_ARGUMENT:H$,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},A6=24;function sr(e){return yp(e,null,void 0)}function x0(e,t){return t.locale!=null?l2(t.locale):l2(e.locale)}let rg;function l2(e){if(mt(e))return e;if(Un(e)){if(e.resolvedOnce&&rg!=null)return rg;if(e.constructor.name==="Function"){const t=e();if(D$(t))throw sr(or.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return rg=t}else throw sr(or.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw sr(or.NOT_SUPPORT_LOCALE_TYPE)}function M6(e,t,n){return[...new Set([n,...eo(t)?t:cn(t)?Object.keys(t):mt(t)?[t]:[n]])]}function V1(e,t,n){const o=mt(n)?n:zu,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;eo(r);)r=a2(i,r,t);const l=eo(t)||!Jt(t)?t:t.default?t.default:null;r=mt(l)?[l]:l,eo(r)&&a2(i,r,!1),s.__localeChainCache.set(o,i)}return i}function a2(e,t,n){let o=!0;for(let s=0;s<t.length&&an(o);s++){const i=t[s];mt(i)&&(o=T6(e,t[s],n))}return o}function T6(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=E6(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function E6(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),(eo(n)||Jt(n))&&n[s]&&(o=n[s])}return o}const al=[];al[0]={w:[0],i:[3,0],"[":[4],o:[7]};al[1]={w:[1],".":[2],"[":[4],o:[7]};al[2]={w:[2],i:[3,0],0:[3,0]};al[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};al[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};al[5]={"'":[4,0],o:8,l:[5,0]};al[6]={'"':[4,0],o:8,l:[6,0]};const I6=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function $6(e){return I6.test(e)}function L6(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 N6(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 R6(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:$6(t)?L6(t):"*"+t}function O6(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=R6(r),r===!1))return!1;f[1]()}};function p(){const h=e[n+1];if(o===5&&h==="'"||o===6&&h==='"')return n++,l="\\"+h,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&p())){if(a=N6(i),d=al[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 c2=new Map;function P6(e,t){return cn(e)?e[t]:null}function D6(e,t){if(!cn(e))return null;let n=c2.get(t);if(n||(n=O6(t),n&&c2.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(_4.includes(r)&&Ri(s)||!cn(s)||!oi(s,r))return null;const l=s[r];if(l===void 0||Un(s))return null;s=l,i++}return s}const B6="11.4.5",kp=-1,zu="en-US",ph="",u2=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function F6(){return{upper:(e,t)=>t==="text"&&mt(e)?e.toUpperCase():t==="vnode"&&cn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&mt(e)?e.toLowerCase():t==="vnode"&&cn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&mt(e)?u2(e):t==="vnode"&&cn(e)&&"__v_isVNode"in e?u2(e.children):e}}let w4;function H6(e){w4=e}let S4;function z6(e){S4=e}let C4;function W6(e){C4=e}let x4=null;const U6=e=>{x4=e},q6=()=>x4;let A4=null;const d2=e=>{A4=e},j6=()=>A4;let f2=0;function V6(e={}){const t=Un(e.onWarn)?e.onWarn:M$,n=mt(e.version)?e.version:B6,o=mt(e.locale)||Un(e.locale)?e.locale:zu,s=Un(o)?zu:o,i=eo(e.fallbackLocale)||Jt(e.fallbackLocale)||mt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=Jt(e.messages)?e.messages:lg(s),l=Jt(e.datetimeFormats)?e.datetimeFormats:lg(s),a=Jt(e.numberFormats)?e.numberFormats:lg(s),c=mo(Tn(),e.modifiers,F6()),u=e.pluralRules||Tn(),d=Un(e.missing)?e.missing:null,f=an(e.missingWarn)||fc(e.missingWarn)?e.missingWarn:!0,p=an(e.fallbackWarn)||fc(e.fallbackWarn)?e.fallbackWarn:!0,h=!!e.fallbackFormat,m=!!e.unresolving,w=Un(e.postTranslation)?e.postTranslation:null,k=Jt(e.processor)?e.processor:null,g=an(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=Un(e.messageCompiler)?e.messageCompiler:w4,M=Un(e.messageResolver)?e.messageResolver:S4||P6,O=Un(e.localeFallbacker)?e.localeFallbacker:C4||M6,L=cn(e.fallbackContext)?e.fallbackContext:void 0,b=e,T=cn(b.__datetimeFormatters)?b.__datetimeFormatters:new Map,$=cn(b.__numberFormatters)?b.__numberFormatters:new Map,N=cn(b.__meta)?b.__meta:{};f2++;const S={version:n,cid:f2,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:m,postTranslation:w,processor:k,warnHtmlMessage:g,escapeParameter:v,messageCompiler:y,messageResolver:M,localeFallbacker:O,fallbackContext:L,onWarn:t,__meta:N};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=T,S.__numberFormatters=$,__INTLIFY_PROD_DEVTOOLS__&&S6(S,n,N),S}const lg=e=>({[e]:Tn()});function A0(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return mt(l)?l:t}else return t}function Qc(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function K6(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function G6(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(K6(e,t[o]))return!0;return!1}function h2(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!mt(t[0])&&!d4(t[0])&&!po(t[0]))return ph;const[a,c,u,d]=K1(...t),f=an(u.missingWarn)?u.missingWarn:e.missingWarn;an(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,h=x0(e,u),m=r(e,s,h);if(!mt(a)||a===""){const O=new Intl.DateTimeFormat(h.replace(/!/g,""),d);return p?O.formatToParts(c):O.format(c)}let w={},k,g=null;const v="datetime format";for(let O=0;O<m.length&&(k=m[O],w=n[k]||{},g=w[a],!Jt(g));O++)A0(e,a,k,f,v);if(!Jt(g)||!mt(k))return o?kp:a;let y=`${k}__${a}`;vp(d)||(y=`${y}__${JSON.stringify(d)}`);let M=l.get(y);return M||(M=new Intl.DateTimeFormat(k,mo({},g,d)),l.set(y,M)),p?M.formatToParts(c):M.format(c)}const M4=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function K1(...e){const[t,n,o,s]=e,i=Tn();let r=Tn(),l;if(mt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw sr(or.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 sr(or.INVALID_ISO_DATE_ARGUMENT)}}else if(d4(t)){if(isNaN(t.getTime()))throw sr(or.INVALID_DATE_ARGUMENT);l=t}else if(po(t))l=t;else throw sr(or.INVALID_ARGUMENT);return mt(n)?i.key=n:Jt(n)&&Object.keys(n).forEach(a=>{M4.includes(a)?r[a]=n[a]:i[a]=n[a]}),mt(o)?i.locale=o:Jt(o)&&(r=o),Jt(s)&&(r=s),[i.key||"",l,i,r]}function p2(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function m2(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!po(t[0]))return ph;const[a,c,u,d]=G1(...t),f=an(u.missingWarn)?u.missingWarn:e.missingWarn;an(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,h=x0(e,u),m=r(e,s,h);if(!mt(a)||a===""){const O=new Intl.NumberFormat(h.replace(/!/g,""),d);return p?O.formatToParts(c):O.format(c)}let w={},k,g=null;const v="number format";for(let O=0;O<m.length&&(k=m[O],w=n[k]||{},g=w[a],!Jt(g));O++)A0(e,a,k,f,v);if(!Jt(g)||!mt(k))return o?kp:a;let y=`${k}__${a}`;vp(d)||(y=`${y}__${JSON.stringify(d)}`);let M=l.get(y);return M||(M=new Intl.NumberFormat(k,mo({},g,d)),l.set(y,M)),p?M.formatToParts(c):M.format(c)}const T4=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function G1(...e){const[t,n,o,s]=e,i=Tn();let r=Tn();if(!po(t))throw sr(or.INVALID_ARGUMENT);const l=t;return mt(n)?i.key=n:Jt(n)&&Object.keys(n).forEach(a=>{T4.includes(a)?r[a]=n[a]:i[a]=n[a]}),mt(o)?i.locale=o:Jt(o)&&(r=o),Jt(s)&&(r=s),[i.key||"",l,i,r]}function g2(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const Y6=e=>e,Q6=e=>"",X6="text",Z6=e=>e.length===0?"":w0(e),J6=B$;function ag(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function e8(e){const t=po(e.pluralIndex)?e.pluralIndex:-1;return po(e.named?.count)?e.named.count:po(e.named?.n)?e.named.n:t}function t8(e={}){const t=e.locale,n=e8(e),o=mt(t)&&Un(e.pluralRules?.[t])?e.pluralRules[t]:ag,s=o===ag?void 0:ag,i=k=>k[o(n,k.length,s)],r=e.list||[],l=k=>r[k],a=e.named||Tn();po(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=k=>a[k];function u(k,g){const v=Un(e.messages)?e.messages(k,!!g):cn(e.messages)?e.messages[k]:!1;return v||(e.parent?e.parent.message(k):Q6)}const d=k=>e.modifiers?e.modifiers[k]:Y6,f=Un(e.processor?.normalize)?e.processor.normalize:Z6,p=Un(e.processor?.interpolate)?e.processor.interpolate:J6,h=mt(e.processor?.type)?e.processor.type:X6,w={list:l,named:c,plural:i,linked:(k,...g)=>{const[v,y]=g;let M="text",O="";g.length===1?cn(v)?(O=v.modifier||O,M=v.type||M):mt(v)&&(O=v||O):g.length===2&&(mt(v)&&(O=v||O),mt(y)&&(M=y||M));const L=u(k,!0)(w),b=L===""||L===void 0?k:L,T=M==="vnode"&&eo(b)&&O?b[0]:b;return O?d(O)(T,M):T},message:u,type:h,interpolate:p,normalize:f,values:mo(Tn(),r,a)};return w}const v2=()=>"",ei=e=>Un(e);function y2(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Y1(...t),u=an(c.missingWarn)?c.missingWarn:e.missingWarn,d=an(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=an(c.escapeParameter)?c.escapeParameter:e.escapeParameter,p=!!c.resolvedMessage,h=mt(c.default)||an(c.default)?an(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||h!=null&&(mt(h)||Un(h)),w=x0(e,c);f&&n8(c);let[k,g,v]=p?[a,w,l[w]||Tn()]:E4(e,a,w,r,d,u),y=k,M=a;if(!p&&!(mt(y)||Ri(y)||ei(y))&&m&&(y=h,M=y),!p&&(!(mt(y)||Ri(y)||ei(y))||!mt(g)))return s?kp:a;let O=!1;const L=()=>{O=!0},b=ei(y)?y:I4(e,a,g,y,M,L);if(O)return y;const T=i8(e,g,v,c),$=t8(T),N=o8(e,b,$);let S=o?o(N,a):N;if(f&&mt(S)&&(S=O$(S)),__INTLIFY_PROD_DEVTOOLS__){const E={timestamp:Date.now(),key:mt(a)?a:ei(y)?y.key:"",locale:g||(ei(y)?y.locale:""),format:mt(y)?y:ei(y)?y.source:"",message:S};E.meta=mo({},e.__meta,q6()||{}),C6(E)}return S}function n8(e){eo(e.list)?e.list=e.list.map(t=>mt(t)?t2(t):t):cn(e.named)&&Object.keys(e.named).forEach(t=>{mt(e.named[t])&&(e.named[t]=t2(e.named[t]))})}function E4(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=Tn(),f,p=null;const h="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||Tn(),(p=a(d,t))===null&&(p=d[t]),!(mt(p)||Ri(p)||ei(p)));m++)if(!G6(f,u)){const w=A0(e,t,f,i,h);w!==t&&(p=w)}return[p,f,d]}function I4(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(ei(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,s8(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function o8(e,t,n){return t(n)}function Y1(...e){const[t,n,o]=e,s=Tn();if(!mt(t)&&!po(t)&&!ei(t)&&!Ri(t))throw sr(or.INVALID_ARGUMENT);const i=po(t)?String(t):(ei(t),t);return po(n)?s.plural=n:mt(n)?s.default=n:Jt(n)&&!vp(n)?s.named=n:eo(n)&&(s.list=n),po(o)?s.plural=o:mt(o)?s.default=o:Jt(o)&&mo(s,o),[i,s]}function s8(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>T$(t,n,r)}}function i8(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:(p,h)=>{let m=r(n,p);if(m==null&&(u||h)){const[w,,k]=E4(u||e,p,t,l,a,c);m=w??r(k,p)}if(mt(m)||Ri(m)){let w=!1;const g=I4(e,p,t,m,p,()=>{w=!0});return w?v2:g}else return ei(m)?m:v2}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),po(o.plural)&&(f.pluralIndex=o.plural),f}d6();/*!
35
+ * vue-i18n v11.4.5
36
+ * (c) 2026 kazuya kawaguchi
37
+ * Released under the MIT License.
38
+ */const r8="11.4.5";function l8(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Dl().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Dl().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Dl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Dl().__INTLIFY_PROD_DEVTOOLS__=!1)}const ss={UNEXPECTED_RETURN_TYPE:A6,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 ks(e,...t){return yp(e,null,void 0)}const Q1=rl("__translateVNode"),X1=rl("__datetimeParts"),Z1=rl("__numberParts"),$4=rl("__setPluralRules"),L4=rl("__injectWithOption"),Wa=rl("__dispose");function Wu(e){if(!cn(e)||Ri(e))return e;for(const t in e)if(oi(e,t))if(!t.includes("."))cn(e[t])&&Wu(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]]=Tn()),!cn(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(Ri(s)?_4.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!Ri(s)){const r=s[n[o]];cn(r)&&Wu(r)}}return e}function M0(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=Jt(n)?n:eo(o)?Tn():{[e]:Tn()};if(eo(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Tn(),Ef(c,r[a])):Ef(c,r)}else mt(l)&&Ef(JSON.parse(l),r)}),s==null&&i)for(const l in r)oi(r,l)&&Wu(r[l]);return r}function N4(e){return e.type}function R4(e,t,n){let o=cn(t.messages)?t.messages:Tn();"__i18nGlobal"in n&&(o=M0(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(cn(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(cn(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function k2(e){return se(Kr,null,e,0)}function Uu(){return Ho()}const b2="__INTLIFY_META__",_2=()=>[],a8=()=>!1;let w2=0;function S2(e){return((t,n,o,s)=>e(n,o,Uu()||void 0,s))}const c8=()=>{const e=Uu();let t=null;return e&&(t=N4(e)[b2])?{[b2]:t}:null};function mh(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=hh?X:ta;let r=an(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:mt(e.locale)?e.locale:zu),a=i(t&&r?t.fallbackLocale.value:mt(e.fallbackLocale)||eo(e.fallbackLocale)||Jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(M0(l.value,e)),u=i(Jt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Jt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:an(e.missingWarn)||fc(e.missingWarn)?e.missingWarn:!0,p=t?t.fallbackWarn:an(e.fallbackWarn)||fc(e.fallbackWarn)?e.fallbackWarn:!0,h=t?t.fallbackRoot:an(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,w=Un(e.missing)?e.missing:null,k=Un(e.missing)?S2(e.missing):null,g=Un(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:an(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const M=t?t.modifiers:Jt(e.modifiers)?e.modifiers:{};let O=e.pluralRules||t&&t.pluralRules,L;L=(()=>{o&&d2(null);const ue={version:r8,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:M,pluralRules:O,missing:k===null?void 0:k,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ue.datetimeFormats=u.value,ue.numberFormats=d.value,ue.__datetimeFormatters=Jt(L)?L.__datetimeFormatters:void 0,ue.__numberFormatters=Jt(L)?L.__numberFormatters:void 0;const Ie=V6(ue);return o&&d2(Ie),Ie})(),Qc(L,l.value,a.value);function T(){return[l.value,a.value,c.value,u.value,d.value]}const $=B({get:()=>l.value,set:ue=>{L.locale=ue,l.value=ue}}),N=B({get:()=>a.value,set:ue=>{L.fallbackLocale=ue,a.value=ue,Qc(L,l.value,ue)}}),S=B(()=>c.value),E=B(()=>u.value),P=B(()=>d.value);function D(){return Un(g)?g:null}function F(ue){g=ue,L.postTranslation=ue}function W(){return w}function K(ue){ue!==null&&(k=S2(ue)),w=ue,L.missing=k}const Y=(ue,Ie,Ge,lt,bt,_t)=>{T();let $t;try{__INTLIFY_PROD_DEVTOOLS__,o||(L.fallbackContext=t?j6():void 0),$t=ue(L)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(L.fallbackContext=void 0)}if(Ge!=="translate exists"&&po($t)&&$t===kp||Ge==="translate exists"&&!$t){const[Bt,yt]=Ie();return t&&h?lt(t):bt(Bt)}else{if(_t($t))return $t;throw ks(ss.UNEXPECTED_RETURN_TYPE)}};function q(...ue){return Y(Ie=>Reflect.apply(y2,null,[Ie,...ue]),()=>Y1(...ue),"translate",Ie=>Reflect.apply(Ie.t,Ie,[...ue]),Ie=>Ie,Ie=>mt(Ie))}function ae(...ue){const[Ie,Ge,lt]=ue;if(lt&&!cn(lt))throw ks(ss.INVALID_ARGUMENT);return q(Ie,Ge,mo({resolvedMessage:!0},lt||{}))}function ce(...ue){return Y(Ie=>Reflect.apply(h2,null,[Ie,...ue]),()=>K1(...ue),"datetime format",Ie=>Reflect.apply(Ie.d,Ie,[...ue]),()=>ph,Ie=>mt(Ie)||eo(Ie))}function ne(...ue){return Y(Ie=>Reflect.apply(m2,null,[Ie,...ue]),()=>G1(...ue),"number format",Ie=>Reflect.apply(Ie.n,Ie,[...ue]),()=>ph,Ie=>mt(Ie)||eo(Ie))}function Q(ue){return ue.map(Ie=>mt(Ie)||po(Ie)||an(Ie)?k2(String(Ie)):Ie)}const ye={normalize:Q,interpolate:ue=>ue,type:"vnode"};function xe(...ue){return Y(Ie=>{let Ge;const lt=Ie;try{lt.processor=ye,Ge=Reflect.apply(y2,null,[lt,...ue])}finally{lt.processor=null}return Ge},()=>Y1(...ue),"translate",Ie=>Ie[Q1](...ue),Ie=>[k2(Ie)],Ie=>eo(Ie))}function Xe(...ue){return Y(Ie=>Reflect.apply(m2,null,[Ie,...ue]),()=>G1(...ue),"number format",Ie=>Ie[Z1](...ue),_2,Ie=>mt(Ie)||eo(Ie))}function me(...ue){return Y(Ie=>Reflect.apply(h2,null,[Ie,...ue]),()=>K1(...ue),"datetime format",Ie=>Ie[X1](...ue),_2,Ie=>mt(Ie)||eo(Ie))}function G(ue){O=ue,L.pluralRules=O}function ie(ue,Ie){return Y(()=>{if(!ue)return!1;const Ge=mt(Ie)?Ie:l.value,lt=mt(Ie)?[Ge]:V1(L,a.value,Ge);for(let bt=0;bt<lt.length;bt++){const _t=Z(lt[bt]);let $t=L.messageResolver(_t,ue);if($t===null&&($t=_t[ue]),Ri($t)||ei($t)||mt($t))return!0}return!1},()=>[ue],"translate exists",Ge=>Reflect.apply(Ge.te,Ge,[ue,Ie]),a8,Ge=>an(Ge))}function de(ue){let Ie=null;const Ge=V1(L,a.value,l.value);for(let lt=0;lt<Ge.length;lt++){const bt=c.value[Ge[lt]]||{},_t=L.messageResolver(bt,ue);if(_t!=null){Ie=_t;break}}return Ie}function z(ue){const Ie=de(ue);return Ie??(t?t.tm(ue)||{}:{})}function Z(ue){return c.value[ue]||{}}function pe(ue,Ie){if(s){const Ge={[ue]:Ie};for(const lt in Ge)oi(Ge,lt)&&Wu(Ge[lt]);Ie=Ge[ue]}c.value[ue]=Ie,L.messages=c.value}function le(ue,Ie){c.value[ue]=c.value[ue]||{};const Ge={[ue]:Ie};if(s)for(const lt in Ge)oi(Ge,lt)&&Wu(Ge[lt]);Ie=Ge[ue],Ef(Ie,c.value[ue]),L.messages=c.value}function he(ue){return u.value[ue]||{}}function U(ue,Ie){u.value[ue]=Ie,L.datetimeFormats=u.value,p2(L,ue,Ie)}function J(ue,Ie){u.value[ue]=mo(u.value[ue]||{},Ie),L.datetimeFormats=u.value,p2(L,ue,Ie)}function fe(ue){return d.value[ue]||{}}function be(ue,Ie){d.value[ue]=Ie,L.numberFormats=d.value,g2(L,ue,Ie)}function Ee(ue,Ie){d.value[ue]=mo(d.value[ue]||{},Ie),L.numberFormats=d.value,g2(L,ue,Ie)}w2++,t&&hh&&(Ve(t.locale,ue=>{r&&(l.value=ue,L.locale=ue,Qc(L,l.value,a.value))}),Ve(t.fallbackLocale,ue=>{r&&(a.value=ue,L.fallbackLocale=ue,Qc(L,l.value,a.value))}));const Le={id:w2,locale:$,fallbackLocale:N,get inheritLocale(){return r},set inheritLocale(ue){r=ue,ue&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Qc(L,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return M},get pluralRules(){return O||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(ue){f=ue,L.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(ue){p=ue,L.fallbackWarn=p},get fallbackRoot(){return h},set fallbackRoot(ue){h=ue},get fallbackFormat(){return m},set fallbackFormat(ue){m=ue,L.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(ue){v=ue,L.warnHtmlMessage=ue},get escapeParameter(){return y},set escapeParameter(ue){y=ue,L.escapeParameter=ue},t:q,getLocaleMessage:Z,setLocaleMessage:pe,mergeLocaleMessage:le,getPostTranslationHandler:D,setPostTranslationHandler:F,getMissingHandler:W,setMissingHandler:K,[$4]:G};return Le.datetimeFormats=E,Le.numberFormats=P,Le.rt=ae,Le.te=ie,Le.tm=z,Le.d=ce,Le.n=ne,Le.getDateTimeFormat=he,Le.setDateTimeFormat=U,Le.mergeDateTimeFormat=J,Le.getNumberFormat=fe,Le.setNumberFormat=be,Le.mergeNumberFormat=Ee,Le[L4]=n,Le[Q1]=xe,Le[X1]=me,Le[Z1]=Xe,Le}function u8(e){const t=mt(e.locale)?e.locale:zu,n=mt(e.fallbackLocale)||eo(e.fallbackLocale)||Jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Un(e.missing)?e.missing:void 0,s=an(e.silentTranslationWarn)||fc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=an(e.silentFallbackWarn)||fc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=an(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Jt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Un(e.postTranslation)?e.postTranslation:void 0,d=mt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,p=an(e.sync)?e.sync:!0;let h=e.messages;if(Jt(e.sharedMessages)){const M=e.sharedMessages;h=Object.keys(M).reduce((L,b)=>{const T=L[b]||(L[b]={});return mo(T,M[b]),L},h||{})}const{__i18n:m,__root:w,__injectWithOption:k}=e,g=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:h,flatJson:y,datetimeFormats:g,numberFormats:v,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:p,__i18n:m,__root:w,__injectWithOption:k}}function J1(e={}){const t=mh(u8(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 an(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=an(s)?!s:s},get silentFallbackWarn(){return an(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=an(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 d8(e,t,n){return{beforeCreate(){const o=Uu();if(!o)throw ks(ss.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=C2(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=J1(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=C2(e,s);else{this.$i18n=J1({__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&&R4(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=Uu();if(!o)throw ks(ss.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 C2(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[$4](t.pluralizationRules||e.pluralizationRules);const n=M0(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 T0={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function f8({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},Tn())}function O4(){return Pe}const h8=je({name:"i18n-t",props:mo({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>po(e)||!isNaN(e)}},T0),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Tn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=mt(e.plural)?+e.plural:e.plural);const u=f8(t,a);return s[Q1](e.keypath,u,c)},r=mo(Tn(),o),l=mt(e.tag)||cn(e.tag)?e.tag:O4();return cn(l)?yn(l,r,{default:i}):yn(l,r,i())}}}),x2=h8;function p8(e){return eo(e)&&!mt(e[0])}function P4(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Tn();e.locale&&(c.locale=e.locale),mt(e.format)?c.key=e.format:cn(e.format)&&(mt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((p,h)=>n.includes(h)?mo(Tn(),p,{[h]:e.format[h]}):p,Tn()));const d=o(e.value,c,u);let f=[c.key];return eo(d)?f=d.map((p,h)=>{const m=s[p.type],w=m?m({[p.type]:p.value,index:h,parts:d}):[p.value];return p8(w)&&(w[0].key=`${p.type}-${h}`),w}):mt(d)&&(f=[d]),f},l=mo(Tn(),i),a=mt(e.tag)||cn(e.tag)?e.tag:O4();return cn(a)?yn(a,l,{default:r}):yn(a,l,r())}}const m8=je({name:"i18n-n",props:mo({value:{type:Number,required:!0},format:{type:[String,Object]}},T0),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return P4(e,t,T4,(...o)=>n[Z1](...o))}}),A2=m8;function g8(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 v8(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw ks(ss.UNEXPECTED_ERROR);const c=g8(e,l.$),u=M2(a);return[Reflect.apply(c.t,c,[...T2(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);hh&&(r.__i18nWatcher=Ve(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{hh&&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=M2(l);r.textContent=Reflect.apply(a.t,a,[...T2(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function M2(e){if(mt(e))return{path:e};if(Jt(e)){if(!("path"in e))throw ks(ss.REQUIRED_VALUE,"path");return e}else throw ks(ss.INVALID_VALUE)}function T2(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return mt(n)&&(r.locale=n),po(s)&&(r.plural=s),po(i)&&(r.plural=i),[t,l,r]}function y8(e,t,...n){const o=Jt(n[0])?n[0]:{};(an(o.globalInstall)?o.globalInstall:!0)&&([x2.name,"I18nT"].forEach(i=>e.component(i,x2)),[A2.name,"I18nN"].forEach(i=>e.component(i,A2)),[$2.name,"I18nD"].forEach(i=>e.component(i,$2))),e.directive("t",v8(t))}const k8=rl("global-vue-i18n");function b8(e={}){const t=__VUE_I18N_LEGACY_API__&&an(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=an(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=_8(e,t),r=rl("");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),Jt(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let p=null;!t&&n&&(p=T8(d,u.global)),__VUE_I18N_FULL_INSTALL__&&y8(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(d8(i,i.__composer,u));const h=d.unmount;d.unmount=()=>{p&&p(),u.dispose(),h()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Tt(e={}){const t=Uu();if(t==null)throw ks(ss.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw ks(ss.NOT_INSTALLED);const n=w8(t),o=C8(n),s=N4(t),i=S8(e,s);if(i==="global")return R4(o,e,s),o;if(i==="parent"){let a=E2(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw ks(ss.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=mo({},e),u=E2(n,t);c.__root=u||o;const d=mh(c);return a.__composerExtend&&(d[Wa]=a.__composerExtend(d)),e0()&&t0(()=>{const p=d[Wa];p&&(p(),delete d[Wa])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=mo({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=mh(a),r.__composerExtend&&(l[Wa]=r.__composerExtend(l)),A8(r,t,l),r.__setInstance(t,l)}return l}function _8(e,t){const n=KE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>J1(e)):n.run(()=>mh(e));if(o==null)throw ks(ss.UNEXPECTED_ERROR);return[n,o]}function w8(e){const t=Vt(e.isCE?k8:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw ks(e.isCE?ss.NOT_INSTALLED_WITH_PROVIDE:ss.UNEXPECTED_ERROR);return t}function S8(e,t){return vp(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function C8(e){return e.mode==="composition"?e.global:e.global.__composer}function E2(e,t,n=!1){let o=null;const s=t.root;let i=x8(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[L4]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function x8(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function A8(e,t,n){Sn(()=>{},t),In(()=>{const o=n;e.__deleteInstance(t);const s=o[Wa];s&&(s(),delete o[Wa])},t)}const M8=["locale","fallbackLocale","availableLocales"],I2=["t","rt","d","n","tm","te"];function T8(e,t){const n=Object.create(null);return M8.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw ks(ss.UNEXPECTED_ERROR);const r=oo(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,I2.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw ks(ss.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,I2.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const E8=je({name:"i18n-d",props:mo({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},T0),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return P4(e,t,M4,(...o)=>n[X1](...o))}}),$2=E8;l8();H6(_6);z6(D6);W6(V1);if(__INTLIFY_PROD_DEVTOOLS__){const e=Dl();e.__INTLIFY__=!0,w6(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const I8="modulepreload",$8=function(e){return"/"+e},L2={},ns=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=$8(c),c in L2)return;L2[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":I8,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((p,h)=>{f.addEventListener("load",p),f.addEventListener("error",()=>h(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)})},Nt={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",showWorkspacePaths:"kimi-web.show-workspace-paths",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",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 N2(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function no(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function io(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function pc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function ud(e){const t=no(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function wc(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function E0(){const e=no(Nt.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 I0(e){const n={...E0()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];io(Nt.unread,JSON.stringify(n))}function L8(){const e=ud(Nt.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function cg(e){wc(Nt.collapsedWorkspaces,Array.from(e))}function N8(){return ud(Nt.showWorkspacePaths)===!0}function R8(e){wc(Nt.showWorkspacePaths,e)}function O8(){const e=ud(Nt.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function D4(e){wc(Nt.workspaceOrder,Array.from(e))}function of(){const e=ud(Nt.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 R2(e){wc(Nt.workspaceNameOverrides,e)}function P8(){return no(Nt.workspaceSort)}function B4(e){io(Nt.workspaceSort,e)}const O2=Nt.clientId,D8="kimi-code-web",B8="web";function F8(){return{serverHttpUrl:z8(),clientId:j8(),clientName:D8,clientVersion:V8(),clientUiMode:B8}}function H8(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function z8(e){const t=H8(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function W8(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function U8(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return W8(e)}function gu(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function q8(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 j8(){const e=no(O2);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return io(O2,t),t}function V8(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function Go(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 K8(e)}function K8(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 G8(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 Y8(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 Q8(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 X8(e,t){return e.toSorted((n,o)=>(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const Z8={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function P2(e){return e.replace(/[&<>"']/g,t=>Z8[t]??t)}function J8(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eL(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 D2(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return D2(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 D2(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function ug(e,t){const n=P2(e),o=t.trim();if(o.length===0)return n;const s=new RegExp(J8(P2(o)),"gi");return n.replace(s,i=>`<mark>${i}</mark>`)}const Oa=X(0),tL=["type","disabled","aria-label"],nL=je({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=X();return t({el:n}),(o,s)=>(_(),I("button",{ref_key:"el",ref:n,class:De(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[On(o.$slots,"default",{},void 0,!0)],10,tL))}}),ut=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Mn=ut(nL,[["__scopeId","data-v-321e56e3"]]),oL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sL(e,t){return _(),I("svg",oL,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const iL=vt({name:"ri-add-line",render:sL}),rL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lL(e,t){return _(),I("svg",rL,[...t[0]||(t[0]=[C("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 aL=vt({name:"ri-alert-line",render:lL}),cL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uL(e,t){return _(),I("svg",cL,[...t[0]||(t[0]=[C("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 dL=vt({name:"ri-arrow-down-line",render:uL}),fL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hL(e,t){return _(),I("svg",fL,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const pL=vt({name:"ri-arrow-down-s-line",render:hL}),mL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gL(e,t){return _(),I("svg",mL,[...t[0]||(t[0]=[C("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 vL=vt({name:"ri-arrow-go-back-line",render:gL}),yL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kL(e,t){return _(),I("svg",yL,[...t[0]||(t[0]=[C("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 bL=vt({name:"ri-arrow-right-line",render:kL}),_L={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wL(e,t){return _(),I("svg",_L,[...t[0]||(t[0]=[C("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 SL=vt({name:"ri-arrow-right-s-line",render:wL}),CL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xL(e,t){return _(),I("svg",CL,[...t[0]||(t[0]=[C("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 B2=vt({name:"ri-arrow-up-line",render:xL}),AL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ML(e,t){return _(),I("svg",AL,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const TL=vt({name:"ri-braces-line",render:ML}),EL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IL(e,t){return _(),I("svg",EL,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const $L=vt({name:"ri-calendar-close-line",render:IL}),LL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NL(e,t){return _(),I("svg",LL,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const RL=vt({name:"ri-calendar-schedule-line",render:NL}),OL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PL(e,t){return _(),I("svg",OL,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const DL=vt({name:"ri-calendar-todo-line",render:PL}),BL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FL(e,t){return _(),I("svg",BL,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3z"},null,-1)])])}const HL=vt({name:"ri-chat-new-line",render:FL}),zL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WL(e,t){return _(),I("svg",zL,[...t[0]||(t[0]=[C("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 UL=vt({name:"ri-check-line",render:WL}),qL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jL(e,t){return _(),I("svg",qL,[...t[0]||(t[0]=[C("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 VL=vt({name:"ri-close-line",render:jL}),KL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GL(e,t){return _(),I("svg",KL,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const YL=vt({name:"ri-code-line",render:GL}),QL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XL(e,t){return _(),I("svg",QL,[...t[0]||(t[0]=[C("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 ZL=vt({name:"ri-collapse-diagonal-line",render:XL}),JL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eN(e,t){return _(),I("svg",JL,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m15.071 4.929l1.414 1.414L11.83 11H21v2h-9.17l4.656 4.657l-1.414 1.414L8.001 12zm-11.07 14.07V5h2v14z"},null,-1)])])}const tN=vt({name:"ri-contract-left-line",render:eN}),nN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oN(e,t){return _(),I("svg",nN,[...t[0]||(t[0]=[C("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 sN=vt({name:"ri-download-line",render:oN}),iN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rN(e,t){return _(),I("svg",iN,[...t[0]||(t[0]=[C("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 lN=vt({name:"ri-draggable",render:rN}),aN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cN(e,t){return _(),I("svg",aN,[...t[0]||(t[0]=[C("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 uN=vt({name:"ri-equalizer-line",render:cN}),dN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fN(e,t){return _(),I("svg",dN,[...t[0]||(t[0]=[C("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 hN=vt({name:"ri-expand-diagonal-line",render:fN}),pN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mN(e,t){return _(),I("svg",pN,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m17.172 11l-4.657-4.657l1.414-1.414L21 12l-7.071 7.071l-1.414-1.414L17.172 13H8v-2zM4 19V5h2v14z"},null,-1)])])}const gN=vt({name:"ri-expand-right-line",render:mN}),vN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yN(e,t){return _(),I("svg",vN,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const kN=vt({name:"ri-external-link-line",render:yN}),bN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _N(e,t){return _(),I("svg",bN,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const wN=vt({name:"ri-file-add-line",render:_N}),SN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CN(e,t){return _(),I("svg",SN,[...t[0]||(t[0]=[C("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 xN=vt({name:"ri-file-copy-line",render:CN}),AN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MN(e,t){return _(),I("svg",AN,[...t[0]||(t[0]=[C("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 F2=vt({name:"ri-file-line",render:MN}),TN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function EN(e,t){return _(),I("svg",TN,[...t[0]||(t[0]=[C("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 IN=vt({name:"ri-file-text-line",render:EN}),$N={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LN(e,t){return _(),I("svg",$N,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const NN=vt({name:"ri-flashlight-line",render:LN}),RN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ON(e,t){return _(),I("svg",RN,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const PN=vt({name:"ri-folder-add-line",render:ON}),DN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function BN(e,t){return _(),I("svg",DN,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const FN=vt({name:"ri-folder-fill",render:BN}),HN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zN(e,t){return _(),I("svg",HN,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 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 WN=vt({name:"ri-folder-line",render:zN}),UN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qN(e,t){return _(),I("svg",UN,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M3 21a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2H20a1 1 0 0 1 1 1v3h-2V7h-7.414l-2-2H4v11.998L5.5 11h17l-2.31 9.243a1 1 0 0 1-.97.757zm16.938-8H7.062l-1.5 6h12.876z"},null,-1)])])}const jN=vt({name:"ri-folder-open-line",render:qN}),VN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function KN(e,t){return _(),I("svg",VN,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const GN=vt({name:"ri-git-pull-request-line",render:KN}),YN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QN(e,t){return _(),I("svg",YN,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 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 XN=vt({name:"ri-global-line",render:QN}),ZN={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JN(e,t){return _(),I("svg",ZN,[...t[0]||(t[0]=[C("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 H2=vt({name:"ri-image-line",render:JN}),e7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function t7(e,t){return _(),I("svg",e7,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const n7=vt({name:"ri-information-line",render:t7}),o7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function s7(e,t){return _(),I("svg",o7,[...t[0]||(t[0]=[C("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 i7=vt({name:"ri-links-line",render:s7}),r7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function l7(e,t){return _(),I("svg",r7,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const a7=vt({name:"ri-list-check",render:l7}),c7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u7(e,t){return _(),I("svg",c7,[...t[0]||(t[0]=[C("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 d7=vt({name:"ri-list-unordered",render:u7}),f7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function h7(e,t){return _(),I("svg",f7,[...t[0]||(t[0]=[C("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 p7=vt({name:"ri-login-box-line",render:h7}),m7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g7(e,t){return _(),I("svg",m7,[...t[0]||(t[0]=[C("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 v7=vt({name:"ri-mail-line",render:g7}),y7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function k7(e,t){return _(),I("svg",y7,[...t[0]||(t[0]=[C("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 b7=vt({name:"ri-message-line",render:k7}),_7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w7(e,t){return _(),I("svg",_7,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5m15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5m-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5"},null,-1)])])}const S7=vt({name:"ri-more-line",render:w7}),C7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function x7(e,t){return _(),I("svg",C7,[...t[0]||(t[0]=[C("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 A7=vt({name:"ri-pencil-line",render:x7}),M7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function T7(e,t){return _(),I("svg",M7,[...t[0]||(t[0]=[C("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 E7=vt({name:"ri-play-fill",render:T7}),I7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $7(e,t){return _(),I("svg",I7,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-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 L7=vt({name:"ri-question-line",render:$7}),N7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function R7(e,t){return _(),I("svg",N7,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975z"},null,-1)])])}const O7=vt({name:"ri-search-line",render:R7}),P7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D7(e,t){return _(),I("svg",P7,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M3.34 17a10 10 0 0 1-.979-2.326a3 3 0 0 0 .003-5.347a10 10 0 0 1 2.5-4.337a3 3 0 0 0 4.632-2.674a10 10 0 0 1 5.007.003a3 3 0 0 0 4.632 2.671a10.06 10.06 0 0 1 2.503 4.336a3 3 0 0 0-.002 5.347a10 10 0 0 1-2.501 4.337a3 3 0 0 0-4.632 2.674a10 10 0 0 1-5.007-.002a3 3 0 0 0-4.631-2.672A10 10 0 0 1 3.339 17m5.66.196a5 5 0 0 1 2.25 2.77q.75.07 1.499.002a5 5 0 0 1 2.25-2.772a5 5 0 0 1 3.526-.564q.435-.614.748-1.298A5 5 0 0 1 18 12c0-1.26.47-2.437 1.273-3.334a8 8 0 0 0-.75-1.298A5 5 0 0 1 15 6.804a5 5 0 0 1-2.25-2.77q-.75-.071-1.5-.001A5 5 0 0 1 9 6.804a5 5 0 0 1-3.526.564q-.436.614-.747 1.298A5 5 0 0 1 6 12c0 1.26-.471 2.437-1.273 3.334a8 8 0 0 0 .75 1.298A5 5 0 0 1 9 17.196M12 15a3 3 0 1 1 0-6a3 3 0 0 1 0 6m0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const B7=vt({name:"ri-settings-3-line",render:D7}),F7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function H7(e,t){return _(),I("svg",F7,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const z7=vt({name:"ri-sort-desc",render:H7}),W7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U7(e,t){return _(),I("svg",W7,[...t[0]||(t[0]=[C("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 q7=vt({name:"ri-sparkling-line",render:U7}),j7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function V7(e,t){return _(),I("svg",j7,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const K7=vt({name:"ri-star-fill",render:V7}),G7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y7(e,t){return _(),I("svg",G7,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const Q7=vt({name:"ri-star-line",render:Y7}),X7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Z7(e,t){return _(),I("svg",X7,[...t[0]||(t[0]=[C("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 J7=vt({name:"ri-stop-fill",render:Z7}),eR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tR(e,t){return _(),I("svg",eR,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const nR=vt({name:"ri-subtract-line",render:tR}),oR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sR(e,t){return _(),I("svg",oR,[...t[0]||(t[0]=[C("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 iR=vt({name:"ri-terminal-box-line",render:sR}),rR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lR(e,t){return _(),I("svg",rR,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const aR=vt({name:"ri-time-line",render:lR}),cR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uR(e,t){return _(),I("svg",cR,[...t[0]||(t[0]=[C("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const dR=vt({name:"ri-tools-line",render:uR}),fR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hR(e,t){return _(),I("svg",fR,[...t[0]||(t[0]=[C("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 pR=vt({name:"ri-user-line",render:hR}),mR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',gR='<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>',vR='<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>',yR='<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>',kR='<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>',bR='<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>',_R='<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>',z2='<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>',wR='<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>',SR='<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>',CR='<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>',xR='<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>',AR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3z"/></svg>',MR='<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>',TR='<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>',ER='<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>',IR='<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>',$R='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m15.071 4.929l1.414 1.414L11.83 11H21v2h-9.17l4.656 4.657l-1.414 1.414L8.001 12zm-11.07 14.07V5h2v14z"/></svg>',LR='<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>',NR='<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>',RR='<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>',OR='<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>',PR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m17.172 11l-4.657-4.657l1.414-1.414L21 12l-7.071 7.071l-1.414-1.414L17.172 13H8v-2zM4 19V5h2v14z"/></svg>',DR='<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>',BR='<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>',FR='<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>',W2='<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>',HR='<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>',zR='<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>',WR='<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>',UR='<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>',qR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 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>',jR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 21a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2H20a1 1 0 0 1 1 1v3h-2V7h-7.414l-2-2H4v11.998L5.5 11h17l-2.31 9.243a1 1 0 0 1-.97.757zm16.938-8H7.062l-1.5 6h12.876z"/></svg>',VR='<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>',KR='<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>',U2='<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>',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 16M11 7h2v2h-2zm0 4h2v6h-2z"/></svg>',YR='<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>',QR='<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>',XR='<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>',ZR='<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>',JR='<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>',eO='<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>',tO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5m15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5m-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5"/></svg>',nO='<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>',oO='<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>',sO='<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>',iO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975z"/></svg>',rO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3.34 17a10 10 0 0 1-.979-2.326a3 3 0 0 0 .003-5.347a10 10 0 0 1 2.5-4.337a3 3 0 0 0 4.632-2.674a10 10 0 0 1 5.007.003a3 3 0 0 0 4.632 2.671a10.06 10.06 0 0 1 2.503 4.336a3 3 0 0 0-.002 5.347a10 10 0 0 1-2.501 4.337a3 3 0 0 0-4.632 2.674a10 10 0 0 1-5.007-.002a3 3 0 0 0-4.631-2.672A10 10 0 0 1 3.339 17m5.66.196a5 5 0 0 1 2.25 2.77q.75.07 1.499.002a5 5 0 0 1 2.25-2.772a5 5 0 0 1 3.526-.564q.435-.614.748-1.298A5 5 0 0 1 18 12c0-1.26.47-2.437 1.273-3.334a8 8 0 0 0-.75-1.298A5 5 0 0 1 15 6.804a5 5 0 0 1-2.25-2.77q-.75-.071-1.5-.001A5 5 0 0 1 9 6.804a5 5 0 0 1-3.526.564q-.436.614-.747 1.298A5 5 0 0 1 6 12c0 1.26-.471 2.437-1.273 3.334a8 8 0 0 0 .75 1.298A5 5 0 0 1 9 17.196M12 15a3 3 0 1 1 0-6a3 3 0 0 1 0 6m0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',lO='<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>',aO='<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>',cO='<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>',uO='<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>',dO='<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>',fO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',hO='<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>',pO='<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>',mO='<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>',gO='<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>',F4={sm:14,md:16,lg:20};function St(e,t){return{component:e,svg:t}}const H4={plus:St(iL,mR),"chat-new":St(HL,AR),"calendar-close":St($L,SR),"calendar-schedule":St(RL,CR),"calendar-todo":St(DL,xR),close:St(VL,TR),check:St(UL,MR),search:St(O7,iO),copy:St(xN,FR),link:St(i7,YR),"external-link":St(kN,DR),download:St(sN,LR),undo:St(vL,kR),send:St(B2,z2),image:St(H2,U2),settings:St(B7,rO),sliders:St(uN,RR),"log-in":St(p7,ZR),"chevron-down":St(pL,yR),"chevron-right":St(SL,_R),"arrow-up":St(B2,z2),"arrow-down":St(dL,vR),"arrow-right":St(bL,bR),minus:St(nR,fO),"panel-collapse":St(tN,$R),"panel-expand":St(gN,PR),expand:St(hN,OR),collapse:St(ZL,IR),list:St(d7,XR),sort:St(z7,lO),grip:St(lN,NR),folder:St(jN,jR),"folder-closed":St(WN,qR),"folder-plus":St(PN,WR),"folder-solid":St(FN,UR),file:St(F2,W2),"file-text":St(IN,HR),"file-plus":St(wN,BR),"file-off":St(F2,W2),"image-off":St(H2,U2),code:St(YL,ER),terminal:St(iR,hO),pencil:St(A7,nO),tool:St(dR,mO),glob:St(TL,wR),globe:St(XN,KR),"check-list":St(a7,QR),bolt:St(NN,zR),"git-pull-request":St(GN,VR),message:St(b7,eO),mail:St(v7,JR),user:St(pR,gO),info:St(n7,GR),"help-circle":St(L7,sO),"alert-triangle":St(aL,gR),clock:St(aR,pO),sparkles:St(q7,aO),play:St(E7,oO),stop:St(J7,dO),star:St(K7,cO),"star-outline":St(Q7,uO),"dots-horizontal":St(S7,tO)};function vO(e){return H4[e]}function yO(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function Pa(e,t="md"){const n=H4[e];return n?yO(n.svg,F4[t]):""}const Mye=[["Actions",["plus","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","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-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-pull-request","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","play","stop","star","star-outline","dots-horizontal"]]],Qe=je({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=B(()=>vO(t.name)),o=B(()=>F4[t.size]);return(s,i)=>n.value?(_(),ke(Oo(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"])):re("",!0)}}),kO={key:0,class:"ui-dialog__head"},bO={class:"ui-dialog__titles"},_O={key:0,class:"ui-dialog__title"},wO={key:1,class:"ui-dialog__desc"},SO={class:"ui-dialog__body"},CO={key:1,class:"ui-dialog__foot"},xO='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',AO=je({__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=X(null);let i=null;function r(){o("update:open",!1),o("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(xO)):[]}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(),p=f[0],h=f[f.length-1];if(!p||!h){d.preventDefault(),s.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===p?(d.preventDefault(),h.focus()):!d.shiftKey&&m===h&&(d.preventDefault(),p.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Ve(()=>n.open,async d=>{if(d){Oa.value+=1,i=document.activeElement,await gt();const f=a(),p=l();(f??p[0]??s.value)?.focus()}else Oa.value=Math.max(0,Oa.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),so(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(Oa.value=Math.max(0,Oa.value-1))}),(d,f)=>(_(),ke(hp,{to:"body"},[e.open?(_(),I("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[C("div",{ref_key:"panel",ref:s,class:De(["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?(_(),I("div",kO,[On(d.$slots,"head",{},()=>[C("div",bO,[e.title?(_(),I("div",_O,R(e.title),1)):re("",!0),e.description?(_(),I("div",wO,R(e.description),1)):re("",!0)])],!0),se(Mn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:we(()=>[se(Qe,{name:"close",size:"md"})]),_:1})])):re("",!0),C("div",SO,[On(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(_(),I("div",CO,[On(d.$slots,"foot",{},void 0,!0)])):re("",!0)],2)],32)):re("",!0)]))}}),mr=ut(AO,[["__scopeId","data-v-3dce23a4"]]),MO={class:"sd-head"},TO=["placeholder","aria-label"],EO=["aria-selected","onClick","onMousemove"],IO={class:"sd-meta"},$O=["innerHTML"],LO={class:"sd-time"},NO=["innerHTML"],RO=["innerHTML"],OO={key:1,class:"sd-empty"},PO={class:"sd-hint"},DO=200,BO=je({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X(!0),r=X(""),l=X(null),a=X(null),c=B(()=>{const k=r.value.trim().toLowerCase(),g=[];for(const v of o.sessions){const y=v.title??"",M=v.lastPrompt??"",O=v.workspaceName??"",L=k.length>0&&y.toLowerCase().includes(k),b=k.length>0&&M.toLowerCase().includes(k),T=k.length>0&&O.toLowerCase().includes(k);if(!(k.length>0&&!L&&!b&&!T)&&(g.push({session:v,inTitle:L,inWorkspace:T,snippetText:M?eL(M,r.value):""}),g.length>=DO))break}return g}),u=X(0);Ve(r,()=>{u.value=0});function d(k){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,k))}async function f(){await gt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function p(k){u.value=d(u.value+k),f()}function h(k){s("select",k),s("close")}function m(){const k=c.value[u.value];k&&h(k.session.id)}function w(k){k.key==="ArrowDown"?(k.preventDefault(),p(1)):k.key==="ArrowUp"?(k.preventDefault(),p(-1)):k.key==="Enter"&&(k.preventDefault(),m())}return Sn(()=>{l.value?.focus()}),(k,g)=>(_(),ke(mr,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>s("close"))},{head:we(()=>[C("div",MO,[se(Qe,{class:"sd-search-icon",name:"search",size:"md"}),An(C("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:x(n)("sidebar.searchPlaceholder"),"aria-label":x(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:w},null,40,TO),[[us,r.value]])])]),foot:we(()=>[C("span",PO,R(x(n)("sidebar.searchHint")),1)]),default:we(()=>[C("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(_(!0),I(Pe,{key:0},nt(c.value,(v,y)=>(_(),I("button",{key:v.session.id,class:De(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:M=>h(v.session.id),onMousemove:M=>u.value=y},[C("span",IO,[se(Qe,{class:"sd-folder",name:"folder-closed",size:"sm"}),C("span",{class:"sd-ws",innerHTML:x(ug)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,$O),C("span",LO,R(v.session.time),1)]),C("span",{class:"sd-title",innerHTML:x(ug)(v.session.title,v.inTitle?r.value:"")},null,8,NO),v.snippetText?(_(),I("span",{key:0,class:"sd-snippet",innerHTML:x(ug)(v.snippetText,r.value)},null,8,RO)):re("",!0)],42,EO))),128)):(_(),I("div",OO,R(x(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),FO=ut(BO,[["__scopeId","data-v-a678f802"]]),HO=["aria-label"],zO=je({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(_(),I("span",{class:De(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[C("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[C("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),C("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,HO))}}),ai=ut(zO,[["__scopeId","data-v-e5c5b17d"]]),WO={key:0,class:"ui-badge__dot","aria-hidden":"true"},UO=je({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(_(),I("span",{class:De(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(_(),I("span",WO)):re("",!0),On(t.$slots,"default",{},void 0,!0)],2))}}),Do=ut(UO,[["__scopeId","data-v-5bc5cd6d"]]),qu=X(null);function z4(e){const t=qu.value;t&&(qu.value=null,t.resolve(e))}function qO(e){return qu.value&&z4(!1),new Promise(t=>{qu.value={...e,resolve:t}})}function cl(){return{current:qu,confirm:qO,settle:z4}}const jO=je({__name:"Menu",setup(e,{expose:t}){const n=X();return t({el:n}),(o,s)=>(_(),I("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[On(o.$slots,"default",{},void 0,!0)],512))}}),Ul=ut(jO,[["__scopeId","data-v-60e6cd8d"]]),VO={key:0,class:"ui-menu-sep",role:"separator"},KO=["disabled"],GO=je({__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?(_(),I("div",VO)):(_(),I("button",{key:1,class:De(["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))},[On(t.$slots,"default",{},void 0,!0)],10,KO))}}),_n=ut(GO,[["__scopeId","data-v-eab8e277"]]),Mr=6,Tr=8,YO=150,QO=je({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=X(),o=X(),s=X(!1),i=X(!1),r=X({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=o.value;if(!a||!m)return;const w=a.getBoundingClientRect(),k=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let M=t.placement;M==="top"&&w.top-Mr-g<Tr?M="bottom":M==="bottom"&&w.bottom+Mr+g>y-Tr?M="top":M==="left"&&w.left-Mr-k<Tr?M="right":M==="right"&&w.right+Mr+k>v-Tr&&(M="left");let O=0,L=0;M==="top"?(O=w.top-Mr-g,L=w.left+w.width/2-k/2):M==="bottom"?(O=w.bottom+Mr,L=w.left+w.width/2-k/2):M==="left"?(O=w.top+w.height/2-g/2,L=w.left-Mr-k):(O=w.top+w.height/2-g/2,L=w.right+Mr),L=Math.min(Math.max(L,Tr),v-Tr-k),O=Math.min(Math.max(O,Tr),y-Tr-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(O)}px`,left:`${Math.round(L)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{s.value=!0,i.value=!1,gt(()=>{u(),i.value=!0})},YO))}function f(){window.clearTimeout(l),s.value=!1,i.value=!1}function p(){s.value&&f()}function h(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return Sn(()=>{const m=n.value??null;h(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const w=m.firstElementChild??null;w!==a&&(f(),h(w??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p)}),so(()=>{window.clearTimeout(l),c?.disconnect(),h(null),window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}),(m,w)=>(_(),I(Pe,null,[C("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[On(m.$slots,"default",{},void 0,!0)],512),(_(),ke(hp,{to:"body"},[An(C("div",{ref_key:"bubble",ref:o,class:De(["ui-tip__bubble",{positioned:i.value}]),style:en([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},R(e.text),7),[[Ns,s.value]])]))],64))}}),Kt=ut(QO,[["__scopeId","data-v-4c261eb6"]]),XO={class:"row"},ZO={class:"lead","aria-hidden":"true"},JO={key:1,class:"unread-dot"},eP={class:"left"},tP=["onKeydown"],nP={class:"act"},oP={class:"ts"},sP={class:"menu-time"},iP=je({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:o}=Tt(),{confirm:s}=cl(),i=e,r=n;function l(S){const E=new Date(S);if(Number.isNaN(E.getTime()))return S;const P=D=>String(D).padStart(2,"0");return`${E.getFullYear()}-${P(E.getMonth()+1)}-${P(E.getDate())} ${P(E.getHours())}:${P(E.getMinutes())}`}const a=B(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=X(!1),u=X(null),d=X(null),f=X({});function p(S){const E=S.target;d.value?.el?.contains(E)||u.value?.el?.contains(E)||w()}function h(){const S=u.value?.el;if(!S)return;const E=d.value?.el,P=S.getBoundingClientRect(),D=4,F=8,W=E?.offsetHeight??0,K=E?.offsetWidth??0;let Y=P.bottom+D;Y+W>window.innerHeight-F&&(Y=Math.max(F,P.top-W-D));let q=P.right-K;q<F&&(q=F),f.value={top:`${Math.round(Y)}px`,left:`${Math.round(q)}px`}}async function m(S){if(S.stopPropagation(),c.value){w();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",p),0),window.addEventListener("resize",w),await gt(),h()}function w(){c.value=!1,document.removeEventListener("mousedown",p),window.removeEventListener("resize",w)}In(()=>{document.removeEventListener("mousedown",p),window.removeEventListener("resize",w)});const k=X(!1),g=X(""),v=X(null);async function y(){w(),k.value=!0,g.value=i.session.title,await gt();try{v.value?.focus(),v.value?.select()}catch{}}function M(){const S=g.value.trim();S&&r("rename",i.session.id,S),k.value=!1}function O(){k.value=!1}const L=X(!1),b=X(!1);async function T(){const S=await Go(i.session.id);L.value=S,b.value=!S,setTimeout(()=>{L.value=!1,b.value=!1,w()},1500)}function $(){w(),r("fork",i.session.id)}async function N(){w(),await s({title:o("sidebar.archive"),message:o("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:w}),(S,E)=>(_(),I("div",{class:De(["se",{on:e.active}]),onClick:E[4]||(E[4]=P=>r("select",e.session.id))},[C("div",XO,[C("span",ZO,[e.session.busy?(_(),ke(ai,{key:0,size:"sm"})):e.unread?(_(),I("span",JO)):re("",!0)]),C("div",eP,[k.value?An((_(),I("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":E[0]||(E[0]=P=>g.value=P),class:"rename-input",onClick:E[1]||(E[1]=kt(()=>{},["stop"])),onKeydown:[gi(kt(M,["stop"]),["enter"]),gi(kt(O,["stop"]),["esc"])],onBlur:M},null,40,tP)),[[us,g.value]]):(_(),I("span",{key:1,class:"t",onDblclick:kt(y,["stop"])},R(e.session.title),33))]),se(Kt,{text:x(o)("workspace.awaitingAnswerTitle")},{default:we(()=>[!k.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(_(),ke(Do,{key:0,variant:"info",size:"sm"},{default:we(()=>[qe(R(x(o)("workspace.awaitingAnswer")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),se(Kt,{text:x(o)("workspace.awaitingPermissionTitle")},{default:we(()=>[!k.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(_(),ke(Do,{key:0,variant:"warning",size:"sm"},{default:we(()=>[qe(R(x(o)("workspace.awaitingPermission")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),se(Kt,{text:x(o)("workspace.abortedTitle")},{default:we(()=>[!k.value&&e.session.status==="aborted"?(_(),ke(Do,{key:0,variant:"danger",size:"sm"},{default:we(()=>[qe(R(x(o)("workspace.aborted")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),C("span",nP,[C("span",oP,R(e.session.time),1),k.value?re("",!0):(_(),ke(Mn,{key:0,ref_key:"kebabRef",ref:u,class:De(["kebab",{open:c.value}]),size:"sm",label:x(o)("sidebar.options"),onClick:E[2]||(E[2]=kt(P=>m(P),["stop"]))},{default:we(()=>[se(Qe,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label"]))])]),(_(),ke(hp,{to:"body"},[c.value?(_(),ke(Ul,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:en(f.value),onClick:E[3]||(E[3]=kt(()=>{},["stop"]))},{default:we(()=>[se(_n,{danger:b.value,onClick:T},{default:we(()=>[qe(R(b.value?x(o)("sidebar.copyFailed"):L.value?x(o)("sidebar.copied"):x(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),se(_n,{separator:""}),se(_n,{onClick:y},{default:we(()=>[qe(R(x(o)("sidebar.rename")),1)]),_:1}),se(_n,{onClick:$},{default:we(()=>[qe(R(x(o)("sidebar.fork")),1)]),_:1}),se(_n,{danger:"",onClick:N},{default:we(()=>[qe(R(x(o)("sidebar.archive")),1)]),_:1}),se(_n,{separator:""}),C("div",sP,R(a.value),1)]),_:1},8,["style"])):re("",!0)]))],2))}}),rP=ut(iP,[["__scopeId","data-v-08103df8"]]),lP={class:"gh-top"},aP={key:2,class:"gh-name"},cP={class:"gh-path"},uP=["inert"],dP=["disabled"],fP={class:"show-more-label"},hP={class:"show-more-label"},pP={key:2,class:"group-empty"},mP=je({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},showPath:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=B({get:()=>o.renameValue,set:f=>s("updateRenameValue",f)}),r=B(()=>{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(p=>p.id===o.activeId)){const p=o.group.sessions.find(h=>h.id===o.activeId);if(p)return[...f,p]}return f}),l=B(()=>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,p)=>(_(),I("div",{class:De(["group",{dragging:e.dragging}])},[C("div",{class:De(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id),"show-path":e.showPath}]),draggable:"true",onClick:p[7]||(p[7]=kt(h=>s("groupClick",e.group.workspace.id,h),["stop"])),onContextmenu:p[8]||(p[8]=h=>s("groupContextmenu",e.group.workspace,h)),onDragstart:d,onDragend:p[9]||(p[9]=h=>s("wsDragend"))},[C("div",lP,[e.isCollapsed(e.group.workspace.id)?(_(),ke(Qe,{key:0,class:"gh-folder",name:"folder-closed",size:"sm"})):(_(),ke(Qe,{key:1,class:"gh-folder",name:"folder",size:"sm"})),e.renamingId!==e.group.workspace.id?(_(),I("span",aP,R(e.group.workspace.name),1)):An((_(),I("input",{key:3,ref:u,"onUpdate:modelValue":p[0]||(p[0]=h=>i.value=h),class:"gh-rename",type:"text",onKeydown:[p[1]||(p[1]=gi(h=>s("confirmRename"),["enter"])),p[2]||(p[2]=gi(h=>s("cancelRename"),["esc"]))],onBlur:p[3]||(p[3]=h=>s("cancelRename")),onClick:p[4]||(p[4]=kt(()=>{},["stop"]))},null,544)),[[us,i.value]]),se(Mn,{class:De(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:x(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:p[5]||(p[5]=kt(h=>s("toggleWsMenu",e.group.workspace,h),["stop"]))},{default:we(()=>[se(Qe,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label","aria-expanded"]),se(Mn,{class:"gh-add",size:"sm",label:x(n)("workspace.newInGroup"),onClick:p[6]||(p[6]=kt(h=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:we(()=>[se(Qe,{name:"chat-new"})]),_:1},8,["label"])]),se(Kt,{text:e.group.workspace.root},{default:we(()=>[C("div",cP,R(e.group.workspace.shortPath||e.group.workspace.root),1)]),_:1},8,["text"])],34),C("div",{class:De(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(_(!0),I(Pe,null,nt(r.value,h=>(_(),ke(rP,{key:h.id,session:h,active:h.id===e.activeId,"approval-count":e.pendingBySession[h.id]?.approvals??0,"question-count":e.pendingBySession[h.id]?.questions??0,unread:e.unreadBySession[h.id]??!1,onSelect:p[10]||(p[10]=m=>s("selectSession",m)),onRename:p[11]||(p[11]=(m,w)=>s("renameSession",m,w)),onArchive:p[12]||(p[12]=m=>s("archiveSession",m)),onFork:p[13]||(p[13]=m=>s("forkSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(_(),I("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:p[14]||(p[14]=kt(h=>s("loadMore",e.group.workspace.id),["stop"]))},[p[16]||(p[16]=C("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),C("span",fP,R(e.group.loadingMore?x(n)("sidebar.loadingMore"):x(n)("sidebar.showMore",{count:a()})),1)],8,dP)):re("",!0),l.value?(_(),I("button",{key:1,class:"show-more",onClick:p[15]||(p[15]=kt(h=>s("toggleExpand",e.group.workspace.id),["stop"]))},[p[17]||(p[17]=C("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),C("span",hP,R(e.isExpanded(e.group.workspace.id)?x(n)("sidebar.showLess"):x(n)("sidebar.showAll",{count:c()})),1)])):re("",!0),e.group.sessions.length===0?(_(),I("div",pP,R(x(n)("sidebar.noSessions")),1)):re("",!0)],10,uP)],2))}}),gP=ut(mP,[["__scopeId","data-v-fd1b0444"]]),vP="kimi_desktop",yP="platform",q2="kimi-desktop",j2="kimi-desktop-platform";function kP(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(vP)?(sessionStorage.setItem(q2,"1"),e=!0):e=e||sessionStorage.getItem(q2)==="1";const o=n.get(yP);o?(sessionStorage.setItem(j2,o),t=o):t=sessionStorage.getItem(j2)}catch{}return{isDesktop:e,platform:t}}const ev=kP(),bP=ev.isDesktop,W4=ev.isDesktop&&ev.platform==="darwin",_P=["aria-label"],wP=je({__name:"InternalBuildBanner",setup(e){const{t}=Tt(),n=bP;return(o,s)=>x(n)?(_(),I("span",{key:0,class:"internal-build-tag",role:"note","aria-label":x(t)("app.internalBuildBanner")},[s[0]||(s[0]=C("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[C("path",{d:"M8 2 14 13H2L8 2Z"}),C("path",{d:"M8 6v3.5"}),C("path",{d:"M8 11.5h.01"})],-1)),C("span",null,R(x(t)("app.internalBuildBanner")),1)],8,_P)):re("",!0)}}),SP=ut(wP,[["__scopeId","data-v-b5e70a09"]]),CP={class:"ch"},xP={class:"ch-brand"},AP={class:"ch-name"},MP={key:0,class:"ch-endpoint"},TP={class:"search-input"},EP={key:0,class:"empty"},IP={class:"side-section-label"},$P={class:"side-section-title"},LP={class:"side-section-actions"},NP=["onDragover","onDrop"],RP={class:"section-menu-check"},OP={class:"section-menu-check"},PP={class:"section-menu-check"},DP=1e3,BP=je({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:o}=cl(),s=!1,i="",r=e,l=t,a=X(!1),c=f()?"⌘K":"Ctrl K";function u(){l("loadAllSessions"),a.value=!0}function d(Ke){(Ke.metaKey||Ke.ctrlKey)&&Ke.key.toLowerCase()==="k"&&(Ke.preventDefault(),u())}Sn(()=>window.addEventListener("keydown",d)),so(()=>window.removeEventListener("keydown",d));function f(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Ke=navigator.userAgentData;return Ke?.platform==="macOS"||Ke?.platform==="iOS"}const p=X(!1);function h(Ke){p.value=Ke.target.scrollTop>0}const m=X(new Set(L8()));function w(Ke){return m.value.has(Ke)}function k(Ke){const Ze=new Set(m.value);Ze.has(Ke)?Ze.delete(Ke):Ze.add(Ke),m.value=Ze,cg(Ze)}function g(){const Ke=new Set(r.groups.map(Ze=>Ze.workspace.id));m.value=Ke,cg(Ke)}function v(){const Ke=new Set;m.value=Ke,cg(Ke)}const y=B(()=>r.groups.length>0&&r.groups.every(Ke=>m.value.has(Ke.workspace.id))),M=X(new Set);function O(Ke){return M.value.has(Ke)}function L(Ke){const Ze=new Set(M.value);Ze.has(Ke)?Ze.delete(Ke):Ze.add(Ke),M.value=Ze}function b(Ke){if(!M.value.has(Ke)){const Ze=new Set(M.value);Ze.add(Ke),M.value=Ze}l("loadMoreSessions",Ke)}const T=X(N8());function $(){T.value=!T.value,R8(T.value)}const N=X(null),S=X(null);function E(Ke){N.value=Ke}function P(){N.value=null,S.value=null}function D(Ke){const Ze=Ke.currentTarget.getBoundingClientRect();return Ke.clientY<Ze.top+Ze.height/2?"before":"after"}function F(Ke,Ze){N.value===null||N.value===Ze||(Ke.preventDefault(),Ke.dataTransfer&&(Ke.dataTransfer.dropEffect="move"),S.value={id:Ze,position:D(Ke)})}function W(Ke){const Ze=N.value,Ft=S.value?.id===Ke?S.value.position:"before";if(S.value=null,N.value=null,!Ze||Ze===Ke)return;const sn=Q8(r.groups.map(un=>un.workspace.id),Ze,Ke,Ft);l("reorderWorkspaces",sn)}function K(Ke,Ze){Ze.target.closest(".gh-more, .gh-add")||k(Ke)}function Y(Ke){l("select",Ke)}const q=X(null),ae=X(""),ce=X(null);function ne(){return ce}function Q(Ke,Ze){q.value=Ke,ae.value=Ze,gt().then(()=>ce.value?.focus())}function ee(){const Ke=q.value,Ze=ae.value.trim();Ke&&Ze&&l("renameWorkspace",Ke,Ze),q.value=null}function ye(){q.value=null}function xe(Ke){ae.value=Ke}const Xe=X(!1),me=X(null),G=X({}),ie=X(null);function de(Ke){ie.value?.el&&!ie.value.el.contains(Ke.target)&&Z()}function z(Ke,Ze){Ze.preventDefault(),Ze.stopPropagation(),me.value=Ke,G.value={top:`${Ze.clientY}px`,left:`${Ze.clientX}px`},Xe.value=!0,document.addEventListener("mousedown",de,!0)}function Z(){Xe.value=!1,document.removeEventListener("mousedown",de,!0),me.value=null}function pe(){me.value&&Go(me.value.root),Z()}function le(){me.value&&Q(me.value.id,me.value.name),Z()}async function he(){const Ke=me.value;Ke&&(Z(),await o({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ke.name}),variant:"danger"})&&l("deleteWorkspace",Ke.id))}const U=X(null),J=X(null),fe=X({}),be=X(null);function Ee(Ke){const Ze=Ke.target;Ze.closest(".gh-more")||Ze.closest(".ws-menu")||ue()}async function Le(Ke,Ze){if(U.value===Ke.id){ue();return}const Ft=Ze.currentTarget;J.value=Ke,U.value=Ke.id,document.addEventListener("mousedown",Ee),window.addEventListener("resize",ue),await gt();const sn=be.value?.el,un=Ft.getBoundingClientRect(),tn=4,Cn=8,Mt=sn?.offsetHeight??0,Xn=sn?.offsetWidth??0;let Ut=un.bottom+tn;Ut+Mt>window.innerHeight-Cn&&(Ut=Math.max(Cn,un.top-Mt-tn));let wo=un.right-Xn;wo<Cn&&(wo=Cn),fe.value={top:`${Math.round(Ut)}px`,left:`${Math.round(wo)}px`}}function ue(){U.value=null,J.value=null,document.removeEventListener("mousedown",Ee),window.removeEventListener("resize",ue)}function Ie(Ke){Go(Ke.root),ue()}function Ge(Ke){Q(Ke.id,Ke.name),ue()}async function lt(Ke){ue(),await o({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ke.name}),variant:"danger"})&&l("deleteWorkspace",Ke.id)}const bt=X(!1),_t=X({}),$t=X(null);function Bt(Ke){const Ze=Ke.target;Ze.closest(".side-section-kebab")||Ze.closest(".section-menu")||Gt()}async function yt(Ke){if(bt.value){Gt();return}const Ze=Ke.currentTarget;bt.value=!0,document.addEventListener("mousedown",Bt),window.addEventListener("resize",Gt),await gt();const Ft=$t.value?.el,sn=Ze.getBoundingClientRect(),un=4,tn=8,Cn=Ft?.offsetHeight??0,Mt=Ft?.offsetWidth??0;let Xn=sn.bottom+un;Xn+Cn>window.innerHeight-tn&&(Xn=Math.max(tn,sn.top-Cn-un));let Ut=sn.right-Mt;Ut<tn&&(Ut=tn),_t.value={top:`${Math.round(Xn)}px`,left:`${Math.round(Ut)}px`}}function Gt(){bt.value=!1,document.removeEventListener("mousedown",Bt),window.removeEventListener("resize",Gt)}function pn(Ke){l("setWorkspaceSortMode",Ke),Gt()}function ro(){$(),Gt()}so(()=>{document.removeEventListener("mousedown",de,!0),document.removeEventListener("mousedown",Ee),document.removeEventListener("mousedown",Bt),window.removeEventListener("resize",ue),window.removeEventListener("resize",Gt)});const Yt=X(null);let mn;function zo(){const Ke=Yt.value;Ke&&(Ke.classList.remove("blink-now"),Ke.getBoundingClientRect(),Ke.classList.add("blink-now"),clearTimeout(mn),mn=setTimeout(()=>Ke.classList.remove("blink-now"),300))}const ot=mi(()=>ns(()=>import("./DesignSystemView-CcrMrQZg.js"),__vite__mapDeps([0,1]))),zn=X(!1);let lo,Gn=!1;function Yn(Ke){Gn=!1,clearTimeout(lo),Ke.currentTarget.setPointerCapture?.(Ke.pointerId),lo=setTimeout(()=>{Gn=!0,zn.value=!0},DP)}function Zt(Ke){clearTimeout(lo);const Ze=Ke.currentTarget;Ze.hasPointerCapture?.(Ke.pointerId)&&Ze.releasePointerCapture(Ke.pointerId)}function Qn(){if(Gn){Gn=!1;return}zo()}return so(()=>{clearTimeout(lo)}),(Ke,Ze)=>(_(),I("aside",{class:De(["side",{"macos-desktop":x(W4)}])},[C("div",{class:"col",style:en({width:e.colWidth+"px"})},[C("div",CP,[C("div",xP,[(_(),I("svg",{ref_key:"logoRef",ref:Yt,class:De(["ch-logo",{"is-dev":x(s)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:Qn,onPointerdown:Yn,onPointerup:Zt,onPointercancel:Zt},[...Ze[21]||(Ze[21]=[v0('<defs data-v-23df25c5><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-23df25c5><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-23df25c5></rect><g class="ch-eyes" fill="#000" data-v-23df25c5><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-23df25c5></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-23df25c5></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-23df25c5></rect>',2)])],34)),C("span",AP,[Ze[22]||(Ze[22]=qe("Kimi Code",-1)),x(s)?(_(),I("span",MP," · "+R(x(i)),1)):re("",!0)]),se(SP)]),se(Mn,{size:"sm",label:x(n)("sidebar.collapseSidebar"),onClick:Ze[0]||(Ze[0]=kt(Ft=>l("collapse"),["stop"]))},{default:we(()=>[se(Qe,{name:"panel-collapse"})]),_:1},8,["label"]),se(Mn,{size:"sm",label:x(n)("settings.title"),onClick:Ze[1]||(Ze[1]=kt(Ft=>l("openSettings"),["stop"]))},{default:we(()=>[se(Qe,{name:"settings"})]),_:1},8,["label"])]),C("button",{class:"search",type:"button",onClick:u},[se(Qe,{class:"search-icon",name:"search"}),C("span",TP,R(x(n)("sidebar.searchShortcut",{shortcut:x(c)})),1)]),C("div",{class:De(["btn-wrap",{"btn-wrap--scrolled":p.value}])},[C("button",{class:"btn-new-chat",type:"button",onClick:Ze[2]||(Ze[2]=kt(Ft=>l("create"),["stop"]))},[se(Qe,{name:"chat-new"}),C("span",null,R(x(n)("sidebar.newChat")),1)]),re("",!0)],2),C("div",{class:"sessions",onScroll:h},[e.groups.length===0?(_(),I("div",EP,R(x(n)("workspace.noWorkspace")),1)):(_(),I(Pe,{key:1},[C("div",IP,[C("span",$P,R(x(n)("sidebar.workspaces")),1),C("div",LP,[se(Mn,{class:"side-section-toggle",size:"sm",label:y.value?x(n)("sidebar.expandAll"):x(n)("sidebar.collapseAll"),onClick:Ze[4]||(Ze[4]=kt(Ft=>y.value?v():g(),["stop"]))},{default:we(()=>[y.value?(_(),ke(Qe,{key:0,name:"expand"})):(_(),ke(Qe,{key:1,name:"collapse"}))]),_:1},8,["label"]),se(Mn,{class:"side-section-toggle side-section-kebab",size:"sm",label:x(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":bt.value,onClick:Ze[5]||(Ze[5]=kt(Ft=>yt(Ft),["stop"]))},{default:we(()=>[se(Qe,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(_(!0),I(Pe,null,nt(e.groups,Ft=>(_(),I("div",{key:Ft.workspace.id,class:De(["ws-drop-target",{"drop-before":S.value?.id===Ft.workspace.id&&S.value.position==="before","drop-after":S.value?.id===Ft.workspace.id&&S.value.position==="after"}]),onDragover:sn=>F(sn,Ft.workspace.id),onDrop:sn=>W(Ft.workspace.id)},[se(gP,{group:Ft,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":q.value,"rename-value":ae.value,"rename-input-ref":ne(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":U.value,dragging:N.value===Ft.workspace.id,"is-collapsed":w,"is-expanded":O,"show-path":T.value,onGroupClick:K,onGroupContextmenu:z,onToggleWsMenu:Le,onCreateInWorkspace:Ze[6]||(Ze[6]=sn=>l("createInWorkspace",sn)),onSelectSession:Y,onRenameSession:Ze[7]||(Ze[7]=(sn,un)=>l("rename",sn,un)),onArchiveSession:Ze[8]||(Ze[8]=sn=>l("archive",sn)),onForkSession:Ze[9]||(Ze[9]=sn=>l("fork",sn)),onLoadMore:b,onToggleExpand:L,onConfirmRename:ee,onCancelRename:ye,onUpdateRenameValue:xe,onWsDragstart:E,onWsDragend:P},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","show-path"])],42,NP))),128))],64))],32)],4),Xe.value?(_(),ke(Ul,{key:0,ref_key:"ghMenuRef",ref:ie,class:"gh-menu",style:en(G.value),onClick:Ze[10]||(Ze[10]=kt(()=>{},["stop"]))},{default:we(()=>[se(_n,{onClick:pe},{default:we(()=>[qe(R(x(n)("sidebar.copyPath")),1)]),_:1}),se(_n,{onClick:le},{default:we(()=>[qe(R(x(n)("sidebar.rename")),1)]),_:1}),se(_n,{danger:"",onClick:he},{default:we(()=>[qe(R(x(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),U.value!==null&&J.value?(_(),ke(Ul,{key:1,ref_key:"wsMenuRef",ref:be,class:"ws-menu",style:en(fe.value),onClick:Ze[14]||(Ze[14]=kt(()=>{},["stop"]))},{default:we(()=>[se(_n,{onClick:Ze[11]||(Ze[11]=Ft=>Ie(J.value))},{default:we(()=>[qe(R(x(n)("sidebar.copyPath")),1)]),_:1}),se(_n,{separator:""}),se(_n,{onClick:Ze[12]||(Ze[12]=Ft=>Ge(J.value))},{default:we(()=>[qe(R(x(n)("sidebar.rename")),1)]),_:1}),se(_n,{separator:""}),se(_n,{danger:"",onClick:Ze[13]||(Ze[13]=Ft=>lt(J.value))},{default:we(()=>[qe(R(x(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),bt.value?(_(),ke(Ul,{key:2,ref_key:"sectionMenuRef",ref:$t,class:"section-menu",style:en(_t.value),onClick:Ze[18]||(Ze[18]=kt(()=>{},["stop"]))},{default:we(()=>[se(_n,{onClick:Ze[15]||(Ze[15]=Ft=>pn("manual"))},{default:we(()=>[C("span",RP,[e.workspaceSortMode==="manual"?(_(),ke(Qe,{key:0,name:"check",size:"sm"})):re("",!0)]),qe(" "+R(x(n)("sidebar.sortManual")),1)]),_:1}),se(_n,{onClick:Ze[16]||(Ze[16]=Ft=>pn("recent"))},{default:we(()=>[C("span",OP,[e.workspaceSortMode==="recent"?(_(),ke(Qe,{key:0,name:"check",size:"sm"})):re("",!0)]),qe(" "+R(x(n)("sidebar.sortRecent")),1)]),_:1}),se(_n,{separator:""}),se(_n,{onClick:Ze[17]||(Ze[17]=Ft=>ro())},{default:we(()=>[C("span",PP,[T.value?(_(),ke(Qe,{key:0,name:"check",size:"sm"})):re("",!0)]),qe(" "+R(x(n)("sidebar.showWorkspacePaths")),1)]),_:1})]),_:1},8,["style"])):re("",!0),a.value?(_(),ke(FO,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:Y,onClose:Ze[19]||(Ze[19]=Ft=>a.value=!1)},null,8,["sessions","active-id"])):re("",!0),(_(),ke(hp,{to:"body"},[zn.value?(_(),ke(x(ot),{key:0,onClose:Ze[20]||(Ze[20]=Ft=>zn.value=!1)})):re("",!0)]))],2))}}),FP=ut(BP,[["__scopeId","data-v-23df25c5"]]);function HP(e){try{const t=no(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function zP(e,t){try{io(e,String(t))}catch{}}function WP(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(k){return Number.isFinite(k)?Math.min(ex(s),Math.max(o,Math.round(k))):n}const l=X(r(HP(t)??n)),a=X(!1);function c(k){const g=r(k);l.value=g,zP(t,g)}let u=0,d=0,f=null,p=-1;function h(k){if(!a.value)return;const g=k.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(p)}catch{}f.removeEventListener("pointermove",h),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,p=-1}}function w(k){k.preventDefault(),a.value=!0,u=k.clientX,d=r(l.value),f=k.currentTarget,p=k.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(p)}catch{}f.addEventListener("pointermove",h),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return so(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:w}}const UP=["aria-label"],qP=je({__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}=Tt(),{width:i,dragging:r,onPointerDown:l}=WP({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),Ve(i,a=>o("update:width",a)),Ve(r,a=>o("update:dragging",a)),(a,c)=>(_(),I("div",{class:De(["rh",{dragging:x(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??x(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>x(l)&&x(l)(...u))},[...c[1]||(c[1]=[C("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,UP))}}),V2=ut(qP,[["__scopeId","data-v-ad762f1c"]]),jP={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},VP={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…",internalBuildBanner:"Internal testing only"},KP={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",showWorkspacePaths:"Show workspace paths",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",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",noSessions:"No conversations yet",showMore:"Load more ({count})",showLess:"Show less",showAll:"Show all ({count})",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchShortcut:"Search sessions ({shortcut})",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},GP={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",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",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 under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",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.',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"},YP={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",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"}},QP={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",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",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"},XP={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",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:" · thinking: {level}"},ZP={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"},JP={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"},e9={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"},t9={justNow:"just now"},n9={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"},o9={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},s9={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"},i9={panelTitle:"Thinking",close:"Close"},r9={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"},l9={},a9={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"}},c9={searching:"Searching…",noMatch:"No matches"},u9={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",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."}},d9={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},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"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},f9={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"},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"},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)"}},h9={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},p9={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"},m9={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},g9={preview:"预览",confirm:"确认",cancel:"取消"},v9={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",internalBuildBanner:"仅供内部测试"},y9={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",showWorkspacePaths:"显示工作区路径",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 ({count})",showLess:"收起",showAll:"展开 ({count})",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchShortcut:"搜索会话 ({shortcut})",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},k9={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:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},b9={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",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:"收起"}},_9={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},w9={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},S9={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 后重试"},C9={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 关闭"},x9={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},A9={justNow:"刚刚"},M9={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:"拒绝并退出"},T9={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},E9={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:"展开"},I9={panelTitle:"思考过程",close:"关闭"},$9={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},L9={},N9={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:"无法读取这个文件"}},R9={searching:"搜索中…",noMatch:"无匹配"},O9={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",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:"目标描述太长了,请精简后重试。"}},P9={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},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 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},D9={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},B9={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},F9={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},H9={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},z9={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"},W9={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},U9={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",soundOnComplete:"Play a sound when a turn completes or needs an answer",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",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",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…"},q9={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",soundOnComplete:"会话完成或待回答时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",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:"服务端版本",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:"正在加载全部归档会话…"},j9={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",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive"},V9={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档"},K9={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"},G9={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},Y9={en:{common:jP,app:VP,sidebar:KP,workspace:GP,conversation:YP,status:QP,composer:XP,login:ZP,providers:JP,model:e9,sessions:t9,approval:n9,question:o9,tasks:s9,thinking:i9,diff:r9,fileTree:l9,filePreview:a9,mention:c9,warnings:u9,commands:d9,tools:f9,layout:h9,mobile:p9,theme:m9,onboarding:z9,settings:U9,header:j9,sideChat:K9},zh:{common:g9,app:v9,sidebar:y9,workspace:k9,conversation:b9,status:_9,composer:w9,login:S9,providers:C9,model:x9,sessions:A9,approval:M9,question:T9,tasks:E9,thinking:I9,diff:$9,fileTree:L9,filePreview:N9,mention:R9,warnings:O9,commands:P9,tools:D9,layout:B9,mobile:F9,theme:H9,onboarding:W9,settings:q9,header:V9,sideChat:G9}},U4=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function Q9(){const e=no(Nt.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Hn=b8({legacy:!1,locale:Q9(),fallbackLocale:"en",messages:Y9});function q4(e){Hn.global.locale.value=e,io(Nt.locale,e)}const nc=Hn.global.t,X9={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"},Z9={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"};function na(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return Z9[t]??t}function oa(e){const t=X9[na(e)];return t?nc(t):e}const J9={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",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function bp(e){const t=na(e);let n=J9[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),Pa(n,"sm")}const j4=80;function eD(e,t=j4){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function tD(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function nD(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 dn(e){return typeof e=="string"&&e.length>0?e:void 0}function xl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function oD(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 dg(e){return dn(e.path)??dn(e.file_path)??dn(e.filePath)??dn(e.filename)}const sD=64;function ju(e,t,n=!1){const o=(s,i=j4)=>n?s.trim():eD(s,i);try{const s=nD(t);if(!n&&tD(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(na(e)){case"read":{const r=dg(s);if(!r)return i();const l=xl(s.offset)??xl(s.line_start)??xl(s.start_line),a=xl(s.limit)??xl(s.length),c=xl(s.line_end)??xl(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=dg(s);return r?o(`${r} ${nc("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=dg(s);return r?o(r):i()}case"bash":{const r=dn(s.command)??dn(s.cmd)??dn(s.script);return r?o(r,sD):i()}case"grep":case"search":{const r=dn(s.pattern)??dn(s.query)??dn(s.regex),l=dn(s.path)??dn(s.glob)??dn(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=dn(s.pattern)??dn(s.glob)??dn(s.query),l=dn(s.path)??dn(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):dn(s.path)?o(dn(s.path)):i()}case"ls":{const r=dn(s.path)??dn(s.dir)??dn(s.directory)??dn(s.cwd);return r?o(r):i()}case"web_fetch":{const r=dn(s.url)??dn(s.uri);return r?o(oD(r)):i()}case"todo":case"task":{const r=dn(s.description)??dn(s.title)??dn(s.prompt)??dn(s.name)??dn(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(nc("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function iD(e){try{switch(na(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return nc("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 nc("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?nc("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const rD=je({__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=B(()=>n(t.status));return(s,i)=>(_(),I("span",{class:De(["kw-dot",`kw-dot--${o.value}`]),"aria-hidden":"true"},null,2))}}),Vu=ut(rD,[["__scopeId","data-v-e36198e5"]]),lD=["innerHTML"],aD={class:"a"},cD={key:0,class:"p"},uD={class:"rt"},dD=["aria-label"],fD={key:0,class:"tm"},hD=["inert"],pD={class:"bb-pad"},mD=je({__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=Vt("pinScroll",()=>{}),s=X(null);function i(){n("toggle");const r=s.value;r&&gt(()=>o(r))}return(r,l)=>(_(),I("div",{class:De(["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"}])},[C("div",{class:"bh",ref_key:"bhEl",ref:s,onClick:i},[e.icon?(_(),I("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,lD)):re("",!0),C("span",aD,R(e.name),1),se(Kt,{text:e.arg},{default:we(()=>[e.arg?(_(),I("span",cD,R(e.arg),1)):re("",!0)]),_:1},8,["text"]),C("span",uD,[C("span",{class:De(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(_(),ke(Qe,{key:0,name:"check",size:"sm"})):e.status==="error"?(_(),ke(Qe,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(_(),ke(Vu,{key:2,status:"suspended"})):(_(),ke(Vu,{key:3,status:"running"}))],10,dD),On(r.$slots,"trailing"),e.time?(_(),I("span",fD,R(e.time),1)):re("",!0)]),e.expandable?(_(),ke(Qe,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):re("",!0)],512),C("div",{class:De(["bb",{open:e.open}]),inert:!e.open},[C("div",pD,[On(r.$slots,"default")])],10,hD)],2))}}),_p=ut(mD,[["__scopeId","data-v-8cb516d8"]]),gD={key:0,class:"at-type"},vD={key:1,class:"at-task"},yD={key:2,class:"bb-code"},kD=je({__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}=Tt(),o=e,s=t;function i(k){if(!k)return{};try{const g=JSON.parse(k);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=B(()=>i(o.tool.arg)),l=B(()=>!!o.tool.output&&o.tool.output.length>0),a=B(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=X(o.tool.defaultExpanded===!0&&a.value),u=B(()=>o.tool.status),d=B(()=>oa(o.tool.name)),f=B(()=>bp(o.tool.name)),p=B(()=>r.value.description||r.value.subagentType||""),h=Vt("resolveAgentTaskId"),m=B(()=>h?h(o.tool.id)!==void 0:!0);function w(){a.value&&(c.value=!c.value)}return Ve(()=>[o.tool.defaultExpanded,o.tool.output?.length,o.tool.status],()=>{o.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(k,g)=>(_(),ke(_p,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":p.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:w},{trailing:we(()=>[m.value?(_(),I("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=kt(v=>s("openAgent",e.tool.id),["stop"]))},R(x(n)("tasks.openDetail")),1)):re("",!0)]),default:we(()=>[r.value.subagentType?(_(),I("div",gD,R(r.value.subagentType),1)):re("",!0),r.value.prompt?(_(),I("div",vD,R(r.value.prompt),1)):re("",!0),l.value?(_(),I("div",yD,[(_(!0),I(Pe,null,nt(e.tool.output??[],(v,y)=>(_(),I("div",{key:y},R(v),1))),128))])):re("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),bD=ut(kD,[["__scopeId","data-v-14ef8750"]]);function _D(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 sf={recognized:!1,answers:{},note:""};function wD(e){const t=e?.[0];if(!t)return sf;let n;try{n=JSON.parse(t)}catch{return sf}if(!n||typeof n!="object"||Array.isArray(n))return sf;const o=n.answers;if(!o||typeof o!="object"||Array.isArray(o))return sf;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 SD(e,t,n){return e[t]??e[`q_${n}`]}const CD=/^opt_\d+_(\d+)$/;function xD(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=CD.exec(l);c?s.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:s,otherText:i.join(", "),indeterminate:!1}}const AD={key:0,class:"chip"},MD={key:0,class:"au-dismissed"},TD={key:1,class:"au-list"},ED={class:"au-q"},ID={key:0,class:"au-hdr"},$D={class:"au-qtext"},LD={class:"au-opts"},ND={class:"au-glyph"},RD={class:"au-label"},OD={key:0,class:"au-desc"},PD={key:0,class:"au-opt sel"},DD={class:"au-glyph"},BD={class:"au-label"},FD={key:1,class:"au-opt sel"},HD={class:"au-label"},zD={key:2,class:"au-raw"},WD=80,UD=je({__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}=Tt();function o(L,b=WD){const T=L.trim();return T.length>b?T.slice(0,b-1)+"…":T}const s=B(()=>_D(t.tool.arg)),i=B(()=>wD(t.tool.output)),r=B(()=>i.value.recognized),l=B(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=B(()=>s.value.map((L,b)=>xD(SD(i.value.answers,L.question,b),L.options))),c=B(()=>Object.keys(i.value.answers).length);function u(L,b){return a.value[L]?.selected.has(b)??!1}function d(L){return a.value[L]?.otherText??""}function f(L){return a.value[L]?.indeterminate??!1}function p(L,b){return L?b?"■":"□":b?"●":"○"}const h=B(()=>{if(!r.value)return o(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const L=s.value[0]?.question??"",b=o(L);return s.value.length<=1?b:`${b} ${n("tools.ask.more",{count:s.value.length-1})}`}),m=B(()=>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}):""),w=B(()=>!!t.tool.output&&t.tool.output.length>0),k=B(()=>r.value&&(s.value.length>0||l.value)||w.value),g=X(t.tool.defaultExpanded===!0&&k.value),v=B(()=>t.tool.status),y=B(()=>oa(t.tool.name)),M=B(()=>bp(t.tool.name));function O(){k.value&&(g.value=!g.value)}return Ve(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&k.value&&(g.value=!0)}),(L,b)=>(_(),ke(_p,{status:v.value,icon:M.value,name:y.value,arg:g.value?"":h.value,time:e.tool.timing,open:g.value,expandable:k.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:O},{trailing:we(()=>[m.value?(_(),I("span",AD,R(m.value),1)):re("",!0)]),default:we(()=>[l.value?(_(),I("div",MD,R(i.value.note),1)):r.value?(_(),I("div",TD,[(_(!0),I(Pe,null,nt(s.value,(T,$)=>(_(),I("div",{key:$,class:"au-block"},[C("div",ED,[T.header?(_(),I("span",ID,R(T.header),1)):re("",!0),C("span",$D,R(T.question),1)]),C("div",LD,[(_(!0),I(Pe,null,nt(T.options,(N,S)=>(_(),I("div",{key:S,class:De(["au-opt",{sel:u($,S)}])},[C("span",ND,R(p(T.multiSelect,u($,S))),1),C("span",RD,R(N.label),1),N.description?(_(),I("span",OD,R(N.description),1)):re("",!0)],2))),128)),d($)?(_(),I("div",PD,[C("span",DD,R(p(T.multiSelect,!0)),1),C("span",BD,R(d($)),1)])):re("",!0),f($)?(_(),I("div",FD,[b[0]||(b[0]=C("span",{class:"au-glyph"},"●",-1)),C("span",HD,R(x(n)("tools.ask.answered")),1)])):re("",!0)])]))),128))])):(_(),I("div",zD,[(_(!0),I(Pe,null,nt(e.tool.output??[],(T,$)=>(_(),I("div",{key:$},R(T),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),qD=ut(UD,[["__scopeId","data-v-a9a0f259"]]),jD=1e6,K2=5e3;function G2(e){if(e==="")return[];const t=e.split(`
39
+ `);return t.at(-1)===""&&t.pop(),t}function VD(e,t){const n=G2(e),o=G2(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>K2||i>K2||(s+1)*(i+1)>jD)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let p=1;p<=s;p++)for(let h=1;h<=i;h++)r[p][h]=n[p-1]===o[h-1]?r[p-1][h-1]+1:Math.max(r[p-1][h],r[p][h-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 p of l)p.type==="context"?(u.push({type:"context",text:p.text,oldNo:d,newNo:f}),d++,f++):p.type==="add"?(u.push({type:"add",text:p.text,newNo:f}),f++):(u.push({type:"del",text:p.text,oldNo:d}),d++);return u}function KD(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 V4(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 K4(e){const t=na(e.name);if(t!=="edit"&&t!=="write")return null;const n=V4(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:VD(o,s)}return null}function GD(e){const t=V4(e);return t&&typeof t.path=="string"?t.path:void 0}function YD(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const QD={key:0,class:"chip"},XD={key:0,class:"bb-summary"},ZD={class:"bb-code"},JD={key:0,class:"bb-empty"},eB=je({__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=B(()=>n.tool.status),i=B(()=>oa(n.tool.name)),r=B(()=>bp(n.tool.name)),l=B(()=>ju(n.tool.name,n.tool.arg)),a=B(()=>ju(n.tool.name,n.tool.arg,!0)),c=B(()=>K4(n.tool)),u=B(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:w,removed:k}=KD(m);if(w||k)return`+${w} −${k}`}return""}),d=B(()=>!!n.tool.output&&n.tool.output.length>0),f=X(!1),p=B(()=>d.value&&!n.toolDiffPanel);function h(){if(n.toolDiffPanel){o("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,w)=>(_(),ke(_p,{status:s.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:p.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:h},{trailing:we(()=>[u.value?(_(),I("span",QD,R(u.value),1)):re("",!0)]),default:we(()=>[a.value?(_(),I("div",XD,R(a.value),1)):re("",!0),C("div",ZD,[d.value?re("",!0):(_(),I("div",JD,"Waiting for output…")),(_(!0),I(Pe,null,nt(e.tool.output??[],(k,g)=>(_(),I("div",{key:g},R(k),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),tB=ut(eB,[["__scopeId","data-v-69861679"]]),nB={key:0,class:"chip"},oB={key:0,class:"bb-summary"},sB={class:"bb-code"},iB={key:0,class:"bb-empty"},rB=je({__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=B(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),o=B(()=>!!t.tool.output&&t.tool.output.length>0),s=B(()=>o.value||n.value),i=X(t.tool.defaultExpanded===!0&&s.value),r=B(()=>t.tool.status),l=B(()=>oa(t.tool.name)),a=B(()=>bp(t.tool.name)),c=B(()=>ju(t.tool.name,t.tool.arg)),u=B(()=>ju(t.tool.name,t.tool.arg,!0)),d=B(()=>iD({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 Ve(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&s.value&&(i.value=!0)}),(p,h)=>(_(),ke(_p,{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:we(()=>[d.value?(_(),I("span",nB,R(d.value),1)):re("",!0)]),default:we(()=>[u.value?(_(),I("div",oB,R(u.value),1)):re("",!0),C("div",sB,[o.value?re("",!0):(_(),I("div",iB,"Waiting for output…")),(_(!0),I(Pe,null,nt(e.tool.output??[],(m,w)=>(_(),I("div",{key:w},R(m),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),lB=ut(rB,[["__scopeId","data-v-f3c4ee38"]]),aB={class:"media-title"},cB=["src","alt"],uB=["src"],dB=["src"],fB=je({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,o=t,s=B(()=>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=B(()=>{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?(_(),I("div",{key:0,class:De(["media-tool",{mob:e.mobile}])},[se(Kt,{text:s.value.path||l.value},{default:we(()=>[C("div",aB,R(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(_(),ke(Kt,{key:0,text:s.value.path||l.value},{default:we(()=>[C("button",{type:"button",class:"media-image-button",onClick:a},[C("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,cB)])]),_:1},8,["text"])):s.value.kind==="video"?(_(),I("video",{key:1,class:"media-video",src:s.value.url,controls:"",preload:"metadata"},null,8,uB)):(_(),I("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,dB))],2)):re("",!0)}}),hB=ut(fB,[["__scopeId","data-v-bec13b73"]]),pB=/<summary>([\s\S]*?)<\/summary>/,mB=/<resume_hint>([\s\S]*?)<\/resume_hint>/,fg=/<subagent\b([^>]*)>|<\/subagent>/g,gB="</subagent>",Y2=/(completed|failed|aborted):\s*(\d+)/g,Q2=/([a-z_]+)="([^"]*)"/g;function vB(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function yB(e){const t={};Q2.lastIndex=0;let n;for(;(n=Q2.exec(e))!==null;)t[n[1]]=vB(n[2]);return t}function kB(e){const t={completed:0,failed:0,aborted:0};Y2.lastIndex=0;let n;for(;(n=Y2.exec(e))!==null;){const o=n[1];t[o]=Number(n[2])}return t}function bB(e,t){const n=yB(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function _B(e){const t=[],n=[];fg.lastIndex=0;let o;for(;(o=fg.exec(e))!==null;)if(o[0]===gB){if(n.length===0)continue;const s=n.pop();s&&n.length===0&&t.push(bB(s.attrs,e.slice(s.bodyStart,o.index)))}else n.length===0?n.push({attrs:o[1]??"",bodyStart:fg.lastIndex}):n.push(null);return t}function wB(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
40
+ `):e;if(!t.includes("<agent_swarm_result>"))return null;const n=pB.exec(t)?.[1]?.trim()??"",{completed:o,failed:s,aborted:i}=kB(n),r=mB.exec(t)?.[1]?.trim(),l=_B(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 X2(e){return e?e.split(`
41
+ `).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function SB(e){return e.suspendedReason||X2(e.text)||X2(e.outputLines?.join(`
42
+ `))||e.summary||""}function CB(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
43
+ `):e.summary??""}function xB(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function Z2(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
44
+ `)[0]??"",phase:xB(e.outcome),body:e.body}}function AB(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function MB(e,t){const n=e.map(s=>({id:s.id,name:s.name,activity:SB(s),phase:s.phase,body:CB(s)}));if(!t)return n;const o=t.subagents.filter(s=>(s.outcome==="aborted"||s.state==="not_started")&&!e.some(i=>AB(i,s))).map((s,i)=>Z2(s,i));return n.length>0?[...n,...o]:t.subagents.map((s,i)=>Z2(s,i))}const TB=["aria-expanded"],EB={class:"title"},IB={key:0,class:"meta"},$B={key:1,class:"sum-txt"},LB={class:"rt"},NB={class:"status"},RB={key:0,class:"chip"},OB={key:1,class:"tm"},PB={class:"body"},DB={class:"overview"},BB={class:"overview-line"},FB={class:"big"},HB={key:0,class:"lbl"},zB={key:1,class:"lbl"},WB={key:2,class:"lbl"},UB={key:0,class:"seg","aria-hidden":"true"},qB={key:1,class:"legend"},jB=["aria-expanded","onClick"],VB={class:"mname"},KB={class:"mact"},GB={class:"mphase"},YB={key:1,class:"fallback-output"},QB={key:2,class:"waiting"},XB=je({__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}=Tt(),n=e;function o($){if(!$)return{};try{const N=JSON.parse($),S=Array.isArray(N.items)?N.items:void 0;return{description:typeof N.description=="string"?N.description:void 0,itemCount:S?.length}}catch{return{}}}const s=Vt("resolveSwarmMembers"),i=B(()=>o(n.tool.arg)),r=B(()=>oa(n.tool.name)),l=B(()=>i.value.description??""),a=B(()=>s?.(n.tool.id)??[]),c=B(()=>wB(n.tool.output)),u=B(()=>n.tool.status),d=B(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=B(()=>MB(a.value,c.value)),p=B(()=>{const $={completed:0,working:0,suspended:0,queued:0,failed:0};for(const N of f.value)$[N.phase]++;return $}),h=B(()=>f.value.length||i.value.itemCount||0),m=B(()=>p.value.completed+p.value.failed),w=B(()=>p.value.working+p.value.suspended+p.value.queued),k=[{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"}],g=B(()=>k.map(({phase:$,cls:N})=>({phase:$,count:p.value[$],cls:N})).filter($=>$.count>0)),v=X(!1);function y(){v.value=!v.value}const M=B(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
45
+ `).trim()),O=X(new Set);function L($){const N=new Set(O.value);N.has($)?N.delete($):N.add($),O.value=N}function b($){return O.value.has($)}function T($){return t(`tools.swarm.phase${$[0].toUpperCase()}${$.slice(1)}`)}return($,N)=>(_(),I("div",{class:De(["swarm-card",{open:v.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[C("button",{class:"head",type:"button","aria-expanded":v.value,onClick:y},[se(Qe,{class:"ic",name:"git-pull-request",size:"sm"}),C("span",EB,R(r.value),1),l.value?(_(),I("span",IB,"·")):re("",!0),l.value?(_(),I("span",$B,R(l.value),1)):re("",!0),C("span",LB,[C("span",NB,[d.value==="ok"?(_(),ke(Qe,{key:0,name:"check",size:"sm"})):d.value==="error"?(_(),ke(Qe,{key:1,name:"close",size:"sm"})):(_(),ke(Vu,{key:2,status:"running"}))]),m.value>0||h.value>0?(_(),I("span",RB,R(m.value)+" / "+R(h.value),1)):re("",!0),e.tool.timing?(_(),I("span",OB,R(e.tool.timing),1)):re("",!0)]),se(Qe,{class:"car",name:v.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,TB),An(C("div",PB,[C("div",DB,[C("div",BB,[C("span",FB,R(x(t)("tools.swarm.progress",{done:m.value,total:h.value})),1),d.value==="running"&&h.value>0?(_(),I("span",HB,R(x(t)("tools.swarm.runningSub",{count:w.value})),1)):c.value?(_(),I("span",zB,R(x(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(_(),I("span",WB,R(x(t)("tools.swarm.waiting")),1))]),h.value>0&&g.value.length>0?(_(),I("div",UB,[(_(!0),I(Pe,null,nt(g.value,S=>(_(),I("span",{key:S.phase,class:De(S.cls),style:en({flex:S.count})},null,6))),128))])):re("",!0),g.value.length>1?(_(),I("div",qB,[(_(!0),I(Pe,null,nt(g.value,S=>(_(),I("span",{key:S.phase},[C("i",{class:De(["lg-dot",S.cls])},null,2),qe(R(T(S.phase))+" "+R(S.count),1)]))),128))])):re("",!0)]),f.value.length>0?(_(!0),I(Pe,{key:0},nt(f.value,S=>(_(),I("div",{key:S.id,class:De(["member",[`phase-${S.phase}`,{open:b(S.id)}]])},[C("button",{class:"member-head",type:"button","aria-expanded":b(S.id),onClick:E=>L(S.id)},[se(Vu,{class:"row-dot",status:S.phase},null,8,["status"]),se(Kt,{text:S.name},{default:we(()=>[C("span",VB,R(S.name),1)]),_:2},1032,["text"]),S.activity?(_(),ke(Kt,{key:0,text:S.activity},{default:we(()=>[C("span",KB,R(S.activity),1)]),_:2},1032,["text"])):re("",!0),C("span",GB,R(T(S.phase)),1),se(Qe,{class:"mcar",name:b(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,jB),An(C("div",{class:"member-body"},R(S.body),513),[[Ns,b(S.id)]])],2))),128)):M.value?(_(),I("div",YB,R(M.value),1)):(_(),I("div",QB,R(x(t)("tools.swarm.waiting")),1))],512),[[Ns,v.value]])],2))}}),ZB=ut(XB,[["__scopeId","data-v-3b95ba79"]]);function JB(e){if(e.media&&e.status==="ok")return hB;const t=na(e.name);return t==="edit"||t==="write"||t==="multi_edit"?tB:t==="task"?bD:t==="agentswarm"?ZB:t==="askuserquestion"?qD:lB}const G4=je({__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=B(()=>JB(n.tool));return(i,r)=>(_(),ke(Oo(s.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,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"]))}});function J2(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function eF(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 wp(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 tF(e){return!(e.tool.status==="ok"&&e.tool.media)}function nF(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function oF(e){const t=wp(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(tF(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 sF(e){return wp(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
46
+
47
+ `)}function iF(e){const t=[];for(const n of wp(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
48
+ > ${n.thinking.split(`
49
+ `).join(`
50
+ > `)}`);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(`
51
+ `);t.push(`\`\`\`
52
+ [${n.tool.name}]
53
+ ${o}
54
+ \`\`\``)}return t.join(`
55
+
56
+ `)}function Y4(e){return e.tool.id||`tool-${e.sourceIndex}`}function rF(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?Y4({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const lF=["aria-expanded"],aF={class:"tg-title"},cF={class:"tg-meta"},uF=["inert"],dF={class:"tool-group-body-inner"},fF=je({__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=X(!0),i=B(()=>n.tools.length),r=B(()=>n.tools.some(p=>p.tool.status==="running")?"running":n.tools.some(p=>p.tool.status==="error")?"error":"done"),{t:l}=Tt(),a=B(()=>{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=Vt("pinScroll",()=>{}),d=X(null);function f(){c();const p=d.value;p&&gt(()=>u(p))}return(p,h)=>(_(),I("div",{class:De(["tool-group",{open:s.value}])},[C("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":s.value,onClick:f},[se(Vu,{status:r.value},null,8,["status"]),se(Qe,{class:"tg-ic",name:"list",size:"sm"}),C("span",aF,R(x(l)("tools.group.title",i.value)),1),C("span",cF,"· "+R(a.value),1),se(Qe,{class:"tg-car",name:"chevron-right",size:"sm"})],8,lF),C("div",{class:De(["tool-group-body",{open:s.value}]),inert:!s.value},[C("div",dF,[(_(!0),I(Pe,null,nt(e.tools,(m,w)=>(_(),ke(G4,{key:x(Y4)(m),tool:m.tool,mobile:e.mobile,"stack-position":x(nF)(w,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:h[0]||(h[0]=k=>o("openMedia",k)),onOpenFile:h[1]||(h[1]=k=>o("openFile",k)),onOpenToolDiff:h[2]||(h[2]=k=>o("openToolDiff",k)),onOpenAgent:h[3]||(h[3]=k=>o("openAgent",k))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,uF)],2))}}),hF=ut(fF,[["__scopeId","data-v-37eb334f"]]);var pF=Object.create,$0=Object.defineProperty,mF=Object.getOwnPropertyDescriptor,Q4=Object.getOwnPropertyNames,gF=Object.getPrototypeOf,vF=Object.prototype.hasOwnProperty,X4=(e,t)=>function(){return t||(0,e[Q4(e)[0]])((t={exports:{}}).exports,t),t.exports},Z4=e=>{let t={};for(var n in e)$0(t,n,{get:e[n],enumerable:!0});return t},yF=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=Q4(t),i=0,r=s.length,l;i<r;i++)l=s[i],!vF.call(e,l)&&l!==n&&$0(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=mF(t,l))||o.enumerable});return e},J4=(e,t,n)=>(n=e!=null?pF(gF(e)):{},yF($0(n,"default",{value:e,enumerable:!0}),e));function kF(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 bF(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function _F(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 wF(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
57
+ `:`<hr class="footnotes-sep">
58
+ `)+`<section class="footnotes">
59
+ <ol class="footnotes-list">
60
+ `}function SF(){return`</ol>
61
+ </section>
62
+ `}function CF(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 xF(){return`</li>
63
+ `}function AF(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 MF(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=_F,e.renderer.rules.footnote_block_open=wF,e.renderer.rules.footnote_block_close=SF,e.renderer.rules.footnote_open=CF,e.renderer.rules.footnote_close=xF,e.renderer.rules.footnote_anchor=AF,e.renderer.rules.footnote_caption=bF,e.renderer.rules.footnote_anchor_name=kF;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 p;for(p=d+2;p<f;p++){if(l.src.charCodeAt(p)===32)return!1;if(l.src.charCodeAt(p)===93)break}if(p===d+2||p+1>=f||l.src.charCodeAt(++p)!==58)return!1;if(u)return!0;p++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const h=l.src.slice(d+2,p-2);l.env.footnotes.refs[`:${h}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:h},m.level=l.level++,l.tokens.push(m);const w=l.bMarks[a],k=l.tShift[a],g=l.sCount[a],v=l.parentType,y=p,M=l.sCount[a]+p-(l.bMarks[a]+l.tShift[a]);let O=M;for(;p<f;){const b=l.src.charCodeAt(p);if(n(b))b===9?O+=4-O%4:O++;else break;p++}l.tShift[a]=p-y,l.sCount[a]=O-M,l.bMarks[a]=y,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=v,l.blkIndent-=4,l.tShift[a]=k,l.sCount[a]=g,l.bMarks[a]=w;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 p=l.env.footnotes.list.length,h=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,h);const m=l.push("footnote_ref","",0);m.meta={id:p},l.env.footnotes.list[p]={content:l.src.slice(d,f),tokens:h}}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 p;l.env.footnotes.refs[`:${f}`]<0?(p=l.env.footnotes.list.length,l.env.footnotes.list[p]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=p):p=l.env.footnotes.refs[`:${f}`];const h=l.env.footnotes.list[p].count;l.env.footnotes.list[p].count++;const m=l.push("footnote_ref","",0);m.meta={id:p,subId:h,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(h){return h.type==="footnote_reference_open"?(d=!0,c=[],u=h.meta.label,!1):h.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(h),!d)}),!l.env.footnotes.list))return;const p=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let h=0,m=p.length;h<m;h++){const w=new l.Token("footnote_open","",1);if(w.meta={id:h,label:p[h].label},l.tokens.push(w),p[h].tokens){a=[];const v=new l.Token("paragraph_open","p",1);v.block=!0,a.push(v);const y=new l.Token("inline","",0);y.children=p[h].tokens,y.content=p[h].content,a.push(y);const M=new l.Token("paragraph_close","p",-1);M.block=!0,a.push(M)}else p[h].label&&(a=f[`:${p[h].label}`]);a&&(l.tokens=l.tokens.concat(a));let k;l.tokens[l.tokens.length-1].type==="paragraph_close"?k=l.tokens.pop():k=null;const g=p[h].count>0?p[h].count:1;for(let v=0;v<g;v++){const y=new l.Token("footnote_anchor","",0);y.meta={id:h,subId:v,label:p[h].label},l.tokens.push(y)}k&&l.tokens.push(k),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 TF(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 EF(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 IF=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function $F(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(IF,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function LF(e){e.inline.ruler.after("emphasis","sub",$F)}const NF=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function RF(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(NF,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function OF(e){e.inline.ruler.after("emphasis","sup",RF)}var PF=X4({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,w){w=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},w),m.core.ruler.after("inline","github-task-lists",function(k){for(var g=k.tokens,v=0,y=2;y<g.length;y++)s(g,y)&&(i(g[y],v,w,k.Token),v+=1,n(g[y-2],"class",w.liClass),n(g[o(g,y-2)],"class",w.ulClass))})};function n(m,w,k){var g=m.attrIndex(w),v=[w,k];g<0?m.attrPush(v):m.attrs[g]=v}function o(m,w){for(var k=m[w].level-1,g=w-1;g>=0;g--)if(m[g].level===k)return g;return-1}function s(m,w){return d(m[w])&&f(m[w-1])&&p(m[w-2])&&h(m[w])}function i(m,w,k,g){var v=k.idPrefix+w;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(v,g)),m.children.push(a(g)),m.children.unshift(r(m,v,k,g)),k.divWrap&&(m.children.unshift(c(k,g)),m.children.push(u(g)))}function r(m,w,k,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",w]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),k.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,w){var k=new w("label_open","label",1);return k.attrs=[["for",m]],k}function a(m){return new m("label_close","label",-1)}function c(m,w){var k=new w("checkbox_open","div",0);return k.attrs=[["class",m.divClass]],k}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function p(m){return m.type==="list_item_open"}function h(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),DF=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))),BF=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),hg;const FF=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]]),HF=(hg=String.fromCodePoint)!==null&&hg!==void 0?hg: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 zF(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=FF.get(e))!==null&&t!==void 0?t:e}var Mo;(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"})(Mo||(Mo={}));const WF=32;var Ur;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ur||(Ur={}));function tv(e){return e>=Mo.ZERO&&e<=Mo.NINE}function UF(e){return e>=Mo.UPPER_A&&e<=Mo.UPPER_F||e>=Mo.LOWER_A&&e<=Mo.LOWER_F}function qF(e){return e>=Mo.UPPER_A&&e<=Mo.UPPER_Z||e>=Mo.LOWER_A&&e<=Mo.LOWER_Z||tv(e)}function jF(e){return e===Mo.EQUALS||qF(e)}var Ao;(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"})(Ao||(Ao={}));var zr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(zr||(zr={}));var VF=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Ao.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=zr.Strict}startEntity(e){this.decodeMode=e,this.state=Ao.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Ao.EntityStart:return e.charCodeAt(t)===Mo.NUM?(this.state=Ao.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ao.NamedEntity,this.stateNamedEntity(e,t));case Ao.NumericStart:return this.stateNumericStart(e,t);case Ao.NumericDecimal:return this.stateNumericDecimal(e,t);case Ao.NumericHex:return this.stateNumericHex(e,t);case Ao.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|WF)===Mo.LOWER_X?(this.state=Ao.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ao.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(tv(o)||UF(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(tv(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===Mo.SEMI)this.consumed+=1;else if(this.decodeMode===zr.Strict)return 0;return this.emitCodePoint(zF(this.result),this.consumed),this.errors&&(e!==Mo.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&Ur.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=KF(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===zr.Attribute&&(s===0||jF(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&Ur.VALUE_LENGTH)>>14,s!==0){if(i===Mo.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==zr.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]&Ur.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]&~Ur.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Ao.NamedEntity:return this.result!==0&&(this.decodeMode!==zr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ao.NumericDecimal:return this.emitNumericEntity(0,2);case Ao.NumericHex:return this.emitNumericEntity(0,3);case Ao.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ao.EntityStart:return 0}}};function e3(e){let t="";const n=new VF(e,o=>t+=HF(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 KF(e,t,n,o){const s=(t&Ur.BRANCH_LENGTH)>>7,i=t&Ur.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 GF=e3(DF);e3(BF);function L0(e,t=zr.Legacy){return GF(e,t)}var YF=J4(PF());const e_={};function QF(e){let t=e_[e];if(t)return t;t=e_[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 Sp(e,t){typeof t!="string"&&(t=Sp.defaultChars);const n=QF(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})}Sp.defaultChars=";/?:@&=+$,#";Sp.componentChars="";var nv=Sp;const t_={};function XF(e){let t=t_[e];if(t)return t;t=t_[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 Cp(e,t,n){typeof t!="string"&&(n=t,t=Cp.defaultChars),typeof n>"u"&&(n=!0);const o=XF(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}Cp.defaultChars=";/?:@&=+$,-_.!~*'()#";Cp.componentChars="-_.!~*'()";var t3=Cp;function N0(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 gh(){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 ZF=/^([a-z0-9.+-]+:)/i,JF=/:[0-9]*$/,eH=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,tH=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
64
+ `," "]),nH=["'"].concat(tH),n_=["%","/","?",";","#"].concat(nH),o_=["/","?","#"],oH=255,s_=/^[+a-z0-9A-Z_-]{0,63}$/,sH=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,i_={javascript:!0,"javascript:":!0},r_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function iH(e,t){if(e&&e instanceof gh)return e;const n=new gh;return n.parse(e,t),n}gh.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=eH.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=ZF.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&&i_[r])&&(i=i.substr(2),this.slashes=!0)),!i_[r]&&(s||r&&!r_[r])){let c=-1;for(let h=0;h<o_.length;h++)o=i.indexOf(o_[h]),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 h=0;h<n_.length;h++)o=i.indexOf(n_[h]),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 p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const h=this.hostname.split(/\./);for(let m=0,w=h.length;m<w;m++){const k=h[m];if(k&&!k.match(s_)){let g="";for(let v=0,y=k.length;v<y;v++)k.charCodeAt(v)>127?g+="x":g+=k[v];if(!g.match(s_)){const v=h.slice(0,m),y=h.slice(m+1),M=k.match(sH);M&&(v.push(M[1]),y.unshift(M[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>oH&&(this.hostname=""),p&&(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),r_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};gh.prototype.parseHost=function(e){let t=JF.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 R0=iH,n3=Z4({decode:()=>nv,encode:()=>t3,format:()=>N0,parse:()=>R0}),o3=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,s3=/[\0-\x1F\x7F-\x9F]/,rH=/[\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]/,i3=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,lH=/[\$\+<->\^`\|~\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]/,r3=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,aH=Z4({Any:()=>o3,Cc:()=>s3,Cf:()=>rH,P:()=>i3,S:()=>lH,Z:()=>r3}),cH=Object.defineProperty,l3=e=>{let t={};for(var n in e)cH(t,n,{get:e[n],enumerable:!0});return t},ho=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}`}},uH=l3({arrayReplaceAt:()=>vH,assign:()=>mH,countLines:()=>Jn,escapeHtml:()=>AH,escapeRE:()=>TH,fromCodePoint:()=>Gu,has:()=>pH,isMdAsciiPunct:()=>kh,isPunctChar:()=>yh,isPunctCode:()=>ov,isSpace:()=>gH,isString:()=>fH,isValidEntityCode:()=>Ap,isWhiteSpace:()=>Ku,lib:()=>EH,mdurl:()=>n3,normalizeReference:()=>xp,ucmicro:()=>vh,unescapeAll:()=>Yu,unescapeMd:()=>_H});const vh=aH;function dH(e){return Object.prototype.toString.call(e)}function fH(e){return dH(e)==="[object String]"}const hH=Object.prototype.hasOwnProperty;function pH(e,t){return hH.call(e,t)}function mH(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 gH(e){return e===9||e===32}function Ku(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 yh(e){return vh.P.test(e)||vh.S.test(e)}const l_=new Map;function ov(e){if(kh(e))return!0;const t=l_.get(e);if(t!==void 0)return t;const n=yh(String.fromCharCode(e));return l_.set(e,n),n}function kh(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 xp(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function vH(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Ap(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 Gu(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 a3=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,yH=new RegExp(`${a3.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),kH=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function bH(e,t){if(t.charCodeAt(0)===35&&kH.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Ap(o)?Gu(o):e}const n=L0(e);return n!==e?n:e}function _H(e){return e.includes("\\")?e.replace(a3,"$1"):e}function Yu(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(yH,(t,n,o)=>n||bH(t,o))}const wH=/[&<>"]/,SH=/[&<>"]/g,CH={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function xH(e){return CH[e]}function AH(e){return wH.test(e)?e.replace(SH,xH):e}const MH=/[.?*+^$[\]\\(){}|-]/g;function TH(e){return e.replace(MH,"\\$&")}const EH={mdurl:n3,ucmicro:vh};function Jn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
65
+ `,n+1))!==-1;)t++;return t}const IH=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,$H=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,LH=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,O0=["references","footnotes","abbreviations","abbr","abbrs"],P0=Symbol.for("markdown-it-ts.global-state"),D0=Object.prototype.hasOwnProperty;function a_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function vi(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Gr(e){if(Array.isArray(e))return e.map(t=>Gr(t));if(vi(e)){const t={};for(const n of Object.keys(e))t[n]=Gr(e[n]);return t}return e}function bh(e){return Array.isArray(e)?e.map((t,n)=>String(n)):vi(e)?Object.keys(e):[]}function sv(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(!sv(e[n],t[n]))return!1;return!0}if(vi(e)||vi(t)){if(!vi(e)||!vi(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(!D0.call(t,s)||!sv(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function c3(e,t){if(Array.isArray(e))return e[Number(t)];if(vi(e))return e[t]}function NH(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=Gr(t[n]);return e}if(vi(e)&&vi(t)){for(const n of Object.keys(e))D0.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=Gr(t[n]);return e}return Gr(t)}function RH(e,t,n){const o=n.ownedKeys??[],s=e[t];if(vi(s)||Array.isArray(s)){const i=new Set(bh(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=Gr(c3(n.value,r)):delete s[r];!n.existed&&bh(s).length===0&&delete e[t];return}n.existed?e[t]=Gr(n.value):delete e[t]}function B0(e){const t=e[P0];return a_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&a_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function OH(e,t){Object.defineProperty(e,P0,{value:t,enumerable:!1,configurable:!0,writable:!0})}function gs(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:IH.test(e)?"footnote-definition":$H.test(e)?"abbreviation-definition":LH.test(e)?"reference-definition":null}function dd(e){return B0(e)?.reason??null}function oc(e,t,n){if(dd(e)&&hr(e),!t)return n();F0(e,t);try{const o=n();return H0(e),o}catch(o){throw hr(e),o}}function F0(e,t){try{hr(e);const n={};for(const o of O0)n[o]=D0.call(e,o)?{existed:!0,value:Gr(e[o])}:{existed:!1};OH(e,{reason:t,snapshot:n})}catch{}}function H0(e){const t=B0(e);if(t)for(const n of O0){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!vi(s)&&!Array.isArray(s))continue;const i=new Set(bh(o.existed?o.value:void 0));o.ownedKeys=bh(s).filter(r=>i.has(r)?!sv(s[r],c3(o.value,r)):!0)}}function hr(e){const t=B0(e);if(t){for(const n of O0){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){RH(e,n,o);continue}o.existed?e[n]=NH(e[n],o.value):delete e[n]}delete e[P0]}}const iv=Symbol.for("markdown-it-ts.diagnostics");function Mp(e,t){if(e)try{const n=e[iv];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[iv]=o,o}catch{return}}function Yi(e){return Mp(e,!1)}function PH(e){if(e)try{const t=e[iv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function Zo(e){PH(e)}function uo(e,t){const n=Mp(e,!0);n&&(n.strategy=t)}function pg(e,t){const n=Mp(e,!0);n&&(n.chunk=t)}function u3(e,t){const n=Mp(e,!0);n&&(n.unbounded=t)}function DH(e){const t={};e=e||{},t.src_Any=o3.source,t.src_Cc=s3.source,t.src_Z=r3.source,t.src_P=i3.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 rv(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Tp(e){return Object.prototype.toString.call(e)}function BH(e){return Tp(e)==="[object String]"}function FH(e){return Tp(e)==="[object Object]"}function HH(e){return Tp(e)==="[object RegExp]"}function c_(e){return Tp(e)==="[object Function]"}function zH(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const d3={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function WH(e){return Object.keys(e||{}).reduce(function(t,n){return t||d3.hasOwnProperty(n)},!1)}const UH={"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}}},qH="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]",jH="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function VH(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function u_(){return function(e,t){t.normalize(e)}}function _h(e){const t=e.re=DH(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(qH),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,FH(a)){HH(a.validate)?c.validate=VH(a.validate):c_(a.validate)?c.validate=a.validate:i(l,a),c_(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=u_();return}if(BH(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:u_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(zH).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 f3(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 Ws(e,t){if(!(this instanceof Ws))return new Ws(e,t);t||WH(e)&&(t=e,e={}),this.__opts__=rv({},d3,t),this.__schemas__=rv({},UH,e),this.__compiled__={},this.__tlds__=jH,this.__tlds_replaced__=!1,this.re={},_h(this)}Ws.prototype.add=function(t,n){return this.__schemas__[t]=n,_h(this),this};Ws.prototype.set=function(t){return this.__opts__=rv(this.__opts__,t),this};Ws.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)};Ws.prototype.pretest=function(t){return this.re.pretest.test(t)};Ws.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};Ws.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,p){return f?p?f.index!==p.index?f.index<p.index?f:p:f.lastIndex>=p.lastIndex?f:p:f:p}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]]],p=c(c(f[0],f[1]),f[2]);if(!p)break;if(p===f[0]?u[0]++:p===f[1]?u[1]++:u[2]++,p.index<d)continue;const h=new f3(t,p.schema,p.index,p.lastIndex);this.__compiled__[h.schema].normalize(h,this),n.push(h),d=p.lastIndex}return n.length?n:null};Ws.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 f3(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};Ws.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(),_h(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,_h(this),this)};Ws.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Ws.prototype.onCompile=function(){};var h3=Ws,KH=X4({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,w=Math.floor,k=String.fromCharCode;function g(D){throw new RangeError(h[D])}function v(D,F){const W=[];let K=D.length;for(;K--;)W[K]=F(D[K]);return W}function y(D,F){const W=D.split("@");let K="";W.length>1&&(K=W[0]+"@",D=W[1]),D=D.replace(p,".");const Y=v(D.split("."),F).join(".");return K+Y}function M(D){const F=[];let W=0;const K=D.length;for(;W<K;){const Y=D.charCodeAt(W++);if(Y>=55296&&Y<=56319&&W<K){const q=D.charCodeAt(W++);(q&64512)==56320?F.push(((Y&1023)<<10)+(q&1023)+65536):(F.push(Y),W--)}else F.push(Y)}return F}const O=D=>String.fromCodePoint(...D),L=function(D){return D>=48&&D<58?26+(D-48):D>=65&&D<91?D-65:D>=97&&D<123?D-97:36},b=function(D,F){return D+22+75*(D<26)-((F!=0)<<5)},T=function(D,F,W){let K=0;for(D=W?w(D/700):D>>1,D+=w(D/F);D>m*26>>1;K+=36)D=w(D/m);return w(K+(m+1)*D/(D+38))},$=function(D){const F=[],W=D.length;let K=0,Y=128,q=72,ae=D.lastIndexOf("-");ae<0&&(ae=0);for(let ce=0;ce<ae;++ce)D.charCodeAt(ce)>=128&&g("not-basic"),F.push(D.charCodeAt(ce));for(let ce=ae>0?ae+1:0;ce<W;){const ne=K;for(let ee=1,ye=36;;ye+=36){ce>=W&&g("invalid-input");const xe=L(D.charCodeAt(ce++));xe>=36&&g("invalid-input"),xe>w((2147483647-K)/ee)&&g("overflow"),K+=xe*ee;const Xe=ye<=q?1:ye>=q+26?26:ye-q;if(xe<Xe)break;const me=36-Xe;ee>w(2147483647/me)&&g("overflow"),ee*=me}const Q=F.length+1;q=T(K-ne,Q,ne==0),w(K/Q)>2147483647-Y&&g("overflow"),Y+=w(K/Q),K%=Q,F.splice(K++,0,Y)}return String.fromCodePoint(...F)},N=function(D){const F=[];D=M(D);const W=D.length;let K=128,Y=0,q=72;for(const ne of D)ne<128&&F.push(k(ne));const ae=F.length;let ce=ae;for(ae&&F.push("-");ce<W;){let ne=2147483647;for(const ee of D)ee>=K&&ee<ne&&(ne=ee);const Q=ce+1;ne-K>w((2147483647-Y)/Q)&&g("overflow"),Y+=(ne-K)*Q,K=ne;for(const ee of D)if(ee<K&&++Y>2147483647&&g("overflow"),ee===K){let ye=Y;for(let xe=36;;xe+=36){const Xe=xe<=q?1:xe>=q+26?26:xe-q;if(ye<Xe)break;const me=ye-Xe,G=36-Xe;F.push(k(b(Xe+me%G,0))),ye=w(me/G)}F.push(k(b(ye,0))),q=T(Y,Q,ce===ae),Y=0,++ce}++Y,++K}return F.join("")},P={version:"2.3.1",ucs2:{decode:M,encode:O},decode:$,encode:N,toASCII:function(D){return y(D,function(F){return f.test(F)?"xn--"+N(F):F})},toUnicode:function(D){return y(D,function(F){return d.test(F)?$(F.slice(4).toLowerCase()):F})}};t.exports=P})}),p3=J4(KH());function z0(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=Yu(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=Yu(e.slice(t,s)),i.pos=s,i.ok=!0),i}var m3=z0;const If=-2;function GH(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 If}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return If;if(r===91){s++,i++;continue}i++}return-1}function W0(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=GH(l,t,a,n);if(f!==If)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 p=-1;return s&&(p=e.pos),e.pos=c,p}var wh=W0;function U0(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+=Yu(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+=Yu(e.slice(t,i)),r}var g3=U0;function Ep(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 q0(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function YH(e,t,n){const o=Ep(e,t),s=[t,n];o<0?q0(e,s):e.attrs[o]=s}function QH(e,t){const n=Ep(e,t);return n>=0?e.attrs[n][1]:null}function XH(e,t,n){const o=Ep(e,t);o<0?q0(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var ZH=l3({attrGet:()=>QH,attrIndex:()=>Ep,attrJoin:()=>XH,attrPush:()=>q0,attrSet:()=>YH,parseLinkDestination:()=>z0,parseLinkLabel:()=>W0,parseLinkTitle:()=>U0});function JH(e){return e.includes("\r")||e.includes("\0")}function v3(e){return typeof e=="string"?e:e.toString()}function ez(e){if(e.inlineMode){const t=new ho("inline","",0);t.content=v3(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 tz=/^([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])?)*)$/,nz=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function oz(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(nz.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(tz.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 sz=oz;function iz(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(`
66
+ `)&&(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 rz=iz;function d_(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 p=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+p,i[c]=p,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 lz(e){const t=e.tokens_meta,n=e.tokens_meta.length;d_(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&d_(t[o].delimiters)}var az=lz;function cz(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 f_(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 uz(e){const t=e.tokens_meta,n=e.tokens_meta.length;f_(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&f_(e,t[o].delimiters)}const h_={tokenize:cz,postProcess:uz};function y3(e){return L0(e)}function j0(e){return e>=48&&e<=57}function dz(e){const t=e|32;return j0(e)||t>=97&&t<=102}function k3(e){const t=e|32;return t>=97&&t<=122}function fz(e){return k3(e)||j0(e)}function hz(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?dz(l):j0(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function pz(e,t,n){let o=t+1;if(o>=n||!k3(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&fz(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 y3(s)!==s?s:null}function mz(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=hz(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=Ap(i)?Gu(i):Gu(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=pz(e.src,n,o);if(s){const i=y3(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 gz=mz;const b3=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),lv=new Array(128),_3=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);lv[e]=`\\${t}`,_3[e]=b3[e]?t:lv[e]}function p_(e,t,n){e.pending&&e.pushPending();const o=new ho("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 vz(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):(p_(e,_3[i],lv[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 p_(e,i<256&&b3[i]?r:l,l),e.pos=n+1,!0}var yz=vz;function kz(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 bz=kz;const w3=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,S3="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",_z=new RegExp(`^(?:${w3}|${S3}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),wz=new RegExp(`^(?:${w3}|${S3})`);function C3(e){return e===32||e===9||e===10||e===12||e===13}function Sz(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||C3(t)}function Cz(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(!C3(n))return!1}return!1}function xz(e){const t=e|32;return t>=97&&t<=122}function Az(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&&!xz(i))return!1;const r=s.slice(o).match(_z);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,Sz(l)&&e.linkLevel++,Cz(l)&&e.linkLevel--}return e.pos+=l.length,!0}var Mz=Az;function Tz(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 p=e.pos+2,h=wh(e,e.pos+1,!1);if(h<0)return!1;if(i=h+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=m3(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=g3(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=wh(e,i),i>=0?s=e.src.slice(c,i++):i=h+1):i=h+1,s||(s=e.src.slice(p,h)),r=e.env.references[xp(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(p,h);const m=[];e.md.inline.parse(o,e.md,e.env,m);const w=e.push("image","img",0);w.attrs=[["src",u],["alt",""]],w.children=m,w.content=o,a&&w.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var Ez=Tz;function Iz(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,p=wh(e,e.pos,!0);if(p<0)return!1;let h=p+1;if(h<d&&e.src.charCodeAt(h)===40){for(c=!1,h++;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);if(h>=d)return!1;if(s=m3(e.src,h,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?h=s.pos:r="",a=h;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);if(s=g3(e.src,h,e.posMax),h<d&&a!==h&&s.ok)for(l=s.str,h=s.pos;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);}(h>=d||e.src.charCodeAt(h)!==41)&&(c=!0),h++}if(c){if(typeof e.env.references>"u")return!1;if(h<d&&e.src.charCodeAt(h)===91?(a=h+1,h=wh(e,h),h>=0?o=e.src.slice(a,h++):h=p+1):h=p+1,o||(o=e.src.slice(f,p)),i=e.env.references[xp(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=p;const m=e.push("link_open","a",1),w=[["href",r]];m.attrs=w,l&&w.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=d,!0}var $z=Iz;function x3(e){const t=e|32;return t>=97&&t<=122}function Lz(e){return e>=48&&e<=57}function Nz(e){return x3(e)||Lz(e)||e===43||e===45||e===46}function Rz(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&Nz(e.charCodeAt(t));)t--;return t++,t>=e.length||!x3(e.charCodeAt(t))?null:e.slice(t)}function Oz(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 Pz(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=Rz(e.pending);if(!s)return!1;const i=Oz(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 Dz(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 Bz=Dz;function Fz(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 m_(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 Hz(e){const t=e.delimiters;m_(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&m_(e,n[o].delimiters)}const g_={tokenize:Fz,postProcess:Hz};function v_(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 zz(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||v_(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!v_(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var Wz=zz;function V0(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Uz(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 qz(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 A3(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:V0(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function sc(e,t,n,o,s,i){const r=A3(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=qz(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=V0()}function jz(e){const t=A3(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=Uz(s.samples)}return t.completedAt=V0(),t}var y_=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}},M3=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 ho("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 ho(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 ho(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=Ku(l),u=Ku(a),d=ov(l),f=ov(a),p=!u&&(!f||c||d),h=!c&&(!d||u||f);return{can_open:p&&(t||!h||d),can_close:h&&(t||!p||f),length:r}}};M3.prototype.Token=ho;const Vz=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function T3(e){return!Vz.test(e)}var Kz=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new y_,this.ruler2=new y_,this.ruler.push("text",Wz),this.ruler.push("linkify",Pz),this.ruler.push("newline",Bz),this.ruler.push("escape",yz),this.ruler.push("backticks",rz),this.ruler.push("strikethrough",g_.tokenize),this.ruler.push("emphasis",h_.tokenize),this.ruler.push("link",$z),this.ruler.push("image",Ez),this.ruler.push("autolink",sz),this.ruler.push("html_inline",Mz),this.ruler.push("entity",gz),this.ruler2.push("balance_pairs",az),this.ruler2.push("strikethrough",g_.postProcess),this.ruler2.push("emphasis",h_.postProcess),this.ruler2.push("fragments_join",bz),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(sc(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(sc(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()&&T3(e)){const a=new ho("text","",0);a.content=e,o.push(a);return}const s=new M3(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();sc(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 Gz(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&&T3(i.content)){const r=new ho("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const Yz=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,Qz=/[0-9a-z]/i;function Xz(e){return/^<a[>\s]/i.test(e)}function Zz(e){return/^<\/a\s*>/i.test(e)}function Jz(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(!Yz.test(o)||!Qz.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 eW(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"&&(Xz(l.content)&&i>0&&i--,Zz(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(p=>Jz(e.md.linkify,p));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 p=0;p<c.length;p++){const h=c[p],m=e.md.normalizeLink(h.url);if(!e.md.validateLink(m))continue;let w=h.text;h.schema?h.schema==="mailto:"&&!/^mailto:/i.test(w)?w=e.md.normalizeLinkText(`mailto:${w}`).replace(/^mailto:/,""):w=e.md.normalizeLinkText(w):w=e.md.normalizeLinkText(`http://${w}`).replace(/^http:\/\//,"");const k=h.index;if(k>f){const M=new ho("text","",0);M.content=a.slice(f,k),M.level=d,u.push(M)}const g=new ho("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new ho("text","",0);v.content=w,v.level=d,u.push(v);const y=new ho("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),f=h.lastIndex}if(f!==0){if(f<a.length){const p=new ho("text","",0);p.content=a.slice(f),p.level=d,u.push(p)}s.splice(r,1,...u)}}}}const tW=/\r\n?|\n/g,nW=/\0/g;function oW(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(tW,`
67
+ `)),o&&(s=s.replace(nW,"�")),e.src=s}const E3=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,sW=/\((?:c|tm|r)\)/i,iW=/\((c|tm|r)\)/gi,rW={c:"©",r:"®",tm:"™"};function lW(e,t){return rW[t.toLowerCase()]}function aW(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(iW,lW)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function cW(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&E3.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 uW(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(""):"");sW.test(o)&&aW(n.children||[]),E3.test(o)&&cW(n.children||[])}}var dW=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 fW=/['"]/,k_=/['"]/g,b_="’";function rf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function hW(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;){k_.lastIndex=c;const d=k_.exec(a);if(!d)break;let f=!0,p=!0;c=d.index+1;const h=d[0]==="'";let m=32;if(d.index-1>=0)m=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){m=e[n].content.charCodeAt(e[n].content.length-1);break}let w=32;if(c<u)w=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){w=e[n].content.charCodeAt(0);break}const k=kh(m)||yh(String.fromCharCode(m)),g=kh(w)||yh(String.fromCharCode(w)),v=Ku(m),y=Ku(w);if(y?f=!1:g&&(v||k||(f=!1)),v?p=!1:k&&(y||g||(p=!1)),w===34&&d[0]==='"'&&m>=48&&m<=57&&(p=f=!1),f&&p&&(f=k,p=g),!f&&!p){h&&(r.content=rf(r.content,d.index,b_));continue}if(p)for(n=o.length-1;n>=0;n--){let M=o[n];if(o[n].level<l)break;if(M.single===h&&o[n].level===l){M=o[n];let O,L;h?(O=s[2]||"‘",L=s[3]||"’"):(O=s[0]||"“",L=s[1]||"”"),r.content=rf(r.content,d.index,L),e[M.token].content=rf(e[M.token].content,M.pos,O),c+=L.length-1,M.token===i&&(c+=O.length-1),a=r.content,u=a.length,o.length=n;continue e}}f?o.push({token:i,pos:d.index,single:h,level:l}):p&&h&&(r.content=rf(r.content,d.index,b_))}}}function pW(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("");!fW.test(o)||!n.children||hW(n.children,e)}}function mW(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 gW=/^(?:vbscript|javascript|file|data):/,vW=/^data:image\/(?:gif|png|jpeg|webp);/,I3=["http:","https:","mailto:"];function $3(e){const t=e.trim().toLowerCase();return gW.test(t)?vW.test(t):!0}function L3(e){const t=R0(e,!0);if(t.hostname&&(!t.protocol||I3.includes(t.protocol)))try{t.hostname=p3.default.toASCII(t.hostname)}catch{}return t3(N0(t))}function N3(e){const t=R0(e,!0);if(t.hostname&&(!t.protocol||I3.includes(t.protocol)))try{t.hostname=p3.default.toUnicode(t.hostname)}catch{}return nv(N0(t),`${nv.defaultChars}%`)}function yW(e){switch(e){case 9:case 32:return!0}return!1}function kW(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 p=[],h=[],m=[],w=[],k=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,y;for(y=t;y<n;y++){const T=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(s.charCodeAt(u++)===62&&!T){let N=a[y]+1,S,E;s.charCodeAt(u)===32?(u++,N++,E=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[y]+N)%4===3?(u++,N++,E=!1):E=!0):S=!1;let P=N;for(p.push(i[y]),i[y]=u;u<d;){const D=s.charCodeAt(u);if(yW(D))D===9?P+=4-(P+c[y]+(E?1:0))%4:P++;else break;u++}v=u>=d,h.push(c[y]),c[y]=a[y]+1+(S?1:0),m.push(a[y]),a[y]=P-N,w.push(l[y]),l[y]=u-i[y];continue}if(v)break;let $=!1;for(let N=0,S=k.length;N<S;N++)if(k[N](e,y,n,!0)){$=!0;break}if($){e.lineMax=y,e.blkIndent!==0&&(p.push(i[y]),h.push(c[y]),w.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}p.push(i[y]),h.push(c[y]),w.push(l[y]),m.push(a[y]),a[y]=-1}const M=e.blkIndent;e.blkIndent=0;const O=e.push("blockquote_open","blockquote",1);O.markup=">";const L=[t,0];O.map=L,e.md.block.tokenize(e,t,y);const b=e.push("blockquote_close","blockquote",-1);b.markup=">",e.lineMax=f,e.parentType=g,L[1]=e.line;for(let T=0;T<w.length;T++)i[T+t]=p[T],l[T+t]=w[T],a[T+t]=m[T],c[T+t]=h[T];return e.blkIndent=M,!0}function bW(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)}
68
+ `,i.map=[t,e.line],!0}function _W(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 p=e.push("fence","code",0);return p.info=u,p.content=e.getLines(t+1,d,a,!0),p.markup=c,p.map=[t,e.line],!0}const __=["","h1","h2","h3","h4","h5","h6"],w_=["","#","##","###","####","#####","######"];function S_(e){switch(e){case 9:case 32:return!0}return!1}function wW(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&&!S_(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&S_(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const p=e.push("heading_open",__[d],1);p.markup=w_[d],p.map=[t,e.line];const h=e.push("inline","",0);h.content=s.slice(a,c).trim(),h.map=[t,e.line],h.children=[];const m=e.push("heading_close",__[d],-1);return m.markup=w_[d],!0}function SW(e){switch(e){case 9:case 32:return!0}return!1}function CW(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&&!SW(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 Aa=[[/^<(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(`${wz.source}\\s*$`),/^$/,!1]];function xW(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<Aa.length&&!Aa[l][0].test(r);l++);if(l===Aa.length)return!1;if(o)return Aa[l][2];let a=t+1;if(!Aa[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),Aa[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 C_(e){switch(e){case 9:case 32:return!0}return!1}const vu={Pipe:1,ParagraphTerminator:2};function AW(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 R3=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|=vu.Pipe|vu.ParagraphTerminator),!a)if(C_(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,AW(f)&&(c|=vu.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 ho(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new ho(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 p=o?this.eMarks[u]+1:this.eMarks[u];let h=0;const m=this.src,w=this.bsCount,k=this.tShift;for(;f<p&&h<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?h+=4-(h+w[u])%4:h++;else if(f-d<k[u])h++;else break;f++}return h>n?new Array(h-n+1).join(" ")+m.slice(f,p):m.slice(f,p)}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 p=r[d];let h=p,m;for(d+1<t||o?m=l[d]+1:m=l[d];h<m&&f<n;){const w=i.charCodeAt(h);if(C_(w))w===9?f+=4-(f+a[d])%4:f++;else if(h-p<c[d])f++;else break;h++}f>n?s[u]=new Array(f-n+1).join(" ")+i.slice(h,m):s[u]=i.slice(h,m)}return s.join("")}};R3.prototype.Token=ho;function MW(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function O3(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function P3(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&vu.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:MW(n,o,s)}const x_=["","h1","h2"];function TW(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=O3(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,p,h=t+1;for(;h<n;h++){const y=i[h]+r[h],M=l[h];if(y>=M)break;if(a[h]-c>3)continue;if(a[h]>=c&&(p=s.charCodeAt(y),p===45||p===61)){let L=y+1,b=L;for(;L<M&&s.charCodeAt(L)===p;)L++;for(b=L;L<M;){const T=s.charCodeAt(L);if(T!==9&&T!==32)break;L++}if(L>=M){f=p===61?1:2;break}if(b-y>1)continue}if(a[h]<0||u&&!P3(e,h,s,y,M))continue;let O=!1;for(let L=0,b=o.length;L<b;L++)if(o[L](e,h,n,!0)){O=!0;break}if(O)break}if(!f)return!1;let m;if(h===t+1){const y=i[t]+r[t];let M=l[t];for(;M>y;){const O=s.charCodeAt(M-1);if(O!==9&&O!==32)break;M--}m=s.slice(y,M)}else m=e.getLines(t,h,c,!1).trim();e.line=h+1;const w=p===61?"=":"-",k=e.push("heading_open",x_[f],1);k.markup=w,k.map=[t,e.line];const g=e.push("inline","",0);g.content=m,g.map=[t,e.line-1],g.children=[];const v=e.push("heading_close",x_[f],-1);return v.markup=w,e.parentType=d,!0}function D3(e){switch(e){case 9:case 32:return!0}return!1}function A_(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&&!D3(i.charCodeAt(l))?-1:l}function M_(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),!D3(c))?-1:a}function EW(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 IW=["0","1","2","3","4","5","6","7","8","9"];function $W(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 LW(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 p=e.src,h=e.bMarks,m=e.tShift,w=e.eMarks,k=e.sCount,g=e.bsCount,v=h[l]+m[l];if(v>=w[l])return!1;const y=p.charCodeAt(v);if(y>=48&&y<=57){if(f=M_(e,l),f<0||(u=!0,r=v,d=EW(e,l,f),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(f=A_(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=w[l])return!1;if(o)return!0;const M=p.charCodeAt(f-1),O=String.fromCharCode(M);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=O;let b=!1;const T=e.tokens.length-1,$=e.md.block.ruler.getRulesForState(e,"list"),N=e.parentType;for(e.parentType="list";l<n;){i=f,s=w[l];const S=k[l]+f-(h[l]+m[l]);let E=S;for(;i<s;){const Q=p.charCodeAt(i);if(Q===9)E+=4-(E+g[l])%4;else if(Q===32)E++;else break;i++}const P=i;let D;P>=s?D=1:D=E-S,D>4&&(D=1);const F=S+D,W=e.push("list_item_open","li",1);W.markup=O;const K=[l,0];W.map=K,u&&(W.info=f-r-1===1?IW[p.charCodeAt(r)-48]:p.slice(r,f-1));const Y=e.tight,q=e.tShift[l],ae=e.sCount[l],ce=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=F,e.tight=!0,e.tShift[l]=P-h[l],e.sCount[l]=E,P>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||b)&&(a=!1),b=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ce,e.tShift[l]=q,e.sCount[l]=ae,e.tight=Y,e.push("list_item_close","li",-1).markup=O,l=e.line,K[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let ne=!1;for(let Q=0,ee=$.length;Q<ee;Q++)if($[Q](e,l,n,!0)){ne=!0;break}if(ne)break;if(u){if(f=M_(e,l),f<0)break;r=h[l]+m[l]}else if(f=A_(e,l),f<0)break;if(M!==p.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=O:e.push("bullet_list_close","ul",-1).markup=O,L[1]=l,e.line=l,e.parentType=N,a&&$W(e,T),!0}function T_(e){return e===9||e===32}function NW(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=O3(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 v=r[f]+l[f],y=a[f];if(v<y){const M=i.charCodeAt(v);if(M===42||M===45||M===43){if(v+1>=y||T_(i.charCodeAt(v+1)))break}else if(M>=48&&M<=57&&v+1<y){let O=v+1;for(;;){if(O>=y){O=-1;break}const L=i.charCodeAt(O++);if(L>=48&&L<=57){if(O-v>=10){O=-1;break}continue}if((L===41||L===46)&&(O>=y||T_(i.charCodeAt(O))))break;O=-1;break}if(O>=0)break}}}const w=r[f]+l[f],k=a[f];if(d&&!P3(e,f,i,w,k))continue;let g=!1;for(let v=0,y=o.length;v<y;v++)if(o[v](e,f,n,!0)){g=!0;break}if(g)break}const p=e.getLines(t,f,u,!1).trim();e.line=f;const h=e.push("paragraph_open","p",1);h.map=[t,e.line];const m=e.push("inline","",0);return m.content=p,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function lf(e){switch(e){case 9:case 32:return!0}return!1}function RW(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(v){const y=e.lineMax;if(v>=y||e.isEmpty(v))return null;let M=!1;if(e.sCount[v]-e.blkIndent>3&&(M=!0),e.sCount[v]<0&&(M=!0),!M){const b=e.parentType;e.parentType="reference";let T=!1;for(let $=0,N=l.length;$<N;$++)if(l[$](e,v,y,!0)){T=!0;break}if(e.parentType=b,T)return null}const O=e.bMarks[v]+e.tShift[v],L=e.eMarks[v];return e.src.slice(O,L+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const v=c.charCodeAt(s);if(v===91)return!1;if(v===93){u=s;break}else if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(v===92&&(s++,s<i&&c.charCodeAt(s)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const v=c.charCodeAt(s);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!lf(v))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 p=s,h=r,m=s;for(;s<i;s++){const v=c.charCodeAt(s);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!lf(v))break}let w=e.md.helpers.parseLinkTitle(c,s,i);for(;w.can_continue;){const v=a(r);if(v===null)break;c+=v,s=i,i=c.length,r++,w=e.md.helpers.parseLinkTitle(c,s,i,w)}let k;for(s<i&&m!==s&&w.ok?(k=w.str,s=w.pos):(k="",s=p,r=h);s<i&&lf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&k)for(k="",s=p,r=h;s<i&&lf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const g=xp(c.slice(1,u));return g?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:k,href:f}),e.line=r),!0):!1}function mg(e){switch(e){case 9:case 32:return!0}return!1}const OW=65536;function gg(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function PW(e,t){if(e.lineFlags)return(e.lineFlags[t]&vu.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 E_(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 DW(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&&!mg(l)||r===45&&mg(l)||!PW(e,t))return!1;for(;i<e.eMarks[s];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!mg(y))return!1;i++}let a=gg(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const M=c[y].trim();if(!M){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(M))return!1;M.charCodeAt(M.length-1)===58?u.push(M.charCodeAt(0)===58?"center":"right"):M.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=gg(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=E_(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 p=e.md.block.ruler.getRulesForState(e,"blockquote"),h=e.push("table_open","table",1),m=[t,0];h.map=m;const w=e.push("thead_open","thead",1);w.map=[t,t+1];const k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let y=0;y<c.length;y++){const M=e.push("th_open","th",1);u[y]&&(M.attrs=[["style",`text-align:${u[y]}`]]);const O=e.push("inline","",0);O.content=c[y].trim(),O.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,v=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let y=!1;for(let O=0,L=p.length;O<L;O++)if(p[O](e,s,n,!0)){y=!0;break}if(y||(a=gg(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=E_(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>OW))break;if(s===t+2){const O=e.push("tbody_open","tbody",1);O.map=g=[t+2,0]}const M=e.push("tr_open","tr",1);M.map=[s,s+1];for(let O=0;O<d;O++){const L=e.push("td_open","td",1);u[O]&&(L.attrs=[["style",`text-align:${u[O]}`]]);const b=e.push("inline","",0);b.content=c[O]?c[O].trim():"",b.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=s),e.push("table_close","table",-1),m[1]=s,e.parentType=f,e.line=s,!0}var BW=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 sc(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 af=[["table",DW,["paragraph","reference"]],["code",bW],["fence",_W,["paragraph","reference","blockquote","list"]],["blockquote",kW,["paragraph","reference","blockquote","list"]],["hr",CW,["paragraph","reference","blockquote","list"]],["list",LW,["paragraph","reference","blockquote"]],["reference",RW],["html_block",xW,["paragraph","reference","blockquote"]],["heading",wW,["paragraph","reference","blockquote"]],["lheading",TW],["paragraph",NW]];var FW=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new BW;for(let e=0;e<af.length;e++)this.ruler.push(af[e][0],af[e][1],{alt:(af[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 p=e.line;let h=!1;for(let m=0;m<s;m++)if(h=o[m](e,u,n,!1),h){if(p>=e.line)throw new Error("block rule didn't increment state.line");break}if(!h)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 p=e.line;let h=!1;for(let m=0;m<s;m++){const w=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();h=f[m].fn(e,u,n,!1);const k=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(sc(e.env,"block",f[m].name,k-w,h,!1),h){if(p>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!h)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 R3(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}},B3=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}};B3.prototype.Token=ho;const I_=[["normalize",oW],["block",ez],["inline",Gz],["linkify",eW],["replacements",uW],["smartquotes",pW],["text_join",mW]],HW={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},zW={parseLinkLabel:W0,parseLinkDestination:z0,parseLinkTitle:U0};function WW(){return{...HW}}function UW(){return{...zW}}var qW=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new FW,this.inline=new Kz,this.ruler=new dW;for(let e=0;e<I_.length;e++){const[t,n]=I_[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:WW(),helpers:UW(),normalizeLink:L3,normalizeLinkText:N3,validateLink:$3,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new h3),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 B3(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();sc(e.env,"core",t[n].name,s-o,!0,!1)}jz(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&JH(e))return this.parse(v3(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 jW=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function Sh(e){return!jW.test(e)}function lu(e,t){const n=e.indexOf(`
69
+ `,t);return n===-1?e.length:n}function $f(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 $_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function vg(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function VW(e){if(e.length>3)return Sh(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 KW=["","h1","h2","h3","h4","h5","h6"],GW=["","#","##","###","####","#####","######"],L_=0,yg=1,kg=2;function Rs(e,t,n,o){const s=new ho(e,t,n);return s.level=o,s.block=!0,s}function F3(e,t,n){const o=Rs("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new ho("text","",0);return s.content=e,o.children=[s],o}function YW(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(!Sh(u))return!1;const d=KW[i],f=GW[i],p=Rs("heading_open",d,1,0);p.map=[s,s+1],p.markup=f,e.push(p),e.push(F3(u,s,1));const h=Rs("heading_close",d,-1,0);return h.markup=f,e.push(h),!0}function QW(e,t,n){const o=Rs("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(F3(t,n,1)),e.push(Rs("paragraph_close","p",-1,0))}function XW(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function bg(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function ZW(e,t){const n=Rs("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function JW(e,t,n){const o=Rs("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=Rs("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=Rs("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new ho("text","",0);r.content=t,i.children=[r],e.push(i);const l=Rs("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Rs("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function eU(e){const t=Rs("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function tU(e,t,n,o){if(!$_(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=lu(e,l);if($_(e,l,c)&&$f(e,l+3,c)){const u=Rs("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 nU(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?L_:kg,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=lu(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(!$f(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!YW(t,e,r,a,l))return null;const p=a<e.length?a+1:a;r=bg(e,p),l+=1+r-p;continue}if(c===45){if(!vg(e,r,a))return null;const p=l;let h=r,m=l,w=null,k=null;for(;h<e.length;){const y=lu(e,h);if(!vg(e,h,y))break;const M=h+2,O=y===M+1?e[M]:e.slice(M,y);if(!VW(O))return null;w===null&&(w=ZW(t,p)),k=JW(t,O,m),h=y<e.length?y+1:y,m++}if(w===null||k===null)return null;let g=h,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const y=lu(e,g);if(!$f(e,g,y)){if(vg(e,g,y))return null;break}g=y<e.length?y+1:y,v++}w.map[1]=v,k.map[1]=v,eU(t),r=g,l=v;continue}if(c===96){const p=tU(e,r,a,l);if(!p)return null;t.push(p.token),r=bg(e,p.nextPos),l=p.nextLine+r-p.nextPos;continue}const u=XW(e,r,a);let d;if(n===kg?d=Sh(u):n===yg&&u===o?d=s:(d=Sh(u),n===L_?(i&&(n=u===o?yg:kg),o=u,s=d,i=!0):n===yg&&(o=u,s=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!$f(e,f,lu(e,f)))return null;QW(t,u,l),r=bg(e,f),l+=1+r-f}return t}const oU=/[&<>"]/,N_=/[&<>"]/g,sU=/&/g,iU=/[<>"]/g,rU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function _g(e){return rU[e]||e}function Rn(e){if(e.length===0)return"";if(e.length<32)return oU.test(e)?e.replace(N_,_g):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(sU,"&amp;"):t?e.replace(N_,_g):e.replace(iU,_g)}const lU=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),aU=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function H3(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(lU,(t,n,o)=>{if(n)return n;if(aU.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return Ap(i)?Gu(i):"�"}const s=L0(t);return s!==t?s:t})}const cU=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,uU=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,dU=/"/g;function Ua(e,t){const n=e.indexOf(`
70
+ `,t);return n===-1?e.length:n}function Ch(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 cf(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function fU(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!Ch(e,t,Ua(e,t))}function R_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function hU(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function K0(e){return uU.test(e)?cU.test(e)?null:e.replace(dU,"&quot;"):e}function pU(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=K0(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
71
+ `}function O_(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function mU(e,t){switch(e.charCodeAt(t)){case 34:return`<li>&quot;</li>
72
+ `;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>
73
+ `}function gU(e,t,n){const o=t+2;if(n===o+1)return mU(e,o);const s=K0(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
74
+ `}function vU(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 yU(e,t,n,o){if(!R_(e,t,n))return null;const s=vU(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=Ua(e,l);if(R_(e,l,a)&&Ch(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-${Rn(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${Rn(c)}</code></pre>
75
+ `,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function P_(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=Ua(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!Ch(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=pU(e,t,u);if(m===null)return null;o?s.push(m):n+=m,t=cf(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=Ua(e,m);if(!O_(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const w=e.slice(t,m);let k;if(w===r)k=l;else{let v=t;for(k=`<ul>
76
+ `;v<m;){const y=Ua(e,v),M=gU(e,v,y);if(M===null)return null;k+=M,v=y<e.length?y+1:y}k+=`</ul>
77
+ `,r=w,l=k}let g=cf(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=Ua(e,g);if(!Ch(e,g,v)){if(O_(e,g,v))return null;break}g=v<e.length?v+1:v}o?s.push(k):n+=k,t=g;continue}if(d===96){const m=yU(e,t,u,i);if(!m)return null;o?s.push(m.html):n+=m.html,t=cf(e,m.nextPos);continue}const f=hU(e,t,u);let p;if(f===a)p=c;else{const m=K0(f);if(m===null)return null;p=`<p>${m}</p>
78
+ `,a=f,c=p}const h=u<e.length?u+1:u;if(h<e.length&&e.charCodeAt(h)!==10&&fU(e,h))return null;o?s.push(p):n+=p,t=cf(e,h)}return o?s.join(""):n}const kU={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function xh(e,t,n={},o){Zo(n);const s={...kU,...o||{}},i=gs(t);if(s.fallbackOnGlobalState!==!1&&i)return pg(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),oc(n,i,()=>e.core.parse(t,n,e).tokens);let r=Lf(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=SU(r,s.maxChunks)),Nf(t,r))return pg(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),oc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return pg(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),oc(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&&_U(f,l),wU(a,f),l+=u.lineCount}return a})}function Lf(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 p=e.indexOf(`
79
+ `,f),h=p;p===-1?(p=e.length,h=e.length):h=p+1;const m=CU(e,f,p);if(t.fenceAware){let g=f;for(;g<p;){const y=e.charCodeAt(g);if(y===32||y===9)g++;else break}const v=e[g];if(v==="`"||v==="~"){let y=g;for(;y<p&&e[y]===v;)y++;const M=y-g;M>=3&&(u?u.marker===v&&M>=u.length&&(u=null):u={marker:v,length:M})}}const w=h-f;s+=w,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=w);const k=m;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(k)d(h);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(h)}f=h}return n&&d(e.length),o}function Nf(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!bU(e,t[s].end))return!0;return!1}function bU(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 _U(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 wU(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function SU(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 CU(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 z3=4e6,W3=8e4,xU=1e4,AU=200,MU=1e4,TU=200;function U3(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function EU(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 Er(e){return e.length===0?0:Jn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function IU(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 $U(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
80
+ `,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 LU(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 IU(e,n+1,e.length-1)?!$U(e,t):!1}function NU(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??MU:e.options.fullChunkSizeChars??xU),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??TU:e.options.fullChunkSizeLines??AU);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 fd=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=Er(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=Lf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(Nf(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,Er(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!LU(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Er(this.pending)),null;const n=Lf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Er(this.pending)),null;const o=Nf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Er(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=Lf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=Nf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Er(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:Er(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Er(this.pending);return NU(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(dd(e)&&hr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=gs(t);n&&(F0(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&&EU(r,a),this.options.retainTokens!==!1&&U3(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&&H0(t),n}catch(o){throw this.markedGlobalStateReason&&(hr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){u3(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 RU(e,t,n={},o={}){Zo(n);const s=new fd(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function OU(e,t,n={},o={}){Zo(n);const s=new fd(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function PU(e,t,n,o={},s={}){Zo(o);const i=new fd(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 DU(e,t,n,o={},s={}){Zo(o);const i=new fd(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 q3(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??z3,s=e.options.autoUnboundedThresholdLines??W3;return t>=o||n>=s}function j3(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??z3))return"yes";const o=e.options.autoUnboundedThresholdLines??W3;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function yu(e,t,n={},o={}){Zo(n);const s=gs(t);if(dd(n)&&hr(n),o.fallbackOnGlobalState!==!1&&s)return u3(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:Jn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),oc(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new fd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){U3(i,l)}});if(s&&F0(n,s),r.feed(t),r.flushForce(n),s&&(H0(n),o.fallbackOnGlobalState===!1)){const l=Yi(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const ic=(e,t,n)=>e<t?t:e>n?n:e;function V3(e){return e.experimental?{...e,...e.experimental}:e}const D_=[{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"}],B_=[{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 K3(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function BU(e,t=Math.max(0,e/40|0),n={}){const o=V3(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<D_.length;l++){const a=D_[l];if(e<=a.max){if(a.strategy!=="adaptive")return K3(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:ic(Math.ceil(e/i),8e3,64e3),maxChunkLines:ic(Math.ceil(t/i),150,700),maxChunks:ic(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 F_(e,t=Math.max(0,e/40|0),n={}){const o=V3(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<B_.length;l++){const a=B_[l];if(e<=a.max){if(a.strategy!=="adaptive")return K3(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:ic(Math.ceil(e/i),8e3,64e3),maxChunkLines:ic(Math.ceil(t/i),150,700),maxChunks:ic(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 FU={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"]}}},HU={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zU={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 Ip(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Rf(e,t){if(Ip(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const H_=e=>Ip(e)?e:Promise.resolve(e);function ku(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 Rn(e)}}function tl(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${ku(t[0])}="${Rn(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${ku(s[0])}="${Rn(s[1])}"`}return n}function G3(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 bu(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
81
+ `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Rn(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
82
+ `;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${tl(r)}>${t}</code></pre>
83
+ `}return`<pre><code${tl(e.attrs)}>${t}</code></pre>
84
+ `}function Ah(e){return!e.attrs||e.attrs.length===0?`<code>${Rn(e.content)}</code>`:`<code${tl(e.attrs)}>${Rn(e.content)}</code>`}function av(e){const t=Rn(e.content);return e.attrs?`<pre${tl(e.attrs)}><code>${t}</code></pre>
85
+ `:`<pre><code>${t}</code></pre>
86
+ `}function WU(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="${Rn(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${Rn(n[0][1])}">`}return null}function z_(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${ku(t[0][0])}="${Rn(t[0][1])}">`:t.length===2?`<a ${ku(t[0][0])}="${Rn(t[0][1])}" ${ku(t[1][0])}="${Rn(t[1][1])}">`:`<a${tl(t)}>`}function UU(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 W_(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 Mh(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+tl(n);return o===0&&t&&(i+=" /"),`${i}>`}const qU={langPrefix:"language-",xhtmlOut:!1,breaks:!1},uf=Object.prototype.hasOwnProperty,$n={code_inline(e,t){return Ah(e[t])},code_block(e,t){return av(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?H3(i.info).trim():"",{langName:l,langAttrs:a}=G3(r),c=n.highlight,u=Rn(i.content);if(!c)return bu(i,u,r,l,n);const d=c(i.content,l,a);return Ip(d)?d.then(f=>bu(i,f||u,r,l,n)):bu(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]],Mh(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
87
+ `:`<br>
88
+ `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
89
+ `:`<br>
90
+ `:`
91
+ `},text(e,t){return Rn(e[t].content)},text_special(e,t){return Rn(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function U_(e,t,n){const o=e.info?H3(e.info).trim():"",{langName:s,langAttrs:i}=G3(o),r=t.highlight,l=Rn(e.content);if(!r)return bu(e,l,o,s,t);const a=r(e.content,s,i);if(Ip(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return bu(e,a||l,o,s,t)}function df(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===$n.text)return l.content.length===0?"":Rn(l.content);break;case"text_special":if(s.text_special===$n.text_special)return l.content.length===0?"":Rn(l.content);break;case"softbreak":if(s.softbreak===$n.softbreak)return r;break;case"hardbreak":if(s.hardbreak===$n.hardbreak)return i;break;case"html_inline":if(s.html_inline===$n.html_inline)return l.content;break;case"code_inline":if(s.code_inline===$n.code_inline)return Ah(l);break}const a=s[l.type];if(!a)return Mh(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:Rf(c,l.type)}var jU=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...$n}}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,p="",h="",m=!1,w="";for(let k=0;k<e.length;k++){const g=e[k],v=g.type,y=k>0&&e[k-1].hidden?`
92
+ `:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&k+3<e.length){const L=e[k+1],b=e[k+2],T=e[k+3];if(L.type==="paragraph_open"&&L.hidden&&b.type==="inline"&&T.type==="paragraph_close"&&T.hidden){w+=`${y}<li>${this.renderInlineTokens(b.children||[],o,s)}`,k+=3;continue}}if(k+2<e.length){const L=e[k+1],b=e[k+2];if(L.type==="inline"&&b.nesting===-1&&b.tag===g.tag&&!b.hidden){const T=WU(g,y);if(T!==null){w+=`${T+this.renderInlineTokens(L.children||[],o,s)}</${g.tag}>
93
+ `,k+=2;continue}}}if(v==="inline"){const L=g.children||[];if(L.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,p=o.xhtmlOut?`<br />
94
+ `:`<br>
95
+ `,h=o.breaks?p:`
96
+ `,m=!0);const b=L[0];switch(b.type){case"text":if(l===$n.text){w+=Rn(b.content);continue}break;case"text_special":if(a===$n.text_special){w+=Rn(b.content);continue}break;case"softbreak":if(c===$n.softbreak){w+=h;continue}break;case"hardbreak":if(u===$n.hardbreak){w+=p;continue}break;case"html_inline":if(d===$n.html_inline){w+=b.content;continue}break;case"code_inline":if(f===$n.code_inline){w+=Ah(b);continue}break}}w+=this.renderInlineTokens(L,o,s);continue}const M=i[v];if(!M){const L=g.attrs;if(!g.hidden){if(!L||L.length===0)switch(v){case"hr":w+=r?`<hr />
97
+ `:`<hr>
98
+ `;continue;case"heading_open":w+=`<${g.tag}>`;continue;case"heading_close":w+=`</${g.tag}>
99
+ `;continue;case"paragraph_open":w+=`${y}<p>`;continue;case"paragraph_close":w+=`</p>
100
+ `;continue;case"list_item_open":{const b=e[k+1];w+=y+(b&&(b.type==="inline"||b.hidden||b.nesting===-1&&b.tag==="li")?"<li>":`<li>
101
+ `);continue}case"list_item_close":w+=`</li>
102
+ `;continue;case"bullet_list_open":w+=`${y}<ul>
103
+ `;continue;case"bullet_list_close":w+=`</ul>
104
+ `;continue;case"blockquote_open":w+=y+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"<blockquote>":`<blockquote>
105
+ `);continue;case"blockquote_close":w+=`</blockquote>
106
+ `;continue;case"ordered_list_open":w+=`${y}<ol>
107
+ `;continue;case"ordered_list_close":w+=`</ol>
108
+ `;continue;case"table_open":w+=`${y}<table>
109
+ `;continue;case"table_close":w+=`</table>
110
+ `;continue;case"thead_open":w+=`${y}<thead>
111
+ `;continue;case"thead_close":w+=`</thead>
112
+ `;continue;case"tbody_open":w+=`${y}<tbody>
113
+ `;continue;case"tbody_close":w+=`</tbody>
114
+ `;continue;case"tr_open":w+=`${y}<tr>
115
+ `;continue;case"tr_close":w+=`</tr>
116
+ `;continue;case"td_open":w+=`${y}<td>`;continue;case"td_close":w+=`</td>
117
+ `;continue;case"th_open":w+=`${y}<th>`;continue;case"th_close":w+=`</th>
118
+ `;continue}else if(L.length===1){const b=L[0];if(v==="ordered_list_open"&&b[0]==="start"){w+=`${y}<ol start="${Rn(b[1])}">
119
+ `;continue}if(v==="td_open"&&b[0]==="style"){w+=`${y}<td style="${Rn(b[1])}">`;continue}if(v==="th_open"&&b[0]==="style"){w+=`${y}<th style="${Rn(b[1])}">`;continue}}}w+=this.renderToken(e,k,o);continue}if(v==="code_block"&&M===$n.code_block){w+=av(g);continue}if(v==="fence"&&M===$n.fence){w+=U_(g,o);continue}if(v==="html_block"&&M===$n.html_block){w+=g.content;continue}const O=M(e,k,o,s,this);typeof O=="string"?w+=O:w+=Rf(O,g.type)}return w}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 H_(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 tl(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?`
120
+ `:"",u=a?`>
121
+ `:">";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+tl(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(uf.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),uf.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(uf.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(uf.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...qU,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===$n.code_block)return av(t);if(i==="html_block"&&s.html_block===$n.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):Mh(t,r.xhtmlOut===!0);if(i==="fence"&&a===$n.fence)return U_(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Rf(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,p=o.em_close,h=o.strong_open,m=o.strong_close,w=t.xhtmlOut===!0,k=w?`<br />
122
+ `:`<br>
123
+ `,g=t.breaks?k:`
124
+ `;if(e.length===1)return df(e,t,n,this,o,k,g);let v="";for(let y=0;y<e.length;y++){const M=e[y];if(M.type==="link_open"&&!u&&!d&&y+2<e.length){const b=e[y+1];if(e[y+2].type==="link_close"&&UU(b)){const T=`${z_(M)+df([b],t,n,this,o,k,g)}</a>`;if(r===$n.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=T+g,y+=3;continue}v+=T,y+=2;continue}}if(M.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${z_(M)}</a>`,y+=1;continue}if(M.type==="em_open"&&!f&&!p&&y+2<e.length){const b=e[y+1];if(e[y+2].type==="em_close"&&W_(b)){v+=`<em>${df([b],t,n,this,o,k,g)}</em>`,y+=2;continue}}if(M.type==="strong_open"&&!h&&!m&&y+2<e.length){const b=e[y+1];if(e[y+2].type==="strong_close"&&W_(b)){v+=`<strong>${df([b],t,n,this,o,k,g)}</strong>`,y+=2;continue}}switch(M.type){case"text":if(s===$n.text){const b=M.content.length===0?"":Rn(M.content);if(a===$n.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(v+=b+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}v+=b;continue}break;case"text_special":if(i===$n.text_special){M.content.length!==0&&(v+=Rn(M.content));continue}break;case"softbreak":if(r===$n.softbreak){v+=g;continue}break;case"hardbreak":if(l===$n.hardbreak){v+=k;continue}break;case"html_inline":if(a===$n.html_inline){for(v+=M.content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}break;case"code_inline":if(c===$n.code_inline){v+=Ah(M);continue}break}const O=o[M.type];if(!O){v+=M.block?this.renderToken(e,y,t):Mh(M,w);continue}const L=O(e,y,t,n,this);typeof L=="string"?v+=L:v+=Rf(L,M.type)}return v}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 H_(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+=`
125
+ `;break}}return o}},VU=jU;const KU=[],wg=4096;function GU(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
126
+ `,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 YU(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 QU(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(!Y3(e[n],t[n]))return!1;return!0}function Y3(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||!YU(e.attrs,t.attrs)||!QU(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function q_(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var XU=class{core;cache=null;stats=q_();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=q_(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(Zo(o??s?.env),!s||o&&o!==s.env){const E=o??{},P=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,F=!!n.options?.streamChunkedFallback,W=!P&&D,K=F||W,Y=n.options?.streamChunkAdaptive!==!1,q=n.options?.streamChunkTargetChunks??8,ae=n.options?.streamChunkSizeChars,ce=n.options?.streamChunkSizeLines,ne=n.options?.streamChunkMaxChunks,Q=!!n.__explicitStreamChunkConfig,ee=n.options?.autoTuneChunks!==!1,ye=n.options?.streamChunkFenceAware??!0,xe=n.options?.streamLargeCachePolicy??"retain",Xe=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,me=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let G,ie=!1;if(xe==="skip"&&(ie=e.length>=Xe,!ie&&me!==void 0&&(G=Jn(e),ie=G>=me)),ie){const z=this.parseFullDocument(e,E,n,G,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",uo(E,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Yi(E)?.unbounded}),z.tokens}else if(K){const z=(fe,be,Ee)=>fe<be?be:fe>Ee?Ee:fe;G===void 0&&(G=Jn(e));const Z=ee&&!Q?F_(e.length,G,n.options):null,pe=Z?.maxChunkChars??(Y?z(Math.ceil(e.length/q),8e3,64e3):ae??1e4),le=Z?.maxChunkLines??(Y?z(Math.ceil(G/q),150,700):ce??200),he=Z?.maxChunks??(Y?z(Math.ceil(e.length/64e3),q,32):ne),U=e.length>0&&e.charCodeAt(e.length-1)===10,J=W&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Z?.strategy!=="plain";if((F||J)&&(e.length>=pe*2||G>=le*2)&&U){const fe=xh(n,e,E,{maxChunkChars:pe,maxChunkLines:le,fenceAware:Z?.fenceAware??ye,maxChunks:he});return this.cache={src:e,tokens:fe,env:E,lineCount:G,lastSegment:void 0,globalStateReason:gs(e)},this.updateCacheLineCount(this.cache,G),this.recordChunkedParseResult(E,F?"explicit-initial-large-doc":"default-initial-large-doc"),fe}}const de=this.parseFullDocument(e,E,n,G);return G=de.lineCount,this.cache={src:e,tokens:de.tokens,env:E,lineCount:G,lastSegment:void 0,globalStateReason:gs(e)},this.updateCacheLineCount(this.cache,G),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",uo(E,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Yi(E)?.unbounded}),de.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",uo(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=gs(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):gs(e),a=r||l;if(a){const E=o??s.env;hr(E);const P=gs(e),D=this.parseFullDocument(e,E,n),F=D.tokens,W=D.lineCount;return this.cache={src:e,tokens:F,env:E,lineCount:W,lastSegment:void 0,globalStateReason:P},this.updateCacheLineCount(this.cache,W),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",uo(E,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Yi(E)?.unbounded}),F}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 E=o??s.env,P=this.parseFullDocument(e,E,n),D=P.tokens,F=P.lineCount;return this.cache={src:e,tokens:D,env:E,lineCount:F,lastSegment:void 0,globalStateReason:gs(e)},this.updateCacheLineCount(this.cache,F),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",uo(E,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!Yi(E)?.unbounded}),D}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const E=s.lineCount??Jn(s.src);let P=3;u.length>5e3?P=8:u.length>1e3?P=6:u.length>200&&(P=4),P=Math.min(P,E);let D=null;const F=n.options?.streamContextParseStrategy??"chars",W=n.options?.streamContextParseMinChars??200,K=n.options?.streamContextParseMinLines??2;let Y;const q=()=>(Y===void 0&&(Y=Jn(u)),Y),ae=this.canDirectlyParseAppend(s),ce=ae&&this.shouldUseUnboundedAppend(e,s,u);let ne=!1;if(!ae)switch(F){case"lines":ne=q()>=K;break;case"constructs":if(u.length>=W){ne=!0;break}if(GU(u)){ne=!0;break}ne=q()>=K;break;case"chars":default:ne=u.length>=W}if(P>0&&ne){const ye=this.getTailLines(s.src,P)+u;try{const xe=this.core.parse(ye,s.env,n).tokens,Xe=xe.findIndex(me=>me.map&&typeof me.map[1]=="number"&&me.map[1]>P);if(Xe!==-1){const me=xe.slice(Xe),G=E-P;G!==0&&this.shiftTokenLines(me,G),D={tokens:me}}}catch{D=null}}else D=null;if(!D){const ye=E;if(ce)D={tokens:yu(n,u,s.env,{mode:"stream"})},ye>0&&this.shiftTokenLines(D.tokens,ye);else{const xe=this.core.parse(u,s.env,n);ye>0&&this.shiftTokenLines(xe.tokens,ye),D=xe}}let Q=0;if(s.tokens.length>0&&D.tokens.length>0){const ye=s.tokens[s.tokens.length-1],xe=D.tokens[0];try{ye.type==="inline"&&xe.type==="inline"&&(xe.children&&xe.children.length>0&&(ye.children||(ye.children=[]),this.appendTokens(ye.children,xe.children)),ye.content=(ye.content||"")+(xe.content||""),Q=1)}catch{Q=0}}const ee=s.tokens.length;if(D.tokens.length>Q){const ye=s.tokens,xe=D.tokens,Xe=Math.min(ye.length,xe.length-Q);let me=0;for(let G=Xe;G>0;G--){let ie=!0;for(let de=0;de<G;de++){const z=ye[ye.length-G+de],Z=xe[Q+de];if(!Y3(z,Z)){ie=!1;break}}if(ie){me=G;break}}me>0&&(Q+=me),xe.length>Q&&this.appendTokens(s.tokens,xe,Q)}if(s.src=e,s.globalStateReason=null,s.lineCount=E+(Y??q()),s.tokens.length>ee){const ye=this.getLastSegment(s.tokens,e,ee,s.tokens.length,e.length-u.length,E);ye?s.lastSegment=ye:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ce&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",uo(s.env,{area:"stream",path:ce?"stream-unbounded-append":"stream-append",reason:ce?"large-delta":"safe-append",unbounded:ce}),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",uo(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const p=!!n.__explicitStreamChunkFallbackSetting,h=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,w=!p&&!u&&h,k=m||w,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,M=n.options?.streamChunkSizeLines,O=n.options?.streamChunkMaxChunks,L=!!n.__explicitStreamChunkConfig,b=n.options?.autoTuneChunks!==!1,T=n.options?.streamChunkFenceAware??!0;let $=u&&s.lineCount!==void 0?s.lineCount+Jn(u):void 0;if(k){$===void 0&&($=Jn(e));const E=(q,ae,ce)=>q<ae?ae:q>ce?ce:q,P=b&&!L?F_(e.length,$,n.options):null,D=P?.maxChunkChars??(g?E(Math.ceil(e.length/v),8e3,64e3):y??1e4),F=P?.maxChunkLines??(g?E(Math.ceil($/v),150,700):M??200),W=P?.maxChunks??(g?E(Math.ceil(e.length/64e3),v,32):O),K=e.length>0&&e.charCodeAt(e.length-1)===10,Y=w&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&P?.strategy!=="plain";if((m||Y)&&(e.length>=D*2||$>=F*2)&&K){const q=xh(n,e,d,{maxChunkChars:D,maxChunkLines:F,fenceAware:P?.fenceAware??T,maxChunks:W});return this.cache={src:e,tokens:q,env:d,lineCount:$,lastSegment:void 0,globalStateReason:gs(e)},this.updateCacheLineCount(this.cache,$),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),q}}const N=this.parseFullDocument(e,d,n,$),S=N.tokens;return $=N.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:$,lastSegment:void 0,globalStateReason:gs(e)},this.updateCacheLineCount(this.cache,$),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",uo(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Yi(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=Yi(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",uo(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!Yi(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",uo(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=gs(e);dd(t)&&hr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?j3(n,e.length,o):"no";if(r==="yes"){const a=yu(n,e,t);return uo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?Jn(e):0)}}let l=o;if(r==="need-lines"&&(l=Jn(e),q3(n,e.length,l))){const a=yu(n,e,t);return uo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?Jn(e):0),{tokens:oc(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:Jn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
127
+ `))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(`
128
+ `);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+Jn(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(`
129
+ `,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??KU}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??Jn(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(-wg))+t,o=gs(n);return e.globalStateCarry=n.length>wg?n.slice(n.length-wg):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(`
130
+ `,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(`
131
+ `,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??Jn(t.src);f>0&&this.shiftTokenLines(d,f);const p=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),h=this.getListParagraphMode(u,0,u.length,0);(p==="loose"||h==="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 m=f+Jn(i);t.lineCount=m;const w=this.getDocLineCount(e,m);return r.map&&(r.map[1]=w),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:w,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),p=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!f||!p||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const h=p.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(h.length===0)return null;const m=s.lineEnd-2;m!==0&&this.shiftTokenLines(h,m);const w=p.tbodyCloseIndex>=0?p.tbodyCloseIndex:p.tableCloseIndex,k=t.lineCount??Jn(t.src);t.tokens.splice(w,0,...h),t.src=e,t.env=n,t.globalStateReason=null;const g=k+Jn(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),p.tbodyOpenIndex>=0){const y=t.tokens[p.tbodyOpenIndex];y?.map&&(y.map[1]=v)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:v,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
132
+ `);if(t<0)return null;const n=e.indexOf(`
133
+ `,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=Jn(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 j_={default:HU,zero:zU,commonmark:FU};function ZU(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function JU(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 V_(e){return e.experimental?{...e,...e.experimental}:e}function Xs(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 K_(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(Xs(t,s)||Xs(e,s))return!0}return!1}function G_(e,t,n){return Xs(t,n)||Xs(e,n)}function Y_(e,t){const n=Yi(e)?.chunk;if(n?.fallback){uo(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}uo(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function eq(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=j_[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=V_(n),typeof n.quotes=="string"){const b=n.quotes;b.length>=4?n.quotes=[b[0],b[1],b[2],b[3]]:n.quotes=["“","”","‘","’"]}let r=K_(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=K_(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=G_(i?.options,s,"fullChunkedFallback"),c=G_(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const p=new qW;let h=null;const m=()=>(h||(h=new VU(n)),h);let w=null;const k=()=>(w||(w=new XU(p)),w);let g=null;const v=()=>(g||(g=new h3),g),y=b=>!u&&!!d&&!JU(b,d),M=(b,T)=>o==="default"&&!u&&h===null&&f!==null&&b.parse===f&&y(b)&&!b.stream.enabled&&T<(b.options.autoUnboundedThresholdChars??4e6)&&b.options.html===!1&&b.options.xhtmlOut===!1&&b.options.breaks===!1&&b.options.langPrefix==="language-"&&b.options.linkify===!1&&b.options.typographer===!1&&b.options.highlight===null,O=(b,T)=>o==="default"&&!u&&y(b)&&!b.stream.enabled&&!b.options.fullChunkedFallback&&T<(b.options.autoUnboundedThresholdChars??4e6)&&b.options.html===!1&&b.options.linkify===!1&&b.options.typographer===!1,L={core:p,block:p.block,inline:p.inline,get linkify(){const b=v();return Object.defineProperty(this,"linkify",{value:b,writable:!0,configurable:!0}),b},get renderer(){const b=m();return Object.defineProperty(this,"renderer",{value:b,writable:!0,configurable:!0}),b},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return y(this)},set(b){const T=V_(b);return this.options={...this.options,...T},(Xs(b,"fullChunkSizeChars")||Xs(b,"fullChunkSizeLines")||Xs(b,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Xs(b,"streamChunkSizeChars")||Xs(b,"streamChunkSizeLines")||Xs(b,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Xs(b,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Xs(b,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),h&&h.set(T),typeof T.stream=="boolean"&&(this.stream.enabled=T.stream,w&&(w.reset(),w.resetStats())),this},configure(b){const T=typeof b=="string"?j_[b]:b;if(!T)throw new Error("Wrong `markdown-it` preset, can't be empty");if(T.options&&this.set(T.options),T.components){const $=T.components;$.core?.rules&&this.core.ruler.enableOnly($.core.rules),$.block?.rules&&this.block.ruler.enableOnly($.block.rules),$.inline?.rules&&this.inline.ruler.enableOnly($.inline.rules),$.inline2?.rules&&this.inline.ruler2.enableOnly($.inline2.rules)}return this},enable(b,T){const $=Array.isArray(b)?b:[b],N=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const E of N){if(!E)continue;const P=E.enable($,!0);for(let D=0;D<P.length;D++)S.add(P[D])}if(!T){const E=$.filter(P=>!S.has(P));if(E.length)throw new Error(`Rules manager: invalid rule name ${E.join(", ")}`)}return this},disable(b,T){const $=Array.isArray(b)?b:[b],N=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const E of N){if(!E)continue;const P=E.disable($,!0);for(let D=0;D<P.length;D++)S.add(P[D])}if(!T){const E=$.filter(P=>!S.has(P));if(E.length)throw new Error(`Rules manager: invalid rule name ${E.join(", ")}`)}return this},use(b,...T){const $=typeof b=="function"?b:b&&typeof b.default=="function"?b.default:void 0;if(!$)throw new TypeError("MarkdownIt.use: plugin must be a function");const N=[this,...T],S=b;return u=!0,$.apply(S,N),this},render(b,T){if(M(this,b.length)){T!==void 0&&Zo(T);const S=P_(b);if(S!==null)return T!==void 0&&uo(T,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const $=T??{},N=this.parse(b,$);return m().render(N,this.options,$)},async renderAsync(b,T){if(M(this,b.length)){T!==void 0&&Zo(T);const S=P_(b);if(S!==null)return T!==void 0&&uo(T,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const $=T??{},N=this.parse(b,$);return m().renderAsync(N,this.options,$)},renderIterable(b,T={}){const $=this.parseIterable(b,T);return m().render($,this.options,T)},async renderAsyncIterable(b,T={}){const $=await this.parseAsyncIterable(b,T);return m().renderAsync($,this.options,T)},renderInline(b,T={}){const $=this.parseInline(b,T);return m().render($,this.options,T)},validateLink:$3,normalizeLink:L3,normalizeLinkText:N3,utils:uH,helpers:{...ZH},parse(b,T){if(typeof b!="string")throw new TypeError("Input data should be a String");if(T!==void 0&&Zo(T),O(this,b.length)){const E=nU(b);if(E!==null)return T!==void 0&&uo(T,{area:"parse",path:"stock-fast",reason:"stock-subset"}),E}const $=T??{};let N;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const E=j3(this,b.length);if(E==="yes"){const P=yu(this,b,$);return uo(T,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),P}E==="need-lines"&&(N=Jn(b))}if(!this.stream.enabled){const E=b.length,P=this.options.autoTuneChunks!==!1,D=r,F=!a&&y(this),W=!!this.options.fullChunkedFallback,K=F&&E>=2e5;let Y;(W||K||N!==void 0)&&(Y=N??Jn(b));const q=(W||K)&&P&&!D?BU(E,Y,this.options):null;if(W||K){const ae=Y??0;if(W?E>=(this.options.fullChunkThresholdChars??2e4)||ae>=(this.options.fullChunkThresholdLines??400):K){if(q&&q.strategy!=="plain"){const ce=xh(this,b,$,{maxChunkChars:q.maxChunkChars,maxChunkLines:q.maxChunkLines,fenceAware:q.fenceAware,maxChunks:q.maxChunks});return T&&Y_(T,W?"explicit-full-chunk":"default-large-string"),ce}if(W){const ce=(ie,de,z)=>ie<de?de:ie>z?z:ie,ne=this.options.fullChunkAdaptive!==!1,Q=this.options.fullChunkTargetChunks??8,ee=ce(Math.ceil(E/Q),8e3,64e3),ye=ce(Math.ceil(ae/Q),150,700),xe=ne?ee:this.options.fullChunkSizeChars??1e4,Xe=ne?ye:this.options.fullChunkSizeLines??200,me=ne?ce(Math.ceil(E/64e3),Q,32):this.options.fullChunkMaxChunks,G=xh(this,b,$,{maxChunkChars:xe,maxChunkLines:Xe,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:me});return T&&Y_(T,"explicit-full-chunk"),G}}}if(N!==void 0&&y(this)&&q3(this,E,Y??N)){const ae=yu(this,b,$);return uo(T,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),ae}}const S=gs(b);return uo(T,{area:"parse",path:"plain",reason:"default-plain"}),oc($,S,()=>p.parse(b,$,this).tokens)},parseIterable(b,T={}){return Zo(T),RU(this,b,T)},parseAsyncIterable(b,T={}){return Zo(T),OU(this,b,T)},parseIterableToSink(b,T,$={}){return Zo($),PU(this,b,T,$)},parseAsyncIterableToSink(b,T,$={}){return Zo($),DU(this,b,T,$)},parseInline(b,T={}){if(typeof b!="string")throw new TypeError("Input data should be a String");Zo(T),dd(T)&&hr(T);const $=p.createState(b,T,this);return $.inlineMode=!0,p.process($),$.tokens}};if(L.stream={enabled:!!n.stream,parse(b,T){return L.stream.enabled?k().parse(b,T,L):L.parse(b,T??{})},reset(){k().reset()},peek(){return w?w.peek():[]},stats(){return w?w.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){w&&w.resetStats()}},i?.components){const b=i.components;b.core?.rules&&L.core.ruler.enableOnly(b.core.rules),b.block?.rules&&L.block.ruler.enableOnly(b.block.rules),b.inline?.rules&&L.inline.ruler.enableOnly(b.inline.rules),b.inline2?.rules&&L.inline.ruler2.enableOnly(b.inline2.rules)}return d=ZU(L),f=L.parse,L}var tq=eq;const Q3=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],nq=["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"],X3=["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"],oq=["svg","g","path"],sq=["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"],iq=["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"],rq=["action","data","href","src","srcset","poster","xlink:href","formaction"],lq=["script"],aq=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],sa=new Set(Q3),cq=new Set(X3),Qu=new Set([...Q3,...nq,...X3,...oq]),Z3=new Set([...Qu,...sq]),uq=new Set(iq),dq=new Set(rq),hd=new Set(lq),J3=new Set(aq);function eA(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 fq={amp:"&",bsol:"\\",colon:":",newline:`
134
+ `,sol:"/",tab:" "};function tA(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 fq[String(s??"").toLowerCase()]??t})}const ff=new Set(["http","https","mailto","tel"]),hq=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Al=new Set(["http","https"]);function nA(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function pq(e,t,n){if(!_u(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function _u(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function mq(e,t){return t==="href"||t==="xlink:href"?_u(e,t)?ff:Al:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Al:(_u(e,t),ff)}function ql(e,t={}){const n=eA(tA(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=nA(n);return i?i==="file"?!pq(n,o,s):_u(o,s)?hq.has(i):!mq(o,s).has(i):!1}function gq(e){const t=tA(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=nA(eA(t).toLowerCase());return n==="http"||n==="https"}function vq(e,t={}){const n=String(e??"").trim();return n?ql(n,t)?"":n:""}function Q_(e){return vq(e,{tagName:"img",attrName:"src"})}function yq(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,p,h,m,w){return f[p].nesting===1&&f[p].attrJoin("class",t),w.renderToken(f,p,h,m,w)}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,p,h,m){let w,k=!1,g=f.bMarks[p]+f.tShift[p],v=f.eMarks[p];if(l!==f.src.charCodeAt(g))return!1;for(w=g+1;w<=v&&r[(w-g)%a]===f.src[w];w++);const y=Math.floor((w-g)/a);if(y<i)return!1;w-=(w-g)%a;const M=f.src.slice(g,w),O=f.src.slice(w,v);if(!c(O,M))return!1;if(m)return!0;let L=p;for(;L++,!(L>=h||(g=f.bMarks[L]+f.tShift[L],v=f.eMarks[L],g<v&&f.sCount[L]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[L]-f.blkIndent>=4)){for(w=g+1;w<=v&&r[(w-g)%a]===f.src[w];w++);if(!(Math.floor((w-g)/a)<y)&&(w-=(w-g)%a,w=f.skipSpaces(w),!(w<v))){k=!0;break}}const b=f.parentType,T=f.lineMax;f.parentType="container",f.lineMax=L;const $=f.push("container_"+t+"_open","div",1);$.markup=M,$.block=!0,$.info=O,$.map=[p,L],f.md.block.tokenize(f,p+1,L);const N=f.push("container_"+t+"_close","div",-1);return N.markup=f.src.slice(g,w),N.block=!0,f.parentType=b,f.lineMax=T,f.line=L+(k?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 kq(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 w=0;w<a.length;w++){const k=a[w];if(k==="\\"){w++;continue}if(!u&&k==="'"){c=!c;continue}if(!c&&k==='"'){u=!u;continue}if(!c&&!u&&k===":"){d=w;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),p=a.slice(d+1).trim();if(!f)return null;let h=f;if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{h=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(h))return null;let m;if(!p)m="";else if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{m=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=p}else/^-?\d+(?:\.\d+)?$/.test(p)?m=Number(p):p==="true"||p==="false"?m=p==="true":p==="null"?m=null:m=p;l[h]=m}return l}function bq(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(yq,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
135
+ `}})}),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,p;const h=d.indexOf("{"),m=h>=0?d.slice(h).trimStart():void 0;if(h===-1)f=d||void 0;else{if(f=d.slice(0,h).trim()||void 0,m?.startsWith("{")){let M=0,O=-1;for(let L=0;L<m.length;L++)if(m[L]==="{"?M++:m[L]==="}"&&M--,M===0){O=L+1;break}O>0&&(p=m.slice(0,O))}p||(f=d||void 0)}if(s)return!0;const w=!!i.env.__markstreamFinal;let k=n+1,g=!1;for(;k<=o;){const M=i.bMarks[k]+i.tShift[k],O=i.eMarks[k];if(i.src.slice(M,O).trim()===":::"){g=!0;break}k++}g||(k=o);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.meta={...v.meta??{},unclosed:!g&&!w},f&&v.attrSet("data-args",f),p)try{const M=JSON.parse(p);for(const[O,L]of Object.entries(M)){const b=L!=null&&typeof L=="object";v.attrSet(`data-${O}`,b?JSON.stringify(L):String(L))}}catch{const M=kq(p);if(M)for(const[O,L]of Object.entries(M)){const b=L!=null&&typeof L=="object";v.attrSet(`data-${O}`,b?JSON.stringify(L):String(L))}else v.attrSet("data-attrs",p)}const y=[];for(let M=n+1;M<k;M++){const O=i.bMarks[M]+i.tShift[M],L=i.eMarks[M];y.push(i.src.slice(O,L))}if(y.some(M=>M.trim().length>0)){let M=y.join(`
136
+ `);M.endsWith(`
137
+ `)||(M+=`
138
+ `),M.endsWith(`
139
+
140
+ `)||(M+=`
141
+ `);const O=i.tokens[i.tokens.length-1];O&&(O.raw=M);const L=[];i.md.block.parse(M,i.md,i.env,L),i.tokens.push(...L)}return g&&i.push("vmr_container_close","div",-1),i.line=g?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ps(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vn(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 $p(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 _q=/^[a-z][a-z0-9_-]*$/;function X_(e){return _q.test(String(e??"").trim().toLowerCase())}function ci(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return X_(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)?"":X_(s)?s:""}function Sc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=ci(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function wq(...e){const t=new Set,n=[];for(const o of e)for(const s of Sc(o))t.has(s)||(t.add(s),n.push(s));return n}function Sq(e){const t=Sc(e);return{key:t.join(","),tags:t}}function oA(e){return ci(e)}function Cq(e,t){const n=String(e??""),o=ci(t);if(!o)return!1;const s=Ps(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 sA(e,t){const n=ci(t);return!!n&&!Qu.has(n)&&!Cq(e,n)}function xq(e,t){const n=String(e??""),o=ci(t);if(!o)return n;const s=Ps(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 iA=sa,Aq=Qu,rA=new Set(cq);rA.delete("details");const Mq=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,Tq=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,cv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,Eq=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Th(e){return(e.match(cv)?.[1]??"").toLowerCase()}function G0(e){return/^\s*<\s*\//.test(e)}function Y0(e,t){return iA.has(t)||/\/\s*>\s*$/.test(e)}function Iq(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=Th(i);if(r===t){if(G0(i)){if(n===0)return o;n--;continue}Y0(i,r)||n++}}return-1}function $q(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=Th(s);if(i===t){if(G0(s)){n>0&&n--;continue}Y0(s,i)||n++}}return n}function Z_(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Ps(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 Lq(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ps(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 Eh(e){const t=e;return String(t.raw??t.content??t.markup??"")}function Nq(e){const t=e;return t.meta||(t.meta={}),t.meta}function Sg(e,t,n){const o=Nq(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function Rq(e,t){if(!t.size)return;const n=Array.from(t,p=>new RegExp(String.raw`<\s*${Ps(p)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=p=>p?n.some(h=>h.test(p)):!1,r=p=>{if(!(!p||!o.length))for(const h of o)h.raw+=p,h.inner+=p},l=()=>{!o.length||!s||(r(`
142
+ `),s=!1)},a=p=>{r(p)},c=p=>{for(let m=0;m<o.length;m++)o[m].raw+=p,m<o.length-1&&(o[m].inner+=p);const h=o.pop();Sg(h.token,h.raw,h.inner)},u=p=>{const h=o[o.length-1]?.tag;if(!h)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Ps(h)}\s*>`,"i");return p.match(m)?.[0]??null},d=p=>!!u(p),f=(p,h,m)=>{const w=m??(p.type==="html_inline"?Th(h):"");if(!(w&&t.has(w))){r(h);return}const k=G0(h),g=!k&&Y0(h,w);if(k){if(!o.length||o[o.length-1].tag!==w){r(h);return}c(h);return}if(r(h),g){Sg(p,h,"");return}o.push({tag:w,token:p,raw:h,inner:""})};for(const p of e){if(p.type==="inline"&&Array.isArray(p.children)){const h=String(p.content??"");if(d(h)?s=!1:l(),!o.length&&!i(h)){s=!1;continue}let m=0,w=!0;for(const k of p.children){const g=Eh(k),v=k.type==="html_inline"?Th(g):"",y=v&&t.has(v);let M=g;if(w&&h&&g&&(o.length||y)){const O=h.indexOf(g,m);if(O!==-1)a(h.slice(m,O)),M=h.slice(O,O+g.length),m=O+g.length;else{if(o.length&&!y)continue;w=!1}}f(k,M,v)}w&&h&&m<h.length&&o.length&&a(h.slice(m)),s=o.length>0;continue}if(o.length&&typeof p.content=="string"){const h=Eh(p),m=p.type==="html_block"?u(h):null;if(m){c(`${s?`
143
+ `:""}${m}`),s=o.length>0;continue}if(!p.content)continue;l(),r(p.content),s=!0}}for(const p of o)Sg(p.token,p.raw,p.inner)}function Oq(e){return/^\s*<\s*[!?]/.test(e)}function Pq(e){const t=new Set(Aq);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 J_(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Dq(e,t){let n=null;for(const i of e.matchAll(Mq)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();J_(l,t)&&Vn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(Tq)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();J_(l,t)&&Vn(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 Bq(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function Fq(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(Bq(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),p=f.match(cv);if(!p){i("<",c),u=d+1;continue}const h=Vn(f);if(h===-1){i("<",c),u=d+1;continue}const m=f.slice(0,h+1),w=(p[1]??"").toLowerCase();t.has(w)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=Dq(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+=Eh(a),s=o.buffer;const c=Vn(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=Eh(a),u=(c.match(cv)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Vn(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 Hq=["a","span","strong","em","b","i","u"];function zq(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const p=ci(f);p&&n.add(p)}const o=f=>{const p=f,h=new Set(n),m=Array.isArray(p.env?.__markstreamCustomHtmlTags)?p.env.__markstreamCustomHtmlTags:[];for(const v of m){const y=ci(String(v??""));y&&h.add(y)}const w=Pq(Array.from(h)),k=new Set(Hq);for(const v of h)k.add(v);return{autoCloseInlineTagSet:k,commonHtmlTags:w,customTagSet:h,shouldMergeHtmlBlockTag:v=>h.has(v)||!w.has(v)||rA.has(v)}},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 p=f.children[0];return p?.type!=="html_block"?"":String(f.content??p.content??"")},i=(f,p)=>{f.type="html_block",f.content=p,f.raw=p,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,p)=>{const h=r(f);if(!/\S/.test(h))return[];if(l(h))return[{type:"code_block",content:a(h),raw:h}];const m=h.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const w={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return p==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},w,{type:"paragraph_close",tag:"p",nesting:-1}]:p==="text"?[{type:"text",content:m,raw:m}]:[w]},u=(f,p,h)=>f[p-1]?.type==="paragraph_open"&&f[p+1]?.type==="paragraph_close"?"inline":h,d=(f,p)=>{const h=r(p);return!/\S/.test(h)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${h}`,f.children.push({type:"text",content:h,raw:h}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const p=f.tokens??[],{commonHtmlTags:h,customTagSet:m}=o(f);for(const w of p){const k=w;if(k.type!=="inline"||!Array.isArray(k.children))continue;const g=String(k.content??""),v=k.children.length?k.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const y=Fq(v,h);if(k.children=y.children,y.pendingBuffer){const M=g.lastIndexOf(y.pendingBuffer);if(M!==-1){const O=g.slice(0,M);k.content=O,typeof k.raw=="string"&&(k.raw=O)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}Rq(p,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const p=f.tokens??[],{autoCloseInlineTagSet:h,customTagSet:m,shouldMergeHtmlBlockTag:w}=o(f),k=[];for(let g=0;g<p.length;g++){const v=p[g];if(k.length>0){const[M,O]=k[k.length-1];if(g!==O){if(v.type==="paragraph_open"||v.type==="paragraph_close"){p.splice(g,1),g--;continue}const L=String(v.content??v.raw??"");if(L){const b=p[O],T=`${String(b.content||"")}
144
+ ${L}`,$=Vn(T),N=$===-1?null:Z_(T,M,$+1);if(N){const S=T.slice(0,N.end),E=T.slice(N.end);b.content=S,b.loading=!1,p.splice(g,1),k.pop();const P=d(b,E)?[]:c(E,u(p,g,"paragraph"));P.length&&p.splice(g,0,...P),g--;continue}b.content=T,b.loading!==!1&&(b.loading=!0)}p.splice(g,1),g--;continue}}const y=s(v);if(y){if(Oq(y))continue;const M=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),O=/^\s*<\s*\//.test(y);if(!M||!w(M))continue;if(i(v,y),!O)M&&!new RegExp(`^\\s*<\\s*${M}\\b[^>]*\\/\\s*>`,"i").test(y)&&Lq(y,M)>0&&k.push([M,g]);else if(k.length>0&&M&&k[k.length-1][0]===M){const[,L]=k[k.length-1],b=p[L];b.content=`${String(b.content||"")}
145
+ ${y}`,b.loading=!1,k.pop(),p.splice(g,1),g--}continue}else if(k.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){p.splice(g,1),g--;continue}const M=v.content||"",O=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(M);if(M){const[,L]=k[k.length-1],b=p[L];b.content=`${b.content||""}
146
+ ${M}`,b.loading!==!1&&(b.loading=!O)}O&&k.pop(),p.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,y=L=>{let b=g.get(L);return b||(b=new RegExp(`<\\s*${L}\\b`,"i"),g.set(L,b)),b},M=L=>{let b=v.get(L);return b||(b=new RegExp(`<\\s*\\/\\s*${L}\\s*>`,"i"),v.set(L,b)),b},O=[];for(let L=0;L<p.length;L++){const b=p[L],T=String(b.content??"");if(O.length>0){const N=O[O.length-1],S=p[N.index],E=b.type==="html_block"?M(N.tag).exec(T):null;if(E){const F=E.index+E[0].length,W=T.slice(0,F),K=T.slice(F);S.content=`${String(S.content??"")}
147
+ ${W}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${N.tag}>`,raw:`</${N.tag}>`}),O.pop();const Y=d(S,K)?[]:c(K,u(p,L,"paragraph"));Y.length?p.splice(L,1,...Y):(p.splice(L,1),L--);continue}if(b.type!=="inline")continue;const P=Array.isArray(b.children)?b.children:[],D=Iq(P,N.tag);if(D!==-1){const F=P.slice(0,D+1),W=P.slice(D+1),K=F.map(Y=>String(Y?.content??Y?.raw??"")).join("");if(S.content=`${String(S.content??"")}
148
+ ${K}`,Array.isArray(S.children)&&S.children.push(...F),W.length){const Y=W.map(q=>String(q.content??q.raw??"")).join("");if(Y.trim()){const q=Y.replace(/^\s+/,"");if(d(S,Y))p.splice(L,1),L--;else if(q.startsWith("<"))p.splice(L,1,{type:"html_block",content:q});else{const ae=c(Y,u(p,L,"paragraph"));p.splice(L,1,...ae)}}else p.splice(L,1),L--}else p.splice(L,1),L--;O.pop();continue}S.content=`${String(S.content??"")}
149
+ ${T}`,Array.isArray(S.children)&&S.children.push(...P),p.splice(L,1),L--;continue}if(b.type!=="inline")continue;const $=Array.isArray(b.children)?b.children:[];for(const N of m)if(($.length?$q($,N):y(N).test(T)&&!M(N).test(T)?1:0)>0){O.push({tag:N,index:L});break}}}{let g=0;for(let v=0;v<p.length;v++){const y=p[v];if(y.type==="paragraph_open"){g++;continue}y.type==="paragraph_close"&&(g>0?g--:(p.splice(v,1),v--))}}for(let g=0;g<p.length;g++){const v=p[g];if(v.type==="html_block"){const b=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(b.startsWith("!")||b.startsWith("?")){v.loading=!1;continue}if(m.has(b)){const D=String(v.content??""),F=Vn(D),W=F===-1?null:Z_(D,b,F+1);v.loading=W?!1:v.loading!==void 0?v.loading:!0;const K=W?.start??-1,Y=W?W.end-W.start:0;if(K!==-1){const q=D.slice(0,K+Y);let ae="";F!==-1&&F<K&&(ae=D.slice(F+1,K)),v.children=[{type:b,content:ae,raw:q,attrs:[],tag:b,loading:!1}],v.content=q,v.raw=q;const ce=c(D.slice(K+Y)||"","text");ce.length&&p.splice(g+1,0,...ce)}else v.children=[{type:b,content:"",raw:D,attrs:[],tag:b,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(b))continue;v.type="inline";const T=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let $;for(;($=T.exec(v.content||""))!==null;)$[1],$[2]||$[3]||$[4];const N=String(v.content??""),S=new RegExp(`<\\/\\s*${b}\\s*>`,"i").exec(N),E=S?S.index:-1,P=S?S[0].length:0;if(E!==-1){const D=N.slice(0,E+P),F=(N.slice(E+P)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:D,tag:b,loading:!1}],v.content=D,v.raw=D,F&&p.splice(g+1,0,F.startsWith("<")?{type:"html_block",content:F}:{type:"text",content:F,raw:F})}else v.children=[{type:"html_block",content:v.content,tag:b,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const b=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),T=v.children[1],$=String(T?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(T?.type==="html_inline"&&$===b)continue;h.has(b)?(v.children[0].loading=!0,v.children[0].tag=b,v.children.push({type:"html_inline",tag:b,loading:!0,content:`</${b}>`})):v.children=[{type:"html_block",loading:!0,tag:b,content:String(v.children[0]?.content??"")+String(v.children[1]?.content??"")}];continue}else if(v.children.length===3&&v.children[0].type==="html_inline"&&v.children[2].type==="html_inline"){const b=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(h.has(b))continue;v.children=[{type:"html_block",loading:!1,tag:b,content:v.children.map(T=>T.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const y=String(v.content),M=v,O=M.children[0];if(O?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(M.children.length=0);continue}const L=String(O.content??y).match(Eq)?.[1]?.toLowerCase()??"";if(L){if(/\/\s*>\s*$/.test(y)||iA.has(L)){M.children=[{type:"html_inline",content:y}];continue}M.children.length=0}}})}function Wq(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 Uq(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&&!Wq(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 lA=/\.([a-z0-9]{1,15})$/i,qq=/[_()[\]{}<>]/u,jq=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,Vq=/[?#@]/u,Kq=/[\\/]/u,Gq=/^[\p{L}\p{N}./\\-]+$/u,Yq=/^[A-Za-z0-9-]{1,63}$/u,Qq=/^xn--[a-z0-9-]{2,59}$/i,Xq=/^(?:[A-Z]{1,6}|\d{1,8})$/u,Zq=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,Jq=/文件名\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,ej=/文件名\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,tj=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,nj=new Set(["ai","md","py","rs","sh","zip"]),aA=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),oj=new Set([...aA,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),sj=new Set(["com","dev","io","page","site"]),ij=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),rj=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 Xu(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Cg(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Xu(n)?n:void 0}function ew(e,t){if(!Xu(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 tw(e){const t=pd(e);return Xu(t)?t:void 0}function lj(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function nw(e,t){if(!Xu(t))return;const n=String(e??"").trim().split(/\s+/u).map(lj).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>Ih(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>Ih(s,{marketTicker:!0}))&&(o.marketTicker=!0),Xu(o)?o:void 0}function ul(e,t=!1){let n;return{options(o){return t||o==null?ew(e,n):ew(e,Cg(tw(o),nw(o,n)))},remember(o){const s=tw(o);n=t?Cg(n,s):Cg(s,nw(o,n))},reset(){n=void 0}}}function ow(e){return Yq.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function aj(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return ow(n)||Qq.test(n)?t.every(ow):!1}function cA(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function cj(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function uj(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function uA(e,t,n){const o=cj(t);return cA(e)&&uj(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function pd(e){const t=String(e??"");return{explicitFilename:Jq.test(t),filename:ej.test(t),marketTicker:tj.test(t)}}function dj(e){return aj(e.split(/[\\/]/)[0]??"")}function fj(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function hj(e){if(qq.test(e)||!Gq.test(e))return!0;if(Kq.test(e))return!dj(e);const t=e.replace(lA,"");return cA(t)?!0:t.split(".").filter(Boolean).some(fj)}function pj(e,t,n){if(!(n?oj:aA).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?Zq:Xq).test(o)}function Ih(e,t={}){if(!e||jq.test(e)||Vq.test(e))return!1;const n=e.match(lA);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return pj(e,o,t.marketTicker===!0)?!0:rj.has(o)?!nj.has(o)||t.filename?!0:hj(e):!!(t.explicitFilename&&sj.has(o)||t.filename&&ij.has(o))}const sw=["!"];function ps(e){return{type:"text",content:e,raw:e}}function Ml(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 Tl(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 Ir(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 mj(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(ps(t))}}function iw(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 gj(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function vj(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 yj(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 kj(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=bj(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function bj(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=pd(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=yj(e,o,i),l=gj(s);if(s.markup==="linkify"&&r&&!uA(r,l,t)&&Ih(r,n)){e.splice(o,i-o+1,ps(r));continue}const a=iw(l,sw);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=iw(u.content,sw);if(d===-1)continue;const f=u.content[d],p=u.content.slice(0,d);let h=u.content.slice(d);for(let k=c+1;k<i;k++){const g=e[k];g?.type==="text"&&typeof g.content=="string"&&(h+=g.content)}u.content=p,u.raw=p;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let w=l;if(a!==-1)w=l.slice(0,a);else if(h){const k=encodeURI(h);if(k&&l.endsWith(k))w=l.slice(0,l.length-k.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(w=l.slice(0,v))}}w!==l&&vj(s,w),h&&e.splice(i+1,0,ps(h));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(ps(r));const c=i[1],u=l[1].length;Ml(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(Ir(c,d,!e[o+4]?.content?.startsWith(")"))),Tl(a,u),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)\**/,"");f&&a.push(ps(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(ps(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let p=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(p+=e[o+4]?.content||"",e[o+4].content=""),Ml(a,f),a.push(Ir(c,p,!e[o+4]?.content?.startsWith(")"))),Tl(a,f),e[o+4]?.type==="text"){const h=e[o+4].content?.replace(/^\)/,"");h&&a.push(ps(h)),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(Ir(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(ps(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(Ir(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(ps(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(h=>h[0]==="href")?.[1]||"",a=r.find(h=>h[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const h=d[1].length;Ml(f,h)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let h=o+1;h<e.length;h++){const m=d?d[1].length:e[o-3].markup.length,w=e[h];if(m===1&&w.type==="em_close")break;if(m===2&&w.type==="strong_close")break;if(m===3&&(w.type==="em_close"||w.type==="strong_close"))break;c+=1}}const p={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(p),d){const h=d[1].length;Tl(f,h)}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(ps(l)),Ml(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(Ir(a,c,u)),Tl(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(ps(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(ps(r)),Ml(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(Ir(l,a,c)),Tl(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(ps(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(ps(r)),Ml(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(p=>p[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(Ir(a,c,d)),Tl(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=[];Ml(a,2),a.push(Ir(r,l,!1)),Tl(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;mj(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function _j(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=wj(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function wj(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 Sj(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=Cj(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function Cj(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 p=String(d.markup??"");let h=u-1;for(;h>=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let w=u+1;for(;w<e.length&&e[w].type==="text"&&e[w].content==="";)w++;const k=e[w];p==="__"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=p,d.raw=p,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 p=String(d.markup??"");let h=u-1;for(;h>=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let w=u+1;for(;w<e.length&&e[w].type==="text"&&e[w].content==="";)w++;const k=e[w];p==="_"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=p,d.raw=p,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:""}],p=c.slice(0,-1);p&&f.unshift({type:"text",content:p,raw:p}),l.splice(i,d,...f)}return l=xj(l),l}function xj(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),p=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),p&&t.push({...c,type:"text",content:p,raw:p}),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=Aj(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 Aj(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 Mj(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=Nj(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 rw(){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 lw(){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 aw(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 dA(e,t){if(!e.startsWith("|")||e.includes(`
150
+ `)||!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 xg(e){return dA(e)!==null}function fA(e){return/^:?-+:?$/.test(e.trim())}function Tj(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(fA)}function Ej(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function Ij(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(fA)&&Ej(n)}function $j(e){return e==="|"||e==="|:"}function Lj(e){const t=dA(e);return t!==null&&t.every(n=>!n.includes(":"))}function Nj(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(`
151
+ `)[0]??"",[a="",c="",...u]=r.split(`
152
+ `),d=!t&&!r.includes(`
153
+ `)&&/\r?\n$/.test(n)&&xg(r);if(!t&&(r.includes(`
154
+ `)&&u.length===0&&xg(a)&&Ij(c)||d)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>aw(h)),p=[...rw(),...f,...lw()];o.splice(s-1,3,...p)}else if(r.includes(`
155
+ `)&&u.length===0&&xg(a)&&Tj(c)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>aw(h)),p=[...rw(),...f,...lw()];o.splice(s-1,3,...p)}else r.includes(`
156
+ `)&&u.length===0&&Lj(a)&&$j(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function Rj(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 Oj=Rj;const Pj=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],$h=Pj.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),Dj=/\\[a-z]+/i,hA="(?:\\\\|\\u0008)",Bj=new RegExp(String.raw`${hA}(?:${$h})\s*\{[^}]+\}`,"i"),Fj=new RegExp(String.raw`(?:${hA})?(?:${$h})\s*\{`,"i"),Hj=/\\(?:text|frac|left|right|times)/,zj=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,Wj=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,Uj=/[A-Z]+\s*\([^)]+\)/i,qj=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,jj=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,Vj=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,Kj={"\b":"\\b","\v":"\\v","\f":"\\f"};function Gj(e){let t="";for(const n of e)t+=Kj[n]??n;return t}function qa(e){if(!e)return!1;const t=Gj(e),n=t.trim();if(Vj.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=Dj.test(t),s=Bj.test(t),i=Fj.test(t),r=Hj.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=zj.test(t)&&!Wj.test(t),c=Uj.test(t),u=qj.test(n),d=jj.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),p=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||p}const pA="__markstreamMathPluginApplied",uv=80,mA=2e4,cw=mA+4096;function gA(e){return!!e[pA]}function Yj(e){e[pA]=!0}const vA=["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"],Qj=["cdot","mathbf{","partial","mu_{"],yA=vA.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),kA="[ \r\b\f\v]",Xj=new RegExp(`([^\\\\])(${Qj.map(e=>e).join("|")})+`,"g"),Zj=/span\{([^}]+)\}/,Jj=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,eV=/(^|[^\\])\\\r?\n/g,tV=/(^|[^\\])\\$/g,nV=new RegExp(`(${kA})|(${yA})\\b`,"g"),uw=new Map,dw=new Map;function oV(e){if(!e)return nV;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=uw.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${kA})|(${s})\\b`,"g");return uw.set(n,i),i}function sV(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=dw.get(o);if(s)return s;const i=e?[$h,yA].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),$h].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return dw.set(o,r),r}const fw={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function hw(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function pw(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 $r(e,t){const n=t?.commands??vA,o=t?.escapeExclamation??!0,s=t?.commands==null,i=oV(s?void 0:n);let r=e.replace(i,(c,u,d,f,p)=>{if(u!==void 0&&fw[u]!==void 0)return`\\${fw[u]}`;if(d&&n.includes(d)){const h=p&&typeof f=="number"?p[f-1]:void 0;return h==="\\"||h&&/\w/.test(h)?c:`\\${d}`}return c});o&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=sV(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(Zj,"span\\{$1\\}").replace(Jj,"\\operatorname{span}\\{$1\\}"),l=l.replace(eV,`$1\\\\
157
+ `),l=l.replace(tV,"$1\\\\"),l=l.replace(Xj,"$1\\$2"),l}function mw(e){const t=e.trim();return!(!qa(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 bA(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 Lh(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function iV(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 md(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function dv(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(md(e,o)){n=o+1;continue}return o}return-1}function Ag(e,t){let n=t;for(;n<e.length;){const o=dv(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 au(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(!md(e,s))return s;o=s+Math.max(1,t.length)}return-1}function gw(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=Lh(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}md(e,a)||i++,r=a+Math.max(1,t.length)}return i}function Q0(e,t,n){const o=Ju(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!Ju(o.slice(0,s)).trim()||md(o,s))return-1;const i=bA(o);if(Lh(i,s))return-1;const r=gw(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>gw(o,n,0,s,i))return-1;return s}function Zu(e){return e===" "||e===" "}function Ju(e){let t=e.length;for(;t>0&&Zu(e[t-1]);)t--;return e.slice(0,t)}function vw(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
158
+ `&&t++;return t}function yw(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function rV(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(!Zu(s))return!1}return n>=3}function lV(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 aV(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(lV)}function cV(e){let t=0;if(!yw(e[t]))return!1;for(;yw(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Zu(e[t+1])}function _A(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&&Zu(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Zu(t[1])||cV(t)||rV(t)||aV(t))}function kw(e,t){return e?t?`${e}
159
+ ${t}`:e:t}function fv(e){const t=String(e??"").trim();return t?qa(t):!1}function bw(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function wA(e){if(e.length<=cw)return{source:e,lineOffset:0};let t=e.length-cw;const n=e.indexOf(`
160
+ `,t);return n===-1?{source:"",lineOffset:vw(e)}:(t=n+1,{source:e.slice(t),lineOffset:vw(e.slice(0,t))})}function SA(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=wA(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-uv-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=Ju(o[r]);if(l&&!_A(l)){for(const[a,c]of i)if(Q0(l,a,c)!==-1)return!0}}return!1}function uV(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=wA(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-uv-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=Ju(s[l]);for(const[c,u]of r){const d=Q0(a,c,u);if(d===-1)continue;let f="",p=!1;for(let h=l+1;h<s.length;h++){if(h-l>uv){p=!0;break}const m=s[h],w=au(m,u);if(w!==-1){const k=kw(f,m.slice(0,w));if(!fv(k)){p=!0;break}const g=m.slice(w+u.length),v=g.trim()?`suffix:${bw(g)}`:"nosuffix";return["closed",c,o+l,d,o+h,w,bw(k),v].join(":")}if(_A(m)){p=!0;break}if(f=kw(f,m),f.length>mA){p=!0;break}}if(!p&&fv(f))return["pending",c,o+l,d].join(":")}}return null}function Mg(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function dV(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 Tg(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function fV(e,t){Yj(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=(g,v)=>{let y=v;for(;y<g.length&&(g[y]===" "||g[y]===" ");)y++;if(y===v||!(g[y]===`
161
+ `||g[y]==="\r"&&g[y+1]===`
162
+ `))return v;const M=g.slice(v,y),O=a.push("text","",0);return O.content=M,y};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let g=a.pos+1;for(;a.src[g]==="$";)g++;const v=g-a.pos,y=a.src[g];if(v>=3&&(!y||/\s/.test(y))){const M=a.push("text","",0);return M.content=a.src.slice(a.pos,g),a.pos=g,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],p=String(a.pending??""),h=Math.max(0,a.pos-p.length);let m=h,w=h;const k=h;for(const[g,v]of f){const y=a.src,M=bA(y),O=iV(y,u);let L=!1;g==="$$"&&m!==k&&(m=k);let b=-1,T=-1,$=0;const N=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const D=a.push("text_special","",0);D.content=S==="\\)"?")":"(",D.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let D=0;for(;D<S.length;){const F=dv(S,D);if(F===-1){const ye=S.slice(D);if(ye){const xe=a.push("text","",0);xe.content=ye,a.pos=a.pos+ye.length,m=a.pos}break}if(F>0&&S[F-1]==="$"||F+1<S.length&&S[F+1]==="$"){const ye=S.slice(D,F+1);if(ye){const xe=a.push("text","",0);xe.content=ye,a.pos=a.pos+ye.length,m=a.pos}D=F+1;continue}const W=S.slice(D,F);if(W){const ye=a.push("text","",0);ye.content=W,a.pos=a.pos+W.length,m=a.pos}const K=Ag(S,F+1);if(K===-1){const ye=S.slice(F),xe=a.push("text","",0);xe.content=ye,a.pos=a.pos+ye.length,m=a.pos;break}const Y=S.slice(F+1,K),q=Y.includes("`"),ae=!Y||!Y.trim(),ce=S[K+1],ne=Mg(Y,ce),Q=Tg(Y);if(!q&&!ae&&!ne&&!Q){const ye=a.push("math_inline","math",0);ye.content=$r(Y,t),ye.markup="$",ye.raw=`$${Y}$`,ye.loading=!1,a.pos=a.pos+(K-F+1),m=a.pos,D=K+1;continue}const ee=a.push("text","",0);ee.content="$",a.pos=a.pos+1,m=a.pos,D=F+1}return}const E=S.indexOf("![");if(E!==-1){if(E>0){const W=S.slice(0,E),K=a.push("text","",0);K.content=W,a.pos=a.pos+W.length,m=a.pos}const D=S.slice(E).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(D){const[,W,K]=D,Y=K.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),q=Y?Y[1]:K,ae=Y&&Y[2]?Y[2]:null,ce=a.push("image","img",0);ce.attrs=[["src",q],["alt",W]],ae&&ce.attrs.push(["title",ae]),ce.content=W,ce.children=[{type:"text",content:W,tag:""}],a.pos=a.pos+D[0].length,m=a.pos;const ne=S.slice(E+D[0].length);ne&&N(ne);return}const F=a.push("text","",0);F.content=S,a.pos=a.pos+S.length,m=a.pos;return}const P=a.push("text","",0);P.content=S,a.pos=a.pos+S.length,m=a.pos};for(;!(m>=y.length);){const S=y.indexOf(g,m);if(S===-1)break;if(md(y,S)){m=S+Math.max(1,g.length);continue}const E=Lh(M,S);if(E){m=E[1];continue}const P=Lh(O,S);if(P){m=P[1];continue}if(S===b&&m===T){if($++,$>2){m=S+Math.max(1,g.length);continue}}else $=0,b=S,T=m;if(g==="("&&S>0){let ne=S-1;for(;ne>=0&&y[ne]===" ";)ne--;if(ne>=0&&y[ne]==="]"){m=S+g.length;continue}}if(g==="$"&&S>0&&y[S-1]==="$"){m=S+1;continue}if(g==="$"&&S<y.length-1&&y[S+1]==="$"){m=S+2;continue}const D=g==="$"?Ag(y,S+g.length):Oj(y,S+g.length,g,v);if(D===-1){const ne=y.slice(S+g.length);if(ne.includes(g)){m=y.indexOf(g,S+g.length);continue}if(D===-1){const Q=g==="$"&&dV(ne);if(u&&!c&&!Q&&qa(ne)&&!ne.includes("`")){if(m=S+g.length,L=!0,!l){a.pending="";const ee=w?y.slice(w,m):y.slice(0,m),ye=hw(ee)%2===1;if(w)N(y.slice(w,m));else{let xe=y.slice(0,m);xe.endsWith(g)&&(xe=xe.slice(0,xe.length-g.length)),N(xe)}if(ye){const xe=pw(ee)?.marker??"**",Xe=a.push("strong_open","",0);Xe.markup=xe;const me=a.push("math_inline","math",0);me.content=$r(ne,t),me.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",me.raw=`${g}${ne}${v}`,me.loading=!0,Xe.content=ne,a.push("strong_close","",0)}else{const xe=a.push("math_inline","math",0);xe.content=$r(ne,t),xe.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",xe.raw=`${g}${ne}${v}`,xe.loading=!0}a.pos=y.length}m=y.length,w=m}break}}const F=y.slice(S+g.length,D),W=F.includes("`"),K=!F||!F.trim(),Y=g==="$",q=y[D+v.length],ae=Y&&Mg(F,q),ce=Y&&Tg(F);if(c?W||K||ae||ce:W||K||ae||ce||!Y&&!qa(F)){m=D+v.length;const ne=y.slice(a.pos,m);a.pending||(N(ne),w=m);continue}if(L=!0,!l){const ne=y.slice(a.pos-(a.pending??"").length,S);let Q=y.slice(0,m)?y.slice(w,S):ne;const ee=hw(Q)%2===1;S!==a.pos&&ee&&(Q=a.pending+y.slice(a.pos,S));const ye=ee?pw(Q):null,xe=ye?.marker??"**";if(a.pending!==Q)if(a.pending="",ee)if(ye){const Xe=Q.slice(ye.index+xe.length);N(Q.slice(0,ye.index));const me=a.push("strong_open","",0);me.markup=xe;const G=a.push("text","",0);G.content=Xe,a.push("strong_close","",0)}else N(Q);else N(Q);if(ee){const Xe=a.push("strong_open","",0);Xe.markup=xe;const me=a.push("math_inline","math",0);me.content=$r(F,t),me.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",me.raw=`${g}${F}${v}`,me.loading=!1;const G=y.slice(D+v.length).startsWith(xe);return G&&a.push("strong_close","",0),a.pos=d(y,D+v.length),m=a.pos,w=m,G||a.push("strong_close","",0),!0}else{const Xe=a.push("math_inline","math",0);Xe.content=$r(F,t),Xe.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Xe.raw=`${g}${F}${v}`,Xe.loading=!1}}return m=d(y,D+v.length),w=m,a.pos=m,!0}if(L){if(l)a.pos=m;else{if(g==="$$"&&m<y.length&&y.slice(m).includes("$")){let S=m;for(;!(S>=y.length);){const E=dv(y,S);if(E===-1)break;if(E+1<y.length&&y[E+1]==="$"){S=E+2;continue}if(E>0&&y[E-1]==="$"){S=E+1;continue}const P=Ag(y,E+1);if(P===-1)break;const D=y.slice(E+1,P),F=D.includes("`"),W=!D||!D.trim(),K=y[P+1],Y=Mg(D,K),q=Tg(D);if(!F&&!W&&!Y&&!q){const ae=y.slice(m,E);ae&&N(ae);const ce=a.push("math_inline","math",0);ce.content=$r(D,t),ce.markup="$",ce.raw=`$${D}$`,ce.loading=!1,m=P+1,S=P+1}else N("$"),S=E+1}S<y.length&&N(y.slice(S))}else m<y.length&&N(y.slice(m));a.pos=y.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,p=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],h=u.bMarks[l]+u.tShift[l];let m=u.src.slice(h,u.eMarks[l]).trim(),w=!1,k="",g="",v=!1,y="",M=!1;for(const[ae,ce]of p)if(m.startsWith(ae))if(ae.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){w=!0,k=ae,g=ce;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){w=!0,k=ae,g=ce;break}continue}else{const ne=u.tokens[u.tokens.length-1];if(ne&&ne.type==="list_item_open"&&ne.mark==="-"&&m.slice(ae.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const Q=m.indexOf("]");if(m.slice(Q).trim()!=="]")continue;const ee=m.slice(ae.length,Q);if(ae==="["?mw(ee):qa(ee)){w=!0,k=ae,g=ce;break}continue}}else{w=!0,k=ae,g=ce;break}else if((ae==="$$"||ae==="\\[")&&m.endsWith(ae)&&l+1<a){const ne=Q0(m,ae,ce);if(ne===-1)continue;y=Ju(m.slice(0,ne)),M=!0;const Q=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(Q,u.eMarks[l+1]).trim(),v=!0,w=!0,k=ae,g=ce;break}if(!w)return!1;if(c&&!M)return!0;const O=m.indexOf(k),L=O+k.length,b=!f&&k==="["?m.indexOf("\\]",L):-1,T=b>=0?"\\]":g,$=b>=0?b:au(m,g,L);if(!v&&$>k.length){const ae=m.slice(O+k.length,$),ce=u.push("math_block","math",0);ce.content=$r(ae),ce.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",ce.map=[l,l+1],ce.raw=`${k}${ae}${T}`,ce.block=!0,ce.loading=!1,u.line=l+1;const ne=m.slice($+T.length);return ne.trim()&&n(u,ne,l),!0}let N=l,S="",E=!1,P="",D=l;const F=v?m:m===k?"":m.slice(k.length),W=!f&&k==="\\["?"]":"",K=au(F,g);if(K!==-1){const ae=K;S=F.slice(0,ae),P=F.slice(ae+g.length),D=v?l+1:l,E=!0,N=D}else for(F&&!v&&(S=F),N=l+1;N<a;N++){const ae=u.bMarks[N]+u.tShift[N],ce=u.eMarks[N],ne=u.src.slice(ae,ce),Q=ne.trim();if(!f&&k==="["&&Q==="\\]"){g="\\]",E=!0;break}if(W&&ne.trim()===W){g=W,E=!0;break}if(Q===g){E=!0;break}else if(!f&&k==="["&&ne.includes("\\]")){E=!0;const ee=ne.indexOf("\\]");g="\\]";const ye=ne.slice(0,ee);ye&&(S+=(S?`
163
+ `:"")+ye),P=ne.slice(ee+g.length),D=N;break}else if(au(ne,g)!==-1){E=!0;const ee=au(ne,g),ye=ne.slice(0,ee);ye&&(S+=(S?`
164
+ `:"")+ye),P=ne.slice(ee+g.length),D=N;break}S+=(S?`
165
+ `:"")+ne}if((!d||f)&&!E)return!1;const Y=/^\s*!\[/.test(S);if(!(M?!Y&&fv(S):k==="$$"?!Y:k==="["?mw(S):qa(S)))return!1;if(c)return!0;y&&n(u,y,l);const q=u.push("math_block","math",0);return q.content=$r(S),q.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",q.raw=`${k}${S}${S.startsWith(`
166
+ `)?`
167
+ `:""}${g}`,q.map=[l,N+1],q.block=!0,q.loading=!E,u.line=N+1,P.trim()&&n(u,P,D),!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 hV(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 pV(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 tq({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!ql(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&fV(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&bq(i),e.enableFixIndentedCodeBlock!==!1&&Uq(i),kj(i),Sj(i),_j(i),Mj(i),hV(i),zq(i,{customHtmlTags:e.customHtmlTags}),i}function jl(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=>jl(n))),t}function mV(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function gV(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 vV(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function hf(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(...Kn(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const _w=/\r?\n[ \t]*`+\s*$/,CA=["diff ","index ","--- ","+++ ","@@ "],yV=/\r?\n/;function kV(e){const t=String(e??"");return t?CA.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function ww(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function bV(e,t){const n=[],o=[],s=[],i=[],r=e.split(yV),l=/\r?\n$/.test(e),a=r.some(p=>p.startsWith("diff ")||p.startsWith("--- ")||p.startsWith("+++ ")||p.startsWith("@@ ")),c=p=>{const h=p;if(!CA.some(m=>h.startsWith(m)))if(h.startsWith("-")){const m=h.slice(1);s.push(!a&&m.startsWith(" ")?` ${m}`:m)}else if(h.startsWith("+")){const m=h.slice(1);i.push(!a&&m.startsWith(" ")?` ${m}`:m)}else{ww(n,o,s,i);const m=a&&h.startsWith(" ")?h.slice(1):h;n.push(m),o.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let p=0;p<u;p++){const h=r[p]??"";!t&&!l&&p===u-1&&kV(h)||c(h)}(t||s.length>0||i.length>0)&&ww(n,o,s,i);const d=n.join(`
168
+ `),f=o.join(`
169
+ `);return{original:t&&l&&d?`${d}
170
+ `:d,updated:t&&l&&f?`${f}
171
+ `:f}}function X0(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(_w.test(a)&&(a=a.replace(_w,"")),r){const{original:c,updated:u}=bV(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 _V(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function wV(){return{type:"hardbreak",raw:`\\
172
+ `}}function SV(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(...Kn(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let Eg=null;const Ig=new WeakMap;function Sw(){return Eg||(Eg={customTagSet:null,allowedTagSet:Rp()}),Eg}function xA(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function AA(e){return/^<\s*\//.test(e)}function MA(e,t){return/\/\s*>\s*$/.test(t)||sa.has(e)}function CV(e){if(!e||e.length===0)return Sw();const t=Ig.get(e);if(t)return t;const n=e.map(ci).filter(Boolean);if(!n.length){const s=Sw();return Ig.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:Rp({customHtmlTags:e})};return Ig.set(e,o),o}function TA(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function xV(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Nh(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 AV(e,t,n){const o=e.slice();return Nh(o,"href")||o.push(["href",t]),n!=null&&!Nh(o,"title")&&o.push(["title",n]),o}function hv(e){return e.map(TA).join("")}function Of(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:Of(o.children)});continue}t.push(o)}return t}function MV(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=xA(r),a=AA(r),c=MA(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function $g(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?MV(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:hv(o),innerTokens:s,nextIndex:i}}function TV(e,t,n,o,s,i,r){const l=String(e.content??""),a=xA(l),{customTagSet:c,allowedTagSet:u}=CV(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!$g(t,n,a).closed){const M=TA(e);return[{type:"text",content:M,raw:M},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=AA(l),f=MA(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const M=$g(t,n,a),O=$p(l),L=M.innerTokens,b=String(Nh(O,"href")??""),T=Nh(O,"title"),$=T==null?null:String(T),N=AV(O,b,$),S=Of(L.length?o(L,s,i,r):[]),E=L.length?hv(L):b||"";return!S.length&&E&&S.push({type:"text",content:E,raw:E}),[{type:"link",href:b,title:$,text:E,attrs:N,children:S,loading:!M.closed,raw:M.html||l},M.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const p=$g(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Of(p.innerTokens.length?o(p.innerTokens,s,i,r):[]),raw:p.html},p.nextIndex];const h=Of(p.innerTokens.length?o(p.innerTokens,s,i,r):[]);let m=p.html||l,w=!p.closed,k=!1;if(!p.closed){const M=`</${a}>`;m.toLowerCase().includes(M.toLowerCase())||(m+=M),k=!0,w=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const M=y[1],O=y[2]||y[3]||y[4]||"";g.push([M,O])}if(c?.has(a)){const M=xV(e);return[{type:a,tag:a,attrs:g,content:M?M.inner:p.innerTokens.length?hv(p.innerTokens):"",children:p.innerTokens.length?o(p.innerTokens,s,i,r):[],raw:M?.raw??m,loading:e.loading||w,autoClosed:k},p.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:h,raw:m,loading:w,autoClosed:k},p.nextIndex]}function EA(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=>EA(t)).join(""):String(e.content??"")}function EV(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>EA(t)).join("")}function Cw(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=EV(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 IV(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function $V(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(...Kn(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function LV(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 Rh(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 NV(e,t,n){const o=e.slice();return Rh(o,"href")||o.push(["href",t]),n!=null&&!Rh(o,"title")&&o.push(["title",n]),o}function pf(e,t,n){const o=e[t],s=LV(o.attrs),i=String(Rh(s,"href")??""),r=Rh(s,"title"),l=r==null?null:String(r),a=NV(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 p=u[u.length-1];if(n?.__insideStrong&&p?.type==="text"&&String(p.content??"").endsWith("**")&&!u.some(w=>w.type==="strong_open")){const w=String(p.content??""),k=String(p.raw??w),g=jl(p);g.content=w.slice(0,-2),g.raw=k.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const h=Kn(f,void 0,void 0,n),m=h.map(w=>{const k=w;return"content"in w?String(k.content??""):String(k.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:h,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function xw(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 RV(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function Aw(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(...Kn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const OV=/\\([\\()[\]`$|*_\-!])/g;function PV(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(OV,"$1")===t))return n}function Xc(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(...Kn(l,PV(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function DV(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(...Kn(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 BV(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(...Kn(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 FV(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const HV=/[^~]*~{2,}[^~]+/,zV=/\*\*/,WV=/[[_*^~]/,UV=/\\([\\()[\]`$|*_\-!])/g,Z0=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),qV=/\s/u,jV=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,VV=/\p{P}/u,KV=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,GV=/:\/\//;function YV(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 IA(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&&Z0.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function nl(e){return!!e&&qV.test(e)}function ol(e){return!!e&&(jV.test(e)||VV.test(e))}function QV(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||nl(o)?!1:!(ol(o)&&n&&!nl(n)&&!ol(n))}function XV(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||nl(n)?!1:!(ol(n)&&o&&!nl(o)&&!ol(o))}function ZV(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?IA(e,o):t.indexOf("*",o);if(i===-1)break;if(XV(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function JV(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||nl(o)?!1:!(ol(o)&&n&&!nl(n)&&!ol(n))}function eK(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||nl(n)?!1:!(ol(n)&&o&&!nl(o)&&!ol(o))}function tK(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(eK(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function nK(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&&Z0.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function oK(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&Z0.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function sK(e,t,n){const o=oK(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 iK=/[\p{L}\p{N}]/u,rK=/^[\p{L}\p{N}]+$/u;function pv(e){return e?iK.test(e):!1}function $A(e){return e?rK.test(e):!1}function wu(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:pv(o)&&pv(s)}}function lK(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=wu(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(!$A(e.slice(o.end,s.start)))return s.end}return-1}function aK(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function cK(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=wu(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function uK(e){return e?KV.test(e)||GV.test(e):!1}function dK(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Kn(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=pd(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 p(){return e===f&&(e=e.slice()),e}function h(){c=null}function m(G,ie){const de=e.length===1?t:String(ie.content??""),z=[],Z=lK(G);if(Z!==-1){M(G.slice(0,Z),G.slice(0,Z));const le=G.slice(Z);return le&&($({type:"text",content:le,raw:le}),u--),u++,!0}if(HV.test(G)){const le=G.indexOf("~~");le!==-1&&z.push({type:"strikethrough",index:le})}if(zV.test(G)){const le=G.indexOf("**");le!==-1&&z.push({type:"strong",index:le})}if(/[^*]*\*[^*]+/.test(G)){const le=de?IA(de,0):G.indexOf("*");if(de&&le===-1)return!1;le!==-1&&z.push({type:"emphasis",index:le})}z.sort((le,he)=>le.index!==he.index?le.index-he.index:le.type===he.type?0:le.type==="strong"?-1:he.type==="strong"?1:0);const pe=z[0];if(!pe)return!1;if(pe.type==="strikethrough"){const le=pe.index,he=le>-1?G.slice(0,le):"";if(he&&M(he,he),le===-1)return u++,!0;const U=G.indexOf("~~",le+2),J=U===-1?G.slice(le+2):G.slice(le+2,U),fe=U===-1?"":G.slice(U+2),{node:be}=Aw([{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 h(),y(be),fe&&($({type:"text",content:fe,raw:fe}),u--),u++,!0}if(pe.type==="strong"){const le=pe.index,he=le>-1?G.slice(0,le):"";if(he&&M(he,he),le===-1)return u++,!0;if(t&&le===0){let Le=!1,ue=0;for(;ue<G.length&&G[ue]==="*";)ue++;if(t.startsWith("\\*")&&(Le=!0),Le){let Ie=0,Ge=0;for(;Ge<t.length&&Ie<ue;)if(t[Ge]==="\\"&&Ge+1<t.length&&t[Ge+1]==="*")Ie+=1,Ge+=2;else{if(t[Ge]==="*")break;Ge++}if(Ie>=2)return M(G,G),u++,!0}}if(t&&(G.match(/\*/g)||[]).length>YV(t))return M(G.slice(he.length),G.slice(he.length)),u++,!0;const U=wu(G,le);if(U.len>=3){const Le=cK(G,le+U.len);if(Le!==-1){const ue=G.slice(le+U.len,Le);if(aK(ue)){const{node:Ie}=Xc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ue,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);h(),y(Ie);const Ge=G.slice(Le+3);return Ge&&($({type:"text",content:Ge,raw:Ge}),u--),u++,!0}}}if(!JV(G,le)){const Le=G.slice(le,le+U.len);M(Le,Le);const ue=G.slice(le+U.len);return ue&&($({type:"text",content:ue,raw:ue}),u--),u++,!0}const J=tK(G,le+2);let fe="",be="";if(J.index!==-1){fe=G.slice(le+2,J.index),be=G.slice(J.index+2);const Le=J.index,ue=wu(G,Le);if(U.intraword&&ue.intraword&&!$A(fe)||!fe&&U.len>=4&&U.intraword)return M(G.slice(he.length),G.slice(he.length)),u++,!0}else{if(d||J.sawInvalidClose||U.intraword)return M(G.slice(he.length),G.slice(he.length)),u++,!0;fe=G.slice(le+2),be=""}if(!fe&&/^\*+$/.test(be))return M(G,G),u++,!0;const{node:Ee}=Xc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:fe,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return h(),y(Ee),be&&($({type:"text",content:be,raw:be}),u--),u++,!0}if(pe.type==="emphasis"){let le=pe.index;le===-1&&(le=0);const he=G.slice(0,le);if(he&&M(he,he),!QV(G,le)){M(G[le],G[le]);const Le=G.slice(le+1);return Le&&($({type:"text",content:Le,raw:Le}),u--),u++,!0}const U=wu(G,le),J=ZV(de,G,le+1),fe=J.index,be=e[u+1];if(o?.final&&be?.type==="em_open"&&fe!==-1&&G.slice(le+1,fe).trim()!==G.slice(le+1,fe)||fe===-1&&(J.sawInvalidClose||o?.final||U.intraword||!pv(G[le+1])))return M(G.slice(le),G.slice(le)),u++,!0;const{node:Ee}=hf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:fe>-1?G.slice(le+1,fe):G.slice(le+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(h(),y(Ee),fe!==-1&&fe<G.length-1){const Le=G.slice(fe+1);Le&&($({type:"text",content:Le,raw:Le}),u--)}return u++,!0}return!1}function w(G,ie){if(!G.includes("`"))return!1;const z=(be=>{for(let Ee=0;Ee<be.length;Ee++){if(be[Ee]!=="`")continue;let Le=0;for(let ue=Ee-1;ue>=0&&be[ue]==="\\";ue--)Le++;if(Le%2===0)return Ee}return-1})(G);if(z===-1)return!1;let Z=1;for(let be=z+1;be<G.length&&G[be]==="`";be++)Z++;const pe="`".repeat(Z),le=z+Z,he=G.indexOf(pe,le);if(he===-1){if(Z===1){const Ee=G.slice(0,z),Le=G.slice(z+1);return Ee&&(m(Ee,ie)?u--:M(Ee,Ee)),g({type:"inline_code",code:Le,raw:String(Le)}),u++,!0}let be=G;for(let Ee=u+1;Ee<e.length;Ee++)be+=String((e[Ee].content??"")+(e[Ee].markup??""));return u=e.length-1,M(be,be),u++,!0}h();const U=G.slice(0,z),J=G.slice(z+Z,he),fe=G.slice(he+Z);return U&&(m(U,ie)?u--:M(U,U)),g({type:"inline_code",code:J,raw:String(J??"")}),fe&&($({type:"text",content:fe,raw:fe}),u--),u++,!0}function k(G){const ie=l?.__markdownIt;if(!ie||e.length<=1||!e.some(pe=>pe?.type==="math_inline")||!WV.test(G))return null;const de=ie.parseInline(G,{__markstreamFinal:!!o?.final});if(!Array.isArray(de)||de.length===0)return null;const z=(de.find(pe=>pe?.type==="inline")?.children??[]).filter(pe=>!(pe?.type==="text"&&String(pe.content??"")===""));if(!z.length||!z.some(pe=>pe?.type!=="text")||z.length===1&&z[0]?.type==="text"&&String(z[0].content??"")===G)return null;const Z=Kn(z,G,n,o);return Z.length?Z:null}function g(G){h(),a.push(G)}function v(G){h();const ie=jl(G);a.push(ie)}function y(G){g(G)}function M(G,ie){c?(c.content+=G,c.raw+=ie??G):(c={type:"text",content:String(G??""),raw:String(ie??G??"")},a.push(c))}function O(G,ie){if(!G)return;const de=Kn([{...ie,type:"text",content:G,raw:G}],G,n,o);if(de.length===1&&de[0]?.type==="text"){const z=de[0];M(String(z.content??""),String(z.raw??z.content??""));return}for(const z of de)y(z)}function L(G,ie){return String(G.markup??"").startsWith(ie)}function b(G){return G.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 T(G,ie){let de=G;const z=String(ie.content??"");return de.endsWith("\\")&&!L(ie,"\\\\")&&!z.endsWith("\\\\")&&(de=de.slice(0,-1)),de.endsWith("(")&&!L(ie,"\\(")&&!z.endsWith("\\(")&&(de=de.slice(0,-1)),/\*+$/.test(de)&&!L(ie,"\\*")&&!z.endsWith("\\*")&&(de=de.replace(/\*+$/,"")),de}for(;u<e.length;){const G=e[u];$(G)}function $(G){switch(G.type){case"text":S(G);break;case"softbreak":c?(c.content+=`
173
+ `,c.raw+=`
174
+ `):(c={type:"text",content:`
175
+ `,raw:`
176
+ `},a.push(c)),u++;break;case"code_inline":y(IV(G)),u++;break;case"html_inline":{const[ie,de]=TV(G,e,u,Kn,t,n,o);y(ie),u=de;break}case"link_open":E(G);break;case"image":ne(G)||(h(),y(Cw(G)),u++);break;case"strong_open":{h();const{node:ie,nextIndex:de}=Xc(e,u,G.content,o);y(ie),u=de;break}case"em_open":{h();const{node:ie,nextIndex:de}=hf(e,u,o);y(ie),u=de;break}case"s_open":{h();const{node:ie,nextIndex:de}=Aw(e,u,o);y(ie),u=de;break}case"mark_open":{h();const{node:ie,nextIndex:de}=SV(e,u,o);y(ie),u=de;break}case"ins_open":{h();const{node:ie,nextIndex:de}=$V(e,u,o);y(ie),u=de;break}case"sub_open":{h();const{node:ie,nextIndex:de}=DV(e,u,o);y(ie),u=de;break}case"sup_open":{h();const{node:ie,nextIndex:de}=BV(e,u,o);y(ie),u=de;break}case"sub":h(),y({type:"subscript",children:[{type:"text",content:String(G.content??""),raw:String(G.content??"")}],raw:`~${String(G.content??"")}~`}),u++;break;case"sup":h(),y({type:"superscript",children:[{type:"text",content:String(G.content??""),raw:String(G.content??"")}],raw:`^${String(G.content??"")}^`}),u++;break;case"emoji":{h();const ie=e[u-1];ie?.type==="text"&&/\|:-+/.test(String(ie.content??""))?M("",""):y(vV(G)),u++;break}case"checkbox":h(),y(mV(G)),u++;break;case"checkbox_input":h(),y(gV(G)),u++;break;case"footnote_ref":h(),y(_V(G)),u++;break;case"footnote_anchor":{h();const ie=G.meta??{};g({type:"footnote_anchor",id:String(ie.label??G.content??""),raw:String(G.content??"")}),u++;break}case"hardbreak":h(),y(wV()),u++;break;case"fence":h(),y(X0(e[u])),u++;break;case"math_inline":h(),!G.content&&G.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(xw({...G,content:e[u+1].content})),u+=2):y(xw(G)),u++;break;case"reference":D(G);break;case"text_special":M(String(G.content??""),String(G.content??"")),u++;break;default:{const ie=G;if(G.type==="link"&&ie.href!=null&&o?.validateLink&&!o.validateLink(String(ie.href))){h();const de=String(ie.text??"");M(de,de),u++}else Q(G)||W(G)||Y(G)||F(G)||v(G),u++;break}}}function N(G,ie,de,z){const Z=FV({...ie,content:G});if(c){c.content+=T(Z.content,ie),c.raw+=Z.raw;return}const pe=de?.tag==="br"&&e[u-2]?.content==="[";z||(Z.content=T(Z.content,ie)),c=Z,c.center=pe,a.push(c)}function S(G){const ie=String(G.content??""),de=e.length===1&&ie.includes("\\")&&typeof t=="string"?String(t):"";let z=de?nK(de):ie.replace(UV,"$1");if(G.content==="<"||z==="1"&&e[u-1]?.tag==="br"){u++;return}const Z=z.indexOf("$");Z!==-1&&Z===z.lastIndexOf("$")&&z.endsWith("$")&&(z=z.slice(0,-1)),z.endsWith("undefined")&&!t?.endsWith("undefined")&&(z=z.slice(0,-9));let pe=a.length,le="";for(let fe=a.length-1;fe>=0;fe--){const be=a[fe];if(be.type!=="text")break;pe=fe,le=String(be.content??"")+le}pe<a.length&&(z.startsWith(le)?(c=null,a.length=pe):c=a[a.length-1]);const he=e[u+1];if((z==="`"||z==="|"||z==="$")&&!L(G,`\\${z}`)||/^\*+$/.test(z)&&!L(G,"\\*")){u++;return}if(!he&&/[^\]]\s*\(\s*$/.test(z)&&(z=z.replace(/\(\s*$/,"")),!z){u++;return}if(ce(z)||ee(z))return;if(!(z.includes("*")||z.includes("_")||z.includes("~")||z.includes("`")||z.includes("[")||z.includes("!")||z.includes("$")||z.includes("|")||z.includes("("))){N(z,G,e[u-1],he),u++;return}if(me(z))return;const U=e[u-1];if(z==="["&&!he?.markup?.includes("*")&&!L(G,"\\[")||z==="]"&&!U?.markup?.includes("*")&&!L(G,"\\]")){u++;return}if(w(ie,G)||Xe(z)||(e[u+1]?.type!=="link_open"||b(z))&&xe(z,G))return;const J=k(ie);if(J){h();for(const fe of J)y(fe);u++;return}m(z,G)||(N(z,G,U,he),u++)}function E(G){if(P(G))return;if(ye()){const{node:he,nextIndex:U}=pf(e,u,o),J=String(he.text||he.href||"");M(J,J),u=U;return}h();const{node:ie,nextIndex:de}=pf(e,u,o);u=de;const z=ie.text||ie.href||"";if(G.markup==="linkify"&&!uA(z,ie.href,t)&&Ih(z,l?.__linkifyDemotionContext)){M(z,z);return}const Z=ie.children.length===1&&ie.children[0]?.type==="text";if(ie.loading&&t&&ie.text===ie.href&&Z){const he=dK(t,ie.href);he&&(ie.text=he,ie.children=[{type:"text",content:he,raw:he}],ie.raw=`[${he}](${ie.href}${ie.title?` "${ie.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(ie.href)){M(ie.text,ie.text);return}const pe=G.attrs?.find(([he])=>he==="href")?.[1],le=String(pe??"");if(t&&le){const he=t.indexOf("](");if(he!==-1){const U=t.indexOf(")",he+2);U===-1?ie.loading=!0:ie.loading&&t.slice(he+2,U).includes(le)&&(ie.loading=!1)}}F(ie)||g(ie)}function P(G){if(G.markup!=="linkify")return!1;const{node:ie,nextIndex:de}=pf(e,u,o);return K(ie,de)?(u=de,!0):!1}function D(G){h(),y(RV(G)),u++}function F(G){if(G.type!=="link")return!1;const ie=a[a.length-1];if(!ie||ie.type!=="text")return!1;const de=String(ie.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!de)return!1;const z=G,Z=String(z.href??""),pe=String(z.text??""),le=String(de[2]??""),he=Z.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Z||!(pe===Z||pe===he||uK(pe)))return!1;const U=String(de[1]??"");return U?(ie.content=U,ie.raw=U):a.pop(),g({...G,text:le,children:[{type:"text",content:le,raw:le}],raw:`[${le}](${Z}${z.title?` "${z.title}"`:""})`}),!0}function W(G){if(G.type!=="link")return!1;const ie=G,de=String(ie.href??"");return de?K({href:de,title:ie.title==null||ie.title===""?null:String(ie.title),loading:!!ie.loading},u+1):!1}function K(G,ie){const de=a[a.length-1];if(de?.type!=="image"||de.src||!de.loading||!String(de.raw??"").endsWith("]("))return!1;const z=e[ie],Z=String(z?.content??"");if(z?.type!=="text"||!Z.startsWith(")"))return!1;a.pop(),c=null;const pe=String(de.alt??"");g({type:"image",src:G.href,alt:pe,title:G.title,raw:`![${pe}](${G.href}${G.title?` "${G.title}"`:""})`,loading:!!G.loading});const le=Z.slice(1),he=jl(z);return he.content=le,he.raw=le,p()[ie]=he,!0}function Y(G){if(G.type!=="link")return!1;const ie=a[a.length-1],de=e[u-1];if(!ie||ie.type!=="text"||de?.type!=="text")return!1;const z=String(ie.content??""),Z=String(de.content??"");if(!z.endsWith("!")||!Z.endsWith("!")||L(de,"\\!"))return!1;const pe=z.slice(0,-1);pe?(ie.content=pe,ie.raw=pe,c=ie):(a.pop(),c=null);const le=G,he=String(le.text??le.children?.map(fe=>String(fe?.content??fe?.raw??"")).join("")??""),U=String(le.href??""),J=le.title==null||le.title===""?null:String(le.title);return g({type:"image",src:U,alt:he,title:J,raw:`![${he}](${U}${J?` "${J}"`:""})`,loading:!!le.loading}),!0}function q(G,ie="",de=null){const z=String(G.alt??G.raw??"");return{type:"link",href:ie,title:de,text:z,children:[G],raw:`[${z}](${ie}${de?` "${de}"`:""})`,loading:!0}}function ae(G){const ie=G.startsWith("![")?G:`![${G}`,de=ie.slice(2),z=de.indexOf("](");return{type:"image",src:"",alt:z===-1?de.replace(/\]$/,""):de.slice(0,z),title:null,raw:ie,loading:!0}}function ce(G){const ie=G.indexOf("[![");if(ie===-1||typeof t=="string"&&e.length===1&&sK(t,ie,"["))return!1;const de=G.slice(0,ie);return de&&M(de,de),g(q(ae(G.slice(ie+1)))),u++,!0}function ne(G){if(o?.final)return!1;const ie=e[u-1];if(ie?.type!=="text"||!String(ie.content??"").endsWith("[")||L(ie,"\\["))return!1;const de=a[a.length-1];if(de?.type==="text"&&de.content.endsWith("[")){const z=de.content.slice(0,-1);z?(de.content=z,de.raw=z,c=de):(a.pop(),c=null)}return g(q(Cw(G))),u++,!0}function Q(G){if(G.type!=="link")return!1;const ie=G,de=String(ie.raw??""),z=String(ie.text??"");if(!de.startsWith("[![")&&!z.startsWith("!["))return!1;const Z=ie.title==null||ie.title===""?null:String(ie.title);return g(q({type:"image",src:String(ie.href??""),alt:z.replace(/^!\[/,"").replace(/\]$/,""),title:Z,raw:de.startsWith("[![")?de.slice(1):de,loading:!0})),!0}function ee(G){if(!G.startsWith("]("))return!1;const ie=e[u-2];if(ie?.type==="text"&&String(ie.content??"").endsWith("[")&&L(ie,"\\["))return!1;const de=a[a.length-1];if(de?.type!=="image"&&de?.type!=="link")return!1;const z=de,Z=de?.type==="link"&&Array.isArray(z.children)&&z.children.length===1&&z.children[0]?.type==="image"?a.pop():null,pe=Z?Z.children[0]:a.pop();if(!pe||pe.type!=="image")return!1;const le=e[u+1];let he=String(Z?.href??""),U=Z?.title==null?null:String(Z.title),J=!0;if(le?.type==="link_open"){const{node:be,nextIndex:Ee}=pf(e,u+1,o);he=be.href,U=be.title,J=!0,u=Ee}else{if(he=G.slice(2),he.includes('"')){const be=he.split('"');he=String(be[0]??"").trim(),U=be[1]==null?null:String(be[1]).trim()}u++}const fe=q(pe,he,U);return fe.loading=J,g(fe),!0}function ye(){const G=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&G?.type==="text"&&String(G.content??"").endsWith("[")&&L(G,"\\[")}function xe(G,ie){const de=G.indexOf("[");if(de===-1)return!1;let z=G.slice(0,de);const Z=G.indexOf("](",de);if(Z!==-1){const pe=e[u+2];let le=G.slice(de+1,Z);if(le.includes("[")){const Le=le.indexOf("[");z+=G.slice(0,de+Le+1);const ue=de+Le+1;le=G.slice(ue+1,Z)}const he=e[u+1];if(G.endsWith("](")&&he?.type==="link_open"&&pe){const Le=e[u+4];let ue=4,Ie=!0;if(Le?.type==="text"){const lt=String(Le.content??"");if(lt.startsWith(")")){Ie=!1;const bt=lt.slice(1);if(bt){const _t=jl(Le);_t.content=bt,_t.raw=bt,p()[u+4]=_t}else ue++}else lt==="."&&ue++}O(z,ie);const Ge=String(pe.content??"");return o?.validateLink&&!o.validateLink(Ge)?M(le,le):g({type:"link",href:Ge,title:null,text:le,children:[{type:"text",content:le,raw:le}],loading:Ie}),u+=ue,!0}const U=G.indexOf(")",Z),J=U!==-1?G.slice(Z+2,U):"",fe=U===-1;let be=z.match(/\*+$/);if(be&&(z=z.replace(/\*+$/,"")),O(z,ie),be||(be=le.match(/^\*+/)),!d&&be){const Le=be[0].length;le=le.replace(/^\*+/,"").replace(/\*+$/,"");const ue=[];if(Le===1?ue.push({type:"em_open",tag:"em",nesting:1}):Le===2?ue.push({type:"strong_open",tag:"strong",nesting:1}):Le===3&&(ue.push({type:"strong_open",tag:"strong",nesting:1}),ue.push({type:"em_open",tag:"em",nesting:1})),ue.push({type:"link",href:J,title:null,text:le,children:[{type:"text",content:le,raw:le}],loading:fe}),Le===1){ue.push({type:"em_close",tag:"em",nesting:-1});const{node:Ie}=hf(ue,0,o);y(Ie)}else if(Le===2){ue.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=Xc(ue,0,void 0,o);y(Ie)}else if(Le===3){ue.push({type:"em_close",tag:"em",nesting:-1}),ue.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=Xc(ue,0,void 0,o);y(Ie)}else{const{node:Ie}=hf(ue,0,o);y(Ie)}}else o?.validateLink&&!o.validateLink(J)?M(le,le):g({type:"link",href:J,title:null,text:le,children:[{type:"text",content:le,raw:le}],loading:fe});const Ee=U!==-1?G.slice(U+1):"";return Ee&&($({type:"text",content:Ee,raw:Ee}),u--),u++,!0}return!1}function Xe(G){const ie=G.indexOf("![");if(ie===-1)return!1;const de=G.slice(0,ie);return de&&!c?c={type:"text",content:de,raw:de}:de&&c&&(c.content+=de),c&&(a.push(c),c=null),g(ae(G.slice(ie))),u++,!0}function me(G){if(!(G?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ie=G.slice(1).match(/[^\s\]]/);if(ie===null)return u++,!0;if(ie&&/x/i.test(ie[0])){const de=ie[0]==="x"||ie[0]==="X";return g({type:"checkbox_input",checked:de,raw:de?"[x]":"[ ]"}),u++,!0}return!1}return a}function fK(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 hK(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 pK(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Cc(e,t,n){const o=e[t],s=[],i=ul(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=pK(c)?jl(c):c,d=e[a-1];u!==c&&(hK(u),fK(u));const f=String(u.content??"");l.push({type:"paragraph",children:Kn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=xc(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]=Cc(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=ey(e,a,i.options(),J0);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(`
177
+ `)},r+1]}function mK(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=ul(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:Kn(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]=Cc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=xc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Lp(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}
178
+ ${r.map(c=>c.raw).join(`
179
+ `)}
180
+ :::`},a+1]}const gK=new Set(["warning","info","note","tip","danger","caution"]);function vK(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 gK.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function yK(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=vK(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=ul(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 p=-1;for(let m=f.length-1;m>=0;m--){const w=f[m];if(w.type==="text"&&/:+/.test(w.content)){p=m;break}}const h={type:"paragraph",children:Kn((p!==-1?f.slice(0,p):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=Cc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=xc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Lp(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}
181
+ ${l.map(d=>d.raw).join(`
182
+ `)}
183
+ :::`},c+1]}const kK=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function bK(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=kK.exec(String(o.info??""));return s?mK(e,t,s,n):null}const J0={parseContainer:(e,t,n)=>yK(e,t,n),matchAdmonition:bK};function xc(e,t,n){const o=[],s=ul(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:Kn(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]=Cc(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=xc(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}default:{const r=ey(e,i,s.options(),J0);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(`
184
+ `)},i+1]}function _K(e){if(e.info?.startsWith("diff"))return X0(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 wK(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=ul(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=Kn(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:Kn(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(`
185
+ `)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
186
+ `)},s+1]}function SK(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=ul(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:Kn(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(`
187
+ `)}`},l+1]}function CK(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:Kn(a.children||[],c,void 0,n),raw:c}}function xK(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=Vn(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=Vn(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 LA(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=Vn(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=sa.has(n),l=$p(s),a=(o===-1?-1:xK(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
188
+ </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function AK(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 MK(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 NA(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function RA(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return NA(n)?n:void 0}function TK(e,t,n){const o=RA(pd(t),n);if(!NA(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 EK(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",p=e[c+1],h=String(p.content??""),m=MK(e[c].attrs),w=a.length,k=!f&&!r,g=k?s?.cells[w]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Kn(p.children||[],h,void 0,TK(n,g,k?u:void 0)),raw:h,align:m}),k&&(u=RA(u,pd(h))),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(`
189
+ `)},o+1]}function IK(){return{type:"thematic_break",raw:"---"}}let Lg=null;const Ng=new WeakMap;function Mw(){return Lg||(Lg={allowedTagSet:Rp(),customTagSet:null}),Lg}function $K(e){if(!e||e.length===0)return Mw();const t=Ng.get(e);if(t)return t;const n=e.map(ci).filter(Boolean);if(!n.length){const s=Mw();return Ng.set(e,s),s}const o={allowedTagSet:Rp({customHtmlTags:e}),customTagSet:new Set(n)};return Ng.set(e,o),o}function LK(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[p,h]of s)if(p==="class"){const m=h.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(p.startsWith("data-")){const m=p.slice(5);try{r[m]=JSON.parse(h)}catch{r[m]=h}}}const l=[],a=ul(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const p=e[c+1];if(p){const h={type:"paragraph",children:Kn(p.children||[],void 0,void 0,a.options()),raw:String(p.content??"")};l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[p,h]=Cc(e,c,a.options());l.push(p),a.remember(p.raw),c=h}else if(e[c].type==="blockquote_open"){const[p,h]=xc(e,c,a.options());l.push(p),a.remember(p.raw),c=h}else{const p=Lp(e,c,a.options());p?(l.push(p[0]),a.remember(p[0].raw),c=p[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+=`
190
+ `,l.length>0&&(f+=o.raw??l.map(p=>p.raw).join(`
191
+ `),f+=`
192
+ `),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 NK(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function RK(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function OK(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${Ps(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Ps(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=Vn(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=Vn(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 PK(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=Vn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const h=c+1;return{raw:e.slice(r,h),end:h}}let u=1,d=c+1;const f=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(m)},p=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const h=e.indexOf("<",d);if(h===-1)return{raw:e.slice(r),end:e.length};if(p(h)){const m=e.indexOf(">",h);if(m===-1)return null;if(u--,u===0){const w=m+1;return{raw:e.slice(r,w),end:w}}d=m+1;continue}if(f(h)){const m=Vn(e.slice(h));if(m===-1)return null;u++,d=h+m+1;continue}d=h+1}return{raw:e.slice(r),end:e.length}}function mv(e){return Number.isFinite(e)&&e>0?e:0}function DK(e,t){const n=mv(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
193
+ `&&(o++,o===n))return s+1;return e.length}function Lp(e,t,n){const o=e[t];switch(o.type){case"heading_open":return[CK(e,t,n),t+3];case"code_block":return[_K(o),t+1];case"fence":return[X0(o),t+1];case"math_block":return[AK(o),t+1];case"html_block":{const s=LA(o),i=s.tag?$K(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)?DK(l,Number(o.map?.[0]??0)):0,u=PK(l,r,Math.max(mv(a),mv(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??s.raw??""),f=Vn(d),p=f!==-1?d.slice(0,f+1):d,h=f!==-1&&/\/\s*>\s*$/.test(p),m=f===-1?null:OK(d,r,f+1),w=m?.start??-1;let k="";f!==-1&&(w!==-1&&f<w?k=d.slice(f+1,w):k=d.slice(f+1)),w===-1&&(k=RK(k,r));const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(p))!==null;){const O=y[1];if(!O||O.toLowerCase()===r)continue;const L=y[2]||y[3]||y[4]||"";g.push([O,L])}const M=!n?.final&&!h&&m==null;return[{type:r,tag:r,content:NK(k),raw:String(u?.raw??s.raw??d),loading:M,attrs:g.length?g:void 0},t+1]}return[s,t+1]}case"table_open":{const[s,i]=EK(e,t,n);return[s,i]}case"dl_open":{const[s,i]=wK(e,t,n);return[s,i]}case"footnote_open":{const[s,i]=SK(e,t,n);return[s,i]}case"hr":return[IK(),t+1]}return null}function ey(e,t,n,o){const s=Lp(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 LK(e,t,n)}return null}function BK(){return{type:"hardbreak",raw:`\\
194
+ `}}function FK(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:Kn(o.children||[],s,void 0,n),raw:s}}const Tw=new WeakMap,Np=new WeakMap,HK=["$$","\\["];function mc(){return typeof performance<"u"?performance.now():Date.now()}function ty(e,t,n){e&&(e[t]=(e[t]??0)+n)}function OA(e){return e.__timing}function Rg(e,t,n){return t&&ty(t,"parseMarkdownToStructureTotalMs",mc()-n),e}function Ew(e,t,n){if(!n)return Dw(e,t);const o=mc(),s=Dw(e,t);return ty(n,"processTokensMs",mc()-o),s}function zK(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=Sc(t);return n.length?new Set(n):null}function WK(e,t){const n=e;let o=Tw.get(n);o||(o=new Map,Tw.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 UK(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function mf(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]=Nl(s.value,n))}}function Nl(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(Nl(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Nl(l,t),Nl(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Nl(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),mf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),mf(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),mf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!UK(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),mf(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=Nl(i[r],t);return s}function PA(e,t=!0){if(!t)return jl(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=>PA(a,t)):t&&r&&typeof r=="object"&&(l=Nl(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function Iw(e,t=!0){return e.map(n=>PA(n,t))}function DA(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 qK(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 jK(e){Np.delete(e)}function VK(e,t,n){Np.set(e,{source:t,key:n,pendingCandidate:n===null&&SA(t)})}function KK(e){return e.endsWith("$")||e.endsWith("\\")}function GK(e){const t=Math.max(e.lastIndexOf(`
195
+ `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return HK.some(o=>n.endsWith(o))}function YK(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||GK(e)&&/[\r\n]/.test(t)):!1}function QK(e,t){if(!gA(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=Np.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&&!YK(s.source,l)&&!KK(t)){s.source=t;return}}const i=uV(t),r=s?!t.startsWith(s.source):!1;(s&&(r||s.key!==i)||!s&&i)&&n.reset(),VK(e,t,i)}function XK(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function ZK(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 Og(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&&ZK(e,t)}function $w(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function JK(e){for(let t=0;t+5<e.length;t++)if($w(e,t)&&$w(e,t+3)&&Og(e[t],e[t+3])&&Og(e[t+1],e[t+4])&&Og(e[t+2],e[t+5]))return!0;return!1}function eG(e,t,n){return gA(e)&&SA(t)&&JK(n)}function tG(e){const t=Np.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function Lw(e,t,n,o){if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!DA(e,o)||(QK(e,t),tG(e)))return e.parse(t,n);const s=e.stream.parse(t,WK(e,n));if(eG(e,t,s))return e.stream?.reset?.(),e.parse(t,n);if(!XK(o))return s;const i=OA(o);if(!i)return Iw(s,!0);const r=mc(),l=Iw(s,!0);return ty(i,"tokenCloneMs",mc()-r),l}function Rp(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Qu;const n=new Set(Qu);for(const o of Sc(t))o&&n.add(o);return n}function nG(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 Nw(e){return{type:"paragraph",children:e,raw:e.map(nG).join("")}}function Rw(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=zK(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(p=>p?.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(Nw(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(Nw(c)),a}function oG(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 Su(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function sG(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*${Ps(t)}\s*>\s*$`,"i").test(n)}function ny(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${Ps(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=Vn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(sa.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*${Ps(o)}(?=\s|>|/)`,"i").test(m)},p=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${Ps(o)}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const h=e.indexOf("<",d);if(h===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(p(h)){const m=Vn(e.slice(h));if(m===-1)return null;u--;const w=h+m+1;if(u===0)return{raw:e.slice(r,w),start:r,end:w,closed:!0};d=w;continue}if(f(h)){const m=Vn(e.slice(h));if(m===-1)return null;const w=e.slice(h,h+m+1);/\/\s*>$/.test(w)||u++,d=h+m+1;continue}d=h+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function iG(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]===`
196
+ `){n++;continue}return-1}return o===t.length?n:-1}function rG(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
197
+ </${t}>`}function Ow(e){return e.replace(/\r\n/g,`
198
+ `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function lG(e,t,n){return n?e.includes(n,t)?!0:Ow(e.slice(Math.max(0,t))).includes(Ow(n)):!1}function aG(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
199
+ `&&n++,n):e[n]===`
200
+ `?n+1:t}function Pw(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 cG(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function oy(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Ps(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function BA(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const uG=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),dG=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function fG(e){return/\n\s*\n/.test(e)||dG.test(e)}function hG(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>uG.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(!fG(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function pG(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"||J3.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=Vn(l);if(a===-1)return s;const c=oy(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return s;const d=Cu(u,t,BA(n,o));return hG(u,d)?{...s,children:d}:s})}function Cu(e,t,n){return e.trim()?HA(e,t,{...n,__disableStreamParse:!0}):[]}function mG(e,t,n){const o=Cu(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function gG(e,t,n){const o=LA({content:e}),s=Vn(e),i=oy(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=mG(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function vG(e,t,n){const o=Vn(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=ny(s,"summary",0);if(!i)return Cu(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...Cu(r,t,n),gG(i.raw,t,n),...Cu(l,t,n)]}function FA(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=Su(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!Pw(c)){r.push(c);continue}const f=String(c.raw??Su(c)??""),p=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(p===-1){r.push(c);continue}let h=1,m=-1;for(let Y=a+1;Y<e.length;Y++){const q=e[Y];if(Pw(q)){h++;continue}if(cG(q)&&(h--,h===0)){m=Y;break}}const w=ny(t,"details",p),k=m===-1&&w?.closed===!0,g=k?(()=>{const Y=oy(f,"details");return Y!==-1?f.slice(0,Y):f})():f,[v]=FA(k?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,o,s,p+f.length),y=vG(g,n,BA(o,s)),M=m===-1?"</details>":String(e[m].raw??Su(e[m])??"</details>"),O=k||m!==-1&&w?.closed===!0,L=M.replace(/[\t\r\n ]+$/,""),b=O?(()=>{const Y=(w?.raw??"").lastIndexOf(L);return Y===-1?t.length:p+Y})():t.length,T=Vn(f),$=k&&T!==-1?p+T+1:p+f.length,N=t.slice($,b===-1?t.length:b),S=n.parse(N,{__markstreamFinal:s}),E=n.renderer.render(S,n.options,{__markstreamFinal:s}),P=b+L.length,D=O?Math.max(b+M.length,aG(t,P)):t.length,F=O?t.slice(b,D):M,W=O?t.slice(p,D):t.slice(p),K=k&&T!==-1?f.slice(0,T+1):f;if(r.push({...c,tag:"details",attrs:$p(f.slice(0,T+1)),raw:W,content:`${K}${E}${F}`,children:[...y,...v],loading:!s&&!O}),l=O?D:t.length,m===-1&&!k)break;m!==-1&&(a=m)}return[r,l]}function yG(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=Su(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=ny(n,c,a!==-1?a:s);if(!u)continue;s=u.end;const d=String(r.content??l),f=String(r.raw??d),p=rG(u.raw,c,u.closed),h=!t&&!u.closed,m=d!==p||f!==u.raw||!!r.loading!==h,w=Vn(u.raw),k=w===-1?"":u.raw.slice(0,w+1),g=k?$p(k):[];if(r.content=p,r.raw=u.raw,r.loading=h,r.attrs=g.length?g:void 0,!m)continue;let v=iG(u.raw,f);v===-1&&(v=0);const y=i+1;for(;y<o.length;){if(u.closed&&sG(o[y],c)){o.splice(y,1);continue}const M=Su(o[y]);if(!M)break;const O=u.raw.indexOf(M,v);if(O===-1){if(lG(n,u.end,M))break;o.splice(y,1);continue}v=O+M.length,o.splice(y,1)}}return o}function kG(e){const t=l=>l===" "||l===" "||l===`
201
+ `||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=m=>{const w=m.charCodeAt(0);return w>=65&&w<=90||w>=97&&w<=122},u=m=>{const w=m.charCodeAt(0);return w>=48&&w<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",p=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",h=p;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(!p(l[a]))return!1;for(a++;a<l.length&&h(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 m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const w=l[a];if(t(w)||w==="<"||w===">"||w==='"'||w==="'"||w==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=g=>g===" "||g===" ",p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;const y=g[v];if(y!=="`"&&y!=="~")return null;let M=v;for(;M<g.length&&g[M]===y;)M++;const O=M-v;return O<3?null:{markerChar:y,markerLen:O,rest:g.slice(M)}},h=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;let y=!1;for(;v<g.length&&g[v]===">";)for(y=!0,v++;v<g.length&&f(g[v]);)v++;return y?g.slice(v):null},m=g=>{const v=p(g);if(v)return v;const y=h(g);return y==null?null:p(y)};let w=0;const k=l.split(/\r?\n/);for(const g of k){const v=w,y=w+g.length;if(a<v)break;const M=m(g);if(M){const O=M.markerChar,L=M.markerLen;c?O===u&&L>=d&&/^\s*$/.test(M.rest)&&(c=!1,u="",d=0):(c=!0,u=O,d=L)}if(a<=y)break;w=y+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===`
202
+ `||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]===`
203
+ `||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function bG(e,t){if(!e||!t.length)return e;const n=new Set(t.map(h=>String(h??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=h=>h===" "||h===" ",s=h=>{const m=h.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||h==="_"||h==="-"||h===":"},i=h=>{if(!h)return!1;if(h[0]===" ")return!0;let m=0;for(let w=0;w<h.length;w++){const k=h[w];if(k===" "){if(m++,m>=4)return!0;continue}if(k===" ")return!0;break}return!1},r=h=>{let m=!1,w=!1;for(let k=0;k<h.length;k++){const g=h[k];if(g==="\\"){k++;continue}if(!w&&g==="'"){m=!m;continue}if(!m&&g==='"'){w=!w;continue}if(!m&&!w&&g===">")return k}return-1},l=h=>{let m=0;for(;m<h.length&&o(h[m]);)m++;const w=h[m];if(w!=="`"&&w!=="~")return null;let k=m;for(;k<h.length&&h[k]===w;)k++;const g=k-m;return g<3?null:{markerChar:w,markerLen:g,rest:h.slice(k)}},a=(h,m)=>{if(i(h))return-1;const w=h.replace(/^[ \t]+/,"");if(!w||w.startsWith(">")||w.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(w))return-1;let k=!1,g=0;for(;g<h.length;){const v=h[g];if(v!=="<"){o(v)||(k=!0),g++;continue}const y=r(h.slice(g));if(y===-1){k=!0,g++;continue}const M=h.slice(g,g+y+1);let O=1;for(;O<M.length&&o(M[O]);)O++;if(O>=M.length){k=!0,g++;continue}const L=M[O];if(L==="!"||L==="?"){k=!0,g+=y+1;continue}if(L==="/"){k=!0,g+=y+1;continue}const b=O;for(;O<M.length&&s(M[O]);)O++;if(O===b){k=!0,g++;continue}const T=M.slice(b,O).toLowerCase(),$=M[O];if($&&$!==" "&&$!==" "&&$!==">"&&$!=="/"){k=!0,g++;continue}const N=new RegExp(String.raw`<\s*\/\s*${T}\s*>`,"i"),S=/\/\s*>$/.test(M),E=N.test(h.slice(g+y+1)),P=N.test(e.slice(m+g+y+1)),D=/[\r\n]/.test(e.slice(m+g+y+1));if(k&&n.has(T)&&!S&&!E&&(P||D))return g;k=!0,g+=y+1}return-1};let c=!1,u="",d=0,f="",p=0;for(;p<e.length;){const h=e.indexOf(`
204
+ `,p),m=h!==-1,w=m&&h>p&&e[h-1]==="\r",k=m?w?h-1:h:e.length,g=e.slice(p,k),v=m?w?`\r
205
+ `:`
206
+ `:"",y=l(g);let M=g;if(!c&&!y){const O=a(g,p);if(O!==-1){const L=v||`
207
+ `;M=`${g.slice(0,O).replace(/[ \t]+$/,"")}${L}${L}${g.slice(O).replace(/^[ \t]+/,"")}`}}f+=M,f+=v,y&&(c?y.markerChar===u&&y.markerLen>=d&&/^\s*$/.test(y.rest)&&(c=!1,u="",d=0):(c=!0,u=y.markerChar,d=y.markerLen)),p=m?h+1:e.length}return f}function _G(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,p=!1;for(let h=0;h<d.length;h++){const m=d[h];if(m==="\\"){h++;continue}if(!p&&m==="'"){f=!f;continue}if(!f&&m==='"'){p=!p;continue}if(!f&&!p&&m===">")return h}return-1},l=(d,f,p)=>{const h=p.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let w=m+1;for(;w<d.length&&o(d[w]);)w++;if(w>=d.length||d[w]!=="/"){m=d.indexOf("<",m+1);continue}for(w++;w<d.length&&o(d[w]);)w++;if(w+h.length>d.length){m=d.indexOf("<",m+1);continue}let k=!0;for(let v=0;v<h.length;v++){const y=d[w+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==h[v]){k=!1;break}}if(!k){m=d.indexOf("<",m+1);continue}let g=w+h.length;if(g<d.length&&s(d[g])){m=d.indexOf("<",m+1);continue}for(;g<d.length&&o(d[g]);)g++;if(g<d.length&&d[g]===">")return!0;m=d.indexOf("<",m+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 p=f;for(;f<d.length&&s(d[f]);)f++;if(f===p)return d;const h=d.slice(p,f).toLowerCase();if(!n.has(h))return d;const m=r(d.slice(f));if(m===-1)return d;const w=f+m;if(l(d,w+1,h))return d;const k=i(d.slice(w+1));return k?`${d.slice(0,w+1)}
208
+ ${k}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
209
+ `,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",p=f?d-1:d,h=e.slice(u,p);c+=a(h),c+=f?`\r
210
+ `:`
211
+ `,u=d+1}return c}function wG(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 p=0,h=!1,m=0;for(;p<f.length;){for(;p<f.length&&o(f[p]);)p++;if(p>=f.length||f[p]!==">")break;for(h=!0,p++;p<f.length&&o(f[p]);)p++;m=p}return h?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let p=0;for(;p<f.length&&o(f[p]);)p++;const h=f[p];if(h!=="`"&&h!=="~")return null;let m=p;for(;m<f.length&&f[m]===h;)m++;const w=m-p;return w<3?null:{markerChar:h,markerLen:w,rest:f.slice(m)}},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(`
212
+ `,d),p=f!==-1,h=p&&f>d&&e[f-1]==="\r",m=p?h?f-1:f:e.length,w=e.slice(d,m),k=p?h?`\r
213
+ `:`
214
+ `:"",g=s(w),v=g?.prefix??"",y=g?.content??w,M=i(y);M&&(l?M.markerChar===a&&M.markerLen>=c&&/^\s*$/.test(M.rest)&&(l=!1,a="",c=0):(l=!0,a=M.markerChar,c=M.markerLen));let O=y;if(!l&&O.includes("</"))for(const L of r)O=O.replace(L,(b,T,$,N)=>{if(N.replace(/^[\t ]+/,"").startsWith("|"))return b;const S=N.slice(0,$).replace(/^[\t ]+/,"");if(S.length>0){const E=T.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",P=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!E||!P||E!==P)return b}return`${T}
215
+
216
+ `});if(v){const L=v+O.split(`
217
+ `).join(`
218
+ ${v}`);u+=L}else u+=O;u+=k,d=p?f+1:e.length}return u}function SG(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 E=0;for(let P=0;P<S.length;P++){const D=S[P];if(D===" "){if(E++,E>=4)return!0;continue}if(D===" ")return!0;break}return!1},i=S=>{const E=S.charCodeAt(0);return E>=65&&E<=90||E>=97&&E<=122||E>=48&&E<=57||S==="_"||S==="-"||S===":"},r=S=>{let E=0;for(;E<S.length&&o(S[E]);)E++;return S.slice(E)},l=S=>{let E=0,P=!1,D=0;for(;E<S.length;){for(;E<S.length&&o(S[E]);)E++;if(E>=S.length||S[E]!==">")break;for(P=!0,E++;E<S.length&&o(S[E]);)E++;D=E}if(!P)return null;const F=S.slice(0,D);return{prefix:F,key:F.replace(/[ \t]+$/,""),content:S.slice(D)}},a=S=>r(S).startsWith("<"),c=S=>{for(let E=0;E<S.length;E++){const P=S[E];if(P!==" "&&P!==" ")return!1}return!0},u=S=>{if(s(S))return"";const E=r(S);if(!E.startsWith("<"))return"";let P=1;for(;P<E.length&&o(E[P]);)P++;if(P>=E.length||E[P]==="/"||E[P]==="!"||E[P]==="?")return"";const D=P;for(;P<E.length&&i(E[P]);)P++;if(P===D)return"";const F=E.slice(D,P).toLowerCase();if(!n.has(F))return"";const W=E[P];return W&&W!==" "&&W!==" "&&W!==">"&&W!=="/"?"":F},d=S=>{if(s(S))return null;const E=r(S);if(!E.startsWith("<"))return null;let P=1;for(;P<E.length&&o(E[P]);)P++;if(P>=E.length)return null;const D=E[P]==="/";if(D)for(P++;P<E.length&&o(E[P]);)P++;const F=E[P];if(!F||F==="!"||F==="?")return null;const W=P;for(;P<E.length&&i(E[P]);)P++;if(P===W)return null;const K=E.slice(W,P).toLowerCase();if(!n.has(K))return null;const Y=E[P];if(Y&&Y!==" "&&Y!==" "&&Y!==">"&&Y!=="/")return null;if(D)return{type:"close",name:K};if(/\/\s*>\s*$/.test(E))return{type:"open",name:K,complete:!0};const q=E.indexOf(">",P);if(q!==-1){const ae=E.slice(q+1);if(new RegExp(`<\\s*\\/\\s*${K}\\s*>`,"i").test(ae))return{type:"open",name:K,complete:!0}}return{type:"open",name:K,complete:!1}},f=S=>{if(s(S))return null;const E=r(S).replace(/[ \t]+$/,"");if(!E.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(E))return null;const P=E.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(P?.[1])return P[1].toLowerCase();const D=E.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!D?.[1]||!D[2])return null;const F=D[1].toLowerCase();return F===D[2].toLowerCase()?F:null};let p=!1,h="",m=0;const w=S=>{let E=0;for(;E<S.length&&o(S[E]);)E++;const P=S[E];if(P!=="`"&&P!=="~")return null;let D=E;for(;D<S.length&&S[D]===P;)D++;const F=D-E;return F<3?null:{markerChar:P,markerLen:F,rest:S.slice(D)}},k=S=>w(S),g=S=>{const E=r(S);return E?s(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(E):!1},v=(S,E,P)=>{let D=S,F=0;for(;D<e.length;){const W=e.indexOf(`
219
+ `,D),K=W!==-1,Y=K&&W>D&&e[W-1]==="\r",q=K?Y?W-1:W:e.length,ae=e.slice(D,q),ce=l(ae),ne=ce?.key??"";if(F>0&&E&&ne!==E)break;const Q=ce?.content??ae,ee=d(Q);if(ee?.name===P){if(ee.type==="open")ee.complete||F++;else if(F>0&&(F--,F===0))return!1}else if(F>0&&(c(Q)||g(Q)))return!0;if(K)D=W+1;else break}return!1};let y="",M=0,O=!0,L=!1,b=!1,T=`
220
+ `;const $=[];let N="";for(;M<e.length;){const S=e.indexOf(`
221
+ `,M),E=S!==-1,P=E&&S>M&&e[S-1]==="\r",D=E?P?S-1:S:e.length,F=e.slice(M,D),W=E?P?`\r
222
+ `:`
223
+ `:"",K=l(F),Y=K?.key??"",q=K?.content??F,ae=k(q);ae&&(p?ae.markerChar===h&&ae.markerLen>=m&&/^\s*$/.test(ae.rest)&&(p=!1,h="",m=0):(p=!0,h=ae.markerChar,m=ae.markerLen));const ce=$.length>0;if(!p&&!ce){const Q=u(q),ee=!!Q&&!O&&L&&b&&v(M,Y,Q);Q&&!O&&(!L||ee)&&(Y&&N&&Y===N?y+=`${Y}${T}`:Y||(y+=T))}if(y+=F,y+=W,W&&(T=W),!p){const Q=d(q);if(Q){if(Q.type==="open")Q.complete||$.push(Q.name);else for(let ee=$.length-1;ee>=0;ee--)if($[ee]===Q.name){$.length=ee;break}}}const ne=c(q);O=ne,L=!ne&&a(q),b=!ne&&!!f(q),N=Y,M=E?S+1:e.length}return y}function HA(e,t,n={}){const o=OA(n),s=o?mc():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(qK(t,n)&&(t.stream.reset(),jK(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,w=>w.startsWith(`
224
+ `)?`
225
+ `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,w=>w.startsWith(`
226
+ `)?`
227
+ `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,w=>w.startsWith(`
228
+ `)?`
229
+ `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
230
+ `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,w=>w.startsWith(`
231
+ `)?`
232
+ `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(w,k,g)=>`${k}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,w=>w.startsWith(`
233
+ `)?`
234
+ `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
235
+ `))),n.customHtmlTags?.length&&r.includes("<")){const w=Sc(n.customHtmlTags);if(w.length&&(r=bG(r,w),r=_G(r,w),r=SG(r,w),r=wG(r,w),r.includes("</")))for(const k of w){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${k}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=kG(r));const l=oG(r);if(l){const w=n.preTransformTokens,k=n.postTransformTokens;if(DA(t,n)||typeof w=="function"||typeof k=="function"){const g=Lw(t,r,{__markstreamFinal:i},n),v=typeof w=="function"&&w(g)||g;typeof k=="function"&&k(v)}return Rg(l,o,s)}const a=Lw(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return Rg([],o,s);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,p=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),h={...n,validateLink:p,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let m=Ew(d,h,o);if(u&&typeof u=="function"){const w=u(d);if(Array.isArray(w)){const k=w[0],g=k?.type;k&&typeof g=="string"?m=Ew(w,void 0,o):m=w}}if(m=yG(m,i,r),m=FA(m,r,t,n,i)[0],m=pG(m,t,n,i),i){const w=new WeakSet,k=g=>{if(!g||typeof g!="object"||w.has(g))return;if(w.add(g),Array.isArray(g)){for(const y of g)k(y);return}const v=g;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))k(y)};k(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),Rg(m,o,s)}function Dw(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=ul(t);let s=0;for(;s<e.length;){const i=ey(e,s,o.options(),J0);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=FK(e,s,o.options(l)),c=Rw(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]=Cc(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"blockquote_open":{const[l,a]=xc(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(BK()),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=Kn(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=Rw(c,t);u?n.push(...u):n.push(c)}o.remember(l)}s+=1;break;default:s+=1;break}}return n}const CG=new Set([...hd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),xG=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"]),Bw=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function Fw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function AG(e){return typeof e=="string"?e:e==null?"":String(e)}function zA(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Wr(e){return AG(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function WA(e){return Wr(e).replace(/`/g,"&#96;")}function Op(e){return String(e??"").trim().toLowerCase()}function sy(e,t="safe"){const n=Op(e);return n?t==="escape"?!0:t==="trusted"?hd.has(n):!xG.has(n):!1}function UA(e,t="safe"){const n=Op(e);return n?t==="escape"?!0:t==="trusted"?hd.has(n):CG.has(n):!1}function Hw(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${WA(o)}"`).join("")}function MG(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||ql(s,{tagName:t,attrName:"srcset"})})}function qA(e,t,n,o){return uq.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?MG(t,o):!!(dq.has(e)&&t&&ql(t,{tagName:o,attrName:e}))}function Rl(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function jA(e,t,n,o=!1){if(t!=="safe"||Op(n)!=="a")return e;const s=Rl(e,"href");if(o&&(!s||!e[s])){const a=Rl(e,"target"),c=Rl(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Rl(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Rl(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 zw(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!zA(r)||qA(l,i,t,n)||(o[r]=i)}return jA(o,t,n,!!Rl(e,"href"))}function VA(e,t){const n=e.toLowerCase();return Z3.has(n)?!1:Fw(t,n)||Fw(t,e)}function iy(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!zA(r)||qA(l,i,t,n)||(o[r]=i)}return jA(o,t,n,!!Rl(e,"href"))}function Oh(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 gv(e,t="safe",n){const o=iy(Oh(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function TG(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 EG(e){const t={};for(const[n,o]of Object.entries(e))t[n]=TG(o,n);return t}function Ww(e){return e.trim().length>0}function IG(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);Ww(a)&&t.push({type:"text",content:a})}break}if(o>n){const a=e.slice(n,o);Ww(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 p;for(;(p=f.exec(u))!==null;){const h=p[1],m=p[2]??p[3]??p[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||sa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=s+1}return t}function $G(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 p;for(;(p=f.exec(u))!==null;){const h=p[1],m=p[2]??p[3]??p[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||sa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function LG(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${Wr(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${Wr(o)}`:` ${Wr(o)}="${WA(s)}"`).join("");return e.type==="self_closing"?`&lt;${Wr(t)}${n} /&gt;`:`&lt;${Wr(t)}${n}&gt;`}function NG(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;Bw.lastIndex=0;let n;for(;(n=Bw.exec(e))!==null;)if(VA(n[1],t))return!0;return!1}function rc(e,t="safe"){if(!e)return"";if(t==="escape")return Wr(e);const n=$G(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(Wr(r.content??""));continue}const l=Op(r.tagName);if(!l)continue;if(UA(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"&&sy(l,t)){s.push(LG(r));continue}if(r.type==="self_closing"){s.push(`<${l}${Hw(zw(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${Hw(zw(r.attrs??{},t,l))}>`),sa.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 RG=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],Uw="http://www.w3.org/2000/svg",OG=new Set(["script","style","iframe","object","embed","link","meta"]),PG=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"]),DG=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),BG=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),FG=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function HG(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function zG(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function WG(e){const t=e.nodeName.toLowerCase();return t==="use"?HG(e):t==="image"?zG(e):t==="text"||t==="tspan"?!!e.textContent?.trim():FG.has(t)}function UG(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 qG(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")?ql(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?ql(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":ql(i,{tagName:o,attrName:s})?"":i:""}function jG(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 KA(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 GA(e){const t=KA(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=jG(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function qw(e){const t=KA(e);return RG.some(n=>n.test(t))||GA(t)}function VG(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 YA(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(!OG.has(o)){if(o==="br"){t.push(`
236
+ `);return}for(const s of Array.from(n.childNodes))YA(s,t)}}function KG(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];YA(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(Uw,"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 p=e.ownerDocument.createElementNS(Uw,"tspan");p.setAttribute("x",String(r+s/2)),p.setAttribute("dy",d===0?`${u}em`:"1.2em"),p.textContent=f,a.appendChild(p)}}t.parentNode?.replaceChild(a,t)}}function GG(e){KG(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!PG.has(o)){n.remove();continue}if(o==="style"&&qw(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&&qw(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(DG.has(r)&&i.value){const l=qG(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(BG.has(r)&&i.value&&GA(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=UG(i.value);l!==i.value&&n.setAttribute(i.name,l)}}VG(n)}}function Tye(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 GG(n),YG(n)?null:n}catch{return null}}function YG(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){WG(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 jw=[];function Pg(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function QG(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function XG(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function Vw(e=`editor-${Date.now()}`,t={}){const n=pV(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=p=>f[p]??o[p]??p}else s=f=>o[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const p=f;if(Array.isArray(p)){const[h,...m]=p;typeof h=="function"&&n.use(h,...m)}else typeof p=="function"&&n.use(p)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(p){console.error("[getMarkdown] apply function threw an error",p)}if(jw.length)for(const f of jw)if(Array.isArray(f)){const[p,...h]=f;typeof p=="function"&&n.use(p,...h)}else typeof f=="function"&&n.use(f);n.use(LF),n.use(OF),n.use(EF);const i=YF,r=i.default??i;n.use(r),n.use(TF),n.use(MF),n.core.ruler.after("block","mark_fence_closed",f=>{const p=f,h=p.src,m=!!p.env?.__markstreamFinal,w=h.split(/\r?\n/);for(const k of p.tokens){if(k.type!=="fence"||!k.map||!k.markup)continue;const g=k.map[0],v=k.map[1],y=k.markup,M=y[0],O=y.length,L=w[Math.max(0,v-1)]??"";let b=0;for(;b<L.length&&(L[b]===" "||L[b]===" ");)b++;let T=0;for(;b+T<L.length&&L[b+T]===M;)T++;let $=b+T;for(;$<L.length&&(L[$]===" "||L[$]===" ");)$++;const N=m?!0:v>g+1&&T>=O&&$===L.length,S=k;S.meta=S.meta??{},S.meta.unclosed=!N,S.meta.closed=!!N}});const l=(f,p)=>{const h=f,m=h.pos;if(h.src[m]!=="~")return!1;const w=h.src[m-1],k=h.src[m+1];if(/\d/.test(w)&&/\d/.test(k)){if(!p){const g=h.push("text","",0);g.content="~"}return h.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,p)=>{const h=f[p],m=String(h.info??"").trim(),w=String(h.content??""),k=btoa(unescape(encodeURIComponent(w))),g=QG(m),v=Pg(g),y=XG(`editor-${e}-${p}-${g}`),M=Pg(s("common.copy"));return`<div class="code-block" data-code="${k}" data-lang="${v}" id="${y}">
237
+ <div class="code-header">
238
+ <span class="code-lang">${Pg(g.toUpperCase())}</span>
239
+ <button class="copy-button" data-code="${k}">${M}</button>
240
+ </div>
241
+ <div class="code-editor"></div>
242
+ </div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const p=c.exec(f);if(!p)return f!=="["&&!/^\[\d+$/.test(f);const h=String(p[1]??"");return f.slice(p[0].length).startsWith("(")?!1:!/^\d+$/.test(h)},d=(f,p)=>{const h=f;if(h.src[h.pos]!=="[")return!1;const m=a.exec(h.src.slice(h.pos));if(!m)return!1;const w=h.src.slice(Math.max(0,h.pos-120),h.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(w))return!1;const k=h.src.slice(h.pos+m[0].length);if(k.startsWith("](")||k.startsWith("(")||u(k))return!1;if(!p){const g=m[1],v=h.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return h.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,p)=>{const m=String(f[p].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function ZG({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 QA({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}:ZG({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const Kw=new WeakMap;function JG(e){let t=Kw.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},Kw.set(e,t)),t}function Gw(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 ry(e){return!!(e.themes?.length||e.langs?.length)}function XA(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function eY(e,t){return!t?.length||e.registeredAllLangs?!0:XA(e.registeredLangs,t)}function Dg(e,t){return ry(t)&&XA(e.registeredThemes,t.themes)&&eY(e,t.langs)}function tY(e,t){if(!ry(t))return t;const n=Gw(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:Gw(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const nY={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 oY(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function ZA(e){const t=oY(e);return nY[t]??t}function JA(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>ZA(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function eM(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 sY(e){return eM(e)?.join("\0")??""}function tM(e,t){const n=eM(e),o=JA(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function Ph(e,t){return`${sY(e)}\0\0${JA(t)?.join("\0")??""}`}function Eye(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=tM(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:Ph(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function Iye(e,t={},n){if(!e)return"ready";const o=tM(t.themes,t.langs),s=Ph(o.themes,o.langs),i=n&&n===s?n:s,r=JG(e);if(r.completed.has(i))return"ready";if(Dg(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)||Dg(r,o))return r.completed.add(i),"ready";const c=tY(r,o),u=Ph(c.themes,c.langs);return r.completed.has(u)||Dg(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(ry(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 Ma(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function Yw(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var iY=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,p=this.pendingChars<=0;if(this.source+=d,p){const h=Qw();this.startedAt=f&&this.hasStarted?h-this.normalizedStartDelayMs:h,this.lastTick=h,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=Qw();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),p=Math.min(100,Math.max(0,d-this.lastTick));if(p<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const h=this.pendingChars,m=h>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,w=cY(h/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(w-this.currentCps)*.2,this.charBudget+=this.currentCps*(p/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=aY(this.source.slice(this.visible.length),k,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.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=Ma(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Ma(o,1e3,1)),this.normalizedTargetLatencyMs=Ma(s,900,1),this.normalizedCatchUpLatencyMs=Ma(i,350,1),this.normalizedCatchUpThreshold=Yw(r,600),this.normalizedStartDelayMs=Yw(a,80),this.maxCommitFps=Math.trunc(Ma(l,30,1)),this.maxCharsPerCommit=Math.trunc(Ma(c,80,1)),this.flushOnFinish=u,this.segmenter=lY(),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 rY(e={},t){const n=new iY(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 lY(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function aY(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 Qw(){return typeof performance<"u"?performance.now():Date.now()}function cY(e,t,n){return Math.min(n,Math.max(t,e))}var uY=(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 vv=Symbol.for("markstream-vue:node-lifecycle"),Xw='<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>',Zw='<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>',dY={id:"material",core:{"":Zw,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:Zw,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:Xw,csharp:Xw,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:()=>ns(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},yv=new Map;let Jw="material";const ja=new Map,eS=new Map;let kv=null;function fY(e){yv.set(e.id,e)}function hY(e){return uY(this,null,function*(){var t,n,o;if(ja.has(e.id))return(t=ja.get(e.id))!=null?t:null;let s=eS.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(ja.set(e.id,i),kv?.(),i)).catch(()=>(ja.set(e.id,null),null)),eS.set(e.id,s)),s})}const pY=ta(0);kv=()=>{pY.value++},fY(dY);const mY={"":"",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 ly(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=mY[n])!=null?t:n}function $ye(e){const t=ly(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Lye(e){return(function(o){const s=yv.get(Jw);if(!s)return;const i=s.core[o];if(i)return i;const r=ja.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!ja.has(s.id)&&hY(s)})(ly(e))||((n=(t=yv.get(Jw))==null?void 0:t.fallback)!=null?n:"");var t,n}const Nye={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 nM=!1;function Rye(){return nM}function Oye(){nM=!0}var Pp=(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 Ls=null,Pf=!1,Dp=cy;function Bp(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function ay(){try{const e=globalThis;return Bp(e?.katex)}catch{return null}}function cy(){return Pp(null,null,function*(){const e=ay();if(e)return e;const t=yield ns(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ns(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Bp(t)})}function gY(e){Dp=e,Ls=null,Pf=!1}function vY(e){gY(cy)}function oM(){return typeof Dp=="function"}function Pye(){var e;const t=Dp;if(!t||t===cy)return null;if(Ls)return Ls;const n=ay();if(n)return Ls=n,Ls;try{const o=t();return o&&typeof o?.then!="function"?(Ls=(e=Bp(o))!=null?e:o,Ls):null}catch{return null}}function uy(){return Pp(this,null,function*(){var e;const t=ay();if(t)return Ls=t,Ls;if(Ls)return Ls;if(Pf)return null;const n=Dp;if(!n)return Pf=!0,null;try{const o=yield n();if(o)return Ls=(e=Bp(o))!=null?e:o,Ls}catch{}return Pf=!0,null})}function sM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let qr=null,Fr=null;const ti=new Map,ir=new Map;let Dh=5;const Bl=new Set;function ed(){if(ti.size<Dh&&Bl.size){const e=Array.from(Bl);Bl.clear();for(const t of e)try{t()}catch{}}}function yY(e){qr=e,Fr=null,qr.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=ti.get(n);if(i)if(ti.delete(n),clearTimeout(i.timeoutId),ed(),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)}},qr.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of ti.entries())clearTimeout(o.timeoutId),o.reject(new Error(`Worker error: ${t.message}`));ti.clear(),ed()}}function kY(){var e;qr&&((e=qr.terminate)==null||e.call(qr)),qr=null,Fr=null}function bY(e,t=!0,n=2e3,o){return Pp(this,null,function*(){performance.now();const s=sM(e);if(!oM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Fr)return Promise.reject(Fr);const i=`${t?"d":"i"}:${s}`,r=ir.get(i);if(r)return Promise.resolve(r);const l=qr||(Fr=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Fr.name="WorkerInitError",Fr.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Fr);if(ti.size>=Dh){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=ti.size,a.max=Dh,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const h=new Error("Aborted");return h.name="AbortError",void c(h)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{ti.delete(u);const h=new Error("Worker render timed out");h.name="WorkerTimeout",h.code="WORKER_TIMEOUT",c(h),ed()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(d),ti.has(u)&&ti.delete(u);const h=new Error("Aborted");h.name="AbortError",c(h),ed()},{once:!0});const f=a,p=c;ti.set(u,{resolve:h=>{f(h)},reject:h=>{p(h)},timeoutId:d}),l.postMessage({id:u,content:s,displayMode:t})})})}function Dye(e,t=!0,n){const o=`${t?"d":"i"}:${sM(e)}`;if(ir.set(o,n),ir.size>200){const s=ir.keys().next().value;ir.delete(s)}}const _Y="WORKER_BUSY";function wY(e=2e3,t){return ti.size<Dh?Promise.resolve():new Promise((n,o)=>{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),Bl.delete(r),n())};if(Bl.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,Bl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>ed()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),Bl.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Zc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Bye(e){return Pp(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!oM()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(s=o.timeout)!=null?s:Zc.timeout,c=(i=o.waitTimeout)!=null?i:Zc.waitTimeout,u=(r=o.backoffMs)!=null?r:Zc.backoffMs,d=(l=o.maxRetries)!=null?l:Zc.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Zc.maxRetries,p=o.signal;let h=0;for(;;){if(p?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield bY(t,n,a,p)}catch(m){if(m?.code!==_Y||h>=f)throw m;if(h++,yield wY(c,p).catch(()=>{}),p?.aborted){const w=new Error("Aborted");throw w.name="AbortError",w}u>0&&(yield new Promise(w=>globalThis.setTimeout(w,u*h)))}}})}function Va(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function SY(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 bv(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=SY(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 _v(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 iM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function wv(e,t=360,n=500){return iM(e,t,n)}function Sv(e,t=360,n=500){return iM(e,t,n)}var CY=Object.defineProperty,xY=Object.defineProperties,AY=Object.getOwnPropertyDescriptors,tS=Object.getOwnPropertySymbols,MY=Object.prototype.hasOwnProperty,TY=Object.prototype.propertyIsEnumerable,nS=(e,t,n)=>t in e?CY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rM=(e,t)=>{for(var n in t||(t={}))MY.call(t,n)&&nS(e,n,t[n]);if(tS)for(var n of tS(t))TY.call(t,n)&&nS(e,n,t[n]);return e},dy=(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 fy=()=>ns(()=>import("./mermaid.core-KmcIQ1Ur.js").then(e=>e.bn),[]);let Ki=null,hy=fy;function EY(e){hy=e,Ki=null}function IY(e){EY(fy)}function $Y(){return typeof hy=="function"}function oS(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},xY(n,AY(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function sS(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 Fye(){return dy(this,null,function*(){if(Ki)return Ki;const e=(function(){try{const o=globalThis;return oS(o?.mermaid)}catch{return null}})();if(e)return Ki=e,sS(Ki),Ki;const t=hy;if(!t)return null;let n;try{n=yield t()}catch(o){throw t===fy?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):o}return n?(Ki=oS(n),sS(Ki),Ki):null})}let es=null,Hr=null;const No=new Map;let iS=5,rS=!1;const LY="WORKER_BUSY",NY="MERMAID_DISABLED";function RY(e){es=e,Hr=null;const t=e;es.onmessage=n=>{if(es!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=No.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},es.onerror=n=>{var o,s;if(es===t)if(No.size!==0){try{rS?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 No.entries())r.reject(new Error(`Worker error: ${n.message}`));No.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},es.onmessageerror=n=>{var o,s;if(es===t)if(No.size!==0){try{rS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of No.entries())r.reject(new Error("Worker messageerror"));No.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function OY(){var e;if(es)try{for(const[t,n]of No.entries())n.reject(new Error("Worker cleared"));No.clear(),(e=es.terminate)==null||e.call(es)}catch{}es=null,Hr=null}function lM(e,t,n=1400){if(!$Y()){const s=new Error("Mermaid rendering disabled");return s.name="MermaidDisabled",s.code=NY,Promise.reject(s)}if(Hr)return Promise.reject(Hr);const o=es||(Hr=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Hr.name="WorkerInitError",Hr.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Hr);if(No.size>=iS){const s=new Error("Worker busy");return s.name="WorkerBusy",s.code=LY,s.inFlight=No.size,s.max=iS,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),No.delete(r))},u={resolve:d=>{c(),s(d)},reject:d=>{c(),i(d)}};No.set(r,u);try{o.postMessage({id:r,action:e,payload:t})}catch(d){return No.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=No.get(r);f&&f.reject(d)},n)})}function Hye(e,t,n=1400){return dy(this,null,function*(){try{return yield lM("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function zye(e,t,n=1400){return dy(this,null,function*(){try{return yield lM("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function Wye(){if(es)try{for(const[e,t]of No.entries())t.reject(new Error("Worker terminated"));No.clear(),es.terminate()}finally{es=null}}var PY=Object.defineProperty,DY=Object.defineProperties,BY=Object.getOwnPropertyDescriptors,lS=Object.getOwnPropertySymbols,FY=Object.prototype.hasOwnProperty,HY=Object.prototype.propertyIsEnumerable,aS=(e,t,n)=>t in e?PY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rt=(e,t)=>{for(var n in t||(t={}))FY.call(t,n)&&aS(e,n,t[n]);if(lS)for(var n of lS(t))HY.call(t,n)&&aS(e,n,t[n]);return e},Pt=(e,t)=>DY(e,BY(t)),jn=(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 zY="__global__",Bg="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Cv=(()=>{const e=globalThis;if(e[Bg])return e[Bg];const t={scopedCustomComponents:{},revision:ta(0)};return e[Bg]=t,t})(),cS=Cv.revision,WY=Symbol("markstreamCustomComponents"),UY=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 UY.has(String(e).trim().toLowerCase())}function qY(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Fg(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([ci(n),ci(qY(n))]))!s||gd(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function go(e){const t=Vt(WY,null);return B(()=>{var n;return cS.value,(function(o,s={}){return cS.value,rt(rt(rt({},Fg(Cv.scopedCustomComponents[zY]||{})),Fg(s)),Fg((function(i){return i&&Cv.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const jY=["aria-label"],VY={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"},KY={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"},kn=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Ds=kn(je({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(_(),I("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(_(),I("svg",KY,[...n[1]||(n[1]=[C("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),C("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(_(),I("svg",VY,[...n[0]||(n[0]=[C("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,jY))}),[["__scopeId","data-v-be21ab83"]]);Ds.install=e=>{e.component(Ds.__name,Ds)};const GY={class:"emoji-node"},bs=kn(je({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(_(),I("span",GY,R(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);bs.install=e=>{e.component(bs.__name,bs)};const YY=["id"],QY=["title"],Bs=kn(je({__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)=>(_(),I("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[C("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+R(e.node.id)+"]",9,QY)],8,YY))}}),[["__scopeId","data-v-c1463a29"]]);Bs.install=e=>{e.component(Bs.__name,Bs)};const aM=(()=>{try{return!1}catch{}return!1})();function Hg(e){aM&&console.warn(e)}function uS(e,t="safe",n){return iy(e,t,n)}function cM(e){return EG(e)}function zg(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function py(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=gv((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),zg(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),zg(r.value)]):Object.entries(s).map(([r,l])=>[r,zg(l)]):null,t,n);var s;if(!o)return;const i=cM(Oh(o));return Object.keys(i).length>0?i:void 0}function dS(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 Jc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Wg(e,t,n,o,s,i,r=!1){const l=(function(d,f){return VA(d,f)})(e,o);if(hd.has(e.toLowerCase())||!l&&UA(e,i))return null;if(!l&&sy(e,i))return r?[dS(e,t,!0)]:[dS(e,t),...n,`</${e}>`];const a=iy(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=cM(a);return yn(d,Pt(rt({},f),{key:u}),n.length>0?n:void 0)}return yn(e,Pt(rt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function uM(e,t){return NG(e,t)}function Bh(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=Wg(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Jc(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 p=-1;for(let h=c.length-1;h>=0;h--)if(c[h].tagName.toLowerCase()===f){p=h;break}if(p!==-1)for(;c.length>p;){const h=c.pop(),m=Wg(h.tagName,h.attrs||{},h.children,r,h.autoKey,l);c.length>0?Jc(c[c.length-1].children,m):Jc(u,m),h.tagName.toLowerCase()!==f&&c.length>p&&Hg(`Auto-closing unclosed tag: <${h.tagName}>`)}else Hg(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=Wg(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Jc(c[c.length-1].children,f):Jc(u,f),Hg(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(IG(e),t,n)}catch(s){return o=s,aM&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const XY=["innerHTML"],Fs=kn(je({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Vt("markstreamHtmlPolicy",void 0),o=B(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=go(()=>t.customId),i=je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=B(()=>{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=Bh(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!uM(l,s.value))return{mode:"html",content:rc(l,o.value)};const a=Bh(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"?(_(),I("span",{key:0,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[se(x(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(_(),I("span",{key:1,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},R(r.value.content),3)):(_(),I("span",{key:2,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,XY))}}),[["__scopeId","data-v-d17f12b0"]]);Fs.install=e=>{e.component(Fs.__name,Fs)};const ZY={class:"inline-code"},JY={key:0},Yo=kn(je({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=ad(),o=Vt("markstreamFade",void 0),s=Vt("markstreamTextStreamState",void 0),i=Vt("markstreamStreamVersion",void 0),r=B(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=B(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=B(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=B(()=>!l.value),u=B(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=X(t.node.code),f=X("");let p=i?.value;const h=X(0);function m(){return d.value+f.value}function w(){f.value&&(d.value=m(),f.value="")}Ve([()=>t.node.code,u,l,()=>i?.value],([g,v,y,M])=>{const O=String(g??""),L=u.value,b=M!==p;p=M;const T=QA({nextContent:O,persistedContent:L?s?.get(L):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:b});d.value=T.settledContent,f.value=T.streamedDelta,T.appended&&(h.value+=1),L&&s?.set(L,O)},{immediate:!0}),Ve(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const k=B(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(_(),I("code",ZY,[c.value?(_(),I(Pe,{key:0},[qe(R(a.value),1)],64)):(_(),I(Pe,{key:1},[d.value?(_(),I("span",JY,R(d.value),1)):re("",!0),f.value?(_(),I("span",{key:1,class:De(["inline-code-stream-delta",[k.value]]),onAnimationend:w},R(f.value),35)):re("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);Yo.install=e=>{e.component(Yo.__name,Yo)};const xv=X(!1),fS=X(""),hS=X("top"),xu=X(null),Au=X(null),Av=X(null),Mv=X(null),pS=X(null);let Df=null,Bf=null,Tv=0;function dM(){Df&&(clearTimeout(Df),Df=null),Bf&&(clearTimeout(Bf),Bf=null)}let vf=!1,yf=null,mS=!1;function eQ(e,t,n="top",o=!1,s,i){if(!e)return;const r=++Tv;dM();const l=()=>jn(null,null,function*(){var a,c;if(yield(function(){return jn(this,null,function*(){if(!vf&&!mS&&typeof document<"u"){yf!=null||(yf=jn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([ns(()=>import("./vue.runtime.esm-bundler-C14m1nnd.js"),[]),ns(()=>import("./Tooltip-CzU8Fz35.js"),[])]),p=document.createElement("div");p.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(p),u({setup:()=>()=>{var h;return d(f,{visible:xv.value,"anchor-el":xu.value,content:fS.value,placement:hS.value,id:Au.value,originX:Av.value,originY:Mv.value,isDark:(h=pS.value)!=null?h:void 0})}}).mount(p),vf=!0}));try{yield yf}catch(u){vf=!1,yf=null,mS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),vf&&r===Tv){Au.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,xu.value=e,fS.value=t,hS.value=n,Av.value=(a=s?.x)!=null?a:null,Mv.value=(c=s?.y)!=null?c:null,pS.value=typeof i=="boolean"?i:null,xv.value=!0;try{e.setAttribute("aria-describedby",Au.value)}catch{}}});o?l():Df=setTimeout(l,80)}function tQ(e=!1){Tv+=1,dM();const t=()=>{if(xu.value&&Au.value)try{xu.value.removeAttribute("aria-describedby")}catch{}xv.value=!1,xu.value=null,Au.value=null,Av.value=null,Mv.value=null};e?t():Bf=setTimeout(t,120)}const Ev={"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..."},Iv=e=>{var t;return(t=Ev[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 gS(e){return{t(t){if(e.te&&Ev[t]&&!e.te(t))return Iv(t);const n=e.t(t);return n===t&&Ev[t]?Iv(t):n}}}function nQ(){const e=(function(){var t,n;try{const o=Ho(),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 gS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return gS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Iv}}function oQ(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 sQ=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],iQ={key:1,class:"image-placeholder"},rQ={key:1,class:"image-node__raw-text"},lQ={key:0,class:"image-shimmer-overlay"},aQ={key:1,class:"image-node__raw-text"},cQ={key:2,class:"image-error"},Yr=kn(je({__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=X(!1),i=X(!1),r=X(""),l=X("primary"),a=X(null),c=ad(),u=Vt(vv,null);let d="",f=null;const p=B(()=>Q_(n.node.src)),h=B(()=>Q_(n.fallbackSrc)),m=B(()=>r.value),w=B(()=>!n.lazy),k=B(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=B(()=>l.value==="failed"),v=B(()=>!w.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=B(()=>oQ(n,c));function M(P=y.value){P&&a.value&&u?.reportHeight(P,a.value.offsetHeight)}function O(P=y.value){P&&gt(()=>{M(P)})}function L(){f&&(clearTimeout(f),f=null)}function b(){const P=y.value;P&&d!==P&&(d&&u?.markSettled(d),L(),d=P,u?.markPending(P),typeof window<"u"&&(f=window.setTimeout(()=>{d===P&&(O(P),T())},8e3)))}function T(){return jn(this,null,function*(){const P=d;P&&(L(),d="",yield gt(),M(P),u?.markSettled(P))})}function $(){if(l.value==="primary"&&h.value&&h.value!==r.value)return l.value="fallback",r.value=h.value,s.value=!1,i.value=!1,void O();l.value="failed",i.value=!0,o("error",r.value),O()}function N(){s.value=!0,i.value=!1,o("load",m.value),O()}function S(P){P.preventDefault(),s.value&&!i.value&&o("click",[P,m.value])}const{t:E}=nQ();return Ve([p,h,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||p.value?(r.value=p.value,void(l.value="primary")):h.value?(r.value=h.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ve([k,s,i,m,()=>n.lazy],([P,D,F,W,K])=>P&&W&&!F?D?(T(),void O()):K?(b(),void O()):void(D||F||b()):(T(),void O()),{flush:"post",immediate:!0}),so(()=>{(function(){const P=d;P&&(L(),d="",u?.markSettled(P))})()}),(P,D)=>{var F,W,K,Y,q;return _(),I("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[k.value?(_(),I("img",{key:0,src:m.value,alt:String((W=(F=n.node.alt)!=null?F:n.node.title)!=null?W:""),title:String((Y=(K=n.node.title)!=null?K:n.node.alt)!=null?Y:""),class:De(["image-node__img",{"is-loading":!w.value&&!s.value,"is-loaded":w.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:w.value?"high":void 0,decoding:w.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(q=n.node.alt)!=null?q:x(E)("image.preview"),onError:$,onLoad:N,onClick:S},null,42,sQ)):re("",!0),e.node.loading&&!i.value?(_(),I("span",iQ,[n.usePlaceholder?On(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=C("span",{class:"image-shimmer"},null,-1))],!0):(_(),I("span",rQ,R(e.node.raw),1))])):re("",!0),se(Jr,{name:"shimmer-fade"},{default:we(()=>[v.value&&!e.node.loading?(_(),I("span",lQ,[n.usePlaceholder?On(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=C("span",{class:"image-shimmer"},null,-1))],!0):(_(),I("span",aQ,R(e.node.raw),1))])):re("",!0)]),_:3}),g.value?(_(),I("span",cQ,[On(P.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[2]=C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[C("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),C("span",null,R(x(E)("image.loadError")),1)],!0)])):re("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Yr.install=e=>{e.component(Yr.__name,Yr)};const uQ={key:2},Oi=je({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=go(()=>t.customId),o=Vt("markstreamHtmlPolicy",void 0),s=Vt("markstreamNestedRendererProps",void 0),i=B(()=>{var h;return(h=o?.value)!=null?h:"safe"}),r=B(()=>{var h,m;const w=(h=s?.value)!=null?h:{};return Pt(rt({},w),{customId:(m=t.customId)!=null?m:w.customId,htmlPolicy:i.value})}),l=mi({loader:()=>Promise.resolve().then(()=>_y),suspensible:!1}),a=B(()=>t.components[String(t.node.type)]),c=B(()=>!!(a.value&&n.value[t.node.type]&&!gd(String(t.node.type)))),u=B(()=>c.value?py(t.node,i.value):void 0),d=B(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=B(()=>{var h;return String((h=t.node.content)!=null?h:"")}),p=B(()=>{var h,m;return String((m=(h=t.node.content)!=null?h:t.node.raw)!=null?m:"")});return(h,m)=>a.value&&c.value?(_(),ke(Oo(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:we(()=>[d.value?(_(),ke(x(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?(_(),ke(x(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"])):re("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(_(),ke(Oo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(_(),I("span",uQ,R(p.value),1)):re("",!0)}}),dQ=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],fQ={key:0,translate:"no",class:"markstream-pre__diff-code"},hQ={class:"markstream-pre__diff-number","aria-hidden":"true"},pQ={class:"markstream-pre__diff-content"},mQ={class:"markstream-pre__diff-content-inner"},gQ={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},vQ=["textContent"],$s=je({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=B(()=>{var S,E,P;const D=String((E=(S=t.node)==null?void 0:S.language)!=null?E:"");return String((P=String(D).split(/\s+/g)[0])!=null?P:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=B(()=>`language-${n.value}`),s=B(()=>{var S,E,P,D,F;return((S=t.node)==null?void 0:S.diff)===!0?String((P=(E=t.node)==null?void 0:E.code)!=null?P:""):(function(W,K){const Y=String(W??"");return K?Y:Y.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((F=t.node)==null?void 0:F.loading)===!0)}),i=B(()=>s.value.split(/\r\n|\n|\r/)),r=B(()=>Array.from({length:Math.max(1,i.value.length)},(S,E)=>E+1)),l=B(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=B(()=>l.value&&t.diffInline===!0),c=B(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const E=`${Math.ceil(S)}px`;return{height:E,minHeight:E,maxHeight:E,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,E="context",P={}){const D=u(S);return{code:S,kind:D&&E!=="hunk"&&!P.preserveBlankKind?"context":E,empty:D}}function f(S){const E=String(S??"");return E?E.split(/\r\n|\n|\r/):[]}function p(S,E){return!u(S[E])||E<S.length-1}function h(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function w(S,E){const P=f(S),D=f(E),F=(function(ce,ne){const Q=ce.length,ee=ne.length;if((Q+1)*(ee+1)>15e5)return null;const ye=ee+1,xe=new Uint32Array((Q+1)*(ee+1));for(let ie=1;ie<=Q;ie++)for(let de=1;de<=ee;de++){const z=ie*ye+de;if(ce[ie-1]===ne[de-1])xe[z]=xe[(ie-1)*ye+(de-1)]+1;else{const Z=xe[(ie-1)*ye+de],pe=xe[ie*ye+(de-1)];xe[z]=Z>=pe?Z:pe}}const Xe=[];let me=Q,G=ee;for(;me>0&&G>0;)ce[me-1]===ne[G-1]?(Xe.push({originalIndex:me-1,modifiedIndex:G-1}),me--,G--):xe[(me-1)*ye+G]>=xe[me*ye+(G-1)]?me--:G--;return Xe.reverse(),Xe})(P,D);if(F){const ce=[];let ne=0,Q=0;for(const ee of F){for(;ne<ee.originalIndex;)ce.push(Pt(rt({},d(P[ne],"removed",{preserveBlankKind:p(P,ne)})),{key:`inline-removed-source-${ne}`,number:""})),ne++;for(;Q<ee.modifiedIndex;)ce.push(Pt(rt({},d(D[Q],"added",{preserveBlankKind:p(D,Q)})),{key:`inline-added-source-${Q}`,number:Q+1})),Q++;ce.push(Pt(rt({},d(D[ee.modifiedIndex])),{key:`inline-context-source-${ee.originalIndex}-${ee.modifiedIndex}`,number:ee.modifiedIndex+1})),ne=ee.originalIndex+1,Q=ee.modifiedIndex+1}for(;ne<P.length;)ce.push(Pt(rt({},d(P[ne],"removed",{preserveBlankKind:p(P,ne)})),{key:`inline-removed-source-${ne}`,number:""})),ne++;for(;Q<D.length;)ce.push(Pt(rt({},d(D[Q],"added",{preserveBlankKind:p(D,Q)})),{key:`inline-added-source-${Q}`,number:Q+1})),Q++;return ce}const W=[];let K=0,Y=P.length-1,q=D.length-1;for(;K<=Y&&K<=q&&P[K]===D[K];)W.push(Pt(rt({},d(D[K])),{key:`inline-prefix-${K}`,number:K+1})),K++;const ae=[];for(;Y>=K&&q>=K&&P[Y]===D[q];)ae.unshift(Pt(rt({},d(D[q])),{key:`inline-suffix-${q}`,number:q+1})),Y--,q--;for(let ce=K;ce<=Y;ce++)W.push(Pt(rt({},d(P[ce],"removed",{preserveBlankKind:p(P,ce)})),{key:`inline-removed-source-${ce}`,number:""}));for(let ce=K;ce<=q;ce++)W.push(Pt(rt({},d(D[ce],"added",{preserveBlankKind:p(D,ce)})),{key:`inline-added-source-${ce}`,number:ce+1}));return W.concat(ae)}const k=B(()=>{var S,E,P,D;const F=(function(q){const ae=q.some(ne=>h(ne)),ce=q.some(ne=>m(ne));return ae&&ce||(function(){var ne,Q,ee,ye;if(n.value==="diff")return!0;const xe=(ye=(ee=String((Q=(ne=t.node)==null?void 0:ne.raw)!=null?Q:"").split(/\r?\n/,1)[0])==null?void 0:ee.trim())!=null?ye:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(xe)})()&&(ae||ce)})(i.value),W=(function(){var q,ae;return((q=t.node)==null?void 0:q.originalCode)!=null||((ae=t.node)==null?void 0:ae.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:F?(function(q){const ae=[];let ce=1;for(const[ne,Q]of q.entries())if(Q.startsWith("@@"))ae.push(Pt(rt({},d(Q,"hunk")),{key:`inline-hunk-${ne}`,number:""}));else if(h(Q))ae.push(Pt(rt({},d(Q.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ne}`,number:""}));else if(m(Q))ae.push(Pt(rt({},d(Q.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${ne}`,number:ce++}));else{const ee=Q.startsWith(" ")?Q.slice(1):Q;ae.push(Pt(rt({},d(ee)),{key:`inline-context-${ne}`,number:ce})),ce++}return ae})(i.value):w((S=t.node)==null?void 0:S.originalCode,(E=t.node)==null?void 0:E.updatedCode)}];if(!F&&W){const q=f((P=t.node)==null?void 0:P.originalCode),ae=f((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:q.map((ce,ne)=>{const Q=ae[ne]===ce?"context":"removed";return Pt(rt({},d(ce,Q,{preserveBlankKind:p(q,ne)})),{key:`original-${ne}`,number:ne+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ae.map((ce,ne)=>{const Q=q[ne]===ce?"context":"added";return Pt(rt({},d(ce,Q,{preserveBlankKind:p(ae,ne)})),{key:`modified-${ne}`,number:ne+1})})}]}const K=[],Y=[];for(const q of i.value)if(q.startsWith("@@"))K.push(d(q,"hunk")),Y.push(d(q,"hunk"));else if(q.startsWith("-")&&!q.startsWith("---"))K.push(d(q.slice(1),"removed",{preserveBlankKind:!0}));else if(q.startsWith("+")&&!q.startsWith("+++"))Y.push(d(q.slice(1),"added",{preserveBlankKind:!0}));else{const ae=q.startsWith(" ")?q.slice(1):q;K.push(d(ae)),Y.push(d(ae))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:K.map((q,ae)=>Pt(rt({},q),{key:`original-${ae}`,number:ae+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Y.map((q,ae)=>Pt(rt({},q),{key:`modified-${ae}`,number:ae+1}))}]}),g=B(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=X(null),y=X([]);let M=null,O=null;function L(S){const E=Number.parseFloat(String(S??""));return Number.isFinite(E)&&E>0?E:0}function b(S,E){var P;if(!S)return E;const D=S.querySelector(".markstream-pre__diff-content"),F=D?.getBoundingClientRect(),W=(P=F?.height)!=null?P:0;return Math.max(E,Math.ceil(W))}function T(){typeof window<"u"&&(M!=null&&window.cancelAnimationFrame(M),M=window.requestAnimationFrame(()=>{(function(){var S,E;M=null;const P=v.value;if(!P||!l.value)return void(y.value.length&&(y.value=[]));const D=(function(ce){const ne=window.getComputedStyle(ce),Q=L(ne.getPropertyValue("--markstream-pre-diff-line-height"));if(Q>0)return Q;const ee=L(ne.lineHeight);return ee>0?ee:18})(P),F=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),W=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),K=Math.max(F.length,W.length),Y=[];for(let ce=0;ce<K;ce++){const ne=b((S=F[ce])!=null?S:null,D),Q=b((E=W[ce])!=null?E:null,D),ee=Math.max(D,ne,Q);Y.push({rowHeight:ee,originalHeight:ne,modifiedHeight:Q})}var q,ae;q=y.value,ae=Y,q.length===ae.length&&q.every((ce,ne)=>{const Q=ae[ne];return Q&&Math.abs(ce.rowHeight-Q.rowHeight)<=.5&&Math.abs(ce.originalHeight-Q.originalHeight)<=.5&&Math.abs(ce.modifiedHeight-Q.modifiedHeight)<=.5})||(y.value=Y)})()}))}function $(S){O?.disconnect(),O=null,S&&l.value&&typeof ResizeObserver<"u"&&(O=new ResizeObserver(()=>{T()}),O.observe(S))}function N(S,E){const P=y.value[S];if(!P)return;const D=E==="original"?P.originalHeight:P.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(P.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return Ve(v,S=>{$(S),gt(()=>T())},{flush:"post"}),Ve([l,k],()=>{$(v.value),gt(()=>T())},{flush:"post",immediate:!0}),so(()=>{M!=null&&(window.cancelAnimationFrame(M),M=null),O?.disconnect(),O=null}),(S,E)=>(_(),I("pre",{ref_key:"preRef",ref:v,style:en(c.value),class:De([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":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(_(),I("code",fQ,[(_(!0),I(Pe,null,nt(k.value,P=>(_(),I("span",{key:P.key,class:De(["markstream-pre__diff-pane",P.className])},[(_(!0),I(Pe,null,nt(P.lines,(D,F)=>(_(),I("span",{key:D.key,class:De(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:en(N(F,P.key))},[E[0]||(E[0]=C("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),C("span",hQ,R(D.number),1),C("span",pQ,[C("span",mQ,R(D.code),1)])],6))),128))],2))),128))])):(_(),I(Pe,{key:1},[t.showLineNumbers?(_(),I("span",gQ,[(_(!0),I(Pe,null,nt(r.value,P=>(_(),I("span",{key:P,class:"markstream-pre__line-number"},R(P),1))),128))])):re("",!0),C("code",{translate:"no",class:"markstream-pre__code",textContent:R(s.value)},null,8,vQ)],64))],14,dQ))}});$s.install=e=>{e.component($s.__name,$s)};const Ug=ta(!1);let vS=null;const yQ={key:0},to=kn(je({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(vS||(vS=uy().then(k=>{Ug.value=!!k}).catch(()=>{Ug.value=!1})),Qf(Ug)),o=ad(),s=Vt("markstreamFade",void 0),i=Vt("markstreamTextStreamState",void 0),r=Vt("markstreamStreamVersion",void 0),l=B(()=>{const k=o.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),a=B(()=>typeof l.value=="boolean"?l.value:typeof s?.value!="boolean"||s.value),c=B(()=>{var k;const g=(k=o["index-key"])!=null?k:o.indexKey;return g==null||g===""?"":String(g)}),u=X(t.node.content),d=X("");let f=r?.value;const p=X(0);function h(){return u.value+d.value}function m(){d.value&&(u.value=h(),d.value="")}Ve([()=>t.node.content,c,a,()=>r?.value],([k,g,v,y])=>{const M=String(k??""),O=c.value,L=y!==f;f=y;const b=QA({nextContent:M,persistedContent:O?i?.get(O):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:L});u.value=b.settledContent,d.value=b.streamedDelta,b.appended&&(p.value+=1),O&&i?.set(O,M)},{immediate:!0}),Ve(a,k=>{var g;k||(g=h(),u.value=g,d.value="")});const w=B(()=>p.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,g)=>(_(),I("span",{class:De([[x(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(_(),I("span",yQ,R(u.value),1)):re("",!0),d.value?(_(),I("span",{key:1,class:De(["text-node-stream-delta",[w.value]]),onAnimationend:m},R(d.value),35)):re("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);to.install=e=>{e.component(to.__name,to)};const fM=je({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return yn($s,Pt(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"}))}}}),qg=mi({loader:()=>jn(null,null,function*(){try{return(yield ns(()=>import("./CodeBlockNode-EM_kCY-N.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),$s}}),loadingComponent:fM,delay:0,suspensible:!1}),bi=mi(()=>jn(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 yn(to,Pt(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 uy())return(yield ns(()=>import("./index6-pl4U4MZe.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 yn(to,Pt(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:""}$`}}))}})),hM=mi(()=>jn(null,null,function*(){try{if(yield uy())return(yield ns(()=>import("./index5-iCBVHj23.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 yn(to,Pt(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:""}$$`}}))}})),is=kn(je({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(_(),I("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))},R(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);is.install=e=>{e.component(is.__name,is)};const kQ={class:"superscript-node"},_s=kn(je({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=go(()=>t.customId),o=B(()=>rt({text:to,inline_code:Yo,link:as,html_inline:Fs,strong:rs,emphasis:cs,footnote_reference:Bs,strikethrough:ls,highlight:Hs,insert:Ss,subscript:ws,emoji:bs,math_inline:bi,reference:is},n.value));return(s,i)=>(_(),I("sup",kQ,[(_(!0),I(Pe,null,nt(e.node.children,(r,l)=>(_(),ke(x(Oi),{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"]]);_s.install=e=>{e.component(_s.__name,_s)};const bQ={class:"subscript-node"},ws=kn(je({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=go(()=>t.customId),o=B(()=>rt({text:to,inline_code:Yo,link:as,html_inline:Fs,strong:rs,emphasis:cs,footnote_reference:Bs,strikethrough:ls,highlight:Hs,insert:Ss,superscript:_s,emoji:bs,math_inline:bi,reference:is},n.value));return(s,i)=>(_(),I("sub",bQ,[(_(!0),I(Pe,null,nt(e.node.children,(r,l)=>(_(),ke(x(Oi),{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"]]);ws.install=e=>{e.component(ws.__name,ws)};const _Q={class:"strong-node"},rs=kn(je({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=go(()=>t.customId),o=B(()=>rt({text:to,inline_code:Yo,link:as,html_inline:Fs,emphasis:cs,strikethrough:ls,highlight:Hs,insert:Ss,subscript:ws,superscript:_s,emoji:bs,footnote_reference:Bs,math_inline:bi,reference:is},n.value));return(s,i)=>(_(),I("strong",_Q,[(_(!0),I(Pe,null,nt(e.node.children,(r,l)=>(_(),ke(x(Oi),{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"]]);rs.install=e=>{e.component(rs.__name,rs)};const wQ={class:"strikethrough-node"},ls=kn(je({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=go(()=>t.customId),o=B(()=>rt({text:to,inline_code:Yo,link:as,html_inline:Fs,strong:rs,emphasis:cs,highlight:Hs,insert:Ss,subscript:ws,superscript:_s,emoji:bs,footnote_reference:Bs,math_inline:bi,reference:is},n.value));return(s,i)=>(_(),I("del",wQ,[(_(!0),I(Pe,null,nt(e.node.children,(r,l)=>(_(),ke(x(Oi),{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"]]);ls.install=e=>{e.component(ls.__name,ls)};const SQ=["href","title","aria-label","aria-hidden","target","rel"],CQ=["aria-hidden"],xQ={class:"link-text-wrapper relative inline-flex"},AQ={class:"leading-[normal] link-text"},as=kn(je({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Vt("markstreamShowTooltips",void 0),o=B(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),s=B(()=>{var k,g,v,y,M;const O=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",L=(k=t.animationOpacity)!=null?k:.35,b=Math.max(.12,Math.min(.5*L,L)),T={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":O,"--underline-opacity":String(L),"--underline-rest-opacity":String(b),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(M=t.animationIteration)!=null?M:"infinite"};return t.color&&(T["--link-color"]=t.color),T}),i=go(()=>t.customId),r=B(()=>rt({text:to,strong:rs,strikethrough:ls,emphasis:cs,image:Yr,html_inline:Fs,inline_code:Yo},i.value)),l=ad(),a=B(()=>{var k,g;const v=(k=t.node)==null?void 0:k.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const M of v)Array.isArray(M)&&M[0]&&(y[String(M[0])]=String((g=M[1])!=null?g:""));else for(const[M,O]of Object.entries(v))M&&O!=null&&O!==!1&&(y[M]=O===!0?"":String(O));return uS(y,"safe","a")}),c=B(()=>rt(rt({},l),a.value)),u=B(()=>{var k,g;return uS({href:String((g=(k=t.node)==null?void 0:k.href)!=null?g:"")},"safe","a").href}),d=B(()=>{if(!u.value)return;const k=c.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(gq(u.value)?"_blank":void 0)}),f=B(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),p=B(()=>{if(!u.value)return;const k=c.value.rel,g=new Set((typeof k=="string"?k:String(k??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),h=B(()=>{const k=rt({},c.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function m(){o.value&&tQ()}const w=B(()=>{var k,g;const v=(k=t.node)==null?void 0:k.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(k,g)=>{var v,y;return e.node.loading?(_(),I("span",bn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},x(l),{style:s.value}),[C("span",xQ,[C("span",AQ,[se(x(to),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=C("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,CQ)):(_(),I("a",bn({key:0,class:"link-node",href:u.value,title:o.value?"":w.value,"aria-label":`Link: ${w.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:p.value},h.value,{style:s.value,onMouseenter:g[0]||(g[0]=M=>(function(O){var L,b,T,$;if(!o.value)return;const N=O,S=N?.clientX!=null&&N?.clientY!=null?{x:N.clientX,y:N.clientY}:void 0,E=((L=t.node)==null?void 0:L.title)||((b=u.value)!=null&&b.includes("xn--")&&(($=(T=t.node)==null?void 0:T.text)!=null&&$.includes("://"))?t.node.text:u.value)||"";eQ(O.currentTarget,E,"top",!1,S)})(M)),onMouseleave:m}),[(_(!0),I(Pe,null,nt(e.node.children,(M,O)=>(_(),ke(x(Oi),{key:`${e.indexKey||"emphasis"}-${O}`,components:r.value,node:M,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${O}`},null,8,["components","node","custom-id","index-key"]))),128))],16,SQ))}}}),[["__scopeId","data-v-367e6ca4"]]);as.install=e=>{e.component(as.__name,as)};const MQ={class:"insert-node"},Ss=kn(je({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=go(()=>t.customId),o=B(()=>rt({text:to,inline_code:Yo,link:as,html_inline:Fs,strong:rs,emphasis:cs,strikethrough:ls,highlight:Hs,subscript:ws,superscript:_s,emoji:bs,footnote_reference:Bs,math_inline:bi,reference:is},n.value));return(s,i)=>(_(),I("ins",MQ,[(_(!0),I(Pe,null,nt(e.node.children,(r,l)=>(_(),ke(x(Oi),{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"]]);Ss.install=e=>{e.component(Ss.__name,Ss)};const TQ={class:"highlight-node"},Hs=kn(je({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=go(()=>t.customId),o=B(()=>rt({text:to,inline_code:Yo,link:as,html_inline:Fs,strong:rs,emphasis:cs,strikethrough:ls,insert:Ss,subscript:ws,superscript:_s,emoji:bs,footnote_reference:Bs,math_inline:bi,reference:is},n.value));return(s,i)=>(_(),I("mark",TQ,[(_(!0),I(Pe,null,nt(e.node.children,(r,l)=>(_(),ke(x(Oi),{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"]]);Hs.install=e=>{e.component(Hs.__name,Hs)};const EQ={class:"emphasis-node"},cs=kn(je({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=go(()=>t.customId),o=B(()=>rt({text:to,inline_code:Yo,link:as,html_inline:Fs,strong:rs,strikethrough:ls,highlight:Hs,insert:Ss,subscript:ws,superscript:_s,emoji:bs,footnote_reference:Bs,math_inline:bi,reference:is},n.value));return(s,i)=>(_(),I("em",EQ,[(_(!0),I(Pe,null,nt(e.node.children,(r,l)=>(_(),ke(x(Oi),{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"]]);cs.install=e=>{e.component(cs.__name,cs)};const IQ={class:"hard-break"},Qr=kn(je({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(_(),I("br",IQ))}),[["__scopeId","data-v-50c58f70"]]);Qr.install=e=>{e.component(Qr.__name,Qr)};const td=je({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=vt({checkbox:Ds,checkbox_input:Ds,emoji:bs,emphasis:cs,hardbreak:Qr,highlight:Hs,inline_code:Yo,insert:Ss,link:as,reference:is,strikethrough:ls,strong:rs,subscript:ws,superscript:_s,text:to}),o=go(()=>t.customId),s=B(()=>{const i=o.value;return Object.keys(i).length>0?rt(rt({},n),i):n});return(i,r)=>(_(!0),I(Pe,null,nt(e.nodes,(l,a)=>(_(),ke(x(Oi),{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 $v(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($v)}function Fh(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every($v))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($v)?s:null}function gc(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 $Q=["cite"],LQ={key:0,dir:"auto",class:"paragraph-node"},NQ=["custom-id"],Ff=kn(je({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=go(()=>t.customId),o=B(()=>!!n.value.paragraph),s=B(()=>!!n.value.text),i=B(()=>Fh(t.node.children,!o.value)),r=B(()=>t.fade!==!1||s.value?null:gc(i.value));return Nn("markstreamShowTooltips",B(()=>t.showTooltips)),Nn("markstreamFade",B(()=>t.fade)),(l,a)=>(_(),I("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(_(),I("p",LQ,[r.value!==null?(_(),I("span",{key:0,class:"text-node","custom-id":t.customId},R(r.value),9,NQ)):(_(),ke(x(td),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(_(),ke(x(Cs),{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,$Q))}}),[["__scopeId","data-v-abfecebc"]]);Ff.install=e=>{e.component(Ff.__name,Ff)};const RQ={class:"definition-list"},OQ={class:"definition-term"},PQ={class:"definition-desc"},Hf=kn(je({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(_(),I("dl",RQ,[(_(!0),I(Pe,null,nt(t.node.items,(s,i)=>(_(),I(Pe,{key:i},[C("dt",OQ,[se(x(Cs),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),C("dd",PQ,[se(x(Cs),{"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"]]);Hf.install=e=>{e.component(Hf.__name,Hf)};const DQ=["href","title"],Mu=kn(je({__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)=>(_(),I("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,DQ))}}),[["__scopeId","data-v-e1eb37b6"]]);Mu.install=e=>{e.component(Mu.__name,Mu)};const BQ=["id"],FQ={class:"flex-1"},zf=je({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(_(),I("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[C("div",FQ,[se(x(Cs),{"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,BQ))}});zf.install=e=>{e.component(zf.__name,zf)};const HQ=["custom-id"],Lv=kn(je({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=go(()=>t.customId),o=Vt("markstreamFade",void 0),s=B(()=>o?.value!==!1||n.value.text?null:gc(t.node.children)),i=B(()=>rt({text:to,inline_code:Yo,link:as,image:Yr,strong:rs,emphasis:cs,strikethrough:ls,highlight:Hs,insert:Ss,subscript:ws,superscript:_s,emoji:bs,checkbox:Ds,checkbox_input:Ds,footnote_reference:Bs,hardbreak:Qr,math_inline:bi,reference:is},n.value));return(r,l)=>(_(),ke(Oo(`h${e.node.level}`),bn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:we(()=>[s.value!==null?(_(),I("span",{key:0,class:"text-node","custom-id":t.customId},R(s.value),9,HQ)):(_(!0),I(Pe,{key:1},nt(e.node.children,(a,c)=>(_(),ke(x(Oi),{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"]]),Hh=Lv;Hh.install=e=>{e.component(Lv.__name,Lv)};const zQ={key:0,dir:"auto",class:"paragraph-node"},WQ=["custom-id"],UQ={dir:"auto",class:"paragraph-node"},qQ=["custom-id"],lc=kn(je({__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=B(()=>{var p;return(p=t.node)!=null?p:t.item}),o=go(()=>t.customId),s=B(()=>!!o.value.paragraph),i=B(()=>!!o.value.text),r=B(()=>{var p;return Fh((p=n.value)==null?void 0:p.children,!s.value)}),l=B(()=>{var p;if(s.value)return null;const h=(p=n.value)==null?void 0:p.children;if(!Array.isArray(h)||h.length<2)return null;const m=h[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const w=h.slice(1);if(!w.every(g=>g?.type==="list"))return null;const k=Fh([m]);return k?{paragraphChildren:k,nestedLists:w}:null});function a(){return t.fade===!1&&!i.value}const c=B(()=>a()?gc(r.value):null),u=B(()=>{var p;return a()?gc((p=l.value)==null?void 0:p.paragraphChildren):null}),d=Object.freeze({}),f=B(()=>{const{value:p}=t;return typeof p=="number"&&Number.isFinite(p)?{value:p}:d});return Nn("markstreamShowTooltips",B(()=>t.showTooltips)),Nn("markstreamFade",B(()=>t.fade)),(p,h)=>{var m,w;return _(),I("li",bn({class:"list-item",dir:"auto"},f.value),[r.value?(_(),I("p",zQ,[c.value!==null?(_(),I("span",{key:0,class:"text-node","custom-id":t.customId},R(c.value),9,WQ)):(_(),ke(x(td),{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?(_(),I(Pe,{key:1},[C("p",UQ,[u.value!==null?(_(),I("span",{key:0,class:"text-node","custom-id":t.customId},R(u.value),9,qQ)):(_(),ke(x(td),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(_(!0),I(Pe,null,nt(l.value.nestedLists,(k,g)=>(_(),ke(x(Cs),{key:g,nodes:[k],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"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:h[0]||(h[0]=v=>p.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(_(),ke(x(Cs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(w=(m=n.value)==null?void 0:m.children)!=null?w:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:h[1]||(h[1]=k=>p.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);lc.install=e=>{e.component(lc.__name,lc)};const ac=kn(je({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=go(()=>e.customId),n=B(()=>t.value.list_item||lc);return(o,s)=>(_(),ke(Oo(e.node.ordered?"ol":"ul"),{class:De(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:we(()=>[(_(!0),I(Pe,null,nt(e.node.items,(i,r)=>{var l;return _(),ke(Oo(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"]]);ac.install=e=>{e.component(ac.__name,ac)};const pM=Symbol("ViewportPriority");function jQ(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?X(t):t,r=s?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function p(){if(f!=null){try{l?.(f)}catch{}f=null}}function h(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||p()}}function m(g){const v=u.get(g);if(v){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),h()}}function w(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&w())},{timeout:1200}))}Ve(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);p()}},{flush:"sync"});const k=(g,v)=>{const y=X(!1);let M,O=!1;const L=new Promise($=>{M=()=>{O||(O=!0,$())}}),b=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),h()};if(!s||!i.value)return y.value=!0,M(),{isVisible:y,whenVisible:L,destroy:b};const T=(function($,N){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(D,F){var W,K,Y;return{root:(W=e?.(D??null))!=null?W:null,rootMargin:(K=F?.rootMargin)!=null?K:"300px",threshold:(Y=F?.threshold)!=null?Y:0}})($,N);if(a&&(P=S,(E=c)&&E.root===P.root&&E.rootMargin===P.rootMargin&&E.threshold===P.threshold))return a;var E,P;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const F of D)(F.isIntersecting||F.intersectionRatio>0)&&m(F.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const D of u.keys())a.observe(D);return a})(g,v);return T?(u.set(g,{resolve:M,visible:y}),T.observe(g),d.add(g),w(),{isVisible:y,whenVisible:L,destroy:b}):(y.value=!0,M(),{isVisible:y,whenVisible:L,destroy:b})};return Nn(pM,k),k}function VQ(){var e,t;const n=Vt(pM,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 p=o.get(f);if(p){if(!p.visible.value){p.visible.value=!0;try{p.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 p=X(!1);let h,m=!1;const w=new Promise(v=>{h=()=>{m||(m=!0,v())}}),k=()=>{try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()},g=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),s));return g?(o.set(f,{resolve:h,visible:p}),g.observe(f),i.add(f),d(),{isVisible:p,whenVisible:w,destroy:k}):(p.value=!0,h(),{isVisible:p,whenVisible:w,destroy:k})}}const KQ={key:2,class:"html-block-node__raw"},GQ=["innerHTML"],YQ={key:1,class:"html-block-node__placeholder"},Tu=kn(je({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Vt("markstreamHtmlPolicy",void 0),o=Vt("markstreamNestedRendererProps",void 0),s=B(()=>{var O,L;return(L=(O=t.htmlPolicy)!=null?O:n?.value)!=null?L:"safe"}),i=B(()=>{var O,L;const b=(O=o?.value)!=null?O:{};return Pt(rt({},b),{customId:(L=t.customId)!=null?L:b.customId,htmlPolicy:s.value})}),r=mi({loader:()=>Promise.resolve().then(()=>_y),suspensible:!1}),l=B(()=>{const O=gv(t.node.attrs,s.value);if(!O)return;const L=Oh(O);return Object.keys(L).length>0?L:void 0}),a=B(()=>{const O=String(t.node.tag||"").trim(),L=gv(t.node.attrs,s.value,O);if(!L)return;const b=Oh(L);return Object.keys(b).length>0?b:void 0}),c=go(()=>t.customId),u=je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=X(null),f=X(typeof window>"u"),p=X(t.node.content),h=B(()=>Array.isArray(t.node.children)?t.node.children:[]),m=B(()=>String(t.node.tag||"div")),w=B(()=>{const O=m.value.trim().toLowerCase();return J3.has(O)||sy(O,s.value)}),k=B(()=>h.value.length>0&&!!t.node.tag&&!w.value),g=B(()=>{var O,L,b;if(k.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(O=p.value)!=null?O:""};const T=(L=p.value)!=null?L:t.node.content;if(!T)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:rc(T,s.value)};if(t.node.loading){const N=Bh(T,c.value,s.value);return N===null?{mode:"text",content:(b=t.node.raw)!=null?b:T}:{mode:"dynamic",nodes:N}}if(!uM(T,c.value))return{mode:"html",content:rc(T,s.value)};const $=Bh(T,c.value,s.value);return $===null?{mode:"html",content:rc(T,s.value)}:{mode:"dynamic",nodes:$}}),v=VQ(),y=X(null),M=!!t.node.loading;return typeof window<"u"?(Ve(d,O=>{var L,b;if((b=(L=y.value)==null?void 0:L.destroy)==null||b.call(L),y.value=null,!M)return f.value=!0,void(p.value=t.node.content);if(!O)return void(f.value=!1);const T=v(O,{rootMargin:"400px"});y.value=T,f.value=T.isVisible.value,T.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ve(()=>t.node.content,O=>{M&&!f.value||(p.value=O)})):f.value=!0,so(()=>{var O,L;(L=(O=y.value)==null?void 0:O.destroy)==null||L.call(O),y.value=null}),(O,L)=>(_(),ke(Oo(k.value?m.value:"div"),bn({ref_key:"htmlRef",ref:d,class:"html-block-node"},k.value?a.value:void 0),{default:we(()=>[f.value?(_(),I(Pe,{key:0},[g.value.mode==="structured"?(_(),ke(x(r),bn({key:0},i.value,{nodes:h.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(_(),ke(x(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(_(),I("pre",KQ,R(g.value.content),1)):(_(),I("div",bn({key:3},l.value,{innerHTML:g.value.content}),null,16,GQ))],64)):(_(),I("div",YQ,[On(O.$slots,"placeholder",{node:e.node},()=>[L[0]||(L[0]=C("span",{class:"html-block-node__placeholder-bar"},null,-1)),L[1]||(L[1]=C("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),L[2]||(L[2]=C("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Tu.install=e=>{e.component(Tu.__name,Tu)};const QQ={dir:"auto",class:"paragraph-node"},XQ=["custom-id"],Vl=kn(je({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=go(()=>t.customId),o=Vt("markstreamHtmlPolicy",void 0),s=Vt("markstreamFade",void 0),i=Vt("markstreamParseOptions",void 0),r=Vt("markstreamCustomMarkdownIt",void 0),l=Vt("markstreamNestedRendererProps",void 0),a=B(()=>{var b;return(b=o?.value)!=null?b:"safe"}),c=B(()=>{var b;return(b=t.parseOptions)!=null?b:i?.value}),u=B(()=>{var b;return(b=t.customMarkdownIt)!=null?b:r?.value}),d=B(()=>{var b,T;return(T=t.customHtmlTags)!=null?T:(b=l?.value)==null?void 0:b.customHtmlTags}),f=B(()=>{var b,T;const $=(b=l?.value)!=null?b:{};return Pt(rt({},$),{customId:(T=t.customId)!=null?T:$.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),p=mi({loader:()=>Promise.resolve().then(()=>_y),suspensible:!1});function h(b){var T;return b.type==="text"&&String((T=b.content)!=null?T:"").trim()===""}const m=B(()=>t.node.children.filter(b=>!h(b))),w=B(()=>m.value.length>0&&m.value.every(b=>b.type==="image"||(function(T){var $;const N=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(E=>!h(E)):[]})(T);return N.length===1&&(($=N[0])==null?void 0:$.type)==="image"})(b))),k=B(()=>new Set(Sc(d.value))),g=B(()=>{if(!w.value||m.value.length<=1)return t.node.children;const b=[];for(let T=0;T<t.node.children.length;T++){const $=t.node.children[T];if(!h($)){b.push($);continue}const N=b.length>0,S=t.node.children.slice(T+1).some(E=>!h(E));N&&S&&b.push(Pt(rt({},$),{content:" ",raw:" "}))}return b}),v=B(()=>s?.value===!1&&!n.value.text),y=B(()=>v.value?gc(g.value):null);function M(b,T){return{node:b,"index-key":`${t.indexKey}-${T}`,"custom-id":t.customId,"custom-html-tags":d.value}}const O=B(()=>rt({inline_code:Yo,image:Yr,link:as,hardbreak:Qr,emphasis:cs,strong:rs,strikethrough:ls,highlight:Hs,insert:Ss,subscript:ws,superscript:_s,html_inline:Fs,html_block:Tu,emoji:bs,checkbox:Ds,math_inline:bi,checkbox_input:Ds,reference:is,footnote_anchor:Mu,footnote_reference:Bs,text:to},n.value)),L=B(()=>g.value.map((b,T)=>{var $;const N=(function(S){var E,P,D,F;if(S.type==="html_block"||S.type==="html_inline"){const W=String((E=S.tag)!=null?E:"").trim().toLowerCase()||oA(S.content);if(W&&!k.value.has(W)&&sA((P=S.content)!=null?P:S.raw,W)){const K=String((F=(D=S.content)!=null?D:S.raw)!=null?F:"");return{child:{type:"text",content:K,raw:K},component:to,isCustomComponent:!1}}}return{child:S,component:O.value[S.type],isCustomComponent:!!(n.value[S.type]&&!gd(String(S.type)))}})(b);return Pt(rt({},N),{index:T,key:`${t.indexKey||"paragraph"}-${T}`,customAttrs:N.isCustomComponent?py(N.child,a.value):void 0,hasSlotChildren:Array.isArray(N.child.children)&&N.child.children.length>0,slotContent:String(($=N.child.content)!=null?$:""),originalChild:b})}));return(b,T)=>(_(),I("p",QQ,[y.value!==null?(_(),I("span",{key:0,class:"text-node","custom-id":t.customId},R(y.value),9,XQ)):(_(!0),I(Pe,{key:1},nt(L.value,$=>{return _(),I(Pe,{key:$.key},[w.value&&h($.originalChild)?(_(),I(Pe,{key:0},[qe(R((N=$.originalChild,String((S=N.content)!=null?S:""))),1)],64)):$.isCustomComponent?(_(),ke(Oo($.component),bn({key:1,ref_for:!0},$.customAttrs,{node:$.child,loading:$.child.loading,"index-key":$.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:we(()=>[$.hasSlotChildren?(_(),ke(x(p),bn({key:0,ref_for:!0},f.value,{nodes:$.child.children,"index-key":$.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):$.slotContent?(_(),ke(x(p),bn({key:1,ref_for:!0},f.value,{content:$.slotContent,final:!$.child.loading,"index-key":`${$.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(_(),ke(Oo($.component),bn({key:2,ref_for:!0},M($.child,$.index)),null,16))],64);var N,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Vl.install=e=>{e.component(Vl.__name,Vl)};const ZQ={class:"table-node-wrapper"},JQ=["aria-busy"],eX={key:0},tX=["custom-id"],nX=["aria-label","onPointerdown"],oX=["custom-id"],sX={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Eu=kn(je({__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=B(()=>{var k;return(k=t.node.loading)!=null&&k}),o=B(()=>{var k;return(k=t.node.rows)!=null?k:[]}),s=X(null),i=X([]);let r=null;const l=B(()=>t.node.header.cells.length),a=B(()=>i.value.some(k=>Number.isFinite(k)&&k>0)),c=B(()=>a.value?i.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);Nn("markstreamShowTooltips",B(()=>t.showTooltips)),Nn("markstreamFade",B(()=>t.fade));const u=go(()=>t.customId),d=B(()=>!!u.value.text),f=B(()=>!!u.value.paragraph),p=new WeakMap;function h(k){const g=t.fade===!1&&!d.value,v=!f.value,y=p.get(k);if(y?.children===k.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const M=Fh(k.children,v,!0),O={simpleChildren:M,plainText:M&&g?gc(M):null};return p.set(k,{children:k.children,textFastPath:g,paragraphFastPath:v,info:O}),O}function m(k){if(!r)return;k.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),y=Math.max(v,Math.min(g-v,Math.round(r.startWidth+k.clientX-r.startX))),M=[...r.widths];M[r.index]=y,M[r.index+1]=g-y,i.value=M}function w(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",w),r=null)}return Ve(l,()=>{w(),i.value=[]}),so(w),(k,g)=>(_(),I("div",ZQ,[C("table",{ref_key:"tableRef",ref:s,class:De(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(_(),I("colgroup",eX,[(_(!0),I(Pe,null,nt(e.node.header.cells,(v,y)=>(_(),I("col",{key:y,style:en(c.value[y])},null,4))),128))])):re("",!0),C("thead",null,[C("tr",null,[(_(!0),I(Pe,null,nt(e.node.header.cells,(v,y)=>(_(),I("th",{key:y,dir:"auto",class:De([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[h(v).plainText!==null?(_(),I("span",{key:0,class:"text-node","custom-id":t.customId},R(h(v).plainText),9,tX)):h(v).simpleChildren?(_(),ke(x(td),{key:1,nodes:h(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(_(),ke(x(Cs),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=M=>k.$emit("copy",M))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(_(),I("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:M=>(function(O,L){if(L.button!==0)return;const b=(function(){var N;const S=(N=s.value)==null?void 0:N.querySelectorAll("thead th");return Array.from(S??[],E=>Math.round(E.getBoundingClientRect().width))})(),T=b[O],$=b[O+1];T&&$&&(L.preventDefault(),r={index:O,startX:L.clientX,startWidth:T,nextStartWidth:$,widths:b},i.value=b,window.addEventListener("pointermove",m),window.addEventListener("pointerup",w),window.addEventListener("pointercancel",w))})(y,M)},null,40,nX)):re("",!0)],2))),128))])]),C("tbody",null,[(_(!0),I(Pe,null,nt(o.value,(v,y)=>(_(),I("tr",{key:y},[(_(!0),I(Pe,null,nt(v.cells,(M,O)=>(_(),I("td",{key:O,class:De([M.align==="right"?"text-right":M.align==="center"?"text-center":"text-left"]),dir:"auto"},[h(M).plainText!==null?(_(),I("span",{key:0,class:"text-node","custom-id":t.customId},R(h(M).plainText),9,oX)):h(M).simpleChildren?(_(),ke(x(td),{key:1,nodes:h(M).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${O}`},null,8,["nodes","custom-id","index-key"])):(_(),ke(x(Cs),{key:2,nodes:M.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=L=>k.$emit("copy",L))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,JQ),se(Jr,{name:"table-node-fade"},{default:we(()=>[n.value?(_(),I("div",sX,[On(k.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=C("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=C("span",{class:"sr-only"},"Loading",-1))],!0)])):re("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Eu.install=e=>{e.component(Eu.__name,Eu)};const iX={class:"hr-node"},Wf=kn({},[["render",function(e,t){return _(),I("hr",iX)}],["__scopeId","data-v-39b2349c"]]);Wf.install=e=>{e.component(Wf.__name,Wf)};const rX={class:"unknown-node"},Nv=je({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(_(),I("div",rX,R(e.node.raw),1))}),Uf=kn(je({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=B(()=>`vmr-container vmr-container-${t.node.name}`),o=go(()=>t.customId),s=B(()=>rt({text:to,paragraph:Vl,heading:Hh,inline_code:Yo,link:as,image:Yr,strong:rs,emphasis:cs,strikethrough:ls,insert:Ss,subscript:ws,superscript:_s,checkbox:Ds,checkbox_input:Ds,hardbreak:Qr,math_inline:bi,reference:is,list:ac,math_block:hM,table:Eu},o.value));return(i,r)=>(_(),I("div",bn({class:n.value},e.node.attrs),[(_(!0),I(Pe,null,nt(e.node.children,(l,a)=>{return _(),ke(Oo((c=l.type,s.value[c]||Nv)),{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"]]);Uf.install=e=>{e.component(Uf.__name,Uf)};const lX=["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"],yS=[[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 aX(e){if(e<=255)return lX[e];let t=0,n=yS.length-1;for(;t<=n;){const o=t+n>>1,s=yS[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const cX=/[ \t\n\r\f]+/g,uX=/[\t\n\r\f]| {2,}|^ | $/;let jg=null;const dX=new RegExp("\\p{Script=Arabic}","u"),Fp=new RegExp("\\p{M}","u"),mM=new RegExp("\\p{Nd}","u");function kS(e){return dX.test(e)}function bS(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 lr(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(bS(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(bS(n))return!0}}return!1}const fX=new Set([" "," ","⁠","\uFEFF"]);function hX(e){return lr(e)}function Rv(e){return!(function(t){const n=zh(t);return n!==null&&(my.has(n)||Ql.has(n))})(e)&&!(function(t){const n=zh(t);return n!==null&&fX.has(n)})(e)}const my=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Hp=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),gy=new Set(["'","’"]),Ql=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),pX=new Set([":",".","،","؛"]),mX=new Set(["၏"]),gX=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function vX(e){if(vy(e))return!0;let t=!1;for(const n of e)if(Ql.has(n))t=!0;else if(!t||!Fp.test(n))return!1;return t}function yX(e){for(const t of e)if(!my.has(t)&&!Ql.has(t))return!1;return e.length>0}function kX(e){if(vy(e))return!0;for(const t of e)if(!Hp.has(t)&&!gy.has(t)&&!Fp.test(t))return!1;return e.length>0}function vy(e){let t=!1;for(const n of e)if(n!=="\\"&&!Fp.test(n)){if(!(Hp.has(n)||Ql.has(n)||gy.has(n)))return!1;t=!0}return t}function gM(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 zh(e){if(e.length===0)return null;const t=gM(e,e.length);return e.slice(t)}function bX(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Fp.test(o))n--;else{if(!Hp.has(o)&&!gy.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function _X(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function _S(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 wS(e,t){return e&&t!==null&&pX.has(t)}function wX(e){const t=zh(e);return t!==null&&mX.has(t)}function SX(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 Ov(e){let t=e.length;for(;t>0;){const n=gM(e,t),o=e.slice(n,t);if(gX.has(o))return!0;if(!Ql.has(o))return!1;t=n}return!1}function CX(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
243
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const xX=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Zs(e){return e.length===1?e[0]:e.join("")}function AX(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Zs(n)}function MX(e,t,n,o){if(!xX.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=CX(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:Zs(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:Zs(r),isWordLike:a,kind:i,start:l}),s}function Vg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const TX=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function EX(e,t){const n=e.texts[t];return!!n.startsWith("www.")||TX.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function IX(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const $X=new Set([":","-","/","×",",",".","+","–","—"]),SS=/^[A-Za-z0-9_]+[,:;]*$/,CS=/[,:;]+$/;function xS(e){for(const t of e)if(mM.test(t))return!0;return!1}function qf(e){if(e.length===0)return!1;for(const t of e)if(!mM.test(t)&&!$X.has(t))return!1;return!0}function AS(e,t,n){var o,s,i;const r=(jg===null&&(jg=new Intl.Segmenter(void 0,{granularity:"word"})),jg);let l=0;const a=[],c=[],u=[],d=[],f=[],p=[],h=[],m=[],w=[],k=[],g=[],v=[];for(const b of r.segment(e))for(const T of MX(b.segment,(o=b.isWordLike)!=null&&o,b.index,n)){let $=function(){p[K]!==null&&(c[K]=[_S(a,p,h,K)],p[K]=null),c[K].push(T.text),u[K]=u[K]||T.isWordLike,m[K]=m[K]||E,w[K]=w[K]||P,k[K]=F,g[K]=W,v[K]=wS(w[K],D)};const N=T.kind==="text",S=_X(T.text,T.isWordLike,T.kind),E=lr(T.text),P=kS(T.text),D=zh(T.text),F=Ov(T.text),W=wX(T.text),K=l-1;t.carryCJKAfterClosingQuote&&N&&l>0&&d[K]==="text"&&E&&m[K]&&k[K]||N&&l>0&&d[K]==="text"&&yX(T.text)&&m[K]||N&&l>0&&d[K]==="text"&&g[K]?$():N&&l>0&&d[K]==="text"&&T.isWordLike&&P&&v[K]?($(),u[K]=!0):S!==null&&l>0&&d[K]==="text"&&p[K]===S?h[K]=((s=h[K])!=null?s:1)+1:N&&!T.isWordLike&&l>0&&d[K]==="text"&&(vX(T.text)||T.text==="-"&&u[K])?$():(a[l]=T.text,c[l]=[T.text],u[l]=T.isWordLike,d[l]=T.kind,f[l]=T.start,p[l]=S,h[l]=S===null?0:1,m[l]=E,w[l]=P,k[l]=F,g[l]=W,v[l]=wS(P,D),l++)}for(let b=0;b<l;b++)p[b]===null?a[b]=Zs(c[b]):a[b]=_S(a,p,h,b);for(let b=1;b<l;b++)d[b]==="text"&&!u[b]&&vy(a[b])&&d[b-1]==="text"&&(a[b-1]+=a[b],u[b-1]=u[b-1]||u[b],a[b]="");const y=Array.from({length:l},()=>null);let M=-1;for(let b=l-1;b>=0;b--){const T=a[b];if(T.length!==0){if(d[b]==="text"&&!u[b]&&kX(T)&&M>=0&&d[M]==="text"){const $=(i=y[M])!=null?i:[];$.push(T),y[M]=$,f[M]=f[b],a[b]="";continue}M=b}}for(let b=0;b<l;b++){const T=y[b];T!=null&&(a[b]=AX(T,a[b]))}let O=0;for(let b=0;b<l;b++){const T=a[b];T.length!==0&&(O!==b&&(a[O]=T,u[O]=u[b],d[O]=d[b],f[O]=f[b]),O++)}a.length=O,u.length=O,d.length=O,f.length=O;const L=(function(b){const T=b.texts.slice(),$=b.isWordLike.slice(),N=b.kinds.slice(),S=b.starts.slice();for(let E=0;E<T.length-1;E++){if(N[E]!=="text"||N[E+1]!=="text"||!lr(T[E])||!lr(T[E+1]))continue;const P=bX(T[E]);P!==null&&(T[E]=P.head,T[E+1]=P.tail+T[E+1],S[E+1]=S[E]+P.head.length)}return{len:T.length,texts:T,isWordLike:$,kinds:N,starts:S}})((function(b){const T=[],$=[],N=[],S=[];for(let E=0;E<b.len;E++){const P=b.texts[E],D=b.kinds[E],F=b.isWordLike[E];if(D==="text"&&F&&SS.test(P)){const W=[P];let K=CS.test(P),Y=E+1;for(;K&&Y<b.len&&b.kinds[Y]==="text"&&b.isWordLike[Y]&&SS.test(b.texts[Y]);){const q=b.texts[Y];W.push(q),K=CS.test(q),Y++}T.push(Zs(W)),$.push(!0),N.push("text"),S.push(b.starts[E]),E=Y-1;continue}T.push(P),$.push(F),N.push(D),S.push(b.starts[E])}return{len:T.length,texts:T,isWordLike:$,kinds:N,starts:S}})((function(b){const T=[],$=[],N=[],S=[];for(let E=0;E<b.len;E++){const P=b.texts[E];if(b.kinds[E]==="text"&&P.includes("-")){const D=P.split("-");let F=D.length>1;for(let W=0;W<D.length;W++){const K=D[W];if(!F)break;K.length!==0&&xS(K)&&qf(K)||(F=!1)}if(F){let W=0;for(let K=0;K<D.length;K++){const Y=D[K],q=K<D.length-1?`${Y}-`:Y;T.push(q),$.push(!0),N.push("text"),S.push(b.starts[E]+W),W+=q.length}continue}}T.push(P),$.push(b.isWordLike[E]),N.push(b.kinds[E]),S.push(b.starts[E])}return{len:T.length,texts:T,isWordLike:$,kinds:N,starts:S}})((function(b){const T=[],$=[],N=[],S=[];for(let E=0;E<b.len;E++){const P=b.texts[E],D=b.kinds[E];if(D==="text"&&qf(P)&&xS(P)){const F=[P];let W=E+1;for(;W<b.len&&b.kinds[W]==="text"&&qf(b.texts[W]);)F.push(b.texts[W]),W++;T.push(Zs(F)),$.push(!0),N.push("text"),S.push(b.starts[E]),E=W-1;continue}T.push(P),$.push(b.isWordLike[E]),N.push(D),S.push(b.starts[E])}return{len:T.length,texts:T,isWordLike:$,kinds:N,starts:S}})((function(b){const T=[],$=[],N=[],S=[];for(let E=0;E<b.len;E++){const P=b.texts[E];if(T.push(P),$.push(b.isWordLike[E]),N.push(b.kinds[E]),S.push(b.starts[E]),!IX(P))continue;const D=E+1;if(D>=b.len||Vg(b.kinds[D]))continue;const F=[],W=b.starts[D];let K=D;for(;K<b.len&&!Vg(b.kinds[K]);)F.push(b.texts[K]),K++;F.length>0&&(T.push(Zs(F)),$.push(!0),N.push("text"),S.push(W),E=K-1)}return{len:T.length,texts:T,isWordLike:$,kinds:N,starts:S}})((function(b){const T=b.texts.slice(),$=b.isWordLike.slice(),N=b.kinds.slice(),S=b.starts.slice();for(let P=0;P<b.len;P++){if(N[P]!=="text"||!EX(b,P))continue;const D=[T[P]];let F=P+1;for(;F<b.len&&!Vg(N[F]);){D.push(T[F]),$[P]=!0;const W=T[F].includes("?");if(N[F]="text",T[F]="",F++,W)break}T[P]=Zs(D)}let E=0;for(let P=0;P<T.length;P++){const D=T[P];D.length!==0&&(E!==P&&(T[E]=D,$[E]=$[P],N[E]=N[P],S[E]=S[P]),E++)}return T.length=E,$.length=E,N.length=E,S.length=E,{len:E,texts:T,isWordLike:$,kinds:N,starts:S}})((function(b){const T=[],$=[],N=[],S=[];let E=0;for(;E<b.len;){const P=[b.texts[E]];let D=b.isWordLike[E],F=b.kinds[E],W=b.starts[E];if(F==="glue"){const K=[P[0]],Y=W;for(E++;E<b.len&&b.kinds[E]==="glue";)K.push(b.texts[E]),E++;const q=Zs(K);if(!(E<b.len&&b.kinds[E]==="text")){T.push(q),$.push(!1),N.push("glue"),S.push(Y);continue}P[0]=q,P.push(b.texts[E]),D=b.isWordLike[E],F="text",W=Y,E++}else E++;if(F==="text")for(;E<b.len&&b.kinds[E]==="glue";){const K=[];for(;E<b.len&&b.kinds[E]==="glue";)K.push(b.texts[E]),E++;const Y=Zs(K);E<b.len&&b.kinds[E]==="text"?(P.push(Y,b.texts[E]),D=D||b.isWordLike[E],E++):P.push(Y)}T.push(Zs(P)),$.push(D),N.push(F),S.push(W)}return{len:T.length,texts:T,isWordLike:$,kinds:N,starts:S}})({len:O,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let b=0;b<L.len-1;b++){const T=SX(L.texts[b]);T!==null&&(L.kinds[b]!=="space"&&L.kinds[b]!=="preserved-space"||L.kinds[b+1]!=="text"||!kS(L.texts[b+1])||(L.texts[b]=T.space,L.isWordLike[b]=!1,L.kinds[b]=L.kinds[b]==="preserved-space"?"preserved-space":"space",L.texts[b+1]=T.marks+L.texts[b+1],L.starts[b+1]=L.starts[b]+T.space.length))}return L}function LX(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 Ta=null;const MS=new Map;let Ea=null;const NX=new RegExp("\\p{Emoji_Presentation}","u"),RX=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Kg=null;const TS=new Map;function Pv(){if(Ta!==null)return Ta;if(typeof OffscreenCanvas<"u")return Ta=new OffscreenCanvas(1,1).getContext("2d"),Ta;if(typeof document<"u")return Ta=document.createElement("canvas").getContext("2d"),Ta;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Lr(e,t){let n=t.get(e);return n===void 0&&(n={width:Pv().measureText(e).width,containsCJK:lr(e)},t.set(e,n)),n}function zp(){if(Ea!==null)return Ea;if(typeof navigator>"u")return Ea={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ea;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 Ea={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ea}function vM(){return Kg===null&&(Kg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Kg}function OX(e){return NX.test(e)||e.includes("️")}function El(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=vM();for(const a of l.segment(i))OX(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function PX(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 DX(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function ES(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i}=e;if(o.length===0)return 0;const r=t+zp().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,p=0;function h(y=u,M=d,O=a){l++,a=0,c=!1,f=-1,p=0}function m(y,M){c=!0,u=y+1,d=0,a=M}function w(y,M,O){c=!0,u=y,d=M+1,a=O}function k(y,M){c?(a+=M,u=y+1,d=0):m(y,M)}function g(y,M){const O=i[y];for(let L=M;L<O.length;L++){const b=O[L];c?a+b>r?(h(),w(y,L,b)):(a+=b,u=y,d=L+1):w(y,L,b)}c&&u===y&&d===O.length&&(u=y+1,d=0)}let v=0;for(;v<o.length&&(c||(v=PX(e,v),!(v>=o.length)));){const y=o[v],M=s[v],O=M==="space"||M==="preserved-space"||M==="tab"||M==="zero-width-break"||M==="soft-hyphen";if(c)if(a+y>r){if(O){k(v,y),h(v+1,0,a-y),v++;continue}if(f>=0){if(u>f||u===f&&d>0){h();continue}h(f,0,p);continue}if(y>t&&i[v]!==null){h(),g(v,0),v++;continue}h()}else k(v,y),O&&(f=v+1,p=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),O&&(f=v+1,p=a-y),v++}return c&&h(),l}let Gg=null;function BX(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,p){o=[d],s=f,i=p,r=Ov(d),l=Hp.has(d)}function u(d,f){o.push(d),i=i||f;const p=Ov(d);r=d.length===1&&Ql.has(d)&&r||p,l=!1}for(const d of(Gg===null&&(Gg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Gg).segment(e)){const f=d.segment,p=lr(f);o.length!==0?l||my.has(f)||Ql.has(f)||t.carryCJKAfterClosingQuote&&p&&r?u(f,p):i||p?(a(),c(f,d.index,p)):u(f,p):c(f,d.index,p)}return a(),n}function FX(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=lr(e[0].text),i=Rv(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=lr(a.text),u=Rv(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 HX(e,t,n,o){const s=zp(),{cache:i,emojiCorrection:r}=(function(L,b){Pv().font=L;const T=(function(S){let E=MS.get(S);return E||(E=new Map,MS.set(S,E)),E})(L),$=(function(S){const E=S.match(/(\d+(?:\.\d+)?)\s*px/);return E?parseFloat(E[1]):16})(L),N=b?(function(S,E){let P=TS.get(S);if(P!==void 0)return P;const D=Pv();D.font=S;const F=D.measureText("😀").width;if(P=0,F>E+.5&&typeof document<"u"&&document.body!==null){const W=document.createElement("span");W.style.font=S,W.style.display="inline-block",W.style.visibility="hidden",W.style.position="absolute",W.textContent="😀",document.body.appendChild(W);const K=W.getBoundingClientRect().width;document.body.removeChild(W),F-K>.5&&(P=F-K)}return TS.set(S,P),P})(L,$):0;return{cache:T,fontSize:$,emojiCorrection:N}})(t,(l=e.normalized,RX.test(l)));var l;const a=El("-",Lr("-",i),r),c=8*El(" ",Lr(" ",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=[],p=[];let h=e.chunks.length<=1;const m=null,w=[],k=n?[]:null,g=Array.from({length:e.len});function v(L,b,T,$,N,S,E){N!=="text"&&N!=="space"&&N!=="zero-width-break"&&(h=!1),u.push(b),d.push(T),f.push($),p.push(N),w.push(E),k!==null&&k.push(L)}function y(L,b,T,$,N){const S=Lr(L,i),E=El(L,S,r),P=b==="space"||b==="preserved-space"||b==="zero-width-break"?0:E,D=b==="space"||b==="zero-width-break"?0:E;if(N&&$&&L.length>1){let F="sum-graphemes";qf(L)?F="pair-context":s.preferPrefixWidthsForBreakableRuns&&(F="segment-prefixes");const W=(function(K,Y,q,ae,ce){if(Y.breakableFitAdvances!==void 0)return Y.breakableFitAdvances;const ne=vM(),Q=[];for(const Xe of ne.segment(K))Q.push(Xe.segment);if(Q.length<=1)return Y.breakableFitAdvances=null,Y.breakableFitAdvances;if(ce==="sum-graphemes"){const Xe=[];for(const me of Q){const G=Lr(me,q);Xe.push(El(me,G,ae))}return Y.breakableFitAdvances=Xe,Y.breakableFitAdvances}if(ce==="pair-context"||Q.length>96){const Xe=[];let me=null,G=0;for(const ie of Q){const de=El(ie,Lr(ie,q),ae);if(me===null)Xe.push(de);else{const z=me+ie,Z=Lr(z,q);Xe.push(El(z,Z,ae)-G)}me=ie,G=de}return Y.breakableFitAdvances=Xe,Y.breakableFitAdvances}const ee=[];let ye="",xe=0;for(const Xe of Q){ye+=Xe;const me=El(ye,Lr(ye,q),ae);ee.push(me-xe),xe=me}return Y.breakableFitAdvances=ee,Y.breakableFitAdvances})(L,S,i,r,F);return void v(L,E,P,D,b,T,W)}v(L,E,P,D,b,T,null)}for(let L=0;L<e.len;L++){g[L]=u.length;const b=e.texts[L],T=e.isWordLike[L],$=e.kinds[L],N=e.starts[L];if($==="soft-hyphen"){v(b,0,a,a,$,N,null);continue}if($==="hard-break"){v(b,0,0,0,$,N,null);continue}if($==="tab"){v(b,0,0,0,$,N,null);continue}const S=Lr(b,i);if($==="text"&&S.containsCJK){const E=BX(b,s),P=o==="keep-all"?FX(E):E;for(let D=0;D<P.length;D++){const F=P[D];y(F.text,"text",N+F.start,T,o==="keep-all"||!lr(F.text))}continue}y(b,$,N,T,!0)}const M=(function(L,b,T){const $=[];for(let N=0;N<L.length;N++){const S=L[N],E=S.startSegmentIndex<b.length?b[S.startSegmentIndex]:T,P=S.endSegmentIndex<b.length?b[S.endSegmentIndex]:T,D=S.consumedEndSegmentIndex<b.length?b[S.consumedEndSegmentIndex]:T;$.push({startSegmentIndex:E,endSegmentIndex:P,consumedEndSegmentIndex:D})}return $})(e.chunks,g,u.length),O=m===null?null:(function(L,b){const T=(function(N){const S=N.length;if(S===0)return null;const E=new Array(S);let P=!1;for(let q=0;q<S;){const ae=N.charCodeAt(q);let ce=ae,ne=1;if(ae>=55296&&ae<=56319&&q+1<S){const ee=N.charCodeAt(q+1);ee>=56320&&ee<=57343&&(ce=ee-56320+(ae-55296<<10)+65536,ne=2)}const Q=aX(ce);Q!=="R"&&Q!=="AL"&&Q!=="AN"||(P=!0);for(let ee=0;ee<ne;ee++)E[q+ee]=Q;q+=ne}if(!P)return null;let D=0;for(let q=0;q<S;q++){const ae=E[q];if(ae==="L"){D=0;break}if(ae==="R"||ae==="AL"){D=1;break}}const F=new Int8Array(S);for(let q=0;q<S;q++)F[q]=D;const W=1&D?"R":"L",K=W;let Y=K;for(let q=0;q<S;q++)E[q]==="NSM"?E[q]=Y:Y=E[q];Y=K;for(let q=0;q<S;q++){const ae=E[q];ae==="EN"?E[q]=Y==="AL"?"AN":"EN":ae!=="R"&&ae!=="L"&&ae!=="AL"||(Y=ae)}for(let q=0;q<S;q++)E[q]==="AL"&&(E[q]="R");for(let q=1;q<S-1;q++)E[q]==="ES"&&E[q-1]==="EN"&&E[q+1]==="EN"&&(E[q]="EN"),E[q]!=="CS"||E[q-1]!=="EN"&&E[q-1]!=="AN"||E[q+1]!==E[q-1]||(E[q]=E[q-1]);for(let q=0;q<S;q++){if(E[q]!=="EN")continue;let ae;for(ae=q-1;ae>=0&&E[ae]==="ET";ae--)E[ae]="EN";for(ae=q+1;ae<S&&E[ae]==="ET";ae++)E[ae]="EN"}for(let q=0;q<S;q++){const ae=E[q];ae!=="WS"&&ae!=="ES"&&ae!=="ET"&&ae!=="CS"||(E[q]="ON")}Y=K;for(let q=0;q<S;q++){const ae=E[q];ae==="EN"?E[q]=Y==="L"?"L":"EN":ae!=="R"&&ae!=="L"||(Y=ae)}for(let q=0;q<S;q++){if(E[q]!=="ON")continue;let ae=q+1;for(;ae<S&&E[ae]==="ON";)ae++;const ce=(q>0?E[q-1]:K)!=="L"?"R":"L";if(ce===((ae<S?E[ae]:K)!=="L"?"R":"L"))for(let ne=q;ne<ae;ne++)E[ne]=ce;q=ae-1}for(let q=0;q<S;q++)E[q]==="ON"&&(E[q]=W);for(let q=0;q<S;q++){const ae=E[q];1&F[q]?ae!=="L"&&ae!=="AN"&&ae!=="EN"||F[q]++:ae==="R"?F[q]++:ae!=="AN"&&ae!=="EN"||(F[q]+=2)}return F})(L);if(T===null)return null;const $=new Int8Array(b.length);for(let N=0;N<b.length;N++)$[N]=T[b[N]];return $})(e.normalized,m);return k!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:h,segLevels:O,breakableFitAdvances:w,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:M,segments:k}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:h,segLevels:O,breakableFitAdvances:w,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:M}}function zX(e,t,n){return(function(o,s,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return HX((function(c,u,d="normal",f="normal"){const p=(function(w){const k=w??"normal";return k==="pre-wrap"?{mode:k,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:k,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),h=p.mode==="pre-wrap"?(function(w){return/[\r\f]/.test(w)?w.replace(/\r\n/g,`
244
+ `).replace(/[\r\f]/g,`
245
+ `):w.replace(/\r\n/g,`
246
+ `)})(c):(function(w){if(!uX.test(w))return w;let k=w.replace(cX," ");return k.charCodeAt(0)===32&&(k=k.slice(1)),k.length>0&&k.charCodeAt(k.length-1)===32&&(k=k.slice(0,-1)),k})(c);if(h.length===0)return{normalized:h,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(w){if(w.len<=1)return w;const k=[],g=[],v=[],y=[];let M=null,O=!1,L=0,b=!1,T=!1;function $(){M!==null&&(k.push(Zs(M)),g.push(O),v.push("text"),y.push(L),M=null)}for(let N=0;N<w.len;N++){const S=w.texts[N],E=w.kinds[N],P=w.isWordLike[N],D=w.starts[N];if(E==="text"){const F=hX(S),W=Rv(S);if(M!==null&&b&&T){M.push(S),O=O||P,b=b||F,T=W;continue}$(),M=[S],O=P,L=D,b=F,T=W;continue}$(),k.push(S),g.push(P),v.push(E),y.push(D)}return $(),{len:k.length,texts:k,isWordLike:g,kinds:v,starts:y}})(AS(h,u,p)):AS(h,u,p);return rt({normalized:h,chunks:LX(m,p)},m)})(o,zp(),r?.whiteSpace,a),s,!1,a)})(e,t,0,n)}const Yg="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",ko=(()=>{const e=globalThis;if(e[Yg])return e[Yg];const t={configs:{},controllers:{},revision:ta(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Yg]=t,t})();let eu=null;const IS=ko.revision;function $S(e){var t;return e&&(t=ko.configs[e])!=null?t:null}function LS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function WX(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Qg(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!WX(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+=`
247
+ `)}return s.length>0?s:null}function Xg(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(eu!=null)return eu;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return eu=!!((i=r.getContext)!=null&&i.call(r,"2d")),eu}catch{return eu=!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=ko.blockEstimateCache.get(r);if(l)return ko.blockEstimateCache.delete(r),ko.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(p,h,m){const w=`${m}\0${h}\0${p}`,k=ko.preparedCache.get(w);if(k)return ko.preparedCache.delete(w),ko.preparedCache.set(w,k),k.prepared;const g=zX(p,h,{whiteSpace:m});for(ko.preparedCache.set(w,{prepared:g});ko.preparedCache.size>240;){const v=ko.preparedCache.keys().next().value;if(!v)break;ko.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(p,h,m){const w=(function(k,g){return k.simpleLineWalkFastPath?ES(k,g):(function(v,y){if(v.simpleLineWalkFastPath)return ES(v,y);const{widths:M,lineEndFitAdvances:O,lineEndPaintAdvances:L,kinds:b,breakableFitAdvances:T,discretionaryHyphenWidth:$,tabStopAdvance:N,chunks:S}=v;if(M.length===0||S.length===0)return 0;const E=zp(),P=E.lineFitEpsilon,D=y+P;let F=0,W=0,K=!1,Y=0,q=0,ae=-1,ce=0,ne=0,Q=null;function ee(){ae=-1,ce=0,ne=0,Q=null}function ye(Z=Y,pe=q,le=W){F++,W=0,K=!1,ee()}function xe(Z,pe){K=!0,Y=Z+1,q=0,W=pe}function Xe(Z,pe,le){K=!0,Y=Z,q=pe+1,W=le}function me(Z,pe){K?(W+=pe,Y=Z+1,q=0):xe(Z,pe)}function G(Z,pe,le,he){if(!pe)return;const U=Z==="tab"?0:O[le],J=Z==="tab"?he:L[le];ae=le+1,ce=W-he+U,ne=W-he+J,Q=Z}function ie(Z,pe){const le=T[Z];for(let he=pe;he<le.length;he++){const U=le[he];K?W+U>D?(ye(),Xe(Z,he,U)):(W+=U,Y=Z,q=he+1):Xe(Z,he,U)}K&&Y===Z&&q===le.length&&(Y=Z+1,q=0)}function de(Z){if(Q!=="soft-hyphen")return!1;const pe=T[Z];if(pe==null)return!1;const{fitCount:le,fittedWidth:he}=(function(U,J,fe,be,Ee){let Le=0,ue=J;for(;Le<U.length;){const Ie=ue+U[Le];if((Le+1<U.length?Ie+Ee:Ie)>fe+be)break;ue=Ie,Le++}return{fitCount:Le,fittedWidth:ue}})(pe,W,y,P,$);return le!==0&&(W=he,Y=Z,q=le,ee(),le===pe.length?(Y=Z+1,q=0,!0):(ye(Z,le,he+$),ie(Z,le),!0))}function z(Z){F++,ee()}for(let Z=0;Z<S.length;Z++){const pe=S[Z];if(pe.startSegmentIndex===pe.endSegmentIndex){z();continue}K=!1,W=0,pe.startSegmentIndex,Y=pe.startSegmentIndex,q=0,ee();let le=pe.startSegmentIndex;for(;le<pe.endSegmentIndex;){const he=b[le],U=he==="space"||he==="preserved-space"||he==="tab"||he==="zero-width-break"||he==="soft-hyphen",J=he==="tab"?DX(W,N):M[le];if(he!=="soft-hyphen")if(K){if(W+J>D){const fe=W+(he==="tab"?0:O[le]),be=W+(he==="tab"?J:L[le]);if(Q==="soft-hyphen"&&E.preferEarlySoftHyphenBreak&&ce<=D){ye(ae,0,ne);continue}if(Q==="soft-hyphen"&&de(le)){le++;continue}if(U&&fe<=D){me(le,J),ye(le+1,0,be),le++;continue}if(ae>=0&&ce<=D){if(Y>ae||Y===ae&&q>0){ye();continue}const Ee=ae;ye(Ee,0,ne),le=Ee;continue}if(J>y&&T[le]!==null){ye(),ie(le,0),le++;continue}ye();continue}me(le,J),G(he,U,le,J),le++}else J>y&&T[le]!==null?ie(le,0):xe(le,J),G(he,U,le,J),le++;else K&&(Y=le+1,q=0,ae=le+1,ce=W+$,ne=W+$,Q=he),le++}if(K){const he=ae===pe.consumedEndSegmentIndex?ne:W;ye(pe.consumedEndSegmentIndex,0,he)}}return F})(k,g)})(p,h);return{lineCount:w,height:w*m}})(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(ko.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});ko.blockEstimateCache.size>4e3;){const p=ko.blockEstimateCache.keys().next().value;if(!p)break;ko.blockEstimateCache.delete(p)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function yM(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Qg(e.children);return i&&n.paragraph?Xg(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Qg(e.children),l=n.headings[i];return r&&l?Xg(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=Qg((s=i[0])==null?void 0:s.children);return r?Xg(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=yM(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 kf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function UX(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,p;return u.diff?Math.max(kf(String((d=u.originalCode)!=null?d:"")),kf(String((f=u.updatedCode)!=null?f:"")),kf(String((p=u.code)!=null?p:""))):kf((function(h,m){const w=String(h??"");return m?w:w.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(p,h){const m=typeof p?.fontSize=="number"&&p.fontSize>0?p.fontSize:h?13:12;return typeof p?.lineHeight=="number"&&p.lineHeight>0?p.lineHeight:h?30:Math.round(1.5*m)})(u,r),f=(function(p,h){var m,w;if(!h)return 0;const k=typeof((m=p?.padding)==null?void 0:m.top)=="number"?p.padding.top:10,g=typeof((w=p?.padding)==null?void 0:w.bottom)=="number"?p.padding.bottom:22;return Math.max(0,k)+Math.max(0,g)})(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 qX(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Zg(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=LS(o.lineHeight,1.5*LS(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:qX(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const jX=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function NS(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))jX.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const VX=!1;function Uye(){return VX}function RS(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,p){return Number.isFinite(f)?Math.min(Math.max(0,f),p):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 p=o.getNormalizedScrollTop(e,t,!1),h=Math.abs(p-r);h<u&&(u=h,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 kM=Symbol("MarkstreamMathBlockMinHeightCache");function qye(){return Vt(kM,null)}const KX=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],GX=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],YX=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),bM=["raw","content","code","originalCode","updatedCode"],OS=new WeakMap,PS=new WeakMap;let QX=1;function fi(){return typeof performance<"u"?performance.now():Date.now()}function DS(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function ni(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=OS.get(t);return n||(n=QX++,OS.set(t,n)),String(n)}function BS(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:ni(t),customMarkdownIt:ni(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:ni(e.validateLink),preTransformTokens:ni(e.preTransformTokens),postTransformTokens:ni(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function FS(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
248
+ `,t-1)+1;return e.slice(n,t).trim()}function HS(e){const t=_M(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function _M(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function wM(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 yy(e){const t=String(e??"");return`${t.length}:${wM(t)}`}function Dv(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?yy(r):`${r.length}:${wM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${ni(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:${ni(o)}`;const i=ni(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Dv(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}:${Dv(r[c],t,n+1)}`).join(";")}`}return typeof e}function Wh(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function SM(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>Wh(o)?sl(o,t,n+1):SM(o,t,n+1)).join(",")}`:Wh(e)?sl(e,t,n):Dv(e,t,n)}function XX(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!bM.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${yy(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${ni(s)}`:YX.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${SM(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${ni(s)}`:""}).filter(Boolean).join(";")}function ZX(e){return bM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${yy(n)}`:""}).filter(Boolean).join(";")}function sl(e,t=new WeakMap,n=0){const o=PS.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}:${ni(s)}`;const r=ni(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],p=f.length?f.slice(0,200).map(h=>sl(h,c,u+1)).join("|"):"";return[a.type,ZX(d),XX(d,c,u),f.length,p].join(":")})(e,t,n);return PS.set(s,l),l}function CM(e,t){return sl(e)===sl(t)}function ky(e,t,n){const o=fi(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=fi()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function zS(e,t,n){return ky(t,n,()=>sl(e))}function xM(e,t,n){return zS(e,n,"stabilizeSignatureMs")===zS(t,n,"stabilizeSignatureMs")}function Jg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function WS(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function JX(e,t){return e.length===t.length&&e===t}function by(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],p=s[d];if(typeof f!=typeof p)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,p))return!1}else if(typeof p!="string"||!JX(f,p))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(!Wh(d)||!Wh(f))return null;const p=by(d,f,n+1);if(p==null)return null;if(!p)return!1}return!0}function eZ(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=by(e,t);return n??CM(e,t)}function tZ(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return ky(n,"stabilizeSignatureMs",()=>{o=by(e,t)}),o??xM(e,t,n)}function nZ(e,t){const n={};for(const o of KX){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function oZ(e,t){var n;const o=Vw(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:B(()=>!1),r=X(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,p=0,h=fi();function m(){l&&(clearTimeout(l),l=void 0)}function w(){m();const T=t.renderContent.value;r.value!==T&&(r.value=T),h=fi()}Ve([t.renderContent,t.effectiveFinal,i],([T,$,N])=>{r.value!==T&&(!N||$||(function(S,E){if(!S&&E||E.length<=80||E.length<S.length||!E.startsWith(S))return!0;const P=E.slice(S.length);return!!P&&(!!HS(FS(E))||!(!P.includes(`
249
+
250
+ `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(P))||P.endsWith(`
251
+ `)&&!(function(D){const F=FS(D);if(HS(F))return!1;const W=_M(F);return W.length>=2&&W.some(K=>K.trim())})(E))})(r.value,T)?w():(function(){if(p+=1,l)return;const S=Math.max(0,(function(E){const P=E.parseCoalesceMs;return typeof P=="number"&&Number.isFinite(P)&&P>=0?P:80})(e)-(fi()-h));S<=0?w():l=setTimeout(w,S)})())},{flush:"sync",immediate:!0}),t0(m);const k=B(()=>{var T,$,N,S;return wq(e.customHtmlTags,(T=e.parseOptions)==null?void 0:T.customHtmlTags,(S=(N=($=t.customComponentsMap)==null?void 0:$.value)!=null?N:{},Object.entries(S).map(([E,P])=>{const D=ci(E);return P==null||!D||gd(D)||Z3.has(D)||hd.has(D)?"":D}).filter(Boolean)))}),g=B(()=>{const{key:T,tags:$}=Sq(k.value);if(!T)return o;const N=s.get(T);if(N)return N;const S=Vw(t.instanceMsgId,{customHtmlTags:$});return s.set(T,S),S}),v=B(()=>{const T=g.value;return e.customMarkdownIt?e.customMarkdownIt(T):T}),y=B(()=>{var T,$;const N=(T=e.parseOptions)!=null?T:{},S=t.effectiveFinal.value,E=k.value,P=S!=null,D=E.length>0;return P||D||N.streamParse==null?rt(rt(Pt(rt({},N),{streamParse:($=N.streamParse)==null||$}),P?{final:S}:{}),D?{customHtmlTags:E}:{}):N}),M=B(()=>{var T;return new Set(((T=y.value.customHtmlTags)!=null?T:[]).map($=>String($).trim().toLowerCase()).filter(Boolean))}),O=B(()=>BS(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),L=B(()=>BS(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ve([O,L],([T,$],[N,S])=>{N&&(T===N&&$===S||(w(),$!==S&&(a=[],d="")))},{flush:"sync"});const b=B(()=>{var T,$,N,S,E,P,D,F;if((T=e.nodes)!=null&&T.length)return a=[],d="",vt(e.nodes.slice());const W=r.value;if(!W)return a=[],d="",[];const K=t.debugPerformanceEnabled.value,Y=K?fi():0,q=v.value,ae=O.value,ce=L.value;c&&ae!==c&&(function(pe){var le,he;(he=(le=pe.stream)==null?void 0:le.reset)==null||he.call(le)})(q),u&&ce!==u&&(a=[],d="");const ne=a.length>0&&W.startsWith(d)&&ce===u,Q=K?DS(q):null,ee=K?{}:void 0,ye=ee?Pt(rt({},y.value),{__timing:ee}):y.value,xe=HA(W,q,ye),Xe=K?fi():0,me=K?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let G,ie=K?Jg(xe.length):void 0,de=0,z=0;if(ne){const pe=K?fi():0;if(me){const le=(function(he,U,J){if(!U.length)return{nodes:he,metrics:Jg(he.length)};const fe=(function(Le,ue,Ie){const Ge=Math.min(Le.length,ue.length);for(let lt=0;lt<Ge;lt++)if(!tZ(ue[lt],Le[lt],Ie))return lt;return Le.length===ue.length?-1:Ge})(he,U,J);if(fe<0)return{nodes:U,metrics:{reusedNodeCount:he.length,dirtyStartIndex:fe,stablePrefixNodeCount:he.length,dirtyTailNodeCount:0}};const be=he.slice();let Ee=fe;for(let Le=0;Le<fe;Le++)be[Le]=U[Le];for(let Le=fe;Le<he.length;Le++){const ue=U[Le],Ie=he[Le];ue&&xM(ue,Ie,J)&&(be[Le]=ue,Ee+=1)}return{nodes:be,metrics:{reusedNodeCount:Ee,dirtyStartIndex:fe,stablePrefixNodeCount:fe,dirtyTailNodeCount:WS(fe,he,U)}}})(xe,a,me);G=le.nodes,ie=le.metrics}else{const le=(function(he,U){if(!U.length)return{nodes:he,metrics:Jg(he.length)};const J=(function(Ee,Le){const ue=Math.min(Ee.length,Le.length);for(let Ie=0;Ie<ue;Ie++)if(!eZ(Le[Ie],Ee[Ie]))return Ie;return Ee.length===Le.length?-1:ue})(he,U);if(J<0)return{nodes:U,metrics:{reusedNodeCount:he.length,dirtyStartIndex:J,stablePrefixNodeCount:he.length,dirtyTailNodeCount:0}};const fe=he.slice();let be=J;for(let Ee=0;Ee<J;Ee++)fe[Ee]=U[Ee];for(let Ee=J;Ee<he.length;Ee++){const Le=U[Ee],ue=he[Ee];Le&&CM(Le,ue)&&(fe[Ee]=Le,be+=1)}return{nodes:fe,metrics:{reusedNodeCount:be,dirtyStartIndex:J,stablePrefixNodeCount:J,dirtyTailNodeCount:WS(J,he,U)}}})(xe,a);G=le.nodes,ie=le.metrics}de=K?fi()-pe:0,z=ie?.dirtyStartIndex==null||ie.dirtyStartIndex<0?G.length:ie.dirtyStartIndex}else G=xe;me?(function(pe,le,he=0){for(let U=Math.max(0,he);U<pe.length;U++)ky(le,"primeSignatureMs",()=>sl(pe[U]))})(G,me,z):(function(pe,le=0){for(let he=Math.max(0,le);he<pe.length;he++)sl(pe[he])})(G,z);const Z=K?fi()-Xe:0;if(f+=1,d=W,c=ae,u=ce,a=G,K){const pe=DS(q),le=typeof pe?.total=="number"&&pe.total>(($=Q?.total)!=null?$:0);t.logPerf(le?"parse(stream)":"parse(sync)",rt(rt(rt({rendererId:t.instanceMsgId,ms:Math.round(fi()-Y),nodes:G.length,contentLength:W.length,parseCommitCount:f,parseCoalescedCount:p,nodeReuseMs:Z,signatureMs:(N=me?.signatureMs)!=null?N:0,stabilizeSignatureMs:(S=me?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(E=me?.primeSignatureMs)!=null?E:0,signatureCallCount:(P=me?.signatureCallCount)!=null?P:0,stabilizeSignatureCallCount:(D=me?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(F=me?.primeSignatureCallCount)!=null?F:0,stabilizeMs:de},ie??{}),ee?Object.fromEntries(GX.map(he=>{var U;return[he,(U=ee[he])!=null?U:0]})):{}),pe?{streamMode:pe.lastMode,streamDelta:nZ(pe,Q),streamStats:pe}:{}))}return vt(G)});return{effectiveCustomHtmlTags:k,effectiveCustomHtmlTagsSet:M,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:b}}function sZ(e){const{isClient:t}=e,n=X(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,p){if((m=(h=e.shouldTrackVisibleNodeIndices)==null?void 0:h.call(e))!=null&&!m)return;var h,m;const w=n.value,k=w.has(f);if(p){if(k)return;const v=new Set(w);return v.add(f),void(n.value=v)}if(!k)return;const g=new Set(w);g.delete(f),n.value=g})(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,p]of s.entries())f<c||(p(),s.delete(f));for(const[f,p]of o.entries())f<c||(p.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 iZ(e={}){const t=X(""),n=X(""),o=X(!1),s=rY(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=B(()=>Math.max(0,t.value.length-n.value.length)),a=B(()=>l.value===0),c=B(()=>o.value&&a.value);return e0()&&t0(()=>{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 US=/auto|scroll|overlay/i;function rZ(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return US.test(t)||US.test(n)}function lZ(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 aZ=je({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,o;return Sv((o=Va(e.estimatedPreviewHeightPx))!=null?o:_v(String((n=e.node.code)!=null?n:"")))});return()=>yn("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?yn("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)"}},[yn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[yn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),yn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),yn("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},()=>yn("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,yn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[yn("div",{class:"absolute inset-0"},[yn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),cZ=je({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,o;return wv((o=Va(e.estimatedPreviewHeightPx))!=null?o:bv(String((n=e.node.code)!=null?n:"")))});return()=>yn("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?yn("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)"}},[yn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[yn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),yn("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},()=>yn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[yn("span",{class:"action-icon block"})])))]):null,yn("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)"}},[yn("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"}})])])}}),uZ=["data-custom-id"],dZ={class:"m-0 p-0"},fZ=["data-probe"],hZ=["data-node-index","data-node-type"],AM=kn(je(Pt(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=Ho(),r=Vt("markstreamNestedRendererProps",void 0);function l(A){var H,j;const V=o[A];return(function(te){const ge=i?.vnode.props;return!!ge&&(Object.prototype.hasOwnProperty.call(ge,te)||Object.prototype.hasOwnProperty.call(ge,String(te).replace(/[A-Z]/g,Ce=>`-${Ce.toLowerCase()}`)))})(A)?V:(j=(H=r?.value)==null?void 0:H[A])!=null?j:V}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=B(()=>{return(A=l("mode"))==="chat"||A==="minimal"||A==="docs"?A:"docs";var A}),u=B(()=>{const A=l("renderCodeBlocksAsPre"),H=l("codeRenderer");return A===!0?"pre":H==="pre"||H==="shiki"||H==="monaco"?H:A===!1||c.value==="docs"?"monaco":"pre"}),d=B(()=>a[c.value]),f=B(()=>{var A;return(A=l("showTooltips"))!=null?A:d.value.showTooltips}),p=B(()=>{var A;return(A=l("fade"))!=null?A:d.value.fade}),h=B(()=>{var A;return(A=l("batchRendering"))!=null?A:d.value.batchRendering}),m=B(()=>{var A;return(A=l("initialRenderBatchSize"))!=null?A:d.value.initialRenderBatchSize}),w=B(()=>{var A;return(A=l("renderBatchSize"))!=null?A:d.value.renderBatchSize}),k=B(()=>{var A;return(A=l("renderBatchDelay"))!=null?A:d.value.renderBatchDelay}),g=B(()=>{var A;return(A=l("renderBatchBudgetMs"))!=null?A:d.value.renderBatchBudgetMs}),v=B(()=>{var A;return(A=l("renderBatchIdleTimeoutMs"))!=null?A:d.value.renderBatchIdleTimeoutMs}),y=B(()=>{var A;return(A=l("deferNodesUntilVisible"))!=null?A:d.value.deferNodesUntilVisible}),M=B(()=>{var A;return(A=l("maxLiveNodes"))!=null?A:d.value.maxLiveNodes}),O=B(()=>{var A;return(A=l("liveNodeBuffer"))!=null?A:d.value.liveNodeBuffer}),L=B(()=>{var A;return(A=l("nodeVirtual"))!=null?A:d.value.nodeVirtual}),b={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 p.value},get batchRendering(){return h.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return w.value},get renderBatchDelay(){return k.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return M.value},get liveNodeBuffer(){return O.value},get nodeVirtual(){return L.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function T(A){s("height-change",A)}function $(A){s("virtual-state-change",A)}function N(A){s("anchor-change",A)}const S=X(),E=X(null),P=X(null),D=X(null),F=Bo({1:null,2:null,3:null,4:null,5:null,6:null}),W=X(!1),K=new Map,Y=X(0),q=X(0),ae=X({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ce(){var A,H;if(((A=o.virtualScroll)==null?void 0:A.enabled)!==!0)return null;const j=(H=o.virtualScroll)==null?void 0:H.scrollRoot;return ne(typeof j=="function"?j():j)}function ne(A){return A?typeof HTMLElement<"u"&&A instanceof HTMLElement?A:typeof A=="object"&&"value"in A?ne(A.value):typeof A=="object"&&"$el"in A?ne(A.$el):null:null}const{isClient:Q,renderAsFragment:ee,debugPerformanceEnabled:ye,resolvedShowTooltips:xe,resolvedHtmlPolicy:Xe,inheritedSmoothStreaming:me,ownsTypewriterCursor:G}=(function(A){const H=typeof window<"u",j=ad(),V=Vt("markstreamHtmlPolicy",void 0),te=Vt("markstreamTypewriterCursor",void 0),ge=Vt("markstreamSmoothStreaming",void 0),Ce=B(()=>A.renderAsFragment===!0),Me=B(()=>!!(A.debugPerformance&&H&&typeof console<"u")),Fe=B(()=>{var ze;if(typeof A.showTooltips=="boolean")return A.showTooltips;const Re=(ze=j.showTooltips)!=null?ze:j["show-tooltips"];return Re===""||Re===!0||Re==="true"||Re!==!1&&Re!=="false"&&void 0}),Ne=B(()=>{var ze,Re;return(Re=(ze=A.htmlPolicy)!=null?ze:V?.value)!=null?Re:"safe"}),Ue=B(()=>te?.value!==!0);return{isClient:H,renderAsFragment:Ce,debugPerformanceEnabled:Me,resolvedShowTooltips:Fe,resolvedHtmlPolicy:Ne,inheritedSmoothStreaming:ge,inheritedTypewriterCursor:te,ownsTypewriterCursor:Ue}})(b),{resolveViewportRoot:ie,resolveScrollContainer:de,isReverseFlexScrollRoot:z,getNormalizedScrollTop:Z,getOffsetTopWithinRoot:pe}=(function(A,H){function j(){var Me,Fe;return(Fe=(Me=H.scrollRoot)==null?void 0:Me.call(H))!=null?Fe:null}function V(Me){if(typeof window>"u")return null;const Fe=j();if(Fe)return Fe;const Ne=Me??A.value;if(!Ne)return null;const Ue=Ne.ownerDocument||document,ze=Ue.scrollingElement||Ue.documentElement;let Re=Ne;for(;Re&&Re!==Ue.body&&Re!==ze;){if(rZ(window.getComputedStyle(Re))&&lZ(Re))return Re;Re=Re.parentElement}return null}function te(Me){if(!H.isClient)return!1;try{const Fe=window.getComputedStyle(Me);return!!(Fe.display||"").toLowerCase().includes("flex")&&(Fe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function ge(Me,Fe,Ne){var Ue,ze;if(Ne)return Ce(Fe);const Re=Me.scrollTop;if(!te(Me))return Re;const We=Re<0?-Re:Re;return Math.max(0,((Ue=Me.scrollHeight)!=null?Ue:0)-((ze=Me.clientHeight)!=null?ze:0))-We}function Ce(Me){var Fe,Ne,Ue,ze,Re;const We=Number((Fe=Me.scrollingElement)==null?void 0:Fe.scrollTop),Je=Number((Ue=(Ne=Me.documentElement)==null?void 0:Ne.scrollTop)!=null?Ue:0),et=Number((Re=(ze=Me.body)==null?void 0:ze.scrollTop)!=null?Re:0);return Math.max(0,Number.isFinite(We)?We:0,Number.isFinite(Je)?Je:0,Number.isFinite(et)?et:0)}return{resolveViewportRoot:V,resolveScrollContainer:function(Me){var Fe,Ne,Ue,ze;const Re=j();if(Re)return Re;const We=V((Fe=Me??A.value)!=null?Fe:null);if(We)return We;const Je=(ze=(Ue=Me?.ownerDocument)!=null?Ue:(Ne=A.value)==null?void 0:Ne.ownerDocument)!=null?ze:typeof document<"u"?document:null;return Je?.scrollingElement||Je?.documentElement||null},isReverseFlexScrollRoot:te,getNormalizedScrollTop:ge,getOffsetTopWithinRoot:function(Me,Fe){const Ne=Fe.ownerDocument||Me.ownerDocument||document;if((function(We,Je){return We===Je.documentElement||We===Je.body||We===Je.scrollingElement})(Fe,Ne))return Me.getBoundingClientRect().top+Ce(Ne);const Ue=Fe.getBoundingClientRect(),ze=Me.getBoundingClientRect(),Re=ge(Fe,Ne,!1);return ze.top-Ue.top+Re}}})(S,{isClient:Q,scrollRoot:ce});Nn("markstreamShowTooltips",xe),Nn("markstreamHtmlPolicy",Xe),Nn("markstreamTypewriter",B(()=>b.typewriter!==!1)),Nn("markstreamFade",B(()=>b.fade!==!1)),Nn("markstreamTypewriterCursor",B(()=>!0)),Nn("markstreamTextStreamState",K),Nn("markstreamStreamVersion",Y),Nn("markstreamParseOptions",B(()=>b.parseOptions)),Nn("markstreamCustomMarkdownIt",B(()=>b.customMarkdownIt));const{smoothStreamingEnabled:le,renderContent:he,effectiveFinal:U}=(function(A,H){const j=iZ(A.smoothStreamingOptions),V=B(()=>{var Ne,Ue,ze;return A.smoothStreaming!==!1&&!((Ne=A.nodes)!=null&&Ne.length)&&(A.smoothStreaming===!0||!((Ue=H.inheritedSmoothStreaming)!=null&&Ue.value))&&(A.smoothStreaming===!0||A.typewriter===!0||((ze=A.maxLiveNodes)!=null?ze:0)<=0)}),te=X(!H.isClient||A.smoothStreaming===!0);Sn(()=>{te.value=!0});const ge=B(()=>te.value&&V.value),Ce=B(()=>{var Ne;return ge.value?j.visible.value:(Ne=A.content)!=null?Ne:""}),Me=B(()=>{var Ne,Ue;const ze=(Ne=A.parseOptions)!=null?Ne:{};return(Ue=A.final)!=null?Ue:ze.final}),Fe=B(()=>{const Ne=Me.value;return ge.value&&Ne!=null?!!Ne&&j.caughtUp.value:Ne});return Ve([()=>A.content,()=>A.nodes,ge,Me],([Ne,Ue,ze,Re])=>{if(Ue?.length)return void j.reset("");const We=Ne??"";if(!ze)return j.reset(We),void(Re&&j.finish({flush:!0}));const Je=j.source.value;We?We===Je||(We.startsWith(Je)?j.enqueue(We.slice(Je.length)):j.reset(We)):j.reset(""),Re&&j.finish()},{immediate:!0}),{smoothStream:j,smoothStreamingEligible:V,smoothStreamingEnabled:ge,renderContent:Ce,requestedFinal:Me,effectiveFinal:Fe}})(b,{isClient:Q,inheritedSmoothStreaming:me});Nn("markstreamSmoothStreaming",le);const J=X(!1);let fe="",be=!1,Ee=null;function Le(){Q&&Ee!=null&&(window.clearTimeout(Ee),Ee=null)}function ue(){J.value=!1,Le()}function Ie(A,H){if(!ye.value)return;const j=(function(){if(!ye.value)return null;const V=$t(Ge),te=$t(lt),ge=Math.max(_t,te);if(V<=0&&ge<=0)return null;const Ce={total:V,maxPerFrame:ge,byLabel:(Me=Ge,Object.fromEntries(Array.from(Me.entries()).sort((Fe,Ne)=>Ne[1]-Fe[1]||Fe[0].localeCompare(Ne[0]))))};var Me;return Ge.clear(),lt.clear(),_t=0,Ce})();console.info(`[markstream-vue][perf] ${A}`,j?Pt(rt({},H),{layoutReads:j}):H)}Ve([he,()=>o.nodes,U],([A,H,j])=>{const V=A??"";return H?.length||j===!0?(ue(),fe=V,void(be=!0)):be?(fe&&V.length>fe.length&&V.startsWith(fe)?(J.value=!0,Q&&(Le(),Ee=window.setTimeout(()=>{var te;Ee=null,U.value===!0||(te=o.nodes)!=null&&te.length||(ya(),J.value=!1,Hi())},1200))):(V.length<fe.length||!V.startsWith(fe))&&ue(),void(fe=V)):(fe=V,void(be=!0))},{flush:"sync",immediate:!0});const Ge=new Map,lt=new Map;let bt=!1,_t=0;function $t(A){let H=0;for(const j of A.values())H+=j;return H}function Bt(){_t=Math.max(_t,$t(lt)),lt.clear(),bt=!1}function yt(A,H){return(function(j){var V,te;ye.value&&(Ge.set(j,((V=Ge.get(j))!=null?V:0)+1),lt.set(j,((te=lt.get(j))!=null?te:0)+1),bt||(bt=!0,Q&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Bt):typeof queueMicrotask!="function"?setTimeout(Bt,0):queueMicrotask(Bt)))})(A),H()}const Gt=b.customId?`renderer-${b.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,pn=(function(A){const H=new Map;return{scope:A,cache:H,clear:()=>H.clear()}})(Gt),ro=B(()=>`${Gt}:${Y.value}`);Nn(kM,pn);const Yt=go(()=>b.customId),{effectiveCustomHtmlTagsSet:mn,mergedParseOptions:zo,parsedNodes:ot}=oZ(b,{instanceMsgId:Gt,renderContent:he,effectiveFinal:U,smoothStreamingEnabled:le,debugPerformanceEnabled:ye,customComponentsMap:Yt,logPerf:Ie});Ve(ot,()=>{pn.clear(),Y.value+=1},{immediate:!0});const zn=B(()=>({customId:b.customId,customHtmlTags:zo.value.customHtmlTags,parseOptions:b.parseOptions,customMarkdownIt:b.customMarkdownIt,htmlPolicy:Xe.value,viewportPriority:b.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:b.codeBlockStream,codeBlockDarkTheme:b.codeBlockDarkTheme,codeBlockLightTheme:b.codeBlockLightTheme,codeBlockMonacoOptions:b.codeBlockMonacoOptions,renderCodeBlocksAsPre:b.renderCodeBlocksAsPre,codeBlockMinWidth:b.codeBlockMinWidth,codeBlockMaxWidth:b.codeBlockMaxWidth,codeBlockProps:b.codeBlockProps,mermaidProps:b.mermaidProps,d2Props:b.d2Props,infographicProps:b.infographicProps,showTooltips:xe.value,themes:b.themes,langs:b.langs,isDark:b.isDark,typewriter:b.typewriter,smoothStreamingOptions:b.smoothStreamingOptions,parseCoalesceMs:b.parseCoalesceMs,fade:b.fade}));Nn("markstreamNestedRendererProps",zn);const lo=B(()=>ot.value),Gn=B(()=>ot.value.length),Yn=X(null),Zt=X(null),Qn=X(null),Ke=X(null),Ze=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),Ft=!Ze&&b.customId?$S(b.customId):null,sn=B(()=>Ft?(IS.value,$S(b.customId)):null),un=B(()=>{var A;return!!(Q&&!ee.value&&b.customId&&!Ze&&((A=sn.value)!=null&&A.enabled))}),tn=B(()=>{var A;return!!(!ee.value&&((A=o.virtualScroll)!=null&&A.enabled))}),Cn=X(!1);Sn(()=>{Cn.value=!0});const Mt=B(()=>!!(Q&&tn.value));Nn("markstreamHostScrollManaged",Mt);const Xn=B(()=>!!(Cn.value&&Mt.value)),Ut=B(()=>un.value||Mt.value),wo=B(()=>un.value||Xn.value),To=B(()=>{var A;return Ut.value&&((A=sn.value)==null?void 0:A.textEstimation)!==!1}),xs=B(()=>{var A;return Ut.value&&((A=sn.value)==null?void 0:A.codeBlockEstimation)!==!1});function Wo(){const A=q.value||yt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=S.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(A)&&A>0?A:0}const ds=B(()=>{const A=Wo();return A>0?Math.max(1,Math.round(A)):640}),fs=B(()=>{var A;return Math.max(1,(A=b.maxLiveNodes)!=null?A:320)}),Ot=B(()=>{var A;return!ee.value&&b.nodeVirtual!==!1&&!(((A=b.maxLiveNodes)!=null?A:0)<=0)&&(b.nodeVirtual===!0?ot.value.length>0:ot.value.length>fs.value)}),Us=B(()=>Ot.value||un.value||Mt.value),qs=B(()=>b.viewportPriority!==!1&&!W.value),Ye=jQ(A=>{var H;return ie((H=A??S.value)!=null?H:null)},qs),{requestFrame:tt,cancelFrame:st,hasIdleCallback:Ht,isTestEnv:js}=(function(A){const H=A.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,j=A.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,V=A.isClient&&typeof window.requestIdleCallback=="function",te=(function(){var ge;if(typeof globalThis>"u"||!("process"in globalThis))return;const Ce=(ge=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:ge.value;return Ce?.env})();return{requestFrame:H,cancelFrame:j,hasIdleCallback:V,isTestEnv:te?.NODE_ENV==="test"}})({isClient:Q}),{resolvedBatchSize:wi,resolvedInitialBatch:$e,batchingEnabled:Te,incrementalRenderingActive:He,renderedCount:Rt,previousRenderContext:qt,adaptiveBatchSize:ao,previousBatchConfig:Zn}=(function(A,H){var j;const V=B(()=>{var ze;const Re=Math.trunc((ze=A.renderBatchSize)!=null?ze:80);return Number.isFinite(Re)?Math.max(0,Re):0}),te=B(()=>{var ze;const Re=Math.trunc((ze=A.initialRenderBatchSize)!=null?ze:V.value);return Number.isFinite(Re)?Math.max(0,Re):V.value}),ge=B(()=>!H.renderAsFragment.value&&A.batchRendering!==!1&&V.value>0&&H.isClient&&!H.isTestEnv),Ce=X(0),Me=X({key:A.indexKey,total:0}),Fe=X(Math.max(1,V.value||1)),Ne=B(()=>{var ze;return ge.value&&((ze=A.maxLiveNodes)!=null?ze:0)<=0}),Ue=X({batchSize:V.value,initial:te.value,delay:(j=A.renderBatchDelay)!=null?j:16,enabled:Ne.value});return{resolvedBatchSize:V,resolvedInitialBatch:te,batchingEnabled:ge,incrementalRenderingActive:Ne,renderedCount:Ce,previousRenderContext:Me,adaptiveBatchSize:Fe,previousBatchConfig:Ue}})(b,{isClient:Q,isTestEnv:js,renderAsFragment:ee}),Pn=new Map,As=new Map,ft=new WeakMap;let ve=null;const Oe=new WeakMap,jt=new Map,ra=X(0),Ac=B(()=>(ra.value,Array.from(Pn.entries()).sort((A,H)=>A[0]-H[0]))),Pi=X(null),vo=X(null);let Di=null,oe=0,Se=null;const{activeRestoreAnchor:Ae,getRelativeScrollTopWithinContainer:Be,setRelativeScrollTopWithinContainer:it,resolveAnchorOffset:at,clearRestoreReconcile:It,scheduleRestoreReconcile:rn,captureRestoreAnchor:nn,restoreAnchor:Eo,getAnchorDrift:gr}=(function(A){const{isClient:H,containerRef:j,parsedNodeCount:V,requestFrame:te,cancelFrame:ge,resolveScrollContainer:Ce,getNormalizedScrollTop:Me,getOffsetTopWithinRoot:Fe,isReverseFlexScrollRoot:Ne,estimateIndexForOffset:Ue,estimateHeightRange:ze,getFallbackNodeHeight:Re,clamp:We}=A,Je=X(null);let et=null,Ct=[];function ct(){const Et=Ce(),Wt=j.value;if(!Et||!Wt)return null;const zt=Et.ownerDocument||Wt.ownerDocument||document;if(Et===zt.documentElement||Et===zt.body||Et===zt.scrollingElement){const gn=Wt.getBoundingClientRect();return Math.max(0,-gn.top)}return Math.max(0,Me(Et,zt,!1)-Fe(Wt,Et))}function dt(Et){var Wt;const zt=Ce(),gn=j.value;if(!zt||!gn)return;const Is=Math.max(0,Et),Qo=zt.ownerDocument||gn.ownerDocument||document,ui=Qo.defaultView||(typeof window<"u"?window:null);if(zt===Qo.documentElement||zt===Qo.body||zt===Qo.scrollingElement){const wr=Me(zt,Qo,!0)+gn.getBoundingClientRect().top;return void((Wt=ui?.scrollTo)==null||Wt.call(ui,0,Math.max(0,wr+Is)))}RS(zt,Qo,Fe(gn,zt)+Is,{isReverseFlexScrollRoot:wr=>{var Sr;return(Sr=Ne?.(wr))!=null&&Sr},getNormalizedScrollTop:Me})}function At(Et){const Wt=V.value,zt=We(Et.nodeIndex,0,Math.max(0,Wt-1));return ze(0,zt)+Math.max(0,Et.offsetWithinNodePx)}function xt(){if(et!=null&&(ge?.(et),et=null),H)for(const Et of Ct)window.clearTimeout(Et);Ct=[]}function ln(Et){const Wt=At(Et),zt=ct();zt!=null&&Math.abs(zt-Wt)<=.5||dt(Wt)}return{activeRestoreAnchor:Je,getRelativeScrollTopWithinContainer:ct,setRelativeScrollTopWithinContainer:dt,resolveAnchorOffset:At,clearRestoreReconcile:xt,applyRestoreAnchor:ln,scheduleRestoreReconcile:function(){Je.value&&H&&et==null&&(et=te?te(()=>{et=null,Je.value&&ln(Je.value)}):null,et==null&&Je.value&&ln(Je.value))},captureRestoreAnchor:function(){const Et=ct(),Wt=V.value;if(Et==null||Wt<=0)return null;const zt=We(Ue(Et+1),0,Wt-1),gn=ze(0,zt),Is=Re(zt);return{nodeIndex:zt,offsetWithinNodePx:We(Et-gn,0,Math.max(0,Is-1))}},restoreAnchor:function(Et){const Wt=V.value;if(Je.value={nodeIndex:We(Et.nodeIndex,0,Math.max(0,Wt-1)),offsetWithinNodePx:Math.max(0,Et.offsetWithinNodePx)},xt(),ln(Je.value),H)for(const zt of[0,120,280,480])Ct.push(window.setTimeout(()=>{Je.value&&ln(Je.value)},zt))},getAnchorDrift:function(Et){const Wt=ct();return Wt==null?null:Wt-At(Et)}}})({isClient:Q,containerRef:S,parsedNodeCount:Gn,requestFrame:tt,cancelFrame:st,resolveScrollContainer:()=>Pi.value||de(),getNormalizedScrollTop:Z,getOffsetTopWithinRoot:pe,isReverseFlexScrollRoot:z,estimateIndexForOffset:Om,estimateHeightRange:_r,getFallbackNodeHeight:Ed,clamp:Lo}),{nodeHeights:Qt,heightStats:xn,heightTreeSize:Dn,heightSumTree:So,heightKnownTree:Co,averageNodeHeight:Io,resetHeightMeasurements:la,pruneHeightMeasurements:Zp,rebuildHeightTrees:bd,recordNodeHeight:jT,removeNodeHeights:VT,exportHeightCache:KT,importHeightCache:GT,fenwickRangeSum:_d}=(function(A={}){const H=Bo({}),j=Bo({total:0,count:0}),V=X(0),te=X([]),ge=X([]);function Ce(){for(const Re of Object.keys(H))delete H[Number(Re)];j.total=0,j.count=0,V.value=0,te.value=[],ge.value=[]}function Me(Re,We,Je){for(let et=We+1;et<Re.length;et+=et&-et)Re[et]+=Je}function Fe(Re,We){let Je=0;for(let et=We+1;et>0;et-=et&-et)Je+=Re[et];return Je}function Ne(Re){V.value=Re;const We=new Array(Re+1).fill(0),Je=new Array(Re+1).fill(0);for(const[et,Ct]of Object.entries(H)){const ct=Number(et),dt=Number(Ct);!Number.isFinite(ct)||ct<0||ct>=Re||!Number.isFinite(dt)||dt<=0||(Me(We,ct,dt),Me(Je,ct,1))}te.value=We,ge.value=Je}function Ue(Re){if(!Number.isInteger(Re)||Re<0)return!1;const We=H[Re];if(!Number.isFinite(We)||We<=0)return!1;if(delete H[Re],j.total=Math.max(0,j.total-We),j.count=Math.max(0,j.count-1),V.value>Re){const Je=te.value,et=ge.value;Je.length&&et.length&&(Me(Je,Re,-We),Me(et,Re,-1))}return!0}const ze=B(()=>j.count>0?Math.max(12,j.total/j.count):32);return{nodeHeights:H,heightStats:j,heightTreeSize:V,heightSumTree:te,heightKnownTree:ge,averageNodeHeight:ze,resetHeightMeasurements:Ce,pruneHeightMeasurements:function(Re){if(Re<=0)return void Ce();let We=0,Je=0;for(const[et,Ct]of Object.entries(H)){const ct=Number(et),dt=Number(Ct);!Number.isFinite(ct)||ct<0||ct>=Re||!Number.isFinite(dt)||dt<=0?delete H[ct]:(We+=dt,Je++)}j.total=We,j.count=Je},rebuildHeightTrees:Ne,recordNodeHeight:function(Re,We,Je={}){(function(et,Ct,ct={}){var dt;if(!Number.isFinite(Ct)||Ct<=0)return!1;const At=H[et];if(At&&(ct.allowShrink===!1&&Ct<At||Math.abs(Ct-At)<=1))return!1;if(H[et]=Ct,At?j.total+=Ct-At:(j.total+=Ct,j.count++),V.value>et){const xt=te.value,ln=ge.value;if(xt.length&&ln.length)if(At){const Et=Ct-At;Et!==0&&Me(xt,et,Et)}else Me(xt,et,Ct),Me(ln,et,1)}ct.notify!==!1&&((dt=A.onHeightRecorded)==null||dt.call(A))})(Re,We,Pt(rt({},Je),{notify:!0}))},removeNodeHeight:function(Re,We={}){var Je;const et=Ue(Re);return et&&We.notify!==!1&&((Je=A.onHeightRecorded)==null||Je.call(A)),et},removeNodeHeights:function(Re,We={}){var Je;let et=0;for(const Ct of Re)Ue(Number(Ct))&&et++;return et>0&&We.notify!==!1&&((Je=A.onHeightRecorded)==null||Je.call(A)),et},exportHeightCache:function(){return Object.entries(H).map(([Re,We])=>({index:Number(Re),height:Number(We)})).filter(Re=>Number.isFinite(Re.index)&&Re.index>=0&&Number.isFinite(Re.height)&&Re.height>0).sort((Re,We)=>Re.index-We.index)},importHeightCache:function(Re,We={}){var Je;if(!Array.isArray(Re))return;const et=V.value;let Ct=!1;if(We.mode!=="merge"){const ct=Object.keys(H);if(ct.length>0){for(const dt of ct)delete H[Number(dt)];Ct=!0}}for(const ct of Re){const dt=Number(ct.index),At=Number(ct.height);if(!Number.isInteger(dt)||dt<0||et>0&&dt>=et||!Number.isFinite(At)||At<=0)continue;const xt=H[dt];xt&&Math.abs(xt-At)<=1||(H[dt]=At,Ct=!0)}Ct&&((function(){let ct=0,dt=0;const At=V.value;for(const[xt,ln]of Object.entries(H)){const Et=Number(xt),Wt=Number(ln);!Number.isFinite(Et)||Et<0||At>0&&Et>=At||!Number.isFinite(Wt)||Wt<=0?delete H[Et]:(ct+=Wt,dt++)}j.total=ct,j.count=dt})(),et>0&&Ne(et),(Je=A.onHeightRecorded)==null||Je.call(A))},fenwickRangeSum:function(Re,We,Je){if(Je<=We)return 0;const et=Fe(Re,Je-1);return We<=0?et:et-Fe(Re,We-1)}}})({onHeightRecorded:()=>{Ks(),Mt.value&&Wc(),Ae.value&&rn(),vo.value&&ma(),Bn("node-resize")}});function wd(){la(),jt.clear()}function Vy(A){!Number.isInteger(A)||A<0||A>=ot.value.length||jt.set(A,$c(A))}function Ky(A,H,j={}){const V=Qt[A];jT(A,H,j);const te=Qt[A];te&&te>0?Vy(A):V&&jt.delete(A)}function Gy(A,H){const j=yt("getNodeLayoutHeight.slot.offsetHeight",()=>{var V,te;return(te=(V=Pn.get(A))==null?void 0:V.offsetHeight)!=null?te:0});return j>0?j:yt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function Yy(A,H={}){GT(A,H),Am()}const vr=B(()=>{var A;return!ee.value&&b.deferNodesUntilVisible!==!1&&!(((A=b.maxLiveNodes)!=null?A:0)<=0)&&!Ot.value&&!(ot.value.length>900)&&qs.value}),Qy=B(()=>!!Ye&&(vr.value||Ot.value)),Xy=B(()=>Ot.value||Mt.value),{liveNodeBufferResolved:Mc,focusIndex:Vs,liveRange:$o,updateLiveRange:fl}=(function(A,H){const{parsedNodeCount:j,virtualizationEnabled:V,maxLiveNodesResolved:te,clamp:ge}=H,Ce=B(()=>{var Ne;return Math.max(0,(Ne=A.liveNodeBuffer)!=null?Ne:60)}),Me=X(0),Fe=Bo({start:0,end:0});return{liveNodeBufferResolved:Ce,focusIndex:Me,liveRange:Fe,updateLiveRange:function(){const Ne=j.value;if(!V.value||Ne===0)return Fe.start=0,void(Fe.end=Ne);const Ue=Math.min(te.value,Ne),ze=Ce.value,Re=ge(Me.value-ze,0,Math.max(0,Ne-Ue));Fe.start=Re,Fe.end=Math.min(Ne,Re+Ue)}}})(b,{parsedNodeCount:Gn,virtualizationEnabled:Ot,maxLiveNodesResolved:fs,clamp:Lo}),Si=new Map,hl=new Map,yr=new Map,Sd=[],Bi=new Map,kr=new Set,Zy=X(0);let Jp=!1;const Jy=B(()=>(Zy.value,kr.size)),Ms=new Map,Ci=new Map,ek=X(0),em=B(()=>{ek.value;let A=0;for(const H of Ms.values())A+=Math.max(0,H);return A});let Ts=null,tm=!0,tk=[0],nk="";function Ks(){tm=!0}const Cd=B(()=>{if(!Ot.value)return ot.value.length;const A=Mc.value,H=Math.max($o.end+A,$e.value),j=Math.min(ot.value.length,H);return Math.max(Rt.value,j)});function xd(){Jp||(Jp=!0,queueMicrotask(()=>{Jp=!1,Zy.value+=1}))}function ok(A,H,j="node-resize"){if(!Q||typeof window>"u")return null;const V=window.setTimeout(()=>{kr.delete(V)&&xd();try{H()}finally{Bn(j)}},Math.max(0,A));return kr.add(V),xd(),V}function Ad(A){Q&&A!=null&&(kr.delete(A)&&xd(),window.clearTimeout(A))}function sk(){if(Q&&typeof window<"u")for(const A of kr)window.clearTimeout(A);kr.size&&(kr.clear(),xd()),Sd.length=0,yr.clear()}function YT(A){var H,j;return(j=(H=Ke.value)==null?void 0:H[A])!=null?j:null}const{cancelScheduledFocusSync:nm,scheduleFocusSync:xi}=(function(A){const{isClient:H,containerRef:j,virtualizationEnabled:V,requestFrame:te,cancelFrame:ge,syncFocusToScroll:Ce}=A;let Me=null;function Fe(){var Ue,ze,Re;return(Re=(ze=(Ue=j.value)==null?void 0:Ue.ownerDocument)==null?void 0:ze.defaultView)!=null?Re:typeof window<"u"?window:null}function Ne(){if(!Me)return;const Ue=Fe();Me.viaTimeout?Ue?Ue.clearTimeout(Me.id):clearTimeout(Me.id):ge?.(Me.id),Me=null}return{cancelScheduledFocusSync:Ne,scheduleFocusSync:function(Ue={}){if(!V.value)return;if(!H)return void Ce(!0);if(Ue.immediate)return Ne(),void Ce(!0);if(Me)return;const ze=()=>{Me=null,Ce()};if(te)return void(Me={id:te(ze),viaTimeout:!1});const Re=Fe();Me={id:Re?Re.setTimeout(ze,16):setTimeout(ze,16),viaTimeout:!0}}}})({isClient:Q,containerRef:S,virtualizationEnabled:Ot,requestFrame:tt,cancelFrame:st,syncFocusToScroll:function(A=!1){var H;if(!Ot.value)return;const j=Pi.value||de();if(!j)return;const V=j.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,te=V?.defaultView||(typeof window<"u"?window:null),ge=j===V?.documentElement||j===V?.body,Ce=ot.value.length;if(!ge&&Ce>0&&z(j)){const Je=yt("syncFocusToScroll.clientHeight",()=>j.clientHeight||0),et=yt("syncFocusToScroll.scrollTop",()=>j.scrollTop),Ct=et<0?-et:et,ct=(function(At){var xt,ln;const Et=ot.value;if(!Et.length)return 0;if(At<=0)return Math.max(0,Et.length-1);if(Ut.value){const zt=(xt=lm()[Et.length])!=null?xt:0;return fk(Math.max(0,zt-At))}if(Dn.value===Et.length){const zt=_r(0,Et.length);return Om(Math.max(0,zt-At))}let Wt=At;for(let zt=Et.length-1;zt>=0;zt--){const gn=(ln=Qt[zt])!=null?ln:Io.value;if(Wt<=gn)return zt;Wt-=gn}return 0})(Math.max(0,Ct)+.5*Math.max(0,Je)),dt=Lo(ct,0,Math.max(0,Ce-1));return void((A||Math.abs(dt-Vs.value)>1)&&(Vs.value=dt,fl()))}const Me=ge?null:yt("syncFocusToScroll.root.getBoundingClientRect",()=>j.getBoundingClientRect()),Fe=ge?0:Me.top,Ne=ge?yt("syncFocusToScroll.viewport.clientHeight",()=>{var Je,et;return(et=(Je=te?.innerHeight)!=null?Je:j.clientHeight)!=null?et:0}):Me.bottom,Ue=Ac.value;let ze=null,Re=null;for(const[Je,et]of Ue){if(!et)continue;const Ct=yt("syncFocusToScroll.slot.getBoundingClientRect",()=>et.getBoundingClientRect());Ct.bottom<=Fe||Ct.top>=Ne||(ze==null&&(ze=Je),Re=Je)}if(ze==null||Re==null){const Je=S.value;if(!Je)return;const et=ge?{top:0}:yt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>j.getBoundingClientRect()),Ct=yt("syncFocusToScroll.fallback.scrollTop",()=>Z(j,V,ge)),ct=ge?(()=>{const xt=yt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Je.getBoundingClientRect()),ln=(ge?0:et.top)-xt.top;return Math.max(0,ln)})():(()=>{const xt=pe(Je,j);return Math.max(0,Ct-xt)})(),dt=ge?yt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var xt,ln,Et,Wt;return(Wt=(Et=(ln=te?.innerHeight)!=null?ln:(xt=V?.documentElement)==null?void 0:xt.clientHeight)!=null?Et:j.clientHeight)!=null?Wt:0}):yt("syncFocusToScroll.fallback.root.clientHeight",()=>j.clientHeight),At=Om(ct+.5*Math.max(0,dt));return Vs.value=Lo(At,0,Math.max(0,ot.value.length-1)),void fl()}const We=Math.round((ze+Re)/2);!A&&Math.abs(We-Vs.value)<=1||(Vs.value=Lo(We,0,Math.max(0,ot.value.length-1)),fl())}}),{visibleNodeIndices:om,nodeVisibilityHandles:aa,nodeVisibilityWatchStops:Md,nodeVisibilityFallbackTimers:ik,clearVisibilityFallback:Td,markNodeVisible:br,cleanupNodeVisibility:QT,destroyNodeVisibilityState:sm}=sZ({isClient:Q,shouldTrackVisibleNodeIndices:()=>vr.value,shouldCleanupNodeVisibility:()=>Ot.value,onNodeMarkedVisible:A=>{Ot.value?xi():Vs.value=Lo(A,0,Math.max(0,ot.value.length-1))},onNodeVisibilityCleaned:A=>{Pn.delete(A)&&Rk()}}),{cleanupScrollListener:rk,setupScrollListener:XT}=(function(A){const{isClient:H,virtualizationEnabled:j,listenerEnabled:V,scrollRootElement:te,resolveScrollContainer:ge,scheduleFocusSync:Ce,onScroll:Me}=A;let Fe=null,Ne=null;function Ue(){Fe&&(Fe(),Fe=null),Ne=null,te.value=null}function ze(Re){const We=A.getScrollTop?A.getScrollTop(Re):Re.scrollTop;return Math.max(0,Number.isFinite(We)?Math.abs(We):0)}return{cleanupScrollListener:Ue,setupScrollListener:function(){if(!H)return;if(!((Re=V?.value)!=null?Re:j.value))return void Ue();var Re;const We=ge();if(!We)return void Ue();if(te.value===We&&Fe)return;Ue(),Ne=ze(We);const Je=()=>{if(Me?.(),j.value){const et=(function(Ct){const ct=ze(Ct),dt=Ne;Ne=ct;const At=Math.max(480,.75*(Ct.clientHeight||0));return dt==null?ct>At?{immediate:!0}:void 0:Math.abs(ct-dt)>At?{immediate:!0}:void 0})(We);et?Ce(et):Ce()}};We.addEventListener("scroll",Je,{passive:!0}),te.value=We,Fe=()=>{We.removeEventListener("scroll",Je)}}}})({isClient:Q,virtualizationEnabled:Ot,listenerEnabled:Xy,scrollRootElement:Pi,resolveScrollContainer:de,scheduleFocusSync:xi,onScroll:function(){const A=vo.value;if(!A)return;const H=Ic();if(!H||(function(V){if(Pc()>=oe)return Se=null,!1;const te=Se;if(te==null)return!0;const ge=Math.abs(V.scrollTop-te)<=2;return ge||(Se=null),ge})(H))return;const j=_k(H);j!=null?(j<-32||Math.abs(Math.max(0,j)-Math.max(0,A.distanceFromBottomPx))>32)&&pa("restore"):pa("restore")},getScrollTop:A=>{var H;const j=A.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,V=A===j.documentElement||A===j.body||A===j.scrollingElement;return yt("scrollListener.getScrollTop",()=>Z(A,j,V))}});function Lo(A,H,j){return Math.min(Math.max(A,H),j)}function im(A){return A?.firstElementChild}function lk(A,H){var j;return A?(j=A.matches)!=null&&j.call(A,H)?A:A.querySelector(H):null}function ak(){if(!Ut.value)return void(q.value=0);const A=yt("updateExperimentContainerWidth.clientWidth",()=>{var H,j;return(j=(H=S.value)==null?void 0:H.clientWidth)!=null?j:0});q.value=A>0?A:0}let Tc=null;function rm(){Tc?.disconnect(),Tc=null}const ck=mi({loader:()=>jn(null,null,function*(){return(yield ns(()=>import("./index8-f7_g7Sdt.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:fM,delay:0,suspensible:!1});function uk(A){return A===ck}const dk=B(()=>u.value==="pre"?$s:u.value==="shiki"?ck:qg),pl=B(()=>{const A=ot.value;if(!A.length||!Ut.value)return A.map(()=>null);const H=q.value||yt("estimatedNodeHeights.clientWidth",()=>{var j;return((j=S.value)==null?void 0:j.clientWidth)||0});return!Number.isFinite(H)||H<=0?A.map(()=>null):A.map((j,V)=>{const te=Qt[V],ge=typeof te=="number"&&te>0;if(To.value&&!ge){const Me=yM(j,H,ae.value);if(Me)return Me}if(xs.value&&j.type==="code_block"){const Me=(function(Fe){if(Fe.type!=="code_block")return null;const Ne=Kk(Fe,Pd(Fe));return uk(Ne)?"markdown":Ne===$s?"pre":Ne===dk.value||Ne===qg?"monaco":null})(j);if(Me==="monaco"||Me==="markdown"||Me==="pre")return UX(j,{rendererKind:Me,monacoOptions:b.codeBlockMonacoOptions,showHeader:((Ce=b.codeBlockProps)==null?void 0:Ce.showHeader)!==!1})}var Ce;return null})});function Ed(A){var H;const j=Qt[A];if(Number.isFinite(j)&&j>0)return j;const V=(H=pl.value[A])==null?void 0:H.height;return Number.isFinite(V)&&V>0?V:Math.max(Io.value,(function(te){var ge,Ce,Me,Fe,Ne,Ue,ze,Re,We,Je,et,Ct,ct;const dt=ot.value[te];if(!dt||typeof dt!="object")return 32;const At=String((ge=dt.type)!=null?ge:""),xt=Wo()||640;switch(At){case"heading":return 44;case"paragraph":return ca(String((Me=(Ce=dt.raw)!=null?Ce:dt.content)!=null?Me:""),xt,34);case"list":{const ln=Array.isArray(dt.items)?dt.items.length:1;return Math.max(48,30*ln+12)}case"list_item":return ca(String((Ne=(Fe=dt.raw)!=null?Fe:dt.content)!=null?Ne:""),xt,34);case"blockquote":return ca(String((ze=(Ue=dt.raw)!=null?Ue:dt.content)!=null?ze:""),xt,56);case"table":{const ln=Array.isArray(dt.rows)?dt.rows.length:Array.isArray(dt.children)?dt.children.length:3;return Math.max(120,38*ln+48)}case"code_block":return ca(String((We=(Re=dt.code)!=null?Re:dt.raw)!=null?We:""),xt,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return ca(String((et=(Je=dt.raw)!=null?Je:dt.content)!=null?et:""),xt,96);case"thematic_break":return 24;default:return ca(String((ct=(Ct=dt.raw)!=null?Ct:dt.content)!=null?ct:""),xt,40)}})(A))}function ca(A,H,j,V=22){const te=String(A??"");if(!te)return j;const ge=Math.max(18,Math.floor(Math.max(320,H)/8)),Ce=te.split(/\r?\n/).length,Me=Math.ceil(te.length/ge),Fe=Math.max(1,Ce,Me);return Math.max(j,Math.ceil(Fe*V+12))}function Ec(A){const H=Number(A);return!Number.isFinite(H)||H<=0?-1:Math.round(H/32)}function lm(){var A,H;const j=ot.value.length,V=Ec(q.value||yt("getFallbackHeightPrefix.clientWidth",()=>{var Me;return((Me=S.value)==null?void 0:Me.clientWidth)||0})),te=((A=o.virtualScroll)==null?void 0:A.measurementKey)==null?"":String(o.virtualScroll.measurementKey),ge=[j,xn.count,Math.round(xn.total),Math.round(100*Io.value),te,V,Ut.value?1:0,IS.value,Y.value].join(":");if(!tm&&nk===ge)return tk;const Ce=new Array(j+1);Ce[0]=0;for(let Me=0;Me<j;Me++)Ce[Me+1]=Ce[Me]+(Ut.value?Ed(Me):(H=Qt[Me])!=null?H:Io.value);return tk=Ce,nk=ge,tm=!1,Ce}function fk(A){var H,j;const V=ot.value.length;if(V<=0||A<=0)return 0;const te=lm();if(A>=((H=te[V])!=null?H:0))return V-1;let ge=0,Ce=V-1,Me=V-1;for(;ge<=Ce;){const Fe=ge+Ce>>1;((j=te[Fe+1])!=null?j:0)>=A?(Me=Fe,Ce=Fe-1):ge=Fe+1}return Me}function _r(A,H){var j,V;if(A>=H)return 0;if(Ut.value)return(function(Ce,Me){var Fe,Ne;const Ue=ot.value.length,ze=Lo(Math.trunc(Ce),0,Ue),Re=Lo(Math.trunc(Me),ze,Ue);if(ze>=Re)return 0;const We=lm();return((Fe=We[Re])!=null?Fe:0)-((Ne=We[ze])!=null?Ne:0)})(A,H);if(Dn.value!==ot.value.length){let Ce=0;for(let Me=A;Me<H;Me++)Ce+=(j=Qt[Me])!=null?j:Io.value;return Ce}const te=So.value,ge=Co.value;if(!te.length||!ge.length){let Ce=0;for(let Me=A;Me<H;Me++)Ce+=(V=Qt[Me])!=null?V:Io.value;return Ce}return _d(te,A,H)+(H-A-_d(ge,A,H))*Io.value}Ve(()=>ot.value.length,A=>{Ks(),A<=0?wd():(A<Dn.value&&Zp(A),A!==Dn.value&&bd(A))},{immediate:!0});const ZT=B(()=>{if(!Ot.value)return ot.value.map((V,te)=>({node:V,index:te}));const A=ot.value.length,H=Lo($o.start,0,A),j=Lo($o.end,H,A);return ot.value.slice(H,j).map((V,te)=>({node:V,index:H+te}))}),am=B(()=>Ot.value?_r(0,Math.min($o.start,ot.value.length)):0),cm=B(()=>{if(!Ot.value)return 0;const A=ot.value.length;return _r(Math.min($o.end,A),A)});function hk(){if(!Ut.value)return 0;let A=0;const H=pl.value;for(let j=0;j<H.length;j++){if(!H[j])continue;const V=Qt[j];Number.isFinite(V)&&V>0||A++}return A}function pk(){const A=ot.value.length;return{totalNodes:A,measuredCount:xn.count,estimatedCount:hk(),averageNodeHeight:Io.value,topSpacerHeight:am.value,bottomSpacerHeight:cm.value,estimatedTotalHeight:_r(0,A),width:ml()}}function JT(){const A=ot.value,H=pk();return Pt(rt({},H),{probe:{paragraphReady:!!ae.value.paragraph,listItemReady:!!ae.value.listItem,listWrapperOverhead:ae.value.listWrapperOverhead,headingReadyLevels:Object.entries(ae.value.headings).filter(([,j])=>!!j).map(([j])=>Number(j))},nodes:A.map((j,V)=>{var te,ge,Ce,Me,Fe,Ne,Ue,ze,Re;return{index:V,type:j.type,estimateKind:(ge=(te=pl.value[V])==null?void 0:te.kind)!=null?ge:null,rendererKind:(Me=(Ce=pl.value[V])==null?void 0:Ce.rendererKind)!=null?Me:null,estimatedHeight:(Ne=(Fe=pl.value[V])==null?void 0:Fe.height)!=null?Ne:null,estimatedContentHeight:(ze=(Ue=pl.value[V])==null?void 0:Ue.contentHeight)!=null?ze:null,measuredHeight:(Re=Qt[V])!=null?Re:null}})})}function um(){return o.indexKey!=null?String(o.indexKey):tn.value?`virtual-${Wn()}`:"markdown-renderer"}function mk(A){const H=String(A),j=`${um()}-`;if(!H.startsWith(j))return null;const V=H.slice(j.length).match(/^(\d+)(?:$|-)/);if(!V)return null;const te=Number(V[1]);return!Number.isInteger(te)||te<0||te>=ot.value.length?null:te}function Wn(){var A,H,j;const V=(A=o.virtualScroll)==null?void 0:A.sessionKey;return String(V!=null&&V!==""?V:(j=(H=o.indexKey)!=null?H:b.customId)!=null?j:Gt)}function yo(){var A;const H=(A=o.virtualScroll)==null?void 0:A.threadKey;return H==null||H===""?void 0:String(H)}function dm(A){var H;return(A??"")===((H=yo())!=null?H:"")}function eE(){var A;const H=(A=o.virtualScroll)==null?void 0:A.measurementKey;return H==null?"":String(H)}function tE(){var A,H;const j=u.value,V=j==="monaco"?b.codeBlockMonacoOptions:void 0,te=b.codeBlockProps,ge=j==="shiki";return[b.isDark?"dark":"light",j==="monaco"?"code-rich":j==="pre"?"code-pre":"code-shiki",b.codeBlockStream===!1?"code-static":"code-stream",xo(b.codeBlockMinWidth),xo(b.codeBlockMaxWidth),...ge?[Ph((A=te?.themes)!=null?A:b.themes,(H=te?.langs)!=null?H:b.langs)]:[],xo(V?.fontSize),xo(V?.lineHeight),xo(V?.fontFamily),xo(V?.tabSize),xo(V?.MAX_HEIGHT),xo(V?.wordWrap),xo(V?.wrappingIndent),xo(V?.padding),xo(te?.showHeader),xo(te?.showCopyButton),xo(te?.showExpandButton),xo(te?.showPreviewButton),xo(te?.showCollapseButton),xo(te?.showFontSizeButtons)].join("\0")}function Fi(){return[eE(),tE()].join("\0")}function ml(){return Wo()}const Id=B(()=>Ec(ml())),Es=B(()=>[Fi(),Id.value].join("\0")),nE=B(()=>{var A;return tn.value?["virtual",(A=yo())!=null?A:"",Wn(),Es.value].join("\0"):o.indexKey});function ua(){ek.value+=1}function fm(A){return!(!A||!Number.isInteger(A.index)||A.index<0||A.index>=ot.value.length||A.sessionKey!==Wn()||A.threadKey!==yo()||A.layoutEpochKey!==Es.value)}function gk(A){const H=String(A),j=Ci.get(H);return j?fm(j)?j.index:null:mk(H)}function vk(A="async-node"){(Ms.size||Ci.size)&&(Ms.clear(),Ci.clear(),ua(),Bn(A))}const da=Vt(vv,null),hm={reportHeight(A,H){if(!Mt.value)return;const j=gk(A);if(j==null)return;const V=Si.get(j);if(!V)return;const te=Number(H),ge=Gy(j,V);Ky(j,Number.isFinite(te)&&te>0?Math.max(te,ge||0):ge)},markPending(A){if(!Mt.value)return;const H=mk(A);H!=null&&(function(j,V){var te;const ge=Ci.get(j);if(ge&&fm(ge))return Ms.set(j,Math.max(0,(te=Ms.get(j))!=null?te:0)+1),ua(),void Bn("async-node");Ms.set(j,1),Ci.set(j,(function(Ce){return{index:Ce,sessionKey:Wn(),threadKey:yo(),layoutEpochKey:Es.value}})(V)),ua(),Bn("async-node")})(String(A),H)},markSettled(A){if(!Mt.value)return;const H=String(A),j=gk(A);(j!=null||(function(V){return Ms.has(String(V))})(H))&&(function(V){var te;const ge=(te=Ms.get(V))!=null?te:0;return!(ge<=0||(ge<=1?(Ms.delete(V),Ci.delete(V)):Ms.set(V,ge-1),ua(),ge===1&&Bn("async-node"),0))})(H)&&j!=null&&Hi()}};function oE(){let A=0;for(const H of Si.values())A+=yt("getVisibleDomHeight.offsetHeight",()=>{var j;return(j=H?.offsetHeight)!=null?j:0});return Math.ceil(Math.max(0,A))}Nn(vv,{reportHeight(A,H){hm.reportHeight(A,H),da?.reportHeight(A,H)},markPending(A){hm.markPending(A),da?.markPending(A)},markSettled(A){hm.markSettled(A),da?.markSettled(A)}});let pm,mm=null,fa=null;function $d(A){return A!==!1&&A!=null&&A!==""}function yk(){return Ot.value?(function(){if(!Ot.value)return!0;const A=ot.value.length,H=Lo($o.start,0,A),j=Lo($o.end,H,A);if(H>=j)return!0;for(let V=H;V<j;V++)if(!Pn.has(V)||Pm(V)&&!Si.has(V))return!1;return!0})():Rt.value>=Cd.value}function gm(){return U.value===!0&&!J.value&&em.value===0&&kr.size===0&&Bi.size===0&&Ts==null&&yk()}function kk(){var A,H;if(((A=o.virtualScroll)==null?void 0:A.settleMode)!=="manual"||mm===Wn()&&pm===yo())return!0;const j=(H=o.virtualScroll)==null?void 0:H.settledToken;return!!$d(j)&&fa===Uc(j)}function vm(){return gm()&&kk()}function sE(A,H){return H.totalNodes<=0?A==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?A==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function gl(A="manual",H){const j=pk(),V=(function(te){return te||(U.value!==!0?ot.value.length>0?"streaming":"estimating":!yk()||Bi.size>0||Ts!=null?"measuring":vm()?"settled":"settling")})(H);return{sessionKey:Wn(),threadKey:yo(),phase:V,nodeCount:j.totalNodes,liveRange:{start:$o.start,end:$o.end},renderedCount:Rt.value,measuredCount:j.measuredCount,estimatedCount:j.estimatedCount,averageNodeHeight:j.averageNodeHeight,topSpacerHeight:j.topSpacerHeight,bottomSpacerHeight:j.bottomSpacerHeight,visibleDomHeight:oE(),totalHeight:bk(),width:j.width,final:U.value===!0,stable:vm(),confidence:sE(V,j),reason:A}}function Ic(){const A=Pi.value||de(),H=S.value;if(!A||!H)return null;const j=A.ownerDocument||H.ownerDocument||document,V=A===j.documentElement||A===j.body||A===j.scrollingElement,te=yt("getScrollBox.scrollTop",()=>Z(A,j,V)),ge=yt("getScrollBox.scrollHeight",()=>{var Me,Fe,Ne,Ue,ze;return V?Math.max((Fe=(Me=j.documentElement)==null?void 0:Me.scrollHeight)!=null?Fe:0,(Ue=(Ne=j.body)==null?void 0:Ne.scrollHeight)!=null?Ue:0,(ze=A.scrollHeight)!=null?ze:0):A.scrollHeight}),Ce=yt("getScrollBox.clientHeight",()=>{var Me;return V?((Me=j.documentElement)==null?void 0:Me.clientHeight)||A.clientHeight||0:A.clientHeight});return{root:A,doc:j,isViewportRoot:V,scrollTop:te,scrollHeight:ge,clientHeight:Ce}}function bk(){const A=ot.value.length,H=Math.max(0,_r(0,A)),j=yt("getRendererLogicalHeight.offsetHeight",()=>{var te,ge;return(ge=(te=S.value)==null?void 0:te.offsetHeight)!=null?ge:0}),V=Math.max(0,j>0?j:yt("getRendererLogicalHeight.scrollHeight",()=>{var te,ge;return(ge=(te=S.value)==null?void 0:te.scrollHeight)!=null?ge:0}));return A<=0?Math.ceil(j):Ot.value?H>0?Math.max(1,Math.ceil(H),(function(){let te=am.value+cm.value;for(const ge of Pn.values())ge&&(te+=Math.max(0,yt("getVirtualizedDomLogicalHeight.offsetHeight",()=>ge.offsetHeight||0)));return Math.ceil(Math.max(0,te))})(),(function(te,ge){return te<=0||ge<=0?0:ge<=te+Math.max(512,.05*te)?Math.ceil(ge):0})(H,V)):Math.max(1,Math.ceil(V)):Mt.value?H>0||xn.count>0||hk()>0?(He.value&&Rt.value,Math.max(1,Math.ceil(V),Math.ceil(H))):Math.ceil(V):Math.max(1,Math.ceil(V),Math.ceil(H))}function _k(A){const H=S.value;if(!H)return null;const j=yt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(te){return te.isViewportRoot?te.clientHeight:yt("getViewportBottomInRoot.getBoundingClientRect",()=>te.root.getBoundingClientRect().bottom)})(A)-j.bottom}function iE(A={}){const H=A.requireViewport!==!1,j=(function(ge=64){const Ce=Ic(),Me=S.value;if(!Ce||!Me)return!1;const Fe=(function(Ue){if(Ue.isViewportRoot)return{top:0,bottom:Ue.clientHeight};const ze=yt("getVirtualViewportRect.getBoundingClientRect",()=>Ue.root.getBoundingClientRect());return{top:ze.top,bottom:ze.bottom}})(Ce),Ne=yt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Me.getBoundingClientRect());return Ne.bottom>=Fe.top-ge&&Ne.top<=Fe.bottom+ge})();if(H&&!j)return null;const V=(function(){const ge=Ic(),Ce=S.value;if(!ge||!Ce||Math.max(0,ge.scrollHeight-ge.scrollTop-ge.clientHeight)>64)return null;const Me=_k(ge);return Me==null?null:Me>=-8&&Me<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Me)}:null})();if(V)return{anchor:V,captured:!0};const te=nn();if(te)return{anchor:{type:"node",nodeIndex:te.nodeIndex,offsetWithinNodePx:te.offsetWithinNodePx},captured:j};if(A.allowFallback===!0){const ge=(function(){const Ce=ot.value.length;return Ce<=0?null:{type:"node",nodeIndex:Lo(Vs.value,0,Math.max(0,Ce-1)),offsetWithinNodePx:0}})();return ge?{anchor:ge,captured:!1}:null}return null}function ym(A){let H=2166136261;for(let j=0;j<A.length;j++)H^=A.charCodeAt(j),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function rE(A,H){let j=A;for(let V=0;V<H.length;V++)j^=H.charCodeAt(V),j=Math.imul(j,16777619);return j^=31,j=Math.imul(j,16777619),j}const lE=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Ld(A,H=new WeakSet,j=0){if(A==null||typeof A=="number"||typeof A=="boolean")return String(A);if(typeof A=="string")return`s:${(function(V){const te=V.length>8192?`${V.slice(0,8192)}...${V.length}`:V;return`${V.length}:${ym(te)}`})(A)}`;if(typeof A=="function")return"fn";if(typeof A!="object")return typeof A;if(H.has(A))return"cycle";if(j>=6)return"max-depth";H.add(A);try{if(Array.isArray(A)){if(A.length<=160){const Ne=[];for(let Ue=0;Ue<A.length;Ue++)Ne.push(Ld(A[Ue],H,j+1));return`a:${A.length}:${Ne.join(",")}`}const ge=[],Ce=[],Me=Math.max(0,A.length-32);let Fe=2166136261;for(let Ne=0;Ne<A.length;Ne++){const Ue=Ld(A[Ne],H,j+1);Fe=rE(Fe,Ue),Ne<32&&ge.push(Ue),Ne>=Me&&Ce.push(Ue)}return[`a:${A.length}`,`h=${ge.join(",")}`,`t=${Ce.join(",")}`,`all=${(Fe>>>0).toString(36)}`].join(":")}const V=A,te=Object.keys(V).filter(ge=>{const Ce=V[ge];return ge!=="parent"&&ge!=="el"&&ge!=="component"&&(Ce==null||typeof Ce=="string"||typeof Ce=="number"||typeof Ce=="boolean"||lE.has(ge))}).sort();return`o:${te.length}:${te.map(ge=>`${ge}=${Ld(V[ge],H,j+1)}`).join(";")}`}finally{H.delete(A)}}let wk=-1,km="";function $c(A){const H=ot.value[A];return H?ym(Ld(H)):""}function bm(){const A=Y.value;if(wk===A)return km;let H=2166136261;for(let j=0;j<ot.value.length;j++){const V=$c(j);for(let te=0;te<V.length;te++)H^=V.charCodeAt(te),H=Math.imul(H,16777619)}return km=(H>>>0).toString(36),wk=A,km}function ha(A,H={}){var j;const V=H.includeHeightCache===!0,te=(j=H.includeContentHash)!=null?j:V,ge=V?(function(Me){const Fe=(function(){var et,Ct;const ct=Number((Ct=(et=o.virtualScroll)==null?void 0:et.heightCacheLimit)!=null?Ct:5e3);return!Number.isFinite(ct)||ct<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ct))})();if(!Number.isFinite(Fe)||Me.length<=Fe)return Me;const Ne=new Map,Ue=et=>{!et||Ne.size>=Fe||Ne.set(et.index,et)},ze=ot.value.length,Re=Lo($o.start-2*Mc.value,0,ze),We=Lo($o.end+2*Mc.value,Re,ze);for(const et of Me)et.index>=Re&&et.index<We&&Ue(et);const Je=Math.max(1,Math.ceil(Me.length/Fe));for(let et=0;et<Me.length&&Ne.size<Fe;et+=Je)Ue(Me[et]);for(let et=Me.length-1;et>=0&&Ne.size<Fe;et-=Je)Ue(Me[et]);return Array.from(Ne.values()).sort((et,Ct)=>et.index-Ct.index).slice(0,Fe)})(KT().map(Me=>{var Fe;const Ne=ot.value[Me.index];return Ne?Pt(rt({},Me),{nodeType:String((Fe=Ne.type)!=null?Fe:""),signature:$c(Me.index)}):null}).filter(Me=>!!Me)):[],Ce=iE({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Ce||ge.length||H.includeEmptyState===!0?Pt(rt({sessionKey:A.sessionKey,threadKey:A.threadKey},Ce?{anchor:Ce.anchor,anchorCaptured:Ce.captured}:{anchorCaptured:!1}),{metrics:A,width:A.width,contentHash:te?bm():void 0,measurementKey:Fi()||void 0,heightCache:ge.length?ge:void 0}):null}function _m(A){var H,j;const V=Ic();if(!V)return;const te=(function(Me){const Fe=S.value;if(!Fe)return null;const Ne=pe(Fe,Me.root),Ue=ot.value.length,ze=yt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Fe.offsetHeight||0),Re=Math.max(0,ze>0?ze:Ue>0?yt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Fe.scrollHeight||0):0),We=bk();return Ne+Math.max(Re,We)})(V);if(te==null)return;const ge=Math.max(0,A.distanceFromBottomPx),Ce=Math.max(0,te-V.clientHeight-ge);(function(Me){oe=Pc()+120,Se=Me})(Ce),V.isViewportRoot?(j=(H=V.doc.defaultView)==null?void 0:H.scrollTo)==null||j.call(H,0,Ce):RS(V.root,V.doc,Ce,{isReverseFlexScrollRoot:z,getNormalizedScrollTop:Z})}const wm=[];function Sk(){if(Q)for(Di!=null&&(st?.(Di),Di=null);wm.length;){const A=wm.pop();A!=null&&window.clearTimeout(A)}}function pa(A){const H=!!vo.value;vo.value=null,oe=0,Se=null,Sk(),H&&A&&Bn(A)}function ma(){if(!vo.value||!Q||Di!=null)return;const A=()=>{Di=null;const H=vo.value;H&&_m(H)};Di=tt?tt(A):null,Di==null&&A()}function Ck(A,H={}){const j=ot.value.length;return j<=0?[]:A.filter(V=>!(!Number.isInteger(V.index)||V.index<0||V.index>=j)&&!(!Number.isFinite(V.height)||V.height<=0)&&!(H.requireSignature&&!V.signature)&&!(H.requireCompatibilityMetadata&&!V.nodeType&&!V.signature)&&(function(te){var ge;const Ce=ot.value[te.index];return!(!Ce||te.nodeType&&te.nodeType!==String((ge=Ce.type)!=null?ge:"")||te.signature&&te.signature!==$c(te.index))})(V))}function xk(A){const H=Ec(ml()),j=Ec(A);return H!==-1&&j!==-1&&H===j}function Sm(A){var H;const j=Number(A?.width);if(Number.isFinite(j)&&j>0)return j;const V=Number((H=A?.metrics)==null?void 0:H.width);return Number.isFinite(V)&&V>0?V:null}function Ak(A){var H;return A.sessionKey===Wn()&&!!dm(A.threadKey)&&((H=A.measurementKey)!=null?H:"")===Fi()&&!!xk(Sm(A))&&!!(function(j){const V=j.heightCache;return!!V?.length&&(Mk(j)?V.some(te=>!!(te.nodeType||te.signature)):V.some(te=>!!te.signature))})(A)}function Mk(A){return!!(A.contentHash&&A.contentHash===bm())}function aE(A){return!Mk(A)}let vl=null,yl=null,Nd=null,Lc=null,Nc=null;function Cm(A){var H;const j=A.map(te=>{var ge,Ce;return[te.index,Math.round(10*te.height),(ge=te.nodeType)!=null?ge:"",(Ce=te.signature)!=null?Ce:""].join("")}).join(""),V=Ec(ml());return[(H=yo())!=null?H:"",Wn(),Fi(),ot.value.length,V,A.length,ym(j)].join(":")}function Tk(A=(H=>(H=o.virtualScroll)==null?void 0:H.heightCache)()){if(!Mt.value||!A?.length||ot.value.length<=0||!xk((H=o.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const j=Ck(A,{requireSignature:!0});if(!j.length)return!1;const V=Cm(j);return V===vl?(yl="standalone",!0):(Yy(j,{mode:"merge"}),Ks(),vl=V,yl="standalone",Bc(),Bn("restore"),!0)}function xm(A,H={}){var j,V,te;if(!Mt.value||!A||A.sessionKey!==Wn()||!dm(A.threadKey)||ot.value.length<=0)return!1;const ge=!!((j=A.heightCache)!=null&&j.length)&&!Rd(),Ce=!A.anchor||A.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:A.anchor,Me=H.restoreAnchor===!0&&!!Ce&&!Rd()&&Number(Sm(A))>0;let Fe=!1;if((V=A.heightCache)!=null&&V.length&&Ak(A)){const Ue=Ck(A.heightCache,{requireCompatibilityMetadata:!A.contentHash,requireSignature:aE(A)});Ue.length&&(Yy(Ue,{mode:"merge"}),Ks(),vl=Cm(Ue),yl="restore",Bc(),Fe=!0)}if(ge||Me)return!1;if(!H.restoreAnchor||!Ce)return Fe&&Bn("restore"),!0;const Ne=(function(Ue,ze){var Re;const We=Ue.anchor,Je=We?We.type==="bottom"?`bottom:${Math.round(We.distanceFromBottomPx)}`:`node:${We.nodeIndex}:${Math.round(We.offsetWithinNodePx)}`:"none";return[(Re=yo())!=null?Re:"",Wn(),Fi(),Id.value,ze,Je].join(":")})(A,(te=H.restoreToken)!=null?te:"imperative");return Nd===Ne?(Fe&&Bn("restore"),!0):(Nd=Ne,(function(Ue){const ze=()=>{if(Ue.type==="node")return pa(),void Eo({nodeIndex:Ue.nodeIndex,offsetWithinNodePx:Ue.offsetWithinNodePx});if(It(),Ae.value=null,vo.value=Ue,Sk(),_m(Ue),Q)for(const Re of[0,120,280,480])wm.push(window.setTimeout(()=>{const We=vo.value;We&&_m(We)},Re))};(function(Re){if(!Ot.value)return!1;const We=ot.value.length;return!(We<=0||(Vs.value=Re.type==="node"?Lo(Re.nodeIndex,0,We-1):We-1,fl(),0))})(Ue)?gt(ze):ze()})(Ce),Bn("restore"),!0)}function Rd(){const A=ml();return Number.isFinite(A)&&A>0}function Ek(A){var H;return A.sessionKey===Wn()&&!!dm(A.threadKey)&&(ot.value.length<=0||!(!((H=A.heightCache)!=null&&H.length)||Rd())||!(!(A.anchor&&Number(Sm(A))>0)||Rd()))}function Am(){jt.clear();for(const A of Object.keys(Qt)){const H=Number(A);Number.isInteger(H)&&H>=0&&H<ot.value.length&&Vy(H)}}function Rc(){Ts!=null&&(st?.(Ts),Ts=null),Dm()}function Ik(){return!Q||js?Promise.resolve():new Promise(A=>{let H=!1,j=null;const V=()=>{H||(H=!0,j!=null&&window.clearTimeout(j),A())};if(tt)return tt(V),void(j=window.setTimeout(V,50));j=window.setTimeout(V,0)})}function Mm(A,H=yo(),j=Es.value){return Wn()===A&&yo()===H&&Es.value===j}function Tm(){return jn(this,arguments,function*(A={}){var H,j,V,te,ge;const Ce=Wn(),Me=yo(),Fe=Es.value,Ne=(H=A.frames)!=null?H:2,Ue=(j=A.timeoutMs)!=null?j:120,ze=(V=A.reason)!=null?V:"manual",Re=A.expectedSettledTokenKey,We=A.flushPendingTimers===!0,Je=gl(ze),et=()=>Pt(rt({},Je),{phase:Je.final?"settling":Je.phase,stable:!1,confidence:Je.confidence==="final"?"mixed":Je.confidence,reason:ze}),Ct=()=>Mm(Ce,Me,Fe)&&(Re==null||Dc()===Re);for(let xt=0;xt<Ne;xt++){if(yield gt(),!Ct()||(yield Ik(),!Ct()))return et();Hi(),Rc()}if(yield(function(xt){return!Q||xt<=0?Promise.resolve():new Promise(ln=>window.setTimeout(ln,xt))})(Ue),!Ct()||(We&&sk(),Hi(),Rc(),!Ct()))return et();const ct=gm();ct&&(mm=Ce,pm=Me,((te=o.virtualScroll)==null?void 0:te.settleMode)==="manual"&&Re!=null&&$d((ge=o.virtualScroll)==null?void 0:ge.settledToken)&&Dc()===Re&&(fa=Uc(o.virtualScroll.settledToken)));const dt=Ct()&&ct&&kk(),At=gl(ze,dt?"final":void 0);return Nm(At,!0),At})}let Em="content",kl=null,bl=null,Im=0,Oc=null,ga=null,$m=null,Lm=null;function Pc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function $k(A){var H,j;const V=Oc;if(!V)return!0;const te=(j=(H=o.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?j:1;return Math.abs(A.totalHeight-V.totalHeight)>te||A.sessionKey!==V.sessionKey||A.phase!==V.phase||A.stable!==V.stable||A.final!==V.final||A.threadKey!==V.threadKey||A.nodeCount!==V.nodeCount||A.measuredCount!==V.measuredCount||A.width!==V.width}function xo(A){if(A==null)return"";if(typeof A=="string"||typeof A=="number"||typeof A=="boolean")return String(A);try{return JSON.stringify(A)}catch{return String(A)}}function Dc(A=(H=>(H=o.virtualScroll)==null?void 0:H.settledToken)()){return xo(A)}function Lk(A,H){var j,V;return[A,H.sessionKey,(j=H.threadKey)!=null?j:"",Fi(),bm(),xo((V=o.virtualScroll)==null?void 0:V.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function Bc(){$m=null,Lm=null,ga=null}function cE(A){const H=A.heightCache;return H?.length?Cm(H):""}function Fc(A){var H,j,V;const te=A.metrics,ge=A.anchor?(Ce=A.anchor).type==="bottom"?`bottom:${Math.round(Ce.distanceFromBottomPx)}`:`node:${Ce.nodeIndex}:${Math.round(Ce.offsetWithinNodePx)}`:"none";var Ce;return[A.sessionKey,(H=A.threadKey)!=null?H:"",(j=A.measurementKey)!=null?j:Fi(),(V=A.contentHash)!=null?V:"",cE(A),ge,A.anchorCaptured?1:0,te.liveRange.start,te.liveRange.end,te.renderedCount,te.nodeCount,Math.round(te.totalHeight),Math.round(te.width),te.phase,te.stable?1:0].join("\0")}function Nm(A,H=!1){if(!Mt.value||(function(Ce=!1){return!Ce&&tn.value&&!Xn.value})(H))return;const j=H||$k(A),V=(function(Ce,Me=!1){return Me||Ce.stable||Ce.phase==="final"?{state:ha(Ce,{includeHeightCache:!0})}:{state:ha(Ce)}})(A,H),te=V.state,ge=!!(te&&(j||(function(Ce,Me=!1){return!!Me||Fc(Ce)!==ga})(te,H)));if(j&&(T(A),Oc=A,Im=Pc()),te&&ge&&($(te),te.anchor&&N(te.anchor),ga=Fc(te)),A.stable){const Ce=Lk("settled",A);if(Ce!==$m){$m=Ce;const Me=ha(A,{includeHeightCache:!0});Me&&($(Me),ga=Fc(Me)),(function(Fe){s("render-settled",Fe)})(A)}}if(A.phase==="final"){const Ce=Lk("final",A);if(Ce!==Lm){Lm=Ce;const Me=ha(A,{includeHeightCache:!0});Me&&($(Me),ga=Fc(Me)),(function(Fe){s("render-final",Fe)})(A)}}}function Rm(){kl!=null&&(st?.(kl),kl=null),bl!=null&&Q&&(window.clearTimeout(bl),bl=null)}function Nk(){kl=null,bl=null,(function(A){if(Bi.size>0||Ts!=null)return!0;switch(A){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Em)&&(Hi(),Rc()),Nm(gl(Em))}function Bn(A){var H,j;if(!Mt.value||(Em=A,kl!=null||bl!=null))return;const V=Math.max(0,(j=(H=o.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?j:32),te=Math.max(0,V-(Pc()-Im)),ge=()=>{bl=null,kl=tt?tt(Nk):null,kl==null&&Nk()};Q&&te>0?bl=window.setTimeout(ge,te):ge()}function Om(A){var H;if(A<=0)return 0;const j=ot.value;if(Ut.value)return fk(A);if(Dn.value===j.length&&So.value.length&&Co.value.length){const te=Io.value,ge=So.value,Ce=Co.value,Me=ze=>ze<=0?0:_d(ge,0,ze)+(ze-_d(Ce,0,ze))*te;let Fe=0,Ne=j.length-1,Ue=j.length-1;for(;Fe<=Ne;){const ze=Fe+Ne>>1;Me(ze+1)>=A?(Ue=ze,Ne=ze-1):Fe=ze+1}return Ue}let V=A;for(let te=0;te<j.length;te++){const ge=(H=Qt[te])!=null?H:Io.value;if(V<=ge)return te;V-=ge}return Math.max(0,j.length-1)}function Rk(){ra.value+=1}function Pm(A){return!(He.value&&A>=Rt.value)&&(!vr.value||A<$e.value||om.value.has(A))}function va(A){const H=Md.get(A);H&&(H(),Md.delete(A));const j=aa.get(A);j&&(j.destroy(),aa.delete(A)),Td(A)}function Ok(A,H){let j=!1;if(H){const ge=Pn.get(A);Pn.set(A,H),ge!==H&&(j=!0)}else Pn.delete(A)&&(j=!0);if(j&&Rk(),H||Td(A),!Qy.value||!Ye||!Ot.value&&vr.value&&!W.value&&aa.size>=640&&(W.value||(W.value=!0,sm()),!Qy.value||!Ye))return va(A),void(H&&br(A,!0));if(A<$e.value&&!Ot.value||om.value.has(A))return va(A),void br(A,!0);if(!H)return void va(A);va(A);const V=Ye(H,{rootMargin:"400px"});if(!V)return;aa.set(A,V),br(A,V.isVisible.value),vr.value&&(function(ge){if(!Q||!vr.value)return;Td(ge);const Ce=ge%17*23,Me=window.setTimeout(()=>{if(ik.delete(ge),!vr.value||om.value.has(ge))return;const Fe=Pn.get(ge);if(!Fe)return;const Ne=de(Fe),Ue=Fe.ownerDocument||document,ze=Ue.defaultView||window,Re=!Ne||Ne===Ue.documentElement||Ne===Ue.body,We=!Re&&Ne?yt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ne.getBoundingClientRect()):null,Je=Re?0:We.top,et=Re?yt("nodeVisibilityFallback.clientHeight",()=>{var ct,dt;return(dt=(ct=ze.innerHeight)!=null?ct:Ne?.clientHeight)!=null?dt:0}):We.bottom,Ct=yt("nodeVisibilityFallback.node.getBoundingClientRect",()=>Fe.getBoundingClientRect());Ct.bottom>=Je-500&&Ct.top<=et+500&&br(ge,!0)},1800+Ce);ik.set(ge,Me)})(A);let te=null;te=Ve(()=>V.isVisible.value,ge=>{if(ge){Td(A),br(A,!0),te?.(),Md.delete(A),aa.get(A)===V&&aa.delete(A);try{V.destroy()}catch{}}},{immediate:!0}),Md.set(A,te),Ot.value&&xi()}function Dm(){Ts=null;for(const[A,H]of Bi)Bi.delete(A),Si.get(A)===H.el&&hl.get(A)===H.version&&Ky(A,H.height,{allowShrink:H.allowShrink})}function ya(){Ts!=null&&(st?.(Ts),Ts=null),Bi.clear()}function Od(A,H){(function(j,V,te){var ge;if(!Number.isFinite(te)||te<=0||Si.get(j)!==V)return;const Ce=hl.get(j);if(Ce==null)return;const Me=ot.value[j],Fe=J.value&&U.value!==!0&&!((ge=o.nodes)!=null&&ge.length)&&j>=ot.value.length-2,Ne=!(Me?.loading===!0||Fe),Ue=Bi.get(j),ze=Ue?Ue.allowShrink&&Ne:Ne,Re=Ue&&!ze?Math.max(Ue.height,te):te;Bi.set(j,{height:Re,allowShrink:ze,version:Ce,el:V}),Ts==null&&(Ts=tt?tt(Dm):null,Ts==null&&Dm())})(A,H,Gy(A,H))}function Hi(){for(const[A,H]of Si)H&&Od(A,H)}function Pk(){ve?.disconnect(),ve=null,As.clear()}function Bm(){for(;Sd.length;)Ad(Sd.pop())}Ve(Xn,A=>{A&&Bn("content")},{flush:"post"}),t({getVirtualMetrics:gl,captureVirtualState:function(A={}){var H;return ha(gl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:A.allowFallbackAnchor===!0,requireViewport:A.requireViewport===!0,includeEmptyState:(H=A.includeEmptyState)==null||H})},restoreVirtualState:function(A,H={}){const j=H.restoreAnchor===!0,V=H.restoreToken==null?"imperative":String(H.restoreToken);Lc=A,Nc={restoreAnchor:j,restoreToken:V,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!xm(A,{restoreAnchor:j,restoreToken:V,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&Ek(A)||(Lc=null,Nc=null)},forceMeasure:function(A="manual"){return jn(this,null,function*(){yield gt(),yield Ik(),Hi(),Rc(),yield gt();const H=gl(A);return Nm(H,!0),H})},settle:Tm,scrollToNode:function(A,H="start"){pa(),It();const j=ot.value.length;if(j<=0)return;const V=Lo(A,0,j-1),te=()=>{var ge;const Ce=at({nodeIndex:V,offsetWithinNodePx:0}),Me=Ed(V),Fe=Ic(),Ne=(ge=Fe?.clientHeight)!=null?ge:0,Ue=Be();let ze=Ce;if(H==="center")ze=Ce-Ne/2+Me/2;else if(H==="end")ze=Ce-Ne+Me;else if(H==="nearest"&&Ue!=null){if(Ce>=Ue&&Ce+Me<=Ue+Ne)return;ze=Ce<Ue?Ce:Ce-Ne+Me}it(Math.max(0,ze)),xi({immediate:!0}),Ot.value&&(Vs.value=V,fl())};if(Ot.value)return Vs.value=V,fl(),void gt(te);te()}}),Ve(()=>Us.value,A=>{if(!A){Pk();for(const H of yr.values())for(const j of H)Ad(j);yr.clear(),hl.clear(),Bm(),ya()}},{immediate:!0}),Ve(U,A=>{A&&(function(){if(Q&&U.value&&Si.size){Bm();for(const H of[80,240,640]){const j=ok(H,()=>{for(const[V,te]of Si)te&&Od(V,te)},"final");j!=null&&Sd.push(j)}}})(),Bn(A?"final":"content")}),Ve([()=>ot.value.length,()=>Rt.value],()=>{vo.value&&ma(),Bn("content")},{flush:"post",immediate:!0}),Ve([()=>$o.start,()=>$o.end],()=>{Bn("batch")},{flush:"post"});const{cleanupBatchScheduler:uE}=(function(A){const{props:H,isClient:j,isTestEnv:V,parsedNodesIdentity:te,parsedNodeCount:ge,desiredRenderedCount:Ce,datasetKey:Me,batchingEnabled:Fe,incrementalRenderingActive:Ne,resolvedBatchSize:Ue,resolvedInitialBatch:ze,renderedCount:Re,adaptiveBatchSize:We,previousRenderContext:Je,previousBatchConfig:et,requestFrame:Ct,cancelFrame:ct,hasIdleCallback:dt,cleanupNodeVisibility:At,onDatasetKeyChanged:xt,onDatasetChanged:ln}=A;let Et=null,Wt=null,zt=!1,gn=null,Is=null,Qo=0,ui=!1,wr=!1;const Sr=new Set,wl=new Set;function eb(){if(j){Et!=null&&(ct?.(Et),Et=null),Wt!=null&&(window.clearTimeout(Wt),Wt=null),Is!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Is),Is=null),Qo+=1;for(const Uo of Sr)ct?.(Uo);Sr.clear();for(const Uo of wl)window.clearTimeout(Uo);wl.clear(),zt=!1,gn=null,ui=!1,wr=!1}}function Wd(){return typeof performance<"u"?performance.now():Date.now()}function tb(Uo){(function(zi){var Cr;if(!Ne.value)return;const Wi=Math.max(2,(Cr=H.renderBatchBudgetMs)!=null?Cr:6),Ui=Math.max(1,Ue.value||1),di=Math.max(1,Math.floor(Ui/4));zi>1.2*Wi?We.value=Math.max(di,Math.floor(.7*We.value)):zi<.5*Wi&&We.value<Ui&&(We.value=Math.min(Ui,Math.ceil(1.2*We.value)))})(Uo),ui=!1;const hs=wr||Re.value<Ce.value;wr=!1,hs&&sb()}function nb(Uo,hs={}){var zi,Cr;if(!Ne.value)return;const Wi=Ce.value;if(Re.value>=Wi)return;const Ui=Math.max(1,Uo),di=()=>{const _a=Wd();let wa=0;Et=null,Wt=null,Is=null,zt=!1;const Sa=gn??Ui;gn=null;const Vm=Wd();Re.value=Math.min(Wi,Re.value+Sa),At(Re.value),wa=Wd()-Vm,(function(Km,ib){if(!j)return void tb(ib);ui=!0;const rb=++Qo;gt().then(()=>{var lb;if(rb!==Qo)return;const IE=Wd(),$E=Math.max(ib,IE-Km),ab=()=>{rb===Qo&&tb($E)};if(Ct){let ub=!1,qi=null;const db=()=>{ub||(ub=!0,ab())},Ud=Ct(()=>{Sr.delete(Ud),qi!=null&&(window.clearTimeout(qi),wl.delete(qi),qi=null),db()});return Sr.add(Ud),qi=window.setTimeout(()=>{qi!=null&&wl.delete(qi),qi=null,ct?.(Ud),Sr.delete(Ud),db()},Math.max(32,(lb=H.renderBatchIdleTimeoutMs)!=null?lb:120)),void wl.add(qi)}const cb=window.setTimeout(()=>{wl.delete(cb),ab()},0);wl.add(cb)})})(_a,wa)};if(!j||hs.immediate)return void di();const xr=Math.max(0,(zi=H.renderBatchDelay)!=null?zi:16);if(gn=gn!=null?Math.max(gn,Ui):Ui,!zt){if(zt=!0,!V&&dt&&window.requestIdleCallback){const _a=Math.max(0,(Cr=H.renderBatchIdleTimeoutMs)!=null?Cr:120);return void(Is=window.requestIdleCallback(()=>di(),{timeout:_a}))}Ct&&!V?Et=Ct(()=>{xr!==0?Wt=window.setTimeout(()=>di(),xr):di()}):Wt=window.setTimeout(()=>di(),xr)}}function ob(Uo,hs={}){ui?wr=!0:Uo==null?sb():nb(Uo,hs)}function sb(){Ne.value&&nb(Fe.value?Math.max(1,Math.round(We.value)):Math.max(1,Ue.value))}return Ve([te,ge,Me,Ne,Ue,ze,()=>H.renderBatchDelay],()=>{var Uo;const hs=ge.value,zi=Je.value,Cr=Me.value,Wi=!Object.is(Cr,zi.key),Ui=hs!==zi.total,di=Wi||Ui;Je.value={key:Cr,total:hs};const xr=et.value,_a=(Uo=H.renderBatchDelay)!=null?Uo:16,wa=xr.batchSize!==Ue.value||xr.initial!==ze.value||xr.delay!==_a||xr.enabled!==Ne.value;et.value={batchSize:Ue.value,initial:ze.value,delay:_a,enabled:Ne.value},Wi&&xt(hs),(di||wa||!Ne.value)&&eb(),(di||wa)&&(We.value=Math.max(1,Ue.value||1)),di&&ln();const Sa=Ce.value;if(!hs)return Re.value=0,void At(0);if(!Ne.value)return Re.value=Sa,void At(Re.value);const Vm=Wi||zi.total===0;Re.value=Vm||wa?Math.min(Sa,ze.value):Math.min(Re.value,Sa);const Km=Math.max(1,ze.value||Ue.value||hs);Re.value<Sa?ob(Km,{immediate:!j}):At(Re.value)},{immediate:!0}),Ve(Ce,(Uo,hs)=>{Ne.value&&(typeof hs=="number"&&Uo<=hs||Uo>Re.value&&ob())}),{cleanupBatchScheduler:eb}})({props:b,isClient:Q,isTestEnv:js,parsedNodesIdentity:lo,parsedNodeCount:Gn,desiredRenderedCount:Cd,datasetKey:nE,batchingEnabled:Te,incrementalRenderingActive:He,resolvedBatchSize:wi,resolvedInitialBatch:$e,renderedCount:Rt,adaptiveBatchSize:ao,previousRenderContext:qt,previousBatchConfig:Zn,requestFrame:tt,cancelFrame:st,hasIdleCallback:Ht,cleanupNodeVisibility:QT,onDatasetKeyChanged:A=>{ya(),wd(),Ks(),Bc(),A>0&&bd(A)},onDatasetChanged:()=>{Ot.value&&xi({immediate:!0})}});Ve([Xy,Ot,()=>S.value,()=>ce()],([A,H])=>{if(!A)return rk(),void nm();XT(),H?xi({immediate:!0}):nm()},{flush:"post",immediate:!0}),Ve([()=>ot.value.length,()=>Ot.value],A=>jn(null,[A],function*([H,j]){j&&H&&Q&&(yield gt(),xi({immediate:!0}))}),{flush:"post"}),Ve(Ut,A=>{A&&(function(){var H;if(Yn.value&&Zt.value&&Qn.value&&((H=Ke.value)!=null&&H[1]))return;const j=vt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),V=vt({type:"list_item",children:[j],raw:"- Probe paragraph text"}),te=vt({type:"list",ordered:!1,items:[V],raw:"- Probe paragraph text"});Yn.value=j,Zt.value=V,Qn.value=te;const ge={1:null,2:null,3:null,4:null,5:null,6:null};for(let Ce=1;Ce<=6;Ce++)ge[Ce]=vt({type:"heading",level:Ce,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Ce)} Probe heading`});Ke.value=ge})()},{immediate:!0}),Ve([()=>S.value,Ut],()=>{if(!Ut.value)return rm(),void(q.value=0);ak(),rm(),Ut.value&&S.value&&typeof ResizeObserver<"u"&&(Tc=new ResizeObserver(()=>{ak(),Ae.value&&rn(),vo.value&&ma(),Bn("resize")}),Tc.observe(S.value))},{immediate:!0}),Ve([Ut,ds,Es],()=>jn(null,null,function*(){if(!Ut.value)return ae.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ks();yield gt(),(function(){if(!Ut.value||typeof window>"u")return ae.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ks();const A={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=lk(im(E.value),".paragraph-node");A.paragraph=Zg(E.value,H,"pre-wrap");const j=im(P.value),V=j?.querySelector(".paragraph-node");A.listItem=Zg(P.value,V,"pre-wrap");const te=yt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Ce,Me;return(Me=(Ce=D.value)==null?void 0:Ce.offsetHeight)!=null?Me:0}),ge=yt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Ce,Me;return(Me=(Ce=P.value)==null?void 0:Ce.offsetHeight)!=null?Me:0});A.listWrapperOverhead=Math.max(0,te-ge);for(let Ce=1;Ce<=6;Ce++){const Me=lk(im(F[Ce]),`h${Ce}`);A.headings[Ce]=Zg(F[Ce],Me,"pre-wrap")}ae.value=A,Ks()})()}),{flush:"post",immediate:!0}),Ve(()=>ot.value.length,()=>{Ot.value&&xi({immediate:!0})}),Ve([Ut,q],()=>{Ks(),Ot.value&&xi({immediate:!0}),Ae.value&&rn(),vo.value&&ma(),Bn("resize")},{immediate:!1}),Ve(()=>vr.value,A=>{if(A)for(const[H,j]of Pn)Ok(H,j);else{sm();for(const[H,j]of Pn)j&&br(H,!0)}},{immediate:!1}),Ve([()=>b.viewportPriority,()=>ot.value.length],([A,H])=>{A!==!1?W.value&&H<=200&&(W.value=!1):W.value=!1}),Ve(()=>Rt.value,()=>{Ot.value&&xi({immediate:!0})}),Ve([Vs,fs,Mc,()=>ot.value.length,Ot],()=>{fl()},{immediate:!0});let Hc=null,zc=!1,ka=null;function Wc(){Hc=null,mm=null,pm=void 0,fa=null,Bc()}function Fm(){ya(),wd(),Ks(),jt.clear();const A=ot.value.length;A>0&&bd(A),Am()}function Hm(){Rm(),sk(),Oc=null,vl=null,yl=null,Nd=null,Lc=null,Nc=null,zc=!1,Wc(),vk("restore"),It(),pa()}function Uc(A){var H;return[(H=yo())!=null?H:"",Wn(),Fi(),Id.value,Dc(A),ot.value.length,Math.round(_r(0,ot.value.length)),Math.round(ml()),xn.count,Math.round(xn.total)].join(":")}function Dk(){return jn(this,null,function*(){var A,H,j,V;const te=(A=o.virtualScroll)==null?void 0:A.settledToken,ge=Dc(te),Ce=Wn(),Me=yo(),Fe=Es.value;if(Mt.value&&((H=o.virtualScroll)==null?void 0:H.settleMode)==="manual"&&$d(te))if(gm()){if(Uc(te)!==fa&&!zc){zc=!0;try{const Ne=yield Tm({reason:"manual",expectedSettledTokenKey:ge}),Ue=Dc()===ge;Mm(Ce,Me,Fe)&&Ne.sessionKey===Ce&&Ne.threadKey===Me&&Ue&&Ne.stable&&Ne.phase==="final"&&(fa=Uc((j=o.virtualScroll)==null?void 0:j.settledToken))}finally{zc=!1,yield gt();const Ne=(V=o.virtualScroll)==null?void 0:V.settledToken,Ue=$d(Ne)?Uc(Ne):"";Mm(Ce,Me,Fe)&&Ue&&fa!==Ue&&Dk()}}}else Bn("manual")})}Ve(Mt,(A,H)=>{if(A!==H){if(!A)return Hm(),void Rm();Hm(),Fm(),ka=Es.value,Bn("content")}},{flush:"post"}),Ve([Mt,Es],([A,H])=>{A?ka!=null?ka!==H&&(ka=H,(function(j="resize"){ya(),wd(),Ks(),jt.clear();const V=ot.value.length;V>0&&bd(V),Am(),vl=null,yl=null,Nd=null,Oc=null,zc=!1,Wc(),Tk(),gt(()=>{Hi(),Ae.value&&rn(),vo.value&&ma(),Bn(j)})})("resize")):ka=H:ka=null},{flush:"post",immediate:!0}),Ve([Mt,()=>Wn(),()=>yo()],([A])=>{A&&(Hm(),Fm(),vk("content"),Bn("content"))}),Ve([Mt,()=>Wn(),()=>yo(),Es,()=>ot.value.length],([A])=>{A&&(function(H="async-node"){let j=!1;for(const[V,te]of Array.from(Ci.entries()))fm(te)||(Ci.delete(V),Ms.delete(V),j=!0);j&&(ua(),Bn(H))})("async-node")},{flush:"post"}),Ve([Mt,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.sessionKey},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey},()=>o.indexKey,()=>Y.value],([A])=>{A&&(Bc(),(function(H="content"){if(!Mt.value)return;const j=[],V=ot.value.length;for(const te of Array.from(jt.keys())){if(te>=V){j.push(te);continue}const ge=$c(te),Ce=jt.get(te);Ce!=null&&Ce!==ge&&j.push(te),jt.set(te,ge)}for(const te of Array.from(jt.keys()))te>=V&&jt.delete(te);j.length&&((function(te,ge={}){const Ce=Array.from(te,Number);VT(Ce,ge)>0&&(function(Fe){for(const Ne of Fe)jt.delete(Ne)})(Ce)})(j,{notify:!1}),Ks(),Wc(),Ae.value&&rn(),vo.value&&ma(),Bn(H))})("content"))},{flush:"post",immediate:!0}),Ve([Mt,()=>ot.value.length,()=>Wn(),()=>yo()],([A,H,j,V],[te,ge,Ce,Me])=>{A&&te&&j===Ce&&V===Me&&H!==ge&&Wc()},{flush:"post"}),Ve([Mt,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.heightCache},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.heightCacheWidth},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey},()=>ot.value.length,()=>Wn(),q],()=>{Tk()},{flush:"post",immediate:!0}),Ve([Mt,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreAnchor},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey},()=>ot.value.length,()=>Wn(),q],A=>jn(null,[A],function*([H,j]){if(!H||!j)return;yield gt();const V=(function(){var te;const ge=(te=o.virtualScroll)==null?void 0:te.restoreAnchor;return ge==null||ge===!1?null:ge===!0?"true":String(ge)})();xm(j,{restoreAnchor:V!=null,restoreToken:V??void 0})}),{flush:"post",immediate:!0}),Ve([Mt,q,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey}],([A])=>{var H;if(!A)return;const j=(H=o.virtualScroll)==null?void 0:H.restoreState;j&&vl&&yl==="restore"&&(Ak(j)||(Fm(),vl=null,yl=null,Bn("resize")))},{flush:"post"}),Ve([Mt,()=>ot.value.length,()=>Wn(),q],A=>jn(null,[A],function*([H]){var j;const V=Lc,te=Nc;H&&V&&(yield gt(),!xm(V,{restoreAnchor:te?.restoreAnchor===!0,restoreToken:(j=te?.restoreToken)!=null?j:"imperative",allowUncapturedAnchor:te?.allowUncapturedAnchor===!0})&&Ek(V)||(Lc=null,Nc=null))}),{flush:"post",immediate:!0}),Ve([Mt,U,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.settleMode},()=>Wn(),()=>yo(),Es,em,Jy,()=>Rt.value,Cd,()=>xn.count,()=>xn.total],([A,H,j])=>{if(!A||H!==!0||j==="manual"||!vm())return;const V=(function(){var te;const ge=ot.value.length;return[(te=yo())!=null?te:"",Wn(),Fi(),Id.value,ge,Math.round(_r(0,ge)),Math.round(ml()),xn.count,Math.round(xn.total)].join(":")})();Hc!==V&&(Hc=V,Tm({reason:"final"}).then(te=>{te.stable||Hc!==V||(Hc=null)}))},{flush:"post",immediate:!0}),Ve([Mt,U,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.settleMode},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.settledToken},()=>Wn(),()=>yo(),Es,em,Jy,()=>Rt.value,Cd,()=>ot.value.length,()=>xn.count,()=>xn.total],()=>{Dk()},{flush:"post",immediate:!0}),Ve([()=>ot.value.length,Ot,fs,Mc,()=>$o.start,()=>$o.end],([A,H,j,V,te,ge])=>{ye.value&&Ie("virtualization",{nodes:A,virtualization:H,maxLiveNodes:j,buffer:V,focusIndex:Vs.value,scroll:H?(()=>{const Ce=Pi.value||de();return Ce?{reverse:z(Ce),scrollTop:Math.round(Ce.scrollTop),scrollTopAbs:Math.round(Math.abs(Ce.scrollTop)),scrollHeight:Math.round(Ce.scrollHeight),clientHeight:Math.round(Ce.clientHeight)}:null})():null,liveRange:{start:te,end:ge},rendered:Rt.value})}),Ve([()=>b.customId],([A],H,j)=>{if(!A||Ze)return;const V=(function(te,ge){return te?(ko.controllers[te]=ge,()=>{ko.controllers[te]===ge&&delete ko.controllers[te]}):()=>{}})(A,{captureRestoreAnchor:nn,restoreAnchor:Eo,getAnchorDrift:gr,getReport:JT});j(()=>{V()})},{immediate:!0}),so(()=>{(function(){if(Mt.value)try{Hi(),Rc();const A=gl("manual");$k(A)&&(T(A),Oc=A,Im=Pc());const H=ha(A,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&($(H),H.anchor&&N(H.anchor),ga=Fc(H))}catch{}})(),uE(),sm(),Le(),Pk();for(const A of yr.values())for(const H of A)Ad(H);yr.clear(),hl.clear(),jt.clear(),Bm(),ya(),rm(),It(),pa(),Rm(),rk(),nm()});const dE=mi({loader:()=>jn(null,null,function*(){try{return(yield ns(()=>import("./index11-Dfvs1Rhd.js"),__vite__mapDeps([8,5]))).default}catch(A){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".',A),$s}}),loadingComponent:cZ,delay:0}),fE=mi({loader:()=>jn(null,null,function*(){try{return(yield ns(()=>import("./index10-CCuAby3p.js"),[])).default}catch(A){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.',A),$s}}),loadingComponent:aZ,delay:0}),hE=mi(()=>jn(null,null,function*(){try{return(yield ns(()=>import("./index7-DHIAb9rr.js"),[])).default}catch(A){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".',A),$s}})),Bk={text:to,paragraph:Vl,heading:Hh,code_block:qg,list:ac,list_item:lc,blockquote:Ff,table:Eu,definition_list:Hf,footnote:zf,footnote_reference:Bs,footnote_anchor:Mu,admonition:jf,vmr_container:Uf,hardbreak:Qr,link:as,image:Yr,thematic_break:Wf,math_inline:bi,math_block:hM,strong:rs,emphasis:cs,strikethrough:ls,highlight:Hs,insert:Ss,subscript:ws,superscript:_s,emoji:bs,checkbox:Ds,checkbox_input:Ds,inline_code:Yo,html_inline:Fs,reference:is,html_block:Tu},pE=B(()=>um()),Fk=B(()=>NS(b.codeBlockProps)),mE=B(()=>NS(b.codeBlockProps,{omit:["langs"]})),Hk=B(()=>rt(rt({stream:b.codeBlockStream,darkTheme:b.codeBlockDarkTheme,lightTheme:b.codeBlockLightTheme,monacoOptions:b.codeBlockMonacoOptions,themes:b.themes,langs:u.value==="shiki"?b.langs:void 0,minWidth:b.codeBlockMinWidth,maxWidth:b.codeBlockMaxWidth},typeof xe.value=="boolean"?{showTooltips:xe.value}:{}),mE.value)),zk=B(()=>rt(Pt(rt({},Hk.value),{langs:b.langs}),Fk.value));function Wk(A){return typeof A=="boolean"?A:void 0}const gE=B(()=>{const A=b.codeBlockProps||{},H={},j=Wk(A.showLineNumbers);j!==void 0&&(H.showLineNumbers=j);const V=Wk(A.diffInline);V!==void 0&&(H.diffInline=V);const te=(function(ge){const Ce=Number(ge);return Number.isFinite(Ce)&&Ce>0?Ce:void 0})(A.reservedHeightPx);return te!==void 0&&(H.reservedHeightPx=te),H}),vE=B(()=>rt(rt({stream:b.codeBlockStream,darkTheme:b.codeBlockDarkTheme,lightTheme:b.codeBlockLightTheme,themes:b.themes,langs:b.langs,minWidth:b.codeBlockMinWidth,maxWidth:b.codeBlockMaxWidth},typeof xe.value=="boolean"?{showTooltips:xe.value}:{}),Fk.value)),yE=B(()=>rt({},b.mermaidProps||{})),Uk=B(()=>rt({},b.d2Props||{})),kE=B(()=>rt({},b.infographicProps||{})),qc=B(()=>({typewriter:b.typewriter,fade:b.fade,customHtmlTags:zo.value.customHtmlTags})),bE=B(()=>rt(rt({},qc.value),typeof xe.value=="boolean"?{showTooltip:xe.value}:{})),_E=B(()=>rt(rt({},qc.value),typeof xe.value=="boolean"?{showTooltips:xe.value}:{})),wE=B(()=>rt(rt({},qc.value),typeof xe.value=="boolean"?{showTooltips:xe.value}:{})),SE=B(()=>rt(rt({},qc.value),typeof xe.value=="boolean"?{showTooltips:xe.value}:{}));function CE(A){return Array.isArray(A.children)&&A.children.length>0}const zm=B(()=>ZT.value.map(A=>{var H,j,V,te,ge,Ce,Me,Fe;let Ne=(function(ct){var dt,At,xt,ln,Et,Wt,zt;if(ct.type!=="code_block")return ct;const gn=ct,Is=[String((dt=gn.language)!=null?dt:""),String((At=gn.loading)!=null?At:""),String((xt=gn.diff)!=null?xt:""),String((ln=gn.code)!=null?ln:""),String((Et=gn.originalCode)!=null?Et:""),String((Wt=gn.updatedCode)!=null?Wt:""),String((zt=gn.raw)!=null?zt:"")].join("\0"),Qo=Oe.get(gn);if(Qo&&Qo.signature===Is)return Qo.node;const ui=rt({},gn);return Oe.set(gn,{signature:Is,node:ui}),ui})(A.node);const Ue=Pd(Ne);let ze=Kk(Ne,Ue);if((Ne.type==="html_block"||Ne.type==="html_inline")&&ze===Bk[Ne.type]){const ct=Ne,dt=String((H=ct.tag)!=null?H:"").trim().toLowerCase()||oA(ct.content);if(dt){const At=Yt.value[dt];if(mn.value.has(dt)&&At)ze=At,Ne=Pt(rt({},ct),{type:dt,tag:dt,content:xq(ct.content,dt)});else if(sA((j=ct.content)!=null?j:ct.raw,dt)){const xt=String((te=(V=ct.content)!=null?V:ct.raw)!=null?te:"");Ne.type==="html_inline"?(ze=to,Ne={type:"text",content:xt,raw:xt}):(ze=Vl,Ne={type:"paragraph",children:[{type:"text",content:xt,raw:xt}],raw:xt})}}}const Re=Ne.type==="code_block"&&u.value==="pre"&&ze===$s&&!Wm(Yt.value,Ue);let We=rt({},(function(ct,dt,At){const xt=dt??Pd(ct);if(ct.type==="code_block"){const ln=xt?Wm(Yt.value,xt):void 0;if(At&&u.value==="pre"&&!ln&&At===$s)return gE.value;if(At&&xt&&At===ln)return xt==="mermaid"?jk(ct):xt==="infographic"?Vk(ct):xt==="d2"||xt==="d2lang"?Uk.value:zk.value;if(At&&At===Yt.value.code_block)return zk.value;if(uk(At))return vE.value}return xt==="mermaid"?jk(ct):xt==="infographic"?Vk(ct):xt==="d2"||xt==="d2lang"?Uk.value:ct.type==="link"?bE.value:ct.type==="list"?_E.value:ct.type==="blockquote"?wE.value:ct.type==="table"?SE.value:ct.type==="code_block"?Hk.value:qc.value})(Ne,Ue,ze));const Je=pl.value[A.index];Ne.type==="code_block"&&Je?.kind==="code-block"&&(We=Pt(rt({},We),Re?{reservedHeightPx:(ge=Je.height)!=null?ge:Je.contentHeight}:{estimatedHeightPx:Je.height,estimatedContentHeightPx:Je.contentHeight})),Re||Ne.type!=="code_block"||Ue!=="mermaid"||Va(We.estimatedPreviewHeightPx)!=null||(We=Pt(rt({},We),{estimatedPreviewHeightPx:wv(bv(String((Ce=Ne.code)!=null?Ce:"")))})),Re||Ne.type!=="code_block"||Ue!=="infographic"||Va(We.estimatedPreviewHeightPx)!=null||(We=Pt(rt({},We),{estimatedPreviewHeightPx:Sv(_v(String((Me=Ne.code)!=null?Me:"")))})),Ne.type==="math_block"&&(We=Pt(rt({},We),{cacheScope:ro.value}));const et=(function(ct,dt){const At=String(ct.type);return!gd(At)&&Yt.value[At]===dt})(Ne,ze),Ct=et?py(Ne,Xe.value):void 0;return Pt(rt({},A),{node:Ne,component:ze,bindings:We,customBindings:rt(rt({},Ct??{}),We),rendersCustomNode:et,hasSlotChildren:CE(Ne),slotContent:String((Fe=Ne.content)!=null?Fe:""),isCodeBlock:Ne.type==="code_block",indexKey:`${pE.value}-${A.index}`})}));function Pd(A){var H;return A?.type==="code_block"?String((H=A.language)!=null?H:"").trim().toLowerCase():""}function Wm(A,H){const j=H.trim().toLowerCase();if(j)for(const V of[j,ly(j),ZA(j)]){const te=V&&A[V];if(te)return te}}function qk(A,H,j,V){var te,ge;const Ce=rt({},A.value);return Va(Ce.estimatedPreviewHeightPx)==null&&(Ce.estimatedPreviewHeightPx=V(j(String((te=H?.code)!=null?te:"")),void 0,Ce.maxHeight==="none"?null:(ge=Va(Ce.maxHeight))!=null?ge:void 0)),Ce}function jk(A){return qk(yE,A,bv,wv)}function Vk(A){return qk(kE,A,_v,Sv)}function Kk(A,H){if(!A)return Nv;const j=Yt.value,V=j[String(A.type)];if(A.type==="code_block"){const te=H??Pd(A),ge=te?Wm(j,te):void 0;return ge||(u.value==="pre"?j.code_block||$s:te==="mermaid"?j.mermaid||dE:te==="infographic"?j.infographic||fE:te==="d2"||te==="d2lang"?j.d2||hE:V||j.code_block||dk.value)}return V||Bk[String(A.type)]||Nv}function Um(A){s("click",A)}function xE(A){var H;(H=A.target)!=null&&H.closest("[data-node-index]")&&s("mouseover",A)}function AE(A){var H;(H=A.target)!=null&&H.closest("[data-node-index]")&&s("mouseout",A)}function Gk(A){s("mouseover",A)}function Yk(A){s("mouseout",A)}const _l=X(null),Ai=X(!1);let jc,ba=null,qm=0,Dd=0,Bd=0;const Qk=["code_block","admonition","table","math_block","html_block","image","thematic_break"],ME=new Set(Qk),Xk=[".typewriter-cursor",".height-estimation-probes",...Qk.map(A=>`[data-node-type="${A}"]`),"script","style"].join(",");function Zk(A){if(!A||typeof A!="object")return!1;const H=A.type;return typeof H=="string"&&ME.has(H)}function Fd(A){var H,j;if(!A||typeof A!="object")return 0;const V=A,te=(j=(H=V.raw)!=null?H:V.content)!=null?j:V.code;if(typeof te=="string")return te.length;const ge=V.children;if(Array.isArray(ge))return ge.reduce((Me,Fe)=>Me+Fd(Fe),0);const Ce=V.items;return Array.isArray(Ce)?Ce.reduce((Me,Fe)=>Me+Fd(Fe),0):0}function Hd(){jc&&(clearTimeout(jc),jc=void 0)}function Jk(){qm+=1,ba!=null&&(st?.(ba),ba=null)}function zd(){Jk(),_l.value&&(_l.value.style.visibility="hidden")}function TE(A){var H;if(A.nodeType!==Node.TEXT_NODE||!((H=A.textContent)!=null?H:"").trim())return!1;const j=A.parentElement;return!!j&&!j.closest(Xk)}function EE(A){let H=A.lastChild;for(;H;){if(TE(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const j=H;if(!j.matches(Xk)&&j.lastChild){H=j.lastChild;continue}}for(;H&&H!==A&&!H.previousSibling;)H=H.parentNode;if(!H||H===A)break;H=H.previousSibling}return null}function jm(){if(!Q||!Ai.value||ba!=null)return;const A=qm,H=()=>{ba=null,A===qm&&(function(){var j,V;if(!(Q&&Ai.value&&S.value&&_l.value))return;const te=S.value,ge=_l.value;ge.style.visibility="hidden";const Ce=(function(){const ze=zm.value;for(let Re=ze.length-1;Re>=0;Re--){const We=ze[Re];if(!We||Zk(We.node)||!Pm(We.index))continue;const Je=Pn.get(We.index);if(!Je)continue;const et=EE(Je);if(et)return et}return null})();if(!Ce)return;let Me=0,Fe=0,Ne=20,Ue=!1;if(Ce?.textContent){const ze=Ce.textContent.length,Re=document.createRange();Re.setStart(Ce,Math.max(0,ze-1)),Re.setEnd(Ce,ze);const We=typeof Re.getClientRects=="function"?Re.getClientRects():void 0,Je=(V=We?.[We.length-1])!=null?V:(j=Ce.parentElement)==null?void 0:j.getBoundingClientRect();if(Je){const et=yt("typewriterCursor.root.getBoundingClientRect",()=>te.getBoundingClientRect());Me=Je.right-et.left+te.scrollLeft,Fe=Je.top-et.top+te.scrollTop,Ne=Je.height||Ne,Ue=!0}Re.detach()}Ue&&(ge.style.transform=`translate(${Math.max(0,Me)}px, ${Math.max(0,Fe)}px)`,ge.style.height=`${Ne}px`,ge.style.visibility="visible")})()};tt?ba=tt(H):H()}return Ve([he,()=>o.content,()=>o.nodes,()=>b.typewriter,U],()=>jn(null,null,function*(){var A,H;if(!Q||ee.value||!G.value)return;if(U.value)return Ai.value=!1,Hd(),void zd();if((A=o.nodes)!=null&&A.length)return Ai.value=!1,Hd(),zd(),Dd=((H=o.content)!=null?H:"").length,void(Bd=he.value.length);const j=(function(){var Me,Fe;return(Me=o.nodes)!=null&&Me.length?o.nodes.reduce((Ne,Ue)=>Ne+Fd(Ue),0):((Fe=o.content)!=null?Fe:"").length})(),V=(function(){var Me;return(Me=o.nodes)!=null&&Me.length?o.nodes.reduce((Fe,Ne)=>Fe+Fd(Ne),0):he.value.length})(),te=!Zk(ot.value[ot.value.length-1]),ge=j>Dd,Ce=V>Bd;if(b.typewriter===!1||!te||!ge&&!Ce)return b.typewriter!==!1&&te||(Ai.value=!1,zd()),Dd=j,void(Bd=V);Dd=j,Bd=V,Ai.value=!0,_l.value&&(_l.value.style.visibility="hidden"),Hd(),yield gt(),jm(),jc=setTimeout(()=>{jc=void 0,Ai.value=!1},3e3)}),{flush:"post",immediate:!0}),Ve(Ai,A=>jn(null,null,function*(){A?(yield gt(),jm()):zd()}),{flush:"post"}),Ve([()=>Rt.value,()=>$o.start,()=>$o.end],()=>jn(null,null,function*(){Q&&!ee.value&&G.value&&Ai.value&&(yield gt(),jm())}),{flush:"post"}),so(()=>{Hd(),Jk(),pn.clear()}),(A,H)=>{const j=n5("NodeRenderer",!0);return x(ee)?(_(!0),I(Pe,{key:0},nt(zm.value,V=>(_(),I(Pe,{key:V.index},[V.rendersCustomNode?(_(),ke(Oo(V.component),bn({key:0,ref_for:!0},V.customBindings,{node:V.node,loading:V.node.loading,"index-key":V.indexKey,"custom-id":b.customId,"is-dark":b.isDark,onClick:Um,onMouseover:Gk,onMouseout:Yk,onCopy:H[0]||(H[0]=te=>s("copy",te)),onHandleArtifactClick:H[1]||(H[1]=te=>s("handleArtifactClick",te))}),{default:we(()=>[V.hasSlotChildren?(_(),ke(j,bn({key:0,ref_for:!0},zn.value,{nodes:V.node.children,"index-key":V.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):V.slotContent?(_(),ke(j,bn({key:1,ref_for:!0},zn.value,{content:V.slotContent,final:!V.node.loading,"index-key":`${V.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(_(),ke(Oo(V.component),bn({key:1,node:V.node,loading:V.node.loading,"index-key":V.indexKey},{ref_for:!0},V.bindings,{"custom-id":b.customId,"is-dark":b.isDark,onClick:Um,onMouseover:Gk,onMouseout:Yk,onCopy:H[2]||(H[2]=te=>s("copy",te)),onHandleArtifactClick:H[3]||(H[3]=te=>s("handleArtifactClick",te))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(_(),I("div",{key:1,ref_key:"containerRef",ref:S,class:De(["markstream-vue markdown-renderer",[{dark:b.isDark},{virtualized:Ot.value},{"virtual-scroll-coordinated":Xn.value}]]),"data-custom-id":b.customId,onClick:Um,onMouseover:xE,onMouseout:AE},[wo.value||Ot.value?(_(),I(Pe,{key:0},[wo.value?(_(),I("div",{key:0,class:"height-estimation-probes",style:en({width:`${ds.value}px`}),"aria-hidden":"true"},[C("div",{ref_key:"paragraphProbeWrapperRef",ref:E,class:"node-content","data-probe":"paragraph"},[se(x(Vl),{node:Yn.value,"index-key":"probe-paragraph"},null,8,["node"])],512),C("div",{ref_key:"listItemProbeWrapperRef",ref:P,class:"node-content","data-probe":"list-item"},[C("ul",dZ,[se(x(lc),{node:Zt.value,"index-key":"probe-list-item"},null,8,["node"])])],512),C("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[se(x(ac),{node:Qn.value,"index-key":"probe-list"},null,8,["node"])],512),(_(),I(Pe,null,nt(6,V=>C("div",{key:`probe-heading-${V}`,ref_for:!0,ref:te=>(function(ge,Ce){ge<1||ge>6||(F[ge]=Ce)})(V,te),class:"node-content","data-probe":`heading-${V}`},[se(x(Hh),{node:YT(V),"index-key":`probe-heading-${V}`},null,8,["node","index-key"])],8,fZ)),64))],4)):re("",!0),Ot.value?(_(),I("div",{key:1,class:"node-spacer",style:en({height:`${am.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],64)):re("",!0),(_(!0),I(Pe,null,nt(zm.value,V=>(_(),I("div",{key:V.index,ref_for:!0,ref:te=>Ok(V.index,te),class:"node-slot","data-node-index":V.index,"data-node-type":V.node.type},[Pm(V.index)?(_(),I("div",{key:0,ref_for:!0,ref:te=>(function(ge,Ce){var Me;Ce||(function(ze){const Re=`${um()}-${ze}`;let We=!1;for(const Je of Array.from(Ms.keys())){const et=Ci.get(Je);(et?.index===ze||Je===Re||Je.startsWith(`${Re}-`))&&(Ms.delete(Je),Ci.delete(Je),We=!0)}We&&(ua(),Bn("async-node"))})(ge),Bi.delete(ge),(function(ze){var Re;const We=((Re=hl.get(ze))!=null?Re:0)+1;hl.set(ze,We)})(ge);const Fe=yr.get(ge);if(Fe){for(const ze of Fe)Ad(ze);yr.delete(ge)}if((function(ze){const Re=As.get(ze);Re&&(ve?.unobserve(Re),ft.delete(Re),As.delete(ze))})(ge),!Ce||!Us.value)return Si.delete(ge),void hl.delete(ge);Si.set(ge,Ce);const Ne=()=>{Od(ge,Ce)};queueMicrotask(Ne);const Ue=(ve||typeof ResizeObserver>"u"||(ve=new ResizeObserver(ze=>{if(ze.length)for(const Re of ze){const We=ft.get(Re.target),Je=As.get(We??-1);We!=null&&Je&&Od(We,Je)}else Hi()})),ve);if(Ue&&(As.set(ge,Ce),ft.set(Ce,ge),Ue.observe(Ce)),typeof window<"u"){const ze=((Me=ot.value[ge])==null?void 0:Me.type)==="code_block"?[16,80,240,800]:U.value?[80]:[];if(ze.length){const Re=ze.map(We=>ok(We,Ne,"node-resize")).filter(We=>We!=null);Re.length&&yr.set(ge,Re)}}})(V.index,te),class:"node-content"},[V.isCodeBlock?V.rendersCustomNode?(_(),ke(Oo(V.component),bn({key:1,ref_for:!0},V.customBindings,{node:V.node,loading:V.node.loading,"index-key":V.indexKey,"custom-id":b.customId,"is-dark":b.isDark,onCopy:H[8]||(H[8]=te=>s("copy",te)),onHandleArtifactClick:H[9]||(H[9]=te=>s("handleArtifactClick",te))}),{default:we(()=>[V.hasSlotChildren?(_(),ke(j,bn({key:0,ref_for:!0},zn.value,{nodes:V.node.children,"index-key":V.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):V.slotContent?(_(),ke(j,bn({key:1,ref_for:!0},zn.value,{content:V.slotContent,final:!V.node.loading,"index-key":`${V.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(_(),ke(Oo(V.component),bn({key:2,node:V.node,loading:V.node.loading,"index-key":V.indexKey},{ref_for:!0},V.bindings,{"custom-id":b.customId,"is-dark":b.isDark,onCopy:H[10]||(H[10]=te=>s("copy",te)),onHandleArtifactClick:H[11]||(H[11]=te=>s("handleArtifactClick",te))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(_(),ke(Jr,{key:0,name:"fade",css:b.fade!==!1,appear:b.fade!==!1},{default:we(()=>[V.rendersCustomNode?(_(),ke(Oo(V.component),bn({key:0,ref_for:!0},V.customBindings,{node:V.node,loading:V.node.loading,"index-key":V.indexKey,"custom-id":b.customId,"is-dark":b.isDark,onCopy:H[4]||(H[4]=te=>s("copy",te)),onHandleArtifactClick:H[5]||(H[5]=te=>s("handleArtifactClick",te))}),{default:we(()=>[V.hasSlotChildren?(_(),ke(j,bn({key:0,ref_for:!0},zn.value,{nodes:V.node.children,"index-key":V.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):V.slotContent?(_(),ke(j,bn({key:1,ref_for:!0},zn.value,{content:V.slotContent,final:!V.node.loading,"index-key":`${V.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(_(),ke(Oo(V.component),bn({key:1,node:V.node,loading:V.node.loading,"index-key":V.indexKey},{ref_for:!0},V.bindings,{"custom-id":b.customId,"is-dark":b.isDark,onCopy:H[6]||(H[6]=te=>s("copy",te)),onHandleArtifactClick:H[7]||(H[7]=te=>s("handleArtifactClick",te))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(_(),I("div",{key:1,class:"node-placeholder",style:en({height:`${Ed(V.index)}px`})},null,4))],8,hZ))),128)),Ai.value?(_(),I("span",{key:1,ref_key:"typewriterCursorRef",ref:_l,class:"typewriter-cursor","aria-hidden":"true"},null,512)):re("",!0),Ot.value?(_(),I("div",{key:2,class:"node-spacer",style:en({height:`${cm.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],42,uZ))}}})),[["__scopeId","data-v-2e8e6e17"]]),Cs=AM;Cs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Cs.__name,Cs.name].filter(n=>!!n));for(const n of t)e.component(n,AM)};const _y=Object.freeze(Object.defineProperty({__proto__:null,default:Cs},Symbol.toStringTag,{value:"Module"})),pZ={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"},mZ={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"},gZ={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"},vZ={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"},yZ={class:"admonition-title"},kZ=["aria-expanded","aria-controls"],bZ=["id"],jf=kn(je({__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=B(()=>{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=X(!!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)=>(_(),I("div",{class:De(["admonition",[`admonition-${o.node.kind}`]])},[C("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(_(),I("svg",pZ,[...u[1]||(u[1]=[C("circle",{cx:"12",cy:"12",r:"10"},null,-1),C("path",{d:"M12 16v-4"},null,-1),C("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(_(),I("svg",mZ,[...u[2]||(u[2]=[C("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),C("path",{d:"M9 18h6"},null,-1),C("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(_(),I("svg",gZ,[...u[3]||(u[3]=[C("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),C("path",{d:"M12 9v4"},null,-1),C("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(_(),I("svg",vZ,[...u[4]||(u[4]=[C("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),C("path",{d:"M12 8v4"},null,-1),C("path",{d:"M12 16h.01"},null,-1)])])):re("",!0),C("span",yZ,R(i.value),1),o.node.collapsible?(_(),I("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(_(),I("svg",{style:en({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]=[C("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,kZ)):re("",!0)]),An(C("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[se(x(Cs),{"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,bZ),[[Ns,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);jf.install=e=>{e.component(jf.__name,jf)};const MM=()=>ns(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let bf=null,_Z=MM;function jye(){return jn(this,null,function*(){if(bf)return bf;const e=_Z;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===MM?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(bf=(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),bf):null})}function Vye(){return!1}function Kye(){return jn(this,null,function*(){return null})}const _f=X(!1);let qS=!1;function e1(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function wZ(){return!qS&&typeof window<"u"&&typeof document<"u"&&(qS=!0,_f.value=e1(),new MutationObserver(()=>{_f.value=e1()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{_f.value=e1()})),_f}const TM=["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"],SZ=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Bv=[...TM].sort((e,t)=>t.length-e.length).join("|"),t1=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Bv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Bv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),EM=/[),.;!?,。;!?)]+$/;function CZ(e){const t=e.toLowerCase();return TM.some(n=>t.endsWith(`.${n}`))}function xZ(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Bv}))["']`,"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 AZ(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(EM,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=SZ.has(i),a=CZ(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 MZ(e,t={}){const n=[];t1.lastIndex=0;let o;for(;(o=t1.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(EM,""),u=a.length-c.length;a=c;const d=AZ(a,t);if(!d)continue;const f=o.index+r,p=f+a.length;n.push({...d,start:f,end:p,text:a}),u>0&&(t1.lastIndex-=u)}return n}const TZ=12e4,EZ=6e4,IZ=32,$Z=3e4,jS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function LZ(e){let t=0,n=0,o=0;jS.lastIndex=0;let s;for(;(s=jS.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=TZ||n>=EZ||t>=IZ||o>=$Z?"pre":"shiki",codeFenceCount:t,codeChars:n}}function NZ(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function RZ(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const OZ={key:1,class:"diff-wrap"},PZ={class:"diff-bar"},DZ=["aria-label","onClick"],BZ={class:"diff-pre"},FZ={key:0,class:"diff-sign"},HZ={class:"diff-text"},zZ="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",VS="github-light",KS="github-dark",WZ=je({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){vY(),IY(),kY(),OY(),yY(new NZ),RY(new RZ);function t(P){return P.inline.ruler.disable("math"),P}const{t:n}=Tt(),o=Vt("resolveImage"),s=X(null),i=e,r=B(()=>!i.streaming),l=B(()=>xZ(i.text??"")),a=B(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:LZ(i.text??"")),c=wZ(),u=B(()=>!i.streaming),d=Bo(new Map),f=new Set,p=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,h=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(P){return!/^(https?:|data:|blob:)/i.test(P)}function w(P){if(!o)return;const D=[];for(const F of[p,h]){F.lastIndex=0;let W;for(;(W=F.exec(P))!==null;)D.push(W[2]??"")}for(const F of D)!F||!m(F)||d.has(F)||f.has(F)||(f.add(F),o(F).then(W=>{d.set(F,W!==F?W:"")}).catch(()=>{d.set(F,"")}).finally(()=>{f.delete(F)}))}function k(P){if(!o)return P;const D=F=>{if(!m(F))return null;const W=d.get(F);return W===void 0?zZ:W===""?null:W};return P.replace(p,(F,W,K,Y)=>{const q=D(K);return q===null?F:`${W}${q}${Y}`}).replace(h,(F,W,K,Y)=>{const q=D(K);return q===null?F:`${W}${q}${Y}`})}Ve(()=>i.text,P=>w(P??""),{immediate:!0});function g(){if(!s.value||!i.openFile||i.streaming)return;const P=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),D=[];let F=P.nextNode();for(;F;){const W=F,K=W.parentElement;K&&!K.closest("a, pre, .md-file-link, svg")&&W.data.trim().length>0&&D.push(W),F=P.nextNode()}for(const W of D){const K=MZ(W.data,{aliases:l.value});if(K.length===0||!W.parentNode)continue;const Y=document.createDocumentFragment();let q=0;for(const ae of K){ae.start>q&&Y.append(document.createTextNode(W.data.slice(q,ae.start)));const ce=document.createElement("button");ce.type="button",ce.className="md-file-link",ce.textContent=ae.text,ce.title=ae.line?`${ae.path}:${ae.line}`:ae.path,ce.addEventListener("click",ne=>{ne.preventDefault(),ne.stopPropagation(),i.openFile?.({path:ae.path,line:ae.line})}),Y.append(ce),q=ae.end}q<W.data.length&&Y.append(document.createTextNode(W.data.slice(q))),W.parentNode.replaceChild(Y,W)}}function v(P){return!(!P||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(P))}function y(P){let D=P.length;for(const F of["#","?"]){const W=P.indexOf(F);W!==-1&&W<D&&(D=W)}return P.slice(0,D)}function M(){if(!s.value||!i.openFile||i.streaming)return;const P=s.value.querySelectorAll("a[href]");for(const D of P){if(D.dataset.mdLinkHandled==="true"||D.closest("svg"))continue;const F=D.getAttribute("href")??"";v(F)&&(D.dataset.mdLinkHandled="true",D.addEventListener("click",W=>{W.preventDefault(),W.stopPropagation(),i.openFile?.({path:y(F)})}))}}function O(){gt().then(()=>{g(),M()})}Ve(()=>i.text,O),Ve(()=>i.streaming,O);let L=null;Sn(()=>{O(),s.value&&(L=new MutationObserver(O),L.observe(s.value,{childList:!0,subtree:!0}))}),In(()=>{L?.disconnect()});const b={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},T=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,$=B(()=>{const P=k(i.text??""),D=[];let F=0;T.lastIndex=0;let W;for(;(W=T.exec(P))!==null;){const Y=W[1]??"",q=P.slice(F,W.index)+(Y||"");q.trim()&&D.push({kind:"md",text:q}),D.push({kind:"diff",code:W[2]??""}),F=T.lastIndex}const K=P.slice(F);return(K.trim()||D.length===0)&&D.push({kind:"md",text:K}),D});function N(P){return P.split(`
252
+ `).map(D=>D.startsWith("@@")?{type:"hunk",sign:"",text:D}:/^\+(?!\+\+)/.test(D)?{type:"add",sign:"+",text:D.slice(1)}:/^-(?!--)/.test(D)?{type:"del",sign:"-",text:D.slice(1)}:D.startsWith(" ")?{type:"ctx",sign:"",text:D.slice(1)}:{type:"ctx",sign:"",text:D})}const S=X(null);function E(P,D){Go(P).then(F=>{F&&(S.value=D,setTimeout(()=>{S.value=null},1400))})}return(P,D)=>(_(),I("div",{ref_key:"mdRef",ref:s,class:"md"},[(_(!0),I(Pe,null,nt($.value,(F,W)=>(_(),I(Pe,{key:W},[F.kind==="md"?(_(),ke(x(Cs),{key:0,content:F.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":x(c),"code-block-light-theme":VS,"code-block-dark-theme":KS,themes:[VS,KS],"code-block-props":b,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(_(),I("div",OZ,[C("div",PZ,[D[0]||(D[0]=C("span",{class:"diff-lang"},"diff",-1)),se(Kt,{text:x(n)("filePreview.copyCode")},{default:we(()=>[C("button",{class:"diff-copy","aria-label":x(n)("filePreview.copyCode"),onClick:K=>E(F.code,W)},[se(Qe,{name:S.value===W?"check":"copy",size:"sm"},null,8,["name"])],8,DZ)]),_:2},1032,["text"])]),C("pre",BZ,[C("code",null,[(_(!0),I(Pe,null,nt(N(F.code),(K,Y)=>(_(),I("span",{key:Y,class:De(["diff-line",`diff-${K.type}`])},[K.type!=="hunk"?(_(),I("span",FZ,R(K.sign),1)):re("",!0),C("span",HZ,R(K.text),1)],2))),128))])])]))],64))),128))],512))}}),Wp=ut(WZ,[["__scopeId","data-v-6678a5da"]]),UZ={class:"tc-anim"},qZ={class:"prev-anim"},jZ={class:"prev"},VZ=je({__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=B(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=B(()=>n.foldable&&s.value.length>1),r=B(()=>n.streaming||!i.value),l=B(()=>s.value.at(-1)??""),a=X(null);return Sn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ve(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||gt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(_(),I("div",{class:De(["think",{mob:e.mobile}])},[i.value?(_(),I("div",{key:0,class:De(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[C("div",UZ,[C("pre",{ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513)]),C("div",qZ,[C("span",jZ,R(l.value),1)])],2)):(_(),I("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513))],2))}}),KZ=ut(VZ,[["__scopeId","data-v-88e1c4c6"]]),GZ={class:"activity-notice",role:"status"},YZ={"aria-hidden":"true"},QZ={class:"an-label"},XZ=je({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(_(),I("div",GZ,[C("span",YZ,[se(ai,{size:"sm"})]),C("span",QZ,R(e.label),1)]))}}),ZZ=ut(XZ,[["__scopeId","data-v-0d497074"]]);function JZ(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 eJ=je({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Tt(),o=X(!1),s=B(()=>{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=B(()=>o.value?s.value:JZ(t.time,n("conversation.yesterday")));function r(){o.value=!o.value}return(l,a)=>(_(),I("button",{type:"button",class:"msg-time",onClick:kt(r,["stop"])},R(i.value),1))}}),IM=ut(eJ,[["__scopeId","data-v-9672fbd5"]]);function tJ(e){return e.length===1?`0${e}`:e}function nJ(e,t){return`${String(Number(e))}:${tJ(t)}`}const GS=e=>/^\d+$/.test(e);function oJ(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(GS(o)&&GS(s)&&c){const f=nJ(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 sJ=["data-turn-id"],iJ={class:"cn-bubble"},rJ={class:"cn-title"},lJ={key:0,class:"cn-prompt"},aJ={class:"cn-meta"},cJ={key:0,class:"cn-meta-item"},uJ={key:1,class:"cn-meta-item"},dJ=["aria-label"],fJ=["title"],hJ=je({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Tt(),o=B(()=>t.cron),s=B(()=>o.value?.missedCount!==void 0),i=B(()=>s.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=B(()=>{const u=o.value?.cron;return u?oJ(u,n):""}),l=B(()=>s.value?"error":"ok"),a=B(()=>{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=B(()=>t.text??"");return(u,d)=>(_(),I("div",{class:De(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[C("div",iJ,[C("span",rJ,R(i.value),1),c.value?(_(),I("span",lJ,R(c.value),1)):re("",!0)]),C("div",aJ,[se(Qe,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(_(),I("span",cJ,R(r.value),1)):re("",!0),a.value?(_(),I("span",uJ,R(a.value),1)):re("",!0),C("span",{class:De(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(_(),ke(Qe,{key:0,name:"check",size:"sm"})):(_(),ke(Qe,{key:1,name:"close",size:"sm"}))],10,dJ),o.value?.jobId?(_(),I("span",{key:2,class:"cn-meta-item cn-id",title:x(n)("conversation.cron.job",{id:o.value.jobId})},R(o.value.jobId),9,fJ)):re("",!0),e.createdAt?(_(),ke(IM,{key:3,time:e.createdAt},null,8,["time"])):re("",!0)])],10,sJ))}}),pJ=ut(hJ,[["__scopeId","data-v-a62a6587"]]);function $M(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 Fv(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaiting_approval":return"awaitingApproval";case"awaiting_question":return"awaitingQuestion";case"aborted":return"aborted"}}function mJ(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function hi(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:Fv(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:$M(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 Iu(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 YS(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 wy(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:YS(e.source)};case"video":return{type:"video",source:YS(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 Hv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(wy),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function gJ(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 vJ(e){return{content:e.content.map(gJ),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 yJ(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function LM(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 kJ(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function bJ(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(kJ),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function NM(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(bJ),createdAt:e.created_at}}function _J(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 wJ(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=_J(o);return{answers:t,method:e.method,note:e.note}}function zv(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.kind==="subagent"?!0:void 0}}function QS(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 Nr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Ia(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Ys(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function SJ(e){if(!e||typeof e!="object")return null;const t=e,n=Nr(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:Nr(t,"goalId")??Nr(t,"goal_id")??"goal",objective:Nr(t,"objective")??"",completionCriterion:Nr(t,"completionCriterion")??Nr(t,"completion_criterion"),status:n,turnsUsed:Ia(t,"turnsUsed")??Ia(t,"turns_used")??0,tokensUsed:Ia(t,"tokensUsed")??Ia(t,"tokens_used")??0,wallClockMs:Ia(t,"wallClockMs")??Ia(t,"wall_clock_ms")??0,terminalReason:Nr(t,"terminalReason")??Nr(t,"terminal_reason"),budget:{tokenBudget:Ys(s,"tokenBudget")??Ys(s,"token_budget"),remainingTokens:Ys(s,"remainingTokens")??Ys(s,"remaining_tokens"),turnBudget:Ys(s,"turnBudget")??Ys(s,"turn_budget"),remainingTurns:Ys(s,"remainingTurns")??Ys(s,"remaining_turns"),wallClockBudgetMs:Ys(s,"wallClockBudgetMs")??Ys(s,"wall_clock_budget_ms"),remainingWallClockMs:Ys(s,"remainingWallClockMs")??Ys(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function CJ(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:hi(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:hi(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:Iu(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Iu(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:Fv(t.payload.status),previousStatus:Fv(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:$M(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=SJ(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:Hv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(wy),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:LM(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:NM(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:zv(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:Wv(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 xJ(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 XS(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 Wv(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 AJ(e){return e.session_id}function MJ(e){return e.seq}const TJ="main",EJ=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"]);function Qi(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 IJ(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 ZS(){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}}function Jo(e,t){const n=e[t];return typeof n=="string"?n:void 0}function $l(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Qs(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function $J(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=Jo(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=Jo(t,"goalId")??Jo(t,"goal_id")??"goal",r=Jo(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:Jo(t,"completionCriterion")??Jo(t,"completion_criterion"),status:s,turnsUsed:$l(t,"turnsUsed")??$l(t,"turns_used")??0,tokensUsed:$l(t,"tokensUsed")??$l(t,"tokens_used")??0,wallClockMs:$l(t,"wallClockMs")??$l(t,"wall_clock_ms")??0,terminalReason:Jo(t,"terminalReason")??Jo(t,"terminal_reason"),budget:{tokenBudget:Qs(o,"tokenBudget")??Qs(o,"token_budget"),remainingTokens:Qs(o,"remainingTokens")??Qs(o,"remaining_tokens"),turnBudget:Qs(o,"turnBudget")??Qs(o,"turn_budget"),remainingTurns:Qs(o,"remainingTurns")??Qs(o,"remaining_turns"),wallClockBudgetMs:Qs(o,"wallClockBudgetMs")??Qs(o,"wall_clock_budget_ms"),remainingWallClockMs:Qs(o,"remainingWallClockMs")??Qs(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Ka(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 LJ(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=Jo(t,"name")??Jo(t,"toolName")??"tool",o=oa(NJ(n)),s=RJ(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=Jo(n,"text");if(s)return n1(s);const i=Jo(n,"message");if(i)return n1(i)}const o=Jo(t,"message");if(o)return n1(o)}return null}function NJ(e){return e.replace(/_\d+$/,"")}const JS=2e3;function n1(e){return e.length>JS?`${e.slice(0,JS)}…`:e}function RJ(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return ju(e,n)}function OJ(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=Jo(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Ka(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),p=[];return f&&p.push({type:"taskCreated",sessionId:t,task:f}),p.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),p}const r=LJ(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Ka(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 tu(e){return{...e,content:e.content.map(t=>({...t}))}}function eC(e,t,n){const o={id:Qi("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function PJ(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 DJ(e){return Array.isArray(e)?e.map(t=>wy(t)):[]}function tC(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 BJ(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 FJ(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 nC(e,t){e.messages.find(n=>n.id===t)}function HJ(e,t,n,o,s,i){const r={id:Qi("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 o1(e,t){return e.messages.find(n=>n.id===t)}function oC(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 zJ(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=ZS(),e.set(u,d)),d}function o(u){e.set(u,ZS())}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),p=d.promptId??Qi("pr_");f.currentPromptId=p,f.turnPromptId.set(d.turnId,p);const h=eC(f,u,p);d.thinkingText.length>0&&h.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&h.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const w=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;h.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:w}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=h.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:p},{type:"messageCreated",message:tu(h)}]}function l(u,d,f,p){try{return c(u,d,f,p)}catch(h){return console.error("[agentProjector] Error projecting event:",u,h instanceof Error?h.message:h),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,p){const h=n(f),m=d,w=[],k=m?.agentId;if(typeof k=="string"&&k!==TJ){const g=t.has(k);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:k,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:k,reason:m?.reason}];if(EJ.has(u))return OJ(h,f,k,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,y={};typeof g=="string"&&g.length>0&&(y.title=g),typeof v=="string"&&(y.lastPrompt=v),(y.title!==void 0||y.lastPrompt!==void 0)&&w.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=DJ(m?.content);if(y.length===0)break;h.currentPromptId=g;const M=PJ(h,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());w.push({type:"messageCreated",message:tu(M)});break}case"turn.started":{const g=m?.turnId,v=h.currentPromptId??Qi("pr_");h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v),h.turnTextLen=0,h.turnThinkLen=0,w.push({type:"sessionStatusChanged",sessionId:f,status:"running",previousStatus:"idle",currentPromptId:v});break}case"turn.step.started":{const g=m?.turnId;let v=h.turnPromptId.get(g)??h.currentPromptId;v||(v=Qi("pr_"),h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v));const y=eC(h,f,v);h.currentAssistantMsgId=y.id,w.push({type:"messageCreated",message:tu(y)});break}case"thinking.delta":{const g=h.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnThinkLen>0&&(h.turnThinkLen=0);const y=a(h.turnThinkLen,p?.offset);if(y==="skip")break;if(y==="gap"){w.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const M=tC(h,g,"thinking",v);if(M<0)break;h.turnThinkLen+=v.length,w.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:M,delta:{thinking:v}});break}case"assistant.delta":{const g=h.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnTextLen>0&&(h.turnTextLen=0);const y=a(h.turnTextLen,p?.offset);if(y==="skip")break;if(y==="gap"){w.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const M=tC(h,g,"text",v);if(M<0)break;h.turnTextLen+=v.length,w.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:M,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=h.currentAssistantMsgId,v=m?.turnId,y=h.turnPromptId.get(v)??h.currentPromptId;if(!g||!y)break;const M=m?.toolCallId,O=m?.name??m?.toolName??"",L=m?.args??m?.input??{};BJ(h,g,M,O,L);const b=o1(h,g);b&&b.content.length-1,h.toolStartTimes.set(M,Date.now()),b&&w.push({type:"messageUpdated",sessionId:f,messageId:g,content:b.content.map(T=>({...T})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=FJ(m??{});g&&v&&w.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=h.turnPromptId.get(g)??h.currentPromptId;v||(v=Qi("pr_"),h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v));const y=m?.toolCallId,M=m?.output,O=m?.isError??!1;h.toolStartTimes.get(y)??Date.now(),h.toolStartTimes.delete(y);const L=HJ(h,f,y,M,O,v);w.push({type:"messageCreated",message:tu(L)}),h.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=h.currentAssistantMsgId,v=IJ(m?.usage);if(h.totalInput+=v.input,h.totalOutput+=v.output,h.totalCacheRead+=v.cacheRead,h.totalCacheCreate+=v.cacheCreate,g){nC(h,g);const y=o1(h,g);y&&w.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(M=>({...M})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(h.model=m.model),m?.contextTokens!==void 0&&(h.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(h.contextLimit=m.maxContextTokens),w.push({type:"sessionUsageUpdated",sessionId:f,usage:oC(h),model:h.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const g=h.currentAssistantMsgId,v=m?.reason??"completed",y=$l(m??{},"durationMs");if(g){nC(h,g);const L=o1(h,g);L&&w.push({type:"messageUpdated",sessionId:f,messageId:g,content:L.content.map(b=>({...b})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}h.turnCount++;const M=oC(h);w.push({type:"sessionUsageUpdated",sessionId:f,usage:M});const O=v==="cancelled"||v==="failed"||v==="filtered"?"aborted":"idle";w.push({type:"sessionStatusChanged",sessionId:f,status:O,previousStatus:"running"}),h.currentAssistantMsgId=void 0,h.currentPromptId=void 0,h.turnTextLen=0,h.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{h.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:Qi("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};h.subagentMeta.set(v.id,v),w.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=Ka(h,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&w.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=Ka(h,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&w.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Ka(h,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&w.push({type:"taskCreated",sessionId:f,task:v}),w.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=Ka(h,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&w.push({type:"taskCreated",sessionId:f,task:v}),w.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{w.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{w.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):Qi("task_"),M=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:Hn.global.t("tasks.defaultDescription"),O=typeof g.command=="string"?g.command:void 0;w.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:M,command:O,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:O!==void 0?`$ ${O}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;w.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};w.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),w.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{w.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{w.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=$J(m?.snapshot??null);w.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=Jo(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const y={id:Qi("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};h.messages.push(y),w.push({type:"messageCreated",message:tu(y)})}break}}return w}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const WJ=new Set(["server_hello","ack","ping","resync_required","error","pong"]),sC=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","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated","cron.fired"]),UJ=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"]),qJ=new Set(["assistant.delta","thinking.delta"]);function jJ(e,t){if(WJ.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return qJ.has(o)?VJ(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?UJ.has(o)?{route:"protocol"}:sC.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:sC.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function VJ(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 Vf 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 Da 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 il(e){return e instanceof Vf||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function RM(e){return e instanceof Da||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const iC=1e3,s1=16384,i1=500,r1=50,KJ=6,GJ=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,YJ=/^[A-Za-z0-9+/=_-]{200,}$/;let l1=null;function _i(){if(l1!==null)return l1;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=no(Nt.debug)==="1"),l1=e,e}const jr=[];let QJ=1;const Sy=X(0),cu=ta(!1);function XJ(){return jr}function ZJ(){jr.length=0,Sy.value++}function dl(e){cu.value||(jr.push({id:QJ++,ts:Date.now(),...e}),jr.length>iC&&jr.splice(0,jr.length-iC),Sy.value++)}function Uv(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const s=e;return YJ.test(s)?`[base64-like, ${s.length} chars omitted]`:s.length>i1?`${s.slice(0,i1)}… [+${s.length-i1} chars]`:s}if(n!=="object")return String(e);if(t>=KJ)return"[max depth]";if(Array.isArray(e)){const s=e.slice(0,r1).map(i=>Uv(i,t+1));return e.length>r1&&s.push(`[+${e.length-r1} more items]`),s}const o={};for(const[s,i]of Object.entries(e))o[s]=GJ.test(s)?"[redacted]":Uv(i,t+1);return o}function ia(e){if(e===void 0)return;const t=Uv(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>s1)return{_truncated:`detail JSON was ${n.length} chars; first ${s1} kept`,preview:n.slice(0,s1)}}catch{return"[unserializable detail]"}return t}function a1(e){_i()&&dl({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:ia(e.body)}})}function wf(e){if(!_i())return;const t=e.code!==0;dl({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:ia(e.data)}})}function nu(e){_i()&&dl({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 $a(e,t){_i()&&dl({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:ia(t)})}function JJ(e){if(!_i())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;dl({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:ia(e)})}function eee(e){if(!_i())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);dl({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:ia(t.payload)})}const tee={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function c1(e,t,n){_i()&&dl({source:"client",kind:`client:${e}`,label:`${tee[e]} ${t}`,detail:ia(n)})}function Ji(e,t){_i()&&dl({source:"client",kind:"client:event",label:`· ${e}`,detail:ia(t)})}let rC=!1;function nee(){if(!(rC||!_i())){rC=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{c1("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;c1("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{c1(e,n.map(oee).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function oee(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 OM(e=jr){if(typeof document>"u")return;const t=new Blob([see(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}function see(e=jr){return e.map(t=>JSON.stringify(t)).join(`
253
+ `)}const Cy="kimi-web.server-credential",iee="token";let nd;const qv=new Set;function ree(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(iee);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 lee(){try{return globalThis.sessionStorage?.getItem(Cy)??void 0}catch{return}}function aee(){const e=ree();return e?(DM(e),!0):(nd=lee(),nd!==void 0)}function PM(){return nd}function DM(e){nd=e;try{globalThis.sessionStorage?.setItem(Cy,e)}catch{}}function cee(){nd=void 0;try{globalThis.sessionStorage?.removeItem(Cy)}catch{}}function uee(e){return qv.add(e),()=>{qv.delete(e)}}function dee(){cee();for(const e of qv)try{e()}catch{}}const Ba=3e4,BM="0123456789ABCDEFGHJKMNPQRSTVWXYZ",lC=500,fee=40101;function u1(){try{return AbortSignal.timeout(Ba)}catch{return}}function hee(e,t){let n="",o=e;for(let s=0;s<t;s++)n=BM[o%32]+n,o=Math.floor(o/32);return n}function pee(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=>BM[n%32]).join("")}function d1(){return`${hee(Date.now(),10)}${pee(16)}`}function mee(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 aC(e){try{const t=await e.text();return t?t.length>lC?`${t.slice(0,lC)}...`:t:void 0}catch{return}}class gee{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=gu(this.origin,t),o=d1(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();a1({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:u1()})}catch(a){throw nu({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new Da({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:Ba,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return wf({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),wf({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 Vf({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 postForm(t,n){const o=gu(this.origin,t),s=d1(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();a1({method:"POST",path:t,url:o,requestId:s,body:mee(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:u1()})}catch(u){throw nu({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new Da({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Ba,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw nu({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new Da({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Ba,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await aC(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(wf({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 Vf({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=gu(this.origin,n);if(s){const p=new URLSearchParams;for(const[m,w]of Object.entries(s))w!==void 0&&p.set(m,String(w));const h=p.toString();h&&(r=`${r}?${h}`)}const l=d1(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();a1({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:u1()})}catch(p){throw nu({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:p}),new Da({message:`Network error calling ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Ba,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(p){throw nu({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:p}),new Da({message:`Failed to parse JSON response from ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Ba,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await aC(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(wf({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 Vf({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=PM();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===fee)&&dee()}}const vee="kimi-code.bearer.",yee=3e4;class kee{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(),$a("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=PM(),n=t!==void 0?[`${vee}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{$a("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(s.data));eee(i),this.handleFrame(i)}catch(i){$a("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{$a("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{$a("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,$a("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=Sf(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(Sf(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(Sf(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,yee),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=Sf(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=jJ(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)),JJ(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Sf(e,t){return`${e}\0${t}`}function f1(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 cC(e){return e==="auto_compact"||e==="manual_compact"}class bee{http;config;constructor(t){this.config=t,this.http=new gee(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}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?mJ(t.status):void 0,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(hi),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 hi(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return hi(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 hi(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 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 hi(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(Hv),hasMore:s.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:hi(n.session),messages:n.messages.items.map(Hv),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(o=>({toolCallId:o.tool_call_id,name:o.name,args:o.args,description:o.description,lastProgress:o.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(LM),pendingQuestions:n.pending_questions.map(NM)}}async submitPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,vJ(n));return{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}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 hi(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 hi(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(hi)}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)}`,yJ(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)}`,wJ(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(zv)}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 zv(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(f1)}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 f1(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return f1(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(QS)])):void 0;return{items:s.items.map(QS),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 gu(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(Iu)}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 Iu(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 Iu(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(xJ)}async listProviders(){return(await this.http.get("/providers")).items.map(XS)}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 XS(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 h1(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return h1(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return h1(t)}async getConfig(){const t=await this.http.get("/config");return Wv(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 Wv(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{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,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 gu(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=q8(this.config.serverHttpUrl,this.config.clientId),o=zJ(),s=new kee(n,this.config.clientId,{onWireEvent:i=>{const r=AJ(i),l=MJ(i),a=CJ(i);a.type==="historyCompacted"&&!cC(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)f.type==="historyCompacted"&&!cC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},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 h1(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 uC;function ht(){return uC??=new bee(F8()),uC}const _ee=["src","controls","muted"],wee=["src","alt"],p1=je({__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=X(t.fileId?"":t.url),o=X(null),s=X(!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 ht().getFileBlob(t.fileId),p=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(p);return}i=p,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Ve(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),Sn(()=>{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}),so(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(_(),I("video",{key:0,ref_key:"mediaEl",ref:o,class:De(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,_ee)):(_(),I("img",{key:1,ref_key:"mediaEl",ref:o,class:De(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,wee))}}),See=["aria-label"],Cee=120,xee=60,Aee=je({__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*Cee}ms`,"--moon-frame-fast-delay":`${o*xee}ms`}}return(o,s)=>(_(),I("span",{class:De(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(_(),I(Pe,null,nt(t,(i,r)=>C("span",{key:i,class:"ui-moon__frame",style:en(n(r)),"aria-hidden":"true"},R(i),5)),64))],10,See))}}),FM=ut(Aee,[["__scopeId","data-v-a6b7ec07"]]),Mee={class:"chat"},Tee={key:0,class:"chat-loading"},Eee={class:"chat-loading-text"},Iee={key:1,class:"chat-empty"},$ee={key:1,class:"top-sentinel-text"},Lee={key:0,class:"u-turn"},Nee=["data-turn-id"],Ree={key:0,class:"u-imgs"},Oee=["aria-label","onClick"],Pee={key:1,class:"skill-act"},Dee={class:"skill-act-head"},Bee={key:0,class:"skill-act-args"},Fee={key:2,class:"skill-act"},Hee={class:"skill-act-head"},zee={key:0,class:"skill-act-args"},Wee={key:3,class:"u-text"},Uee={key:0,class:"u-meta"},qee=["aria-label","onClick"],jee=["aria-label","onClick"],Vee=["data-turn-id"],Kee=["onClick"],Gee={class:"cd-view"},Yee={key:1,class:"cd-label"},Qee=["data-turn-id"],Xee={key:1,class:"msg"},Zee={key:0,class:"a-msg-ft"},Jee={key:0,class:"a-duration"},ete=["aria-label","onClick"],tte={key:4,class:"sending-placeholder"},nte={key:5,class:"q-stack"},ote={class:"q-head"},ste={class:"q-title"},ite={class:"q-hint"},rte=["onDragover","onDrop"],lte={class:"u-bub q-bub"},ate=["title","onDragstart"],cte=["title","onClick"],ute={key:0,class:"u-text q-text"},dte={key:1,class:"q-text q-text-placeholder"},fte={key:0,class:"q-imgs"},hte={key:1,class:"q-tag q-tag-next"},pte={key:2,class:"q-tag q-tag-idx"},mte=["aria-label","onClick"],gte=2500,vte=je({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},running:{type:Boolean,default:!1},sending:{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}=Tt(),{confirm:s}=cl();In(()=>{q!==null&&(clearTimeout(q),q=null),E!==null&&(clearTimeout(E),E=null),T!==null&&(clearTimeout(T),T=null)});const i=e,r=X(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(ee=>{ee[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))}Sn(a),In(()=>{l?.disconnect(),l=null}),Ve(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{gt().then(a)});const c=B(()=>{if(!i.running||i.turns.length===0)return null;const ee=i.turns.at(-1);return ee.role==="assistant"?ee.id:null}),u=B(()=>i.sending||i.running),d=n,f=X(null),p=X(null);function h(ee){return(ee.attachments?.length??0)>0}function m(ee){d("editQueued",ee)}function w(ee,ye){if(f.value=ee,!ye.dataTransfer)return;ye.dataTransfer.effectAllowed="move",ye.dataTransfer.setData("text/plain",String(ee));const xe=ye.currentTarget?.closest(".q-turn");xe&&ye.dataTransfer.setDragImage(xe,24,24)}function k(ee,ye){if(f.value===null)return;ye.preventDefault(),ye.dataTransfer&&(ye.dataTransfer.dropEffect="move");const xe=ye.currentTarget.getBoundingClientRect(),Xe=ye.clientY<xe.top+xe.height/2?"before":"after";p.value={index:ee,position:Xe}}function g(ee,ye){ye.preventDefault();const xe=f.value,Xe=p.value?.position??"before";if(f.value=null,p.value=null,xe===null)return;let me=Xe==="before"?ee:ee+1;xe<me&&(me-=1),xe!==me&&d("reorderQueue",{from:xe,to:me})}function v(){f.value=null,p.value=null}const y=B(()=>{for(let ee=i.turns.length-1;ee>=0;ee--)if(i.turns[ee].role==="user")return i.turns[ee].id;return null});function M(ee){return ee.role==="user"&&ee.id===y.value&&!i.running&&!i.sending&&!ee.skillActivation&&!ee.pluginCommand}function O(ee){const ye=ee.compaction,xe=ye?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof ye?.tokensBefore=="number"&&typeof ye?.tokensAfter=="number"?xe+o("conversation.compactedTokens",{before:J2(ye.tokensBefore),after:J2(ye.tokensAfter)}):xe}const L=X(null),b=X(null);let T=null;async function $(ee){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&N(ee)}function N(ee){b.value===null&&(b.value=ee.id,d("editMessage",{text:ee.text,images:ee.images}),T=setTimeout(()=>{T=null,b.value=null},gte))}Ve(()=>i.turns,ee=>{b.value!==null&&(ee.some(ye=>ye.id===b.value)||(b.value=null,T!==null&&(clearTimeout(T),T=null)))},{flush:"post"});const S=X(!1);let E=null;function P(){if(i.turns.length===0)return;const ee=[];for(const xe of i.turns){if(xe.role==="compaction"||xe.role==="cron")continue;const Xe=xe.role==="user"?"User":"Assistant",me=iF(xe);me.trim()&&ee.push(`**${Xe}**
254
+
255
+ ${me}`)}const ye=ee.join(`
256
+
257
+ ---
258
+
259
+ `);Go(ye).then(xe=>{xe&&(S.value=!0,d("copyConversationCopied"),E!==null&&clearTimeout(E),E=setTimeout(()=>{E=null,S.value=!1},2e3))}).catch(()=>{})}function D(ee){const ye=[];for(let xe=ee;xe>=0;xe--){const Xe=i.turns[xe];if(!Xe||Xe.role!=="assistant")break;ye.unshift(Xe)}return ye}function F(ee){return D(ee).map(ye=>sF(ye)).filter(Boolean).join(`
260
+
261
+ `)}function W(){for(let ee=i.turns.length-1;ee>=0;ee-=1)if(i.turns[ee]?.role==="assistant")return F(ee);return""}function K(){const ee=W();ee.trim()&&Go(ee).then(ye=>{ye&&(S.value=!0,d("copyConversationCopied"),E!==null&&clearTimeout(E),E=setTimeout(()=>{E=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:P,copyFinalSummary:K});function Y(ee){const ye=i.turns[ee];if(!ye||ye.role!=="assistant")return!1;const xe=i.turns[ee+1];return!xe||xe.role!=="assistant"}let q=null;function ae(ee){const ye=i.turns[ee];if(!ye)return;const xe=F(ee);xe.trim()&&Go(xe).then(Xe=>{Xe&&(L.value=ye.id,q!==null&&clearTimeout(q),q=setTimeout(()=>{q=null,L.value=null},1400))}).catch(()=>{})}function ce(ee){const ye=ee.text;ye.trim()&&Go(ye).then(xe=>{xe&&(L.value=ee.id,q!==null&&clearTimeout(q),q=setTimeout(()=>{q=null,L.value=null},1400))}).catch(()=>{})}function ne(ee){return{kind:"image",url:ee.url,path:ee.alt,fileId:ee.fileId}}function Q(ee,ye){return ee.id!==c.value?!1:ye.sourceIndex===wp(ee).length-1}return(ee,ye)=>(_(),I("div",Mee,[e.sessionLoading?(_(),I("div",Tee,[se(ai,{size:"sm"}),C("span",Eee,R(x(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(_(),I("div",Iee)):re("",!0),e.hasMoreMessages||e.loadingMore?(_(),I("div",{key:2,ref_key:"topSentinelRef",ref:r,class:De(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(_(),I("span",$ee,[se(ai,{size:"sm"}),qe(" "+R(x(o)("conversation.loadingOlder")),1)])):(_(),I("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:ye[0]||(ye[0]=xe=>d("loadOlderMessages"))},R(x(o)("conversation.loadOlder")),1))],2)):re("",!0),(_(!0),I(Pe,null,nt(e.turns,(xe,Xe)=>(_(),I(Pe,{key:xe.id},[xe.role==="user"?(_(),I("div",Lee,[C("div",{class:De(["u-bub turn-anchor",{undoing:b.value===xe.id}]),"data-turn-id":xe.id},[xe.images&&xe.images.length>0?(_(),I("div",Ree,[(_(!0),I(Pe,null,nt(xe.images,(me,G)=>(_(),I(Pe,{key:G},[me.kind==="video"?(_(),ke(p1,{key:0,url:me.url,kind:"video","file-id":me.fileId,"media-class":"u-img"},null,8,["url","file-id"])):(_(),I("button",{key:1,type:"button",class:"u-img-btn","aria-label":x(o)("filePreview.enlargeImage"),onClick:ie=>d("openMedia",ne(me))},[se(p1,{url:me.url,kind:"image",alt:me.alt,"file-id":me.fileId,"media-class":"u-img"},null,8,["url","alt","file-id"])],8,Oee))],64))),128))])):re("",!0),xe.skillActivation?(_(),I("div",Pee,[C("div",Dee,[ye[9]||(ye[9]=C("span",{class:"skill-act-arrow"},"▶",-1)),C("span",null,R(x(o)("conversation.activatedSkill",{name:xe.skillActivation.name})),1)]),xe.skillActivation.args?(_(),I("div",Bee,R(xe.skillActivation.args),1)):re("",!0)])):xe.pluginCommand?(_(),I("div",Fee,[C("div",Hee,[ye[10]||(ye[10]=C("span",{class:"skill-act-arrow"},"▶",-1)),C("span",null,"/"+R(xe.pluginCommand.pluginId)+":"+R(xe.pluginCommand.commandName),1)]),xe.pluginCommand.args?(_(),I("div",zee,R(xe.pluginCommand.args),1)):re("",!0)])):(_(),I("div",Wee,R(xe.text),1))],10,Nee),xe.createdAt||M(xe)?(_(),I("div",Uee,[M(xe)?(_(),I("div",{key:0,class:De(["u-edit-wrap",{undoing:b.value===xe.id}])},[C("button",{type:"button",class:"u-edit","aria-label":x(o)("conversation.undoTooltip"),onClick:me=>$(xe)},[se(Qe,{name:"undo",size:"sm"})],8,qee)],2)):re("",!0),xe.text.trim().length>0?(_(),I("button",{key:1,type:"button",class:"u-copy","aria-label":x(o)("filePreview.copy"),onClick:kt(me=>ce(xe),["stop"])},[L.value!==xe.id?(_(),ke(Qe,{key:0,name:"copy",size:"sm"})):(_(),ke(Qe,{key:1,name:"check",size:"sm"}))],8,jee)):re("",!0),xe.createdAt?(_(),ke(IM,{key:2,time:xe.createdAt},null,8,["time"])):re("",!0)])):re("",!0)])):xe.role==="compaction"?(_(),I("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":xe.id,role:"separator"},[ye[11]||(ye[11]=C("span",{class:"cd-line","aria-hidden":"true"},null,-1)),xe.text?(_(),I("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:me=>d("openCompaction",{turnId:xe.id})},[C("span",null,R(O(xe)),1),C("span",Gee,R(x(o)("conversation.viewSummary")),1)],8,Kee)):(_(),I("span",Yee,R(O(xe)),1)),ye[12]||(ye[12]=C("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Vee)):xe.role==="cron"?(_(),ke(pJ,{key:2,text:xe.text,cron:xe.cron,"turn-id":xe.id,"created-at":xe.createdAt},null,8,["text","cron","turn-id","created-at"])):(_(),I("div",{key:3,class:"a-msg turn-anchor","data-turn-id":xe.id},[(_(!0),I(Pe,null,nt(x(oF)(xe),(me,G)=>(_(),I(Pe,{key:x(rF)(me,G)},[me.kind==="thinking"?(_(),ke(KZ,{key:0,text:me.thinking,mobile:"",streaming:Q(xe,me),onOpen:ie=>d("openThinking",{turnId:xe.id,blockIndex:me.sourceIndex})},null,8,["text","streaming","onOpen"])):me.kind==="text"&&me.text?(_(),I("div",Xee,[se(Wp,{text:me.text,streaming:Q(xe,me),"open-file":ie=>d("openFile",ie)},null,8,["text","streaming","open-file"])])):me.kind==="tool-stack"?(_(),ke(hF,{key:2,tools:me.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:ye[1]||(ye[1]=ie=>d("openMedia",ie)),onOpenFile:ye[2]||(ye[2]=ie=>d("openFile",ie)),onOpenToolDiff:ye[3]||(ye[3]=ie=>d("openToolDiff",ie)),onOpenAgent:ye[4]||(ye[4]=ie=>d("openAgent",ie))},null,8,["tools","tool-diff-panel"])):me.kind==="tool"?(_(),ke(G4,{key:3,tool:me.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:ye[5]||(ye[5]=ie=>d("openMedia",ie)),onOpenFile:ye[6]||(ye[6]=ie=>d("openFile",ie)),onOpenToolDiff:ye[7]||(ye[7]=ie=>d("openToolDiff",ie)),onOpenAgent:ye[8]||(ye[8]=ie=>d("openAgent",ie))},null,8,["tool","tool-diff-panel"])):re("",!0)],64))),128)),xe.id!==c.value&&Y(Xe)&&(F(Xe).trim().length>0||xe.durationMs!==void 0)?(_(),I("div",Zee,[se(Kt,{text:`${xe.durationMs} ms`},{default:we(()=>[xe.durationMs!==void 0?(_(),I("span",Jee,R(x(eF)(xe.durationMs)),1)):re("",!0)]),_:2},1032,["text"]),F(Xe).trim().length>0?(_(),I("button",{key:0,class:"a-cpbtn","aria-label":x(o)("filePreview.copy"),onClick:me=>ae(Xe)},[L.value!==xe.id?(_(),ke(Qe,{key:0,name:"copy",size:"sm"})):(_(),ke(Qe,{key:1,name:"check",size:"sm"}))],8,ete)):re("",!0)])):re("",!0)],8,Qee))],64))),128)),e.compaction?(_(),ke(ZZ,{key:3,label:x(o)("conversation.compacting")},null,8,["label"])):re("",!0),u.value?(_(),I("div",tte,[se(FM,{fast:e.fastMoon},null,8,["fast"])])):re("",!0),e.queued.length>0?(_(),I("div",nte,[C("div",ote,[C("span",ste,[se(Qe,{name:"mail",size:"sm"}),qe(" "+R(x(o)("composer.queueLabel"))+" · ",1),C("b",null,R(e.queued.length),1)]),C("span",ite,R(x(o)("composer.queueAutoDrain")),1)]),(_(!0),I(Pe,null,nt(e.queued,(xe,Xe)=>(_(),I("div",{key:Xe,class:De(["u-turn q-turn",{"q-dragging":f.value===Xe,"drop-before":p.value?.index===Xe&&p.value.position==="before","drop-after":p.value?.index===Xe&&p.value.position==="after"}]),onDragover:me=>k(Xe,me),onDrop:me=>g(Xe,me)},[C("div",lte,[C("span",{class:"q-grip",title:x(o)("composer.queueDragTitle"),draggable:"true",onDragstart:me=>w(Xe,me),onDragend:v},[se(Qe,{name:"grip",size:"sm"})],40,ate),C("button",{type:"button",class:"q-body",title:x(o)("composer.editQueued"),onClick:me=>m(Xe)},[xe.text?(_(),I("span",ute,R(xe.text),1)):(_(),I("span",dte,[se(Qe,{name:"image",size:"sm"}),qe(" "+R(x(o)("composer.queuedImageOnly",{n:xe.attachments?.length??0})),1)]))],8,cte),h(xe)?(_(),I("div",fte,[(_(!0),I(Pe,null,nt(xe.attachments,(me,G)=>(_(),ke(p1,{key:G,url:me.url,kind:me.kind,"file-id":me.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))),128))])):re("",!0),Xe===0?(_(),I("span",hte,R(x(o)("composer.queueNext")),1)):(_(),I("span",pte,"#"+R(Xe+1),1)),C("button",{type:"button",class:"q-rm","aria-label":x(o)("composer.remove"),onClick:kt(me=>d("unqueue",Xe),["stop"])},[se(Qe,{name:"close",size:"sm"})],8,mte)])],42,rte))),128))])):re("",!0)]))}}),HM=ut(vte,[["__scopeId","data-v-923f3347"]]),yte={class:"ch-id"},kte={key:0,class:"ch-ws"},bte={key:1,class:"ch-sep"},_te=["onKeydown"],wte={class:"ch-ses"},Ste={key:0,class:"ch-pill ch-sync-pill"},Cte={key:0,class:"ch-ahead"},xte={key:1,class:"ch-behind"},Ate={key:1,class:"ch-pill ch-diff-pill"},Mte={key:0,class:"ch-add"},Tte={key:1,class:"ch-del"},Ete=je({__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"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:o}=cl(),s=e,i=t,r=B(()=>s.ahead??0),l=B(()=>s.behind??0),a=B(()=>s.gitDiffStats?.totalAdditions??0),c=B(()=>s.gitDiffStats?.totalDeletions??0),u=B(()=>a.value>0||c.value>0),d=X(!1),f=X(null),p=X(null),h=X({});function m(D){const F=D.target;p.value?.el?.contains(F)||f.value?.el?.contains(F)||g()}function w(){g()}async function k(D){if(D.stopPropagation(),d.value){g();return}d.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",w),await gt();const F=f.value?.el,W=p.value?.el;if(!F||!W)return;const K=F.getBoundingClientRect(),Y=4,q=8,ae=W.offsetWidth,ce=W.offsetHeight;let ne=K.bottom+Y;ne+ce>window.innerHeight-q&&(ne=Math.max(q,K.top-ce-Y));let Q=K.left;Q+ae>window.innerWidth-q&&(Q=Math.max(q,K.right-ae)),h.value={top:`${Math.round(ne)}px`,left:`${Math.round(Q)}px`}}function g(){d.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",w)}In(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",w)});function v(){i("copyAll"),g()}function y(){i("copyFinalSummary"),g()}const M=X(!1);function O(){s.sessionId&&Go(s.sessionId).then(D=>{D&&(M.value=!0,setTimeout(()=>{M.value=!1},1200))})}const L=X(!1),b=X(""),T=X(null);async function $(){if(g(),!!s.sessionId){L.value=!0,b.value=s.sessionTitle??"",await gt();try{T.value?.focus(),T.value?.select()}catch{}}}function N(){const D=b.value.trim();D&&s.sessionId&&D!==(s.sessionTitle??"").trim()&&i("renameSession",s.sessionId,D),L.value=!1}function S(){L.value=!1}function E(){s.sessionId&&(g(),i("forkSession",s.sessionId))}async function P(){s.sessionId&&(g(),await o({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",s.sessionId))}return(D,F)=>(_(),I("header",{class:De(["chat-header",{"macos-desktop":x(W4)}])},[C("div",yte,[e.workspaceName?(_(),I("span",kte,R(e.workspaceName),1)):re("",!0),e.workspaceName&&e.sessionTitle?(_(),I("span",bte,"/")):re("",!0),L.value?An((_(),I("input",{key:2,ref_key:"renameInputRef",ref:T,"onUpdate:modelValue":F[0]||(F[0]=W=>b.value=W),class:"ch-rename",type:"text",onKeydown:[gi(kt(N,["stop"]),["enter"]),gi(kt(S,["stop"]),["esc"])],onBlur:N,onClick:F[1]||(F[1]=kt(()=>{},["stop"]))},null,40,_te)),[[us,b.value]]):e.sessionTitle?(_(),ke(Kt,{key:3,text:e.sessionTitle},{default:we(()=>[C("span",wte,R(e.sessionTitle),1)]),_:1},8,["text"])):re("",!0)]),se(Mn,{ref_key:"kebabRef",ref:f,class:De(["ch-act-more",{open:d.value}]),label:x(n)("header.options"),"aria-expanded":d.value,"aria-haspopup":"menu",onClick:F[2]||(F[2]=kt(W=>k(W),["stop"]))},{default:we(()=>[se(Qe,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),d.value?(_(),ke(Ul,{key:0,ref_key:"menuRef",ref:p,class:"ch-menu",style:en(h.value),onClick:F[3]||(F[3]=kt(()=>{},["stop"]))},{default:we(()=>[se(_n,{onClick:v},{default:we(()=>[qe(R(e.copied?x(n)("header.copied"):x(n)("header.copyAll")),1)]),_:1}),se(_n,{onClick:y},{default:we(()=>[qe(R(x(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(_(),I(Pe,{key:0},[se(_n,{separator:""}),se(_n,{onClick:O},{default:we(()=>[qe(R(M.value?x(n)("header.copied"):x(n)("header.copySessionId")),1)]),_:1}),se(_n,{onClick:$},{default:we(()=>[qe(R(x(n)("header.renameSession")),1)]),_:1}),se(_n,{onClick:E},{default:we(()=>[qe(R(x(n)("header.forkSession")),1)]),_:1}),se(_n,{danger:"",onClick:P},{default:we(()=>[qe(R(x(n)("header.archiveSession")),1)]),_:1})],64)):re("",!0)]),_:1},8,["style"])):re("",!0),F[6]||(F[6]=C("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(_(),I("button",{key:1,type:"button",class:"ch-git",onClick:F[4]||(F[4]=W=>i("openChanges"))},[C("span",{class:De(["ch-branch",{"ch-detached":!e.branch}])},R(e.branch||x(n)("header.detached")),3),r.value>0||l.value>0?(_(),I("span",Ste,[r.value>0?(_(),I("span",Cte,"↑"+R(r.value),1)):re("",!0),l.value>0?(_(),I("span",xte,"↓"+R(l.value),1)):re("",!0)])):re("",!0),u.value?(_(),I("span",Ate,[a.value>0?(_(),I("span",Mte,"+"+R(a.value),1)):re("",!0),c.value>0?(_(),I("span",Tte,"-"+R(c.value),1)):re("",!0)])):re("",!0)])):re("",!0),e.pr?(_(),I("button",{key:2,type:"button",class:De(["ch-pill ch-pr",`pr-${e.pr.state}`]),onClick:F[5]||(F[5]=W=>e.pr&&i("openPr",e.pr.url))},[se(Qe,{name:"git-pull-request",size:"sm"}),C("span",null,"PR #"+R(e.pr.number)+" · "+R(e.pr.state),1)],2)):re("",!0)],2))}}),Ite=ut(Ete,[["__scopeId","data-v-39760f19"]]),$te={key:0,class:"slash-menu",role:"listbox"},Lte=["aria-selected","onMouseenter","onMousedown"],Nte={class:"slash-name"},Rte={class:"slash-desc"},Ote=je({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X([]);return Ve(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(_(),I("div",$te,[(_(!0),I(Pe,null,nt(e.items,(a,c)=>(_(),I("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:De(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:kt(u=>s("select",a),["prevent"])},[C("span",Nte,R(a.name),1),C("span",Rte,R(a.isSkill?a.desc:x(n)(a.desc)),1)],42,Lte))),128))])):re("",!0)}}),Pte=ut(Ote,[["__scopeId","data-v-f60b70d9"]]),Dte={class:"mention-menu",role:"listbox"},Bte={key:0,class:"mention-state dim"},Fte={key:1,class:"mention-state dim"},Hte=["aria-selected","onMouseenter","onMousedown"],zte=["innerHTML"],Wte={class:"mention-name"},Ute={class:"mention-path"},qte=je({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=Pa("folder","sm"),r=Pa("code","sm"),l=Pa("file-text","sm"),a=Pa("image","sm"),c=Pa("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 p(h){const m=h.path;if(m.endsWith("/"))return i;const w=h.name||m.split("/").pop()||m,k=w.lastIndexOf("."),g=k>0?w.slice(k+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(h,m)=>(_(),I("div",Dte,[n.loading?(_(),I("div",Bte,R(x(s)("mention.searching")),1)):n.items.length===0?(_(),I("div",Fte,R(x(s)("mention.noMatch")),1)):(_(!0),I(Pe,{key:2},nt(n.items,(w,k)=>(_(),I("div",{key:w.path,class:De(["mention-item",{active:k===n.activeIndex}]),role:"option","aria-selected":k===n.activeIndex,onMouseenter:g=>o("hover",k),onMousedown:kt(g=>o("select",w),["prevent"])},[C("span",{class:"mention-icon",innerHTML:p(w),"aria-hidden":"true"},null,8,zte),C("span",Wte,R(w.name),1),C("span",Ute,R(w.path),1)],42,Hte))),128))]))}}),jte=ut(qte,[["__scopeId","data-v-f4d6b958"]]),zM=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.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:"/status",desc:"commands.status.desc"}];function Vte(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 Uh="skill:";function Kte(e){return e.startsWith(Uh)?e.slice(Uh.length):e}function WM(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Uh}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...zM,...t]}function Gte(e,t=zM){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 vd(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 xy(e){return e?.supportEfforts??[]}function Yte(e){return e[Math.floor(e.length/2)]}function jv(e){if(vd(e)==="unsupported")return"off";const t=xy(e);return t.length>0?e?.defaultEffort??Yte(t):"on"}function Ay(e){const t=xy(e),n=vd(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Vv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function Qte(e){return e!=="off"}function Xl(e,t){if(e===void 0)return t;const n=vd(e);if(n==="unsupported")return"off";if(t==="off")return n==="always-on"?jv(e):"off";const o=xy(e);return o.length>0?o.includes(t)?t:jv(e):"on"}function My(e,t){return t==="off"?"off":t==="on"?jv(e):t}const qh=100;function Xte(e){const t=ud(Nt.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>qh?n.slice(-qh):n,s={[e]:o};return wc(Nt.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function Zte(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=X(Xte(s())),r=B(()=>i.value[s()??""]??[]);let l=-1,a="";function c(k){const g=s();if(l=-1,!g)return;const v=k.trim();if(!v)return;const y=i.value[g]??[];if(y.at(-1)===v)return;const M=[...y,v],O=M.length>qh?M.slice(-qh):M;i.value={...i.value,[g]:O},wc(Nt.inputHistory,i.value)}function u(){const k=n.value;return k?(k.selectionStart??0)===0:!1}function d(k){t.value=k,gt(()=>{const g=n.value;if(!g)return;o();const v=k.length;g.setSelectionRange(v,v)})}function f(){const k=r.value;if(k.length!==0){if(l===-1)a=t.value,l=k.length-1;else if(l>0)l-=1;else return;d(k[l])}}function p(){if(l===-1)return;const k=r.value;l<k.length-1?(l+=1,d(k[l])):(l=-1,d(a))}function h(){l=-1}function m(){return l!==-1}function w(){return r.value.length>0}return Ve(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:p,resetBrowsing:h,isBrowsing:m,hasHistory:w}}function Jte(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=X(!1),c=X([]),u=X(0);function d(){const p=t.value;p.startsWith("/")&&!p.includes(" ")?(c.value=Gte(p,WM(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(p){if(a.value=!1,p.acceptsInput){t.value=`${p.name} `,gt(()=>{const h=n.value;if(!h)return;const m=t.value.length;h.setSelectionRange(m,m),h.focus(),o()});return}t.value="",l?.(),r(p.name),i(p.name)}return{open:a,items:c,active:u,update:d,select:f}}function ene(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=X(!1),r=X([]),l=X(0),a=X(!1);let c=null;function u(){const p=t.value,h=n.value?.selectionStart??p.length;let m=h-1;for(;m>=0&&!/\s/.test(p[m]);)m--;m++;const w=p.slice(m,h);return w.startsWith("@")?{token:w.slice(1),start:m,end:h}:null}function d(){const p=u(),h=s();if(!p||!h){i.value=!1;return}const m=p.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await h(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(p){const h=u();if(!h)return;const m=t.value;t.value=m.slice(0,h.start)+p.path+m.slice(h.end),i.value=!1,gt(()=>{const w=n.value;if(!w)return;const k=h.start+p.path.length;w.setSelectionRange(k,k),w.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function tne(e){const{sessionId:t}=e;function n(c){return no(N2(c))??""}function o(c,u){const d=N2(c);u?io(d,u):pc(d)}const s=X(n(t())),i=X(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ve(s,c=>{gt(r),o(t(),c)}),Ve(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),gt(r))});function l(c){s.value=c,gt(()=>{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 nne(e){const{uploadImage:t,sessionId:n}=e,o=X({}),s=B(()=>o.value[n()??""]??[]),i=X(null),r=X(null),l=X(!1);let a=0;function c(){return`att_${++a}`}function u(N,S){o.value={...o.value,[N]:S}}function d(N){try{URL.revokeObjectURL(N.previewUrl)}catch{}}function f(N){return N.startsWith("image/")?"image":N.startsWith("video/")?"video":null}async function p(N){const S=t();if(!S)return;const E=n()??"",P=N.map(D=>({file:D,kind:f(D.type)})).filter(D=>D.kind!==null);if(P.length!==0)for(const{file:D,kind:F}of P){const W=c(),K=URL.createObjectURL(D),Y={localId:W,name:D.name,kind:F,previewUrl:K,uploading:!0};u(E,[...o.value[E]??[],Y]),S(D,D.name).then(q=>{const ae=o.value[E]??[];u(E,ae.map(ce=>ce.localId===W?{...ce,uploading:!1,fileId:q?.fileId,error:q===null}:ce))}).catch(()=>{const q=o.value[E]??[];u(E,q.map(ae=>ae.localId===W?{...ae,uploading:!1,error:!0}:ae))})}}function h(N){const S=n()??"",E=o.value[S]??[],P=E.find(D=>D.localId===N);i.value?.localId===N&&(i.value=null),P&&d(P),u(S,E.filter(D=>D.localId!==N))}function m(N){i.value=N}function w(){i.value=null}function k(){r.value?.click()}function g(N){const S=N.target,E=Array.from(S.files??[]);p(E),S.value=""}function v(N){if(!t())return;const S=N.clipboardData;if(!S)return;const E=[],P=new Set,D=(F,W)=>{const K=`${F.size}:${F.type}:${W}`;if(P.has(K))return;P.add(K);const Y=F.type.split("/")[1]??"png",q=W.includes(".")?W:`paste-${Date.now()}.${Y}`;E.push(F instanceof File?F:new File([F],q,{type:F.type}))};for(const F of Array.from(S.items))if(F.kind==="file"&&f(F.type)){const W=F.getAsFile();W&&D(W,W.name||`paste-${Date.now()}.${F.type.split("/")[1]??"png"}`)}for(const F of Array.from(S.files))f(F.type)&&D(F,F.name);E.length!==0&&(N.preventDefault(),p(E))}function y(N){!t()||!Array.from(N.dataTransfer?.items??[]).some(E=>E.kind==="file")||(N.preventDefault(),l.value=!0)}function M(){l.value=!1}function O(N){if(l.value=!1,!t())return;N.preventDefault();const S=Array.from(N.dataTransfer?.files??[]);p(S)}function L(){const N=n()??"";for(const S of o.value[N]??[])d(S);u(N,[])}function b(N,S,E){const P=o.value[N]??[];P.some(D=>D.localId===S)&&u(N,P.map(D=>D.localId===S?{...D,...E}:D))}function T(N){return fetch(N).then(S=>{if(!S.ok)throw new Error(`fetch failed: ${S.status}`);return S.blob()})}function $(N){const S=n()??"";for(const E of o.value[S]??[])d(E);u(S,[]);for(const E of N){const P=c(),D=/^data:/i.test(E.url),F=/^blob:/i.test(E.url),W=E.name??E.kind;if(E.fileId){const K={localId:P,name:W,kind:E.kind,previewUrl:E.url,uploading:!1,fileId:E.fileId};u(S,[...o.value[S]??[],K]),!D&&!F&&ht().getFileBlob(E.fileId).then(Y=>{const q=URL.createObjectURL(Y);if(!(o.value[S]??[]).some(ce=>ce.localId===P)){URL.revokeObjectURL(q);return}b(S,P,{previewUrl:q})}).catch(()=>{})}else{const K=t();if(!K)continue;const Y={localId:P,name:W,kind:E.kind,previewUrl:E.url,uploading:!0};u(S,[...o.value[S]??[],Y]),T(E.url).then(q=>{const ae=W.includes(".")?W:`${W}.${q.type.split("/")[1]??"bin"}`;return K(q,ae)}).then(q=>{if(q===null){const ae=o.value[S]??[];u(S,ae.filter(ce=>ce.localId!==P));return}b(S,P,{uploading:!1,fileId:q.fileId})}).catch(()=>{const q=o.value[S]??[];u(S,q.filter(ae=>ae.localId!==P))})}}}return Ve(n,()=>{i.value=null}),Sn(()=>{document.addEventListener("paste",v)}),In(()=>{document.removeEventListener("paste",v);for(const N of Object.values(o.value))for(const S of N)d(S);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:h,openAttachmentPreview:m,closeAttachmentPreview:w,openFilePicker:k,handleFileInputChange:g,handleDragOver:y,handleDragLeave:M,handleDrop:O,clearAfterSubmit:L,loadAttachments:$}}const one={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},sne=["stroke-dasharray","stroke-dashoffset"],m1=7,ine=je({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*m1;return(o,s)=>(_(),I("svg",one,[C("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:m1,fill:"none","stroke-width":"2.5"}),C("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:m1,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,sne)]))}}),rne=ut(ine,[["__scopeId","data-v-a364f1f1"]]),lne={key:0,class:"att-strip"},ane=["onClick"],cne=["src"],une=["src","alt"],dne={key:2,class:"att-video-badge","aria-hidden":"true"},fne={class:"att-name"},hne={class:"att-err-icon"},pne=["onClick"],mne={class:"att-lightbox-card"},gne=["src"],vne=["src","alt"],yne={class:"att-lightbox-name"},kne={class:"composer-card"},bne={class:"cin-wrap"},_ne={class:"input-row"},wne=["placeholder"],Sne=["aria-label"],Cne={class:"toolbar-left"},xne=["onKeydown"],Ane=["onClick"],Mne={class:"pd-check"},Tne={class:"pd-info"},Ene={class:"pd-desc"},Ine={class:"mode-label"},$ne={key:0,class:"mode-tag"},Lne={key:1,class:"mode-tag"},Nne={key:2,class:"mode-tag"},Rne={class:"mode-row-name"},One={class:"mode-row-name"},Pne={class:"mode-row-name"},Dne={key:0,class:"mode-row-actions"},Bne={class:"toolbar-right"},Fne=["aria-label"],Hne={class:"ctx-num"},zne=["onKeydown"],Wne={key:0,class:"think-suffix"},Une=["aria-label"],qne=["aria-label"],jne={key:0,class:"md-section"},Vne=["onClick"],Kne={class:"md-check"},Gne={class:"md-name"},Yne={class:"md-provider"},Qne={key:1,class:"md-divider"},Xne={key:2,class:"md-section"},Zne=["onClick"],Jne={class:"md-check"},eoe={class:"md-name"},toe={key:3,class:"md-divider"},noe={class:"md-name"},ooe={key:0,class:"md-note"},soe=["aria-label"],ioe=["disabled","onClick"],roe={class:"md-name"},dC=36,loe=je({__name:"Composer",props:{running:{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},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=B(()=>o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=Tt(),{text:l,textareaRef:a,autosize:c,loadForEdit:u,clearDraft:d}=tne({sessionId:()=>o.sessionId}),f=X(!1);function p(){f.value=!f.value,gt(()=>{c(),k(),a.value?.focus()})}function h(){f.value&&(f.value=!1,gt(c))}function m(Ye){if(typeof getComputedStyle>"u")return dC;const tt=Number.parseFloat(getComputedStyle(Ye).minHeight);return Number.isFinite(tt)&&tt>0?tt:dC}const w=X(!1);function k(){const Ye=a.value;w.value=!!Ye&&Ye.scrollHeight>m(Ye)}Ve(l,()=>{gt(k)}),Ve(()=>o.sessionId,()=>{f.value=!1});const g=Zte({text:l,textareaRef:a,autosize:c,sessionId:()=>o.sessionId}),{open:v,items:y,active:M,update:O,select:L}=Jte({text:l,textareaRef:a,autosize:c,skills:()=>o.skills,emitCommand:Ye=>i("command",Ye),historyPush:Ye=>g.push(Ye),clearDraft:d}),{open:b,items:T,active:$,loading:N,update:S,select:E}=ene({text:l,textareaRef:a,autosize:c,searchFiles:()=>o.searchFiles});function P(){g.resetBrowsing(),O(),S()}const{attachments:D,previewAttachment:F,fileInputRef:W,isDragOver:K,removeAttachment:Y,openAttachmentPreview:q,closeAttachmentPreview:ae,openFilePicker:ce,handleFileInputChange:ne,handleDragOver:Q,handleDragLeave:ee,handleDrop:ye,clearAfterSubmit:xe,loadAttachments:Xe}=nne({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});Sn(()=>{l.value&&gt(()=>{c(),k()})}),In(()=>{document.removeEventListener("mousedown",Mt),pe()});function me(){a.value?.focus({preventScroll:!0})}function G(Ye){Xe(Ye)}t({loadForEdit:u,loadAttachmentsForEdit:G,focus:me});function ie(){const Ye=l.value.trim();if(D.value.some(Ht=>Ht.uploading))return;const tt=D.value.filter(Ht=>!Ht.uploading&&!Ht.error&&Ht.fileId);if(!Ye&&tt.length===0)return;if(g.push(Ye),Ye){const Ht=Vte(Ye),js=Ht?WM(o.skills).some(wi=>wi.name===Ht.cmd||wi.name===`/${Uh}${Ht.cmd.slice(1)}`):!1;if(Ht&&js){l.value="",d(),v.value=!1,h(),i("command",Ht.arg?`${Ht.cmd} ${Ht.arg}`:Ht.cmd);return}}const st={text:Ye,attachments:tt.map(Ht=>({fileId:Ht.fileId,kind:Ht.kind}))};F.value=null,xe(),l.value="",d(),v.value=!1,b.value=!1,h(),i("submit",st)}function de(){if(!o.running||D.value.some(Ht=>Ht.uploading))return;const Ye=l.value.trim(),tt=D.value.filter(Ht=>!Ht.uploading&&!Ht.error&&Ht.fileId);if(!Ye&&tt.length===0&&o.queued.length===0)return;const st={text:Ye,attachments:tt.map(Ht=>({fileId:Ht.fileId,kind:Ht.kind}))};xe(),g.push(Ye),l.value="",d(),v.value=!1,b.value=!1,h(),i("steer",st)}let z=!1,Z=null;function pe(){Z!==null&&(clearTimeout(Z),Z=null)}function le(){pe(),z=!0}function he(){pe(),Z=setTimeout(()=>{Z=null,z=!1},0)}function U(Ye){return z||Ye.isComposing||Ye.keyCode===229}function J(Ye){if(!U(Ye)){if(Ye.key==="Escape"){if(Ee.value){Ye.preventDefault(),Ge();return}if(Le.value){Ye.preventDefault(),bt();return}}if(v.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),M.value=(M.value+1)%y.value.length;return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),M.value=(M.value-1+y.value.length)%y.value.length;return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const tt=y.value[M.value];tt&&L(tt);return}if(Ye.key==="Escape"){Ye.preventDefault(),v.value=!1;return}}if(b.value&&!N.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),$.value=($.value+1)%Math.max(1,T.value.length);return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),$.value=($.value-1+Math.max(1,T.value.length))%Math.max(1,T.value.length);return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const tt=T.value[$.value];tt&&E(tt);return}if(Ye.key==="Escape"){Ye.preventDefault(),b.value=!1;return}}if(Ye.key==="s"&&(Ye.ctrlKey||Ye.metaKey)&&!Ye.shiftKey&&!Ye.altKey){o.running&&(Ye.preventDefault(),de());return}if(!f.value&&!v.value&&!b.value&&!Ye.shiftKey&&!Ye.altKey&&!Ye.metaKey&&!Ye.ctrlKey){const tt=g.isBrowsing();if(Ye.key==="ArrowUp"&&g.hasHistory()&&(tt||g.caretAtTextStart())){Ye.preventDefault(),g.recallOlder();return}if(Ye.key==="ArrowDown"&&tt){Ye.preventDefault(),g.recallNewer();return}}if(Ye.key==="Enter"&&!Ye.shiftKey){if(f.value&&!(Ye.metaKey||Ye.ctrlKey))return;Ye.preventDefault(),ie()}}}const fe=B(()=>r("composer.send")),be=B(()=>!!o.uploadImage),Ee=X(!1),Le=X(!1),ue=X(null);function Ie(){Ee.value=!Ee.value,Ee.value?(Le.value=!1,Cn(),document.addEventListener("click",_t,!0)):document.removeEventListener("click",_t,!0)}function Ge(){Ee.value=!1,Le.value||document.removeEventListener("click",_t,!0)}function lt(){Le.value=!Le.value,Le.value?(Ee.value=!1,Cn(),document.addEventListener("click",_t,!0)):document.removeEventListener("click",_t,!0)}function bt(){Le.value=!1,Ee.value||document.removeEventListener("click",_t,!0)}function _t(Ye){ue.value&&!ue.value.contains(Ye.target)&&(Ge(),bt())}In(()=>{document.removeEventListener("click",_t,!0)});const $t=Ye=>`${Math.round(Ye/1e3)}k`,Bt=B(()=>{const Ye=o.status?.ctxMax??0;return Ye<=0?0:Math.min(100,Math.max(0,Math.round((o.status?.ctxUsed??0)/Ye*100)))}),yt=B(()=>{const Ye=(o.status?.ctxUsed??0).toLocaleString(),tt=(o.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ye,max:tt,pct:Bt.value})}),Gt=B(()=>Bt.value>=80),pn=B(()=>{const Ye=o.status?.modelId??o.status?.model??"";return o.models?.find(tt=>tt.id===Ye||tt.model===Ye||tt.displayName===o.status?.model)}),ro=B(()=>vd(pn.value)),Yt=B(()=>Ay(pn.value)),mn=B(()=>Xl(pn.value,o.thinking??"off")),zo=B(()=>{const Ye=Yt.value,tt=mn.value;return Ye.includes(tt)?tt:Ye.includes("on")?"on":Ye[0]??"off"}),ot=B(()=>ro.value==="always-on"?!0:ro.value==="unsupported"?!1:Qte(mn.value)),zn=B(()=>ro.value==="unsupported"||Yt.value.length<=1),lo=B(()=>{if(!ot.value)return"";const Ye=(pn.value?.supportEfforts?.length??0)>0,tt=mn.value;return Ye&&tt!=="on"?r("composer.thinkingSuffixEffort",{level:tt}):r("composer.thinkingSuffix")});function Gn(Ye){zn.value||i("setThinking",My(pn.value,Ye))}const Yn=B(()=>o.planMode===!0),Zt=B(()=>o.swarmMode===!0),Qn=B(()=>o.activationBadges?.goal!==null),Ke=B(()=>Qn.value||o.goalMode===!0),Ze=X(!1),Ft=X(null),sn=X(null),un=X({}),tn=B(()=>Yn.value||Zt.value||Ke.value);function Cn(){Ze.value=!1,document.removeEventListener("mousedown",Mt)}function Mt(Ye){const tt=Ye.target;Ft.value?.contains(tt)||sn.value?.contains(tt)||Cn()}function Xn(){if(Ze.value){Cn();return}Ge(),bt();const Ye=Ft.value?.getBoundingClientRect();Ye&&(un.value={left:`${Math.round(Ye.left)}px`,bottom:`${Math.round(window.innerHeight-Ye.top+8)}px`}),Ze.value=!0,setTimeout(()=>document.addEventListener("mousedown",Mt),0)}const Ut=[{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"}];function wo(Ye){i("setPermission",Ye),bt()}const To=B(()=>Ut.find(Ye=>Ye.mode===o.status?.permission)),xs=B(()=>To.value?r(To.value.labelKey):""),Wo=B(()=>pn.value?.provider??""),ds=B(()=>!Wo.value||!o.models?.length?[]:o.models.filter(Ye=>Ye.provider===Wo.value)),fs=B(()=>new Set(o.starredIds??[]));function Ot(Ye){return fs.value.has(Ye)}const Us=B(()=>o.models?.length?o.models.filter(Ye=>Ot(Ye.id)&&Ye.provider!==Wo.value):[]);function qs(Ye){i("selectModel",Ye),Ge()}return(Ye,tt)=>(_(),I("div",{class:De(["composer",{"drag-over":x(K),expanded:f.value}]),onDragover:tt[17]||(tt[17]=(...st)=>x(Q)&&x(Q)(...st)),onDragleave:tt[18]||(tt[18]=(...st)=>x(ee)&&x(ee)(...st)),onDrop:tt[19]||(tt[19]=(...st)=>x(ye)&&x(ye)(...st))},[x(D).length>0?(_(),I("div",lne,[(_(!0),I(Pe,null,nt(x(D),st=>(_(),I("div",{key:st.localId,class:De(["att-chip",{"att-error":st.error}])},[se(Kt,{text:x(r)("composer.previewAttachment",{name:st.name})},{default:we(()=>[C("button",{type:"button",class:"att-preview",onClick:Ht=>x(q)(st)},[st.kind==="video"?(_(),I("video",{key:0,class:"att-thumb",src:st.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,cne)):(_(),I("img",{key:1,class:"att-thumb",src:st.previewUrl,alt:st.name},null,8,une)),st.kind==="video"?(_(),I("span",dne,[se(Qe,{name:"play",size:"sm"})])):re("",!0)],8,ane)]),_:2},1032,["text"]),C("span",fne,R(st.name),1),st.uploading?(_(),ke(ai,{key:0,size:"sm",label:x(r)("composer.uploading")},null,8,["label"])):st.error?(_(),ke(Kt,{key:1,text:x(r)("composer.uploadFailed")},{default:we(()=>[C("span",hne,[se(Qe,{name:"info",size:"sm"})])]),_:1},8,["text"])):re("",!0),se(Kt,{text:x(r)("composer.removeNamed",{name:st.name})},{default:we(()=>[C("button",{class:"att-rm",onClick:Ht=>x(Y)(st.localId)},[se(Qe,{name:"close",size:"sm"})],8,pne)]),_:2},1032,["text"])],2))),128))])):re("",!0),x(F)?(_(),I("div",{key:1,class:"att-lightbox",onClick:tt[1]||(tt[1]=kt((...st)=>x(ae)&&x(ae)(...st),["self"]))},[C("div",mne,[se(Kt,{text:x(r)("model.close")},{default:we(()=>[C("button",{type:"button",class:"att-lightbox-close",onClick:tt[0]||(tt[0]=(...st)=>x(ae)&&x(ae)(...st))},"✕")]),_:1},8,["text"]),x(F).kind==="video"?(_(),I("video",{key:0,class:"att-lightbox-media",src:x(F).previewUrl,controls:"",playsinline:""},null,8,gne)):(_(),I("img",{key:1,class:"att-lightbox-media",src:x(F).previewUrl,alt:x(F).name},null,8,vne)),C("div",yne,R(x(F).name),1)])])):re("",!0),C("div",kne,[C("div",bne,[x(v)?(_(),ke(Pte,{key:0,items:x(y),"active-index":x(M),onSelect:x(L),onHover:tt[2]||(tt[2]=st=>M.value=st)},null,8,["items","active-index","onSelect"])):re("",!0),x(b)?(_(),ke(jte,{key:1,items:x(T),"active-index":x($),loading:x(N),onSelect:x(E),onHover:tt[3]||(tt[3]=st=>$.value=st)},null,8,["items","active-index","loading","onSelect"])):re("",!0),C("div",_ne,[An(C("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":tt[4]||(tt[4]=st=>oo(l)?l.value=st:null),class:"ph",placeholder:s.value,rows:"1",onKeydown:J,onCompositionstart:le,onCompositionend:he,onInput:P},null,40,wne),[[us,x(l)]]),f.value||w.value?(_(),I("button",{key:0,class:"expand-btn",type:"button","aria-label":f.value?x(r)("composer.collapseTitle"):x(r)("composer.expandTitle"),onClick:p},[f.value?(_(),ke(Qe,{key:0,name:"collapse",size:"sm"})):(_(),ke(Qe,{key:1,name:"expand",size:"sm"}))],8,Sne)):re("",!0)])]),be.value?(_(),I("input",{key:0,ref_key:"fileInputRef",ref:W,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:tt[5]||(tt[5]=(...st)=>x(ne)&&x(ne)(...st))},null,544)):re("",!0),C("div",{ref_key:"toolbarRef",ref:ue,class:"toolbar"},[C("div",Cne,[be.value?(_(),ke(Mn,{key:0,size:"md",label:x(r)("composer.attachImage"),onClick:x(ce)},{default:we(()=>[se(Qe,{name:"image"})]),_:1},8,["label","onClick"])):re("",!0),e.status?(_(),I("span",{key:1,class:De(["perm-pill",["perm-"+e.status.permission,{open:Le.value}]]),role:"button",tabindex:"0",onClick:kt(lt,["stop"]),onKeydown:[gi(lt,["enter"]),gi(kt(lt,["prevent"]),["space"])]},R(xs.value),43,xne)):re("",!0),Le.value&&e.status?(_(),I("div",{key:2,class:"perm-dropdown",role:"menu",onClick:tt[6]||(tt[6]=kt(()=>{},["stop"]))},[(_(),I(Pe,null,nt(Ut,st=>C("button",{key:st.mode,class:De(["pd-row",{"is-current":st.mode===e.status.permission}]),role:"menuitem",onClick:Ht=>wo(st.mode)},[C("span",Mne,[st.mode===e.status.permission?(_(),ke(Qe,{key:0,name:"check",size:"sm"})):re("",!0)]),C("span",Tne,[C("span",{class:"pd-name",style:en({color:st.color})},R(x(r)(st.labelKey)),5),C("span",Ene,R(x(r)(st.descKey)),1)])],10,Ane)),64))])):re("",!0),e.status?(_(),I("div",{key:3,ref_key:"modesRef",ref:Ft,class:"modes"},[C("button",{type:"button",class:De(["mode-pill",{on:tn.value,open:Ze.value}]),onClick:kt(Xn,["stop"])},[C("span",Ine,R(x(r)("status.modesLabel")),1),Yn.value?(_(),I("span",$ne,R(x(r)("status.planLabel")),1)):re("",!0),Zt.value?(_(),I("span",Lne,R(x(r)("status.swarmLabel")),1)):re("",!0),Ke.value?(_(),I("span",Nne,R(x(r)("status.goalLabel")),1)):re("",!0)],2),Ze.value?(_(),I("div",{key:0,ref_key:"modesMenuRef",ref:sn,class:"modes-menu",style:en(un.value)},[C("button",{type:"button",class:De(["mode-row",{on:Yn.value}]),onClick:tt[7]||(tt[7]=st=>i("togglePlan"))},[C("span",Rne,R(x(r)("status.planLabel")),1),C("span",{class:De(["mode-switch",{on:Yn.value}])},[...tt[20]||(tt[20]=[C("span",{class:"mode-knob"},null,-1)])],2)],2),C("button",{type:"button",class:De(["mode-row",{on:Zt.value}]),onClick:tt[8]||(tt[8]=st=>i("toggleSwarm"))},[C("span",One,R(x(r)("status.swarmLabel")),1),C("span",{class:De(["mode-switch",{on:Zt.value}])},[...tt[21]||(tt[21]=[C("span",{class:"mode-knob"},null,-1)])],2)],2),C("div",{class:De(["mode-row mode-row-goal",{on:Qn.value||o.goalMode}])},[C("button",{type:"button",class:"mode-row-main",onClick:tt[9]||(tt[9]=st=>Qn.value?i("controlGoal","cancel"):i("toggleGoal"))},[C("span",Pne,R(x(r)("status.goalLabel")),1),Qn.value?re("",!0):(_(),I("span",{key:0,class:De(["mode-switch",{on:o.goalMode}])},[...tt[22]||(tt[22]=[C("span",{class:"mode-knob"},null,-1)])],2))]),Qn.value?(_(),I("div",Dne,[C("button",{type:"button",class:"mode-row-action",onClick:tt[10]||(tt[10]=st=>i("controlGoal","pause"))},R(x(r)("status.goalPause")),1),C("button",{type:"button",class:"mode-row-action",onClick:tt[11]||(tt[11]=st=>i("controlGoal","resume"))},R(x(r)("status.goalResume")),1)])):re("",!0)],2)],4)):re("",!0)],512)):re("",!0)]),C("div",Bne,[Gt.value?(_(),I("button",{key:0,class:"compact-chip",onClick:tt[12]||(tt[12]=kt(st=>i("compact"),["stop"]))},"/compact")):re("",!0),se(Kt,{text:yt.value},{default:we(()=>[e.status&&!e.hideContext?(_(),I("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":yt.value},[se(rne,{pct:Bt.value},null,8,["pct"]),C("span",Hne,R($t(e.status.ctxUsed))+"/"+R($t(e.status.ctxMax)),1)],8,Fne)):re("",!0)]),_:1},8,["text"]),e.status?(_(),I("span",{key:1,class:De(["model-pill",{open:Ee.value}]),role:"button",tabindex:"0",onClick:kt(Ie,["stop"]),onKeydown:[gi(Ie,["enter"]),gi(kt(Ie,["prevent"]),["space"])]},[C("b",null,R(e.status.model),1),lo.value?(_(),I("span",Wne,R(lo.value),1)):re("",!0),se(Qe,{class:"cv",name:"chevron-down",size:"sm"})],42,zne)):re("",!0),e.running?(_(),ke(Kt,{key:2,text:x(r)("composer.interruptTitle")},{default:we(()=>[C("button",{class:"stop","aria-label":x(r)("composer.interrupt"),onClick:tt[13]||(tt[13]=st=>i("interrupt"))},[se(Qe,{name:"stop",size:"sm"})],8,Une)]),_:1},8,["text"])):re("",!0),C("button",{class:"send","aria-label":fe.value,onClick:tt[14]||(tt[14]=st=>ie())},[se(Qe,{name:"send",size:"sm"})],8,qne)]),Ee.value&&e.status?(_(),I("div",{key:0,class:"model-dropdown",role:"menu",onClick:tt[16]||(tt[16]=kt(()=>{},["stop"]))},[Us.value.length>0?(_(),I("div",jne,R(x(r)("status.starredModels")),1)):re("",!0),(_(!0),I(Pe,null,nt(Us.value,st=>(_(),I("button",{key:st.id,class:De(["md-row",{"is-current":st.id===e.status.modelId}]),role:"menuitem",onClick:Ht=>qs(st.id)},[C("span",Kne,[st.id===e.status.model||st.model===e.status.model||st.displayName===e.status.model?(_(),ke(Qe,{key:0,name:"check",size:"sm"})):re("",!0)]),C("span",Gne,R(st.displayName??st.model),1),C("span",Yne,R(st.provider),1),se(Qe,{class:"md-star",name:"star",size:"sm"})],10,Vne))),128)),Us.value.length>0?(_(),I("div",Qne)):re("",!0),ds.value.length>0?(_(),I("div",Xne,R(Wo.value),1)):re("",!0),(_(!0),I(Pe,null,nt(ds.value,st=>(_(),I("button",{key:st.id,class:De(["md-row",{"is-current":st.id===e.status.modelId}]),role:"menuitem",onClick:Ht=>qs(st.id)},[C("span",Jne,[st.id===e.status.model||st.model===e.status.model||st.displayName===e.status.model?(_(),ke(Qe,{key:0,name:"check",size:"sm"})):re("",!0)]),C("span",eoe,R(st.displayName??st.model),1),Ot(st.id)?(_(),ke(Qe,{key:0,class:"md-star",name:"star",size:"sm"})):re("",!0)],10,Zne))),128)),ds.value.length>0?(_(),I("div",toe)):re("",!0),C("div",{class:De(["md-thinking",{"is-readonly":zn.value}])},[C("span",noe,R(x(r)("status.thinkingLabel")),1),ro.value==="unsupported"?(_(),I("span",ooe,R(x(r)("status.modeNotSupported")),1)):(_(),I("div",{key:1,class:"effort-segments",role:"group","aria-label":x(r)("status.thinkingLabel")},[(_(!0),I(Pe,null,nt(Yt.value,st=>(_(),I("button",{key:st,type:"button",class:De(["effort-seg",{"is-active":st===zo.value}]),disabled:zn.value,onClick:Ht=>Gn(st)},R(x(Vv)(st)),11,ioe))),128))],8,soe))],2),tt[23]||(tt[23]=C("div",{class:"md-divider"},null,-1)),C("button",{class:"md-row md-row-more",role:"menuitem",onClick:tt[15]||(tt[15]=st=>{Ge(),i("pickModel")})},[C("span",roe,R(x(r)("status.moreModels")),1)])])):re("",!0)],512)])],34))}}),UM=ut(loe,[["__scopeId","data-v-2d5e8ded"]]),aoe={key:0,class:"ui-card__head"},coe={class:"ui-card__body"},uoe={key:1,class:"ui-card__foot"},doe=je({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(_(),I("div",{class:De(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(_(),I("div",aoe,[On(t.$slots,"head",{},void 0,!0)])):re("",!0),C("div",coe,[On(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(_(),I("div",uoe,[On(t.$slots,"foot",{},void 0,!0)])):re("",!0)],2))}}),Ty=ut(doe,[["__scopeId","data-v-9c9f9a9a"]]),foe=["type","disabled"],hoe={class:"ui-button__content"},poe=je({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(_(),I("button",{class:De(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(_(),ke(ai,{key:0,size:"sm",class:"ui-button__spinner"})):re("",!0),C("span",hoe,[On(t.$slots,"default",{},void 0,!0)])],10,foe))}}),Dt=ut(poe,[["__scopeId","data-v-e58393a8"]]),moe={class:"goal-progress","aria-hidden":"true"},goe={class:"goal-full"},voe={key:0,class:"goal-criterion"},yoe={class:"goal-stats"},koe={class:"goal-actions"},boe=je({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=X(!1);Ve(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=B(()=>{const a=n.goal.budget.tokenBudget;return!a||a<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/a*100)))});function l(a){const c=Math.max(0,Math.round(a/1e3)),u=Math.floor(c/60),d=c%60;return u<=0?`${d}s`:u<60?`${u}m ${d}s`:`${Math.floor(u/60)}h ${u%60}m`}return(a,c)=>(_(),ke(Ty,{class:De(["goal-strip",{expanded:i.value}])},d0({head:we(()=>[C("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[4]||(c[4]=C("span",{class:"goal-kicker"},"Goal",-1)),C("span",{class:De(["goal-objective",{"expanded-hidden":i.value}])},R(e.goal.objective),3),se(Do,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:we(()=>[qe(R(e.goal.status),1)]),_:1},8,["variant"]),C("span",moe,[C("span",{class:"goal-progress-fill",style:en({width:`${r.value}%`})},null,4)]),se(Qe,{class:De(["goal-chevron",{open:i.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),_:2},[i.value?{name:"default",fn:we(()=>[C("div",goe,R(e.goal.objective),1),e.goal.completionCriterion?(_(),I("div",voe,[c[5]||(c[5]=C("span",null,"Done when",-1)),C("p",null,R(e.goal.completionCriterion),1)])):re("",!0),C("div",yoe,[se(Do,{variant:"neutral",size:"sm"},{default:we(()=>[qe(R(e.goal.turnsUsed)+" turns",1)]),_:1}),se(Do,{variant:"neutral",size:"sm"},{default:we(()=>[qe(R(e.goal.tokensUsed.toLocaleString())+" tokens",1)]),_:1}),se(Do,{variant:"neutral",size:"sm"},{default:we(()=>[qe(R(l(e.goal.wallClockMs)),1)]),_:1}),e.goal.budget.tokenBudget!==null?(_(),ke(Do,{key:0,variant:"neutral",size:"sm"},{default:we(()=>[qe(R(r.value)+"% token budget",1)]),_:1})):re("",!0)])]),key:"0"}:void 0,i.value?{name:"foot",fn:we(()=>[C("div",koe,[e.goal.status!=="paused"?(_(),ke(Dt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:c[1]||(c[1]=kt(u=>o("controlGoal","pause"),["stop"]))},{default:we(()=>[qe(R(x(s)("status.goalPause")),1)]),_:1})):re("",!0),e.goal.status==="paused"?(_(),ke(Dt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:c[2]||(c[2]=kt(u=>o("controlGoal","resume"),["stop"]))},{default:we(()=>[qe(R(x(s)("status.goalResume")),1)]),_:1})):re("",!0),se(Dt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:c[3]||(c[3]=kt(u=>o("controlGoal","cancel"),["stop"]))},{default:we(()=>[qe(R(x(s)("status.goalCancel")),1)]),_:1})])]),key:"1"}:void 0]),1032,["class"]))}}),_oe=ut(boe,[["__scopeId","data-v-eaeefe1e"]]),woe={class:"qh"},Soe={class:"qtitle"},Coe={key:0,class:"qstep"},xoe={key:1,class:"qmin-peek"},Aoe={class:"qbody"},Moe=["aria-label"],Toe=["aria-selected","aria-label","onClick"],Eoe={class:"qstep-num"},Ioe={key:1,class:"qheader-chip"},$oe={class:"qtext"},Loe={class:"qopts"},Noe=["onClick"],Roe={class:"qopt-key"},Ooe={class:"qopt-glyph"},Poe={key:0,class:"chk"},Doe={key:1,class:"rad"},Boe={class:"qopt-text"},Foe={class:"qopt-label"},Hoe={key:0,class:"qopt-desc"},zoe={class:"qopt-glyph"},Woe={key:0,class:"chk"},Uoe={key:1,class:"rad"},qoe={class:"qopt-label"},joe=["placeholder"],Voe={class:"qfoot"},Koe=je({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=Tt(),s=t,i=X(0),r=X(!1),l=B(()=>n.question.questions[i.value]),a=B(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(F){F>=0&&F<a.value&&(i.value=F)}function f(F){const W=h.value[F];return W?W.kind==="multi"?W.optionIds.length>0:W.kind==="multiWithOther"?W.optionIds.length>0||W.otherText.trim().length>0:W.kind==="other"?W.text.trim().length>0:!0:!1}function p(){return f(l.value.id)}const h=X({});function m(F){return F.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${F.label} ${F.description??""}`.toLowerCase())}function w(){const F={...h.value};let W=!1;for(const K of n.question.questions){if(F[K.id])continue;const Y=K.options.filter(m);Y.length!==0&&(F[K.id]=K.multiSelect?{kind:"multi",optionIds:Y.map(q=>q.id)}:{kind:"single",optionId:Y[0].id},W=!0)}W&&(h.value=F)}Ve(()=>n.question.questionId,()=>{i.value=0,r.value=!1,h.value={},v.value={}}),Ve(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),w()},{immediate:!0,deep:!0});function k(F,W){const K=h.value[F];if(K&&K.kind==="single"&&K.optionId===W){const Y={...h.value};delete Y[F],h.value=Y}else h.value={...h.value,[F]:{kind:"single",optionId:W}}}function g(F,W){const K=h.value[F],Y=K&&(K.kind==="multi"||K.kind==="multiWithOther")?K.kind==="multi"?[...K.optionIds]:[...K.optionIds]:[],q=Y.indexOf(W);q>=0?Y.splice(q,1):Y.push(W);const ae=h.value[F],ce=ae&&ae.kind==="multiWithOther"?ae.otherText:"";ce?h.value={...h.value,[F]:{kind:"multiWithOther",optionIds:Y,otherText:ce}}:h.value={...h.value,[F]:{kind:"multi",optionIds:Y}}}const v=X({}),y=X(null);function M(F){const W=n.question.questions.find(Y=>Y.id===F),K=v.value[F]??"";if(W.multiSelect){const Y=h.value[F],q=Y&&(Y.kind==="multi"||Y.kind==="multiWithOther")?Y.kind==="multi"?[...Y.optionIds]:[...Y.optionIds]:[];h.value={...h.value,[F]:{kind:"multiWithOther",optionIds:q,otherText:K}}}else h.value={...h.value,[F]:{kind:"other",text:K}}}function O(F){M(F),gt(()=>y.value?.focus())}function L(F,W){const K=h.value[F];return K?K.kind==="single"?K.optionId===W:K.kind==="multi"||K.kind==="multiWithOther"?K.optionIds.includes(W):!1:!1}function b(F){const W=h.value[F];return!!(W&&(W.kind==="other"||W.kind==="multiWithOther"))}function T(){return n.question.questions.every(F=>f(F.id))}const $=B(()=>n.busyKind==="answer"),N=B(()=>n.busyKind==="dismiss"),S=B(()=>!!n.busyKind);function E(){if(S.value||!T())return;const F={answers:h.value,method:"click"};s("answer",n.question.questionId,F)}function P(){S.value||s("dismiss",n.question.questionId)}function D(F){const W=(document.activeElement?.tagName??"").toLowerCase(),K=W==="input"||W==="textarea";if(S.value)return;if(F.key==="Enter"){if(F.preventDefault(),r.value)return;i.value<a.value-1&&p()?u():T()&&E();return}if(K)return;if(F.key==="Escape"){F.preventDefault(),P();return}if(r.value)return;const Y=parseInt(F.key,10);if(!isNaN(Y)&&Y>=1&&Y<=9){F.preventDefault();const q=l.value,ae=Y-1,ce=q.options[ae];ce&&(q.multiSelect?g(q.id,ce.id):k(q.id,ce.id))}}return Sn(()=>document.addEventListener("keydown",D)),In(()=>document.removeEventListener("keydown",D)),(F,W)=>(_(),ke(Ty,{class:De(["qcard",{minimized:r.value}])},d0({head:we(()=>[C("div",woe,[W[5]||(W[5]=C("span",{class:"qh-ic"},"?",-1)),C("span",Soe,R(x(o)("question.title")),1),a.value>1&&!r.value?(_(),I("span",Coe,R(x(o)("question.step",{current:i.value+1,total:a.value})),1)):re("",!0),r.value?(_(),I("span",xoe,R(l.value.question),1)):re("",!0),se(Mn,{class:"qmin",size:"sm",label:r.value?x(o)("question.expand"):x(o)("question.minimize"),onClick:W[0]||(W[0]=K=>r.value=!r.value)},{default:we(()=>[r.value?(_(),ke(Qe,{key:0,name:"chevron-down",size:"md"})):(_(),ke(Qe,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:we(()=>[C("div",Aoe,[a.value>1?(_(),I("div",{key:0,class:"qsteps",role:"tablist","aria-label":x(o)("question.step",{current:i.value+1,total:a.value})},[(_(!0),I(Pe,null,nt(n.question.questions,(K,Y)=>(_(),I("button",{key:K.id,type:"button",class:De(["qstep-dot",{active:Y===i.value,answered:f(K.id)}]),"aria-selected":Y===i.value,"aria-label":x(o)("question.step",{current:Y+1,total:a.value}),onClick:q=>d(Y)},[C("span",Eoe,R(Y+1),1)],10,Toe))),128))],8,Moe)):re("",!0),l.value.header?(_(),I("div",Ioe,[se(Do,{variant:"neutral",size:"sm"},{default:we(()=>[qe(R(l.value.header),1)]),_:1})])):re("",!0),C("div",$oe,R(l.value.question),1),l.value.body?(_(),ke(Wp,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):re("",!0),C("div",Loe,[(_(!0),I(Pe,null,nt(l.value.options,(K,Y)=>(_(),I("label",{key:K.id,class:De(["qopt",{selected:L(l.value.id,K.id)}]),onClick:kt(q=>l.value.multiSelect?g(l.value.id,K.id):k(l.value.id,K.id),["prevent"])},[C("span",Roe,R(Y+1),1),C("span",Ooe,[l.value.multiSelect?(_(),I("span",Poe,R(L(l.value.id,K.id)?"■":"□"),1)):(_(),I("span",Doe,R(L(l.value.id,K.id)?"●":"○"),1))]),C("span",Boe,[C("span",Foe,R(K.label),1),K.description?(_(),I("span",Hoe,R(K.description),1)):re("",!0)])],10,Noe))),128)),l.value.allowOther?(_(),I("label",{key:0,class:De(["qopt",{selected:b(l.value.id)}]),onClick:W[4]||(W[4]=kt(K=>O(l.value.id),["prevent"]))},[W[6]||(W[6]=C("span",{class:"qopt-key"},null,-1)),C("span",zoe,[l.value.multiSelect?(_(),I("span",Woe,R(b(l.value.id)?"■":"□"),1)):(_(),I("span",Uoe,R(b(l.value.id)?"●":"○"),1))]),C("span",qoe,R(l.value.otherLabel??x(o)("question.otherDefault")),1),An(C("input",{ref_key:"otherInputEl",ref:y,"onUpdate:modelValue":W[1]||(W[1]=K=>v.value[l.value.id]=K),class:"other-input",type:"text",placeholder:l.value.otherLabel??x(o)("question.otherDefault"),onInput:W[2]||(W[2]=K=>M(l.value.id)),onFocus:W[3]||(W[3]=K=>M(l.value.id))},null,40,joe),[[us,v.value[l.value.id]]])],2)):re("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:we(()=>[C("div",Voe,[i.value<a.value-1?(_(),ke(Dt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!p(),onClick:u},{default:we(()=>[qe(R(x(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(_(),ke(Dt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!T(),loading:$.value,onClick:E},{default:we(()=>[qe(R(x(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(_(),ke(Dt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:we(()=>[qe(R(x(o)("question.back")),1)]),_:1},8,["disabled"])):re("",!0),se(Dt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:N.value,disabled:S.value,onClick:P},{default:we(()=>[qe(R(x(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),Goe=ut(Koe,[["__scopeId","data-v-08fbd85e"]]),Yoe={class:"ah"},Qoe={class:"akind"},Xoe={class:"apath"},Zoe={class:"ah-path"},Joe={key:1,class:"diff"},ese={class:"dg"},tse={class:"dc"},nse={key:2,class:"body-shell"},ose={class:"shell-cmd"},sse={key:0,class:"shell-cwd"},ise={key:1,class:"shell-danger"},rse={key:3,class:"body-file"},lse={class:"file-bar"},ase={class:"file-lang"},cse={class:"file-content"},use={class:"file-ln"},dse={class:"file-text"},fse={key:4,class:"body-chip"},hse={class:"chip-label"},pse={class:"chip-value"},mse={key:0,class:"chip-detail"},gse={key:5,class:"body-chip"},vse={key:0,class:"chip-label"},yse={class:"chip-value"},kse={key:6,class:"body-chip"},bse={class:"chip-label"},_se={class:"chip-value"},wse={key:0,class:"chip-detail"},Sse={key:7,class:"body-chip"},Cse={class:"chip-label"},xse={class:"chip-value"},Ase={key:0,class:"chip-detail"},Mse={key:8,class:"body-todo"},Tse={class:"todo-glyph"},Ese={key:9,class:"body-plan"},Ise={key:10,class:"body-generic"},$se={class:"gen-text"},Lse={key:11,class:"feedback-wrap"},Nse=["placeholder"],Rse={class:"feedback-hint"},Ose={key:0,class:"plan-actions"},Pse={class:"k"},Dse={key:0,class:"k"},Bse={key:0,class:"k"},Fse={key:1,class:"abtn"},Hse=je({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=B(()=>{const $=n.block;return $.kind!=="plan_review"?null:{plan:$.plan,path:$.path,options:$.options??[]}}),r=X(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const $=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${$}`)}const c=X(!1),u=X(""),d=X(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function p(){if(n.busy)return;const $=u.value.trim();i.value?k("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:$||void 0}):k("feedback",{decision:"rejected",feedback:$||void 0}),c.value=!1,u.value=""}function h(){c.value=!1,u.value=""}function m($){$.key==="Enter"&&!$.shiftKey?($.preventDefault(),p()):$.key==="Escape"&&($.preventDefault(),h())}const w=X(null);Ve(()=>n.busy,$=>{$||(w.value=null)});function k($,N){n.busy||(w.value=$,o("decide",N))}function g(){k("approve",{decision:"approved"})}function v(){k("approveSession",{decision:"approved",scope:"session"})}function y(){k("reject",{decision:"rejected"})}function M(){k("approvePlan",{decision:"approved"})}function O($){k(`option:${$}`,{decision:"approved",selectedLabel:$})}function L(){n.busy||f()}function b(){k("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function T($){const N=(document.activeElement?.tagName??"").toLowerCase();if(N==="input"||N==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){$.key==="1"?($.preventDefault(),M()):$.key==="2"?($.preventDefault(),L()):$.key==="3"&&($.preventDefault(),b());return}$.key==="1"&&S.options[0]?($.preventDefault(),O(S.options[0].label)):$.key==="2"&&S.options[1]?($.preventDefault(),O(S.options[1].label)):$.key==="3"&&S.options[2]&&($.preventDefault(),O(S.options[2].label));return}$.key==="1"?($.preventDefault(),g()):$.key==="2"?($.preventDefault(),v()):$.key==="3"?($.preventDefault(),y()):$.key==="4"&&($.preventDefault(),f())}return Sn(()=>document.addEventListener("keydown",T)),In(()=>document.removeEventListener("keydown",T)),($,N)=>(_(),ke(Ty,{class:De(["appr",{minimized:r.value}])},d0({head:we(()=>[C("div",Yoe,[N[2]||(N[2]=C("span",{class:"ah-ic"},"!",-1)),C("span",Qoe,R(a()),1),C("span",Xoe,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(_(),I(Pe,{key:0},[qe(R(e.block.path),1)],64)):e.block.kind==="shell"?(_(),I(Pe,{key:1},[qe(R(e.block.command),1)],64)):e.block.kind==="url"?(_(),I(Pe,{key:2},[qe(R(e.block.url),1)],64)):e.block.kind==="search"?(_(),I(Pe,{key:3},[qe(R(e.block.query),1)],64)):e.block.kind==="invocation"?(_(),I(Pe,{key:4},[qe(R(e.block.name),1)],64)):e.block.kind==="generic"?(_(),I(Pe,{key:5},[qe(R(e.block.summary),1)],64)):re("",!0)]),e.agentName&&!r.value?(_(),ke(Do,{key:0,variant:"neutral",size:"sm"},{default:we(()=>[qe(R(x(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):re("",!0),r.value?re("",!0):(_(),ke(Do,{key:1,variant:"warning",size:"sm",class:"aw"},{default:we(()=>[qe(R(x(s)("approval.required")),1)]),_:1})),se(Mn,{class:"amin",size:"sm",label:r.value?x(s)("question.expand"):x(s)("question.minimize"),onClick:N[0]||(N[0]=S=>r.value=!r.value)},{default:we(()=>[r.value?(_(),ke(Qe,{key:0,name:"chevron-down",size:"md"})):(_(),ke(Qe,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:we(()=>[e.block.kind==="plan_review"&&e.block.path?(_(),ke(Kt,{key:0,text:e.block.path},{default:we(()=>[C("div",Zoe,R(e.block.path),1)]),_:1},8,["text"])):re("",!0),e.block.kind==="diff"?(_(),I("div",Joe,[(_(!0),I(Pe,null,nt(e.block.diff,(S,E)=>(_(),I("div",{key:E,class:De(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[C("span",ese,R(S.gutter),1),C("span",tse,R(S.text),1)],2))),128))])):e.block.kind==="shell"?(_(),I("div",nse,[C("div",ose,[N[3]||(N[3]=C("span",{class:"shell-dollar"},"$",-1)),qe(" "+R(e.block.command),1)]),e.block.cwd?(_(),I("div",sse,"cwd: "+R(e.block.cwd),1)):re("",!0),e.block.danger?(_(),I("div",ise,R(x(s)("approval.danger",{detail:e.block.danger})),1)):re("",!0)])):e.block.kind==="file"?(_(),I("div",rse,[C("div",lse,[C("span",ase,R(e.block.language??""),1)]),C("div",cse,[(_(!0),I(Pe,null,nt(e.block.content.split(`
262
+ `),(S,E)=>(_(),I("div",{key:E,class:"file-line"},[C("span",use,R(E+1),1),C("span",dse,R(S),1)]))),128))])])):e.block.kind==="fileop"?(_(),I("div",fse,[C("span",hse,R(e.block.op),1),C("span",pse,R(e.block.path),1),e.block.detail?(_(),I("span",mse,R(e.block.detail),1)):re("",!0)])):e.block.kind==="url"?(_(),I("div",gse,[e.block.method?(_(),I("span",vse,R(e.block.method),1)):re("",!0),C("span",yse,R(e.block.url),1)])):e.block.kind==="search"?(_(),I("div",kse,[C("span",bse,R(x(s)("approval.searchQueryLabel")),1),C("span",_se,R(e.block.query),1),e.block.scope?(_(),I("span",wse,R(x(s)("approval.searchScope",{scope:e.block.scope})),1)):re("",!0)])):e.block.kind==="invocation"?(_(),I("div",Sse,[C("span",Cse,R(e.block.kind2),1),C("span",xse,R(e.block.name),1),e.block.description?(_(),I("span",Ase,R(e.block.description),1)):re("",!0)])):e.block.kind==="todo"?(_(),I("div",Mse,[(_(!0),I(Pe,null,nt(e.block.items,(S,E)=>(_(),I("div",{key:E,class:"todo-item"},[C("span",Tse,R(S.status==="done"||S.status==="completed"?"✓":"○"),1),C("span",{class:De(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},R(S.title),3)]))),128))])):e.block.kind==="plan_review"?(_(),I("div",Ese,[se(Wp,{text:e.block.plan},null,8,["text"])])):(_(),I("div",Ise,[C("span",$se,R(e.block.summary),1)])),c.value?(_(),I("div",Lse,[An(C("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":N[1]||(N[1]=S=>u.value=S),class:"feedback-ta",placeholder:x(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,Nse),[[us,u.value]]),C("div",Rse,R(x(s)("approval.feedbackHint")),1)])):re("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:we(()=>[i.value?(_(),I("div",Ose,[i.value.options.length>0?(_(!0),I(Pe,{key:0},nt(i.value.options,(S,E)=>(_(),ke(Kt,{key:E,text:S.description},{default:we(()=>[se(Dt,{class:"kbtn",size:"sm",variant:"primary",loading:w.value===`option:${S.label}`,disabled:e.busy,onClick:P=>O(S.label)},{default:we(()=>[qe(R(S.label),1),C("span",Pse,"["+R(E+1)+"]",1)]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(_(),ke(Dt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:w.value==="approvePlan",disabled:e.busy,onClick:M},{default:we(()=>[qe(R(x(s)("approval.approvePlan")),1),N[4]||(N[4]=C("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"])),se(Dt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:L},{default:we(()=>[qe(R(x(s)("approval.revise")),1),i.value.options.length===0?(_(),I("span",Dse,"[2]")):re("",!0)]),_:1},8,["disabled"]),se(Dt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:w.value==="rejectAndExit",disabled:e.busy,onClick:b},{default:we(()=>[qe(R(x(s)("approval.rejectAndExit")),1),i.value.options.length===0?(_(),I("span",Bse,"[3]")):re("",!0)]),_:1},8,["loading","disabled"])])):(_(),I("div",Fse,[se(Dt,{class:"kbtn",size:"sm",variant:"primary",loading:w.value==="approve",disabled:e.busy,onClick:g},{default:we(()=>[qe(R(x(s)("approval.approve")),1),N[5]||(N[5]=C("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"]),se(Dt,{class:"kbtn",size:"sm",variant:"secondary",loading:w.value==="approveSession",disabled:e.busy,onClick:v},{default:we(()=>[qe(R(x(s)("approval.approveSession")),1),N[6]||(N[6]=C("span",{class:"k"},"[2]",-1))]),_:1},8,["loading","disabled"]),se(Dt,{class:"kbtn",size:"sm",variant:"secondary",loading:w.value==="reject",disabled:e.busy,onClick:y},{default:we(()=>[qe(R(x(s)("approval.reject")),1),N[7]||(N[7]=C("span",{class:"k"},"[3]",-1))]),_:1},8,["loading","disabled"]),se(Dt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:we(()=>[qe(R(x(s)("approval.feedback")),1),N[8]||(N[8]=C("span",{class:"k"},"[4]",-1))]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),zse=ut(Hse,[["__scopeId","data-v-4c0c7bdb"]]),Wse=je({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(_(),I("span",{class:De(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},R(n[t.status]),3))}}),qM=ut(Wse,[["__scopeId","data-v-f595d935"]]),Use={class:"taskspane"},qse={class:"tp-head"},jse={class:"tp-title"},Vse={class:"tp-count"},Kse={class:"tp-list"},Gse={key:0,class:"tp-empty"},Yse=["role","onClick"],Qse={class:"tp-name"},Xse={class:"tp-time"},Zse=["onClick"],Jse={key:0,class:"tp-detail"},eie={key:0,class:"tp-codebox"},tie=["onClick"],nie={class:"tp-pre"},oie={class:"tp-cmd"},sie={key:1,class:"tp-codebox"},iie=["onClick"],rie={class:"tp-pre"},lie=je({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Tt(),s=Bo(new Set),i=Bo(new Set),r=Bo(new Set);function l(h){return!!(h.output&&h.output.length>0||h.meta)}function a(h){if(h.kind==="subagent"){n("open",h.id);return}l(h)&&(s.has(h.id)?s.delete(h.id):s.add(h.id))}function c(h){return h.kind==="subagent"||l(h)}function u(h){return h==="run"||h==="done"||h==="fail"?h:"pending"}async function d(h,m,w){await Go(h)&&(w.add(m),setTimeout(()=>w.delete(m),1500))}async function f(h){h.meta&&await d(h.meta,h.id,i)}async function p(h){const m=h.output?.join(`
263
+ `)??"";m&&await d(m,h.id,r)}return(h,m)=>(_(),I("div",Use,[C("div",qse,[C("span",jse,R(x(o)("tasks.tag")),1),C("span",Vse,R(e.tasks.length),1)]),C("div",Kse,[e.tasks.length===0?(_(),I("div",Gse,R(x(o)("tasks.emptyTasks")),1)):(_(!0),I(Pe,{key:1},nt(e.tasks,w=>(_(),I("div",{key:w.id,class:De(["tp-row",{done:w.state==="done",fail:w.state==="fail",expandable:c(w)}])},[C("div",{class:"tp-main",role:c(w)?"button":void 0,onClick:k=>a(w)},[se(qM,{status:u(w.state)},null,8,["status"]),C("span",Qse,R(w.name),1),se(Do,{variant:"neutral",size:"sm"},{default:we(()=>[qe(R(w.kind),1)]),_:2},1024),C("span",Xse,R(w.timing),1),w.state==="run"?(_(),I("button",{key:0,class:"tp-stop",onClick:kt(k=>n("cancel",w.id),["stop"])},R(x(o)("tasks.stop")),9,Zse)):re("",!0),w.kind==="subagent"?(_(),ke(Qe,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(w)?(_(),ke(Qe,{key:2,class:De(["tp-chevron",{open:s.has(w.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):re("",!0)],8,Yse),s.has(w.id)&&l(w)?(_(),I("div",Jse,[w.meta?(_(),I("div",eie,[C("button",{class:De(["tp-copy",{copied:i.has(w.id)}]),onClick:kt(k=>f(w),["stop"])},R(i.has(w.id)?"已复制":"复制"),11,tie),C("pre",nie,[C("code",null,[C("span",oie,R(w.meta),1)])])])):re("",!0),w.output&&w.output.length>0?(_(),I("div",sie,[C("button",{class:De(["tp-copy",{copied:r.has(w.id)}]),onClick:kt(k=>p(w),["stop"])},R(r.has(w.id)?"已复制":"复制"),11,iie),C("pre",rie,[C("code",null,[m[0]||(m[0]=qe(`
264
+ `,-1)),(_(!0),I(Pe,null,nt(w.output,(k,g)=>(_(),I("span",{key:g,class:"tp-line"},R(k),1))),128)),m[1]||(m[1]=qe(`
265
+ `,-1))])])])):re("",!0)])):re("",!0)],2))),128))])]))}}),fC=ut(lie,[["__scopeId","data-v-28fd5fc0"]]),aie={class:"todo-card"},cie={key:0,class:"tc-empty"},uie={class:"tc-name"},die=je({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Tt();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(_(),I("div",aie,[t.todos.length===0?(_(),I("div",cie,[i[0]||(i[0]=C("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[C("path",{d:"M9 11l2 2 4-4"}),C("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),C("span",null,R(x(n)("tasks.emptyTodo")),1)])):re("",!0),(_(!0),I(Pe,null,nt(t.todos,(r,l)=>(_(),I("div",{key:l,class:De(["tc-row",`s-${r.status}`])},[se(qM,{status:o(r.status)},null,8,["status"]),C("span",uie,R(r.title),1)],2))),128))]))}}),fie=ut(die,[["__scopeId","data-v-01c65735"]]),hie=["disabled","aria-pressed"],pie=je({__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?(_(),I("button",{key:0,class:De(["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))},[On(t.$slots,"default",{},void 0,!0)],10,hie)):(_(),I("span",{key:1,class:De(["ui-pill",{"is-active":e.active}])},[On(t.$slots,"default",{},void 0,!0)],2))}}),g1=ut(pie,[["__scopeId","data-v-317ace1a"]]),mie={class:"dock-work-head"},gie={key:0,class:"dock-work-tab static"},vie={key:1,class:"dock-work-tab static"},yie={key:2,class:"dock-work-tab static"},kie={class:"dock-work-body"},bie={class:"dw-count"},_ie={class:"dw-count"},wie={class:"dw-count"},Sie=je({__name:"ChatDock",props:{sessionId:{},running:{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}=Tt(),r=X(null),l=X(null),a=X(null);function c(p){return r.value?(r.value.loadForEdit(p),!0):!1}function u(p){r.value?.loadAttachmentsForEdit(p)}function d(){r.value?.focus()}function f(p){if(!o.dockPanel)return;const h=p.target;h&&(l.value?.contains(h)||a.value?.contains(h)||s("close-dock-panel"))}return Ve(()=>o.dockPanel,p=>{typeof document>"u"||(document.removeEventListener("mousedown",f,!0),p&&document.addEventListener("mousedown",f,!0))},{immediate:!0}),In(()=>{typeof document<"u"&&document.removeEventListener("mousedown",f,!0)}),t({loadForEdit:c,loadAttachmentsForEdit:u,focus:d}),(p,h)=>(_(),I("div",{class:De(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:h[28]||(h[28]=kt(()=>{},["stop"]))},[se(Jr,{name:"dock-panel"},{default:we(()=>[e.dockPanel?(_(),I("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:h[3]||(h[3]=kt(()=>{},["stop"]))},[C("div",mie,[e.dockPanel==="bash"?(_(),I("span",gie,R(x(i)("tasks.dockBash"))+" · "+R(e.bashRunning)+" "+R(x(i)("tasks.running")),1)):e.dockPanel==="subagent"?(_(),I("span",vie,R(x(i)("tasks.dockSubagent"))+" · "+R(e.subagentRunning)+" "+R(x(i)("tasks.running")),1)):e.dockPanel==="todos"?(_(),I("span",yie,R(x(i)("tasks.dockTodos"))+" · "+R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1)):re("",!0)]),C("div",kie,[e.dockPanel==="bash"?(_(),ke(fC,{key:0,tasks:e.bashTasks,onCancel:h[0]||(h[0]=m=>s("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(_(),ke(fC,{key:1,tasks:e.subagentTasks,onCancel:h[1]||(h[1]=m=>s("cancelTask",m)),onOpen:h[2]||(h[2]=m=>s("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(_(),ke(fie,{key:2,todos:e.todos??[]},null,8,["todos"])):re("",!0)])],512)):re("",!0)]),_:1}),e.goal?(_(),ke(_oe,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:h[4]||(h[4]=m=>s("controlGoal",m))},null,8,["goal","force-expanded"])):re("",!0),e.hasDockWork?(_(),I("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(_(),ke(g1,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:h[5]||(h[5]=m=>s("toggle-dock-panel","bash"))},{default:we(()=>[se(Qe,{name:"clock",size:"md"}),C("span",null,R(x(i)("tasks.dockBash")),1),C("span",bie,[h[29]||(h[29]=qe("(",-1)),C("b",null,R(e.bashTasks.length),1),h[30]||(h[30]=qe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),e.subagentTasks.length>0?(_(),ke(g1,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:h[6]||(h[6]=m=>s("toggle-dock-panel","subagent"))},{default:we(()=>[se(Qe,{name:"sparkles",size:"md"}),C("span",null,R(x(i)("tasks.dockSubagent")),1),C("span",_ie,[h[31]||(h[31]=qe("(",-1)),C("b",null,R(e.subagentTasks.length),1),h[32]||(h[32]=qe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),(e.todos?.length??0)>0?(_(),ke(g1,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:h[7]||(h[7]=m=>s("toggle-dock-panel","todos"))},{default:we(()=>[se(Qe,{name:"check-list",size:"md"}),C("span",null,R(x(i)("tasks.dockTodos")),1),C("span",wie,[h[33]||(h[33]=qe("(",-1)),C("b",null,R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1),h[34]||(h[34]=qe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0)],512)):re("",!0),e.pendingQuestion?(_(),ke(Goe,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:h[8]||(h[8]=(m,w)=>s("answer",m,w)),onDismiss:h[9]||(h[9]=m=>s("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(_(),ke(zse,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:h[10]||(h[10]=m=>s("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(_(),ke(UM,{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,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:h[11]||(h[11]=m=>s("submit",m)),onSteer:h[12]||(h[12]=m=>s("steer",m)),onCommand:h[13]||(h[13]=m=>s("command",m)),onInterrupt:h[14]||(h[14]=m=>s("interrupt")),onSetPermission:h[15]||(h[15]=m=>s("setPermission",m)),onSetThinking:h[16]||(h[16]=m=>s("setThinking",m)),onTogglePlan:h[17]||(h[17]=m=>s("togglePlan")),onToggleSwarm:h[18]||(h[18]=m=>s("toggleSwarm")),onToggleGoal:h[19]||(h[19]=m=>s("toggleGoal")),onOpenBtw:h[20]||(h[20]=m=>s("openBtw")),onCreateGoal:h[21]||(h[21]=m=>s("createGoal",m)),onControlGoal:h[22]||(h[22]=m=>s("controlGoal",m)),onFocusGoal:h[23]||(h[23]=m=>s("focusGoal")),onFocusSwarm:h[24]||(h[24]=m=>s("focusSwarm")),onCompact:h[25]||(h[25]=m=>s("compact")),onPickModel:h[26]||(h[26]=m=>s("pickModel")),onSelectModel:h[27]||(h[27]=m=>s("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]))],2))}}),Cie=ut(Sie,[["__scopeId","data-v-1223755a"]]),xie=["aria-label","aria-hidden"],Aie={class:"toc-scroll"},Mie=["onClick"],Tie={class:"toc-label"},Eie=240,Iie=je({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=X(null),r=X(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,p=d.getBoundingClientRect().right;r.value=p-f>=Eie}const c=B(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ve(c,u=>{l?.disconnect(),l=null,u&&gt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),so(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(_(),I("nav",{key:0,ref_key:"navRef",ref:i,class:De(["conversation-toc",{"toc-clipped":!r.value}]),"aria-label":x(s)("conversation.toc"),"aria-hidden":r.value?void 0:!0},[C("div",Aie,[(_(!0),I(Pe,null,nt(e.items,f=>(_(),I("button",{key:f.id,type:"button",class:De(["toc-row",{active:e.activeTurnId===f.id}]),onClick:p=>o("select",f.id)},[d[0]||(d[0]=C("span",{class:"toc-bar"},null,-1)),C("span",Tie,R(f.title),1)],10,Mie))),128))])],10,xie)):re("",!0)}}),$ie=ut(Iie,[["__scopeId","data-v-0a2a2a96"]]),Lie=5;function Nie(e,t,n,o=Lie){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 Rie={class:"chat-layout"},Oie={class:"empty-hint"},Pie={class:"empty-hint-title"},Die={class:"empty-hint-text"},Bie={key:0,class:"ws-pick"},Fie={class:"ws-pick-name"},Hie={key:1,class:"ws-pick-menu"},zie=["onClick"],Wie={class:"ws-pick-item-name"},Uie={class:"ws-pick-item-path"},qie=["aria-label"],jie={key:0,class:"abort-toast",role:"status","aria-live":"polite"},Vie={class:"abort-toast-text"},v1=80,hC=1e3,Kie=420,Gie=3e3,Yie=je({__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},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{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"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=X(!1),r=X(!1),l=B(()=>o.workspaces?.find(Te=>Te.id===o.activeWorkspaceId)?.name??o.workspaceName??""),a=B(()=>(o.workspaces?.length??0)>0),c=B(()=>Nie(o.workspaces??[],o.activeWorkspaceId,r.value)),u=B(()=>(o.workspaces?.length??0)-c.value.length);Ve(i,$e=>{$e||(r.value=!1)});function d($e){i.value=!1,$e!==o.activeWorkspaceId&&s("selectWorkspace",$e)}const{t:f}=Tt();pc(Nt.contentAlign);const p=X(null),h=X(null),m=X(null),w=X(!1),k=X(0);let g=null;function v($e,Te){const He=m.value??h.value;return!He||He.loadForEdit($e)===!1?!1:(He.loadAttachmentsForEdit(Te??[]),!0)}function y(){w.value=!0,g!==null&&clearTimeout(g),g=setTimeout(()=>{g=null,w.value=!1},2e3)}function M(){k.value++}const O=B(()=>o.tasks.filter($e=>$e.kind!=="subagent")),L=B(()=>o.tasks.filter($e=>$e.kind==="subagent"&&$e.runInBackground)),b=B(()=>O.value.filter($e=>$e.state==="run").length),T=B(()=>L.value.filter($e=>$e.state==="run").length);function $($e){const Te=o.tasks,He=Te.find(qt=>qt.id===$e)??Te.find(qt=>qt.parentToolCallId===$e);if(He)return He.id;const Rt=Te.filter(qt=>qt.kind==="subagent"&&!qt.parentToolCallId);if(Rt.length===1)return Rt[0].id}Nn("resolveAgentTaskId",$),Nn("pinScroll",zo);const N=B(()=>(o.todos??[]).filter($e=>$e.status==="done").length),S=B(()=>O.value.length>0||L.value.length>0||(o.todos?.length??0)>0||(o.queued?.length??0)>0),E=X(null),P=B(()=>o.gitInfo?o.changes?.length??0:0);function D($e){E.value=E.value===$e?null:$e}function F(){E.value=null}Ve(S,$e=>{$e||F()});function W($e){if($e.role==="compaction")return f("conversation.compactedPlain");if($e.role==="user"){if($e.skillActivation)return`/${$e.skillActivation.name}`;if($e.pluginCommand)return`/${$e.pluginCommand.pluginId}:${$e.pluginCommand.commandName}`;const He=$e.text.trim().replaceAll(/\s+/g," ");return He.length>0?He:"user"}const Te=($e.text||$e.thinking||"").trim().replaceAll(/\s+/g," ");return Te.length>0?Te:($e.tools?.length??0)>0?`${$e.tools.length} tools`:"kimi"}const K=B(()=>o.turns.filter($e=>$e.role==="user").map(($e,Te)=>({id:$e.id,role:$e.role,no:Te+1,title:W($e)}))),Y=X(null);function q(){const $e=ee.value;if(!$e)return;const Te=$e.querySelectorAll(".turn-anchor[data-turn-id]");if(Te.length===0)return;const He=K.value;if(He.length===0)return;const Rt=new Set(He.map(Pn=>Pn.id));if(le()<=v1){Y.value=He[He.length-1].id;return}const qt=$e.getBoundingClientRect(),ao=qt.height/2;let Zn=null;Te.forEach(Pn=>{const As=Pn.dataset.turnId;if(!As||!Rt.has(As))return;Pn.getBoundingClientRect().top-qt.top<=ao&&(Zn=As)}),Y.value=Zn??He[0].id}const ae=B(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),ce=B(()=>{const $e=ae.value;if($e)return o.pendingQuestionActions?.[$e.questionId]}),ne=B(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),Q=B(()=>{const $e=ne.value;return $e?!!o.pendingApprovalActions?.[$e.approvalId]:!1}),ee=X(null),ye=X(null),xe=X(0),Xe=X(0),me=B(()=>({"--panes-scrollbar-width":`${xe.value}px`}));function G($e){return $e instanceof HTMLElement?$e:$e&&"$el"in $e&&$e.$el instanceof HTMLElement?$e.$el:null}function ie(){const $e=ee.value;xe.value=$e?Math.max(0,$e.offsetWidth-$e.clientWidth):0,Xe.value=ye.value?.offsetHeight??0}function de($e){const Te=G($e);ee.value=Te,Te&&Ot()}function z($e){const Te=G($e);ye.value=Te??null,$e&&"loadForEdit"in $e&&typeof $e.loadForEdit=="function"&&"focus"in $e&&typeof $e.focus=="function"?m.value={loadForEdit:$e.loadForEdit.bind($e),loadAttachmentsForEdit:"loadAttachmentsForEdit"in $e&&typeof $e.loadAttachmentsForEdit=="function"?$e.loadAttachmentsForEdit.bind($e):()=>{},focus:$e.focus.bind($e)}:m.value=null,fs()}const Z=X(!0),pe=X(!1);function le(){const $e=ee.value;return $e?$e.scrollHeight-$e.scrollTop-$e.clientHeight:0}let he=0,U=0,J=0,fe=0,be=0,Ee=0;function Le(){return Date.now()<U}function ue(){const $e=ee.value;if(!$e)return;const Te=$e.scrollTop;if(mn()){he=Te;return}if(performance.now()-J<100){he=Te;return}const He=le();if(Le()){Z.value=!0,pe.value=!1,he=Te;return}Te<he-1&&He>1?(Z.value=!1,pe.value=!0):He<=v1&&Te>he+1&&(Z.value=!0,pe.value=!1),he=Te,q()}function Ie($e=!1){const Te=ee.value;Z.value=!0,pe.value=!1,Te&&(!$e&&performance.now()<fe||($e&&typeof Te.scrollTo=="function"?(J=performance.now(),fe=performance.now()+Kie,Te.scrollTo({top:Te.scrollHeight,behavior:"smooth"})):Te.scrollTop=Te.scrollHeight,he=Te.scrollTop))}function Ge($e,Te){const He=$e.querySelectorAll(".turn-anchor");for(const Rt of He)if(Rt.offsetTop>=Te){const qt=Rt.dataset.turnId;if(qt)return{id:qt,top:Rt.offsetTop}}return null}async function lt(){if(!o.sessionId||!o.loadOlderMessages||o.loadingMore||!o.hasMoreMessages)return;const $e=o.sessionId,Te=ee.value,He=Te?.scrollTop??0,Rt=Te?.scrollHeight??0,qt=Te?Ge(Te,He):null;xs.value=!0;try{await o.loadOlderMessages($e),await gt()}finally{xs.value=!1}if(o.sessionId!==$e)return;const ao=ee.value;if(!ao)return;let Zn=0;if(qt){const Pn=ao.querySelector(`.turn-anchor[data-turn-id="${bt(qt.id)}"]`);Pn&&(Zn=Pn.offsetTop-qt.top)}Zn===0&&(Zn=ao.scrollHeight-Rt),ao.scrollTop=He+Zn}function bt($e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape($e):$e.replaceAll(/["\\]/g,"\\$&")}function _t($e){const Te=ee.value;if(!Te)return;const He=Te.querySelector(`.turn-anchor[data-turn-id="${bt($e)}"]`);He&&(Z.value=!1,pe.value=le()>v1,He.scrollIntoView({behavior:"smooth",block:"center"}))}function $t(){const $e=ee.value;if(!$e)return"none";const Te=$e.firstElementChild,He=Te instanceof HTMLElement?Te.offsetHeight:0,Rt=ye.value?.offsetHeight??0;return`${$e.scrollHeight}:${$e.clientHeight}:${He}:${Rt}`}function Bt($e){return typeof requestAnimationFrame=="function"?requestAnimationFrame($e):setTimeout($e,16)}function yt($e){typeof cancelAnimationFrame=="function"?cancelAnimationFrame($e):clearTimeout($e)}let Gt=0,pn=0,ro=null,Yt=0;function mn(){return performance.now()<Gt}function zo($e,Te=260){const He=ee.value;if(!He||(ro=$e,Yt=$e.getBoundingClientRect().top,Gt=performance.now()+Te,pn))return;const Rt=()=>{if(pn=0,performance.now()>=Gt||!ro){ro=null;return}const qt=ro.getBoundingClientRect().top-Yt;qt&&(He.scrollTop+=qt),pn=Bt(Rt)};pn=Bt(Rt)}function ot($e=36){if(!Z.value&&!Le())return;const Te=++Ee;let He="",Rt=0,qt=0;be&&(yt(be),be=0);const ao=()=>{if(be=0,Te!==Ee||!Z.value&&!Le())return;Ie(!1);const Zn=$t();Rt=Zn===He?Rt+1:0,He=Zn,qt++,Rt<3&&qt<$e&&(be=Bt(ao))};be=Bt(ao)}function zn($e,Te){return $e!==void 0&&$e.length>0&&Te.length>=$e.length&&$e.firstId!==Te.firstId&&$e.lastId===Te.lastId&&$e.lastTextLen===Te.lastTextLen&&$e.lastThinkingLen===Te.lastThinkingLen&&$e.lastToolsLen===Te.lastToolsLen&&$e.approvalIds===Te.approvalIds}const lo=B(()=>{const $e=(o.approvals??[]).map(ao=>ao.approvalId).join(","),Te=o.turns,He=Te.at(-1),Rt=He?.thinking?.length??0,qt=He?.tools?.reduce((ao,Zn)=>ao+Zn.name.length+(Zn.arg?.length??0)+(Zn.output?.join("").length??0),0)??0;return{length:Te.length,firstId:Te[0]?.id??"",lastId:He?.id??"",lastTextLen:He?.text.length??0,lastThinkingLen:Rt,lastToolsLen:qt,approvalIds:$e}});Ve(lo,async($e,Te)=>{if(xs.value&&zn(Te,$e)){q();return}await gt(),Z.value||Le()?Ie($e.length<Te.length):pe.value=!0,q()}),Ve(ye,()=>{fs()}),Ve(()=>o.mobile,async()=>{await gt(),ie()});const Gn=new Map;Ve(()=>o.fileReloadKey,async($e,Te)=>{const He=ee.value;Te&&He&&Gn.set(String(Te),{top:He.scrollTop,following:Z.value}),await gt();const Rt=ee.value,qt=$e?Gn.get(String($e)):void 0;qt&&Rt?(Z.value=qt.following,Rt.scrollTop=qt.top,he=qt.top,qt.following&&ot()):(Z.value=!0,he=0,Ie(!1),ot()),q()}),Ve(()=>o.sessionLoading,async($e,Te)=>{$e||!Te||(Z.value=!0,await gt(),ot(),q())}),Ve(()=>o.running,async($e,Te)=>{$e||!Te||!Z.value&&!Le()||(await gt(),ot(48),q())});function Yn(){Z.value=!0,pe.value=!1,U=Date.now()+hC,gt(()=>{Ie(!0),ot(16)})}function Zt($e){Yn(),s("submit",$e)}function Qn($e){Z.value=!0,pe.value=!1,U=Date.now()+hC,s("editMessage",$e)}function Ke($e){const Te=o.queued?.[$e],He=Te?.text??"";v(He,Te?.attachments)&&s("editQueued",$e)}function Ze($e){s("reorderQueue",$e)}function Ft($e,Te){Yn(),s("answer",$e,Te)}function sn($e,Te){!$e||!Te||s("approval",$e,Te)}let un=null,tn=null,Cn=null,Mt=null,Xn=0,Ut=0,wo=0,To=!1;const xs=X(!1);function Wo($e){if(xs.value||(To=To||$e,wo))return;wo=(typeof requestAnimationFrame=="function"?requestAnimationFrame:He=>setTimeout(He,16))(()=>{wo=0;const He=To;To=!1,!mn()&&(Z.value||Le()?Ie(!1):He&&(pe.value=!0))})}function ds(){if(!tn)return;const $e=ee.value?.firstElementChild??null;$e!==Cn&&(Cn&&tn.unobserve(Cn),Cn=$e,$e&&tn.observe($e))}function fs(){if(!tn)return;const $e=ye.value;$e!==Mt&&(Mt&&tn.unobserve(Mt),Mt=$e,$e&&tn.observe($e))}function Ot(){const $e=ee.value;ie(),un&&(un.disconnect(),$e&&un.observe($e,{childList:!0,subtree:!0,characterData:!0})),tn&&(tn.disconnect(),Cn=null,Mt=null,$e&&tn.observe($e),ds(),fs()),Xn=$e?.scrollHeight??0,Ut=$e?.clientHeight??0}function Us(){ds(),Wo(!0)}function qs(){typeof document>"u"||document.visibilityState==="visible"&&Z.value&&ot()}const Ye=X(!1);let tt=null;function st(){Ye.value=!0,tt!==null&&clearTimeout(tt),tt=setTimeout(()=>{Ye.value=!1},Gie)}function Ht(){st(),s("interrupt")}function js($e){$e.key==="Escape"&&(o.running||o.sending)&&($e.preventDefault(),Ht())}Sn(()=>{gt(()=>{typeof MutationObserver=="function"&&(un=new MutationObserver(Us)),typeof ResizeObserver=="function"&&(tn=new ResizeObserver(()=>{ie();const $e=ee.value;if(!$e)return;const{scrollHeight:Te,clientHeight:He}=$e,Rt=Te>Xn+1,qt=He<Ut-1;Xn=Te,Ut=He,!mn()&&(Rt||qt)&&Wo(!1)})),Ot(),ot(48),q(),typeof document<"u"&&(document.addEventListener("visibilitychange",qs),document.addEventListener("keydown",js))})}),In(()=>{un&&un.disconnect(),tn&&tn.disconnect(),wo&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(wo),be&&yt(be),pn&&yt(pn),tt!==null&&clearTimeout(tt),g!==null&&(clearTimeout(g),g=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",qs),document.removeEventListener("keydown",js))});function wi(){(m.value??h.value)?.focus()}return t({loadComposerForEdit:v,focusComposer:wi}),($e,Te)=>(_(),I("section",{class:De(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(_(),ke(Ite,{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:w.value,onOpenChanges:Te[0]||(Te[0]=He=>s("openChanges")),onCopyAll:Te[1]||(Te[1]=He=>p.value?.copyConversation()),onCopyFinalSummary:Te[2]||(Te[2]=He=>p.value?.copyFinalSummary()),onOpenPr:Te[3]||(Te[3]=He=>e.pr&&s("openPr",e.pr.url)),onRenameSession:Te[4]||(Te[4]=(He,Rt)=>s("renameSession",He,Rt)),onForkSession:Te[5]||(Te[5]=He=>s("forkSession",He)),onArchiveSession:Te[6]||(Te[6]=He=>s("archiveSession",He))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):re("",!0),e.conversationToc?(_(),ke($ie,{key:1,items:K.value,"active-turn-id":Y.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:_t},null,8,["items","active-turn-id","mobile","session-loading"])):re("",!0),C("div",Rie,[C("div",{ref:de,class:"panes chat-scroll",onScrollPassive:ue},[C("div",{class:De(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(_(),I(Pe,{key:0},[Te[54]||(Te[54]=C("div",{class:"empty-spacer"},null,-1)),C("div",Oie,[C("span",Pie,R(x(f)("composer.emptyConversationTitle")),1),C("span",Die,R(x(f)("composer.emptyConversation")),1),a.value?(_(),I("div",Bie,[se(Kt,{text:x(f)("conversation.switchWorkspace")},{default:we(()=>[C("button",{type:"button",class:"ws-pick-btn",onClick:Te[7]||(Te[7]=kt(He=>i.value=!i.value,["stop"]))},[se(Qe,{name:"folder",size:"sm"}),C("span",Fie,R(l.value),1),se(Qe,{class:De(["ws-pick-chev",{open:i.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),i.value?(_(),I("div",{key:0,class:"ws-pick-backdrop",onClick:Te[8]||(Te[8]=He=>i.value=!1)})):re("",!0),i.value?(_(),I("div",Hie,[(_(!0),I(Pe,null,nt(c.value,He=>(_(),I("button",{key:He.id,type:"button",class:De(["ws-pick-item",{on:He.id===e.activeWorkspaceId}]),onClick:kt(Rt=>d(He.id),["stop"])},[C("span",Wie,R(He.name),1),C("span",Uie,R(He.shortPath),1)],10,zie))),128)),u.value>0?(_(),I("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:Te[9]||(Te[9]=kt(He=>r.value=!r.value,["stop"]))},[C("span",null,R(x(f)("conversation.moreWorkspaces",{count:u.value})),1)])):re("",!0),Te[53]||(Te[53]=C("div",{class:"ws-pick-divider"},null,-1)),C("button",{type:"button",class:"ws-pick-action",onClick:Te[10]||(Te[10]=kt(He=>{i.value=!1,s("addWorkspace")},["stop"]))},[se(Qe,{name:"plus",size:"sm"}),C("span",null,R(x(f)("conversation.addWorkspace")),1)])])):re("",!0)])):(_(),I("button",{key:1,type:"button",class:"empty-add-workspace",onClick:Te[11]||(Te[11]=He=>s("addWorkspace"))},[se(Qe,{name:"folder-plus",size:"sm"}),C("span",null,R(x(f)("conversation.addWorkspace")),1)]))]),se(UM,{ref_key:"emptyComposerRef",ref:h,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,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,"hide-context":"",onSubmit:Zt,onSteer:Te[12]||(Te[12]=He=>s("steer",He)),onCommand:Te[13]||(Te[13]=He=>s("command",He)),onInterrupt:Ht,onUnqueue:Te[14]||(Te[14]=He=>s("unqueue",He)),onEditQueued:Te[15]||(Te[15]=He=>s("editQueued",He)),onSetPermission:Te[16]||(Te[16]=He=>s("setPermission",He)),onSetThinking:Te[17]||(Te[17]=He=>s("setThinking",He)),onTogglePlan:Te[18]||(Te[18]=He=>s("togglePlan")),onToggleSwarm:Te[19]||(Te[19]=He=>s("toggleSwarm")),onToggleGoal:Te[20]||(Te[20]=He=>s("toggleGoal")),onOpenBtw:Te[21]||(Te[21]=He=>s("command","/btw")),onCreateGoal:Te[22]||(Te[22]=He=>s("createGoal",He)),onControlGoal:Te[23]||(Te[23]=He=>s("controlGoal",He)),onFocusGoal:M,onCompact:Te[24]||(Te[24]=He=>s("compact")),onPickModel:Te[25]||(Te[25]=He=>s("pickModel")),onSelectModel:Te[26]||(Te[26]=He=>s("selectModel",He))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),Te[55]||(Te[55]=C("div",{class:"empty-spacer"},null,-1))],64)):(_(),ke(HM,{ref_key:"chatPaneRef",ref:p,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,running:e.running,sending:e.sending,"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":Z.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:Te[27]||(Te[27]=He=>s("openFile",He)),onOpenMedia:Te[28]||(Te[28]=He=>s("openMedia",He)),onCopyConversationCopied:y,onOpenThinking:Te[29]||(Te[29]=He=>s("openThinking",He)),onOpenCompaction:Te[30]||(Te[30]=He=>s("openCompaction",He)),onOpenAgent:Te[31]||(Te[31]=He=>s("openAgent",He)),onOpenToolDiff:Te[32]||(Te[32]=He=>s("openToolDiff",He)),onEditMessage:Qn,onLoadOlderMessages:lt,onUnqueue:Te[33]||(Te[33]=He=>s("unqueue",He)),onEditQueued:Ke,onReorderQueue:Ze},null,8,["turns","approvals","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],32),e.turns.length===0&&!e.sessionLoading?re("",!0):(_(),ke(Cie,{key:0,ref:z,style:en(me.value),"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,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":k.value,"dock-panel":E.value,"bash-tasks":O.value,"subagent-tasks":L.value,"bash-running":b.value,"subagent-running":T.value,"todo-done-count":N.value,"has-dock-work":S.value,todos:e.todos,"pending-question":ae.value,"question-busy-kind":ce.value,"pending-approval":ne.value,"approval-busy":Q.value,mobile:e.mobile,onToggleDockPanel:Te[34]||(Te[34]=He=>D(He)),onCloseDockPanel:Te[35]||(Te[35]=He=>F()),onOpenAgent:Te[36]||(Te[36]=He=>s("openAgent",He)),onAnswer:Ft,onDismiss:Te[37]||(Te[37]=He=>s("dismiss",He)),onApproval:sn,onCancelTask:Te[38]||(Te[38]=He=>s("cancelTask",He)),onControlGoal:Te[39]||(Te[39]=He=>s("controlGoal",He)),onSubmit:Zt,onSteer:Te[40]||(Te[40]=He=>s("steer",He)),onCommand:Te[41]||(Te[41]=He=>s("command",He)),onInterrupt:Ht,onSetPermission:Te[42]||(Te[42]=He=>s("setPermission",He)),onSetThinking:Te[43]||(Te[43]=He=>s("setThinking",He)),onTogglePlan:Te[44]||(Te[44]=He=>s("togglePlan")),onToggleSwarm:Te[45]||(Te[45]=He=>s("toggleSwarm")),onToggleGoal:Te[46]||(Te[46]=He=>s("toggleGoal")),onOpenBtw:Te[47]||(Te[47]=He=>s("command","/btw")),onCreateGoal:Te[48]||(Te[48]=He=>s("createGoal",He)),onFocusGoal:M,onCompact:Te[49]||(Te[49]=He=>s("compact")),onPickModel:Te[50]||(Te[50]=He=>s("pickModel")),onSelectModel:Te[51]||(Te[51]=He=>s("selectModel",He))},null,8,["style","session-id","running","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"]))]),se(Jr,{name:"pill"},{default:we(()=>[pe.value?(_(),I("button",{key:0,class:"newmsg-pill",style:en({bottom:`${Xe.value+12}px`}),"aria-label":x(f)("conversation.jumpToLatestAria"),onClick:Te[52]||(Te[52]=He=>Ie(!0))},[se(Qe,{class:"pill-chevron",name:"chevron-down",size:"md"}),qe(" "+R(x(f)("conversation.newMessages")),1)],12,qie)):re("",!0)]),_:1}),se(Jr,{name:"abort-toast"},{default:we(()=>[Ye.value?(_(),I("div",jie,[C("span",Vie,R(x(f)("conversation.manuallyAborted")),1)])):re("",!0)]),_:1})],2))}}),Qie=ut(Yie,[["__scopeId","data-v-f702e00f"]]),Xie=["aria-selected","onClick"],Zie=je({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(_(),I("div",{class:De(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(_(!0),I(Pe,null,nt(e.options,i=>(_(),I("button",{key:i.value,class:De(["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)},R(i.label),11,Xie))),128))],2))}}),os=ut(Zie,[["__scopeId","data-v-d1aaccd7"]]),Jie={class:"ui-panel-header__title"},ere={key:0,class:"ui-panel-header__sub"},tre=je({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(_(),I("div",{class:De(["ui-panel-header",{wrap:e.wrap}])},[C("span",Jie,R(e.title),1),se(Kt,{text:e.subtitle},{default:we(()=>[e.subtitle?(_(),I("span",ere,R(e.subtitle),1)):re("",!0)]),_:1},8,["text"]),On(t.$slots,"default",{},void 0,!0),e.closable?(_(),ke(Mn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:we(()=>[se(Qe,{name:"close",size:"sm"})]),_:1},8,["label"])):re("",!0)],2))}}),Zl=ut(tre,[["__scopeId","data-v-c47879ad"]]),nre={key:0,class:"fp-empty fp-error"},ore={key:1,class:"fp-empty"},sre={key:2,class:"fp-loading"},ire={class:"fp-path"},rre={class:"fp-meta"},lre={key:0,class:"fp-lines"},are={class:"fp-size"},cre={key:3,class:"fp-search"},ure=["placeholder"],dre={key:0,class:"fp-search-count"},fre=["href","aria-label"],hre={key:1,class:"fp-code"},pre={class:"fp-line-table"},mre=["data-line"],gre={class:"fp-gutter"},vre=["innerHTML"],yre={key:1,class:"fp-body fp-code"},kre={class:"fp-line-table"},bre=["data-line"],_re={class:"fp-gutter"},wre=["innerHTML"],Sre={key:2,class:"fp-body"},Cre=["srcdoc","title"],xre={key:1,class:"fp-code"},Are={class:"fp-line-table"},Mre=["data-line"],Tre={class:"fp-gutter"},Ere=["innerHTML"],Ire={key:3,class:"fp-body fp-pdf-wrap"},$re=["src","title"],Lre={key:1,class:"fp-binary-card"},Nre={class:"fp-binary-label"},Rre={key:4,class:"fp-body fp-table-wrap"},Ore={class:"fp-table"},Pre=["data-line"],Dre={key:5,class:"fp-body fp-image-wrap"},Bre=["src","alt"],Fre={key:1,class:"fp-binary-card"},Hre={class:"fp-binary-icon"},zre={class:"fp-binary-label"},Wre={key:6,class:"fp-body fp-code"},Ure={class:"fp-line-table"},qre=["data-line"],jre={class:"fp-gutter"},Vre=["innerHTML"],Kre={key:7,class:"fp-body fp-binary-wrap"},Gre={class:"fp-binary-card"},Yre={class:"fp-binary-icon"},Qre={class:"fp-binary-label"},Xre=je({__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}=Tt();function o(me,G){const ie=G?G.split("/").filter(Boolean):[];for(const de of me.split("/"))de===""||de==="."||(de===".."?ie.pop():ie.push(de));return ie.join("/")}const s=Vt("resolveImage",async me=>me),i=B(()=>{const me=c.file?.path??"",G=me.lastIndexOf("/");return G>0?me.slice(0,G):""});function r(me){if(/^(https?:|data:|blob:)/i.test(me)||me.startsWith("/"))return me;const G=i.value;return G?o(me,G):me}async function l(me){const G=r(me);return s?s(G):G}Nn("resolveImage",l);function a(me){let G=me.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(G)||G.startsWith("/"))return me;for(const de of["#","?"]){const z=G.indexOf(de);z!==-1&&(G=G.slice(0,z))}const ie=i.value;return{...me,path:o(G,ie)}}const c=e,u=t;function d(me){c.openFile?.(a(me))}const f=X(null),p=B(()=>{const me=c.file;if(!me)return"binary";const G=me.mime??"",ie=me.languageId??"",de=me.path.toLowerCase();return G==="text/markdown"||ie==="markdown"||ie==="md"||de.endsWith(".mdx")?"markdown":G==="application/json"||ie==="json"?"json":G==="text/html"||ie==="html"||de.endsWith(".html")||de.endsWith(".htm")?"html":G==="application/pdf"||de.endsWith(".pdf")?"pdf":G==="text/csv"||ie==="csv"||de.endsWith(".csv")?"csv":G.startsWith("image/")?"image":me.isBinary?"binary":G.startsWith("text/")||ie!==""?"text":"binary"});function h(me){const G=atob(me),ie=Uint8Array.from(G,de=>de.charCodeAt(0));return new TextDecoder().decode(ie)}const m=B(()=>{const me=c.file;if(!me)return"";if(me.encoding==="base64")try{return h(me.content)}catch{return me.content}return me.content}),w=B(()=>{if(p.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),k=B(()=>c.file?(p.value==="json"?w.value:m.value).split(`
266
+ `):[]),g=B(()=>c.file?p.value==="json"?w.value:m.value:""),v=X(""),y=X(0),M=B(()=>{const me=v.value.trim().toLowerCase();if(!me)return[];const G=[];return k.value.forEach((ie,de)=>{ie.toLowerCase().includes(me)&&G.push(de+1)}),G});Ve(v,()=>{y.value=0});function O(me,G=!1){me&&gt(()=>{const ie=f.value?.querySelector(".fp-body"),de=ie?.querySelector(`[data-line="${me}"]`);if(!ie||!de)return;G&&(ie.scrollTop=0);const z=ie.getBoundingClientRect(),Z=de.getBoundingClientRect(),pe=Z.top-z.top+ie.scrollTop;ie.scrollTop=pe-ie.clientHeight/2+Z.height/2})}Ve(()=>[c.file?.path,c.line],()=>O(c.line,!0),{immediate:!0});function L(me){const G=M.value;G.length!==0&&(y.value=(y.value+me+G.length)%G.length,O(G[y.value]))}function b(me){const G=M.value;return{target:c.line===me,hit:G.includes(me),active:G[y.value]===me}}function T(me){return me<1024?`${me} B`:me<1024*1024?`${(me/1024).toFixed(1)} KB`:`${(me/(1024*1024)).toFixed(1)} MB`}const $=X(!1),N=X(!1);function S(){c.file&&Go(g.value).then(me=>{me&&($.value=!0,setTimeout(()=>{$.value=!1},1400))})}function E(){c.file&&Go(c.file.path).then(me=>{me&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}const P=X("preview"),D=X("preview"),F=X("fit");function W(me){P.value=me}function K(me){D.value=me}function Y(me){F.value=me}Ve(p,me=>{P.value=me==="html"?"preview":"source",D.value="preview",F.value="fit"});const q=B(()=>{const me=c.file;return!me||p.value!=="image"?null:me.sourceUrl?me.sourceUrl:me.encoding==="base64"?`data:${me.mime};base64,${me.content}`:me.mime==="image/svg+xml"?`data:${me.mime};charset=utf-8,${encodeURIComponent(me.content)}`:null}),ae=B(()=>{const me=c.file;return!me||p.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:me.encoding==="base64"?`data:${me.mime};base64,${me.content}`:null}),ce=B(()=>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:;">`,m.value].join(""):"");function ne(me){const G=[];let ie="",de=!1;for(let z=0;z<me.length;z++){const Z=me[z];Z==='"'&&me[z+1]==='"'?(ie+='"',z++):Z==='"'?de=!de:Z===","&&!de?(G.push(ie),ie=""):ie+=Z}return G.push(ie),G}const Q=B(()=>k.value.slice(0,200).map(ne));function ee(me){return me.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function ye(){const me=c.file;if(!me)return"";const G=me.languageId?.toLowerCase();return G||(me.path.split(".").pop()?.toLowerCase()??"")}function xe(me){const G=ye();let ie=ee(me);return p.value==="json"||G==="json"||G==="jsonc"?(ie=ie.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),ie=ie.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),ie=ie.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ie=ie.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ie):p.value==="html"||G==="html"||G==="xml"||G==="svg"?(ie=ie.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ie=ie.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),ie=ie.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ie):(ie=ie.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>'),ie=ie.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),ie=ie.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ie)}function Xe(me,G=55){return!me||me.length<=G?me:"…"+me.slice(me.length-G+1)}return(me,G)=>(_(),I("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(_(),I("div",nre,[C("span",null,R(e.error),1),e.closable?(_(),ke(Dt,{key:0,variant:"secondary",size:"sm",onClick:G[0]||(G[0]=ie=>u("close"))},{default:we(()=>[qe(R(x(n)("filePreview.close")),1)]),_:1})):re("",!0)])):!e.file&&!e.loading?(_(),I("div",ore,R(x(n)("filePreview.empty")),1)):e.loading?(_(),I("div",sre,[G[7]||(G[7]=C("span",{class:"spinner"},null,-1)),C("span",null,R(x(n)("filePreview.loading")),1)])):e.file?(_(),I(Pe,{key:3},[se(Zl,{wrap:"",title:x(n)("common.preview"),closable:e.closable,"close-label":x(n)("filePreview.close"),onClose:G[6]||(G[6]=ie=>u("close"))},{default:we(()=>[se(Kt,{text:e.file.path},{default:we(()=>[C("span",ire,R(Xe(e.file.path)),1)]),_:1},8,["text"]),C("span",rre,[e.file.lineCount?(_(),I("span",lre,R(x(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):re("",!0),C("span",are,R(T(e.file.size)),1)]),p.value==="html"?(_(),ke(os,{key:0,"model-value":P.value,size:"sm",options:[{value:"preview",label:x(n)("filePreview.preview")},{value:"source",label:x(n)("filePreview.source")}],"onUpdate:modelValue":W},null,8,["model-value","options"])):re("",!0),p.value==="markdown"?(_(),ke(os,{key:1,"model-value":D.value,size:"sm",options:[{value:"preview",label:x(n)("filePreview.preview")},{value:"source",label:x(n)("filePreview.source")}],"onUpdate:modelValue":K},null,8,["model-value","options"])):re("",!0),p.value==="image"?(_(),ke(os,{key:2,"model-value":F.value,size:"sm",options:[{value:"fit",label:x(n)("filePreview.fit")},{value:"actual",label:x(n)("filePreview.actual")}],"onUpdate:modelValue":Y},null,8,["model-value","options"])):re("",!0),p.value==="text"||p.value==="json"||p.value==="html"||p.value==="csv"?(_(),I("div",cre,[An(C("input",{"onUpdate:modelValue":G[1]||(G[1]=ie=>v.value=ie),class:"fp-search-input",type:"search",placeholder:x(n)("filePreview.search")},null,8,ure),[[us,v.value]]),v.value.trim()?(_(),I("span",dre,R(M.value.length),1)):re("",!0),se(Mn,{size:"sm",disabled:M.value.length===0,label:x(n)("filePreview.prevMatch"),onClick:G[2]||(G[2]=ie=>L(-1))},{default:we(()=>[se(Qe,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),se(Mn,{size:"sm",disabled:M.value.length===0,label:x(n)("filePreview.nextMatch"),onClick:G[3]||(G[3]=ie=>L(1))},{default:we(()=>[se(Qe,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):re("",!0),se(Mn,{size:"sm",class:De({copied:N.value}),label:N.value?x(n)("filePreview.copied"):x(n)("filePreview.copyPath"),onClick:E},{default:we(()=>[N.value?(_(),ke(Qe,{key:1,class:"fp-check",name:"check",size:"md"})):(_(),ke(Qe,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(_(),ke(Mn,{key:4,size:"sm",label:x(n)("filePreview.openInEditor"),onClick:G[4]||(G[4]=ie=>u("openExternal"))},{default:we(()=>[se(Qe,{name:"external-link",size:"md"})]),_:1},8,["label"])):re("",!0),e.externalActions?(_(),ke(Mn,{key:5,size:"sm",label:x(n)("filePreview.reveal"),onClick:G[5]||(G[5]=ie=>u("reveal"))},{default:we(()=>[se(Qe,{name:"folder",size:"md"})]),_:1},8,["label"])):re("",!0),e.downloadUrl?(_(),I("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":x(n)("filePreview.download")},[se(Qe,{name:"download",size:"md"})],8,fre)):re("",!0),!e.file.isBinary&&p.value!=="image"?(_(),ke(Mn,{key:7,size:"sm",class:De({copied:$.value}),label:$.value?x(n)("filePreview.copied"):x(n)("filePreview.copy"),onClick:S},{default:we(()=>[$.value?(_(),ke(Qe,{key:1,class:"fp-check",name:"check",size:"md"})):(_(),ke(Qe,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):re("",!0)]),_:1},8,["title","closable","close-label"]),p.value==="markdown"?(_(),I("div",{key:0,class:De(["fp-body",{"fp-markdown":D.value==="preview"}])},[D.value==="preview"?(_(),ke(Wp,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(_(),I("div",hre,[C("div",pre,[(_(!0),I(Pe,null,nt(k.value,(ie,de)=>(_(),I("div",{key:de,class:De(["fp-line-row",b(de+1)]),"data-line":de+1},[C("span",gre,R(de+1),1),C("span",{class:"fp-line-text",innerHTML:xe(ie)},null,8,vre)],10,mre))),128))])]))],2)):p.value==="json"?(_(),I("div",yre,[C("div",kre,[(_(!0),I(Pe,null,nt(k.value,(ie,de)=>(_(),I("div",{key:de,class:De(["fp-line-row",b(de+1)]),"data-line":de+1},[C("span",_re,R(de+1),1),C("span",{class:"fp-line-text",innerHTML:xe(ie)},null,8,wre)],10,bre))),128))])])):p.value==="html"?(_(),I("div",Sre,[P.value==="preview"?(_(),I("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ce.value,title:e.file.path},null,8,Cre)):(_(),I("div",xre,[C("div",Are,[(_(!0),I(Pe,null,nt(k.value,(ie,de)=>(_(),I("div",{key:de,class:De(["fp-line-row",b(de+1)]),"data-line":de+1},[C("span",Tre,R(de+1),1),C("span",{class:"fp-line-text",innerHTML:xe(ie)},null,8,Ere)],10,Mre))),128))])]))])):p.value==="pdf"?(_(),I("div",Ire,[ae.value?(_(),I("iframe",{key:0,class:"fp-pdf-frame",src:ae.value,title:e.file.path},null,8,$re)):(_(),I("div",Lre,[C("span",Nre,R(x(n)("filePreview.pdfNoPreview")),1)]))])):p.value==="csv"?(_(),I("div",Rre,[C("table",Ore,[C("tbody",null,[(_(!0),I(Pe,null,nt(Q.value,(ie,de)=>(_(),I("tr",{key:de,class:De(b(de+1)),"data-line":de+1},[C("th",null,R(de+1),1),(_(!0),I(Pe,null,nt(ie,(z,Z)=>(_(),I("td",{key:Z},R(z),1))),128))],10,Pre))),128))])])])):p.value==="image"?(_(),I("div",Dre,[q.value?(_(),I("img",{key:0,src:q.value,alt:e.file.path,class:De(["fp-image",{actual:F.value==="actual"}])},null,10,Bre)):(_(),I("div",Fre,[C("span",Hre,[se(Qe,{name:"image-off",size:"lg"})]),C("span",zre,R(x(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:T(e.file.size)})),1)]))])):p.value==="text"?(_(),I("div",Wre,[C("div",Ure,[(_(!0),I(Pe,null,nt(k.value,(ie,de)=>(_(),I("div",{key:de,class:De(["fp-line-row",b(de+1)]),"data-line":de+1},[C("span",jre,R(de+1),1),C("span",{class:"fp-line-text",innerHTML:xe(ie)},null,8,Vre)],10,qre))),128))])])):(_(),I("div",Kre,[C("div",Gre,[C("span",Yre,[se(Qe,{name:"file-off",size:"lg"})]),C("span",Qre,R(x(n)("filePreview.binaryNoPreview",{mime:e.file.mime||x(n)("filePreview.unknownType"),size:T(e.file.size)})),1)])]))],64)):re("",!0)],512))}}),Zre=ut(Xre,[["__scopeId","data-v-62bfaf2d"]]),Jre={class:"tp"},ele=je({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=X(null);return Ve(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||gt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(_(),I("div",Jre,[se(Zl,{title:x(s)("common.preview"),subtitle:e.subtitle??x(s)("thinking.panelTitle"),"close-label":x(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),C("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},R(e.text),513)]))}}),pC=ut(ele,[["__scopeId","data-v-6af94b37"]]),tle={class:"ap"},nle={key:0,class:"ap-type"},ole={key:1,class:"ap-reason"},sle={key:2,class:"ap-field"},ile={class:"ap-field-body"},rle={key:3,class:"ap-field"},lle={class:"ap-field-body ap-live"},ale={key:4,class:"ap-field"},cle={class:"ap-field-body ap-progress"},ule={key:0,class:"ap-call"},dle={key:1,class:"ap-output"},fle=["onClick"],hle={key:5,class:"ap-field"},ple={class:"ap-field-body"},mle=8,mC=5,gC=2,gle=je({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=B(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=B(()=>(n.member.text??"").trimEnd());function l(m){const w=[];let k=null,g=0;for(const v of m)v.startsWith("Calling ")?(k={key:`g${g++}`,call:v,output:[]},w.push(k)):k?k.output.push(v):(k={key:`g${g++}`,call:"",output:[v]},w.push(k));return w}const a=B(()=>l(i.value)),c=X(new Set);function u(m){return c.value.has(m)}function d(m){const w=new Set(c.value);w.has(m)?w.delete(m):w.add(m),c.value=w}function f(m){return m.output.length-mC-gC}function p(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const h=X(null);return Ve(()=>i.value.length+r.value.length,()=>{const m=h.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||gt(()=>{h.value&&(h.value.scrollTop=h.value.scrollHeight)})},{immediate:!0}),(m,w)=>(_(),I("div",tle,[se(Zl,{title:x(s)("common.preview"),subtitle:e.member.name,"close-label":x(s)("thinking.close"),onClose:w[0]||(w[0]=k=>o("close"))},{default:we(()=>[se(Do,{variant:"neutral",size:"sm",class:"ap-phase"},{default:we(()=>[qe(R(p(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),C("div",{ref_key:"bodyEl",ref:h,class:"ap-body"},[e.member.subagentType?(_(),I("div",nle,R(e.member.subagentType),1)):re("",!0),e.member.suspendedReason?(_(),I("div",ole,R(e.member.suspendedReason),1)):re("",!0),e.member.prompt?(_(),I("div",sle,[w[1]||(w[1]=C("span",{class:"ap-field-label"},"Task",-1)),C("div",ile,R(e.member.prompt),1)])):re("",!0),r.value?(_(),I("div",rle,[w[2]||(w[2]=C("span",{class:"ap-field-label"},"Output",-1)),C("div",lle,R(r.value),1)])):re("",!0),a.value.length>0?(_(),I("div",ale,[w[4]||(w[4]=C("span",{class:"ap-field-label"},"Progress",-1)),C("div",cle,[(_(!0),I(Pe,null,nt(a.value,k=>(_(),I("div",{key:k.key,class:"ap-group"},[k.call?(_(),I("div",ule,[w[3]||(w[3]=C("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),qe(" "+R(k.call),1)])):re("",!0),k.output.length>0?(_(),I("div",dle,[k.output.length<=mle||u(k.key)?(_(!0),I(Pe,{key:0},nt(k.output,(g,v)=>(_(),I("div",{key:v,class:"ap-out-line"},R(g),1))),128)):(_(),I(Pe,{key:1},[(_(!0),I(Pe,null,nt(k.output.slice(0,mC),(g,v)=>(_(),I("div",{key:v,class:"ap-out-line"},R(g),1))),128)),C("button",{type:"button",class:"ap-fold",onClick:g=>d(k.key)}," … ("+R(f(k))+" more) ",9,fle),(_(!0),I(Pe,null,nt(k.output.slice(-gC),(g,v)=>(_(),I("div",{key:"t"+v,class:"ap-out-line"},R(g),1))),128))],64))])):re("",!0)]))),128))])])):re("",!0),e.member.summary?(_(),I("div",hle,[w[5]||(w[5]=C("span",{class:"ap-field-label"},"Result",-1)),C("div",ple,R(e.member.summary),1)])):re("",!0)],512)]))}}),vle=ut(gle,[["__scopeId","data-v-715bd93e"]]),yle={class:"diff-lines"},kle={key:0,class:"hunk-text"},ble={class:"dl-gutter old"},_le={class:"dl-gutter new"},wle={class:"dl-sign"},Sle={class:"dl-text"},Cle=je({__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)=>(_(),I("div",yle,[(_(!0),I(Pe,null,nt(e.lines,(r,l)=>(_(),I("div",{key:l,class:De(["dl",o(r)])},[r.type==="hunk"?(_(),I("span",kle,R(r.text),1)):(_(),I(Pe,{key:1},[C("span",ble,R(t(r)),1),C("span",_le,R(n(r)),1),C("span",wle,R(r.type==="add"?"+":r.type==="del"?"-":" "),1),C("span",Sle,R(r.text),1)],64))],2))),128))]))}}),jM=ut(Cle,[["__scopeId","data-v-2f6bc1cc"]]),xle={class:"tdp"},Ale={class:"tdp-body"},Mle={key:1,class:"tdp-output"},Tle={key:2,class:"tdp-empty"},Ele=je({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=Tt();return(s,i)=>(_(),I("div",xle,[se(Zl,{title:e.target.title,subtitle:e.target.path,"close-label":x(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),C("div",Ale,[e.target.lines&&e.target.lines.length>0?(_(),ke(jM,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(_(),I("div",Mle,[(_(!0),I(Pe,null,nt(e.target.output,(r,l)=>(_(),I("div",{key:l},R(r),1))),128))])):(_(),I("div",Tle,R(x(o)("diff.noDiff")),1))])]))}}),Ile=ut(Ele,[["__scopeId","data-v-76f2fbca"]]),$le={class:"sc"},Lle={key:0,class:"sc-empty"},Nle={key:2,class:"sc-loading","aria-hidden":"true"},Rle={class:"sc-composer"},Ole=["placeholder"],Ple=["disabled"],Dle=je({__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}=Tt(),i=B(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=B(()=>n.title?.trim()||s("sideChat.title")),l=B(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=X(""),c=X(null),u=X(null);function d(){const k=a.value.trim();k&&(o("send",k),a.value="",gt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const k=u.value;k&&(k.scrollTop=k.scrollHeight)}const p=B(()=>{const k=n.turns;if(k.length===0)return"0";const g=k.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((M,O)=>M+O.name.length+(O.arg?.length??0)+(O.output?.join("").length??0),0)??0;return`${k.length}:${g.text.length}:${v}:${y}`});Ve(p,async()=>{!n.running&&!n.sending||(await gt(),f())});const h=B(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(k){k.key==="Enter"&&!k.shiftKey&&!k.isComposing&&(k.preventDefault(),d())}function w(){const k=c.value;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`)}return(k,g)=>(_(),I("div",$le,[se(Zl,{title:r.value,subtitle:l.value,"close-label":x(s)("thinking.close"),onClose:g[0]||(g[0]=v=>o("close"))},null,8,["title","subtitle","close-label"]),C("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(_(),I("div",Lle,R(x(s)("sideChat.empty")),1)):(_(),ke(HM,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),h.value?(_(),I("div",Nle,[se(FM)])):re("",!0)],512),C("div",Rle,[An(C("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:x(s)("sideChat.placeholder"),onInput:w,onKeydown:m},null,40,Ole),[[us,a.value]]),se(Kt,{text:x(s)("sideChat.send")},{default:we(()=>[C("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[se(Qe,{name:"arrow-right",size:"sm"})],8,Ple)]),_:1},8,["text"])])]))}}),Ble=ut(Dle,[["__scopeId","data-v-9ee5df02"]]),Fle={class:"changes-pane"},Hle={class:"dv-path"},zle={class:"diff-head"},Wle={class:"back-label"},Ule={key:0,class:"empty-state"},qle={key:1,class:"dv-lines-wrap"},jle={key:2,class:"empty-state"},Vle={class:"dv-change-count"},Kle={class:"ch-head"},Gle={class:"br-label"},Yle={class:"br-name"},Qle={key:0,class:"sync-info"},Xle={key:0,class:"ahead"},Zle={key:0,class:"behind"},Jle={key:1,class:"empty-head"},eae={key:0,class:"ch-list"},tae=["onClick"],nae={class:"fpath"},oae={key:1,class:"ch-list ch-tree"},sae={class:"tree-list"},iae=["onClick"],rae={class:"tree-name"},lae=["onClick"],aae={class:"tree-name"},cae={key:2,class:"empty-state"},uae={key:3,class:"empty-state"},dae=je({__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}=Tt(),o=e,s=t;function i(N){const S=N.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(N){return r[i(N)]??"?"}function a(N,S=60){return N.length<=S?N:"…"+N.slice(N.length-S+1)}const c=B(()=>o.gitInfo!==null),u=B(()=>o.changes.length>0),d=B(()=>(o.selectedDiffPath??null)!==null),f=B(()=>o.mode==="detail"||o.mode==="full"&&d.value),p=B(()=>o.fileDiff??[]),h=B(()=>o.fileDiffLoading===!0);function m(N){s("open",N)}function w(){s("back")}function k(){s("close")}const g=X("list");function v(N){g.value=N}function y(N){const S={children:[]},E=[...N].sort((P,D)=>P.path.localeCompare(D.path));for(const P of E){const D=P.path.split("/");let F=S;for(let W=0;W<D.length;W++){const K=D[W],Y=W===D.length-1,q=D.slice(0,W+1).join("/");let ae=F.children.find(ce=>ce.name===K&&ce.kind===(Y?"file":"folder"));ae||(ae={name:K,path:q,kind:Y?"file":"folder",status:Y?P.status:void 0,children:[]},F.children.push(ae)),F=ae}}return S.children}const M=B(()=>y(o.changes)),O=X(new Set);function L(N){return!O.value.has(N)}const b=B(()=>{const N=[];function S(E,P){for(const D of E)N.push({node:D,depth:P}),D.kind==="folder"&&L(D.path)&&S(D.children,P+1)}return S(M.value,0),N});function T(N){const S=new Set(O.value);S.has(N.path)?S.delete(N.path):S.add(N.path),O.value=S}function $(N){return`${16+N*16}px`}return(N,S)=>(_(),I("div",Fle,[f.value?(_(),I(Pe,{key:0},[se(Zl,{title:x(n)("diff.title"),closable:e.closable,"close-label":x(n)("diff.close"),onClose:k},{default:we(()=>[se(Kt,{text:e.selectedDiffPath??""},{default:we(()=>[C("span",Hle,R(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),C("div",zle,[e.hideBack?re("",!0):(_(),ke(Dt,{key:0,variant:"ghost",size:"sm",onClick:w},{default:we(()=>[S[0]||(S[0]=C("span",{"aria-hidden":"true"},"←",-1)),C("span",Wle,R(x(n)("diff.back")),1)]),_:1}))]),h.value?(_(),I("div",Ule,R(x(n)("diff.loading")),1)):p.value.length>0?(_(),I("div",qle,[se(jM,{lines:p.value},null,8,["lines"])])):(_(),I("div",jle,R(x(n)("diff.noDiff")),1))],64)):(_(),I(Pe,{key:1},[se(Zl,{title:x(n)("diff.title"),closable:e.closable,"close-label":x(n)("diff.close"),onClose:k},{default:we(()=>[C("span",Vle,R(x(n)("diff.changeCount",{count:e.changes.length})),1),se(os,{"model-value":g.value,size:"sm",options:[{value:"list",label:x(n)("diff.list")},{value:"tree",label:x(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),C("div",Kle,[c.value?(_(),I(Pe,{key:0},[C("span",Gle,R(x(n)("diff.branch")),1),C("span",Yle,R(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(_(),I("span",Qle,[se(Kt,{text:x(n)("diff.aheadTitle")},{default:we(()=>[e.gitInfo.ahead>0?(_(),I("span",Xle,"↑"+R(e.gitInfo.ahead),1)):re("",!0)]),_:1},8,["text"]),se(Kt,{text:x(n)("diff.behindTitle")},{default:we(()=>[e.gitInfo.behind>0?(_(),I("span",Zle,"↓"+R(e.gitInfo.behind),1)):re("",!0)]),_:1},8,["text"])])):re("",!0)],64)):(_(),I("span",Jle,R(x(n)("diff.empty")),1))]),u.value&&g.value==="list"?(_(),I("div",eae,[(_(!0),I(Pe,null,nt(e.changes,E=>(_(),ke(Kt,{key:E.path,text:E.path},{default:we(()=>[C("button",{type:"button",class:"ch-row",onClick:P=>m(E.path)},[C("span",{class:De(["badge",i(E.status)])},R(l(E.status)),3),C("span",nae,R(a(E.path)),1)],8,tae)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(_(),I("div",oae,[C("ul",sae,[(_(!0),I(Pe,null,nt(b.value,({node:E,depth:P})=>(_(),I("li",{key:E.path,class:"tree-node"},[E.kind==="folder"?(_(),I("button",{key:0,type:"button",class:"tree-row tree-folder",style:en({paddingLeft:$(P)}),onClick:D=>T(E)},[se(Qe,{class:"tree-icon",name:"folder-solid",size:"sm"}),C("span",rae,R(E.name),1)],12,iae)):(_(),ke(Kt,{key:1,text:E.path},{default:we(()=>[C("button",{type:"button",class:"tree-row tree-file",style:en({paddingLeft:$(P)}),onClick:D=>m(E.path)},[C("span",{class:De(["badge",i(E.status)])},R(l(E.status)),3),C("span",aae,R(E.name),1)],12,lae)]),_:2},1032,["text"]))]))),128))])])):c.value?(_(),I("div",cae,R(x(n)("diff.clean")),1)):(_(),I("div",uae,R(x(n)("diff.empty")),1))],64))]))}}),fae=ut(dae,[["__scopeId","data-v-7778610a"]]);function Ey(e,t){let n=null;Sn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,gt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),so(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const hae=["type","value","placeholder","disabled","readonly"],pae=je({__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=X();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)=>(_(),I("input",{ref_key:"el",ref:s,class:De(["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,hae))}}),Kl=ut(pae,[["__scopeId","data-v-340f0da2"]]),mae={class:"search-wrap"},gae={key:0,class:"tab-strip"},vae={key:1,class:"state-row"},yae={key:2,class:"state-row unavail"},kae={key:3,class:"model-list"},bae=["aria-selected","onClick","onMouseenter"],_ae={class:"check"},wae={class:"model-main"},Sae={class:"model-name"},Cae={class:"model-id"},xae={key:0,class:"caps"},Aae={class:"model-provider"},Mae={class:"model-ctx"},Tae={key:0,class:"empty"},Eae={class:"footer-hint"},Iae=je({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=B(()=>new Set(o.starredIds??[]));function r(v){return i.value.has(v)}const l=X(""),a=X(null),c=X(null),u=X("all");Ey(c,a);const d=B(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const M of o.models)v.has(M.provider)||(v.add(M.provider),y.push({id:M.provider,label:M.provider}));return y}),f=B(()=>{const v=l.value.toLowerCase().trim(),y=o.models.filter(M=>{if(u.value!=="all"&&M.provider!==u.value)return!1;const O=(M.displayName??M.model).toLowerCase().includes(v),L=M.provider.toLowerCase().includes(v),b=M.id.toLowerCase().includes(v);return!v||O||L||b});return u.value!=="all"?y:y.sort((M,O)=>{const L=r(M.id)?1:0;return(r(O.id)?1:0)-L})}),p=B(()=>f.value),h=X(0);Ve([l,u],()=>{h.value=0}),Ve(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ve(p,v=>{h.value=Math.min(h.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){s("close");return}if(v.key==="ArrowDown")v.preventDefault(),h.value=Math.min(h.value+1,p.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),h.value=Math.max(h.value-1,0);else if(v.key==="Enter"){const y=p.value[h.value];y&&s("select",y.id)}}Sn(()=>{document.addEventListener("keydown",m)}),In(()=>{document.removeEventListener("keydown",m)});function w(v){s("select",v)}function k(v){return p.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(_(),ke(mr,{open:!0,"close-on-esc":!1,title:x(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=M=>s("close"))},{default:we(()=>[C("div",{ref_key:"dialogRef",ref:c,class:"mp"},[C("div",mae,[se(Kl,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=M=>l.value=M),placeholder:x(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(_(),I("div",gae,[(_(!0),I(Pe,null,nt(d.value,M=>(_(),ke(Dt,{key:M.id,variant:M.id===u.value?"secondary":"ghost",size:"sm",onClick:O=>g(M.id)},{default:we(()=>[qe(R(M.label),1)]),_:2},1032,["variant","onClick"]))),128))])):re("",!0),e.loading?(_(),I("div",vae,[se(ai,{size:"sm"}),C("span",null,R(x(n)("model.loading")),1)])):e.unavailable?(_(),I("div",yae,[se(Qe,{name:"alert-triangle",size:"lg"}),C("span",null,R(x(n)("model.unavailable")),1)])):(_(),I("div",kae,[(_(!0),I(Pe,null,nt(p.value,M=>(_(),I("div",{key:M.id,class:De(["model-row",{"is-current":M.id===e.current,"is-selected":k(M)===h.value}]),role:"option","aria-selected":M.id===e.current,onClick:O=>w(M.id),onMouseenter:O=>h.value=k(M)},[C("span",_ae,[M.id===e.current?(_(),ke(Qe,{key:0,name:"check",size:"sm"})):re("",!0)]),C("span",wae,[C("span",Sae,R(M.displayName??M.model),1),C("span",Cae,R(M.id),1),M.capabilities&&M.capabilities.length>0?(_(),I("span",xae,[(_(!0),I(Pe,null,nt(M.capabilities,O=>(_(),ke(Do,{key:O,variant:"info",size:"sm"},{default:we(()=>[qe(R(O),1)]),_:2},1024))),128))])):re("",!0)]),C("span",Aae,R(M.provider),1),C("span",Mae,R(x(n)("model.contextSuffix",{size:Math.round(M.maxContextSize/1e3)})),1),se(Mn,{size:"sm",label:r(M.id)?x(n)("model.unstarTitle"):x(n)("model.starTitle"),onClick:kt(O=>s("toggle-star",M.id),["stop"])},{default:we(()=>[r(M.id)?(_(),ke(Qe,{key:0,name:"star",size:"md"})):(_(),ke(Qe,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,bae))),128)),p.value.length===0&&!e.loading&&!e.unavailable?(_(),I("div",Tae,R(o.models.length===0?x(n)("model.emptyNoModels"):x(n)("model.emptyNoMatch")),1)):re("",!0)])),C("div",Eae,R(x(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),$ae=ut(Iae,[["__scopeId","data-v-e93073d7"]]),Lae={key:0,class:"ui-field__label"},Nae={key:1,class:"ui-field__error"},Rae={key:2,class:"ui-field__hint"},Oae=je({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(_(),I("div",{class:De(["ui-field",{"has-error":!!e.error}])},[e.label?(_(),I("label",Lae,R(e.label),1)):re("",!0),On(t.$slots,"default",{},void 0,!0),e.error?(_(),I("span",Nae,R(e.error),1)):e.hint?(_(),I("span",Rae,R(e.hint),1)):re("",!0)],2))}}),uu=ut(Oae,[["__scopeId","data-v-49bce958"]]),Pae=["value","disabled"],Dae=je({__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)=>(_(),I("select",{class:De(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[On(s.$slots,"default",{},void 0,!0)],42,Pae))}}),Kv=ut(Dae,[["__scopeId","data-v-92a040fd"]]),Bae={class:"prov-list"},Fae={key:0,class:"state-row"},Hae={key:1,class:"state-row unavail"},zae={key:2,class:"empty"},Wae={class:"prov-info"},Uae={class:"prov-type"},qae={key:0,class:"prov-url"},jae={class:"prov-meta"},Vae={key:0},Kae={class:"prov-actions"},Gae={key:0,class:"add-section"},Yae={key:0,class:"add-btns"},Qae={key:1,class:"add-form"},Xae=["value"],Zae={key:0,class:"add-error"},Jae={class:"form-btns"},ece={class:"footer-hint"},tce=je({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:o}=cl(),s=X(null);Ey(s);const i=t;async function r(k){await o({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",k)}const l=X(!1),a=Bo({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=X(""),u=["moonshot","anthropic","openai","custom"];function d(){a.type="moonshot",a.apiKey="",a.baseUrl="",a.defaultModel="",c.value="",l.value=!0}function f(){l.value=!1}function p(){if(!a.apiKey.trim()){c.value=n("providers.apiKeyRequired");return}c.value="",i("add",{type:a.type,apiKey:a.apiKey.trim()||void 0,baseUrl:a.baseUrl.trim()||void 0,defaultModel:a.defaultModel.trim()||void 0}),l.value=!1}function h(k){if(k.key==="Escape"){if(l.value){f();return}i("close")}}Sn(()=>document.addEventListener("keydown",h)),In(()=>document.removeEventListener("keydown",h));function m(k){return k==="connected"?"var(--color-success)":k==="error"?"var(--color-danger)":"var(--color-text-faint)"}function w(k){return n(k==="connected"?"providers.status.connected":k==="error"?"providers.status.error":"providers.status.unconfigured")}return(k,g)=>(_(),ke(mr,{open:!0,"close-on-esc":!1,title:x(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:we(()=>[C("div",{ref_key:"dialogRef",ref:s,class:"pm"},[C("div",Bae,[e.loading?(_(),I("div",Fae,[se(ai,{size:"sm"}),C("span",null,R(x(n)("providers.loading")),1)])):e.unavailable?(_(),I("div",Hae,[se(Qe,{name:"alert-triangle",size:"md"}),C("span",null,R(x(n)("providers.unavailable")),1)])):e.providers.length===0?(_(),I("div",zae,R(x(n)("providers.empty")),1)):(_(!0),I(Pe,{key:3},nt(e.providers,v=>(_(),I("div",{key:v.id,class:"prov-row"},[se(Kt,{text:w(v.status)},{default:we(()=>[C("span",{class:De(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:en(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),C("div",Wae,[C("span",Uae,R(v.type),1),v.baseUrl?(_(),I("span",qae,R(v.baseUrl),1)):re("",!0),C("span",jae,[se(Do,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:we(()=>[qe(R(v.hasApiKey?x(n)("providers.keySet"):x(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(_(),I("span",Vae," · "+R(x(n)("providers.modelCount",{count:v.models.length})),1)):re("",!0)])]),C("div",Kae,[se(Kt,{text:x(n)("providers.refreshTitle",{type:v.type})},{default:we(()=>[se(Dt,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:we(()=>[qe(R(x(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),se(Kt,{text:x(n)("providers.deleteTitle",{type:v.type})},{default:we(()=>[se(Dt,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:we(()=>[qe(R(x(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?re("",!0):(_(),I("div",Gae,[l.value?(_(),I("div",Qae,[se(uu,{label:x(n)("providers.fieldType")},{default:we(()=>[se(Kv,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:we(()=>[(_(),I(Pe,null,nt(u,v=>C("option",{key:v,value:v},R(v),9,Xae)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),se(uu,{label:x(n)("providers.fieldApiKey")},{default:we(()=>[se(Kl,{modelValue:a.apiKey,"onUpdate:modelValue":g[3]||(g[3]=v=>a.apiKey=v),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),se(uu,{label:x(n)("providers.fieldBaseUrl")},{default:we(()=>[se(Kl,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:x(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),se(uu,{label:x(n)("providers.fieldDefaultModel")},{default:we(()=>[se(Kl,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:x(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(_(),I("div",Zae,R(c.value),1)):re("",!0),C("div",Jae,[se(Dt,{variant:"primary",size:"sm",onClick:p},{default:we(()=>[qe(R(x(n)("providers.add")),1)]),_:1}),se(Dt,{variant:"secondary",size:"sm",onClick:f},{default:we(()=>[qe(R(x(n)("common.cancel")),1)]),_:1})])])):(_(),I("div",Yae,[se(Dt,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:we(()=>[se(Qe,{name:"user",size:"sm"}),qe(" "+R(x(n)("providers.loginKimi")),1)]),_:1}),se(Dt,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:we(()=>[se(Qe,{name:"user",size:"sm"}),qe(" "+R(x(n)("providers.loginAnthropic")),1)]),_:1}),se(Dt,{variant:"primary",size:"sm",onClick:d},{default:we(()=>[se(Qe,{name:"plus",size:"sm"}),qe(" "+R(x(n)("providers.enterApiKey")),1)]),_:1})]))])),C("div",ece,R(x(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),nce=ut(tce,[["__scopeId","data-v-fb6f1365"]]),oce={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},sce={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},ice={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},y1=je({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(_(),I("svg",oce,[...n[0]||(n[0]=[C("circle",{cx:"18",cy:"18",r:"15"},null,-1),C("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(_(),I("svg",sce,[...n[1]||(n[1]=[C("circle",{cx:"14",cy:"14",r:"12"},null,-1),C("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),C("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(_(),I("svg",ice,[...n[2]||(n[2]=[C("path",{d:"M14 3 L26 24 H2 Z"},null,-1),C("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),C("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),rce={key:0,class:"center-body"},lce={class:"center-text"},ace={key:1,class:"nb"},cce={class:"nb-lead"},uce=["href"],dce={class:"nb-or"},fce={class:"nb-fallback"},hce={class:"nb-fb-text"},pce=["href"],mce={class:"nb-code-row"},gce={class:"nb-code"},vce={class:"nb-status"},yce={class:"nb-status-text"},kce={class:"nb-countdown"},bce={key:2,class:"center-body"},_ce={class:"center-text success-text"},wce={class:"center-hint"},Sce={class:"center-body"},Cce={class:"center-text err-text"},xce={class:"center-hint"},Ace={class:"actions"},Mce={class:"center-body"},Tce={class:"center-text warn-text"},Ece={class:"center-hint"},Ice={class:"actions"},$ce=je({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=X(!0),s=t,i=e,r=X("starting"),l=X(null),a=X(0),c=X(!1);let u=null,d=null;Sn(async()=>{await f()}),In(()=>{m()});async function f(){m(),l.value=null,r.value="starting";const y=await i.onStartOAuthLogin();if(!y){r.value="error";return}l.value={flowId:y.flowId,verificationUri:y.verificationUri,verificationUriComplete:y.verificationUriComplete,userCode:y.userCode,expiresIn:y.expiresIn,interval:y.interval},a.value=y.expiresIn,r.value="device-code",p(),h(y.interval)}function p(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function h(y){u&&clearTimeout(u),u=setTimeout(async()=>{const M=await i.onPollOAuthLogin();M?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):M?.status==="expired"||M?.status==="cancelled"?(m(),r.value="expired"):h(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function w(){await f()}async function k(){!l.value||!await Go(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function g(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function v(y){const M=Math.floor(y/60),O=y%60;return`${M}:${String(O).padStart(2,"0")}`}return(y,M)=>(_(),ke(mr,{open:o.value,"onUpdate:open":M[0]||(M[0]=O=>o.value=O),title:x(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:we(()=>[r.value==="starting"?(_(),I("div",rce,[se(ai,{size:"md"}),C("span",lce,R(x(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(_(),I("div",ace,[C("div",cce,R(x(n)("login.lead")),1),C("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[qe(R(x(n)("login.authorizeInBrowser"))+" ",1),se(Qe,{name:"external-link",size:"sm"})],8,uce),C("div",dce,R(x(n)("login.orDivider")),1),C("div",fce,[C("div",hce,[qe(R(x(n)("login.fallbackPrefix")),1),C("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},R(l.value.verificationUri),9,pce),qe(R(x(n)("login.fallbackSuffix")),1)]),C("div",mce,[C("span",gce,R(l.value.userCode),1),se(Dt,{class:De(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:k},{default:we(()=>[c.value?(_(),I(Pe,{key:0},[se(Qe,{name:"check",size:"sm"}),qe(" "+R(x(n)("login.copied")),1)],64)):(_(),I(Pe,{key:1},[se(Qe,{name:"copy",size:"sm"}),qe(" "+R(x(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),C("div",vce,[se(ai,{size:"sm",label:x(n)("login.waitingAuth")},null,8,["label"]),C("span",yce,R(x(n)("login.waitingAutoClose")),1),C("span",kce,R(v(a.value)),1)])])):r.value==="success"?(_(),I("div",bce,[se(y1,{kind:"success"}),C("span",_ce,R(x(n)("login.success")),1),C("span",wce,R(x(n)("login.successHint")),1)])):r.value==="expired"?(_(),I(Pe,{key:3},[C("div",Sce,[se(y1,{kind:"expired"}),C("span",Cce,R(x(n)("login.expiredTitle")),1),C("span",xce,R(x(n)("login.expiredHint")),1)]),C("div",Ace,[se(Dt,{variant:"primary",onClick:w},{default:we(()=>[qe(R(x(n)("login.retry")),1)]),_:1}),se(Dt,{variant:"secondary",onClick:g},{default:we(()=>[qe(R(x(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(_(),I(Pe,{key:4},[C("div",Mce,[se(y1,{kind:"error"}),C("span",Tce,R(x(n)("login.errorTitle")),1),C("span",Ece,R(x(n)("login.errorHint")),1)]),C("div",Ice,[se(Dt,{variant:"primary",onClick:w},{default:we(()=>[qe(R(x(n)("login.retry")),1)]),_:1}),se(Dt,{variant:"secondary",onClick:g},{default:we(()=>[qe(R(x(n)("login.closeBtn")),1)]),_:1})])],64)):re("",!0)]),_:1},8,["open","title"]))}}),Lce=ut($ce,[["__scopeId","data-v-b228800e"]]);function Nce(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Rce(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function Oce(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,activeRoot:s,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(o),a=new Map;for(const p of t)l.has(p.root)||a.has(p.root)||a.set(p.root,{...p});for(const p of n){const h=p.cwd;h&&(l.has(h)||a.has(h)||a.set(h,{id:p.workspaceId??h,root:h,name:Nce(h),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const p of n){const h=Rce(t,p);c.set(h,(c.get(h)??0)+1)}const u=[...new Set(t.filter(p=>!l.has(p.root)).map(p=>p.root))],d=[...a.keys()].filter(p=>!u.includes(p));d.sort((p,h)=>p.localeCompare(h));const f=[];for(const p of[...u,...d]){const h=a.get(p),m=c.get(h.id)??c.get(h.root)??0,w=r[h.id]===!1?m:Math.max(h.sessionCount,m);let k=h.branch;!k&&i&&s===h.root&&(k=i),f.push({...h,sessionCount:w,branch:k})}return f}function Pce(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=e.filter(s=>{const i=Date.parse(s.createdAt);return!Number.isNaN(i)&&i<n});return o.length>0?[...o,...t]:t}function Dce(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 Bce=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function Fce(e){return Bce.has(e.type)}function Hce(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function zce(e,t,n=Hce){let o=[],s=null;const i=()=>{if(s=null,o.length===0)return;const l=o;o=[];for(const a of l)e(a)},r=(l=>{if(t(l)){o.push(l),s===null&&(s=n(i));return}i(),e(l)});return r.flush=i,r}const VM=["blue","mono"],KM=["light","dark","system"],GM=14,Wce=12,Uce=20;function qce(){const e=no(Nt.accent);return e&&VM.includes(e)?e:"blue"}function jce(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Vce(){const e=no(Nt.colorScheme);return e&&KM.includes(e)?e:"system"}function Kce(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 Iy(e){return Number.isFinite(e)?Math.min(Uce,Math.max(Wce,Math.round(e))):GM}function Gce(){const e=no(Nt.uiFontSize);return e===null?GM:Iy(Number(e))}function Yce(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Iy(e)}px`)}const $y=X(Vce()),Ly=X(qce()),Ny=X(Gce());Ve($y,Kce,{immediate:!0});Ve(Ly,jce,{immediate:!0});Ve(Ny,Yce,{immediate:!0});function Qce(e){KM.includes(e)&&($y.value=e,io(Nt.colorScheme,e))}function Xce(e){VM.includes(e)&&(Ly.value=e,io(Nt.accent,e))}function Zce(e){const t=Iy(e);Ny.value=t,io(Nt.uiFontSize,String(t))}const Jce=600,eue=250,Up=250,tue=1e3,nue=160,jh=X(!1);let Ol=[],Fl=null,Vh=-Up;function oue(){Ol=[],Vh=-Up,jh.value=!1,Fl!==null&&(clearTimeout(Fl),Fl=null)}function sue(){jh.value=!0,Fl!==null&&clearTimeout(Fl),Fl=setTimeout(()=>{Fl=null,Ol=[],Vh=-Up,jh.value=!1},tue)}function iue(e){if(e<=0)return;const t=Date.now();Ol.push({time:t,chars:e});const n=t-Jce;if(Ol=Ol.filter(l=>l.time>=n),t-Vh<Up)return;Vh=t;const o=Ol[0]?.time??t,s=Math.max(t-o,eue);Ol.reduce((l,a)=>l+a.chars,0)/s*1e3>=nue&&sue()}function YM(){return{colorScheme:$y,accent:Ly,uiFontSize:Ny,fastMoon:jh,setColorScheme:Qce,setAccent:Xce,setUiFontSize:Zce,resetFastMoon:oue,recordMoonDelta:iue}}function QM(e,t){const n=no(e);return n===null?t:n==="1"}const Ry=X(QM(Nt.notifyOnComplete,!0)),Oy=X(QM(Nt.notifyOnQuestion,!1)),Py=X(typeof Notification<"u"?Notification.permission:"denied"),rue="/favicon.ico";async function XM(e,t,n){if(!n){e.value=!1,io(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}Py.value=o,o==="granted"&&(e.value=!0,io(t,"1"))}function lue(e){return XM(Ry,Nt.notifyOnComplete,e)}function aue(e){return XM(Oy,Nt.notifyOnQuestion,e)}function ZM(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function cue(e){return{title:Hn.global.t("settings.notifyTitle"),body:ZM(e,Hn.global.t("settings.notifyFallback"))}}function uue(e,t){return{title:Hn.global.t("settings.notifyQuestionTitle"),body:ZM(t,e,Hn.global.t("settings.notifyQuestionFallback"))}}function JM(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{Py.value=i,i==="granted"&&vC(t,n,o)});return}vC(t,n,o)}}function vC(e,t,n){if(!e.isActiveAndVisible)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:rue});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function due(e,t){JM(Ry.value,t,cue(t.sessionTitle),`kimi-complete-${e}`)}function fue(e,t){JM(Oy.value,t,uue(t.sessionTitle,t.questionPreview),`kimi-question-${e}`)}function hue(){return{notifyOnComplete:Ry,notifyOnQuestion:Oy,notifyPermission:Py,setNotifyOnComplete:lue,setNotifyOnQuestion:aue,maybeNotifyCompletion:due,maybeNotifyQuestion:fue}}function pue(){return no(Nt.soundOnComplete)==="1"}const yd=X(pue());function mue(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let k1=null;function eT(){const e=mue();if(!e)return null;if(k1===null)try{k1=new e}catch{return null}return k1}function tT(){if(!yd.value)return;const e=eT();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Ji("sound: audio context resumed",{state:e.state})},t=>{Ji("sound: audio context resume rejected",{error:String(t)})})}let yC=!1;function gue(){if(yC||typeof window>"u")return;yC=!0;const e=()=>{tT()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}gue();function vue(e){yd.value=e,io(Nt.soundOnComplete,e?"1":"0"),e&&tT()}function kC(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 nT(){const e=eT();if(e===null){Ji("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Ji("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Ji("sound: context resumed for next time",{state:e.state})},t=>{Ji("sound: resume rejected",{error:String(t)})});return}try{kC(e,880,0,.16,.18),kC(e,1320,.1,.22,.16),Ji("sound: chime scheduled",{state:e.state})}catch(t){Ji("sound: failed to play",{error:String(t)})}}function yue(){yd.value&&nT()}function kue(){yd.value&&nT()}function bue(){return{soundOnComplete:yd,setSoundOnComplete:vue,maybePlayCompletionSound:yue,maybePlayQuestionSound:kue}}function bC(e,t){const n=new Set(e.map(s=>s.id)),o=t.filter(s=>s.kind==="subagent"&&!n.has(s.id));return o.length===0?e:[...e,...o]}const _ue=1e3,wue=4096,_C=32*1024;function Sue(e,t){let n=null,o;const s=new Set;async function i(f){try{const h=await ht().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:bC(h,e.tasksBySession[f]??[])},await r(f,h)}catch{}}async function r(f,p){if(e.activeSessionId!==f)return;const h=p??e.tasksBySession[f]??[],m=ht(),w=new Map;if(await Promise.all(h.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!s.has(g.id)&&!((g.outputLines?.length??0)>0))try{const y=await m.getTask(f,g.id,{withOutput:!0,outputBytes:_C});y.outputPreview!==void 0&&w.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{s.add(g.id)}})),w.size===0)return;const k=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:k.map(g=>{const v=w.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const p=ht();let h;try{h=await p.listTasks(f)}catch{return}const m=new Map;await Promise.all(h.map(async v=>{const y=v.status==="running",M=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!M)&&!(M&&(s.has(v.id)||(v.outputLines?.length??0)>0)))try{const O=await p.getTask(f,v.id,{withOutput:!0,outputBytes:y?wue:_C});O.outputPreview!==void 0&&m.set(v.id,{preview:O.outputPreview,bytes:O.outputBytes})}catch{}finally{M&&s.add(v.id)}}));const w=e.tasksBySession[f]??[],k=new Map(w.map(v=>[v.id,v])),g=h.map(v=>{const y=k.get(v.id),M=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:M?.preview??y?.outputPreview,outputBytes:M?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:bC(g,w)}}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())},_ue))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=X(0);let d=null;return Ve(()=>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}),Ve(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const p=e.tasksBySession[f]??[];return{sid:f,hasRunning:p.some(h=>h.status==="running")}},({sid:f,hasRunning:p},h,m)=>{let w;p&&f!==void 0?a(f):f!==void 0?w=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{w!==void 0&&clearTimeout(w)})},{deep:!0,immediate:!0}),{taskClock:B(()=>u.value),loadTasksForSession:i}}const oT=Nt.starredModels;function Cue(){try{const e=no(oT);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function xue(e){try{io(oT,JSON.stringify(e))}catch{}}function Aue(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=X([]),d=X(Cue()),f=X({}),p=X({}),h=X([]),m=X(null);function w(Y){if(!(Y==null||Y.length===0))return u.value.find(q=>q.id===Y||q.model===Y)}function k(){const Y=e.activeSessionId?e.sessions.find(q=>q.id===e.activeSessionId):void 0;return w(Y?.model??m.value??e.defaultModel)}function g(Y){const q=Xl(k(),Y);return e.thinking=q,l(q),q}async function v(Y){try{const ae=await ht().listSkills(Y);f.value={...f.value,[Y]:ae}}catch{}}async function y(Y){try{const ae=await ht().listSkillsForWorkspace(Y);p.value={...p.value,[Y]:ae}}catch{}}async function M(){try{const Y=ht();u.value=await Y.listModels(),g(e.thinking)}catch(Y){n("loadModels",Y)}}async function O(){try{const Y=await ht().refreshOAuthProviderModels();for(const q of Y.failed)n("refreshOAuthProviderModels",new Error(q.reason),{message:q.provider})}catch{}}async function L(){try{const Y=ht();h.value=await Y.listProviders()}catch(Y){n("loadProviders",Y)}}async function b(Y){const q=e.activeSessionId,ae=Xl(w(Y),e.thinking),ce=e.thinking;if(!q)return m.value=Y,g(ae),!0;const ne=e.sessions.find(Q=>Q.id===q)?.model;a(q,Q=>({...Q,model:Y})),ae!==ce&&(e.thinking=ae,l(ae));try{await ht().updateSession(q,{model:Y,thinking:ae!==ce?ae:void 0})}catch(Q){return a(q,ee=>({...ee,model:ne??ee.model})),ae!==ce&&(e.thinking=ce,l(ce)),n("setModel",Q,{sessionId:q}),!1}return await o(q),!0}function T(Y){const q=new Set(d.value);q.has(Y)?q.delete(Y):q.add(Y),d.value=Array.from(q),xue(d.value)}async function $(Y,q,ae){const ce=ae??e.activeSessionId;if(!ce)return;const ne=i.value==="idle"&&!r.has(ce),Q=`msg_skill_opt_${Date.now().toString(36)}`;if(ne){r.add(ce),e.sendingBySession={...e.sendingBySession,[ce]:!0};const ee={id:Q,sessionId:ce,role:"user",content:[{type:"text",text:`/${Y}${q?` ${q}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:Y,skillArgs:q}}};c(ce,ye=>[...ye,ee])}try{await ht().activateSkill(ce,Y,q)}catch(ee){ne&&(r.delete(ce),e.sendingBySession={...e.sendingBySession,[ce]:!1},c(ce,ye=>ye.filter(xe=>xe.id!==Q))),n("activateSkill",ee,{sessionId:ce})}}async function N(Y){try{await ht().addProvider(Y),await Promise.all([L(),M()])}catch(q){n("addProvider",q)}}async function S(Y){try{await ht().deleteProvider(Y),await Promise.all([L(),M()])}catch(q){n("deleteProvider",q)}}async function E(Y){try{const q=await ht().refreshProvider(Y);for(const ae of q.failed)n("refreshProvider",new Error(ae.reason),{message:ae.provider});await Promise.all([L(),M()])}catch(q){n("refreshProvider",q)}}async function P(){try{const Y=await ht().refreshAllProviders();for(const q of Y.failed)n("refreshAllProviders",new Error(q.reason),{message:q.provider});await Promise.all([L(),M()])}catch(Y){n("refreshAllProviders",Y)}}async function D(){try{return await ht().startOAuthLogin()}catch{return null}}async function F(){try{return await ht().pollOAuthLogin()}catch{return null}}async function W(){try{await ht().cancelOAuthLogin()}catch{}}function K(Y){const q=g(Y);s({thinking:q})}return{models:u,starredModelIds:d,providers:h,draftModel:m,skillsBySession:f,skillsByWorkspace:p,loadSkillsForSession:v,loadSkillsForWorkspace:y,loadModels:M,refreshOAuthProviderModels:O,loadProviders:L,setModel:b,toggleStarModel:T,activateSkill:$,addProvider:N,deleteProvider:S,refreshProvider:E,refreshAllProviders:P,startOAuthLogin:D,pollOAuthLogin:F,cancelOAuthLogin:W,setThinking:K}}const sT="kimiWeb.compaction",Mue=/^read[_-]?media(?:file)?$/i,Tue=/^data:([^;]+);base64,(.*)$/s,Eue=/^<(image|video|audio)\s+path="([^"]+)">$/,Iue=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,$ue=/Mime type:\s*([^.\s]+)/i,Lue=/Size:\s*(\d+)\s*bytes/i,Nue=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Rue(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function Oue(e){const t=Iue.exec(e.trim());return t?{kind:t[1],path:Rue(t[2])}:null}const Pue=/^f_[A-Za-z0-9]{10,}$/;function Due(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return Pue.test(o)?o:void 0}function Bue(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 Fue(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 Hue(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 zue(e,t){if(!Mue.test(e))return;const n=Fue(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 p=d.text,h=Eue.exec(p);h&&(s=h[1],o=h[2]);const m=$ue.exec(p);m?.[1]&&(i=m[1]);const w=Lue.exec(p);w?.[1]&&(r=Number(w[1]));const k=Nue.exec(p);k?.[1]&&k[2]&&(l=`${k[1]}x${k[2]}`);continue}const f=Hue(d);f&&(a=f)}if(a===null)return;const c=Tue.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Bue(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Wue(e){if(e!=null){if(typeof e=="string")return e.split(`
267
+ `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
268
+ `));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
269
+ `)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
270
+ `)):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 Uue(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 que(e,t){const n=e.split(`
271
+ `),o=t.split(`
272
+ `),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 jue(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:que(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 Vue(e){const t=`<prompt>
273
+ `,n=`
274
+ </prompt>`,o=e.indexOf(t),s=e.lastIndexOf(n);return o>=0&&s>=o+t.length?e.slice(o+t.length,s):Kue(e)}function Kue(e){const t=e.split(`
275
+ `);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
276
+ `):e}function Gue(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function Yue(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
277
+ `);return Vue(t)}function Que(e,t){const n=e.metadata?.origin??{},o=Yue(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 Xue(e,t,n){const{text:o,cron:s}=Que(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function Zue(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 Jue(e){return e.metadata?.origin?.kind==="compaction_summary"}function ede(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function tde(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 iT(e,t,n,o=!0,s={}){const i=[];let r=1;const l=new Map;for(const f of t)l.set(f.toolCallId,f);let a=null;function c(f=!1){if(!a)return;const p=a;if(a=null,!f||!o)for(let h=0;h<p.tools.length;h++){const m=p.tools[h];if(m.status!=="running")continue;const w={...m,status:"ok"};p.tools[h]=w;const k=p.blocks.find(g=>g.kind==="tool"&&g.tool.id===w.id);k&&k.kind==="tool"&&(k.tool=w)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
278
+ `),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
279
+ `):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(f,p){for(const h of p)if(h.type==="text"){if(h.text){f.textParts.push(h.text);const m=f.blocks.at(-1);m&&m.kind==="text"?m.text+=`
280
+ `+h.text:f.blocks.push({kind:"text",text:h.text})}}else if(h.type==="thinking"){if(h.thinking){f.thinkingParts.push(h.thinking);const m=f.blocks.at(-1);m&&m.kind==="thinking"?m.thinking+=`
281
+ `+h.thinking:f.blocks.push({kind:"thinking",thinking:h.thinking})}}else if(h.type==="toolUse"){const m=l.get(h.toolCallId),w={id:h.toolCallId,name:h.toolName,arg:typeof h.input=="string"?h.input:JSON.stringify(h.input),status:"running",output:h.outputLines,planPath:h.toolName==="ExitPlanMode"?s[h.toolCallId]?.path:void 0};f.tools.push(w),f.blocks.push({kind:"tool",tool:w}),m&&(f.approval=jue(m),f.approvalId=m.approvalId)}else if(h.type==="toolResult"){const m=f.tools.findIndex(w=>w.id===h.toolCallId);if(m!==-1){const w=f.tools[m],k={...w,status:h.isError?"error":"ok",output:Wue(h.output),media:h.isError?void 0:zue(w.name,h.output)};k.name==="ExitPlanMode"&&!k.planPath&&(k.planPath=tde(k.output)),f.tools[m]=k;const g=f.blocks.find(v=>v.kind==="tool"&&v.tool.id===h.toolCallId);g&&g.kind==="tool"&&(g.tool=k)}}}function d(f){if(f.type==="image"||f.type==="video"){const p=f.type,h=f.source;if(h.kind==="url")return{url:h.url,kind:p};if(h.kind==="base64")return{url:`data:${h.mediaType};base64,${h.data}`,kind:p};if(h.kind==="file"&&n)return{url:n(h.fileId),kind:p,fileId:h.fileId}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image",fileId:f.fileId};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video",fileId:f.fileId}}}for(const f of e){if(f.role==="system")continue;if(Jue(f)){c();const k=f.metadata?.[sT];i.push({id:f.id,role:"compaction",no:r,text:f.content.filter(g=>g.type==="text").map(g=>g.text).join(`
282
+ `),compaction:{trigger:k?.trigger,tokensBefore:k?.tokensBefore,tokensAfter:k?.tokensAfter}});continue}if(f.role==="user"){const k=Gue(f);if(c(),k!==void 0){i.push(Xue(f,r++,k));continue}if(!Zue(f))continue;const g=f.metadata?.origin,v=g?.kind==="skill_activation"&&g?.trigger==="user-slash",y=g?.kind==="plugin_command"&&g?.trigger==="user-slash",M=[],O=[];for(const L of f.content){if(L.type==="text")if(v)M.push(g.skillArgs??"");else if(y)M.push(g.commandArgs??"");else{const T=Oue(L.text);if(T&&(T.kind==="video"||T.kind==="image")&&n){const $=Due(T.path);if($){O.push({url:n($),kind:T.kind,alt:$,fileId:$});continue}}M.push(L.text)}const b=d(L);b&&O.push({url:b.url,kind:b.kind,alt:L.type==="file"?L.name:void 0,fileId:b.fileId})}i.push({id:f.id,role:"user",no:r++,text:M.join(`
283
+ `),images:O.length>0?O:void 0,skillActivation:v?{name:g.skillName,args:g.skillArgs}:void 0,pluginCommand:y?{pluginId:g.pluginId,commandName:g.commandName,args:g.commandArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){a&&u(a,f.content);continue}const p=f.promptId;ede(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:f.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const m=a;if(m===null)continue;const w=JSON.stringify(f.content);m.promptId!==void 0&&m.seenSigs.has(w)||(m.seenSigs.add(w),u(m,f.content))}return c(!0),i}function nde(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i}=t,r=X({}),l=B(()=>{const T=e.activeSessionId;if(!T)return null;const $=r.value[T];return $?{parentId:T,agentId:$.agentId}:null}),a=B(()=>l.value?.parentId??null),c=B(()=>l.value!==null),u=B(()=>{const T=l.value;return T?!!e.sideChatSendingByAgent[T.agentId]:!1}),d=B(()=>{const T=l.value;return T?e.sideChatSendingByAgent[T.agentId]?!0:(e.tasksBySession[T.parentId]??[]).some($=>$.id===T.agentId&&$.status==="running"):!1}),f=B(()=>{const T=l.value;if(!T)return[];const $=e.sideChatMessagesByAgent[T.agentId]??[];return iT($,[],N=>ht().getFileUrl(N),d.value)});function p(T,$){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[T]:$(e.sideChatMessagesByAgent[T]??[])}}function h(T,$){p(T,N=>[...N,$])}function m(T){p(T,$=>{const N=[...$].reverse().findIndex(E=>E.role==="user");if(N===-1)return $;const S=$.length-1-N;return $.filter((E,P)=>P!==S)})}function w(T,$){p(T,N=>{const S=[...N];for(let E=S.length-1;E>=0;E-=1){const P=S[E];if(P.role==="user")return S[E]={...P,promptId:P.promptId??$},S}return N})}function k(T,$,N){N&&p(T,S=>{const E=S.at(-1);if(E?.role==="assistant"){const P=E.content[0],D=P?.type==="text"?P.text:"";return[...S.slice(0,-1),{...E,content:[{type:"text",text:`${D}${N}`}]}]}return[...S,{id:o(),sessionId:$,role:"assistant",content:[{type:"text",text:N}],createdAt:new Date().toISOString()}]})}function g(T,$,N){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[T]:!1},!N)return;const E=(e.sideChatMessagesByAgent[T]??[]).at(-1);(E?.role==="assistant"&&E.content[0]?.type==="text"?E.content[0].text:"").trim().length>0||k(T,$,N)}async function v(T){const $=e.activeSessionId;$&&await y($,T)}async function y(T,$){if(!r.value[T]){let N;try{({agentId:N}=await ht().startBtw(T))}catch(S){n("openSideChat",S,{sessionId:T});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[N]:e.sideChatMessagesByAgent[N]??[]},r.value={...r.value,[T]:{agentId:N}},s(),i()?.markSideChannelAgent(N)}$&&$.trim()&&await M(T,$.trim())}async function M(T,$){const N=r.value[T],S=$.trim();if(!N||!S)return;const E=T,P=N.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!0};const D={id:o(),sessionId:E,role:"user",content:[{type:"text",text:S}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};h(P,D);try{const F=e.sessions.find(q=>q.id===E),W=(F?.model&&F.model.length>0?F.model:e.defaultModel)??void 0,K=W===void 0?void 0:t.models().find(q=>q.model===W||q.id===W||q.displayName===W),Y=await ht().submitPrompt(E,{content:[{type:"text",text:S}],agentId:P,model:W,thinking:Xl(K,e.thinking),permissionMode:e.permission,planMode:e.planModeBySession[E]??!1,swarmMode:e.swarmModeBySession[E]??!1});w(P,Y.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[E]:[...e.sideChatUserMessageIdsBySession[E]??[],Y.userMessageId]}}catch(F){n("sendSideChatPrompt",F,{sessionId:E}),m(P),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!1}}}function O(){const T=e.activeSessionId;if(!T)return;const{[T]:$,...N}=r.value;r.value=N}async function L(T){const $=l.value;$&&await M($.parentId,T)}function b(T){if(!r.value[T])return;const{[T]:$,...N}=r.value;r.value=N}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:k,finishSideChatAgent:g,openSideChat:v,openSideChatOn:y,closeSideChat:O,sendSideChatPrompt:L,clearSideChatForSession:b}}function ode(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 sde(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
284
+ `)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&ode(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 Gv="/sessions/";function wC(e){const{pathname:t}=e;if(!t.startsWith(Gv))return;const n=t.slice(Gv.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function ide(e){return e===void 0||e.length===0?"/":`${Gv}${encodeURIComponent(e)}`}const rde=50,Yv=5,lde=40402,ade=40410,cde=40902;function b1(e){return il(e)&&e.code===cde}const ude=40904;function dde(e){return il(e)&&e.code===ude}const Il=Bo({}),Cf=Bo({}),_1=Bo({});function fde(e,t){const{t:n}=Hn.global,{confirm:o}=cl(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,inFlightPromptSessions:c,sessionsKnownEmpty:u,setSessions:d,updateSession:f,upsertSessionFront:p,appendSession:h,forgetSession:m,setActiveSessionId:w,updateSessionMessages:k,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:M,hasLoadedMessages:O,refreshSessionStatus:L,persistSessionProfile:b,mergedWorkspaces:T,workspacesView:$,status:N,workspaceIdForSession:S,savePermissionToStorage:E,savePlanModeToStorage:P,saveSwarmModeToStorage:D,saveGoalModeToStorage:F,draftModes:W,saveUnread:K,saveActiveWorkspaceToStorage:Y,saveHiddenWorkspacesToStorage:q,goalErrorMessage:ae,resetFastMoon:ce,initialized:ne,selectedDiffPath:Q,fileDiffLines:ee,fileDiffLoading:ye}=t;async function xe(oe){if(e.messagesLoadingMoreBySession[oe])return;const Se=e.messagesBySession[oe];if(!Se||Se.length===0)return;const Ae=Se[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[oe]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[oe]:!1};try{const Be=await ht().listMessages(oe,{beforeId:Ae,pageSize:rde}),it=[...Be.items].reverse();k(oe,at=>[...it,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[oe]:Be.hasMore}}catch(Be){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[oe]:!0},l("loadOlderMessages",Be,{sessionId:oe})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[oe]:!1}}}function Xe(oe){s.loadTasksForSession(oe),ie(oe),L(oe),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,oe)||r.loadSkillsForSession(oe)}async function me(oe){const Se=e.activeSessionId;if(Se){Q.value=oe,ee.value=[],ye.value=!0;try{const Be=await ht().getFileDiff(Se,oe);if(Q.value!==oe)return;ee.value=sde(Be.diff)}catch(Ae){Q.value===oe&&(ee.value=[]),console.warn("[loadFileDiff] diff unavailable for",oe,Ae)}finally{Q.value===oe&&(ye.value=!1)}}}function G(){Q.value=null,ee.value=[],ye.value=!1}async function ie(oe){try{const Ae=await ht().getGitStatus(oe);e.gitStatusBySession={...e.gitStatusBySession,[oe]:Ae}}catch{}}async function de(){try{const Se=await ht().getAuth();e.authReady=Se.ready,e.defaultModel=Se.defaultModel,e.managedProviderStatus=Se.managedProvider?.status??null}catch{}}async function z(){try{const oe=ht();e.config=await oe.getConfig()}catch{}}async function Z(oe){try{const Ae=await ht().setConfig(oe);return e.config=Ae,e.defaultModel=Ae.defaultModel??null,!0}catch(Se){return l("setConfig",Se),!1}}const pe=100,le=30,he=720*60*1e3;async function U(){const oe=ht(),Se=[];let Ae;for(;;){const Be=await oe.listSessions({pageSize:pe,beforeId:Ae,excludeEmpty:!0});if(Se.push(...Be.items),!Be.hasMore||Be.items.length===0)break;Ae=Be.items[Be.items.length-1].id}return Se}async function J(oe){const Se=ht(),Ae=[],Be=Date.now(),it=nn=>Be-new Date(nn.updatedAt).getTime();let at,It=!1,rn=!0;for(;;){let nn;try{nn=await Se.listSessions({workspaceId:oe,pageSize:Yv,beforeId:at,excludeEmpty:!0})}catch(Qt){if(rn)throw Qt;break}if(It=nn.hasMore,nn.items.length===0)break;const Eo=nn.items[nn.items.length-1],gr=it(Eo)>=he;if(!rn&&gr){const Qt=nn.items.findIndex(Dn=>it(Dn)>=he),xn=Qt>=0?Qt+1:nn.items.length;Ae.push(...nn.items.slice(0,xn)),It=nn.hasMore||xn<nn.items.length;break}if(Ae.push(...nn.items),rn=!1,!nn.hasMore||gr)break;at=Eo.id}return{workspaceId:oe,page:{items:Ae,hasMore:It}}}async function fe(){const oe=e.workspaces;if(oe.length===0){const It=await U().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,It}const Se=await Promise.all(oe.map(It=>J(It.id).catch(()=>({workspaceId:It.id,page:{items:[],hasMore:!1}})))),Ae=[],Be={},it={},at={};for(const{workspaceId:It,page:rn}of Se)Ae.push(...rn.items),Be[It]=rn.hasMore,it[It]=rn.items.length>0?rn.items[rn.items.length-1].id:void 0,at[It]=Math.max(rn.items.length,Yv);return e.sessionsHasMoreByWorkspace=Be,e.sessionsCursorByWorkspace=it,e.sessionsInitialCountByWorkspace=at,e.sessionsFullyLoaded=!1,Ae.sort((It,rn)=>new Date(rn.updatedAt).getTime()-new Date(It.updatedAt).getTime()),Ae}async function be(oe){if(e.sessionsLoadingMoreByWorkspace[oe]||e.sessionsHasMoreByWorkspace[oe]===!1)return;const Se=e.sessionsCursorByWorkspace[oe];if(Se!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[oe]:!0};try{const Ae=await ht().listSessions({workspaceId:oe,pageSize:le,beforeId:Se,excludeEmpty:!0}),Be=new Set(e.sessions.map(at=>at.id)),it=Ae.items.filter(at=>!Be.has(at.id));it.length>0&&d([...e.sessions,...it]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[oe]:Ae.items.length>0?Ae.items[Ae.items.length-1].id:Se},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[oe]:Ae.hasMore}}catch(Ae){l("loadMoreSessions",Ae)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[oe]:!1}}}}async function Ee(){if(e.sessionsFullyLoaded)return;const oe=await U().catch(()=>null);if(oe===null)return;d(oe),e.sessionsFullyLoaded=!0;const Se={};for(const Ae of e.workspaces)Se[Ae.id]=!1;e.sessionsHasMoreByWorkspace=Se}async function Le(){e.loading=!0;try{const oe=ht();await Promise.all([oe.getHealth().catch(()=>null),oe.getMeta().then(It=>{e.serverVersion=It.serverVersion,e.availableOpenInApps=It.openInApps,e.dangerousBypassAuth=It.dangerousBypassAuth}).catch(()=>null),r.loadModels()]),await de(),await z(),await ue();const Se=await fe();d(Se);const Ae=Se[0],Be=e.activeWorkspaceId;!(Be!==null&&T.value.some(It=>It.id===Be))&&Ae&&Ge(S(Ae)),Yn();const at=typeof window<"u"?wC(window.location):void 0;!e.activeSessionId&&at!==void 0&&(e.sessions.some(rn=>rn.id===at)||await zn(at))&&await Zt(at,{urlMode:"replace"}),!e.activeSessionId&&Se.length>0&&await Zt(Se[0].id,{urlMode:"replace"})}catch(oe){l("load",oe)}finally{e.loading=!1,ne.value=!0}}async function ue(){try{const oe=ht(),[Se,Ae]=await Promise.all([oe.listWorkspaces().catch(()=>[]),oe.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Ie(Se),e.fsHome=Ae.home||null,e.recentRoots=Ae.recentRoots}catch{}}function Ie(oe){const Se=of();return Object.keys(Se).length===0?oe:oe.map(Ae=>{const Be=Se[Ae.root];return Be!==void 0?{...Ae,name:Be}:Ae})}function Ge(oe){e.activeWorkspaceId=oe,Y(oe)}function lt(oe){Ge(oe);const Se=e.sessions.filter(Ae=>S(Ae)===oe);if(Se.length>0){const Ae=Se[0];Ae&&Ae.id!==e.activeSessionId&&Zt(Ae.id)}else w(void 0),ot(void 0,"push")}function bt(oe){const Se=of()[oe.root],Ae=Se!==void 0?{...oe,name:Se}:oe;e.hiddenWorkspaceRoots.includes(Ae.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(at=>at!==Ae.root),q(e.hiddenWorkspaceRoots));const Be=e.workspaces.findIndex(at=>at.id===Ae.id||at.root===Ae.root);if(Be===-1){e.workspaces=[Ae,...e.workspaces];return}const it=[...e.workspaces];it[Be]=Ae,e.workspaces=it}function _t(oe){if(oe.type==="workspaceCreated"||oe.type==="workspaceUpdated"){bt(oe.workspace);return}const Se=e.workspaces.find(Be=>Be.id===oe.workspaceId)?.root??oe.root;if(Se&&!e.hiddenWorkspaceRoots.includes(Se)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Se],q(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Be=>Be.id!==oe.workspaceId&&Be.root!==Se),e.activeWorkspaceId===oe.workspaceId||e.activeWorkspaceId===Se){const Be=$.value[0]?.id??null;if(e.activeWorkspaceId=Be,Be)Y(Be);else try{pc(Nt.activeWorkspace)}catch{}w(void 0),e.sessionLoading=!1,G(),ot(void 0,"replace")}}function $t(){w(void 0),ot(void 0,"push")}function Bt(oe){Ge(oe),$t(),G()}async function yt(oe){const Se=T.value.find(Eo=>Eo.id===oe);if(!Se)return null;const Ae=ht();let Be,it=Se.root;try{const Eo=await Ae.addWorkspace({root:Se.root});Be=Eo.id,it=Eo.root,bt(Eo)}catch{}const at=r.draftModel.value??void 0,It=await Ae.createSession({workspaceId:Be,cwd:it,model:at});r.draftModel.value=null;const rn=at!==void 0&&(!It.model||It.model.length===0)?{...It,model:at}:It;p(rn),Ge(It.workspaceId??Be??oe),await Zt(It.id);const nn=It.id;return W.planMode&&(e.planModeBySession={...e.planModeBySession,[nn]:!0},P()),W.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[nn]:!0},D()),W.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[nn]:!0},F()),W.planMode=!1,W.swarmMode=!1,W.goalMode=!1,nn}async function Gt(oe,Se,Ae){try{const Be=await yt(oe);if(!Be)return;await Ke(Be,Se,Ae)}catch(Be){l("startSessionAndSendPrompt",Be)}}async function pn(oe,Se,Ae){try{const Be=await yt(oe);if(!Be)return;const it=e.planModeBySession[Be]??!1,at=e.swarmModeBySession[Be]??!1,It=e.sessions.find(nn=>nn.id===Be),rn=(It?.model&&It.model.length>0?It.model:e.defaultModel)??void 0;await b({planMode:it,swarmMode:at,permissionMode:e.permission,thinking:Qn(rn)},Be),await r.activateSkill(Se,Ae,Be)}catch(Be){l("startSessionAndActivateSkill",Be)}}async function ro(oe,Se){try{const Ae=await yt(oe);if(!Ae)return;await i.openSideChatOn(Ae,Se)}catch(Ae){l("startSessionAndOpenSideChat",Ae)}}async function Yt(oe){const Se=oe.trim();if(!Se)return!1;const Ae=ht();try{const Be=await Ae.addWorkspace({root:Se});return bt(Be),Bt(Be.id),!0}catch{return!1}}async function mn(oe){try{return await ht().browseFs(oe)}catch{return{path:"",parent:null,entries:[]}}}async function zo(){try{return await ht().getFsHome()}catch{return{home:"",recentRoots:[]}}}function ot(oe,Se){if(Se==="none"||typeof window>"u"||!window.history)return;const Ae=ide(oe);if(window.location.pathname!==Ae)try{Se==="push"?window.history.pushState(null,"",Ae):window.history.replaceState(null,"",Ae)}catch{}}async function zn(oe){try{const Se=await ht().getSession(oe);return e.sessions.some(Ae=>Ae.id===Se.id)||h(Se),!0}catch{return!1}}function lo(){const oe=wC(window.location);if(oe===void 0){w(void 0);return}if(oe!==e.activeSessionId){if(e.sessions.some(Se=>Se.id===oe)){Zt(oe,{urlMode:"none"});return}(async()=>{if(await zn(oe)){await Zt(oe,{urlMode:"none"});return}const Se=e.sessions[0];Se?await Zt(Se.id,{urlMode:"replace"}):(w(void 0),ot(void 0,"replace"))})()}}let Gn=!1;function Yn(){Gn||typeof window>"u"||(Gn=!0,window.addEventListener("popstate",lo))}async function Zt(oe,Se){const Ae=O(oe),Be=!Ae&&u.has(oe);u.delete(oe);try{ot(oe,Se?.urlMode??"push"),e.sessionLoading=!Ae&&!Be,w(oe),ce(),e.unreadBySession[oe]&&(e.unreadBySession={...e.unreadBySession,[oe]:!1},K({[oe]:!1})),G();const it=e.sessions.find(at=>at.id===oe);if(it){const at=S(it);e.activeWorkspaceId!==at&&Ge(at)}if(Ae){if(await M(oe)==="not-found")return}else if(await y(oe)==="not-found")return;Xe(oe)}catch(it){l("selectSession",it,{sessionId:oe})}finally{e.activeSessionId===oe&&(e.sessionLoading=!1)}}function Qn(oe){const Se=oe===void 0?void 0:r.models.value.find(Ae=>Ae.model===oe||Ae.id===oe||Ae.displayName===oe);return Xl(Se,e.thinking)}async function Ke(oe,Se,Ae){c.add(oe),e.sendingBySession={...e.sendingBySession,[oe]:!0};const Be=g();try{const it=ht(),at=[];Se&&at.push({type:"text",text:Se});for(const Dn of Ae??[])Dn.kind==="video"?at.push({type:"video",source:{kind:"file",fileId:Dn.fileId}}):at.push({type:"image",source:{kind:"file",fileId:Dn.fileId}});if(at.length===0)return c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},!1;const It={id:Be,sessionId:oe,role:"user",content:at,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(oe,Dn=>[...Dn,It]);const rn=e.sessions.find(Dn=>Dn.id===oe),nn=(rn?.model&&rn.model.length>0?rn.model:e.defaultModel)??void 0,Eo=e.planModeBySession[oe]??!1,gr=e.swarmModeBySession[oe]??!1,Qt=e.goalModeBySession[oe]??!1;if(Qt&&Se)try{await it.updateSession(oe,{goalObjective:Se.trim()})}catch(Dn){return l("createGoal",Dn,{sessionId:oe}),c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},k(oe,So=>So.some(Co=>Co.id===Be)?So.filter(Co=>Co.id!==Be):So),!1}const xn=await it.submitPrompt(oe,{content:at,model:nn,thinking:Qn(nn),permissionMode:e.permission,planMode:Eo,swarmMode:gr});return Qt&&(e.goalModeBySession={...e.goalModeBySession,[oe]:!1},F()),e.promptIdBySession={...e.promptIdBySession,[oe]:xn.promptId},k(oe,Dn=>{const So=Dn.findIndex(Io=>Io.id===Be);if(So===-1)return Dn;const Co=[...Dn];return Co[So]={...Co[So],promptId:Co[So].promptId??xn.promptId},Co}),v()?.bindNextPromptId(oe,xn.promptId),!0}catch(it){return c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},k(oe,at=>at.some(It=>It.id===Be)?at.filter(It=>It.id!==Be):at),l("sendPrompt",it,{sessionId:oe}),!1}}async function Ze(oe,Se){const Ae=e.activeSessionId;if(Ae){if(a.value!=="idle"||c.has(Ae)){un(oe,Se);return}await Ke(Ae,oe,Se)}}async function Ft(oe,Se){const Ae=e.activeSessionId;if(!Ae)return;const Be=e.queuedBySession[Ae]??[],it=[],at=[];for(const Qt of Be){const xn=Qt.text.trim();xn&&it.push(xn),Qt.attachments?.length&&at.push(...Qt.attachments)}const It=oe.trim();if(It&&it.push(It),Se?.length&&at.push(...Se),it.length===0&&at.length===0)return;Be.length>0&&(e.queuedBySession={...e.queuedBySession,[Ae]:[]});const rn=it.join(`
285
+
286
+ `);if(a.value==="idle"&&!c.has(Ae)){await Ke(Ae,rn,at);return}const nn=[];rn&&nn.push({type:"text",text:rn});for(const Qt of at)Qt.kind==="video"?nn.push({type:"video",source:{kind:"file",fileId:Qt.fileId}}):nn.push({type:"image",source:{kind:"file",fileId:Qt.fileId}});const Eo=g(),gr={id:Eo,sessionId:Ae,role:"user",content:nn,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(Ae,Qt=>[...Qt,gr]);try{const Qt=ht(),xn=e.sessions.find(Co=>Co.id===Ae),Dn=(xn?.model&&xn.model.length>0?xn.model:e.defaultModel)??void 0,So=await Qt.submitPrompt(Ae,{content:nn,model:Dn,thinking:Qn(Dn),permissionMode:e.permission,planMode:e.planModeBySession[Ae]??!1,swarmMode:e.swarmModeBySession[Ae]??!1});if(k(Ae,Co=>{const Io=Co.findIndex(Zp=>Zp.id===Eo);if(Io===-1)return Co;const la=[...Co];return la[Io]={...la[Io],promptId:la[Io].promptId??So.promptId},la}),So.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Ae]:So.promptId},v()?.bindNextPromptId(Ae,So.promptId);return}try{await Qt.steerPrompts(Ae,[So.promptId])}catch{}}catch(Qt){k(Ae,xn=>xn.filter(Dn=>Dn.id!==Eo)),l("steer",Qt,{sessionId:Ae})}}async function sn(oe,Se){try{const Be=await ht().uploadFile({file:oe,name:Se});return{fileId:Be.id,name:Be.name,mediaType:Be.mediaType}}catch(Ae){return l("uploadImage",Ae),null}}function un(oe,Se){const Ae=e.activeSessionId;if(!Ae)return;const Be=e.queuedBySession[Ae]??[];e.queuedBySession={...e.queuedBySession,[Ae]:[...Be,{text:oe,attachments:Se}]}}async function tn(){const oe=e.activeSessionId;if(!oe)return;const Se=e.sessions.find(it=>it.id===oe);let Ae=e.promptIdBySession[oe];if(Ae===void 0){const it=Se?.currentPromptId;it?.startsWith("prompt_")&&(Ae=it)}const Be=ht();if(Ae!==void 0)try{if((await Be.abortPrompt(oe,Ae)).aborted)return;const at={...e.promptIdBySession};delete at[oe],e.promptIdBySession=at}catch(it){if(il(it)&&it.code===lde){const at={...e.promptIdBySession};delete at[oe],e.promptIdBySession=at}else{l("abortCurrentPrompt",it,{sessionId:oe});return}}try{await Be.abortSession(oe)}catch(it){l("abortCurrentPrompt",it,{sessionId:oe})}}function Cn(oe,Se){const Ae=e.approvalsBySession[oe]??[];e.approvalsBySession={...e.approvalsBySession,[oe]:Ae.filter(Be=>Be.approvalId!==Se)}}function Mt(oe,Se){const Ae=e.questionsBySession[oe]??[];e.questionsBySession={...e.questionsBySession,[oe]:Ae.filter(Be=>Be.questionId!==Se)}}async function Xn(oe,Se){const Ae=e.activeSessionId;if(Ae&&!Cf[oe]){Cf[oe]=!0;try{const Be=ht(),it={decision:Se.decision,scope:Se.scope,feedback:Se.feedback,selectedLabel:Se.selectedLabel};await Be.respondApproval(Ae,oe,it),Cn(Ae,oe)}catch(Be){b1(Be)?Cn(Ae,oe):l("respondApproval",Be,{sessionId:Ae})}finally{delete Cf[oe]}}}async function Ut(oe,Se){const Ae=e.activeSessionId;if(Ae&&!Il[oe]){Il[oe]="answer";try{await ht().respondQuestion(Ae,oe,Se),Mt(Ae,oe)}catch(Be){b1(Be)?Mt(Ae,oe):l("respondQuestion",Be,{sessionId:Ae})}finally{delete Il[oe]}}}async function wo(oe){const Se=e.activeSessionId;if(Se&&!Il[oe]){Il[oe]="dismiss";try{await ht().dismissQuestion(Se,oe),Mt(Se,oe)}catch(Ae){b1(Ae)?Mt(Se,oe):l("dismissQuestion",Ae,{sessionId:Se})}finally{delete Il[oe]}}}async function To(oe){const Se=e.activeSessionId;if(Se&&!_1[oe]){_1[oe]=!0;try{await ht().cancelTask(Se,oe);const Be=e.tasksBySession[Se]??[];e.tasksBySession={...e.tasksBySession,[Se]:Be.map(it=>it.id===oe?{...it,status:"cancelled"}:it)}}catch(Ae){dde(Ae)||l("cancelTask",Ae,{sessionId:Se})}finally{delete _1[oe]}}}function xs(oe){const Se=e.activeSessionId;Se?(e.planModeBySession={...e.planModeBySession,[Se]:oe},P(),b({planMode:oe})):W.planMode=oe}function Wo(){const oe=e.activeSessionId,Se=oe?e.planModeBySession[oe]??!1:W.planMode;xs(!Se)}function ds(oe){const Se=e.activeSessionId;Se?(e.swarmModeBySession={...e.swarmModeBySession,[Se]:oe},D(),b({swarmMode:oe})):W.swarmMode=oe}async function fs(){const oe=e.activeSessionId,Ae=!(oe?e.swarmModeBySession[oe]??!1:W.swarmMode);Ae&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||ds(Ae)}function Ot(oe){const Se=e.activeSessionId;Se?(e.goalModeBySession={...e.goalModeBySession,[Se]:oe},F()):W.goalMode=oe}function Us(){const oe=e.activeSessionId,Se=oe?e.goalModeBySession[oe]??!1:W.goalMode;Ot(!Se)}async function qs(oe){const Se=oe.trim();if(!Se||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:Se}),variant:"primary"}))return;let Ae=e.activeSessionId;if(!Ae){const Be=e.activeWorkspaceId,it=Be&&$.value.some(at=>at.id===Be)?Be:$.value[0]?.id??null;if(!it)return;try{Ae=await yt(it)??void 0}catch(at){l("createGoal",at);return}if(!Ae)return}try{await ht().updateSession(Ae,{goalObjective:Se})}catch(Be){l("createGoal",Be,{sessionId:Ae,message:ae(Be)});return}e.goalModeBySession[Ae]&&(e.goalModeBySession={...e.goalModeBySession,[Ae]:!1},F()),e.activeSessionId===Ae?await Ze(Se):await Ke(Ae,Se)}function Ye(oe){const Se=e.activeSessionId;Se&&Promise.resolve(ht().updateSession(Se,{goalControl:oe})).catch(Ae=>{l("controlGoal",Ae,{sessionId:Se,message:ae(Ae)})})}function tt(oe){e.permission=oe,E(oe),b({permissionMode:oe})}function st(oe){const Se=[...e.warnings];Se.splice(oe,1),e.warnings=Se}async function Ht(oe,Se){try{await ht().updateSession(oe,{title:Se}),f(oe,Be=>({...Be,title:Se}))}catch(Ae){l("renameSession",Ae,{sessionId:oe})}}async function js(oe,Se){const Ae=e.workspaces.find(it=>it.id===oe)?.root,Be=()=>{e.workspaces=e.workspaces.map(it=>it.id===oe?{...it,name:Se}:it)};try{if(await ht().updateWorkspace(oe,{name:Se}),Ae!==void 0){const it=of();Ae in it&&(delete it[Ae],R2(it))}Be()}catch(it){if(Ae!==void 0&&il(it)&&it.code===ade){R2({...of(),[Ae]:Se}),Be();return}l("renameWorkspace",it)}}async function wi(oe){const Se=e.workspaces.find(at=>at.id===oe)?.root??T.value.find(at=>at.id===oe)?.root??oe,Ae=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,Be=e.activeWorkspaceId===oe||e.activeWorkspaceId===Se,it=!!(Ae&&(Ae.cwd===Se||Ae.workspaceId===oe||S(Ae)===oe));Se&&!e.hiddenWorkspaceRoots.includes(Se)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Se],q(e.hiddenWorkspaceRoots));try{await ht().deleteWorkspace(oe)}catch{}if(e.workspaces=e.workspaces.filter(at=>at.id!==oe&&at.root!==Se),Be||it){const at=$.value[0]?.id??null;if(e.activeWorkspaceId=at,at)Y(at);else try{pc(Nt.activeWorkspace)}catch{}}(Be||it)&&(w(void 0),e.sessionLoading=!1,G(),ot(void 0,"replace"))}async function $e(oe){try{await ht().archiveSession(oe),m(oe),i.clearSideChatForSession(oe);const{[oe]:Ae,...Be}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Be,e.activeSessionId===oe){const it=e.sessions[0];it?await Zt(it.id,{urlMode:"replace"}):(w(void 0),ot(void 0,"replace"))}}catch(Se){l("archiveSession",Se,{sessionId:oe})}}async function Te(oe){try{const Se=await ht().restoreSession(oe);return p(Se),!0}catch(Se){return l("restoreSession",Se,{sessionId:oe}),!1}}function He(oe){return ht().listSessions({archivedOnly:!0,beforeId:oe?.beforeId,pageSize:oe?.pageSize??50})}async function Rt(){try{await ht().logout(),await de(),await Le()}catch(oe){l("logout",oe)}}function qt(oe){const Se=e.activeSessionId;Se&&ht().compactSession(Se,oe).catch(Ae=>{l("compact",Ae,{sessionId:Se})})}async function ao(oe){const Se=oe??e.activeSessionId;if(Se)try{const Ae=await ht().forkSession(Se);p(Ae),await Zt(Ae.id)}catch(Ae){l("fork",Ae,{sessionId:Se})}}async function Zn(oe=1){const Se=e.activeSessionId;if(!Se)return null;const Ae=(()=>{const Be=e.messagesBySession[Se]??[];for(let it=Be.length-1;it>=0;it--){const at=Be[it];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(It=>It.type==="text").map(It=>It.text).join(`
287
+ `)}return null})();try{return await ht().undoSession(Se,oe),await y(Se),Ae}catch(Be){return l("undo",Be,{sessionId:Se}),null}}function Pn(oe){const Se=e.activeSessionId;if(!Se)return;const Ae=e.queuedBySession[Se]??[];if(oe<0||oe>=Ae.length)return;const Be=[...Ae];Be.splice(oe,1),e.queuedBySession={...e.queuedBySession,[Se]:Be}}function As(oe,Se){const Ae=e.activeSessionId;if(!Ae)return;const Be=e.queuedBySession[Ae]??[];if(oe===Se||oe<0||oe>=Be.length||Se<0||Se>=Be.length)return;const it=[...Be],[at]=it.splice(oe,1);at!==void 0&&(it.splice(Se,0,at),e.queuedBySession={...e.queuedBySession,[Ae]:it})}async function ft(oe){const Se=e.activeSessionId;if(!Se)return[];try{return(await ht().listDirectory(Se,{path:oe,includeGitStatus:!0})).items}catch{return[]}}async function ve(oe){const Se=e.activeSessionId;if(!Se)return null;try{const Be=await ht().readFile(Se,{path:oe});return{path:Be.path,content:Be.content,encoding:Be.encoding,mime:Be.mime,languageId:Be.languageId,isBinary:Be.isBinary,size:Be.size,lineCount:Be.lineCount}}catch{return null}}const Oe=10485760;function jt(oe){const Se=e.activeSessionId;return Se?ht().getFileDownloadUrl(Se,oe):null}async function ra(oe,Se){const Ae=e.activeSessionId;if(!Ae)return!1;try{return await ht().openFile(Ae,{path:oe,line:Se}),!0}catch(Be){return l("openFile",Be,{sessionId:Ae}),!1}}async function Ac(oe){const Se=e.activeSessionId;if(!Se)return;const Ae=N.value.cwd||".";try{await ht().openInApp(Se,oe,Ae)}catch(Be){l("openInApp",Be,{sessionId:Se})}}async function Pi(oe){const Se=e.activeSessionId;if(!Se)return!1;try{return await ht().revealFile(Se,{path:oe}),!0}catch(Ae){return l("revealFile",Ae,{sessionId:Se}),!1}}async function vo(oe){if(/^(https?:|data:|blob:)/i.test(oe))return oe;const Se=e.activeSessionId;if(!Se)return oe;let Ae=oe;if(Ae.startsWith("/")){const Be=e.sessions.find(it=>it.id===Se)?.cwd;if(Be&&(Ae===Be||Ae.startsWith(Be.endsWith("/")?Be:`${Be}/`))){if(Ae=Ae.slice(Be.length).replace(/^\//,""),!Ae)return oe}else return oe}try{const it=await ht().readFile(Se,{path:Ae,length:Oe});return!it.isBinary||it.encoding!=="base64"||it.truncated?oe:`data:${it.mime};base64,${it.content}`}catch{return oe}}async function Di(oe){const Se=e.activeSessionId;if(!Se)return[];try{return(await ht().searchFiles(Se,{query:oe,limit:20})).items.map(it=>({path:it.path,name:it.name}))}catch{return[]}}return{loadFileDiff:me,clearFileDiff:G,loadGitStatus:ie,checkAuth:de,loadConfig:z,updateConfig:Z,listAllSessionsGlobal:U,load:Le,loadWorkspaces:ue,loadMoreSessions:be,loadAllSessions:Ee,selectWorkspace:Ge,openWorkspace:lt,upsertWorkspacePreserveOrder:bt,applyWorkspaceEvent:_t,clearActiveSession:$t,openWorkspaceDraft:Bt,startSessionAndSendPrompt:Gt,startSessionAndActivateSkill:pn,startSessionAndOpenSideChat:ro,addWorkspaceByPath:Yt,browseFs:mn,getFsHome:zo,writeSessionUrl:ot,fetchSessionIntoList:zn,onSessionRoutePopState:lo,bindSessionRoute:Yn,selectSession:Zt,submitPromptInternal:Ke,sendPrompt:Ze,steerPrompt:Ft,uploadImage:sn,enqueue:un,unqueue:Pn,reorderQueue:As,abortCurrentPrompt:tn,respondApproval:Xn,respondQuestion:Ut,dismissQuestion:wo,pendingQuestionActions:Il,pendingApprovalActions:Cf,cancelTask:To,setPlanMode:xs,togglePlanMode:Wo,setSwarmMode:ds,toggleSwarmMode:fs,setGoalMode:Ot,toggleGoalMode:Us,createGoal:qs,controlGoal:Ye,setPermission:tt,dismissWarning:st,renameSession:Ht,renameWorkspace:js,deleteWorkspace:wi,archiveSession:$e,restoreSession:Te,loadArchivedSessions:He,logout:Rt,compact:qt,forkSession:ao,undo:Zn,listDir:ft,readFileContent:ve,getFileDownloadUrl:jt,openWorkspaceFile:ra,openInApp:Ac,revealWorkspaceFile:Pi,resolveImageUrl:vo,searchFiles:Di,loadOlderMessages:xe,refreshSessionSidecars:Xe}}const hde="kimiWeb.optimisticUserMessage";function pde(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function mde(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function gde(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 w1(e){return e.role==="user"&&e.metadata?.[hde]===!0}function vde(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function yde(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const kde=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function SC(e){let t="",n=0;for(const o of e.content)o.type==="text"?kde.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 bde(e,t){const n=SC(e),o=SC(t);return n.text===o.text&&n.media===o.media}function _de(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(w1(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(w1(s)&&yde(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(w1(s)&&bde(s,t))return o}return-1}function wde(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}function Sde(e,t,n){const o=mde(e);switch(gde(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],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionStatusChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,status:t.status,currentPromptId:t.currentPromptId});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"},[sT]: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"&&!vde(t.message)){const a=_de(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]=wde(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,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground},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;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"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&(s._agentError||s._agentWarning)){const i=s._agentError?Hn.global.t("warnings.errorLabel"):Hn.global.t("warnings.noteLabel"),r=s.message??s.code??"agent error";o.warnings=[...o.warnings,`${i}: ${r}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function Cde(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function xde(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"||na(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:Cde(a.status)}]:[]})}}return[]}const Ade=["queued","working","suspended","completed","failed"];function rT(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function Mde(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Tde(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:rT(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=Mde();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 Ede(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of Ade)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}function Ide(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:rT(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 Li=YM(),Pl=hue(),Kh=bue(),lT=Nt.permission,aT=Nt.activeWorkspace,cT=Nt.thinking,uT=Nt.planMode,dT=Nt.swarmMode,fT=Nt.goalMode,CC=40401,hT=Nt.onboarded,$de=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;pc(Nt.codeFont);pc(Nt.theme);function Lde(){try{const e=no(lT);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Nde(e){try{io(lT,e)}catch{}}function Rde(){try{const e=no(cT);if(e&&$de.test(e))return e}catch{}return"high"}function Ode(e){try{io(cT,e)}catch{}}function S1(e){const t=no(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 Dy(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);io(e,JSON.stringify(n))}catch{}}function pT(){Dy(uT,_e.planModeBySession)}function mT(){Dy(dT,_e.swarmModeBySession)}function gT(){Dy(fT,_e.goalModeBySession)}function Pde(){try{return no(aT)}catch{return null}}const vT=Nt.hiddenWorkspaces;function Dde(){try{const e=no(vT);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Bde(e){try{io(vT,JSON.stringify(e))}catch{}}function Fde(e){try{io(aT,e)}catch{}}function Hde(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 _e=Bo({...pde(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,workspaceName:"kimi-web",connection:"disconnected",permission:Lde(),thinking:Rde(),planModeBySession:S1(uT),swarmModeBySession:S1(dT),goalModeBySession:S1(fT),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:E0(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Pde(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Dde(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),qp=Bo({planMode:!1,swarmMode:!1,goalMode:!1});function yT(e){_e.sessions=e}function jp(e,t){_e.sessions=_e.sessions.map(n=>n.id===e?t(n):n)}function zde(e){_e.sessions=[e,..._e.sessions.filter(t=>t.id!==e.id)]}function Wde(e){_e.sessions=[..._e.sessions,e]}function Ude(e){_e.sessions=_e.sessions.filter(t=>t.id!==e)}function kT(){const e=_e.activeSessionId;e&&_e.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(_e.unreadBySession={..._e.unreadBySession,[e]:!1},I0({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Nt.unread&&(_e.unreadBySession=E0(),kT())});function qde(){if(ri===null||!ri.health().stale)return;Ji("ws: stale socket on focus, reconnecting",{activeSessionId:_e.activeSessionId}),ri.reconnect();const e=_e.activeSessionId;e&&RT.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(kT(),qde())});function By(e){_e.activeSessionId=e}function jde(e){_e.messagesBySession=e}function Vde(e,t){_e.messagesBySession={..._e.messagesBySession,[e]:t}}function bT(e,t){_e.messagesBySession={..._e.messagesBySession,[e]:t(_e.messagesBySession[e]??[])}}function Kde(e){const{[e]:t,...n}=_e.messagesBySession;_e.messagesBySession=n}function _T(e){ri?.unsubscribe(e),gfe(e),Gh.flush(),Ude(e),Kde(e),delete _e.approvalsBySession[e],delete _e.questionsBySession[e],delete _e.tasksBySession[e],delete _e.goalBySession[e],delete _e.gitStatusBySession[e],delete _e.lastSeqBySession[e],delete _e.compactionBySession[e],delete _e.messagesLoadingMoreBySession[e],delete _e.messagesHasMoreBySession[e],delete _e.messagesLoadMoreErrorBySession[e],delete Fy[e],LT.delete(e),Kp.delete(e),delete _e.queuedBySession[e],delete _e.promptIdBySession[e],delete _e.sendingBySession[e],delete _e.planModeBySession[e],delete _e.swarmModeBySession[e],delete _e.goalModeBySession[e],pT(),mT(),gT()}const wT=X(null),ST=X([]),CT=X(!1),xT=X(!1);async function Vp(e){let t;try{t=await ht().getSessionStatus(e)}catch{return}jp(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),_e.swarmModeBySession={..._e.swarmModeBySession,[e]:t.swarmMode},_e.planModeBySession={..._e.planModeBySession,[e]:t.planMode}}function AT(e,t){const n=t??_e.activeSessionId;return n?Promise.resolve(ht().updateSession(n,e)).then(()=>Vp(n)).catch(()=>{}):Promise.resolve()}const MT=Nt.conversationToc;function Gde(){try{const e=no(MT);return e===null?!0:e==="true"}catch{return!0}}function Yde(e){try{io(MT,e?"true":"false")}catch{}}const TT=X(Gde());function Qde(e){TT.value=e,Yde(e)}function Xde(e){try{return no(e)??""}catch{return""}}const ET=X(Xde(hT)==="1");function Zde(e){ET.value=e;try{io(hT,e?"1":"0")}catch{}}let ri=null,xC=0;function IT(){return xC+=1,`msg_opt_${Date.now().toString(36)}_${xC}`}const Kp=new Set;function Jde(e,t,n){const o={sessions:_e.sessions,activeSessionId:_e.activeSessionId,messagesBySession:_e.messagesBySession,approvalsBySession:_e.approvalsBySession,planReviewByToolCallId:_e.planReviewByToolCallId,questionsBySession:_e.questionsBySession,tasksBySession:_e.tasksBySession,goalBySession:_e.goalBySession,lastSeqBySession:_e.lastSeqBySession,compactionBySession:_e.compactionBySession,config:_e.config,warnings:_e.warnings},s=Sde(o,e,{sessionId:t,seq:n});yT(s.sessions),By(s.activeSessionId),jde(s.messagesBySession),_e.approvalsBySession=s.approvalsBySession,_e.planReviewByToolCallId=s.planReviewByToolCallId,_e.questionsBySession=s.questionsBySession,_e.tasksBySession=s.tasksBySession,_e.goalBySession=s.goalBySession,_e.lastSeqBySession=s.lastSeqBySession,_e.compactionBySession=s.compactionBySession,_e.config=s.config??null,_e.warnings=s.warnings,e.type==="configChanged"&&(_e.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Ln.loadModels(),Ln.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(_e.swarmModeBySession={..._e.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(_e.planModeBySession={..._e.planModeBySession,[e.sessionId]:e.planMode}))}function efe(e,t){Jde(e,t.sessionId,t.seq);const n=jo.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:o}=n,s=t.sessionId;e.type==="agentDelta"&&e.agentId===o?e.delta.text&&jo.appendSideChatAssistantText(o,s,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===o?jo.finishSideChatAgent(o,s):e.type==="taskProgress"&&e.taskId===o?jo.appendSideChatAssistantText(o,s,e.outputChunk):e.type==="taskCompleted"&&e.taskId===o&&jo.finishSideChatAgent(o,s,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const o=e.message.sessionId;_e.promptIdBySession[o]!==e.message.promptId&&(_e.promptIdBySession={..._e.promptIdBySession,[o]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===_e.activeSessionId&&Li.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&khe(e.sessionId,e.status),e.type==="questionRequested"&&bhe(e.sessionId,e.question)}const Gh=zce(({appEvent:e,meta:t})=>efe(e,t),({appEvent:e})=>Fce(e));function $T(){if(ri!==null||typeof WebSocket>"u")return;_e.connection="connecting",ri=ht().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){pt.applyWorkspaceEvent(t);return}Gh({appEvent:t,meta:n})},onResync(t,n,o){Gh.flush(),o!==void 0&&(Fy[t]=o),RT.request(t)},onError(t,n,o){Hy({severity:"error",title:Hn.global.t("warnings.wsTitle"),message:n,details:[qn("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){_e.connected=t,_e.connection=t?"connected":"disconnected",t&&afe()}})}const Fy={},LT=new Set;function tfe(e){return il(e)&&e.code===CC?!0:typeof e=="object"&&e!==null&&e.code===CC}function qn(e,t){if(!(t==null||t===""))return{label:Hn.global.t(`warnings.details.${e}`),value:NT(t)}}function NT(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 nfe(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function ofe(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function sfe(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function ife(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function AC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function rfe(e,t,n){const o=RM(t),s=il(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[qn("operation",e),qn("sessionId",n??_e.activeSessionId),qn("connection",_e.connection),qn("timestamp",ife(i??Date.now()))];return o?l.push(qn("duration",AC(r)),qn("request",`${t.method} ${t.path}`),qn("endpoint",t.url),qn("requestId",t.requestId),qn("phase",t.phase),qn("timeout",`${t.timeoutMs}ms`),qn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),qn("contentType",t.contentType),qn("responsePreview",t.bodyPreview),qn("cause",t.cause)):s?l.push(qn("duration",AC(r)),qn("code",t.code),qn("requestId",t.requestId),qn("message",t.message),qn("details",t.details)):l.push(qn("errorName",nfe(t)),qn("message",ofe(t)??NT(t)),qn("stack",sfe(t))),l.filter(a=>a!==void 0)}function lfe(e,t,n={}){const o=RM(t),s=il(t),i=n.title??(o?Hn.global.t("warnings.daemonNetworkTitle"):s?Hn.global.t("warnings.daemonApiTitle"):Hn.global.t("warnings.operationFailedTitle")),r=n.message??(o?Hn.global.t("warnings.daemonNetworkMessage"):s?t.message:Hn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:rfe(e,t,n.sessionId)}}function Hy(e){_e.warnings=[..._e.warnings,e]}function afe(){const e=Hn.global.t("warnings.wsTitle"),t=_e.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==_e.warnings.length&&(_e.warnings=t)}function Gp(e,t,n){Hy(lfe(e,t,n))}const cfe={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function ufe(e){if(!il(e))return;const t=cfe[e.code];return t?Hn.global.t(t):void 0}async function dfe(e){if(_T(e),_e.activeSessionId!==e)return;const t=_e.sessions[0];t?await pt.selectSession(t.id,{urlMode:"replace"}):(By(void 0),_e.sessionLoading=!1,pt.writeSessionUrl(void 0,"replace"))}const MC=new Set;async function ffe(e){if(!MC.has(e)){MC.add(e);try{const t=await ht().getSessionWarnings(e),n=Hn.global.t("warnings.noteLabel");for(const o of t)Hy(`${n}: ${o.message}`)}catch{}}}async function zy(e){try{const n=await ht().getSessionSnapshot(e);Gh.flush(),jp(e,o=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:o.model})),Vde(e,Pce(_e.messagesBySession[e]??[],n.messages)),_e.messagesHasMoreBySession={..._e.messagesHasMoreBySession,[e]:n.hasMoreMessages},_e.approvalsBySession={..._e.approvalsBySession,[e]:n.pendingApprovals};for(const o of n.pendingApprovals){const s=o.display;s?.kind==="plan_review"&&typeof s.plan=="string"&&s.plan.length>0&&(_e.planReviewByToolCallId={..._e.planReviewByToolCallId,[o.toolCallId]:{plan:s.plan,path:typeof s.path=="string"?s.path:void 0}})}return _e.questionsBySession={..._e.questionsBySession,[e]:n.pendingQuestions},_e.lastSeqBySession={..._e.lastSeqBySession,[e]:n.asOfSeq},Fy[e]=n.epoch,$T(),ri&&(ri.seedSnapshot(e,n),ri.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch}),mfe(e)),Wy.delete(e),ffe(e),"ok"}catch(t){return tfe(t)?(await dfe(e),"not-found"):(Gp("getSessionSnapshot",t,{title:Hn.global.t("warnings.sessionSnapshotTitle"),message:Hn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const RT=Dce(zy);function hfe(e){return Object.prototype.hasOwnProperty.call(_e.messagesBySession,e)}const pfe=4,Xi=[],Wy=new Set;function mfe(e){const t=Xi.indexOf(e);for(t!==-1&&Xi.splice(t,1),Xi.unshift(e);Xi.length>pfe;){let n=-1;for(let s=Xi.length-1;s>=0;s--)if(Xi[s]!==_e.activeSessionId){n=s;break}if(n===-1)break;const[o]=Xi.splice(n,1);if(o===void 0)break;ri?.unsubscribe(o),Wy.add(o)}}function gfe(e){const t=Xi.indexOf(e);t!==-1&&Xi.splice(t,1),Wy.delete(e)}async function vfe(e){return zy(e)}function Yp(e){const t=_e.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=jo.sideChatTargetBySession.value[e]?.agentId,s=(_e.tasksBySession[e]??[]).filter(i=>i.status==="running");return s.length===0?!(n&&_e.sideChatSendingByAgent[n]):s.some(i=>i.id!==n)}function Uy(e,t){try{const n=new Date(e),s=Date.now()-n.getTime(),i=s/36e5;if(s<6e4)return Hn.global.t("sessions.justNow");if(i<1)return`${Math.round(s/6e4)}m`;if(i<24)return`${Math.round(i)}h`;const r=s/864e5;return r<7?`${Math.round(r)}d`:r<30?`${Math.round(r/7)}w`:r<365?`${Math.round(r/30)}m`:`${Math.round(r/365)}y`}catch{return e}}const yfe=3e4,od=X(0);let C1=null;function kfe(){C1===null&&(C1=setInterval(()=>{od.value=(od.value+1)%Number.MAX_SAFE_INTEGER},yfe),C1.unref?.())}function bfe(e,t){const n=e.split(`
288
+ `),o=t.split(`
289
+ `),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 _fe(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:bfe(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 wfe(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 Sfe(e){const t=_e.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 Cfe(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":t="fail";let n="";if(e.status==="running"&&e.startedAt){const r=Math.round((Date.now()-new Date(e.startedAt).getTime())/1e3),l=Math.floor(r/60),a=r%60;n=Hn.global.t("tasks.timingRunning",{time:`${l}:${String(a).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){const r=Math.round((new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime())/1e3);n=Hn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??Sfe(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 xfe=B(()=>{const e=_e.sessions.find(n=>n.id===_e.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:_e.workspaceName,branch:t}}),Afe=B(()=>(od.value,_e.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Uy(e.updatedAt,e.status),status:e.status,busy:Yp(e.id)})))),Mfe=B(()=>_e.activeSessionId??""),Tfe=B(()=>{const e=_e.activeSessionId;if(e)return Ln.skillsBySession.value[e]??[];const t=Xp.value;return t?Ln.skillsByWorkspace.value[t]??[]:[]}),Efe=B(()=>{const e=_e.activeSessionId;return e?_e.sendingBySession[e]??!1:!1}),jo=nde(_e,{pushOperationFailure:Gp,nextOptimisticMsgId:IT,connectEventsIfNeeded:$T,getEventConn:()=>ri,models:()=>Ln.models.value}),kd=B(()=>{const e=_e.activeSessionId;if(!e)return[];const t=jo.sideChatTargetBySession.value[e]?.agentId;return(_e.tasksBySession[e]??[]).filter(n=>n.id!==t)}),OT=Sue(_e,kd),Ife=B(()=>{const e=_e.activeSessionId;if(!e)return[];const t=new Set(_e.sideChatUserMessageIdsBySession[e]??[]),n=(_e.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=_e.approvalsBySession[e]??[];return iT(n,o,s=>ht().getFileUrl(s),Qp.value!=="idle",_e.planReviewByToolCallId)}),$fe=B(()=>(OT.taskClock.value,kd.value.map(Cfe))),PT=B(()=>Tde(kd.value)),Lfe=B(()=>Ide(kd.value)),Fa=B(()=>{const e=_e.activeSessionId;return e?_e.goalBySession[e]??null:null}),Nfe=B(()=>{const e=_e.activeSessionId;return e?xde(_e.messagesBySession[e]??[]):[]}),Rfe=B(()=>{const e=_e.activeSessionId;return e?_e.compactionBySession[e]??null:null}),Ofe=B(()=>_e.connection),Pfe=B(()=>_e.loading),Dfe=B(()=>_e.sessionLoading),Bfe=B(()=>{const e=_e.activeSessionId;return e?_e.messagesLoadingMoreBySession[e]??!1:!1}),Ffe=B(()=>{const e=_e.activeSessionId;return e?_e.messagesHasMoreBySession[e]??!1:!1}),Hfe=B(()=>{const e=_e.activeSessionId;return e?_e.messagesLoadMoreErrorBySession[e]??!1:!1}),zfe=B(()=>_e.serverVersion),Wfe=B(()=>_e.dangerousBypassAuth);function Ufe(){_e.dangerousBypassAuth=!1}const qfe=B(()=>_e.permission),jfe=B(()=>_e.thinking),DT=B(()=>{const e=_e.activeSessionId;return e?_e.planModeBySession[e]??!1:qp.planMode}),Vfe=B(()=>{const e=_e.activeSessionId;return e?_e.swarmModeBySession[e]??!1:qp.swarmMode}),Kfe=B(()=>{const e=_e.activeSessionId;return e?_e.goalModeBySession[e]??!1:qp.goalMode}),Gfe=B(()=>{const e=Ede(PT.value);return{plan:DT.value,goal:Fa.value&&Fa.value.status!=="complete"?{status:Fa.value.status,turnsUsed:Fa.value.turnsUsed,elapsedMs:Fa.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Yfe=B(()=>{const e=_e.activeSessionId;if(!e)return[];const t=ht();return(_e.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)}))}))}),Qfe=B(()=>_e.warnings),Xfe=B(()=>{const e=_e.activeSessionId;return e?(_e.questionsBySession[e]??[]).map(wfe):[]}),Zfe=B(()=>{const e=_e.activeSessionId;return e?(_e.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:_fe(t),agentName:t.agentName})):[]}),Qp=B(()=>{const e=_e.activeSessionId;return e?(_e.approvalsBySession[e]??[]).length>0?"awaiting-approval":(_e.questionsBySession[e]??[]).length>0?"awaiting-question":Yp(e)?"running":"idle":"idle"}),Ln=Aue(_e,{pushOperationFailure:Gp,refreshSessionStatus:Vp,persistSessionProfile:AT,activity:Qp,inFlightPromptSessions:Kp,saveThinkingToStorage:Ode,updateSession:jp,updateSessionMessages:bT}),Yh=B(()=>{const e=_e.activeSessionId;if(!e)return null;const t=_e.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Jfe=B(()=>{const e=_e.activeSessionId;return e?_e.gitStatusBySession[e]?.pullRequest??null:null}),ehe=B(()=>{const e=_e.activeSessionId;if(!e)return[];const t=_e.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),the=B(()=>{const e=_e.activeSessionId;if(!e)return null;const t=_e.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),BT=B(()=>{const e=_e.sessions.find(r=>r.id===_e.activeSessionId),t=Yh.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Ln.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??_e.defaultModel)??"—",s=Ln.models.value.find(r=>r.id===o||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:_e.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Yh.value!==null}}),nhe=B(()=>ST.value),ohe=B(()=>_e.sessions.find(t=>t.id===_e.activeSessionId)?.usage.totalCostUsd??0),she=B(()=>_e.authReady),ihe=B(()=>_e.defaultModel),rhe=B(()=>_e.managedProviderStatus),lhe=B(()=>_e.config),ahe=B(()=>{const e=_e.activeSessionId;if(!e)return{};const t=_e.gitStatusBySession[e];return t?{...t.entries}:{}});function vc(e){return _e.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const qy=B(()=>Oce({workspaces:_e.workspaces,sessions:_e.sessions,hiddenWorkspaceRoots:_e.hiddenWorkspaceRoots,activeRoot:_e.sessions.find(e=>e.id===_e.activeSessionId)?.cwd,activeBranch:Yh.value?.branch??null,sessionsHasMoreByWorkspace:_e.sessionsHasMoreByWorkspace})),Qh=X(O8()),yc=X(P8()==="manual"?"manual":"recent");Ve(()=>[qy.value.map(e=>e.id).join("\0"),_e.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=G8(n,Qh.value);o!==null&&(Qh.value=o,D4(o))});const Jl=B(()=>{const e=qy.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Hde(t.root,_e.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(yc.value==="recent"){const t=new Map;for(const n of _e.sessions){if(n.parentSessionId)continue;const o=vc(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return X8(e,t)}return Y8(e,Qh.value)}),Xp=B(()=>{const e=_e.activeWorkspaceId,t=Jl.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Ve(Xp,e=>{e&&(Object.prototype.hasOwnProperty.call(Ln.skillsByWorkspace.value,e)||Ln.loadSkillsForWorkspace(e))},{immediate:!0});const che=B(()=>{const e=Xp.value;return e?Jl.value.find(t=>t.id===e)??null:null}),uhe=B(()=>{od.value;const e=new Set(Jl.value.map(n=>n.id)),t=new Map(Jl.value.map(n=>[n.id,n.name]));return _e.sessions.filter(n=>!n.parentSessionId&&e.has(vc(n))).map(n=>{const o=vc(n);return{id:n.id,title:n.title,time:Uy(n.updatedAt,n.status),status:n.status,busy:Yp(n.id),lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),dhe=B(()=>{od.value;const e=new Map;for(const t of _e.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=vc(t),o={id:t.id,title:t.title,time:Uy(t.updatedAt,t.status),status:t.status,busy:Yp(t.id),updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return Jl.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:_e.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:_e.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:_e.sessionsInitialCountByWorkspace[t.id]??Yv}))});function fhe(e){Qh.value=e,D4(e),yc.value!=="manual"&&(yc.value="manual",B4("manual"))}function hhe(e){yc.value!==e&&(yc.value=e,B4(e))}const FT=B(()=>{const e={};for(const[t,n]of Object.entries(_e.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(_e.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),phe=B(()=>{const e={};for(const[t,n]of Object.entries(_e.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(_e.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),mhe=B(()=>{const e={};for(const[t,n]of Object.entries(_e.unreadBySession))n&&(e[t]=!0);return e}),ghe=B(()=>{const e={},t=FT.value;for(const n of _e.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=vc(n);e[s]=(e[s]??0)+o}return e}),vhe=B(()=>_e.recentRoots),yhe=B(()=>_e.availableOpenInApps),pt=fde(_e,{taskPoller:OT,sideChat:jo,modelProvider:Ln,pushOperationFailure:Gp,activity:Qp,inFlightPromptSessions:Kp,sessionsKnownEmpty:LT,setSessions:yT,updateSession:jp,upsertSessionFront:zde,appendSession:Wde,forgetSession:_T,setActiveSessionId:By,updateSessionMessages:bT,nextOptimisticMsgId:IT,getEventConn:()=>ri,syncSessionFromSnapshot:zy,reopenSession:vfe,hasLoadedMessages:hfe,refreshSessionStatus:Vp,persistSessionProfile:AT,mergedWorkspaces:qy,workspacesView:Jl,status:BT,workspaceIdForSession:vc,savePermissionToStorage:Nde,savePlanModeToStorage:pT,saveSwarmModeToStorage:mT,saveGoalModeToStorage:gT,draftModes:qp,saveUnread:I0,saveActiveWorkspaceToStorage:Fde,saveHiddenWorkspacesToStorage:Bde,goalErrorMessage:ufe,resetFastMoon:Li.resetFastMoon,initialized:xT,selectedDiffPath:wT,fileDiffLines:ST,fileDiffLoading:CT});function khe(e,t){if(Kp.delete(e),_e.sendingBySession={..._e.sendingBySession,[e]:!1},_e.promptIdBySession[e]!==void 0){const i={..._e.promptIdBySession};delete i[e],_e.promptIdBySession=i}e===_e.activeSessionId?(Li.resetFastMoon(),pt.loadGitStatus(e),Vp(e)):t==="idle"&&(_e.unreadBySession={..._e.unreadBySession,[e]:!0},I0({[e]:!0})),Pl.maybeNotifyCompletion(e,{isActiveAndVisible:e===_e.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:_e.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{pt.selectSession(e)}}),t==="idle"&&Kh.maybePlayCompletionSound();const n=_e.queuedBySession[e]??[];if(n.length===0)return;const[o,...s]=n;_e.queuedBySession={..._e.queuedBySession,[e]:s},o!==void 0&&pt.submitPromptInternal(e,o.text,o.attachments).then(i=>{if(!i){const r=_e.queuedBySession[e]??[];_e.queuedBySession={..._e.queuedBySession,[e]:[o,...r]}}})}function bhe(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;Pl.maybeNotifyQuestion(e,{isActiveAndVisible:e===_e.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:_e.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,onClick:()=>{pt.selectSession(e)}}),Kh.maybePlayQuestionSound()}function jy(){return kfe(),{workspace:xfe,sessions:Afe,activeSessionId:Mfe,workspacesView:Jl,workspaceSortMode:yc,visibleWorkspace:che,activeWorkspaceId:Xp,sessionsForView:uhe,workspaceGroups:dhe,attentionBySession:FT,pendingBySession:phe,attentionByWorkspace:ghe,unreadBySession:mhe,recentRoots:vhe,turns:Ife,tasks:$fe,activeAppTasks:kd,todos:Nfe,goal:Fa,swarms:PT,swarmMembersByToolCallId:Lfe,activationBadges:Gfe,compaction:Rfe,status:BT,sessionCost:ohe,fileDiff:nhe,selectedDiffPath:wT,fileDiffLoading:CT,changes:ehe,gitInfo:Yh,gitDiffStats:the,activePullRequest:Jfe,changesByPath:ahe,pendingApprovals:Zfe,availableOpenInApps:yhe,connection:Ofe,loading:Pfe,sessionLoading:Dfe,loadingMoreMessages:Bfe,hasMoreMessages:Ffe,loadMoreMessagesError:Hfe,serverVersion:zfe,dangerousBypassAuth:Wfe,clearDangerousBypassAuth:Ufe,initialized:xT,permission:qfe,thinking:jfe,planMode:DT,swarmMode:Vfe,goalMode:Kfe,queued:Yfe,warnings:Qfe,questions:Xfe,activity:Qp,isSending:Efe,fastMoon:Li.fastMoon,models:Ln.models,starredModelIds:Ln.starredModelIds,providers:Ln.providers,uiFontSize:Li.uiFontSize,setUiFontSize:Li.setUiFontSize,conversationToc:TT,setConversationToc:Qde,colorScheme:Li.colorScheme,setColorScheme:Li.setColorScheme,accent:Li.accent,setAccent:Li.setAccent,notifyOnComplete:Pl.notifyOnComplete,notifyOnQuestion:Pl.notifyOnQuestion,notifyPermission:Pl.notifyPermission,setNotifyOnComplete:Pl.setNotifyOnComplete,setNotifyOnQuestion:Pl.setNotifyOnQuestion,soundOnComplete:Kh.soundOnComplete,setSoundOnComplete:Kh.setSoundOnComplete,onboarded:ET,setOnboarded:Zde,load:pt.load,selectSession:pt.selectSession,clearActiveSession:pt.clearActiveSession,loadOlderMessages:pt.loadOlderMessages,loadWorkspaces:pt.loadWorkspaces,loadMoreSessions:pt.loadMoreSessions,loadAllSessions:pt.loadAllSessions,selectWorkspace:pt.selectWorkspace,openWorkspace:pt.openWorkspace,openWorkspaceDraft:pt.openWorkspaceDraft,startSessionAndSendPrompt:pt.startSessionAndSendPrompt,startSessionAndActivateSkill:pt.startSessionAndActivateSkill,startSessionAndOpenSideChat:pt.startSessionAndOpenSideChat,addWorkspaceByPath:pt.addWorkspaceByPath,browseFs:pt.browseFs,getFsHome:pt.getFsHome,sendPrompt:pt.sendPrompt,steerPrompt:pt.steerPrompt,sideChatVisible:jo.sideChatVisible,sideChatSessionId:jo.sideChatSessionId,sideChatTurns:jo.sideChatTurns,sideChatRunning:jo.sideChatRunning,sideChatSending:jo.sideChatSending,openSideChat:jo.openSideChat,closeSideChat:jo.closeSideChat,sendSideChatPrompt:jo.sendSideChatPrompt,uploadImage:pt.uploadImage,abortCurrentPrompt:pt.abortCurrentPrompt,respondApproval:pt.respondApproval,respondQuestion:pt.respondQuestion,dismissQuestion:pt.dismissQuestion,pendingQuestionActions:pt.pendingQuestionActions,pendingApprovalActions:pt.pendingApprovalActions,cancelTask:pt.cancelTask,setPermission:pt.setPermission,setThinking:Ln.setThinking,setPlanMode:pt.setPlanMode,togglePlanMode:pt.togglePlanMode,setSwarmMode:pt.setSwarmMode,toggleSwarmMode:pt.toggleSwarmMode,setGoalMode:pt.setGoalMode,toggleGoalMode:pt.toggleGoalMode,createGoal:pt.createGoal,controlGoal:pt.controlGoal,enqueue:pt.enqueue,dismissWarning:pt.dismissWarning,renameSession:pt.renameSession,renameWorkspace:pt.renameWorkspace,deleteWorkspace:pt.deleteWorkspace,reorderWorkspaces:fhe,setWorkspaceSortMode:hhe,archiveSession:pt.archiveSession,restoreSession:pt.restoreSession,loadArchivedSessions:pt.loadArchivedSessions,compact:pt.compact,forkSession:pt.forkSession,undo:pt.undo,unqueue:pt.unqueue,reorderQueue:pt.reorderQueue,searchFiles:pt.searchFiles,loadGitStatus:pt.loadGitStatus,loadFileDiff:pt.loadFileDiff,clearFileDiff:pt.clearFileDiff,listDir:pt.listDir,readFileContent:pt.readFileContent,getFileDownloadUrl:pt.getFileDownloadUrl,openWorkspaceFile:pt.openWorkspaceFile,openInApp:pt.openInApp,revealWorkspaceFile:pt.revealWorkspaceFile,resolveImageUrl:pt.resolveImageUrl,refreshOAuthProviderModels:Ln.refreshOAuthProviderModels,loadModels:Ln.loadModels,loadProviders:Ln.loadProviders,skills:Tfe,activateSkill:Ln.activateSkill,setModel:Ln.setModel,toggleStarModel:Ln.toggleStarModel,addProvider:Ln.addProvider,deleteProvider:Ln.deleteProvider,refreshProvider:Ln.refreshProvider,refreshAllProviders:Ln.refreshAllProviders,authReady:she,defaultModel:ihe,managedProviderStatus:rhe,config:lhe,updateConfig:pt.updateConfig,checkAuth:pt.checkAuth,startOAuthLogin:Ln.startOAuthLogin,pollOAuthLogin:Ln.pollOAuthLogin,cancelOAuthLogin:Ln.cancelOAuthLogin,logout:pt.logout}}const HT=je({__name:"LanguageSwitcher",setup(e){const{locale:t}=Tt(),n=U4.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&q4(s)}return(s,i)=>(_(),ke(os,{"model-value":x(t),options:x(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),_he=["aria-checked","aria-label","disabled"],whe=je({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(_(),I("button",{class:De(["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]=[C("span",{class:"ui-switch__thumb"},null,-1)])],10,_he))}}),Rr=ut(whe,[["__scopeId","data-v-dbe22dc4"]]),She=["aria-label"],Che=["aria-selected","onClick"],xhe={class:"body"},Ahe={class:"panel"},Mhe={class:"sec"},The={class:"sec-title"},Ehe={class:"row"},Ihe={class:"rlabel"},$he={class:"row"},Lhe={class:"rlabel"},Nhe={class:"row"},Rhe={class:"rlabel"},Ohe={class:"num-field"},Phe=["value","aria-label"],Dhe={class:"row"},Bhe={class:"rlabel"},Fhe={class:"row"},Hhe={class:"rlabel"},zhe={class:"hint"},Whe={class:"sec"},Uhe={class:"sec-title"},qhe={class:"row"},jhe={class:"rlabel"},Vhe={key:0,class:"hint"},Khe={class:"row"},Ghe={class:"rlabel"},Yhe={key:0,class:"hint"},Qhe={class:"row"},Xhe={class:"rlabel"},Zhe={class:"panel"},Jhe={class:"sec"},epe={class:"sec-title"},tpe={class:"row"},npe={class:"rlabel"},ope={key:0,class:"rvalue"},spe={class:"actions"},ipe={class:"panel"},rpe={class:"sec"},lpe={class:"sec-head"},ape={class:"sec-title"},cpe={key:0,class:"saving"},upe={class:"row"},dpe={class:"rlabel"},fpe={class:"hint"},hpe={key:0,class:"select-wrap"},ppe={key:0,value:"",disabled:""},mpe=["label"],gpe=["value"],vpe={key:1,class:"rvalue mono"},ype={class:"row"},kpe={class:"rlabel"},bpe={class:"hint"},_pe={class:"row"},wpe={class:"rlabel"},Spe={class:"hint"},Cpe={class:"row"},xpe={class:"rlabel"},Ape={class:"hint"},Mpe={class:"row"},Tpe={class:"rlabel"},Epe={class:"hint"},Ipe={key:1,class:"empty-config"},$pe={class:"panel"},Lpe={class:"sec"},Npe={class:"sec-title"},Rpe={class:"row"},Ope={class:"rlabel"},Ppe={class:"rvalue mono"},Dpe={class:"row"},Bpe={class:"rlabel"},Fpe={class:"rvalue mono"},Hpe={key:0,class:"row"},zpe={class:"rlabel"},Wpe={class:"hint"},Upe={class:"hint"},qpe={class:"row"},jpe={class:"rlabel"},Vpe={key:0,class:"hint"},Kpe={class:"panel"},Gpe={class:"panel-head"},Ype={class:"panel-title"},Qpe={class:"panel-desc"},Xpe={class:"archive-toolbar"},Zpe={class:"archive-search"},Jpe=["placeholder"],eme={value:"all"},tme=["value"],nme={key:0,class:"archive-empty"},ome={key:0,class:"archive-list"},sme={class:"archive-workspace"},ime={class:"path"},rme={class:"count"},lme={class:"setting-card"},ame={class:"archive-meta"},cme={class:"archive-name"},ume={class:"archive-time"},dme={key:1,class:"archive-empty"},fme=100,hme=je({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X("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=U8(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=X(null);Ey(u);function d(ne){ne.key==="Escape"&&s("close")}Sn(()=>document.addEventListener("keydown",d)),In(()=>document.removeEventListener("keydown",d));function f(){OM()}const p=B(()=>{const ne=new Map;for(const Q of o.models??[])ne.set(Q.id,{id:Q.id,label:Q.displayName??Q.model??Q.id,provider:Q.provider});for(const[Q,ee]of Object.entries(o.config?.models??{})){if(ne.has(Q))continue;const ye=w(ee);ne.set(Q,{id:Q,label:k(Q,ee,ye),provider:ye??Q})}return Array.from(ne.values())}),h=B(()=>{const ne=new Map;for(const Q of p.value){const ee=ne.get(Q.provider)??[];ee.push(Q),ne.set(Q.provider,ee)}for(const Q of ne.values())Q.sort((ee,ye)=>ee.label.localeCompare(ye.label));return Array.from(ne.entries()).toSorted(([Q],[ee])=>Q.localeCompare(ee)).map(([Q,ee])=>({provider:Q,options:ee}))}),m=B(()=>{const ne=o.config?.defaultPermissionMode;return ne==="auto"||ne==="yolo"||ne==="manual"?ne:"manual"});function w(ne){if(!ne||typeof ne!="object")return;const Q=ne;return typeof Q.provider=="string"?Q.provider:void 0}function k(ne,Q,ee){if(!Q||typeof Q!="object")return ne;const ye=Q,xe=typeof ye.model=="string"?ye.model:void 0,Xe=ee??w(Q);return xe&&Xe?`${ne} (${Xe}/${xe})`:xe?`${ne} (${xe})`:ne}function g(ne){return ne===!0}function v(ne){!ne||ne===o.config?.defaultModel||s("updateConfig",{defaultModel:ne})}function y(ne){ne!==m.value&&s("updateConfig",{defaultPermissionMode:ne})}function M(ne){const Q=o.config?.[ne];s("updateConfig",{[ne]:!g(Q)})}function O(){const ne=o.config?.thinking;return!ne||typeof ne!="object"?!0:ne.enabled!==!1}function L(){s("updateConfig",{thinking:{enabled:!O()}})}function b(){const ne=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!ne})}function T(ne){i.value=ne}const $=jy(),N=X([]),S=X(!1),E=X(!1),P=X(""),D=X("all"),F=X("archived-desc");async function W(){if(!(S.value||E.value)){S.value=!0;try{const ne=[];let Q;for(;;){const ee=await $.loadArchivedSessions({beforeId:Q,pageSize:fme});if(ne.push(...ee.items),!ee.hasMore||ee.items.length===0)break;const ye=ee.items.at(-1)?.id;if(ye===void 0)break;Q=ye}N.value=ne,E.value=!0}catch(ne){console.warn("loadAllArchived failed",ne)}finally{S.value=!1}}}Ve(i,ne=>{ne==="archived"&&!E.value&&W()});const K=B(()=>{const ne=new Set;for(const Q of N.value)ne.add(Q.cwd);return Array.from(ne).sort((Q,ee)=>Q.localeCompare(ee))}),Y=B(()=>{const ne=P.value.trim().toLowerCase();let Q=N.value.filter(ee=>ee.archived===!0);return D.value!=="all"&&(Q=Q.filter(ee=>ee.cwd===D.value)),ne&&(Q=Q.filter(ee=>ee.title.toLowerCase().includes(ne))),Q=Q.slice(),F.value==="archived-desc"?Q.sort((ee,ye)=>ye.updatedAt.localeCompare(ee.updatedAt)):F.value==="created-desc"?Q.sort((ee,ye)=>ye.createdAt.localeCompare(ee.createdAt)):Q.sort((ee,ye)=>ee.title.localeCompare(ye.title,"zh")),Q}),q=B(()=>{const ne=new Map;for(const Q of Y.value){const ee=ne.get(Q.cwd)??[];ee.push(Q),ne.set(Q.cwd,ee)}return Array.from(ne.entries()).map(([Q,ee])=>({cwd:Q,items:ee}))});async function ae(ne){await $.restoreSession(ne)&&(N.value=N.value.filter(ee=>ee.id!==ne))}function ce(ne){const Q=new Date(ne);if(Number.isNaN(Q.getTime()))return ne;const ee=ye=>String(ye).padStart(2,"0");return`${Q.getFullYear()}-${ee(Q.getMonth()+1)}-${ee(Q.getDate())} ${ee(Q.getHours())}:${ee(Q.getMinutes())}`}return(ne,Q)=>(_(),ke(mr,{open:!0,"close-on-esc":!1,title:x(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:Q[18]||(Q[18]=ee=>s("close"))},{default:we(()=>[C("div",{ref_key:"dialogRef",ref:u,class:"sd"},[C("nav",{class:"settings-tabs",role:"tablist","aria-label":x(n)("settings.title")},[(_(),I(Pe,null,nt(r,ee=>C("button",{key:ee.id,type:"button",class:De(["tab",{on:i.value===ee.id}]),role:"tab","aria-selected":i.value===ee.id,onClick:ye=>T(ee.id)},R(x(n)(ee.labelKey)),11,Che)),64))],8,She),C("div",xhe,[An(C("section",Ahe,[C("section",Mhe,[C("h3",The,R(x(n)("settings.appearance")),1),C("div",Ehe,[C("span",Ihe,R(x(n)("theme.colorSchemeLabel")),1),se(os,{"model-value":e.colorScheme,options:[{value:"light",label:x(n)("theme.light")},{value:"dark",label:x(n)("theme.dark")},{value:"system",label:x(n)("theme.system")}],"onUpdate:modelValue":Q[0]||(Q[0]=ee=>s("setColorScheme",ee))},null,8,["model-value","options"])]),C("div",$he,[C("span",Lhe,R(x(n)("theme.accentLabel")),1),se(os,{"model-value":e.accent,options:[{value:"blue",label:x(n)("theme.accentBlue")},{value:"mono",label:x(n)("theme.accentBlack")}],"onUpdate:modelValue":Q[1]||(Q[1]=ee=>s("setAccent",ee))},null,8,["model-value","options"])]),C("div",Nhe,[C("span",Rhe,R(x(n)("settings.uiFontSize")),1),C("label",Ohe,[C("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":x(n)("settings.uiFontSize"),onInput:Q[2]||(Q[2]=ee=>s("setUiFontSize",Number(ee.target.value)))},null,40,Phe),Q[19]||(Q[19]=C("span",{class:"num-unit"},"px",-1))])]),C("div",Dhe,[C("span",Bhe,R(x(n)("sidebar.language")),1),se(HT)]),C("div",Fhe,[C("span",Hhe,[qe(R(x(n)("settings.conversationToc"))+" ",1),C("span",zhe,R(x(n)("settings.conversationTocHint")),1)]),se(Rr,{"model-value":e.conversationToc??!0,label:x(n)("settings.conversationToc"),"onUpdate:modelValue":Q[3]||(Q[3]=ee=>s("setConversationToc",ee))},null,8,["model-value","label"])])]),C("section",Whe,[C("h3",Uhe,R(x(n)("settings.notifications")),1),C("div",qhe,[C("span",jhe,[qe(R(x(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(_(),I("span",Vhe,R(x(n)("settings.notifyDenied")),1)):re("",!0)]),se(Rr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:x(n)("settings.notifyOnComplete"),"onUpdate:modelValue":Q[4]||(Q[4]=ee=>s("setNotify",ee))},null,8,["model-value","disabled","label"])]),C("div",Khe,[C("span",Ghe,[qe(R(x(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(_(),I("span",Yhe,R(x(n)("settings.notifyDenied")),1)):re("",!0)]),se(Rr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:x(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":Q[5]||(Q[5]=ee=>s("setNotifyQuestion",ee))},null,8,["model-value","disabled","label"])]),C("div",Qhe,[C("span",Xhe,R(x(n)("settings.soundOnComplete")),1),se(Rr,{"model-value":e.sound,label:x(n)("settings.soundOnComplete"),"onUpdate:modelValue":Q[6]||(Q[6]=ee=>s("setSound",ee))},null,8,["model-value","label"])])])],512),[[Ns,i.value==="general"]]),An(C("section",Zhe,[C("section",Jhe,[C("h3",epe,R(x(n)("settings.account")),1),C("div",tpe,[C("span",npe,R(e.authReady?"managed:kimi-code":x(n)("sidebar.notSignedIn")),1),se(Kt,{text:e.accountModel},{default:we(()=>[e.authReady&&e.accountModel?(_(),I("span",ope,R(e.accountModel),1)):re("",!0)]),_:1},8,["text"])]),C("div",spe,[se(Dt,{variant:"secondary",size:"sm",onClick:Q[7]||(Q[7]=ee=>{s("openOnboarding"),s("close")})},{default:we(()=>[qe(R(x(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(_(),ke(Dt,{key:0,variant:"danger-soft",size:"sm",onClick:Q[8]||(Q[8]=ee=>s("logout"))},{default:we(()=>[qe(R(x(n)("sidebar.signOut")),1)]),_:1})):(_(),ke(Dt,{key:1,variant:"primary",size:"sm",onClick:Q[9]||(Q[9]=ee=>s("login"))},{default:we(()=>[qe(R(x(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[Ns,i.value==="account"]]),An(C("section",ipe,[C("section",rpe,[C("div",lpe,[C("h3",ape,R(x(n)("settings.agentDefaults")),1),e.configSaving?(_(),I("span",cpe,R(x(n)("settings.saving")),1)):re("",!0)]),e.config?(_(),I(Pe,{key:0},[C("div",upe,[C("span",dpe,[qe(R(x(n)("settings.defaultModel"))+" ",1),C("span",fpe,R(x(n)("settings.defaultModelHint")),1)]),h.value.length>0?(_(),I("div",hpe,[se(Kv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":x(n)("settings.defaultModel"),"onUpdate:modelValue":v},{default:we(()=>[e.config.defaultModel?re("",!0):(_(),I("option",ppe,R(x(n)("settings.noDefaultModel")),1)),(_(!0),I(Pe,null,nt(h.value,ee=>(_(),I("optgroup",{key:ee.provider,label:ee.provider},[(_(!0),I(Pe,null,nt(ee.options,ye=>(_(),I("option",{key:ye.id,value:ye.id},R(ye.label),9,gpe))),128))],8,mpe))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(_(),I("span",vpe,R(e.config.defaultModel??x(n)("settings.noDefaultModel")),1))]),C("div",ype,[C("span",kpe,[qe(R(x(n)("settings.defaultPermission"))+" ",1),C("span",bpe,R(x(n)("settings.defaultPermissionHint")),1)]),se(os,{"model-value":m.value,options:a.map(ee=>({value:ee,label:x(n)(c[ee])})),"onUpdate:modelValue":Q[10]||(Q[10]=ee=>y(ee))},null,8,["model-value","options"])]),C("div",_pe,[C("span",wpe,[qe(R(x(n)("settings.defaultThinking"))+" ",1),C("span",Spe,R(x(n)("settings.defaultThinkingHint")),1)]),se(Rr,{"model-value":O(),disabled:e.configSaving,label:x(n)("settings.defaultThinking"),"onUpdate:modelValue":Q[11]||(Q[11]=ee=>L())},null,8,["model-value","disabled","label"])]),C("div",Cpe,[C("span",xpe,[qe(R(x(n)("settings.defaultPlanMode"))+" ",1),C("span",Ape,R(x(n)("settings.defaultPlanModeHint")),1)]),se(Rr,{"model-value":g(e.config.defaultPlanMode),disabled:e.configSaving,label:x(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Q[12]||(Q[12]=ee=>M("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),C("div",Mpe,[C("span",Tpe,[qe(R(x(n)("settings.mergeSkills"))+" ",1),C("span",Epe,R(x(n)("settings.mergeSkillsHint")),1)]),se(Rr,{"model-value":g(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:x(n)("settings.mergeSkills"),"onUpdate:modelValue":Q[13]||(Q[13]=ee=>M("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(_(),I("div",Ipe,R(x(n)("settings.configUnavailable")),1))])],512),[[Ns,i.value==="agent"]]),An(C("section",$pe,[C("section",Lpe,[C("h3",Npe,R(x(n)("settings.advanced")),1),C("div",Rpe,[C("span",Ope,R(x(n)("sidebar.daemon")),1),C("span",Ppe,R(x(l)),1)]),C("div",Dpe,[C("span",Bpe,R(x(n)("settings.serverVersion")),1),C("span",Fpe,R(e.serverVersion||"-"),1)]),e.config?(_(),I("div",Hpe,[C("span",zpe,[qe(R(x(n)("settings.telemetry"))+" ",1),C("span",Wpe,R(x(n)("settings.telemetryHint")),1),C("span",Upe,R(x(n)("settings.telemetryRestartHint")),1)]),se(Rr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:x(n)("settings.telemetry"),"onUpdate:modelValue":Q[14]||(Q[14]=ee=>b())},null,8,["model-value","disabled","label"])])):re("",!0),C("div",qpe,[C("span",jpe,[qe(R(x(n)("settings.exportLog"))+" ",1),x(_i)()?re("",!0):(_(),I("span",Vpe,R(x(n)("settings.logHint")),1))]),se(Dt,{variant:"secondary",size:"sm",onClick:f},{default:we(()=>[qe(R(x(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[Ns,i.value==="advanced"]]),An(C("section",Kpe,[C("div",Gpe,[Q[20]||(Q[20]=C("div",{class:"panel-kicker"},"Archived sessions",-1)),C("h4",Ype,R(x(n)("settings.archivedTitle")),1),C("p",Qpe,R(x(n)("settings.archivedDesc")),1)]),C("div",Xpe,[C("label",Zpe,[Q[21]||(Q[21]=C("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[C("circle",{cx:"11",cy:"11",r:"7"}),C("path",{d:"m21 21-4.3-4.3"})],-1)),An(C("input",{"onUpdate:modelValue":Q[15]||(Q[15]=ee=>P.value=ee),placeholder:x(n)("settings.archivedSearch")},null,8,Jpe),[[us,P.value]])]),se(Kv,{"model-value":D.value,size:"sm","aria-label":x(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Q[16]||(Q[16]=ee=>D.value=ee)},{default:we(()=>[C("option",eme,R(x(n)("settings.archivedAllWorkspaces")),1),(_(!0),I(Pe,null,nt(K.value,ee=>(_(),I("option",{key:ee,value:ee},R(ee),9,tme))),128))]),_:1},8,["model-value","aria-label"]),se(os,{size:"sm","model-value":F.value,options:[{value:"archived-desc",label:x(n)("settings.archivedSortArchived")},{value:"created-desc",label:x(n)("settings.archivedSortCreated")},{value:"name-asc",label:x(n)("settings.archivedSortName")}],"onUpdate:modelValue":Q[17]||(Q[17]=ee=>F.value=ee)},null,8,["model-value","options"])]),S.value?(_(),I("div",nme,R(x(n)("settings.archivedLoadingAll")),1)):(_(),I(Pe,{key:1},[q.value.length>0?(_(),I("div",ome,[(_(!0),I(Pe,null,nt(q.value,ee=>(_(),I("section",{key:ee.cwd,class:"archive-card"},[C("div",sme,[Q[22]||(Q[22]=C("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[C("path",{d:"M3 7h6l2 2h10v9H3z"}),C("path",{d:"M3 7V5h6l2 2"})],-1)),C("span",ime,R(ee.cwd),1),C("span",rme,R(x(n)("settings.archivedSessionsCount",{count:ee.items.length})),1)]),C("div",lme,[(_(!0),I(Pe,null,nt(ee.items,ye=>(_(),I("div",{key:ye.id,class:"archive-row"},[C("div",ame,[C("div",cme,R(ye.title),1),C("div",ume,R(x(n)("settings.archivedAt",{time:ce(ye.updatedAt)})),1)]),se(Dt,{variant:"secondary",size:"sm",onClick:xe=>ae(ye.id)},{default:we(()=>[qe(R(x(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(_(),I("div",dme,R(N.value.length===0?x(n)("settings.archivedEmpty"):x(n)("settings.archivedNoMatch")),1))],64))],512),[[Ns,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),pme=ut(hme,[["__scopeId","data-v-47260198"]]),mme={class:"aw"},gme={class:"crumbbar"},vme={class:"crumbs"},yme={key:0,class:"crumb-sep"},kme=["onClick"],bme={key:0,class:"filterbar"},_me=["placeholder"],wme={class:"folder-list"},Sme={key:0,class:"fl-loading"},Cme=["onClick"],xme={class:"folder-name search-rel"},Ame={key:0,class:"git-branch"},Mme={key:0,class:"fl-empty"},Tme={key:1,class:"fl-loading"},Eme=["onClick"],Ime={class:"folder-name"},$me={key:0,class:"git-branch"},Lme={key:0,class:"fl-empty"},Nme={class:"paste-row"},Rme={class:"paste-input-wrap"},Ome={key:1,class:"add-error",role:"alert"},Pme={class:"actions"},Dme={class:"footer-hint"},Bme=600,Fme=6,TC=150,Hme=je({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X(!0),r=X(!1),l=X(!1),a=X(""),c=X(null),u=X([]),d=X(""),f=X(!1),p=X([]),h=B(()=>d.value.trim().length>0);let m=0,w=null;function k(E,P){const D=E.toLowerCase(),F=P.toLowerCase();let W=0;for(let K=0;K<F.length&&W<D.length;K++)F[K]===D[W]&&W++;return W===D.length}async function g(E){const P=a.value,D=E.trim();if(!P||D===""){p.value=[],f.value=!1;return}const F=++m;f.value=!0;const W=[],K=[{path:P,depth:0}];let Y=0;for(;K.length>0&&Y<Bme&&W.length<TC;){if(F!==m)return;const q=K.shift();Y++;let ae;try{ae=await o.browseFs(q.path)}catch{continue}if(F!==m)return;for(const ce of ae.entries){if(!ce.isDir)continue;const ne=ce.path.startsWith(P)?ce.path.slice(P.length).replace(/^\/+/,""):ce.path;if(k(D,ne||ce.name)&&(W.push({path:ce.path,name:ce.name,rel:ne||ce.name,isGitRepo:ce.isGitRepo,branch:ce.branch}),W.length>=TC))break;q.depth+1<Fme&&K.push({path:ce.path,depth:q.depth+1})}F===m&&(p.value=[...W])}F===m&&(f.value=!1)}Ve(d,E=>{if(w&&clearTimeout(w),E.trim()===""){m++,p.value=[],f.value=!1;return}w=setTimeout(()=>void g(E),220)});const v=X(!1),y=X(""),M=B(()=>y.value.trim()),O=B(()=>{const E=a.value;if(!E)return[];const P=E.split("/").filter(Boolean),D=[{label:"/",path:"/"}];let F="";for(const W of P)F+=`/${W}`,D.push({label:W,path:F});return D}),L=B(()=>a.value.length>0);async function b(E){r.value=!0;try{const P=await o.browseFs(E);if(!P.path){l.value=!0;return}a.value=P.path,c.value=P.parent,u.value=P.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function T(E){E.isDir&&b(E.path)}function $(){c.value&&b(c.value)}function N(){L.value&&s("add",a.value)}function S(){M.value.length!==0&&s("add",M.value)}return Sn(async()=>{r.value=!0;try{if(o.defaultPath&&(await b(o.defaultPath),!l.value))return;const E=await o.getFsHome();E.home?await b(E.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),In(()=>{w&&clearTimeout(w)}),(E,P)=>(_(),ke(mr,{open:i.value,"onUpdate:open":P[5]||(P[5]=D=>i.value=D),title:x(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:P[6]||(P[6]=D=>s("close"))},{default:we(()=>[C("div",mme,[l.value?re("",!0):(_(),I(Pe,{key:0},[C("div",gme,[se(Mn,{size:"sm",disabled:!c.value,label:x(n)("workspace.up"),onClick:$},{default:we(()=>[se(Qe,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),C("div",vme,[(_(!0),I(Pe,null,nt(O.value,(D,F)=>(_(),I(Pe,{key:D.path},[F>1?(_(),I("span",yme,"/")):re("",!0),C("button",{class:De(["crumb",{last:F===O.value.length-1}]),onClick:W=>b(D.path)},R(D.label),11,kme)],64))),128))])]),r.value?re("",!0):(_(),I("div",bme,[se(Qe,{class:"filter-icon",name:"search",size:"md"}),An(C("input",{"onUpdate:modelValue":P[0]||(P[0]=D=>d.value=D),class:"filter-input",type:"text",placeholder:x(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:P[1]||(P[1]=kt(()=>{},["stop"]))},null,40,_me),[[us,d.value]]),f.value?(_(),ke(ai,{key:0,size:"sm"})):re("",!0)])),C("div",wme,[r.value?(_(),I("div",Sme,R(x(n)("workspace.browsing")),1)):h.value?(_(),I(Pe,{key:1},[(_(!0),I(Pe,null,nt(p.value,D=>(_(),I("button",{key:D.path,class:"folder-row",onClick:F=>b(D.path)},[se(Qe,{class:"dir-icon",name:"folder-closed",size:"sm"}),C("span",xme,R(D.rel),1),D.isGitRepo?(_(),ke(Do,{key:0,variant:"info",size:"sm"},{default:we(()=>[qe(R(x(n)("workspace.gitTag")),1),D.branch?(_(),I("span",Ame,R(D.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,Cme))),128)),!f.value&&p.value.length===0?(_(),I("div",Mme,R(x(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&p.value.length===0?(_(),I("div",Tme,R(x(n)("workspace.searching")),1)):re("",!0)],64)):(_(),I(Pe,{key:2},[(_(!0),I(Pe,null,nt(u.value,D=>(_(),I("button",{key:D.path,class:"folder-row",onClick:F=>T(D)},[se(Qe,{class:"dir-icon",name:"folder-closed",size:"sm"}),C("span",Ime,R(D.name),1),D.isGitRepo?(_(),ke(Do,{key:0,variant:"info",size:"sm"},{default:we(()=>[qe(R(x(n)("workspace.gitTag")),1),D.branch?(_(),I("span",$me,R(D.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,Eme))),128)),u.value.length===0?(_(),I("div",Lme,R(x(n)("workspace.noSubfolders")),1)):re("",!0)],64))])],64)),C("div",{class:De(["paste-section",{"paste-only":l.value}])},[!l.value&&!v.value?(_(),ke(Dt,{key:0,variant:"ghost",size:"sm",onClick:P[2]||(P[2]=D=>v.value=!0)},{default:we(()=>[qe(R(x(n)("workspace.pasteToggle")),1)]),_:1})):(_(),ke(uu,{key:1,label:x(n)("workspace.pathLabel")},{default:we(()=>[C("div",Nme,[C("div",Rme,[se(Kl,{modelValue:y.value,"onUpdate:modelValue":P[3]||(P[3]=D=>y.value=D),placeholder:x(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:gi(kt(S,["stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])]),se(Mn,{disabled:M.value.length===0,label:x(n)("workspace.add"),onClick:S},{default:we(()=>[se(Qe,{name:"plus",size:"md"})]),_:1},8,["disabled","label"])])]),_:1},8,["label"]))],2),e.error?(_(),I("div",Ome,R(e.error),1)):re("",!0),C("div",Pme,[se(Kt,{text:a.value},{default:we(()=>[l.value?re("",!0):(_(),ke(Dt,{key:0,variant:"primary",disabled:!L.value,onClick:N},{default:we(()=>[qe(R(x(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),se(Dt,{variant:"secondary",onClick:P[4]||(P[4]=D=>s("close"))},{default:we(()=>[qe(R(x(n)("workspace.cancel")),1)]),_:1})]),C("div",Dme,R(x(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),zme=ut(Hme,[["__scopeId","data-v-ad529757"]]),Wme={key:0,class:"confirm-dialog__message"},Ume=je({__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=X(null);function o(){const c=n.value?.$el;return c instanceof HTMLElement?c:null}const s=e,i=t,{t:r}=Tt();function l(){i("update:open",!1),i("cancel")}function a(c){if(c.key!=="Enter"||!s.open||s.loading)return;const u=c.target;u instanceof HTMLButtonElement||u instanceof HTMLAnchorElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement||u instanceof HTMLInputElement||(c.preventDefault(),i("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",a),so(()=>{typeof window<"u"&&window.removeEventListener("keydown",a)}),(c,u)=>(_(),ke(mr,{open:e.open,title:e.title,height:"auto","initial-focus":o,"onUpdate:open":u[1]||(u[1]=d=>i("update:open",d)),onClose:l},{foot:we(()=>[se(Dt,{variant:"secondary",disabled:e.loading,onClick:l},{default:we(()=>[qe(R(e.cancelLabel??x(r)("common.cancel")),1)]),_:1},8,["disabled"]),se(Dt,{ref_key:"confirmButtonRef",ref:n,variant:e.variant,loading:e.loading,onClick:u[0]||(u[0]=d=>i("confirm"))},{default:we(()=>[qe(R(e.confirmLabel??x(r)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:we(()=>[e.message?(_(),I("p",Wme,R(e.message),1)):re("",!0)]),_:1},8,["open","title"]))}}),qme=ut(Ume,[["__scopeId","data-v-76e206e7"]]),jme=je({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=cl();return(o,s)=>(_(),ke(qme,{open:x(t)!==null,title:x(t)?.title??"",message:x(t)?.message,"confirm-label":x(t)?.confirmLabel,"cancel-label":x(t)?.cancelLabel,variant:x(t)?.variant,onConfirm:s[0]||(s[0]=i=>x(n)(!0)),onCancel:s[1]||(s[1]=i=>x(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),Vme={class:"rows"},Kme={class:"row"},Gme={class:"row"},Yme={class:"row"},Qme={class:"row"},Xme={class:"row"},Zme={class:"row"},Jme={class:"ctx-text"},ege={key:0,class:"bar"},tge={class:"row"},nge=je({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X(!0),r=B(()=>o.status.ctxMax>0?Math.round(o.status.ctxUsed/o.status.ctxMax*100):0),l=B(()=>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(h){return n(h==="yolo"?"status.permissionYolo":h==="auto"?"status.permissionAuto":"status.permissionManual")}const c=B(()=>{const h=o.status.permission;return h==="yolo"?"var(--color-danger)":h==="auto"?"var(--color-warning)":"var(--color-text)"}),u=B(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=B(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=B(()=>typeof o.costUsd=="number"&&o.costUsd>0),p=B(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(h,m)=>(_(),ke(mr,{open:i.value,"onUpdate:open":m[0]||(m[0]=w=>i.value=w),title:x(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=w=>s("close"))},{default:we(()=>[C("dl",Vme,[C("div",Kme,[C("dt",null,R(x(n)("status.statusModel")),1),C("dd",null,R(e.status.model),1)]),C("div",Gme,[C("dt",null,R(x(n)("status.statusThinking")),1),C("dd",null,R(e.thinking),1)]),C("div",Yme,[C("dt",null,R(x(n)("status.statusPermission")),1),C("dd",{style:en({color:c.value})},R(a(e.status.permission)),5)]),C("div",Qme,[C("dt",null,R(x(n)("status.statusPlanMode")),1),C("dd",{class:De({"plan-on":e.planMode})},R(u.value),3)]),C("div",Xme,[C("dt",null,R(x(n)("status.statusSwarmMode")),1),C("dd",{class:De({"swarm-on":e.swarmMode})},R(d.value),3)]),C("div",Zme,[C("dt",null,R(x(n)("status.statusContext")),1),C("dd",null,[C("span",Jme,R(l.value),1),e.status.ctxMax>0?(_(),I("span",ege,[C("i",{style:en({width:r.value+"%"})},null,4)])):re("",!0)])]),C("div",tge,[C("dt",null,R(x(n)("status.statusCost")),1),C("dd",null,R(p.value),1)])])]),_:1},8,["open","title"]))}}),oge=ut(nge,[["__scopeId","data-v-59dd31f3"]]),sge={class:"ui-toast__icon","aria-hidden":"true"},ige={class:"ui-toast__body"},rge={class:"ui-toast__title"},lge={key:0,class:"ui-toast__msg"},age=je({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(_(),I("div",{class:De(["ui-toast",`ui-toast--${e.variant}`])},[C("span",sge,[On(t.$slots,"icon",{},()=>[e.variant==="success"?(_(),ke(Qe,{key:0,name:"check"})):e.variant==="danger"?(_(),ke(Qe,{key:1,name:"close"})):e.variant==="warning"?(_(),ke(Qe,{key:2,name:"alert-triangle"})):(_(),ke(Qe,{key:3,name:"info"}))],!0)]),C("div",ige,[C("div",rge,R(e.title),1),e.message?(_(),I("div",lge,R(e.message),1)):re("",!0),On(t.$slots,"default",{},void 0,!0)]),se(Mn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:we(()=>[se(Qe,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),cge=ut(age,[["__scopeId","data-v-adc6f346"]]),uge={key:0,class:"actions"},dge=["onClick"],fge=["onClick"],hge={key:1,class:"details"},pge=je({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt();function i(b){return typeof b=="object"&&b!==null}function r(b){return i(b)?b.title:b}function l(b){return i(b)?b.message??"":""}function a(b){return i(b)?b.details:void 0}function c(b){return i(b)?b.severity==="error":b.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(b)}function u(b){return i(b)?`notice:${b.severity}:${b.title}:${b.message??""}:${JSON.stringify(b.details??[])}`:`text:${b}`}function d(b){if(!i(b))return b;const T=[b.title];b.message&&T.push(b.message);const $=b.details??[];if($.length>0){T.push("",`${s("warnings.diagnostics")}:`);for(const N of $)T.push(`${N.label}: ${N.value}`)}return T.join(`
290
+ `)}let f=1;const p=X([]),h=new Map,m=new Map;function w(b){const T=c(b)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?T+5e3:T}function k(b,T){const $=h.get(b)??{handle:null,deadline:0,remaining:0};$.handle=setTimeout(()=>L(b),T),$.deadline=Date.now()+T,h.set(b,$)}function g(b){const T=h.get(b);T&&T.handle!==null&&clearTimeout(T.handle),h.delete(b)}function v(b){const T=h.get(b);!T||T.handle===null||(clearTimeout(T.handle),T.handle=null,T.remaining=Math.max(0,T.deadline-Date.now()))}function y(b){if(p.value.find(N=>N.id===b)?.detailsOpen)return;const $=h.get(b);!$||$.handle!==null||k(b,$.remaining)}function M(b){b.detailsOpen=!b.detailsOpen,b.detailsOpen?v(b.id):y(b.id)}async function O(b){if(!await Go(d(b.warning)))return;b.copied=!0;const $=m.get(b.id);$&&clearTimeout($),m.set(b.id,setTimeout(()=>{b.copied=!1,m.delete(b.id)},1400))}function L(b){g(b);const T=m.get(b);T&&clearTimeout(T),m.delete(b);const $=p.value.findIndex(N=>N.id===b);$!==-1&&(p.value=p.value.filter(N=>N.id!==b),o("dismiss",$))}return Ve(()=>n.warnings,b=>{const T=[...p.value];p.value=b.map($=>{const N=u($),S=T.findIndex(D=>D.key===N),E=S===-1?void 0:T.splice(S,1)[0];if(E)return E.warning=$,E;const P={id:f++,key:N,warning:$,detailsOpen:!1,copied:!1};return k(P.id,w($)),P});for(const $ of T){g($.id);const N=m.get($.id);N&&clearTimeout(N),m.delete($.id)}},{immediate:!0,flush:"post"}),In(()=>{h.forEach(b=>{b.handle!==null&&clearTimeout(b.handle)}),h.clear(),m.forEach(b=>clearTimeout(b)),m.clear()}),(b,T)=>(_(),ke(p$,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:we(()=>[(_(!0),I(Pe,null,nt(p.value,$=>(_(),ke(cge,{key:$.id,variant:c($.warning)?"danger":"warning",title:r($.warning),message:l($.warning),"dismiss-label":x(s)("warnings.dismiss"),onDismiss:N=>L($.id),onPointerenter:N=>v($.id),onPointerleave:N=>y($.id)},{default:we(()=>[a($.warning)?.length?(_(),I("div",uge,[C("button",{class:"link",type:"button",onClick:N=>M($)},R($.detailsOpen?x(s)("warnings.hideDetails"):x(s)("warnings.showDetails")),9,dge),C("button",{class:"link",type:"button",onClick:N=>O($)},R($.copied?x(s)("warnings.copied"):x(s)("warnings.copyDetails")),9,fge)])):re("",!0),$.detailsOpen&&a($.warning)?.length?(_(),I("dl",hge,[(_(!0),I(Pe,null,nt(a($.warning),N=>(_(),I("div",{key:`${N.label}:${N.value}`,class:"detail-row"},[C("dt",null,R(N.label),1),C("dd",null,R(N.value),1)]))),128))])):re("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),mge=ut(pge,[["__scopeId","data-v-92efeff8"]]),gge={class:"topbar"},vge={class:"wsq"},yge=["aria-label"],kge={class:"tb-path"},bge={class:"ws"},_ge={class:"se"},wge={class:"tb-sub"},Sge=je({__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}=Tt(),o=e,s=t,i=B(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=B(()=>o.workspace?.name??n("workspace.noWorkspace")),l=B(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(_(),I("div",gge,[C("span",vge,R(i.value),1),C("button",{type:"button",class:"tb-mid","aria-label":x(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[C("span",kge,[C("span",bge,R(r.value),1),e.sessionTitle?(_(),I(Pe,{key:0},[c[2]||(c[2]=C("span",{class:"sl"},"/",-1)),C("span",_ge,R(e.sessionTitle),1)],64)):re("",!0),c[3]||(c[3]=C("span",{class:"cv"},"⌄",-1))]),C("span",wge,[C("span",{class:De(["rd",{on:e.running}])},null,2),C("span",null,R(l.value),1),e.branch?(_(),I(Pe,{key:0},[qe(" · "+R(e.branch),1)],64)):re("",!0),e.sessionCount>0?(_(),I(Pe,{key:1},[qe(" · "+R(x(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):re("",!0)])],8,yge),se(Mn,{size:"lg",label:x(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:we(()=>[se(Qe,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Cge=ut(Sge,[["__scopeId","data-v-59a11935"]]),xge={key:0,class:"sheet-root"},Age=["aria-label"],Mge=["aria-label"],Tge={key:0,class:"sheet-head"},Ege={class:"sheet-title"},Ige={class:"sheet-body"},$ge=je({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return Ve(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),In(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(_(),ke(Jr,{name:"sheet"},{default:we(()=>[e.modelValue?(_(),I("div",xge,[C("div",{class:"sheet-scrim",onClick:i}),C("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||x(n)("mobile.sheetLabel")},[C("button",{type:"button",class:"sheet-grab","aria-label":x(n)("mobile.closeSheet"),onClick:i},null,8,Mge),e.title?(_(),I("div",Tge,[C("span",Ege,R(e.title),1)])):re("",!0),C("div",Ige,[On(l.$slots,"default",{},void 0,!0)])],8,Age)])):re("",!0)]),_:3}))}}),zT=ut($ge,[["__scopeId","data-v-4441dd70"]]),Lge={class:"mlist"},Nge={key:0,class:"mempty"},Rge=["onClick"],Oge={class:"mgh-main"},Pge={class:"mgh-name"},Dge={class:"mgh-path"},Bge={key:2,class:"att"},Fge={key:0,class:"mempty small"},Hge=["onClick"],zge={class:"m"},Wge={class:"s"},Uge={key:0,class:"att"},qge=["disabled","onClick"],jge=["onClick"],Vge=je({__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}=Tt(),{confirm:o}=cl(),s=e,i=t;function r(){i("update:modelValue",!1)}function l(S){i("select",S),r()}function a(S){i("createInWorkspace",S),r()}function c(){i("create"),r()}function u(){i("addWorkspace"),r()}const d=X(new Set);function f(S){return d.value.has(S)}function p(S){const E=new Set(d.value);E.has(S)?E.delete(S):E.add(S),d.value=E,y.value=null,b.value=null}const h=X(new Set);function m(S){return h.value.has(S)}function w(S){const E=new Set(h.value);E.has(S)?E.delete(S):E.add(S),h.value=E}function k(S){if(m(S.workspace.id))return S.sessions;const E=S.sessions.slice(0,S.initialCount);if(s.activeId&&!E.some(P=>P.id===s.activeId)){const P=S.sessions.find(D=>D.id===s.activeId);if(P)return[...E,P]}return E}function g(S){if(!h.value.has(S)){const E=new Set(h.value);E.add(S),h.value=E}i("loadMore",S)}function v(S){return s.attentionByWorkspace[S]??0}const y=X(null);function M(S){y.value=y.value===S?null:S,b.value=null}function O(S){y.value=null;const P=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();P&&i("rename",S.id,P)}async function L(S){y.value=null,await o({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const b=X(null);function T(S){b.value=b.value===S?null:S,y.value=null}function $(S){Go(S.root),b.value=null}async function N(S){b.value=null,await o({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:S.name}),variant:"danger"})&&i("deleteWorkspace",S.id)}return(S,E)=>(_(),ke(zT,{"model-value":e.modelValue,"onUpdate:modelValue":E[2]||(E[2]=P=>i("update:modelValue",P))},{default:we(()=>[C("button",{type:"button",class:"newrow",onClick:c},[se(Qe,{name:"message",size:"sm"}),qe(" "+R(x(n)("sidebar.newChat")),1)]),C("button",{type:"button",class:"newrow secondary",onClick:u},[se(Qe,{name:"folder",size:"sm"}),qe(" "+R(x(n)("sidebar.newWorkspace")),1)]),C("div",Lge,[e.groups.length===0?(_(),I("div",Nge,R(x(n)("workspace.noWorkspace")),1)):re("",!0),(_(!0),I(Pe,null,nt(e.groups,P=>(_(),I("div",{key:P.workspace.id,class:"mgroup"},[C("div",{class:De(["mgh",{on:P.workspace.id===e.activeWorkspaceId}]),onClick:D=>p(P.workspace.id)},[f(P.workspace.id)?(_(),ke(Qe,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(_(),ke(Qe,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),C("div",Oge,[C("span",Pge,R(P.workspace.name),1),se(Kt,{text:P.workspace.root},{default:we(()=>[C("span",Dge,R(P.workspace.branch||P.workspace.shortPath),1)]),_:2},1032,["text"])]),f(P.workspace.id)&&v(P.workspace.id)>0?(_(),I("span",Bge,R(v(P.workspace.id)),1)):re("",!0),se(Mn,{size:"lg",class:"mgh-more",label:x(n)("sidebar.options"),onClick:kt(D=>T(P.workspace.id),["stop"])},{default:we(()=>[se(Qe,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),se(Mn,{size:"lg",class:"mgh-add",label:x(n)("workspace.newInGroup"),onClick:kt(D=>a(P.workspace.id),["stop"])},{default:we(()=>[se(Qe,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),b.value===P.workspace.id?(_(),ke(Ul,{key:3,class:"kmenu wsmenu",onClick:E[0]||(E[0]=kt(()=>{},["stop"]))},{default:we(()=>[se(_n,{size:"lg",onClick:D=>$(P.workspace)},{default:we(()=>[qe(R(x(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),se(_n,{size:"lg",danger:"",onClick:D=>N(P.workspace)},{default:we(()=>[qe(R(x(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,Rge),An(C("div",null,[P.sessions.length===0?(_(),I("div",Fge,R(x(n)("sidebar.noSessions")),1)):re("",!0),(_(!0),I(Pe,null,nt(k(P),D=>(_(),I("div",{key:D.id,class:De(["srow",{cur:D.id===e.activeId}]),onClick:F=>l(D.id)},[C("div",zge,[C("div",{class:De(["t",{run:D.busy,aborted:D.status==="aborted"}])},R(D.title),3),C("div",Wge,R(D.time),1)]),(e.attentionBySession[D.id]??0)>0?(_(),I("span",Uge,R(e.attentionBySession[D.id]),1)):re("",!0),se(Mn,{size:"lg",class:"kb",label:x(n)("sidebar.options"),onClick:kt(F=>M(D.id),["stop"])},{default:we(()=>[se(Qe,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===D.id?(_(),ke(Ul,{key:1,class:"kmenu",onClick:E[1]||(E[1]=kt(()=>{},["stop"]))},{default:we(()=>[se(_n,{size:"lg",onClick:F=>O(D)},{default:we(()=>[qe(R(x(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),se(_n,{size:"lg",danger:"",onClick:F=>L(D.id)},{default:we(()=>[qe(R(x(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,Hge))),128)),P.hasMore||P.loadingMore?(_(),I("button",{key:1,type:"button",class:"mshow-more",disabled:P.loadingMore,onClick:kt(D=>g(P.workspace.id),["stop"])},R(P.loadingMore?x(n)("sidebar.loadingMore"):x(n)("sidebar.showMore",{count:Math.max(0,P.workspace.sessionCount-P.sessions.length)})),9,qge)):re("",!0),P.sessions.length>P.initialCount?(_(),I("button",{key:2,type:"button",class:"mshow-more",onClick:kt(D=>w(P.workspace.id),["stop"])},R(m(P.workspace.id)?x(n)("sidebar.showLess"):x(n)("sidebar.showAll",{count:P.sessions.length-P.initialCount})),9,jge)):re("",!0)],512),[[Ns,!f(P.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),Kge=ut(Vge,[["__scopeId","data-v-58db7de1"]]),Gge={class:"group-title"},Yge={class:"srow-main"},Qge={class:"srow-label"},Xge={class:"srow-sub"},Zge={class:"srow read-only"},Jge={class:"srow-main"},e1e={class:"srow-label"},t1e={key:0,class:"srow-sub"},n1e={class:"srow-main"},o1e={class:"srow-label"},s1e={class:"srow-sub"},i1e=["aria-checked"],r1e={class:"srow-main"},l1e={class:"srow-label"},a1e={class:"srow-sub"},c1e=["aria-checked"],u1e={class:"srow-main"},d1e={class:"srow-label"},f1e={class:"srow read-only"},h1e={class:"srow-main"},p1e={class:"srow-label"},m1e={class:"srow-sub"},g1e=["aria-label"],v1e={class:"group-title"},y1e={class:"srow-main"},k1e={class:"srow-label"},b1e={class:"srow-sub"},_1e={class:"srow read-only pref"},w1e={class:"srow-main"},S1e={class:"srow-label"},C1e={class:"srow read-only pref"},x1e={class:"srow-main"},A1e={class:"srow-label"},M1e={class:"srow read-only pref"},T1e={class:"srow-main"},E1e={class:"srow-label"},I1e={class:"num-field"},$1e=["value","aria-label"],L1e={class:"srow-main"},N1e={class:"srow-label"},R1e={class:"srow-sub"},O1e=["aria-checked"],P1e={class:"srow-main"},D1e={class:"srow-label"},B1e={class:"srow-main"},F1e={class:"srow-label"},H1e={key:2,class:"srow read-only"},z1e={class:"srow-main"},W1e={class:"srow-label"},U1e={class:"srow-val dim"},q1e={class:"arch-subhead"},j1e={class:"arch-count"},V1e={class:"arch-tools"},K1e={key:0,class:"arch-empty"},G1e={class:"arch-meta"},Y1e={class:"arch-name"},Q1e={class:"arch-time"},X1e={key:2,class:"arch-empty"},Z1e=100,J1e=je({__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}=Tt(),o=e,s=t;function i(ce){s("setColorScheme",ce)}const r=["manual","auto","yolo"],l=B(()=>{const ce=o.status?.modelId??o.status?.model??"";return o.models?.find(ne=>ne.id===ce||ne.model===ce||ne.displayName===o.status?.model)}),a=B(()=>vd(l.value)),c=B(()=>Ay(l.value)),u=B(()=>Xl(l.value,o.thinking??"off")),d=B(()=>{const ce=c.value,ne=u.value;return ce.includes(ne)?ne:ce.includes("on")?"on":ce[0]??"off"}),f=B(()=>c.value.map(ce=>({value:ce,label:Vv(ce)}))),p=B(()=>o.planMode===!0),h=B(()=>o.swarmMode===!0),m=B(()=>{const ce=o.status.permission;return ce==="yolo"?"var(--color-danger)":ce==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),w=B(()=>{const ce=o.status.permission,ne=n(ce==="yolo"?"mobile.permYoloSub":ce==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${ce} · ${ne}`}),k=ce=>`${Math.round(ce/1e3)}k`,g=B(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(o.status.ctxUsed/o.status.ctxMax*100))):0),v=B(()=>o.status.ctxMax>0?`${k(o.status.ctxUsed)}/${k(o.status.ctxMax)}`:n("status.statusNone"));function y(ce){s("setThinking",My(l.value,ce))}function M(){const ce=r.indexOf(o.status.permission),ne=r[(ce+1)%r.length];s("setPermission",ne)}function O(){s("pickModel"),s("update:modelValue",!1)}function L(){s("login"),s("update:modelValue",!1)}function b(){s("logout"),s("update:modelValue",!1)}const T=jy(),$=X("main"),N=X([]),S=X(!1),E=X(!1),P=X(""),D=X("archived-desc");async function F(){if(!S.value){S.value=!0,E.value=!1;try{const ce=[];let ne;for(;;){const Q=await T.loadArchivedSessions({beforeId:ne,pageSize:Z1e});if(ce.push(...Q.items),!Q.hasMore||Q.items.length===0)break;const ee=Q.items.at(-1)?.id;if(ee===void 0)break;ne=ee}N.value=ce,E.value=!0}catch(ce){console.warn("loadAllArchived failed",ce)}finally{S.value=!1}}}function W(){$.value="archived",P.value="",F()}function K(){$.value="main"}const Y=B(()=>{const ce=P.value.trim().toLowerCase();let ne=N.value.filter(Q=>Q.archived===!0);return ce&&(ne=ne.filter(Q=>Q.title.toLowerCase().includes(ce))),ne=ne.slice(),D.value==="archived-desc"?ne.sort((Q,ee)=>ee.updatedAt.localeCompare(Q.updatedAt)):D.value==="created-desc"?ne.sort((Q,ee)=>ee.createdAt.localeCompare(Q.createdAt)):ne.sort((Q,ee)=>Q.title.localeCompare(ee.title,"zh")),ne});async function q(ce){await T.restoreSession(ce)&&(N.value=N.value.filter(Q=>Q.id!==ce))}function ae(ce){const ne=new Date(ce);if(Number.isNaN(ne.getTime()))return ce;const Q=ee=>String(ee).padStart(2,"0");return`${ne.getFullYear()}-${Q(ne.getMonth()+1)}-${Q(ne.getDate())} ${Q(ne.getHours())}:${Q(ne.getMinutes())}`}return Ve(()=>o.modelValue,ce=>{ce||($.value="main")}),(ce,ne)=>(_(),ke(zT,{"model-value":e.modelValue,title:x(n)("mobile.settingsTitle"),"onUpdate:modelValue":ne[6]||(ne[6]=Q=>s("update:modelValue",Q))},{default:we(()=>[$.value==="main"?(_(),I(Pe,{key:0},[C("div",Gge,R(x(n)("mobile.groupSession")),1),C("button",{type:"button",class:"srow",onClick:O},[C("span",Yge,[C("span",Qge,R(x(n)("status.statusModel")),1),C("span",Xge,R(e.status.model),1)]),ne[7]||(ne[7]=C("span",{class:"chev"},"›",-1))]),C("div",Zge,[C("span",Jge,[C("span",e1e,R(x(n)("status.statusThinking")),1),a.value==="unsupported"?(_(),I("span",t1e,R(x(n)("status.modeNotSupported")),1)):re("",!0)]),c.value.length>1?(_(),ke(os,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(_(),I("span",{key:1,class:De(["srow-val",{dim:d.value==="off"}])},R(d.value==="off"?x(n)("status.planOff"):x(Vv)(d.value)),3))]),C("button",{type:"button",class:"srow",onClick:ne[0]||(ne[0]=Q=>s("togglePlan"))},[C("span",n1e,[C("span",o1e,R(x(n)("status.statusPlanMode")),1),C("span",s1e,R(x(n)("mobile.planModeSub")),1)]),C("span",{class:De(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,i1e)]),C("button",{type:"button",class:"srow",onClick:ne[1]||(ne[1]=Q=>s("toggleSwarm"))},[C("span",r1e,[C("span",l1e,R(x(n)("status.statusSwarmMode")),1),C("span",a1e,R(x(n)("mobile.swarmModeSub")),1)]),C("span",{class:De(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,c1e)]),C("button",{type:"button",class:"srow",onClick:M},[C("span",u1e,[C("span",d1e,R(x(n)("status.statusPermission")),1),C("span",{class:"srow-sub",style:en({color:m.value})},R(w.value),5)]),ne[8]||(ne[8]=C("span",{class:"chev"},"›",-1))]),C("div",f1e,[C("span",h1e,[C("span",p1e,R(x(n)("status.statusContext")),1),C("span",m1e,R(v.value),1)]),C("span",{class:"ctx-meter","aria-label":v.value},[C("i",{style:en({width:g.value+"%"})},null,4)],8,g1e)]),C("div",v1e,R(x(n)("mobile.groupApp")),1),C("button",{type:"button",class:"srow",onClick:W},[C("span",y1e,[C("span",k1e,R(x(n)("mobile.archivedSessions")),1),C("span",b1e,R(x(n)("mobile.archivedSessionsSub")),1)]),ne[9]||(ne[9]=C("span",{class:"chev"},"›",-1))]),C("div",_1e,[C("span",w1e,[C("span",S1e,R(x(n)("theme.colorSchemeLabel")),1)]),se(os,{"model-value":e.colorScheme??"system",options:[{value:"light",label:x(n)("theme.light")},{value:"dark",label:x(n)("theme.dark")},{value:"system",label:x(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),C("div",C1e,[C("span",x1e,[C("span",A1e,R(x(n)("sidebar.language")),1)]),se(HT)]),C("div",M1e,[C("span",T1e,[C("span",E1e,R(x(n)("settings.uiFontSize")),1)]),C("label",I1e,[C("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":x(n)("settings.uiFontSize"),onInput:ne[2]||(ne[2]=Q=>s("setUiFontSize",Number(Q.target.value)))},null,40,$1e),ne[10]||(ne[10]=C("span",{class:"num-unit"},"px",-1))])]),C("button",{type:"button",class:"srow",onClick:ne[3]||(ne[3]=Q=>s("setConversationToc",!e.conversationToc))},[C("span",L1e,[C("span",N1e,R(x(n)("settings.conversationToc")),1),C("span",R1e,R(x(n)("settings.conversationTocHint")),1)]),C("span",{class:De(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,O1e)]),e.authReady?(_(),I("button",{key:0,type:"button",class:"srow acct out",onClick:b},[C("span",P1e,[C("span",D1e,R(x(n)("sidebar.signOut")),1)])])):(_(),I("button",{key:1,type:"button",class:"srow acct in",onClick:L},[C("span",B1e,[C("span",F1e,R(x(n)("sidebar.signIn")),1)])])),e.serverVersion?(_(),I("div",H1e,[C("span",z1e,[C("span",W1e,R(x(n)("settings.serverVersion")),1)]),C("span",U1e,R(e.serverVersion),1)])):re("",!0)],64)):(_(),I(Pe,{key:1},[C("div",q1e,[C("button",{type:"button",class:"arch-back",onClick:K},[ne[11]||(ne[11]=C("span",{class:"chev back"},"‹",-1)),qe(" "+R(x(n)("mobile.archivedBack")),1)]),C("span",j1e,R(x(n)("mobile.sessionCount",{n:Y.value.length})),1)]),C("div",V1e,[se(Kl,{class:"arch-search-input","model-value":P.value,size:"sm",placeholder:x(n)("settings.archivedSearch"),"onUpdate:modelValue":ne[4]||(ne[4]=Q=>P.value=Q)},null,8,["model-value","placeholder"]),se(os,{size:"sm","model-value":D.value,options:[{value:"archived-desc",label:x(n)("settings.archivedSortArchived")},{value:"created-desc",label:x(n)("settings.archivedSortCreated")},{value:"name-asc",label:x(n)("settings.archivedSortName")}],"onUpdate:modelValue":ne[5]||(ne[5]=Q=>D.value=Q)},null,8,["model-value","options"])]),S.value?(_(),I("div",K1e,R(x(n)("settings.archivedLoadingAll")),1)):Y.value.length>0?(_(!0),I(Pe,{key:1},nt(Y.value,Q=>(_(),I("div",{key:Q.id,class:"arch-row"},[C("div",G1e,[C("div",Y1e,R(Q.title),1),C("div",Q1e,R(x(n)("settings.archivedAt",{time:ae(Q.updatedAt)})),1)]),se(Dt,{variant:"secondary",size:"sm",onClick:ee=>q(Q.id)},{default:we(()=>[qe(R(x(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(_(),I("div",X1e,R(N.value.length===0?x(n)("settings.archivedEmpty"):x(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),eve=ut(J1e,[["__scopeId","data-v-eeaf31bb"]]),tve={class:"ob-brand"},nve={class:"ob-brand-text"},ove={class:"ob-title"},sve={class:"ob-sub"},ive={class:"ob-sec"},rve={class:"ob-label"},lve={class:"ob-sec"},ave={class:"ob-label"},cve={class:"ob-sec"},uve={class:"ob-label"},dve=je({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=Tt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=YM();function c(d){s.value!==d&&q4(d)}function u(){n("complete")}return(d,f)=>(_(),ke(mr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=p=>n("skip"))},{head:we(()=>[C("div",tve,[f[4]||(f[4]=C("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[C("defs",null,[C("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[C("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),C("g",{class:"ob-eyes",fill:"#000"},[C("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),C("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),C("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),C("div",nve,[C("div",ove,R(x(o)("onboarding.title")),1),C("div",sve,R(x(o)("onboarding.subtitle")),1)])])]),default:we(()=>[C("section",ive,[C("div",rve,R(x(o)("onboarding.languageLabel")),1),se(os,{"model-value":x(s),options:x(U4).map(p=>({value:p.code,label:p.label})),"onUpdate:modelValue":f[0]||(f[0]=p=>c(p))},null,8,["model-value","options"])]),C("section",lve,[C("div",ave,R(x(o)("theme.colorSchemeLabel")),1),se(os,{"model-value":x(i),options:[{value:"light",label:x(o)("theme.light")},{value:"dark",label:x(o)("theme.dark")},{value:"system",label:x(o)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=p=>x(l)(p))},null,8,["model-value","options"])]),C("section",cve,[C("div",uve,R(x(o)("theme.accentLabel")),1),se(os,{"model-value":x(r),options:[{value:"blue",label:x(o)("theme.accentBlue")},{value:"mono",label:x(o)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=p=>x(a)(p))},null,8,["model-value","options"])]),se(Dt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:we(()=>[qe(R(x(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),fve=ut(dve,[["__scopeId","data-v-fbdd3eab"]]),hve=["aria-label"],pve={class:"gload-box"},mve={class:"gload-text"},gve=je({__name:"GlobalLoading",setup(e){const{t}=Tt();return(n,o)=>(_(),I("div",{class:"gload",role:"status","aria-label":x(t)("app.connecting")},[C("div",pve,[o[0]||(o[0]=v0('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-8d6a5c44><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-8d6a5c44></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-8d6a5c44></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-8d6a5c44></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-8d6a5c44></path></svg>',1)),se(ai,{size:"md",label:x(t)("app.connecting")},null,8,["label"]),C("div",mve,R(x(t)("app.connecting")),1)])],8,hve))}}),vve=ut(gve,[["__scopeId","data-v-8d6a5c44"]]),yve={class:"kap-root"},kve={class:"kap-head"},bve={class:"kap-count"},_ve={class:"kap-head-actions"},wve={class:"kap-filters"},Sve=["value"],Cve={class:"kap-check"},xve={class:"kap-check"},Ave={class:"kap-view-toggle",role:"group"},Mve={key:0,class:"kap-empty"},Tve=["onClick"],Eve={class:"kap-ts"},Ive={class:"kap-label"},$ve={key:0,class:"kap-detail"},Lve={class:"kap-detail-actions"},Nve=["onClick"],Rve={key:1,class:"kap-agg"},Ove={class:"mono"},Pve={class:"mono"},Dve={class:"num"},Bve={class:"num"},Fve={key:0},Hve={class:"mono"},zve={class:"num"},Wve={class:"num"},Uve={key:0},qve=je({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=X("all"),s=X(""),i=X(""),r=X(!1),l=X("timeline"),a=B(()=>(Sy.value,[...XJ()])),c=B(()=>{const T=new Set;for(const $ of a.value)$.sessionId&&T.add($.sessionId);return[...T].sort()});function u(T){return T.kind==="rest:error"||T.code!==void 0&&T.code!==0||T.eventType==="error"||T.eventType==="parse-error"}const d=B(()=>{const T=s.value.trim().toLowerCase();return a.value.filter($=>!(o.value!=="all"&&$.source!==o.value||i.value&&$.sessionId!==i.value||r.value&&!u($)||T&&!`${$.label} ${$.kind} ${$.eventType??""} ${$.sessionId??""} ${$.requestId??""}`.toLowerCase().includes(T)))}),f=B(()=>{const T=new Map;for(const $ of d.value){if($.kind!=="ws:in"&&$.kind!=="ws:out")continue;const N=$.kind==="ws:in"?"←":"→",S=`${N} ${$.eventType??"?"} @ ${$.sessionId??"-"}`,E=T.get(S)??{key:S,sessionId:$.sessionId??"-",eventType:$.eventType??"?",dir:N,count:0};E.count++,$.seq!==void 0&&(E.lastSeq=$.seq),T.set(S,E)}return[...T.values()].sort(($,N)=>N.count-$.count)}),p=B(()=>{const T=new Map;for(const $ of d.value){if($.source!=="rest"||$.kind==="rest:request")continue;const N=`${$.method??"?"} ${$.path??"?"}`,S=T.get(N)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u($)&&S.errors++,$.durationMs!==void 0&&(S.totalMs+=$.durationMs,S.timed++),T.set(N,S)}return[...T.entries()].map(([$,N])=>({key:$,count:N.count,errors:N.errors,avgMs:N.timed>0?Math.round(N.totalMs/N.timed):0})).sort(($,N)=>N.count-$.count)}),h=X(null),m=X(!0),w=X(null),k=X(null);Ve(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await gt();const T=w.value;T&&(T.scrollTop=T.scrollHeight)});function g(T){h.value=h.value===T?null:T}function v(T){const $=new Date(T),N=(S,E=2)=>String(S).padStart(E,"0");return`${N($.getHours())}:${N($.getMinutes())}:${N($.getSeconds())}.${N($.getMilliseconds(),3)}`}function y(T){return JSON.stringify(T,null,2)}async function M(T){await Go(y(T))&&(k.value=T.id,setTimeout(()=>{k.value===T.id&&(k.value=null)},1500))}function O(){OM(d.value)}function L(T){return u(T)||T.source==="client"?"b-err":T.source==="rest"?"b-rest":T.kind==="ws:lifecycle"?"b-life":T.kind==="ws:out"?"b-out":"b-in"}function b(T){return T.source==="rest"?"REST":T.source==="client"?"APP":"WS"}return(T,$)=>(_(),I("section",yve,[C("header",kve,[$[11]||($[11]=C("strong",null,"KAP debug",-1)),C("span",bve,R(d.value.length)+"/"+R(a.value.length),1),C("div",_ve,[C("button",{type:"button",class:De({on:x(cu)}),onClick:$[0]||($[0]=N=>cu.value=!x(cu))},R(x(cu)?"resume":"pause"),3),C("button",{type:"button",onClick:$[1]||($[1]=N=>x(ZJ)())},"clear"),C("button",{type:"button",onClick:$[2]||($[2]=N=>O())},"export jsonl"),se(Kt,{text:"Close window"},{default:we(()=>[C("button",{type:"button",onClick:$[3]||($[3]=N=>n("close"))},"✕")]),_:1})])]),C("div",wve,[An(C("select",{"onUpdate:modelValue":$[4]||($[4]=N=>o.value=N),"aria-label":"Source filter"},[...$[12]||($[12]=[C("option",{value:"all"},"rest + ws + app",-1),C("option",{value:"rest"},"rest",-1),C("option",{value:"ws"},"ws",-1),C("option",{value:"client"},"app errors",-1)])],512),[[U1,o.value]]),An(C("select",{"onUpdate:modelValue":$[5]||($[5]=N=>i.value=N),"aria-label":"Session filter"},[$[13]||($[13]=C("option",{value:""},"all sessions",-1)),(_(!0),I(Pe,null,nt(c.value,N=>(_(),I("option",{key:N,value:N},R(N),9,Sve))),128))],512),[[U1,i.value]]),An(C("input",{"onUpdate:modelValue":$[6]||($[6]=N=>s.value=N),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[us,s.value]]),C("label",Cve,[An(C("input",{"onUpdate:modelValue":$[7]||($[7]=N=>r.value=N),type:"checkbox"},null,512),[[dh,r.value]]),$[14]||($[14]=qe(" errors",-1))]),C("label",xve,[An(C("input",{"onUpdate:modelValue":$[8]||($[8]=N=>m.value=N),type:"checkbox"},null,512),[[dh,m.value]]),$[15]||($[15]=qe(" follow",-1))]),C("div",Ave,[C("button",{type:"button",class:De({on:l.value==="timeline"}),onClick:$[9]||($[9]=N=>l.value="timeline")},"timeline",2),C("button",{type:"button",class:De({on:l.value==="aggregate"}),onClick:$[10]||($[10]=N=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(_(),I("div",{key:0,ref_key:"listRef",ref:w,class:"kap-list"},[d.value.length===0?(_(),I("div",Mve," No trace entries yet. REST calls and WS frames will appear here. ")):re("",!0),(_(!0),I(Pe,null,nt(d.value,N=>(_(),I("div",{key:N.id,class:"kap-row-wrap"},[C("button",{type:"button",class:De(["kap-row",{expanded:h.value===N.id}]),onClick:S=>g(N.id)},[C("span",Eve,R(v(N.ts)),1),C("span",{class:De(["kap-badge",L(N)])},R(b(N)),3),C("span",Ive,R(N.label),1)],10,Tve),h.value===N.id?(_(),I("div",$ve,[C("div",Lve,[C("button",{type:"button",onClick:S=>M(N)},R(k.value===N.id?"copied ✓":"copy json"),9,Nve)]),C("pre",null,R(y(N)),1)])):re("",!0)]))),128))],512)):(_(),I("div",Rve,[$[20]||($[20]=C("h4",null,"WS frames by session / type",-1)),C("table",null,[$[17]||($[17]=C("thead",null,[C("tr",null,[C("th",null,"dir"),C("th",null,"type"),C("th",null,"session"),C("th",null,"count"),C("th",null,"last seq")])],-1)),C("tbody",null,[(_(!0),I(Pe,null,nt(f.value,N=>(_(),I("tr",{key:N.key},[C("td",null,R(N.dir),1),C("td",Ove,R(N.eventType),1),C("td",Pve,R(N.sessionId),1),C("td",Dve,R(N.count),1),C("td",Bve,R(N.lastSeq??"—"),1)]))),128)),f.value.length===0?(_(),I("tr",Fve,[...$[16]||($[16]=[C("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):re("",!0)])]),$[21]||($[21]=C("h4",null,"REST by endpoint",-1)),C("table",null,[$[19]||($[19]=C("thead",null,[C("tr",null,[C("th",null,"endpoint"),C("th",null,"count"),C("th",null,"errors"),C("th",null,"avg ms")])],-1)),C("tbody",null,[(_(!0),I(Pe,null,nt(p.value,N=>(_(),I("tr",{key:N.key},[C("td",Hve,R(N.key),1),C("td",zve,R(N.count),1),C("td",{class:De(["num",{err:N.errors>0}])},R(N.errors),3),C("td",Wve,R(N.avgMs),1)]))),128)),p.value.length===0?(_(),I("tr",Uve,[...$[18]||($[18]=[C("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):re("",!0)])])]))]))}}),jve=ut(qve,[["__scopeId","data-v-3cda6fe3"]]),Vve=je({__name:"DebugPanel",setup(e){const t=X(!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 p of i){const h=d.getAttribute(p);h!==null?f.setAttribute(p,h):f.removeAttribute(p)}}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 h of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(h.cloneNode(!0));r(d),d.body.style.margin="0";const p=d.createElement("div");return p.style.height="100vh",d.body.appendChild(p),p}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=fh(jve,{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 Sn(()=>{c()}),so(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(_(),ke(Kt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:we(()=>[C("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),Kve=ut(Vve,[["__scopeId","data-v-21346738"]]);function Gve({client:e,authLogoRef:t}){const n=B(()=>e.authReady.value),o=B(()=>e.initialized.value&&!n.value),s="/login",i=X(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)}Ve(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 In(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function Yve({running:e,showAuthGate:t}){const{t:n}=Tt(),o=["◐","◓","◑","◒"],s=X(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}Ve(e,c=>{c?r():l()},{immediate:!0});const a=B(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});II(()=>{typeof document<"u"&&(document.title=a.value)}),In(()=>{l()})}const WT=X(typeof window>"u"?0:window.innerWidth);let xf=0,Xh=!1;function Qv(){WT.value=window.innerWidth}function Qve(){Xh||typeof window>"u"||(window.addEventListener("resize",Qv),Xh=!0,Qv())}function Xve(){!Xh||typeof window>"u"||(window.removeEventListener("resize",Qv),Xh=!1)}function UT(e,t,n){return Math.max(t,e-n)}function Xv(e,t,n){return Math.min(n,Math.max(t,e))}function qT(){return Sn(()=>{xf+=1,Qve()}),so(()=>{xf=Math.max(0,xf-1),xf===0&&Xve()}),{viewportWidth:WT}}const Zve="kimi-web.file-preview-width",Ha=320;function Jve({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=qT(),i=B(()=>Math.max(0,s.value-t.value)),r=B(()=>UT(i.value,Ha,Ha));function l(de){return Xv(Math.round(de),Ha,r.value)}function a(){return l(i.value/2)}const c=B(()=>a()),u=X(c.value),d=B(()=>Xv(u.value,Ha,r.value)),f=X(null),p=B(()=>{const de=f.value;if(!de)return null;const Z=e.turns.value.find(pe=>pe.id===de.turnId)?.blocks?.[de.blockIndex];return Z?.kind==="thinking"?Z.thinking:null}),h=B(()=>p.value!==null);function m(de){const z=f.value;if(z&&z.turnId===de.turnId&&z.blockIndex===de.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=de}function w(){f.value=null,n.value==="thinking"&&(n.value=null)}const k=X(null),g=B(()=>{const de=k.value;if(!de)return null;const z=e.turns.value.find(Z=>Z.id===de.turnId);return z?.role==="compaction"&&z.text?z.text:null}),v=B(()=>g.value!==null);function y(de){if(k.value?.turnId===de.turnId){k.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",k.value=de}function M(){k.value=null,n.value==="compaction"&&(n.value=null)}const O=X(null);function L(de){const z=e.activeAppTasks.value,Z=z.find(le=>le.id===de)??z.find(le=>le.parentToolCallId===de);if(Z)return Z.id;const pe=z.filter(le=>le.kind==="subagent"&&!le.parentToolCallId);if(pe.length===1)return pe[0].id}const b=B(()=>{const de=O.value;if(!de)return null;const z=e.activeAppTasks.value.find(Z=>Z.id===de.subagentId);return z?Uue(z):null}),T=B(()=>b.value!==null);function $(de){const z=L(de);if(z){if(O.value?.subagentId===z){O.value=null,n.value==="agent"&&(n.value=null);return}O.value={subagentId:z},n.value="agent"}}function N(){O.value=null,n.value==="agent"&&(n.value=null)}const S=X(null),E=B(()=>{const de=S.value;if(!de)return null;const z=YD(e.turns.value,de);return z?{id:de,title:oa(z.name),path:GD(z.arg),lines:z.status==="error"?null:K4(z),output:z.output}:null}),P=B(()=>E.value!==null);function D(de){if(n.value==="toolDiff"&&S.value===de){F();return}n.value="toolDiff",S.value=de}function F(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const W=X("list"),K=X(null);function Y(){if(n.value==="diff"){q();return}n.value="diff",W.value="list",K.value=null,e.loadGitStatus(e.activeSessionId.value)}function q(){n.value==="diff"&&(n.value=null),W.value="list",K.value=null,e.clearFileDiff()}async function ae(de){W.value="detail",K.value=de,await e.loadFileDiff(de)}async function ce(de){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,de):await e.openSideChat(de),n.value="btw"}function ne(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function Q(){n.value==="btw"&&(n.value=null)}const ee=B(()=>e.sideChatVisible.value),ye=B(()=>n.value!==null&&(n.value!=="thinking"||h.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||T.value)&&(n.value!=="toolDiff"||P.value)&&(n.value!=="btw"||ee.value)),xe=X(!1),Xe=X({});function me(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return k.value?{kind:"compaction",...k.value}:null;case"agent":return O.value?{kind:"agent",...O.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function G(de){if(de)switch(de.kind){case"thinking":f.value={turnId:de.turnId,blockIndex:de.blockIndex},n.value="thinking";break;case"compaction":k.value={turnId:de.turnId},n.value="compaction";break;case"agent":O.value={subagentId:de.subagentId},n.value="agent";break;case"toolDiff":S.value=de.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ie(){return n.value==="thinking"&&h.value?(w(),!0):n.value==="compaction"&&v.value?(M(),!0):n.value==="agent"&&T.value?(N(),!0):n.value==="toolDiff"&&P.value?(F(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(q(),!0):n.value==="btw"?(ne(),!0):!1}return Ve(e.activeSessionId,(de,z)=>{if(z){const Z=me();Z?Xe.value[z]=Z:delete Xe.value[z]}o(),w(),M(),N(),F(),q(),Q(),de&&G(Xe.value[de])}),{PREVIEW_WIDTH_KEY:Zve,PREVIEW_MIN:Ha,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:p,thinkingVisible:h,openThinkingPanel:m,closeThinkingPanel:w,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:M,agentPanelMember:b,agentPanelVisible:T,openAgentPanel:$,closeAgentPanel:N,toolDiffTarget:E,toolDiffVisible:P,openToolDiff:D,closeToolDiff:F,detailDiffMode:W,detailDiffPath:K,openDiffDetail:Y,closeDiffDetail:q,selectDiffFile:ae,btwVisible:ee,openSideChatTab:ce,closeSideChat:ne,hideSideChatPanel:Q,sidePanelVisible:ye,panelDragging:xe,closeOpenSidePanel:ie}}const e0e=Nt.sidebarWidth,EC=Nt.sidebarCollapsed,IC=270,x1=170,t0e=36,n0e=320;function o0e(e={}){const{viewportWidth:t}=qT(),n=X(IC),o=X(!1),s=B(()=>{const c=n0e+(ex(e.previewOpen)?Ha:0);return UT(t.value,x1,c)}),i=B(()=>o.value?t0e:Xv(n.value,x1,s.value));function r(){try{o.value=no(EC)==="true"}catch{o.value=!1}}function l(){try{io(EC,String(o.value))}catch{}}function a(){o.value=!o.value,l()}return{SIDEBAR_WIDTH_KEY:e0e,SIDEBAR_DEFAULT:IC,SIDEBAR_MIN:x1,sidebarMax:s,sessionColWidth:n,sidebarCollapsed:o,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function s0e({client:e,detailTarget:t}){const{t:n}=Tt(),o=X(null),s=X(null),i=X(!1),r=X(null),l=X(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=B(()=>{const L=l.value;return L?e.getFileDownloadUrl(L):null}),f=B(()=>o.value!==null);function p(L){return L.length>1?L.replace(/\/+$/,""):L}function h(L){const b=[];for(const T of L.split(/[\\/]+/))if(!(!T||T===".")){if(T===".."){b.pop();continue}b.push(T)}return b.join("/")}function m(L){const b=L.trim();if(!b)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(b))return{error:n("filePreview.errors.unsupportedPath")};if(b.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const T=p(e.status.value.cwd);if(b.startsWith("/")){if(!T||b!==T&&!b.startsWith(`${T}/`))return{error:n("filePreview.errors.outsideWorkspace")};const N=b===T?"":b.slice(T.length+1);if(N.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=h(N);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(b.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const $=h(b);return $?{path:$}:{error:n("filePreview.errors.emptyPath")}}async function w(L){const b=o.value;if(t.value==="file"&&b&&b.path===L.path&&b.line===L.line){y();return}const T=++a;u(),t.value="file",s.value=null,r.value=null,i.value=!0,o.value=L,l.value=null;const $=m(L.path);if("error"in $){i.value=!1,r.value=$.error;return}l.value=$.path;try{const N=await e.readFileContent($.path);if(T!==a)return;N?s.value={...N,path:N.path||$.path}:s.value={path:$.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(N){if(T!==a)return;r.value=N instanceof Error?N.message:n("filePreview.errors.loadFailed")}finally{T===a&&(i.value=!1)}}function k(L){return/^data:([^;,]+)/i.exec(L)?.[1]}function g(L){if(L.kind!=="image")return;const b=++a;u(),t.value="file",o.value=null,l.value=null,r.value=null;const T={path:L.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:L.mimeType??k(L.url)??"image/*",isBinary:!0,size:L.bytes??0};L.fileId?(i.value=!0,s.value=T,ht().getFileBlob(L.fileId).then($=>{if(b===a){if(t.value!=="file"||!s.value){i.value=!1;return}c=URL.createObjectURL($),s.value={...s.value,sourceUrl:c},i.value=!1}}).catch(()=>{b===a&&(s.value&&(s.value={...s.value,sourceUrl:L.url}),i.value=!1)})):(i.value=!1,s.value={...T,sourceUrl:L.url})}function v(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,u()}function y(){v(),t.value==="file"&&(t.value=null)}Ve(t,(L,b)=>{b==="file"&&L!=="file"&&v()});function M(){const L=s.value?.path??o.value?.path;L&&e.openWorkspaceFile(L,o.value?.line)}function O(){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:w,openMediaPreview:g,closeFilePreview:y,openPreviewInEditor:M,revealPreviewFile:O}}const i0e=640,r0e=`(max-width: ${i0e}px)`;function l0e(){const e=X(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(r0e);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),In(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),In(()=>t.removeListener(n))),e}const a0e={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},c0e={class:"server-auth-card"},u0e={class:"server-auth-body"},d0e={class:"server-auth-foot"},f0e=je({__name:"ServerAuthDialog",setup(e){const t=X(""),n=X(null),o=X(!1);Sn(()=>{gt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,DM(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(_(),I("div",a0e,[C("div",c0e,[l[1]||(l[1]=C("div",{class:"server-auth-head"},[C("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),C("p",{class:"server-auth-hint"},[qe(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),C("code",null,"KIMI_CODE_PASSWORD"),qe("). ")])],-1)),C("div",u0e,[se(Kl,{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"])]),C("div",d0e,[se(Dt,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:we(()=>[qe(R(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),h0e=ut(f0e,[["__scopeId","data-v-82150ea4"]]),p0e={class:"app-shell"},m0e={key:1,class:"auth-page"},g0e={class:"auth-page-inner"},v0e={class:"auth-page-copy"},y0e={key:0,class:"sidebar-rail"},k0e=["aria-label","aria-hidden"],b0e=je({__name:"App",setup(e){const t=aee(),n=X(!t);let o=null;const s=jy(),i=B(()=>!s.dangerousBypassAuth.value&&n.value);Nn("resolveImage",s.resolveImageUrl),Nn("resolveSwarmMembers",ft=>s.swarmMembersByToolCallId.value.get(ft)??[]);const{t:r}=Tt(),l=_i(),a=l0e(),c=X(!1),u=X(!1),d=B(()=>{const ft=s.activeSessionId.value;return s.sessions.value.find(ve=>ve.id===ft)?.title??""}),f=B(()=>s.visibleWorkspace.value?.sessionCount??0),p=B(()=>s.activity.value!=="idle"),h=X(null),{showAuthGate:m,blinkAuthLogo:w}=Gve({client:s,authLogoRef:h});Yve({running:p,showAuthGate:m});function k(ft){const ve=s.status.value.modelId??s.status.value.model??"",Oe=s.models.value.find(vo=>vo.id===ve||vo.model===ve||vo.displayName===s.status.value.model),jt=Ay(Oe),ra=Xl(Oe,ft),Ac=jt.indexOf(ra),Pi=jt[(Ac+1)%jt.length]??jt[0]??"off";return My(Oe,Pi)}const g=X(!s.onboarded.value);function v(){s.setOnboarded(!0),g.value=!1}function y(){g.value=!0}Sn(()=>{s.load(),xe(),document.addEventListener("keydown",M,!0),o=uee(()=>{n.value=!0,s.clearDangerousBypassAuth()})}),In(()=>{document.removeEventListener("keydown",M,!0),o!==null&&(o(),o=null)});function M(ft){ft.key==="Escape"&&(sn.value||ot()&&(ft.stopPropagation(),ft.preventDefault()))}const O=X(null),L=X(!1);Ve(s.activeSessionId,()=>{L.value=!0,gt(()=>{L.value=!1})});const{previewTarget:b,previewFile:T,previewLoading:$,previewError:N,previewDownloadUrl:S,previewExternalActions:E,openFilePreview:P,openMediaPreview:D,closeFilePreview:F,openPreviewInEditor:W,revealPreviewFile:K}=s0e({client:s,detailTarget:O}),Y=B(()=>O.value!==null),{SIDEBAR_WIDTH_KEY:q,SIDEBAR_DEFAULT:ae,SIDEBAR_MIN:ce,sidebarMax:ne,sessionColWidth:Q,sidebarCollapsed:ee,sideWidth:ye,loadSidebarCollapsed:xe,toggleSidebarCollapse:Xe}=o0e({previewOpen:Y}),{PREVIEW_WIDTH_KEY:me,PREVIEW_MIN:G,previewDefaultWidth:ie,previewMax:de,previewWidth:z,previewPanelWidth:Z,thinkingPanelText:pe,thinkingVisible:le,openThinkingPanel:he,closeThinkingPanel:U,compactionPanelText:J,compactionPanelVisible:fe,openCompactionPanel:be,closeCompactionPanel:Ee,agentPanelMember:Le,openAgentPanel:ue,closeAgentPanel:Ie,toolDiffTarget:Ge,openToolDiff:lt,closeToolDiff:bt,detailDiffMode:_t,detailDiffPath:$t,openDiffDetail:Bt,closeDiffDetail:yt,selectDiffFile:Gt,btwVisible:pn,openSideChatTab:ro,closeSideChat:Yt,sidePanelVisible:mn,panelDragging:zo,closeOpenSidePanel:ot}=Jve({client:s,sideWidth:ye,detailTarget:O,closeFilePreview:F}),zn=X(null),lo=X(!1),Gn=X(!1),Yn=X(!1),Zt=X(!1),Qn=X(!1),Ke=X(!1),Ze=X(null),Ft=X(null),sn=B(()=>Oa.value>0||lo.value||Gn.value||Yn.value||Zt.value||Qn.value||Ke.value||g.value||c.value||u.value),un=X(!1),tn=X(!1),Cn=X(!1),Mt=X(!1),Xn=X(!1);async function Ut(){un.value=!0,tn.value=!1,lo.value=!0;try{await s.refreshOAuthProviderModels(),await s.loadModels()}catch{tn.value=!0}finally{un.value=!1}}async function wo(){Cn.value=!0,Mt.value=!1,Gn.value=!0;try{await s.loadProviders()}catch{Mt.value=!0}finally{Cn.value=!1}}function To(){Yn.value=!0}async function xs(ft){lo.value=!1,await Wo(ft)}async function Wo(ft){await s.setModel(ft)&&ft!==s.defaultModel.value&&s.updateConfig({defaultModel:ft})}async function ds(ft){await s.addProvider(ft)}async function fs(ft){await s.deleteProvider(ft)}async function Ot(ft){await s.refreshProvider(ft)}async function Us(ft){Xn.value=!0;try{await s.updateConfig(ft)&&await s.checkAuth()}finally{Xn.value=!1}}async function qs(){return s.startOAuthLogin()}async function Ye(){return s.pollOAuthLogin()}async function tt(){return s.cancelOAuthLogin()}async function st(){Yn.value=!1,await s.checkAuth(),await s.load()}async function Ht(ft){await s.undo(1),await gt(),zn.value?.loadComposerForEdit(ft.text,ft.images)}function js(ft){if(ft==="/compact"||ft.startsWith("/compact ")){s.compact(ft.slice(8).trim()||void 0);return}if(ft==="/swarm"||ft.startsWith("/swarm ")){const ve=ft.slice(6).trim();ve==="on"?s.setSwarmMode(!0):ve==="off"?s.setSwarmMode(!1):ve?(s.setSwarmMode(!0),s.sendPrompt(ve)):s.toggleSwarmMode();return}if(ft==="/goal"||ft.startsWith("/goal ")){const ve=ft.slice(5).trim();ve==="pause"||ve==="resume"||ve==="cancel"?s.controlGoal(ve):ve?s.createGoal(ve):s.toggleGoalMode();return}if(ft==="/btw"||ft.startsWith("/btw ")){const ve=ft.slice(4).trim();!ve&&s.sideChatVisible.value?Yt():ro(ve||void 0);return}switch(ft){case"/new":case"/clear":Zn();break;case"/fork":s.forkSession();break;case"/undo":s.undo();break;case"/permission":{const ve=s.permission.value,Oe=ve==="manual"?"auto":ve==="auto"?"yolo":"manual";s.setPermission(Oe);break}case"/plan":s.togglePlanMode();break;case"/auto":s.setPermission("auto");break;case"/yolo":s.setPermission("yolo");break;case"/thinking":s.setThinking(k(s.thinking.value));break;case"/help":s.dismissWarning(-1);break;case"/status":Qn.value=!0;break;case"/model":Ut();break;case"/provider":break;case"/login":To();break;default:{const ve=ft.indexOf(" "),Oe=Kte((ve===-1?ft:ft.slice(0,ve)).slice(1)),jt=ve===-1?void 0:ft.slice(ve+1).trim()||void 0;if(!Oe)break;!s.activeSessionId.value&&s.activeWorkspaceId.value?s.startSessionAndActivateSkill(s.activeWorkspaceId.value,Oe,jt):s.activateSkill(Oe,jt);break}}}function wi(ft){s.unqueue(ft)}function $e(ft){s.unqueue(ft)}function Te(ft){s.reorderQueue(ft.from,ft.to)}async function He(ft){const ve=s.activeWorkspaceId.value;if(!s.activeSessionId.value&&ve){await s.startSessionAndSendPrompt(ve,ft.text,ft.attachments);return}if(!s.activeSessionId.value&&!ve){Ze.value=ft,Zt.value=!0;return}s.sendPrompt(ft.text,ft.attachments)}async function Rt(ft){if(Ft.value=null,!await s.addWorkspaceByPath(ft)){Ft.value=r("workspace.addFailed");return}Zt.value=!1;const Oe=Ze.value;Ze.value=null;const jt=s.activeWorkspaceId.value;Oe&&jt&&await s.startSessionAndSendPrompt(jt,Oe.text,Oe.attachments)}function qt(){Ze.value=null,Ft.value=null,Zt.value=!1}function ao(){gt(()=>{zn.value?.focusComposer()})}function Zn(){const ft=s.activeWorkspaceId.value;ft?s.openWorkspaceDraft(ft):s.clearActiveSession(),ao()}function Pn(ft){s.openWorkspaceDraft(ft),ao()}function As(ft){ft&&window.open(ft,"_blank","noopener")}return(ft,ve)=>(_(),I("div",p0e,[i.value?(_(),ke(h0e,{key:0})):re("",!0),x(m)?(_(),I("section",m0e,[C("div",g0e,[(_(),I("svg",{ref_key:"authLogoRef",ref:h,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:ve[0]||(ve[0]=kt(()=>{},["prevent"])),onClick:ve[1]||(ve[1]=(...Oe)=>x(w)&&x(w)(...Oe))},[...ve[94]||(ve[94]=[v0('<defs data-v-2ec72588><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-2ec72588><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-2ec72588></rect><g class="ch-eyes" fill="#000" data-v-2ec72588><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-2ec72588></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-2ec72588></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-2ec72588></rect>',2)])],544)),C("div",v0e,[C("h1",null,R(x(r)("app.authPageTitle")),1),C("p",null,R(x(r)("app.authPageMessage")),1)]),se(Dt,{class:"auth-page-btn",variant:"primary",onClick:To},{default:we(()=>[se(Qe,{name:"log-in",size:"md"}),C("span",null,R(x(r)("app.authPageLogin")),1)]),_:1})])])):(_(),I("div",{key:2,class:De(["app",{mobile:x(a),"sidebar-collapsed":x(ee)&&!x(a)}]),style:en({"--side-w":x(ye)+"px","--preview-w":x(Z)+"px"})},[x(a)?(_(),ke(Cge,{key:1,workspace:x(s).visibleWorkspace.value,"session-title":d.value,running:p.value,branch:x(s).status.value.branch,"session-count":f.value,onOpenSwitcher:ve[17]||(ve[17]=Oe=>c.value=!0),onOpenSettings:ve[18]||(ve[18]=Oe=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(_(),I(Pe,{key:0},[An(se(FP,{"col-width":x(ye),"active-workspace":x(s).visibleWorkspace.value,"active-workspace-id":x(s).activeWorkspaceId.value,sessions:x(s).sessionsForView.value,groups:x(s).workspaceGroups.value,"active-id":x(s).activeSessionId.value,"attention-by-session":x(s).attentionBySession.value,"pending-by-session":x(s).pendingBySession.value,"unread-by-session":x(s).unreadBySession.value,"workspace-sort-mode":x(s).workspaceSortMode.value,onSelect:ve[2]||(ve[2]=Oe=>x(s).selectSession(Oe)),onCreate:Zn,onCreateInWorkspace:ve[3]||(ve[3]=Oe=>Pn(Oe)),onSelectWorkspace:ve[4]||(ve[4]=Oe=>x(s).openWorkspace(Oe)),onAddWorkspace:ve[5]||(ve[5]=Oe=>Zt.value=!0),onRename:ve[6]||(ve[6]=(Oe,jt)=>x(s).renameSession(Oe,jt)),onArchive:ve[7]||(ve[7]=Oe=>x(s).archiveSession(Oe)),onFork:ve[8]||(ve[8]=Oe=>x(s).forkSession(Oe)),onRenameWorkspace:ve[9]||(ve[9]=(Oe,jt)=>x(s).renameWorkspace(Oe,jt)),onDeleteWorkspace:ve[10]||(ve[10]=Oe=>x(s).deleteWorkspace(Oe)),onReorderWorkspaces:ve[11]||(ve[11]=Oe=>x(s).reorderWorkspaces(Oe)),onSetWorkspaceSortMode:ve[12]||(ve[12]=Oe=>x(s).setWorkspaceSortMode(Oe)),onLoadMoreSessions:ve[13]||(ve[13]=Oe=>void x(s).loadMoreSessions(Oe)),onLoadAllSessions:ve[14]||(ve[14]=Oe=>void x(s).loadAllSessions()),onOpenSettings:ve[15]||(ve[15]=Oe=>Ke.value=!0),onCollapse:x(Xe)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","onCollapse"]),[[Ns,!x(ee)]]),An(se(V2,{"storage-key":x(q),"default-width":x(ae),min:x(ce),max:x(ne),"onUpdate:width":ve[16]||(ve[16]=Oe=>Q.value=Oe)},null,8,["storage-key","default-width","min","max"]),[[Ns,!x(ee)]]),x(ee)?(_(),I("div",y0e,[se(Mn,{size:"sm",label:x(r)("sidebar.expandSidebar"),onClick:x(Xe)},{default:we(()=>[se(Qe,{name:"panel-expand",size:"sm"})]),_:1},8,["label","onClick"])])):re("",!0)],64)),se(Qie,{ref_key:"conversationPaneRef",ref:zn,mobile:x(a),turns:x(s).turns.value,"session-id":x(s).activeSessionId.value,approvals:x(s).pendingApprovals.value,changes:x(s).changes.value,"git-info":x(s).gitInfo.value,tasks:x(s).tasks.value,todos:x(s).todos.value,goal:x(s).goal.value,"activation-badges":x(s).activationBadges.value,status:x(s).status.value,thinking:x(s).thinking.value,"plan-mode":x(s).planMode.value,"swarm-mode":x(s).swarmMode.value,"goal-mode":x(s).goalMode.value,models:x(s).models.value,"starred-ids":x(s).starredModelIds.value,skills:x(s).skills.value,questions:x(s).questions.value,"pending-question-actions":x(s).pendingQuestionActions,"pending-approval-actions":x(s).pendingApprovalActions,running:p.value,queued:x(s).queued.value,"search-files":x(s).searchFiles,"upload-image":x(s).uploadImage,sending:x(s).isSending.value,"fast-moon":x(s).fastMoon.value,"file-reload-key":x(s).activeSessionId.value,"session-loading":x(s).sessionLoading.value,compaction:x(s).compaction.value,"has-more-messages":x(s).hasMoreMessages.value,"loading-more":x(s).loadingMoreMessages.value,"loading-more-error":x(s).loadMoreMessagesError.value,"load-older-messages":x(s).loadOlderMessages,"workspace-name":x(s).visibleWorkspace.value?.name,"workspace-root":x(s).visibleWorkspace.value?.root??x(s).status.value.cwd,"git-diff-stats":x(s).gitDiffStats.value,workspaces:x(s).workspacesView.value,"active-workspace-id":x(s).activeWorkspaceId.value,"session-title":d.value,pr:x(s).activePullRequest.value,"conversation-toc":x(s).conversationToc.value,onOpenChanges:ve[19]||(ve[19]=Oe=>x(Bt)()),onSelectWorkspace:ve[20]||(ve[20]=Oe=>Pn(Oe)),onAddWorkspace:ve[21]||(ve[21]=Oe=>Zt.value=!0),onOpenPr:As,onSubmit:ve[22]||(ve[22]=Oe=>He(Oe)),onSteer:ve[23]||(ve[23]=Oe=>x(s).steerPrompt(Oe.text,Oe.attachments)),onApproval:ve[24]||(ve[24]=(Oe,jt)=>x(s).respondApproval(Oe,jt)),onCancelTask:ve[25]||(ve[25]=Oe=>x(s).cancelTask(Oe)),onAnswer:ve[26]||(ve[26]=(Oe,jt)=>x(s).respondQuestion(Oe,jt)),onDismiss:ve[27]||(ve[27]=Oe=>x(s).dismissQuestion(Oe)),onCommand:js,onInterrupt:ve[28]||(ve[28]=Oe=>x(s).abortCurrentPrompt()),onUnqueue:wi,onEditQueued:$e,onReorderQueue:Te,onSetPermission:ve[29]||(ve[29]=Oe=>x(s).setPermission(Oe)),onSetThinking:ve[30]||(ve[30]=Oe=>x(s).setThinking(Oe)),onTogglePlan:ve[31]||(ve[31]=Oe=>x(s).togglePlanMode()),onToggleSwarm:ve[32]||(ve[32]=Oe=>x(s).toggleSwarmMode()),onToggleGoal:ve[33]||(ve[33]=Oe=>x(s).toggleGoalMode()),onCreateGoal:ve[34]||(ve[34]=Oe=>x(s).createGoal(Oe)),onControlGoal:ve[35]||(ve[35]=Oe=>x(s).controlGoal(Oe)),onRefreshGitStatus:ve[36]||(ve[36]=Oe=>x(s).activeSessionId.value&&x(s).loadGitStatus(x(s).activeSessionId.value)),onRenameSession:ve[37]||(ve[37]=(Oe,jt)=>x(s).renameSession(Oe,jt)),onForkSession:ve[38]||(ve[38]=Oe=>x(s).forkSession(Oe)),onArchiveSession:ve[39]||(ve[39]=Oe=>x(s).archiveSession(Oe)),onCompact:ve[40]||(ve[40]=Oe=>x(s).compact()),onPickModel:ve[41]||(ve[41]=Oe=>Ut()),onSelectModel:ve[42]||(ve[42]=Oe=>Wo(Oe)),onOpenFile:ve[43]||(ve[43]=Oe=>x(P)(Oe)),onOpenMedia:ve[44]||(ve[44]=Oe=>x(D)(Oe)),onOpenThinking:ve[45]||(ve[45]=Oe=>x(he)(Oe)),onOpenCompaction:ve[46]||(ve[46]=Oe=>x(be)(Oe)),onOpenAgent:ve[47]||(ve[47]=Oe=>x(ue)(Oe)),onOpenToolDiff:ve[48]||(ve[48]=Oe=>x(lt)(Oe)),onEditMessage:Ht},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","queued","search-files","upload-image","sending","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"]),x(mn)&&!x(a)?(_(),ke(V2,{key:2,"storage-key":x(me),"default-width":x(ie),min:x(G),max:x(de),reverse:"","aria-label":x(r)("layout.resizePreviewAria"),"onUpdate:width":ve[49]||(ve[49]=Oe=>z.value=Oe),"onUpdate:dragging":ve[50]||(ve[50]=Oe=>zo.value=Oe)},null,8,["storage-key","default-width","min","max","aria-label"])):re("",!0),!x(a)||x(mn)?(_(),I("aside",{key:3,class:De(["global-preview",{open:x(mn),mobile:x(a),"no-anim":x(zo)||L.value}]),role:"complementary","aria-label":x(r)("layout.detailPanelAria"),"aria-hidden":!x(mn)},[O.value==="thinking"&&x(le)?(_(),ke(pC,{key:0,text:x(pe)??"",onClose:x(U)},null,8,["text","onClose"])):O.value==="compaction"&&x(fe)?(_(),ke(pC,{key:1,text:x(J)??"",subtitle:x(r)("conversation.summaryTitle"),onClose:x(Ee)},null,8,["text","subtitle","onClose"])):O.value==="agent"&&x(Le)?(_(),ke(vle,{key:2,member:x(Le),onClose:x(Ie)},null,8,["member","onClose"])):O.value==="btw"&&x(pn)?(_(),ke(Ble,{key:3,turns:x(s).sideChatTurns.value,running:x(s).sideChatRunning.value,sending:x(s).sideChatSending.value,onSend:ve[51]||(ve[51]=Oe=>x(s).sendSideChatPrompt(Oe)),onClose:x(Yt)},null,8,["turns","running","sending","onClose"])):O.value==="diff"?(_(),ke(fae,{key:4,mode:x(_t),changes:x(s).changes.value,"git-info":x(s).gitInfo.value,"file-diff":x(s).fileDiff.value,"selected-diff-path":x(s).selectedDiffPath.value,"file-diff-loading":x(s).fileDiffLoading.value,closable:"",onOpen:x(Gt),onBack:ve[52]||(ve[52]=Oe=>{_t.value="list",$t.value=null,x(s).clearFileDiff()}),onClose:x(yt)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):O.value==="toolDiff"&&x(Ge)?(_(),ke(Ile,{key:5,target:x(Ge),onClose:x(bt)},null,8,["target","onClose"])):O.value==="file"?(_(),ke(Zre,{key:6,file:x(T),loading:x($),error:x(N),line:x(b)?.line,"download-url":x(S),closable:"","external-actions":x(E),"open-file":x(P),onClose:x(F),onOpenExternal:x(W),onReveal:x(K)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):re("",!0)],10,k0e)):re("",!0),lo.value?(_(),ke($ae,{key:4,models:x(s).models.value,current:x(s).status.value.modelId,"starred-ids":x(s).starredModelIds.value,loading:un.value,unavailable:tn.value,onSelect:ve[53]||(ve[53]=Oe=>xs(Oe)),onToggleStar:ve[54]||(ve[54]=Oe=>x(s).toggleStarModel(Oe)),onClose:ve[55]||(ve[55]=Oe=>lo.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):re("",!0),Ke.value?(_(),ke(pme,{key:5,"color-scheme":x(s).colorScheme.value,accent:x(s).accent.value,"ui-font-size":x(s).uiFontSize.value,"auth-ready":x(s).authReady.value,"account-model":x(s).defaultModel.value,notify:x(s).notifyOnComplete.value,"notify-question":x(s).notifyOnQuestion.value,"notify-permission":x(s).notifyPermission.value,sound:x(s).soundOnComplete.value,"conversation-toc":x(s).conversationToc.value,config:x(s).config.value,models:x(s).models.value,"config-saving":Xn.value,"server-version":x(s).serverVersion.value,onSetColorScheme:ve[56]||(ve[56]=Oe=>x(s).setColorScheme(Oe)),onSetAccent:ve[57]||(ve[57]=Oe=>x(s).setAccent(Oe)),onSetUiFontSize:ve[58]||(ve[58]=Oe=>x(s).setUiFontSize(Oe)),onSetNotify:ve[59]||(ve[59]=Oe=>x(s).setNotifyOnComplete(Oe)),onSetNotifyQuestion:ve[60]||(ve[60]=Oe=>x(s).setNotifyOnQuestion(Oe)),onSetSound:ve[61]||(ve[61]=Oe=>x(s).setSoundOnComplete(Oe)),onSetConversationToc:ve[62]||(ve[62]=Oe=>x(s).setConversationToc(Oe)),onUpdateConfig:ve[63]||(ve[63]=Oe=>Us(Oe)),onLogin:ve[64]||(ve[64]=()=>{Ke.value=!1,To()}),onLogout:x(s).logout,onOpenOnboarding:ve[65]||(ve[65]=()=>{Ke.value=!1,y()}),onOpenProviders:ve[66]||(ve[66]=()=>{Ke.value=!1,wo()}),onClose:ve[67]||(ve[67]=Oe=>Ke.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","onLogout"])):re("",!0),Gn.value?(_(),ke(nce,{key:6,providers:x(s).providers.value,loading:Cn.value,unavailable:Mt.value,onAdd:ve[68]||(ve[68]=Oe=>ds(Oe)),onRefresh:ve[69]||(ve[69]=Oe=>Ot(Oe)),onDelete:ve[70]||(ve[70]=Oe=>fs(Oe)),onOpenLogin:ve[71]||(ve[71]=()=>{Gn.value=!1,To()}),onClose:ve[72]||(ve[72]=Oe=>Gn.value=!1)},null,8,["providers","loading","unavailable"])):re("",!0),Qn.value?(_(),ke(oge,{key:7,status:x(s).status.value,thinking:x(s).thinking.value,"plan-mode":x(s).planMode.value,"swarm-mode":x(s).swarmMode.value,"cost-usd":x(s).sessionCost.value,onClose:ve[73]||(ve[73]=Oe=>Qn.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):re("",!0),Zt.value?(_(),ke(zme,{key:8,"browse-fs":x(s).browseFs,"get-fs-home":x(s).getFsHome,"default-path":x(s).visibleWorkspace.value?.root??x(s).status.value.cwd,error:Ft.value,onAdd:ve[74]||(ve[74]=Oe=>Rt(Oe)),onClose:qt},null,8,["browse-fs","get-fs-home","default-path","error"])):re("",!0),se(Jr,{name:"gload-fade"},{default:we(()=>[x(s).initialized.value?re("",!0):(_(),ke(vve,{key:0}))]),_:1}),g.value&&!x(m)?(_(),ke(fve,{key:9,onComplete:v,onSkip:v})):re("",!0),se(mge,{warnings:x(s).warnings.value,onDismiss:x(s).dismissWarning},null,8,["warnings","onDismiss"]),x(l)?(_(),ke(Kve,{key:10})):re("",!0),se(jme),x(a)?(_(),ke(Kge,{key:11,modelValue:c.value,"onUpdate:modelValue":ve[75]||(ve[75]=Oe=>c.value=Oe),groups:x(s).workspaceGroups.value,"active-workspace-id":x(s).activeWorkspaceId.value,"active-id":x(s).activeSessionId.value,"attention-by-session":x(s).attentionBySession.value,"attention-by-workspace":x(s).attentionByWorkspace.value,onSelect:ve[76]||(ve[76]=Oe=>x(s).selectSession(Oe)),onCreate:Zn,onCreateInWorkspace:ve[77]||(ve[77]=Oe=>Pn(Oe)),onAddWorkspace:ve[78]||(ve[78]=Oe=>Zt.value=!0),onRename:ve[79]||(ve[79]=(Oe,jt)=>x(s).renameSession(Oe,jt)),onArchive:ve[80]||(ve[80]=Oe=>x(s).archiveSession(Oe)),onDeleteWorkspace:ve[81]||(ve[81]=Oe=>x(s).deleteWorkspace(Oe)),onLoadMore:ve[82]||(ve[82]=Oe=>void x(s).loadMoreSessions(Oe))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):re("",!0),x(a)?(_(),ke(eve,{key:12,modelValue:u.value,"onUpdate:modelValue":ve[83]||(ve[83]=Oe=>u.value=Oe),status:x(s).status.value,thinking:x(s).thinking.value,models:x(s).models.value,"plan-mode":x(s).planMode.value,"swarm-mode":x(s).swarmMode.value,"color-scheme":x(s).colorScheme.value,"ui-font-size":x(s).uiFontSize.value,"auth-ready":x(s).authReady.value,"conversation-toc":x(s).conversationToc.value,"server-version":x(s).serverVersion.value,onPickModel:ve[84]||(ve[84]=Oe=>Ut()),onSetThinking:ve[85]||(ve[85]=Oe=>x(s).setThinking(Oe)),onTogglePlan:ve[86]||(ve[86]=Oe=>x(s).togglePlanMode()),onToggleSwarm:ve[87]||(ve[87]=Oe=>x(s).toggleSwarmMode()),onSetPermission:ve[88]||(ve[88]=Oe=>x(s).setPermission(Oe)),onSetColorScheme:ve[89]||(ve[89]=Oe=>x(s).setColorScheme(Oe)),onSetUiFontSize:ve[90]||(ve[90]=Oe=>x(s).setUiFontSize(Oe)),onSetConversationToc:ve[91]||(ve[91]=Oe=>x(s).setConversationToc(Oe)),onLogin:ve[92]||(ve[92]=()=>{u.value=!1,To()}),onLogout:x(s).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):re("",!0)],6)),Yn.value?(_(),ke(Lce,{key:3,"on-start-o-auth-login":qs,"on-poll-o-auth-login":Ye,"on-cancel-o-auth-login":tt,onSuccess:st,onClose:ve[93]||(ve[93]=Oe=>Yn.value=!1)})):re("",!0)]))}}),_0e=ut(b0e,[["__scopeId","data-v-2ec72588"]]);nee();fh(_0e).use(Hn).mount("#app");export{KE as $,d0 as A,DI as B,fo as C,bye as D,DC as E,Pe as F,v0 as G,qe as H,se as I,gI as J,j0e as K,mi as L,je as M,c$ as N,Y0e as O,Q0e as P,J0e as Q,Gf as R,ec as S,hp as T,X0e as U,k0 as V,G0e as W,wye as X,Z0e as Y,mye as Z,S0e as _,fx as a,Oo as a$,Ho as a0,e0 as a1,$0e as a2,r0 as a3,N5 as a4,yn as a5,bc as a6,D0e as a7,xye as a8,z0e as a9,vx as aA,GI as aB,e5 as aC,Sn as aD,JI as aE,ZI as aF,t0 as aG,XI as aH,In as aI,a0 as aJ,_I as aK,_ as aL,r$ as aM,O0e as aN,Nn as aO,tx as aP,R0e as aQ,Jf as aR,Bo as aS,Qf as aT,X as aU,cye as aV,x$ as aW,nt as aX,On as aY,n5 as aZ,V0e as a_,q0e as aa,U0e as ab,W0e as ac,dye as ad,Aye as ae,Vt as af,F5 as ag,dp as ah,Vr as ai,dr as aj,oo as ak,uye as al,Os as am,Zr as an,vt as ao,nye as ap,oye as aq,bn as ar,gt as as,q5 as at,De as au,w0e as av,en as aw,KI as ax,QI as ay,so as az,N0e as b,oQ as b$,yye as b0,Ou as b1,ih as b2,gye as b3,Xr as b4,fI as b5,x0e as b6,ta as b7,TI as b8,vye as b9,us as bA,Ns as bB,H5 as bC,hye as bD,Ve as bE,II as bF,B0e as bG,$I as bH,iye as bI,we as bJ,eye as bK,An as bL,gi as bM,fye as bN,kt as bO,P0e as bP,kn as bQ,ns as bR,Pye as bS,VQ as bT,sM as bU,Bye as bV,_Y as bW,uy as bX,Dye as bY,vv as bZ,qye as b_,C0e as ba,R as bb,Af as bc,K0e as bd,on as be,T0e as bf,M0e as bg,ex as bh,aye as bi,A0e as bj,x as bk,ad as bl,Cye as bm,_ye as bn,d$ as bo,F0e as bp,rye as bq,EI as br,Sye as bs,tye as bt,H0e as bu,dx as bv,dh as bw,b$ as bx,o4 as by,U1 as bz,pye as c,nQ as c0,ly as c1,tQ as c2,Nye as c3,pY as c4,Lye as c5,Ph as c6,Eye as c7,eQ as c8,ZA as c9,Uye as ca,Iye as cb,Vye as cc,Sv as cd,Va as ce,_v as cf,Kye as cg,jye as ch,Oye as ci,$s as cj,$ye as ck,Rye as cl,SY as cm,Wye as cn,wv as co,bv as cp,zye as cq,Tye as cr,Hye as cs,Fye as ct,Qe as cu,Mye as cv,ut as cw,lye as d,Kr as e,E0e as f,Jr as g,p$ as h,I0e as i,L0e as j,li as k,id as l,_o as m,op as n,fr as o,kye as p,B as q,fh as r,ke as s,re as t,I as u,C as v,C5 as w,sye as x,S5 as y,A$ as z};