@moonshot-ai/kimi-code 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/main.mjs +281 -131
  2. package/dist-web/assets/{CodeBlockNode-xopu-OEb.js → CodeBlockNode-BBTPBNlr.js} +1 -1
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-DmARNWLd.js → CodeBlockShell.vue_vue_type_style_index_0_lang-DW-0ZP66.js} +1 -1
  4. package/dist-web/assets/{Tooltip-DzPFYPha.js → Tooltip-BEPNqHjy.js} +1 -1
  5. package/dist-web/assets/{arc-D9ISmG8O.js → arc-DsEMn4wL.js} +1 -1
  6. package/dist-web/assets/{architectureDiagram-3BPJPVTR-Bde5KvUn.js → architectureDiagram-3BPJPVTR-CRMgytTq.js} +1 -1
  7. package/dist-web/assets/{blockDiagram-GPEHLZMM-JCl1lMhx.js → blockDiagram-GPEHLZMM-DZjTWP93.js} +1 -1
  8. package/dist-web/assets/{c4Diagram-AAUBKEIU-CbJhvcRt.js → c4Diagram-AAUBKEIU-XN05Flkv.js} +1 -1
  9. package/dist-web/assets/channel-Dyiajwlv.js +1 -0
  10. package/dist-web/assets/{chunk-2J33WTMH-L9nQnfKd.js → chunk-2J33WTMH-DB2YVfPY.js} +1 -1
  11. package/dist-web/assets/{chunk-4BX2VUAB-zohve9Ok.js → chunk-4BX2VUAB-Bed6jJZo.js} +1 -1
  12. package/dist-web/assets/{chunk-55IACEB6-DR3E48TL.js → chunk-55IACEB6-CHhaYL59.js} +1 -1
  13. package/dist-web/assets/{chunk-727SXJPM-C18LQHi4.js → chunk-727SXJPM-BOJiU2Eb.js} +1 -1
  14. package/dist-web/assets/{chunk-AQP2D5EJ-BsjNQvhe.js → chunk-AQP2D5EJ-C8k6MI_Z.js} +1 -1
  15. package/dist-web/assets/{chunk-FMBD7UC4-774mj8wI.js → chunk-FMBD7UC4-C-MvWtbr.js} +1 -1
  16. package/dist-web/assets/{chunk-ND2GUHAM-BahAcenP.js → chunk-ND2GUHAM-CEqD9cw0.js} +1 -1
  17. package/dist-web/assets/{chunk-QZHKN3VN-Dc2ML4_y.js → chunk-QZHKN3VN-BcJHlqi-.js} +1 -1
  18. package/dist-web/assets/classDiagram-4FO5ZUOK-Cq15LdMD.js +1 -0
  19. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Cq15LdMD.js +1 -0
  20. package/dist-web/assets/{cose-bilkent-S5V4N54A-BHhvV2M3.js → cose-bilkent-S5V4N54A-DJ8zjD1S.js} +1 -1
  21. package/dist-web/assets/{dagre-BM42HDAG-CCUkqn3c.js → dagre-BM42HDAG-BrTwtLB1.js} +1 -1
  22. package/dist-web/assets/{diagram-2AECGRRQ-CJAIuD9v.js → diagram-2AECGRRQ-Y7FcZPzP.js} +1 -1
  23. package/dist-web/assets/{diagram-5GNKFQAL-CIzOyklY.js → diagram-5GNKFQAL-DKHdXG1y.js} +1 -1
  24. package/dist-web/assets/{diagram-KO2AKTUF-Dy0TSkF9.js → diagram-KO2AKTUF-VCCXGLOR.js} +1 -1
  25. package/dist-web/assets/{diagram-LMA3HP47-D0VZv9QJ.js → diagram-LMA3HP47-CYLE3Fzr.js} +1 -1
  26. package/dist-web/assets/{diagram-OG6HWLK6-BOmRuoa3.js → diagram-OG6HWLK6-DoP7AdmG.js} +1 -1
  27. package/dist-web/assets/{erDiagram-TEJ5UH35-XD82Xp5G.js → erDiagram-TEJ5UH35-BMcb04Oc.js} +1 -1
  28. package/dist-web/assets/{flowDiagram-I6XJVG4X-Cjx82rYf.js → flowDiagram-I6XJVG4X-C6UZeyqx.js} +1 -1
  29. package/dist-web/assets/{ganttDiagram-6RSMTGT7-uApHfVFI.js → ganttDiagram-6RSMTGT7-ejmlce9Q.js} +1 -1
  30. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-pCJa6Sqh.js → gitGraphDiagram-PVQCEYII-0oVWkTiE.js} +1 -1
  31. package/dist-web/assets/{index-ruKp3ITH.js → index-Bj6xsK-Y.js} +1 -1
  32. package/dist-web/assets/index-CNwU-esk.js +268 -0
  33. package/dist-web/assets/index-D6vWyrW-.css +1 -0
  34. package/dist-web/assets/{index-DSJEhgK2.js → index-DrcjPgrD.js} +3 -3
  35. package/dist-web/assets/{index10-BU_fP3cF.js → index10-BIb6yLoQ.js} +1 -1
  36. package/dist-web/assets/{index11-4vKmecHt.js → index11-BcLwmlar.js} +2 -2
  37. package/dist-web/assets/{index5-B_Zm1CXv.js → index5-BOBUDie_.js} +1 -1
  38. package/dist-web/assets/{index6-Bcj2CUc2.js → index6-B1AecMuA.js} +1 -1
  39. package/dist-web/assets/{index7-CktYDBgt.js → index7-B1vZsaF7.js} +1 -1
  40. package/dist-web/assets/{index8-Dv0bVWi6.js → index8-jsIBLdbS.js} +2 -2
  41. package/dist-web/assets/{infoDiagram-5YYISTIA-ntWeW9KZ.js → infoDiagram-5YYISTIA-C3E_KFZS.js} +1 -1
  42. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-LIB-i9cU.js → ishikawaDiagram-YF4QCWOH-DTMAsXar.js} +1 -1
  43. package/dist-web/assets/{journeyDiagram-JHISSGLW-BlfBWGGp.js → journeyDiagram-JHISSGLW-DlMqknWB.js} +1 -1
  44. package/dist-web/assets/{kanban-definition-UN3LZRKU-D5dIR3XR.js → kanban-definition-UN3LZRKU-D8W-yZwQ.js} +1 -1
  45. package/dist-web/assets/{linear-DModnwwD.js → linear-CXvIR_Cz.js} +1 -1
  46. package/dist-web/assets/{mermaid.core-vCZSrzF3.js → mermaid.core-Cm0scdl_.js} +4 -4
  47. package/dist-web/assets/{mindmap-definition-RKZ34NQL-DtXX70f6.js → mindmap-definition-RKZ34NQL-BTR5HSvV.js} +1 -1
  48. package/dist-web/assets/{pieDiagram-4H26LBE5-BTWE5xhz.js → pieDiagram-4H26LBE5-DgBdBron.js} +1 -1
  49. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-BIf4h40K.js → quadrantDiagram-W4KKPZXB-DlJDz6Co.js} +1 -1
  50. package/dist-web/assets/{requirementDiagram-4Y6WPE33-DYIJe9Dp.js → requirementDiagram-4Y6WPE33-BILYgyLr.js} +1 -1
  51. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-C6fQmYW1.js → sankeyDiagram-5OEKKPKP-CsB0bfUt.js} +1 -1
  52. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-j9sFp20c.js → sequenceDiagram-3UESZ5HK-B6sFCfAl.js} +1 -1
  53. package/dist-web/assets/{stateDiagram-AJRCARHV-BmdayxXt.js → stateDiagram-AJRCARHV-CR0aRL4-.js} +1 -1
  54. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-UfuPGBrg.js +1 -0
  55. package/dist-web/assets/{timeline-definition-PNZ67QCA-CoPa3Alw.js → timeline-definition-PNZ67QCA-Bfmc75An.js} +1 -1
  56. package/dist-web/assets/{vennDiagram-CIIHVFJN-C1znvnC_.js → vennDiagram-CIIHVFJN-bwUT2S9H.js} +1 -1
  57. package/dist-web/assets/{vue.runtime.esm-bundler-C3-MzG4F.js → vue.runtime.esm-bundler-BJNZCSc8.js} +1 -1
  58. package/dist-web/assets/{wardley-L42UT6IY-CRUU46rw.js → wardley-L42UT6IY-grqTsjin.js} +1 -1
  59. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-u3Px8OI4.js → wardleyDiagram-YWT4CUSO-By-aofC4.js} +1 -1
  60. package/dist-web/assets/{xychartDiagram-2RQKCTM6-CCMgiVYB.js → xychartDiagram-2RQKCTM6-BxqaMGkt.js} +1 -1
  61. package/dist-web/index.html +2 -2
  62. package/package.json +3 -3
  63. package/dist-web/assets/channel-Dx9cvqoI.js +0 -1
  64. package/dist-web/assets/classDiagram-4FO5ZUOK-CQBVgO9P.js +0 -1
  65. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-CQBVgO9P.js +0 -1
  66. package/dist-web/assets/index-Bm5hIhdQ.css +0 -1
  67. package/dist-web/assets/index-Cr6PBwa_.js +0 -268
  68. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BGbtlEvl.js +0 -1
@@ -1,268 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-KEf2LMH_.js","assets/katex-HP8lGamR.js","assets/CodeBlockNode-xopu-OEb.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-DmARNWLd.js","assets/index8-Dv0bVWi6.js","assets/index11-4vKmecHt.js"])))=>i.map(i=>d[i]);
2
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
3
- * @vue/shared v3.5.35
4
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
- * @license MIT
6
- **/function jf(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Mt={},jl=[],bo=()=>{},Zw=()=>!1,Qc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),zf=e=>e.startsWith("onUpdate:"),Kt=Object.assign,_1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},MA=Object.prototype.hasOwnProperty,Wt=(e,t)=>MA.call(e,t),ot=Array.isArray,zl=e=>pa(e)==="[object Map]",il=e=>pa(e)==="[object Set]",fy=e=>pa(e)==="[object Date]",EA=e=>pa(e)==="[object RegExp]",mt=e=>typeof e=="function",Xt=e=>typeof e=="string",Zs=e=>typeof e=="symbol",Ut=e=>e!==null&&typeof e=="object",w1=e=>(Ut(e)||mt(e))&&mt(e.then)&&mt(e.catch),Jw=Object.prototype.toString,pa=e=>Jw.call(e),IA=e=>pa(e).slice(8,-1),Vf=e=>pa(e)==="[object Object]",Kf=e=>Xt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zr=jf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gf=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},$A=/-\w/g,Ln=Gf(e=>e.replace($A,t=>t.slice(1).toUpperCase())),NA=/\B([A-Z])/g,As=Gf(e=>e.replace(NA,"-$1").toLowerCase()),Yf=Gf(e=>e.charAt(0).toUpperCase()+e.slice(1)),bd=Gf(e=>e?`on${Yf(e)}`:""),Vn=(e,t)=>!Object.is(e,t),Vl=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Qw=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Xf=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Fd=e=>{const t=Xt(e)?Number(e):NaN;return isNaN(t)?e:t};let hy;const Zf=()=>hy||(hy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),LA="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",RA=jf(LA);function Dt(e){if(ot(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Xt(s)?BA(s):Dt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(Xt(e)||Ut(e))return e}const OA=/;(?![^(]*\))/g,PA=/:([^]+)/,DA=/\/\*[^]*?\*\//g;function BA(e){const t={};return e.replace(DA,"").split(OA).forEach(n=>{if(n){const s=n.split(PA);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Te(e){let t="";if(Xt(e))t=e;else if(ot(e))for(let n=0;n<e.length;n++){const s=Te(e[n]);s&&(t+=s+" ")}else if(Ut(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Uue(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Xt(t)&&(e.class=Te(t)),n&&(e.style=Dt(n)),e}const FA="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",HA=jf(FA);function e2(e){return!!e||e===""}function WA(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=xi(e[s],t[s]);return n}function xi(e,t){if(e===t)return!0;let n=fy(e),s=fy(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Zs(e),s=Zs(t),n||s)return e===t;if(n=ot(e),s=ot(t),n||s)return n&&s?WA(e,t):!1;if(n=Ut(e),s=Ut(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!xi(e[r],t[r]))return!1}}return String(e)===String(t)}function Jf(e,t){return e.findIndex(n=>xi(n,t))}const t2=e=>!!(e&&e.__v_isRef===!0),N=e=>Xt(e)?e:e==null?"":ot(e)||Ut(e)&&(e.toString===Jw||!mt(e.toString))?t2(e)?N(e.value):JSON.stringify(e,n2,2):String(e),n2=(e,t)=>t2(t)?n2(e,t.value):zl(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[Up(s,i)+" =>"]=o,n),{})}:il(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Up(n))}:Zs(t)?Up(t):Ut(t)&&!ot(t)&&!Vf(t)?String(t):t,Up=(e,t="")=>{var n;return Zs(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function UA(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 Nn;class s2{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&&Nn&&(Nn.active?(this.parent=Nn,this.index=(Nn.scopes||(Nn.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=Nn;try{return Nn=this,t()}finally{Nn=n}}}on(){++this._on===1&&(this.prevScope=Nn,Nn=this)}off(){if(this._on>0&&--this._on===0){if(Nn===this)Nn=this.prevScope;else{let t=Nn;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,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function qA(e){return new s2(e)}function S1(){return Nn}function C1(e,t=!1){Nn&&Nn.cleanups.push(e)}let nn;const qp=new WeakSet;class Hd{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,Nn&&(Nn.active?Nn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,qp.has(this)&&(qp.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||i2(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,py(this),r2(this);const t=nn,n=No;nn=this,No=!0;try{return this.fn()}finally{l2(this),nn=t,No=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)A1(t);this.deps=this.depsTail=void 0,py(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?qp.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Qm(this)&&this.run()}get dirty(){return Qm(this)}}let o2=0,fc,hc;function i2(e,t=!1){if(e.flags|=8,t){e.next=hc,hc=e;return}e.next=fc,fc=e}function x1(){o2++}function T1(){if(--o2>0)return;if(hc){let t=hc;for(hc=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;fc;){let t=fc;for(fc=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function r2(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function l2(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),A1(s),jA(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Qm(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(a2(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function a2(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ic)||(e.globalVersion=Ic,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Qm(e))))return;e.flags|=2;const t=e.dep,n=nn,s=No;nn=e,No=!0;try{r2(e);const o=e.fn(e._value);(t.version===0||Vn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{nn=n,No=s,l2(e),e.flags&=-3}}function A1(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)A1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function jA(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function que(e,t){e.effect instanceof Hd&&(e=e.effect.fn);const n=new Hd(e);t&&Kt(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function jue(e){e.effect.stop()}let No=!0;const c2=[];function Ti(){c2.push(No),No=!1}function Ai(){const e=c2.pop();No=e===void 0?!0:e}function py(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=nn;nn=void 0;try{t()}finally{nn=n}}}let Ic=0;class zA{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 Qf{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(!nn||!No||nn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==nn)n=this.activeLink=new zA(nn,this),nn.deps?(n.prevDep=nn.depsTail,nn.depsTail.nextDep=n,nn.depsTail=n):nn.deps=nn.depsTail=n,u2(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=nn.depsTail,n.nextDep=void 0,nn.depsTail.nextDep=n,nn.depsTail=n,nn.deps===n&&(nn.deps=s)}return n}trigger(t){this.version++,Ic++,this.notify(t)}notify(t){x1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{T1()}}}function u2(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)u2(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Wd=new WeakMap,Jr=Symbol(""),eg=Symbol(""),$c=Symbol("");function ns(e,t,n){if(No&&nn){let s=Wd.get(e);s||Wd.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Qf),o.map=s,o.key=n),o.track()}}function vi(e,t,n,s,o,i){const r=Wd.get(e);if(!r){Ic++;return}const l=a=>{a&&a.trigger()};if(x1(),t==="clear")r.forEach(l);else{const a=ot(e),c=a&&Kf(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,p)=>{(p==="length"||p===$c||!Zs(p)&&p>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get($c)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Jr)),zl(e)&&l(r.get(eg)));break;case"delete":a||(l(r.get(Jr)),zl(e)&&l(r.get(eg)));break;case"set":zl(e)&&l(r.get(Jr));break}}T1()}function VA(e,t){const n=Wd.get(e);return n&&n.get(t)}function Al(e){const t=Nt(e);return t===e?t:(ns(t,"iterate",$c),zs(e)?t:t.map(Lo))}function eh(e){return ns(e=Nt(e),"iterate",$c),e}function Yo(e,t){return Mi(e)?la(sr(e)?Lo(t):t):Lo(t)}const KA={__proto__:null,[Symbol.iterator](){return jp(this,Symbol.iterator,e=>Yo(this,e))},concat(...e){return Al(this).concat(...e.map(t=>ot(t)?Al(t):t))},entries(){return jp(this,"entries",e=>(e[1]=Yo(this,e[1]),e))},every(e,t){return fi(this,"every",e,t,void 0,arguments)},filter(e,t){return fi(this,"filter",e,t,n=>n.map(s=>Yo(this,s)),arguments)},find(e,t){return fi(this,"find",e,t,n=>Yo(this,n),arguments)},findIndex(e,t){return fi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return fi(this,"findLast",e,t,n=>Yo(this,n),arguments)},findLastIndex(e,t){return fi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return fi(this,"forEach",e,t,void 0,arguments)},includes(...e){return zp(this,"includes",e)},indexOf(...e){return zp(this,"indexOf",e)},join(e){return Al(this).join(e)},lastIndexOf(...e){return zp(this,"lastIndexOf",e)},map(e,t){return fi(this,"map",e,t,void 0,arguments)},pop(){return za(this,"pop")},push(...e){return za(this,"push",e)},reduce(e,...t){return my(this,"reduce",e,t)},reduceRight(e,...t){return my(this,"reduceRight",e,t)},shift(){return za(this,"shift")},some(e,t){return fi(this,"some",e,t,void 0,arguments)},splice(...e){return za(this,"splice",e)},toReversed(){return Al(this).toReversed()},toSorted(e){return Al(this).toSorted(e)},toSpliced(...e){return Al(this).toSpliced(...e)},unshift(...e){return za(this,"unshift",e)},values(){return jp(this,"values",e=>Yo(this,e))}};function jp(e,t,n){const s=eh(e),o=s[t]();return s!==e&&!zs(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const GA=Array.prototype;function fi(e,t,n,s,o,i){const r=eh(e),l=r!==e&&!zs(e),a=r[t];if(a!==GA[t]){const d=a.apply(e,i);return l?Lo(d):d}let c=n;r!==e&&(l?c=function(d,p){return n.call(this,Yo(e,d),p,e)}:n.length>2&&(c=function(d,p){return n.call(this,d,p,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function my(e,t,n,s){const o=eh(e),i=o!==e&&!zs(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Yo(e,c)),n.call(this,c,Yo(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?Yo(e,a):a}function zp(e,t,n){const s=Nt(e);ns(s,"iterate",$c);const o=s[t](...n);return(o===-1||o===!1)&&sh(n[0])?(n[0]=Nt(n[0]),s[t](...n)):o}function za(e,t,n=[]){Ti(),x1();const s=Nt(e)[t].apply(e,n);return T1(),Ai(),s}const YA=jf("__proto__,__v_isRef,__isVue"),d2=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Zs));function XA(e){Zs(e)||(e=String(e));const t=Nt(this);return ns(t,"has",e),t.hasOwnProperty(e)}class f2{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?y2:v2:i?g2:m2).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=ot(t);if(!o){let a;if(r&&(a=KA[n]))return a;if(n==="hasOwnProperty")return XA}const l=Reflect.get(t,n,xn(t)?t:s);if((Zs(n)?d2.has(n):YA(n))||(o||ns(t,"get",n),i))return l;if(xn(l)){const a=r&&Kf(n)?l:l.value;return o&&Ut(a)?Ud(a):a}return Ut(l)?o?Ud(l):qs(l):l}}class h2 extends f2{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=ot(t)&&Kf(n);if(!this._isShallow){const c=Mi(i);if(!zs(s)&&!Mi(s)&&(i=Nt(i),s=Nt(s)),!r&&xn(i)&&!xn(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:Wt(t,n),a=Reflect.set(t,n,s,xn(t)?t:o);return t===Nt(o)&&(l?Vn(s,i)&&vi(t,"set",n,s):vi(t,"add",n,s)),a}deleteProperty(t,n){const s=Wt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&vi(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Zs(n)||!d2.has(n))&&ns(t,"has",n),s}ownKeys(t){return ns(t,"iterate",ot(t)?"length":Jr),Reflect.ownKeys(t)}}class p2 extends f2{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const ZA=new h2,JA=new p2,QA=new h2(!0),eM=new p2(!0),tg=e=>e,Wu=e=>Reflect.getPrototypeOf(e);function tM(e,t,n){return function(...s){const o=this.__v_raw,i=Nt(o),r=zl(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?tg:t?la:Lo;return!t&&ns(i,"iterate",a?eg:Jr),Kt(Object.create(c),{next(){const{value:d,done:p}=c.next();return p?{value:d,done:p}:{value:l?[u(d[0]),u(d[1])]:u(d),done:p}}})}}function Uu(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function nM(e,t){const n={get(o){const i=this.__v_raw,r=Nt(i),l=Nt(o);e||(Vn(o,l)&&ns(r,"get",o),ns(r,"get",l));const{has:a}=Wu(r),c=t?tg:e?la:Lo;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&ns(Nt(o),"iterate",Jr),o.size},has(o){const i=this.__v_raw,r=Nt(i),l=Nt(o);return e||(Vn(o,l)&&ns(r,"has",o),ns(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=Nt(l),c=t?tg:e?la:Lo;return!e&&ns(a,"iterate",Jr),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return Kt(n,e?{add:Uu("add"),set:Uu("set"),delete:Uu("delete"),clear:Uu("clear")}:{add(o){const i=Nt(this),r=Wu(i),l=Nt(o),a=!t&&!zs(o)&&!Mi(o)?l:o;return r.has.call(i,a)||Vn(o,a)&&r.has.call(i,o)||Vn(l,a)&&r.has.call(i,l)||(i.add(a),vi(i,"add",a,a)),this},set(o,i){!t&&!zs(i)&&!Mi(i)&&(i=Nt(i));const r=Nt(this),{has:l,get:a}=Wu(r);let c=l.call(r,o);c||(o=Nt(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Vn(i,u)&&vi(r,"set",o,i):vi(r,"add",o,i),this},delete(o){const i=Nt(this),{has:r,get:l}=Wu(i);let a=r.call(i,o);a||(o=Nt(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&vi(i,"delete",o,void 0),c},clear(){const o=Nt(this),i=o.size!==0,r=o.clear();return i&&vi(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=tM(o,e,t)}),n}function th(e,t){const n=nM(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(Wt(n,o)&&o in s?n:s,o,i)}const sM={get:th(!1,!1)},oM={get:th(!1,!0)},iM={get:th(!0,!1)},rM={get:th(!0,!0)},m2=new WeakMap,g2=new WeakMap,v2=new WeakMap,y2=new WeakMap;function lM(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qs(e){return Mi(e)?e:nh(e,!1,ZA,sM,m2)}function aM(e){return nh(e,!1,QA,oM,g2)}function Ud(e){return nh(e,!0,JA,iM,v2)}function zue(e){return nh(e,!0,eM,rM,y2)}function nh(e,t,n,s,o){if(!Ut(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=lM(IA(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function sr(e){return Mi(e)?sr(e.__v_raw):!!(e&&e.__v_isReactive)}function Mi(e){return!!(e&&e.__v_isReadonly)}function zs(e){return!!(e&&e.__v_isShallow)}function sh(e){return e?!!e.__v_raw:!1}function Nt(e){const t=e&&e.__v_raw;return t?Nt(t):e}function er(e){return!Wt(e,"__v_skip")&&Object.isExtensible(e)&&Qw(e,"__v_skip",!0),e}const Lo=e=>Ut(e)?qs(e):e,la=e=>Ut(e)?Ud(e):e;function xn(e){return e?e.__v_isRef===!0:!1}function ie(e){return k2(e,!1)}function rl(e){return k2(e,!0)}function k2(e,t){return xn(e)?e:new cM(e,t)}class cM{constructor(t,n){this.dep=new Qf,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Nt(t),this._value=n?t:Lo(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||zs(t)||Mi(t);t=s?t:Nt(t),Vn(t,n)&&(this._rawValue=t,this._value=s?t:Lo(t),this.dep.trigger())}}function Vue(e){e.dep&&e.dep.trigger()}function A(e){return xn(e)?e.value:e}function Kue(e){return mt(e)?e():A(e)}const uM={get:(e,t,n)=>t==="__v_raw"?e:A(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return xn(o)&&!xn(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function b2(e){return sr(e)?e:new Proxy(e,uM)}class dM{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Qf,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function fM(e){return new dM(e)}function Gue(e){const t=ot(e)?new Array(e.length):{};for(const n in e)t[n]=_2(e,n);return t}class hM{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=Zs(n)?n:String(n),this._raw=Nt(t);let o=!0,i=t;if(!ot(t)||Zs(this._key)||!Kf(this._key))do o=!sh(i)||zs(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=A(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&xn(this._raw[this._key])){const n=this._object[this._key];if(xn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return VA(this._raw,this._key)}}class pM{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 Yue(e,t,n){return xn(e)?e:mt(e)?new pM(e):Ut(e)&&arguments.length>1?_2(e,t,n):ie(e)}function _2(e,t,n){return new hM(e,t,n)}class mM{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Qf(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ic-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&nn!==this)return i2(this,!0),!0}get value(){const t=this.dep.track();return a2(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function gM(e,t,n=!1){let s,o;return mt(e)?s=e:(s=e.get,o=e.set),new mM(s,o,n)}const Xue={GET:"get",HAS:"has",ITERATE:"iterate"},Zue={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},qu={},qd=new WeakMap;let Yi;function Jue(){return Yi}function vM(e,t=!1,n=Yi){if(n){let s=qd.get(n);s||qd.set(n,s=[]),s.push(e)}}function yM(e,t,n=Mt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:zs(y)||o===!1||o===0?yi(y,1):yi(y);let u,d,p,m,f=!1,g=!1;if(xn(e)?(d=()=>e.value,f=zs(e)):sr(e)?(d=()=>c(e),f=!0):ot(e)?(g=!0,f=e.some(y=>sr(y)||zs(y)),d=()=>e.map(y=>{if(xn(y))return y.value;if(sr(y))return c(y);if(mt(y))return a?a(y,2):y()})):mt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(p){Ti();try{p()}finally{Ai()}}const y=Yi;Yi=u;try{return a?a(e,3,[m]):e(m)}finally{Yi=y}}:d=bo,t&&o){const y=d,k=o===!0?1/0:o;d=()=>yi(y(),k)}const w=S1(),b=()=>{u.stop(),w&&w.active&&_1(w.effects,u)};if(i&&t){const y=t;t=(...k)=>{y(...k),b()}}let _=g?new Array(e.length).fill(qu):qu;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const k=u.run();if(o||f||(g?k.some((T,E)=>Vn(T,_[E])):Vn(k,_))){p&&p();const T=Yi;Yi=u;try{const E=[k,_===qu?void 0:g&&_[0]===qu?[]:_,m];_=k,a?a(t,3,E):t(...E)}finally{Yi=T}}}else u.run()};return l&&l(v),u=new Hd(d),u.scheduler=r?()=>r(v,!1):v,m=y=>vM(y,!1,u),p=u.onStop=()=>{const y=qd.get(u);if(y){if(a)a(y,4);else for(const k of y)k();qd.delete(u)}},t?s?v(!0):_=u.run():r?r(v.bind(null,!0),!0):u.run(),b.pause=u.pause.bind(u),b.resume=u.resume.bind(u),b.stop=b,b}function yi(e,t=1/0,n){if(t<=0||!Ut(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,xn(e))yi(e.value,t,n);else if(ot(e))for(let s=0;s<e.length;s++)yi(e[s],t,n);else if(il(e)||zl(e))e.forEach(s=>{yi(s,t,n)});else if(Vf(e)){for(const s in e)yi(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&yi(e[s],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 w2=[];function kM(e){w2.push(e)}function bM(){w2.pop()}function Que(e,t){}const ede={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"},_M={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 eu(e,t,n,s){try{return s?e(...s):e()}catch(o){ma(o,t,n)}}function So(e,t,n,s){if(mt(e)){const o=eu(e,t,n,s);return o&&w1(o)&&o.catch(i=>{ma(i,t,n)}),o}if(ot(e)){const o=[];for(let i=0;i<e.length;i++)o.push(So(e[i],t,n,s));return o}}function ma(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Mt;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){Ti(),eu(i,null,10,[e,a,c]),Ai();return}}wM(e,n,o,s,r)}function wM(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const ps=[];let Vo=-1;const Kl=[];let Xi=null,Pl=0;const S2=Promise.resolve();let jd=null;function ut(e){const t=jd||S2;return e?t.then(this?e.bind(this):e):t}function SM(e){let t=Vo+1,n=ps.length;for(;t<n;){const s=t+n>>>1,o=ps[s],i=Nc(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function M1(e){if(!(e.flags&1)){const t=Nc(e),n=ps[ps.length-1];!n||!(e.flags&2)&&t>=Nc(n)?ps.push(e):ps.splice(SM(t),0,e),e.flags|=1,C2()}}function C2(){jd||(jd=S2.then(x2))}function zd(e){ot(e)?Kl.push(...e):Xi&&e.id===-1?Xi.splice(Pl+1,0,e):e.flags&1||(Kl.push(e),e.flags|=1),C2()}function gy(e,t,n=Vo+1){for(;n<ps.length;n++){const s=ps[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;ps.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Vd(e){if(Kl.length){const t=[...new Set(Kl)].sort((n,s)=>Nc(n)-Nc(s));if(Kl.length=0,Xi){Xi.push(...t);return}for(Xi=t,Pl=0;Pl<Xi.length;Pl++){const n=Xi[Pl];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Xi=null,Pl=0}}const Nc=e=>e.id==null?e.flags&2?-1:1/0:e.id;function x2(e){try{for(Vo=0;Vo<ps.length;Vo++){const t=ps[Vo];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),eu(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Vo<ps.length;Vo++){const t=ps[Vo];t&&(t.flags&=-2)}Vo=-1,ps.length=0,Vd(),jd=null,(ps.length||Kl.length)&&x2()}}let Dl,ju=[];function T2(e,t){var n,s;Dl=e,Dl?(Dl.enabled=!0,ju.forEach(({event:o,args:i})=>Dl.emit(o,...i)),ju=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{T2(i,t)}),setTimeout(()=>{Dl||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ju=[])},3e3)):ju=[]}let Yn=null,oh=null;function Lc(e){const t=Yn;return Yn=e,oh=e&&e.type.__scopeId||null,t}function tde(e){oh=e}function nde(){oh=null}const sde=e=>yn;function yn(e,t=Yn,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Zd(-1);const i=Lc(t);let r;try{r=e(...o)}finally{Lc(i),s._d&&Zd(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Lt(e,t){if(Yn===null)return e;const n=ou(Yn),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Mt]=t[o];i&&(mt(i)&&(i={mounted:i,updated:i}),i.deep&&yi(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Go(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(Ti(),So(a,n,8,[e.el,l,e,t]),Ai())}}function an(e,t){if(Kn){let n=Kn.provides;const s=Kn.parent&&Kn.parent.provides;s===n&&(n=Kn.provides=Object.create(s)),n[e]=t}}function Rt(e,t,n=!1){const s=rs();if(s||Qr){let o=Qr?Qr._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&mt(t)?t.call(s&&s.proxy):t}}function ode(){return!!(rs()||Qr)}const CM=Symbol.for("v-scx"),xM=()=>Rt(CM);function TM(e,t){return tu(e,null,t)}function ide(e,t){return tu(e,null,{flush:"post"})}function AM(e,t){return tu(e,null,{flush:"sync"})}function Ve(e,t,n){return tu(e,t,n)}function tu(e,t,n=Mt){const{immediate:s,deep:o,flush:i,once:r}=n,l=Kt({},n),a=t&&s||!t&&i!=="post";let c;if(sl){if(i==="sync"){const m=xM();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!a){const m=()=>{};return m.stop=bo,m.resume=bo,m.pause=bo,m}}const u=Kn;l.call=(m,f,g)=>So(m,u,f,g);let d=!1;i==="post"?l.scheduler=m=>{wn(m,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(m,f)=>{f?m():M1(m)}),l.augmentJob=m=>{t&&(m.flags|=4),d&&(m.flags|=2,u&&(m.id=u.uid,m.i=u))};const p=yM(e,t,l);return sl&&(c?c.push(p):a&&p()),p}function MM(e,t,n){const s=this.proxy,o=Xt(e)?e.includes(".")?A2(s,e):()=>s[e]:e.bind(s,s);let i;mt(t)?i=t:(i=t.handler,n=t);const r=ga(this),l=tu(o,i.bind(s),n);return r(),l}function A2(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Ki=new WeakMap,M2=Symbol("_vte"),E2=e=>e.__isTeleport,jr=e=>e&&(e.disabled||e.disabled===""),EM=e=>e&&(e.defer||e.defer===""),vy=e=>typeof SVGElement<"u"&&e instanceof SVGElement,yy=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ng=(e,t)=>{const n=e&&e.to;return Xt(n)?t?t(n):null:n},IM={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:p,o:{insert:m,querySelector:f,createText:g,createComment:w,parentNode:b}}=c,_=jr(t.props);let{dynamicChildren:v}=t;const y=(E,C,M)=>{E.shapeFlag&16&&u(E.children,C,M,o,i,r,l,a)},k=(E=t)=>{const C=jr(E.props),M=E.target=ng(E.props,f),$=sg(M,E,g,m);M&&(r!=="svg"&&vy(M)?r="svg":r!=="mathml"&&yy(M)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(M),C||(y(E,M,$),nc(E,!1)))},T=E=>{const C=()=>{if(Ki.get(E)===C){if(Ki.delete(E),jr(E.props)){const M=b(E.el)||n;y(E,M,E.anchor),nc(E,!0)}k(E)}};Ki.set(E,C),wn(C,i)};if(e==null){const E=t.el=g(""),C=t.anchor=g("");if(m(E,n,s),m(C,n,s),EM(t.props)||i&&i.pendingBranch){T(t);return}_&&(y(t,n,C),nc(t,!0)),k()}else{t.el=e.el;const E=t.anchor=e.anchor,C=Ki.get(e);if(C){C.flags|=8,Ki.delete(e),T(t);return}t.targetStart=e.targetStart;const M=t.target=e.target,$=t.targetAnchor=e.targetAnchor,L=jr(e.props),D=L?n:M,R=L?E:$;if(r==="svg"||vy(M)?r="svg":(r==="mathml"||yy(M))&&(r="mathml"),v?(p(e.dynamicChildren,v,D,o,i,r,l),B1(e,t,!0)):a||d(e,t,D,R,o,i,r,l,!1),_)L?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):zu(t,n,E,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const P=t.target=ng(t.props,f);P&&zu(t,P,null,c,0)}else L&&zu(t,M,$,c,1);nc(t,_)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:p}=e,m=i||!jr(p),f=Ki.get(e);if(f&&(f.flags|=8,Ki.delete(e)),d&&(o(c),o(u)),i&&o(a),!f&&r&16)for(let g=0;g<l.length;g++){const w=l[g];s(w,t,n,m,!!w.dynamicChildren)}},move:zu,hydrate:$M};function zu(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!Ki.has(e)&&(!d||jr(u))&&a&16)for(let p=0;p<c.length;p++)o(c[p],t,n,2);d&&s(l,t,n)}function $M(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function p(w,b){let _=b;for(;_;){if(_&&_.nodeType===8){if(_.data==="teleport start anchor")t.targetStart=_;else if(_.data==="teleport anchor"){t.targetAnchor=_,w._lpa=t.targetAnchor&&r(t.targetAnchor);break}}_=r(_)}}function m(w,b){b.anchor=d(r(w),b,l(w),n,s,o,i)}const f=t.target=ng(t.props,a),g=jr(t.props);if(f){const w=f._lpa||f.firstChild;t.shapeFlag&16&&(g?(m(e,t),p(f,w),t.targetAnchor||sg(f,t,u,c,l(e)===f?e:null)):(t.anchor=r(e),p(f,w),t.targetAnchor||sg(f,t,u,c),d(w&&r(w),t,f,n,s,o,i))),nc(t,g)}else g&&t.shapeFlag&16&&(m(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const rde=IM;function nc(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function sg(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[M2]=r,e&&(s(i,e,o),s(r,e,o)),r}const po=Symbol("_leaveCb"),Va=Symbol("_enterCb");function I2(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return sn(()=>{e.isMounted=!0}),Js(()=>{e.isUnmounting=!0}),e}const ao=[Function,Array],$2={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ao,onEnter:ao,onAfterEnter:ao,onEnterCancelled:ao,onBeforeLeave:ao,onLeave:ao,onAfterLeave:ao,onLeaveCancelled:ao,onBeforeAppear:ao,onAppear:ao,onAfterAppear:ao,onAppearCancelled:ao},N2=e=>{const t=e.subTree;return t.component?N2(t.component):t},NM={name:"BaseTransition",props:$2,setup(e,{slots:t}){const n=rs(),s=I2();return()=>{const o=t.default&&E1(t.default(),!0),i=o&&o.length?L2(o):n.subTree?ue():void 0;if(!i)return;const r=Nt(e),{mode:l}=r;if(s.isLeaving)return Vp(i);const a=ky(i);if(!a)return Vp(i);let c=Rc(a,r,s,n,d=>c=d);a.type!==Sn&&ar(a,c);let u=n.subTree&&ky(n.subTree);if(u&&u.type!==Sn&&!Mo(u,a)&&N2(n).type!==Sn){let d=Rc(u,r,s,n);if(ar(u,d),l==="out-in"&&a.type!==Sn)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Vp(i);l==="in-out"&&a.type!==Sn?d.delayLeave=(p,m,f)=>{const g=R2(s,u);g[String(u.key)]=u,p[po]=()=>{m(),p[po]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{f(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function L2(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Sn){t=n;break}}return t}const LM=NM;function R2(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Rc(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:m,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:w,onAppear:b,onAfterAppear:_,onAppearCancelled:v}=t,y=String(e.key),k=R2(n,e),T=(M,$)=>{M&&So(M,s,9,$)},E=(M,$)=>{const L=$[1];T(M,$),ot(M)?M.every(D=>D.length<=1)&&L():M.length<=1&&L()},C={mode:r,persisted:l,beforeEnter(M){let $=a;if(!n.isMounted)if(i)$=w||a;else return;M[po]&&M[po](!0);const L=k[y];L&&Mo(e,L)&&L.el[po]&&L.el[po](),T($,[M])},enter(M){if(k[y]===e)return;let $=c,L=u,D=d;if(!n.isMounted)if(i)$=b||c,L=_||u,D=v||d;else return;let R=!1;M[Va]=O=>{R||(R=!0,O?T(D,[M]):T(L,[M]),C.delayedLeave&&C.delayedLeave(),M[Va]=void 0)};const P=M[Va].bind(null,!1);$?E($,[M,P]):P()},leave(M,$){const L=String(e.key);if(M[Va]&&M[Va](!0),n.isUnmounting)return $();T(p,[M]);let D=!1;M[po]=P=>{D||(D=!0,$(),P?T(g,[M]):T(f,[M]),M[po]=void 0,k[L]===e&&delete k[L])};const R=M[po].bind(null,!1);k[L]=e,m?E(m,[M,R]):R()},clone(M){const $=Rc(M,t,n,s,o);return o&&o($),$}};return C}function Vp(e){if(nu(e))return e=Ei(e),e.children=null,e}function ky(e){if(!nu(e))return E2(e.type)&&e.children?L2(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&&mt(n.default))return n.default()}}function ar(e,t){e.shapeFlag&6&&e.component?(e.transition=t,ar(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 E1(e,t=!1,n){let s=[],o=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===Me?(r.patchFlag&128&&o++,s=s.concat(E1(r.children,t,l))):(t||r.type!==Sn)&&s.push(l!=null?Ei(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Xe(e,t){return mt(e)?Kt({name:e.name},t,{setup:e}):e}function lde(){const e=rs();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function I1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ade(e){const t=rs(),n=rl(null);if(t){const o=t.refs===Mt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function by(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Kd=new WeakMap;function Gl(e,t,n,s,o=!1){if(ot(e)){e.forEach((g,w)=>Gl(g,t&&(ot(t)?t[w]:t),n,s,o));return}if(wi(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Gl(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?ou(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Mt?l.refs={}:l.refs,d=l.setupState,p=Nt(d),m=d===Mt?Zw:g=>by(u,g)?!1:Wt(p,g),f=(g,w)=>!(w&&by(u,w));if(c!=null&&c!==a){if(_y(t),Xt(c))u[c]=null,m(c)&&(d[c]=null);else if(xn(c)){const g=t;f(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if(mt(a))eu(a,l,12,[r,u]);else{const g=Xt(a),w=xn(a);if(g||w){const b=()=>{if(e.f){const _=g?m(a)?d[a]:u[a]:f()||!e.k?a.value:u[e.k];if(o)ot(_)&&_1(_,i);else if(ot(_))_.includes(i)||_.push(i);else if(g)u[a]=[i],m(a)&&(d[a]=u[a]);else{const v=[i];f(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else g?(u[a]=r,m(a)&&(d[a]=r)):w&&(f(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const _=()=>{b(),Kd.delete(e)};_.id=-1,Kd.set(e,_),wn(_,n)}else _y(e),b()}}}function _y(e){const t=Kd.get(e);t&&(t.flags|=8,Kd.delete(e))}let wy=!1;const Ml=()=>{wy||(console.error("Hydration completed but contains mismatches."),wy=!0)},RM=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",OM=e=>e.namespaceURI.includes("MathML"),Vu=e=>{if(e.nodeType===1){if(RM(e))return"svg";if(OM(e))return"mathml"}},Hl=e=>e.nodeType===8;function PM(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,y)=>{if(!y.hasChildNodes()){n(null,v,y),Vd(),y._vnode=v;return}d(y.firstChild,v,null,null,null),Vd(),y._vnode=v},d=(v,y,k,T,E,C=!1)=>{C=C||!!y.dynamicChildren;const M=Hl(v)&&v.data==="[",$=()=>g(v,y,k,T,E,M),{type:L,ref:D,shapeFlag:R,patchFlag:P}=y;let O=v.nodeType;y.el=v,P===-2&&(C=!1,y.dynamicChildren=null);let W=null;switch(L){case or:O!==3?y.children===""?(a(y.el=o(""),r(v),v),W=v):W=$():(v.data!==y.children&&(Ml(),v.data=y.children),W=i(v));break;case Sn:_(v)?(W=i(v),b(y.el=v.content.firstChild,v,k)):O!==8||M?W=$():W=i(v);break;case Zl:if(M&&(v=i(v),O=v.nodeType),O===1||O===3){W=v;const V=!y.children.length;for(let z=0;z<y.staticCount;z++)V&&(y.children+=W.nodeType===1?W.outerHTML:W.data),z===y.staticCount-1&&(y.anchor=W),W=i(W);return M?i(W):W}else $();break;case Me:M?W=f(v,y,k,T,E,C):W=$();break;default:if(R&1)(O!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!_(v)?W=$():W=p(v,y,k,T,E,C);else if(R&6){y.slotScopeIds=E;const V=r(v);if(M?W=w(v):Hl(v)&&v.data==="teleport start"?W=w(v,v.data,"teleport end"):W=i(v),t(y,V,null,k,T,Vu(V),C),wi(y)&&!y.type.__asyncResolved){let z;M?(z=pt(Me),z.anchor=W?W.previousSibling:V.lastChild):z=v.nodeType===3?vt(""):pt("div"),z.el=v,y.component.subTree=z}}else R&64?O!==8?W=$():W=y.type.hydrate(v,y,k,T,E,C,e,m):R&128&&(W=y.type.hydrate(v,y,k,T,Vu(r(v)),E,C,e,d))}return D!=null&&Gl(D,null,T,y),W},p=(v,y,k,T,E,C)=>{C=C||!!y.dynamicChildren;const{type:M,props:$,patchFlag:L,shapeFlag:D,dirs:R,transition:P}=y,O=M==="input"||M==="option";if(O||L!==-1){R&&Go(y,null,k,"created");let W=!1;if(_(v)){W=Q2(null,P)&&k&&k.vnode.props&&k.vnode.props.appear;const z=v.content.firstChild;if(W){const se=z.getAttribute("class");se&&(z.$cls=se),P.beforeEnter(z)}b(z,v,k),y.el=v=z}if(D&16&&!($&&($.innerHTML||$.textContent))){let z=m(v.firstChild,y,v,k,T,E,C);for(z&&!Ku(v,1)&&Ml();z;){const se=z;z=z.nextSibling,l(se)}}else if(D&8){let z=y.children;z[0]===`
15
- `&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(z=z.slice(1));const{textContent:se}=v;se!==z&&se!==z.replace(/\r\n|\r/g,`
16
- `)&&(Ku(v,0)||Ml(),v.textContent=y.children)}if($){if(O||!C||L&48){const z=v.tagName.includes("-");for(const se in $)(O&&(se.endsWith("value")||se==="indeterminate")||Qc(se)&&!Zr(se)||se[0]==="."||z&&!Zr(se))&&s(v,se,null,$[se],void 0,k)}else if($.onClick)s(v,"onClick",null,$.onClick,void 0,k);else if(L&4&&sr($.style))for(const z in $.style)$.style[z]}let V;(V=$&&$.onVnodeBeforeMount)&&xs(V,k,y),R&&Go(y,null,k,"beforeMount"),((V=$&&$.onVnodeMounted)||R||W)&&sS(()=>{V&&xs(V,k,y),W&&P.enter(v),R&&Go(y,null,k,"mounted")},T)}return v.nextSibling},m=(v,y,k,T,E,C,M)=>{M=M||!!y.dynamicChildren;const $=y.children,L=$.length;let D=!1;for(let R=0;R<L;R++){const P=M?$[R]:$[R]=Ts($[R]),O=P.type===or;v?(O&&!M&&R+1<L&&Ts($[R+1]).type===or&&(a(o(v.data.slice(P.children.length)),k,i(v)),v.data=P.children),v=d(v,P,T,E,C,M)):O&&!P.children?a(P.el=o(""),k):(D||(D=!0,Ku(k,1)||Ml()),n(null,P,k,null,T,E,Vu(k),C))}return v},f=(v,y,k,T,E,C)=>{const{slotScopeIds:M}=y;M&&(E=E?E.concat(M):M);const $=r(v),L=m(i(v),y,$,k,T,E,C);return L&&Hl(L)&&L.data==="]"?i(y.anchor=L):(Ml(),a(y.anchor=c("]"),$,L),L)},g=(v,y,k,T,E,C)=>{if(Ku(v.parentElement,1)||Ml(),y.el=null,C){const L=w(v);for(;;){const D=i(v);if(D&&D!==L)l(D);else break}}const M=i(v),$=r(v);return l(v),n(null,y,$,M,k,T,Vu($),E),k&&(k.vnode.el=y.el,lh(k,y.el)),M},w=(v,y="[",k="]")=>{let T=0;for(;v;)if(v=i(v),v&&Hl(v)&&(v.data===y&&T++,v.data===k)){if(T===0)return i(v);T--}return v},b=(v,y,k)=>{const T=y.parentNode;T&&T.replaceChild(v,y);let E=k;for(;E;)E.vnode.el===y&&(E.vnode.el=E.subTree.el=v),E=E.parent},_=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const Sy="data-allow-mismatch",DM={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Ku(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Sy);)e=e.parentElement;const n=e&&e.getAttribute(Sy);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(DM[t])}}const BM=Zf().requestIdleCallback||(e=>setTimeout(e,1)),FM=Zf().cancelIdleCallback||(e=>clearTimeout(e)),cde=(e=1e4)=>t=>{const n=BM(t,{timeout:e});return()=>FM(n)};function HM(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const ude=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(HM(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},dde=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},fde=(e=[])=>(t,n)=>{Xt(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function WM(e,t){if(Hl(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Hl(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const wi=e=>!!e.type.__asyncLoader;function Xo(e){mt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const p=()=>(d++,c=null,m()),m=()=>{let f;return c||(f=c=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((w,b)=>{a(g,()=>w(p()),()=>b(g),d+1)});throw g}).then(g=>f!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Xe({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(f,g,w){let b=!1;(g.bu||(g.bu=[])).push(()=>b=!0);const _=()=>{b||w()},v=i?()=>{const y=i(_,k=>WM(f,k));y&&(g.bum||(g.bum=[])).push(y)}:_;u?v():m().then(()=>!g.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const f=Kn;if(I1(f),u)return()=>Gu(u,f);const g=v=>{c=null,ma(v,f,13,!s)};if(l&&f.suspense||sl)return m().then(v=>()=>Gu(v,f)).catch(v=>(g(v),()=>s?pt(s,{error:v}):null));const w=ie(!1),b=ie(),_=ie(!!o);return o&&setTimeout(()=>{_.value=!1},o),r!=null&&setTimeout(()=>{if(!w.value&&!b.value){const v=new Error(`Async component timed out after ${r}ms.`);g(v),b.value=v}},r),m().then(()=>{w.value=!0,f.parent&&nu(f.parent.vnode)&&f.parent.update()}).catch(v=>{g(v),b.value=v}),()=>{if(w.value&&u)return Gu(u,f);if(b.value&&s)return pt(s,{error:b.value});if(n&&!_.value)return Gu(n,f)}}})}function Gu(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=pt(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const nu=e=>e.type.__isKeepAlive,UM={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=rs(),s=n.ctx;if(!s.renderer)return()=>{const _=t.default&&t.default();return _&&_.length===1?_[0]:_};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,p=d("div");s.activate=(_,v,y,k,T)=>{const E=_.component;c(_,v,y,0,l),a(E.vnode,_,v,y,E,l,k,_.slotScopeIds,T),wn(()=>{E.isDeactivated=!1,E.a&&Vl(E.a);const C=_.props&&_.props.onVnodeMounted;C&&xs(C,E.parent,_)},l)},s.deactivate=_=>{const v=_.component;Yd(v.m),Yd(v.a),c(_,p,null,1,l),wn(()=>{v.da&&Vl(v.da);const y=_.props&&_.props.onVnodeUnmounted;y&&xs(y,v.parent,_),v.isDeactivated=!0},l)};function m(_){Kp(_),u(_,n,l,!0)}function f(_){o.forEach((v,y)=>{const k=fg(wi(v)?v.type.__asyncResolved||{}:v.type);k&&!_(k)&&g(y)})}function g(_){const v=o.get(_);v&&(!r||!Mo(v,r))?m(v):r&&Kp(r),o.delete(_),i.delete(_)}Ve(()=>[e.include,e.exclude],([_,v])=>{_&&f(y=>sc(_,y)),v&&f(y=>!sc(v,y))},{flush:"post",deep:!0});let w=null;const b=()=>{w!=null&&(Xd(n.subTree.type)?wn(()=>{o.set(w,Yu(n.subTree))},n.subTree.suspense):o.set(w,Yu(n.subTree)))};return sn(b),$1(b),Js(()=>{o.forEach(_=>{const{subTree:v,suspense:y}=n,k=Yu(v);if(_.type===k.type&&_.key===k.key){Kp(k);const T=k.component.da;T&&wn(T,y);return}m(_)})}),()=>{if(w=null,!t.default)return r=null;const _=t.default(),v=_[0];if(_.length>1)return r=null,_;if(!cr(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=Yu(v);if(y.type===Sn)return r=null,y;const k=y.type,T=fg(wi(y)?y.type.__asyncResolved||{}:k),{include:E,exclude:C,max:M}=e;if(E&&(!T||!sc(E,T))||C&&T&&sc(C,T))return y.shapeFlag&=-257,r=y,v;const $=y.key==null?k:y.key,L=o.get($);return y.el&&(y=Ei(y),v.shapeFlag&128&&(v.ssContent=y)),w=$,L?(y.el=L.el,y.component=L.component,y.transition&&ar(y,y.transition),y.shapeFlag|=512,i.delete($),i.add($)):(i.add($),M&&i.size>parseInt(M,10)&&g(i.values().next().value)),y.shapeFlag|=256,r=y,Xd(v.type)?v:y}}},hde=UM;function sc(e,t){return ot(e)?e.some(n=>sc(n,t)):Xt(e)?e.split(",").includes(t):EA(e)?(e.lastIndex=0,e.test(t)):!1}function qM(e,t){O2(e,"a",t)}function jM(e,t){O2(e,"da",t)}function O2(e,t,n=Kn){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(ih(t,s,n),n){let o=n.parent;for(;o&&o.parent;)nu(o.parent.vnode)&&zM(s,t,n,o),o=o.parent}}function zM(e,t,n,s){const o=ih(t,e,s,!0);Gt(()=>{_1(s[t],o)},n)}function Kp(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Yu(e){return e.shapeFlag&128?e.ssContent:e}function ih(e,t,n=Kn,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Ti();const l=ga(n),a=So(t,n,e,r);return l(),Ai(),a});return s?o.unshift(i):o.push(i),i}}const $i=e=>(t,n=Kn)=>{(!sl||e==="sp")&&ih(e,(...s)=>t(...s),n)},VM=$i("bm"),sn=$i("m"),P2=$i("bu"),$1=$i("u"),Js=$i("bum"),Gt=$i("um"),KM=$i("sp"),GM=$i("rtg"),YM=$i("rtc");function XM(e,t=Kn){ih("ec",e,t)}const N1="components",ZM="directives";function JM(e,t){return L1(N1,e,!0,t)||e}const D2=Symbol.for("v-ndc");function ss(e){return Xt(e)?L1(N1,e,!1)||e:e||D2}function pde(e){return L1(ZM,e)}function L1(e,t,n=!0,s=!1){const o=Yn||Kn;if(o){const i=o.type;if(e===N1){const l=fg(i,!1);if(l&&(l===t||l===Ln(t)||l===Yf(Ln(t))))return i}const r=Cy(o[e]||i[e],t)||Cy(o.appContext[e],t);return!r&&s?i:r}}function Cy(e,t){return e&&(e[t]||e[Ln(t)]||e[Yf(Ln(t))])}function Ze(e,t,n,s){let o;const i=n&&n[s],r=ot(e);if(r||Xt(e)){const l=r&&sr(e);let a=!1,c=!1;l&&(a=!zs(e),c=Mi(e),e=eh(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?la(Lo(e[u])):Lo(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(Ut(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function mde(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(ot(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function Yl(e,t,n={},s,o){if(Yn.ce||Yn.parent&&wi(Yn.parent)&&Yn.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),S(),je(Me,null,[pt("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),S();const r=i&&R1(i(n)),l=n.key||r&&r.key,a=je(Me,{key:(l&&!Zs(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function R1(e){return e.some(t=>cr(t)?!(t.type===Sn||t.type===Me&&!R1(t.children)):!0)?e:null}function gde(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:bd(s)]=e[s];return n}const og=e=>e?aS(e)?ou(e):og(e.parent):null,pc=Kt(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=>og(e.parent),$root:e=>og(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>O1(e),$forceUpdate:e=>e.f||(e.f=()=>{M1(e.update)}),$nextTick:e=>e.n||(e.n=ut.bind(e.proxy)),$watch:e=>MM.bind(e)}),Gp=(e,t)=>e!==Mt&&!e.__isScriptSetup&&Wt(e,t),ig={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const p=r[t];if(p!==void 0)switch(p){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(Gp(s,t))return r[t]=1,s[t];if(o!==Mt&&Wt(o,t))return r[t]=2,o[t];if(Wt(i,t))return r[t]=3,i[t];if(n!==Mt&&Wt(n,t))return r[t]=4,n[t];rg&&(r[t]=0)}}const c=pc[t];let u,d;if(c)return t==="$attrs"&&ns(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Mt&&Wt(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,Wt(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return Gp(o,t)?(o[t]=n,!0):s!==Mt&&Wt(s,t)?(s[t]=n,!0):Wt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Mt&&l[0]!=="$"&&Wt(e,l)||Gp(t,l)||Wt(i,l)||Wt(s,l)||Wt(pc,l)||Wt(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Wt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},QM=Kt({},ig,{get(e,t){if(t!==Symbol.unscopables)return ig.get(e,t,e)},has(e,t){return t[0]!=="_"&&!RA(t)}});function vde(){return null}function yde(){return null}function kde(e){}function bde(e){}function _de(){return null}function wde(){}function Sde(e,t){return null}function Cde(){return B2().slots}function su(){return B2().attrs}function B2(e){const t=rs();return t.setupContext||(t.setupContext=dS(t))}function Oc(e){return ot(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function xde(e,t){const n=Oc(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?ot(o)||mt(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function Tde(e,t){return!e||!t?e||t:ot(e)&&ot(t)?e.concat(t):Kt({},Oc(e),Oc(t))}function Ade(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function Mde(e){const t=rs(),n=sl;let s=e();Dc(),n&&Jl(!1);const o=()=>{ga(t),n&&Jl(!0)},i=()=>{rs()!==t&&t.scope.off(),Dc(),n&&Jl(!1)};return w1(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let rg=!0;function e4(e){const t=O1(e),n=e.proxy,s=e.ctx;rg=!1,t.beforeCreate&&xy(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:m,updated:f,activated:g,deactivated:w,beforeDestroy:b,beforeUnmount:_,destroyed:v,unmounted:y,render:k,renderTracked:T,renderTriggered:E,errorCaptured:C,serverPrefetch:M,expose:$,inheritAttrs:L,components:D,directives:R,filters:P}=t;if(c&&t4(c,s,null),r)for(const V in r){const z=r[V];mt(z)&&(s[V]=z.bind(n))}if(o){const V=o.call(n,n);Ut(V)&&(e.data=qs(V))}if(rg=!0,i)for(const V in i){const z=i[V],se=mt(z)?z.bind(n,n):mt(z.get)?z.get.bind(n,n):bo,Q=!mt(z)&&mt(z.set)?z.set.bind(n):bo,me=U({get:se,set:Q});Object.defineProperty(s,V,{enumerable:!0,configurable:!0,get:()=>me.value,set:$e=>me.value=$e})}if(l)for(const V in l)F2(l[V],s,n,V);if(a){const V=mt(a)?a.call(n):a;Reflect.ownKeys(V).forEach(z=>{an(z,V[z])})}u&&xy(u,e,"c");function W(V,z){ot(z)?z.forEach(se=>V(se.bind(n))):z&&V(z.bind(n))}if(W(VM,d),W(sn,p),W(P2,m),W($1,f),W(qM,g),W(jM,w),W(XM,C),W(YM,T),W(GM,E),W(Js,_),W(Gt,y),W(KM,M),ot($))if($.length){const V=e.exposed||(e.exposed={});$.forEach(z=>{Object.defineProperty(V,z,{get:()=>n[z],set:se=>n[z]=se,enumerable:!0})})}else e.exposed||(e.exposed={});k&&e.render===bo&&(e.render=k),L!=null&&(e.inheritAttrs=L),D&&(e.components=D),R&&(e.directives=R),M&&I1(e)}function t4(e,t,n=bo){ot(e)&&(e=lg(e));for(const s in e){const o=e[s];let i;Ut(o)?"default"in o?i=Rt(o.from||s,o.default,!0):i=Rt(o.from||s):i=Rt(o),xn(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function xy(e,t,n){So(ot(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function F2(e,t,n,s){let o=s.includes(".")?A2(n,s):()=>n[s];if(Xt(e)){const i=t[e];mt(i)&&Ve(o,i)}else if(mt(e))Ve(o,e.bind(n));else if(Ut(e))if(ot(e))e.forEach(i=>F2(i,t,n,s));else{const i=mt(e.handler)?e.handler.bind(n):t[e.handler];mt(i)&&Ve(o,i,e)}}function O1(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>Gd(a,c,r,!0)),Gd(a,t,r)),Ut(t)&&i.set(t,a),a}function Gd(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Gd(e,i,n,!0),o&&o.forEach(r=>Gd(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=n4[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const n4={data:Ty,props:Ay,emits:Ay,methods:oc,computed:oc,beforeCreate:hs,created:hs,beforeMount:hs,mounted:hs,beforeUpdate:hs,updated:hs,beforeDestroy:hs,beforeUnmount:hs,destroyed:hs,unmounted:hs,activated:hs,deactivated:hs,errorCaptured:hs,serverPrefetch:hs,components:oc,directives:oc,watch:o4,provide:Ty,inject:s4};function Ty(e,t){return t?e?function(){return Kt(mt(e)?e.call(this,this):e,mt(t)?t.call(this,this):t)}:t:e}function s4(e,t){return oc(lg(e),lg(t))}function lg(e){if(ot(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function hs(e,t){return e?[...new Set([].concat(e,t))]:t}function oc(e,t){return e?Kt(Object.create(null),e,t):t}function Ay(e,t){return e?ot(e)&&ot(t)?[...new Set([...e,...t])]:Kt(Object.create(null),Oc(e),Oc(t??{})):t}function o4(e,t){if(!e)return t;if(!t)return e;const n=Kt(Object.create(null),e);for(const s in t)n[s]=hs(e[s],t[s]);return n}function H2(){return{app:null,config:{isNativeTag:Zw,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 i4=0;function r4(e,t){return function(s,o=null){mt(s)||(s=Kt({},s)),o!=null&&!Ut(o)&&(o=null);const i=H2(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:i4++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:P4,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&mt(u.install)?(r.add(u),u.install(c,...d)):mt(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,p){if(!a){const m=c._ceVNode||pt(s,o);return m.appContext=i,p===!0?p="svg":p===!1&&(p=void 0),d&&t?t(m,u):e(m,u,p),a=!0,c._container=u,u.__vue_app__=c,ou(m.component)}},onUnmount(u){l.push(u)},unmount(){a&&(So(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=Qr;Qr=c;try{return u()}finally{Qr=d}}};return c}}let Qr=null;function Ede(e,t,n=Mt){const s=rs(),o=Ln(t),i=As(t),r=W2(e,o),l=fM((a,c)=>{let u,d=Mt,p;return AM(()=>{const m=e[o];Vn(u,m)&&(u=m,c())}),{get(){return a(),n.get?n.get(u):u},set(m){const f=n.set?n.set(m):m;if(!Vn(f,u)&&!(d!==Mt&&Vn(m,d)))return;const g=s.vnode.props;g&&(t in g||o in g||i in g)&&(`onUpdate:${t}`in g||`onUpdate:${o}`in g||`onUpdate:${i}`in g)||(u=m,c()),s.emit(`update:${t}`,f),Vn(m,f)&&Vn(m,d)&&!Vn(f,p)&&c(),d=m,p=f}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Mt:l,done:!1}:{done:!0}}}},l}const W2=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ln(t)}Modifiers`]||e[`${As(t)}Modifiers`];function l4(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Mt;let o=n;const i=t.startsWith("update:"),r=i&&W2(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>Xt(u)?u.trim():u)),r.number&&(o=n.map(Xf)));let l,a=s[l=bd(t)]||s[l=bd(Ln(t))];!a&&i&&(a=s[l=bd(As(t))]),a&&So(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,So(c,e,6,o)}}const a4=new WeakMap;function U2(e,t,n=!1){const s=n?a4:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!mt(e)){const a=c=>{const u=U2(c,t,!0);u&&(l=!0,Kt(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(Ut(e)&&s.set(e,null),null):(ot(i)?i.forEach(a=>r[a]=null):Kt(r,i),Ut(e)&&s.set(e,r),r)}function rh(e,t){return!e||!Qc(t)?!1:(t=t.slice(2).replace(/Once$/,""),Wt(e,t[0].toLowerCase()+t.slice(1))||Wt(e,As(t))||Wt(e,t))}function _d(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:p,setupState:m,ctx:f,inheritAttrs:g}=e,w=Lc(e);let b,_;try{if(n.shapeFlag&4){const y=o||s,k=y;b=Ts(c.call(k,y,u,d,m,p,f)),_=l}else{const y=t;b=Ts(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),_=t.props?l:u4(l)}}catch(y){mc.length=0,ma(y,e,1),b=pt(Sn)}let v=b;if(_&&g!==!1){const y=Object.keys(_),{shapeFlag:k}=v;y.length&&k&7&&(i&&y.some(zf)&&(_=d4(_,i)),v=Ei(v,_,!1,!0))}return n.dirs&&(v=Ei(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&ar(v,n.transition),b=v,Lc(w),b}function c4(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(cr(o)){if(o.type!==Sn||o.children==="v-if"){if(n)return;n=o}}else return}return n}const u4=e=>{let t;for(const n in e)(n==="class"||n==="style"||Qc(n))&&((t||(t={}))[n]=e[n]);return t},d4=(e,t)=>{const n={};for(const s in e)(!zf(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function f4(e,t,n){const{props:s,children:o,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 s?My(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const p=u[d];if(q2(r,s,p)&&!rh(c,p))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?My(s,r,c):!0:!!r;return!1}function My(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(q2(t,e,i)&&!rh(n,i))return!0}return!1}function q2(e,t,n){const s=e[n],o=t[n];return n==="style"&&Ut(s)&&Ut(o)?!xi(s,o):s!==o}function lh({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const j2={},z2=()=>Object.create(j2),V2=e=>Object.getPrototypeOf(e)===j2;function h4(e,t,n,s=!1){const o={},i=z2();e.propsDefaults=Object.create(null),K2(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:aM(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function p4(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=Nt(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let p=u[d];if(rh(e.emitsOptions,p))continue;const m=t[p];if(a)if(Wt(i,p))m!==i[p]&&(i[p]=m,c=!0);else{const f=Ln(p);o[f]=ag(a,l,f,m,e,!1)}else m!==i[p]&&(i[p]=m,c=!0)}}}else{K2(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!Wt(t,d)&&((u=As(d))===d||!Wt(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=ag(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!Wt(t,d))&&(delete i[d],c=!0)}c&&vi(e.attrs,"set","")}function K2(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Zr(a))continue;const c=t[a];let u;o&&Wt(o,u=Ln(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:rh(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=Nt(n),c=l||Mt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=ag(o,a,d,c[d],e,!Wt(c,d))}}return r}function ag(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=Wt(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&mt(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=ga(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===As(n))&&(s=!0))}return s}const m4=new WeakMap;function G2(e,t,n=!1){const s=n?m4:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!mt(e)){const u=d=>{a=!0;const[p,m]=G2(d,t,!0);Kt(r,p),m&&l.push(...m)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return Ut(e)&&s.set(e,jl),jl;if(ot(i))for(let u=0;u<i.length;u++){const d=Ln(i[u]);Ey(d)&&(r[d]=Mt)}else if(i)for(const u in i){const d=Ln(u);if(Ey(d)){const p=i[u],m=r[d]=ot(p)||mt(p)?{type:p}:Kt({},p),f=m.type;let g=!1,w=!0;if(ot(f))for(let b=0;b<f.length;++b){const _=f[b],v=mt(_)&&_.name;if(v==="Boolean"){g=!0;break}else v==="String"&&(w=!1)}else g=mt(f)&&f.name==="Boolean";m[0]=g,m[1]=w,(g||Wt(m,"default"))&&l.push(d)}}const c=[r,l];return Ut(e)&&s.set(e,c),c}function Ey(e){return e[0]!=="$"&&!Zr(e)}const P1=e=>e==="_"||e==="_ctx"||e==="$stable",D1=e=>ot(e)?e.map(Ts):[Ts(e)],g4=(e,t,n)=>{if(t._n)return t;const s=yn((...o)=>D1(t(...o)),n);return s._c=!1,s},Y2=(e,t,n)=>{const s=e._ctx;for(const o in e){if(P1(o))continue;const i=e[o];if(mt(i))t[o]=g4(o,i,s);else if(i!=null){const r=D1(i);t[o]=()=>r}}},X2=(e,t)=>{const n=D1(t);e.slots.default=()=>n},Z2=(e,t,n)=>{for(const s in t)(n||!P1(s))&&(e[s]=t[s])},v4=(e,t,n)=>{const s=e.slots=z2();if(e.vnode.shapeFlag&32){const o=t._;o?(Z2(s,t,n),n&&Qw(s,"_",o,!0)):Y2(t,s)}else t&&X2(e,t)},y4=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Mt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:Z2(o,t,n):(i=!t.$stable,Y2(t,o)),r=t}else t&&(X2(e,t),r={default:1});if(i)for(const l in o)!P1(l)&&r[l]==null&&delete o[l]},wn=sS;function k4(e){return J2(e)}function b4(e){return J2(e,PM)}function J2(e,t){const n=Zf();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:p,setScopeId:m=bo,insertStaticContent:f}=e,g=(F,Y,le,re=null,fe=null,q=null,X=void 0,de=null,he=!!Y.dynamicChildren)=>{if(F===Y)return;F&&!Mo(F,Y)&&(re=ee(F),$e(F,fe,q,!0),F=null),Y.patchFlag===-2&&(he=!1,Y.dynamicChildren=null);const{type:ke,ref:Ce,shapeFlag:ae}=Y;switch(ke){case or:w(F,Y,le,re);break;case Sn:b(F,Y,le,re);break;case Zl:F==null&&_(Y,le,re,X);break;case Me:D(F,Y,le,re,fe,q,X,de,he);break;default:ae&1?k(F,Y,le,re,fe,q,X,de,he):ae&6?R(F,Y,le,re,fe,q,X,de,he):(ae&64||ae&128)&&ke.process(F,Y,le,re,fe,q,X,de,he,G)}Ce!=null&&fe?Gl(Ce,F&&F.ref,q,Y||F,!Y):Ce==null&&F&&F.ref!=null&&Gl(F.ref,null,q,F,!0)},w=(F,Y,le,re)=>{if(F==null)s(Y.el=l(Y.children),le,re);else{const fe=Y.el=F.el;Y.children!==F.children&&c(fe,Y.children)}},b=(F,Y,le,re)=>{F==null?s(Y.el=a(Y.children||""),le,re):Y.el=F.el},_=(F,Y,le,re)=>{[F.el,F.anchor]=f(F.children,Y,le,re,F.el,F.anchor)},v=({el:F,anchor:Y},le,re)=>{let fe;for(;F&&F!==Y;)fe=p(F),s(F,le,re),F=fe;s(Y,le,re)},y=({el:F,anchor:Y})=>{let le;for(;F&&F!==Y;)le=p(F),o(F),F=le;o(Y)},k=(F,Y,le,re,fe,q,X,de,he)=>{if(Y.type==="svg"?X="svg":Y.type==="math"&&(X="mathml"),F==null)T(Y,le,re,fe,q,X,de,he);else{const ke=F.el&&F.el._isVueCE?F.el:null;try{ke&&ke._beginPatch(),M(F,Y,fe,q,X,de,he)}finally{ke&&ke._endPatch()}}},T=(F,Y,le,re,fe,q,X,de)=>{let he,ke;const{props:Ce,shapeFlag:ae,transition:_e,dirs:ze}=F;if(he=F.el=r(F.type,q,Ce&&Ce.is,Ce),ae&8?u(he,F.children):ae&16&&C(F.children,he,null,re,fe,Yp(F,q),X,de),ze&&Go(F,null,re,"created"),E(he,F,F.scopeId,X,re),Ce){for(const dt in Ce)dt!=="value"&&!Zr(dt)&&i(he,dt,null,Ce[dt],q,re);"value"in Ce&&i(he,"value",null,Ce.value,q),(ke=Ce.onVnodeBeforeMount)&&xs(ke,re,F)}ze&&Go(F,null,re,"beforeMount");const Qe=Q2(fe,_e);Qe&&_e.beforeEnter(he),s(he,Y,le),((ke=Ce&&Ce.onVnodeMounted)||Qe||ze)&&wn(()=>{try{ke&&xs(ke,re,F),Qe&&_e.enter(he),ze&&Go(F,null,re,"mounted")}finally{}},fe)},E=(F,Y,le,re,fe)=>{if(le&&m(F,le),re)for(let q=0;q<re.length;q++)m(F,re[q]);if(fe){let q=fe.subTree;if(Y===q||Xd(q.type)&&(q.ssContent===Y||q.ssFallback===Y)){const X=fe.vnode;E(F,X,X.scopeId,X.slotScopeIds,fe.parent)}}},C=(F,Y,le,re,fe,q,X,de,he=0)=>{for(let ke=he;ke<F.length;ke++){const Ce=F[ke]=de?gi(F[ke]):Ts(F[ke]);g(null,Ce,Y,le,re,fe,q,X,de)}},M=(F,Y,le,re,fe,q,X)=>{const de=Y.el=F.el;let{patchFlag:he,dynamicChildren:ke,dirs:Ce}=Y;he|=F.patchFlag&16;const ae=F.props||Mt,_e=Y.props||Mt;let ze;if(le&&Pr(le,!1),(ze=_e.onVnodeBeforeUpdate)&&xs(ze,le,Y,F),Ce&&Go(Y,F,le,"beforeUpdate"),le&&Pr(le,!0),(ae.innerHTML&&_e.innerHTML==null||ae.textContent&&_e.textContent==null)&&u(de,""),ke?$(F.dynamicChildren,ke,de,le,re,Yp(Y,fe),q):X||z(F,Y,de,null,le,re,Yp(Y,fe),q,!1),he>0){if(he&16)L(de,ae,_e,le,fe);else if(he&2&&ae.class!==_e.class&&i(de,"class",null,_e.class,fe),he&4&&i(de,"style",ae.style,_e.style,fe),he&8){const Qe=Y.dynamicProps;for(let dt=0;dt<Qe.length;dt++){const Ge=Qe[dt],ft=ae[Ge],Ct=_e[Ge];(Ct!==ft||Ge==="value")&&i(de,Ge,ft,Ct,fe,le)}}he&1&&F.children!==Y.children&&u(de,Y.children)}else!X&&ke==null&&L(de,ae,_e,le,fe);((ze=_e.onVnodeUpdated)||Ce)&&wn(()=>{ze&&xs(ze,le,Y,F),Ce&&Go(Y,F,le,"updated")},re)},$=(F,Y,le,re,fe,q,X)=>{for(let de=0;de<Y.length;de++){const he=F[de],ke=Y[de],Ce=he.el&&(he.type===Me||!Mo(he,ke)||he.shapeFlag&198)?d(he.el):le;g(he,ke,Ce,null,re,fe,q,X,!0)}},L=(F,Y,le,re,fe)=>{if(Y!==le){if(Y!==Mt)for(const q in Y)!Zr(q)&&!(q in le)&&i(F,q,Y[q],null,fe,re);for(const q in le){if(Zr(q))continue;const X=le[q],de=Y[q];X!==de&&q!=="value"&&i(F,q,de,X,fe,re)}"value"in le&&i(F,"value",Y.value,le.value,fe)}},D=(F,Y,le,re,fe,q,X,de,he)=>{const ke=Y.el=F?F.el:l(""),Ce=Y.anchor=F?F.anchor:l("");let{patchFlag:ae,dynamicChildren:_e,slotScopeIds:ze}=Y;ze&&(de=de?de.concat(ze):ze),F==null?(s(ke,le,re),s(Ce,le,re),C(Y.children||[],le,Ce,fe,q,X,de,he)):ae>0&&ae&64&&_e&&F.dynamicChildren&&F.dynamicChildren.length===_e.length?($(F.dynamicChildren,_e,le,fe,q,X,de),(Y.key!=null||fe&&Y===fe.subTree)&&B1(F,Y,!0)):z(F,Y,le,Ce,fe,q,X,de,he)},R=(F,Y,le,re,fe,q,X,de,he)=>{Y.slotScopeIds=de,F==null?Y.shapeFlag&512?fe.ctx.activate(Y,le,re,X,he):P(Y,le,re,fe,q,X,he):O(F,Y,he)},P=(F,Y,le,re,fe,q,X)=>{const de=F.component=lS(F,re,fe);if(nu(F)&&(de.ctx.renderer=G),cS(de,!1,X),de.asyncDep){if(fe&&fe.registerDep(de,W,X),!F.el){const he=de.subTree=pt(Sn);b(null,he,Y,le),F.placeholder=he.el}}else W(de,F,Y,le,fe,q,X)},O=(F,Y,le)=>{const re=Y.component=F.component;if(f4(F,Y,le))if(re.asyncDep&&!re.asyncResolved){V(re,Y,le);return}else re.next=Y,re.update();else Y.el=F.el,re.vnode=Y},W=(F,Y,le,re,fe,q,X)=>{const de=()=>{if(F.isMounted){let{next:ae,bu:_e,u:ze,parent:Qe,vnode:dt}=F;{const Ft=eS(F);if(Ft){ae&&(ae.el=dt.el,V(F,ae,X)),Ft.asyncDep.then(()=>{wn(()=>{F.isUnmounted||ke()},fe)});return}}let Ge=ae,ft;Pr(F,!1),ae?(ae.el=dt.el,V(F,ae,X)):ae=dt,_e&&Vl(_e),(ft=ae.props&&ae.props.onVnodeBeforeUpdate)&&xs(ft,Qe,ae,dt),Pr(F,!0);const Ct=_d(F),Jt=F.subTree;F.subTree=Ct,g(Jt,Ct,d(Jt.el),ee(Jt),F,fe,q),ae.el=Ct.el,Ge===null&&lh(F,Ct.el),ze&&wn(ze,fe),(ft=ae.props&&ae.props.onVnodeUpdated)&&wn(()=>xs(ft,Qe,ae,dt),fe)}else{let ae;const{el:_e,props:ze}=Y,{bm:Qe,m:dt,parent:Ge,root:ft,type:Ct}=F,Jt=wi(Y);if(Pr(F,!1),Qe&&Vl(Qe),!Jt&&(ae=ze&&ze.onVnodeBeforeMount)&&xs(ae,Ge,Y),Pr(F,!0),_e&&J){const Ft=()=>{F.subTree=_d(F),J(_e,F.subTree,F,fe,null)};Jt&&Ct.__asyncHydrate?Ct.__asyncHydrate(_e,F,Ft):Ft()}else{ft.ce&&ft.ce._hasShadowRoot()&&ft.ce._injectChildStyle(Ct,F.parent?F.parent.type:void 0);const Ft=F.subTree=_d(F);g(null,Ft,le,re,F,fe,q),Y.el=Ft.el}if(dt&&wn(dt,fe),!Jt&&(ae=ze&&ze.onVnodeMounted)){const Ft=Y;wn(()=>xs(ae,Ge,Ft),fe)}(Y.shapeFlag&256||Ge&&wi(Ge.vnode)&&Ge.vnode.shapeFlag&256)&&F.a&&wn(F.a,fe),F.isMounted=!0,Y=le=re=null}};F.scope.on();const he=F.effect=new Hd(de);F.scope.off();const ke=F.update=he.run.bind(he),Ce=F.job=he.runIfDirty.bind(he);Ce.i=F,Ce.id=F.uid,he.scheduler=()=>M1(Ce),Pr(F,!0),ke()},V=(F,Y,le)=>{Y.component=F;const re=F.vnode.props;F.vnode=Y,F.next=null,p4(F,Y.props,re,le),y4(F,Y.children,le),Ti(),gy(F),Ai()},z=(F,Y,le,re,fe,q,X,de,he=!1)=>{const ke=F&&F.children,Ce=F?F.shapeFlag:0,ae=Y.children,{patchFlag:_e,shapeFlag:ze}=Y;if(_e>0){if(_e&128){Q(ke,ae,le,re,fe,q,X,de,he);return}else if(_e&256){se(ke,ae,le,re,fe,q,X,de,he);return}}ze&8?(Ce&16&&te(ke,fe,q),ae!==ke&&u(le,ae)):Ce&16?ze&16?Q(ke,ae,le,re,fe,q,X,de,he):te(ke,fe,q,!0):(Ce&8&&u(le,""),ze&16&&C(ae,le,re,fe,q,X,de,he))},se=(F,Y,le,re,fe,q,X,de,he)=>{F=F||jl,Y=Y||jl;const ke=F.length,Ce=Y.length,ae=Math.min(ke,Ce);let _e;for(_e=0;_e<ae;_e++){const ze=Y[_e]=he?gi(Y[_e]):Ts(Y[_e]);g(F[_e],ze,le,null,fe,q,X,de,he)}ke>Ce?te(F,fe,q,!0,!1,ae):C(Y,le,re,fe,q,X,de,he,ae)},Q=(F,Y,le,re,fe,q,X,de,he)=>{let ke=0;const Ce=Y.length;let ae=F.length-1,_e=Ce-1;for(;ke<=ae&&ke<=_e;){const ze=F[ke],Qe=Y[ke]=he?gi(Y[ke]):Ts(Y[ke]);if(Mo(ze,Qe))g(ze,Qe,le,null,fe,q,X,de,he);else break;ke++}for(;ke<=ae&&ke<=_e;){const ze=F[ae],Qe=Y[_e]=he?gi(Y[_e]):Ts(Y[_e]);if(Mo(ze,Qe))g(ze,Qe,le,null,fe,q,X,de,he);else break;ae--,_e--}if(ke>ae){if(ke<=_e){const ze=_e+1,Qe=ze<Ce?Y[ze].el:re;for(;ke<=_e;)g(null,Y[ke]=he?gi(Y[ke]):Ts(Y[ke]),le,Qe,fe,q,X,de,he),ke++}}else if(ke>_e)for(;ke<=ae;)$e(F[ke],fe,q,!0),ke++;else{const ze=ke,Qe=ke,dt=new Map;for(ke=Qe;ke<=_e;ke++){const Ke=Y[ke]=he?gi(Y[ke]):Ts(Y[ke]);Ke.key!=null&&dt.set(Ke.key,ke)}let Ge,ft=0;const Ct=_e-Qe+1;let Jt=!1,Ft=0;const Xn=new Array(Ct);for(ke=0;ke<Ct;ke++)Xn[ke]=0;for(ke=ze;ke<=ae;ke++){const Ke=F[ke];if(ft>=Ct){$e(Ke,fe,q,!0);continue}let Et;if(Ke.key!=null)Et=dt.get(Ke.key);else for(Ge=Qe;Ge<=_e;Ge++)if(Xn[Ge-Qe]===0&&Mo(Ke,Y[Ge])){Et=Ge;break}Et===void 0?$e(Ke,fe,q,!0):(Xn[Et-Qe]=ke+1,Et>=Ft?Ft=Et:Jt=!0,g(Ke,Y[Et],le,null,fe,q,X,de,he),ft++)}const _s=Jt?_4(Xn):jl;for(Ge=_s.length-1,ke=Ct-1;ke>=0;ke--){const Ke=Qe+ke,Et=Y[Ke],ls=Y[Ke+1],Os=Ke+1<Ce?ls.el||tS(ls):re;Xn[ke]===0?g(null,Et,le,Os,fe,q,X,de,he):Jt&&(Ge<0||ke!==_s[Ge]?me(Et,le,Os,2):Ge--)}}},me=(F,Y,le,re,fe=null)=>{const{el:q,type:X,transition:de,children:he,shapeFlag:ke}=F;if(ke&6){me(F.component.subTree,Y,le,re);return}if(ke&128){F.suspense.move(Y,le,re);return}if(ke&64){X.move(F,Y,le,G);return}if(X===Me){s(q,Y,le);for(let ae=0;ae<he.length;ae++)me(he[ae],Y,le,re);s(F.anchor,Y,le);return}if(X===Zl){v(F,Y,le);return}if(re!==2&&ke&1&&de)if(re===0)de.persisted&&!q[po]?s(q,Y,le):(de.beforeEnter(q),s(q,Y,le),wn(()=>de.enter(q),fe));else{const{leave:ae,delayLeave:_e,afterLeave:ze}=de,Qe=()=>{F.ctx.isUnmounted?o(q):s(q,Y,le)},dt=()=>{const Ge=q._isLeaving||!!q[po];q._isLeaving&&q[po](!0),de.persisted&&!Ge?Qe():ae(q,()=>{Qe(),ze&&ze()})};_e?_e(q,Qe,dt):dt()}else s(q,Y,le)},$e=(F,Y,le,re=!1,fe=!1)=>{const{type:q,props:X,ref:de,children:he,dynamicChildren:ke,shapeFlag:Ce,patchFlag:ae,dirs:_e,cacheIndex:ze,memo:Qe}=F;if(ae===-2&&(fe=!1),de!=null&&(Ti(),Gl(de,null,le,F,!0),Ai()),ze!=null&&(Y.renderCache[ze]=void 0),Ce&256){Y.ctx.deactivate(F);return}const dt=Ce&1&&_e,Ge=!wi(F);let ft;if(Ge&&(ft=X&&X.onVnodeBeforeUnmount)&&xs(ft,Y,F),Ce&6)Ee(F.component,le,re);else{if(Ce&128){F.suspense.unmount(le,re);return}dt&&Go(F,null,Y,"beforeUnmount"),Ce&64?F.type.remove(F,Y,le,G,re):ke&&!ke.hasOnce&&(q!==Me||ae>0&&ae&64)?te(ke,Y,le,!1,!0):(q===Me&&ae&384||!fe&&Ce&16)&&te(he,Y,le),re&&He(F)}const Ct=Qe!=null&&ze==null;(Ge&&(ft=X&&X.onVnodeUnmounted)||dt||Ct)&&wn(()=>{ft&&xs(ft,Y,F),dt&&Go(F,null,Y,"unmounted"),Ct&&(F.el=null)},le)},He=F=>{const{type:Y,el:le,anchor:re,transition:fe}=F;if(Y===Me){Be(le,re);return}if(Y===Zl){y(F);return}const q=()=>{o(le),fe&&!fe.persisted&&fe.afterLeave&&fe.afterLeave()};if(F.shapeFlag&1&&fe&&!fe.persisted){const{leave:X,delayLeave:de}=fe,he=()=>X(le,q);de?de(F.el,q,he):he()}else q()},Be=(F,Y)=>{let le;for(;F!==Y;)le=p(F),o(F),F=le;o(Y)},Ee=(F,Y,le)=>{const{bum:re,scope:fe,job:q,subTree:X,um:de,m:he,a:ke}=F;Yd(he),Yd(ke),re&&Vl(re),fe.stop(),q&&(q.flags|=8,$e(X,F,Y,le)),de&&wn(de,Y),wn(()=>{F.isUnmounted=!0},Y)},te=(F,Y,le,re=!1,fe=!1,q=0)=>{for(let X=q;X<F.length;X++)$e(F[X],Y,le,re,fe)},ee=F=>{if(F.shapeFlag&6)return ee(F.component.subTree);if(F.shapeFlag&128)return F.suspense.next();const Y=p(F.anchor||F.el),le=Y&&Y[M2];return le?p(le):Y};let Z=!1;const Ae=(F,Y,le)=>{let re;F==null?Y._vnode&&($e(Y._vnode,null,null,!0),re=Y._vnode.component):g(Y._vnode||null,F,Y,null,null,null,le),Y._vnode=F,Z||(Z=!0,gy(re),Vd(),Z=!1)},G={p:g,um:$e,m:me,r:He,mt:P,mc:C,pc:z,pbc:$,n:ee,o:e};let oe,J;return t&&([oe,J]=t(G)),{render:Ae,hydrate:oe,createApp:r4(Ae,oe)}}function Yp({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 Pr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Q2(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function B1(e,t,n=!1){const s=e.children,o=t.children;if(ot(s)&&ot(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=gi(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&B1(r,l)),l.type===or&&(l.patchFlag===-1&&(l=o[i]=gi(l)),l.el=r.el),l.type===Sn&&!l.el&&(l.el=r.el)}}function _4(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);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[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function eS(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:eS(t)}function Yd(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function tS(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?tS(t.subTree):null}const Xd=e=>e.__isSuspense;let cg=0;const w4={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)S4(t,n,s,o,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}C4(e,t,n,s,o,r,l,a,c)}},hydrate:x4,normalize:T4},Ide=w4;function Pc(e,t){const n=e.props&&e.props[t];mt(n)&&n()}function S4(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),p=e.suspense=nS(e,o,s,t,d,n,i,r,l,a);c(null,p.pendingBranch=e.ssContent,d,null,s,p,i,r),p.deps>0?(Pc(e,"onPending"),Pc(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),Xl(p,e.ssFallback)):p.resolve(!1,!0)}function C4(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const p=t.ssContent,m=t.ssFallback,{activeBranch:f,pendingBranch:g,isInFallback:w,isHydrating:b}=d;if(g)d.pendingBranch=p,Mo(g,p)?(a(g,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():w&&(b||(a(f,m,n,s,o,null,i,r,l),Xl(d,m)))):(d.pendingId=cg++,b?(d.isHydrating=!1,d.activeBranch=g):c(g,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),w?(a(null,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(f,m,n,s,o,null,i,r,l),Xl(d,m))):f&&Mo(f,p)?(a(f,p,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(f&&Mo(f,p))a(f,p,n,s,o,d,i,r,l),Xl(d,p);else if(Pc(t,"onPending"),d.pendingBranch=p,p.shapeFlag&512?d.pendingId=p.component.suspenseId:d.pendingId=cg++,a(null,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:_,pendingId:v}=d;_>0?setTimeout(()=>{d.pendingId===v&&d.fallback(m)},_):_===0&&d.fallback(m)}}function nS(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:p,um:m,n:f,o:{parentNode:g,remove:w}}=c;let b;const _=A4(e);_&&t&&t.pendingBranch&&(b=t.pendingId,t.deps++);const v=e.props?Fd(e.props.timeout):void 0,y=i,k={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:cg++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(T=!1,E=!1){const{vnode:C,activeBranch:M,pendingBranch:$,pendingId:L,effects:D,parentComponent:R,container:P,isInFallback:O}=k;let W=!1;if(k.isHydrating)k.isHydrating=!1;else if(!T){W=M&&$.transition&&$.transition.mode==="out-in";let se=!1;W&&(M.transition.afterLeave=()=>{L===k.pendingId&&(p($,P,i===y&&!se?f(M):i,0),zd(D),O&&C.ssFallback&&(C.ssFallback.el=null))}),M&&!k.isFallbackMountPending&&(g(M.el)===P&&(i=f(M),se=!0),m(M,R,k,!0),!W&&O&&C.ssFallback&&wn(()=>C.ssFallback.el=null,k)),W||p($,P,i,0)}k.isFallbackMountPending=!1,Xl(k,$),k.pendingBranch=null,k.isInFallback=!1;let V=k.parent,z=!1;for(;V;){if(V.pendingBranch){V.effects.push(...D),z=!0;break}V=V.parent}!z&&!W&&zd(D),k.effects=[],_&&t&&t.pendingBranch&&b===t.pendingId&&(t.deps--,t.deps===0&&!E&&t.resolve()),Pc(C,"onResolve")},fallback(T){if(!k.pendingBranch)return;const{vnode:E,activeBranch:C,parentComponent:M,container:$,namespace:L}=k;Pc(E,"onFallback");const D=f(C),R=()=>{k.isFallbackMountPending=!1,k.isInFallback&&(d(null,T,$,D,M,null,L,l,a),Xl(k,T))},P=T.transition&&T.transition.mode==="out-in";P&&(k.isFallbackMountPending=!0,C.transition.afterLeave=R),k.isInFallback=!0,m(C,M,null,!0),P||R()},move(T,E,C){k.activeBranch&&p(k.activeBranch,T,E,C),k.container=T},next(){return k.activeBranch&&f(k.activeBranch)},registerDep(T,E,C){const M=!!k.pendingBranch;M&&k.deps++;const $=T.vnode.el;T.asyncDep.catch(L=>{ma(L,T,0)}).then(L=>{if(T.isUnmounted||k.isUnmounted||k.pendingId!==T.suspenseId)return;Dc(),T.asyncResolved=!0;const{vnode:D}=T;ug(T,L,!1),$&&(D.el=$);const R=!$&&T.subTree.el;E(T,D,g($||T.subTree.el),$?null:f(T.subTree),k,r,C),R&&(D.placeholder=null,w(R)),lh(T,D.el),M&&--k.deps===0&&k.resolve()})},unmount(T,E){k.isUnmounted=!0,k.activeBranch&&m(k.activeBranch,n,T,E),k.pendingBranch&&m(k.pendingBranch,n,T,E)}};return k}function x4(e,t,n,s,o,i,r,l,a){const c=t.suspense=nS(t,s,n,e.parentNode,document.createElement("div"),null,o,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 T4(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=Iy(s?n.default:n),e.ssFallback=s?Iy(n.fallback):pt(Sn)}function Iy(e){let t;if(mt(e)){const n=nl&&e._c;n&&(e._d=!1,S()),e=e(),n&&(e._d=!0,t=os,oS())}return ot(e)&&(e=c4(e)),e=Ts(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function sS(e,t){t&&t.pendingBranch?ot(e)?t.effects.push(...e):t.effects.push(e):zd(e)}function Xl(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,lh(s,o))}function A4(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Me=Symbol.for("v-fgt"),or=Symbol.for("v-txt"),Sn=Symbol.for("v-cmt"),Zl=Symbol.for("v-stc"),mc=[];let os=null;function S(e=!1){mc.push(os=e?null:[])}function oS(){mc.pop(),os=mc[mc.length-1]||null}let nl=1;function Zd(e,t=!1){nl+=e,e<0&&os&&t&&(os.hasOnce=!0)}function iS(e){return e.dynamicChildren=nl>0?os||jl:null,oS(),nl>0&&os&&os.push(e),e}function I(e,t,n,s,o,i){return iS(h(e,t,n,s,o,i,!0))}function je(e,t,n,s,o){return iS(pt(e,t,n,s,o,!0))}function cr(e){return e?e.__v_isVNode===!0:!1}function Mo(e,t){return e.type===t.type&&e.key===t.key}function $de(e){}const rS=({key:e})=>e??null,wd=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Xt(e)||xn(e)||mt(e)?{i:Yn,r:e,k:t,f:!!n}:e:null);function h(e,t=null,n=null,s=0,o=null,i=e===Me?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&rS(t),ref:t&&wd(t),scopeId:oh,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:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Yn};return l?(F1(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Xt(n)?8:16),nl>0&&!r&&os&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&os.push(a),a}const pt=M4;function M4(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===D2)&&(e=Sn),cr(e)){const l=Ei(e,t,!0);return n&&F1(l,n),nl>0&&!i&&os&&(l.shapeFlag&6?os[os.indexOf(e)]=l:os.push(l)),l.patchFlag=-2,l}if(R4(e)&&(e=e.__vccOpts),t){t=E4(t);let{class:l,style:a}=t;l&&!Xt(l)&&(t.class=Te(l)),Ut(a)&&(sh(a)&&!ot(a)&&(a=Kt({},a)),t.style=Dt(a))}const r=Xt(e)?1:Xd(e)?128:E2(e)?64:Ut(e)?4:mt(e)?2:0;return h(e,t,n,s,o,r,i,!0)}function E4(e){return e?sh(e)||V2(e)?Kt({},e):e:null}function Ei(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?Vt(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&rS(c),ref:t&&t.ref?n&&i?ot(i)?i.concat(wd(t)):[i,wd(t)]:wd(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!==Me?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&&Ei(e.ssContent),ssFallback:e.ssFallback&&Ei(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&ar(u,a.clone(u)),u}function vt(e=" ",t=0){return pt(or,null,e,t)}function ur(e,t){const n=pt(Zl,null,e);return n.staticCount=t,n}function ue(e="",t=!1){return t?(S(),je(Sn,null,e)):pt(Sn,null,e)}function Ts(e){return e==null||typeof e=="boolean"?pt(Sn):ot(e)?pt(Me,null,e.slice()):cr(e)?gi(e):pt(or,null,String(e))}function gi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ei(e)}function F1(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(ot(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),F1(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!V2(t)?t._ctx=Yn:o===3&&Yn&&(Yn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else mt(t)?(t={default:t,_ctx:Yn},n=32):(t=String(t),s&64?(n=16,t=[vt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Vt(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Te([t.class,s.class]));else if(o==="style")t.style=Dt([t.style,s.style]);else if(Qc(o)){const i=t[o],r=s[o];r&&i!==r&&!(ot(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!zf(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function xs(e,t,n,s=null){So(e,t,7,[n,s])}const I4=H2();let $4=0;function lS(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||I4,i={uid:$4++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new s2(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:G2(s,o),emitsOptions:U2(s,o),emit:null,emitted:null,propsDefaults:Mt,inheritAttrs:s.inheritAttrs,ctx:Mt,data:Mt,props:Mt,attrs:Mt,slots:Mt,refs:Mt,setupState:Mt,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=l4.bind(null,i),e.ce&&e.ce(i),i}let Kn=null;const rs=()=>Kn||Yn;let Jd,Jl;{const e=Zf(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};Jd=t("__VUE_INSTANCE_SETTERS__",n=>Kn=n),Jl=t("__VUE_SSR_SETTERS__",n=>sl=n)}const ga=e=>{const t=Kn;return Jd(e),e.scope.on(),()=>{e.scope.off(),Jd(t)}},Dc=()=>{Kn&&Kn.scope.off(),Jd(null)};function aS(e){return e.vnode.shapeFlag&4}let sl=!1;function cS(e,t=!1,n=!1){t&&Jl(t);const{props:s,children:o}=e.vnode,i=aS(e);h4(e,s,i,t),v4(e,o,n||t);const r=i?N4(e,t):void 0;return t&&Jl(!1),r}function N4(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ig);const{setup:s}=n;if(s){Ti();const o=e.setupContext=s.length>1?dS(e):null,i=ga(e),r=eu(s,e,0,[e.props,o]),l=w1(r);if(Ai(),i(),(l||e.sp)&&!wi(e)&&I1(e),l){if(r.then(Dc,Dc),t)return r.then(a=>{ug(e,a,t)}).catch(a=>{ma(a,e,0)});e.asyncDep=r}else ug(e,r,t)}else uS(e,t)}function ug(e,t,n){mt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ut(t)&&(e.setupState=b2(t)),uS(e,n)}let Qd,dg;function Nde(e){Qd=e,dg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,QM))}}const Lde=()=>!Qd;function uS(e,t,n){const s=e.type;if(!e.render){if(!t&&Qd&&!s.render){const o=s.template||O1(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=Kt(Kt({isCustomElement:i,delimiters:l},r),a);s.render=Qd(o,c)}}e.render=s.render||bo,dg&&dg(e)}{const o=ga(e);Ti();try{e4(e)}finally{Ai(),o()}}}const L4={get(e,t){return ns(e,"get",""),e[t]}};function dS(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,L4),slots:e.slots,emit:e.emit,expose:t}}function ou(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(b2(er(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in pc)return pc[n](e)},has(t,n){return n in t||n in pc}})):e.proxy}function fg(e,t=!0){return mt(e)?e.displayName||e.name:e.name||t&&e.__name}function R4(e){return mt(e)&&"__vccOpts"in e}const U=(e,t)=>gM(e,t,sl);function jt(e,t,n){try{Zd(-1);const s=arguments.length;return s===2?Ut(t)&&!ot(t)?cr(t)?pt(e,null,[t]):pt(e,t):pt(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&cr(n)&&(n=[n]),pt(e,t,n))}finally{Zd(1)}}function Rde(){}function Ode(e,t,n,s){const o=n[s];if(o&&O4(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function O4(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Vn(n[s],t[s]))return!1;return nl>0&&os&&os.push(e),!0}const P4="3.5.35",Pde=bo,Dde=_M,Bde=Dl,Fde=T2,D4={createComponentInstance:lS,setupComponent:cS,renderComponentRoot:_d,setCurrentRenderingInstance:Lc,isVNode:cr,normalizeVNode:Ts,getComponentPublicInstance:ou,ensureValidVNode:R1,pushWarningContext:kM,popWarningContext:bM},Hde=D4,Wde=null,Ude=null,qde=null;/**
17
- * @vue/runtime-dom v3.5.35
18
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
- * @license MIT
20
- **/let hg;const $y=typeof window<"u"&&window.trustedTypes;if($y)try{hg=$y.createPolicy("vue",{createHTML:e=>e})}catch{}const fS=hg?e=>hg.createHTML(e):e=>e,B4="http://www.w3.org/2000/svg",F4="http://www.w3.org/1998/Math/MathML",pi=typeof document<"u"?document:null,Ny=pi&&pi.createElement("template"),H4={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?pi.createElementNS(B4,e):t==="mathml"?pi.createElementNS(F4,e):n?pi.createElement(e,{is:n}):pi.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>pi.createTextNode(e),createComment:e=>pi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>pi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{Ny.innerHTML=fS(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Ny.content;if(s==="svg"||s==="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]}},Wi="transition",Ka="animation",aa=Symbol("_vtc"),hS={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},pS=Kt({},$2,hS),W4=e=>(e.displayName="Transition",e.props=pS,e),Si=W4((e,{slots:t})=>jt(LM,mS(e),t)),Dr=(e,t=[])=>{ot(e)?e.forEach(n=>n(...t)):e&&e(...t)},Ly=e=>e?ot(e)?e.some(t=>t.length>1):e.length>1:!1;function mS(e){const t={};for(const D in e)D in hS||(t[D]=e[D]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,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:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,f=U4(o),g=f&&f[0],w=f&&f[1],{onBeforeEnter:b,onEnter:_,onEnterCancelled:v,onLeave:y,onLeaveCancelled:k,onBeforeAppear:T=b,onAppear:E=_,onAppearCancelled:C=v}=t,M=(D,R,P,O)=>{D._enterCancelled=O,Gi(D,R?u:l),Gi(D,R?c:r),P&&P()},$=(D,R)=>{D._isLeaving=!1,Gi(D,d),Gi(D,m),Gi(D,p),R&&R()},L=D=>(R,P)=>{const O=D?E:_,W=()=>M(R,D,P);Dr(O,[R,W]),Ry(()=>{Gi(R,D?a:i),zo(R,D?u:l),Ly(O)||Oy(R,s,g,W)})};return Kt(t,{onBeforeEnter(D){Dr(b,[D]),zo(D,i),zo(D,r)},onBeforeAppear(D){Dr(T,[D]),zo(D,a),zo(D,c)},onEnter:L(!1),onAppear:L(!0),onLeave(D,R){D._isLeaving=!0;const P=()=>$(D,R);zo(D,d),D._enterCancelled?(zo(D,p),pg(D)):(pg(D),zo(D,p)),Ry(()=>{D._isLeaving&&(Gi(D,d),zo(D,m),Ly(y)||Oy(D,s,w,P))}),Dr(y,[D,P])},onEnterCancelled(D){M(D,!1,void 0,!0),Dr(v,[D])},onAppearCancelled(D){M(D,!0,void 0,!0),Dr(C,[D])},onLeaveCancelled(D){$(D),Dr(k,[D])}})}function U4(e){if(e==null)return null;if(Ut(e))return[Xp(e.enter),Xp(e.leave)];{const t=Xp(e);return[t,t]}}function Xp(e){return Fd(e)}function zo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[aa]||(e[aa]=new Set)).add(t)}function Gi(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[aa];n&&(n.delete(t),n.size||(e[aa]=void 0))}function Ry(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let q4=0;function Oy(e,t,n,s){const o=e._endId=++q4,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=gS(e,t);if(!r)return s();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,p),i()},p=m=>{m.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,p)}function gS(e,t){const n=window.getComputedStyle(e),s=f=>(n[f]||"").split(", "),o=s(`${Wi}Delay`),i=s(`${Wi}Duration`),r=Py(o,i),l=s(`${Ka}Delay`),a=s(`${Ka}Duration`),c=Py(l,a);let u=null,d=0,p=0;t===Wi?r>0&&(u=Wi,d=r,p=i.length):t===Ka?c>0&&(u=Ka,d=c,p=a.length):(d=Math.max(r,c),u=d>0?r>c?Wi:Ka:null,p=u?u===Wi?i.length:a.length:0);const m=u===Wi&&/\b(?:transform|all)(?:,|$)/.test(s(`${Wi}Property`).toString());return{type:u,timeout:d,propCount:p,hasTransform:m}}function Py(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Dy(n)+Dy(e[s])))}function Dy(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function pg(e){return(e?e.ownerDocument:document).body.offsetHeight}function j4(e,t,n){const s=e[aa];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ef=Symbol("_vod"),vS=Symbol("_vsh"),Eo={name:"show",beforeMount(e,{value:t},{transition:n}){e[ef]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Ga(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),Ga(e,!0),s.enter(e)):s.leave(e,()=>{Ga(e,!1)}):Ga(e,t))},beforeUnmount(e,{value:t}){Ga(e,t)}};function Ga(e,t){e.style.display=t?e[ef]:"none",e[vS]=!t}function z4(){Eo.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const yS=Symbol("");function jde(e){const t=rs();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>tf(i,o))},s=()=>{const o=e(t.proxy);t.ce?tf(t.ce,o):mg(t.subTree,o),n(o)};P2(()=>{zd(s)}),sn(()=>{Ve(s,bo,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),Gt(()=>o.disconnect())})}function mg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{mg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)tf(e.el,t);else if(e.type===Me)e.children.forEach(n=>mg(n,t));else if(e.type===Zl){let{el:n,anchor:s}=e;for(;n&&(tf(n,t),n!==s);)n=n.nextSibling}}function tf(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=UA(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[yS]=s}}const V4=/(?:^|;)\s*display\s*:/;function K4(e,t,n){const s=e.style,o=Xt(n);let i=!1;if(n&&!o){if(t)if(Xt(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&ic(s,l,"")}else for(const r in t)n[r]==null&&ic(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?Y4(e,r,!Xt(t)&&t?t[r]:void 0,l)||ic(s,r,l):ic(s,r,"")}}else if(o){if(t!==n){const r=s[yS];r&&(n+=";"+r),s.cssText=n,i=V4.test(n)}}else t&&e.removeAttribute("style");ef in e&&(e[ef]=i?s.display:"",e[vS]&&(s.display="none"))}const By=/\s*!important$/;function ic(e,t,n){if(ot(n))n.forEach(s=>ic(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=G4(e,t);By.test(n)?e.setProperty(As(s),n.replace(By,""),"important"):e[s]=n}}const Fy=["Webkit","Moz","ms"],Zp={};function G4(e,t){const n=Zp[t];if(n)return n;let s=Ln(t);if(s!=="filter"&&s in e)return Zp[t]=s;s=Yf(s);for(let o=0;o<Fy.length;o++){const i=Fy[o]+s;if(i in e)return Zp[t]=i}return t}function Y4(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Xt(s)&&n===s}const Hy="http://www.w3.org/1999/xlink";function Wy(e,t,n,s,o,i=HA(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Hy,t.slice(6,t.length)):e.setAttributeNS(Hy,t,n):n==null||i&&!e2(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Zs(n)?String(n):n)}function Uy(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?fS(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=e2(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function ki(e,t,n,s){e.addEventListener(t,n,s)}function X4(e,t,n,s){e.removeEventListener(t,n,s)}const qy=Symbol("_vei");function Z4(e,t,n,s,o=null){const i=e[qy]||(e[qy]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=J4(t);if(s){const c=i[t]=tE(s,o);ki(e,l,c,a)}else r&&(X4(e,l,r,a),i[t]=void 0)}}const jy=/(?:Once|Passive|Capture)$/;function J4(e){let t;if(jy.test(e)){t={};let s;for(;s=e.match(jy);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):As(e.slice(2)),t]}let Jp=0;const Q4=Promise.resolve(),eE=()=>Jp||(Q4.then(()=>Jp=0),Jp=Date.now());function tE(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(ot(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&So(c,t,5,l)}}else So(o,t,5,[s])};return n.value=e,n.attached=eE(),n}const zy=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,nE=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?j4(e,s,r):t==="style"?K4(e,n,s):Qc(t)?zf(t)||Z4(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):sE(e,t,s,r))?(Uy(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Wy(e,t,s,r,i,t!=="value")):e._isVueCE&&(oE(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Xt(s)))?Uy(e,Ln(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Wy(e,t,s,r))};function sE(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&zy(t)&&mt(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 o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return zy(t)&&Xt(n)?!1:t in e}function oE(e,t){const n=e._def.props;if(!n)return!1;const s=Ln(t);return Array.isArray(n)?n.some(o=>Ln(o)===s):Object.keys(n).some(o=>Ln(o)===s)}const Vy={};function iE(e,t,n){let s=Xe(e,t);Vf(s)&&(s=Kt({},s,t));class o extends H1{constructor(r){super(s,r,n)}}return o.def=s,o}const zde=((e,t)=>iE(e,t,_E)),rE=typeof HTMLElement<"u"?HTMLElement:class{};class H1 extends rE{constructor(t,n={},s=rf){super(),this._def=t,this._props=n,this._createApp=s,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&&s!==rf?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Kt({},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 H1){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,ut(()=>{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 s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!ot(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Fd(this._props[a])),(l||(l=Object.create(null)))[Ln(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!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 s in n)Wt(this,s)||Object.defineProperty(this,s,{get:()=>A(n[s])})}_resolveProps(t){const{props:n}=t,s=ot(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(Ln))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):Vy;const o=Ln(t);n&&this._numberProps&&this._numberProps[o]&&(s=Fd(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Vy?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(As(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(As(t),n+""):n||this.removeAttribute(As(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),bE(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=pt(this._def,Kt(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,Vf(r[0])?Kt({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),As(i)!==i&&o(As(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||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 s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.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,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[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 lE(e){const t=rs(),n=t&&t.ce;return n||null}function Vde(){const e=lE();return e&&e.shadowRoot}function Kde(e="$style"){{const t=rs();if(!t)return Mt;const n=t.type.__cssModules;if(!n)return Mt;const s=n[e];return s||Mt}}const kS=new WeakMap,bS=new WeakMap,nf=Symbol("_moveCb"),Ky=Symbol("_enterCb"),aE=e=>(delete e.props.mode,e),cE=aE({name:"TransitionGroup",props:Kt({},pS,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=rs(),s=I2();let o,i;return $1(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!hE(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(uE),o.forEach(dE);const l=o.filter(fE);pg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;zo(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[nf]=p=>{p&&p.target!==c||(!p||p.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[nf]=null,Gi(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=Nt(e),l=mS(r);let a=r.tag||Me;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),ar(u,Rc(u,l,s,n)),kS.set(u,_S(u.el)))}i=t.default?E1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&ar(u,Rc(u,l,s,n))}return pt(a,null,i)}}}),Gde=cE;function uE(e){const t=e.el;t[nf]&&t[nf](),t[Ky]&&t[Ky]()}function dE(e){bS.set(e,_S(e.el))}function fE(e){const t=kS.get(e),n=bS.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){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(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function _S(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function hE(e,t,n){const s=e.cloneNode(),o=e[aa];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=gS(s);return i.removeChild(s),r}const dr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ot(t)?n=>Vl(t,n):t};function pE(e){e.target.composing=!0}function Gy(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const _o=Symbol("_assign");function Yy(e,t,n){return t&&(e=e.trim()),n&&(e=Xf(e)),e}const _n={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[_o]=dr(o);const i=s||o.props&&o.props.type==="number";ki(e,t?"change":"input",r=>{r.target.composing||e[_o](Yy(e.value,n,i))}),(n||i)&&ki(e,"change",()=>{e.value=Yy(e.value,n,i)}),t||(ki(e,"compositionstart",pE),ki(e,"compositionend",Gy),ki(e,"change",Gy))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[_o]=dr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Xf(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"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},sf={deep:!0,created(e,t,n){e[_o]=dr(n),ki(e,"change",()=>{const s=e._modelValue,o=ca(e),i=e.checked,r=e[_o];if(ot(s)){const l=Jf(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(il(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(SS(e,i))})},mounted:Xy,beforeUpdate(e,t,n){e[_o]=dr(n),Xy(e,t,n)}};function Xy(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(ot(t))o=Jf(t,s.props.value)>-1;else if(il(t))o=t.has(s.props.value);else{if(t===n)return;o=xi(t,SS(e,!0))}e.checked!==o&&(e.checked=o)}const wS={created(e,{value:t},n){e.checked=xi(t,n.props.value),e[_o]=dr(n),ki(e,"change",()=>{e[_o](ca(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[_o]=dr(s),t!==n&&(e.checked=xi(t,s.props.value))}},of={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=il(t);ki(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Xf(ca(r)):ca(r));e[_o](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,ut(()=>{e._assigning=!1})}),e[_o]=dr(s)},mounted(e,{value:t}){Zy(e,t)},beforeUpdate(e,t,n){e[_o]=dr(n)},updated(e,{value:t}){e._assigning||Zy(e,t)}};function Zy(e,t){const n=e.multiple,s=ot(t);if(!(n&&!s&&!il(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=ca(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Jf(t,l)>-1}else r.selected=t.has(l);else if(xi(ca(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ca(e){return"_value"in e?e._value:e.value}function SS(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const mE={created(e,t,n){Xu(e,t,n,null,"created")},mounted(e,t,n){Xu(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Xu(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Xu(e,t,n,s,"updated")}};function CS(e,t){switch(e){case"SELECT":return of;case"TEXTAREA":return _n;default:switch(t){case"checkbox":return sf;case"radio":return wS;default:return _n}}}function Xu(e,t,n,s,o){const r=CS(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function gE(){_n.getSSRProps=({value:e})=>({value:e}),wS.getSSRProps=({value:e},t)=>{if(t.props&&xi(t.props.value,e))return{checked:!0}},sf.getSSRProps=({value:e},t)=>{if(ot(e)){if(t.props&&Jf(e,t.props.value)>-1)return{checked:!0}}else if(il(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},mE.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=CS(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const vE=["ctrl","shift","alt","meta"],yE={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)=>vE.some(n=>e[`${n}Key`]&&!t.includes(n))},Ye=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=yE[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},kE={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Io=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=As(o.key);if(t.some(r=>r===i||kE[r]===i))return e(o)}))},xS=Kt({patchProp:nE},H4);let gc,Jy=!1;function TS(){return gc||(gc=k4(xS))}function AS(){return gc=Jy?gc:b4(xS),Jy=!0,gc}const bE=((...e)=>{TS().render(...e)}),Yde=((...e)=>{AS().hydrate(...e)}),rf=((...e)=>{const t=TS().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=ES(s);if(!o)return;const i=t._component;!mt(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,MS(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),_E=((...e)=>{const t=AS().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=ES(s);if(o)return n(o,!0,MS(o))},t});function MS(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ES(e){return Xt(e)?document.querySelector(e):e}let Qy=!1;const Xde=()=>{Qy||(Qy=!0,gE(),z4())};/*!
21
- * shared v11.4.5
22
- * (c) 2026 kazuya kawaguchi
23
- * Released under the MIT License.
24
- */function wE(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const lf=typeof window<"u",vr=(e,t=!1)=>t?Symbol.for(e):Symbol(e),SE=(e,t,n)=>CE({l:e,k:t,s:n}),CE=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Cn=e=>typeof e=="number"&&isFinite(e),IS=e=>U1(e)==="[object Date]",ua=e=>U1(e)==="[object RegExp]",ah=e=>$t(e)&&Object.keys(e).length===0,Tn=Object.assign,xE=Object.create,Yt=(e=null)=>xE(e);let ek;const Gr=()=>ek||(ek=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Yt());function tk(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 TE(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 AE=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,ME=/^(?:href|src|action|formaction)$/i;function W1(e){return AE.test(e)}function EE(e){const t=/url\s*\(/gi;let n="",s=0,o;for(;(o=t.exec(e))!==null;){const i=o.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const p=e[l];if(c){p===c&&(c=null);continue}if(p==='"'||p==="'")c=p;else if(p==="(")a++;else if(p===")"&&(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(s,i),n+=W1(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function nk(e,t){if(ME.test(e)&&W1(t))return"about:blank";const n=e.toLowerCase()==="style"?EE(t):t;return TE(n)}function IE(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${nk(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${nk(s,o)}'`),/\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,s,o)=>W1(o)?`${s}about:blank`:n),e}const $E=Object.prototype.hasOwnProperty;function ko(e,t){return $E.call(e,t)}const vn=Array.isArray,cn=e=>typeof e=="function",nt=e=>typeof e=="string",Pt=e=>typeof e=="boolean",Bt=e=>e!==null&&typeof e=="object",NE=e=>Bt(e)&&cn(e.then)&&cn(e.catch),$S=Object.prototype.toString,U1=e=>$S.call(e),$t=e=>U1(e)==="[object Object]",LE=e=>e==null?"":vn(e)||$t(e)&&e.toString===$S?JSON.stringify(e,null,2):String(e);function q1(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Zu=e=>!Bt(e)||vn(e);function Sd(e,t){if(Zu(e)||Zu(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{i!=="__proto__"&&(Bt(s[i])&&!Bt(o[i])&&(o[i]=Array.isArray(s[i])?[]:Yt()),Zu(o[i])||Zu(s[i])?o[i]=s[i]:n.push({src:s[i],des:o[i]}))})}}/*!
25
- * message-compiler v11.4.5
26
- * (c) 2026 kazuya kawaguchi
27
- * Released under the MIT License.
28
- */function RE(e,t,n){return{line:e,column:t,offset:n}}function gg(e,t,n){return{start:e,end:t}}const qt={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},OE=17;function ch(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=s,l}function PE(e){throw e}const qo=" ",DE="\r",Qn=`
29
- `,BE="\u2028",FE="\u2029";function HE(e){const t=e;let n=0,s=1,o=1,i=0;const r=E=>t[E]===DE&&t[E+1]===Qn,l=E=>t[E]===Qn,a=E=>t[E]===FE,c=E=>t[E]===BE,u=E=>r(E)||l(E)||a(E)||c(E),d=()=>n,p=()=>s,m=()=>o,f=()=>i,g=E=>r(E)||a(E)||c(E)?Qn:t[E],w=()=>g(n),b=()=>g(n+i);function _(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function y(){n=0,s=1,o=1,i=0}function k(E=0){i=E}function T(){const E=n+i;for(;E!==n;)_();i=0}return{index:d,line:p,column:m,peekOffset:f,charAt:g,currentChar:w,currentPeek:b,next:_,peek:v,reset:y,resetPeek:k,skipToPeek:T}}const hi=void 0,WE=".",sk="'",UE="tokenizer";function qE(e,t={}){const n=t.location!==!1,s=HE(e),o=()=>s.index(),i=()=>RE(s.line(),s.column(),s.index()),r=i(),l=o(),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(q,X,de,...he){const ke=c();if(X.column+=de,X.offset+=de,u){const Ce=n?gg(ke.startLoc,X):null,ae=ch(q,Ce,{domain:UE,args:he});u(ae)}}function p(q,X,de){q.endLoc=i(),q.currentType=X;const he={type:X};return n&&(he.loc=gg(q.startLoc,q.endLoc)),de!=null&&(he.value=de),he}const m=q=>p(q,13);function f(q,X){return q.currentChar()===X?(q.next(),X):(d(qt.EXPECTED_TOKEN,i(),0,X),"")}function g(q){let X="";for(;q.currentPeek()===qo||q.currentPeek()===Qn;)X+=q.currentPeek(),q.peek();return X}function w(q){const X=g(q);return q.skipToPeek(),X}function b(q){if(q===hi)return!1;const X=q.charCodeAt(0);return X>=97&&X<=122||X>=65&&X<=90||X===95}function _(q){if(q===hi)return!1;const X=q.charCodeAt(0);return X>=48&&X<=57}function v(q,X){const{currentType:de}=X;if(de!==2)return!1;g(q);const he=b(q.currentPeek());return q.resetPeek(),he}function y(q,X){const{currentType:de}=X;if(de!==2)return!1;g(q);const he=q.currentPeek()==="-"?q.peek():q.currentPeek(),ke=_(he);return q.resetPeek(),ke}function k(q,X){const{currentType:de}=X;if(de!==2)return!1;g(q);const he=q.currentPeek()===sk;return q.resetPeek(),he}function T(q,X){const{currentType:de}=X;if(de!==7)return!1;g(q);const he=q.currentPeek()===".";return q.resetPeek(),he}function E(q,X){const{currentType:de}=X;if(de!==8)return!1;g(q);const he=b(q.currentPeek());return q.resetPeek(),he}function C(q,X){const{currentType:de}=X;if(!(de===7||de===11))return!1;g(q);const he=q.currentPeek()===":";return q.resetPeek(),he}function M(q,X){const{currentType:de}=X;if(de!==9)return!1;const he=()=>{const Ce=q.currentPeek();return Ce==="{"?b(q.peek()):Ce==="@"||Ce==="|"||Ce===":"||Ce==="."||Ce===qo||!Ce?!1:Ce===Qn?(q.peek(),he()):L(q,!1)},ke=he();return q.resetPeek(),ke}function $(q){g(q);const X=q.currentPeek()==="|";return q.resetPeek(),X}function L(q,X=!0){const de=(ke=!1,Ce="")=>{const ae=q.currentPeek();return ae==="{"||ae==="@"||!ae?ke:ae==="|"?!(Ce===qo||Ce===Qn):ae===qo?(q.peek(),de(!0,qo)):ae===Qn?(q.peek(),de(!0,Qn)):!0},he=de();return X&&q.resetPeek(),he}function D(q,X){const de=q.currentChar();return de===hi?hi:X(de)?(q.next(),de):null}function R(q){const X=q.charCodeAt(0);return X>=97&&X<=122||X>=65&&X<=90||X>=48&&X<=57||X===95||X===36}function P(q){return D(q,R)}function O(q){const X=q.charCodeAt(0);return X>=97&&X<=122||X>=65&&X<=90||X>=48&&X<=57||X===95||X===36||X===45}function W(q){return D(q,O)}function V(q){const X=q.charCodeAt(0);return X>=48&&X<=57}function z(q){return D(q,V)}function se(q){const X=q.charCodeAt(0);return X>=48&&X<=57||X>=65&&X<=70||X>=97&&X<=102}function Q(q){return D(q,se)}function me(q){let X="",de="";for(;X=z(q);)de+=X;return de}function $e(q){let X="";for(;;){const de=q.currentChar();if(de==="\\"){const he=q.peek();he==="{"||he==="}"||he==="@"||he==="|"||he==="\\"?(X+=de+he,q.next(),q.next()):(q.resetPeek(),X+=de,q.next())}else{if(de==="{"||de==="}"||de==="@"||de==="|"||!de)break;if(de===qo||de===Qn)if(L(q))X+=de,q.next();else{if($(q))break;X+=de,q.next()}else X+=de,q.next()}}return X}function He(q){w(q);let X="",de="";for(;X=W(q);)de+=X;const he=q.currentChar();if(he&&he!=="}"&&he!==hi&&he!==qo&&he!==Qn&&he!==" "){const ke=G(q);return d(qt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,de+ke),de+ke}return q.currentChar()===hi&&d(qt.UNTERMINATED_CLOSING_BRACE,i(),0),de}function Be(q){w(q);let X="";return q.currentChar()==="-"?(q.next(),X+=`-${me(q)}`):X+=me(q),q.currentChar()===hi&&d(qt.UNTERMINATED_CLOSING_BRACE,i(),0),X}function Ee(q){return q!==sk&&q!==Qn}function te(q){w(q),f(q,"'");let X="",de="";for(;X=D(q,Ee);)X==="\\"?de+=ee(q):de+=X;const he=q.currentChar();return he===Qn||he===hi?(d(qt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),he===Qn&&(q.next(),f(q,"'")),de):(f(q,"'"),de)}function ee(q){const X=q.currentChar();switch(X){case"\\":case"'":return q.next(),`\\${X}`;case"u":return Z(q,X,4);case"U":return Z(q,X,6);default:return d(qt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,X),""}}function Z(q,X,de){f(q,X);let he="";for(let ke=0;ke<de;ke++){const Ce=Q(q);if(!Ce){d(qt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${X}${he}${q.currentChar()}`);break}he+=Ce}return`\\${X}${he}`}function Ae(q){return q!=="{"&&q!=="}"&&q!==qo&&q!==Qn}function G(q){w(q);let X="",de="";for(;X=D(q,Ae);)de+=X;return de}function oe(q){let X="",de="";for(;X=P(q);)de+=X;return de}function J(q){const X=de=>{const he=q.currentChar();return he==="{"||he==="@"||he==="|"||he==="("||he===")"||!he||he===qo?de:(de+=he,q.next(),X(de))};return X("")}function F(q){w(q);const X=f(q,"|");return w(q),X}function Y(q,X){let de=null;switch(q.currentChar()){case"{":return X.braceNest>=1&&d(qt.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),q.next(),de=p(X,2,"{"),w(q),X.braceNest++,de;case"}":return X.braceNest>0&&X.currentType===2&&d(qt.EMPTY_PLACEHOLDER,i(),0),q.next(),de=p(X,3,"}"),X.braceNest--,X.braceNest>0&&w(q),X.inLinked&&X.braceNest===0&&(X.inLinked=!1),de;case"@":return X.braceNest>0&&d(qt.UNTERMINATED_CLOSING_BRACE,i(),0),de=le(q,X)||m(X),X.braceNest=0,de;default:{let ke=!0,Ce=!0,ae=!0;if($(q))return X.braceNest>0&&d(qt.UNTERMINATED_CLOSING_BRACE,i(),0),de=p(X,1,F(q)),X.braceNest=0,X.inLinked=!1,de;if(X.braceNest>0&&(X.currentType===4||X.currentType===5||X.currentType===6))return d(qt.UNTERMINATED_CLOSING_BRACE,i(),0),X.braceNest=0,re(q,X);if(ke=v(q,X))return de=p(X,4,He(q)),w(q),de;if(Ce=y(q,X))return de=p(X,5,Be(q)),w(q),de;if(ae=k(q,X))return de=p(X,6,te(q)),w(q),de;if(!ke&&!Ce&&!ae)return de=p(X,12,G(q)),d(qt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,de.value),w(q),de;break}}return de}function le(q,X){const{currentType:de}=X;let he=null;const ke=q.currentChar();switch((de===7||de===8||de===11||de===9)&&(ke===Qn||ke===qo)&&d(qt.INVALID_LINKED_FORMAT,i(),0),ke){case"@":return q.next(),he=p(X,7,"@"),X.inLinked=!0,he;case".":return w(q),q.next(),p(X,8,".");case":":return w(q),q.next(),p(X,9,":");default:return $(q)?(he=p(X,1,F(q)),X.braceNest=0,X.inLinked=!1,he):T(q,X)||C(q,X)?(w(q),le(q,X)):E(q,X)?(w(q),p(X,11,oe(q))):M(q,X)?(w(q),ke==="{"?Y(q,X)||he:p(X,10,J(q))):(de===7&&d(qt.INVALID_LINKED_FORMAT,i(),0),X.braceNest=0,X.inLinked=!1,re(q,X))}}function re(q,X){let de={type:13};if(X.braceNest>0)return Y(q,X)||m(X);if(X.inLinked)return le(q,X)||m(X);switch(q.currentChar()){case"{":return Y(q,X)||m(X);case"}":return d(qt.UNBALANCED_CLOSING_BRACE,i(),0),q.next(),p(X,3,"}");case"@":return le(q,X)||m(X);default:{if($(q))return de=p(X,1,F(q)),X.braceNest=0,X.inLinked=!1,de;if(L(q))return p(X,0,$e(q));break}}return de}function fe(){const{currentType:q,offset:X,startLoc:de,endLoc:he}=a;return a.lastType=q,a.lastOffset=X,a.lastStartLoc=de,a.lastEndLoc=he,a.offset=o(),a.startLoc=i(),s.currentChar()===hi?p(a,13):re(s,a)}return{nextToken:fe,currentOffset:o,currentPosition:i,context:c}}const jE="parser",zE=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,VE=/\\([\\@{}|])/g;function KE(e,t){return t}function GE(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function YE(e={}){const t=e.location!==!1,{onError:n}=e;function s(b,_,v,y,...k){const T=b.currentPosition();if(T.offset+=y,T.column+=y,n){const E=t?gg(v,T):null,C=ch(_,E,{domain:jE,args:k});n(C)}}function o(b,_,v){const y={type:b};return t&&(y.start=_,y.end=_,y.loc={start:v,end:v}),y}function i(b,_,v,y){t&&(b.end=_,b.loc&&(b.loc.end=v))}function r(b,_){const v=b.context(),y=o(3,v.offset,v.startLoc);return y.value=_.replace(VE,KE),i(y,b.currentOffset(),b.currentPosition()),y}function l(b,_){const v=b.context(),{lastOffset:y,lastStartLoc:k}=v,T=o(5,y,k);return T.index=parseInt(_,10),b.nextToken(),i(T,b.currentOffset(),b.currentPosition()),T}function a(b,_){const v=b.context(),{lastOffset:y,lastStartLoc:k}=v,T=o(4,y,k);return T.key=_,b.nextToken(),i(T,b.currentOffset(),b.currentPosition()),T}function c(b,_){const v=b.context(),{lastOffset:y,lastStartLoc:k}=v,T=o(9,y,k);return T.value=_.replace(zE,GE),b.nextToken(),i(T,b.currentOffset(),b.currentPosition()),T}function u(b){const _=b.nextToken(),v=b.context(),{lastOffset:y,lastStartLoc:k}=v,T=o(8,y,k);return _.type!==11?(s(b,qt.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),T.value="",i(T,y,k),{nextConsumeToken:_,node:T}):(_.value==null&&s(b,qt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,jo(_)),T.value=_.value||"",i(T,b.currentOffset(),b.currentPosition()),{node:T})}function d(b,_){const v=b.context(),y=o(7,v.offset,v.startLoc);return y.value=_,i(y,b.currentOffset(),b.currentPosition()),y}function p(b){const _=b.context(),v=o(6,_.offset,_.startLoc);let y=b.nextToken();if(y.type===8){const k=u(b);v.modifier=k.node,y=k.nextConsumeToken||b.nextToken()}switch(y.type!==9&&s(b,qt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,jo(y)),y=b.nextToken(),y.type===2&&(y=b.nextToken()),y.type){case 10:y.value==null&&s(b,qt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,jo(y)),v.key=d(b,y.value||"");break;case 4:y.value==null&&s(b,qt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,jo(y)),v.key=a(b,y.value||"");break;case 5:y.value==null&&s(b,qt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,jo(y)),v.key=l(b,y.value||"");break;case 6:y.value==null&&s(b,qt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,jo(y)),v.key=c(b,y.value||"");break;default:{s(b,qt.UNEXPECTED_EMPTY_LINKED_KEY,_.lastStartLoc,0);const k=b.context(),T=o(7,k.offset,k.startLoc);return T.value="",i(T,k.offset,k.startLoc),v.key=T,i(v,k.offset,k.startLoc),{nextConsumeToken:y,node:v}}}return i(v,b.currentOffset(),b.currentPosition()),{node:v}}function m(b){const _=b.context(),v=_.currentType===1?b.currentOffset():_.offset,y=_.currentType===1?_.endLoc:_.startLoc,k=o(2,v,y);k.items=[];let T=null;do{const M=T||b.nextToken();switch(T=null,M.type){case 0:M.value==null&&s(b,qt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,jo(M)),k.items.push(r(b,M.value||""));break;case 5:M.value==null&&s(b,qt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,jo(M)),k.items.push(l(b,M.value||""));break;case 4:M.value==null&&s(b,qt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,jo(M)),k.items.push(a(b,M.value||""));break;case 6:M.value==null&&s(b,qt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,jo(M)),k.items.push(c(b,M.value||""));break;case 7:{const $=p(b);k.items.push($.node),T=$.nextConsumeToken||null;break}}}while(_.currentType!==13&&_.currentType!==1);const E=_.currentType===1?_.lastOffset:b.currentOffset(),C=_.currentType===1?_.lastEndLoc:b.currentPosition();return i(k,E,C),k}function f(b,_,v,y){const k=b.context();let T=y.items.length===0;const E=o(1,_,v);E.cases=[],E.cases.push(y);do{const C=m(b);T||(T=C.items.length===0),E.cases.push(C)}while(k.currentType!==13);return T&&s(b,qt.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i(E,b.currentOffset(),b.currentPosition()),E}function g(b){const _=b.context(),{offset:v,startLoc:y}=_,k=m(b);return _.currentType===13?k:f(b,v,y,k)}function w(b){const _=qE(b,Tn({},e)),v=_.context(),y=o(0,v.offset,v.startLoc);return t&&y.loc&&(y.loc.source=b),y.body=g(_),e.onCacheKey&&(y.cacheKey=e.onCacheKey(b)),v.currentType!==13&&s(_,qt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,b[v.offset]||""),i(y,_.currentOffset(),_.currentPosition()),y}return{parse:w}}function jo(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 XE(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function ok(e,t){for(let n=0;n<e.length;n++)j1(e[n],t)}function j1(e,t){switch(e.type){case 1:ok(e.cases,t),t.helper("plural");break;case 2:ok(e.items,t);break;case 6:{j1(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 ZE(e,t={}){const n=XE(e);n.helper("normalize"),e.body&&j1(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function JE(e){const t=e.body;return t.type===2?ik(t):t.cases.forEach(n=>ik(n)),e}function ik(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 s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=q1(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}function Bl(e){switch(e.t=e.type,e.type){case 0:{const t=e;Bl(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)Bl(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)Bl(n[s]);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;Bl(t.key),t.k=t.key,delete t.key,t.modifier&&(Bl(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 QE(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(g,w){r.code+=g}function c(g,w=!0){const b=w?s:"";a(o?b+" ".repeat(g):b)}function u(g=!0){const w=++r.indentLevel;g&&c(w)}function d(g=!0){const w=--r.indentLevel;g&&c(w)}function p(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:p,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function eI(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),da(e,t.key),t.modifier?(e.push(", "),da(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function tI(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(da(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function nI(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(da(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function sI(e,t){t.body?da(e,t.body):e.push("null")}function da(e,t){const{helper:n}=e;switch(t.type){case 0:sI(e,t);break;case 1:nI(e,t);break;case 2:tI(e,t);break;case 6:eI(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 oI=(e,t={})=>{const n=nt(t.mode)?t.mode:"normal",s=nt(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
30
- `,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=QE(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${q1(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),da(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 iI(e,t={}){const n=Tn({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=YE(n).parse(e);return s?(i&&JE(l),o&&Bl(l),{ast:l,code:""}):(ZE(l,n),oI(l,n))}/*!
31
- * core-base v11.4.5
32
- * (c) 2026 kazuya kawaguchi
33
- * Released under the MIT License.
34
- */function rI(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Gr().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Gr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Jo(e){return Bt(e)&&z1(e)===0&&(ko(e,"b")||ko(e,"body"))}const NS=["b","body"];function lI(e){return yr(e,NS)}const LS=["c","cases"];function aI(e){return yr(e,LS,[])}const RS=["s","static"];function cI(e){return yr(e,RS)}const OS=["i","items"];function uI(e){return yr(e,OS,[])}const PS=["t","type"];function z1(e){return yr(e,PS)}const DS=["v","value"];function Ju(e,t){const n=yr(e,DS);if(n!=null)return n;throw Bc(t)}const BS=["m","modifier"];function dI(e){return yr(e,BS)}const FS=["k","key"];function fI(e){const t=yr(e,FS);if(t)return t;throw Bc(6)}function yr(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(ko(e,o)&&e[o]!=null)return e[o]}return n}const HS=[...NS,...LS,...RS,...OS,...FS,...BS,...DS,...PS];function Bc(e){return new Error(`unhandled node type: ${e}`)}function Qp(e){return n=>hI(n,e)}function hI(e,t){const n=lI(t);if(n==null)throw Bc(0);if(z1(n)===1){const i=aI(n);return e.plural(i.reduce((r,l)=>[...r,rk(e,l)],[]))}else return rk(e,n)}function rk(e,t){const n=cI(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=uI(t).reduce((o,i)=>[...o,vg(e,i)],[]);return e.normalize(s)}}function vg(e,t){const n=z1(t);switch(n){case 3:return Ju(t,n);case 9:return Ju(t,n);case 4:{const s=t;if(ko(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(ko(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Bc(n)}case 5:{const s=t;if(ko(s,"i")&&Cn(s.i))return e.interpolate(e.list(s.i));if(ko(s,"index")&&Cn(s.index))return e.interpolate(e.list(s.index));throw Bc(n)}case 6:{const s=t,o=dI(s),i=fI(s);return e.linked(vg(e,i),o?vg(e,o):void 0,e.type)}case 7:return Ju(t,n);case 8:return Ju(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const pI=e=>e;let Qu=Yt();function mI(e,t={}){let n=!1;const s=t.onError||PE;return t.onError=o=>{n=!0,s(o)},{...iI(e,t),detectError:n}}function gI(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&nt(e)){Pt(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||pI)(e),o=Qu[s];if(o)return o;const{ast:i,detectError:r}=mI(e,{...t,location:!1,jit:!0}),l=Qp(i);return r?l:Qu[s]=l}else{const n=e.cacheKey;if(n){const s=Qu[n];return s||(Qu[n]=Qp(e))}else return Qp(e)}}let Fc=null;function vI(e){Fc=e}function yI(e,t,n){Fc&&Fc.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const kI=bI("function:translate");function bI(e){return t=>Fc&&Fc.emit(e,t)}const bi={INVALID_ARGUMENT:OE,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},_I=24;function _i(e){return ch(e,null,void 0)}function V1(e,t){return t.locale!=null?lk(t.locale):lk(e.locale)}let em;function lk(e){if(nt(e))return e;if(cn(e)){if(e.resolvedOnce&&em!=null)return em;if(e.constructor.name==="Function"){const t=e();if(NE(t))throw _i(bi.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return em=t}else throw _i(bi.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw _i(bi.NOT_SUPPORT_LOCALE_TYPE)}function wI(e,t,n){return[...new Set([n,...vn(t)?t:Bt(t)?Object.keys(t):nt(t)?[t]:[n]])]}function yg(e,t,n){const s=nt(n)?n:Hc,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;vn(r);)r=ak(i,r,t);const l=vn(t)||!$t(t)?t:t.default?t.default:null;r=nt(l)?[l]:l,vn(r)&&ak(i,r,!1),o.__localeChainCache.set(s,i)}return i}function ak(e,t,n){let s=!0;for(let o=0;o<t.length&&Pt(s);o++){const i=t[o];nt(i)&&(s=SI(e,t[o],n))}return s}function SI(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=CI(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function CI(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(vn(n)||$t(n))&&n[o]&&(s=n[o])}return s}const kr=[];kr[0]={w:[0],i:[3,0],"[":[4],o:[7]};kr[1]={w:[1],".":[2],"[":[4],o:[7]};kr[2]={w:[2],i:[3,0],0:[3,0]};kr[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};kr[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};kr[5]={"'":[4,0],o:8,l:[5,0]};kr[6]={'"':[4,0],o:8,l:[6,0]};const xI=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function TI(e){return xI.test(e)}function AI(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 MI(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 EI(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:TI(t)?AI(t):"*"+t}function II(e){const t=[];let n=-1,s=0,o=0,i,r,l,a,c,u,d;const p=[];p[0]=()=>{r===void 0?r=l:r+=l},p[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},p[2]=()=>{p[0](),o++},p[3]=()=>{if(o>0)o--,s=4,p[0]();else{if(o=0,r===void 0||(r=EI(r),r===!1))return!1;p[1]()}};function m(){const f=e[n+1];if(s===5&&f==="'"||s===6&&f==='"')return n++,l="\\"+f,p[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&m())){if(a=MI(i),d=kr[s],c=d[a]||d.l||8,c===8||(s=c[0],c[1]!==void 0&&(u=p[c[1]],u&&(l=i,u()===!1))))return;if(s===7)return t}}const ck=new Map;function $I(e,t){return Bt(e)?e[t]:null}function NI(e,t){if(!Bt(e))return null;let n=ck.get(t);if(n||(n=II(t),n&&ck.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(HS.includes(r)&&Jo(o)||!Bt(o)||!ko(o,r))return null;const l=o[r];if(l===void 0||cn(o))return null;o=l,i++}return o}const LI="11.4.5",uh=-1,Hc="en-US",af="",uk=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function RI(){return{upper:(e,t)=>t==="text"&&nt(e)?e.toUpperCase():t==="vnode"&&Bt(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&nt(e)?e.toLowerCase():t==="vnode"&&Bt(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&nt(e)?uk(e):t==="vnode"&&Bt(e)&&"__v_isVNode"in e?uk(e.children):e}}let WS;function OI(e){WS=e}let US;function PI(e){US=e}let qS;function DI(e){qS=e}let jS=null;const BI=e=>{jS=e},FI=()=>jS;let zS=null;const dk=e=>{zS=e},HI=()=>zS;let fk=0;function WI(e={}){const t=cn(e.onWarn)?e.onWarn:wE,n=nt(e.version)?e.version:LI,s=nt(e.locale)||cn(e.locale)?e.locale:Hc,o=cn(s)?Hc:s,i=vn(e.fallbackLocale)||$t(e.fallbackLocale)||nt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=$t(e.messages)?e.messages:tm(o),l=$t(e.datetimeFormats)?e.datetimeFormats:tm(o),a=$t(e.numberFormats)?e.numberFormats:tm(o),c=Tn(Yt(),e.modifiers,RI()),u=e.pluralRules||Yt(),d=cn(e.missing)?e.missing:null,p=Pt(e.missingWarn)||ua(e.missingWarn)?e.missingWarn:!0,m=Pt(e.fallbackWarn)||ua(e.fallbackWarn)?e.fallbackWarn:!0,f=!!e.fallbackFormat,g=!!e.unresolving,w=cn(e.postTranslation)?e.postTranslation:null,b=$t(e.processor)?e.processor:null,_=Pt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=cn(e.messageCompiler)?e.messageCompiler:WS,k=cn(e.messageResolver)?e.messageResolver:US||$I,T=cn(e.localeFallbacker)?e.localeFallbacker:qS||wI,E=Bt(e.fallbackContext)?e.fallbackContext:void 0,C=e,M=Bt(C.__datetimeFormatters)?C.__datetimeFormatters:new Map,$=Bt(C.__numberFormatters)?C.__numberFormatters:new Map,L=Bt(C.__meta)?C.__meta:{};fk++;const D={version:n,cid:fk,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:p,fallbackWarn:m,fallbackFormat:f,unresolving:g,postTranslation:w,processor:b,warnHtmlMessage:_,escapeParameter:v,messageCompiler:y,messageResolver:k,localeFallbacker:T,fallbackContext:E,onWarn:t,__meta:L};return D.datetimeFormats=l,D.numberFormats=a,D.__datetimeFormatters=M,D.__numberFormatters=$,__INTLIFY_PROD_DEVTOOLS__&&yI(D,n,L),D}const tm=e=>({[e]:Yt()});function K1(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return nt(l)?l:t}else return t}function Ya(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function UI(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function qI(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(UI(e,t[s]))return!0;return!1}function hk(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!nt(t[0])&&!IS(t[0])&&!Cn(t[0]))return af;const[a,c,u,d]=kg(...t),p=Pt(u.missingWarn)?u.missingWarn:e.missingWarn;Pt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,f=V1(e,u),g=r(e,o,f);if(!nt(a)||a===""){const T=new Intl.DateTimeFormat(f.replace(/!/g,""),d);return m?T.formatToParts(c):T.format(c)}let w={},b,_=null;const v="datetime format";for(let T=0;T<g.length&&(b=g[T],w=n[b]||{},_=w[a],!$t(_));T++)K1(e,a,b,p,v);if(!$t(_)||!nt(b))return s?uh:a;let y=`${b}__${a}`;ah(d)||(y=`${y}__${JSON.stringify(d)}`);let k=l.get(y);return k||(k=new Intl.DateTimeFormat(b,Tn({},_,d)),l.set(y,k)),m?k.formatToParts(c):k.format(c)}const VS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function kg(...e){const[t,n,s,o]=e,i=Yt();let r=Yt(),l;if(nt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw _i(bi.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 _i(bi.INVALID_ISO_DATE_ARGUMENT)}}else if(IS(t)){if(isNaN(t.getTime()))throw _i(bi.INVALID_DATE_ARGUMENT);l=t}else if(Cn(t))l=t;else throw _i(bi.INVALID_ARGUMENT);return nt(n)?i.key=n:$t(n)&&Object.keys(n).forEach(a=>{VS.includes(a)?r[a]=n[a]:i[a]=n[a]}),nt(s)?i.locale=s:$t(s)&&(r=s),$t(o)&&(r=o),[i.key||"",l,i,r]}function pk(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function mk(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!Cn(t[0]))return af;const[a,c,u,d]=bg(...t),p=Pt(u.missingWarn)?u.missingWarn:e.missingWarn;Pt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,f=V1(e,u),g=r(e,o,f);if(!nt(a)||a===""){const T=new Intl.NumberFormat(f.replace(/!/g,""),d);return m?T.formatToParts(c):T.format(c)}let w={},b,_=null;const v="number format";for(let T=0;T<g.length&&(b=g[T],w=n[b]||{},_=w[a],!$t(_));T++)K1(e,a,b,p,v);if(!$t(_)||!nt(b))return s?uh:a;let y=`${b}__${a}`;ah(d)||(y=`${y}__${JSON.stringify(d)}`);let k=l.get(y);return k||(k=new Intl.NumberFormat(b,Tn({},_,d)),l.set(y,k)),m?k.formatToParts(c):k.format(c)}const KS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function bg(...e){const[t,n,s,o]=e,i=Yt();let r=Yt();if(!Cn(t))throw _i(bi.INVALID_ARGUMENT);const l=t;return nt(n)?i.key=n:$t(n)&&Object.keys(n).forEach(a=>{KS.includes(a)?r[a]=n[a]:i[a]=n[a]}),nt(s)?i.locale=s:$t(s)&&(r=s),$t(o)&&(r=o),[i.key||"",l,i,r]}function gk(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const jI=e=>e,zI=e=>"",VI="text",KI=e=>e.length===0?"":q1(e),GI=LE;function nm(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function YI(e){const t=Cn(e.pluralIndex)?e.pluralIndex:-1;return Cn(e.named?.count)?e.named.count:Cn(e.named?.n)?e.named.n:t}function XI(e={}){const t=e.locale,n=YI(e),s=nt(t)&&cn(e.pluralRules?.[t])?e.pluralRules[t]:nm,o=s===nm?void 0:nm,i=b=>b[s(n,b.length,o)],r=e.list||[],l=b=>r[b],a=e.named||Yt();Cn(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=b=>a[b];function u(b,_){const v=cn(e.messages)?e.messages(b,!!_):Bt(e.messages)?e.messages[b]:!1;return v||(e.parent?e.parent.message(b):zI)}const d=b=>e.modifiers?e.modifiers[b]:jI,p=cn(e.processor?.normalize)?e.processor.normalize:KI,m=cn(e.processor?.interpolate)?e.processor.interpolate:GI,f=nt(e.processor?.type)?e.processor.type:VI,w={list:l,named:c,plural:i,linked:(b,..._)=>{const[v,y]=_;let k="text",T="";_.length===1?Bt(v)?(T=v.modifier||T,k=v.type||k):nt(v)&&(T=v||T):_.length===2&&(nt(v)&&(T=v||T),nt(y)&&(k=y||k));const E=u(b,!0)(w),C=E===""||E===void 0?b:E,M=k==="vnode"&&vn(C)&&T?C[0]:C;return T?d(T)(M,k):M},message:u,type:f,interpolate:m,normalize:p,values:Tn(Yt(),r,a)};return w}const vk=()=>"",go=e=>cn(e);function yk(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=_g(...t),u=Pt(c.missingWarn)?c.missingWarn:e.missingWarn,d=Pt(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,p=Pt(c.escapeParameter)?c.escapeParameter:e.escapeParameter,m=!!c.resolvedMessage,f=nt(c.default)||Pt(c.default)?Pt(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,g=n||f!=null&&(nt(f)||cn(f)),w=V1(e,c);p&&ZI(c);let[b,_,v]=m?[a,w,l[w]||Yt()]:GS(e,a,w,r,d,u),y=b,k=a;if(!m&&!(nt(y)||Jo(y)||go(y))&&g&&(y=f,k=y),!m&&(!(nt(y)||Jo(y)||go(y))||!nt(_)))return o?uh:a;let T=!1;const E=()=>{T=!0},C=go(y)?y:YS(e,a,_,y,k,E);if(T)return y;const M=e6(e,_,v,c),$=XI(M),L=JI(e,C,$);let D=s?s(L,a):L;if(p&&nt(D)&&(D=IE(D)),__INTLIFY_PROD_DEVTOOLS__){const R={timestamp:Date.now(),key:nt(a)?a:go(y)?y.key:"",locale:_||(go(y)?y.locale:""),format:nt(y)?y:go(y)?y.source:"",message:D};R.meta=Tn({},e.__meta,FI()||{}),kI(R)}return D}function ZI(e){vn(e.list)?e.list=e.list.map(t=>nt(t)?tk(t):t):Bt(e.named)&&Object.keys(e.named).forEach(t=>{nt(e.named[t])&&(e.named[t]=tk(e.named[t]))})}function GS(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=Yt(),p,m=null;const f="translate";for(let g=0;g<u.length&&(p=u[g],d=r[p]||Yt(),(m=a(d,t))===null&&(m=d[t]),!(nt(m)||Jo(m)||go(m)));g++)if(!qI(p,u)){const w=K1(e,t,p,i,f);w!==t&&(m=w)}return[m,p,d]}function YS(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(go(s)){const c=s;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>s);return c.locale=n,c.key=t,c}const a=r(s,QI(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function JI(e,t,n){return t(n)}function _g(...e){const[t,n,s]=e,o=Yt();if(!nt(t)&&!Cn(t)&&!go(t)&&!Jo(t))throw _i(bi.INVALID_ARGUMENT);const i=Cn(t)?String(t):(go(t),t);return Cn(n)?o.plural=n:nt(n)?o.default=n:$t(n)&&!ah(n)?o.named=n:vn(n)&&(o.list=n),Cn(s)?o.plural=s:nt(s)?o.default=s:$t(s)&&Tn(o,s),[i,o]}function QI(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>SE(t,n,r)}}function e6(e,t,n,s){const{modifiers:o,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,p={locale:t,modifiers:o,pluralRules:i,messages:(m,f)=>{let g=r(n,m);if(g==null&&(u||f)){const[w,,b]=GS(u||e,m,t,l,a,c);g=w??r(b,m)}if(nt(g)||Jo(g)){let w=!1;const _=YS(e,m,t,g,m,()=>{w=!0});return w?vk:_}else return go(g)?g:vk}};return e.processor&&(p.processor=e.processor),s.list&&(p.list=s.list),s.named&&(p.named=s.named),Cn(s.plural)&&(p.pluralIndex=s.plural),p}rI();/*!
35
- * vue-i18n v11.4.5
36
- * (c) 2026 kazuya kawaguchi
37
- * Released under the MIT License.
38
- */const t6="11.4.5";function n6(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Gr().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Gr().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Gr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Gr().__INTLIFY_PROD_DEVTOOLS__=!1)}const ms={UNEXPECTED_RETURN_TYPE:_I,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 Ms(e,...t){return ch(e,null,void 0)}const wg=vr("__translateVNode"),Sg=vr("__datetimeParts"),Cg=vr("__numberParts"),XS=vr("__setPluralRules"),ZS=vr("__injectWithOption"),Wl=vr("__dispose");function Wc(e){if(!Bt(e)||Jo(e))return e;for(const t in e)if(ko(e,t))if(!t.includes("."))Bt(e[t])&&Wc(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=Yt()),!Bt(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(Jo(o)?HS.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!Jo(o)){const r=o[n[s]];Bt(r)&&Wc(r)}}return e}function G1(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=$t(n)?n:vn(s)?Yt():{[e]:Yt()};if(vn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Yt(),Sd(c,r[a])):Sd(c,r)}else nt(l)&&Sd(JSON.parse(l),r)}),o==null&&i)for(const l in r)ko(r,l)&&Wc(r[l]);return r}function JS(e){return e.type}function QS(e,t,n){let s=Bt(t.messages)?t.messages:Yt();"__i18nGlobal"in n&&(s=G1(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(Bt(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(Bt(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function kk(e){return pt(or,null,e,0)}function Uc(){return rs()}const bk="__INTLIFY_META__",_k=()=>[],s6=()=>!1;let wk=0;function Sk(e){return((t,n,s,o)=>e(n,s,Uc()||void 0,o))}const o6=()=>{const e=Uc();let t=null;return e&&(t=JS(e)[bk])?{[bk]:t}:null};function cf(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=lf?ie:rl;let r=Pt(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:nt(e.locale)?e.locale:Hc),a=i(t&&r?t.fallbackLocale.value:nt(e.fallbackLocale)||vn(e.fallbackLocale)||$t(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(G1(l.value,e)),u=i($t(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i($t(e.numberFormats)?e.numberFormats:{[l.value]:{}});let p=t?t.missingWarn:Pt(e.missingWarn)||ua(e.missingWarn)?e.missingWarn:!0,m=t?t.fallbackWarn:Pt(e.fallbackWarn)||ua(e.fallbackWarn)?e.fallbackWarn:!0,f=t?t.fallbackRoot:Pt(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,w=cn(e.missing)?e.missing:null,b=cn(e.missing)?Sk(e.missing):null,_=cn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:Pt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const k=t?t.modifiers:$t(e.modifiers)?e.modifiers:{};let T=e.pluralRules||t&&t.pluralRules,E;E=(()=>{s&&dk(null);const ae={version:t6,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:k,pluralRules:T,missing:b===null?void 0:b,missingWarn:p,fallbackWarn:m,fallbackFormat:g,unresolving:!0,postTranslation:_===null?void 0:_,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ae.datetimeFormats=u.value,ae.numberFormats=d.value,ae.__datetimeFormatters=$t(E)?E.__datetimeFormatters:void 0,ae.__numberFormatters=$t(E)?E.__numberFormatters:void 0;const _e=WI(ae);return s&&dk(_e),_e})(),Ya(E,l.value,a.value);function M(){return[l.value,a.value,c.value,u.value,d.value]}const $=U({get:()=>l.value,set:ae=>{E.locale=ae,l.value=ae}}),L=U({get:()=>a.value,set:ae=>{E.fallbackLocale=ae,a.value=ae,Ya(E,l.value,ae)}}),D=U(()=>c.value),R=U(()=>u.value),P=U(()=>d.value);function O(){return cn(_)?_:null}function W(ae){_=ae,E.postTranslation=ae}function V(){return w}function z(ae){ae!==null&&(b=Sk(ae)),w=ae,E.missing=b}const se=(ae,_e,ze,Qe,dt,Ge)=>{M();let ft;try{__INTLIFY_PROD_DEVTOOLS__,s||(E.fallbackContext=t?HI():void 0),ft=ae(E)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(E.fallbackContext=void 0)}if(ze!=="translate exists"&&Cn(ft)&&ft===uh||ze==="translate exists"&&!ft){const[Ct,Jt]=_e();return t&&f?Qe(t):dt(Ct)}else{if(Ge(ft))return ft;throw Ms(ms.UNEXPECTED_RETURN_TYPE)}};function Q(...ae){return se(_e=>Reflect.apply(yk,null,[_e,...ae]),()=>_g(...ae),"translate",_e=>Reflect.apply(_e.t,_e,[...ae]),_e=>_e,_e=>nt(_e))}function me(...ae){const[_e,ze,Qe]=ae;if(Qe&&!Bt(Qe))throw Ms(ms.INVALID_ARGUMENT);return Q(_e,ze,Tn({resolvedMessage:!0},Qe||{}))}function $e(...ae){return se(_e=>Reflect.apply(hk,null,[_e,...ae]),()=>kg(...ae),"datetime format",_e=>Reflect.apply(_e.d,_e,[...ae]),()=>af,_e=>nt(_e)||vn(_e))}function He(...ae){return se(_e=>Reflect.apply(mk,null,[_e,...ae]),()=>bg(...ae),"number format",_e=>Reflect.apply(_e.n,_e,[...ae]),()=>af,_e=>nt(_e)||vn(_e))}function Be(ae){return ae.map(_e=>nt(_e)||Cn(_e)||Pt(_e)?kk(String(_e)):_e)}const te={normalize:Be,interpolate:ae=>ae,type:"vnode"};function ee(...ae){return se(_e=>{let ze;const Qe=_e;try{Qe.processor=te,ze=Reflect.apply(yk,null,[Qe,...ae])}finally{Qe.processor=null}return ze},()=>_g(...ae),"translate",_e=>_e[wg](...ae),_e=>[kk(_e)],_e=>vn(_e))}function Z(...ae){return se(_e=>Reflect.apply(mk,null,[_e,...ae]),()=>bg(...ae),"number format",_e=>_e[Cg](...ae),_k,_e=>nt(_e)||vn(_e))}function Ae(...ae){return se(_e=>Reflect.apply(hk,null,[_e,...ae]),()=>kg(...ae),"datetime format",_e=>_e[Sg](...ae),_k,_e=>nt(_e)||vn(_e))}function G(ae){T=ae,E.pluralRules=T}function oe(ae,_e){return se(()=>{if(!ae)return!1;const ze=nt(_e)?_e:l.value,Qe=nt(_e)?[ze]:yg(E,a.value,ze);for(let dt=0;dt<Qe.length;dt++){const Ge=Y(Qe[dt]);let ft=E.messageResolver(Ge,ae);if(ft===null&&(ft=Ge[ae]),Jo(ft)||go(ft)||nt(ft))return!0}return!1},()=>[ae],"translate exists",ze=>Reflect.apply(ze.te,ze,[ae,_e]),s6,ze=>Pt(ze))}function J(ae){let _e=null;const ze=yg(E,a.value,l.value);for(let Qe=0;Qe<ze.length;Qe++){const dt=c.value[ze[Qe]]||{},Ge=E.messageResolver(dt,ae);if(Ge!=null){_e=Ge;break}}return _e}function F(ae){const _e=J(ae);return _e??(t?t.tm(ae)||{}:{})}function Y(ae){return c.value[ae]||{}}function le(ae,_e){if(o){const ze={[ae]:_e};for(const Qe in ze)ko(ze,Qe)&&Wc(ze[Qe]);_e=ze[ae]}c.value[ae]=_e,E.messages=c.value}function re(ae,_e){c.value[ae]=c.value[ae]||{};const ze={[ae]:_e};if(o)for(const Qe in ze)ko(ze,Qe)&&Wc(ze[Qe]);_e=ze[ae],Sd(_e,c.value[ae]),E.messages=c.value}function fe(ae){return u.value[ae]||{}}function q(ae,_e){u.value[ae]=_e,E.datetimeFormats=u.value,pk(E,ae,_e)}function X(ae,_e){u.value[ae]=Tn(u.value[ae]||{},_e),E.datetimeFormats=u.value,pk(E,ae,_e)}function de(ae){return d.value[ae]||{}}function he(ae,_e){d.value[ae]=_e,E.numberFormats=d.value,gk(E,ae,_e)}function ke(ae,_e){d.value[ae]=Tn(d.value[ae]||{},_e),E.numberFormats=d.value,gk(E,ae,_e)}wk++,t&&lf&&(Ve(t.locale,ae=>{r&&(l.value=ae,E.locale=ae,Ya(E,l.value,a.value))}),Ve(t.fallbackLocale,ae=>{r&&(a.value=ae,E.fallbackLocale=ae,Ya(E,l.value,a.value))}));const Ce={id:wk,locale:$,fallbackLocale:L,get inheritLocale(){return r},set inheritLocale(ae){r=ae,ae&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Ya(E,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:D,get modifiers(){return k},get pluralRules(){return T||{}},get isGlobal(){return s},get missingWarn(){return p},set missingWarn(ae){p=ae,E.missingWarn=p},get fallbackWarn(){return m},set fallbackWarn(ae){m=ae,E.fallbackWarn=m},get fallbackRoot(){return f},set fallbackRoot(ae){f=ae},get fallbackFormat(){return g},set fallbackFormat(ae){g=ae,E.fallbackFormat=g},get warnHtmlMessage(){return v},set warnHtmlMessage(ae){v=ae,E.warnHtmlMessage=ae},get escapeParameter(){return y},set escapeParameter(ae){y=ae,E.escapeParameter=ae},t:Q,getLocaleMessage:Y,setLocaleMessage:le,mergeLocaleMessage:re,getPostTranslationHandler:O,setPostTranslationHandler:W,getMissingHandler:V,setMissingHandler:z,[XS]:G};return Ce.datetimeFormats=R,Ce.numberFormats=P,Ce.rt=me,Ce.te=oe,Ce.tm=F,Ce.d=$e,Ce.n=He,Ce.getDateTimeFormat=fe,Ce.setDateTimeFormat=q,Ce.mergeDateTimeFormat=X,Ce.getNumberFormat=de,Ce.setNumberFormat=he,Ce.mergeNumberFormat=ke,Ce[ZS]=n,Ce[wg]=ee,Ce[Sg]=Ae,Ce[Cg]=Z,Ce}function i6(e){const t=nt(e.locale)?e.locale:Hc,n=nt(e.fallbackLocale)||vn(e.fallbackLocale)||$t(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=cn(e.missing)?e.missing:void 0,o=Pt(e.silentTranslationWarn)||ua(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Pt(e.silentFallbackWarn)||ua(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Pt(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=$t(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=cn(e.postTranslation)?e.postTranslation:void 0,d=nt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,p=!!e.escapeParameterHtml,m=Pt(e.sync)?e.sync:!0;let f=e.messages;if($t(e.sharedMessages)){const k=e.sharedMessages;f=Object.keys(k).reduce((E,C)=>{const M=E[C]||(E[C]={});return Tn(M,k[C]),E},f||{})}const{__i18n:g,__root:w,__injectWithOption:b}=e,_=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:f,flatJson:y,datetimeFormats:_,numberFormats:v,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:p,messageResolver:e.messageResolver,inheritLocale:m,__i18n:g,__root:w,__injectWithOption:b}}function xg(e={}){const t=cf(i6(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},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(o){t.setMissingHandler(o)},get silentTranslationWarn(){return Pt(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Pt(o)?!o:o},get silentFallbackWarn(){return Pt(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Pt(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function r6(e,t,n){return{beforeCreate(){const s=Uc();if(!s)throw Ms(ms.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=Ck(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=xg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Ck(e,o);else{this.$i18n=xg({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&QS(t,o,o),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(s,this.$i18n)},mounted(){},unmounted(){const s=Uc();if(!s)throw Ms(ms.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function Ck(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[XS](t.pluralizationRules||e.pluralizationRules);const n=G1(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const Y1={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function l6({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Me?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},Yt())}function eC(){return Me}const a6=Xe({name:"i18n-t",props:Tn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Cn(e)||!isNaN(e)}},Y1),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||_t({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Yt();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=nt(e.plural)?+e.plural:e.plural);const u=l6(t,a);return o[wg](e.keypath,u,c)},r=Tn(Yt(),s),l=nt(e.tag)||Bt(e.tag)?e.tag:eC();return Bt(l)?jt(l,r,{default:i}):jt(l,r,i())}}}),xk=a6;function c6(e){return vn(e)&&!nt(e[0])}function tC(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Yt();e.locale&&(c.locale=e.locale),nt(e.format)?c.key=e.format:Bt(e.format)&&(nt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((m,f)=>n.includes(f)?Tn(Yt(),m,{[f]:e.format[f]}):m,Yt()));const d=s(e.value,c,u);let p=[c.key];return vn(d)?p=d.map((m,f)=>{const g=o[m.type],w=g?g({[m.type]:m.value,index:f,parts:d}):[m.value];return c6(w)&&(w[0].key=`${m.type}-${f}`),w}):nt(d)&&(p=[d]),p},l=Tn(Yt(),i),a=nt(e.tag)||Bt(e.tag)?e.tag:eC();return Bt(a)?jt(a,l,{default:r}):jt(a,l,r())}}const u6=Xe({name:"i18n-n",props:Tn({value:{type:Number,required:!0},format:{type:[String,Object]}},Y1),setup(e,t){const n=e.i18n||_t({useScope:e.scope,__useComponent:!0});return tC(e,t,KS,(...s)=>n[Cg](...s))}}),Tk=u6;function d6(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function f6(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Ms(ms.UNEXPECTED_ERROR);const c=d6(e,l.$),u=Ak(a);return[Reflect.apply(c.t,c,[...Mk(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);lf&&(r.__i18nWatcher=Ve(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{lf&&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=Ak(l);r.textContent=Reflect.apply(a.t,a,[...Mk(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Ak(e){if(nt(e))return{path:e};if($t(e)){if(!("path"in e))throw Ms(ms.REQUIRED_VALUE,"path");return e}else throw Ms(ms.INVALID_VALUE)}function Mk(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return nt(n)&&(r.locale=n),Cn(o)&&(r.plural=o),Cn(i)&&(r.plural=i),[t,l,r]}function h6(e,t,...n){const s=$t(n[0])?n[0]:{};(Pt(s.globalInstall)?s.globalInstall:!0)&&([xk.name,"I18nT"].forEach(i=>e.component(i,xk)),[Tk.name,"I18nN"].forEach(i=>e.component(i,Tk)),[$k.name,"I18nD"].forEach(i=>e.component(i,$k))),e.directive("t",f6(t))}const p6=vr("global-vue-i18n");function m6(e={}){const t=__VUE_I18N_LEGACY_API__&&Pt(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Pt(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=g6(e,t),r=vr("");function l(d){return s.get(d)||null}function a(d,p){s.set(d,p)}function c(d){s.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...p){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),$t(p[0])){const g=p[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let m=null;!t&&n&&(m=S6(d,u.global)),__VUE_I18N_FULL_INSTALL__&&h6(d,u,...p),__VUE_I18N_LEGACY_API__&&t&&d.mixin(r6(i,i.__composer,u));const f=d.unmount;d.unmount=()=>{m&&m(),u.dispose(),f()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function _t(e={}){const t=Uc();if(t==null)throw Ms(ms.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ms(ms.NOT_INSTALLED);const n=v6(t),s=k6(n),o=JS(t),i=y6(e,o);if(i==="global")return QS(s,e,o),s;if(i==="parent"){let a=Ek(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw Ms(ms.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=Tn({},e),u=Ek(n,t);c.__root=u||s;const d=cf(c);return a.__composerExtend&&(d[Wl]=a.__composerExtend(d)),S1()&&C1(()=>{const m=d[Wl];m&&(m(),delete d[Wl])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=Tn({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=cf(a),r.__composerExtend&&(l[Wl]=r.__composerExtend(l)),_6(r,t,l),r.__setInstance(t,l)}return l}function g6(e,t){const n=qA(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>xg(e)):n.run(()=>cf(e));if(s==null)throw Ms(ms.UNEXPECTED_ERROR);return[n,s]}function v6(e){const t=Rt(e.isCE?p6:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ms(e.isCE?ms.NOT_INSTALLED_WITH_PROVIDE:ms.UNEXPECTED_ERROR);return t}function y6(e,t){return ah(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function k6(e){return e.mode==="composition"?e.global:e.global.__composer}function Ek(e,t,n=!1){let s=null;const o=t.root;let i=b6(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(s=l.__composer,n&&s&&!s[ZS]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function b6(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function _6(e,t,n){sn(()=>{},t),Gt(()=>{const s=n;e.__deleteInstance(t);const o=s[Wl];o&&(o(),delete s[Wl])},t)}const w6=["locale","fallbackLocale","availableLocales"],Ik=["t","rt","d","n","tm","te"];function S6(e,t){const n=Object.create(null);return w6.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Ms(ms.UNEXPECTED_ERROR);const r=xn(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,Ik.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Ms(ms.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,Ik.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const C6=Xe({name:"i18n-d",props:Tn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Y1),setup(e,t){const n=e.i18n||_t({useScope:e.scope,__useComponent:!0});return tC(e,t,VS,(...s)=>n[Sg](...s))}}),$k=C6;n6();OI(gI);PI(NI);DI(yg);if(__INTLIFY_PROD_DEVTOOLS__){const e=Gr();e.__INTLIFY__=!0,vI(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const x6={class:"row"},T6={class:"lead","aria-hidden":"true"},A6={key:0,class:"run-ico",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none"},M6={key:1,class:"unread-dot"},E6={class:"archive-label"},I6={class:"left"},$6=["onKeydown"],N6={class:"ts"},L6=["title"],R6={class:"tag-text"},O6=["title"],P6={class:"tag-text"},D6=["title"],B6={class:"tag-text"},F6=["title"],H6=Xe({__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:s}=_t(),o=e,i=n,r=ie(!1),l=ie(null),a=ie(null);function c(M){const $=M.target;a.value?.contains($)||l.value?.contains($)||d()}function u(M){M.stopPropagation(),r.value?d():(r.value=!0,setTimeout(()=>document.addEventListener("mousedown",c),0))}function d(){r.value=!1,document.removeEventListener("mousedown",c)}Gt(()=>document.removeEventListener("mousedown",c));const p=ie(!1),m=ie(""),f=ie(null);async function g(){d(),p.value=!0,m.value=o.session.title,await ut();try{f.value?.focus(),f.value?.select()}catch{}}function w(){const M=m.value.trim();M&&i("rename",o.session.id,M),p.value=!1}function b(){p.value=!1}const _=ie(!1);function v(){navigator.clipboard.writeText(o.session.id).then(()=>{_.value=!0,setTimeout(()=>{_.value=!1},1200)}).catch(()=>{})}function y(){d(),i("fork",o.session.id)}const k=ie(!1);function T(){d(),k.value=!0}function E(){i("archive",o.session.id),k.value=!1}function C(){k.value=!1}return t({closeMenu:d,cancelArchive:C}),(M,$)=>(S(),I("div",{class:Te(["se",{on:e.active}]),onClick:$[5]||($[5]=L=>i("select",e.session.id))},[h("div",x6,[h("span",T6,[e.session.busy?(S(),I("svg",A6,[...$[6]||($[6]=[h("circle",{class:"run-track",cx:"8",cy:"8",r:"6","stroke-width":"2"},null,-1),h("path",{class:"run-arc",d:"M8 2 A6 6 0 1 1 2 8","stroke-width":"2","stroke-linecap":"round"},null,-1)])])):e.unread?(S(),I("span",M6)):ue("",!0)]),k.value?(S(),I("div",{key:0,class:"archive-confirm",onClick:$[0]||($[0]=Ye(()=>{},["stop"]))},[h("span",E6,N(A(s)("sidebar.archiveConfirm")),1),h("button",{class:"btn-confirm",onClick:Ye(E,["stop"])},N(A(s)("sidebar.confirm")),1),h("button",{class:"btn-cancel",onClick:Ye(C,["stop"])},N(A(s)("sidebar.cancel")),1)])):(S(),I(Me,{key:1},[h("div",I6,[p.value?Lt((S(),I("input",{key:0,ref_key:"renameInputRef",ref:f,"onUpdate:modelValue":$[1]||($[1]=L=>m.value=L),class:"rename-input",onClick:$[2]||($[2]=Ye(()=>{},["stop"])),onKeydown:[Io(Ye(w,["stop"]),["enter"]),Io(Ye(b,["stop"]),["esc"])],onBlur:w},null,40,$6)),[[_n,m.value]]):(S(),I("span",{key:1,class:"t",onDblclick:Ye(g,["stop"])},N(e.session.title),33))]),h("span",N6,N(e.session.time),1),!p.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(S(),I("span",{key:0,class:"tag tag-ask",title:A(s)("workspace.awaitingAnswerTitle")},[h("span",R6,N(A(s)("workspace.awaitingAnswer")),1)],8,L6)):ue("",!0),!p.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(S(),I("span",{key:1,class:"tag tag-approve",title:A(s)("workspace.awaitingPermissionTitle")},[h("span",P6,N(A(s)("workspace.awaitingPermission")),1)],8,O6)):ue("",!0),!p.value&&e.session.status==="aborted"?(S(),I("span",{key:2,class:"tag tag-aborted",title:A(s)("workspace.abortedTitle")},[h("span",B6,N(A(s)("workspace.aborted")),1)],8,D6)):ue("",!0),p.value?ue("",!0):(S(),I("button",{key:3,ref_key:"kebabRef",ref:l,class:Te(["kebab",{open:r.value}]),title:A(s)("sidebar.options"),onClick:$[3]||($[3]=Ye(L=>u(L),["stop"]))},[...$[7]||($[7]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,F6))],64))]),r.value?(S(),I("div",{key:0,ref_key:"menuRef",ref:a,class:"menu",onClick:$[4]||($[4]=Ye(()=>{},["stop"]))},[h("button",{class:"menu-item copy-id",onClick:Ye(v,["stop"])},N(_.value?"已复制 ✓":"复制 Session ID ⧉"),1),$[8]||($[8]=h("div",{class:"menu-divider"},null,-1)),h("button",{class:"menu-item",onClick:Ye(g,["stop"])},N(A(s)("sidebar.rename")),1),h("button",{class:"menu-item",onClick:Ye(y,["stop"])},N(A(s)("sidebar.fork")),1),h("button",{class:"menu-item archive",onClick:Ye(T,["stop"])},N(A(s)("sidebar.archive")),1)],512)):ue("",!0)],2))}}),yt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},W6=yt(H6,[["__scopeId","data-v-490f8224"]]),U6={class:"side"},q6={class:"ch"},j6={class:"ch-brand"},z6=["title","aria-label"],V6=["title","aria-label"],K6={class:"btn-wrap"},G6={class:"sessions"},Y6={key:0,class:"empty"},X6=["onClick","onContextmenu"],Z6={class:"gh-top"},J6={class:"gh-folder",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},Q6={key:0,class:"gh-name"},e$=["title","aria-label","aria-expanded","onClick"],t$=["title","aria-label","onClick"],n$=["title"],s$={class:"group-sessions"},o$=["onClick"],i$={key:1,class:"group-empty"},sm=10,r$=Xe({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","selectWorkspaces","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=_t(),s=t,o=ie(new Set);function i(oe){return o.value.has(oe)}function r(oe){const J=new Set(o.value);if(J.has(oe)){J.delete(oe);const F=new Set(l.value);F.delete(oe),l.value=F}else J.add(oe);o.value=J}const l=ie(new Set);function a(oe){return l.value.has(oe)}function c(oe){const J=new Set(l.value);J.has(oe)?J.delete(oe):J.add(oe),l.value=J}function u(oe,J,F){if(J||oe.length<=sm)return oe;const Y=oe.slice(0,sm);if(F&&!Y.some(le=>le.id===F)){const le=oe.find(re=>re.id===F);le&&(Y[sm-1]=le)}return Y}const d=ie(new Set);function p(oe,J){if(J.shiftKey){J.stopPropagation();const F=new Set(d.value);F.has(oe)?F.delete(oe):F.add(oe),d.value=F,s("selectWorkspaces",Array.from(F));return}d.value=new Set,s("selectWorkspaces",[]),r(oe)}function m(oe){d.value=new Set,s("selectWorkspaces",[]),s("select",oe)}const f=ie(null),g=ie(""),w=ie(null);function b(oe,J){f.value=oe,g.value=J,ut().then(()=>w.value?.focus())}function _(){const oe=f.value,J=g.value.trim();oe&&J&&s("renameWorkspace",oe,J),f.value=null}function v(){f.value=null}const y=ie(!1),k=ie(null),T=ie({}),E=ie(null);function C(oe){E.value&&!E.value.contains(oe.target)&&$()}function M(oe,J){if(J.shiftKey){J.stopPropagation();const F=new Set(d.value);F.has(oe.id)?F.delete(oe.id):F.add(oe.id),d.value=F,s("selectWorkspaces",Array.from(F));return}J.preventDefault(),J.stopPropagation(),k.value=oe,T.value={top:`${J.clientY}px`,left:`${J.clientX}px`},y.value=!0,document.addEventListener("mousedown",C,!0)}function $(){y.value=!1,document.removeEventListener("mousedown",C,!0),k.value=null,W()}function L(){k.value&&navigator.clipboard.writeText(k.value.root),$()}function D(){k.value&&b(k.value.id,k.value.name),$()}function R(){const oe=k.value;oe&&V(oe.id)&&(s("deleteWorkspace",oe.id),$())}const P=ie(null);let O;function W(){clearTimeout(O),P.value=null}function V(oe){return P.value===oe?(W(),!0):(clearTimeout(O),P.value=oe,O=setTimeout(()=>{P.value=null},2500),!1)}const z=ie(null),se=ie(null),Q=ie({}),me=ie(null);function $e(oe){const J=oe.target;J.closest(".gh-more")||J.closest(".ws-menu")||Be()}async function He(oe,J){if(z.value===oe.id){Be();return}const F=J.currentTarget;se.value=oe,z.value=oe.id,document.addEventListener("mousedown",$e),document.addEventListener("scroll",Be,!0),window.addEventListener("resize",Be),await ut();const Y=me.value,le=F.getBoundingClientRect(),re=4,fe=8,q=Y?.offsetHeight??0,X=Y?.offsetWidth??0;let de=le.bottom+re;de+q>window.innerHeight-fe&&(de=Math.max(fe,le.top-q-re));let he=le.right-X;he<fe&&(he=fe),Q.value={top:`${Math.round(de)}px`,left:`${Math.round(he)}px`}}function Be(){z.value=null,se.value=null,W(),document.removeEventListener("mousedown",$e),document.removeEventListener("scroll",Be,!0),window.removeEventListener("resize",Be)}function Ee(oe){navigator.clipboard.writeText(oe.root),Be()}function te(oe){b(oe.id,oe.name),Be()}function ee(oe){V(oe.id)&&(s("deleteWorkspace",oe.id),Be())}Js(()=>{document.removeEventListener("mousedown",C,!0),document.removeEventListener("mousedown",$e),document.removeEventListener("scroll",Be,!0),window.removeEventListener("resize",Be),clearTimeout(O)});const Z=ie(null);let Ae;function G(){const oe=Z.value;oe&&(oe.classList.remove("blink-now"),oe.getBoundingClientRect(),oe.classList.add("blink-now"),clearTimeout(Ae),Ae=setTimeout(()=>oe.classList.remove("blink-now"),300))}return(oe,J)=>(S(),I("aside",U6,[h("div",{class:"col",style:Dt({width:e.colWidth+"px"})},[h("div",q6,[h("div",j6,[(S(),I("svg",{ref_key:"logoRef",ref:Z,class:"ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:G},[...J[15]||(J[15]=[ur('<defs data-v-976591c7><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-976591c7><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-976591c7></rect><g class="ch-eyes" fill="#000" data-v-976591c7><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-976591c7></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-976591c7></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-976591c7></rect>',2)])],512)),J[16]||(J[16]=h("span",{class:"ch-name"},"Kimi Code",-1))]),h("button",{type:"button",class:"collapse-btn",title:A(n)("sidebar.collapseSidebar"),"aria-label":A(n)("sidebar.collapseSidebar"),onClick:J[0]||(J[0]=Ye(F=>s("collapse"),["stop"]))},[...J[17]||(J[17]=[ur('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-976591c7><path d="M11 6h9" data-v-976591c7></path><path d="M11 12h9" data-v-976591c7></path><path d="M11 18h9" data-v-976591c7></path><path d="M7 9l-3 3 3 3" data-v-976591c7></path></svg>',1)])],8,z6),h("button",{type:"button",class:"settings-btn",title:A(n)("settings.title"),"aria-label":A(n)("settings.title"),onClick:J[1]||(J[1]=Ye(F=>s("openSettings"),["stop"]))},[...J[18]||(J[18]=[h("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("circle",{cx:"12",cy:"12",r:"3"}),h("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l-.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09A1.65 1.65 0 0 0 15 4.6a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09A1.65 1.65 0 0 0 19.4 15z"})],-1)])],8,V6)]),h("div",K6,[h("button",{class:"btn-new-chat",onClick:J[2]||(J[2]=Ye(F=>s("create"),["stop"]))},[J[19]||(J[19]=h("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),h("span",null,N(A(n)("sidebar.newChat")),1)]),ue("",!0)]),h("div",G6,[e.groups.length===0?(S(),I("div",Y6,N(A(n)("workspace.noWorkspace")),1)):(S(!0),I(Me,{key:1},Ze(e.groups,F=>(S(),I("div",{key:F.workspace.id,class:"group"},[h("div",{class:Te(["gh",{on:F.workspace.id===e.activeWorkspaceId,sel:d.value.has(F.workspace.id)}]),onClick:Ye(Y=>p(F.workspace.id,Y),["stop"]),onContextmenu:Y=>M(F.workspace,Y)},[h("div",Z6,[(S(),I("svg",J6,[i(F.workspace.id)?(S(),I(Me,{key:0},[J[21]||(J[21]=h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),J[22]||(J[22]=h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(S(),I(Me,{key:1},[J[23]||(J[23]=h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),J[24]||(J[24]=h("path",{d:"M1 5.5h12"},null,-1))],64))])),f.value!==F.workspace.id?(S(),I("span",Q6,N(F.workspace.name),1)):Lt((S(),I("input",{key:1,ref_for:!0,ref_key:"renameInputRef",ref:w,"onUpdate:modelValue":J[4]||(J[4]=Y=>g.value=Y),class:"gh-rename",type:"text",onKeydown:[Io(_,["enter"]),Io(v,["esc"])],onBlur:v,onClick:J[5]||(J[5]=Ye(()=>{},["stop"]))},null,544)),[[_n,g.value]]),h("button",{type:"button",class:Te(["gh-more",{open:z.value===F.workspace.id}]),title:A(n)("sidebar.options"),"aria-label":A(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":z.value===F.workspace.id,onClick:Ye(Y=>He(F.workspace,Y),["stop"])},[...J[25]||(J[25]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,e$),h("button",{type:"button",class:"gh-add",title:A(n)("workspace.newInGroup"),"aria-label":A(n)("workspace.newInGroup"),onClick:Ye(Y=>s("createInWorkspace",F.workspace.id),["stop"])},[...J[26]||(J[26]=[h("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 3v10M3 8h10"})],-1)])],8,t$)]),h("div",{class:"gh-path",title:F.workspace.root},N(F.workspace.shortPath||F.workspace.root),9,n$)],42,X6),Lt(h("div",s$,[(S(!0),I(Me,null,Ze(u(F.sessions,a(F.workspace.id),e.activeId),Y=>(S(),je(W6,{key:Y.id,session:Y,active:Y.id===e.activeId,"approval-count":e.pendingBySession[Y.id]?.approvals??0,"question-count":e.pendingBySession[Y.id]?.questions??0,unread:e.unreadBySession[Y.id]??!1,onSelect:J[6]||(J[6]=le=>m(le)),onRename:J[7]||(J[7]=(le,re)=>s("rename",le,re)),onArchive:J[8]||(J[8]=le=>s("archive",le)),onFork:J[9]||(J[9]=le=>s("fork",le))},null,8,["session","active","approval-count","question-count","unread"]))),128)),!a(F.workspace.id)&&u(F.sessions,!1,e.activeId).length<F.sessions.length?(S(),I("button",{key:0,class:"show-more",onClick:Ye(Y=>c(F.workspace.id),["stop"])},N(A(n)("sidebar.showMore",{count:F.sessions.length-u(F.sessions,!1,e.activeId).length})),9,o$)):ue("",!0),F.sessions.length===0?(S(),I("div",i$,N(A(n)("sidebar.noSessions")),1)):ue("",!0)],512),[[Eo,!i(F.workspace.id)]])]))),128))])],4),y.value?(S(),I("div",{key:0,ref_key:"ghMenuRef",ref:E,class:"gh-menu",style:Dt(T.value),onClick:J[10]||(J[10]=Ye(()=>{},["stop"]))},[h("button",{type:"button",class:"ghm-item",onClick:L},N(A(n)("sidebar.copyPath")),1),h("button",{type:"button",class:"ghm-item",onClick:D},N(A(n)("sidebar.rename")),1),h("button",{type:"button",class:"ghm-item del",onClick:R},N(k.value&&P.value===k.value.id?A(n)("sidebar.confirm"):A(n)("sidebar.removeWorkspace")),1)],4)):ue("",!0),z.value!==null&&se.value?(S(),I("div",{key:1,ref_key:"wsMenuRef",ref:me,class:"ws-menu",style:Dt(Q.value),onClick:J[14]||(J[14]=Ye(()=>{},["stop"]))},[h("button",{class:"ws-menu-item",onClick:J[11]||(J[11]=Ye(F=>Ee(se.value),["stop"]))},N(A(n)("sidebar.copyPath")),1),J[27]||(J[27]=h("div",{class:"ws-menu-divider"},null,-1)),h("button",{class:"ws-menu-item",onClick:J[12]||(J[12]=Ye(F=>te(se.value),["stop"]))},N(A(n)("sidebar.rename")),1),J[28]||(J[28]=h("div",{class:"ws-menu-divider"},null,-1)),h("button",{class:"ws-menu-item del",onClick:J[13]||(J[13]=Ye(F=>ee(se.value),["stop"]))},N(P.value===se.value.id?A(n)("sidebar.confirm"):A(n)("sidebar.removeWorkspace")),1)],4)):ue("",!0)]))}}),l$=yt(r$,[["__scopeId","data-v-976591c7"]]);function a$(e){try{const t=localStorage.getItem(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function c$(e,t){try{localStorage.setItem(e,String(t))}catch{}}function u$(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(b){return Number.isFinite(b)?Math.min(o,Math.max(s,Math.round(b))):n}const l=ie(r(a$(t)??n)),a=ie(!1);function c(b){const _=r(b);l.value=_,c$(t,_)}let u=0,d=0,p=null,m=-1;function f(b){if(!a.value)return;const _=b.clientX-u;c(d+(i?-_:_))}function g(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),p){try{p.releasePointerCapture(m)}catch{}p.removeEventListener("pointermove",f),p.removeEventListener("pointerup",g),p.removeEventListener("pointercancel",g)}p=null,m=-1}}function w(b){b.preventDefault(),a.value=!0,u=b.clientX,d=l.value,p=b.currentTarget,m=b.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{p.setPointerCapture(m)}catch{}p.addEventListener("pointermove",f),p.addEventListener("pointerup",g),p.addEventListener("pointercancel",g)}return Js(g),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:w}}const d$=["aria-label"],f$=Xe({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),{width:i,dragging:r,onPointerDown:l}=u$({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:n.max,reverse:n.reverse});return s("update:width",i.value),Ve(i,a=>s("update:width",a)),Ve(r,a=>s("update:dragging",a)),(a,c)=>(S(),I("div",{class:Te(["rh",{dragging:A(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??A(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>A(l)&&A(l)(...u))},[...c[1]||(c[1]=[h("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,d$))}}),Nk=yt(f$,[["__scopeId","data-v-419b78b9"]]),h$={preview:"Preview"},p$={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…",comingSoon:"Coming soon…"},m$={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive session?",confirm:"Confirm",cancel:"Cancel",options:"Options",rename:"Rename",copyPath:"Copy path",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:"Show more ({count})",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar"},g$={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",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.",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"},v$={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?",confirm:"Confirm",cancel:"Cancel",yesterday:"Yesterday"},y$={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",modelTooltip:"Click to switch model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionTooltip:"Click to cycle permission mode",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",modesTooltip:"Mode: Plan / Goal / Swarm",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"},k$={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",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",steerNow:"Steer now ⌃S",steerTitle:"Inject into the running turn without waiting (Ctrl+S / ⌘S)",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking"},b$={title:"Sign in to Kimi Code",close:"Close (Esc)",starting:"Starting authorization flow…",instruction:"Open the link below in your browser and enter the device code to authorize:",deviceCode:"Device code",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAuthEllipsis:"Waiting for authorization…",openBrowser:"Open browser",cancel:"Cancel",footerHint:"This dialog will close automatically once authorization completes · Esc to close",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",escClose:"Esc to close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade kimi-code and try again"},_$={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?",confirm:"Confirm",cancel:"Cancel",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"},w$={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"},S$={title:"New session",close:"Close (Esc)",cwdLabel:"Working directory",cwdPlaceholder:"Absolute path of the working directory, e.g. /Users/you/project",recentLabel:"Recent directories",titleFieldLabel:"Title",titleFieldPlaceholder:"Optional, named automatically if left blank",create:"Create",cancel:"Cancel",footerHint:"Enter to create · Esc to close"},C$={title:"Sessions",close:"Close",searchPlaceholder:"Search sessions by title…",noWorkspace:"No workspace",emptyNone:"No sessions yet",emptyNoMatch:"No matching sessions",footerHint:"↑↓ to navigate · Enter to switch · Esc to close",justNow:"just now"},x$={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",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"},T$={title:"Question",step:"Q{current}/{total}",prev:"‹ Prev",next:"Next ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},A$={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",dockQueue:"Queue",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",todoTag:"todos",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",collapse:"Collapse",expand:"Expand"},M$={panelTitle:"Thinking",close:"Close"},E$={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"},I$={},$$={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",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"}},N$={searching:"Searching…",noMatch:"No matches"},L$={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",contentType:"Content type",details:"Server details",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",status:"HTTP status",timeout:"Timeout"},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."}},R$={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},sessions:{desc:"Browse & switch sessions"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to the platform with an API key"},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"}},O$={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Plan",task:"Task"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"}},P$={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},D$={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",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"},B$={label:"Theme",modern:"Explore",kimi:"Native",colorSchemeLabel:"Appearance",light:"Light",dark:"Dark",system:"System"},F$={preview:"预览"},H$={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",comingSoon:"敬请期待"},W$={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",confirm:"确认",cancel:"取消",options:"选项",rename:"重命名",copyPath:"复制路径",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"展开更多 ({count})",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏"},U$={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},q$={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:"确定撤销?",confirm:"确定",cancel:"取消",yesterday:"昨天"},j$={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",modelTooltip:"点击切换模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionTooltip:"点击循环切换审批模式",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",modesTooltip:"模式:计划 / 目标 / Swarm",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:"进行中"},z$={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",steerNow:"立即插入 ⌃S",steerTitle:"不等当前回合结束,把消息直接插进正在运行的任务(Ctrl+S / ⌘S)",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking"},V$={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",instruction:"在浏览器中打开以下链接,输入设备码完成授权:",deviceCode:"设备码",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAuthEllipsis:"等待授权…",openBrowser:"打开浏览器",cancel:"取消",footerHint:"授权完成后对话框将自动关闭 · Esc 关闭",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",escClose:"Esc 关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试"},K$={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",confirm:"确认",cancel:"取消",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 关闭"},G$={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},Y$={title:"新建会话",close:"关闭 (Esc)",cwdLabel:"工作目录",cwdPlaceholder:"工作目录绝对路径,如 /Users/you/project",recentLabel:"最近目录",titleFieldLabel:"标题",titleFieldPlaceholder:"可选,留空则自动命名",create:"新建",cancel:"取消",footerHint:"Enter 新建 · Esc 关闭"},X$={title:"会话",close:"关闭",searchPlaceholder:"按标题搜索会话…",noWorkspace:"无工作区",emptyNone:"暂无会话",emptyNoMatch:"没有匹配的会话",footerHint:"↑↓ 切换 · Enter 进入 · Esc 关闭",justNow:"刚刚"},Z$={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈"},J$={title:"提问",step:"Q{current}/{total}",prev:"‹ 上一",next:"下一 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},Q$={tag:"tasks",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",dockQueue:"队列",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",todoTag:"待办",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",collapse:"折叠",expand:"展开"},e5={panelTitle:"思考过程",close:"关闭"},t5={title:"改动",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},n5={},s5={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:"复制代码",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},o5={searching:"搜索中…",noMatch:"无匹配"},i5={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",contentType:"响应类型",details:"服务端详情",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",status:"HTTP 状态",timeout:"超时设置"},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:"目标描述太长了,请精简后重试。"}},r5={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},sessions:{desc:"浏览/切换会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"通过 API Key 登录平台"},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:"撤销上一条消息"}},l5={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"计划",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"}},a5={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},c5={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},u5={label:"主题",modern:"探索",kimi:"原生",colorSchemeLabel:"外观",light:"浅色",dark:"深色",system:"跟随系统"},d5={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",themeLabel:"Theme",modernDesc:"Bubbles, conversational, softer.",kimiDesc:"Native look: calm, flat.",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},f5={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",themeLabel:"主题",modernDesc:"气泡、对话感、更柔和。",kimiDesc:"原生风格:安静、扁平。",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},h5={title:"Settings",tabs:{general:"General",agent:"Agent",advanced:"Advanced",experimental:"Experimental"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",permission:{manual:"Manual",auto:"Auto",yolo:"YOLO"},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:"Telemetry",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",beta:"Experimental",betaToc:"Proportional conversation outline",betaTocHint:" Larger bubbles, viewport indicator, and hover tooltip"},p5={title:"设置",tabs:{general:"通用",agent:"Agent",advanced:"高级",experimental:"实验性"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",permission:{manual:"手动",auto:"自动",yolo:"全自动"},defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"遥测",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",beta:"实验性",betaToc:"对话目录增强",betaTocHint:"更大的气泡、视口指示器和悬停提示"},m5={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",confirmArchive:"Confirm archive?"},g5={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"detached",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",confirmArchive:"确认归档?"},v5={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"},y5={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},k5={en:{common:h$,app:p$,sidebar:m$,workspace:g$,conversation:v$,status:y$,composer:k$,login:b$,providers:_$,model:w$,newSession:S$,sessions:C$,approval:x$,question:T$,tasks:A$,thinking:M$,diff:E$,fileTree:I$,filePreview:$$,mention:N$,warnings:L$,commands:R$,tools:O$,layout:P$,mobile:D$,theme:B$,onboarding:d5,settings:h5,header:m5,sideChat:v5},zh:{common:F$,app:H$,sidebar:W$,workspace:U$,conversation:q$,status:j$,composer:z$,login:V$,providers:K$,model:G$,newSession:Y$,sessions:X$,approval:Z$,question:J$,tasks:Q$,thinking:e5,diff:t5,fileTree:n5,filePreview:s5,mention:o5,warnings:i5,commands:r5,tools:l5,layout:a5,mobile:c5,theme:u5,onboarding:f5,settings:p5,header:g5,sideChat:y5}},nC="kimi-locale",sC=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function b5(){const e=globalThis.localStorage?.getItem(nC);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const bn=m6({legacy:!1,locale:b5(),fallbackLocale:"en",messages:k5});function oC(e){bn.global.locale.value=e,globalThis.localStorage?.setItem(nC,e)}const Ql=bn.global.t,_5={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"},w5={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 iu(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return w5[t]??t}function Lk(e){const t=_5[iu(e)];return t?Ql(t):e}const S5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="2.5" y="1.5" width="9" height="13" rx="1"/><line x1="5" y1="5" x2="9" y2="5"/><line x1="5" y1="7.5" x2="11" y2="7.5"/><line x1="5" y1="10" x2="10" y2="10"/></svg>',C5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="1.5" y="2.5" width="13" height="11" rx="1.5"/><polyline points="4,6 6.5,8 4,10"/><line x1="8" y1="10" x2="12" y2="10"/></svg>',Rk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M10.5 2.5l3 3-8 8H2.5v-3l8-8z"/><line x1="8.5" y1="4.5" x2="11.5" y2="7.5"/></svg>',x5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M3 12V4.5L8 2l5 2.5V12H3z"/><line x1="6" y1="7" x2="10" y2="7"/><line x1="8" y1="5" x2="8" y2="9"/></svg>',Ok='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="6.5" cy="6.5" r="4"/><line x1="9.5" y1="9.5" x2="13.5" y2="13.5"/></svg>',T5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M5 2.5C3.5 2.5 3.5 5 3.5 6.5S2.5 8 2.5 8s1 0 1 1.5S3.5 13.5 5 13.5"/><path d="M11 2.5c1.5 0 1.5 2.5 1.5 4S13.5 8 13.5 8s-1 0-1 1.5.5 4-1.5 4"/><line x1="8" y1="6" x2="8" y2="10"/><line x1="6.3" y1="6.8" x2="9.7" y2="9.2"/><line x1="9.7" y1="6.8" x2="6.3" y2="9.2"/></svg>',A5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',M5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="6"/><path d="M8 2c-2 2-3 3.6-3 6s1 4 3 6"/><path d="M8 2c2 2 3 3.6 3 6s-1 4-3 6"/><line x1="2" y1="8" x2="14" y2="8"/></svg>',Pk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><polyline points="2,4.5 3.5,6 5.5,3"/><polyline points="2,11 3.5,12.5 5.5,9.5"/><line x1="8" y1="4.5" x2="14" y2="4.5"/><line x1="8" y1="11" x2="14" y2="11"/></svg>',E5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M8.5 1L3 9h4l-1.5 6 5.5-8h-4l1.5-6z"/></svg>',I5="";function $5(e){switch(iu(e)){case"read":return S5;case"bash":return C5;case"edit":return Rk;case"multi_edit":return Rk;case"write":return x5;case"grep":return Ok;case"search":return Ok;case"glob":return T5;case"ls":return A5;case"web_fetch":return M5;case"todo":return Pk;case"task":return Pk;default:return(e??"").trim().toLowerCase().includes("skill")?E5:I5}}const iC=80;function N5(e,t=iC){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function L5(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function R5(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 Ht(e){return typeof e=="string"&&e.length>0?e:void 0}function Br(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function O5(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 om(e){return Ht(e.path)??Ht(e.file_path)??Ht(e.filePath)??Ht(e.filename)}const P5=64;function Dk(e,t,n=!1){const s=(o,i=iC)=>n?o.trim():N5(o,i);try{const o=R5(t);if(!n&&L5(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(iu(e)){case"read":{const r=om(o);if(!r)return i();const l=Br(o.offset)??Br(o.line_start)??Br(o.start_line),a=Br(o.limit)??Br(o.length),c=Br(o.line_end)??Br(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=om(o);return r?s(`${r} ${Ql("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=om(o);return r?s(r):i()}case"bash":{const r=Ht(o.command)??Ht(o.cmd)??Ht(o.script);return r?s(r,P5):i()}case"grep":case"search":{const r=Ht(o.pattern)??Ht(o.query)??Ht(o.regex),l=Ht(o.path)??Ht(o.glob)??Ht(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=Ht(o.pattern)??Ht(o.glob)??Ht(o.query),l=Ht(o.path)??Ht(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):Ht(o.path)?s(Ht(o.path)):i()}case"ls":{const r=Ht(o.path)??Ht(o.dir)??Ht(o.directory)??Ht(o.cwd);return r?s(r):i()}case"web_fetch":{const r=Ht(o.url)??Ht(o.uri);return r?s(O5(r)):i()}case"todo":case"task":{const r=Ht(o.description)??Ht(o.title)??Ht(o.prompt)??Ht(o.name)??Ht(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(Ql("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function D5(e){try{switch(iu(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Ql("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return Ql("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Ql("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const B5=["title"],F5=["title"],H5=["src","alt"],W5=["src"],U5=["src"],q5={class:"car",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},j5=["points"],z5=["innerHTML"],V5={class:"a"},K5=["title"],G5={class:"rt"},Y5={key:0,class:"chip"},X5={key:1,class:"spin",role:"status","aria-label":"running"},Z5={key:3,class:"tm"},J5={key:0,class:"bb"},Q5={key:0,class:"bb-summary"},eN={key:1,class:"bb-empty"},tN=Xe({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=U(()=>n.tool.status==="running"&&/^bash$/i.test(n.tool.name)),i=U(()=>!!n.tool.output&&n.tool.output.length>0),r=U(()=>i.value||o.value),l=ie(n.tool.defaultExpanded===!0&&r.value);function a(){r.value&&(l.value=!l.value)}Ve(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status,n.tool.name],()=>{n.tool.defaultExpanded===!0&&r.value&&(l.value=!0)});const c=()=>n.tool.status==="error"?"✕":"✓",u=()=>Lk(n.tool.name),d=()=>$5(n.tool.name),p=()=>Dk(n.tool.name,n.tool.arg),m=()=>Dk(n.tool.name,n.tool.arg,!0),f=()=>D5({name:n.tool.name,arg:n.tool.arg,output:n.tool.output,timing:n.tool.timing,status:n.tool.status}),g=()=>n.tool.status==="error",w=U(()=>n.tool.status==="ok"?n.tool.media:void 0);function b(k){return k.split(/[\\/]+/).pop()||k}function _(k){return k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/1024/1024).toFixed(1)} MB`}const v=U(()=>{const k=w.value;if(!k)return"";const T=[k.path?b(k.path):Lk(n.tool.name)];return k.mimeType&&T.push(k.mimeType),k.bytes!==void 0&&T.push(_(k.bytes)),k.dimensions&&T.push(k.dimensions),T.join(" · ")});function y(){const k=w.value;k?.kind==="image"&&s("openMedia",k)}return(k,T)=>w.value?(S(),I("div",{key:0,class:Te(["media-tool",{mob:e.mobile}])},[h("div",{class:"media-title",title:w.value.path||v.value},N(v.value),9,B5),w.value.kind==="image"?(S(),I("button",{key:0,type:"button",class:"media-image-button",title:w.value.path||v.value,onClick:y},[h("img",{class:"media-image",src:w.value.url,alt:w.value.path?b(w.value.path):v.value,loading:"lazy"},null,8,H5)],8,F5)):w.value.kind==="video"?(S(),I("video",{key:1,class:"media-video",src:w.value.url,controls:"",preload:"metadata"},null,8,W5)):(S(),I("audio",{key:2,class:"media-audio",src:w.value.url,controls:""},null,8,U5))],2)):(S(),I("div",{key:1,class:Te(["box",{open:l.value,err:g(),mob:e.mobile,stacked:e.stackPosition!=="single","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[h("div",{class:"bh",onClick:a},[(S(),I("svg",q5,[h("polyline",{points:l.value?"4,6 8,10 12,6":"6,4 10,8 6,12"},null,8,j5)])),d()?(S(),I("span",{key:0,class:"gl",innerHTML:d(),"aria-hidden":"true"},null,8,z5)):ue("",!0),h("span",V5,N(u()),1),l.value?ue("",!0):(S(),I("span",{key:1,class:"p",title:p()},N(p()),9,K5)),h("span",G5,[f()?(S(),I("span",Y5,N(f()),1)):ue("",!0),e.tool.status==="running"?(S(),I("span",X5)):(S(),I("span",{key:2,class:Te(e.tool.status==="ok"?"ok":"er")},N(c()),3)),e.tool.timing&&e.tool.name!=="bash"?(S(),I("span",Z5,N(e.tool.timing),1)):ue("",!0)])]),l.value?(S(),I("div",J5,[m()?(S(),I("div",Q5,N(m()),1)):ue("",!0),i.value?ue("",!0):(S(),I("div",eN,"Waiting for output…")),(S(!0),I(Me,null,Ze(e.tool.output??[],(E,C)=>(S(),I("div",{key:C},N(E),1))),128))])):ue("",!0)],2))}}),ed=yt(tN,[["__scopeId","data-v-62dadf8a"]]);var nN=Object.create,X1=Object.defineProperty,sN=Object.getOwnPropertyDescriptor,rC=Object.getOwnPropertyNames,oN=Object.getPrototypeOf,iN=Object.prototype.hasOwnProperty,lC=(e,t)=>function(){return t||(0,e[rC(e)[0]])((t={exports:{}}).exports,t),t.exports},aC=e=>{let t={};for(var n in e)X1(t,n,{get:e[n],enumerable:!0});return t},rN=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=rC(t),i=0,r=o.length,l;i<r;i++)l=o[i],!iN.call(e,l)&&l!==n&&X1(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=sN(t,l))||s.enumerable});return e},cC=(e,t,n)=>(n=e!=null?nN(oN(e)):{},rN(X1(n,"default",{value:e,enumerable:!0}),e));function lN(e,t,n,s){const o=Number(e[t].meta.id+1).toString();let i="";return typeof s.docId=="string"&&(i=`-${s.docId}-`),i+o}function aN(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function cN(e,t,n,s,o){const i=o.rules.footnote_anchor_name(e,t,n,s,o),r=o.rules.footnote_caption(e,t,n,s,o);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 uN(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
39
- `:`<hr class="footnotes-sep">
40
- `)+`<section class="footnotes">
41
- <ol class="footnotes-list">
42
- `}function dN(){return`</ol>
43
- </section>
44
- `}function fN(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function hN(){return`</li>
45
- `}function pN(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function mN(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=cN,e.renderer.rules.footnote_block_open=uN,e.renderer.rules.footnote_block_close=dN,e.renderer.rules.footnote_open=fN,e.renderer.rules.footnote_close=hN,e.renderer.rules.footnote_anchor=pN,e.renderer.rules.footnote_caption=aN,e.renderer.rules.footnote_anchor_name=lN;function s(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],p=l.eMarks[a];if(d+4>p||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let m;for(m=d+2;m<p;m++){if(l.src.charCodeAt(m)===32)return!1;if(l.src.charCodeAt(m)===93)break}if(m===d+2||m+1>=p||l.src.charCodeAt(++m)!==58)return!1;if(u)return!0;m++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const f=l.src.slice(d+2,m-2);l.env.footnotes.refs[`:${f}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:f},g.level=l.level++,l.tokens.push(g);const w=l.bMarks[a],b=l.tShift[a],_=l.sCount[a],v=l.parentType,y=m,k=l.sCount[a]+m-(l.bMarks[a]+l.tShift[a]);let T=k;for(;m<p;){const C=l.src.charCodeAt(m);if(n(C))C===9?T+=4-T%4:T++;else break;m++}l.tShift[a]=m-y,l.sCount[a]=T-k,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]=b,l.sCount[a]=_,l.bMarks[a]=w;const E=new l.Token("footnote_reference_close","",-1);return E.level=--l.level,l.tokens.push(E),!0}function o(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,p=t(l,u+1);if(p<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const m=l.env.footnotes.list.length,f=[];l.md.inline.parse(l.src.slice(d,p),l.md,l.env,f);const g=l.push("footnote_ref","",0);g.meta={id:m},l.env.footnotes.list[m]={content:l.src.slice(d,p),tokens:f}}return l.pos=p+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 p=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${p}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let m;l.env.footnotes.refs[`:${p}`]<0?(m=l.env.footnotes.list.length,l.env.footnotes.list[m]={label:p,count:0},l.env.footnotes.refs[`:${p}`]=m):m=l.env.footnotes.refs[`:${p}`];const f=l.env.footnotes.list[m].count;l.env.footnotes.list[m].count++;const g=l.push("footnote_ref","",0);g.meta={id:m,subId:f,label:p}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const p={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(f){return f.type==="footnote_reference_open"?(d=!0,c=[],u=f.meta.label,!1):f.type==="footnote_reference_close"?(d=!1,p[":"+u]=c,!1):(d&&c.push(f),!d)}),!l.env.footnotes.list))return;const m=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let f=0,g=m.length;f<g;f++){const w=new l.Token("footnote_open","",1);if(w.meta={id:f,label:m[f].label},l.tokens.push(w),m[f].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=m[f].tokens,y.content=m[f].content,a.push(y);const k=new l.Token("paragraph_close","p",-1);k.block=!0,a.push(k)}else m[f].label&&(a=p[`:${m[f].label}`]);a&&(l.tokens=l.tokens.concat(a));let b;l.tokens[l.tokens.length-1].type==="paragraph_close"?b=l.tokens.pop():b=null;const _=m[f].count>0?m[f].count:1;for(let v=0;v<_;v++){const y=new l.Token("footnote_anchor","",0);y.meta={id:f,subId:v,label:m[f].label},l.tokens.push(y)}b&&l.tokens.push(b),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",s,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",o),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function gN(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==43)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){let i;const r=[],l=o.length;for(let a=0;a<l;a++){const c=o[a];if(c.marker!==43||c.end===-1)continue;const u=o[c.end];i=s.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=s.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",s.tokens[u.token-1].type==="text"&&s.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<s.tokens.length&&s.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=s.tokens[c],s.tokens[c]=s.tokens[a],s.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(s){const o=s.tokens_meta,i=(s.tokens_meta||[]).length;n(s,s.delimiters);for(let r=0;r<i;r++)o[r]&&o[r].delimiters&&n(s,o[r].delimiters)})}function vN(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==61)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){const i=[],r=o.length;for(let l=0;l<r;l++){const a=o[l];if(a.marker!==61||a.end===-1)continue;const c=o[a.end],u=s.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=s.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",s.tokens[c.token-1].type==="text"&&s.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<s.tokens.length&&s.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=s.tokens[a];s.tokens[a]=s.tokens[l],s.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(s){let o;const i=s.tokens_meta,r=(s.tokens_meta||[]).length;for(n(s,s.delimiters),o=0;o<r;o++)i[o]&&i[o].delimiters&&n(s,i[o].delimiters)})}const yN=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function kN(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==126||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(yN,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function bN(e){e.inline.ruler.after("emphasis","sub",kN)}const _N=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function wN(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==94||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(_N,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function SN(e){e.inline.ruler.after("emphasis","sup",wN)}var CN=lC({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(g,w){w=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},w),g.core.ruler.after("inline","github-task-lists",function(b){for(var _=b.tokens,v=0,y=2;y<_.length;y++)o(_,y)&&(i(_[y],v,w,b.Token),v+=1,n(_[y-2],"class",w.liClass),n(_[s(_,y-2)],"class",w.ulClass))})};function n(g,w,b){var _=g.attrIndex(w),v=[w,b];_<0?g.attrPush(v):g.attrs[_]=v}function s(g,w){for(var b=g[w].level-1,_=w-1;_>=0;_--)if(g[_].level===b)return _;return-1}function o(g,w){return d(g[w])&&p(g[w-1])&&m(g[w-2])&&f(g[w])}function i(g,w,b,_){var v=b.idPrefix+w;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(v,_)),g.children.push(a(_)),g.children.unshift(r(g,v,b,_)),b.divWrap&&(g.children.unshift(c(b,_)),g.children.push(u(_)))}function r(g,w,b,_){var v=new _("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",w]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&v.attrs.push(["checked","true"]),b.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(g,w){var b=new w("label_open","label",1);return b.attrs=[["for",g]],b}function a(g){return new g("label_close","label",-1)}function c(g,w){var b=new w("checkbox_open","div",0);return b.attrs=[["class",g.divClass]],b}function u(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function p(g){return g.type==="paragraph_open"}function m(g){return g.type==="list_item_open"}function f(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})}),xN=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))),TN=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),im;const AN=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]]),MN=(im=String.fromCodePoint)!==null&&im!==void 0?im: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 EN(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=AN.get(e))!==null&&t!==void 0?t:e}var Bn;(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"})(Bn||(Bn={}));const IN=32;var tr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(tr||(tr={}));function Tg(e){return e>=Bn.ZERO&&e<=Bn.NINE}function $N(e){return e>=Bn.UPPER_A&&e<=Bn.UPPER_F||e>=Bn.LOWER_A&&e<=Bn.LOWER_F}function NN(e){return e>=Bn.UPPER_A&&e<=Bn.UPPER_Z||e>=Bn.LOWER_A&&e<=Bn.LOWER_Z||Tg(e)}function LN(e){return e===Bn.EQUALS||NN(e)}var Dn;(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"})(Dn||(Dn={}));var Ji;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ji||(Ji={}));var RN=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Dn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ji.Strict}startEntity(e){this.decodeMode=e,this.state=Dn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Dn.EntityStart:return e.charCodeAt(t)===Bn.NUM?(this.state=Dn.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Dn.NamedEntity,this.stateNamedEntity(e,t));case Dn.NumericStart:return this.stateNumericStart(e,t);case Dn.NumericDecimal:return this.stateNumericDecimal(e,t);case Dn.NumericHex:return this.stateNumericHex(e,t);case Dn.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|IN)===Bn.LOWER_X?(this.state=Dn.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Dn.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const o=n-t;this.result=this.result*Math.pow(s,o)+parseInt(e.substr(t,o),s),this.consumed+=o}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Tg(s)||$N(s))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Tg(s))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(s,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===Bn.SEMI)this.consumed+=1;else if(this.decodeMode===Ji.Strict)return 0;return this.emitCodePoint(EN(this.result),this.consumed),this.errors&&(e!==Bn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let s=n[this.treeIndex],o=(s&tr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=ON(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===Ji.Attribute&&(o===0||LN(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&tr.VALUE_LENGTH)>>14,o!==0){if(i===Bn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Ji.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&tr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~tr.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case Dn.NamedEntity:return this.result!==0&&(this.decodeMode!==Ji.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Dn.NumericDecimal:return this.emitNumericEntity(0,2);case Dn.NumericHex:return this.emitNumericEntity(0,3);case Dn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Dn.EntityStart:return 0}}};function uC(e){let t="";const n=new RN(e,s=>t+=MN(s));return function(o,i){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(i);const c=n.write(o,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+o.slice(r);return t="",a}}function ON(e,t,n,s){const o=(t&tr.BRANCH_LENGTH)>>7,i=t&tr.JUMP_TABLE;if(o===0)return i!==0&&s===i?n:-1;if(i){const a=s-i;return a<0||a>=o?-1:e[n+a]-1}let r=n,l=r+o-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<s)r=a+1;else if(c>s)l=a-1;else return e[a+o]}return-1}const PN=uC(xN);uC(TN);function Z1(e,t=Ji.Legacy){return PN(e,t)}var DN=cC(CN());const Bk={};function BN(e){let t=Bk[e];if(t)return t;t=Bk[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function dh(e,t){typeof t!="string"&&(t=dh.defaultChars);const n=BN(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let o="";for(let i=0,r=s.length;i<r;i+=3){const l=parseInt(s.slice(i+1,i+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(s.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?o+="��":o+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.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?o+="���":o+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16),u=parseInt(s.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?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}o+="�"}return o})}dh.defaultChars=";/?:@&=+$,#";dh.componentChars="";var Ag=dh;const Fk={};function FN(e){let t=Fk[e];if(t)return t;t=Fk[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):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 fh(e,t,n){typeof t!="string"&&(n=t,t=fh.defaultChars),typeof n>"u"&&(n=!0);const s=FN(t);let o="";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))){o+=e.slice(i,i+3),i+=2;continue}if(l<128){o+=s[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){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}fh.defaultChars=";/?:@&=+$,-_.!~*'()#";fh.componentChars="-_.!~*'()";var dC=fh;function J1(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 uf(){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 HN=/^([a-z0-9.+-]+:)/i,WN=/:[0-9]*$/,UN=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,qN=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
46
- `," "]),jN=["'"].concat(qN),Hk=["%","/","?",";","#"].concat(jN),Wk=["/","?","#"],zN=255,Uk=/^[+a-z0-9A-Z_-]{0,63}$/,VN=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,qk={javascript:!0,"javascript:":!0},jk={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function KN(e,t){if(e&&e instanceof uf)return e;const n=new uf;return n.parse(e,t),n}uf.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=UN.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=HN.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=i.substr(0,2)==="//",o&&!(r&&qk[r])&&(i=i.substr(2),this.slashes=!0)),!qk[r]&&(o||r&&!jk[r])){let c=-1;for(let f=0;f<Wk.length;f++)s=i.indexOf(Wk[f]),s!==-1&&(c===-1||s<c)&&(c=s);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 f=0;f<Hk.length;f++)s=i.indexOf(Hk[f]),s!==-1&&(c===-1||s<c)&&(c=s);c===-1&&(c=i.length),i[c-1]===":"&&c--;const p=i.slice(0,c);i=i.slice(c),this.parseHost(p),this.hostname=this.hostname||"";const m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m){const f=this.hostname.split(/\./);for(let g=0,w=f.length;g<w;g++){const b=f[g];if(b&&!b.match(Uk)){let _="";for(let v=0,y=b.length;v<y;v++)b.charCodeAt(v)>127?_+="x":_+=b[v];if(!_.match(Uk)){const v=f.slice(0,g),y=f.slice(g+1),k=b.match(VN);k&&(v.push(k[1]),y.unshift(k[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>zN&&(this.hostname=""),m&&(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),jk[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};uf.prototype.parseHost=function(e){let t=WN.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 Q1=KN,fC=aC({decode:()=>Ag,encode:()=>dC,format:()=>J1,parse:()=>Q1}),hC=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,pC=/[\0-\x1F\x7F-\x9F]/,GN=/[\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]/,mC=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,YN=/[\$\+<->\^`\|~\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]/,gC=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,XN=aC({Any:()=>hC,Cc:()=>pC,Cf:()=>GN,P:()=>mC,S:()=>YN,Z:()=>gC}),ZN=Object.defineProperty,vC=e=>{let t={};for(var n in e)ZN(t,n,{get:e[n],enumerable:!0});return t},JN=vC({arrayReplaceAt:()=>i8,assign:()=>s8,countLines:()=>gn,escapeHtml:()=>p8,escapeRE:()=>g8,fromCodePoint:()=>jc,has:()=>n8,isMdAsciiPunct:()=>hf,isPunctChar:()=>ff,isPunctCode:()=>Mg,isSpace:()=>o8,isString:()=>e8,isValidEntityCode:()=>ph,isWhiteSpace:()=>qc,lib:()=>v8,mdurl:()=>fC,normalizeReference:()=>hh,ucmicro:()=>df,unescapeAll:()=>zc,unescapeMd:()=>c8});const df=XN;function QN(e){return Object.prototype.toString.call(e)}function e8(e){return QN(e)==="[object String]"}const t8=Object.prototype.hasOwnProperty;function n8(e,t){return t8.call(e,t)}function s8(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(s=>{e[s]=n[s]})}}),e}function o8(e){return e===9||e===32}function qc(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 ff(e){return df.P.test(e)||df.S.test(e)}const zk=new Map;function Mg(e){if(hf(e))return!0;const t=zk.get(e);if(t!==void 0)return t;const n=ff(String.fromCharCode(e));return zk.set(e,n),n}function hf(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 hh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function i8(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function ph(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 jc(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 yC=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,r8=new RegExp(`${yC.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),l8=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function a8(e,t){if(t.charCodeAt(0)===35&&l8.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return ph(s)?jc(s):e}const n=Z1(e);return n!==e?n:e}function c8(e){return e.includes("\\")?e.replace(yC,"$1"):e}function zc(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(r8,(t,n,s)=>n||a8(t,s))}const u8=/[&<>"]/,d8=/[&<>"]/g,f8={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function h8(e){return f8[e]}function p8(e){return u8.test(e)?e.replace(d8,h8):e}const m8=/[.?*+^$[\]\\(){}|-]/g;function g8(e){return e.replace(m8,"\\$&")}const v8={mdurl:fC,ucmicro:df};function gn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
47
- `,n+1))!==-1;)t++;return t}const y8=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,k8=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,b8=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,ev=["references","footnotes","abbreviations","abbr","abbrs"],tv=Symbol.for("markdown-it-ts.global-state"),nv=Object.prototype.hasOwnProperty;function Vk(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $o(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ir(e){if(Array.isArray(e))return e.map(t=>ir(t));if($o(e)){const t={};for(const n of Object.keys(e))t[n]=ir(e[n]);return t}return e}function pf(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$o(e)?Object.keys(e):[]}function Eg(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(!Eg(e[n],t[n]))return!1;return!0}if($o(e)||$o(t)){if(!$o(e)||!$o(t))return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!nv.call(t,o)||!Eg(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function kC(e,t){if(Array.isArray(e))return e[Number(t)];if($o(e))return e[t]}function _8(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=ir(t[n]);return e}if($o(e)&&$o(t)){for(const n of Object.keys(e))nv.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=ir(t[n]);return e}return ir(t)}function w8(e,t,n){const s=n.ownedKeys??[],o=e[t];if($o(o)||Array.isArray(o)){const i=new Set(pf(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=ir(kC(n.value,r)):delete o[r];!n.existed&&pf(o).length===0&&delete e[t];return}n.existed?e[t]=ir(n.value):delete e[t]}function sv(e){const t=e[tv];return Vk(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Vk(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function S8(e,t){Object.defineProperty(e,tv,{value:t,enumerable:!1,configurable:!0,writable:!0})}function es(e){return e?y8.test(e)?"footnote-definition":k8.test(e)?"abbreviation-definition":b8.test(e)?"reference-definition":null:null}function ru(e){return sv(e)?.reason??null}function ea(e,t,n){if(ru(e)&&Ii(e),!t)return n();ov(e,t);try{const s=n();return iv(e),s}catch(s){throw Ii(e),s}}function ov(e,t){try{Ii(e);const n={};for(const s of ev)n[s]=nv.call(e,s)?{existed:!0,value:ir(e[s])}:{existed:!1};S8(e,{reason:t,snapshot:n})}catch{}}function iv(e){const t=sv(e);if(t)for(const n of ev){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!$o(o)&&!Array.isArray(o))continue;const i=new Set(pf(s.existed?s.value:void 0));s.ownedKeys=pf(o).filter(r=>i.has(r)?!Eg(o[r],kC(s.value,r)):!0)}}function Ii(e){const t=sv(e);if(t){for(const n of ev){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){w8(e,n,s);continue}s.existed?e[n]=_8(e[n],s.value):delete e[n]}delete e[tv]}}const Ig=Symbol.for("markdown-it-ts.diagnostics");function mh(e,t){if(e)try{const n=e[Ig];if(n&&typeof n=="object")return n;if(!t)return;const s={};return Object.defineProperty(e,Ig,{value:s,enumerable:!1,configurable:!0,writable:!0}),s}catch{return}}function mi(e){return mh(e,!1)}function C8(e){if(e)try{delete e[Ig]}catch{}}function Us(e){C8(e)}function zn(e,t){const n=mh(e,!0);n&&(n.strategy=t)}function rm(e,t){const n=mh(e,!0);n&&(n.chunk=t)}function bC(e,t){const n=mh(e,!0);n&&(n.unbounded=t)}function x8(e){const t={};e=e||{},t.src_Any=hC.source,t.src_Cc=pC.source,t.src_Z=gC.source,t.src_P=mC.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 $g(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function gh(e){return Object.prototype.toString.call(e)}function T8(e){return gh(e)==="[object String]"}function A8(e){return gh(e)==="[object Object]"}function M8(e){return gh(e)==="[object RegExp]"}function Kk(e){return gh(e)==="[object Function]"}function E8(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const _C={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function I8(e){return Object.keys(e||{}).reduce(function(t,n){return t||_C.hasOwnProperty(n)},!1)}const $8={"http:":{validate:function(e,t,n){const s=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(s)?s.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const s=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(s)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const s=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(s)?s.match(n.re.mailto)[0].length:0}}},N8="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]",L8="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function R8(e){e.__index__=-1,e.__text_cache__=""}function O8(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function Gk(){return function(e,t){t.normalize(e)}}function mf(e){const t=e.re=x8(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(N8),n.push(t.src_xn),t.src_tlds=n.join("|");function s(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const o=[];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,A8(a)){M8(a.validate)?c.validate=O8(a.validate):Kk(a.validate)?c.validate=a.validate:i(l,a),Kk(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Gk();return}if(T8(a)){o.push(l);return}i(l,a)}),o.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:Gk()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(E8).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"),R8(e)}function P8(e,t){const n=e.__index__,s=e.__last_index__,o=e.__text_cache__.slice(n,s);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=s+t,this.raw=o,this.text=o,this.url=o}function Ng(e,t){const n=new P8(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Qs(e,t){if(!(this instanceof Qs))return new Qs(e,t);t||I8(e)&&(t=e,e={}),this.__opts__=$g({},_C,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=$g({},$8,e),this.__compiled__={},this.__tlds__=L8,this.__tlds_replaced__=!1,this.re={},mf(this)}Qs.prototype.add=function(t,n){return this.__schemas__[t]=n,mf(this),this};Qs.prototype.set=function(t){return this.__opts__=$g(this.__opts__,t),this};Qs.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,s,o,i,r,l,a,c,u;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(t))!==null;)if(i=this.testSchemaAt(t,n[2],a.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(s=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(r=s.index+s[1].length,(this.__index__<0||r<this.__index__)&&(this.__schema__="",this.__index__=r,this.__last_index__=s.index+s[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(o=t.match(this.re.email_fuzzy))!==null&&(r=o.index+o[1].length,l=o.index+o[0].length,(this.__index__<0||r<this.__index__||r===this.__index__&&l>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=l))),this.__index__>=0};Qs.prototype.pretest=function(t){return this.re.pretest.test(t)};Qs.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};Qs.prototype.match=function(t){const n=[];let s=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Ng(this,s)),s=this.__last_index__);let o=s?t.slice(s):t;for(;this.test(o);)n.push(Ng(this,s)),o=o.slice(this.__last_index__),s+=this.__last_index__;return n.length?n:null};Qs.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const s=this.testSchemaAt(t,n[2],n[0].length);return s?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s,Ng(this,0)):null};Qs.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,o,i){return s!==i[o-1]}).reverse(),mf(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,mf(this),this)};Qs.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Qs.prototype.onCompile=function(){};var wC=Qs,D8=lC({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,p=/[^\0-\x7F]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,w=Math.floor,b=String.fromCharCode;function _(O){throw new RangeError(f[O])}function v(O,W){const V=[];let z=O.length;for(;z--;)V[z]=W(O[z]);return V}function y(O,W){const V=O.split("@");let z="";V.length>1&&(z=V[0]+"@",O=V[1]),O=O.replace(m,".");const se=v(O.split("."),W).join(".");return z+se}function k(O){const W=[];let V=0;const z=O.length;for(;V<z;){const se=O.charCodeAt(V++);if(se>=55296&&se<=56319&&V<z){const Q=O.charCodeAt(V++);(Q&64512)==56320?W.push(((se&1023)<<10)+(Q&1023)+65536):(W.push(se),V--)}else W.push(se)}return W}const T=O=>String.fromCodePoint(...O),E=function(O){return O>=48&&O<58?26+(O-48):O>=65&&O<91?O-65:O>=97&&O<123?O-97:36},C=function(O,W){return O+22+75*(O<26)-((W!=0)<<5)},M=function(O,W,V){let z=0;for(O=V?w(O/700):O>>1,O+=w(O/W);O>g*26>>1;z+=36)O=w(O/g);return w(z+(g+1)*O/(O+38))},$=function(O){const W=[],V=O.length;let z=0,se=128,Q=72,me=O.lastIndexOf("-");me<0&&(me=0);for(let $e=0;$e<me;++$e)O.charCodeAt($e)>=128&&_("not-basic"),W.push(O.charCodeAt($e));for(let $e=me>0?me+1:0;$e<V;){const He=z;for(let Ee=1,te=36;;te+=36){$e>=V&&_("invalid-input");const ee=E(O.charCodeAt($e++));ee>=36&&_("invalid-input"),ee>w((2147483647-z)/Ee)&&_("overflow"),z+=ee*Ee;const Z=te<=Q?1:te>=Q+26?26:te-Q;if(ee<Z)break;const Ae=36-Z;Ee>w(2147483647/Ae)&&_("overflow"),Ee*=Ae}const Be=W.length+1;Q=M(z-He,Be,He==0),w(z/Be)>2147483647-se&&_("overflow"),se+=w(z/Be),z%=Be,W.splice(z++,0,se)}return String.fromCodePoint(...W)},L=function(O){const W=[];O=k(O);const V=O.length;let z=128,se=0,Q=72;for(const He of O)He<128&&W.push(b(He));const me=W.length;let $e=me;for(me&&W.push("-");$e<V;){let He=2147483647;for(const Ee of O)Ee>=z&&Ee<He&&(He=Ee);const Be=$e+1;He-z>w((2147483647-se)/Be)&&_("overflow"),se+=(He-z)*Be,z=He;for(const Ee of O)if(Ee<z&&++se>2147483647&&_("overflow"),Ee===z){let te=se;for(let ee=36;;ee+=36){const Z=ee<=Q?1:ee>=Q+26?26:ee-Q;if(te<Z)break;const Ae=te-Z,G=36-Z;W.push(b(C(Z+Ae%G,0))),te=w(Ae/G)}W.push(b(C(te,0))),Q=M(se,Be,$e===me),se=0,++$e}++se,++z}return W.join("")},P={version:"2.3.1",ucs2:{decode:k,encode:T},decode:$,encode:L,toASCII:function(O){return y(O,function(W){return p.test(W)?"xn--"+L(W):W})},toUnicode:function(O){return y(O,function(W){return d.test(W)?$(W.slice(4).toLowerCase()):W})}};t.exports=P})}),SC=cC(D8()),Gn=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,s=t.length;n<s;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),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s}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}`}};function rv(e,t,n){let s,o=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(s=e.charCodeAt(o),s===10||s===60)return i;if(s===62)return i.pos=o+1,i.str=zc(e.slice(t+1,o)),i.ok=!0,i;if(s===92&&o+1<n){o+=2;continue}o++}return i}let r=0;for(;o<n&&(s=e.charCodeAt(o),!(s===32||s<32||s===127));){if(s===92&&o+1<n){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(s===40&&(r++,r>32))return i;if(s===41){if(r===0)break;r--}o++}return t===o||r!==0||(i.str=zc(e.slice(t,o)),i.pos=o,i.ok=!0),i}var CC=rv;const Cd=-2;function B8(e,t,n){let s=t+1;for(;s<n;){const o=e.charCodeAt(s);if(o===93)return s;if(o===92){s+=2;continue}if(o===96||o===60||o===33&&s+1<n&&e.charCodeAt(s+1)===91||o===91)return Cd;s++}return-1}function lv(e,t,n){let s=1,o=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.__mdtsLinkLabelNoCloseFrom;if(typeof u=="number"&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.__mdtsLinkLabelNoCloseFrom=t+1,-1;const p=B8(l,t,a);if(p!==Cd)return p;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(s--,s===0)){o=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)s++;else if(n)return e.pos=c,-1}}let m=-1;return o&&(m=e.pos),e.pos=c,m}var gf=lv;function av(e,t,n,s){let o,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)r.str=s.str,r.marker=s.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(o=e.charCodeAt(i),o===r.marker)return r.pos=i+1,r.str+=zc(e.slice(t,i)),r.ok=!0,r;if(o===40&&r.marker===41)return r;o===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=zc(e.slice(t,i)),r}var xC=av;function vh(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 cv(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function F8(e,t,n){const s=vh(e,t),o=[t,n];s<0?cv(e,o):e.attrs[s]=o}function H8(e,t){const n=vh(e,t);return n>=0?e.attrs[n][1]:null}function W8(e,t,n){const s=vh(e,t);s<0?cv(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var U8=vC({attrGet:()=>H8,attrIndex:()=>vh,attrJoin:()=>W8,attrPush:()=>cv,attrSet:()=>F8,parseLinkDestination:()=>rv,parseLinkLabel:()=>lv,parseLinkTitle:()=>av});function q8(e){return e.includes("\r")||e.includes("\0")}function TC(e){return typeof e=="string"?e:e.toString()}function j8(e){if(e.inlineMode){const t=new Gn("inline","",0);t.content=TC(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 z8=/^([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])?)*)$/,V8=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function K8(e,t){let n=e.pos;const s=e.src;if(s.charCodeAt(n)!==60)return!1;const o=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=s.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=s.slice(o+1,n);if(V8.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(z8.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 G8=K8;function Y8(e,t){const n=e.src;let s=e.pos;if(n.charCodeAt(s)!==96)return!1;const o=s;s++;const i=e.posMax;for(;s<i&&n.charCodeAt(s)===96;)s++;const r=n.slice(o,s),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=o)return t||(e.pending+=r),e.pos+=l,!0;let a=s,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 p=n.slice(s,c);p.includes(`
48
- `)&&(p=p.replace(/\n/g," ")),p.length>2&&p.charCodeAt(0)===32&&p.charCodeAt(p.length-1)===32&&(p=p.slice(1,-1)),d.content=p}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var X8=Y8;function Yk(e){const t={},n=e.length;if(!n)return;let s=0,o=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[s].marker!==l.marker||o!==l.token-1)&&(s=r),o=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=s-i[s]-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 p=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(p=!0),!p){const m=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+m,i[c]=m,l.open=!1,d.end=r,d.close=!1,u=-1,o=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function Z8(e){const t=e.tokens_meta,n=e.tokens_meta.length;Yk(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&Yk(t[s].delimiters)}var J8=Z8;function Q8(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);if(!o||o.length===0)return!1;for(let i=0;i<o.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function Xk(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=t[o.end],r=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===i.token+1,l=String.fromCharCode(o.marker),a=e.tokens[o.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[s-1].token].content="",e.tokens[t[o.end+1].token].content="",s--)}}function eL(e){const t=e.tokens_meta,n=e.tokens_meta.length;Xk(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&Xk(e,t[s].delimiters)}const Zk={tokenize:Q8,postProcess:eL};function AC(e){return Z1(e)}function uv(e){return e>=48&&e<=57}function tL(e){const t=e|32;return uv(e)||t>=97&&t<=102}function MC(e){const t=e|32;return t>=97&&t<=122}function nL(e){return MC(e)||uv(e)}function sL(e,t,n){let s=t+2;if(s>=n)return null;let o=!1,i=7,r=s;for((e.charCodeAt(s)|32)===120&&(o=!0,i=6,s++,r=s);s<n&&s-r<i;){const l=e.charCodeAt(s);if(!(o?tL(l):uv(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function oL(e,t,n){let s=t+1;if(s>=n||!MC(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&nL(e.charCodeAt(s));)s++;if(s-t-1<2||s>=n||e.charCodeAt(s)!==59)return null;const o=e.slice(t,s+1);return AC(o)!==o?o:null}function iL(e,t){const n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=s)return!1;if(e.src.charCodeAt(n+1)===35){const o=sL(e.src,n,s);if(o){if(!t){const i=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=ph(i)?jc(i):jc(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=oL(e.src,n,s);if(o){const i=AC(o);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var rL=iL;const EC=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Lg=new Array(128),IC=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Lg[e]=`\\${t}`,IC[e]=EC[e]?t:Lg[e]}function Jk(e,t,n){e.pending&&e.pushPending();const s=new Gn("text_special","",0);s.level=e.level,s.content=t,s.markup=n,s.info="escape",e.pendingLevel=e.level,e.tokens.push(s),e.tokens_meta.push(null)}function lL(e,t){let n=e.pos;const s=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=s))return!1;let i=o.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<s&&(i=o.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(Jk(e,IC[i],Lg[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return Jk(e,i<256&&EC[i]?r:l,l),e.pos=n+1,!0}var aL=lL;function cL(e){let t,n,s=0;const o=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=o[t];r&&(r.nesting&&r.nesting<0&&s--,r.level=s,r.nesting&&r.nesting>0&&s++,r.type==="text"&&t+1<i&&o[t+1]?.type==="text"?o[t+1].content=r.content+o[t+1].content:(t!==n&&(o[n]=r),n++))}t!==n&&(o.length=n)}var uL=cL;const $C=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,NC="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",dL=new RegExp(`^(?:${$C}|${NC}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),fL=new RegExp(`^(?:${$C}|${NC})`);function LC(e){return e===32||e===9||e===10||e===12||e===13}function hL(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||LC(t)}function pL(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(!LC(n))return!1}return!1}function mL(e){const t=e|32;return t>=97&&t<=122}function gL(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos,o=e.src;if(o.charCodeAt(s)!==60||s+2>=n)return!1;const i=o.charCodeAt(s+1);if(i!==33&&i!==63&&i!==47&&!mL(i))return!1;const r=o.slice(s).match(dL);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,hL(l)&&e.linkLevel++,pL(l)&&e.linkLevel--}return e.pos+=l.length,!0}var vL=gL;function yL(e,t){let n,s,o,i,r,l,a,c,u="";const d=e.pos,p=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const m=e.pos+2,f=gf(e,e.pos+1,!1);if(f<0)return!1;if(i=f+1,i<p&&e.src.charCodeAt(i)===40){for(i++;i<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=p)return!1;if(l=CC(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<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=xC(e.src,i,e.posMax),i<p&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=p||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<p&&e.src.charCodeAt(i)===91?(c=i+1,i=gf(e,i),i>=0?o=e.src.slice(c,i++):i=f+1):i=f+1,o||(o=e.src.slice(m,f)),r=e.env.references[hh(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(m,f);const g=[];e.md.inline.parse(s,e.md,e.env,g);const w=e.push("image","img",0);w.attrs=[["src",u],["alt",""]],w.children=g,w.content=s,a&&w.attrs.push(["title",a])}return e.pos=i,e.posMax=p,!0}var kL=yL;function bL(e,t){let n,s,o,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,p=e.pos+1,m=gf(e,e.pos,!0);if(m<0)return!1;let f=m+1;if(f<d&&e.src.charCodeAt(f)===40){for(c=!1,f++;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(f>=d)return!1;if(o=CC(e.src,f,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?f=o.pos:r="",a=f;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(o=xC(e.src,f,e.posMax),f<d&&a!==f&&o.ok)for(l=o.str,f=o.pos;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);}(f>=d||e.src.charCodeAt(f)!==41)&&(c=!0),f++}if(c){if(typeof e.env.references>"u")return!1;if(f<d&&e.src.charCodeAt(f)===91?(a=f+1,f=gf(e,f),f>=0?s=e.src.slice(a,f++):f=m+1):f=m+1,s||(s=e.src.slice(p,m)),i=e.env.references[hh(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=p,e.posMax=m;const g=e.push("link_open","a",1),w=[["href",r]];g.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=f,e.posMax=d,!0}var _L=bL;function RC(e){const t=e|32;return t>=97&&t<=122}function wL(e){return e>=48&&e<=57}function SL(e){return RC(e)||wL(e)||e===43||e===45||e===46}function CL(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&SL(e.charCodeAt(t));)t--;return t++,t>=e.length||!RC(e.charCodeAt(t))?null:e.slice(t)}function xL(e,t,n){let s=t;for(;s<n;){const o=e.charCodeAt(s);if(o<=32||o===127||o===60)break;s++}return e.slice(t,s)}function TL(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,s=e.posMax;if(n+3>s||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=CL(e.pending);if(!o)return!1;const i=xL(e.src,n-o.length,s),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=o.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,-o.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 p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=l.length-o.length,!0}function AL(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,o=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let i=s-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<o;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var ML=AL;function EL(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==126)return!1;const o=e.scanDelims(e.pos,!0);if(!o)return!1;let i=o.length;const r=String.fromCharCode(s);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:s,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function Qk(e,t){let n;const s=[],o=t.length;for(let i=0;i<o;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==="~"&&s.push(l.token-1)}for(;s.length;){const i=s.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 IL(e){const t=e.delimiters;Qk(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&Qk(e,n[s].delimiters)}const eb={tokenize:EL,postProcess:IL};function tb(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 $L(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||tb(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!tb(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var NL=$L;function dv(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function LL(e){if(e.length===0)return 0;const t=e.slice().sort((s,o)=>s-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function RL(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 OC(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,s={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:dv(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function ta(e,t,n,s,o,i){const r=OC(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=RL(t,n));a.calls++,a.inclusiveMs+=s,s>a.maxMs&&(a.maxMs=s),a.samples.push(s),i?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=dv()}function OL(e){const t=OC(e);if(!t)return null;const n=Object.keys(t.records);for(let s=0;s<n.length;s++){const o=t.records[n[s]];o.medianMs=LL(o.samples)}return t.completedAt=dv(),t}var nb=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const s=this.rules.findIndex(o=>o.name===e);s>=0&&this.rules.splice(s,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const s=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(s<0)return;const o=this.rules[s];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(s<0)throw new Error(`Parser rule not found: ${e}`);this.rules[s].fn=t,n?.alt!==void 0&&(this.rules[s].alt=n.alt),this.invalidateCache()}before(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<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(o,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<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(o+1,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,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 s of this.rules)if(s.enabled&&s.alt)for(const o of s.alt)e.add(o);const t=new Map,n=new Map;for(const s of e){const o=[],i=[];for(const r of this.rules)r.enabled&&(s!==""&&!r.alt?.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(s,o),n.set(s,i)}this.cache=t,this.namedCache=n}},PC=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;maxNesting;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.tokens_meta=new Array(s.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.maxNesting=t.options.maxNesting}pushPending(){const e=new Gn("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 Gn(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 s=new Gn(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s}scanDelims(e,t){const{src:n,posMax:s}=this,o=n.charCodeAt(e);let i=e;for(;i<s&&n.charCodeAt(i)===o;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<s?n.charCodeAt(i):32,c=qc(l),u=qc(a),d=Mg(l),p=Mg(a),m=!u&&(!p||c||d),f=!c&&(!d||u||p);return{can_open:m&&(t||!f||d),can_close:f&&(t||!m||p),length:r}}};PC.prototype.Token=Gn;function PL(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 DC(e){for(let t=0;t<e.length;t++)if(PL(e.charCodeAt(t)))return!1;return!0}var DL=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new nb,this.ruler2=new nb,this.ruler.push("text",NL),this.ruler.push("linkify",TL),this.ruler.push("newline",ML),this.ruler.push("escape",aL),this.ruler.push("backticks",X8),this.ruler.push("strikethrough",eb.tokenize),this.ruler.push("emphasis",Zk.tokenize),this.ruler.push("link",_L),this.ruler.push("image",kL),this.ruler.push("autolink",G8),this.ruler.push("html_inline",vL),this.ruler.push("entity",rL),this.ruler2.push("balance_pairs",J8),this.ruler2.push("strikethrough",eb.postProcess),this.ruler2.push("emphasis",Zk.postProcess),this.ruler2.push("fragments_join",uL),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),s=n.length,o=e.cache,i=o[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<s;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(ta(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<s;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++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,s=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<s;){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>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos<s;){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=o[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ta(e.env,"inline",o[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>=s)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,s){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&DC(e)){const a=new Gn("text","",0);a.content=e,s.push(a);return}const o=new PC(e,t,n,s);this.tokenize(o);const i=this.getRules2(),r=i.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](o,!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(o,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ta(o.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,s){this.parseSource(e,t,n,s)}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 BL(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let s=0,o=t.length;s<o;s++){const i=t[s];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&DC(i.content)){const r=new Gn("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const FL=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,HL=/[0-9a-z]/i;function WL(e){return/^<a[>\s]/i.test(e)}function UL(e){return/^<\/a\s*>/i.test(e)}function qL(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const s=t.raw[n-1],o=t.raw[n];if(!FL.test(s)||!HL.test(o))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 jL(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const s=t[n];if(s.type!=="inline"||!e.md.linkify.pretest(s.content))continue;let o=s.children;o||(o=[],s.children=o);let i=0;for(let r=o.length-1;r>=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(WL(l.content)&&i>0&&i--,UL(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(m=>qL(e.md.linkify,m));if(c.length===0)continue;const u=[];let d=l.level,p=0;c.length>0&&c[0].index===0&&r>0&&o[r-1].type==="text_special"&&(c=c.slice(1));for(let m=0;m<c.length;m++){const f=c[m],g=e.md.normalizeLink(f.url);if(!e.md.validateLink(g))continue;let w=f.text;f.schema?f.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 b=f.index;if(b>p){const k=new Gn("text","",0);k.content=a.slice(p,b),k.level=d,u.push(k)}const _=new Gn("link_open","a",1);_.attrs=[["href",g]],_.level=d++,_.markup="linkify",_.info="auto",u.push(_);const v=new Gn("text","",0);v.content=w,v.level=d,u.push(v);const y=new Gn("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),p=f.lastIndex}if(p!==0){if(p<a.length){const m=new Gn("text","",0);m.content=a.slice(p),m.level=d,u.push(m)}o.splice(r,1,...u)}}}}const zL=/\r\n?|\n/g,VL=/\0/g;function KL(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),s=t.includes("\0");if(!n&&!s)return;let o=t;n&&(o=o.replace(zL,`
49
- `)),s&&(o=o.replace(VL,"�")),e.src=o}const BC=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,GL=/\((?:c|tm|r)\)/i,YL=/\((c|tm|r)\)/gi,XL={c:"©",r:"®",tm:"™"};function ZL(e,t){return XL[t.toLowerCase()]}function JL(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(YL,ZL)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function QL(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&BC.test(s.content)&&(s.content=s.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–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function eR(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 s=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");GL.test(s)&&JL(n.children||[]),BC.test(s)&&QL(n.children||[])}}var tR=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(s=>s.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(s=>s.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 s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,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 nR=/['"]/,sb=/['"]/g,ob="’";function td(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function sR(e,t){let n;const s=[],o=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=s.length-1;n>=0&&!(s[n].level<=l);n--);if(s.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){sb.lastIndex=c;const d=sb.exec(a);if(!d)break;let p=!0,m=!0;c=d.index+1;const f=d[0]==="'";let g=32;if(d.index-1>=0)g=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let 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 b=hf(g)||ff(String.fromCharCode(g)),_=hf(w)||ff(String.fromCharCode(w)),v=qc(g),y=qc(w);if(y?p=!1:_&&(v||b||(p=!1)),v?m=!1:b&&(y||_||(m=!1)),w===34&&d[0]==='"'&&g>=48&&g<=57&&(m=p=!1),p&&m&&(p=b,m=_),!p&&!m){f&&(r.content=td(r.content,d.index,ob));continue}if(m)for(n=s.length-1;n>=0;n--){let k=s[n];if(s[n].level<l)break;if(k.single===f&&s[n].level===l){k=s[n];let T,E;f?(T=o[2]||"‘",E=o[3]||"’"):(T=o[0]||"“",E=o[1]||"”"),r.content=td(r.content,d.index,E),e[k.token].content=td(e[k.token].content,k.pos,T),c+=E.length-1,k.token===i&&(c+=T.length-1),a=r.content,u=a.length,s.length=n;continue e}}p?s.push({token:i,pos:d.index,single:f,level:l}):m&&f&&(r.content=td(r.content,d.index,ob))}}}function oR(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 s=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!nR.test(s)||!n.children||sR(n.children,e)}}function iR(e){const t=e.tokens||[],n=t.length;for(let s=0;s<n;s++){const o=t[s];if(o.type!=="inline"||!Array.isArray(o.children))continue;const i=o.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 rR=/^(?:vbscript|javascript|file|data):/,lR=/^data:image\/(?:gif|png|jpeg|webp);/,FC=["http:","https:","mailto:"];function HC(e){const t=e.trim().toLowerCase();return rR.test(t)?lR.test(t):!0}function WC(e){const t=Q1(e,!0);if(t.hostname&&(!t.protocol||FC.includes(t.protocol)))try{t.hostname=SC.default.toASCII(t.hostname)}catch{}return dC(J1(t))}function UC(e){const t=Q1(e,!0);if(t.hostname&&(!t.protocol||FC.includes(t.protocol)))try{t.hostname=SC.default.toUnicode(t.hostname)}catch{}return Ag(J1(t),`${Ag.defaultChars}%`)}function aR(e){switch(e){case 9:case 32:return!0}return!1}function cR(e,t,n,s){const o=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 p=e.lineMax;if(a[t]-e.blkIndent>=4||o.charCodeAt(u)!==62)return!1;if(s)return!0;const m=[],f=[],g=[],w=[],b=e.md.block.ruler.getRulesForState(e,"blockquote"),_=e.parentType;e.parentType="blockquote";let v=!1,y;for(y=t;y<n;y++){const M=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(o.charCodeAt(u++)===62&&!M){let L=a[y]+1,D,R;o.charCodeAt(u)===32?(u++,L++,R=!1,D=!0):o.charCodeAt(u)===9?(D=!0,(c[y]+L)%4===3?(u++,L++,R=!1):R=!0):D=!1;let P=L;for(m.push(i[y]),i[y]=u;u<d;){const O=o.charCodeAt(u);if(aR(O))O===9?P+=4-(P+c[y]+(R?1:0))%4:P++;else break;u++}v=u>=d,f.push(c[y]),c[y]=a[y]+1+(D?1:0),g.push(a[y]),a[y]=P-L,w.push(l[y]),l[y]=u-i[y];continue}if(v)break;let $=!1;for(let L=0,D=b.length;L<D;L++)if(b[L](e,y,n,!0)){$=!0;break}if($){e.lineMax=y,e.blkIndent!==0&&(m.push(i[y]),f.push(c[y]),w.push(l[y]),g.push(a[y]),a[y]-=e.blkIndent);break}m.push(i[y]),f.push(c[y]),w.push(l[y]),g.push(a[y]),a[y]=-1}const k=e.blkIndent;e.blkIndent=0;const T=e.push("blockquote_open","blockquote",1);T.markup=">";const E=[t,0];T.map=E,e.md.block.tokenize(e,t,y);const C=e.push("blockquote_close","blockquote",-1);C.markup=">",e.lineMax=p,e.parentType=_,E[1]=e.line;for(let M=0;M<w.length;M++)i[M+t]=m[M],l[M+t]=w[M],a[M+t]=g[M],c[M+t]=f[M];return e.blkIndent=k,!0}function uR(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,o,4+e.blkIndent,!1)}
50
- `,i.map=[t,e.line],!0}function dR(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>i)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const c=e.src.slice(l,o),u=e.src.slice(o,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(s)return!0;let d=t,p=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],o<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(o)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(o=e.skipChars(o,r),!(o-l<a)&&(o=e.skipSpaces(o),!(o<i)))){p=!0;break}a=e.sCount[t],e.line=d+(p?1:0);const m=e.push("fence","code",0);return m.info=u,m.content=e.getLines(t+1,d,a,!0),m.markup=c,m.map=[t,e.line],!0}const ib=["","h1","h2","h3","h4","h5","h6"],rb=["","#","##","###","####","#####","######"];function lb(e){switch(e){case 9:case 32:return!0}return!1}function fR(e,t,n,s){const o=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=o.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=o.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=o.charCodeAt(++a);if(d>6||a<c&&!lb(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const p=e.skipCharsBack(c,35,a);p>a&&lb(o.charCodeAt(p-1))&&(c=p),e.line=t+1;const m=e.push("heading_open",ib[d],1);m.markup=rb[d],m.map=[t,e.line];const f=e.push("inline","",0);f.content=o.slice(a,c).trim(),f.map=[t,e.line],f.children=[];const g=e.push("heading_close",ib[d],-1);return g.markup=rb[d],!0}function hR(e){switch(e){case 9:case 32:return!0}return!1}function pR(e,t,n,s){const o=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<o;){const c=e.src.charCodeAt(i++);if(c!==r&&!hR(c))return!1;c===r&&l++}if(l<3)return!1;if(s)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 El=[[/^<(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(`${fL.source}\\s*$`),/^$/,!1]];function mR(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,i),l=0;for(;l<El.length&&!El[l][0].test(r);l++);if(l===El.length)return!1;if(s)return El[l][2];let a=t+1;if(!El[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(o=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(o,i),El[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 gR(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function qC(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function jC(e,t,n){if(t>=n)return!1;const s=e.charCodeAt(t);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:gR(e,t,n)}const ab=["","h1","h2"];function vR(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=qC(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let p=0,m,f=t+1;for(;f<n;f++){const y=i[f]+r[f],k=l[f];if(y>=k)break;if(a[f]-c>3)continue;if(a[f]>=c&&(m=o.charCodeAt(y),m===45||m===61)){let E=y+1,C=E;for(;E<k&&o.charCodeAt(E)===m;)E++;for(C=E;E<k;){const M=o.charCodeAt(E);if(M!==9&&M!==32)break;E++}if(E>=k){p=m===61?1:2;break}if(C-y>1)continue}if(a[f]<0||u&&!jC(o,y,k))continue;let T=!1;for(let E=0,C=s.length;E<C;E++)if(s[E](e,f,n,!0)){T=!0;break}if(T)break}if(!p)return!1;let g;if(f===t+1){const y=i[t]+r[t];let k=l[t];for(;k>y;){const T=o.charCodeAt(k-1);if(T!==9&&T!==32)break;k--}g=o.slice(y,k)}else g=e.getLines(t,f,c,!1).trim();e.line=f+1;const w=m===61?"=":"-",b=e.push("heading_open",ab[p],1);b.markup=w,b.map=[t,e.line];const _=e.push("inline","",0);_.content=g,_.map=[t,e.line-1],_.children=[];const v=e.push("heading_close",ab[p],-1);return v.markup=w,e.parentType=d,!0}function zC(e){switch(e){case 9:case 32:return!0}return!1}function cb(e,t){const n=e.eMarks,s=e.bMarks,o=e.tShift,i=e.src,r=n[t];let l=s[t]+o[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!zC(i.charCodeAt(l))?-1:l}function ub(e,t){const n=e.bMarks,s=e.tShift,o=e.eMarks,i=e.src,r=n[t]+s[t],l=o[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),!zC(c))?-1:a}function yR(e,t,n){const s=e.bMarks,o=e.tShift,i=e.src,r=s[t]+o[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const kR=["0","1","2","3","4","5","6","7","8","9"];function bR(e,t){const n=e.level+2,s=e.tokens;for(let o=t+2,i=s.length-2;o<i;o++){const r=s[o];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,s[o+2].hidden=!0,o+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++o<i;)l+=s[o].nesting}}}}function _R(e,t,n,s){let o,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;s&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,p;const m=e.src,f=e.bMarks,g=e.tShift,w=e.eMarks,b=e.sCount,_=e.bsCount,v=f[l]+g[l];if(v>=w[l])return!1;const y=m.charCodeAt(v);if(y>=48&&y<=57){if(p=ub(e,l),p<0||(u=!0,r=v,d=yR(e,l,p),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(p=cb(e,l),p<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(p)>=w[l])return!1;if(s)return!0;const k=m.charCodeAt(p-1),T=String.fromCharCode(k);if(u){const D=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(D.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const E=[l,0];e.tokens[e.tokens.length-1].map=E,e.tokens[e.tokens.length-1].markup=T;let C=!1;const M=e.tokens.length-1,$=e.md.block.ruler.getRulesForState(e,"list"),L=e.parentType;for(e.parentType="list";l<n;){i=p,o=w[l];const D=b[l]+p-(f[l]+g[l]);let R=D;for(;i<o;){const Be=m.charCodeAt(i);if(Be===9)R+=4-(R+_[l])%4;else if(Be===32)R++;else break;i++}const P=i;let O;P>=o?O=1:O=R-D,O>4&&(O=1);const W=D+O,V=e.push("list_item_open","li",1);V.markup=T;const z=[l,0];V.map=z,u&&(V.info=p-r-1===1?kR[m.charCodeAt(r)-48]:m.slice(r,p-1));const se=e.tight,Q=e.tShift[l],me=e.sCount[l],$e=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=W,e.tight=!0,e.tShift[l]=P-f[l],e.sCount[l]=R,P>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||C)&&(a=!1),C=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=$e,e.tShift[l]=Q,e.sCount[l]=me,e.tight=se,e.push("list_item_close","li",-1).markup=T,l=e.line,z[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let He=!1;for(let Be=0,Ee=$.length;Be<Ee;Be++)if($[Be](e,l,n,!0)){He=!0;break}if(He)break;if(u){if(p=ub(e,l),p<0)break;r=f[l]+g[l]}else if(p=cb(e,l),p<0)break;if(k!==m.charCodeAt(p-1))break}return u?e.push("ordered_list_close","ol",-1).markup=T:e.push("bullet_list_close","ul",-1).markup=T,E[1]=l,e.line=l,e.parentType=L,a&&bR(e,M),!0}function db(e){return e===9||e===32}function wR(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=qC(e);let p=t+1;for(e.parentType="paragraph";p<n&&!e.isEmpty(p);p++){if(c[p]-u>3||c[p]<0)continue;if(o==="list"&&c[p]>=u){const v=r[p]+l[p],y=a[p];if(v<y){const k=i.charCodeAt(v);if(k===42||k===45||k===43){if(v+1>=y||db(i.charCodeAt(v+1)))break}else if(k>=48&&k<=57&&v+1<y){let T=v+1;for(;;){if(T>=y){T=-1;break}const E=i.charCodeAt(T++);if(E>=48&&E<=57){if(T-v>=10){T=-1;break}continue}if((E===41||E===46)&&(T>=y||db(i.charCodeAt(T))))break;T=-1;break}if(T>=0)break}}}const w=r[p]+l[p],b=a[p];if(d&&!jC(i,w,b))continue;let _=!1;for(let v=0,y=s.length;v<y;v++)if(s[v](e,p,n,!0)){_=!0;break}if(_)break}const m=e.getLines(t,p,u,!1).trim();e.line=p;const f=e.push("paragraph_open","p",1);f.map=[t,e.line];const g=e.push("inline","",0);return g.content=m,g.map=[t,e.line],g.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function nd(e){switch(e){case 9:case 32:return!0}return!1}function SR(e,t,n,s){let o=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(o)!==91)return!1;function a(v){const y=e.lineMax;if(v>=y||e.isEmpty(v))return null;let k=!1;if(e.sCount[v]-e.blkIndent>3&&(k=!0),e.sCount[v]<0&&(k=!0),!k){const C=e.parentType;e.parentType="reference";let M=!1;for(let $=0,L=l.length;$<L;$++)if(l[$](e,v,y,!0)){M=!0;break}if(e.parentType=C,M)return null}const T=e.bMarks[v]+e.tShift[v],E=e.eMarks[v];return e.src.slice(T,E+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const v=c.charCodeAt(o);if(v===91)return!1;if(v===93){u=o;break}else if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(v===92&&(o++,o<i&&c.charCodeAt(o)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const v=c.charCodeAt(o);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!nd(v))break}const d=e.md.helpers.parseLinkDestination(c,o,i);if(!d.ok)return!1;const p=e.md.normalizeLink(d.str);if(!e.md.validateLink(p))return!1;o=d.pos;const m=o,f=r,g=o;for(;o<i;o++){const v=c.charCodeAt(o);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!nd(v))break}let w=e.md.helpers.parseLinkTitle(c,o,i);for(;w.can_continue;){const v=a(r);if(v===null)break;c+=v,o=i,i=c.length,r++,w=e.md.helpers.parseLinkTitle(c,o,i,w)}let b;for(o<i&&g!==o&&w.ok?(b=w.str,o=w.pos):(b="",o=m,r=f);o<i&&nd(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&b)for(b="",o=m,r=f;o<i&&nd(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const _=hh(c.slice(1,u));return _?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[_]>"u"&&(e.env.references[_]={title:b,href:p}),e.line=r),!0):!1}function lm(e){switch(e){case 9:case 32:return!0}return!1}const CR=65536;function am(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function xR(e,t){for(let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];n<s;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function fb(e){const t=[],n=e.length;let s=0,o=e.charCodeAt(s),i=!1,r=0,l="";for(;s<n;)o===124&&(i?(l+=e.substring(r,s-1),r=s):(t.push(l+e.substring(r,s)),l="",r=s+1)),i=o===92,s++,o=e.charCodeAt(s);return t.push(l+e.substring(r)),t}function TR(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[o])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!lm(l)||r===45&&lm(l)||!xR(e,t))return!1;for(;i<e.eMarks[o];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!lm(y))return!1;i++}let a=am(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const k=c[y].trim();if(!k){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(k))return!1;k.charCodeAt(k.length-1)===58?u.push(k.charCodeAt(0)===58?"center":"right"):k.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=am(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=fb(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(s)return!0;const p=e.parentType;e.parentType="table";const m=e.md.block.ruler.getRulesForState(e,"blockquote"),f=e.push("table_open","table",1),g=[t,0];f.map=g;const w=e.push("thead_open","thead",1);w.map=[t,t+1];const b=e.push("tr_open","tr",1);b.map=[t,t+1];for(let y=0;y<c.length;y++){const k=e.push("th_open","th",1);u[y]&&(k.attrs=[["style",`text-align:${u[y]}`]]);const T=e.push("inline","",0);T.content=c[y].trim(),T.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let _,v=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let y=!1;for(let T=0,E=m.length;T<E;T++)if(m[T](e,o,n,!0)){y=!0;break}if(y||(a=am(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=fb(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>CR))break;if(o===t+2){const T=e.push("tbody_open","tbody",1);T.map=_=[t+2,0]}const k=e.push("tr_open","tr",1);k.map=[o,o+1];for(let T=0;T<d;T++){const E=e.push("td_open","td",1);u[T]&&(E.attrs=[["style",`text-align:${u[T]}`]]);const C=e.push("inline","",0);C.content=c[T]?c[T].trim():"",C.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return _&&(e.push("tbody_close","tbody",-1),_[1]=o),e.push("table_close","table",-1),g[1]=o,e.parentType=p,e.line=o,!0}var AR=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,s){const o=this._rules.findIndex(r=>r.name===e);if(o<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(o,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}after(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<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(o+1,0,{name:t,enabled:!0,fn:n,alt:s?.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:s,fn:o})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=o(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return ta(i?.env,"block",s,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const s=this._rules.findIndex(o=>o.name===e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[s].fn=t,n?.alt&&(this._rules[s].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}`)}s.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!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}`)}s.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this._rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const s of this._rules)if(s.enabled)for(const o of s.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const s of e){const o=[],i=[];for(const r of this._rules)r.enabled&&(s!==""&&!r.alt.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t[s]=o,n[s]=i}this.cache=t,this.namedCache=n}};function hb(e){switch(e){case 9:case 32:return!0}return!1}var VC=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s;const o=this.src;let i=0,r=0,l=0,a=!1;for(let c=0,u=o.length;c<u;c++){const d=o.charCodeAt(c);if(!a)if(hb(d)){i++,d===9?r+=4-r%4:r++;continue}else a=!0;(d===10||c===u-1)&&(d!==10&&c++,this.bMarks.push(l),this.eMarks.push(c),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),a=!1,i=0,r=0,l=c+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const o=new Gn(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new Gn(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,s=this.eMarks;for(let o=this.lineMax;e<o&&!(t[e]+n[e]<s[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const s=t.charCodeAt(e);if(s!==9&&s!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const s=n.charCodeAt(--e);if(s!==9&&s!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let s=n.length;e<s&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const s=this.src;for(;e>n;)if(t!==s.charCodeAt(--e))return e+1;return e}getLines(e,t,n,s){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let p=d;const m=s?this.eMarks[u]+1:this.eMarks[u];let f=0;const g=this.src,w=this.bsCount,b=this.tShift;for(;p<m&&f<n;){const _=g.charCodeAt(p);if(_===9||_===32)_===9?f+=4-(f+w[u])%4:f++;else if(p-d<b[u])f++;else break;p++}return f>n?new Array(f-n+1).join(" ")+g.slice(p,m):g.slice(p,m)}const o=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 p=0;const m=r[d];let f=m,g;for(d+1<t||s?g=l[d]+1:g=l[d];f<g&&p<n;){const w=i.charCodeAt(f);if(hb(w))w===9?p+=4-(p+a[d])%4:p++;else if(f-m<c[d])p++;else break;f++}p>n?o[u]=new Array(p-n+1).join(" ")+i.slice(f,g):o[u]=i.slice(f,g)}return o.join("")}};VC.prototype.Token=Gn;const sd=[["table",TR,["paragraph","reference"]],["code",uR],["fence",dR,["paragraph","reference","blockquote","list"]],["blockquote",cR,["paragraph","reference","blockquote","list"]],["hr",pR,["paragraph","reference","blockquote","list"]],["list",_R,["paragraph","reference","blockquote"]],["reference",SR],["html_block",mR,["paragraph","reference","blockquote"]],["heading",fR,["paragraph","reference","blockquote"]],["lheading",vR],["paragraph",wR]];var MR=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new AR;for(let e=0;e<sd.length;e++)this.ruler.push(sd[e][0],sd[e][1],{alt:(sd[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const s=this.getRules(),o=s.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 m=e.line;let f=!1;for(let g=0;g<o;g++)if(f=s[g](e,u,n,!1),f){if(m>=e.line)throw new Error("block rule didn't increment state.line");break}if(!f)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 p=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 m=e.line;let f=!1;for(let g=0;g<o;g++){const w=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();f=p[g].fn(e,u,n,!1);const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ta(e.env,"block",p[g].name,b-w,f,!1),f){if(m>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!f)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,s){if(!e||e.length===0)return;const o=new VC(e,t,n,s);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},KC=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}};KC.prototype.Token=Gn;const pb=[["normalize",KL],["block",j8],["inline",BL],["linkify",jL],["replacements",eR],["smartquotes",oR],["text_join",iR]],ER={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},IR={parseLinkLabel:lv,parseLinkDestination:rv,parseLinkTitle:av};function $R(){return{...ER}}function NR(){return{...IR}}var LR=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new MR,this.inline=new DL,this.ruler=new tR;for(let e=0;e<pb.length;e++){const[t,n]=pb[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:$R(),helpers:NR(),normalizeLink:WC,normalizeLinkText:UC,validateLink:HC,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new wC),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 KC(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 s=0;s<n.length;s++)n[s](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ta(e.env,"core",t[n].name,o-s,!0,!1)}OL(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&q8(e))return this.parse(TC(e),t,n);const s=this.createState(e,t,n);return this.process(s),this.lastState=s,s}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 RR={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function vf(e,t,n={},s){Us(n);const o={...RR,...s||{}},i=es(t);if(o.fallbackOnGlobalState!==!1&&i)return rm(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),ea(n,i,()=>e.core.parse(t,n,e).tokens);let r=xd(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=BR(r,o.maxChunks)),Td(t,r))return rm(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),ea(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return rm(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),ea(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),p=e.core.parse(d,n,e).tokens;l!==0&&p.length&&PR(p,l),DR(a,p),l+=u.lineCount}return a})}function xd(e,t,n=!0){const s=[];let o=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(p){p<=r||(s.push({start:r,end:p,lineCount:l}),r=p,o=0,i=0,l=0)}for(let p=0;p<e.length;){let m=e.indexOf(`
51
- `,p),f=m;m===-1?(m=e.length,f=e.length):f=m+1;const g=FR(e,p,m);if(t.fenceAware){let _=p;for(;_<m;){const y=e.charCodeAt(_);if(y===32||y===9)_++;else break}const v=e[_];if(v==="`"||v==="~"){let y=_;for(;y<m&&e[y]===v;)y++;const k=y-_;k>=3&&(u?u.marker===v&&k>=u.length&&(u=null):u={marker:v,length:k})}}const w=f-p;o+=w,i+=1,l+=1,g?(a=0,c=0):(a+=1,c+=w);const b=g;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(b)d(f);else{const _=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=_||c>=v)&&d(f)}p=f}return n&&d(e.length),s}function Td(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!OR(e,t[o].end))return!0;return!1}function OR(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 s=n+1;s<t-1;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function PR(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function DR(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function BR(e,t){if(e.length<=t)return e;const n=[];let s=0;for(let o=0;o<t;o++){const i=t-o,r=e.length-s,l=Math.ceil(r/i),a=e.slice(s,s+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}),s+=l}return n}function FR(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}const GC=4e6,YC=8e4,HR=1e4,WR=200,UR=1e4,qR=200;function XC(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function jR(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function Ui(e){return e.length===0?0:gn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function zR(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function VR(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
52
- `,s);o===-1&&(o=e.length);let i=s;for(;i<o;){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<o&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}s=o===e.length?e.length:o+1}return n!==null}function KR(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 zR(e,n+1,e.length-1)?!VR(e,t):!1}function GR(e,t,n,s={}){const o=s.mode??"full",i=s.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(s.maxChunkChars!==void 0||s.maxChunkLines!==void 0||s.autoTune===!1){const r=s.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??UR:e.options.fullChunkSizeChars??HR),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??qR:e.options.fullChunkSizeLines??WR);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return o==="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 lu=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=Ui(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=xd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(Td(this.pending,s,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const o=this.commitRanges(s,e);return this.pending=this.pending.slice(o),this.updateEnvDiagnostics(e,t,Ui(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!KR(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Ui(this.pending)),null;const n=xd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Ui(this.pending)),null;const s=Td(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Ui(this.pending)}]:n;return this.commitRanges(s,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const s=this.resolveWindow();return this.updateEnvDiagnostics(e,s,0),this.tokens}const t=this.resolveWindow(),n=xd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=Td(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Ui(this.pending)}]:n;this.commitRanges(s,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:Ui(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Ui(this.pending);return GR(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(ru(e)&&Ii(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=es(t);n&&(ov(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let s=0;s<e.length;s++){const o=e[s],i=this.pending.slice(o.start,o.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&jR(r,a),this.options.retainTokens!==!1&&XC(this.tokens,r),this.committedChars+=i.length,this.committedLines+=o.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:o.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=o.end}return this.markedGlobalStateReason&&iv(t),n}catch(s){throw this.markedGlobalStateReason&&(Ii(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){bC(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 YR(e,t,n={},s={}){Us(n);const o=new lu(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function XR(e,t,n={},s={}){Us(n);const o=new lu(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function ZR(e,t,n,s={},o={}){Us(s);const i=new lu(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}async function JR(e,t,n,s={},o={}){Us(s);const i=new lu(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}function ZC(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??GC,o=e.options.autoUnboundedThresholdLines??YC;return t>=s||n>=o}function JC(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??GC))return"yes";const s=e.options.autoUnboundedThresholdLines??YC;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function vc(e,t,n={},s={}){Us(n);const o=es(t);if(ru(n)&&Ii(n),s.fallbackOnGlobalState!==!1&&o)return bC(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:gn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),ea(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new lu(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){XC(i,l)}});if(o&&ov(n,o),r.feed(t),r.flushForce(n),o&&(iv(n),s.fallbackOnGlobalState===!1)){const l=mi(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const na=(e,t,n)=>e<t?t:e>n?n:e;function QC(e){return e.experimental?{...e,...e.experimental}:e}const mb=[{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"}],gb=[{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 ex(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function QR(e,t=Math.max(0,e/40|0),n={}){const s=QC(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<mb.length;l++){const a=mb[l];if(e<=a.max){if(a.strategy!=="adaptive")return ex(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:na(Math.ceil(e/i),8e3,64e3),maxChunkLines:na(Math.ceil(t/i),150,700),maxChunks:na(Math.ceil(e/64e3),i,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.fullChunkSizeChars??1e4,maxChunkLines:s.fullChunkSizeLines??200,fenceAware:o,maxChunks:s.fullChunkMaxChunks}}function vb(e,t=Math.max(0,e/40|0),n={}){const s=QC(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<gb.length;l++){const a=gb[l];if(e<=a.max){if(a.strategy!=="adaptive")return ex(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:na(Math.ceil(e/i),8e3,64e3),maxChunkLines:na(Math.ceil(t/i),150,700),maxChunks:na(Math.ceil(e/64e3),i,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.streamChunkSizeChars??1e4,maxChunkLines:s.streamChunkSizeLines??200,maxChunks:s.streamChunkMaxChunks,fenceAware:o}}var eO={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"]}}},tO={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},nO={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"]}}};const sO=/[&<>"]/,yb=/[&<>"]/g,oO=/&/g,iO=/[<>"]/g,rO={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function cm(e){return rO[e]||e}function on(e){if(e.length===0)return"";if(e.length<32)return sO.test(e)?e.replace(yb,cm):e;const t=e.includes("&"),n=e.includes("<"),s=e.includes(">"),o=e.includes('"');return!t&&!n&&!s&&!o?e:t&&!n&&!s&&!o?e.replace(oO,"&amp;"):t?e.replace(yb,cm):e.replace(iO,cm)}const lO=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),aO=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function tx(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(lO,(t,n,s)=>{if(n)return n;if(aO.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return ph(i)?jc(i):"�"}const o=Z1(t);return o!==t?o:t})}function yh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Ad(e,t){if(yh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const kb=e=>yh(e)?e:Promise.resolve(e);function yc(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 on(e)}}function fr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${yc(t[0])}="${on(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${yc(o[0])}="${on(o[1])}"`}return n}function nx(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const s=e.charCodeAt(t);if(s===32||s===9||s===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const s=e.charCodeAt(n);if(s!==32&&s!==9&&s!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function kc(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
53
- `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${on(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
54
- `;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${s}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${fr(r)}>${t}</code></pre>
55
- `}return`<pre><code${fr(e.attrs)}>${t}</code></pre>
56
- `}function yf(e){return!e.attrs||e.attrs.length===0?`<code>${on(e.content)}</code>`:`<code${fr(e.attrs)}>${on(e.content)}</code>`}function Rg(e){const t=on(e.content);return e.attrs?`<pre${fr(e.attrs)}><code>${t}</code></pre>
57
- `:`<pre><code>${t}</code></pre>
58
- `}function cO(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="${on(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${on(n[0][1])}">`}return null}function bb(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${yc(t[0][0])}="${on(t[0][1])}">`:t.length===2?`<a ${yc(t[0][0])}="${on(t[0][1])}" ${yc(t[1][0])}="${on(t[1][1])}">`:`<a${fr(t)}>`}function uO(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 _b(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 kf(e,t){if(e.hidden)return"";const n=e.attrs,s=e.nesting,o=e.tag;if(!n||n.length===0)return s===0?t?`<${o} />`:`<${o}>`:s===-1?`</${o}>`:`<${o}>`;let i=(s===-1?"</":"<")+o+fr(n);return s===0&&t&&(i+=" /"),`${i}>`}const dO={langPrefix:"language-",xhtmlOut:!1,breaks:!1},od=Object.prototype.hasOwnProperty,Zt={code_inline(e,t){return yf(e[t])},code_block(e,t){return Rg(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?tx(i.info).trim():"",{langName:l,langAttrs:a}=nx(r),c=n.highlight,u=on(i.content);if(!c)return kc(i,u,r,l,n);const d=c(i.content,l,a);return yh(d)?d.then(p=>kc(i,p||u,r,l,n)):kc(i,d||u,r,l,n)},image(e,t,n,s,o){const i=e[t],r=o.renderInlineAsText(i.children||[],n,s),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]],kf(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
59
- `:`<br>
60
- `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
61
- `:`<br>
62
- `:`
63
- `},text(e,t){return on(e[t].content)},text_special(e,t){return on(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function wb(e,t,n){const s=e.info?tx(e.info).trim():"",{langName:o,langAttrs:i}=nx(s),r=t.highlight,l=on(e.content);if(!r)return kc(e,l,s,o,t);const a=r(e.content,o,i);if(yh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return kc(e,a||l,s,o,t)}function id(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===Zt.text)return l.content.length===0?"":on(l.content);break;case"text_special":if(o.text_special===Zt.text_special)return l.content.length===0?"":on(l.content);break;case"softbreak":if(o.softbreak===Zt.softbreak)return r;break;case"hardbreak":if(o.hardbreak===Zt.hardbreak)return i;break;case"html_inline":if(o.html_inline===Zt.html_inline)return l.content;break;case"code_inline":if(o.code_inline===Zt.code_inline)return yf(l);break}const a=o[l.type];if(!a)return kf(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:Ad(c,l.type)}var fO=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Zt}}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 s=this.mergeOptions(t),o=n??{},i=this.rules,r=s.xhtmlOut===!0;let l,a,c,u,d,p,m="",f="",g=!1,w="";for(let b=0;b<e.length;b++){const _=e[b],v=_.type,y=b>0&&e[b-1].hidden?`
64
- `:"";if(v==="list_item_open"&&(!_.attrs||_.attrs.length===0)&&b+3<e.length){const E=e[b+1],C=e[b+2],M=e[b+3];if(E.type==="paragraph_open"&&E.hidden&&C.type==="inline"&&M.type==="paragraph_close"&&M.hidden){w+=`${y}<li>${this.renderInlineTokens(C.children||[],s,o)}`,b+=3;continue}}if(b+2<e.length){const E=e[b+1],C=e[b+2];if(E.type==="inline"&&C.nesting===-1&&C.tag===_.tag&&!C.hidden){const M=cO(_,y);if(M!==null){w+=`${M+this.renderInlineTokens(E.children||[],s,o)}</${_.tag}>
65
- `,b+=2;continue}}}if(v==="inline"){const E=_.children||[];if(E.length===1){g||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,p=i.code_inline,m=s.xhtmlOut?`<br />
66
- `:`<br>
67
- `,f=s.breaks?m:`
68
- `,g=!0);const C=E[0];switch(C.type){case"text":if(l===Zt.text){w+=on(C.content);continue}break;case"text_special":if(a===Zt.text_special){w+=on(C.content);continue}break;case"softbreak":if(c===Zt.softbreak){w+=f;continue}break;case"hardbreak":if(u===Zt.hardbreak){w+=m;continue}break;case"html_inline":if(d===Zt.html_inline){w+=C.content;continue}break;case"code_inline":if(p===Zt.code_inline){w+=yf(C);continue}break}}w+=this.renderInlineTokens(E,s,o);continue}const k=i[v];if(!k){const E=_.attrs;if(!_.hidden){if(!E||E.length===0)switch(v){case"hr":w+=r?`<hr />
69
- `:`<hr>
70
- `;continue;case"heading_open":w+=`<${_.tag}>`;continue;case"heading_close":w+=`</${_.tag}>
71
- `;continue;case"paragraph_open":w+=`${y}<p>`;continue;case"paragraph_close":w+=`</p>
72
- `;continue;case"list_item_open":{const C=e[b+1];w+=y+(C&&(C.type==="inline"||C.hidden||C.nesting===-1&&C.tag==="li")?"<li>":`<li>
73
- `);continue}case"list_item_close":w+=`</li>
74
- `;continue;case"bullet_list_open":w+=`${y}<ul>
75
- `;continue;case"bullet_list_close":w+=`</ul>
76
- `;continue;case"blockquote_open":w+=y+(e[b+1]&&e[b+1].nesting===-1&&e[b+1].tag==="blockquote"?"<blockquote>":`<blockquote>
77
- `);continue;case"blockquote_close":w+=`</blockquote>
78
- `;continue;case"ordered_list_open":w+=`${y}<ol>
79
- `;continue;case"ordered_list_close":w+=`</ol>
80
- `;continue;case"table_open":w+=`${y}<table>
81
- `;continue;case"table_close":w+=`</table>
82
- `;continue;case"thead_open":w+=`${y}<thead>
83
- `;continue;case"thead_close":w+=`</thead>
84
- `;continue;case"tbody_open":w+=`${y}<tbody>
85
- `;continue;case"tbody_close":w+=`</tbody>
86
- `;continue;case"tr_open":w+=`${y}<tr>
87
- `;continue;case"tr_close":w+=`</tr>
88
- `;continue;case"td_open":w+=`${y}<td>`;continue;case"td_close":w+=`</td>
89
- `;continue;case"th_open":w+=`${y}<th>`;continue;case"th_close":w+=`</th>
90
- `;continue}else if(E.length===1){const C=E[0];if(v==="ordered_list_open"&&C[0]==="start"){w+=`${y}<ol start="${on(C[1])}">
91
- `;continue}if(v==="td_open"&&C[0]==="style"){w+=`${y}<td style="${on(C[1])}">`;continue}if(v==="th_open"&&C[0]==="style"){w+=`${y}<th style="${on(C[1])}">`;continue}}}w+=this.renderToken(e,b,s);continue}if(v==="code_block"&&k===Zt.code_block){w+=Rg(_);continue}if(v==="fence"&&k===Zt.fence){w+=wb(_,s);continue}if(v==="html_block"&&k===Zt.html_block){w+=_.content;continue}const T=k(e,b,s,o,this);typeof T=="string"?w+=T:w+=Ad(T,_.type)}return w}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=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||[],s,o);continue}const c=i[a.type];c?r+=await kb(c(e,l,s,o,this)):r+=this.renderToken(e,l,s)}return r}renderInline(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokens(e,s,o)}async renderInlineAsync(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokensAsync(e,s,o)}renderInlineAsText(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineAsTextInternal(e,s,o)}renderAttrs(e){return fr(e.attrs)}renderToken(e,t,n){const s=e[t];if(s.hidden)return"";const o=s.block,i=s.nesting,r=s.tag,l=s.attrs;let a=!1;if(o&&(a=!0,i===1&&t+1<e.length)){const p=e[t+1];(p.type==="inline"||p.hidden||p.nesting===-1&&p.tag===r)&&(a=!1)}const c=o&&i!==-1&&t>0&&e[t-1].hidden?`
92
- `:"",u=a?`>
93
- `:">";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+fr(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 s=()=>(n||(n={...t}),n);if(od.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),od.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(od.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(od.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...dO,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===Zt.code_block)return Rg(t);if(i==="html_block"&&o.html_block===Zt.html_block)return t.content;const r=this.mergeOptions(n),l=s??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[i];if(!a)return t.block?this.renderToken(e,0,r):kf(t,r.xhtmlOut===!0);if(i==="fence"&&a===Zt.fence)return wb(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Ad(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const s=this.rules,o=s.text,i=s.text_special,r=s.softbreak,l=s.hardbreak,a=s.html_inline,c=s.code_inline,u=s.link_open,d=s.link_close,p=s.em_open,m=s.em_close,f=s.strong_open,g=s.strong_close,w=t.xhtmlOut===!0,b=w?`<br />
94
- `:`<br>
95
- `,_=t.breaks?b:`
96
- `;if(e.length===1)return id(e,t,n,this,s,b,_);let v="";for(let y=0;y<e.length;y++){const k=e[y];if(k.type==="link_open"&&!u&&!d&&y+2<e.length){const C=e[y+1];if(e[y+2].type==="link_close"&&uO(C)){const M=`${bb(k)+id([C],t,n,this,s,b,_)}</a>`;if(r===Zt.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=M+_,y+=3;continue}v+=M,y+=2;continue}}if(k.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${bb(k)}</a>`,y+=1;continue}if(k.type==="em_open"&&!p&&!m&&y+2<e.length){const C=e[y+1];if(e[y+2].type==="em_close"&&_b(C)){v+=`<em>${id([C],t,n,this,s,b,_)}</em>`,y+=2;continue}}if(k.type==="strong_open"&&!f&&!g&&y+2<e.length){const C=e[y+1];if(e[y+2].type==="strong_close"&&_b(C)){v+=`<strong>${id([C],t,n,this,s,b,_)}</strong>`,y+=2;continue}}switch(k.type){case"text":if(o===Zt.text){const C=k.content.length===0?"":on(k.content);if(a===Zt.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(v+=C+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}v+=C;continue}break;case"text_special":if(i===Zt.text_special){k.content.length!==0&&(v+=on(k.content));continue}break;case"softbreak":if(r===Zt.softbreak){v+=_;continue}break;case"hardbreak":if(l===Zt.hardbreak){v+=b;continue}break;case"html_inline":if(a===Zt.html_inline){for(v+=k.content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}break;case"code_inline":if(c===Zt.code_inline){v+=yf(k);continue}break}const T=s[k.type];if(!T){v+=k.block?this.renderToken(e,y,t):kf(k,w);continue}const E=T(e,y,t,n,this);typeof E=="string"?v+=E:v+=Ad(E,k.type)}return v}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const s=this.rules;let o="";for(let i=0;i<e.length;i++){const r=s[e[i].type];r?o+=await kb(r(e,i,t,n,this)):o+=this.renderToken(e,i,t)}return o}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let s="";for(let o=0;o<e.length;o++){const i=e[o];switch(i.type){case"text":case"text_special":s+=i.content;break;case"image":s+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":s+=i.content;break;case"softbreak":case"hardbreak":s+=`
97
- `;break}}return s}},hO=fO;const pO=[];function Sb(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var mO=class{core;cache=null;stats=Sb();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=Sb(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(Us(s??o?.env),!o||s&&s!==o.env){const D=s??{},R=!!n.__explicitStreamChunkFallbackSetting,P=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,O=!!n.options?.streamChunkedFallback,W=!R&&P,V=O||W,z=n.options?.streamChunkAdaptive!==!1,se=n.options?.streamChunkTargetChunks??8,Q=n.options?.streamChunkSizeChars,me=n.options?.streamChunkSizeLines,$e=n.options?.streamChunkMaxChunks,He=!!n.__explicitStreamChunkConfig,Be=n.options?.autoTuneChunks!==!1,Ee=n.options?.streamChunkFenceAware??!0,te=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,ee=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let Z,Ae=e.length>=te;if(!Ae&&ee!==void 0&&(Z=gn(e),Ae=Z>=ee),Ae){const oe=this.parseFullDocument(e,D,n,Z,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",zn(D,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!mi(D)?.unbounded}),oe.tokens}else if(V){const oe=(q,X,de)=>q<X?X:q>de?de:q;Z===void 0&&(Z=gn(e));const J=Be&&!He?vb(e.length,Z,n.options):null,F=J?.maxChunkChars??(z?oe(Math.ceil(e.length/se),8e3,64e3):Q??1e4),Y=J?.maxChunkLines??(z?oe(Math.ceil(Z/se),150,700):me??200),le=J?.maxChunks??(z?oe(Math.ceil(e.length/64e3),se,32):$e),re=e.length>0&&e.charCodeAt(e.length-1)===10,fe=W&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&J?.strategy!=="plain";if((O||fe)&&(e.length>=F*2||Z>=Y*2)&&re){const q=vf(n,e,D,{maxChunkChars:F,maxChunkLines:Y,fenceAware:J?.fenceAware??Ee,maxChunks:le});return this.cache={src:e,tokens:q,env:D,lineCount:Z,lastSegment:void 0,globalStateReason:es(e)},this.updateCacheLineCount(this.cache,Z),this.recordChunkedParseResult(D,O?"explicit-initial-large-doc":"default-initial-large-doc"),q}}const G=this.parseFullDocument(e,D,n,Z);return Z=G.lineCount,this.cache={src:e,tokens:G.tokens,env:D,lineCount:Z,lastSegment:void 0,globalStateReason:es(e)},this.updateCacheLineCount(this.cache,Z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",zn(D,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!mi(D)?.unbounded}),G.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",zn(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;let i=o.globalStateReason;i===void 0&&(i=es(o.src),o.globalStateReason=i);const r=es(e),l=i||r;if(l){const D=s??o.env;Ii(D);const R=this.parseFullDocument(e,D,n),P=R.tokens,O=R.lineCount;return this.cache={src:e,tokens:P,env:D,lineCount:O,lastSegment:void 0,globalStateReason:r},this.updateCacheLineCount(this.cache,O),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",zn(D,{area:"stream",path:"stream-full",reason:`global-state:${l}`,unbounded:!!mi(D)?.unbounded}),P}const a=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length<a&&e.length<a*1.5&&!e.startsWith(o.src)){const D=s??o.env,R=this.parseFullDocument(e,D,n),P=R.tokens,O=R.lineCount;return this.cache={src:e,tokens:P,env:D,lineCount:O,lastSegment:void 0,globalStateReason:es(e)},this.updateCacheLineCount(this.cache,O),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",zn(D,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!mi(D)?.unbounded}),P}const c=this.getAppendedSegment(o.src,e);if(c&&!this.shouldPreferTailReparseForAppend(o)){let z=function(Ee){const te=Ee.length;let ee=0;for(;ee<=te;){let Z=Ee.indexOf(`
98
- `,ee);Z===-1&&(Z=te);const Ae=Z<te;let G=ee,oe=0;for(;G<Z;){const J=Ee.charCodeAt(G);if(J===32){if(oe++,G++,oe>=4)return!0;continue}if(J===9){if(oe+=4-oe%4,G++,oe>=4)return!0;continue}break}if(G<Z){const J=Ee.charCodeAt(G);switch(J){case 35:{let F=G;for(;F<Z&&Ee.charCodeAt(F)===35;)F++;const Y=F-G;if(Y>0&&Y<=6){if(F<Z){const le=Ee.charCodeAt(F);if(le===32||le===9||le===13)return!0}else if(F===Z&&Ae)return!0}break}case 62:{const F=G+1;if(F<Z){const Y=Ee.charCodeAt(F);if(Y===32||Y===9||Y===13)return!0}else if(F===Z&&Ae)return!0;break}case 45:case 42:case 43:{const F=G+1;if(F<Z){const Y=Ee.charCodeAt(F);if(Y===32||Y===9||Y===13)return!0}else if(F===Z&&Ae)return!0;break}case 96:case 126:{let F=G;for(;F<Z&&Ee.charCodeAt(F)===J;)F++;if(F-G>=3)return!0;break}default:if(J>=48&&J<=57){let F=G+1;for(;F<Z;){const Y=Ee.charCodeAt(F);if(Y<48||Y>57)break;F++}if(F<Z&&Ee.charCodeAt(F)===46){const Y=F+1;if(Y<Z){const le=Ee.charCodeAt(Y);if(le===32||le===9||le===13)return!0}else if(Y===Z&&Ae)return!0}}break}}if(Z===te)break;ee=Z+1}return!1};const D=o.lineCount??gn(o.src);let R=3;c.length>5e3?R=8:c.length>1e3?R=6:c.length>200&&(R=4),R=Math.min(R,D);let P=null;const O=n.options?.streamContextParseStrategy??"chars",W=n.options?.streamContextParseMinChars??200,V=n.options?.streamContextParseMinLines??2;let se=null;const Q=()=>(se===null&&(se=gn(c)),se),me=this.canDirectlyParseAppend(o),$e=me&&this.shouldUseUnboundedAppend(e,o,c);let He=!1;if(!me)switch(O){case"lines":He=Q()>=V;break;case"constructs":if(c.length>=W){He=!0;break}if(z(c)){He=!0;break}He=Q()>=V;break;case"chars":default:He=c.length>=W}if(R>0&&He){const Ee=this.getTailLines(o.src,R)+c;try{const te=this.core.parse(Ee,o.env,n).tokens,ee=te.findIndex(Z=>Z.map&&typeof Z.map[1]=="number"&&Z.map[1]>R);if(ee!==-1){const Z=te.slice(ee),Ae=D-R;Ae!==0&&this.shiftTokenLines(Z,Ae),P={tokens:Z}}}catch{P=null}}else P=null;if(!P){const Ee=D;if($e)P={tokens:vc(n,c,o.env,{mode:"stream"})},Ee>0&&this.shiftTokenLines(P.tokens,Ee);else{const te=this.core.parse(c,o.env,n);Ee>0&&this.shiftTokenLines(te.tokens,Ee),P=te}}if(o.tokens.length>0&&P.tokens.length>0){const Ee=o.tokens[o.tokens.length-1],te=P.tokens[0];try{Ee.type==="inline"&&te.type==="inline"&&(te.children&&te.children.length>0&&(Ee.children||(Ee.children=[]),this.appendTokens(Ee.children,te.children)),Ee.content=(Ee.content||"")+(te.content||""),P.tokens.shift())}catch{}}const Be=o.tokens.length;if(P.tokens.length>0){let Z=function(J,F){if(!J&&!F)return!0;if(!J||!F||J.length!==F.length)return!1;for(let Y=0;Y<J.length;Y++)if(J[Y][0]!==F[Y][0]||J[Y][1]!==F[Y][1])return!1;return!0},Ae=function(J,F){if(!J&&!F)return!0;if(!J||!F||J.length!==F.length)return!1;for(let Y=0;Y<J.length;Y++)if(!G(J[Y],F[Y]))return!1;return!0},G=function(J,F){if(!J||!F||J.type!==F.type)return!1;const Y=J.map,le=F.map;return!!Y!=!!le||Y&&le&&(Y[0]!==le[0]||Y[1]!==le[1])||J.tag!==F.tag||J.nesting!==F.nesting||J.markup!==F.markup||J.info!==F.info||J.block!==F.block||J.hidden!==F.hidden||!Z(J.attrs,F.attrs)||!Ae(J.children,F.children)?!1:(J.type==="inline",(J.content||"")===(F.content||""))};const Ee=o.tokens,te=P.tokens,ee=Math.min(Ee.length,te.length);let oe=0;for(let J=ee;J>0;J--){let F=!0;for(let Y=0;Y<J;Y++){const le=Ee[Ee.length-J+Y],re=te[Y];if(!G(le,re)){F=!1;break}}if(F){oe=J;break}}oe>0&&te.splice(0,oe),te.length>0&&this.appendTokens(o.tokens,te)}if(o.src=e,o.globalStateReason=es(e),o.lineCount=D+(se??gn(c)),o.tokens.length>Be){const Ee=this.getLastSegment(o.tokens.slice(Be),e);Ee?o.lastSegment={tokenStart:Be+Ee.tokenStart,tokenEnd:Be+Ee.tokenEnd,lineStart:Ee.lineStart,lineEnd:Ee.lineEnd,srcOffset:Ee.srcOffset}:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,$e&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",zn(o.env,{area:"stream",path:$e?"stream-unbounded-append":"stream-append",reason:$e?"large-delta":"safe-append",unbounded:$e}),o.tokens}const u=s??o.env,d=this.tryTailSegmentReparse(e,o,u,n);if(d)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",zn(u,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),d;const p=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,f=!!n.options?.streamChunkedFallback,g=!p&&!c&&m,w=f||g,b=n.options?.streamChunkAdaptive!==!1,_=n.options?.streamChunkTargetChunks??8,v=n.options?.streamChunkSizeChars,y=n.options?.streamChunkSizeLines,k=n.options?.streamChunkMaxChunks,T=!!n.__explicitStreamChunkConfig,E=n.options?.autoTuneChunks!==!1,C=n.options?.streamChunkFenceAware??!0;let M=c&&o.lineCount!==void 0?o.lineCount+gn(c):void 0;if(w){M===void 0&&(M=gn(e));const D=(se,Q,me)=>se<Q?Q:se>me?me:se,R=E&&!T?vb(e.length,M,n.options):null,P=R?.maxChunkChars??(b?D(Math.ceil(e.length/_),8e3,64e3):v??1e4),O=R?.maxChunkLines??(b?D(Math.ceil(M/_),150,700):y??200),W=R?.maxChunks??(b?D(Math.ceil(e.length/64e3),_,32):k),V=e.length>0&&e.charCodeAt(e.length-1)===10,z=g&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&R?.strategy!=="plain";if((f||z)&&(e.length>=P*2||M>=O*2)&&V){const se=vf(n,e,u,{maxChunkChars:P,maxChunkLines:O,fenceAware:R?.fenceAware??C,maxChunks:W});return this.cache={src:e,tokens:se,env:u,lineCount:M,lastSegment:void 0,globalStateReason:es(e)},this.updateCacheLineCount(this.cache,M),this.recordChunkedParseResult(u,f?"explicit-fallback-large-doc":"default-fallback-large-doc"),se}}const $=this.parseFullDocument(e,u,n,M),L=$.tokens;return M=$.lineCount,this.cache={src:e,tokens:L,env:u,lineCount:M,lastSegment:void 0,globalStateReason:es(e)},this.updateCacheLineCount(this.cache,M),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",zn(u,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!mi(u)?.unbounded}),L}recordChunkedParseResult(e,t){const n=mi(e)?.chunk,s=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,s){this.stats.fullParses+=1,this.stats.lastMode="full",zn(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!mi(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",zn(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=es(e);ru(t)&&Ii(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?JC(n,e.length,s):"no";if(r==="yes"){const a=vc(n,e,t);return zn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?gn(e):0)}}let l=s;if(r==="need-lines"&&(l=gn(e),ZC(n,e.length,l))){const a=vc(n,e,t);return zn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?gn(e):0),{tokens:ea(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:gn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t){if(!t.startsWith(e)||!e.endsWith(`
99
- `))return null;const n=t.slice(e.length);if(!n)return null;const s=n.length;if(n.charCodeAt(s-1)!==10)return null;let o=0,i=-1;for(let l=0;l<s&&!(n.charCodeAt(l)===10&&(i===-1&&(i=l),o++,o>=2));l++);if(o<2)return null;const r=(i===-1?n:n.slice(0,i)).trim();if(r.length===0)return null;if(/^[-=]+$/.test(r)){const l=e.slice(0,-1),a=l.lastIndexOf(`
100
- `);if(l.slice(a+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(n)?null:n}tryTailSegmentReparse(e,t,n,s){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const i=t.src.slice(0,o.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.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,s,o,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,s),u=this.getLastSegment(c.tokens,l);return o.lineStart>0&&this.shiftTokenLines(c.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=es(e),t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=gn(e),u?t.lastSegment={tokenStart:o.tokenStart+u.tokenStart,tokenEnd:o.tokenStart+u.tokenEnd,lineStart:o.lineStart+u.lineStart,lineEnd:o.lineStart+u.lineEnd,srcOffset:o.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let s=e.length-1;s>=0;s--)if(e.charCodeAt(s)===10&&(n--,n===0))return e.slice(s+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,s=e.slice(n),o=s.length;let i=null,r=0;for(;r<=o;){let l=s.indexOf(`
101
- `,r);l===-1&&(l=o);let a=r;for(;a<l;){const c=s.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=s.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&s.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===o)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??pO}getStats(){return{...this.stats}}appendTokens(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}updateCacheLineCount(e,t){e.lineCount=t??gn(e.src),e.lastSegment=void 0}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t){if(e.length===0)return null;let n=Number.POSITIVE_INFINITY,s=-1,o=0;for(let i=e.length-1;i>=0;i--){const r=e[i];if(r.map&&(r.map[0]<n&&(n=r.map[0]),r.map[1]>s&&(s=r.map[1])),r.nesting<0){o+=-r.nesting;continue}if(r.nesting>0){if(o-=r.nesting,r.level===0&&o<=0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}continue}if(r.level===0&&o===0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}}return null}getLineStartOffset(e,t){if(t<=0)return 0;let n=t,s=-1;for(;n>0;){if(s=e.indexOf(`
102
- `,s+1),s===-1)return e.length;n--}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,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.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,s).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 p=t.lineCount??gn(t.src);p>0&&this.shiftTokenLines(d,p);const m=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),f=this.getListParagraphMode(u,0,u.length,0);return(m==="loose"||f==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.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=es(e),t.lineCount=gn(e),r.map&&(r.map[1]=this.getDocLineCount(e)),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:this.getDocLineCount(e),srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.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(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const p=this.getTableBodySection(d,0,d.length,0),m=this.getTableBodySection(t.tokens,o.tokenStart,t.tokens.length,r.level);if(!p||!m||p.tbodyOpenIndex<0||p.tbodyCloseIndex<0)return null;const f=m.tbodyOpenIndex>=0?d.slice(p.tbodyOpenIndex+1,p.tbodyCloseIndex):d.slice(p.tbodyOpenIndex,p.tbodyCloseIndex+1);if(f.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(f,g);const w=m.tbodyCloseIndex>=0?m.tbodyCloseIndex:m.tableCloseIndex;t.tokens.splice(w,0,...f),t.src=e,t.env=n,t.globalStateReason=es(e),t.lineCount=gn(e);const b=this.getDocLineCount(e);if(r.map&&(r.map[1]=b),m.tbodyOpenIndex>=0){const _=t.tokens[m.tbodyOpenIndex];_?.map&&(_.map[1]=b)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:b,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
103
- `);if(t<0)return null;const n=e.indexOf(`
104
- `,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,s){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===s){o=l;break}}if(o<0)return null;let i=-1,r=-1;for(let l=t+1;l<o;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===s+1){i=l;break}}if(i>=0){for(let l=o-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===s+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,s){if(e.length<2)return!1;const o=e[0],i=e[e.length-1];if(o.type!==t||i.type!==n||o.level!==0||i.level!==0||s!==void 0&&o.markup!==s)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,s){let o=!1,i=!1;const r=s+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?o=!0:i=!0,o&&i))return"loose"}return i?"loose":o?"tight":"none"}setListParagraphVisibility(e,t,n,s,o){const i=s+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=o)}}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 s=e.charCodeAt(n);if(s===32||s===9){n--;continue}return s===10}return!0}getDocLineCount(e){const t=gn(e);return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;const n=[...e];for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}};const Cb={default:tO,zero:nO,commonmark:eO};function gO(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function vO(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 xb(e){return e.experimental?{...e,...e.experimental}:e}function fo(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 Tb(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(fo(t,o)||fo(e,o))return!0}return!1}function Ab(e,t,n){return fo(t,n)||fo(e,n)}function Mb(e,t){const n=mi(e)?.chunk;if(n?.fallback){zn(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}zn(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function yO(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,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},s="default",o;!t&&typeof e!="string"?(o=e,s="default"):typeof e=="string"&&(s=e,o=t);const i=Cb[s];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${s}", check name`);if(i?.options&&(n={...n,...i.options}),o&&(n={...n,...o}),n=xb(n),typeof n.quotes=="string"){const k=n.quotes;k.length>=4?n.quotes=[k[0],k[1],k[2],k[3]]:n.quotes=["“","”","‘","’"]}let r=Tb(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=Tb(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=Ab(i?.options,o,"fullChunkedFallback"),c=Ab(i?.options,o,"streamChunkedFallback"),u=!1,d=null;const p=new LR;let m=null;const f=()=>(m||(m=new hO(n)),m);let g=null;const w=()=>(g||(g=new mO(p)),g);let b=null;const _=()=>(b||(b=new wC),b),v=k=>!u&&!!d&&!vO(k,d),y={core:p,block:p.block,inline:p.inline,get linkify(){const k=_();return Object.defineProperty(this,"linkify",{value:k,writable:!0,configurable:!0}),k},get renderer(){const k=f();return Object.defineProperty(this,"renderer",{value:k,writable:!0,configurable:!0}),k},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return v(this)},set(k){const T=xb(k);return this.options={...this.options,...T},(fo(k,"fullChunkSizeChars")||fo(k,"fullChunkSizeLines")||fo(k,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(fo(k,"streamChunkSizeChars")||fo(k,"streamChunkSizeLines")||fo(k,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),fo(k,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),fo(k,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(T),typeof T.stream=="boolean"&&(this.stream.enabled=T.stream,g&&(g.reset(),g.resetStats())),this},configure(k){const T=typeof k=="string"?Cb[k]:k;if(!T)throw new Error("Wrong `markdown-it` preset, can't be empty");if(T.options&&this.set(T.options),T.components){const E=T.components;E.core?.rules&&this.core.ruler.enableOnly(E.core.rules),E.block?.rules&&this.block.ruler.enableOnly(E.block.rules),E.inline?.rules&&this.inline.ruler.enableOnly(E.inline.rules),E.inline2?.rules&&this.inline.ruler2.enableOnly(E.inline2.rules)}return this},enable(k,T){const E=Array.isArray(k)?k:[k],C=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const $ of C){if(!$)continue;const L=$.enable(E,!0);for(let D=0;D<L.length;D++)M.add(L[D])}if(!T){const $=E.filter(L=>!M.has(L));if($.length)throw new Error(`Rules manager: invalid rule name ${$.join(", ")}`)}return this},disable(k,T){const E=Array.isArray(k)?k:[k],C=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const $ of C){if(!$)continue;const L=$.disable(E,!0);for(let D=0;D<L.length;D++)M.add(L[D])}if(!T){const $=E.filter(L=>!M.has(L));if($.length)throw new Error(`Rules manager: invalid rule name ${$.join(", ")}`)}return this},use(k,...T){const E=typeof k=="function"?k:k&&typeof k.default=="function"?k.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const C=[this,...T],M=k;return u=!0,E.apply(M,C),this},render(k,T={}){const E=this.parse(k,T);return f().render(E,this.options,T)},async renderAsync(k,T={}){const E=this.parse(k,T);return f().renderAsync(E,this.options,T)},renderIterable(k,T={}){const E=this.parseIterable(k,T);return f().render(E,this.options,T)},async renderAsyncIterable(k,T={}){const E=await this.parseAsyncIterable(k,T);return f().renderAsync(E,this.options,T)},renderInline(k,T={}){const E=this.parseInline(k,T);return f().render(E,this.options,T)},validateLink:HC,normalizeLink:WC,normalizeLinkText:UC,utils:JN,helpers:{...U8},parse(k,T={}){if(typeof k!="string")throw new TypeError("Input data should be a String");Us(T);let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&v(this)){const M=JC(this,k.length);if(M==="yes"){const $=vc(this,k,T);return zn(T,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),$}M==="need-lines"&&(E=gn(k))}if(!this.stream.enabled){const M=k.length,$=E??gn(k),L=this.options.autoTuneChunks!==!1,D=r,R=!a&&v(this),P=!!this.options.fullChunkedFallback,O=R&&M>=2e5,W=L&&!D?QR(M,$,this.options):null;if((P||O)&&(P?M>=(this.options.fullChunkThresholdChars??2e4)||$>=(this.options.fullChunkThresholdLines??400):O)){if(W&&W.strategy!=="plain"){const V=vf(this,k,T,{maxChunkChars:W.maxChunkChars,maxChunkLines:W.maxChunkLines,fenceAware:W.fenceAware,maxChunks:W.maxChunks});return Mb(T,P?"explicit-full-chunk":"default-large-string"),V}if(P){const V=(te,ee,Z)=>te<ee?ee:te>Z?Z:te,z=this.options.fullChunkAdaptive!==!1,se=this.options.fullChunkTargetChunks??8,Q=V(Math.ceil(M/se),8e3,64e3),me=V(Math.ceil($/se),150,700),$e=z?Q:this.options.fullChunkSizeChars??1e4,He=z?me:this.options.fullChunkSizeLines??200,Be=z?V(Math.ceil(M/64e3),se,32):this.options.fullChunkMaxChunks,Ee=vf(this,k,T,{maxChunkChars:$e,maxChunkLines:He,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Be});return Mb(T,"explicit-full-chunk"),Ee}}if(E!==void 0&&v(this)&&ZC(this,M,$)){const V=vc(this,k,T);return zn(T,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),V}}const C=es(k);return zn(T,{area:"parse",path:"plain",reason:"default-plain"}),ea(T,C,()=>p.parse(k,T,this).tokens)},parseIterable(k,T={}){return Us(T),YR(this,k,T)},parseAsyncIterable(k,T={}){return Us(T),XR(this,k,T)},parseIterableToSink(k,T,E={}){return Us(E),ZR(this,k,T,E)},parseAsyncIterableToSink(k,T,E={}){return Us(E),JR(this,k,T,E)},parseInline(k,T={}){if(typeof k!="string")throw new TypeError("Input data should be a String");Us(T),ru(T)&&Ii(T);const E=p.createState(k,T,this);return E.inlineMode=!0,p.process(E),E.tokens}};if(y.stream={enabled:!!n.stream,parse(k,T){return y.stream.enabled?w().parse(k,T,y):y.parse(k,T??{})},reset(){w().reset()},peek(){return g?g.peek():[]},stats(){return g?g.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){g&&g.resetStats()}},i?.components){const k=i.components;k.core?.rules&&y.core.ruler.enableOnly(k.core.rules),k.block?.rules&&y.block.ruler.enableOnly(k.block.rules),k.inline?.rules&&y.inline.ruler.enableOnly(k.inline.rules),k.inline2?.rules&&y.inline.ruler2.enableOnly(k.inline2.rules)}return d=gO(y),y}var kO=yO;function bO(e,t,n){function s(p){return p.trim().split(" ",2)[0]===t}function o(p,m,f,g,w){return p[m].nesting===1&&p[m].attrJoin("class",t),w.renderToken(p,m,f,g,w)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(p,m,f,g){let w,b=!1,_=p.bMarks[m]+p.tShift[m],v=p.eMarks[m];if(l!==p.src.charCodeAt(_))return!1;for(w=_+1;w<=v&&r[(w-_)%a]===p.src[w];w++);const y=Math.floor((w-_)/a);if(y<i)return!1;w-=(w-_)%a;const k=p.src.slice(_,w),T=p.src.slice(w,v);if(!c(T,k))return!1;if(g)return!0;let E=m;for(;E++,!(E>=f||(_=p.bMarks[E]+p.tShift[E],v=p.eMarks[E],_<v&&p.sCount[E]<p.blkIndent));)if(l===p.src.charCodeAt(_)&&!(p.sCount[E]-p.blkIndent>=4)){for(w=_+1;w<=v&&r[(w-_)%a]===p.src[w];w++);if(!(Math.floor((w-_)/a)<y)&&(w-=(w-_)%a,w=p.skipSpaces(w),!(w<v))){b=!0;break}}const C=p.parentType,M=p.lineMax;p.parentType="container",p.lineMax=E;const $=p.push("container_"+t+"_open","div",1);$.markup=k,$.block=!0,$.info=T,$.map=[m,E],p.md.block.tokenize(p,m+1,E);const L=p.push("container_"+t+"_close","div",-1);return L.markup=p.src.slice(_,w),L.block=!0,p.parentType=C,p.lineMax=M,p.line=E+(b?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 _O(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 s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let w=0;w<a.length;w++){const b=a[w];if(b==="\\"){w++;continue}if(!u&&b==="'"){c=!c;continue}if(!c&&b==='"'){u=!u;continue}if(!c&&!u&&b===":"){d=w;break}}if(d===-1)return null;const p=a.slice(0,d).trim(),m=a.slice(d+1).trim();if(!p)return null;let f=p;if(f.startsWith('"')&&f.endsWith('"')||f.startsWith("'")&&f.endsWith("'"))try{f=JSON.parse(f.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(f))return null;let g;if(!m)g="";else if(m.startsWith('"')&&m.endsWith('"')||m.startsWith("'")&&m.endsWith("'"))try{g=JSON.parse(m.replace(/^'/,'"').replace(/'$/,'"'))}catch{g=m}else/^-?\d+(?:\.\d+)?$/.test(m)?g=Number(m):m==="true"||m==="false"?g=m==="true":m==="null"?g=null:g=m;l[f]=g}return l}function wO(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(bO,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
105
- `}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,s,o)=>{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 p,m;const f=d.indexOf("{"),g=f>=0?d.slice(f).trimStart():void 0;if(f===-1)p=d||void 0;else{if(p=d.slice(0,f).trim()||void 0,g?.startsWith("{")){let k=0,T=-1;for(let E=0;E<g.length;E++)if(g[E]==="{"?k++:g[E]==="}"&&k--,k===0){T=E+1;break}T>0&&(m=g.slice(0,T))}m||(p=d||void 0)}if(o)return!0;const w=!!i.env.__markstreamFinal;let b=n+1,_=!1;for(;b<=s;){const k=i.bMarks[b]+i.tShift[b],T=i.eMarks[b];if(i.src.slice(k,T).trim()===":::"){_=!0;break}b++}_||(b=s);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.meta={...v.meta??{},unclosed:!_&&!w},p&&v.attrSet("data-args",p),m)try{const k=JSON.parse(m);for(const[T,E]of Object.entries(k)){const C=E!=null&&typeof E=="object";v.attrSet(`data-${T}`,C?JSON.stringify(E):String(E))}}catch{const k=_O(m);if(k)for(const[T,E]of Object.entries(k)){const C=E!=null&&typeof E=="object";v.attrSet(`data-${T}`,C?JSON.stringify(E):String(E))}else v.attrSet("data-attrs",m)}const y=[];for(let k=n+1;k<b;k++){const T=i.bMarks[k]+i.tShift[k],E=i.eMarks[k];y.push(i.src.slice(T,E))}if(y.some(k=>k.trim().length>0)){let k=y.join(`
106
- `);k.endsWith(`
107
- `)||(k+=`
108
- `),k.endsWith(`
109
-
110
- `)||(k+=`
111
- `);const T=i.tokens[i.tokens.length-1];T&&(T.raw=k);const E=[];i.md.block.parse(k,i.md,i.env,E),i.tokens.push(...E)}return _&&i.push("vmr_container_close","div",-1),i.line=_?b+1:b,!0},{alt:["paragraph","reference","blockquote","list"]})}const sx=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],SO=["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"],ox=["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"],CO=["svg","g","path"],xO=["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"],TO=["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"],AO=["action","data","href","src","srcset","poster","xlink:href","formaction"],MO=["script"],EO=["pre","script","style","textarea","title"],ll=new Set(sx),IO=new Set(ox),Vc=new Set([...sx,...SO,...ox,...CO]),ix=new Set([...Vc,...xO]),$O=new Set(TO),NO=new Set(AO),au=new Set(MO),rx=new Set(EO);function lx(e){let t="";for(const n of e){const s=n.charCodeAt(0);s<=31||s>=127&&s<=159||/\s/u.test(n)||(t+=n)}return t}const LO={amp:"&",bsol:"\\",colon:":",newline:`
112
- `,sol:"/",tab:" "};function ax(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,s,o)=>{const i=n??s;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return LO[String(o??"").toLowerCase()]??t})}const rd=new Set(["http","https","mailto","tel"]),Xa=new Set(["http","https"]);function cx(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function RO(e,t){return t==="href"||t==="xlink:href"?rd:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Xa:rd}function sa(e,t={}){const n=lx(ax(e)).toLowerCase(),s=String(t.tagName??"").toLowerCase(),o=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 s==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=cx(n);return i?!RO(s,o).has(i):!1}function OO(e){const t=ax(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=cx(lx(t).toLowerCase());return n==="http"||n==="https"}function PO(e,t={}){const n=String(e??"").trim();return n?sa(n,t)?"":n:""}function Eb(e){return PO(e,{tagName:"img",attrName:"src"})}function Vs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hn(e){let t=!1,n=!1;for(let s=0;s<e.length;s++){const o=e[s];if(o==="\\"){s++;continue}if(!n&&o==="'"){t=!t;continue}if(!t&&o==='"'){n=!n;continue}if(!t&&!n&&o===">")return s}return-1}function kh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=s[2]||s[3]||s[4]||"";t.push([o,i])}return t}const DO=/^[a-z][a-z0-9_-]*$/;function Ib(e){return DO.test(String(e??"").trim().toLowerCase())}function Co(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return Ib(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 s=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const o=t.slice(s,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":Ib(o)?o:""}function va(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=Co(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function BO(...e){const t=new Set,n=[];for(const s of e)for(const o of va(s))t.has(o)||(t.add(o),n.push(o));return n}function FO(e){const t=va(e);return{key:t.join(","),tags:t}}function ux(e){return Co(e)}function HO(e,t){const n=String(e??""),s=Co(t);if(!s)return!1;const o=Vs(s),i=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function dx(e,t){const n=Co(t);return!!n&&!Vc.has(n)&&!HO(e,n)}function WO(e,t){const n=String(e??""),s=Co(t);if(!s)return n;const o=Vs(s),i=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const fx=ll,UO=Vc,hx=new Set(IO);hx.delete("details");const qO=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,jO=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Og=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,zO=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function bf(e){return(e.match(Og)?.[1]??"").toLowerCase()}function fv(e){return/^\s*<\s*\//.test(e)}function hv(e,t){return fx.has(t)||/\/\s*>\s*$/.test(e)}function VO(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(!o||o.type!=="html_inline")continue;const i=String(o.content??""),r=bf(i);if(r===t){if(fv(i)){if(n===0)return s;n--;continue}hv(i,r)||n++}}return-1}function KO(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=bf(o);if(i===t){if(fv(o)){n>0&&n--;continue}hv(o,i)||n++}}return n}function $b(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${Vs(t)}(?=[\s>/])[^>]*>`,"gi");s.lastIndex=Math.max(0,n);let o=0,i;for(;(i=s.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:i.index,end:i.index+r.length};o--;continue}a||o++}return null}function GO(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Vs(t)}(?=[\s>/])[^>]*>`,"gi");let s=0,o;for(;(o=n.exec(e))!==null;){const i=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(i);if(r){s>0&&s--;continue}l||s++}return s}function _f(e){const t=e;return String(t.raw??t.content??t.markup??"")}function YO(e){const t=e;return t.meta||(t.meta={}),t.meta}function um(e,t,n){const s=YO(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function XO(e,t){if(!t.size)return;const n=Array.from(t,m=>new RegExp(String.raw`<\s*${Vs(m)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=m=>m?n.some(f=>f.test(m)):!1,r=m=>{if(!(!m||!s.length))for(const f of s)f.raw+=m,f.inner+=m},l=()=>{!s.length||!o||(r(`
113
- `),o=!1)},a=m=>{r(m)},c=m=>{for(let g=0;g<s.length;g++)s[g].raw+=m,g<s.length-1&&(s[g].inner+=m);const f=s.pop();um(f.token,f.raw,f.inner)},u=m=>{const f=s[s.length-1]?.tag;if(!f)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Vs(f)}\s*>`,"i");return m.match(g)?.[0]??null},d=m=>!!u(m),p=(m,f,g)=>{const w=g??(m.type==="html_inline"?bf(f):"");if(!(w&&t.has(w))){r(f);return}const b=fv(f),_=!b&&hv(f,w);if(b){if(!s.length||s[s.length-1].tag!==w){r(f);return}c(f);return}if(r(f),_){um(m,f,"");return}s.push({tag:w,token:m,raw:f,inner:""})};for(const m of e){if(m.type==="inline"&&Array.isArray(m.children)){const f=String(m.content??"");if(d(f)?o=!1:l(),!s.length&&!i(f)){o=!1;continue}let g=0,w=!0;for(const b of m.children){const _=_f(b),v=b.type==="html_inline"?bf(_):"",y=v&&t.has(v);let k=_;if(w&&f&&_&&(s.length||y)){const T=f.indexOf(_,g);if(T!==-1)a(f.slice(g,T)),k=f.slice(T,T+_.length),g=T+_.length;else{if(s.length&&!y)continue;w=!1}}p(b,k,v)}w&&f&&g<f.length&&s.length&&a(f.slice(g)),o=s.length>0;continue}if(s.length&&typeof m.content=="string"){const f=_f(m),g=m.type==="html_block"?u(f):null;if(g){c(`${o?`
114
- `:""}${g}`),o=s.length>0;continue}if(!m.content)continue;l(),r(m.content),o=!0}}for(const m of s)um(m.token,m.raw,m.inner)}function ZO(e){return/^\s*<\s*[!?]/.test(e)}function JO(e){const t=new Set(UO);if(e&&Array.isArray(e))for(const n of e){const s=String(n??"").trim();if(!s)continue;const o=s.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function Nb(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function QO(e,t){let n=null;for(const i of e.matchAll(qO)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Nb(l,t)&&hn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(jO)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Nb(l,t)&&hn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const s=/<\/\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const o=/<\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function eP(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function tP(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(eP(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 p=a.slice(d),m=p.match(Og);if(!m){i("<",c),u=d+1;continue}const f=hn(p);if(f===-1){i("<",c),u=d+1;continue}const g=p.slice(0,f+1),w=(m[1]??"").toLowerCase();t.has(w)?n.push({type:"html_inline",tag:"",content:g,raw:g}):i(g,c),u=d+g.length}}function l(a,c){if(!a)return;const u=QO(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),s={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},o=s.buffer}for(const a of e){if(s){s.buffer+=_f(a),o=s.buffer;const c=hn(s.buffer);if(c===-1)continue;const u=s.buffer.slice(0,c+1),d=s.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),s=null,o=null,d&&l(d);continue}if(a.type==="html_inline"){const c=_f(a),u=(c.match(Og)?.[1]??"").toLowerCase();if(u&&t.has(u)&&hn(c)===-1){s={tag:u,buffer:c,closing:/^<\s*\//.test(c)},o=s.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:o??void 0}}const nP=["a","span","strong","em","b","i","u"];function sP(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const p of t.customHtmlTags){const m=Co(p);m&&n.add(m)}const s=p=>{const m=p,f=new Set(n),g=Array.isArray(m.env?.__markstreamCustomHtmlTags)?m.env.__markstreamCustomHtmlTags:[];for(const v of g){const y=Co(String(v??""));y&&f.add(y)}const w=JO(Array.from(f)),b=new Set(nP);for(const v of f)b.add(v);return{autoCloseInlineTagSet:b,commonHtmlTags:w,customTagSet:f,shouldMergeHtmlBlockTag:v=>f.has(v)||!w.has(v)||hx.has(v)}},o=p=>{if(p.type==="html_block")return String(p.content??"");if(p.type!=="inline"||!Array.isArray(p.children)||p.children.length!==1)return"";const m=p.children[0];return m?.type!=="html_block"?"":String(p.content??m.content??"")},i=(p,m)=>{p.type="html_block",p.content=m,p.raw=m,p.children=[]},r=p=>p.replace(/^(?:\r?\n)+/,""),l=p=>/^(?: {4}|\t)/.test(p),a=p=>p.replace(/^(?: {4}|\t)/gm,""),c=(p,m)=>{const f=r(p);if(!/\S/.test(f))return[];if(l(f))return[{type:"code_block",content:a(f),raw:f}];const g=f.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const w={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return m==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},w,{type:"paragraph_close",tag:"p",nesting:-1}]:m==="text"?[{type:"text",content:g,raw:g}]:[w]},u=(p,m,f)=>p[m-1]?.type==="paragraph_open"&&p[m+1]?.type==="paragraph_close"?"inline":f,d=(p,m)=>{const f=r(m);return!/\S/.test(f)||p.type!=="inline"||!Array.isArray(p.children)?!1:(p.content=`${String(p.content??"")}${f}`,p.children.push({type:"text",content:f,raw:f}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",p=>{const m=p.tokens??[],{commonHtmlTags:f,customTagSet:g}=s(p);for(const w of m){const b=w;if(b.type!=="inline"||!Array.isArray(b.children))continue;const _=String(b.content??""),v=b.children.length?b.children:_.includes("<")?[{type:"text",content:_,raw:_}]:null;if(v)try{const y=tP(v,f);if(b.children=y.children,y.pendingBuffer){const k=_.lastIndexOf(y.pendingBuffer);if(k!==-1){const T=_.slice(0,k);b.content=T,typeof b.raw=="string"&&(b.raw=T)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}XO(m,g)}),e.core.ruler.push("fix_html_inline_tokens",p=>{const m=p.tokens??[],{autoCloseInlineTagSet:f,customTagSet:g,shouldMergeHtmlBlockTag:w}=s(p),b=[];for(let _=0;_<m.length;_++){const v=m[_];if(b.length>0){const[k,T]=b[b.length-1];if(_!==T){if(v.type==="paragraph_open"||v.type==="paragraph_close"){m.splice(_,1),_--;continue}const E=String(v.content??v.raw??"");if(E){const C=m[T],M=`${String(C.content||"")}
115
- ${E}`,$=hn(M),L=$===-1?null:$b(M,k,$+1);if(L){const D=M.slice(0,L.end),R=M.slice(L.end);C.content=D,C.loading=!1,m.splice(_,1),b.pop();const P=d(C,R)?[]:c(R,u(m,_,"paragraph"));P.length&&m.splice(_,0,...P),_--;continue}C.content=M,C.loading!==!1&&(C.loading=!0)}m.splice(_,1),_--;continue}}const y=o(v);if(y){if(ZO(y))continue;const k=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),T=/^\s*<\s*\//.test(y);if(!k||!w(k))continue;if(i(v,y),!T)k&&!new RegExp(`^\\s*<\\s*${k}\\b[^>]*\\/\\s*>`,"i").test(y)&&GO(y,k)>0&&b.push([k,_]);else if(b.length>0&&k&&b[b.length-1][0]===k){const[,E]=b[b.length-1],C=m[E];C.content=`${String(C.content||"")}
116
- ${y}`,C.loading=!1,b.pop(),m.splice(_,1),_--}continue}else if(b.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){m.splice(_,1),_--;continue}const k=v.content||"",T=new RegExp(`<\\s*\\/\\s*${b[b.length-1][0]}\\s*>`,"i").test(k);if(k){const[,E]=b[b.length-1],C=m[E];C.content=`${C.content||""}
117
- ${k}`,C.loading!==!1&&(C.loading=!T)}T&&b.pop(),m.splice(_,1),_--}else continue}if(g.size>0){const _=new Map,v=new Map,y=E=>{let C=_.get(E);return C||(C=new RegExp(`<\\s*${E}\\b`,"i"),_.set(E,C)),C},k=E=>{let C=v.get(E);return C||(C=new RegExp(`<\\s*\\/\\s*${E}\\s*>`,"i"),v.set(E,C)),C},T=[];for(let E=0;E<m.length;E++){const C=m[E],M=String(C.content??"");if(T.length>0){const L=T[T.length-1],D=m[L.index],R=C.type==="html_block"?k(L.tag).exec(M):null;if(R){const W=R.index+R[0].length,V=M.slice(0,W),z=M.slice(W);D.content=`${String(D.content??"")}
118
- ${V}`,Array.isArray(D.children)&&D.children.push({type:"html_inline",content:`</${L.tag}>`,raw:`</${L.tag}>`}),T.pop();const se=d(D,z)?[]:c(z,u(m,E,"paragraph"));se.length?m.splice(E,1,...se):(m.splice(E,1),E--);continue}if(C.type!=="inline")continue;const P=Array.isArray(C.children)?C.children:[],O=VO(P,L.tag);if(O!==-1){const W=P.slice(0,O+1),V=P.slice(O+1),z=W.map(se=>String(se?.content??se?.raw??"")).join("");if(D.content=`${String(D.content??"")}
119
- ${z}`,Array.isArray(D.children)&&D.children.push(...W),V.length){const se=V.map(Q=>String(Q.content??Q.raw??"")).join("");if(se.trim()){const Q=se.replace(/^\s+/,"");if(d(D,se))m.splice(E,1),E--;else if(Q.startsWith("<"))m.splice(E,1,{type:"html_block",content:Q});else{const me=c(se,u(m,E,"paragraph"));m.splice(E,1,...me)}}else m.splice(E,1),E--}else m.splice(E,1),E--;T.pop();continue}D.content=`${String(D.content??"")}
120
- ${M}`,Array.isArray(D.children)&&D.children.push(...P),m.splice(E,1),E--;continue}if(C.type!=="inline")continue;const $=Array.isArray(C.children)?C.children:[];for(const L of g)if(($.length?KO($,L):y(L).test(M)&&!k(L).test(M)?1:0)>0){T.push({tag:L,index:E});break}}}{let _=0;for(let v=0;v<m.length;v++){const y=m[v];if(y.type==="paragraph_open"){_++;continue}y.type==="paragraph_close"&&(_>0?_--:(m.splice(v,1),v--))}}for(let _=0;_<m.length;_++){const v=m[_];if(v.type==="html_block"){const C=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(C.startsWith("!")||C.startsWith("?")){v.loading=!1;continue}if(g.has(C)){const O=String(v.content??""),W=hn(O),V=W===-1?null:$b(O,C,W+1);v.loading=V?!1:v.loading!==void 0?v.loading:!0;const z=V?.start??-1,se=V?V.end-V.start:0;if(z!==-1){const Q=O.slice(0,z+se);let me="";W!==-1&&W<z&&(me=O.slice(W+1,z)),v.children=[{type:C,content:me,raw:Q,attrs:[],tag:C,loading:!1}],v.content=Q,v.raw=Q;const $e=c(O.slice(z+se)||"","text");$e.length&&m.splice(_+1,0,...$e)}else v.children=[{type:C,content:"",raw:O,attrs:[],tag:C,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(C))continue;v.type="inline";const M=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let $;for(;($=M.exec(v.content||""))!==null;)$[1],$[2]||$[3]||$[4];const L=String(v.content??""),D=new RegExp(`<\\/\\s*${C}\\s*>`,"i").exec(L),R=D?D.index:-1,P=D?D[0].length:0;if(R!==-1){const O=L.slice(0,R+P),W=(L.slice(R+P)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:O,tag:C,loading:!1}],v.content=O,v.raw=O,W&&m.splice(_+1,0,W.startsWith("<")?{type:"html_block",content:W}:{type:"text",content:W,raw:W})}else v.children=[{type:"html_block",content:v.content,tag:C,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const C=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),M=v.children[1],$=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&$===C)continue;f.has(C)?(v.children[0].loading=!0,v.children[0].tag=C,v.children.push({type:"html_inline",tag:C,loading:!0,content:`</${C}>`})):v.children=[{type:"html_block",loading:!0,tag:C,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 C=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(f.has(C))continue;v.children=[{type:"html_block",loading:!1,tag:C,content:v.children.map(M=>M.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const y=String(v.content),k=v,T=k.children[0];if(T?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(k.children.length=0);continue}const E=String(T.content??y).match(zO)?.[1]?.toLowerCase()??"";if(E){if(/\/\s*>\s*$/.test(y)||fx.has(E)){k.children=[{type:"html_inline",content:y}];continue}k.children.length=0}}})}function oP(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 iP(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const s=n.tokens??[];for(let o=0;o<s.length;o++){const i=s[o];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&&!oP(l[0]??"")){const a=l[0]??"",c=i.level??0;s.splice(o,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}),o+=2}}})}const px=/\.([a-z0-9]{1,15})$/i,rP=/[_()[\]{}<>]/u,lP=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,aP=/[?#@]/u,cP=/[\\/]/u,uP=/^[\p{L}\p{N}./\\-]+$/u,dP=/^[A-Za-z0-9-]{1,63}$/u,fP=/^xn--[a-z0-9-]{2,59}$/i,hP=/^(?:[A-Z]{1,6}|\d{1,8})$/u,pP=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,mP=/文件名\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,gP=/文件名\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,vP=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,yP=new Set(["ai","md","py","rs","sh","zip"]),mx=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),kP=new Set([...mx,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),bP=new Set(["com","dev","io","page","site"]),_P=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),wP=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 Kc(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function dm(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Kc(n)?n:void 0}function Lb(e,t){if(!Kc(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 Rb(e){const t=cu(e);return Kc(t)?t:void 0}function SP(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Ob(e,t){if(!Kc(t))return;const n=String(e??"").trim().split(/\s+/u).map(SP).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>wf(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>wf(o,{marketTicker:!0}))&&(s.marketTicker=!0),Kc(s)?s:void 0}function br(e,t=!1){let n;return{options(s){return t||s==null?Lb(e,n):Lb(e,dm(Rb(s),Ob(s,n)))},remember(s){const o=Rb(s);n=t?dm(n,o):dm(o,Ob(s,n))},reset(){n=void 0}}}function Pb(e){return dP.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function CP(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return Pb(n)||fP.test(n)?t.every(Pb):!1}function gx(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function xP(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function TP(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function vx(e,t,n){const s=xP(t);return gx(e)&&TP(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function cu(e){const t=String(e??"");return{explicitFilename:mP.test(t),filename:gP.test(t),marketTicker:vP.test(t)}}function AP(e){return CP(e.split(/[\\/]/)[0]??"")}function MP(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function EP(e){if(rP.test(e)||!uP.test(e))return!0;if(cP.test(e))return!AP(e);const t=e.replace(px,"");return gx(t)?!0:t.split(".").filter(Boolean).some(MP)}function IP(e,t,n){if(!(n?kP:mx).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?pP:hP).test(s)}function wf(e,t={}){if(!e||lP.test(e)||aP.test(e))return!1;const n=e.match(px);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return IP(e,s,t.marketTicker===!0)?!0:wP.has(s)?!yP.has(s)||t.filename?!0:EP(e):!!(t.explicitFilename&&bP.has(s)||t.filename&&_P.has(s))}const Db=["!"];function Cs(e){return{type:"text",content:e,raw:e}}function Fr(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 Hr(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 qi(e,t,n){let s="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),s=o[1].trim()}return{type:"link",loading:n,href:t,title:s,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function $P(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(Cs(t))}}function Bb(e,t){let n=-1;for(const s of t){const o=e.indexOf(s);o!==-1&&(n===-1||o<n)&&(n=o)}return n}function NP(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function LP(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(s=>s?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function RP(e,t,n){let s="";for(let o=t+1;o<n;o++){const i=e[o];if(i?.type!=="text"||typeof i.content!="string")return null;s+=i.content}return s||null}function OP(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=PP(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function PP(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=cu(t);for(let s=0;s<=e.length-1;s++){s<0&&(s=0);const o=e[s];if(!o)break;if(o.type==="link_open"&&(o.markup==="linkify"||o.markup==="autolink")){let i=-1;for(let r=s+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=RP(e,s,i),l=NP(o);if(o.markup==="linkify"&&r&&!vx(r,l,t)&&wf(r,n)){e.splice(s,i-s+1,Cs(r));continue}const a=Bb(l,Db);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=Bb(u.content,Db);if(d===-1)continue;const p=u.content[d],m=u.content.slice(0,d);let f=u.content.slice(d);for(let b=c+1;b<i;b++){const _=e[b];_?.type==="text"&&typeof _.content=="string"&&(f+=_.content)}u.content=m,u.raw=m;const g=i-(c+1);g>0&&(e.splice(c+1,g),i=c+1);let w=l;if(a!==-1)w=l.slice(0,a);else if(f){const b=encodeURI(f);if(b&&l.endsWith(b))w=l.slice(0,l.length-b.length);else{const _=p?encodeURI(p):"",v=_?l.indexOf(_):-1;v!==-1&&(w=l.slice(0,v))}}w!==l&&LP(o,w),f&&e.splice(i+1,0,Cs(f));break}}}if(o?.type==="em_open"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("*")){const i=e[s-1].content?.replace(/(\*+)$/,"")||"";e[s-1].content=i,o.type="strong_open",o.tag="strong",o.markup="**";for(let r=s+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(o?.type==="text"&&o.content?.endsWith("(")&&e[s+1]?.type==="link_open"){const i=o.content.match(/\[([^\]]+)\]/);if(i){let r=o.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Cs(r));const c=i[1],u=l[1].length;Fr(a,u);let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(qi(c,d,!e[s+4]?.content?.startsWith(")"))),Hr(a,u),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)\**/,"");p&&a.push(Cs(p)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(Cs(r));let c=i[1];const u=c.match(/^\*+/);if(u){const p=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let m=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(m+=e[s+4]?.content||"",e[s+4].content=""),Fr(a,p),a.push(qi(c,m,!e[s+4]?.content?.startsWith(")"))),Hr(a,p),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(Cs(f)),e.splice(s,5,...a)}else e.splice(s,4,...a);s===0?s=a.length-1:s-=a.length+1;continue}let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(qi(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(Cs(p)),e.splice(s,5,...a)}else e.splice(s,4,...a)}s-=a.length+1;continue}}else if(o.type==="link_open"&&o.markup==="linkify"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("(")){if(e[s-2]?.type==="link_close"){const i=[],r=e[s-3].content||"";let l=o.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[s+3]?.type==="text"){const a=(e[s+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[s+3]?.content?.slice(0,a)||"",e[s+3].content=""),i.push(qi(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(Cs(u)),e.splice(s-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(s-4,7,...i);continue}else if(e[s-1].content==="]("&&e[s-3]?.type==="text"&&e[s-3].content?.endsWith(")"))if(e[s-2]?.type==="strong_open"){const[i,r]=e[s-3].content?.split("[**")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else if(e[s-2]?.type==="em_open"){const[i,r]=e[s-3].content?.split("[*")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else{const[i,r]=e[s-3].content?.split("[")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}}if(o.type==="link_close"&&o.nesting===-1&&e[s-2]?.type==="link_open"&&e[s+1]?.type==="text"&&e[s-1]?.type==="text"){const i=e[s-1].content||"",r=e[s-2].attrs||[],l=r.find(f=>f[0]==="href")?.[1]||"",a=r.find(f=>f[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[s-3]?.content||"").match(/^(\*+)$/),p=[];if(d){u+=1;const f=d[1].length;Fr(p,f)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let f=s+1;f<e.length;f++){const g=d?d[1].length:e[s-3].markup.length,w=e[f];if(g===1&&w.type==="em_close")break;if(g===2&&w.type==="strong_close")break;if(g===3&&(w.type==="em_close"||w.type==="strong_close"))break;c+=1}}const m={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(p.push(m),d){const f=d[1].length;Hr(p,f)}e.splice(s-u,c,...p),s-=p.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].markup?.includes("*")&&e[s-4]?.type==="text"&&e[s-4].content?.endsWith("[")){const i=e[s-1].markup.length,r=[],l=e[s-4].content.slice(0,e[s-4].content.length-i);l&&r.push(Cs(l)),Fr(r,i);const a=e[s-2].content||"";let c=o.content.slice(2),u=!0;if(e[s+1]?.type==="text"){const d=(e[s+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[s+1]?.content?.slice(0,d)||"",e[s+1].content="")}if(r.push(qi(a,c,u)),Hr(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(Cs(d)),e.splice(s-4,8,...r)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...r):e.splice(s-4,7,...r);s-=r.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].type==="strong_close"&&e[s-4]?.type==="text"&&e[s-4]?.content?.includes("**[")){const i=[],r=e[s-4].content.split("**[")[0];r&&i.push(Cs(r)),Fr(i,2);const l=e[s-2].content||"";let a=o.content.slice(2),c=!0;if(e[s+1]?.type==="text"){const u=(e[s+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[s+1]?.content?.slice(0,u)||"",e[s+1].content="")}if(i.push(qi(l,a,c)),Hr(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(Cs(u)),e.splice(s-4,8,...i)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...i):e.splice(s-4,7,...i);s-=i.length+1;continue}else if(o.type==="strong_close"&&e[s+1]?.type==="text"&&e[s+1].content?.includes("](")&&e[s-1].type==="text"&&/\[.*$/.test(e[s-1].content||"")){const i=[],[r,l]=e[s-1].content?.split("[")||["",""];r&&i.push(Cs(r)),Fr(i,2);let[a,c]=e[s+1].content.split("](");a=l+a;let u=4;if(e[s+2]?.type==="link_open"){const p=e[s+2].attrs?.find(m=>m[0]==="href")?.[1];e[s+5]?.type==="text"&&e[s+5].content==="."?(c=(p||c)+e[s+5].content,e[s+5].content=""):c=p||c,u+=3}let d=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,"")),e[s+2]?.type==="text"){const p=(e[s+2]?.content??"").indexOf(")");d=p===-1,p===-1&&(c+=e[s+2]?.content?.slice(0,p)||"",e[s+2].content="")}i.push(qi(a,c,d)),Hr(i,2),e.splice(s-2,u,...i)}if(o.type==="text"&&/\*+\[[^\]]*$/.test(o.content||"")&&e[s+1]?.type==="strong_open"&&e[s+2]?.type==="text"&&e[s+2].content==="]("&&e[s+3]?.type==="link_open"&&e[s+5]?.type==="link_close"&&e[s+6]?.type==="text"&&e[s+6].content===")"&&e[s+7]?.type==="strong_close"){const i=(o.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[s+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[s+4]?.type==="text"&&(l=e[s+4].content||"");const a=[];Fr(a,2),a.push(qi(r,l,!1)),Hr(a,2),e.splice(s,9,...a),s-=a.length-1;continue}}}for(let s=0;s<e.length-1;s++){const o=e[s],i=e[s+1];if(o?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(o.href??"");if(String(o.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;$P(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function DP(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=BP(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function BP(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 FP(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=HP(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function HP(e){let t=0;const n=new Set,s=new Set;let o=0;for(let u=0;u<e.length;u++){const d=e[u],p=d.type;if(p==="strong_open"){t++;const m=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const g=e[f];let w=u+1;for(;w<e.length&&e[w].type==="text"&&e[w].content==="";)w++;const b=e[w];m==="__"&&(g?.content?.endsWith("_")||b?.content?.startsWith("_")||b?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=m,d.raw=m,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(p==="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(p==="em_open"){o++;const m=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const g=e[f];let w=u+1;for(;w<e.length&&e[w].type==="text"&&e[w].content==="";)w++;const b=e[w];m==="_"&&(g?.content?.endsWith("_")||b?.content?.startsWith("_")||b?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=m,d.raw=m,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,s.add(o))}else p==="em_close"&&(s.has(o)&&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),o--,o<0&&(o=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,p=[{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:""}],m=c.slice(0,-1);m&&p.unshift({type:"text",content:m,raw:m}),l.splice(i,d,...p)}return l=WP(l),l}function WP(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const s=e[n],o=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(s?.type==="strong_open"&&o?.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 p=u.slice(0,d),m=u.slice(d+2);t.push(s),t.push(o),t.push(l),p&&t.push({...c,type:"text",content:p,raw:p}),t.push(a),m&&t.push({...c,type:"text",content:m,raw:m}),n+=6;continue}}if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=UP(e,n+6);if(u){t.push(s),t.push(o),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(s)}return t}function UP(e,t){for(let n=t;n<e.length;n++){const s=e[n];if(s?.type==="strong_open")return null;if(s?.type!=="text")continue;const o=String(s.content??""),i=o.indexOf("**");if(i!==-1)return{index:n,beforeClose:o.slice(0,i),afterClose:o.slice(i+2)}}return null}function qP(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=YP(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(s)&&(n.tokens=s)}catch(s){console.error("[applyFixTableTokens] failed to fix table tokens",s)}})}function Fb(){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 Hb(){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 Wb(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 yx(e,t){if(!e.startsWith("|")||e.includes(`
121
- `)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function fm(e){return yx(e)!==null}function kx(e){return/^:?-+:?$/.test(e.trim())}function jP(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(kx)}function zP(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function VP(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(kx)&&zP(n)}function KP(e){return e==="|"||e==="|:"}function GP(e){const t=yx(e);return t!==null&&t.every(n=>!n.includes(":"))}function YP(e,t=!1,n=""){const s=[...e];if(e.length<3)return s;const o=e.length-2,i=e[o];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
122
- `)[0]??"",[a="",c="",...u]=r.split(`
123
- `),d=!t&&!r.includes(`
124
- `)&&/\r?\n$/.test(n)&&fm(r);if(!t&&(r.includes(`
125
- `)&&u.length===0&&fm(a)&&VP(c)||d)){const p=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>Wb(f)),m=[...Fb(),...p,...Hb()];s.splice(o-1,3,...m)}else if(r.includes(`
126
- `)&&u.length===0&&fm(a)&&jP(c)){const p=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>Wb(f)),m=[...Fb(),...p,...Hb()];s.splice(o-1,3,...m)}else r.includes(`
127
- `)&&u.length===0&&GP(a)&&KP(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function XP(e,t,n,s){const o=e.length;if(n==="$$"&&s==="$$"){let c=t;for(;c<o-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=s;let l=0,a=t;for(;a<o;){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 ZP=XP;const JP=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Sf=JP.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),QP=/\\[a-z]+/i,bx="(?:\\\\|\\u0008)",e7=new RegExp(String.raw`${bx}(?:${Sf})\s*\{[^}]+\}`,"i"),t7=new RegExp(String.raw`(?:${bx})?(?:${Sf})\s*\{`,"i"),n7=/\\(?:text|frac|left|right|times)/,s7=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,o7=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,i7=/[A-Z]+\s*\([^)]+\)/i,r7=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,l7=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,a7=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,c7={"\b":"\\b","\v":"\\v","\f":"\\f"};function u7(e){let t="";for(const n of e)t+=c7[n]??n;return t}function rc(e){if(!e)return!1;const t=u7(e),n=t.trim();if(a7.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=QP.test(t),o=e7.test(t),i=t7.test(t),r=n7.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=s7.test(t)&&!o7.test(t),c=i7.test(t),u=r7.test(n),d=l7.test(t),p=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),m=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return s||o||i||r||l||a||c||u||d||p||m}const _x=["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"],d7=["cdot","mathbf{","partial","mu_{"],wx=_x.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Sx="[ \r\b\f\v]",f7=new RegExp(`([^\\\\])(${d7.map(e=>e).join("|")})+`,"g"),h7=/span\{([^}]+)\}/,p7=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,m7=/(^|[^\\])\\\r?\n/g,g7=/(^|[^\\])\\$/g,v7=new RegExp(`(${Sx})|(${wx})\\b`,"g"),Ub=new Map,qb=new Map;function y7(e){if(!e)return v7;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=Ub.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${Sx})|(${o})\\b`,"g");return Ub.set(n,i),i}function k7(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=qb.get(s);if(o)return o;const i=e?[Sf,wx].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Sf].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return qb.set(s,r),r}const jb={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function zb(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Vb(e){const t=/(^|[^\\])(__|\*\*)/g;let n,s=null;for(;(n=t.exec(e))!==null;)s={marker:n[2],index:n.index+(n[1]?.length??0)};return s}function ji(e,t){const n=t?.commands??_x,s=t?.escapeExclamation??!0,o=t?.commands==null,i=y7(o?void 0:n);let r=e.replace(i,(c,u,d,p,m)=>{if(u!==void 0&&jb[u]!==void 0)return`\\${jb[u]}`;if(d&&n.includes(d)){const f=m&&typeof p=="number"?m[p-1]:void 0;return f==="\\"||f&&/\w/.test(f)?c:`\\${d}`}return c});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=k7(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(h7,"span\\{$1\\}").replace(p7,"\\operatorname{span}\\{$1\\}"),l=l.replace(m7,`$1\\\\
128
- `),l=l.replace(g7,"$1\\\\"),l=l.replace(f7,"$1\\$2"),l}function Kb(e){const t=e.trim();return!(!rc(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 b7(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const s=n;let o=1;for(;s+o<e.length&&e[s+o]==="`";)o++;let i=s+o,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===o){r=i;break}i+=l}if(r!==-1){t.push([s,r+o]),n=r+o;continue}n=s+o}return t}function Gb(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function _7(e,t=!1){const n=[];let s=0;for(;s<e.length-1;){if(e[s]==="!"&&e[s+1]==="["){const o=s;let i=s+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([o,l]),s=l;continue}if(t){n.push([o,e.length]),s=e.length;continue}}}s++}return n}function Cx(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function Pg(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(Cx(e,s)){n=s+1;continue}return s}return-1}function hm(e,t){let n=t;for(;n<e.length;){const s=Pg(e,n);if(s===-1)return-1;if(s>0&&e[s-1]==="$"||s+1<e.length&&e[s+1]==="$"){n=s+1;continue}return s}return-1}function pm(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function w7(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const s=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(s)?!1:s===""||/^[)\s,.!?;:]/.test(s)}function mm(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function S7(e,t){const n=(i,r)=>{const l=i,a=!!t?.strictDelimiters,c=!l?.env?.__markstreamFinal,u=(b,_)=>{let v=_;for(;v<b.length&&(b[v]===" "||b[v]===" ");)v++;if(v===_||!(b[v]===`
129
- `||b[v]==="\r"&&b[v+1]===`
130
- `))return _;const y=b.slice(_,v),k=l.push("text","",0);return k.content=y,v};if(/^\*[^*]+/.test(l.src))return!1;const d=[["$$","$$"],["$","$"],["\\(","\\)"]],p=String(l.pending??""),m=Math.max(0,l.pos-p.length);let f=m,g=m;const w=m;for(const[b,_]of d){const v=l.src,y=b7(v),k=_7(v,c);let T=!1;b==="$$"&&f!==w&&(f=w);let E=-1,C=-1,M=0;const $=L=>{if((L==="undefined"||L==null)&&(L=""),L==="\\"){l.pos=l.pos+L.length,f=l.pos;return}if(L==="\\)"||L==="\\("){const P=l.push("text_special","",0);P.content=L==="\\)"?")":"(",P.markup=L,l.pos=l.pos+L.length,f=l.pos;return}if(!L)return;if(b==="$$"&&L.includes("$")){let P=0;for(;P<L.length;){const O=Pg(L,P);if(O===-1){const Ee=L.slice(P);if(Ee){const te=l.push("text","",0);te.content=Ee,l.pos=l.pos+Ee.length,f=l.pos}break}if(O>0&&L[O-1]==="$"||O+1<L.length&&L[O+1]==="$"){const Ee=L.slice(P,O+1);if(Ee){const te=l.push("text","",0);te.content=Ee,l.pos=l.pos+Ee.length,f=l.pos}P=O+1;continue}const W=L.slice(P,O);if(W){const Ee=l.push("text","",0);Ee.content=W,l.pos=l.pos+W.length,f=l.pos}const V=hm(L,O+1);if(V===-1){const Ee=L.slice(O),te=l.push("text","",0);te.content=Ee,l.pos=l.pos+Ee.length,f=l.pos;break}const z=L.slice(O+1,V),se=z.includes("`"),Q=!z||!z.trim(),me=L[V+1],$e=pm(z,me),He=mm(z);if(!se&&!Q&&!$e&&!He){const Ee=l.push("math_inline","math",0);Ee.content=ji(z,t),Ee.markup="$",Ee.raw=`$${z}$`,Ee.loading=!1,l.pos=l.pos+(V-O+1),f=l.pos,P=V+1;continue}const Be=l.push("text","",0);Be.content="$",l.pos=l.pos+1,f=l.pos,P=O+1}return}const D=L.indexOf("![");if(D!==-1){if(D>0){const W=L.slice(0,D),V=l.push("text","",0);V.content=W,l.pos=l.pos+W.length,f=l.pos}const P=L.slice(D).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(P){const[,W,V]=P,z=V.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),se=z?z[1]:V,Q=z&&z[2]?z[2]:null,me=l.push("image","img",0);me.attrs=[["src",se],["alt",W]],Q&&me.attrs.push(["title",Q]),me.content=W,me.children=[{type:"text",content:W,tag:""}],l.pos=l.pos+P[0].length,f=l.pos;const $e=L.slice(D+P[0].length);$e&&$($e);return}const O=l.push("text","",0);O.content=L,l.pos=l.pos+L.length,f=l.pos;return}const R=l.push("text","",0);R.content=L,l.pos=l.pos+L.length,f=l.pos};for(;!(f>=v.length);){const L=v.indexOf(b,f);if(L===-1)break;if(Cx(v,L)){f=L+Math.max(1,b.length);continue}const D=Gb(y,L);if(D){f=D[1];continue}const R=Gb(k,L);if(R){f=R[1];continue}if(L===E&&f===C){if(M++,M>2){f=L+Math.max(1,b.length);continue}}else M=0,E=L,C=f;if(b==="("&&L>0){let $e=L-1;for(;$e>=0&&v[$e]===" ";)$e--;if($e>=0&&v[$e]==="]"){f=L+b.length;continue}}if(b==="$"&&L>0&&v[L-1]==="$"){f=L+1;continue}if(b==="$"&&L<v.length-1&&v[L+1]==="$"){f=L+2;continue}const P=b==="$"?hm(v,L+b.length):ZP(v,L+b.length,b,_);if(P===-1){const $e=v.slice(L+b.length);if($e.includes(b)){f=v.indexOf(b,L+b.length);continue}if(P===-1){const He=b==="$"&&w7($e);if(c&&!a&&!He&&rc($e)&&!$e.includes("`")){if(f=L+b.length,T=!0,!r){l.pending="";const Be=g?v.slice(g,f):v.slice(0,f),Ee=zb(Be)%2===1;if(g)$(v.slice(g,f));else{let te=v.slice(0,f);te.endsWith(b)&&(te=te.slice(0,te.length-b.length)),$(te)}if(Ee){const te=Vb(Be)?.marker??"**",ee=l.push("strong_open","",0);ee.markup=te;const Z=l.push("math_inline","math",0);Z.content=ji($e,t),Z.markup=b==="$$"?"$$":b==="\\("?"\\(\\)":b==="$"?"$":"()",Z.raw=`${b}${$e}${_}`,Z.loading=!0,ee.content=$e,l.push("strong_close","",0)}else{const te=l.push("math_inline","math",0);te.content=ji($e,t),te.markup=b==="$$"?"$$":b==="\\("?"\\(\\)":b==="$"?"$":"()",te.raw=`${b}${$e}${_}`,te.loading=!0}l.pos=v.length}f=v.length,g=f}break}}const O=v.slice(L+b.length,P),W=O.includes("`"),V=!O||!O.trim(),z=b==="$",se=v[P+_.length],Q=z&&pm(O,se),me=z&&mm(O);if(a?W||V||Q||me:W||V||Q||me||!z&&!rc(O)){f=P+_.length;const $e=v.slice(l.pos,f);l.pending||($($e),g=f);continue}if(T=!0,!r){const $e=v.slice(l.pos-(l.pending??"").length,L);let He=v.slice(0,f)?v.slice(g,L):$e;const Be=zb(He)%2===1;L!==l.pos&&Be&&(He=l.pending+v.slice(l.pos,L));const Ee=Be?Vb(He):null,te=Ee?.marker??"**";if(l.pending!==He)if(l.pending="",Be)if(Ee){const ee=He.slice(Ee.index+te.length);$(He.slice(0,Ee.index));const Z=l.push("strong_open","",0);Z.markup=te;const Ae=l.push("text","",0);Ae.content=ee,l.push("strong_close","",0)}else $(He);else $(He);if(Be){const ee=l.push("strong_open","",0);ee.markup=te;const Z=l.push("math_inline","math",0);Z.content=ji(O,t),Z.markup=b==="$$"?"$$":b==="\\("?"\\(\\)":b==="$"?"$":"()",Z.raw=`${b}${O}${_}`,Z.loading=!1;const Ae=v.slice(P+_.length).startsWith(te);return Ae&&l.push("strong_close","",0),l.pos=u(v,P+_.length),f=l.pos,g=f,Ae||l.push("strong_close","",0),!0}else{const ee=l.push("math_inline","math",0);ee.content=ji(O,t),ee.markup=b==="$$"?"$$":b==="\\("?"\\(\\)":b==="$"?"$":"()",ee.raw=`${b}${O}${_}`,ee.loading=!1}}return f=u(v,P+_.length),g=f,l.pos=f,!0}if(T){if(r)l.pos=f;else{if(b==="$$"&&f<v.length&&v.slice(f).includes("$")){let L=f;for(;!(L>=v.length);){const D=Pg(v,L);if(D===-1)break;if(D+1<v.length&&v[D+1]==="$"){L=D+2;continue}if(D>0&&v[D-1]==="$"){L=D+1;continue}const R=hm(v,D+1);if(R===-1)break;const P=v.slice(D+1,R),O=P.includes("`"),W=!P||!P.trim(),V=v[R+1],z=pm(P,V),se=mm(P);if(!O&&!W&&!z&&!se){const Q=v.slice(f,D);Q&&$(Q);const me=l.push("math_inline","math",0);me.content=ji(P,t),me.markup="$",me.raw=`$${P}$`,me.loading=!1,f=R+1,L=R+1}else $("$"),L=D+1}L<v.length&&$(v.slice(L))}else f<v.length&&$(v.slice(f));l.pos=v.length}return!0}}return!1},s=(i,r,l,a)=>{const c=i,u=!c?.env?.__markstreamFinal,d=t?.strictDelimiters,p=d?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[r]+c.tShift[r];let f=c.src.slice(m,c.eMarks[r]).trim(),g=!1,w="",b="",_=!1;for(const[O,W]of p)if(f.startsWith(O))if(O.includes("["))if(t?.strictDelimiters){if(f.replace("\\","")==="["){if(r+1<l){g=!0,w=O,b=W;break}continue}}else if(f.replace("\\","")==="["){if(r+1<l){g=!0,w=O,b=W;break}continue}else{const V=c.tokens[c.tokens.length-1];if(V&&V.type==="list_item_open"&&V.mark==="-"&&f.slice(O.length,f.indexOf("]")).trim()==="x")continue;if(f.replace("\\","").startsWith("[")&&!f.includes("](")){const z=f.indexOf("]");if(f.slice(z).trim()!=="]")continue;const se=f.slice(O.length,z);if(O==="["?Kb(se):rc(se)){g=!0,w=O,b=W;break}continue}}else{g=!0,w=O,b=W;break}else if(O==="$$"&&f.endsWith(O)&&!f.slice(0,f.length-O.length).trim().includes(O)&&r+1<l){c.push("text","",0).content=f.slice(0,f.length-O.length);const V=c.bMarks[r+1]+c.tShift[r+1];f=c.src.slice(V,c.eMarks[r+1]).trim(),_=!0,g=!0,w=O,b=W;break}if(!g)return!1;if(a)return!0;const v=f.indexOf(w),y=v+w.length,k=!d&&w==="["?f.indexOf("\\]",y):-1,T=k>=0?"\\]":b,E=k>=0?k:f.indexOf(b,y);if(E>w.length){const O=f.slice(v+w.length,E),W=c.push("math_block","math",0);return W.content=ji(O),W.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",W.map=[r,r+1],W.raw=`${w}${O}${T}`,W.block=!0,W.loading=!1,c.line=r+1,!0}let C=r,M="",$=!1;const L=f===w?"":f.slice(w.length),D=!d&&w==="\\["?"]":"";if(L.includes(b)){const O=L.indexOf(b);M=L.slice(0,O),$=!0,C=r}else for(L&&!_&&(M=L),C=r+1;C<l;C++){const O=c.bMarks[C]+c.tShift[C],W=c.eMarks[C],V=c.src.slice(O,W),z=V.trim();if(!d&&w==="["&&z==="\\]"){b="\\]",$=!0;break}if(D&&V.trim()===D){b=D,$=!0;break}if(z===b){$=!0;break}else if(!d&&w==="["&&V.includes("\\]")){$=!0;const se=V.indexOf("\\]");b="\\]",M+=(M?`
131
- `:"")+V.slice(0,se);break}else if(V.includes(b)){$=!0;const se=V.indexOf(b);M+=(M?`
132
- `:"")+V.slice(0,se);break}M+=(M?`
133
- `:"")+V}if((!u||d)&&!$)return!1;const R=/^\s*!\[/.test(M);if(!(w==="$$"?!R:w==="["?Kb(M):rc(M)))return!1;const P=c.push("math_block","math",0);return P.content=ji(M),P.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",P.raw=`${w}${M}${M.startsWith(`
134
- `)?`
135
- `:""}${b}`,P.map=[r,C+1],P.block=!0,P.loading=!$,c.line=C+1,!0},o=(i,r,l,a)=>{const c=i,u=c.bMarks[r]+c.tShift[r],d=c.src.slice(u,c.eMarks[r]).trim();return!d.startsWith("$$")&&!d.startsWith("\\[")?!1:s(i,r,l,a)};e.inline.ruler.before("escape","math",n),e.block.ruler.before("lheading","explicit_math_block",o,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function C7(e){const t=e.renderer.rules.image||function(n,s,o,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,s,o):""};e.renderer.rules.image=(n,s,o,i,r)=>{const l=n;return l[s].attrSet?.("loading","lazy"),t(l,s,o,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,s)=>{const o=n[s],i=String(o.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(o.content??""))}</code></pre>`})}function x7(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},s=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=new kO({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return(e.enableMath??!0)&&S7(o,{...e.mathOptions??{}}),(e.enableContainers??!0)&&wO(o),e.enableFixIndentedCodeBlock!==!1&&iP(o),OP(o),FP(o),DP(o),qP(o),C7(o),sP(o,{customHtmlTags:e.customHtmlTags}),o}function el(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=>el(n))),t}function T7(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function A7(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,s=n===""||n==="true";return{type:"checkbox_input",checked:s,raw:s?"[x]":"[ ]"}}function M7(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function ld(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];o+=String(e[i].content??l.text??""),r.push(e[i]),i++}return s.push(...pn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const Yb=/\r?\n[ \t]*`+\s*$/,xx=["diff ","index ","--- ","+++ ","@@ "],E7=/\r?\n/;function I7(e){const t=String(e??"");return t?xx.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function Xb(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function $7(e,t){const n=[],s=[],o=[],i=[],r=e.split(E7),l=/\r?\n$/.test(e),a=r.some(m=>m.startsWith("diff ")||m.startsWith("--- ")||m.startsWith("+++ ")||m.startsWith("@@ ")),c=m=>{const f=m;if(!xx.some(g=>f.startsWith(g)))if(f.startsWith("-")){const g=f.slice(1);o.push(!a&&g.startsWith(" ")?` ${g}`:g)}else if(f.startsWith("+")){const g=f.slice(1);i.push(!a&&g.startsWith(" ")?` ${g}`:g)}else{Xb(n,s,o,i);const g=a&&f.startsWith(" ")?f.slice(1):f;n.push(g),s.push(g)}},u=l?Math.max(0,r.length-1):r.length;for(let m=0;m<u;m++){const f=r[m]??"";!t&&!l&&m===u-1&&I7(f)||c(f)}(t||o.length>0||i.length>0)&&Xb(n,s,o,i);const d=n.join(`
136
- `),p=s.join(`
137
- `);return{original:t&&l&&d?`${d}
138
- `:d,updated:t&&l&&p?`${p}
139
- `:p}}function pv(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},s=typeof n.closed=="boolean"?n.closed:void 0,o=s===!0||s!==!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(Yb.test(a)&&(a=a.replace(Yb,"")),r){const{original:c,updated:u}=$7(a,o===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t}}function N7(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function L7(){return{type:"hardbreak",raw:`\\
140
- `}}function R7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...pn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let gm=null;const vm=new WeakMap;function Zb(){return gm||(gm={customTagSet:null,allowedTagSet:_h()}),gm}function Tx(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function Ax(e){return/^<\s*\//.test(e)}function Mx(e,t){return/\/\s*>\s*$/.test(t)||ll.has(e)}function O7(e){if(!e||e.length===0)return Zb();const t=vm.get(e);if(t)return t;const n=e.map(Co).filter(Boolean);if(!n.length){const o=Zb();return vm.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:_h({customHtmlTags:e})};return vm.set(e,s),s}function Ex(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function P7(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function Cf(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function D7(e,t,n){const s=e.slice();return Cf(s,"href")||s.push(["href",t]),n!=null&&!Cf(s,"title")&&s.push(["title",n]),s}function Dg(e){return e.map(Ex).join("")}function Md(e){const t=[],n=s=>{const o=String(s??"");if(!o)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${o}`,i.raw=`${i.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const s of e)if(s){if(s.type==="reference"||s.type==="footnote_reference"){n(String(s.raw??""));continue}if("children"in s&&Array.isArray(s.children)){t.push({...s,children:Md(s.children)});continue}t.push(s)}return t}function B7(e,t,n){let s=0;for(let o=t;o<e.length;o++){const i=e[o];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=Tx(r),a=Ax(r),c=Mx(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function ym(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?B7(e,t+1,n):-1;return l!==-1?(o=e.slice(t+1,l),s.push(...o,e[l]),i=l+1,r=!0):(o=e.slice(t+1),o.length&&s.push(...o),i=e.length),{closed:r,html:Dg(s),innerTokens:o,nextIndex:i}}function F7(e,t,n,s,o,i,r){const l=String(e.content??""),a=Tx(l),{customTagSet:c,allowedTagSet:u}=O7(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!ym(t,n,a).closed){const k=Ex(e);return[{type:"text",content:k,raw:k},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=Ax(l),p=Mx(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const k=ym(t,n,a),T=kh(l),E=k.innerTokens,C=String(Cf(T,"href")??""),M=Cf(T,"title"),$=M==null?null:String(M),L=D7(T,C,$),D=Md(E.length?s(E,o,i,r):[]),R=E.length?Dg(E):C||"";return!D.length&&R&&D.push({type:"text",content:R,raw:R}),[{type:"link",href:C,title:$,text:R,attrs:L,children:D,loading:!k.closed,raw:k.html||l},k.nextIndex]}if(p)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const m=ym(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Md(m.innerTokens.length?s(m.innerTokens,o,i,r):[]),raw:m.html},m.nextIndex];const f=Md(m.innerTokens.length?s(m.innerTokens,o,i,r):[]);let g=m.html||l,w=!m.closed,b=!1;if(!m.closed){const k=`</${a}>`;g.toLowerCase().includes(k.toLowerCase())||(g+=k),b=!0,w=!0}const _=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const k=y[1],T=y[2]||y[3]||y[4]||"";_.push([k,T])}if(c?.has(a)){const k=P7(e);return[{type:a,tag:a,attrs:_,content:k?k.inner:m.innerTokens.length?Dg(m.innerTokens):"",children:m.innerTokens.length?s(m.innerTokens,o,i,r):[],raw:k?.raw??g,loading:e.loading||w,autoClosed:b},m.nextIndex]}return[{type:"html_inline",tag:a,attrs:_,content:g,children:f,raw:g,loading:w,autoClosed:b},m.nextIndex]}function Ix(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=>Ix(t)).join(""):String(e.content??"")}function H7(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>Ix(t)).join("")}function Jb(e,t=!1){let n=e.attrs??[],s=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const p=d.attrs;if(Array.isArray(p)&&p.length>0){n=p,s=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=H7(s??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):s?.content!=null&&String(s.content).length>0?l=String(s.content):Array.isArray(s?.children)&&s.children[0]?.content?l=String(s.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:o,alt:l,title:c,raw:u,loading:t}}function W7(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function U7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...pn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function q7(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const s=n?.[0];s&&t.push([String(s),String(n?.[1]??"")])}return t}function xf(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function j7(e,t,n){const s=e.slice();return xf(s,"href")||s.push(["href",t]),n!=null&&!xf(s,"title")&&s.push(["title",n]),s}function ad(e,t,n){const s=e[t],o=q7(s.attrs),i=String(xf(o,"href")??""),r=xf(o,"title"),l=r==null?null:String(r),a=j7(o,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 p=u;const m=u[u.length-1];if(n?.__insideStrong&&m?.type==="text"&&String(m.content??"").endsWith("**")&&!u.some(w=>w.type==="strong_open")){const w=String(m.content??""),b=String(m.raw??w),_=el(m);_.content=w.slice(0,-2),_.raw=b.replace(/\*\*$/,""),p=u.slice(),p[p.length-1]=_}const f=pn(p,void 0,void 0,n),g=f.map(w=>{const b=w;return"content"in w?String(b.content??""):String(b.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:g,children:f,raw:`[${g}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function Qb(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 z7(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function e_(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...pn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const V7=/\\([\\()[\]`$|*_\-!])/g;function K7(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(V7,"$1")===t))return n}function Za(e,t,n,s){const o=[];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={...s,__insideStrong:!0};return o.push(...pn(l,K7(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function G7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)o+=String(e[i].content??""),r.push(e[i]),i++;s.push(...pn(r,void 0,void 0,n));const l=String(e[t].content??""),a=o||l;return{node:{type:"subscript",children:s.length>0?s:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function Y7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...pn(r,void 0,void 0,n)),{node:{type:"superscript",children:s.length>0?s:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function X7(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const Z7=/[^~]*~{2,}[^~]+/,J7=/\*\*/,Q7=/[[_*^~]/,eD=/\\([\\()[\]`$|*_\-!])/g,mv=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),tD=/\s/u,nD=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,sD=/\p{P}/u,oD=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,iD=/:\/\//;function rD(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 $x(e,t=0){if(!e)return-1;let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&mv.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function hr(e){return!!e&&tD.test(e)}function pr(e){return!!e&&(nD.test(e)||sD.test(e))}function lD(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||hr(s)?!1:!(pr(s)&&n&&!hr(n)&&!pr(n))}function aD(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||hr(n)?!1:!(pr(n)&&s&&!hr(s)&&!pr(s))}function cD(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?$x(e,s):t.indexOf("*",s);if(i===-1)break;if(aD(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function uD(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||hr(s)?!1:!(pr(s)&&n&&!hr(n)&&!pr(n))}function dD(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||hr(n)?!1:!(pr(n)&&s&&!hr(s)&&!pr(s))}function fD(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(dD(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function hD(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let s=0;for(;n+s<e.length&&e[n+s]==="\\";)s++;const o=e[n+s];if(t+="\\".repeat(Math.floor(s/2)),s%2===1){if(o&&mv.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function pD(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&mv.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function mD(e,t,n){const s=pD(e,t);if(s===-1||e[s]!==n)return!1;let o=0;for(let i=s-1;i>=0&&e[i]==="\\";i--)o++;return o%2===1}const gD=/[\p{L}\p{N}]/u,vD=/^[\p{L}\p{N}]+$/u;function Bg(e){return e?gD.test(e):!1}function Nx(e){return e?vD.test(e):!1}function bc(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const s=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return{len:n-t,prev:s,next:o,intraword:Bg(s)&&Bg(o)}}function yD(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=bc(e,n),o=n+s.len;s.len>=2&&s.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n<t.length-1;n++){const s=t[n],o=t[n+1];if(!Nx(e.slice(s.end,o.start)))return o.end}return-1}function kD(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function bD(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=bc(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function _D(e){return e?oD.test(e)||iD.test(e):!1}function wD(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function pn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=cu(t),r={filename:o?.filename||i.filename,explicitFilename:o?.explicitFilename||i.explicitFilename,marketTicker:o?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(s={...s,__linkifyDemotionContext:r});const l=s,a=[];let c=null,u=0;const d=s?.requireClosingStrong,p=e;function m(){return e===p&&(e=e.slice()),e}function f(){c=null}function g(G,oe){const J=e.length===1?t:String(oe.content??""),F=[],Y=yD(G);if(Y!==-1){k(G.slice(0,Y),G.slice(0,Y));const re=G.slice(Y);return re&&($({type:"text",content:re,raw:re}),u--),u++,!0}if(Z7.test(G)){const re=G.indexOf("~~");re!==-1&&F.push({type:"strikethrough",index:re})}if(J7.test(G)){const re=G.indexOf("**");re!==-1&&F.push({type:"strong",index:re})}if(/[^*]*\*[^*]+/.test(G)){const re=J?$x(J,0):G.indexOf("*");if(J&&re===-1)return!1;re!==-1&&F.push({type:"emphasis",index:re})}F.sort((re,fe)=>re.index!==fe.index?re.index-fe.index:re.type===fe.type?0:re.type==="strong"?-1:fe.type==="strong"?1:0);const le=F[0];if(!le)return!1;if(le.type==="strikethrough"){const re=le.index,fe=re>-1?G.slice(0,re):"";if(fe&&k(fe,fe),re===-1)return u++,!0;const q=G.indexOf("~~",re+2),X=q===-1?G.slice(re+2):G.slice(re+2,q),de=q===-1?"":G.slice(q+2),{node:he}=e_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:X,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return f(),y(he),de&&($({type:"text",content:de,raw:de}),u--),u++,!0}if(le.type==="strong"){const re=le.index,fe=re>-1?G.slice(0,re):"";if(fe&&k(fe,fe),re===-1)return u++,!0;if(t&&re===0){let Ce=!1,ae=0;for(;ae<G.length&&G[ae]==="*";)ae++;if(t.startsWith("\\*")&&(Ce=!0),Ce){let _e=0,ze=0;for(;ze<t.length&&_e<ae;)if(t[ze]==="\\"&&ze+1<t.length&&t[ze+1]==="*")_e+=1,ze+=2;else{if(t[ze]==="*")break;ze++}if(_e>=2)return k(G,G),u++,!0}}if(t&&(G.match(/\*/g)||[]).length>rD(t))return k(G.slice(fe.length),G.slice(fe.length)),u++,!0;const q=bc(G,re);if(q.len>=3){const Ce=bD(G,re+q.len);if(Ce!==-1){const ae=G.slice(re+q.len,Ce);if(kD(ae)){const{node:_e}=Za([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ae,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,s);f(),y(_e);const ze=G.slice(Ce+3);return ze&&($({type:"text",content:ze,raw:ze}),u--),u++,!0}}}if(!uD(G,re)){const Ce=G.slice(re,re+q.len);k(Ce,Ce);const ae=G.slice(re+q.len);return ae&&($({type:"text",content:ae,raw:ae}),u--),u++,!0}const X=fD(G,re+2);let de="",he="";if(X.index!==-1){de=G.slice(re+2,X.index),he=G.slice(X.index+2);const Ce=X.index,ae=bc(G,Ce);if(q.intraword&&ae.intraword&&!Nx(de)||!de&&q.len>=4&&q.intraword)return k(G.slice(fe.length),G.slice(fe.length)),u++,!0}else{if(d||X.sawInvalidClose||q.intraword)return k(G.slice(fe.length),G.slice(fe.length)),u++,!0;de=G.slice(re+2),he=""}if(!de&&/^\*+$/.test(he))return k(G,G),u++,!0;const{node:ke}=Za([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:de,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return f(),y(ke),he&&($({type:"text",content:he,raw:he}),u--),u++,!0}if(le.type==="emphasis"){let re=le.index;re===-1&&(re=0);const fe=G.slice(0,re);if(fe&&k(fe,fe),!lD(G,re)){k(G[re],G[re]);const Ce=G.slice(re+1);return Ce&&($({type:"text",content:Ce,raw:Ce}),u--),u++,!0}const q=bc(G,re),X=cD(J,G,re+1),de=X.index,he=e[u+1];if(s?.final&&he?.type==="em_open"&&de!==-1&&G.slice(re+1,de).trim()!==G.slice(re+1,de)||de===-1&&(X.sawInvalidClose||s?.final||q.intraword||!Bg(G[re+1])))return k(G.slice(re),G.slice(re)),u++,!0;const{node:ke}=ld([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:de>-1?G.slice(re+1,de):G.slice(re+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(f(),y(ke),de!==-1&&de<G.length-1){const Ce=G.slice(de+1);Ce&&($({type:"text",content:Ce,raw:Ce}),u--)}return u++,!0}return!1}function w(G,oe){if(!G.includes("`"))return!1;const F=(he=>{for(let ke=0;ke<he.length;ke++){if(he[ke]!=="`")continue;let Ce=0;for(let ae=ke-1;ae>=0&&he[ae]==="\\";ae--)Ce++;if(Ce%2===0)return ke}return-1})(G);if(F===-1)return!1;let Y=1;for(let he=F+1;he<G.length&&G[he]==="`";he++)Y++;const le="`".repeat(Y),re=F+Y,fe=G.indexOf(le,re);if(fe===-1){if(Y===1){const ke=G.slice(0,F),Ce=G.slice(F+1);return ke&&(g(ke,oe)?u--:k(ke,ke)),_({type:"inline_code",code:Ce,raw:String(Ce)}),u++,!0}let he=G;for(let ke=u+1;ke<e.length;ke++)he+=String((e[ke].content??"")+(e[ke].markup??""));return u=e.length-1,k(he,he),u++,!0}f();const q=G.slice(0,F),X=G.slice(F+Y,fe),de=G.slice(fe+Y);return q&&(g(q,oe)?u--:k(q,q)),_({type:"inline_code",code:X,raw:String(X??"")}),de&&($({type:"text",content:de,raw:de}),u--),u++,!0}function b(G){const oe=l?.__markdownIt;if(!oe||e.length<=1||!e.some(le=>le?.type==="math_inline")||!Q7.test(G))return null;const J=oe.parseInline(G,{__markstreamFinal:!!s?.final});if(!Array.isArray(J)||J.length===0)return null;const F=(J.find(le=>le?.type==="inline")?.children??[]).filter(le=>!(le?.type==="text"&&String(le.content??"")===""));if(!F.length||!F.some(le=>le?.type!=="text")||F.length===1&&F[0]?.type==="text"&&String(F[0].content??"")===G)return null;const Y=pn(F,G,n,s);return Y.length?Y:null}function _(G){f(),a.push(G)}function v(G){f();const oe=el(G);a.push(oe)}function y(G){_(G)}function k(G,oe){c?(c.content+=G,c.raw+=oe??G):(c={type:"text",content:String(G??""),raw:String(oe??G??"")},a.push(c))}function T(G,oe){if(!G)return;const J=pn([{...oe,type:"text",content:G,raw:G}],G,n,s);if(J.length===1&&J[0]?.type==="text"){const F=J[0];k(String(F.content??""),String(F.raw??F.content??""));return}for(const F of J)y(F)}function E(G,oe){return String(G.markup??"").startsWith(oe)}function C(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 M(G,oe){let J=G;const F=String(oe.content??"");return J.endsWith("\\")&&!E(oe,"\\\\")&&!F.endsWith("\\\\")&&(J=J.slice(0,-1)),J.endsWith("(")&&!E(oe,"\\(")&&!F.endsWith("\\(")&&(J=J.slice(0,-1)),/\*+$/.test(J)&&!E(oe,"\\*")&&!F.endsWith("\\*")&&(J=J.replace(/\*+$/,"")),J}for(;u<e.length;){const G=e[u];$(G)}function $(G){switch(G.type){case"text":D(G);break;case"softbreak":c?(c.content+=`
141
- `,c.raw+=`
142
- `):(c={type:"text",content:`
143
- `,raw:`
144
- `},a.push(c)),u++;break;case"code_inline":y(W7(G)),u++;break;case"html_inline":{const[oe,J]=F7(G,e,u,pn,t,n,s);y(oe),u=J;break}case"link_open":R(G);break;case"image":He(G)||(f(),y(Jb(G)),u++);break;case"strong_open":{f();const{node:oe,nextIndex:J}=Za(e,u,G.content,s);y(oe),u=J;break}case"em_open":{f();const{node:oe,nextIndex:J}=ld(e,u,s);y(oe),u=J;break}case"s_open":{f();const{node:oe,nextIndex:J}=e_(e,u,s);y(oe),u=J;break}case"mark_open":{f();const{node:oe,nextIndex:J}=R7(e,u,s);y(oe),u=J;break}case"ins_open":{f();const{node:oe,nextIndex:J}=U7(e,u,s);y(oe),u=J;break}case"sub_open":{f();const{node:oe,nextIndex:J}=G7(e,u,s);y(oe),u=J;break}case"sup_open":{f();const{node:oe,nextIndex:J}=Y7(e,u,s);y(oe),u=J;break}case"sub":f(),y({type:"subscript",children:[{type:"text",content:String(G.content??""),raw:String(G.content??"")}],raw:`~${String(G.content??"")}~`}),u++;break;case"sup":f(),y({type:"superscript",children:[{type:"text",content:String(G.content??""),raw:String(G.content??"")}],raw:`^${String(G.content??"")}^`}),u++;break;case"emoji":{f();const oe=e[u-1];oe?.type==="text"&&/\|:-+/.test(String(oe.content??""))?k("",""):y(M7(G)),u++;break}case"checkbox":f(),y(T7(G)),u++;break;case"checkbox_input":f(),y(A7(G)),u++;break;case"footnote_ref":f(),y(N7(G)),u++;break;case"footnote_anchor":{f();const oe=G.meta??{};_({type:"footnote_anchor",id:String(oe.label??G.content??""),raw:String(G.content??"")}),u++;break}case"hardbreak":f(),y(L7()),u++;break;case"fence":f(),y(pv(e[u])),u++;break;case"math_inline":f(),!G.content&&G.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(Qb({...G,content:e[u+1].content})),u+=2):y(Qb(G)),u++;break;case"reference":O(G);break;case"text_special":k(String(G.content??""),String(G.content??"")),u++;break;default:{const oe=G;if(G.type==="link"&&oe.href!=null&&s?.validateLink&&!s.validateLink(String(oe.href))){f();const J=String(oe.text??"");k(J,J),u++}else Be(G)||V(G)||se(G)||W(G)||v(G),u++;break}}}function L(G,oe,J,F){const Y=X7({...oe,content:G});if(c){c.content+=M(Y.content,oe),c.raw+=Y.raw;return}const le=J?.tag==="br"&&e[u-2]?.content==="[";F||(Y.content=M(Y.content,oe)),c=Y,c.center=le,a.push(c)}function D(G){const oe=String(G.content??""),J=e.length===1&&oe.includes("\\")&&typeof t=="string"?String(t):"";let F=J?hD(J):oe.replace(eD,"$1");if(G.content==="<"||F==="1"&&e[u-1]?.tag==="br"){u++;return}const Y=F.indexOf("$");Y!==-1&&Y===F.lastIndexOf("$")&&F.endsWith("$")&&(F=F.slice(0,-1)),F.endsWith("undefined")&&!t?.endsWith("undefined")&&(F=F.slice(0,-9));let le=a.length,re="";for(let de=a.length-1;de>=0;de--){const he=a[de];if(he.type!=="text")break;le=de,re=String(he.content??"")+re}le<a.length&&(F.startsWith(re)?(c=null,a.length=le):c=a[a.length-1]);const fe=e[u+1];if((F==="`"||F==="|"||F==="$")&&!E(G,`\\${F}`)||/^\*+$/.test(F)&&!E(G,"\\*")){u++;return}if(!fe&&/[^\]]\s*\(\s*$/.test(F)&&(F=F.replace(/\(\s*$/,"")),!F){u++;return}if($e(F)||Ee(F))return;if(!(F.includes("*")||F.includes("_")||F.includes("~")||F.includes("`")||F.includes("[")||F.includes("!")||F.includes("$")||F.includes("|")||F.includes("("))){L(F,G,e[u-1],fe),u++;return}if(Ae(F))return;const q=e[u-1];if(F==="["&&!fe?.markup?.includes("*")&&!E(G,"\\[")||F==="]"&&!q?.markup?.includes("*")&&!E(G,"\\]")){u++;return}if(w(oe,G)||Z(F)||(e[u+1]?.type!=="link_open"||C(F))&&ee(F,G))return;const X=b(oe);if(X){f();for(const de of X)y(de);u++;return}g(F,G)||(L(F,G,q,fe),u++)}function R(G){if(P(G))return;if(te()){const{node:fe,nextIndex:q}=ad(e,u,s),X=String(fe.text||fe.href||"");k(X,X),u=q;return}f();const{node:oe,nextIndex:J}=ad(e,u,s);u=J;const F=oe.text||oe.href||"";if(G.markup==="linkify"&&!vx(F,oe.href,t)&&wf(F,l?.__linkifyDemotionContext)){k(F,F);return}const Y=oe.children.length===1&&oe.children[0]?.type==="text";if(oe.loading&&t&&oe.text===oe.href&&Y){const fe=wD(t,oe.href);fe&&(oe.text=fe,oe.children=[{type:"text",content:fe,raw:fe}],oe.raw=`[${fe}](${oe.href}${oe.title?` "${oe.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(oe.href)){k(oe.text,oe.text);return}const le=G.attrs?.find(([fe])=>fe==="href")?.[1],re=String(le??"");if(t&&re){const fe=t.indexOf("](");if(fe!==-1){const q=t.indexOf(")",fe+2);q===-1?oe.loading=!0:oe.loading&&t.slice(fe+2,q).includes(re)&&(oe.loading=!1)}}W(oe)||_(oe)}function P(G){if(G.markup!=="linkify")return!1;const{node:oe,nextIndex:J}=ad(e,u,s);return z(oe,J)?(u=J,!0):!1}function O(G){f(),y(z7(G)),u++}function W(G){if(G.type!=="link")return!1;const oe=a[a.length-1];if(!oe||oe.type!=="text")return!1;const J=String(oe.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!J)return!1;const F=G,Y=String(F.href??""),le=String(F.text??""),re=String(J[2]??""),fe=Y.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Y||!(le===Y||le===fe||_D(le)))return!1;const q=String(J[1]??"");return q?(oe.content=q,oe.raw=q):a.pop(),_({...G,text:re,children:[{type:"text",content:re,raw:re}],raw:`[${re}](${Y}${F.title?` "${F.title}"`:""})`}),!0}function V(G){if(G.type!=="link")return!1;const oe=G,J=String(oe.href??"");return J?z({href:J,title:oe.title==null||oe.title===""?null:String(oe.title),loading:!!oe.loading},u+1):!1}function z(G,oe){const J=a[a.length-1];if(J?.type!=="image"||J.src||!J.loading||!String(J.raw??"").endsWith("]("))return!1;const F=e[oe],Y=String(F?.content??"");if(F?.type!=="text"||!Y.startsWith(")"))return!1;a.pop(),c=null;const le=String(J.alt??"");_({type:"image",src:G.href,alt:le,title:G.title,raw:`![${le}](${G.href}${G.title?` "${G.title}"`:""})`,loading:!!G.loading});const re=Y.slice(1),fe=el(F);return fe.content=re,fe.raw=re,m()[oe]=fe,!0}function se(G){if(G.type!=="link")return!1;const oe=a[a.length-1],J=e[u-1];if(!oe||oe.type!=="text"||J?.type!=="text")return!1;const F=String(oe.content??""),Y=String(J.content??"");if(!F.endsWith("!")||!Y.endsWith("!")||E(J,"\\!"))return!1;const le=F.slice(0,-1);le?(oe.content=le,oe.raw=le,c=oe):(a.pop(),c=null);const re=G,fe=String(re.text??re.children?.map(de=>String(de?.content??de?.raw??"")).join("")??""),q=String(re.href??""),X=re.title==null||re.title===""?null:String(re.title);return _({type:"image",src:q,alt:fe,title:X,raw:`![${fe}](${q}${X?` "${X}"`:""})`,loading:!!re.loading}),!0}function Q(G,oe="",J=null){const F=String(G.alt??G.raw??"");return{type:"link",href:oe,title:J,text:F,children:[G],raw:`[${F}](${oe}${J?` "${J}"`:""})`,loading:!0}}function me(G){const oe=G.startsWith("![")?G:`![${G}`,J=oe.slice(2),F=J.indexOf("](");return{type:"image",src:"",alt:F===-1?J.replace(/\]$/,""):J.slice(0,F),title:null,raw:oe,loading:!0}}function $e(G){const oe=G.indexOf("[![");if(oe===-1||typeof t=="string"&&e.length===1&&mD(t,oe,"["))return!1;const J=G.slice(0,oe);return J&&k(J,J),_(Q(me(G.slice(oe+1)))),u++,!0}function He(G){if(s?.final)return!1;const oe=e[u-1];if(oe?.type!=="text"||!String(oe.content??"").endsWith("[")||E(oe,"\\["))return!1;const J=a[a.length-1];if(J?.type==="text"&&J.content.endsWith("[")){const F=J.content.slice(0,-1);F?(J.content=F,J.raw=F,c=J):(a.pop(),c=null)}return _(Q(Jb(G))),u++,!0}function Be(G){if(G.type!=="link")return!1;const oe=G,J=String(oe.raw??""),F=String(oe.text??"");if(!J.startsWith("[![")&&!F.startsWith("!["))return!1;const Y=oe.title==null||oe.title===""?null:String(oe.title);return _(Q({type:"image",src:String(oe.href??""),alt:F.replace(/^!\[/,"").replace(/\]$/,""),title:Y,raw:J.startsWith("[![")?J.slice(1):J,loading:!0})),!0}function Ee(G){if(!G.startsWith("]("))return!1;const oe=e[u-2];if(oe?.type==="text"&&String(oe.content??"").endsWith("[")&&E(oe,"\\["))return!1;const J=a[a.length-1];if(J?.type!=="image"&&J?.type!=="link")return!1;const F=J,Y=J?.type==="link"&&Array.isArray(F.children)&&F.children.length===1&&F.children[0]?.type==="image"?a.pop():null,le=Y?Y.children[0]:a.pop();if(!le||le.type!=="image")return!1;const re=e[u+1];let fe=String(Y?.href??""),q=Y?.title==null?null:String(Y.title),X=!0;if(re?.type==="link_open"){const{node:he,nextIndex:ke}=ad(e,u+1,s);fe=he.href,q=he.title,X=!0,u=ke}else{if(fe=G.slice(2),fe.includes('"')){const he=fe.split('"');fe=String(he[0]??"").trim(),q=he[1]==null?null:String(he[1]).trim()}u++}const de=Q(le,fe,q);return de.loading=X,_(de),!0}function te(){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("[")&&E(G,"\\[")}function ee(G,oe){const J=G.indexOf("[");if(J===-1)return!1;let F=G.slice(0,J);const Y=G.indexOf("](",J);if(Y!==-1){const le=e[u+2];let re=G.slice(J+1,Y);if(re.includes("[")){const Ce=re.indexOf("[");F+=G.slice(0,J+Ce+1);const ae=J+Ce+1;re=G.slice(ae+1,Y)}const fe=e[u+1];if(G.endsWith("](")&&fe?.type==="link_open"&&le){const Ce=e[u+4];let ae=4,_e=!0;if(Ce?.type==="text"){const Qe=String(Ce.content??"");if(Qe.startsWith(")")){_e=!1;const dt=Qe.slice(1);if(dt){const Ge=el(Ce);Ge.content=dt,Ge.raw=dt,m()[u+4]=Ge}else ae++}else Qe==="."&&ae++}T(F,oe);const ze=String(le.content??"");return s?.validateLink&&!s.validateLink(ze)?k(re,re):_({type:"link",href:ze,title:null,text:re,children:[{type:"text",content:re,raw:re}],loading:_e}),u+=ae,!0}const q=G.indexOf(")",Y),X=q!==-1?G.slice(Y+2,q):"",de=q===-1;let he=F.match(/\*+$/);if(he&&(F=F.replace(/\*+$/,"")),T(F,oe),he||(he=re.match(/^\*+/)),!d&&he){const Ce=he[0].length;re=re.replace(/^\*+/,"").replace(/\*+$/,"");const ae=[];if(Ce===1?ae.push({type:"em_open",tag:"em",nesting:1}):Ce===2?ae.push({type:"strong_open",tag:"strong",nesting:1}):Ce===3&&(ae.push({type:"strong_open",tag:"strong",nesting:1}),ae.push({type:"em_open",tag:"em",nesting:1})),ae.push({type:"link",href:X,title:null,text:re,children:[{type:"text",content:re,raw:re}],loading:de}),Ce===1){ae.push({type:"em_close",tag:"em",nesting:-1});const{node:_e}=ld(ae,0,s);y(_e)}else if(Ce===2){ae.push({type:"strong_close",tag:"strong",nesting:-1});const{node:_e}=Za(ae,0,void 0,s);y(_e)}else if(Ce===3){ae.push({type:"em_close",tag:"em",nesting:-1}),ae.push({type:"strong_close",tag:"strong",nesting:-1});const{node:_e}=Za(ae,0,void 0,s);y(_e)}else{const{node:_e}=ld(ae,0,s);y(_e)}}else s?.validateLink&&!s.validateLink(X)?k(re,re):_({type:"link",href:X,title:null,text:re,children:[{type:"text",content:re,raw:re}],loading:de});const ke=q!==-1?G.slice(q+1):"";return ke&&($({type:"text",content:ke,raw:ke}),u--),u++,!0}return!1}function Z(G){const oe=G.indexOf("![");if(oe===-1)return!1;const J=G.slice(0,oe);return J&&!c?c={type:"text",content:J,raw:J}:J&&c&&(c.content+=J),c&&(a.push(c),c=null),_(me(G.slice(oe))),u++,!0}function Ae(G){if(!(G?.startsWith("[")&&n?.type==="list_item_open"))return!1;const oe=G.slice(1).match(/[^\s\]]/);if(oe===null)return u++,!0;if(oe&&/x/i.test(oe[0])){const J=oe[0]==="x"||oe[0]==="X";return _({type:"checkbox_input",checked:J,raw:J?"[x]":"[ ]"}),u++,!0}return!1}return a}function SD(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){o.content=r;break}s.pop();continue}break}}function CD(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 s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){s.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?o.content=r:s.pop())}break}}function xD(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function ya(e,t,n){const s=e[t],o=[],i=br(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=xD(c)?el(c):c,d=e[a-1];u!==c&&(CD(u),SD(u));const p=String(u.content??"");l.push({type:"paragraph",children:pn(u.children||[],p,d,i.options()),raw:p}),i.remember(p),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=ka(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]=ya(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=vv(e,a,i.options(),gv);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}o.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:s.type==="ordered_list_open",start:(()=>{if(s.attrs&&s.attrs.length){const l=s.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:o,raw:o.map(l=>l.raw).join(`
145
- `)},r+1]}function TD(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=br(s,!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:pn(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]=ya(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=ka(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=bh(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:o,title:i,children:r,raw:`:::${o} ${i}
146
- ${r.map(c=>c.raw).join(`
147
- `)}
148
- :::`},a+1]}const AD=new Set(["warning","info","note","tip","danger","caution"]);function MD(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 s=n.search(/\s/),o=(s===-1?n:n.slice(0,s)).toLowerCase();return AD.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function ED(e,t,n){const s=e[t];let o="note",i="";const r=s.type.match(/^container_(\w+)_open$/);if(r){o=r[1];const d=String(s.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(o)){const p=d.slice(o.length).trim();p&&(i=p)}}else{const d=MD(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=br(n,!0);let c=t+1;const u=new RegExp(`^container_${o}_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 p=d.children||[];let m=-1;for(let g=p.length-1;g>=0;g--){const w=p[g];if(w.type==="text"&&/:+/.test(w.content)){m=g;break}}const f={type:"paragraph",children:pn((m!==-1?p.slice(0,m):p)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,p]=ya(e,c,a.options());l.push(d),a.remember(d.raw),c=p}else if(e[c].type==="blockquote_open"){const[d,p]=ka(e,c,a.options());l.push(d),a.remember(d.raw),c=p}else{const d=bh(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:i,children:l,raw:`:::${o} ${i}
149
- ${l.map(d=>d.raw).join(`
150
- `)}
151
- :::`},c+1]}const ID=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function $D(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=ID.exec(String(s.info??""));return o?TD(e,t,o,n):null}const gv={parseContainer:(e,t,n)=>ED(e,t,n),matchAdmonition:$D};function ka(e,t,n){const s=[],o=br(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:pn(r.children||[],String(r.content??""),void 0,o.options()),raw:String(r.content??"")};s.push(l),o.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=ya(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=ka(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=vv(e,i,o.options(),gv);r?(s.push(r[0]),o.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:s,raw:s.map(r=>r.raw).join(`
152
- `)},i+1]}function ND(e){if(e.info?.startsWith("diff"))return pv(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let s=t;n?.[1]&&(s=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:s,raw:s,loading:!o}}function LD(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=br(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=pn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+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:pn(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&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
153
- `)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
154
- `)},o+1]}function RD(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=br(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:pn(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:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
155
- `)}`},l+1]}function OD(e,t,n){const s=e[t],o=s.attrs,i=Array.isArray(o)&&o.length?Object.fromEntries(o.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(s.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:pn(a.children||[],c,void 0,n),raw:c}}function PD(e,t,n){const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${s}(?=\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=hn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(o.test(c)){const u=hn(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 Lx(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 s=hn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=ll.has(n),l=kh(o),a=(s===-1?-1:PD(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
156
- </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function DD(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 BD(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,s]=t;if(!s)continue;const o=String(s).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(o);if(i)return i[1].toLowerCase()}}return"left"}function Rx(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Ox(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Rx(n)?n:void 0}function FD(e,t,n){const s=Ox(cu(t),n);if(!Rx(s))return e;const o=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:o?.filename||s?.filename,explicitFilename:o?.explicitFilename||s?.explicitFilename,marketTicker:o?.marketTicker||s?.marketTicker}}}function HD(e,t,n){let s=t+1,o=null;const i=[];let r=!1;for(;s<e.length&&e[s].type!=="table_close";)if(e[s].type==="thead_open")r=!0,s++;else if(e[s].type==="thead_close")r=!1,s++;else if(e[s].type==="tbody_open"||e[s].type==="tbody_close")s++;else if(e[s].type==="tr_open"){const a=[];let c=s+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const p=e[c].type==="th_open",m=e[c+1],f=String(m.content??""),g=BD(e[c].attrs),w=a.length,b=!p&&!r,_=b?o?.cells[w]?.raw:void 0;a.push({type:"table_cell",header:p||r,children:pn(m.children||[],f,void 0,FD(n,_,b?u:void 0)),raw:f,align:g}),b&&(u=Ox(u,cu(f))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(p=>p.raw).join("|")};r?o=d:i.push(d),s=c+1}else s++;o||(o={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:o,rows:i,loading:l&&!n?.final&&i.length===0,raw:[o,...i].map(a=>a.raw).join(`
157
- `)},s+1]}function WD(){return{type:"thematic_break",raw:"---"}}let km=null;const bm=new WeakMap;function t_(){return km||(km={allowedTagSet:_h(),customTagSet:null}),km}function UD(e){if(!e||e.length===0)return t_();const t=bm.get(e);if(t)return t;const n=e.map(Co).filter(Boolean);if(!n.length){const o=t_();return bm.set(e,o),o}const s={allowedTagSet:_h({customHtmlTags:e}),customTagSet:new Set(n)};return bm.set(e,s),s}function qD(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[m,f]of o)if(m==="class"){const g=f.match(/(?:\s|^)vmr-container-(\S+)/);g&&(i=g[1])}else if(m.startsWith("data-")){const g=m.slice(5);try{r[g]=JSON.parse(f)}catch{r[g]=f}}}const l=[],a=br(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const m=e[c+1];if(m){const f={type:"paragraph",children:pn(m.children||[],void 0,void 0,a.options()),raw:String(m.content??"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[m,f]=ya(e,c,a.options());l.push(m),a.remember(m.raw),c=f}else if(e[c].type==="blockquote_open"){const[m,f]=ka(e,c,a.options());l.push(m),a.remember(m.raw),c=f}else{const m=bh(e,c,a.options());m?(l.push(m[0]),a.remember(m[0].raw),c=m[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let p=`::: ${i}`;return Object.keys(r).length>0&&(p+=` ${JSON.stringify(r)}`),p+=`
158
- `,l.length>0&&(p+=s.raw??l.map(m=>m.raw).join(`
159
- `),p+=`
160
- `),p+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:p},u?c+1:c]}function jD(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function zD(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function VD(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Vs(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Vs(s)}(?=\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=hn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(o.test(c)){const u=hn(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 KD(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${s}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n||0);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=hn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const f=c+1;return{raw:e.slice(r,f),end:f}}let u=1,d=c+1;const p=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(g)},m=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),end:e.length};if(m(f)){const g=e.indexOf(">",f);if(g===-1)return null;if(u--,u===0){const w=g+1;return{raw:e.slice(r,w),end:w}}d=g+1;continue}if(p(f)){const g=hn(e.slice(f));if(g===-1)return null;u++,d=f+g+1;continue}d=f+1}return{raw:e.slice(r),end:e.length}}function Fg(e){return Number.isFinite(e)&&e>0?e:0}function GD(e,t){const n=Fg(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
161
- `&&(s++,s===n))return o+1;return e.length}function bh(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[OD(e,t,n),t+3];case"code_block":return[ND(s),t+1];case"fence":return[pv(s),t+1];case"math_block":return[DD(s),t+1];case"html_block":{const o=Lx(s),i=o.tag?UD(n?.customHtmlTags):null;if(o.tag&&o.loading&&i&&!i.allowedTagSet.has(o.tag)){const r=String(s.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(o.tag&&i?.customTagSet?.has(o.tag)){const r=o.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(s.map)?GD(l,Number(s.map?.[0]??0)):0,u=KD(l,r,Math.max(Fg(a),Fg(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),p=hn(d),m=p!==-1?d.slice(0,p+1):d,f=p!==-1&&/\/\s*>\s*$/.test(m),g=p===-1?null:VD(d,r,p+1),w=g?.start??-1;let b="";p!==-1&&(w!==-1&&p<w?b=d.slice(p+1,w):b=d.slice(p+1)),w===-1&&(b=zD(b,r));const _=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(m))!==null;){const T=y[1];if(!T||T.toLowerCase()===r)continue;const E=y[2]||y[3]||y[4]||"";_.push([T,E])}const k=!n?.final&&!f&&g==null;return[{type:r,tag:r,content:jD(b),raw:String(u?.raw??o.raw??d),loading:k,attrs:_.length?_:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=HD(e,t,n);return[o,i]}case"dl_open":{const[o,i]=LD(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=RD(e,t,n);return[o,i]}case"hr":return[WD(),t+1]}return null}function vv(e,t,n,s){const o=bh(e,t,n);if(o)return o;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(s?.parseContainer)return s.parseContainer(e,t,n);break;case"container_open":if(s?.matchAdmonition){const i=s.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return qD(e,t,n)}return null}function YD(){return{type:"hardbreak",raw:`\\
162
- `}}function XD(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:pn(s.children||[],o,void 0,n),raw:o}}const n_=new WeakMap;function fa(){return typeof performance<"u"?performance.now():Date.now()}function yv(e,t,n){e&&(e[t]=(e[t]??0)+n)}function Px(e){return e.__timing}function _m(e,t,n){return t&&yv(t,"parseMarkdownToStructureTotalMs",fa()-n),e}function s_(e,t,n){if(!n)return u_(e,t);const s=fa(),o=u_(e,t);return yv(n,"processTokensMs",fa()-s),o}function ZD(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=va(t);return n.length?new Set(n):null}function JD(e,t){const n=e;let s=n_.get(n);s||(s=new Map,n_.set(n,s));const o=t.__markstreamFinal===!0?"final":"streaming";let i=s.get(o);i||(i={},s.set(o,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function QD(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function cd(e,t,n){for(const s of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,s);if(!o||!("value"in o))continue;const i=Object.getOwnPropertyDescriptor(t,s);i&&(!("value"in i)||i.writable===!1)||(t[s]=zr(o.value,n))}}function zr(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,s=t.get(n);if(s)return s;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(zr(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(zr(l,t),zr(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(zr(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),cd(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),cd(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),cd(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!QD(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),cd(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=zr(i[r],t);return o}function Dx(e,t=!0){if(!t)return el(e);const n=Object.create(Object.getPrototypeOf(e)),s=new WeakMap;for(const o of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,o);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,o,i);continue}const r=i.value;let l=r;o==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):o==="map"&&Array.isArray(r)?l=[...r]:o==="children"&&Array.isArray(r)?l=r.map(a=>Dx(a,t)):t&&r&&typeof r=="object"&&(l=zr(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function o_(e,t=!0){return e.map(n=>Dx(n,t))}function Bx(e,t){const n=t,s=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&s?.enabled===!0&&typeof s.parse=="function"}function e9(e,t){const n=t,s=t.streamParse??"auto",o=e.stream;return t.final===!0&&s==="auto"&&n.__disableStreamParse!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function t9(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function i_(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!Bx(e,s))return e.parse(t,n);const o=e.stream.parse(t,JD(e,n));if(!t9(s))return o;const i=Px(s);if(!i)return o_(o,!0);const r=fa(),l=o_(o,!0);return yv(i,"tokenCloneMs",fa()-r),l}function _h(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Vc;const n=new Set(Vc);for(const s of va(t))s&&n.add(s);return n}function n9(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 r_(e){return{type:"paragraph",children:e,raw:e.map(n9).join("")}}function l_(e,t){if(e.type!=="paragraph")return null;const n=e.children,s=Array.isArray(n)?n:[];if(s.length===0)return null;const o=ZD(t);if(!o?.size)return null;let i=-1;for(let u=0;u<s.length;u++){const d=s[u];if(!o.has(String(d?.type??"").toLowerCase()))continue;const p=s.slice(0,u);if(String(d.content??"").trim()&&p.some(m=>m?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=s.slice(0,i),l=s[i];if(!l)return null;const a=[];r.length&&a.push(r_(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(r_(c)),a}function s9(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),s=/<\/html>\s*$/i.test(t);return!n||!s?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function _c(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function o9(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*${Vs(t)}\s*>\s*$`,"i").test(n)}function kv(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${Vs(s)}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=hn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(ll.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const p=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*${Vs(s)}(?=\s|>|/)`,"i").test(g)},m=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${Vs(s)}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(m(f)){const g=hn(e.slice(f));if(g===-1)return null;u--;const w=f+g+1;if(u===0)return{raw:e.slice(r,w),start:r,end:w,closed:!0};d=w;continue}if(p(f)){const g=hn(e.slice(f));if(g===-1)return null;const w=e.slice(f,f+g+1);/\/\s*>$/.test(w)||u++,d=f+g+1;continue}d=f+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function i9(e,t){if(!t)return 0;let n=0,s=0;for(;n<e.length&&s<t.length;){if(e[n]===t[s]){n++,s++;continue}if(e[n]==="\r"||e[n]===`
163
- `){n++;continue}return-1}return s===t.length?n:-1}function r9(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
164
- </${t}>`}function a_(e){return e.replace(/\r\n/g,`
165
- `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function l9(e,t,n){return n?e.includes(n,t)?!0:a_(e.slice(Math.max(0,t))).includes(a_(n)):!1}function a9(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
166
- `&&n++,n):e[n]===`
167
- `?n+1:t}function c_(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 c9(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function bv(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Vs(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function Fx(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const u9=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),d9=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function f9(e){return/\n\s*\n/.test(e)||d9.test(e)}function h9(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>u9.has(String(s?.type??"").toLowerCase()))||t.some(s=>{if(s?.type!=="html_block")return!1;const o=s;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!f9(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function p9(e,t,n,s){return e.map(o=>{if(o?.type!=="html_block")return o;const i=o,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||rx.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=hn(l);if(a===-1)return o;const c=bv(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=wc(u,t,Fx(n,s));return h9(u,d)?{...o,children:d}:o})}function wc(e,t,n){return e.trim()?Wx(e,t,{...n,__disableStreamParse:!0}):[]}function m9(e,t,n){const s=wc(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function g9(e,t,n){const s=Lx({content:e}),o=hn(e),i=bv(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=m9(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function v9(e,t,n){const s=hn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=kv(o,"summary",0);if(!i)return wc(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...wc(r,t,n),g9(i.raw,t,n),...wc(l,t,n)]}function Hx(e,t,n,s,o,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=_c(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!c_(c)){r.push(c);continue}const p=String(c.raw??_c(c)??""),m=d!==-1?d:t.indexOf(p,Math.max(0,l-p.length));if(m===-1){r.push(c);continue}let f=1,g=-1;for(let se=a+1;se<e.length;se++){const Q=e[se];if(c_(Q)){f++;continue}if(c9(Q)&&(f--,f===0)){g=se;break}}const w=kv(t,"details",m),b=g===-1&&w?.closed===!0,_=b?(()=>{const se=bv(p,"details");return se!==-1?p.slice(0,se):p})():p,[v]=Hx(b?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,s,o,m+p.length),y=v9(_,n,Fx(s,o)),k=g===-1?"</details>":String(e[g].raw??_c(e[g])??"</details>"),T=b||g!==-1&&w?.closed===!0,E=k.replace(/[\t\r\n ]+$/,""),C=T?(()=>{const se=(w?.raw??"").lastIndexOf(E);return se===-1?t.length:m+se})():t.length,M=hn(p),$=b&&M!==-1?m+M+1:m+p.length,L=t.slice($,C===-1?t.length:C),D=n.parse(L,{__markstreamFinal:o}),R=n.renderer.render(D,n.options,{__markstreamFinal:o}),P=C+E.length,O=T?Math.max(C+k.length,a9(t,P)):t.length,W=T?t.slice(C,O):k,V=T?t.slice(m,O):t.slice(m),z=b&&M!==-1?p.slice(0,M+1):p;if(r.push({...c,tag:"details",attrs:kh(p.slice(0,M+1)),raw:V,content:`${z}${R}${W}`,children:[...y,...v],loading:!o&&!T}),l=T?O:t.length,g===-1&&!b)break;g!==-1&&(a=g)}return[r,l]}function y9(e,t,n){if(!n)return e;const s=e.slice();let o=0;for(let i=0;i<s.length;i++){const r=s[i],l=_c(r),a=l?n.indexOf(l,o):-1;if(r?.type!=="html_block"){a!==-1&&(o=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(o=a+l.length);continue}const u=kv(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),p=String(r.raw??d),m=r9(u.raw,c,u.closed),f=!t&&!u.closed,g=d!==m||p!==u.raw||!!r.loading!==f,w=hn(u.raw),b=w===-1?"":u.raw.slice(0,w+1),_=b?kh(b):[];if(r.content=m,r.raw=u.raw,r.loading=f,r.attrs=_.length?_:void 0,!g)continue;let v=i9(u.raw,p);v===-1&&(v=0);const y=i+1;for(;y<s.length;){if(u.closed&&o9(s[y],c)){s.splice(y,1);continue}const k=_c(s[y]);if(!k)break;const T=u.raw.indexOf(k,v);if(T===-1){if(l9(n,u.end,k))break;s.splice(y,1);continue}v=T+k.length,s.splice(y,1)}}return s}function k9(e){const t=l=>l===" "||l===" "||l===`
168
- `||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=g=>{const w=g.charCodeAt(0);return w>=65&&w<=90||w>=97&&w<=122},u=g=>{const w=g.charCodeAt(0);return w>=48&&w<=57},d=g=>g==="!"||c(g),p=g=>c(g)||u(g)||g===":"||g==="-",m=g=>c(g)||u(g)||g==="_"||g==="."||g===":"||g==="-",f=m;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&p(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(!m(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a<l.length&&l[a]!==g;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const w=l[a];if(t(w)||w==="<"||w===">"||w==='"'||w==="'"||w==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const p=_=>_===" "||_===" ",m=_=>{let v=0;for(;v<_.length&&p(_[v]);)v++;const y=_[v];if(y!=="`"&&y!=="~")return null;let k=v;for(;k<_.length&&_[k]===y;)k++;const T=k-v;return T<3?null:{markerChar:y,markerLen:T,rest:_.slice(k)}},f=_=>{let v=0;for(;v<_.length&&p(_[v]);)v++;let y=!1;for(;v<_.length&&_[v]===">";)for(y=!0,v++;v<_.length&&p(_[v]);)v++;return y?_.slice(v):null},g=_=>{const v=m(_);if(v)return v;const y=f(_);return y==null?null:m(y)};let w=0;const b=l.split(/\r?\n/);for(const _ of b){const v=w,y=w+_.length;if(a<v)break;const k=g(_);if(k){const T=k.markerChar,E=k.markerLen;c?T===u&&E>=d&&/^\s*$/.test(k.rest)&&(c=!1,u="",d=0):(c=!0,u=T,d=E)}if(a<=y)break;w=y+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
169
- `||l==="\r",c=o[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return o}const r=o.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
170
- `||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function b9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const s=f=>f===" "||f===" ",o=f=>{const g=f.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||f==="_"||f==="-"||f===":"},i=f=>{if(!f)return!1;if(f[0]===" ")return!0;let g=0;for(let w=0;w<f.length;w++){const b=f[w];if(b===" "){if(g++,g>=4)return!0;continue}if(b===" ")return!0;break}return!1},r=f=>{let g=!1,w=!1;for(let b=0;b<f.length;b++){const _=f[b];if(_==="\\"){b++;continue}if(!w&&_==="'"){g=!g;continue}if(!g&&_==='"'){w=!w;continue}if(!g&&!w&&_===">")return b}return-1},l=f=>{let g=0;for(;g<f.length&&s(f[g]);)g++;const w=f[g];if(w!=="`"&&w!=="~")return null;let b=g;for(;b<f.length&&f[b]===w;)b++;const _=b-g;return _<3?null:{markerChar:w,markerLen:_,rest:f.slice(b)}},a=(f,g)=>{if(i(f))return-1;const w=f.replace(/^[ \t]+/,"");if(!w||w.startsWith(">")||w.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(w))return-1;let b=!1,_=0;for(;_<f.length;){const v=f[_];if(v!=="<"){s(v)||(b=!0),_++;continue}const y=r(f.slice(_));if(y===-1){b=!0,_++;continue}const k=f.slice(_,_+y+1);let T=1;for(;T<k.length&&s(k[T]);)T++;if(T>=k.length){b=!0,_++;continue}const E=k[T];if(E==="!"||E==="?"){b=!0,_+=y+1;continue}if(E==="/"){b=!0,_+=y+1;continue}const C=T;for(;T<k.length&&o(k[T]);)T++;if(T===C){b=!0,_++;continue}const M=k.slice(C,T).toLowerCase(),$=k[T];if($&&$!==" "&&$!==" "&&$!==">"&&$!=="/"){b=!0,_++;continue}const L=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),D=/\/\s*>$/.test(k),R=L.test(f.slice(_+y+1)),P=L.test(e.slice(g+_+y+1)),O=/[\r\n]/.test(e.slice(g+_+y+1));if(b&&n.has(M)&&!D&&!R&&(P||O))return _;b=!0,_+=y+1}return-1};let c=!1,u="",d=0,p="",m=0;for(;m<e.length;){const f=e.indexOf(`
171
- `,m),g=f!==-1,w=g&&f>m&&e[f-1]==="\r",b=g?w?f-1:f:e.length,_=e.slice(m,b),v=g?w?`\r
172
- `:`
173
- `:"",y=l(_);let k=_;if(!c&&!y){const T=a(_,m);if(T!==-1){const E=v||`
174
- `;k=`${_.slice(0,T).replace(/[ \t]+$/,"")}${E}${E}${_.slice(T).replace(/^[ \t]+/,"")}`}}p+=k,p+=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)),m=g?f+1:e.length}return p}function _9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const s=d=>d===" "||d===" ",o=d=>{const p=d.charCodeAt(0);return p>=65&&p<=90||p>=97&&p<=122||p>=48&&p<=57||d==="_"||d==="-"},i=d=>{let p=0;for(;p<d.length&&s(d[p]);)p++;return d.slice(p)},r=d=>{let p=!1,m=!1;for(let f=0;f<d.length;f++){const g=d[f];if(g==="\\"){f++;continue}if(!m&&g==="'"){p=!p;continue}if(!p&&g==='"'){m=!m;continue}if(!p&&!m&&g===">")return f}return-1},l=(d,p,m)=>{const f=m.toLowerCase();let g=d.indexOf("<",p);for(;g!==-1;){let w=g+1;for(;w<d.length&&s(d[w]);)w++;if(w>=d.length||d[w]!=="/"){g=d.indexOf("<",g+1);continue}for(w++;w<d.length&&s(d[w]);)w++;if(w+f.length>d.length){g=d.indexOf("<",g+1);continue}let b=!0;for(let v=0;v<f.length;v++){const y=d[w+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==f[v]){b=!1;break}}if(!b){g=d.indexOf("<",g+1);continue}let _=w+f.length;if(_<d.length&&o(d[_])){g=d.indexOf("<",g+1);continue}for(;_<d.length&&s(d[_]);)_++;if(_<d.length&&d[_]===">")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let p=0;for(;p<d.length&&s(d[p]);)p++;if(p>=d.length||d[p]!=="<")return d;for(p++;p<d.length&&s(d[p]);)p++;if(p>=d.length||d[p]==="/")return d;const m=p;for(;p<d.length&&o(d[p]);)p++;if(p===m)return d;const f=d.slice(m,p).toLowerCase();if(!n.has(f))return d;const g=r(d.slice(p));if(g===-1)return d;const w=p+g;if(l(d,w+1,f))return d;const b=i(d.slice(w+1));return b?`${d.slice(0,w+1)}
175
- ${b}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
176
- `,u);if(d===-1){c+=a(e.slice(u));break}const p=d>u&&e[d-1]==="\r",m=p?d-1:d,f=e.slice(u,m);c+=a(f),c+=p?`\r
177
- `:`
178
- `,u=d+1}return c}function w9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()));if(!n.size)return e;const s=p=>p===" "||p===" ",o=p=>{let m=0,f=!1,g=0;for(;m<p.length;){for(;m<p.length&&s(p[m]);)m++;if(m>=p.length||p[m]!==">")break;for(f=!0,m++;m<p.length&&s(p[m]);)m++;g=m}return f?{prefix:p.slice(0,g),content:p.slice(g)}:null},i=p=>{let m=0;for(;m<p.length&&s(p[m]);)m++;const f=p[m];if(f!=="`"&&f!=="~")return null;let g=m;for(;g<p.length&&p[g]===f;)g++;const w=g-m;return w<3?null:{markerChar:f,markerLen:w,rest:p.slice(g)}},r=Array.from(n).map(p=>new RegExp(String.raw`(<\s*\/\s*${p}\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 p=e.indexOf(`
179
- `,d),m=p!==-1,f=m&&p>d&&e[p-1]==="\r",g=m?f?p-1:p:e.length,w=e.slice(d,g),b=m?f?`\r
180
- `:`
181
- `:"",_=o(w),v=_?.prefix??"",y=_?.content??w,k=i(y);k&&(l?k.markerChar===a&&k.markerLen>=c&&/^\s*$/.test(k.rest)&&(l=!1,a="",c=0):(l=!0,a=k.markerChar,c=k.markerLen));let T=y;if(!l&&T.includes("</"))for(const E of r)T=T.replace(E,(C,M,$,L)=>{if(L.replace(/^[\t ]+/,"").startsWith("|"))return C;const D=L.slice(0,$).replace(/^[\t ]+/,"");if(D.length>0){const R=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",P=D.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!R||!P||R!==P)return C}return`${M}
182
-
183
- `});if(v){const E=v+T.split(`
184
- `).join(`
185
- ${v}`);u+=E}else u+=T;u+=b,d=m?p+1:e.length}return u}function S9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(D=>String(D??"").toLowerCase()));if(!n.size)return e;const s=D=>D===" "||D===" ",o=D=>{if(!D)return!1;if(D[0]===" ")return!0;let R=0;for(let P=0;P<D.length;P++){const O=D[P];if(O===" "){if(R++,R>=4)return!0;continue}if(O===" ")return!0;break}return!1},i=D=>{const R=D.charCodeAt(0);return R>=65&&R<=90||R>=97&&R<=122||R>=48&&R<=57||D==="_"||D==="-"||D===":"},r=D=>{let R=0;for(;R<D.length&&s(D[R]);)R++;return D.slice(R)},l=D=>{let R=0,P=!1,O=0;for(;R<D.length;){for(;R<D.length&&s(D[R]);)R++;if(R>=D.length||D[R]!==">")break;for(P=!0,R++;R<D.length&&s(D[R]);)R++;O=R}if(!P)return null;const W=D.slice(0,O);return{prefix:W,key:W.replace(/[ \t]+$/,""),content:D.slice(O)}},a=D=>r(D).startsWith("<"),c=D=>{for(let R=0;R<D.length;R++){const P=D[R];if(P!==" "&&P!==" ")return!1}return!0},u=D=>{if(o(D))return"";const R=r(D);if(!R.startsWith("<"))return"";let P=1;for(;P<R.length&&s(R[P]);)P++;if(P>=R.length||R[P]==="/"||R[P]==="!"||R[P]==="?")return"";const O=P;for(;P<R.length&&i(R[P]);)P++;if(P===O)return"";const W=R.slice(O,P).toLowerCase();if(!n.has(W))return"";const V=R[P];return V&&V!==" "&&V!==" "&&V!==">"&&V!=="/"?"":W},d=D=>{if(o(D))return null;const R=r(D);if(!R.startsWith("<"))return null;let P=1;for(;P<R.length&&s(R[P]);)P++;if(P>=R.length)return null;const O=R[P]==="/";if(O)for(P++;P<R.length&&s(R[P]);)P++;const W=R[P];if(!W||W==="!"||W==="?")return null;const V=P;for(;P<R.length&&i(R[P]);)P++;if(P===V)return null;const z=R.slice(V,P).toLowerCase();if(!n.has(z))return null;const se=R[P];if(se&&se!==" "&&se!==" "&&se!==">"&&se!=="/")return null;if(O)return{type:"close",name:z};if(/\/\s*>\s*$/.test(R))return{type:"open",name:z,complete:!0};const Q=R.indexOf(">",P);if(Q!==-1){const me=R.slice(Q+1);if(new RegExp(`<\\s*\\/\\s*${z}\\s*>`,"i").test(me))return{type:"open",name:z,complete:!0}}return{type:"open",name:z,complete:!1}},p=D=>{if(o(D))return null;const R=r(D).replace(/[ \t]+$/,"");if(!R.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(R))return null;const P=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(P?.[1])return P[1].toLowerCase();const O=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!O?.[1]||!O[2])return null;const W=O[1].toLowerCase();return W===O[2].toLowerCase()?W:null};let m=!1,f="",g=0;const w=D=>{let R=0;for(;R<D.length&&s(D[R]);)R++;const P=D[R];if(P!=="`"&&P!=="~")return null;let O=R;for(;O<D.length&&D[O]===P;)O++;const W=O-R;return W<3?null:{markerChar:P,markerLen:W,rest:D.slice(O)}},b=D=>w(D),_=D=>{const R=r(D);return R?o(D)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(R):!1},v=(D,R,P)=>{let O=D,W=0;for(;O<e.length;){const V=e.indexOf(`
186
- `,O),z=V!==-1,se=z&&V>O&&e[V-1]==="\r",Q=z?se?V-1:V:e.length,me=e.slice(O,Q),$e=l(me),He=$e?.key??"";if(W>0&&R&&He!==R)break;const Be=$e?.content??me,Ee=d(Be);if(Ee?.name===P){if(Ee.type==="open")Ee.complete||W++;else if(W>0&&(W--,W===0))return!1}else if(W>0&&(c(Be)||_(Be)))return!0;if(z)O=V+1;else break}return!1};let y="",k=0,T=!0,E=!1,C=!1,M=`
187
- `;const $=[];let L="";for(;k<e.length;){const D=e.indexOf(`
188
- `,k),R=D!==-1,P=R&&D>k&&e[D-1]==="\r",O=R?P?D-1:D:e.length,W=e.slice(k,O),V=R?P?`\r
189
- `:`
190
- `:"",z=l(W),se=z?.key??"",Q=z?.content??W,me=b(Q);me&&(m?me.markerChar===f&&me.markerLen>=g&&/^\s*$/.test(me.rest)&&(m=!1,f="",g=0):(m=!0,f=me.markerChar,g=me.markerLen));const $e=$.length>0;if(!m&&!$e){const Be=u(Q),Ee=!!Be&&!T&&E&&C&&v(k,se,Be);Be&&!T&&(!E||Ee)&&(se&&L&&se===L?y+=`${se}${M}`:se||(y+=M))}if(y+=W,y+=V,V&&(M=V),!m){const Be=d(Q);if(Be){if(Be.type==="open")Be.complete||$.push(Be.name);else for(let Ee=$.length-1;Ee>=0;Ee--)if($[Ee]===Be.name){$.length=Ee;break}}}const He=c(Q);T=He,E=!He&&a(Q),C=!He&&!!p(Q),L=se,k=R?D+1:e.length}return y}function Wx(e,t,n={}){const s=Px(n),o=s?fa():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(e9(t,n)&&t.stream.reset(),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,w=>w.startsWith(`
191
- `)?`
192
- `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,w=>w.startsWith(`
193
- `)?`
194
- `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,w=>w.startsWith(`
195
- `)?`
196
- `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
197
- `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,w=>w.startsWith(`
198
- `)?`
199
- `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(w,b,_)=>`${b}${_.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,w=>w.startsWith(`
200
- `)?`
201
- `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
202
- `))),n.customHtmlTags?.length&&r.includes("<")){const w=va(n.customHtmlTags);if(w.length&&(r=b9(r,w),r=_9(r,w),r=S9(r,w),r=w9(r,w),r.includes("</")))for(const b of w){const _=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${b}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(_,"$1$2$2")}}i||(r=k9(r));const l=s9(r);if(l){const w=n.preTransformTokens,b=n.postTransformTokens;if(Bx(t,n)||typeof w=="function"||typeof b=="function"){const _=i_(t,r,{__markstreamFinal:i},n),v=typeof w=="function"&&w(_)||_;typeof b=="function"&&b(v)}return _m(l,s,o)}const a=i_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return _m([],s,o);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const p=t,m=n.validateLink??p.options?.validateLink??(typeof p.validateLink=="function"?p.validateLink:void 0),f={...n,validateLink:m,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let g=s_(d,f,s);if(u&&typeof u=="function"){const w=u(d);if(Array.isArray(w)){const b=w[0],_=b?.type;b&&typeof _=="string"?g=s_(w,void 0,s):g=w}}if(g=y9(g,i,r),g=Hx(g,r,t,n,i)[0],g=p9(g,t,n,i),i){const w=new WeakSet,b=_=>{if(!_||typeof _!="object"||w.has(_))return;if(w.add(_),Array.isArray(_)){for(const y of _)b(y);return}const v=_;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))b(y)};b(g)}return n.debug&&console.log("Parsed Markdown Tree Structure:",g),_m(g,s,o)}function u_(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=br(t);let o=0;for(;o<e.length;){const i=vv(e,o,s.options(),gv);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=XD(e,o,s.options(l)),c=l_(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=ya(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=ka(e,o,s.options());n.push(l),s.remember(l.raw),o=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??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(YD()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=pn(r.children||[],l,void 0,s.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=l_(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const C9=new Set([...au,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),x9=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"]),d_=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function f_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function T9(e){return typeof e=="string"?e:e==null?"":String(e)}function Ux(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Qi(e){return T9(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function qx(e){return Qi(e).replace(/`/g,"&#96;")}function wh(e){return String(e??"").trim().toLowerCase()}function _v(e,t="safe"){const n=wh(e);return n?t==="escape"?!0:t==="trusted"?au.has(n):!x9.has(n):!1}function jx(e,t="safe"){const n=wh(e);return n?t==="escape"?!0:t==="trusted"?au.has(n):C9.has(n):!1}function h_(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${qx(s)}"`).join("")}function A9(e,t){const n=e.split(",").map(s=>s.trim()).filter(Boolean);return n.length===0?!1:n.some(s=>{const o=s.split(/\s+/,1)[0]??"";return!o||sa(o,{tagName:t,attrName:"srcset"})})}function zx(e,t,n,s){return $O.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?A9(t,s):!!(NO.has(e)&&t&&sa(t,{tagName:s,attrName:e}))}function Vr(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function Vx(e,t,n,s=!1){if(t!=="safe"||wh(n)!=="a")return e;const o=Vr(e,"href");if(s&&(!o||!e[o])){const a=Vr(e,"target"),c=Vr(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Vr(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Vr(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 p_(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Ux(r)||zx(l,i,t,n)||(s[r]=i)}return Vx(s,t,n,!!Vr(e,"href"))}function Kx(e,t){const n=e.toLowerCase();return ix.has(n)?!1:f_(t,n)||f_(t,e)}function wv(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Ux(r)||zx(l,i,t,n)||(s[r]=i)}return Vx(s,t,n,!!Vr(e,"href"))}function Tf(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function Hg(e,t="safe",n){const s=wv(Tf(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function M9(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 s=Number(e);if(e!==""&&!Number.isNaN(s))return s}return e}function E9(e){const t={};for(const[n,s]of Object.entries(e))t[n]=M9(s,n);return t}function m_(e){return e.trim().length>0}function I9(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 s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);m_(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);m_(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).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 p=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let m;for(;(m=p.exec(u))!==null;){const f=m[1],g=m[2]??m[3]??m[4]??"";f&&!f.endsWith("/")&&(d[f]=g)}}t.push({type:l||ll.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function $9(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const p=e.indexOf("-->",n);if(p!==-1){n=p+3;continue}break}const s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const p=e.indexOf("]]>",s);if(p!==-1){t.push({type:"text",content:e.slice(s,p+3)}),n=p+3;continue}break}if(e.startsWith("!",s+1)){const p=e.indexOf(">",s);if(p!==-1){n=p+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const p=i.slice(1).trim();t.push({type:"tag_close",tagName:p}),n=o+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 p=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let m;for(;(m=p.exec(u))!==null;){const f=m[1],g=m[2]??m[3]??m[4]??"";f&&!f.endsWith("/")&&(d[f]=g)}}t.push({type:l||ll.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function N9(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${Qi(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${Qi(s)}`:` ${Qi(s)}="${qx(o)}"`).join("");return e.type==="self_closing"?`&lt;${Qi(t)}${n} /&gt;`:`&lt;${Qi(t)}${n}&gt;`}function L9(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;d_.lastIndex=0;let n;for(;(n=d_.exec(e))!==null;)if(Kx(n[1],t))return!0;return!1}function oa(e,t="safe"){if(!e)return"";if(t==="escape")return Qi(e);const n=$9(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(Qi(r.content??""));continue}const l=wh(r.tagName);if(!l)continue;if(jx(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"&&_v(l,t)){o.push(N9(r));continue}if(r.type==="self_closing"){o.push(`<${l}${h_(p_(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${h_(p_(r.attrs??{},t,l))}>`),ll.has(l)||s.push(l);continue}const a=s.lastIndexOf(l);if(a===-1)continue;for(;s.length>a+1;){const u=s.pop();u&&o.push(`</${u}>`)}const c=s.pop();c&&o.push(`</${c}>`)}for(;s.length>0;){const r=s.pop();r&&o.push(`</${r}>`)}return o.join("")}const R9=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],g_="http://www.w3.org/2000/svg",O9=new Set(["script","style","iframe","object","embed","link","meta"]),P9=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"]),D9=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),B9=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),F9=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function H9(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function W9(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function U9(e){const t=e.nodeName.toLowerCase();return t==="use"?H9(e):t==="image"?W9(e):t==="text"||t==="tspan"?!!e.textContent?.trim():F9.has(t)}function q9(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 j9(e,t,n){const s=e.toLowerCase(),o=t.toLowerCase(),i=String(n??"").trim();return i?(s==="use"||s==="marker"||s==="clippath"||s==="mask")&&(o==="href"||o==="xlink:href")?i.startsWith("#")?i:"":s==="a"&&(o==="href"||o==="xlink:href")?sa(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?sa(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":sa(i,{tagName:s,attrName:o})?"":i:""}function z9(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const s=e[n];if(s==='"'||s==="'"){const i=n+1,r=e.indexOf(s,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 o=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(o,n)}}function Gx(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const s=n.trim();if(/^[0-9a-f]+$/i.test(s)){const o=Number.parseInt(s,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function Yx(e){const t=Gx(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=z9(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function v_(e){const t=Gx(e);return R9.some(n=>n.test(t))||Yx(t)}function V9(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 ud(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function Xx(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,s=n.tagName.toLowerCase();if(!O9.has(s)){if(s==="br"){t.push(`
203
- `);return}for(const o of Array.from(n.childNodes))Xx(o,t)}}function K9(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];Xx(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=ud(t.getAttribute("width")),i=ud(t.getAttribute("height")),r=ud(t.getAttribute("x")),l=ud(t.getAttribute("y")),a=e.ownerDocument.createElementNS(g_,"text");a.setAttribute("x",String(r+o/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")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,p]of s.entries()){const m=e.ownerDocument.createElementNS(g_,"tspan");m.setAttribute("x",String(r+o/2)),m.setAttribute("dy",d===0?`${u}em`:"1.2em"),m.textContent=p,a.appendChild(m)}}t.parentNode?.replaceChild(a,t)}}function G9(e){K9(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!P9.has(s)){n.remove();continue}if(s==="style"&&v_(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&v_(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(D9.has(r)&&i.value){const l=j9(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(B9.has(r)&&i.value&&Yx(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=q9(i.value);l!==i.value&&n.setAttribute(i.name,l)}}V9(n)}}function Zde(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 G9(n),Y9(n)?null:n}catch{return null}}function Y9(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const i=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let s=!1;for(const o of n){U9(o)&&(s=!0);for(const i of Array.from(o.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!s}const y_=[];function wm(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function X9(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function Z9(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function k_(e=`editor-${Date.now()}`,t={}){const n=x7(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const p=t.i18n;o=m=>p[m]??s[m]??m}else o=p=>s[p]??p;if(Array.isArray(t.plugin))for(const p of t.plugin){const m=p;if(Array.isArray(m)){const[f,...g]=m;typeof f=="function"&&n.use(f,...g)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const p of t.apply)try{p(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(y_.length)for(const p of y_)if(Array.isArray(p)){const[m,...f]=p;typeof m=="function"&&n.use(m,...f)}else typeof p=="function"&&n.use(p);n.use(bN),n.use(SN),n.use(vN);const i=DN,r=i.default??i;n.use(r),n.use(gN),n.use(mN),n.core.ruler.after("block","mark_fence_closed",p=>{const m=p,f=m.src,g=!!m.env?.__markstreamFinal,w=f.split(/\r?\n/);for(const b of m.tokens){if(b.type!=="fence"||!b.map||!b.markup)continue;const _=b.map[0],v=b.map[1],y=b.markup,k=y[0],T=y.length,E=w[Math.max(0,v-1)]??"";let C=0;for(;C<E.length&&(E[C]===" "||E[C]===" ");)C++;let M=0;for(;C+M<E.length&&E[C+M]===k;)M++;let $=C+M;for(;$<E.length&&(E[$]===" "||E[$]===" ");)$++;const L=g?!0:v>_+1&&M>=T&&$===E.length,D=b;D.meta=D.meta??{},D.meta.unclosed=!L,D.meta.closed=!!L}});const l=(p,m)=>{const f=p,g=f.pos;if(f.src[g]!=="~")return!1;const w=f.src[g-1],b=f.src[g+1];if(/\d/.test(w)&&/\d/.test(b)){if(!m){const _=f.push("text","",0);_.content="~"}return f.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(p,m)=>{const f=p[m],g=String(f.info??"").trim(),w=String(f.content??""),b=btoa(unescape(encodeURIComponent(w))),_=X9(g),v=wm(_),y=Z9(`editor-${e}-${m}-${_}`),k=wm(o("common.copy"));return`<div class="code-block" data-code="${b}" data-lang="${v}" id="${y}">
204
- <div class="code-header">
205
- <span class="code-lang">${wm(_.toUpperCase())}</span>
206
- <button class="copy-button" data-code="${b}">${k}</button>
207
- </div>
208
- <div class="code-editor"></div>
209
- </div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=p=>{if(!p.startsWith("["))return!1;const m=c.exec(p);if(!m)return p!=="["&&!/^\[\d+$/.test(p);const f=String(m[1]??"");return p.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(f)},d=(p,m)=>{const f=p;if(f.src[f.pos]!=="[")return!1;const g=a.exec(f.src.slice(f.pos));if(!g)return!1;const w=f.src.slice(Math.max(0,f.pos-120),f.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(w))return!1;const b=f.src.slice(f.pos+g[0].length);if(b.startsWith("](")||b.startsWith("(")||u(b))return!1;if(!m){const _=g[1],v=f.push("reference","span",0);v.content=_,v.markup=g[0],v.raw=g[0]}return f.pos+=g[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(p,m)=>{const g=String(p[m].content??"");return`<span class="reference-link" data-reference-id="${g}" role="button" tabindex="0" title="Click to view reference">${g}</span>`},n}const J9="modulepreload",Q9=function(e){return"/"+e},b_={},js=function(t,n,s){let o=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");o=r(n.map(c=>{if(c=Q9(c),c in b_)return;b_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":J9,u||(p.as="script"),p.crossOrigin="",p.href=c,a&&p.setAttribute("nonce",a),document.head.appendChild(p),u)return new Promise((m,f)=>{p.addEventListener("load",m),p.addEventListener("error",()=>f(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 o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function eB({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 Zx({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:eB({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}function Il(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function __(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var tB=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 p=this.source.length>0,m=this.pendingChars<=0;if(this.source+=d,m){const f=w_();this.startedAt=p&&this.hasStarted?f-this.normalizedStartDelayMs:f,this.lastTick=f,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=w_();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 p=1e3/Math.max(1,this.maxCommitFps),m=Math.min(100,Math.max(0,d-this.lastTick));if(m<p){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const f=this.pendingChars,g=f>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,w=iB(f/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(w-this.currentCps)*.2,this.charBudget+=this.currentCps*(m/1e3),this.charBudget<1){this.ensureLoop();return}const b=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),_=oB(this.source.slice(this.visible.length),b,this.segmenter);_.text&&(this.visible+=_.text,this.charBudget=Math.max(0,this.charBudget-_.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Il(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Il(s,1e3,1)),this.normalizedTargetLatencyMs=Il(o,900,1),this.normalizedCatchUpLatencyMs=Il(i,350,1),this.normalizedCatchUpThreshold=__(r,600),this.normalizedStartDelayMs=__(a,80),this.maxCommitFps=Math.trunc(Il(l,30,1)),this.maxCharsPerCommit=Math.trunc(Il(c,80,1)),this.flushOnFinish=u,this.segmenter=sB(),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 nB(e={},t){const n=new tB(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 sB(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function oB(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 s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function w_(){return typeof performance<"u"?performance.now():Date.now()}function iB(e,t,n){return Math.min(n,Math.max(t,e))}var rB=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Wg=Symbol.for("markstream-vue:node-lifecycle"),Ug=new Map;let S_="material";const Ul=new Map,C_=new Map;let qg=null;function lB(e){Ug.set(e.id,e)}function aB(e){return rB(this,null,function*(){var t,n,s;if(Ul.has(e.id))return(t=Ul.get(e.id))!=null?t:null;let o=C_.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Ul.set(e.id,i),qg?.(),i)).catch(()=>(Ul.set(e.id,null),null)),C_.set(e.id,o)),o})}const x_='<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>',T_='<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>',cB={id:"material",core:{"":T_,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:T_,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:x_,csharp:x_,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:()=>js(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},uB=rl(0);qg=()=>{uB.value++},lB(cB);const dB={"":"",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","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Jx(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=dB[n])!=null?t:n}function Jde(e){const t=Jx(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Qde(e){return(function(s){const o=Ug.get(S_);if(!o)return;const i=o.core[s];if(i)return i;const r=Ul.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!Ul.has(o.id)&&aB(o)})(Jx(e))||((n=(t=Ug.get(S_))==null?void 0:t.fallback)!=null?n:"");var t,n}const efe={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#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let Qx=!1;function tfe(){return Qx}function nfe(){Qx=!0}var Sh=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let vo=null,Sm=!1,Sv=eT;function Ch(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Cv(){try{const e=globalThis;return Ch(e?.katex)}catch{return null}}function eT(){return Sh(null,null,function*(){const e=Cv();if(e)return e;const t=yield js(()=>import("./katex-HP8lGamR.js"),[]);try{yield js(()=>import("./mhchem-KEf2LMH_.js"),__vite__mapDeps([0,1]))}catch{}return Ch(t)})}function tT(){return typeof Sv=="function"}function sfe(){var e;const t=Sv;if(!t||t===eT)return null;if(vo)return vo;const n=Cv();if(n)return vo=n,vo;try{const s=t();return s&&typeof s?.then!="function"?(vo=(e=Ch(s))!=null?e:s,vo):null}catch{return null}}function xv(){return Sh(this,null,function*(){var e;const t=Cv();if(t)return vo=t,vo;if(vo)return vo;if(Sm)return null;const n=Sv;if(!n)return Sm=!0,null;try{const s=yield n();if(s)return vo=(e=Ch(s))!=null?e:s,vo}catch{}return Sm=!0,null})}function nT(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let $l=null;const sT=new Map,lc=new Map;let oT=5;const Yr=new Set;function fB(){if(sT.size<oT&&Yr.size){const e=Array.from(Yr);Yr.clear();for(const t of e)try{t()}catch{}}}function hB(e,t=!0,n=2e3,s){return Sh(this,null,function*(){performance.now();const o=nT(e);if(!tT()){const l=new Error("KaTeX rendering disabled");return l.name="KaTeXDisabled",l.code="KATEX_DISABLED",Promise.reject(l)}if($l)return Promise.reject($l);const i=`${t?"d":"i"}:${o}`,r=lc.get(i);return r?Promise.resolve(r):($l=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),$l.name="WorkerInitError",$l.code="WORKER_INIT_ERROR",Promise.reject($l))})}function ofe(e,t=!0,n){const s=`${t?"d":"i"}:${nT(e)}`;if(lc.set(s,n),lc.size>200){const o=lc.keys().next().value;lc.delete(o)}}const pB="WORKER_BUSY";function mB(e=2e3,t){return sT.size<oT?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Yr.delete(r),n())};if(Yr.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Yr.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>fB()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Yr.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Ja={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function ife(e){return Sh(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!tT()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=s.timeout)!=null?o:Ja.timeout,c=(i=s.waitTimeout)!=null?i:Ja.waitTimeout,u=(r=s.backoffMs)!=null?r:Ja.backoffMs,d=(l=s.maxRetries)!=null?l:Ja.maxRetries,p=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Ja.maxRetries,m=s.signal;let f=0;for(;;){if(m?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield hB(t,n,a,m)}catch(g){if(g?.code!==pB||f>=p)throw g;if(f++,yield mB(c,m).catch(()=>{}),m?.aborted){const w=new Error("Aborted");throw w.name="AbortError",w}u>0&&(yield new Promise(w=>globalThis.setTimeout(w,u*f)))}}})}var gB=Object.defineProperty,vB=Object.defineProperties,yB=Object.getOwnPropertyDescriptors,A_=Object.getOwnPropertySymbols,kB=Object.prototype.hasOwnProperty,bB=Object.prototype.propertyIsEnumerable,M_=(e,t,n)=>t in e?gB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tt=(e,t)=>{for(var n in t||(t={}))kB.call(t,n)&&M_(e,n,t[n]);if(A_)for(var n of A_(t))bB.call(t,n)&&M_(e,n,t[n]);return e},xt=(e,t)=>vB(e,yB(t)),fn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const _B="__global__",Cm="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",jg=(()=>{const e=globalThis;if(e[Cm])return e[Cm];const t={scopedCustomComponents:{},revision:rl(0)};return e[Cm]=t,t})(),E_=jg.revision,wB=Symbol("markstreamCustomComponents"),SB=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 uu(e){return SB.has(String(e).trim().toLowerCase())}function CB(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function xm(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([Co(n),Co(CB(n))]))!o||uu(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function An(e){const t=Rt(wB,null);return U(()=>{var n;return E_.value,(function(s,o={}){return E_.value,tt(tt(tt({},xm(jg.scopedCustomComponents[_B]||{})),xm(o)),xm((function(i){return i&&jg.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const xB=["aria-label"],TB={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"},AB={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"},zt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Ks=zt(Xe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(S(),I("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(S(),I("svg",AB,[...n[1]||(n[1]=[h("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),h("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(S(),I("svg",TB,[...n[0]||(n[0]=[h("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,xB))}),[["__scopeId","data-v-be21ab83"]]);Ks.install=e=>{e.component(Ks.__name,Ks)};const MB={class:"emoji-node"},Es=zt(Xe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(S(),I("span",MB,N(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Es.install=e=>{e.component(Es.__name,Es)};const EB=["id"],IB=["title"],Gs=zt(Xe({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(S(),I("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[h("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+N(e.node.id)+"]",9,IB)],8,EB))}}),[["__scopeId","data-v-c1463a29"]]);Gs.install=e=>{e.component(Gs.__name,Gs)};const iT=(()=>{try{return!1}catch{}return!1})();function Tm(e){iT&&console.warn(e)}function I_(e,t="safe",n){return wv(e,t,n)}function rT(e){return E9(e)}function Am(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function Tv(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=Hg((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Am(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Am(r.value)]):Object.entries(o).map(([r,l])=>[r,Am(l)]):null,t,n);var o;if(!s)return;const i=rT(Tf(s));return Object.keys(i).length>0?i:void 0}function $_(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Qa(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Mm(e,t,n,s,o,i,r=!1){const l=(function(d,p){return Kx(d,p)})(e,s);if(au.has(e.toLowerCase())||!l&&jx(e,i))return null;if(!l&&_v(e,i))return r?[$_(e,t,!0)]:[$_(e,t),...n,`</${e}>`];const a=wv(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],p=rT(a);return jt(d,xt(tt({},p),{key:u}),n.length>0?n:void 0)}return jt(e,xt(tt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function lT(e,t){return L9(e,t)}function Af(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 p=Mm(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Qa(c.length>0?c[c.length-1].children:u,p)}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 p=d.tagName.toLowerCase();let m=-1;for(let f=c.length-1;f>=0;f--)if(c[f].tagName.toLowerCase()===p){m=f;break}if(m!==-1)for(;c.length>m;){const f=c.pop(),g=Mm(f.tagName,f.attrs||{},f.children,r,f.autoKey,l);c.length>0?Qa(c[c.length-1].children,g):Qa(u,g),f.tagName.toLowerCase()!==p&&c.length>m&&Tm(`Auto-closing unclosed tag: <${f.tagName}>`)}else Tm(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),p=Mm(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Qa(c[c.length-1].children,p):Qa(u,p),Tm(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(I9(e),t,n)}catch(o){return s=o,iT&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const $B=["innerHTML"],Ys=zt(Xe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Rt("markstreamHtmlPolicy",void 0),s=U(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=An(()=>t.customId),i=Xe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=U(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:oa(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Af(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!lT(l,o.value))return{mode:"html",content:oa(l,s.value)};const a=Af(l,o.value,s.value);return a===null?{mode:"html",content:oa(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(S(),I("span",{key:0,class:Te(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[pt(A(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(S(),I("span",{key:1,class:Te(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},N(r.value.content),3)):(S(),I("span",{key:2,class:Te(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,$B))}}),[["__scopeId","data-v-d17f12b0"]]);Ys.install=e=>{e.component(Ys.__name,Ys)};const NB={class:"inline-code"},LB={key:0},is=zt(Xe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=su(),s=Rt("markstreamFade",void 0),o=Rt("markstreamTextStreamState",void 0),i=Rt("markstreamStreamVersion",void 0),r=U(()=>{const _=n.fade;return _===""||_===!0||_==="true"||_!==!1&&_!=="false"&&void 0}),l=U(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=U(()=>{var _;return String((_=t.node.code)!=null?_:"")}),c=U(()=>!l.value),u=U(()=>{var _;const v=(_=n["index-key"])!=null?_:n.indexKey;return v==null||v===""?"":String(v)}),d=ie(t.node.code),p=ie("");let m=i?.value;const f=ie(0);function g(){return d.value+p.value}function w(){p.value&&(d.value=g(),p.value="")}Ve([()=>t.node.code,u,l,()=>i?.value],([_,v,y,k])=>{const T=String(_??""),E=u.value,C=k!==m;m=k;const M=Zx({nextContent:T,persistedContent:E?o?.get(E):void 0,currentState:{settledContent:d.value,streamedDelta:p.value},typewriterEnabled:l.value,streamRenderVersionChanged:C});d.value=M.settledContent,p.value=M.streamedDelta,M.appended&&(f.value+=1),E&&o?.set(E,T)},{immediate:!0}),Ve(l,_=>{var v;_||(v=g(),d.value=v,p.value="")});const b=U(()=>f.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(_,v)=>(S(),I("code",NB,[c.value?(S(),I(Me,{key:0},[vt(N(a.value),1)],64)):(S(),I(Me,{key:1},[d.value?(S(),I("span",LB,N(d.value),1)):ue("",!0),p.value?(S(),I("span",{key:1,class:Te(["inline-code-stream-delta",[b.value]]),onAnimationend:w},N(p.value),35)):ue("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);is.install=e=>{e.component(is.__name,is)};const zg=ie(!1),N_=ie(""),L_=ie("top"),Sc=ie(null),Cc=ie(null),Vg=ie(null),Kg=ie(null),R_=ie(null);let Ed=null,Id=null,Gg=0;function aT(){Ed&&(clearTimeout(Ed),Ed=null),Id&&(clearTimeout(Id),Id=null)}let dd=!1,fd=null,O_=!1;function RB(e,t,n="top",s=!1,o,i){if(!e)return;const r=++Gg;aT();const l=()=>fn(null,null,function*(){var a,c;if(yield(function(){return fn(this,null,function*(){if(!dd&&!O_&&typeof document<"u"){fd!=null||(fd=fn(null,null,function*(){const[{createApp:u,h:d},{default:p}]=yield Promise.all([js(()=>import("./vue.runtime.esm-bundler-C3-MzG4F.js"),[]),js(()=>import("./Tooltip-DzPFYPha.js"),[])]),m=document.createElement("div");m.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(m),u({setup:()=>()=>{var f;return d(p,{visible:zg.value,"anchor-el":Sc.value,content:N_.value,placement:L_.value,id:Cc.value,originX:Vg.value,originY:Kg.value,isDark:(f=R_.value)!=null?f:void 0})}}).mount(m),dd=!0}));try{yield fd}catch(u){dd=!1,fd=null,O_=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),dd&&r===Gg){Cc.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Sc.value=e,N_.value=t,L_.value=n,Vg.value=(a=o?.x)!=null?a:null,Kg.value=(c=o?.y)!=null?c:null,R_.value=typeof i=="boolean"?i:null,zg.value=!0;try{e.setAttribute("aria-describedby",Cc.value)}catch{}}});s?l():Ed=setTimeout(l,80)}function OB(e=!1){Gg+=1,aT();const t=()=>{if(Sc.value&&Cc.value)try{Sc.value.removeAttribute("aria-describedby")}catch{}zg.value=!1,Sc.value=null,Cc.value=null,Vg.value=null,Kg.value=null};e?t():Id=setTimeout(t,120)}const Yg={"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..."},Xg=e=>{var t;return(t=Yg[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function P_(e){return{t(t){if(e.te&&Yg[t]&&!e.te(t))return Xg(t);const n=e.t(t);return n===t&&Yg[t]?Xg(t):n}}}function PB(){const e=(function(){var t,n;try{const s=rs(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.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 P_(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return P_({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Xg}}function DB(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const BB=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],FB={key:1,class:"image-placeholder"},HB={key:1,class:"image-node__raw-text"},WB={key:0,class:"image-shimmer-overlay"},UB={key:1,class:"image-node__raw-text"},qB={key:2,class:"image-error"},rr=zt(Xe({__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,s=t,o=ie(!1),i=ie(!1),r=ie(""),l=ie("primary"),a=ie(null),c=su(),u=Rt(Wg,null);let d="",p=null;const m=U(()=>Eb(n.node.src)),f=U(()=>Eb(n.fallbackSrc)),g=U(()=>r.value),w=U(()=>!n.lazy),b=U(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),_=U(()=>l.value==="failed"),v=U(()=>!w.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=U(()=>DB(n,c));function k(P=y.value){P&&a.value&&u?.reportHeight(P,a.value.offsetHeight)}function T(P=y.value){P&&ut(()=>{k(P)})}function E(){p&&(clearTimeout(p),p=null)}function C(){const P=y.value;P&&d!==P&&(d&&u?.markSettled(d),E(),d=P,u?.markPending(P),typeof window<"u"&&(p=window.setTimeout(()=>{d===P&&(T(P),M())},8e3)))}function M(){return fn(this,null,function*(){const P=d;P&&(E(),d="",yield ut(),k(P),u?.markSettled(P))})}function $(){if(l.value==="primary"&&f.value&&f.value!==r.value)return l.value="fallback",r.value=f.value,o.value=!1,i.value=!1,void T();l.value="failed",i.value=!0,s("error",r.value),T()}function L(){o.value=!0,i.value=!1,s("load",g.value),T()}function D(P){P.preventDefault(),o.value&&!i.value&&s("click",[P,g.value])}const{t:R}=PB();return Ve([m,f,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||m.value?(r.value=m.value,void(l.value="primary")):f.value?(r.value=f.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ve([b,o,i,g,()=>n.lazy],([P,O,W,V,z])=>P&&V&&!W?O?(M(),void T()):z?(C(),void T()):void(O||W||C()):(M(),void T()),{flush:"post",immediate:!0}),Js(()=>{(function(){const P=d;P&&(E(),d="",u?.markSettled(P))})()}),(P,O)=>{var W,V,z,se,Q;return S(),I("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[b.value?(S(),I("img",{key:0,src:g.value,alt:String((V=(W=n.node.alt)!=null?W:n.node.title)!=null?V:""),title:String((se=(z=n.node.title)!=null?z:n.node.alt)!=null?se:""),class:Te(["image-node__img",{"is-loading":!w.value&&!o.value,"is-loaded":w.value||o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:w.value?"high":void 0,decoding:w.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(Q=n.node.alt)!=null?Q:A(R)("image.preview"),onError:$,onLoad:L,onClick:D},null,42,BB)):ue("",!0),e.node.loading&&!i.value?(S(),I("span",FB,[n.usePlaceholder?Yl(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[0]||(O[0]=h("span",{class:"image-shimmer"},null,-1))],!0):(S(),I("span",HB,N(e.node.raw),1))])):ue("",!0),pt(Si,{name:"shimmer-fade"},{default:yn(()=>[v.value&&!e.node.loading?(S(),I("span",WB,[n.usePlaceholder?Yl(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[1]||(O[1]=h("span",{class:"image-shimmer"},null,-1))],!0):(S(),I("span",UB,N(e.node.raw),1))])):ue("",!0)]),_:3}),_.value?(S(),I("span",qB,[Yl(P.$slots,"error",{node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[O[2]||(O[2]=h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[h("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)),h("span",null,N(A(R)("image.loadError")),1)],!0)])):ue("",!0)],512)}}}),[["__scopeId","data-v-373b57e2"]]);rr.install=e=>{e.component(rr.__name,rr)};const jB={key:2},ei=Xe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=An(()=>t.customId),s=Rt("markstreamHtmlPolicy",void 0),o=Rt("markstreamNestedRendererProps",void 0),i=U(()=>{var f;return(f=s?.value)!=null?f:"safe"}),r=U(()=>{var f,g;const w=(f=o?.value)!=null?f:{};return xt(tt({},w),{customId:(g=t.customId)!=null?g:w.customId,htmlPolicy:i.value})}),l=Xo({loader:()=>Promise.resolve().then(()=>Lv),suspensible:!1}),a=U(()=>t.components[String(t.node.type)]),c=U(()=>!!(a.value&&n.value[t.node.type]&&!uu(String(t.node.type)))),u=U(()=>c.value?Tv(t.node,i.value):void 0),d=U(()=>Array.isArray(t.node.children)&&t.node.children.length>0),p=U(()=>{var f;return String((f=t.node.content)!=null?f:"")}),m=U(()=>{var f,g;return String((g=(f=t.node.content)!=null?f:t.node.raw)!=null?g:"")});return(f,g)=>a.value&&c.value?(S(),je(ss(a.value),Vt({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:yn(()=>[d.value?(S(),je(A(l),Vt({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"])):p.value?(S(),je(A(l),Vt({key:1},r.value,{content:p.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"])):ue("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(S(),je(ss(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(S(),I("span",jB,N(m.value),1)):ue("",!0)}}),zB=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],VB={key:0,translate:"no",class:"markstream-pre__diff-code"},KB={class:"markstream-pre__diff-number","aria-hidden":"true"},GB={class:"markstream-pre__diff-content"},YB={class:"markstream-pre__diff-content-inner"},XB={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},ZB=["textContent"],mo=Xe({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=U(()=>{var C,M,$;const L=String((M=(C=t.node)==null?void 0:C.language)!=null?M:"");return String(($=String(L).split(/\s+/g)[0])!=null?$:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=U(()=>`language-${n.value}`),o=U(()=>{var C,M;return String((M=(C=t.node)==null?void 0:C.code)!=null?M:"").split(/\r\n|\n|\r/)}),i=U(()=>Array.from({length:Math.max(1,o.value.length)},(C,M)=>M+1)),r=U(()=>{var C;return t.showLineNumbers===!0&&((C=t.node)==null?void 0:C.diff)===!0}),l=U(()=>r.value&&t.diffInline===!0),a=U(()=>{const C=Number(t.reservedHeightPx);if(!Number.isFinite(C)||C<=0)return;const M=`${Math.ceil(C)}px`;return{height:M,minHeight:M,maxHeight:M,overflow:"auto"}});function c(C,M="context"){const $=(function(L){return String(L??"").trim().length===0})(C);return{code:C,kind:$&&M!=="hunk"?"context":M,empty:$}}function u(C){return String(C??"").split(/\r\n|\n|\r/)}function d(C){return C.startsWith("-")&&!C.startsWith("---")}function p(C){return C.startsWith("+")&&!C.startsWith("+++")}const m=U(()=>{var C,M,$,L,D,R;const P=o.value.some(V=>d(V)||p(V));if(l.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:P?(function(z){const se=[];let Q=1,me=1;for(const[$e,He]of z.entries())if(He.startsWith("@@"))se.push(xt(tt({},c(He,"hunk")),{key:`inline-hunk-${$e}`,number:""}));else if(d(He))se.push(xt(tt({},c(He.slice(1),"removed")),{key:`inline-removed-${$e}`,number:Q++}));else if(p(He))se.push(xt(tt({},c(He.slice(1),"added")),{key:`inline-added-${$e}`,number:me++}));else{const Be=He.startsWith(" ")?He.slice(1):He;se.push(xt(tt({},c(Be)),{key:`inline-context-${$e}`,number:me})),Q++,me++}return se})(o.value):(function(z,se){const Q=u(z),me=u(se),$e=[];let He=0,Be=Q.length-1,Ee=me.length-1;for(;He<=Be&&He<=Ee&&Q[He]===me[He];)$e.push(xt(tt({},c(me[He])),{key:`inline-prefix-${He}`,number:He+1})),He++;const te=[];for(;Be>=He&&Ee>=He&&Q[Be]===me[Ee];)te.unshift(xt(tt({},c(me[Ee])),{key:`inline-suffix-${Ee}`,number:Ee+1})),Be--,Ee--;for(let ee=He;ee<=Be;ee++)$e.push(xt(tt({},c(Q[ee],"removed")),{key:`inline-removed-source-${ee}`,number:ee+1}));for(let ee=He;ee<=Ee;ee++)$e.push(xt(tt({},c(me[ee],"added")),{key:`inline-added-source-${ee}`,number:ee+1}));return $e.concat(te)})((C=t.node)==null?void 0:C.originalCode,(M=t.node)==null?void 0:M.updatedCode)}];if(!P&&((($=t.node)==null?void 0:$.originalCode)!=null||((L=t.node)==null?void 0:L.updatedCode)!=null))return[{key:"original",className:"markstream-pre__diff-pane--original",lines:u((D=t.node)==null?void 0:D.originalCode).map((V,z)=>xt(tt({},c(V,"removed")),{key:`original-${z}`,number:z+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:u((R=t.node)==null?void 0:R.updatedCode).map((V,z)=>xt(tt({},c(V,"added")),{key:`modified-${z}`,number:z+1}))}];const O=[],W=[];for(const V of o.value)if(V.startsWith("@@"))O.push(c(V,"hunk")),W.push(c(V,"hunk"));else if(V.startsWith("-")&&!V.startsWith("---"))O.push(c(V.slice(1),"removed"));else if(V.startsWith("+")&&!V.startsWith("+++"))W.push(c(V.slice(1),"added"));else{const z=V.startsWith(" ")?V.slice(1):V;O.push(c(z)),W.push(c(z))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:O.map((V,z)=>xt(tt({},V),{key:`original-${z}`,number:z+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:W.map((V,z)=>xt(tt({},V),{key:`modified-${z}`,number:z+1}))}]}),f=U(()=>{const C=n.value;return C?`Code block: ${C}`:"Code block"}),g=ie(null),w=ie([]);let b=null,_=null;function v(C){const M=Number.parseFloat(String(C??""));return Number.isFinite(M)&&M>0?M:0}function y(C,M){var $;if(!C)return M;const L=C.querySelector(".markstream-pre__diff-content"),D=L?.getBoundingClientRect(),R=($=D?.height)!=null?$:0;return Math.max(M,Math.ceil(R))}function k(){typeof window<"u"&&(b!=null&&window.cancelAnimationFrame(b),b=window.requestAnimationFrame(()=>{(function(){var C,M;b=null;const $=g.value;if(!$||!r.value)return void(w.value.length&&(w.value=[]));const L=(function(z){const se=window.getComputedStyle(z),Q=v(se.getPropertyValue("--markstream-pre-diff-line-height"));if(Q>0)return Q;const me=v(se.lineHeight);return me>0?me:18})($),D=Array.from($.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),R=Array.from($.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),P=Math.max(D.length,R.length),O=[];for(let z=0;z<P;z++){const se=y((C=D[z])!=null?C:null,L),Q=y((M=R[z])!=null?M:null,L),me=Math.max(L,se,Q);O.push({rowHeight:me,originalHeight:se,modifiedHeight:Q})}var W,V;W=w.value,V=O,W.length===V.length&&W.every((z,se)=>{const Q=V[se];return Q&&Math.abs(z.rowHeight-Q.rowHeight)<=.5&&Math.abs(z.originalHeight-Q.originalHeight)<=.5&&Math.abs(z.modifiedHeight-Q.modifiedHeight)<=.5})||(w.value=O)})()}))}function T(C){_?.disconnect(),_=null,C&&r.value&&typeof ResizeObserver<"u"&&(_=new ResizeObserver(()=>{k()}),_.observe(C))}function E(C,M){const $=w.value[C];if(!$)return;const L=M==="original"?$.originalHeight:$.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil($.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(L)}px`}}return Ve(g,C=>{T(C),ut(()=>k())},{flush:"post"}),Ve([r,m],()=>{T(g.value),ut(()=>k())},{flush:"post",immediate:!0}),Js(()=>{b!=null&&(window.cancelAnimationFrame(b),b=null),_?.disconnect(),_=null}),(C,M)=>(S(),I("pre",{ref_key:"preRef",ref:g,style:Dt(a.value),class:Te([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":r.value,"markstream-pre--diff-inline":l.value}]),"aria-busy":e.node.loading===!0,"aria-label":f.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[r.value?(S(),I("code",VB,[(S(!0),I(Me,null,Ze(m.value,$=>(S(),I("span",{key:$.key,class:Te(["markstream-pre__diff-pane",$.className])},[(S(!0),I(Me,null,Ze($.lines,(L,D)=>(S(),I("span",{key:L.key,class:Te(["markstream-pre__diff-line",[`markstream-pre__diff-line--${L.kind}`,{"markstream-pre__diff-line--empty":L.empty}]]),style:Dt(E(D,$.key))},[M[0]||(M[0]=h("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),h("span",KB,N(L.number),1),h("span",GB,[h("span",YB,N(L.code),1)])],6))),128))],2))),128))])):(S(),I(Me,{key:1},[t.showLineNumbers?(S(),I("span",XB,[(S(!0),I(Me,null,Ze(i.value,$=>(S(),I("span",{key:$,class:"markstream-pre__line-number"},N($),1))),128))])):ue("",!0),h("code",{translate:"no",class:"markstream-pre__code",textContent:N(e.node.code)},null,8,ZB)],64))],14,zB))}});mo.install=e=>{e.component(mo.__name,mo)};const Em=rl(!1);let D_=null;const JB={key:0},kn=zt(Xe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(D_||(D_=xv().then(b=>{Em.value=!!b}).catch(()=>{Em.value=!1})),Ud(Em)),s=su(),o=Rt("markstreamFade",void 0),i=Rt("markstreamTextStreamState",void 0),r=Rt("markstreamStreamVersion",void 0),l=U(()=>{const b=s.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),a=U(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=U(()=>{var b;const _=(b=s["index-key"])!=null?b:s.indexKey;return _==null||_===""?"":String(_)}),u=ie(t.node.content),d=ie("");let p=r?.value;const m=ie(0);function f(){return u.value+d.value}function g(){d.value&&(u.value=f(),d.value="")}Ve([()=>t.node.content,c,a,()=>r?.value],([b,_,v,y])=>{const k=String(b??""),T=c.value,E=y!==p;p=y;const C=Zx({nextContent:k,persistedContent:T?i?.get(T):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:E});u.value=C.settledContent,d.value=C.streamedDelta,C.appended&&(m.value+=1),T&&i?.set(T,k)},{immediate:!0}),Ve(a,b=>{var _;b||(_=f(),u.value=_,d.value="")});const w=U(()=>m.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(b,_)=>(S(),I("span",{class:Te([[A(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(S(),I("span",JB,N(u.value),1)):ue("",!0),d.value?(S(),I("span",{key:1,class:Te(["text-node-stream-delta",[w.value]]),onAnimationend:g},N(d.value),35)):ue("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);kn.install=e=>{e.component(kn.__name,kn)};const cT=Xe({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return jt(mo,xt(tt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),Im=Xo({loader:()=>fn(null,null,function*(){try{return(yield js(()=>import("./CodeBlockNode-xopu-OEb.js"),__vite__mapDeps([2,3,4]))).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),mo}}),loadingComponent:cT,delay:0,suspensible:!1}),Ro=Xo(()=>fn(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,s,o,i;return jt(kn,xt(tt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield xv())return(yield js(()=>import("./index6-Bcj2CUc2.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,s,o,i;return jt(kn,xt(tt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),uT=Xo(()=>fn(null,null,function*(){try{if(yield xv())return(yield js(()=>import("./index5-B_Zm1CXv.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,s,o;return jt(kn,xt(tt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),gs=zt(Xe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(S(),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]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},N(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);gs.install=e=>{e.component(gs.__name,gs)};const QB={class:"superscript-node"},Is=zt(Xe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=An(()=>t.customId),s=U(()=>tt({text:kn,inline_code:is,link:ks,html_inline:Ys,strong:vs,emphasis:bs,footnote_reference:Gs,strikethrough:ys,highlight:Xs,insert:Ns,subscript:$s,emoji:Es,math_inline:Ro,reference:gs},n.value));return(o,i)=>(S(),I("sup",QB,[(S(!0),I(Me,null,Ze(e.node.children,(r,l)=>(S(),je(A(ei),{key:`${e.indexKey||"superscript"}-${l}`,components:s.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"]]);Is.install=e=>{e.component(Is.__name,Is)};const eF={class:"subscript-node"},$s=zt(Xe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=An(()=>t.customId),s=U(()=>tt({text:kn,inline_code:is,link:ks,html_inline:Ys,strong:vs,emphasis:bs,footnote_reference:Gs,strikethrough:ys,highlight:Xs,insert:Ns,superscript:Is,emoji:Es,math_inline:Ro,reference:gs},n.value));return(o,i)=>(S(),I("sub",eF,[(S(!0),I(Me,null,Ze(e.node.children,(r,l)=>(S(),je(A(ei),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);$s.install=e=>{e.component($s.__name,$s)};const tF={class:"strong-node"},vs=zt(Xe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=An(()=>t.customId),s=U(()=>tt({text:kn,inline_code:is,link:ks,html_inline:Ys,emphasis:bs,strikethrough:ys,highlight:Xs,insert:Ns,subscript:$s,superscript:Is,emoji:Es,footnote_reference:Gs,math_inline:Ro,reference:gs},n.value));return(o,i)=>(S(),I("strong",tF,[(S(!0),I(Me,null,Ze(e.node.children,(r,l)=>(S(),je(A(ei),{key:`${e.indexKey||"strong"}-${l}`,components:s.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"]]);vs.install=e=>{e.component(vs.__name,vs)};const nF={class:"strikethrough-node"},ys=zt(Xe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=An(()=>t.customId),s=U(()=>tt({text:kn,inline_code:is,link:ks,html_inline:Ys,strong:vs,emphasis:bs,highlight:Xs,insert:Ns,subscript:$s,superscript:Is,emoji:Es,footnote_reference:Gs,math_inline:Ro,reference:gs},n.value));return(o,i)=>(S(),I("del",nF,[(S(!0),I(Me,null,Ze(e.node.children,(r,l)=>(S(),je(A(ei),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.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"]]);ys.install=e=>{e.component(ys.__name,ys)};const sF=["href","title","aria-label","aria-hidden","target","rel"],oF=["aria-hidden"],iF={class:"link-text-wrapper relative inline-flex"},rF={class:"leading-[normal] link-text"},ks=zt(Xe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Rt("markstreamShowTooltips",void 0),s=U(()=>{const b=n?.value;return typeof b=="boolean"?b:t.showTooltip}),o=U(()=>{var b,_,v,y,k;const T=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",E=(b=t.animationOpacity)!=null?b:.35,C=Math.max(.12,Math.min(.5*E,E)),M={"--underline-height":`${(_=t.underlineHeight)!=null?_:2}px`,"--underline-bottom":T,"--underline-opacity":String(E),"--underline-rest-opacity":String(C),"--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):(k=t.animationIteration)!=null?k:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),i=An(()=>t.customId),r=U(()=>tt({text:kn,strong:vs,strikethrough:ys,emphasis:bs,image:rr,html_inline:Ys,inline_code:is},i.value)),l=su(),a=U(()=>{var b,_;const v=(b=t.node)==null?void 0:b.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const k of v)Array.isArray(k)&&k[0]&&(y[String(k[0])]=String((_=k[1])!=null?_:""));else for(const[k,T]of Object.entries(v))k&&T!=null&&T!==!1&&(y[k]=T===!0?"":String(T));return I_(y,"safe","a")}),c=U(()=>tt(tt({},l),a.value)),u=U(()=>{var b,_;return I_({href:String((_=(b=t.node)==null?void 0:b.href)!=null?_:"")},"safe","a").href}),d=U(()=>{if(!u.value)return;const b=c.value.target;return(typeof b=="string"?b.trim():String(b??"").trim())||(OO(u.value)?"_blank":void 0)}),p=U(()=>{var b;return String((b=d.value)!=null?b:"").trim().toLowerCase()==="_blank"}),m=U(()=>{if(!u.value)return;const b=c.value.rel,_=new Set((typeof b=="string"?b:String(b??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(_).filter(y=>y.toLowerCase()!=="opener"));return p.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),f=U(()=>{const b=tt({},c.value);return delete b.title,delete b.href,delete b.target,delete b.rel,b});function g(){s.value&&OB()}const w=U(()=>{var b,_;const v=(b=t.node)==null?void 0:b.title;return typeof v=="string"&&v.trim().length>0?v:String((_=u.value)!=null?_:"")});return(b,_)=>{var v,y;return e.node.loading?(S(),I("span",Vt({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},A(l),{style:o.value}),[h("span",iF,[h("span",rF,[pt(A(kn),{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"])]),_[1]||(_[1]=h("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,oF)):(S(),I("a",Vt({key:0,class:"link-node",href:u.value,title:s.value?"":w.value,"aria-label":`Link: ${w.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:m.value},f.value,{style:o.value,onMouseenter:_[0]||(_[0]=k=>(function(T){var E,C,M,$;if(!s.value)return;const L=T,D=L?.clientX!=null&&L?.clientY!=null?{x:L.clientX,y:L.clientY}:void 0,R=((E=t.node)==null?void 0:E.title)||((C=u.value)!=null&&C.includes("xn--")&&(($=(M=t.node)==null?void 0:M.text)!=null&&$.includes("://"))?t.node.text:u.value)||"";RB(T.currentTarget,R,"top",!1,D)})(k)),onMouseleave:g}),[(S(!0),I(Me,null,Ze(e.node.children,(k,T)=>(S(),je(A(ei),{key:`${e.indexKey||"emphasis"}-${T}`,components:r.value,node:k,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${T}`},null,8,["components","node","custom-id","index-key"]))),128))],16,sF))}}}),[["__scopeId","data-v-367e6ca4"]]);ks.install=e=>{e.component(ks.__name,ks)};const lF={class:"insert-node"},Ns=zt(Xe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=An(()=>t.customId),s=U(()=>tt({text:kn,inline_code:is,link:ks,html_inline:Ys,strong:vs,emphasis:bs,strikethrough:ys,highlight:Xs,subscript:$s,superscript:Is,emoji:Es,footnote_reference:Gs,math_inline:Ro,reference:gs},n.value));return(o,i)=>(S(),I("ins",lF,[(S(!0),I(Me,null,Ze(e.node.children,(r,l)=>(S(),je(A(ei),{key:`${e.indexKey||"insert"}-${l}`,components:s.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"]]);Ns.install=e=>{e.component(Ns.__name,Ns)};const aF={class:"highlight-node"},Xs=zt(Xe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=An(()=>t.customId),s=U(()=>tt({text:kn,inline_code:is,link:ks,html_inline:Ys,strong:vs,emphasis:bs,strikethrough:ys,insert:Ns,subscript:$s,superscript:Is,emoji:Es,footnote_reference:Gs,math_inline:Ro,reference:gs},n.value));return(o,i)=>(S(),I("mark",aF,[(S(!0),I(Me,null,Ze(e.node.children,(r,l)=>(S(),je(A(ei),{key:`${e.indexKey||"highlight"}-${l}`,components:s.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"]]);Xs.install=e=>{e.component(Xs.__name,Xs)};const cF={class:"emphasis-node"},bs=zt(Xe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=An(()=>t.customId),s=U(()=>tt({text:kn,inline_code:is,link:ks,html_inline:Ys,strong:vs,strikethrough:ys,highlight:Xs,insert:Ns,subscript:$s,superscript:Is,emoji:Es,footnote_reference:Gs,math_inline:Ro,reference:gs},n.value));return(o,i)=>(S(),I("em",cF,[(S(!0),I(Me,null,Ze(e.node.children,(r,l)=>(S(),je(A(ei),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.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"]]);bs.install=e=>{e.component(bs.__name,bs)};const uF={class:"hard-break"},lr=zt(Xe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(S(),I("br",uF))}),[["__scopeId","data-v-50c58f70"]]);lr.install=e=>{e.component(lr.__name,lr)};const Gc=Xe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=er({checkbox:Ks,checkbox_input:Ks,emoji:Es,emphasis:bs,hardbreak:lr,highlight:Xs,inline_code:is,insert:Ns,link:ks,reference:gs,strikethrough:ys,strong:vs,subscript:$s,superscript:Is,text:kn}),s=An(()=>t.customId),o=U(()=>{const i=s.value;return Object.keys(i).length>0?tt(tt({},n),i):n});return(i,r)=>(S(!0),I(Me,null,Ze(e.nodes,(l,a)=>(S(),je(A(ei),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function Zg(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(Zg)}function Mf(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Zg))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(Zg)?o:null}function ha(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const dF=["cite"],fF={key:0,dir:"auto",class:"paragraph-node"},hF=["custom-id"],$d=zt(Xe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=An(()=>t.customId),s=U(()=>!!n.value.paragraph),o=U(()=>!!n.value.text),i=U(()=>Mf(t.node.children,!s.value)),r=U(()=>t.fade!==!1||o.value?null:ha(i.value));return an("markstreamShowTooltips",U(()=>t.showTooltips)),an("markstreamFade",U(()=>t.fade)),(l,a)=>(S(),I("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(S(),I("p",fF,[r.value!==null?(S(),I("span",{key:0,class:"text-node","custom-id":t.customId},N(r.value),9,hF)):(S(),je(A(Gc),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(S(),je(A(Ls),{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,dF))}}),[["__scopeId","data-v-abfecebc"]]);$d.install=e=>{e.component($d.__name,$d)};const pF={class:"definition-list"},mF={class:"definition-term"},gF={class:"definition-desc"},Nd=zt(Xe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(S(),I("dl",pF,[(S(!0),I(Me,null,Ze(t.node.items,(o,i)=>(S(),I(Me,{key:i},[h("dt",mF,[pt(A(Ls),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),h("dd",gF,[pt(A(Ls),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Nd.install=e=>{e.component(Nd.__name,Nd)};const vF=["href","title"],xc=zt(Xe({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,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,vF))}}),[["__scopeId","data-v-e1eb37b6"]]);xc.install=e=>{e.component(xc.__name,xc)};const yF=["id"],kF={class:"flex-1"},Ld=Xe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(S(),I("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[h("div",kF,[pt(A(Ls),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,yF))}});Ld.install=e=>{e.component(Ld.__name,Ld)};const bF=["custom-id"],Jg=zt(Xe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=An(()=>t.customId),s=Rt("markstreamFade",void 0),o=U(()=>s?.value!==!1||n.value.text?null:ha(t.node.children)),i=U(()=>tt({text:kn,inline_code:is,link:ks,image:rr,strong:vs,emphasis:bs,strikethrough:ys,highlight:Xs,insert:Ns,subscript:$s,superscript:Is,emoji:Es,checkbox:Ks,checkbox_input:Ks,footnote_reference:Gs,hardbreak:lr,math_inline:Ro,reference:gs},n.value));return(r,l)=>(S(),je(ss(`h${e.node.level}`),Vt({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:yn(()=>[o.value!==null?(S(),I("span",{key:0,class:"text-node","custom-id":t.customId},N(o.value),9,bF)):(S(!0),I(Me,{key:1},Ze(e.node.children,(a,c)=>(S(),je(A(ei),{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"]]),Ef=Jg;Ef.install=e=>{e.component(Jg.__name,Jg)};const _F={key:0,dir:"auto",class:"paragraph-node"},wF=["custom-id"],SF={dir:"auto",class:"paragraph-node"},CF=["custom-id"],ia=zt(Xe({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{}},emits:["copy"],setup(e){const t=e,n=U(()=>{var m;return(m=t.node)!=null?m:t.item}),s=An(()=>t.customId),o=U(()=>!!s.value.paragraph),i=U(()=>!!s.value.text),r=U(()=>{var m;return Mf((m=n.value)==null?void 0:m.children,!o.value)}),l=U(()=>{var m;if(o.value)return null;const f=(m=n.value)==null?void 0:m.children;if(!Array.isArray(f)||f.length<2)return null;const g=f[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const w=f.slice(1);if(!w.every(_=>_?.type==="list"))return null;const b=Mf([g]);return b?{paragraphChildren:b,nestedLists:w}:null});function a(){return t.fade===!1&&!i.value}const c=U(()=>a()?ha(r.value):null),u=U(()=>{var m;return a()?ha((m=l.value)==null?void 0:m.paragraphChildren):null}),d=Object.freeze({}),p=U(()=>{const{value:m}=t;return typeof m=="number"&&Number.isFinite(m)?{value:m}:d});return an("markstreamShowTooltips",U(()=>t.showTooltips)),an("markstreamFade",U(()=>t.fade)),(m,f)=>{var g,w;return S(),I("li",Vt({class:"list-item",dir:"auto"},p.value),[r.value?(S(),I("p",_F,[c.value!==null?(S(),I("span",{key:0,class:"text-node","custom-id":t.customId},N(c.value),9,wF)):(S(),je(A(Gc),{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?(S(),I(Me,{key:1},[h("p",SF,[u.value!==null?(S(),I("span",{key:0,class:"text-node","custom-id":t.customId},N(u.value),9,CF)):(S(),je(A(Gc),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(S(!0),I(Me,null,Ze(l.value.nestedLists,(b,_)=>(S(),je(A(Ls),{key:_,nodes:[b],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${_}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:f[0]||(f[0]=v=>m.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade"]))),128))],64)):(S(),je(A(Ls),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(w=(g=n.value)==null?void 0:g.children)!=null?w:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"batch-rendering":!1,onCopy:f[1]||(f[1]=b=>m.$emit("copy",b))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],16)}}}),[["__scopeId","data-v-356f1243"]]);ia.install=e=>{e.component(ia.__name,ia)};const ra=zt(Xe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=An(()=>e.customId),n=U(()=>t.value.list_item||ia);return(s,o)=>(S(),je(ss(e.node.ordered?"ol":"ul"),{class:Te(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:yn(()=>[(S(!0),I(Me,null,Ze(e.node.items,(i,r)=>{var l;return S(),je(ss(n.value),Vt({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,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-7c789f94"]]);ra.install=e=>{e.component(ra.__name,ra)};const dT=Symbol("ViewportPriority");function xF(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?ie(t):t,r=o?(n=window.requestIdleCallback)!=null?n:b=>window.setTimeout(()=>b({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:b=>window.clearTimeout(b):null;let a=null,c=null;const u=new Map,d=new Set;let p=null;function m(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||(function(){if(p!=null){try{l?.(p)}catch{}p=null}})()}}function f(b){const _=u.get(b);if(_){if(!_.visible.value){_.visible.value=!0;try{_.resolve()}catch{}}try{a?.unobserve(b)}catch{}u.delete(b),d.delete(b),m()}}function g(){r&&p==null&&d.size&&(p=r(()=>{p=null;const b=d.values().next().value;b&&(d.delete(b),f(b),d.size&&g())},{timeout:1200}))}const w=(b,_)=>{const v=ie(!1);let y,k=!1;const T=new Promise(M=>{y=()=>{k||(k=!0,M())}}),E=()=>{try{a?.unobserve(b)}catch{}u.delete(b),d.delete(b),m()};if(!o||!i.value)return v.value=!0,y(),{isVisible:v,whenVisible:T,destroy:E};const C=(function(M,$){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const L=(function(P,O){var W,V,z;return{root:(W=e?.(P??null))!=null?W:null,rootMargin:(V=O?.rootMargin)!=null?V:"300px",threshold:(z=O?.threshold)!=null?z:0}})(M,$);if(a&&(R=L,(D=c)&&D.root===R.root&&D.rootMargin===R.rootMargin&&D.threshold===R.threshold))return a;var D,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(P=>{for(const O of P)(O.isIntersecting||O.intersectionRatio>0)&&f(O.target)},{root:L.root,rootMargin:L.rootMargin,threshold:L.threshold}),c=L;for(const P of u.keys())a.observe(P);return a})(b,_);return C?(u.set(b,{resolve:y,visible:v}),C.observe(b),d.add(b),g(),{isVisible:v,whenVisible:T,destroy:E}):(v.value=!0,y(),{isVisible:v,whenVisible:T,destroy:E})};return an(dT,w),w}function TF(){var e,t;const n=Rt(dT,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:p=>window.setTimeout(()=>p({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:p=>window.clearTimeout(p):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=p=>{const m=s.get(p);if(m){if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{o?.unobserve(p)}catch{}s.delete(p),i.delete(p),i.size||c()}},d=()=>{l&&r==null&&i.size&&(r=l(()=>{r=null;const p=i.values().next().value;p&&(i.delete(p),u(p),i.size&&d())},{timeout:1200}))};return p=>{const m=ie(!1);let f,g=!1;const w=new Promise(v=>{f=()=>{g||(g=!0,v())}}),b=()=>{try{o?.unobserve(p)}catch{}s.delete(p),i.delete(p),i.size||c()},_=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),o));return _?(s.set(p,{resolve:f,visible:m}),_.observe(p),i.add(p),d(),{isVisible:m,whenVisible:w,destroy:b}):(m.value=!0,f(),{isVisible:m,whenVisible:w,destroy:b})}}const AF={key:2,class:"html-block-node__raw"},MF=["innerHTML"],EF={key:1,class:"html-block-node__placeholder"},Tc=zt(Xe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Rt("markstreamHtmlPolicy",void 0),s=Rt("markstreamNestedRendererProps",void 0),o=U(()=>{var T,E;return(E=(T=t.htmlPolicy)!=null?T:n?.value)!=null?E:"safe"}),i=U(()=>{var T,E;const C=(T=s?.value)!=null?T:{};return xt(tt({},C),{customId:(E=t.customId)!=null?E:C.customId,htmlPolicy:o.value})}),r=Xo({loader:()=>Promise.resolve().then(()=>Lv),suspensible:!1}),l=U(()=>{const T=Hg(t.node.attrs,o.value);if(!T)return;const E=Tf(T);return Object.keys(E).length>0?E:void 0}),a=U(()=>{const T=String(t.node.tag||"").trim(),E=Hg(t.node.attrs,o.value,T);if(!E)return;const C=Tf(E);return Object.keys(C).length>0?C:void 0}),c=An(()=>t.customId),u=Xe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=ie(null),p=ie(typeof window>"u"),m=ie(t.node.content),f=U(()=>Array.isArray(t.node.children)?t.node.children:[]),g=U(()=>String(t.node.tag||"div")),w=U(()=>{const T=g.value.trim().toLowerCase();return rx.has(T)||_v(T,o.value)}),b=U(()=>f.value.length>0&&!!t.node.tag&&!w.value),_=U(()=>{var T,E,C;if(b.value)return{mode:"structured"};if(!p.value)return{mode:"html",content:(T=m.value)!=null?T:""};const M=(E=m.value)!=null?E:t.node.content;if(!M)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:oa(M,o.value)};if(t.node.loading){const L=Af(M,c.value,o.value);return L===null?{mode:"text",content:(C=t.node.raw)!=null?C:M}:{mode:"dynamic",nodes:L}}if(!lT(M,c.value))return{mode:"html",content:oa(M,o.value)};const $=Af(M,c.value,o.value);return $===null?{mode:"html",content:oa(M,o.value)}:{mode:"dynamic",nodes:$}}),v=TF(),y=ie(null),k=!!t.node.loading;return typeof window<"u"?(Ve(d,T=>{var E,C;if((C=(E=y.value)==null?void 0:E.destroy)==null||C.call(E),y.value=null,!k)return p.value=!0,void(m.value=t.node.content);if(!T)return void(p.value=!1);const M=v(T,{rootMargin:"400px"});y.value=M,p.value=M.isVisible.value,M.whenVisible.then(()=>{p.value=!0})},{immediate:!0}),Ve(()=>t.node.content,T=>{k&&!p.value||(m.value=T)})):p.value=!0,Js(()=>{var T,E;(E=(T=y.value)==null?void 0:T.destroy)==null||E.call(T),y.value=null}),(T,E)=>(S(),je(ss(b.value?g.value:"div"),Vt({ref_key:"htmlRef",ref:d,class:"html-block-node"},b.value?a.value:void 0),{default:yn(()=>[p.value?(S(),I(Me,{key:0},[_.value.mode==="structured"?(S(),je(A(r),Vt({key:0},i.value,{nodes:f.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):_.value.mode==="dynamic"?(S(),je(A(u),{key:1,nodes:_.value.nodes},null,8,["nodes"])):_.value.mode==="text"?(S(),I("pre",AF,N(_.value.content),1)):(S(),I("div",Vt({key:3},l.value,{innerHTML:_.value.content}),null,16,MF))],64)):(S(),I("div",EF,[Yl(T.$slots,"placeholder",{node:e.node},()=>[E[0]||(E[0]=h("span",{class:"html-block-node__placeholder-bar"},null,-1)),E[1]||(E[1]=h("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),E[2]||(E[2]=h("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Tc.install=e=>{e.component(Tc.__name,Tc)};const IF={dir:"auto",class:"paragraph-node"},$F=["custom-id"],tl=zt(Xe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=An(()=>t.customId),s=Rt("markstreamHtmlPolicy",void 0),o=Rt("markstreamFade",void 0),i=Rt("markstreamParseOptions",void 0),r=Rt("markstreamCustomMarkdownIt",void 0),l=Rt("markstreamNestedRendererProps",void 0),a=U(()=>{var C;return(C=s?.value)!=null?C:"safe"}),c=U(()=>{var C;return(C=t.parseOptions)!=null?C:i?.value}),u=U(()=>{var C;return(C=t.customMarkdownIt)!=null?C:r?.value}),d=U(()=>{var C,M;return(M=t.customHtmlTags)!=null?M:(C=l?.value)==null?void 0:C.customHtmlTags}),p=U(()=>{var C,M;const $=(C=l?.value)!=null?C:{};return xt(tt({},$),{customId:(M=t.customId)!=null?M:$.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),m=Xo({loader:()=>Promise.resolve().then(()=>Lv),suspensible:!1});function f(C){var M;return C.type==="text"&&String((M=C.content)!=null?M:"").trim()===""}const g=U(()=>t.node.children.filter(C=>!f(C))),w=U(()=>g.value.length>0&&g.value.every(C=>C.type==="image"||(function(M){var $;const L=(function(D){return D.type==="link"&&Array.isArray(D.children)?D.children.filter(R=>!f(R)):[]})(M);return L.length===1&&(($=L[0])==null?void 0:$.type)==="image"})(C))),b=U(()=>new Set(va(d.value))),_=U(()=>{if(!w.value||g.value.length<=1)return t.node.children;const C=[];for(let M=0;M<t.node.children.length;M++){const $=t.node.children[M];if(!f($)){C.push($);continue}const L=C.length>0,D=t.node.children.slice(M+1).some(R=>!f(R));L&&D&&C.push(xt(tt({},$),{content:" ",raw:" "}))}return C}),v=U(()=>o?.value===!1&&!n.value.text),y=U(()=>v.value?ha(_.value):null);function k(C,M){return{node:C,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const T=U(()=>tt({inline_code:is,image:rr,link:ks,hardbreak:lr,emphasis:bs,strong:vs,strikethrough:ys,highlight:Xs,insert:Ns,subscript:$s,superscript:Is,html_inline:Ys,html_block:Tc,emoji:Es,checkbox:Ks,math_inline:Ro,checkbox_input:Ks,reference:gs,footnote_anchor:xc,footnote_reference:Gs,text:kn},n.value)),E=U(()=>_.value.map((C,M)=>{var $;const L=(function(D){var R,P,O,W;if(D.type==="html_block"||D.type==="html_inline"){const V=String((R=D.tag)!=null?R:"").trim().toLowerCase()||ux(D.content);if(V&&!b.value.has(V)&&dx((P=D.content)!=null?P:D.raw,V)){const z=String((W=(O=D.content)!=null?O:D.raw)!=null?W:"");return{child:{type:"text",content:z,raw:z},component:kn,isCustomComponent:!1}}}return{child:D,component:T.value[D.type],isCustomComponent:!!(n.value[D.type]&&!uu(String(D.type)))}})(C);return xt(tt({},L),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:L.isCustomComponent?Tv(L.child,a.value):void 0,hasSlotChildren:Array.isArray(L.child.children)&&L.child.children.length>0,slotContent:String(($=L.child.content)!=null?$:""),originalChild:C})}));return(C,M)=>(S(),I("p",IF,[y.value!==null?(S(),I("span",{key:0,class:"text-node","custom-id":t.customId},N(y.value),9,$F)):(S(!0),I(Me,{key:1},Ze(E.value,$=>{return S(),I(Me,{key:$.key},[w.value&&f($.originalChild)?(S(),I(Me,{key:0},[vt(N((L=$.originalChild,String((D=L.content)!=null?D:""))),1)],64)):$.isCustomComponent?(S(),je(ss($.component),Vt({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":p.value.isDark}),{default:yn(()=>[$.hasSlotChildren?(S(),je(A(m),Vt({key:0,ref_for:!0},p.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?(S(),je(A(m),Vt({key:1,ref_for:!0},p.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"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(S(),je(ss($.component),Vt({key:2,ref_for:!0},k($.child,$.index)),null,16))],64);var L,D}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);tl.install=e=>{e.component(tl.__name,tl)};const NF={class:"table-node-wrapper"},LF=["aria-busy"],RF={key:0},OF=["custom-id"],PF=["aria-label","onPointerdown"],DF=["custom-id"],BF={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Ac=zt(Xe({__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=U(()=>{var b;return(b=t.node.loading)!=null&&b}),s=U(()=>{var b;return(b=t.node.rows)!=null?b:[]}),o=ie(null),i=ie([]);let r=null;const l=U(()=>t.node.header.cells.length),a=U(()=>i.value.some(b=>Number.isFinite(b)&&b>0)),c=U(()=>a.value?i.value.map(b=>b>0?{width:`${b}px`}:void 0):[]);an("markstreamShowTooltips",U(()=>t.showTooltips)),an("markstreamFade",U(()=>t.fade));const u=An(()=>t.customId),d=U(()=>!!u.value.text),p=U(()=>!!u.value.paragraph),m=new WeakMap;function f(b){const _=t.fade===!1&&!d.value,v=!p.value,y=m.get(b);if(y?.children===b.children&&y.textFastPath===_&&y.paragraphFastPath===v)return y.info;const k=Mf(b.children,v,!0),T={simpleChildren:k,plainText:k&&_?ha(k):null};return m.set(b,{children:b.children,textFastPath:_,paragraphFastPath:v,info:T}),T}function g(b){if(!r)return;b.preventDefault();const _=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(_/2)),y=Math.max(v,Math.min(_-v,Math.round(r.startWidth+b.clientX-r.startX))),k=[...r.widths];k[r.index]=y,k[r.index+1]=_-y,i.value=k}function w(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",w),r=null)}return Ve(l,()=>{w(),i.value=[]}),Js(w),(b,_)=>(S(),I("div",NF,[h("table",{ref_key:"tableRef",ref:o,class:Te(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(S(),I("colgroup",RF,[(S(!0),I(Me,null,Ze(e.node.header.cells,(v,y)=>(S(),I("col",{key:y,style:Dt(c.value[y])},null,4))),128))])):ue("",!0),h("thead",null,[h("tr",null,[(S(!0),I(Me,null,Ze(e.node.header.cells,(v,y)=>(S(),I("th",{key:y,dir:"auto",class:Te([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[f(v).plainText!==null?(S(),I("span",{key:0,class:"text-node","custom-id":t.customId},N(f(v).plainText),9,OF)):f(v).simpleChildren?(S(),je(A(Gc),{key:1,nodes:f(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(S(),je(A(Ls),{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:_[0]||(_[0]=k=>b.$emit("copy",k))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(S(),I("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:k=>(function(T,E){if(E.button!==0)return;const C=(function(){var L;const D=(L=o.value)==null?void 0:L.querySelectorAll("thead th");return Array.from(D??[],R=>Math.round(R.getBoundingClientRect().width))})(),M=C[T],$=C[T+1];M&&$&&(E.preventDefault(),r={index:T,startX:E.clientX,startWidth:M,nextStartWidth:$,widths:C},i.value=C,window.addEventListener("pointermove",g),window.addEventListener("pointerup",w),window.addEventListener("pointercancel",w))})(y,k)},null,40,PF)):ue("",!0)],2))),128))])]),h("tbody",null,[(S(!0),I(Me,null,Ze(s.value,(v,y)=>(S(),I("tr",{key:y},[(S(!0),I(Me,null,Ze(v.cells,(k,T)=>(S(),I("td",{key:T,class:Te([k.align==="right"?"text-right":k.align==="center"?"text-center":"text-left"]),dir:"auto"},[f(k).plainText!==null?(S(),I("span",{key:0,class:"text-node","custom-id":t.customId},N(f(k).plainText),9,DF)):f(k).simpleChildren?(S(),je(A(Gc),{key:1,nodes:f(k).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${T}`},null,8,["nodes","custom-id","index-key"])):(S(),je(A(Ls),{key:2,nodes:k.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:_[1]||(_[1]=E=>b.$emit("copy",E))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,LF),pt(Si,{name:"table-node-fade"},{default:yn(()=>[n.value?(S(),I("div",BF,[Yl(b.$slots,"loading",{isLoading:n.value},()=>[_[2]||(_[2]=h("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),_[3]||(_[3]=h("span",{class:"sr-only"},"Loading",-1))],!0)])):ue("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Ac.install=e=>{e.component(Ac.__name,Ac)};const FF={class:"hr-node"},Rd=zt({},[["render",function(e,t){return S(),I("hr",FF)}],["__scopeId","data-v-39b2349c"]]);Rd.install=e=>{e.component(Rd.__name,Rd)};const HF={class:"unknown-node"},Qg=Xe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(S(),I("div",HF,N(e.node.raw),1))}),Od=zt(Xe({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=U(()=>`vmr-container vmr-container-${t.node.name}`),s=An(()=>t.customId),o=U(()=>tt({text:kn,paragraph:tl,heading:Ef,inline_code:is,link:ks,image:rr,strong:vs,emphasis:bs,strikethrough:ys,insert:Ns,subscript:$s,superscript:Is,checkbox:Ks,checkbox_input:Ks,hardbreak:lr,math_inline:Ro,reference:gs,list:ra,math_block:uT,table:Ac},s.value));return(i,r)=>(S(),I("div",Vt({class:n.value},e.node.attrs),[(S(!0),I(Me,null,Ze(e.node.children,(l,a)=>{return S(),je(ss((c=l.type,o.value[c]||Qg)),{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"]]);Od.install=e=>{e.component(Od.__name,Od)};const WF=["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"],B_=[[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 UF(e){if(e<=255)return WF[e];let t=0,n=B_.length-1;for(;t<=n;){const s=t+n>>1,o=B_[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const qF=/[ \t\n\r\f]+/g,jF=/[\t\n\r\f]| {2,}|^ | $/;let $m=null;const zF=new RegExp("\\p{Script=Arabic}","u"),xh=new RegExp("\\p{M}","u"),fT=new RegExp("\\p{Nd}","u");function F_(e){return zF.test(e)}function H_(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 Ci(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 s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(H_(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(H_(n))return!0}}return!1}const VF=new Set([" "," ","⁠","\uFEFF"]);function KF(e){return Ci(e)}function e1(e){return!(function(t){const n=If(t);return n!==null&&(Av.has(n)||ol.has(n))})(e)&&!(function(t){const n=If(t);return n!==null&&VF.has(n)})(e)}const Av=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Th=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Mv=new Set(["'","’"]),ol=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),GF=new Set([":",".","،","؛"]),YF=new Set(["၏"]),XF=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function ZF(e){if(Ev(e))return!0;let t=!1;for(const n of e)if(ol.has(n))t=!0;else if(!t||!xh.test(n))return!1;return t}function JF(e){for(const t of e)if(!Av.has(t)&&!ol.has(t))return!1;return e.length>0}function QF(e){if(Ev(e))return!0;for(const t of e)if(!Th.has(t)&&!Mv.has(t)&&!xh.test(t))return!1;return e.length>0}function Ev(e){let t=!1;for(const n of e)if(n!=="\\"&&!xh.test(n)){if(!(Th.has(n)||ol.has(n)||Mv.has(n)))return!1;t=!0}return t}function hT(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function If(e){if(e.length===0)return null;const t=hT(e,e.length);return e.slice(t)}function eH(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(xh.test(s))n--;else{if(!Th.has(s)&&!Mv.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function tH(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function W_(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function U_(e,t){return e&&t!==null&&GF.has(t)}function nH(e){const t=If(e);return t!==null&&YF.has(t)}function sH(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 t1(e){let t=e.length;for(;t>0;){const n=hT(e,t),s=e.slice(n,t);if(XF.has(s))return!0;if(!ol.has(s))return!1;t=n}return!1}function oH(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
210
- `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const iH=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ho(e){return e.length===1?e[0]:e.join("")}function rH(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),ho(n)}function lH(e,t,n,s){if(!iH.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=oH(u,s),p=d==="text"&&t;i===null||d!==i||p!==a?(i!==null&&o.push({text:ho(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=p,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&o.push({text:ho(r),isWordLike:a,kind:i,start:l}),o}function Nm(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const aH=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function cH(e,t){const n=e.texts[t];return!!n.startsWith("www.")||aH.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function uH(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const dH=new Set([":","-","/","×",",",".","+","–","—"]),q_=/^[A-Za-z0-9_]+[,:;]*$/,j_=/[,:;]+$/;function z_(e){for(const t of e)if(fT.test(t))return!0;return!1}function Pd(e){if(e.length===0)return!1;for(const t of e)if(!fT.test(t)&&!dH.has(t))return!1;return!0}function V_(e,t,n){var s,o,i;const r=($m===null&&($m=new Intl.Segmenter(void 0,{granularity:"word"})),$m);let l=0;const a=[],c=[],u=[],d=[],p=[],m=[],f=[],g=[],w=[],b=[],_=[],v=[];for(const C of r.segment(e))for(const M of lH(C.segment,(s=C.isWordLike)!=null&&s,C.index,n)){let $=function(){m[z]!==null&&(c[z]=[W_(a,m,f,z)],m[z]=null),c[z].push(M.text),u[z]=u[z]||M.isWordLike,g[z]=g[z]||R,w[z]=w[z]||P,b[z]=W,_[z]=V,v[z]=U_(w[z],O)};const L=M.kind==="text",D=tH(M.text,M.isWordLike,M.kind),R=Ci(M.text),P=F_(M.text),O=If(M.text),W=t1(M.text),V=nH(M.text),z=l-1;t.carryCJKAfterClosingQuote&&L&&l>0&&d[z]==="text"&&R&&g[z]&&b[z]||L&&l>0&&d[z]==="text"&&JF(M.text)&&g[z]||L&&l>0&&d[z]==="text"&&_[z]?$():L&&l>0&&d[z]==="text"&&M.isWordLike&&P&&v[z]?($(),u[z]=!0):D!==null&&l>0&&d[z]==="text"&&m[z]===D?f[z]=((o=f[z])!=null?o:1)+1:L&&!M.isWordLike&&l>0&&d[z]==="text"&&(ZF(M.text)||M.text==="-"&&u[z])?$():(a[l]=M.text,c[l]=[M.text],u[l]=M.isWordLike,d[l]=M.kind,p[l]=M.start,m[l]=D,f[l]=D===null?0:1,g[l]=R,w[l]=P,b[l]=W,_[l]=V,v[l]=U_(P,O),l++)}for(let C=0;C<l;C++)m[C]===null?a[C]=ho(c[C]):a[C]=W_(a,m,f,C);for(let C=1;C<l;C++)d[C]==="text"&&!u[C]&&Ev(a[C])&&d[C-1]==="text"&&(a[C-1]+=a[C],u[C-1]=u[C-1]||u[C],a[C]="");const y=Array.from({length:l},()=>null);let k=-1;for(let C=l-1;C>=0;C--){const M=a[C];if(M.length!==0){if(d[C]==="text"&&!u[C]&&QF(M)&&k>=0&&d[k]==="text"){const $=(i=y[k])!=null?i:[];$.push(M),y[k]=$,p[k]=p[C],a[C]="";continue}k=C}}for(let C=0;C<l;C++){const M=y[C];M!=null&&(a[C]=rH(M,a[C]))}let T=0;for(let C=0;C<l;C++){const M=a[C];M.length!==0&&(T!==C&&(a[T]=M,u[T]=u[C],d[T]=d[C],p[T]=p[C]),T++)}a.length=T,u.length=T,d.length=T,p.length=T;const E=(function(C){const M=C.texts.slice(),$=C.isWordLike.slice(),L=C.kinds.slice(),D=C.starts.slice();for(let R=0;R<M.length-1;R++){if(L[R]!=="text"||L[R+1]!=="text"||!Ci(M[R])||!Ci(M[R+1]))continue;const P=eH(M[R]);P!==null&&(M[R]=P.head,M[R+1]=P.tail+M[R+1],D[R+1]=D[R]+P.head.length)}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:D}})((function(C){const M=[],$=[],L=[],D=[];for(let R=0;R<C.len;R++){const P=C.texts[R],O=C.kinds[R],W=C.isWordLike[R];if(O==="text"&&W&&q_.test(P)){const V=[P];let z=j_.test(P),se=R+1;for(;z&&se<C.len&&C.kinds[se]==="text"&&C.isWordLike[se]&&q_.test(C.texts[se]);){const Q=C.texts[se];V.push(Q),z=j_.test(Q),se++}M.push(ho(V)),$.push(!0),L.push("text"),D.push(C.starts[R]),R=se-1;continue}M.push(P),$.push(W),L.push(O),D.push(C.starts[R])}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:D}})((function(C){const M=[],$=[],L=[],D=[];for(let R=0;R<C.len;R++){const P=C.texts[R];if(C.kinds[R]==="text"&&P.includes("-")){const O=P.split("-");let W=O.length>1;for(let V=0;V<O.length;V++){const z=O[V];if(!W)break;z.length!==0&&z_(z)&&Pd(z)||(W=!1)}if(W){let V=0;for(let z=0;z<O.length;z++){const se=O[z],Q=z<O.length-1?`${se}-`:se;M.push(Q),$.push(!0),L.push("text"),D.push(C.starts[R]+V),V+=Q.length}continue}}M.push(P),$.push(C.isWordLike[R]),L.push(C.kinds[R]),D.push(C.starts[R])}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:D}})((function(C){const M=[],$=[],L=[],D=[];for(let R=0;R<C.len;R++){const P=C.texts[R],O=C.kinds[R];if(O==="text"&&Pd(P)&&z_(P)){const W=[P];let V=R+1;for(;V<C.len&&C.kinds[V]==="text"&&Pd(C.texts[V]);)W.push(C.texts[V]),V++;M.push(ho(W)),$.push(!0),L.push("text"),D.push(C.starts[R]),R=V-1;continue}M.push(P),$.push(C.isWordLike[R]),L.push(O),D.push(C.starts[R])}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:D}})((function(C){const M=[],$=[],L=[],D=[];for(let R=0;R<C.len;R++){const P=C.texts[R];if(M.push(P),$.push(C.isWordLike[R]),L.push(C.kinds[R]),D.push(C.starts[R]),!uH(P))continue;const O=R+1;if(O>=C.len||Nm(C.kinds[O]))continue;const W=[],V=C.starts[O];let z=O;for(;z<C.len&&!Nm(C.kinds[z]);)W.push(C.texts[z]),z++;W.length>0&&(M.push(ho(W)),$.push(!0),L.push("text"),D.push(V),R=z-1)}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:D}})((function(C){const M=C.texts.slice(),$=C.isWordLike.slice(),L=C.kinds.slice(),D=C.starts.slice();for(let P=0;P<C.len;P++){if(L[P]!=="text"||!cH(C,P))continue;const O=[M[P]];let W=P+1;for(;W<C.len&&!Nm(L[W]);){O.push(M[W]),$[P]=!0;const V=M[W].includes("?");if(L[W]="text",M[W]="",W++,V)break}M[P]=ho(O)}let R=0;for(let P=0;P<M.length;P++){const O=M[P];O.length!==0&&(R!==P&&(M[R]=O,$[R]=$[P],L[R]=L[P],D[R]=D[P]),R++)}return M.length=R,$.length=R,L.length=R,D.length=R,{len:R,texts:M,isWordLike:$,kinds:L,starts:D}})((function(C){const M=[],$=[],L=[],D=[];let R=0;for(;R<C.len;){const P=[C.texts[R]];let O=C.isWordLike[R],W=C.kinds[R],V=C.starts[R];if(W==="glue"){const z=[P[0]],se=V;for(R++;R<C.len&&C.kinds[R]==="glue";)z.push(C.texts[R]),R++;const Q=ho(z);if(!(R<C.len&&C.kinds[R]==="text")){M.push(Q),$.push(!1),L.push("glue"),D.push(se);continue}P[0]=Q,P.push(C.texts[R]),O=C.isWordLike[R],W="text",V=se,R++}else R++;if(W==="text")for(;R<C.len&&C.kinds[R]==="glue";){const z=[];for(;R<C.len&&C.kinds[R]==="glue";)z.push(C.texts[R]),R++;const se=ho(z);R<C.len&&C.kinds[R]==="text"?(P.push(se,C.texts[R]),O=O||C.isWordLike[R],R++):P.push(se)}M.push(ho(P)),$.push(O),L.push(W),D.push(V)}return{len:M.length,texts:M,isWordLike:$,kinds:L,starts:D}})({len:T,texts:a,isWordLike:u,kinds:d,starts:p})))))));for(let C=0;C<E.len-1;C++){const M=sH(E.texts[C]);M!==null&&(E.kinds[C]!=="space"&&E.kinds[C]!=="preserved-space"||E.kinds[C+1]!=="text"||!F_(E.texts[C+1])||(E.texts[C]=M.space,E.isWordLike[C]=!1,E.kinds[C]=E.kinds[C]==="preserved-space"?"preserved-space":"space",E.texts[C+1]=M.marks+E.texts[C+1],E.starts[C+1]=E.starts[C]+M.space.length))}return E}function fH(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let Nl=null;const K_=new Map;let Ll=null;const hH=new RegExp("\\p{Emoji_Presentation}","u"),pH=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Lm=null;const G_=new Map;function n1(){if(Nl!==null)return Nl;if(typeof OffscreenCanvas<"u")return Nl=new OffscreenCanvas(1,1).getContext("2d"),Nl;if(typeof document<"u")return Nl=document.createElement("canvas").getContext("2d"),Nl;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function zi(e,t){let n=t.get(e);return n===void 0&&(n={width:n1().measureText(e).width,containsCJK:Ci(e)},t.set(e,n)),n}function Ah(){if(Ll!==null)return Ll;if(typeof navigator>"u")return Ll={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ll;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 Ll={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ll}function pT(){return Lm===null&&(Lm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Lm}function mH(e){return hH.test(e)||e.includes("️")}function Wr(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=pT();for(const a of l.segment(i))mH(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function gH(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 vH(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Y_(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Ah().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,p=-1,m=0;function f(y=u,k=d,T=a){l++,a=0,c=!1,p=-1,m=0}function g(y,k){c=!0,u=y+1,d=0,a=k}function w(y,k,T){c=!0,u=y,d=k+1,a=T}function b(y,k){c?(a+=k,u=y+1,d=0):g(y,k)}function _(y,k){const T=i[y];for(let E=k;E<T.length;E++){const C=T[E];c?a+C>r?(f(),w(y,E,C)):(a+=C,u=y,d=E+1):w(y,E,C)}c&&u===y&&d===T.length&&(u=y+1,d=0)}let v=0;for(;v<s.length&&(c||(v=gH(e,v),!(v>=s.length)));){const y=s[v],k=o[v],T=k==="space"||k==="preserved-space"||k==="tab"||k==="zero-width-break"||k==="soft-hyphen";if(c)if(a+y>r){if(T){b(v,y),f(v+1,0,a-y),v++;continue}if(p>=0){if(u>p||u===p&&d>0){f();continue}f(p,0,m);continue}if(y>t&&i[v]!==null){f(),_(v,0),v++;continue}f()}else b(v,y),T&&(p=v+1,m=a-y),v++;else y>t&&i[v]!==null?_(v,0):g(v,y),T&&(p=v+1,m=a-y),v++}return c&&f(),l}let Rm=null;function yH(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,p,m){s=[d],o=p,i=m,r=t1(d),l=Th.has(d)}function u(d,p){s.push(d),i=i||p;const m=t1(d);r=d.length===1&&ol.has(d)&&r||m,l=!1}for(const d of(Rm===null&&(Rm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Rm).segment(e)){const p=d.segment,m=Ci(p);s.length!==0?l||Av.has(p)||ol.has(p)||t.carryCJKAfterClosingQuote&&m&&r?u(p,m):i||m?(a(),c(p,d.index,m)):u(p,m):c(p,d.index,m)}return a(),n}function kH(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=Ci(e[0].text),i=e1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=Ci(a.text),u=e1(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function bH(e,t,n,s){const o=Ah(),{cache:i,emojiCorrection:r}=(function(E,C){n1().font=E;const M=(function(D){let R=K_.get(D);return R||(R=new Map,K_.set(D,R)),R})(E),$=(function(D){const R=D.match(/(\d+(?:\.\d+)?)\s*px/);return R?parseFloat(R[1]):16})(E),L=C?(function(D,R){let P=G_.get(D);if(P!==void 0)return P;const O=n1();O.font=D;const W=O.measureText("😀").width;if(P=0,W>R+.5&&typeof document<"u"&&document.body!==null){const V=document.createElement("span");V.style.font=D,V.style.display="inline-block",V.style.visibility="hidden",V.style.position="absolute",V.textContent="😀",document.body.appendChild(V);const z=V.getBoundingClientRect().width;document.body.removeChild(V),W-z>.5&&(P=W-z)}return G_.set(D,P),P})(E,$):0;return{cache:M,fontSize:$,emojiCorrection:L}})(t,(l=e.normalized,pH.test(l)));var l;const a=Wr("-",zi("-",i),r),c=8*Wr(" ",zi(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],p=[],m=[];let f=e.chunks.length<=1;const g=null,w=[],b=n?[]:null,_=Array.from({length:e.len});function v(E,C,M,$,L,D,R){L!=="text"&&L!=="space"&&L!=="zero-width-break"&&(f=!1),u.push(C),d.push(M),p.push($),m.push(L),w.push(R),b!==null&&b.push(E)}function y(E,C,M,$,L){const D=zi(E,i),R=Wr(E,D,r),P=C==="space"||C==="preserved-space"||C==="zero-width-break"?0:R,O=C==="space"||C==="zero-width-break"?0:R;if(L&&$&&E.length>1){let W="sum-graphemes";Pd(E)?W="pair-context":o.preferPrefixWidthsForBreakableRuns&&(W="segment-prefixes");const V=(function(z,se,Q,me,$e){if(se.breakableFitAdvances!==void 0)return se.breakableFitAdvances;const He=pT(),Be=[];for(const Z of He.segment(z))Be.push(Z.segment);if(Be.length<=1)return se.breakableFitAdvances=null,se.breakableFitAdvances;if($e==="sum-graphemes"){const Z=[];for(const Ae of Be){const G=zi(Ae,Q);Z.push(Wr(Ae,G,me))}return se.breakableFitAdvances=Z,se.breakableFitAdvances}if($e==="pair-context"||Be.length>96){const Z=[];let Ae=null,G=0;for(const oe of Be){const J=Wr(oe,zi(oe,Q),me);if(Ae===null)Z.push(J);else{const F=Ae+oe,Y=zi(F,Q);Z.push(Wr(F,Y,me)-G)}Ae=oe,G=J}return se.breakableFitAdvances=Z,se.breakableFitAdvances}const Ee=[];let te="",ee=0;for(const Z of Be){te+=Z;const Ae=Wr(te,zi(te,Q),me);Ee.push(Ae-ee),ee=Ae}return se.breakableFitAdvances=Ee,se.breakableFitAdvances})(E,D,i,r,W);return void v(E,R,P,O,C,M,V)}v(E,R,P,O,C,M,null)}for(let E=0;E<e.len;E++){_[E]=u.length;const C=e.texts[E],M=e.isWordLike[E],$=e.kinds[E],L=e.starts[E];if($==="soft-hyphen"){v(C,0,a,a,$,L,null);continue}if($==="hard-break"){v(C,0,0,0,$,L,null);continue}if($==="tab"){v(C,0,0,0,$,L,null);continue}const D=zi(C,i);if($==="text"&&D.containsCJK){const R=yH(C,o),P=s==="keep-all"?kH(R):R;for(let O=0;O<P.length;O++){const W=P[O];y(W.text,"text",L+W.start,M,s==="keep-all"||!Ci(W.text))}continue}y(C,$,L,M,!0)}const k=(function(E,C,M){const $=[];for(let L=0;L<E.length;L++){const D=E[L],R=D.startSegmentIndex<C.length?C[D.startSegmentIndex]:M,P=D.endSegmentIndex<C.length?C[D.endSegmentIndex]:M,O=D.consumedEndSegmentIndex<C.length?C[D.consumedEndSegmentIndex]:M;$.push({startSegmentIndex:R,endSegmentIndex:P,consumedEndSegmentIndex:O})}return $})(e.chunks,_,u.length),T=g===null?null:(function(E,C){const M=(function(L){const D=L.length;if(D===0)return null;const R=new Array(D);let P=!1;for(let Q=0;Q<D;){const me=L.charCodeAt(Q);let $e=me,He=1;if(me>=55296&&me<=56319&&Q+1<D){const Ee=L.charCodeAt(Q+1);Ee>=56320&&Ee<=57343&&($e=Ee-56320+(me-55296<<10)+65536,He=2)}const Be=UF($e);Be!=="R"&&Be!=="AL"&&Be!=="AN"||(P=!0);for(let Ee=0;Ee<He;Ee++)R[Q+Ee]=Be;Q+=He}if(!P)return null;let O=0;for(let Q=0;Q<D;Q++){const me=R[Q];if(me==="L"){O=0;break}if(me==="R"||me==="AL"){O=1;break}}const W=new Int8Array(D);for(let Q=0;Q<D;Q++)W[Q]=O;const V=1&O?"R":"L",z=V;let se=z;for(let Q=0;Q<D;Q++)R[Q]==="NSM"?R[Q]=se:se=R[Q];se=z;for(let Q=0;Q<D;Q++){const me=R[Q];me==="EN"?R[Q]=se==="AL"?"AN":"EN":me!=="R"&&me!=="L"&&me!=="AL"||(se=me)}for(let Q=0;Q<D;Q++)R[Q]==="AL"&&(R[Q]="R");for(let Q=1;Q<D-1;Q++)R[Q]==="ES"&&R[Q-1]==="EN"&&R[Q+1]==="EN"&&(R[Q]="EN"),R[Q]!=="CS"||R[Q-1]!=="EN"&&R[Q-1]!=="AN"||R[Q+1]!==R[Q-1]||(R[Q]=R[Q-1]);for(let Q=0;Q<D;Q++){if(R[Q]!=="EN")continue;let me;for(me=Q-1;me>=0&&R[me]==="ET";me--)R[me]="EN";for(me=Q+1;me<D&&R[me]==="ET";me++)R[me]="EN"}for(let Q=0;Q<D;Q++){const me=R[Q];me!=="WS"&&me!=="ES"&&me!=="ET"&&me!=="CS"||(R[Q]="ON")}se=z;for(let Q=0;Q<D;Q++){const me=R[Q];me==="EN"?R[Q]=se==="L"?"L":"EN":me!=="R"&&me!=="L"||(se=me)}for(let Q=0;Q<D;Q++){if(R[Q]!=="ON")continue;let me=Q+1;for(;me<D&&R[me]==="ON";)me++;const $e=(Q>0?R[Q-1]:z)!=="L"?"R":"L";if($e===((me<D?R[me]:z)!=="L"?"R":"L"))for(let He=Q;He<me;He++)R[He]=$e;Q=me-1}for(let Q=0;Q<D;Q++)R[Q]==="ON"&&(R[Q]=V);for(let Q=0;Q<D;Q++){const me=R[Q];1&W[Q]?me!=="L"&&me!=="AN"&&me!=="EN"||W[Q]++:me==="R"?W[Q]++:me!=="AN"&&me!=="EN"||(W[Q]+=2)}return W})(E);if(M===null)return null;const $=new Int8Array(C.length);for(let L=0;L<C.length;L++)$[L]=M[C[L]];return $})(e.normalized,g);return b!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:f,segLevels:T,breakableFitAdvances:w,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:k,segments:b}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:f,segLevels:T,breakableFitAdvances:w,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:k}}function _H(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return bH((function(c,u,d="normal",p="normal"){const m=(function(w){const b=w??"normal";return b==="pre-wrap"?{mode:b,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:b,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),f=m.mode==="pre-wrap"?(function(w){return/[\r\f]/.test(w)?w.replace(/\r\n/g,`
211
- `).replace(/[\r\f]/g,`
212
- `):w.replace(/\r\n/g,`
213
- `)})(c):(function(w){if(!jF.test(w))return w;let b=w.replace(qF," ");return b.charCodeAt(0)===32&&(b=b.slice(1)),b.length>0&&b.charCodeAt(b.length-1)===32&&(b=b.slice(0,-1)),b})(c);if(f.length===0)return{normalized:f,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const g=p==="keep-all"?(function(w){if(w.len<=1)return w;const b=[],_=[],v=[],y=[];let k=null,T=!1,E=0,C=!1,M=!1;function $(){k!==null&&(b.push(ho(k)),_.push(T),v.push("text"),y.push(E),k=null)}for(let L=0;L<w.len;L++){const D=w.texts[L],R=w.kinds[L],P=w.isWordLike[L],O=w.starts[L];if(R==="text"){const W=KF(D),V=e1(D);if(k!==null&&C&&M){k.push(D),T=T||P,C=C||W,M=V;continue}$(),k=[D],T=P,E=O,C=W,M=V;continue}$(),b.push(D),_.push(P),v.push(R),y.push(O)}return $(),{len:b.length,texts:b,isWordLike:_,kinds:v,starts:y}})(V_(f,u,m)):V_(f,u,m);return tt({normalized:f,chunks:fH(g,m)},g)})(s,Ah(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const Om="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",$n=(()=>{const e=globalThis;if(e[Om])return e[Om];const t={configs:{},controllers:{},revision:rl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Om]=t,t})();let ec=null;const X_=$n.revision;function Z_(e){var t;return e&&(t=$n.configs[e])!=null?t:null}function J_(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function wH(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Pm(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!wH(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
214
- `)}return o.length>0?o:null}function Dm(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(ec!=null)return ec;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return ec=!!((i=r.getContext)!=null&&i.call(r,"2d")),ec}catch{return ec=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=$n.blockEstimateCache.get(r);if(l)return $n.blockEstimateCache.delete(r),$n.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(m,f,g){const w=`${g}\0${f}\0${m}`,b=$n.preparedCache.get(w);if(b)return $n.preparedCache.delete(w),$n.preparedCache.set(w,b),b.prepared;const _=_H(m,f,{whiteSpace:g});for($n.preparedCache.set(w,{prepared:_});$n.preparedCache.size>240;){const v=$n.preparedCache.keys().next().value;if(!v)break;$n.preparedCache.delete(v)}return _})(e,n.font,a),u=(function(m,f,g){const w=(function(b,_){return b.simpleLineWalkFastPath?Y_(b,_):(function(v,y){if(v.simpleLineWalkFastPath)return Y_(v,y);const{widths:k,lineEndFitAdvances:T,lineEndPaintAdvances:E,kinds:C,breakableFitAdvances:M,discretionaryHyphenWidth:$,tabStopAdvance:L,chunks:D}=v;if(k.length===0||D.length===0)return 0;const R=Ah(),P=R.lineFitEpsilon,O=y+P;let W=0,V=0,z=!1,se=0,Q=0,me=-1,$e=0,He=0,Be=null;function Ee(){me=-1,$e=0,He=0,Be=null}function te(Y=se,le=Q,re=V){W++,V=0,z=!1,Ee()}function ee(Y,le){z=!0,se=Y+1,Q=0,V=le}function Z(Y,le,re){z=!0,se=Y,Q=le+1,V=re}function Ae(Y,le){z?(V+=le,se=Y+1,Q=0):ee(Y,le)}function G(Y,le,re,fe){if(!le)return;const q=Y==="tab"?0:T[re],X=Y==="tab"?fe:E[re];me=re+1,$e=V-fe+q,He=V-fe+X,Be=Y}function oe(Y,le){const re=M[Y];for(let fe=le;fe<re.length;fe++){const q=re[fe];z?V+q>O?(te(),Z(Y,fe,q)):(V+=q,se=Y,Q=fe+1):Z(Y,fe,q)}z&&se===Y&&Q===re.length&&(se=Y+1,Q=0)}function J(Y){if(Be!=="soft-hyphen")return!1;const le=M[Y];if(le==null)return!1;const{fitCount:re,fittedWidth:fe}=(function(q,X,de,he,ke){let Ce=0,ae=X;for(;Ce<q.length;){const _e=ae+q[Ce];if((Ce+1<q.length?_e+ke:_e)>de+he)break;ae=_e,Ce++}return{fitCount:Ce,fittedWidth:ae}})(le,V,y,P,$);return re!==0&&(V=fe,se=Y,Q=re,Ee(),re===le.length?(se=Y+1,Q=0,!0):(te(Y,re,fe+$),oe(Y,re),!0))}function F(Y){W++,Ee()}for(let Y=0;Y<D.length;Y++){const le=D[Y];if(le.startSegmentIndex===le.endSegmentIndex){F();continue}z=!1,V=0,le.startSegmentIndex,se=le.startSegmentIndex,Q=0,Ee();let re=le.startSegmentIndex;for(;re<le.endSegmentIndex;){const fe=C[re],q=fe==="space"||fe==="preserved-space"||fe==="tab"||fe==="zero-width-break"||fe==="soft-hyphen",X=fe==="tab"?vH(V,L):k[re];if(fe!=="soft-hyphen")if(z){if(V+X>O){const de=V+(fe==="tab"?0:T[re]),he=V+(fe==="tab"?X:E[re]);if(Be==="soft-hyphen"&&R.preferEarlySoftHyphenBreak&&$e<=O){te(me,0,He);continue}if(Be==="soft-hyphen"&&J(re)){re++;continue}if(q&&de<=O){Ae(re,X),te(re+1,0,he),re++;continue}if(me>=0&&$e<=O){if(se>me||se===me&&Q>0){te();continue}const ke=me;te(ke,0,He),re=ke;continue}if(X>y&&M[re]!==null){te(),oe(re,0),re++;continue}te();continue}Ae(re,X),G(fe,q,re,X),re++}else X>y&&M[re]!==null?oe(re,0):ee(re,X),G(fe,q,re,X),re++;else z&&(se=re+1,Q=0,me=re+1,$e=V+$,He=V+$,Be=fe),re++}if(z){const fe=me===le.consumedEndSegmentIndex?He:V;te(le.consumedEndSegmentIndex,0,fe)}}return W})(b,_)})(m,f);return{lineCount:w,height:w*g}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),p=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for($n.blockEstimateCache.set(r,{height:p,contentHeight:Math.round(d)});$n.blockEstimateCache.size>4e3;){const m=$n.blockEstimateCache.keys().next().value;if(!m)break;$n.blockEstimateCache.delete(m)}return{kind:"simple-text",height:p,contentHeight:Math.round(d)}}catch{return null}}function mT(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Pm(e.children);return i&&n.paragraph?Dm(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Pm(e.children),l=n.headings[i];return r&&l?Dm(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=Pm((o=i[0])==null?void 0:o.children);return r?Dm(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=mT(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 hd(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function SH(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Bm(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=J_(s.lineHeight,1.5*J_(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:SH(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}function $f(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function CH(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function gT(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=CH(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function vT(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 yT(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function kT(e,t=360,n=500){return yT(e,t,n)}function bT(e,t=360,n=500){return yT(e,t,n)}function Q_(e,t,n,s){var o;const i=(function(p){return Math.max(0,Math.ceil(p.scrollHeight||0)-Math.ceil(p.clientHeight||0))})(e),r=(function(p,m){return Number.isFinite(p)?Math.min(Math.max(0,p),m):0})(n,i);if(!s.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 p of a){e.scrollTop=p;const m=s.getNormalizedScrollTop(e,t,!1),f=Math.abs(m-r);f<u&&(u=f,c=p)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const _T=Symbol("MarkstreamMathBlockMinHeightCache");function rfe(){return Rt(_T,null)}const xH=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],TH=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],AH=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),wT=["raw","content","code","originalCode","updatedCode"],ew=new WeakMap,tw=new WeakMap;let MH=1;function Ao(){return typeof performance<"u"?performance.now():Date.now()}function nw(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function yo(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=ew.get(t);return n||(n=MH++,ew.set(t,n)),String(n)}function sw(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:yo(t),customMarkdownIt:yo(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:yo(e.validateLink),preTransformTokens:yo(e.preTransformTokens),postTransformTokens:yo(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function ow(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
215
- `,t-1)+1;return e.slice(n,t).trim()}function iw(e){const t=ST(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function ST(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function CT(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 Iv(e){const t=String(e??"");return`${t.length}:${CT(t)}`}function s1(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?Iv(r):`${r.length}:${CT(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${yo(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${yo(s)}`;const i=yo(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>s1(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}:${s1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Nf(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function xT(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Nf(s)?mr(s,t,n+1):xT(s,t,n+1)).join(",")}`:Nf(e)?mr(e,t,n):s1(e,t,n)}function EH(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!wT.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${Iv(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${yo(o)}`:AH.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${xT(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${yo(o)}`:""}).filter(Boolean).join(";")}function IH(e){return wT.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Iv(n)}`:""}).filter(Boolean).join(";")}function mr(e,t=new WeakMap,n=0){const s=tw.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${yo(o)}`;const r=yo(o);t.set(o,r);const l=(function(a,c,u){const d=a,p=Array.isArray(d.children)?d.children:[],m=p.length?p.slice(0,200).map(f=>mr(f,c,u+1)).join("|"):"";return[a.type,IH(d),EH(d,c,u),p.length,m].join(":")})(e,t,n);return tw.set(o,l),l}function TT(e,t){return mr(e)===mr(t)}function $v(e,t,n){const s=Ao(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ao()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function rw(e,t,n){return $v(t,n,()=>mr(e))}function AT(e,t,n){return rw(e,n,"stabilizeSignatureMs")===rw(t,n,"stabilizeSignatureMs")}function Fm(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function lw(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function $H(e,t){return e.length===t.length&&e===t}function Nv(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).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 p=s[d],m=o[d];if(typeof p!=typeof m)return!1;if(typeof p!="string"){if(typeof p!="number"&&typeof p!="boolean"&&p!=null)return null;if(!Object.is(p,m))return!1}else if(typeof m!="string"||!$H(p,m))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.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],p=c[u];if(!Nf(d)||!Nf(p))return null;const m=Nv(d,p,n+1);if(m==null)return null;if(!m)return!1}return!0}function NH(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Nv(e,t);return n??TT(e,t)}function LH(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return $v(n,"stabilizeSignatureMs",()=>{s=Nv(e,t)}),s??AT(e,t,n)}function RH(e,t){const n={};for(const s of xH){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function OH(e,t){var n;const s=k_(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:U(()=>!1),r=ie(t.renderContent.value);let l,a=[],c="",u="",d="",p=0,m=0,f=Ao();function g(){l&&(clearTimeout(l),l=void 0)}function w(){g();const M=t.renderContent.value;r.value!==M&&(r.value=M),f=Ao()}Ve([t.renderContent,t.effectiveFinal,i],([M,$,L])=>{r.value!==M&&(!L||$||(function(D,R){if(!D&&R||R.length<=80||R.length<D.length||!R.startsWith(D))return!0;const P=R.slice(D.length);return!!P&&(!!iw(ow(R))||!(!P.includes(`
216
-
217
- `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(P))||P.endsWith(`
218
- `)&&!(function(O){const W=ow(O);if(iw(W))return!1;const V=ST(W);return V.length>=2&&V.some(z=>z.trim())})(R))})(r.value,M)?w():(function(){if(m+=1,l)return;const D=Math.max(0,(function(R){const P=R.parseCoalesceMs;return typeof P=="number"&&Number.isFinite(P)&&P>=0?P:80})(e)-(Ao()-f));D<=0?w():l=setTimeout(w,D)})())},{flush:"sync",immediate:!0}),C1(g);const b=U(()=>{var M,$,L,D;return BO(e.customHtmlTags,(M=e.parseOptions)==null?void 0:M.customHtmlTags,(D=(L=($=t.customComponentsMap)==null?void 0:$.value)!=null?L:{},Object.entries(D).map(([R,P])=>{const O=Co(R);return P==null||!O||uu(O)||ix.has(O)||au.has(O)?"":O}).filter(Boolean)))}),_=U(()=>{const{key:M,tags:$}=FO(b.value);if(!M)return s;const L=o.get(M);if(L)return L;const D=k_(t.instanceMsgId,{customHtmlTags:$});return o.set(M,D),D}),v=U(()=>{const M=_.value;return e.customMarkdownIt?e.customMarkdownIt(M):M}),y=U(()=>{var M,$;const L=(M=e.parseOptions)!=null?M:{},D=t.effectiveFinal.value,R=b.value,P=D!=null,O=R.length>0;return P||O||L.streamParse==null?tt(tt(xt(tt({},L),{streamParse:($=L.streamParse)==null||$}),P?{final:D}:{}),O?{customHtmlTags:R}:{}):L}),k=U(()=>{var M;return new Set(((M=y.value.customHtmlTags)!=null?M:[]).map($=>String($).trim().toLowerCase()).filter(Boolean))}),T=U(()=>sw(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),E=U(()=>sw(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ve([T,E],([M,$],[L,D])=>{L&&(M===L&&$===D||(w(),$!==D&&(a=[],d="")))},{flush:"sync"});const C=U(()=>{var M,$,L,D,R,P,O,W;if((M=e.nodes)!=null&&M.length)return a=[],d="",er(e.nodes.slice());const V=r.value;if(!V)return a=[],d="",[];const z=t.debugPerformanceEnabled.value,se=z?Ao():0,Q=v.value,me=T.value,$e=E.value;c&&me!==c&&(function(le){var re,fe;(fe=(re=le.stream)==null?void 0:re.reset)==null||fe.call(re)})(Q),u&&$e!==u&&(a=[],d="");const He=a.length>0&&V.startsWith(d)&&$e===u,Be=z?nw(Q):null,Ee=z?{}:void 0,te=Ee?xt(tt({},y.value),{__timing:Ee}):y.value,ee=Wx(V,Q,te),Z=z?Ao():0,Ae=z?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let G,oe=z?Fm(ee.length):void 0,J=0,F=0;if(He){const le=z?Ao():0;if(Ae){const re=(function(fe,q,X){if(!q.length)return{nodes:fe,metrics:Fm(fe.length)};const de=(function(Ce,ae,_e){const ze=Math.min(Ce.length,ae.length);for(let Qe=0;Qe<ze;Qe++)if(!LH(ae[Qe],Ce[Qe],_e))return Qe;return Ce.length===ae.length?-1:ze})(fe,q,X);if(de<0)return{nodes:q,metrics:{reusedNodeCount:fe.length,dirtyStartIndex:de,stablePrefixNodeCount:fe.length,dirtyTailNodeCount:0}};const he=fe.slice();let ke=de;for(let Ce=0;Ce<de;Ce++)he[Ce]=q[Ce];for(let Ce=de;Ce<fe.length;Ce++){const ae=q[Ce],_e=fe[Ce];ae&&AT(ae,_e,X)&&(he[Ce]=ae,ke+=1)}return{nodes:he,metrics:{reusedNodeCount:ke,dirtyStartIndex:de,stablePrefixNodeCount:de,dirtyTailNodeCount:lw(de,fe,q)}}})(ee,a,Ae);G=re.nodes,oe=re.metrics}else{const re=(function(fe,q){if(!q.length)return{nodes:fe,metrics:Fm(fe.length)};const X=(function(ke,Ce){const ae=Math.min(ke.length,Ce.length);for(let _e=0;_e<ae;_e++)if(!NH(Ce[_e],ke[_e]))return _e;return ke.length===Ce.length?-1:ae})(fe,q);if(X<0)return{nodes:q,metrics:{reusedNodeCount:fe.length,dirtyStartIndex:X,stablePrefixNodeCount:fe.length,dirtyTailNodeCount:0}};const de=fe.slice();let he=X;for(let ke=0;ke<X;ke++)de[ke]=q[ke];for(let ke=X;ke<fe.length;ke++){const Ce=q[ke],ae=fe[ke];Ce&&TT(Ce,ae)&&(de[ke]=Ce,he+=1)}return{nodes:de,metrics:{reusedNodeCount:he,dirtyStartIndex:X,stablePrefixNodeCount:X,dirtyTailNodeCount:lw(X,fe,q)}}})(ee,a);G=re.nodes,oe=re.metrics}J=z?Ao()-le:0,F=oe?.dirtyStartIndex==null||oe.dirtyStartIndex<0?G.length:oe.dirtyStartIndex}else G=ee;Ae?(function(le,re,fe=0){for(let q=Math.max(0,fe);q<le.length;q++)$v(re,"primeSignatureMs",()=>mr(le[q]))})(G,Ae,F):(function(le,re=0){for(let fe=Math.max(0,re);fe<le.length;fe++)mr(le[fe])})(G,F);const Y=z?Ao()-Z:0;if(p+=1,d=V,c=me,u=$e,a=G,z){const le=nw(Q),re=typeof le?.total=="number"&&le.total>(($=Be?.total)!=null?$:0);t.logPerf(re?"parse(stream)":"parse(sync)",tt(tt(tt({rendererId:t.instanceMsgId,ms:Math.round(Ao()-se),nodes:G.length,contentLength:V.length,parseCommitCount:p,parseCoalescedCount:m,nodeReuseMs:Y,signatureMs:(L=Ae?.signatureMs)!=null?L:0,stabilizeSignatureMs:(D=Ae?.stabilizeSignatureMs)!=null?D:0,primeSignatureMs:(R=Ae?.primeSignatureMs)!=null?R:0,signatureCallCount:(P=Ae?.signatureCallCount)!=null?P:0,stabilizeSignatureCallCount:(O=Ae?.stabilizeSignatureCallCount)!=null?O:0,primeSignatureCallCount:(W=Ae?.primeSignatureCallCount)!=null?W:0,stabilizeMs:J},oe??{}),Ee?Object.fromEntries(TH.map(fe=>{var q;return[fe,(q=Ee[fe])!=null?q:0]})):{}),le?{streamMode:le.lastMode,streamDelta:RH(le,Be),streamStats:le}:{}))}return er(G)});return{effectiveCustomHtmlTags:b,effectiveCustomHtmlTagsSet:k,mdBase:_,mdInstance:v,mergedParseOptions:y,parsedNodes:C}}function PH(e){const{isClient:t}=e,n=ie(new Set),s=new Map,o=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:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(p,m){if((g=(f=e.shouldTrackVisibleNodeIndices)==null?void 0:f.call(e))!=null&&!g)return;var f,g;const w=n.value,b=w.has(p);if(m){if(b)return;const v=new Set(w);return v.add(p),void(n.value=v)}if(!b)return;const _=new Set(w);_.delete(p),n.value=_})(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[p,m]of o.entries())p<c||(m(),o.delete(p));for(const[p,m]of s.entries())p<c||(m.destroy(),s.delete(p),r(p),(u=e.onNodeVisibilityCleaned)==null||u.call(e,p));for(const p of Array.from(i.keys()))p<c||r(p);if(!n.value.size)return;const d=new Set;for(const p of n.value)p<c&&d.add(p);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function DH(e={}){const t=ie(""),n=ie(""),s=ie(!1),o=nB(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=U(()=>Math.max(0,t.value.length-n.value.length)),a=U(()=>l.value===0),c=U(()=>s.value&&a.value);return S1()&&C1(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const aw=/auto|scroll|overlay/i;function BH(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return aw.test(t)||aw.test(n)}function FH(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 HH=Xe({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=U(()=>{var n,s;return bT((s=$f(e.estimatedPreviewHeightPx))!=null?s:vT(String((n=e.node.code)!=null?n:"")))});return()=>jt("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?jt("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)"}},[jt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[jt("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),jt("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),jt("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},()=>jt("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,jt("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[jt("div",{class:"absolute inset-0"},[jt("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),WH=Xe({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=U(()=>{var n,s;return kT((s=$f(e.estimatedPreviewHeightPx))!=null?s:gT(String((n=e.node.code)!=null?n:"")))});return()=>jt("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?jt("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)"}},[jt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[jt("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),jt("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},()=>jt("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[jt("span",{class:"action-icon block"})])))]):null,jt("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)"}},[jt("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"}})])])}}),UH=["data-custom-id"],qH={class:"m-0 p-0"},jH=["data-probe"],zH=["data-node-index","data-node-type"],MT=zt(Xe(xt(tt({},{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:{},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 s=e,o=n,i={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:320,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"}},r=U(()=>{return(x=s.mode)==="chat"||x==="minimal"||x==="docs"?x:"docs";var x}),l=U(()=>s.renderCodeBlocksAsPre===!0?"pre":s.codeRenderer==="pre"||s.codeRenderer==="shiki"||s.codeRenderer==="monaco"?s.codeRenderer:s.renderCodeBlocksAsPre===!1||r.value==="docs"?"monaco":"pre"),a=U(()=>i[r.value]),c=U(()=>{var x;return(x=s.showTooltips)!=null?x:a.value.showTooltips}),u=U(()=>{var x;return(x=s.fade)!=null?x:a.value.fade}),d=U(()=>{var x;return(x=s.batchRendering)!=null?x:a.value.batchRendering}),p=U(()=>{var x;return(x=s.initialRenderBatchSize)!=null?x:a.value.initialRenderBatchSize}),m=U(()=>{var x;return(x=s.renderBatchSize)!=null?x:a.value.renderBatchSize}),f=U(()=>{var x;return(x=s.renderBatchDelay)!=null?x:a.value.renderBatchDelay}),g=U(()=>{var x;return(x=s.renderBatchBudgetMs)!=null?x:a.value.renderBatchBudgetMs}),w=U(()=>{var x;return(x=s.renderBatchIdleTimeoutMs)!=null?x:a.value.renderBatchIdleTimeoutMs}),b=U(()=>{var x;return(x=s.deferNodesUntilVisible)!=null?x:a.value.deferNodesUntilVisible}),_=U(()=>{var x;return(x=s.maxLiveNodes)!=null?x:a.value.maxLiveNodes}),v=U(()=>{var x;return(x=s.liveNodeBuffer)!=null?x:a.value.liveNodeBuffer}),y=U(()=>{var x;return(x=s.nodeVirtual)!=null?x:a.value.nodeVirtual}),k={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return s.parseOptions},get customMarkdownIt(){return s.customMarkdownIt},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return s.customHtmlTags},get mode(){return s.mode},get htmlPolicy(){return s.htmlPolicy},get viewportPriority(){return s.viewportPriority},get codeBlockStream(){return s.codeBlockStream},get codeBlockDarkTheme(){return s.codeBlockDarkTheme},get codeBlockLightTheme(){return s.codeBlockLightTheme},get codeBlockMonacoOptions(){return s.codeBlockMonacoOptions},get codeRenderer(){return s.codeRenderer},get renderCodeBlocksAsPre(){return s.renderCodeBlocksAsPre},get codeBlockMinWidth(){return s.codeBlockMinWidth},get codeBlockMaxWidth(){return s.codeBlockMaxWidth},get codeBlockProps(){return s.codeBlockProps},get mermaidProps(){return s.mermaidProps},get d2Props(){return s.d2Props},get infographicProps(){return s.infographicProps},get showTooltips(){return c.value},get themes(){return s.themes},get isDark(){return s.isDark},get customId(){return s.customId},get indexKey(){return s.indexKey},get typewriter(){return s.typewriter},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return s.smoothStreamingOptions},get parseCoalesceMs(){return s.parseCoalesceMs},get fade(){return u.value},get batchRendering(){return d.value},get initialRenderBatchSize(){return p.value},get renderBatchSize(){return m.value},get renderBatchDelay(){return f.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return w.value},get deferNodesUntilVisible(){return b.value},get maxLiveNodes(){return _.value},get liveNodeBuffer(){return v.value},get nodeVirtual(){return y.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function T(x){o("height-change",x)}function E(x){o("virtual-state-change",x)}function C(x){o("anchor-change",x)}const M=ie(),$=ie(null),L=ie(null),D=ie(null),R=qs({1:null,2:null,3:null,4:null,5:null,6:null}),P=ie(!1),O=new Map,W=ie(0),V=ie(0),z=ie({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function se(){var x,B;if(((x=s.virtualScroll)==null?void 0:x.enabled)!==!0)return null;const j=(B=s.virtualScroll)==null?void 0:B.scrollRoot;return Q(typeof j=="function"?j():j)}function Q(x){return x?typeof HTMLElement<"u"&&x instanceof HTMLElement?x:typeof x=="object"&&"value"in x?Q(x.value):typeof x=="object"&&"$el"in x?Q(x.$el):null:null}const{isClient:me,renderAsFragment:$e,debugPerformanceEnabled:He,resolvedShowTooltips:Be,resolvedHtmlPolicy:Ee,inheritedSmoothStreaming:te,ownsTypewriterCursor:ee}=(function(x){const B=typeof window<"u",j=su(),K=Rt("markstreamHtmlPolicy",void 0),ne=Rt("markstreamTypewriterCursor",void 0),pe=Rt("markstreamSmoothStreaming",void 0),ge=U(()=>x.renderAsFragment===!0),ve=U(()=>!!(x.debugPerformance&&B&&typeof console<"u")),Ne=U(()=>{var Oe;if(typeof x.showTooltips=="boolean")return x.showTooltips;const Se=(Oe=j.showTooltips)!=null?Oe:j["show-tooltips"];return Se===""||Se===!0||Se==="true"||Se!==!1&&Se!=="false"&&void 0}),we=U(()=>{var Oe,Se;return(Se=(Oe=x.htmlPolicy)!=null?Oe:K?.value)!=null?Se:"safe"}),De=U(()=>ne?.value!==!0);return{isClient:B,renderAsFragment:ge,debugPerformanceEnabled:ve,resolvedShowTooltips:Ne,resolvedHtmlPolicy:we,inheritedSmoothStreaming:pe,inheritedTypewriterCursor:ne,ownsTypewriterCursor:De}})(k),{resolveViewportRoot:Z,resolveScrollContainer:Ae,isReverseFlexScrollRoot:G,getNormalizedScrollTop:oe,getOffsetTopWithinRoot:J}=(function(x,B){function j(){var ve,Ne;return(Ne=(ve=B.scrollRoot)==null?void 0:ve.call(B))!=null?Ne:null}function K(ve){if(typeof window>"u")return null;const Ne=j();if(Ne)return Ne;const we=ve??x.value;if(!we)return null;const De=we.ownerDocument||document,Oe=De.scrollingElement||De.documentElement;let Se=we;for(;Se&&Se!==De.body&&Se!==Oe;){if(BH(window.getComputedStyle(Se))&&FH(Se))return Se;Se=Se.parentElement}return null}function ne(ve){if(!B.isClient)return!1;try{const Ne=window.getComputedStyle(ve);return!!(Ne.display||"").toLowerCase().includes("flex")&&(Ne.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function pe(ve,Ne,we){var De,Oe;if(we)return ge(Ne);const Se=ve.scrollTop;if(!ne(ve))return Se;const Pe=Se<0?-Se:Se;return Math.max(0,((De=ve.scrollHeight)!=null?De:0)-((Oe=ve.clientHeight)!=null?Oe:0))-Pe}function ge(ve){var Ne,we,De,Oe,Se;const Pe=Number((Ne=ve.scrollingElement)==null?void 0:Ne.scrollTop),Ue=Number((De=(we=ve.documentElement)==null?void 0:we.scrollTop)!=null?De:0),We=Number((Se=(Oe=ve.body)==null?void 0:Oe.scrollTop)!=null?Se:0);return Math.max(0,Number.isFinite(Pe)?Pe:0,Number.isFinite(Ue)?Ue:0,Number.isFinite(We)?We:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(ve){var Ne,we,De,Oe;const Se=j();if(Se)return Se;const Pe=K((Ne=ve??x.value)!=null?Ne:null);if(Pe)return Pe;const Ue=(Oe=(De=ve?.ownerDocument)!=null?De:(we=x.value)==null?void 0:we.ownerDocument)!=null?Oe:typeof document<"u"?document:null;return Ue?.scrollingElement||Ue?.documentElement||null},isReverseFlexScrollRoot:ne,getNormalizedScrollTop:pe,getOffsetTopWithinRoot:function(ve,Ne){const we=Ne.ownerDocument||ve.ownerDocument||document;if((function(Pe,Ue){return Pe===Ue.documentElement||Pe===Ue.body||Pe===Ue.scrollingElement})(Ne,we))return ve.getBoundingClientRect().top+ge(we);const De=Ne.getBoundingClientRect(),Oe=ve.getBoundingClientRect(),Se=pe(Ne,we,!1);return Oe.top-De.top+Se}}})(M,{isClient:me,scrollRoot:se});an("markstreamShowTooltips",Be),an("markstreamHtmlPolicy",Ee),an("markstreamTypewriter",U(()=>s.typewriter!==!1)),an("markstreamFade",U(()=>k.fade!==!1)),an("markstreamTypewriterCursor",U(()=>!0)),an("markstreamTextStreamState",O),an("markstreamStreamVersion",W),an("markstreamParseOptions",U(()=>s.parseOptions)),an("markstreamCustomMarkdownIt",U(()=>s.customMarkdownIt));const{smoothStreamingEnabled:F,renderContent:Y,effectiveFinal:le}=(function(x,B){const j=DH(x.smoothStreamingOptions),K=U(()=>{var we,De,Oe;return x.smoothStreaming!==!1&&!((we=x.nodes)!=null&&we.length)&&(x.smoothStreaming===!0||!((De=B.inheritedSmoothStreaming)!=null&&De.value))&&(x.smoothStreaming===!0||x.typewriter===!0||((Oe=x.maxLiveNodes)!=null?Oe:0)<=0)}),ne=ie(!B.isClient||x.smoothStreaming===!0);sn(()=>{ne.value=!0});const pe=U(()=>ne.value&&K.value),ge=U(()=>{var we;return pe.value?j.visible.value:(we=x.content)!=null?we:""}),ve=U(()=>{var we,De;const Oe=(we=x.parseOptions)!=null?we:{};return(De=x.final)!=null?De:Oe.final}),Ne=U(()=>{const we=ve.value;return pe.value&&we!=null?!!we&&j.caughtUp.value:we});return Ve([()=>x.content,()=>x.nodes,pe,ve],([we,De,Oe,Se])=>{if(De?.length)return void j.reset("");const Pe=we??"";if(!Oe)return j.reset(Pe),void(Se&&j.finish({flush:!0}));const Ue=j.source.value;Pe?Pe===Ue||(Pe.startsWith(Ue)?j.enqueue(Pe.slice(Ue.length)):j.reset(Pe)):j.reset(""),Se&&j.finish()},{immediate:!0}),{smoothStream:j,smoothStreamingEligible:K,smoothStreamingEnabled:pe,renderContent:ge,requestedFinal:ve,effectiveFinal:Ne}})(k,{isClient:me,inheritedSmoothStreaming:te});an("markstreamSmoothStreaming",F);const re=ie(!1);let fe="",q=!1,X=null;function de(){me&&X!=null&&(window.clearTimeout(X),X=null)}function he(){re.value=!1,de()}function ke(x,B){if(!He.value)return;const j=(function(){if(!He.value)return null;const K=Qe(Ce),ne=Qe(ae),pe=Math.max(ze,ne);if(K<=0&&pe<=0)return null;const ge={total:K,maxPerFrame:pe,byLabel:(ve=Ce,Object.fromEntries(Array.from(ve.entries()).sort((Ne,we)=>we[1]-Ne[1]||Ne[0].localeCompare(we[0]))))};var ve;return Ce.clear(),ae.clear(),ze=0,ge})();console.info(`[markstream-vue][perf] ${x}`,j?xt(tt({},B),{layoutReads:j}):B)}Ve([Y,()=>s.nodes,le],([x,B,j])=>{const K=x??"";return B?.length||j===!0?(he(),fe=K,void(q=!0)):q?(fe&&K.length>fe.length&&K.startsWith(fe)?(re.value=!0,me&&(de(),X=window.setTimeout(()=>{var ne;X=null,le.value===!0||(ne=s.nodes)!=null&&ne.length||(_l(),re.value=!1,li())},1200))):(K.length<fe.length||!K.startsWith(fe))&&he(),void(fe=K)):(fe=K,void(q=!0))},{flush:"sync",immediate:!0});const Ce=new Map,ae=new Map;let _e=!1,ze=0;function Qe(x){let B=0;for(const j of x.values())B+=j;return B}function dt(){ze=Math.max(ze,Qe(ae)),ae.clear(),_e=!1}function Ge(x,B){return(function(j){var K,ne;He.value&&(Ce.set(j,((K=Ce.get(j))!=null?K:0)+1),ae.set(j,((ne=ae.get(j))!=null?ne:0)+1),_e||(_e=!0,me&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(dt):typeof queueMicrotask!="function"?setTimeout(dt,0):queueMicrotask(dt)))})(x),B()}const ft=s.customId?`renderer-${s.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Ct=(function(x){const B=new Map;return{scope:x,cache:B,clear:()=>B.clear()}})(ft),Jt=U(()=>`${ft}:${W.value}`);an(_T,Ct);const Ft=An(()=>s.customId),{effectiveCustomHtmlTagsSet:Xn,mergedParseOptions:_s,parsedNodes:Ke}=OH(s,{instanceMsgId:ft,renderContent:Y,effectiveFinal:le,smoothStreamingEnabled:F,debugPerformanceEnabled:He,customComponentsMap:Ft,logPerf:ke});Ve(Ke,()=>{Ct.clear(),W.value+=1},{immediate:!0});const Et=U(()=>({customId:s.customId,customHtmlTags:_s.value.customHtmlTags,parseOptions:s.parseOptions,customMarkdownIt:s.customMarkdownIt,htmlPolicy:Ee.value,viewportPriority:s.viewportPriority,mode:r.value,codeRenderer:l.value,codeBlockStream:k.codeBlockStream,codeBlockDarkTheme:s.codeBlockDarkTheme,codeBlockLightTheme:s.codeBlockLightTheme,codeBlockMonacoOptions:s.codeBlockMonacoOptions,renderCodeBlocksAsPre:k.renderCodeBlocksAsPre,codeBlockMinWidth:s.codeBlockMinWidth,codeBlockMaxWidth:s.codeBlockMaxWidth,codeBlockProps:s.codeBlockProps,mermaidProps:s.mermaidProps,d2Props:s.d2Props,infographicProps:s.infographicProps,showTooltips:Be.value,themes:s.themes,isDark:s.isDark,typewriter:s.typewriter,smoothStreamingOptions:s.smoothStreamingOptions,parseCoalesceMs:s.parseCoalesceMs,fade:k.fade}));an("markstreamNestedRendererProps",Et);const ls=U(()=>Ke.value),Os=U(()=>Ke.value.length),eo=ie(null),Oo=ie(null),Ps=ie(null),Fn=ie(null),un=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),to=!un&&s.customId?Z_(s.customId):null,Mn=U(()=>to?(X_.value,Z_(s.customId)):null),Hn=U(()=>{var x;return!!(me&&!$e.value&&s.customId&&!un&&((x=Mn.value)!=null&&x.enabled))}),Wn=U(()=>{var x;return!!(!$e.value&&((x=s.virtualScroll)!=null&&x.enabled))}),Po=ie(!1);sn(()=>{Po.value=!0});const wt=U(()=>!!(me&&Wn.value));an("markstreamHostScrollManaged",wt);const as=U(()=>!!(Po.value&&wt.value)),Qt=U(()=>Hn.value||wt.value),ni=U(()=>Hn.value||as.value),no=U(()=>{var x;return Qt.value&&((x=Mn.value)==null?void 0:x.textEstimation)!==!1}),ws=U(()=>{var x;return Qt.value&&((x=Mn.value)==null?void 0:x.codeBlockEstimation)!==!1});function En(){const x=V.value||Ge("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=M.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(x)&&x>0?x:0}const Ds=U(()=>{const x=En();return x>0?Math.max(1,Math.round(x)):640}),Un=U(()=>{var x;return Math.max(1,(x=k.maxLiveNodes)!=null?x:320)}),gt=U(()=>{var x;return!$e.value&&k.nodeVirtual!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&(k.nodeVirtual===!0?Ke.value.length>0:Ke.value.length>Un.value)}),Ie=U(()=>gt.value||Hn.value||wt.value),ye=U(()=>s.viewportPriority!==!1&&!P.value),Le=xF(x=>{var B;return Z((B=x??M.value)!=null?B:null)},ye),{requestFrame:St,cancelFrame:At,hasIdleCallback:mn,isTestEnv:dn}=(function(x){const B=x.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,j=x.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,K=x.isClient&&typeof window.requestIdleCallback=="function",ne=(function(){var pe;if(typeof globalThis>"u"||!("process"in globalThis))return;const ge=(pe=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:pe.value;return ge?.env})();return{requestFrame:B,cancelFrame:j,hasIdleCallback:K,isTestEnv:ne?.NODE_ENV==="test"}})({isClient:me}),{resolvedBatchSize:so,resolvedInitialBatch:xe,batchingEnabled:Re,incrementalRenderingActive:qe,renderedCount:st,previousRenderContext:Rn,adaptiveBatchSize:en,previousBatchConfig:Zn}=(function(x,B){var j;const K=U(()=>{var Oe;const Se=Math.trunc((Oe=x.renderBatchSize)!=null?Oe:80);return Number.isFinite(Se)?Math.max(0,Se):0}),ne=U(()=>{var Oe;const Se=Math.trunc((Oe=x.initialRenderBatchSize)!=null?Oe:K.value);return Number.isFinite(Se)?Math.max(0,Se):K.value}),pe=U(()=>!B.renderAsFragment.value&&x.batchRendering!==!1&&K.value>0&&B.isClient&&!B.isTestEnv),ge=ie(0),ve=ie({key:x.indexKey,total:0}),Ne=ie(Math.max(1,K.value||1)),we=U(()=>{var Oe;return pe.value&&((Oe=x.maxLiveNodes)!=null?Oe:0)<=0}),De=ie({batchSize:K.value,initial:ne.value,delay:(j=x.renderBatchDelay)!=null?j:16,enabled:we.value});return{resolvedBatchSize:K,resolvedInitialBatch:ne,batchingEnabled:pe,incrementalRenderingActive:we,renderedCount:ge,previousRenderContext:ve,adaptiveBatchSize:Ne,previousBatchConfig:De}})(k,{isClient:me,isTestEnv:dn,renderAsFragment:$e}),rn=new Map,Bs=new Map,wr=new WeakMap;let Do=null;const pu=new WeakMap,cs=new Map,mu=ie(0),jh=U(()=>(mu.value,Array.from(rn.entries()).sort((x,B)=>x[0]-B[0]))),Sr=ie(null),us=ie(null);let si=null,wa=0,Cr=null;const{activeRestoreAnchor:oi,getRelativeScrollTopWithinContainer:Sa,setRelativeScrollTopWithinContainer:zh,resolveAnchorOffset:Fe,clearRestoreReconcile:ce,scheduleRestoreReconcile:be,captureRestoreAnchor:It,restoreAnchor:Ca,getAnchorDrift:gu}=(function(x){const{isClient:B,containerRef:j,parsedNodeCount:K,requestFrame:ne,cancelFrame:pe,resolveScrollContainer:ge,getNormalizedScrollTop:ve,getOffsetTopWithinRoot:Ne,isReverseFlexScrollRoot:we,estimateIndexForOffset:De,estimateHeightRange:Oe,getFallbackNodeHeight:Se,clamp:Pe}=x,Ue=ie(null);let We=null,it=[];function et(){const lt=ge(),kt=j.value;if(!lt||!kt)return null;const bt=lt.ownerDocument||kt.ownerDocument||document;if(lt===bt.documentElement||lt===bt.body||lt===bt.scrollingElement){const Ot=kt.getBoundingClientRect();return Math.max(0,-Ot.top)}return Math.max(0,ve(lt,bt,!1)-Ne(kt,lt))}function Je(lt){var kt;const bt=ge(),Ot=j.value;if(!bt||!Ot)return;const ds=Math.max(0,lt),fs=bt.ownerDocument||Ot.ownerDocument||document,xo=fs.defaultView||(typeof window<"u"?window:null);if(bt===fs.documentElement||bt===fs.body||bt===fs.scrollingElement){const Di=ve(bt,fs,!0)+Ot.getBoundingClientRect().top;return void((kt=xo?.scrollTo)==null||kt.call(xo,0,Math.max(0,Di+ds)))}Q_(bt,fs,Ne(Ot,bt)+ds,{isReverseFlexScrollRoot:Di=>{var Bi;return(Bi=we?.(Di))!=null&&Bi},getNormalizedScrollTop:ve})}function at(lt){const kt=K.value,bt=Pe(lt.nodeIndex,0,Math.max(0,kt-1));return Oe(0,bt)+Math.max(0,lt.offsetWithinNodePx)}function ct(){if(We!=null&&(pe?.(We),We=null),B)for(const lt of it)window.clearTimeout(lt);it=[]}function ht(lt){const kt=at(lt),bt=et();bt!=null&&Math.abs(bt-kt)<=.5||Je(kt)}return{activeRestoreAnchor:Ue,getRelativeScrollTopWithinContainer:et,setRelativeScrollTopWithinContainer:Je,resolveAnchorOffset:at,clearRestoreReconcile:ct,applyRestoreAnchor:ht,scheduleRestoreReconcile:function(){Ue.value&&B&&We==null&&(We=ne?ne(()=>{We=null,Ue.value&&ht(Ue.value)}):null,We==null&&Ue.value&&ht(Ue.value))},captureRestoreAnchor:function(){const lt=et(),kt=K.value;if(lt==null||kt<=0)return null;const bt=Pe(De(lt+1),0,kt-1),Ot=Oe(0,bt),ds=Se(bt);return{nodeIndex:bt,offsetWithinNodePx:Pe(lt-Ot,0,Math.max(0,ds-1))}},restoreAnchor:function(lt){const kt=K.value;if(Ue.value={nodeIndex:Pe(lt.nodeIndex,0,Math.max(0,kt-1)),offsetWithinNodePx:Math.max(0,lt.offsetWithinNodePx)},ct(),ht(Ue.value),B)for(const bt of[0,120,280,480])it.push(window.setTimeout(()=>{Ue.value&&ht(Ue.value)},bt))},getAnchorDrift:function(lt){const kt=et();return kt==null?null:kt-at(lt)}}})({isClient:me,containerRef:M,parsedNodeCount:Os,requestFrame:St,cancelFrame:At,resolveScrollContainer:()=>Sr.value||Ae(),getNormalizedScrollTop:oe,getOffsetTopWithinRoot:J,isReverseFlexScrollRoot:G,estimateIndexForOffset:Ip,estimateHeightRange:Pi,getFallbackNodeHeight:Tu,clamp:jn}),{nodeHeights:oo,heightStats:io,heightTreeSize:xa,heightSumTree:Vh,heightKnownTree:Kh,averageNodeHeight:Bo,resetHeightMeasurements:F3,pruneHeightMeasurements:H3,rebuildHeightTrees:vu,recordNodeHeight:W3,removeNodeHeights:U3,exportHeightCache:q3,importHeightCache:j3,fenwickRangeSum:yu}=(function(x={}){const B=qs({}),j=qs({total:0,count:0}),K=ie(0),ne=ie([]),pe=ie([]);function ge(){for(const Se of Object.keys(B))delete B[Number(Se)];j.total=0,j.count=0,K.value=0,ne.value=[],pe.value=[]}function ve(Se,Pe,Ue){for(let We=Pe+1;We<Se.length;We+=We&-We)Se[We]+=Ue}function Ne(Se,Pe){let Ue=0;for(let We=Pe+1;We>0;We-=We&-We)Ue+=Se[We];return Ue}function we(Se){K.value=Se;const Pe=new Array(Se+1).fill(0),Ue=new Array(Se+1).fill(0);for(const[We,it]of Object.entries(B)){const et=Number(We),Je=Number(it);!Number.isFinite(et)||et<0||et>=Se||!Number.isFinite(Je)||Je<=0||(ve(Pe,et,Je),ve(Ue,et,1))}ne.value=Pe,pe.value=Ue}function De(Se){if(!Number.isInteger(Se)||Se<0)return!1;const Pe=B[Se];if(!Number.isFinite(Pe)||Pe<=0)return!1;if(delete B[Se],j.total=Math.max(0,j.total-Pe),j.count=Math.max(0,j.count-1),K.value>Se){const Ue=ne.value,We=pe.value;Ue.length&&We.length&&(ve(Ue,Se,-Pe),ve(We,Se,-1))}return!0}const Oe=U(()=>j.count>0?Math.max(12,j.total/j.count):32);return{nodeHeights:B,heightStats:j,heightTreeSize:K,heightSumTree:ne,heightKnownTree:pe,averageNodeHeight:Oe,resetHeightMeasurements:ge,pruneHeightMeasurements:function(Se){if(Se<=0)return void ge();let Pe=0,Ue=0;for(const[We,it]of Object.entries(B)){const et=Number(We),Je=Number(it);!Number.isFinite(et)||et<0||et>=Se||!Number.isFinite(Je)||Je<=0?delete B[et]:(Pe+=Je,Ue++)}j.total=Pe,j.count=Ue},rebuildHeightTrees:we,recordNodeHeight:function(Se,Pe,Ue={}){(function(We,it,et={}){var Je;if(!Number.isFinite(it)||it<=0)return!1;const at=B[We];if(at&&(et.allowShrink===!1&&it<at||Math.abs(it-at)<=1))return!1;if(B[We]=it,at?j.total+=it-at:(j.total+=it,j.count++),K.value>We){const ct=ne.value,ht=pe.value;if(ct.length&&ht.length)if(at){const lt=it-at;lt!==0&&ve(ct,We,lt)}else ve(ct,We,it),ve(ht,We,1)}et.notify!==!1&&((Je=x.onHeightRecorded)==null||Je.call(x))})(Se,Pe,xt(tt({},Ue),{notify:!0}))},removeNodeHeight:function(Se,Pe={}){var Ue;const We=De(Se);return We&&Pe.notify!==!1&&((Ue=x.onHeightRecorded)==null||Ue.call(x)),We},removeNodeHeights:function(Se,Pe={}){var Ue;let We=0;for(const it of Se)De(Number(it))&&We++;return We>0&&Pe.notify!==!1&&((Ue=x.onHeightRecorded)==null||Ue.call(x)),We},exportHeightCache:function(){return Object.entries(B).map(([Se,Pe])=>({index:Number(Se),height:Number(Pe)})).filter(Se=>Number.isFinite(Se.index)&&Se.index>=0&&Number.isFinite(Se.height)&&Se.height>0).sort((Se,Pe)=>Se.index-Pe.index)},importHeightCache:function(Se,Pe={}){var Ue;if(!Array.isArray(Se))return;const We=K.value;let it=!1;if(Pe.mode!=="merge"){const et=Object.keys(B);if(et.length>0){for(const Je of et)delete B[Number(Je)];it=!0}}for(const et of Se){const Je=Number(et.index),at=Number(et.height);if(!Number.isInteger(Je)||Je<0||We>0&&Je>=We||!Number.isFinite(at)||at<=0)continue;const ct=B[Je];ct&&Math.abs(ct-at)<=1||(B[Je]=at,it=!0)}it&&((function(){let et=0,Je=0;const at=K.value;for(const[ct,ht]of Object.entries(B)){const lt=Number(ct),kt=Number(ht);!Number.isFinite(lt)||lt<0||at>0&&lt>=at||!Number.isFinite(kt)||kt<=0?delete B[lt]:(et+=kt,Je++)}j.total=et,j.count=Je})(),We>0&&we(We),(Ue=x.onHeightRecorded)==null||Ue.call(x))},fenwickRangeSum:function(Se,Pe,Ue){if(Ue<=Pe)return 0;const We=Ne(Se,Ue-1);return Pe<=0?We:We-Ne(Se,Pe-1)}}})({onHeightRecorded:()=>{lo(),wt.value&&Wa(),oi.value&&be(),us.value&&yl(),tn("node-resize")}});function ku(){F3(),cs.clear()}function Zv(x){!Number.isInteger(x)||x<0||x>=Ke.value.length||cs.set(x,Ia(x))}function Jv(x,B,j={}){const K=oo[x];W3(x,B,j);const ne=oo[x];ne&&ne>0?Zv(x):K&&cs.delete(x)}function Qv(x,B){const j=Ge("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,ne;return(ne=(K=rn.get(x))==null?void 0:K.offsetHeight)!=null?ne:0});return j>0?j:Ge("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function e0(x,B={}){j3(x,B),_p()}const Ni=U(()=>{var x;return!$e.value&&k.deferNodesUntilVisible!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&!gt.value&&!(Ke.value.length>900)&&ye.value}),t0=U(()=>!!Le&&(Ni.value||gt.value)),n0=U(()=>gt.value||wt.value),{liveNodeBufferResolved:Ta,focusIndex:ro,liveRange:qn,updateLiveRange:xr}=(function(x,B){const{parsedNodeCount:j,virtualizationEnabled:K,maxLiveNodesResolved:ne,clamp:pe}=B,ge=U(()=>{var we;return Math.max(0,(we=x.liveNodeBuffer)!=null?we:60)}),ve=ie(0),Ne=qs({start:0,end:0});return{liveNodeBufferResolved:ge,focusIndex:ve,liveRange:Ne,updateLiveRange:function(){const we=j.value;if(!K.value||we===0)return Ne.start=0,void(Ne.end=we);const De=Math.min(ne.value,we),Oe=ge.value,Se=pe(ve.value-Oe,0,Math.max(0,we-De));Ne.start=Se,Ne.end=Math.min(we,Se+De)}}})(k,{parsedNodeCount:Os,virtualizationEnabled:gt,maxLiveNodesResolved:Un,clamp:jn}),Fo=new Map,Tr=new Map,Li=new Map,bu=[],ii=new Map,Ri=new Set,s0=ie(0);let Gh=!1;const o0=U(()=>(s0.value,Ri.size)),Fs=new Map,Ho=new Map,i0=ie(0),Yh=U(()=>{i0.value;let x=0;for(const B of Fs.values())x+=Math.max(0,B);return x});let Hs=null,Xh=!0,r0=[0],l0="";function lo(){Xh=!0}const _u=U(()=>{if(!gt.value)return Ke.value.length;const x=Ta.value,B=Math.max(qn.end+x,xe.value),j=Math.min(Ke.value.length,B);return Math.max(st.value,j)});function wu(){Gh||(Gh=!0,queueMicrotask(()=>{Gh=!1,s0.value+=1}))}function a0(x,B,j="node-resize"){if(!me||typeof window>"u")return null;const K=window.setTimeout(()=>{Ri.delete(K)&&wu();try{B()}finally{tn(j)}},Math.max(0,x));return Ri.add(K),wu(),K}function Su(x){me&&x!=null&&(Ri.delete(x)&&wu(),window.clearTimeout(x))}function c0(){if(me&&typeof window<"u")for(const x of Ri)window.clearTimeout(x);Ri.size&&(Ri.clear(),wu()),bu.length=0,Li.clear()}function z3(x){var B,j;return(j=(B=Fn.value)==null?void 0:B[x])!=null?j:null}const{cancelScheduledFocusSync:Zh,scheduleFocusSync:Wo}=(function(x){const{isClient:B,containerRef:j,virtualizationEnabled:K,requestFrame:ne,cancelFrame:pe,syncFocusToScroll:ge}=x;let ve=null;function Ne(){var De,Oe,Se;return(Se=(Oe=(De=j.value)==null?void 0:De.ownerDocument)==null?void 0:Oe.defaultView)!=null?Se:typeof window<"u"?window:null}function we(){if(!ve)return;const De=Ne();ve.viaTimeout?De?De.clearTimeout(ve.id):clearTimeout(ve.id):pe?.(ve.id),ve=null}return{cancelScheduledFocusSync:we,scheduleFocusSync:function(De={}){if(!K.value)return;if(!B)return void ge(!0);if(De.immediate)return we(),void ge(!0);if(ve)return;const Oe=()=>{ve=null,ge()};if(ne)return void(ve={id:ne(Oe),viaTimeout:!1});const Se=Ne();ve={id:Se?Se.setTimeout(Oe,16):setTimeout(Oe,16),viaTimeout:!0}}}})({isClient:me,containerRef:M,virtualizationEnabled:gt,requestFrame:St,cancelFrame:At,syncFocusToScroll:function(x=!1){var B;if(!gt.value)return;const j=Sr.value||Ae();if(!j)return;const K=j.ownerDocument||((B=M.value)==null?void 0:B.ownerDocument)||document,ne=K?.defaultView||(typeof window<"u"?window:null),pe=j===K?.documentElement||j===K?.body,ge=Ke.value.length;if(!pe&&ge>0&&G(j)){const Ue=Ge("syncFocusToScroll.clientHeight",()=>j.clientHeight||0),We=Ge("syncFocusToScroll.scrollTop",()=>j.scrollTop),it=We<0?-We:We,et=(function(at){var ct,ht;const lt=Ke.value;if(!lt.length)return 0;if(at<=0)return Math.max(0,lt.length-1);if(Qt.value){const bt=(ct=np()[lt.length])!=null?ct:0;return v0(Math.max(0,bt-at))}if(xa.value===lt.length){const bt=Pi(0,lt.length);return Ip(Math.max(0,bt-at))}let kt=at;for(let bt=lt.length-1;bt>=0;bt--){const Ot=(ht=oo[bt])!=null?ht:Bo.value;if(kt<=Ot)return bt;kt-=Ot}return 0})(Math.max(0,it)+.5*Math.max(0,Ue)),Je=jn(et,0,Math.max(0,ge-1));return void((x||Math.abs(Je-ro.value)>1)&&(ro.value=Je,xr()))}const ve=pe?null:Ge("syncFocusToScroll.root.getBoundingClientRect",()=>j.getBoundingClientRect()),Ne=pe?0:ve.top,we=pe?Ge("syncFocusToScroll.viewport.clientHeight",()=>{var Ue,We;return(We=(Ue=ne?.innerHeight)!=null?Ue:j.clientHeight)!=null?We:0}):ve.bottom,De=jh.value;let Oe=null,Se=null;for(const[Ue,We]of De){if(!We)continue;const it=Ge("syncFocusToScroll.slot.getBoundingClientRect",()=>We.getBoundingClientRect());it.bottom<=Ne||it.top>=we||(Oe==null&&(Oe=Ue),Se=Ue)}if(Oe==null||Se==null){const Ue=M.value;if(!Ue)return;const We=pe?{top:0}:Ge("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>j.getBoundingClientRect()),it=Ge("syncFocusToScroll.fallback.scrollTop",()=>oe(j,K,pe)),et=pe?(()=>{const ct=Ge("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Ue.getBoundingClientRect()),ht=(pe?0:We.top)-ct.top;return Math.max(0,ht)})():(()=>{const ct=J(Ue,j);return Math.max(0,it-ct)})(),Je=pe?Ge("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var ct,ht,lt,kt;return(kt=(lt=(ht=ne?.innerHeight)!=null?ht:(ct=K?.documentElement)==null?void 0:ct.clientHeight)!=null?lt:j.clientHeight)!=null?kt:0}):Ge("syncFocusToScroll.fallback.root.clientHeight",()=>j.clientHeight),at=Ip(et+.5*Math.max(0,Je));return ro.value=jn(at,0,Math.max(0,Ke.value.length-1)),void xr()}const Pe=Math.round((Oe+Se)/2);!x&&Math.abs(Pe-ro.value)<=1||(ro.value=jn(Pe,0,Math.max(0,Ke.value.length-1)),xr())}}),{visibleNodeIndices:Jh,nodeVisibilityHandles:dl,nodeVisibilityWatchStops:Cu,nodeVisibilityFallbackTimers:u0,clearVisibilityFallback:xu,markNodeVisible:Oi,cleanupNodeVisibility:V3,destroyNodeVisibilityState:Qh}=PH({isClient:me,shouldTrackVisibleNodeIndices:()=>Ni.value,shouldCleanupNodeVisibility:()=>gt.value,onNodeMarkedVisible:x=>{gt.value?Wo():ro.value=jn(x,0,Math.max(0,Ke.value.length-1))},onNodeVisibilityCleaned:x=>{rn.delete(x)&&F0()}}),{cleanupScrollListener:d0,setupScrollListener:K3}=(function(x){const{isClient:B,virtualizationEnabled:j,listenerEnabled:K,scrollRootElement:ne,resolveScrollContainer:pe,scheduleFocusSync:ge,onScroll:ve}=x;let Ne=null,we=null;function De(){Ne&&(Ne(),Ne=null),we=null,ne.value=null}function Oe(Se){const Pe=x.getScrollTop?x.getScrollTop(Se):Se.scrollTop;return Math.max(0,Number.isFinite(Pe)?Math.abs(Pe):0)}return{cleanupScrollListener:De,setupScrollListener:function(){if(!B)return;if(!((Se=K?.value)!=null?Se:j.value))return void De();var Se;const Pe=pe();if(!Pe)return void De();if(ne.value===Pe&&Ne)return;De(),we=Oe(Pe);const Ue=()=>{if(ve?.(),j.value){const We=(function(it){const et=Oe(it),Je=we;we=et;const at=Math.max(480,.75*(it.clientHeight||0));return Je==null?et>at?{immediate:!0}:void 0:Math.abs(et-Je)>at?{immediate:!0}:void 0})(Pe);We?ge(We):ge()}};Pe.addEventListener("scroll",Ue,{passive:!0}),ne.value=Pe,Ne=()=>{Pe.removeEventListener("scroll",Ue)}}}})({isClient:me,virtualizationEnabled:gt,listenerEnabled:n0,scrollRootElement:Sr,resolveScrollContainer:Ae,scheduleFocusSync:Wo,onScroll:function(){const x=us.value;if(!x)return;const B=Ea();if(!B||(function(K){if(Oa()>=wa)return Cr=null,!1;const ne=Cr;if(ne==null)return!0;const pe=Math.abs(K.scrollTop-ne)<=2;return pe||(Cr=null),pe})(B))return;const j=T0(B);j!=null?(j<-32||Math.abs(Math.max(0,j)-Math.max(0,x.distanceFromBottomPx))>32)&&vl("restore"):vl("restore")},getScrollTop:x=>{var B;const j=x.ownerDocument||((B=M.value)==null?void 0:B.ownerDocument)||document,K=x===j.documentElement||x===j.body||x===j.scrollingElement;return Ge("scrollListener.getScrollTop",()=>oe(x,j,K))}});function jn(x,B,j){return Math.min(Math.max(x,B),j)}function ep(x){return x?.firstElementChild}function f0(x,B){var j;return x?(j=x.matches)!=null&&j.call(x,B)?x:x.querySelector(B):null}function h0(){if(!Qt.value)return void(V.value=0);const x=Ge("updateExperimentContainerWidth.clientWidth",()=>{var B,j;return(j=(B=M.value)==null?void 0:B.clientWidth)!=null?j:0});V.value=x>0?x:0}let Aa=null;function tp(){Aa?.disconnect(),Aa=null}const p0=Xo({loader:()=>fn(null,null,function*(){return(yield js(()=>import("./index8-Dv0bVWi6.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:cT,delay:0,suspensible:!1});function m0(x){return x===p0}const g0=U(()=>l.value==="pre"?mo:l.value==="shiki"?p0:Im),Ar=U(()=>{const x=Ke.value;if(!x.length||!Qt.value)return x.map(()=>null);const B=V.value||Ge("estimatedNodeHeights.clientWidth",()=>{var j;return((j=M.value)==null?void 0:j.clientWidth)||0});return!Number.isFinite(B)||B<=0?x.map(()=>null):x.map((j,K)=>{const ne=oo[K],pe=typeof ne=="number"&&ne>0;if(no.value&&!pe){const ve=mT(j,B,z.value);if(ve)return ve}if(ws.value&&j.type==="code_block"){const ve=(function(Ne){if(Ne.type!=="code_block")return null;const we=K0(Ne,Lu(Ne));return m0(we)?"markdown":we===mo?"pre":we===g0.value||we===Im?"monaco":null})(j);if(ve==="monaco"||ve==="markdown"||ve==="pre")return(function(Ne,we){var De;if(!Ne||Ne.type!=="code_block")return null;const Oe=we.rendererKind,Se=we.showHeader!==!1,Pe=(function(Je){var at,ct,ht,lt;return Je.diff?Math.max(hd(String((at=Je.originalCode)!=null?at:"")),hd(String((ct=Je.updatedCode)!=null?ct:"")),hd(String((ht=Je.code)!=null?ht:""))):hd(String((lt=Je.code)!=null?lt:""))})(Ne),Ue=!!Ne.diff;let We=0,it=500;if(Oe==="monaco"){const Je=(De=we.monacoOptions)!=null?De:{},at=(function(ht,lt){const kt=typeof ht?.fontSize=="number"&&ht.fontSize>0?ht.fontSize:lt?13:12;return typeof ht?.lineHeight=="number"&&ht.lineHeight>0?ht.lineHeight:lt?30:Math.round(1.5*kt)})(Je,Ue),ct=(function(ht,lt){var kt,bt;if(!lt)return 0;const Ot=typeof((kt=ht?.padding)==null?void 0:kt.top)=="number"?ht.padding.top:10,ds=typeof((bt=ht?.padding)==null?void 0:bt.bottom)=="number"?ht.padding.bottom:22;return Math.max(0,Ot)+Math.max(0,ds)})(Je,Ue);it=typeof Je.MAX_HEIGHT=="number"&&Je.MAX_HEIGHT>0?Je.MAX_HEIGHT:500,We=Math.round(Ue?Pe*at+ct:Pe*(at+1.5))}else Oe==="markdown"?We=Math.round(21*Pe+32):(We=Math.round(21*Pe+32),it=Number.POSITIVE_INFINITY);const et=Math.max(1,Math.min(We,it));return{kind:"code-block",height:Math.round(et+(Se?40:0)),contentHeight:et,rendererKind:Oe}})(j,{rendererKind:ve,monacoOptions:s.codeBlockMonacoOptions,showHeader:((ge=s.codeBlockProps)==null?void 0:ge.showHeader)!==!1})}var ge;return null})});function Tu(x){var B;const j=oo[x];if(Number.isFinite(j)&&j>0)return j;const K=(B=Ar.value[x])==null?void 0:B.height;return Number.isFinite(K)&&K>0?K:Math.max(Bo.value,(function(ne){var pe,ge,ve,Ne,we,De,Oe,Se,Pe,Ue,We,it,et;const Je=Ke.value[ne];if(!Je||typeof Je!="object")return 32;const at=String((pe=Je.type)!=null?pe:""),ct=En()||640;switch(at){case"heading":return 44;case"paragraph":return fl(String((ve=(ge=Je.raw)!=null?ge:Je.content)!=null?ve:""),ct,34);case"list":{const ht=Array.isArray(Je.items)?Je.items.length:1;return Math.max(48,30*ht+12)}case"list_item":return fl(String((we=(Ne=Je.raw)!=null?Ne:Je.content)!=null?we:""),ct,34);case"blockquote":return fl(String((Oe=(De=Je.raw)!=null?De:Je.content)!=null?Oe:""),ct,56);case"table":{const ht=Array.isArray(Je.rows)?Je.rows.length:Array.isArray(Je.children)?Je.children.length:3;return Math.max(120,38*ht+48)}case"code_block":return fl(String((Pe=(Se=Je.code)!=null?Se:Je.raw)!=null?Pe:""),ct,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return fl(String((We=(Ue=Je.raw)!=null?Ue:Je.content)!=null?We:""),ct,96);case"thematic_break":return 24;default:return fl(String((et=(it=Je.raw)!=null?it:Je.content)!=null?et:""),ct,40)}})(x))}function fl(x,B,j,K=22){const ne=String(x??"");if(!ne)return j;const pe=Math.max(18,Math.floor(Math.max(320,B)/8)),ge=ne.split(/\r?\n/).length,ve=Math.ceil(ne.length/pe),Ne=Math.max(1,ge,ve);return Math.max(j,Math.ceil(Ne*K+12))}function Ma(x){const B=Number(x);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function np(){var x,B;const j=Ke.value.length,K=Ma(V.value||Ge("getFallbackHeightPrefix.clientWidth",()=>{var ve;return((ve=M.value)==null?void 0:ve.clientWidth)||0})),ne=((x=s.virtualScroll)==null?void 0:x.measurementKey)==null?"":String(s.virtualScroll.measurementKey),pe=[j,io.count,Math.round(io.total),Math.round(100*Bo.value),ne,K,Qt.value?1:0,X_.value,W.value].join(":");if(!Xh&&l0===pe)return r0;const ge=new Array(j+1);ge[0]=0;for(let ve=0;ve<j;ve++)ge[ve+1]=ge[ve]+(Qt.value?Tu(ve):(B=oo[ve])!=null?B:Bo.value);return r0=ge,l0=pe,Xh=!1,ge}function v0(x){var B,j;const K=Ke.value.length;if(K<=0||x<=0)return 0;const ne=np();if(x>=((B=ne[K])!=null?B:0))return K-1;let pe=0,ge=K-1,ve=K-1;for(;pe<=ge;){const Ne=pe+ge>>1;((j=ne[Ne+1])!=null?j:0)>=x?(ve=Ne,ge=Ne-1):pe=Ne+1}return ve}function Pi(x,B){var j,K;if(x>=B)return 0;if(Qt.value)return(function(ge,ve){var Ne,we;const De=Ke.value.length,Oe=jn(Math.trunc(ge),0,De),Se=jn(Math.trunc(ve),Oe,De);if(Oe>=Se)return 0;const Pe=np();return((Ne=Pe[Se])!=null?Ne:0)-((we=Pe[Oe])!=null?we:0)})(x,B);if(xa.value!==Ke.value.length){let ge=0;for(let ve=x;ve<B;ve++)ge+=(j=oo[ve])!=null?j:Bo.value;return ge}const ne=Vh.value,pe=Kh.value;if(!ne.length||!pe.length){let ge=0;for(let ve=x;ve<B;ve++)ge+=(K=oo[ve])!=null?K:Bo.value;return ge}return yu(ne,x,B)+(B-x-yu(pe,x,B))*Bo.value}Ve(()=>Ke.value.length,x=>{lo(),x<=0?ku():(x<xa.value&&H3(x),x!==xa.value&&vu(x))},{immediate:!0});const G3=U(()=>{if(!gt.value)return Ke.value.map((K,ne)=>({node:K,index:ne}));const x=Ke.value.length,B=jn(qn.start,0,x),j=jn(qn.end,B,x);return Ke.value.slice(B,j).map((K,ne)=>({node:K,index:B+ne}))}),sp=U(()=>gt.value?Pi(0,Math.min(qn.start,Ke.value.length)):0),op=U(()=>{if(!gt.value)return 0;const x=Ke.value.length;return Pi(Math.min(qn.end,x),x)});function y0(){if(!Qt.value)return 0;let x=0;const B=Ar.value;for(let j=0;j<B.length;j++){if(!B[j])continue;const K=oo[j];Number.isFinite(K)&&K>0||x++}return x}function k0(){const x=Ke.value.length;return{totalNodes:x,measuredCount:io.count,estimatedCount:y0(),averageNodeHeight:Bo.value,topSpacerHeight:sp.value,bottomSpacerHeight:op.value,estimatedTotalHeight:Pi(0,x),width:Mr()}}function Y3(){const x=Ke.value,B=k0();return xt(tt({},B),{probe:{paragraphReady:!!z.value.paragraph,listItemReady:!!z.value.listItem,listWrapperOverhead:z.value.listWrapperOverhead,headingReadyLevels:Object.entries(z.value.headings).filter(([,j])=>!!j).map(([j])=>Number(j))},nodes:x.map((j,K)=>{var ne,pe,ge,ve,Ne,we,De,Oe,Se;return{index:K,type:j.type,estimateKind:(pe=(ne=Ar.value[K])==null?void 0:ne.kind)!=null?pe:null,rendererKind:(ve=(ge=Ar.value[K])==null?void 0:ge.rendererKind)!=null?ve:null,estimatedHeight:(we=(Ne=Ar.value[K])==null?void 0:Ne.height)!=null?we:null,estimatedContentHeight:(Oe=(De=Ar.value[K])==null?void 0:De.contentHeight)!=null?Oe:null,measuredHeight:(Se=oo[K])!=null?Se:null}})})}function ip(){return s.indexKey!=null?String(s.indexKey):Wn.value?`virtual-${ln()}`:"markdown-renderer"}function b0(x){const B=String(x),j=`${ip()}-`;if(!B.startsWith(j))return null;const K=B.slice(j.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const ne=Number(K[1]);return!Number.isInteger(ne)||ne<0||ne>=Ke.value.length?null:ne}function ln(){var x,B,j;const K=(x=s.virtualScroll)==null?void 0:x.sessionKey;return String(K!=null&&K!==""?K:(j=(B=s.indexKey)!=null?B:s.customId)!=null?j:ft)}function In(){var x;const B=(x=s.virtualScroll)==null?void 0:x.threadKey;return B==null||B===""?void 0:String(B)}function rp(x){var B;return(x??"")===((B=In())!=null?B:"")}function X3(){var x;const B=(x=s.virtualScroll)==null?void 0:x.measurementKey;return B==null?"":String(B)}function Z3(){const x=l.value,B=x==="monaco"?s.codeBlockMonacoOptions:void 0,j=s.codeBlockProps;return[s.isDark?"dark":"light",x==="monaco"?"code-rich":x==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",On(s.codeBlockMinWidth),On(s.codeBlockMaxWidth),On(B?.fontSize),On(B?.lineHeight),On(B?.fontFamily),On(B?.tabSize),On(B?.MAX_HEIGHT),On(B?.wordWrap),On(B?.wrappingIndent),On(B?.padding),On(j?.showHeader),On(j?.showCopyButton),On(j?.showExpandButton),On(j?.showPreviewButton),On(j?.showCollapseButton),On(j?.showFontSizeButtons)].join("\0")}function ri(){return[X3(),Z3()].join("\0")}function Mr(){return En()}const Au=U(()=>Ma(Mr())),Ws=U(()=>[ri(),Au.value].join("\0")),J3=U(()=>{var x;return Wn.value?["virtual",(x=In())!=null?x:"",ln(),Ws.value].join("\0"):s.indexKey});function hl(){i0.value+=1}function lp(x){return!(!x||!Number.isInteger(x.index)||x.index<0||x.index>=Ke.value.length||x.sessionKey!==ln()||x.threadKey!==In()||x.layoutEpochKey!==Ws.value)}function _0(x){const B=String(x),j=Ho.get(B);return j?lp(j)?j.index:null:b0(B)}function w0(x="async-node"){(Fs.size||Ho.size)&&(Fs.clear(),Ho.clear(),hl(),tn(x))}const pl=Rt(Wg,null),ap={reportHeight(x,B){if(!wt.value)return;const j=_0(x);if(j==null)return;const K=Fo.get(j);if(!K)return;const ne=Number(B),pe=Qv(j,K);Jv(j,Number.isFinite(ne)&&ne>0?Math.max(ne,pe||0):pe)},markPending(x){if(!wt.value)return;const B=b0(x);B!=null&&(function(j,K){var ne;const pe=Ho.get(j);if(pe&&lp(pe))return Fs.set(j,Math.max(0,(ne=Fs.get(j))!=null?ne:0)+1),hl(),void tn("async-node");Fs.set(j,1),Ho.set(j,(function(ge){return{index:ge,sessionKey:ln(),threadKey:In(),layoutEpochKey:Ws.value}})(K)),hl(),tn("async-node")})(String(x),B)},markSettled(x){if(!wt.value)return;const B=String(x),j=_0(x);(j!=null||(function(K){return Fs.has(String(K))})(B))&&(function(K){var ne;const pe=(ne=Fs.get(K))!=null?ne:0;return!(pe<=0||(pe<=1?(Fs.delete(K),Ho.delete(K)):Fs.set(K,pe-1),hl(),pe===1&&tn("async-node"),0))})(B)&&j!=null&&li()}};function Q3(){let x=0;for(const B of Fo.values())x+=Ge("getVisibleDomHeight.offsetHeight",()=>{var j;return(j=B?.offsetHeight)!=null?j:0});return Math.ceil(Math.max(0,x))}an(Wg,{reportHeight(x,B){ap.reportHeight(x,B),pl?.reportHeight(x,B)},markPending(x){ap.markPending(x),pl?.markPending(x)},markSettled(x){ap.markSettled(x),pl?.markSettled(x)}});let cp,up=null,ml=null;function Mu(x){return x!==!1&&x!=null&&x!==""}function S0(){return gt.value?(function(){if(!gt.value)return!0;const x=Ke.value.length,B=jn(qn.start,0,x),j=jn(qn.end,B,x);if(B>=j)return!0;for(let K=B;K<j;K++)if(!rn.has(K)||$p(K)&&!Fo.has(K))return!1;return!0})():st.value>=_u.value}function dp(){return le.value===!0&&!re.value&&Yh.value===0&&Ri.size===0&&ii.size===0&&Hs==null&&S0()}function C0(){var x,B;if(((x=s.virtualScroll)==null?void 0:x.settleMode)!=="manual"||up===ln()&&cp===In())return!0;const j=(B=s.virtualScroll)==null?void 0:B.settledToken;return!!Mu(j)&&ml===Ua(j)}function fp(){return dp()&&C0()}function eA(x,B){return B.totalNodes<=0?x==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?x==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function Er(x="manual",B){const j=k0(),K=(function(ne){return ne||(le.value!==!0?Ke.value.length>0?"streaming":"estimating":!S0()||ii.size>0||Hs!=null?"measuring":fp()?"settled":"settling")})(B);return{sessionKey:ln(),threadKey:In(),phase:K,nodeCount:j.totalNodes,liveRange:{start:qn.start,end:qn.end},renderedCount:st.value,measuredCount:j.measuredCount,estimatedCount:j.estimatedCount,averageNodeHeight:j.averageNodeHeight,topSpacerHeight:j.topSpacerHeight,bottomSpacerHeight:j.bottomSpacerHeight,visibleDomHeight:Q3(),totalHeight:x0(),width:j.width,final:le.value===!0,stable:fp(),confidence:eA(K,j),reason:x}}function Ea(){const x=Sr.value||Ae(),B=M.value;if(!x||!B)return null;const j=x.ownerDocument||B.ownerDocument||document,K=x===j.documentElement||x===j.body||x===j.scrollingElement,ne=Ge("getScrollBox.scrollTop",()=>oe(x,j,K)),pe=Ge("getScrollBox.scrollHeight",()=>{var ve,Ne,we,De,Oe;return K?Math.max((Ne=(ve=j.documentElement)==null?void 0:ve.scrollHeight)!=null?Ne:0,(De=(we=j.body)==null?void 0:we.scrollHeight)!=null?De:0,(Oe=x.scrollHeight)!=null?Oe:0):x.scrollHeight}),ge=Ge("getScrollBox.clientHeight",()=>{var ve;return K?((ve=j.documentElement)==null?void 0:ve.clientHeight)||x.clientHeight||0:x.clientHeight});return{root:x,doc:j,isViewportRoot:K,scrollTop:ne,scrollHeight:pe,clientHeight:ge}}function x0(){const x=Ke.value.length,B=Math.max(0,Pi(0,x)),j=Ge("getRendererLogicalHeight.offsetHeight",()=>{var ne,pe;return(pe=(ne=M.value)==null?void 0:ne.offsetHeight)!=null?pe:0}),K=Math.max(0,j>0?j:Ge("getRendererLogicalHeight.scrollHeight",()=>{var ne,pe;return(pe=(ne=M.value)==null?void 0:ne.scrollHeight)!=null?pe:0}));return x<=0?Math.ceil(j):gt.value?B>0?Math.max(1,Math.ceil(B),(function(){let ne=sp.value+op.value;for(const pe of rn.values())pe&&(ne+=Math.max(0,Ge("getVirtualizedDomLogicalHeight.offsetHeight",()=>pe.offsetHeight||0)));return Math.ceil(Math.max(0,ne))})(),(function(ne,pe){return ne<=0||pe<=0?0:pe<=ne+Math.max(512,.05*ne)?Math.ceil(pe):0})(B,K)):Math.max(1,Math.ceil(K)):wt.value?B>0||io.count>0||y0()>0?(qe.value&&st.value,Math.max(1,Math.ceil(K),Math.ceil(B))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(B))}function T0(x){const B=M.value;if(!B)return null;const j=Ge("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(ne){return ne.isViewportRoot?ne.clientHeight:Ge("getViewportBottomInRoot.getBoundingClientRect",()=>ne.root.getBoundingClientRect().bottom)})(x)-j.bottom}function tA(x={}){const B=x.requireViewport!==!1,j=(function(pe=64){const ge=Ea(),ve=M.value;if(!ge||!ve)return!1;const Ne=(function(De){if(De.isViewportRoot)return{top:0,bottom:De.clientHeight};const Oe=Ge("getVirtualViewportRect.getBoundingClientRect",()=>De.root.getBoundingClientRect());return{top:Oe.top,bottom:Oe.bottom}})(ge),we=Ge("isRendererNearVirtualViewport.getBoundingClientRect",()=>ve.getBoundingClientRect());return we.bottom>=Ne.top-pe&&we.top<=Ne.bottom+pe})();if(B&&!j)return null;const K=(function(){const pe=Ea(),ge=M.value;if(!pe||!ge||Math.max(0,pe.scrollHeight-pe.scrollTop-pe.clientHeight)>64)return null;const ve=T0(pe);return ve==null?null:ve>=-8&&ve<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,ve)}:null})();if(K)return{anchor:K,captured:!0};const ne=It();if(ne)return{anchor:{type:"node",nodeIndex:ne.nodeIndex,offsetWithinNodePx:ne.offsetWithinNodePx},captured:j};if(x.allowFallback===!0){const pe=(function(){const ge=Ke.value.length;return ge<=0?null:{type:"node",nodeIndex:jn(ro.value,0,Math.max(0,ge-1)),offsetWithinNodePx:0}})();return pe?{anchor:pe,captured:!1}:null}return null}function hp(x){let B=2166136261;for(let j=0;j<x.length;j++)B^=x.charCodeAt(j),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function nA(x,B){let j=x;for(let K=0;K<B.length;K++)j^=B.charCodeAt(K),j=Math.imul(j,16777619);return j^=31,j=Math.imul(j,16777619),j}const sA=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Eu(x,B=new WeakSet,j=0){if(x==null||typeof x=="number"||typeof x=="boolean")return String(x);if(typeof x=="string")return`s:${(function(K){const ne=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${hp(ne)}`})(x)}`;if(typeof x=="function")return"fn";if(typeof x!="object")return typeof x;if(B.has(x))return"cycle";if(j>=6)return"max-depth";B.add(x);try{if(Array.isArray(x)){if(x.length<=160){const we=[];for(let De=0;De<x.length;De++)we.push(Eu(x[De],B,j+1));return`a:${x.length}:${we.join(",")}`}const pe=[],ge=[],ve=Math.max(0,x.length-32);let Ne=2166136261;for(let we=0;we<x.length;we++){const De=Eu(x[we],B,j+1);Ne=nA(Ne,De),we<32&&pe.push(De),we>=ve&&ge.push(De)}return[`a:${x.length}`,`h=${pe.join(",")}`,`t=${ge.join(",")}`,`all=${(Ne>>>0).toString(36)}`].join(":")}const K=x,ne=Object.keys(K).filter(pe=>{const ge=K[pe];return pe!=="parent"&&pe!=="el"&&pe!=="component"&&(ge==null||typeof ge=="string"||typeof ge=="number"||typeof ge=="boolean"||sA.has(pe))}).sort();return`o:${ne.length}:${ne.map(pe=>`${pe}=${Eu(K[pe],B,j+1)}`).join(";")}`}finally{B.delete(x)}}let A0=-1,pp="";function Ia(x){const B=Ke.value[x];return B?hp(Eu(B)):""}function mp(){const x=W.value;if(A0===x)return pp;let B=2166136261;for(let j=0;j<Ke.value.length;j++){const K=Ia(j);for(let ne=0;ne<K.length;ne++)B^=K.charCodeAt(ne),B=Math.imul(B,16777619)}return pp=(B>>>0).toString(36),A0=x,pp}function gl(x,B={}){var j;const K=B.includeHeightCache===!0,ne=(j=B.includeContentHash)!=null?j:K,pe=K?(function(ve){const Ne=(function(){var We,it;const et=Number((it=(We=s.virtualScroll)==null?void 0:We.heightCacheLimit)!=null?it:5e3);return!Number.isFinite(et)||et<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(et))})();if(!Number.isFinite(Ne)||ve.length<=Ne)return ve;const we=new Map,De=We=>{!We||we.size>=Ne||we.set(We.index,We)},Oe=Ke.value.length,Se=jn(qn.start-2*Ta.value,0,Oe),Pe=jn(qn.end+2*Ta.value,Se,Oe);for(const We of ve)We.index>=Se&&We.index<Pe&&De(We);const Ue=Math.max(1,Math.ceil(ve.length/Ne));for(let We=0;We<ve.length&&we.size<Ne;We+=Ue)De(ve[We]);for(let We=ve.length-1;We>=0&&we.size<Ne;We-=Ue)De(ve[We]);return Array.from(we.values()).sort((We,it)=>We.index-it.index).slice(0,Ne)})(q3().map(ve=>{var Ne;const we=Ke.value[ve.index];return we?xt(tt({},ve),{nodeType:String((Ne=we.type)!=null?Ne:""),signature:Ia(ve.index)}):null}).filter(ve=>!!ve)):[],ge=tA({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ge||pe.length||B.includeEmptyState===!0?xt(tt({sessionKey:x.sessionKey,threadKey:x.threadKey},ge?{anchor:ge.anchor,anchorCaptured:ge.captured}:{anchorCaptured:!1}),{metrics:x,width:x.width,contentHash:ne?mp():void 0,measurementKey:ri()||void 0,heightCache:pe.length?pe:void 0}):null}function gp(x){var B,j;const K=Ea();if(!K)return;const ne=(function(ve){const Ne=M.value;if(!Ne)return null;const we=J(Ne,ve.root),De=Ke.value.length,Oe=Ge("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Ne.offsetHeight||0),Se=Math.max(0,Oe>0?Oe:De>0?Ge("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Ne.scrollHeight||0):0),Pe=x0();return we+Math.max(Se,Pe)})(K);if(ne==null)return;const pe=Math.max(0,x.distanceFromBottomPx),ge=Math.max(0,ne-K.clientHeight-pe);(function(ve){wa=Oa()+120,Cr=ve})(ge),K.isViewportRoot?(j=(B=K.doc.defaultView)==null?void 0:B.scrollTo)==null||j.call(B,0,ge):Q_(K.root,K.doc,ge,{isReverseFlexScrollRoot:G,getNormalizedScrollTop:oe})}const vp=[];function M0(){if(me)for(si!=null&&(At?.(si),si=null);vp.length;){const x=vp.pop();x!=null&&window.clearTimeout(x)}}function vl(x){const B=!!us.value;us.value=null,wa=0,Cr=null,M0(),B&&x&&tn(x)}function yl(){if(!us.value||!me||si!=null)return;const x=()=>{si=null;const B=us.value;B&&gp(B)};si=St?St(x):null,si==null&&x()}function E0(x,B={}){const j=Ke.value.length;return j<=0?[]:x.filter(K=>!(!Number.isInteger(K.index)||K.index<0||K.index>=j)&&!(!Number.isFinite(K.height)||K.height<=0)&&!(B.requireSignature&&!K.signature)&&!(B.requireCompatibilityMetadata&&!K.nodeType&&!K.signature)&&(function(ne){var pe;const ge=Ke.value[ne.index];return!(!ge||ne.nodeType&&ne.nodeType!==String((pe=ge.type)!=null?pe:"")||ne.signature&&ne.signature!==Ia(ne.index))})(K))}function I0(x){const B=Ma(Mr()),j=Ma(x);return B!==-1&&j!==-1&&B===j}function yp(x){var B;const j=Number(x?.width);if(Number.isFinite(j)&&j>0)return j;const K=Number((B=x?.metrics)==null?void 0:B.width);return Number.isFinite(K)&&K>0?K:null}function $0(x){var B;return x.sessionKey===ln()&&!!rp(x.threadKey)&&((B=x.measurementKey)!=null?B:"")===ri()&&!!I0(yp(x))&&!!(function(j){const K=j.heightCache;return!!K?.length&&(N0(j)?K.some(ne=>!!(ne.nodeType||ne.signature)):K.some(ne=>!!ne.signature))})(x)}function N0(x){return!!(x.contentHash&&x.contentHash===mp())}function oA(x){return!N0(x)}let Ir=null,$r=null,Iu=null,$a=null,Na=null;function kp(x){var B;const j=x.map(ne=>{var pe,ge;return[ne.index,Math.round(10*ne.height),(pe=ne.nodeType)!=null?pe:"",(ge=ne.signature)!=null?ge:""].join("")}).join(""),K=Ma(Mr());return[(B=In())!=null?B:"",ln(),ri(),Ke.value.length,K,x.length,hp(j)].join(":")}function L0(x=(B=>(B=s.virtualScroll)==null?void 0:B.heightCache)()){if(!wt.value||!x?.length||Ke.value.length<=0||!I0((B=s.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const j=E0(x,{requireSignature:!0});if(!j.length)return!1;const K=kp(j);return K===Ir?($r="standalone",!0):(e0(j,{mode:"merge"}),lo(),Ir=K,$r="standalone",Da(),tn("restore"),!0)}function bp(x,B={}){var j,K,ne;if(!wt.value||!x||x.sessionKey!==ln()||!rp(x.threadKey)||Ke.value.length<=0)return!1;const pe=!!((j=x.heightCache)!=null&&j.length)&&!$u(),ge=!x.anchor||x.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:x.anchor,ve=B.restoreAnchor===!0&&!!ge&&!$u()&&Number(yp(x))>0;let Ne=!1;if((K=x.heightCache)!=null&&K.length&&$0(x)){const De=E0(x.heightCache,{requireCompatibilityMetadata:!x.contentHash,requireSignature:oA(x)});De.length&&(e0(De,{mode:"merge"}),lo(),Ir=kp(De),$r="restore",Da(),Ne=!0)}if(pe||ve)return!1;if(!B.restoreAnchor||!ge)return Ne&&tn("restore"),!0;const we=(function(De,Oe){var Se;const Pe=De.anchor,Ue=Pe?Pe.type==="bottom"?`bottom:${Math.round(Pe.distanceFromBottomPx)}`:`node:${Pe.nodeIndex}:${Math.round(Pe.offsetWithinNodePx)}`:"none";return[(Se=In())!=null?Se:"",ln(),ri(),Au.value,Oe,Ue].join(":")})(x,(ne=B.restoreToken)!=null?ne:"imperative");return Iu===we?(Ne&&tn("restore"),!0):(Iu=we,(function(De){const Oe=()=>{if(De.type==="node")return vl(),void Ca({nodeIndex:De.nodeIndex,offsetWithinNodePx:De.offsetWithinNodePx});if(ce(),oi.value=null,us.value=De,M0(),gp(De),me)for(const Se of[0,120,280,480])vp.push(window.setTimeout(()=>{const Pe=us.value;Pe&&gp(Pe)},Se))};(function(Se){if(!gt.value)return!1;const Pe=Ke.value.length;return!(Pe<=0||(ro.value=Se.type==="node"?jn(Se.nodeIndex,0,Pe-1):Pe-1,xr(),0))})(De)?ut(Oe):Oe()})(ge),tn("restore"),!0)}function $u(){const x=Mr();return Number.isFinite(x)&&x>0}function R0(x){var B;return x.sessionKey===ln()&&!!rp(x.threadKey)&&(Ke.value.length<=0||!(!((B=x.heightCache)!=null&&B.length)||$u())||!(!(x.anchor&&Number(yp(x))>0)||$u()))}function _p(){cs.clear();for(const x of Object.keys(oo)){const B=Number(x);Number.isInteger(B)&&B>=0&&B<Ke.value.length&&Zv(B)}}function La(){Hs!=null&&(At?.(Hs),Hs=null),Np()}function O0(){return!me||dn?Promise.resolve():new Promise(x=>{let B=!1,j=null;const K=()=>{B||(B=!0,j!=null&&window.clearTimeout(j),x())};if(St)return St(K),void(j=window.setTimeout(K,50));j=window.setTimeout(K,0)})}function wp(x,B=In(),j=Ws.value){return ln()===x&&In()===B&&Ws.value===j}function Sp(){return fn(this,arguments,function*(x={}){var B,j,K,ne,pe;const ge=ln(),ve=In(),Ne=Ws.value,we=(B=x.frames)!=null?B:2,De=(j=x.timeoutMs)!=null?j:120,Oe=(K=x.reason)!=null?K:"manual",Se=x.expectedSettledTokenKey,Pe=x.flushPendingTimers===!0,Ue=Er(Oe),We=()=>xt(tt({},Ue),{phase:Ue.final?"settling":Ue.phase,stable:!1,confidence:Ue.confidence==="final"?"mixed":Ue.confidence,reason:Oe}),it=()=>wp(ge,ve,Ne)&&(Se==null||Pa()===Se);for(let ct=0;ct<we;ct++){if(yield ut(),!it()||(yield O0(),!it()))return We();li(),La()}if(yield(function(ct){return!me||ct<=0?Promise.resolve():new Promise(ht=>window.setTimeout(ht,ct))})(De),!it()||(Pe&&c0(),li(),La(),!it()))return We();const et=dp();et&&(up=ge,cp=ve,((ne=s.virtualScroll)==null?void 0:ne.settleMode)==="manual"&&Se!=null&&Mu((pe=s.virtualScroll)==null?void 0:pe.settledToken)&&Pa()===Se&&(ml=Ua(s.virtualScroll.settledToken)));const Je=it()&&et&&C0(),at=Er(Oe,Je?"final":void 0);return Mp(at,!0),at})}let Cp="content",Nr=null,Lr=null,xp=0,Ra=null,kl=null,Tp=null,Ap=null;function Oa(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function P0(x){var B,j;const K=Ra;if(!K)return!0;const ne=(j=(B=s.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?j:1;return Math.abs(x.totalHeight-K.totalHeight)>ne||x.sessionKey!==K.sessionKey||x.phase!==K.phase||x.stable!==K.stable||x.final!==K.final||x.threadKey!==K.threadKey||x.nodeCount!==K.nodeCount||x.measuredCount!==K.measuredCount||x.width!==K.width}function On(x){if(x==null)return"";if(typeof x=="string"||typeof x=="number"||typeof x=="boolean")return String(x);try{return JSON.stringify(x)}catch{return String(x)}}function Pa(x=(B=>(B=s.virtualScroll)==null?void 0:B.settledToken)()){return On(x)}function D0(x,B){var j,K;return[x,B.sessionKey,(j=B.threadKey)!=null?j:"",ri(),mp(),On((K=s.virtualScroll)==null?void 0:K.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function Da(){Tp=null,Ap=null,kl=null}function iA(x){const B=x.heightCache;return B?.length?kp(B):""}function Ba(x){var B,j,K;const ne=x.metrics,pe=x.anchor?(ge=x.anchor).type==="bottom"?`bottom:${Math.round(ge.distanceFromBottomPx)}`:`node:${ge.nodeIndex}:${Math.round(ge.offsetWithinNodePx)}`:"none";var ge;return[x.sessionKey,(B=x.threadKey)!=null?B:"",(j=x.measurementKey)!=null?j:ri(),(K=x.contentHash)!=null?K:"",iA(x),pe,x.anchorCaptured?1:0,ne.liveRange.start,ne.liveRange.end,ne.renderedCount,ne.nodeCount,Math.round(ne.totalHeight),Math.round(ne.width),ne.phase,ne.stable?1:0].join("\0")}function Mp(x,B=!1){if(!wt.value||(function(ge=!1){return!ge&&Wn.value&&!as.value})(B))return;const j=B||P0(x),K=(function(ge,ve=!1){return ve||ge.stable||ge.phase==="final"?{state:gl(ge,{includeHeightCache:!0})}:{state:gl(ge)}})(x,B),ne=K.state,pe=!!(ne&&(j||(function(ge,ve=!1){return!!ve||Ba(ge)!==kl})(ne,B)));if(j&&(T(x),Ra=x,xp=Oa()),ne&&pe&&(E(ne),ne.anchor&&C(ne.anchor),kl=Ba(ne)),x.stable){const ge=D0("settled",x);if(ge!==Tp){Tp=ge;const ve=gl(x,{includeHeightCache:!0});ve&&(E(ve),kl=Ba(ve)),(function(Ne){o("render-settled",Ne)})(x)}}if(x.phase==="final"){const ge=D0("final",x);if(ge!==Ap){Ap=ge;const ve=gl(x,{includeHeightCache:!0});ve&&(E(ve),kl=Ba(ve)),(function(Ne){o("render-final",Ne)})(x)}}}function Ep(){Nr!=null&&(At?.(Nr),Nr=null),Lr!=null&&me&&(window.clearTimeout(Lr),Lr=null)}function B0(){Nr=null,Lr=null,(function(x){if(ii.size>0||Hs!=null)return!0;switch(x){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Cp)&&(li(),La()),Mp(Er(Cp))}function tn(x){var B,j;if(!wt.value||(Cp=x,Nr!=null||Lr!=null))return;const K=Math.max(0,(j=(B=s.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?j:32),ne=Math.max(0,K-(Oa()-xp)),pe=()=>{Lr=null,Nr=St?St(B0):null,Nr==null&&B0()};me&&ne>0?Lr=window.setTimeout(pe,ne):pe()}function Ip(x){var B;if(x<=0)return 0;const j=Ke.value;if(Qt.value)return v0(x);if(xa.value===j.length&&Vh.value.length&&Kh.value.length){const ne=Bo.value,pe=Vh.value,ge=Kh.value,ve=Oe=>Oe<=0?0:yu(pe,0,Oe)+(Oe-yu(ge,0,Oe))*ne;let Ne=0,we=j.length-1,De=j.length-1;for(;Ne<=we;){const Oe=Ne+we>>1;ve(Oe+1)>=x?(De=Oe,we=Oe-1):Ne=Oe+1}return De}let K=x;for(let ne=0;ne<j.length;ne++){const pe=(B=oo[ne])!=null?B:Bo.value;if(K<=pe)return ne;K-=pe}return Math.max(0,j.length-1)}function F0(){mu.value+=1}function $p(x){return!(qe.value&&x>=st.value)&&(!Ni.value||x<xe.value||Jh.value.has(x))}function bl(x){const B=Cu.get(x);B&&(B(),Cu.delete(x));const j=dl.get(x);j&&(j.destroy(),dl.delete(x)),xu(x)}function H0(x,B){let j=!1;if(B){const pe=rn.get(x);rn.set(x,B),pe!==B&&(j=!0)}else rn.delete(x)&&(j=!0);if(j&&F0(),B||xu(x),!t0.value||!Le||!gt.value&&Ni.value&&!P.value&&dl.size>=640&&(P.value||(P.value=!0,Qh()),!t0.value||!Le))return bl(x),void(B&&Oi(x,!0));if(x<xe.value&&!gt.value||Jh.value.has(x))return bl(x),void Oi(x,!0);if(!B)return void bl(x);bl(x);const K=Le(B,{rootMargin:"400px"});if(!K)return;dl.set(x,K),Oi(x,K.isVisible.value),Ni.value&&(function(pe){if(!me||!Ni.value)return;xu(pe);const ge=pe%17*23,ve=window.setTimeout(()=>{if(u0.delete(pe),!Ni.value||Jh.value.has(pe))return;const Ne=rn.get(pe);if(!Ne)return;const we=Ae(Ne),De=Ne.ownerDocument||document,Oe=De.defaultView||window,Se=!we||we===De.documentElement||we===De.body,Pe=!Se&&we?Ge("nodeVisibilityFallback.root.getBoundingClientRect",()=>we.getBoundingClientRect()):null,Ue=Se?0:Pe.top,We=Se?Ge("nodeVisibilityFallback.clientHeight",()=>{var et,Je;return(Je=(et=Oe.innerHeight)!=null?et:we?.clientHeight)!=null?Je:0}):Pe.bottom,it=Ge("nodeVisibilityFallback.node.getBoundingClientRect",()=>Ne.getBoundingClientRect());it.bottom>=Ue-500&&it.top<=We+500&&Oi(pe,!0)},1800+ge);u0.set(pe,ve)})(x);let ne=null;ne=Ve(()=>K.isVisible.value,pe=>{if(pe){xu(x),Oi(x,!0),ne?.(),Cu.delete(x),dl.get(x)===K&&dl.delete(x);try{K.destroy()}catch{}}},{immediate:!0}),Cu.set(x,ne),gt.value&&Wo()}function Np(){Hs=null;for(const[x,B]of ii)ii.delete(x),Fo.get(x)===B.el&&Tr.get(x)===B.version&&Jv(x,B.height,{allowShrink:B.allowShrink})}function _l(){Hs!=null&&(At?.(Hs),Hs=null),ii.clear()}function Nu(x,B){(function(j,K,ne){var pe;if(!Number.isFinite(ne)||ne<=0||Fo.get(j)!==K)return;const ge=Tr.get(j);if(ge==null)return;const ve=Ke.value[j],Ne=re.value&&le.value!==!0&&!((pe=s.nodes)!=null&&pe.length)&&j>=Ke.value.length-2,we=!(ve?.loading===!0||Ne),De=ii.get(j),Oe=De?De.allowShrink&&we:we,Se=De&&!Oe?Math.max(De.height,ne):ne;ii.set(j,{height:Se,allowShrink:Oe,version:ge,el:K}),Hs==null&&(Hs=St?St(Np):null,Hs==null&&Np())})(x,B,Qv(x,B))}function li(){for(const[x,B]of Fo)B&&Nu(x,B)}function W0(){Do?.disconnect(),Do=null,Bs.clear()}function Lp(){for(;bu.length;)Su(bu.pop())}Ve(as,x=>{x&&tn("content")},{flush:"post"}),t({getVirtualMetrics:Er,captureVirtualState:function(x={}){var B;return gl(Er("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:x.allowFallbackAnchor===!0,requireViewport:x.requireViewport===!0,includeEmptyState:(B=x.includeEmptyState)==null||B})},restoreVirtualState:function(x,B={}){const j=B.restoreAnchor===!0,K=B.restoreToken==null?"imperative":String(B.restoreToken);$a=x,Na={restoreAnchor:j,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!bp(x,{restoreAnchor:j,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&R0(x)||($a=null,Na=null)},forceMeasure:function(x="manual"){return fn(this,null,function*(){yield ut(),yield O0(),li(),La(),yield ut();const B=Er(x);return Mp(B,!0),B})},settle:Sp,scrollToNode:function(x,B="start"){vl(),ce();const j=Ke.value.length;if(j<=0)return;const K=jn(x,0,j-1),ne=()=>{var pe;const ge=Fe({nodeIndex:K,offsetWithinNodePx:0}),ve=Tu(K),Ne=Ea(),we=(pe=Ne?.clientHeight)!=null?pe:0,De=Sa();let Oe=ge;if(B==="center")Oe=ge-we/2+ve/2;else if(B==="end")Oe=ge-we+ve;else if(B==="nearest"&&De!=null){if(ge>=De&&ge+ve<=De+we)return;Oe=ge<De?ge:ge-we+ve}zh(Math.max(0,Oe)),Wo({immediate:!0}),gt.value&&(ro.value=K,xr())};if(gt.value)return ro.value=K,xr(),void ut(ne);ne()}}),Ve(()=>Ie.value,x=>{if(!x){W0();for(const B of Li.values())for(const j of B)Su(j);Li.clear(),Tr.clear(),Lp(),_l()}},{immediate:!0}),Ve(le,x=>{x&&(function(){if(me&&le.value&&Fo.size){Lp();for(const B of[80,240,640]){const j=a0(B,()=>{for(const[K,ne]of Fo)ne&&Nu(K,ne)},"final");j!=null&&bu.push(j)}}})(),tn(x?"final":"content")}),Ve([()=>Ke.value.length,()=>st.value],()=>{us.value&&yl(),tn("content")},{flush:"post",immediate:!0}),Ve([()=>qn.start,()=>qn.end],()=>{tn("batch")},{flush:"post"});const{cleanupBatchScheduler:rA}=(function(x){const{props:B,isClient:j,isTestEnv:K,parsedNodesIdentity:ne,parsedNodeCount:pe,desiredRenderedCount:ge,datasetKey:ve,batchingEnabled:Ne,incrementalRenderingActive:we,resolvedBatchSize:De,resolvedInitialBatch:Oe,renderedCount:Se,adaptiveBatchSize:Pe,previousRenderContext:Ue,previousBatchConfig:We,requestFrame:it,cancelFrame:et,hasIdleCallback:Je,cleanupNodeVisibility:at,onDatasetKeyChanged:ct,onDatasetChanged:ht}=x;let lt=null,kt=null,bt=!1,Ot=null,ds=null,fs=0,xo=!1,Di=!1;const Bi=new Set,Or=new Set;function ey(){if(j){lt!=null&&(et?.(lt),lt=null),kt!=null&&(window.clearTimeout(kt),kt=null),ds!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(ds),ds=null),fs+=1;for(const Jn of Bi)et?.(Jn);Bi.clear();for(const Jn of Or)window.clearTimeout(Jn);Or.clear(),bt=!1,Ot=null,xo=!1,Di=!1}}function Fu(){return typeof performance<"u"?performance.now():Date.now()}function ty(Jn){(function(ai){var Fi;if(!we.value)return;const ci=Math.max(2,(Fi=B.renderBatchBudgetMs)!=null?Fi:6),ui=Math.max(1,De.value||1),To=Math.max(1,Math.floor(ui/4));ai>1.2*ci?Pe.value=Math.max(To,Math.floor(.7*Pe.value)):ai<.5*ci&&Pe.value<ui&&(Pe.value=Math.min(ui,Math.ceil(1.2*Pe.value)))})(Jn),xo=!1;const Ss=Di||Se.value<ge.value;Di=!1,Ss&&oy()}function ny(Jn,Ss={}){var ai,Fi;if(!we.value)return;const ci=ge.value;if(Se.value>=ci)return;const ui=Math.max(1,Jn),To=()=>{const Cl=Fu();let xl=0;lt=null,kt=null,ds=null,bt=!1;const Tl=Ot??ui;Ot=null;const Hp=Fu();Se.value=Math.min(ci,Se.value+Tl),at(Se.value),xl=Fu()-Hp,(function(Wp,iy){if(!j)return void ty(iy);xo=!0;const ry=++fs;ut().then(()=>{var ly;if(ry!==fs)return;const TA=Fu(),AA=Math.max(iy,TA-Wp),ay=()=>{ry===fs&&ty(AA)};if(it){let uy=!1,di=null;const dy=()=>{uy||(uy=!0,ay())},Hu=it(()=>{Bi.delete(Hu),di!=null&&(window.clearTimeout(di),Or.delete(di),di=null),dy()});return Bi.add(Hu),di=window.setTimeout(()=>{di!=null&&Or.delete(di),di=null,et?.(Hu),Bi.delete(Hu),dy()},Math.max(32,(ly=B.renderBatchIdleTimeoutMs)!=null?ly:120)),void Or.add(di)}const cy=window.setTimeout(()=>{Or.delete(cy),ay()},0);Or.add(cy)})})(Cl,xl)};if(!j||Ss.immediate)return void To();const Hi=Math.max(0,(ai=B.renderBatchDelay)!=null?ai:16);if(Ot=Ot!=null?Math.max(Ot,ui):ui,!bt){if(bt=!0,!K&&Je&&window.requestIdleCallback){const Cl=Math.max(0,(Fi=B.renderBatchIdleTimeoutMs)!=null?Fi:120);return void(ds=window.requestIdleCallback(()=>To(),{timeout:Cl}))}it&&!K?lt=it(()=>{Hi!==0?kt=window.setTimeout(()=>To(),Hi):To()}):kt=window.setTimeout(()=>To(),Hi)}}function sy(Jn,Ss={}){xo?Di=!0:Jn==null?oy():ny(Jn,Ss)}function oy(){we.value&&ny(Ne.value?Math.max(1,Math.round(Pe.value)):Math.max(1,De.value))}return Ve([ne,pe,ve,we,De,Oe,()=>B.renderBatchDelay],()=>{var Jn;const Ss=pe.value,ai=Ue.value,Fi=ve.value,ci=!Object.is(Fi,ai.key),ui=Ss!==ai.total,To=ci||ui;Ue.value={key:Fi,total:Ss};const Hi=We.value,Cl=(Jn=B.renderBatchDelay)!=null?Jn:16,xl=Hi.batchSize!==De.value||Hi.initial!==Oe.value||Hi.delay!==Cl||Hi.enabled!==we.value;We.value={batchSize:De.value,initial:Oe.value,delay:Cl,enabled:we.value},ci&&ct(Ss),(To||xl||!we.value)&&ey(),(To||xl)&&(Pe.value=Math.max(1,De.value||1)),To&&ht();const Tl=ge.value;if(!Ss)return Se.value=0,void at(0);if(!we.value)return Se.value=Tl,void at(Se.value);const Hp=ci||ai.total===0;Se.value=Hp||xl?Math.min(Tl,Oe.value):Math.min(Se.value,Tl);const Wp=Math.max(1,Oe.value||De.value||Ss);Se.value<Tl?sy(Wp,{immediate:!j}):at(Se.value)},{immediate:!0}),Ve(ge,(Jn,Ss)=>{we.value&&(typeof Ss=="number"&&Jn<=Ss||Jn>Se.value&&sy())}),{cleanupBatchScheduler:ey}})({props:k,isClient:me,isTestEnv:dn,parsedNodesIdentity:ls,parsedNodeCount:Os,desiredRenderedCount:_u,datasetKey:J3,batchingEnabled:Re,incrementalRenderingActive:qe,resolvedBatchSize:so,resolvedInitialBatch:xe,renderedCount:st,adaptiveBatchSize:en,previousRenderContext:Rn,previousBatchConfig:Zn,requestFrame:St,cancelFrame:At,hasIdleCallback:mn,cleanupNodeVisibility:V3,onDatasetKeyChanged:x=>{_l(),ku(),lo(),Da(),x>0&&vu(x)},onDatasetChanged:()=>{gt.value&&Wo({immediate:!0})}});Ve([n0,gt,()=>M.value,()=>se()],([x,B])=>{if(!x)return d0(),void Zh();K3(),B?Wo({immediate:!0}):Zh()},{flush:"post",immediate:!0}),Ve([()=>Ke.value.length,()=>gt.value],x=>fn(null,[x],function*([B,j]){j&&B&&me&&(yield ut(),Wo({immediate:!0}))}),{flush:"post"}),Ve(Qt,x=>{x&&(function(){var B;if(eo.value&&Oo.value&&Ps.value&&((B=Fn.value)!=null&&B[1]))return;const j=er({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=er({type:"list_item",children:[j],raw:"- Probe paragraph text"}),ne=er({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});eo.value=j,Oo.value=K,Ps.value=ne;const pe={1:null,2:null,3:null,4:null,5:null,6:null};for(let ge=1;ge<=6;ge++)pe[ge]=er({type:"heading",level:ge,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ge)} Probe heading`});Fn.value=pe})()},{immediate:!0}),Ve([()=>M.value,Qt],()=>{if(!Qt.value)return tp(),void(V.value=0);h0(),tp(),Qt.value&&M.value&&typeof ResizeObserver<"u"&&(Aa=new ResizeObserver(()=>{h0(),oi.value&&be(),us.value&&yl(),tn("resize")}),Aa.observe(M.value))},{immediate:!0}),Ve([Qt,Ds,Ws],()=>fn(null,null,function*(){if(!Qt.value)return z.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void lo();yield ut(),(function(){if(!Qt.value||typeof window>"u")return z.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void lo();const x={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=f0(ep($.value),".paragraph-node");x.paragraph=Bm($.value,B,"pre-wrap");const j=ep(L.value),K=j?.querySelector(".paragraph-node");x.listItem=Bm(L.value,K,"pre-wrap");const ne=Ge("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ge,ve;return(ve=(ge=D.value)==null?void 0:ge.offsetHeight)!=null?ve:0}),pe=Ge("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ge,ve;return(ve=(ge=L.value)==null?void 0:ge.offsetHeight)!=null?ve:0});x.listWrapperOverhead=Math.max(0,ne-pe);for(let ge=1;ge<=6;ge++){const ve=f0(ep(R[ge]),`h${ge}`);x.headings[ge]=Bm(R[ge],ve,"pre-wrap")}z.value=x,lo()})()}),{flush:"post",immediate:!0}),Ve(()=>Ke.value.length,()=>{gt.value&&Wo({immediate:!0})}),Ve([Qt,V],()=>{lo(),gt.value&&Wo({immediate:!0}),oi.value&&be(),us.value&&yl(),tn("resize")},{immediate:!1}),Ve(()=>Ni.value,x=>{if(x)for(const[B,j]of rn)H0(B,j);else{Qh();for(const[B,j]of rn)j&&Oi(B,!0)}},{immediate:!1}),Ve([()=>s.viewportPriority,()=>Ke.value.length],([x,B])=>{x!==!1?P.value&&B<=200&&(P.value=!1):P.value=!1}),Ve(()=>st.value,()=>{gt.value&&Wo({immediate:!0})}),Ve([ro,Un,Ta,()=>Ke.value.length,gt],()=>{xr()},{immediate:!0});let Fa=null,Ha=!1,wl=null;function Wa(){Fa=null,up=null,cp=void 0,ml=null,Da()}function Rp(){_l(),ku(),lo(),cs.clear();const x=Ke.value.length;x>0&&vu(x),_p()}function Op(){Ep(),c0(),Ra=null,Ir=null,$r=null,Iu=null,$a=null,Na=null,Ha=!1,Wa(),w0("restore"),ce(),vl()}function Ua(x){var B;return[(B=In())!=null?B:"",ln(),ri(),Au.value,Pa(x),Ke.value.length,Math.round(Pi(0,Ke.value.length)),Math.round(Mr()),io.count,Math.round(io.total)].join(":")}function U0(){return fn(this,null,function*(){var x,B,j,K;const ne=(x=s.virtualScroll)==null?void 0:x.settledToken,pe=Pa(ne),ge=ln(),ve=In(),Ne=Ws.value;if(wt.value&&((B=s.virtualScroll)==null?void 0:B.settleMode)==="manual"&&Mu(ne))if(dp()){if(Ua(ne)!==ml&&!Ha){Ha=!0;try{const we=yield Sp({reason:"manual",expectedSettledTokenKey:pe}),De=Pa()===pe;wp(ge,ve,Ne)&&we.sessionKey===ge&&we.threadKey===ve&&De&&we.stable&&we.phase==="final"&&(ml=Ua((j=s.virtualScroll)==null?void 0:j.settledToken))}finally{Ha=!1,yield ut();const we=(K=s.virtualScroll)==null?void 0:K.settledToken,De=Mu(we)?Ua(we):"";wp(ge,ve,Ne)&&De&&ml!==De&&U0()}}}else tn("manual")})}Ve(wt,(x,B)=>{if(x!==B){if(!x)return Op(),void Ep();Op(),Rp(),wl=Ws.value,tn("content")}},{flush:"post"}),Ve([wt,Ws],([x,B])=>{x?wl!=null?wl!==B&&(wl=B,(function(j="resize"){_l(),ku(),lo(),cs.clear();const K=Ke.value.length;K>0&&vu(K),_p(),Ir=null,$r=null,Iu=null,Ra=null,Ha=!1,Wa(),L0(),ut(()=>{li(),oi.value&&be(),us.value&&yl(),tn(j)})})("resize")):wl=B:wl=null},{flush:"post",immediate:!0}),Ve([wt,()=>ln(),()=>In()],([x])=>{x&&(Op(),Rp(),w0("content"),tn("content"))}),Ve([wt,()=>ln(),()=>In(),Ws,()=>Ke.value.length],([x])=>{x&&(function(B="async-node"){let j=!1;for(const[K,ne]of Array.from(Ho.entries()))lp(ne)||(Ho.delete(K),Fs.delete(K),j=!0);j&&(hl(),tn(B))})("async-node")},{flush:"post"}),Ve([wt,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.sessionKey},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>s.indexKey,()=>W.value],([x])=>{x&&(Da(),(function(B="content"){if(!wt.value)return;const j=[],K=Ke.value.length;for(const ne of Array.from(cs.keys())){if(ne>=K){j.push(ne);continue}const pe=Ia(ne),ge=cs.get(ne);ge!=null&&ge!==pe&&j.push(ne),cs.set(ne,pe)}for(const ne of Array.from(cs.keys()))ne>=K&&cs.delete(ne);j.length&&((function(ne,pe={}){const ge=Array.from(ne,Number);U3(ge,pe)>0&&(function(Ne){for(const we of Ne)cs.delete(we)})(ge)})(j,{notify:!1}),lo(),Wa(),oi.value&&be(),us.value&&yl(),tn(B))})("content"))},{flush:"post",immediate:!0}),Ve([wt,()=>Ke.value.length,()=>ln(),()=>In()],([x,B,j,K],[ne,pe,ge,ve])=>{x&&ne&&j===ge&&K===ve&&B!==pe&&Wa()},{flush:"post"}),Ve([wt,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.heightCache},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.heightCacheWidth},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>Ke.value.length,()=>ln(),V],()=>{L0()},{flush:"post",immediate:!0}),Ve([wt,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreAnchor},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>Ke.value.length,()=>ln(),V],x=>fn(null,[x],function*([B,j]){if(!B||!j)return;yield ut();const K=(function(){var ne;const pe=(ne=s.virtualScroll)==null?void 0:ne.restoreAnchor;return pe==null||pe===!1?null:pe===!0?"true":String(pe)})();bp(j,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Ve([wt,V,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey}],([x])=>{var B;if(!x)return;const j=(B=s.virtualScroll)==null?void 0:B.restoreState;j&&Ir&&$r==="restore"&&($0(j)||(Rp(),Ir=null,$r=null,tn("resize")))},{flush:"post"}),Ve([wt,()=>Ke.value.length,()=>ln(),V],x=>fn(null,[x],function*([B]){var j;const K=$a,ne=Na;B&&K&&(yield ut(),!bp(K,{restoreAnchor:ne?.restoreAnchor===!0,restoreToken:(j=ne?.restoreToken)!=null?j:"imperative",allowUncapturedAnchor:ne?.allowUncapturedAnchor===!0})&&R0(K)||($a=null,Na=null))}),{flush:"post",immediate:!0}),Ve([wt,le,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settleMode},()=>ln(),()=>In(),Ws,Yh,o0,()=>st.value,_u,()=>io.count,()=>io.total],([x,B,j])=>{if(!x||B!==!0||j==="manual"||!fp())return;const K=(function(){var ne;const pe=Ke.value.length;return[(ne=In())!=null?ne:"",ln(),ri(),Au.value,pe,Math.round(Pi(0,pe)),Math.round(Mr()),io.count,Math.round(io.total)].join(":")})();Fa!==K&&(Fa=K,Sp({reason:"final"}).then(ne=>{ne.stable||Fa!==K||(Fa=null)}))},{flush:"post",immediate:!0}),Ve([wt,le,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settleMode},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settledToken},()=>ln(),()=>In(),Ws,Yh,o0,()=>st.value,_u,()=>Ke.value.length,()=>io.count,()=>io.total],()=>{U0()},{flush:"post",immediate:!0}),Ve([()=>Ke.value.length,gt,Un,Ta,()=>qn.start,()=>qn.end],([x,B,j,K,ne,pe])=>{He.value&&ke("virtualization",{nodes:x,virtualization:B,maxLiveNodes:j,buffer:K,focusIndex:ro.value,scroll:B?(()=>{const ge=Sr.value||Ae();return ge?{reverse:G(ge),scrollTop:Math.round(ge.scrollTop),scrollTopAbs:Math.round(Math.abs(ge.scrollTop)),scrollHeight:Math.round(ge.scrollHeight),clientHeight:Math.round(ge.clientHeight)}:null})():null,liveRange:{start:ne,end:pe},rendered:st.value})}),Ve([()=>s.customId],([x],B,j)=>{if(!x||un)return;const K=(function(ne,pe){return ne?($n.controllers[ne]=pe,()=>{$n.controllers[ne]===pe&&delete $n.controllers[ne]}):()=>{}})(x,{captureRestoreAnchor:It,restoreAnchor:Ca,getAnchorDrift:gu,getReport:Y3});j(()=>{K()})},{immediate:!0}),Js(()=>{(function(){if(wt.value)try{li(),La();const x=Er("manual");P0(x)&&(T(x),Ra=x,xp=Oa());const B=gl(x,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&(E(B),B.anchor&&C(B.anchor),kl=Ba(B))}catch{}})(),rA(),Qh(),de(),W0();for(const x of Li.values())for(const B of x)Su(B);Li.clear(),Tr.clear(),cs.clear(),Lp(),_l(),tp(),ce(),vl(),Ep(),d0(),Zh()});const lA=Xo({loader:()=>fn(null,null,function*(){try{return(yield js(()=>import("./index11-4vKmecHt.js"),__vite__mapDeps([6,3]))).default}catch(x){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".',x),mo}}),loadingComponent:WH,delay:0}),aA=Xo({loader:()=>fn(null,null,function*(){try{return(yield js(()=>import("./index10-BU_fP3cF.js"),[])).default}catch(x){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.',x),mo}}),loadingComponent:HH,delay:0}),cA=Xo(()=>fn(null,null,function*(){try{return(yield js(()=>import("./index7-CktYDBgt.js"),[])).default}catch(x){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".',x),mo}})),q0={text:kn,paragraph:tl,heading:Ef,code_block:Im,list:ra,list_item:ia,blockquote:$d,table:Ac,definition_list:Nd,footnote:Ld,footnote_reference:Gs,footnote_anchor:xc,admonition:Dd,vmr_container:Od,hardbreak:lr,link:ks,image:rr,thematic_break:Rd,math_inline:Ro,math_block:uT,strong:vs,emphasis:bs,strikethrough:ys,highlight:Xs,insert:Ns,subscript:$s,superscript:Is,emoji:Es,checkbox:Ks,checkbox_input:Ks,inline_code:is,html_inline:Ys,reference:gs,html_block:Tc},uA=U(()=>ip()),j0=U(()=>tt(tt({stream:k.codeBlockStream,darkTheme:s.codeBlockDarkTheme,lightTheme:s.codeBlockLightTheme,monacoOptions:s.codeBlockMonacoOptions,themes:s.themes,minWidth:s.codeBlockMinWidth,maxWidth:s.codeBlockMaxWidth},typeof Be.value=="boolean"?{showTooltips:Be.value}:{}),s.codeBlockProps||{}));function z0(x){return typeof x=="boolean"?x:void 0}const dA=U(()=>{const x=s.codeBlockProps||{},B={},j=z0(x.showLineNumbers);j!==void 0&&(B.showLineNumbers=j);const K=z0(x.diffInline);K!==void 0&&(B.diffInline=K);const ne=(function(pe){const ge=Number(pe);return Number.isFinite(ge)&&ge>0?ge:void 0})(x.reservedHeightPx);return ne!==void 0&&(B.reservedHeightPx=ne),B}),fA=U(()=>{const x=s.codeBlockProps||{};return tt(tt({stream:k.codeBlockStream,darkTheme:s.codeBlockDarkTheme,lightTheme:s.codeBlockLightTheme,themes:s.themes,minWidth:s.codeBlockMinWidth,maxWidth:s.codeBlockMaxWidth},typeof Be.value=="boolean"?{showTooltips:Be.value}:{}),x)}),hA=U(()=>tt({},s.mermaidProps||{})),pA=U(()=>tt({},s.d2Props||{})),mA=U(()=>tt({},s.infographicProps||{})),qa=U(()=>({typewriter:s.typewriter,fade:k.fade,customHtmlTags:_s.value.customHtmlTags})),gA=U(()=>tt(tt({},qa.value),typeof Be.value=="boolean"?{showTooltip:Be.value}:{})),vA=U(()=>tt(tt({},qa.value),typeof Be.value=="boolean"?{showTooltips:Be.value}:{})),yA=U(()=>tt(tt({},qa.value),typeof Be.value=="boolean"?{showTooltips:Be.value}:{})),kA=U(()=>tt(tt({},qa.value),typeof Be.value=="boolean"?{showTooltips:Be.value}:{}));function bA(x){return Array.isArray(x.children)&&x.children.length>0}const Pp=U(()=>G3.value.map(x=>{var B,j,K,ne,pe,ge,ve,Ne;let we=(function(et){var Je,at,ct,ht,lt,kt,bt;if(et.type!=="code_block")return et;const Ot=et,ds=[String((Je=Ot.language)!=null?Je:""),String((at=Ot.loading)!=null?at:""),String((ct=Ot.diff)!=null?ct:""),String((ht=Ot.code)!=null?ht:""),String((lt=Ot.originalCode)!=null?lt:""),String((kt=Ot.updatedCode)!=null?kt:""),String((bt=Ot.raw)!=null?bt:"")].join("\0"),fs=pu.get(Ot);if(fs&&fs.signature===ds)return fs.node;const xo=tt({},Ot);return pu.set(Ot,{signature:ds,node:xo}),xo})(x.node);const De=Lu(we);let Oe=K0(we,De);if((we.type==="html_block"||we.type==="html_inline")&&Oe===q0[we.type]){const et=we,Je=String((B=et.tag)!=null?B:"").trim().toLowerCase()||ux(et.content);if(Je){const at=Ft.value[Je];if(Xn.value.has(Je)&&at)Oe=at,we=xt(tt({},et),{type:Je,tag:Je,content:WO(et.content,Je)});else if(dx((j=et.content)!=null?j:et.raw,Je)){const ct=String((ne=(K=et.content)!=null?K:et.raw)!=null?ne:"");we.type==="html_inline"?(Oe=kn,we={type:"text",content:ct,raw:ct}):(Oe=tl,we={type:"paragraph",children:[{type:"text",content:ct,raw:ct}],raw:ct})}}}const Se=V0(we,De,Oe);let Pe=tt({},(function(et,Je,at){const ct=Je??Lu(et);return at&&V0(et,ct,at)?dA.value:et.type==="code_block"&&(function(ht){return!!(ht&&ht===Ft.value.code_block)})(at)?j0.value:et.type==="code_block"&&m0(at)?fA.value:ct==="mermaid"?hA.value:ct==="infographic"?mA.value:ct==="d2"||ct==="d2lang"?pA.value:et.type==="link"?gA.value:et.type==="list"?vA.value:et.type==="blockquote"?yA.value:et.type==="table"?kA.value:et.type==="code_block"?j0.value:qa.value})(we,De,Oe));const Ue=Ar.value[x.index];we.type==="code_block"&&Ue?.kind==="code-block"&&(Pe=xt(tt({},Pe),Se?{reservedHeightPx:(pe=Ue.height)!=null?pe:Ue.contentHeight}:{estimatedHeightPx:Ue.height,estimatedContentHeightPx:Ue.contentHeight})),Se||we.type!=="code_block"||De!=="mermaid"||$f(Pe.estimatedPreviewHeightPx)!=null||(Pe=xt(tt({},Pe),{estimatedPreviewHeightPx:kT(gT(String((ge=we.code)!=null?ge:"")))})),Se||we.type!=="code_block"||De!=="infographic"||$f(Pe.estimatedPreviewHeightPx)!=null||(Pe=xt(tt({},Pe),{estimatedPreviewHeightPx:bT(vT(String((ve=we.code)!=null?ve:"")))})),we.type==="math_block"&&(Pe=xt(tt({},Pe),{cacheScope:Jt.value}));const We=(function(et,Je){const at=String(et.type);return!uu(at)&&Ft.value[at]===Je})(we,Oe),it=We?Tv(we,Ee.value):void 0;return xt(tt({},x),{node:we,component:Oe,bindings:Pe,customBindings:tt(tt({},it??{}),Pe),rendersCustomNode:We,hasSlotChildren:bA(we),slotContent:String((Ne=we.content)!=null?Ne:""),isCodeBlock:we.type==="code_block",indexKey:`${uA.value}-${x.index}`})}));function Lu(x){var B;return x?.type==="code_block"?String((B=x.language)!=null?B:"").trim().toLowerCase():""}function V0(x,B,j){return x.type==="code_block"&&l.value==="pre"&&!(function(K){return!!(K&&Ft.value[K])})(B)&&j===mo}function K0(x,B){if(!x)return Qg;const j=Ft.value,K=j[String(x.type)];if(x.type==="code_block"){const ne=B??Lu(x),pe=ne?j[ne]:void 0;return pe||(l.value==="pre"?j.code_block||mo:ne==="mermaid"?j.mermaid||lA:ne==="infographic"?j.infographic||aA:ne==="d2"||ne==="d2lang"?j.d2||cA:K||j.code_block||g0.value)}return K||q0[String(x.type)]||Qg}function Dp(x){o("click",x)}function _A(x){var B;(B=x.target)!=null&&B.closest("[data-node-index]")&&o("mouseover",x)}function wA(x){var B;(B=x.target)!=null&&B.closest("[data-node-index]")&&o("mouseout",x)}function G0(x){o("mouseover",x)}function Y0(x){o("mouseout",x)}const Rr=ie(null),Uo=ie(!1);let ja,Sl=null,Bp=0,Ru=0,Ou=0;const X0=["code_block","admonition","table","math_block","html_block","image","thematic_break"],SA=new Set(X0),Z0=[".typewriter-cursor",".height-estimation-probes",...X0.map(x=>`[data-node-type="${x}"]`),"script","style"].join(",");function J0(x){if(!x||typeof x!="object")return!1;const B=x.type;return typeof B=="string"&&SA.has(B)}function Pu(x){var B,j;if(!x||typeof x!="object")return 0;const K=x,ne=(j=(B=K.raw)!=null?B:K.content)!=null?j:K.code;if(typeof ne=="string")return ne.length;const pe=K.children;if(Array.isArray(pe))return pe.reduce((ve,Ne)=>ve+Pu(Ne),0);const ge=K.items;return Array.isArray(ge)?ge.reduce((ve,Ne)=>ve+Pu(Ne),0):0}function Du(){ja&&(clearTimeout(ja),ja=void 0)}function Q0(){Bp+=1,Sl!=null&&(At?.(Sl),Sl=null)}function Bu(){Q0(),Rr.value&&(Rr.value.style.visibility="hidden")}function CA(x){var B;if(x.nodeType!==Node.TEXT_NODE||!((B=x.textContent)!=null?B:"").trim())return!1;const j=x.parentElement;return!!j&&!j.closest(Z0)}function xA(x){let B=x.lastChild;for(;B;){if(CA(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const j=B;if(!j.matches(Z0)&&j.lastChild){B=j.lastChild;continue}}for(;B&&B!==x&&!B.previousSibling;)B=B.parentNode;if(!B||B===x)break;B=B.previousSibling}return null}function Fp(){if(!me||!Uo.value||Sl!=null)return;const x=Bp,B=()=>{Sl=null,x===Bp&&(function(){var j,K;if(!(me&&Uo.value&&M.value&&Rr.value))return;const ne=M.value,pe=Rr.value;pe.style.visibility="hidden";const ge=(function(){const Oe=Pp.value;for(let Se=Oe.length-1;Se>=0;Se--){const Pe=Oe[Se];if(!Pe||J0(Pe.node)||!$p(Pe.index))continue;const Ue=rn.get(Pe.index);if(!Ue)continue;const We=xA(Ue);if(We)return We}return null})();if(!ge)return;let ve=0,Ne=0,we=20,De=!1;if(ge?.textContent){const Oe=ge.textContent.length,Se=document.createRange();Se.setStart(ge,Math.max(0,Oe-1)),Se.setEnd(ge,Oe);const Pe=typeof Se.getClientRects=="function"?Se.getClientRects():void 0,Ue=(K=Pe?.[Pe.length-1])!=null?K:(j=ge.parentElement)==null?void 0:j.getBoundingClientRect();if(Ue){const We=Ge("typewriterCursor.root.getBoundingClientRect",()=>ne.getBoundingClientRect());ve=Ue.right-We.left+ne.scrollLeft,Ne=Ue.top-We.top+ne.scrollTop,we=Ue.height||we,De=!0}Se.detach()}De&&(pe.style.transform=`translate(${Math.max(0,ve)}px, ${Math.max(0,Ne)}px)`,pe.style.height=`${we}px`,pe.style.visibility="visible")})()};St?Sl=St(B):B()}return Ve([Y,()=>s.content,()=>s.nodes,()=>s.typewriter,le],()=>fn(null,null,function*(){var x,B;if(!me||$e.value||!ee.value)return;if(le.value)return Uo.value=!1,Du(),void Bu();if((x=s.nodes)!=null&&x.length)return Uo.value=!1,Du(),Bu(),Ru=((B=s.content)!=null?B:"").length,void(Ou=Y.value.length);const j=(function(){var ve,Ne;return(ve=s.nodes)!=null&&ve.length?s.nodes.reduce((we,De)=>we+Pu(De),0):((Ne=s.content)!=null?Ne:"").length})(),K=(function(){var ve;return(ve=s.nodes)!=null&&ve.length?s.nodes.reduce((Ne,we)=>Ne+Pu(we),0):Y.value.length})(),ne=!J0(Ke.value[Ke.value.length-1]),pe=j>Ru,ge=K>Ou;if(s.typewriter===!1||!ne||!pe&&!ge)return s.typewriter!==!1&&ne||(Uo.value=!1,Bu()),Ru=j,void(Ou=K);Ru=j,Ou=K,Uo.value=!0,Rr.value&&(Rr.value.style.visibility="hidden"),Du(),yield ut(),Fp(),ja=setTimeout(()=>{ja=void 0,Uo.value=!1},3e3)}),{flush:"post",immediate:!0}),Ve(Uo,x=>fn(null,null,function*(){x?(yield ut(),Fp()):Bu()}),{flush:"post"}),Ve([()=>st.value,()=>qn.start,()=>qn.end],()=>fn(null,null,function*(){me&&!$e.value&&ee.value&&Uo.value&&(yield ut(),Fp())}),{flush:"post"}),Js(()=>{Du(),Q0(),Ct.clear()}),(x,B)=>{const j=JM("NodeRenderer",!0);return A($e)?(S(!0),I(Me,{key:0},Ze(Pp.value,K=>(S(),I(Me,{key:K.index},[K.rendersCustomNode?(S(),je(ss(K.component),Vt({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onClick:Dp,onMouseover:G0,onMouseout:Y0,onCopy:B[0]||(B[0]=ne=>o("copy",ne)),onHandleArtifactClick:B[1]||(B[1]=ne=>o("handleArtifactClick",ne))}),{default:yn(()=>[K.hasSlotChildren?(S(),je(j,Vt({key:0,ref_for:!0},Et.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(S(),je(j,Vt({key:1,ref_for:!0},Et.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(S(),je(ss(K.component),Vt({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onClick:Dp,onMouseover:G0,onMouseout:Y0,onCopy:B[2]||(B[2]=ne=>o("copy",ne)),onHandleArtifactClick:B[3]||(B[3]=ne=>o("handleArtifactClick",ne))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(S(),I("div",{key:1,ref_key:"containerRef",ref:M,class:Te(["markstream-vue markdown-renderer",[{dark:s.isDark},{virtualized:gt.value},{"virtual-scroll-coordinated":as.value}]]),"data-custom-id":s.customId,onClick:Dp,onMouseover:_A,onMouseout:wA},[ni.value||gt.value?(S(),I(Me,{key:0},[ni.value?(S(),I("div",{key:0,class:"height-estimation-probes",style:Dt({width:`${Ds.value}px`}),"aria-hidden":"true"},[h("div",{ref_key:"paragraphProbeWrapperRef",ref:$,class:"node-content","data-probe":"paragraph"},[pt(A(tl),{node:eo.value,"index-key":"probe-paragraph"},null,8,["node"])],512),h("div",{ref_key:"listItemProbeWrapperRef",ref:L,class:"node-content","data-probe":"list-item"},[h("ul",qH,[pt(A(ia),{node:Oo.value,"index-key":"probe-list-item"},null,8,["node"])])],512),h("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[pt(A(ra),{node:Ps.value,"index-key":"probe-list"},null,8,["node"])],512),(S(),I(Me,null,Ze(6,K=>h("div",{key:`probe-heading-${K}`,ref_for:!0,ref:ne=>(function(pe,ge){pe<1||pe>6||(R[pe]=ge)})(K,ne),class:"node-content","data-probe":`heading-${K}`},[pt(A(Ef),{node:z3(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,jH)),64))],4)):ue("",!0),gt.value?(S(),I("div",{key:1,class:"node-spacer",style:Dt({height:`${sp.value}px`}),"aria-hidden":"true"},null,4)):ue("",!0)],64)):ue("",!0),(S(!0),I(Me,null,Ze(Pp.value,K=>(S(),I("div",{key:K.index,ref_for:!0,ref:ne=>H0(K.index,ne),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[$p(K.index)?(S(),I("div",{key:0,ref_for:!0,ref:ne=>(function(pe,ge){var ve;ge||(function(Oe){const Se=`${ip()}-${Oe}`;let Pe=!1;for(const Ue of Array.from(Fs.keys())){const We=Ho.get(Ue);(We?.index===Oe||Ue===Se||Ue.startsWith(`${Se}-`))&&(Fs.delete(Ue),Ho.delete(Ue),Pe=!0)}Pe&&(hl(),tn("async-node"))})(pe),ii.delete(pe),(function(Oe){var Se;const Pe=((Se=Tr.get(Oe))!=null?Se:0)+1;Tr.set(Oe,Pe)})(pe);const Ne=Li.get(pe);if(Ne){for(const Oe of Ne)Su(Oe);Li.delete(pe)}if((function(Oe){const Se=Bs.get(Oe);Se&&(Do?.unobserve(Se),wr.delete(Se),Bs.delete(Oe))})(pe),!ge||!Ie.value)return Fo.delete(pe),void Tr.delete(pe);Fo.set(pe,ge);const we=()=>{Nu(pe,ge)};queueMicrotask(we);const De=(Do||typeof ResizeObserver>"u"||(Do=new ResizeObserver(Oe=>{if(Oe.length)for(const Se of Oe){const Pe=wr.get(Se.target),Ue=Bs.get(Pe??-1);Pe!=null&&Ue&&Nu(Pe,Ue)}else li()})),Do);if(De&&(Bs.set(pe,ge),wr.set(ge,pe),De.observe(ge)),typeof window<"u"){const Oe=((ve=Ke.value[pe])==null?void 0:ve.type)==="code_block"?[16,80,240,800]:le.value?[80]:[];if(Oe.length){const Se=Oe.map(Pe=>a0(Pe,we,"node-resize")).filter(Pe=>Pe!=null);Se.length&&Li.set(pe,Se)}}})(K.index,ne),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(S(),je(ss(K.component),Vt({key:1,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onCopy:B[8]||(B[8]=ne=>o("copy",ne)),onHandleArtifactClick:B[9]||(B[9]=ne=>o("handleArtifactClick",ne))}),{default:yn(()=>[K.hasSlotChildren?(S(),je(j,Vt({key:0,ref_for:!0},Et.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(S(),je(j,Vt({key:1,ref_for:!0},Et.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(S(),je(ss(K.component),Vt({key:2,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onCopy:B[10]||(B[10]=ne=>o("copy",ne)),onHandleArtifactClick:B[11]||(B[11]=ne=>o("handleArtifactClick",ne))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(S(),je(Si,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:yn(()=>[K.rendersCustomNode?(S(),je(ss(K.component),Vt({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onCopy:B[4]||(B[4]=ne=>o("copy",ne)),onHandleArtifactClick:B[5]||(B[5]=ne=>o("handleArtifactClick",ne))}),{default:yn(()=>[K.hasSlotChildren?(S(),je(j,Vt({key:0,ref_for:!0},Et.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(S(),je(j,Vt({key:1,ref_for:!0},Et.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(S(),je(ss(K.component),Vt({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onCopy:B[6]||(B[6]=ne=>o("copy",ne)),onHandleArtifactClick:B[7]||(B[7]=ne=>o("handleArtifactClick",ne))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(S(),I("div",{key:1,class:"node-placeholder",style:Dt({height:`${Tu(K.index)}px`})},null,4))],8,zH))),128)),Uo.value?(S(),I("span",{key:1,ref_key:"typewriterCursorRef",ref:Rr,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ue("",!0),gt.value?(S(),I("div",{key:2,class:"node-spacer",style:Dt({height:`${op.value}px`}),"aria-hidden":"true"},null,4)):ue("",!0)],42,UH))}}})),[["__scopeId","data-v-661c7a50"]]),Ls=MT;Ls.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Ls.__name,Ls.name].filter(n=>!!n));for(const n of t)e.component(n,MT)};const Lv=Object.freeze(Object.defineProperty({__proto__:null,default:Ls},Symbol.toStringTag,{value:"Module"})),VH={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"},KH={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"},GH={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"},YH={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"},XH={class:"admonition-title"},ZH=["aria-expanded","aria-controls"],JH=["id"],Dd=zt(Xe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=U(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=ie(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(S(),I("div",{class:Te(["admonition",[`admonition-${s.node.kind}`]])},[h("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(S(),I("svg",VH,[...u[1]||(u[1]=[h("circle",{cx:"12",cy:"12",r:"10"},null,-1),h("path",{d:"M12 16v-4"},null,-1),h("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(S(),I("svg",KH,[...u[2]||(u[2]=[h("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),h("path",{d:"M9 18h6"},null,-1),h("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(S(),I("svg",GH,[...u[3]||(u[3]=[h("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),h("path",{d:"M12 9v4"},null,-1),h("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(S(),I("svg",YH,[...u[4]||(u[4]=[h("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),h("path",{d:"M12 8v4"},null,-1),h("path",{d:"M12 16h.01"},null,-1)])])):ue("",!0),h("span",XH,N(i.value),1),s.node.collapsible?(S(),I("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(S(),I("svg",{style:Dt({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]=[h("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,ZH)):ue("",!0)]),Lt(h("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[pt(A(Ls),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,JH),[[Eo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Dd.install=e=>{e.component(Dd.__name,Dd)};const ET=()=>js(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let pd=null,QH=ET;function lfe(){return fn(this,null,function*(){if(pd)return pd;const e=QH;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===ET?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(pd=(function(n){var s;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 o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),pd):null})}function afe(){return!1}function cfe(){return fn(this,null,function*(){return null})}const md=ie(!1);let cw=!1;function Hm(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function eW(){return!cw&&typeof window<"u"&&typeof document<"u"&&(cw=!0,md.value=Hm(),new MutationObserver(()=>{md.value=Hm()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{md.value=Hm()})),md}const IT=["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"],tW=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),o1=[...IT].sort((e,t)=>t.length-e.length).join("|"),Wm=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${o1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${o1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),$T=/[),.;!?,。;!?)]+$/;function nW(e){const t=e.toLowerCase();return IT.some(n=>t.endsWith(`.${n}`))}function sW(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${o1}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function oW(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace($T,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=tW.has(i),a=nW(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function iW(e,t={}){const n=[];Wm.lastIndex=0;let s;for(;(s=Wm.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace($T,""),u=a.length-c.length;a=c;const d=oW(a,t);if(!d)continue;const p=s.index+r,m=p+a.length;n.push({...d,start:p,end:m,text:a}),u>0&&(Wm.lastIndex-=u)}return n}const rW=12e4,lW=6e4,aW=32,cW=3e4,uw=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function uW(e){let t=0,n=0,s=0;uw.lastIndex=0;let o;for(;(o=uw.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=rW||n>=lW||t>=aW||s>=cW?"pre":"shiki",codeFenceCount:t,codeChars:n}}const dW={key:1,class:"diff-wrap"},fW={class:"diff-bar"},hW=["title","onClick"],pW={class:"diff-pre"},mW="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",dw="github-light",fw="github-dark",gW=Xe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){const{t}=_t(),n=Rt("resolveImage"),s=ie(null),o=e,i=U(()=>!o.streaming),r=U(()=>sW(o.text??"")),l=U(()=>o.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:uW(o.text??"")),a=eW(),c=U(()=>!o.streaming),u=qs(new Map),d=new Set,p=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,m=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function f(R){return!/^(https?:|data:|blob:)/i.test(R)}function g(R){if(!n)return;const P=[];for(const O of[p,m]){O.lastIndex=0;let W;for(;(W=O.exec(R))!==null;)P.push(W[2]??"")}for(const O of P)!O||!f(O)||u.has(O)||d.has(O)||(d.add(O),n(O).then(W=>{u.set(O,W!==O?W:"")}).catch(()=>{u.set(O,"")}).finally(()=>{d.delete(O)}))}function w(R){if(!n)return R;const P=O=>{if(!f(O))return null;const W=u.get(O);return W===void 0?mW:W===""?null:W};return R.replace(p,(O,W,V,z)=>{const se=P(V);return se===null?O:`${W}${se}${z}`}).replace(m,(O,W,V,z)=>{const se=P(V);return se===null?O:`${W}${se}${z}`})}Ve(()=>o.text,R=>g(R??""),{immediate:!0});function b(){if(!s.value||!o.openFile||o.streaming)return;const R=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),P=[];let O=R.nextNode();for(;O;){const W=O,V=W.parentElement;V&&!V.closest("a, pre, .md-file-link")&&W.data.trim().length>0&&P.push(W),O=R.nextNode()}for(const W of P){const V=iW(W.data,{aliases:r.value});if(V.length===0||!W.parentNode)continue;const z=document.createDocumentFragment();let se=0;for(const Q of V){Q.start>se&&z.append(document.createTextNode(W.data.slice(se,Q.start)));const me=document.createElement("button");me.type="button",me.className="md-file-link",me.textContent=Q.text,me.title=Q.line?`${Q.path}:${Q.line}`:Q.path,me.addEventListener("click",$e=>{$e.preventDefault(),$e.stopPropagation(),o.openFile?.({path:Q.path,line:Q.line})}),z.append(me),se=Q.end}se<W.data.length&&z.append(document.createTextNode(W.data.slice(se))),W.parentNode.replaceChild(z,W)}}function _(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function v(R){let P=R.length;for(const O of["#","?"]){const W=R.indexOf(O);W!==-1&&W<P&&(P=W)}return R.slice(0,P)}function y(){if(!s.value||!o.openFile||o.streaming)return;const R=s.value.querySelectorAll("a[href]");for(const P of R){if(P.dataset.mdLinkHandled==="true")continue;const O=P.getAttribute("href")??"";_(O)&&(P.dataset.mdLinkHandled="true",P.addEventListener("click",W=>{W.preventDefault(),W.stopPropagation(),o.openFile?.({path:v(O)})}))}}function k(){ut().then(()=>{b(),y()})}Ve(()=>o.text,k),Ve(()=>o.streaming,k);let T=null;sn(()=>{k(),s.value&&(T=new MutationObserver(k),T.observe(s.value,{childList:!0,subtree:!0}))}),Gt(()=>{T?.disconnect()});const E={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},C=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,M=U(()=>{const R=w(o.text??""),P=[];let O=0;C.lastIndex=0;let W;for(;(W=C.exec(R))!==null;){const z=W[1]??"",se=R.slice(O,W.index)+(z||"");se.trim()&&P.push({kind:"md",text:se}),P.push({kind:"diff",code:W[2]??""}),O=C.lastIndex}const V=R.slice(O);return(V.trim()||P.length===0)&&P.push({kind:"md",text:V}),P});function $(R){return R.split(`
219
- `).map(P=>/^\+(?!\+\+)/.test(P)?{cls:"diff-add",text:P}:/^-(?!--)/.test(P)?{cls:"diff-del",text:P}:P.startsWith("@@")?{cls:"diff-hunk",text:P}:{cls:"diff-ctx",text:P})}const L=ie(null);function D(R,P){navigator.clipboard.writeText(R).then(()=>{L.value=P,setTimeout(()=>{L.value=null},1400)}).catch(()=>{})}return(R,P)=>(S(),I("div",{ref_key:"mdRef",ref:s,class:"md"},[(S(!0),I(Me,null,Ze(M.value,(O,W)=>(S(),I(Me,{key:W},[O.kind==="md"?(S(),je(A(Ls),{key:0,content:O.text,mode:"chat","code-renderer":l.value.codeRenderer,"is-dark":A(a),"code-block-light-theme":dw,"code-block-dark-theme":fw,themes:[dw,fw],"code-block-props":E,final:i.value,"smooth-streaming":e.streaming,"batch-rendering":c.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(S(),I("div",dW,[h("div",fW,[P[0]||(P[0]=h("span",{class:"diff-lang"},"diff",-1)),h("button",{class:"diff-copy",title:A(t)("filePreview.copyCode"),onClick:V=>D(O.code,W)},N(L.value===W?"✓":"⧉"),9,hW)]),h("pre",pW,[h("code",null,[(S(!0),I(Me,null,Ze($(O.code),(V,z)=>(S(),I("span",{key:z,class:Te(V.cls)},N(V.text),3))),128))])])]))],64))),128))],512))}}),Lf=yt(gW,[["__scopeId","data-v-9786e921"]]),vW={class:"tc-anim"},yW={class:"prev-anim"},kW={class:"prev"},bW=Xe({__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,s=t,o=U(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=U(()=>n.foldable&&o.value.length>1),r=U(()=>n.streaming||!i.value),l=U(()=>o.value.pop()??""),a=ie(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)||ut(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(S(),I("div",{class:Te(["think",{mob:e.mobile}])},[i.value?(S(),I("div",{key:0,class:Te(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[h("div",vW,[h("pre",{ref_key:"bodyEl",ref:a,class:"tc"},N(e.text),513)]),h("div",yW,[h("span",kW,N(l.value),1)])],2)):(S(),I("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},N(e.text),513))],2))}}),hw=yt(bW,[["__scopeId","data-v-67632248"]]),_W={class:"activity-notice",role:"status"},wW={class:"an-moon","aria-hidden":"true"},SW={class:"an-label"},CW=120,xW=Xe({__name:"ActivityNotice",props:{label:{}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"],n=ie(0);let s=null;return sn(()=>{s=setInterval(()=>{n.value=(n.value+1)%t.length},CW)}),Gt(()=>{s&&(clearInterval(s),s=null)}),(o,i)=>(S(),I("div",_W,[h("span",wW,N(t[n.value]),1),h("span",SW,N(e.label),1)]))}}),pw=yt(xW,[["__scopeId","data-v-bca6ec2b"]]),TW=["disabled"],AW={class:"agent-main"},MW={class:"agent-title-row"},EW={class:"agent-name"},IW={key:0,class:"agent-type"},$W={class:"agent-phase"},NW={key:0,class:"agent-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},LW=Xe({__name:"AgentCard",props:{member:{},compact:{type:Boolean}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=U(()=>(n.member.outputLines??[]).map(u=>u.trimEnd()).filter(u=>u.length>0).slice(-8)),i=U(()=>o.value.at(-1)),r=U(()=>n.member.phase==="queued"||n.member.phase==="working"||n.member.phase==="suspended"),l=U(()=>!!(n.member.summary||n.member.suspendedReason||n.member.prompt||o.value.length>0));function a(u){switch(u){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function c(){l.value&&s("open",n.member.id)}return(u,d)=>(S(),I("div",{class:Te(["agent-card",[`phase-${e.member.phase}`,{compact:e.compact}]])},[h("button",{class:"agent-head",type:"button",disabled:!l.value,onClick:c},[d[1]||(d[1]=h("span",{class:"agent-dot","aria-hidden":"true"},null,-1)),h("span",AW,[h("span",MW,[h("span",EW,N(e.member.name),1),e.member.subagentType?(S(),I("span",IW,N(e.member.subagentType),1)):ue("",!0),r.value?(S(),I("span",{key:1,class:Te(["agent-live",{empty:!i.value}])},N(i.value),3)):ue("",!0)])]),h("span",$W,N(a(e.member.phase)),1),l.value?(S(),I("svg",NW,[...d[0]||(d[0]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])])):ue("",!0)],8,TW)],2))}}),i1=yt(LW,[["__scopeId","data-v-41bb2d23"]]),RW={class:"agent-group"},OW={class:"group-count"},PW={key:0,class:"group-live"},DW={key:0,class:"group-body"},BW=Xe({__name:"AgentGroup",props:{members:{}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=ie(!0),i=U(()=>n.members.filter(l=>l.phase==="completed"||l.phase==="failed").length),r=U(()=>n.members.filter(l=>l.phase==="queued"||l.phase==="working"||l.phase==="suspended").length);return(l,a)=>(S(),I("section",RW,[h("button",{class:"group-head",type:"button",onClick:a[0]||(a[0]=c=>o.value=!o.value)},[a[3]||(a[3]=h("span",{class:"group-title"},"Agents",-1)),h("span",OW,N(i.value)+"/"+N(e.members.length),1),r.value>0?(S(),I("span",PW,N(r.value)+" running",1)):ue("",!0),(S(),I("svg",{class:Te(["group-chevron",{open:o.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...a[2]||(a[2]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),o.value?(S(),I("div",DW,[(S(!0),I(Me,null,Ze(e.members,c=>(S(),je(i1,{key:c.id,member:c,compact:"",onOpen:a[1]||(a[1]=u=>s("open",u))},null,8,["member"]))),128))])):ue("",!0)]))}}),mw=yt(BW,[["__scopeId","data-v-644d434d"]]),FW=["aria-label"],HW=120,WW=60,UW=Xe({__name:"MoonSpinner",props:{fast:{type:Boolean},label:{default:"Working…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*HW}ms`,"--moon-frame-fast-delay":`${s*WW}ms`}}return(s,o)=>(S(),I("span",{class:Te(["moon-spin",{"moon-spin--fast":e.fast}]),"aria-label":e.label,role:"img"},[(S(),I(Me,null,Ze(t,(i,r)=>h("span",{key:i,class:"moon-frame",style:Dt(n(r)),"aria-hidden":"true"},N(i),5)),64))],10,FW))}}),r1=yt(UW,[["__scopeId","data-v-e7ccbb9a"]]);function qW(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}const jW={key:0,class:"chat"},zW={key:0,class:"chat-loading"},VW={class:"chat-loading-text"},KW={key:1,class:"chat-empty"},GW=["data-turn-id"],YW={key:0,class:"u-imgs"},XW=["src"],ZW=["src","alt"],JW={key:1,class:"skill-act"},QW={class:"skill-act-head"},eU={key:0,class:"skill-act-args"},tU={key:2,class:"u-text"},nU={key:0,class:"u-meta"},sU=["data-tooltip","onClick"],oU={class:"u-edit-text"},iU=["onClick"],rU=["onClick"],lU=["data-turn-id"],aU=["onClick"],cU={class:"cd-view"},uU={key:1,class:"cd-label"},dU=["data-turn-id"],fU={key:1,class:"msg"},hU={key:2,class:"tool-stack"},pU={key:0,class:"a-msg-ft"},mU=["title"],gU=["onClick"],vU={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},yU={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},kU={class:"a-cpbtn-text"},bU={key:3,class:"sending-placeholder"},_U={key:1,class:"term"},wU={key:0,class:"chat-loading"},SU={class:"chat-loading-text"},CU={key:1,class:"chat-empty"},xU=["data-turn-id"],TU=["onClick"],AU={class:"cd-view"},MU={key:1,class:"cd-label"},EU=["data-turn-id"],IU={class:"no"},$U={class:"tx"},NU={class:"role-row"},LU=["onClick"],RU={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},OU={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},PU={class:"cpbtn-text"},DU=["title"],BU={key:0,class:"u-text"},FU={key:0,class:"skill-act"},HU={class:"skill-act-head"},WU={key:0,class:"skill-act-args"},UU={key:2,class:"tool-stack"},qU=["data-tooltip","onClick"],jU={class:"u-edit-text"},zU=["onClick"],VU={key:3,class:"ln sending-line"},KU={class:"tx"},GU=Xe({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},bubble:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","editMessage"],setup(e,{expose:t,emit:n}){const{t:s}=_t();Gt(()=>{V!==null&&(clearTimeout(V),V=null),C!==null&&(clearTimeout(C),C=null),b!==null&&(clearTimeout(b),b=null)});const o=e,i=U(()=>o.bubble||o.mobile),r=U(()=>{if(!o.running||o.turns.length===0)return null;const te=o.turns.at(-1);return te.role==="assistant"?te.id:null}),l=U(()=>o.sending||o.running),a=n,c=U(()=>{for(let te=o.turns.length-1;te>=0;te--)if(o.turns[te].role==="user")return o.turns[te].id;return null});function u(te){return te.role==="user"&&te.id===c.value&&!o.running&&!o.sending&&!te.skillActivation}function d(te){return te>=1e6?`${(te/1e6).toFixed(1)}M`:te>=1e3?`${(te/1e3).toFixed(1)}k`:String(te)}function p(te){if(te<1e3)return`${te}ms`;if(te<6e4)return`${(te/1e3).toFixed(1)}s`;const ee=Math.floor(te/6e4),Z=(te%6e4/1e3).toFixed(1);return`${ee}m${Z}s`}function m(te){const ee=te.compaction,Z=ee?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof ee?.tokensBefore=="number"&&typeof ee?.tokensAfter=="number"?Z+s("conversation.compactedTokens",{before:d(ee.tokensBefore),after:d(ee.tokensAfter)}):Z}const f=ie(null),g=ie(null),w=ie(null);let b=null;const _=ie(new Set);function v(te){return _.value.has(te)}function y(te){const ee=new Set(_.value);ee.has(te)?ee.delete(te):ee.add(te),_.value=ee}function k(te,ee){if(v(ee)){const Z=new Date(te);if(Number.isNaN(Z.getTime()))return te;const Ae=G=>String(G).padStart(2,"0");return`${Z.getFullYear()}-${Ae(Z.getMonth()+1)}-${Ae(Z.getDate())} ${Ae(Z.getHours())}:${Ae(Z.getMinutes())}`}return qW(te,s("conversation.yesterday"))}function T(te){w.value===null&&(g.value=null,w.value=te.id,b=setTimeout(()=>{b=null,a("editMessage",te.text),w.value=null},240))}const E=ie(!1);let C=null;function M(te){return se(te).flatMap(ee=>ee.kind==="text"&&ee.text?[ee.text]:[]).join(`
220
-
221
- `)}function $(te){const ee=[];for(const Z of se(te))if(Z.kind==="thinking"&&Z.thinking)ee.push(`> **Thinking**
222
- > ${Z.thinking.split(`
223
- `).join(`
224
- > `)}`);else if(Z.kind==="text"&&Z.text)ee.push(Z.text);else if(Z.kind==="tool"&&Z.tool.output&&Z.tool.output.length>0){const Ae=Z.tool.output.join(`
225
- `);ee.push(`\`\`\`
226
- [${Z.tool.name}]
227
- ${Ae}
228
- \`\`\``)}else Z.kind==="agent"?ee.push(`**Agent** ${Z.member.name} (${Z.member.phase})`):Z.kind==="agentGroup"&&ee.push(`**Agents**
229
-
230
- ${Z.members.map(Ae=>`- ${Ae.name}: ${Ae.phase}`).join(`
231
- `)}`);return ee.join(`
232
-
233
- `)}function L(){if(o.turns.length===0)return;const te=[];for(const Z of o.turns){if(Z.role==="compaction")continue;const Ae=Z.role==="user"?"User":"Assistant",G=$(Z);G.trim()&&te.push(`**${Ae}**
234
-
235
- ${G}`)}const ee=te.join(`
236
-
237
- ---
238
-
239
- `);navigator.clipboard.writeText(ee).then(()=>{E.value=!0,a("copyConversationCopied"),C!==null&&clearTimeout(C),C=setTimeout(()=>{C=null,E.value=!1},2e3)}).catch(()=>{})}function D(te){const ee=[];for(let Z=te;Z>=0;Z--){const Ae=o.turns[Z];if(!Ae||Ae.role!=="assistant")break;ee.unshift(Ae)}return ee}function R(te){return D(te).map(ee=>M(ee)).filter(Boolean).join(`
240
-
241
- `)}function P(){for(let te=o.turns.length-1;te>=0;te-=1)if(o.turns[te]?.role==="assistant")return R(te);return""}function O(){const te=P();te.trim()&&navigator.clipboard.writeText(te).then(()=>{E.value=!0,a("copyConversationCopied"),C!==null&&clearTimeout(C),C=setTimeout(()=>{C=null,E.value=!1},2e3)}).catch(()=>{})}t({copyConversation:L,copyFinalSummary:O});function W(te){const ee=o.turns[te];if(!ee||ee.role!=="assistant")return!1;const Z=o.turns[te+1];return!Z||Z.role!=="assistant"}let V=null;function z(te){const ee=o.turns[te];if(!ee)return;const Z=R(te);Z.trim()&&navigator.clipboard.writeText(Z).then(()=>{f.value=ee.id,V!==null&&clearTimeout(V),V=setTimeout(()=>{V=null,f.value=null},1400)}).catch(()=>{})}function se(te){if(te.blocks)return te.blocks;const ee=[];te.thinking&&ee.push({kind:"thinking",thinking:te.thinking}),te.text&&ee.push({kind:"text",text:te.text});for(const Z of te.tools??[])ee.push({kind:"tool",tool:Z});return ee}function Q(te){return!(te.tool.status==="ok"&&te.tool.media)}function me(te,ee){return ee<=1?"single":te===0?"first":te===ee-1?"last":"middle"}function $e(te){const ee=se(te),Z=[];let Ae=[];const G=()=>{if(Ae.length===1){const[oe]=Ae;oe&&Z.push({kind:"tool",tool:oe.tool,sourceIndex:oe.sourceIndex})}else Ae.length>1&&Z.push({kind:"tool-stack",tools:Ae});Ae=[]};return ee.forEach((oe,J)=>{if(oe.kind==="tool"){if(Q(oe)){Ae.push({tool:oe.tool,sourceIndex:J});return}G(),Z.push({kind:"tool",tool:oe.tool,sourceIndex:J});return}G(),oe.kind==="thinking"?Z.push({kind:"thinking",thinking:oe.thinking,sourceIndex:J}):oe.kind==="text"?Z.push({kind:"text",text:oe.text,sourceIndex:J}):oe.kind==="agent"?Z.push({kind:"agent",member:oe.member,sourceIndex:J}):Z.push({kind:"agentGroup",members:oe.members,sourceIndex:J})}),G(),Z}function He(te,ee){return te.id!==r.value?!1:ee.sourceIndex===se(te).length-1}function Be(te){return te.tool.id||`tool-${te.sourceIndex}`}function Ee(te,ee){return te.kind==="tool-stack"?`tool-stack-${te.tools[0]?.sourceIndex??ee}`:te.kind==="tool"?Be({tool:te.tool,sourceIndex:te.sourceIndex}):te.kind==="agent"?`agent-${te.member.id}-${te.sourceIndex}`:te.kind==="agentGroup"?`agent-group-${te.members[0]?.id??te.sourceIndex}`:`${te.kind}-${te.sourceIndex}`}return(te,ee)=>i.value?(S(),I("div",jW,[e.sessionLoading?(S(),I("div",zW,[ee[8]||(ee[8]=h("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),h("span",VW,N(A(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(S(),I("div",KW)):ue("",!0),(S(!0),I(Me,null,Ze(e.turns,(Z,Ae)=>(S(),I(Me,{key:Z.id},[Z.role==="user"?(S(),I(Me,{key:0},[h("div",{class:Te(["u-bub turn-anchor",{undoing:w.value===Z.id}]),"data-turn-id":Z.id},[Z.images&&Z.images.length>0?(S(),I("div",YW,[(S(!0),I(Me,null,Ze(Z.images,(G,oe)=>(S(),I(Me,{key:oe},[G.kind==="video"?(S(),I("video",{key:0,class:"u-img",src:G.url,controls:"",playsinline:"",preload:"metadata"},null,8,XW)):(S(),I("img",{key:1,class:"u-img",src:G.url,alt:G.alt||"",loading:"lazy"},null,8,ZW))],64))),128))])):ue("",!0),Z.skillActivation?(S(),I("div",JW,[h("div",QW,[ee[9]||(ee[9]=h("span",{class:"skill-act-arrow"},"▶",-1)),h("span",null,N(A(s)("conversation.activatedSkill",{name:Z.skillActivation.name})),1)]),Z.skillActivation.args?(S(),I("div",eU,N(Z.skillActivation.args),1)):ue("",!0)])):(S(),I("div",tU,N(Z.text),1))],10,GW),Z.createdAt||u(Z)?(S(),I("div",nU,[u(Z)?(S(),I("div",{key:0,class:Te(["u-edit-wrap",{undoing:w.value===Z.id}])},[g.value!==Z.id?(S(),I("button",{key:0,type:"button",class:"u-edit","data-tooltip":A(s)("conversation.undoTooltip"),onClick:G=>g.value=Z.id},[h("span",oU,N(A(s)("conversation.undo")),1),ee[10]||(ee[10]=h("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),h("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1))],8,sU)):(S(),I("div",{key:1,class:"u-edit-confirm",onClick:ee[1]||(ee[1]=Ye(()=>{},["stop"]))},[h("span",null,N(A(s)("conversation.undoConfirm")),1),h("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ye(G=>T(Z),["stop"])},N(A(s)("conversation.confirm")),9,iU),h("button",{type:"button",class:"u-edit-confirm-btn",onClick:ee[0]||(ee[0]=Ye(G=>g.value=null,["stop"]))},N(A(s)("conversation.cancel")),1)]))],2)):ue("",!0),Z.createdAt?(S(),I("button",{key:1,type:"button",class:"u-time",onClick:Ye(G=>y(Z.id),["stop"])},N(k(Z.createdAt,Z.id)),9,rU)):ue("",!0)])):ue("",!0)],64)):Z.role==="compaction"?(S(),I("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":Z.id,role:"separator"},[ee[11]||(ee[11]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1)),Z.text?(S(),I("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:G=>a("openCompaction",{turnId:Z.id})},[h("span",null,N(m(Z)),1),h("span",cU,N(A(s)("conversation.viewSummary")),1)],8,aU)):(S(),I("span",uU,N(m(Z)),1)),ee[12]||(ee[12]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,lU)):(S(),I("div",{key:2,class:"a-msg turn-anchor","data-turn-id":Z.id},[(S(!0),I(Me,null,Ze($e(Z),(G,oe)=>(S(),I(Me,{key:Ee(G,oe)},[G.kind==="thinking"?(S(),je(hw,{key:0,text:G.thinking,mobile:i.value,streaming:He(Z,G),onOpen:J=>a("openThinking",{turnId:Z.id,blockIndex:G.sourceIndex})},null,8,["text","mobile","streaming","onOpen"])):G.kind==="text"&&G.text?(S(),I("div",fU,[pt(Lf,{text:G.text,streaming:He(Z,G),"open-file":J=>a("openFile",J)},null,8,["text","streaming","open-file"])])):G.kind==="tool-stack"?(S(),I("div",hU,[(S(!0),I(Me,null,Ze(G.tools,(J,F)=>(S(),je(ed,{key:Be(J),tool:J.tool,mobile:i.value,"stack-position":me(F,G.tools.length),onOpenMedia:ee[2]||(ee[2]=Y=>a("openMedia",Y))},null,8,["tool","mobile","stack-position"]))),128))])):G.kind==="agent"?(S(),je(i1,{key:3,member:G.member,onOpen:J=>a("openAgent",{turnId:Z.id,blockIndex:G.sourceIndex,memberId:J})},null,8,["member","onOpen"])):G.kind==="agentGroup"?(S(),je(mw,{key:4,members:G.members,onOpen:J=>a("openAgent",{turnId:Z.id,blockIndex:G.sourceIndex,memberId:J})},null,8,["members","onOpen"])):G.kind==="tool"?(S(),je(ed,{key:5,tool:G.tool,mobile:i.value,onOpenMedia:ee[3]||(ee[3]=J=>a("openMedia",J))},null,8,["tool","mobile"])):ue("",!0)],64))),128)),Z.id!==r.value&&W(Ae)&&(R(Ae).trim().length>0||Z.durationMs!==void 0)?(S(),I("div",pU,[Z.durationMs!==void 0?(S(),I("span",{key:0,class:"a-duration",title:`${Z.durationMs} ms`},N(p(Z.durationMs)),9,mU)):ue("",!0),R(Ae).trim().length>0?(S(),I("button",{key:1,class:"a-cpbtn",tabindex:"-1",onClick:G=>z(Ae)},[f.value!==Z.id?(S(),I("svg",vU,[...ee[13]||(ee[13]=[h("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),h("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(S(),I("svg",yU,[...ee[14]||(ee[14]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),h("span",kU,N(A(s)("filePreview.copy")),1)],8,gU)):ue("",!0)])):ue("",!0)],8,dU))],64))),128)),e.compaction?(S(),je(pw,{key:2,label:A(s)("conversation.compacting")},null,8,["label"])):ue("",!0),l.value?(S(),I("div",bU,[pt(r1,{fast:e.fastMoon},null,8,["fast"])])):ue("",!0)])):(S(),I("div",_U,[e.sessionLoading?(S(),I("div",wU,[ee[15]||(ee[15]=h("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),h("span",SU,N(A(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(S(),I("div",CU)):ue("",!0),(S(!0),I(Me,null,Ze(e.turns,(Z,Ae)=>(S(),I(Me,{key:Z.id},[Z.role==="compaction"?(S(),I("div",{key:0,class:"compact-divider turn-anchor","data-turn-id":Z.id,role:"separator"},[ee[16]||(ee[16]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1)),Z.text?(S(),I("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:G=>a("openCompaction",{turnId:Z.id})},[h("span",null,N(m(Z)),1),h("span",AU,N(A(s)("conversation.viewSummary")),1)],8,TU)):(S(),I("span",MU,N(m(Z)),1)),ee[17]||(ee[17]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,xU)):(S(),I("div",{key:1,class:Te(["ln turn-anchor",[Z.role==="user"?"userline":"ai",{undoing:w.value===Z.id}]]),"data-turn-id":Z.id},[h("span",IU,N(Z.no),1),h("div",$U,[h("div",NU,[Z.role==="user"?(S(),I(Me,{key:0},[ee[18]||(ee[18]=h("span",{class:"pr"},"user@kimi",-1)),ee[19]||(ee[19]=h("span",{class:"who"}," $ ",-1))],64)):(S(),I(Me,{key:1},[ee[20]||(ee[20]=h("span",{class:"pr"},"kimi",-1)),ee[21]||(ee[21]=h("span",{class:"who"}," > ",-1))],64)),Z.id!==r.value&&W(Ae)&&R(Ae).trim().length>0?(S(),I("button",{key:2,class:"cpbtn",onClick:G=>z(Ae),tabindex:"-1"},[f.value!==Z.id?(S(),I("svg",RU,[...ee[22]||(ee[22]=[h("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),h("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(S(),I("svg",OU,[...ee[23]||(ee[23]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),h("span",PU,N(A(s)("filePreview.copy")),1)],8,LU)):ue("",!0),Z.durationMs!==void 0&&Z.role==="assistant"?(S(),I("span",{key:3,class:"turn-duration",title:`${Z.durationMs} ms`},N(p(Z.durationMs)),9,DU)):ue("",!0)]),Z.role==="user"?(S(),I("div",BU,[Z.skillActivation?(S(),I("div",FU,[h("div",HU,[ee[24]||(ee[24]=h("span",{class:"skill-act-arrow"},"▶",-1)),h("span",null,N(A(s)("conversation.activatedSkill",{name:Z.skillActivation.name})),1)]),Z.skillActivation.args?(S(),I("div",WU,N(Z.skillActivation.args),1)):ue("",!0)])):(S(),I(Me,{key:1},[vt(N(Z.text),1)],64))])):(S(!0),I(Me,{key:1},Ze($e(Z),(G,oe)=>(S(),I(Me,{key:Ee(G,oe)},[G.kind==="thinking"?(S(),je(hw,{key:0,text:G.thinking,streaming:He(Z,G),onOpen:J=>a("openThinking",{turnId:Z.id,blockIndex:G.sourceIndex})},null,8,["text","streaming","onOpen"])):G.kind==="text"&&G.text?(S(),je(Lf,{key:1,text:G.text,streaming:He(Z,G),"open-file":J=>a("openFile",J)},null,8,["text","streaming","open-file"])):G.kind==="tool-stack"?(S(),I("div",UU,[(S(!0),I(Me,null,Ze(G.tools,(J,F)=>(S(),je(ed,{key:Be(J),tool:J.tool,"stack-position":me(F,G.tools.length),onOpenMedia:ee[4]||(ee[4]=Y=>a("openMedia",Y))},null,8,["tool","stack-position"]))),128))])):G.kind==="agent"?(S(),je(i1,{key:3,member:G.member,onOpen:J=>a("openAgent",{turnId:Z.id,blockIndex:G.sourceIndex,memberId:J})},null,8,["member","onOpen"])):G.kind==="agentGroup"?(S(),je(mw,{key:4,members:G.members,onOpen:J=>a("openAgent",{turnId:Z.id,blockIndex:G.sourceIndex,memberId:J})},null,8,["members","onOpen"])):G.kind==="tool"?(S(),je(ed,{key:5,tool:G.tool,onOpenMedia:ee[5]||(ee[5]=J=>a("openMedia",J))},null,8,["tool"])):ue("",!0)],64))),128))]),Z.role==="user"&&u(Z)?(S(),I("div",{key:0,class:Te(["u-edit-wrap ln-edit-wrap",{undoing:w.value===Z.id}])},[g.value!==Z.id?(S(),I("button",{key:0,type:"button",class:"u-edit","data-tooltip":A(s)("conversation.undoTooltip"),onClick:G=>g.value=Z.id},[ee[25]||(ee[25]=h("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),h("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1)),h("span",jU,N(A(s)("conversation.undo")),1)],8,qU)):(S(),I("div",{key:1,class:"u-edit-confirm",onClick:ee[7]||(ee[7]=Ye(()=>{},["stop"]))},[h("span",null,N(A(s)("conversation.undoConfirm")),1),h("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ye(G=>T(Z),["stop"])},N(A(s)("conversation.confirm")),9,zU),h("button",{type:"button",class:"u-edit-confirm-btn",onClick:ee[6]||(ee[6]=Ye(G=>g.value=null,["stop"]))},N(A(s)("conversation.cancel")),1)]))],2)):ue("",!0)],10,EU))],64))),128)),e.compaction?(S(),je(pw,{key:2,label:A(s)("conversation.compacting")},null,8,["label"])):ue("",!0),l.value?(S(),I("div",VU,[ee[27]||(ee[27]=h("span",{class:"no"},"—",-1)),h("div",KU,[ee[26]||(ee[26]=h("div",{class:"role-row"},[h("span",{class:"pr"},"kimi"),h("span",{class:"who"}," > ")],-1)),pt(r1,{fast:e.fastMoon,label:"Sending…"},null,8,["fast"])])])):ue("",!0)]))}}),NT=yt(GU,[["__scopeId","data-v-16e5048a"]]),YU={class:"chat-header"},XU={class:"ch-id"},ZU={key:0,class:"ch-ws"},JU={key:1,class:"ch-sep"},QU=["onKeydown"],eq=["title"],tq=["title","aria-label","aria-expanded"],nq=["title"],sq={key:0,class:"ch-pill ch-sync-pill"},oq={key:0,class:"ch-ahead"},iq={key:1,class:"ch-behind"},rq={key:1,class:"ch-pill ch-diff-pill"},lq={key:0,class:"ch-add"},aq={key:1,class:"ch-del"},cq=["title"],uq=Xe({__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}=_t(),s=e,o=t,i=U(()=>s.ahead??0),r=U(()=>s.behind??0),l=U(()=>s.gitDiffStats?.totalAdditions??0),a=U(()=>s.gitDiffStats?.totalDeletions??0),c=U(()=>l.value>0||a.value>0),u=ie(!1),d=ie(null),p=ie(null),m=ie({});function f(V){const z=V.target;p.value?.contains(z)||d.value?.contains(z)||b()}function g(){b()}async function w(V){if(V.stopPropagation(),u.value){b();return}u.value=!0,document.addEventListener("mousedown",f),document.addEventListener("scroll",g,!0),window.addEventListener("resize",g),await ut();const z=d.value,se=p.value;if(!z||!se)return;const Q=z.getBoundingClientRect(),me=4,$e=8,He=se.offsetWidth,Be=se.offsetHeight;let Ee=Q.bottom+me;Ee+Be>window.innerHeight-$e&&(Ee=Math.max($e,Q.top-Be-me));let te=Q.left;te+He>window.innerWidth-$e&&(te=Math.max($e,Q.right-He)),m.value={top:`${Math.round(Ee)}px`,left:`${Math.round(te)}px`}}function b(){u.value=!1,O(),document.removeEventListener("mousedown",f),document.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}Gt(()=>{document.removeEventListener("mousedown",f),document.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)});function _(){o("copyAll"),b()}function v(){o("copyFinalSummary"),b()}const y=ie(!1);function k(){s.sessionId&&navigator.clipboard.writeText(s.sessionId).then(()=>{y.value=!0,setTimeout(()=>{y.value=!1},1200)}).catch(()=>{})}const T=ie(!1),E=ie(""),C=ie(null);async function M(){if(b(),!!s.sessionId){T.value=!0,E.value=s.sessionTitle??"",await ut();try{C.value?.focus(),C.value?.select()}catch{}}}function $(){const V=E.value.trim();V&&s.sessionId&&V!==(s.sessionTitle??"").trim()&&o("renameSession",s.sessionId,V),T.value=!1}function L(){T.value=!1}function D(){s.sessionId&&(b(),o("forkSession",s.sessionId))}const R=ie(!1);let P;function O(){clearTimeout(P),R.value=!1}function W(){if(s.sessionId){if(R.value){o("archiveSession",s.sessionId),b();return}R.value=!0,P=setTimeout(()=>{R.value=!1},2500)}}return(V,z)=>(S(),I("header",YU,[h("div",XU,[e.workspaceName?(S(),I("span",ZU,N(e.workspaceName),1)):ue("",!0),e.workspaceName&&e.sessionTitle?(S(),I("span",JU,"/")):ue("",!0),T.value?Lt((S(),I("input",{key:2,ref_key:"renameInputRef",ref:C,"onUpdate:modelValue":z[0]||(z[0]=se=>E.value=se),class:"ch-rename",type:"text",onKeydown:[Io(Ye($,["stop"]),["enter"]),Io(Ye(L,["stop"]),["esc"])],onBlur:$,onClick:z[1]||(z[1]=Ye(()=>{},["stop"]))},null,40,QU)),[[_n,E.value]]):e.sessionTitle?(S(),I("span",{key:3,class:"ch-ses",title:e.sessionTitle},N(e.sessionTitle),9,eq)):ue("",!0)]),h("button",{ref_key:"kebabRef",ref:d,type:"button",class:Te(["ch-act ch-act-more",{open:u.value}]),title:A(n)("header.options"),"aria-label":A(n)("header.options"),"aria-expanded":u.value,"aria-haspopup":"menu",onClick:z[2]||(z[2]=Ye(se=>w(se),["stop"]))},[...z[6]||(z[6]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"3",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"13",cy:"8",r:"1.3"})],-1)])],10,tq),u.value?(S(),I("div",{key:0,ref_key:"menuRef",ref:p,class:"ch-menu",style:Dt(m.value),onClick:z[3]||(z[3]=Ye(()=>{},["stop"]))},[h("button",{type:"button",class:"chm-item",onClick:Ye(_,["stop"])},N(e.copied?A(n)("header.copied"):A(n)("header.copyAll")),1),h("button",{type:"button",class:"chm-item",onClick:Ye(v,["stop"])},N(A(n)("header.copyFinalSummary")),1),e.sessionId?(S(),I(Me,{key:0},[z[7]||(z[7]=h("div",{class:"chm-divider"},null,-1)),h("button",{type:"button",class:"chm-item",onClick:Ye(k,["stop"])},[h("span",null,N(y.value?A(n)("header.copied"):A(n)("header.copySessionId")),1)]),h("button",{type:"button",class:"chm-item",onClick:Ye(M,["stop"])},N(A(n)("header.renameSession")),1),h("button",{type:"button",class:"chm-item",onClick:Ye(D,["stop"])},N(A(n)("header.forkSession")),1),h("button",{type:"button",class:"chm-item del",onClick:Ye(W,["stop"])},N(R.value?A(n)("header.confirmArchive"):A(n)("header.archiveSession")),1)],64)):ue("",!0)],4)):ue("",!0),z[9]||(z[9]=h("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(S(),I("button",{key:1,type:"button",class:"ch-git",title:A(n)("header.gitTooltip"),onClick:z[4]||(z[4]=se=>o("openChanges"))},[h("span",{class:Te(["ch-branch",{"ch-detached":!e.branch}])},N(e.branch||A(n)("header.detached")),3),i.value>0||r.value>0?(S(),I("span",sq,[i.value>0?(S(),I("span",oq,"↑"+N(i.value),1)):ue("",!0),r.value>0?(S(),I("span",iq,"↓"+N(r.value),1)):ue("",!0)])):ue("",!0),c.value?(S(),I("span",rq,[l.value>0?(S(),I("span",lq,"+"+N(l.value),1)):ue("",!0),a.value>0?(S(),I("span",aq,"-"+N(a.value),1)):ue("",!0)])):ue("",!0)],8,nq)):ue("",!0),e.pr?(S(),I("button",{key:2,type:"button",class:Te(["ch-pill ch-pr",`pr-${e.pr.state}`]),title:A(n)("header.openPr"),onClick:z[5]||(z[5]=se=>e.pr&&o("openPr",e.pr.url))},[z[8]||(z[8]=ur('<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-a77d7ee9><circle cx="5" cy="6" r="3" data-v-a77d7ee9></circle><path d="M5 9v12" data-v-a77d7ee9></path><circle cx="19" cy="18" r="3" data-v-a77d7ee9></circle><path d="m15 9-3-3 3-3" data-v-a77d7ee9></path><path d="M12 6h5a2 2 0 0 1 2 2v7" data-v-a77d7ee9></path></svg>',1)),h("span",null,"PR #"+N(e.pr.number)+" · "+N(e.pr.state),1)],10,cq)):ue("",!0)]))}}),dq=yt(uq,[["__scopeId","data-v-a77d7ee9"]]),fq={key:0,class:"slash-menu",role:"listbox"},hq=["aria-selected","onMouseenter","onMousedown"],pq={class:"slash-name"},mq={class:"slash-desc"},gq=Xe({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t;return(i,r)=>e.items.length>0?(S(),I("div",fq,[(S(!0),I(Me,null,Ze(e.items,(l,a)=>(S(),I("div",{key:l.name,class:Te(["slash-item",{active:a===s.activeIndex}]),role:"option","aria-selected":a===s.activeIndex,onMouseenter:c=>o("hover",a),onMousedown:Ye(c=>o("select",l),["prevent"])},[h("span",pq,N(l.name),1),h("span",mq,N(l.isSkill?l.desc:A(n)(l.desc)),1)],42,hq))),128))])):ue("",!0)}}),vq=yt(gq,[["__scopeId","data-v-354c4858"]]),yq={class:"mention-menu",role:"listbox"},kq={key:0,class:"mention-state dim"},bq={key:1,class:"mention-state dim"},_q=["aria-selected","onMouseenter","onMousedown"],wq=["innerHTML"],Sq={class:"mention-name"},Cq={class:"mention-path"},xq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',Tq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><polyline points="5.5,5 2.5,8 5.5,11"/><polyline points="10.5,5 13.5,8 10.5,11"/></svg>',Aq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><line x1="6" y1="8" x2="11" y2="8"/><line x1="6" y1="10.5" x2="11" y2="10.5"/></svg>',Mq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="3" width="12" height="10" rx="1"/><circle cx="5.5" cy="6.5" r="1.1"/><path d="M3 12l3.5-3.5L9 11l2-2 3 3"/></svg>',gw='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><polyline points="9,1.5 9,4.5 12,4.5"/></svg>',Eq=Xe({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=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"]),r=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),l=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function a(c){const u=c.path;if(u.endsWith("/"))return xq;const d=c.name||u.split("/").pop()||u,p=d.lastIndexOf("."),m=p>0?d.slice(p+1).toLowerCase():"";return m?i.has(m)?Tq:r.has(m)?Aq:l.has(m)?Mq:gw:gw}return(c,u)=>(S(),I("div",yq,[n.loading?(S(),I("div",kq,N(A(o)("mention.searching")),1)):n.items.length===0?(S(),I("div",bq,N(A(o)("mention.noMatch")),1)):(S(!0),I(Me,{key:2},Ze(n.items,(d,p)=>(S(),I("div",{key:d.path,class:Te(["mention-item",{active:p===n.activeIndex}]),role:"option","aria-selected":p===n.activeIndex,onMouseenter:m=>s("hover",p),onMousedown:Ye(m=>s("select",d),["prevent"])},[h("span",{class:"mention-icon",innerHTML:a(d),"aria-hidden":"true"},null,8,wq),h("span",Sq,N(d.name),1),h("span",Cq,N(d.path),1)],42,_q))),128))]))}}),Iq=yt(Eq,[["__scopeId","data-v-13371515"]]),LT=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/sessions",desc:"commands.sessions.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/provider",desc:"commands.provider.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 $q(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)}}function vw(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0}));return[...LT,...t]}function Nq(e,t=LT){const n=e.toLowerCase().trim();return n===""||n==="/"?t:t.filter(s=>s.name.toLowerCase().includes(n))}function RT(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 OT(e,t){switch(RT(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const Lq={key:0,class:"att-strip"},Rq=["title","onClick"],Oq=["src"],Pq=["src","alt"],Dq={key:2,class:"att-video-badge","aria-hidden":"true"},Bq={class:"att-name"},Fq=["aria-label"],Hq=["title"],Wq=["title","onClick"],Uq={class:"att-lightbox-card"},qq=["title"],jq=["src"],zq=["src","alt"],Vq={class:"att-lightbox-name"},Kq={class:"composer-card"},Gq={class:"cin-wrap"},Yq={class:"input-row"},Xq=["placeholder"],Zq=["aria-label","title"],Jq={class:"toolbar-left"},Qq=["title"],ej=["title","onKeydown"],tj=["onClick"],nj={class:"pd-check"},sj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},oj={class:"pd-info"},ij={class:"pd-desc"},rj=["title"],lj={class:"mode-label"},aj={key:0,class:"mode-tag"},cj={key:1,class:"mode-tag"},uj={key:2,class:"mode-tag"},dj={class:"mode-row-name"},fj={class:"mode-row-name"},hj={class:"mode-row-name"},pj={key:0,class:"mode-row-actions"},mj={class:"toolbar-right"},gj=["title"],vj={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},yj=["stroke-dasharray","stroke-dashoffset"],kj={class:"ctx-num"},bj=["title","onKeydown"],_j={key:0,class:"think-suffix"},wj={key:0,class:"md-section"},Sj=["onClick"],Cj={class:"md-check"},xj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Tj={class:"md-name"},Aj={class:"md-provider"},Mj={key:1,class:"md-divider"},Ej={key:2,class:"md-section"},Ij=["onClick"],$j={class:"md-check"},Nj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Lj={class:"md-name"},Rj={key:0,class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},Oj={key:3,class:"md-divider"},Pj=["disabled"],Dj={class:"md-check"},Bj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Fj={class:"md-name"},Hj={key:0,class:"md-note"},Wj={key:1,class:"md-note"},Uj={class:"md-name"},qj="kimi-web.draft.",jj=Xe({__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 s=e,o=U(()=>s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=_t();function l(xe){return qj+(xe&&xe.length>0?xe:"__new__")}function a(xe){try{return localStorage.getItem(l(xe))??""}catch{return""}}function c(xe,Re){try{const qe=l(xe);Re?localStorage.setItem(qe,Re):localStorage.removeItem(qe)}catch{}}const u=ie(a(s.sessionId)),d=ie(null);function p(){const xe=d.value;xe&&xe.style.removeProperty("height")}Ve(u,xe=>{ut(p),c(s.sessionId,xe)}),Ve(()=>s.sessionId,(xe,Re)=>{xe!==Re&&(c(Re,u.value),u.value=a(xe),ut(p))});const m=ie([]);let f=-1,g="";function w(xe){const Re=xe.trim();f=-1,Re&&m.value[m.value.length-1]!==Re&&(m.value=[...m.value,Re])}function b(){const xe=d.value;if(!xe)return!1;const Re=xe.selectionStart??0;return xe.value.lastIndexOf(`
242
- `,Re-1)===-1}function _(xe){u.value=xe,ut(()=>{const Re=d.value;if(!Re)return;p();const qe=xe.length;Re.setSelectionRange(qe,qe)})}function v(){if(m.value.length!==0){if(f===-1)g=u.value,f=m.value.length-1;else if(f>0)f-=1;else return;_(m.value[f])}}function y(){f!==-1&&(f<m.value.length-1?(f+=1,_(m.value[f])):(f=-1,_(g)))}const k=ie(!1),T=ie([]),E=ie(0);function C(){const xe=u.value;xe.startsWith("/")&&!xe.includes(" ")?(T.value=Nq(xe,vw(s.skills)),E.value=0,k.value=T.value.length>0):k.value=!1}function M(xe){if(k.value=!1,xe.acceptsInput){u.value=`${xe.name} `,ut(()=>{const Re=d.value;if(!Re)return;const qe=u.value.length;Re.setSelectionRange(qe,qe),Re.focus(),p()});return}u.value="",i("command",xe.name)}const $=ie(!1),L=ie([]),D=ie(0),R=ie(!1);let P=null;function O(){const xe=u.value,Re=d.value?.selectionStart??xe.length;let qe=Re-1;for(;qe>=0&&!/\s/.test(xe[qe]);)qe--;qe++;const st=xe.slice(qe,Re);return st.startsWith("@")?{token:st.slice(1),start:qe,end:Re}:null}function W(){const xe=O();if(!xe||!s.searchFiles){$.value=!1;return}const Re=xe.token;P!==null&&clearTimeout(P),P=setTimeout(async()=>{R.value=!0,$.value=!0,D.value=0;try{const qe=await s.searchFiles(Re);L.value=qe}catch{L.value=[]}finally{R.value=!1}},200)}function V(xe){const Re=O();if(!Re)return;const qe=u.value;u.value=qe.slice(0,Re.start)+xe.path+qe.slice(Re.end),$.value=!1,ut(()=>{const st=d.value;if(!st)return;const Rn=Re.start+xe.path.length;st.setSelectionRange(Rn,Rn),st.focus(),p()})}function z(){f=-1,C(),W()}const se=ie([]),Q=ie(null),me=ie(null),$e=ie(!1);let He=0;function Be(){return`att_${++He}`}function Ee(xe){try{URL.revokeObjectURL(xe.previewUrl)}catch{}}function te(xe){return xe.startsWith("image/")?"image":xe.startsWith("video/")?"video":null}async function ee(xe){if(!s.uploadImage)return;const Re=xe.map(qe=>({file:qe,kind:te(qe.type)})).filter(qe=>qe.kind!==null);if(Re.length!==0)for(const{file:qe,kind:st}of Re){const Rn=Be(),en=URL.createObjectURL(qe),Zn={localId:Rn,name:qe.name,kind:st,previewUrl:en,uploading:!0};se.value=[...se.value,Zn],s.uploadImage(qe,qe.name).then(rn=>{se.value=se.value.map(Bs=>Bs.localId===Rn?{...Bs,uploading:!1,fileId:rn?.fileId,error:rn===null}:Bs)}).catch(()=>{se.value=se.value.map(rn=>rn.localId===Rn?{...rn,uploading:!1,error:!0}:rn)})}}function Z(xe){const Re=se.value.find(qe=>qe.localId===xe);Q.value?.localId===xe&&(Q.value=null),Re&&Ee(Re),se.value=se.value.filter(qe=>qe.localId!==xe)}function Ae(xe){Q.value=xe}function G(){Q.value=null}function oe(){me.value?.click()}function J(xe){const Re=xe.target,qe=Array.from(Re.files??[]);ee(qe),Re.value=""}function F(xe){if(!s.uploadImage)return;const Re=xe.clipboardData;if(!Re)return;const qe=[],st=new Set,Rn=(en,Zn)=>{const rn=`${en.size}:${en.type}:${Zn}`;if(st.has(rn))return;st.add(rn);const Bs=en.type.split("/")[1]??"png",wr=Zn.includes(".")?Zn:`paste-${Date.now()}.${Bs}`;qe.push(en instanceof File?en:new File([en],wr,{type:en.type}))};for(const en of Array.from(Re.items))if(en.kind==="file"&&te(en.type)){const Zn=en.getAsFile();Zn&&Rn(Zn,Zn.name||`paste-${Date.now()}.${en.type.split("/")[1]??"png"}`)}for(const en of Array.from(Re.files))te(en.type)&&Rn(en,en.name);qe.length!==0&&(xe.preventDefault(),ee(qe))}function Y(xe){!s.uploadImage||!Array.from(xe.dataTransfer?.items??[]).some(qe=>qe.kind==="file")||(xe.preventDefault(),$e.value=!0)}function le(){$e.value=!1}function re(xe){if($e.value=!1,!s.uploadImage)return;xe.preventDefault();const Re=Array.from(xe.dataTransfer?.files??[]);ee(Re)}sn(()=>{document.addEventListener("paste",F),u.value&&ut(p)}),Gt(()=>{document.removeEventListener("paste",F),document.removeEventListener("mousedown",En);for(const xe of se.value)Ee(xe);Q.value=null,ke()});function fe(xe){u.value=xe,ut(()=>{const Re=d.value;if(!Re)return;Re.focus();const qe=xe.length;Re.setSelectionRange(qe,qe),p()})}t({loadForEdit:fe});function q(){const xe=u.value.trim();if(se.value.some(st=>st.uploading))return;const Re=se.value.filter(st=>!st.uploading&&!st.error&&st.fileId);if(!xe&&Re.length===0)return;if(xe){const st=$q(xe),Rn=st?vw(s.skills).some(en=>en.name===st.cmd):!1;if(st&&Rn){u.value="",k.value=!1,i("command",st.arg?`${st.cmd} ${st.arg}`:st.cmd);return}}const qe={text:xe,attachments:Re.map(st=>({fileId:st.fileId,kind:st.kind}))};Q.value=null;for(const st of se.value)Ee(st);se.value=[],w(xe),u.value="",k.value=!1,$.value=!1,i("submit",qe)}function X(){if(!s.running||se.value.some(st=>st.uploading))return;const xe=u.value.trim(),Re=se.value.filter(st=>!st.uploading&&!st.error&&st.fileId);if(!xe&&Re.length===0&&s.queued.length===0)return;const qe={text:xe,attachments:Re.map(st=>({fileId:st.fileId,kind:st.kind}))};for(const st of se.value)Ee(st);se.value=[],w(xe),u.value="",k.value=!1,$.value=!1,i("steer",qe)}let de=!1,he=null;function ke(){he!==null&&(clearTimeout(he),he=null)}function Ce(){ke(),de=!0}function ae(){ke(),he=setTimeout(()=>{he=null,de=!1},0)}function _e(xe){return de||xe.isComposing||xe.keyCode===229}function ze(xe){if(!_e(xe)){if(xe.key==="Escape"){if(Ge.value){xe.preventDefault(),Ft();return}if(ft.value){xe.preventDefault(),_s();return}}if(k.value){if(xe.key==="ArrowDown"){xe.preventDefault(),E.value=(E.value+1)%T.value.length;return}if(xe.key==="ArrowUp"){xe.preventDefault(),E.value=(E.value-1+T.value.length)%T.value.length;return}if(xe.key==="Enter"||xe.key==="Tab"){xe.preventDefault();const Re=T.value[E.value];Re&&M(Re);return}if(xe.key==="Escape"){xe.preventDefault(),k.value=!1;return}}if($.value&&!R.value){if(xe.key==="ArrowDown"){xe.preventDefault(),D.value=(D.value+1)%Math.max(1,L.value.length);return}if(xe.key==="ArrowUp"){xe.preventDefault(),D.value=(D.value-1+Math.max(1,L.value.length))%Math.max(1,L.value.length);return}if(xe.key==="Enter"||xe.key==="Tab"){xe.preventDefault();const Re=L.value[D.value];Re&&V(Re);return}if(xe.key==="Escape"){xe.preventDefault(),$.value=!1;return}}if(xe.key==="s"&&(xe.ctrlKey||xe.metaKey)&&!xe.shiftKey&&!xe.altKey){s.running&&(xe.preventDefault(),X());return}if(!k.value&&!$.value&&!xe.shiftKey&&!xe.altKey&&!xe.metaKey&&!xe.ctrlKey){const Re=f!==-1;if(xe.key==="ArrowUp"&&m.value.length>0&&(Re||b())){xe.preventDefault(),v();return}if(xe.key==="ArrowDown"&&Re){xe.preventDefault(),y();return}}xe.key==="Enter"&&!xe.shiftKey&&(xe.preventDefault(),q())}}const Qe=U(()=>s.running?r("composer.interrupt"):r("composer.send")),dt=U(()=>!!s.uploadImage),Ge=ie(!1),ft=ie(!1),Ct=ie(null);function Jt(){Ge.value=!Ge.value,Ge.value?(ft.value=!1,document.addEventListener("click",Ke,!0)):document.removeEventListener("click",Ke,!0)}function Ft(){Ge.value=!1,ft.value||document.removeEventListener("click",Ke,!0)}function Xn(){ft.value=!ft.value,ft.value?(Ge.value=!1,document.addEventListener("click",Ke,!0)):document.removeEventListener("click",Ke,!0)}function _s(){ft.value=!1,Ge.value||document.removeEventListener("click",Ke,!0)}function Ke(xe){Ct.value&&!Ct.value.contains(xe.target)&&(Ft(),_s())}Gt(()=>{document.removeEventListener("click",Ke,!0)});const Et=xe=>`${Math.round(xe/1e3)}k`,ls=U(()=>{const xe=s.status?.ctxMax??0;return xe<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/xe*100)))}),Os=U(()=>{const xe=(s.status?.ctxUsed??0).toLocaleString(),Re=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:xe,max:Re,pct:ls.value})}),eo=U(()=>ls.value>=80),Oo=U(()=>{const xe=s.status?.modelId??s.status?.model??"";return s.models?.find(Re=>Re.id===xe||Re.model===xe||Re.displayName===s.status?.model)}),Ps=U(()=>RT(Oo.value)),Fn=U(()=>Ps.value==="toggle"),un=U(()=>Ps.value==="always-on"?!0:Ps.value==="unsupported"?!1:(s.thinking??"off")!=="off");function to(){Fn.value&&i("setThinking",un.value?"off":"high")}const Mn=U(()=>s.planMode===!0),Hn=U(()=>s.swarmMode===!0),Wn=U(()=>s.activationBadges?.goal!==null),Po=U(()=>Wn.value||s.goalMode===!0),wt=ie(!1),as=ie(null),Qt=ie(null),ni=ie({}),no=U(()=>Mn.value||Hn.value||Po.value);function ws(){wt.value=!1,document.removeEventListener("mousedown",En)}function En(xe){const Re=xe.target;as.value?.contains(Re)||Qt.value?.contains(Re)||ws()}function Ds(){if(wt.value){ws();return}const xe=as.value?.getBoundingClientRect();xe&&(ni.value={left:`${Math.round(xe.left)}px`,bottom:`${Math.round(window.innerHeight-xe.top+8)}px`}),wt.value=!0,setTimeout(()=>document.addEventListener("mousedown",En),0)}const Un=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--warn)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--err)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}];function gt(xe){i("setPermission",xe),_s()}const Ie=U(()=>Un.find(xe=>xe.mode===s.status?.permission)),ye=U(()=>Ie.value?r(Ie.value.labelKey):""),Le=U(()=>Oo.value?.provider??""),St=U(()=>!Le.value||!s.models?.length?[]:s.models.filter(xe=>xe.provider===Le.value)),At=U(()=>new Set(s.starredIds??[]));function mn(xe){return At.value.has(xe)}const dn=U(()=>s.models?.length?s.models.filter(xe=>mn(xe.id)&&xe.provider!==Le.value):[]);function so(xe){i("selectModel",xe),Ft()}return(xe,Re)=>(S(),I("div",{class:Te(["composer",{"drag-over":$e.value}]),onDragover:Y,onDragleave:le,onDrop:re},[se.value.length>0?(S(),I("div",Lq,[(S(!0),I(Me,null,Ze(se.value,qe=>(S(),I("div",{key:qe.localId,class:Te(["att-chip",{"att-error":qe.error}])},[h("button",{type:"button",class:"att-preview",title:A(r)("composer.previewAttachment",{name:qe.name}),onClick:st=>Ae(qe)},[qe.kind==="video"?(S(),I("video",{key:0,class:"att-thumb",src:qe.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,Oq)):(S(),I("img",{key:1,class:"att-thumb",src:qe.previewUrl,alt:qe.name},null,8,Pq)),qe.kind==="video"?(S(),I("span",Dq,[...Re[14]||(Re[14]=[h("svg",{viewBox:"0 0 16 16",width:"9",height:"9",fill:"currentColor"},[h("path",{d:"M5 3.5v9l7-4.5z"})],-1)])])):ue("",!0)],8,Rq),h("span",Bq,N(qe.name),1),qe.uploading?(S(),I("span",{key:0,class:"att-spinner","aria-label":A(r)("composer.uploading")},[...Re[15]||(Re[15]=[h("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("circle",{cx:"8",cy:"8",r:"6","stroke-opacity":"0.25"}),h("path",{d:"M8 2 A6 6 0 0 1 14 8","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"0.8s",repeatCount:"indefinite"})])],-1)])],8,Fq)):qe.error?(S(),I("span",{key:1,class:"att-err-icon",title:A(r)("composer.uploadFailed")},[...Re[16]||(Re[16]=[h("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("circle",{cx:"6",cy:"6",r:"5"}),h("line",{x1:"6",y1:"3.5",x2:"6",y2:"6.5"}),h("circle",{cx:"6",cy:"8.5",r:"0.5",fill:"currentColor"})],-1)])],8,Hq)):ue("",!0),h("button",{class:"att-rm",title:A(r)("composer.removeNamed",{name:qe.name}),onClick:st=>Z(qe.localId)},[...Re[17]||(Re[17]=[h("svg",{viewBox:"0 0 12 12",width:"9",height:"9",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,Wq)],2))),128))])):ue("",!0),Q.value?(S(),I("div",{key:1,class:"att-lightbox",onClick:Ye(G,["self"])},[h("div",Uq,[h("button",{type:"button",class:"att-lightbox-close",title:A(r)("model.close"),onClick:G},"✕",8,qq),Q.value.kind==="video"?(S(),I("video",{key:0,class:"att-lightbox-media",src:Q.value.previewUrl,controls:"",playsinline:""},null,8,jq)):(S(),I("img",{key:1,class:"att-lightbox-media",src:Q.value.previewUrl,alt:Q.value.name},null,8,zq)),h("div",Vq,N(Q.value.name),1)])])):ue("",!0),h("div",Kq,[h("div",Gq,[k.value?(S(),je(vq,{key:0,items:T.value,"active-index":E.value,onSelect:M,onHover:Re[0]||(Re[0]=qe=>E.value=qe)},null,8,["items","active-index"])):ue("",!0),$.value?(S(),je(Iq,{key:1,items:L.value,"active-index":D.value,loading:R.value,onSelect:V,onHover:Re[1]||(Re[1]=qe=>D.value=qe)},null,8,["items","active-index","loading"])):ue("",!0),h("div",Yq,[Lt(h("textarea",{ref_key:"textareaRef",ref:d,"onUpdate:modelValue":Re[2]||(Re[2]=qe=>u.value=qe),class:"ph",placeholder:o.value,rows:"1",onKeydown:ze,onCompositionstart:Ce,onCompositionend:ae,onInput:z},null,40,Xq),[[_n,u.value]]),h("button",{class:Te(["send",{aborting:e.running}]),"aria-label":Qe.value,title:e.running?A(r)("composer.interruptTitle"):Qe.value,onClick:Re[3]||(Re[3]=qe=>e.running?i("interrupt"):q())},[(S(),I("svg",{class:Te(["send-icon",{hidden:e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...Re[18]||(Re[18]=[h("path",{d:"M8 3l6 5.5M8 3L2 8.5M8 3v10"},null,-1)])],2)),(S(),I("svg",{class:Te(["send-icon",{hidden:!e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[...Re[19]||(Re[19]=[h("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1.5"},null,-1)])],2))],10,Zq)])]),dt.value?(S(),I("input",{key:0,ref_key:"fileInputRef",ref:me,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:J},null,544)):ue("",!0),h("div",{ref_key:"toolbarRef",ref:Ct,class:"toolbar"},[h("div",Jq,[dt.value?(S(),I("button",{key:0,class:"attach-btn",title:A(r)("composer.attachImage"),type:"button",onClick:oe},[...Re[20]||(Re[20]=[h("svg",{class:"attach-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},[h("path",{d:"M8 3v10M3 8h10"})],-1)])],8,Qq)):ue("",!0),e.status?(S(),I("span",{key:1,class:Te(["perm-pill",["perm-"+e.status.permission,{open:ft.value}]]),role:"button",tabindex:"0",title:A(r)("status.permissionTooltip"),onClick:Ye(Xn,["stop"]),onKeydown:[Io(Xn,["enter"]),Io(Ye(Xn,["prevent"]),["space"])]},N(ye.value),43,ej)):ue("",!0),ft.value&&e.status?(S(),I("div",{key:2,class:"perm-dropdown",role:"menu",onClick:Re[4]||(Re[4]=Ye(()=>{},["stop"]))},[(S(),I(Me,null,Ze(Un,qe=>h("button",{key:qe.mode,class:Te(["pd-row",{"is-current":qe.mode===e.status.permission}]),role:"menuitem",onClick:st=>gt(qe.mode)},[h("span",nj,[qe.mode===e.status.permission?(S(),I("svg",sj,[...Re[21]||(Re[21]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ue("",!0)]),h("span",oj,[h("span",{class:"pd-name",style:Dt({color:qe.color})},N(A(r)(qe.labelKey)),5),h("span",ij,N(A(r)(qe.descKey)),1)])],10,tj)),64))])):ue("",!0),e.status?(S(),I("div",{key:3,ref_key:"modesRef",ref:as,class:"modes"},[h("button",{type:"button",class:Te(["mode-pill",{on:no.value}]),title:A(r)("status.modesTooltip"),onClick:Ye(Ds,["stop"])},[h("span",lj,N(A(r)("status.modesLabel")),1),Mn.value?(S(),I("span",aj,N(A(r)("status.planLabel")),1)):ue("",!0),Hn.value?(S(),I("span",cj,N(A(r)("status.swarmLabel")),1)):ue("",!0),Po.value?(S(),I("span",uj,N(A(r)("status.goalLabel")),1)):ue("",!0)],10,rj),wt.value?(S(),I("div",{key:0,ref_key:"modesMenuRef",ref:Qt,class:"modes-menu",style:Dt(ni.value)},[h("button",{type:"button",class:Te(["mode-row",{on:Mn.value}]),onClick:Re[5]||(Re[5]=qe=>i("togglePlan"))},[h("span",dj,N(A(r)("status.planLabel")),1),h("span",{class:Te(["mode-switch",{on:Mn.value}])},[...Re[22]||(Re[22]=[h("span",{class:"mode-knob"},null,-1)])],2)],2),h("button",{type:"button",class:Te(["mode-row",{on:Hn.value}]),onClick:Re[6]||(Re[6]=qe=>i("toggleSwarm"))},[h("span",fj,N(A(r)("status.swarmLabel")),1),h("span",{class:Te(["mode-switch",{on:Hn.value}])},[...Re[23]||(Re[23]=[h("span",{class:"mode-knob"},null,-1)])],2)],2),h("div",{class:Te(["mode-row mode-row-goal",{on:Wn.value||s.goalMode}])},[h("button",{type:"button",class:"mode-row-main",onClick:Re[7]||(Re[7]=qe=>Wn.value?i("controlGoal","cancel"):i("toggleGoal"))},[h("span",hj,N(A(r)("status.goalLabel")),1),Wn.value?ue("",!0):(S(),I("span",{key:0,class:Te(["mode-switch",{on:s.goalMode}])},[...Re[24]||(Re[24]=[h("span",{class:"mode-knob"},null,-1)])],2))]),Wn.value?(S(),I("div",pj,[h("button",{type:"button",class:"mode-row-action",onClick:Re[8]||(Re[8]=qe=>i("controlGoal","pause"))},N(A(r)("status.goalPause")),1),h("button",{type:"button",class:"mode-row-action",onClick:Re[9]||(Re[9]=qe=>i("controlGoal","resume"))},N(A(r)("status.goalResume")),1)])):ue("",!0)],2)],4)):ue("",!0)],512)):ue("",!0)]),h("div",mj,[eo.value?(S(),I("button",{key:0,class:"compact-chip",onClick:Re[10]||(Re[10]=Ye(qe=>i("compact"),["stop"]))},"/compact")):ue("",!0),e.status&&!e.hideContext?(S(),I("span",{key:1,class:"ctx-group",title:Os.value},[(S(),I("svg",vj,[Re[25]||(Re[25]=h("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5"},null,-1)),h("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${2*Math.PI*7}`,"stroke-dashoffset":`${2*Math.PI*7*(1-ls.value/100)}`},null,8,yj)])),h("span",kj,N(Et(e.status.ctxUsed))+"/"+N(Et(e.status.ctxMax)),1)],8,gj)):ue("",!0),e.status?(S(),I("span",{key:2,class:Te(["model-pill",{open:Ge.value}]),role:"button",tabindex:"0",title:A(r)("status.modelTooltip"),onClick:Ye(Jt,["stop"]),onKeydown:[Io(Jt,["enter"]),Io(Ye(Jt,["prevent"]),["space"])]},[h("b",null,N(e.status.model),1),un.value?(S(),I("span",_j,N(A(r)("composer.thinkingSuffix")),1)):ue("",!0),Re[26]||(Re[26]=h("svg",{class:"cv",viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M4 6l4 4 4-4"})],-1))],42,bj)):ue("",!0)]),Ge.value&&e.status?(S(),I("div",{key:0,class:"model-dropdown",role:"menu",onClick:Re[13]||(Re[13]=Ye(()=>{},["stop"]))},[dn.value.length>0?(S(),I("div",wj,N(A(r)("status.starredModels")),1)):ue("",!0),(S(!0),I(Me,null,Ze(dn.value,qe=>(S(),I("button",{key:qe.id,class:Te(["md-row",{"is-current":qe.id===e.status.modelId}]),role:"menuitem",onClick:st=>so(qe.id)},[h("span",Cj,[qe.id===e.status.model||qe.model===e.status.model||qe.displayName===e.status.model?(S(),I("svg",xj,[...Re[27]||(Re[27]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ue("",!0)]),h("span",Tj,N(qe.displayName??qe.model),1),h("span",Aj,N(qe.provider),1),Re[28]||(Re[28]=h("svg",{class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},[h("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})],-1))],10,Sj))),128)),dn.value.length>0?(S(),I("div",Mj)):ue("",!0),St.value.length>0?(S(),I("div",Ej,N(Le.value),1)):ue("",!0),(S(!0),I(Me,null,Ze(St.value,qe=>(S(),I("button",{key:qe.id,class:Te(["md-row",{"is-current":qe.id===e.status.modelId}]),role:"menuitem",onClick:st=>so(qe.id)},[h("span",$j,[qe.id===e.status.model||qe.model===e.status.model||qe.displayName===e.status.model?(S(),I("svg",Nj,[...Re[29]||(Re[29]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ue("",!0)]),h("span",Lj,N(qe.displayName??qe.model),1),mn(qe.id)?(S(),I("svg",Rj,[...Re[30]||(Re[30]=[h("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,-1)])])):ue("",!0)],10,Ij))),128)),St.value.length>0?(S(),I("div",Oj)):ue("",!0),h("button",{class:Te(["md-row md-row-toggle",{"is-on":un.value,"is-disabled":!Fn.value}]),role:"menuitem",disabled:!Fn.value,onClick:Re[11]||(Re[11]=qe=>to())},[h("span",Dj,[un.value?(S(),I("svg",Bj,[...Re[31]||(Re[31]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ue("",!0)]),h("span",Fj,N(A(r)("status.thinkingLabel")),1),Ps.value==="always-on"?(S(),I("span",Hj,N(A(r)("status.planOn")),1)):Ps.value==="unsupported"?(S(),I("span",Wj,N(A(r)("status.modeNotSupported")),1)):ue("",!0)],10,Pj),Re[32]||(Re[32]=h("div",{class:"md-divider"},null,-1)),h("button",{class:"md-row md-row-more",role:"menuitem",onClick:Re[12]||(Re[12]=qe=>{Ft(),i("pickModel")})},[h("span",Uj,N(A(r)("status.moreModels")),1)])])):ue("",!0)],512)])],34))}}),PT=yt(jj,[["__scopeId","data-v-0ebe5422"]]),zj=["id"],Vj={class:"swarm-head"},Kj={class:"swarm-count"},Gj={class:"swarm-grid"},Yj={class:"member-top"},Xj={class:"member-name"},Zj={class:"member-phase"},Jj={class:"member-mid"},Qj={class:"member-bar"},ez={key:0,class:"member-type"},tz={key:0,class:"member-bottom"},nz=Xe({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=U(()=>t.group.members.length),s=U(()=>t.group.counts.completed+t.group.counts.failed);function o(l){switch(l){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function i(l){switch(l.phase){case"queued":return"......";case"working":return":::...";case"suspended":return"::....";case"completed":return"::::::";case"failed":return"!!...."}}function r(l){return l.outputLines?.map(a=>a.trimEnd()).filter(Boolean).at(-1)}return(l,a)=>(S(),I("section",{class:"swarm-card",id:`swarm-${e.group.id}`},[h("header",Vj,[a[0]||(a[0]=h("div",{class:"swarm-title"},[h("span",{class:"swarm-mark","aria-hidden":"true"}),h("span",null,"Swarm")],-1)),h("div",Kj,N(s.value)+"/"+N(n.value),1)]),h("div",Gj,[(S(!0),I(Me,null,Ze(e.group.members,c=>(S(),I("article",{key:c.id,class:Te(["swarm-member",`phase-${c.phase}`])},[h("div",Yj,[h("span",Xj,N(c.name),1),h("span",Zj,N(o(c.phase)),1)]),h("div",Jj,[h("span",Qj,N(i(c)),1),c.subagentType?(S(),I("span",ez,N(c.subagentType),1)):ue("",!0)]),c.suspendedReason||r(c)||c.summary?(S(),I("div",tz,N(c.suspendedReason||r(c)||c.summary),1)):ue("",!0)],2))),128))])],8,zj))}}),sz=yt(nz,[["__scopeId","data-v-6ae42022"]]),oz={class:"goal-progress","aria-hidden":"true"},iz={key:0,class:"goal-body"},rz={class:"goal-full"},lz={key:0,class:"goal-criterion"},az={class:"goal-stats"},cz={key:0},uz={class:"goal-actions"},dz=Xe({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=ie(!1);Ve(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=U(()=>{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)=>(S(),I("section",{class:Te(["goal-strip",{expanded:i.value}])},[h("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[5]||(c[5]=h("span",{class:"goal-kicker"},"Goal",-1)),h("span",{class:Te(["goal-objective",{"expanded-hidden":i.value}])},N(e.goal.objective),3),h("span",{class:Te(["goal-status",`status-${e.goal.status}`])},N(e.goal.status),3),h("span",oz,[h("span",{class:"goal-progress-fill",style:Dt({width:`${r.value}%`})},null,4)]),(S(),I("svg",{class:Te(["goal-chevron",{open:i.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...c[4]||(c[4]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),i.value?(S(),I("div",iz,[h("div",rz,N(e.goal.objective),1),e.goal.completionCriterion?(S(),I("div",lz,[c[6]||(c[6]=h("span",null,"Done when",-1)),h("p",null,N(e.goal.completionCriterion),1)])):ue("",!0),h("div",az,[h("span",null,N(e.goal.turnsUsed)+" turns",1),h("span",null,N(e.goal.tokensUsed.toLocaleString())+" tokens",1),h("span",null,N(l(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(S(),I("span",cz,N(r.value)+"% token budget",1)):ue("",!0)]),h("div",uz,[e.goal.status!=="paused"?(S(),I("button",{key:0,type:"button",class:"goal-action",onClick:c[1]||(c[1]=Ye(u=>s("controlGoal","pause"),["stop"]))},N(A(o)("status.goalPause")),1)):ue("",!0),e.goal.status==="paused"?(S(),I("button",{key:1,type:"button",class:"goal-action primary",onClick:c[2]||(c[2]=Ye(u=>s("controlGoal","resume"),["stop"]))},N(A(o)("status.goalResume")),1)):ue("",!0),h("button",{type:"button",class:"goal-action danger",onClick:c[3]||(c[3]=Ye(u=>s("controlGoal","cancel"),["stop"]))},N(A(o)("status.goalCancel")),1)])])):ue("",!0)],2))}}),fz=yt(dz,[["__scopeId","data-v-bca1710c"]]),hz={class:"qh"},pz={class:"qtitle"},mz={class:"qstep"},gz=["disabled"],vz=["disabled"],yz={key:1,class:"qmin-peek"},kz=["title","aria-label"],bz={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},_z={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},wz={key:0,class:"qbody"},Sz={key:0,class:"qheader-chip"},Cz={class:"qtext"},xz={class:"qopts"},Tz=["onClick"],Az={class:"qopt-key"},Mz={class:"qopt-glyph"},Ez={key:0,class:"chk"},Iz={key:1,class:"rad"},$z={class:"qopt-text"},Nz={class:"qopt-label"},Lz={key:0,class:"qopt-desc"},Rz={class:"qopt-glyph"},Oz={key:0,class:"chk"},Pz={key:1,class:"rad"},Dz={class:"qopt-label"},Bz=["placeholder"],Fz={key:1,class:"qfooter"},Hz=["disabled"],Wz=Xe({__name:"QuestionCard",props:{question:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=_t(),o=t,i=ie(0),r=ie(!1),l=U(()=>n.question.questions[i.value]),a=U(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}const d=ie({});function p(C){return C.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${C.label} ${C.description??""}`.toLowerCase())}function m(){const C={...d.value};let M=!1;for(const $ of n.question.questions){if(C[$.id])continue;const L=$.options.filter(p);L.length!==0&&(C[$.id]=$.multiSelect?{kind:"multi",optionIds:L.map(D=>D.id)}:{kind:"single",optionId:L[0].id},M=!0)}M&&(d.value=C)}Ve(()=>n.question.questionId,()=>{i.value=0,r.value=!1,d.value={},w.value={}}),Ve(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),m()},{immediate:!0,deep:!0});function f(C,M){const $=d.value[C];if($&&$.kind==="single"&&$.optionId===M){const L={...d.value};delete L[C],d.value=L}else d.value={...d.value,[C]:{kind:"single",optionId:M}}}function g(C,M){const $=d.value[C],L=$&&($.kind==="multi"||$.kind==="multiWithOther")?$.kind==="multi"?[...$.optionIds]:[...$.optionIds]:[],D=L.indexOf(M);D>=0?L.splice(D,1):L.push(M);const R=d.value[C],P=R&&R.kind==="multiWithOther"?R.otherText:"";P?d.value={...d.value,[C]:{kind:"multiWithOther",optionIds:L,otherText:P}}:d.value={...d.value,[C]:{kind:"multi",optionIds:L}}}const w=ie({});function b(C){const M=n.question.questions.find(L=>L.id===C),$=w.value[C]??"";if(M.multiSelect){const L=d.value[C],D=L&&(L.kind==="multi"||L.kind==="multiWithOther")?L.kind==="multi"?[...L.optionIds]:[...L.optionIds]:[];d.value={...d.value,[C]:{kind:"multiWithOther",optionIds:D,otherText:$}}}else d.value={...d.value,[C]:{kind:"other",text:$}}}function _(C,M){const $=d.value[C];return $?$.kind==="single"?$.optionId===M:$.kind==="multi"||$.kind==="multiWithOther"?$.optionIds.includes(M):!1:!1}function v(C){const M=d.value[C];return!!(M&&(M.kind==="other"||M.kind==="multiWithOther"))}function y(){return n.question.questions.every(C=>{const M=d.value[C.id];return M?M.kind==="multi"?M.optionIds.length>0:M.kind==="multiWithOther"?M.optionIds.length>0||M.otherText.trim().length>0:M.kind==="other"?M.text.trim().length>0:!0:!1})}function k(){if(!y())return;const C={answers:d.value,method:"click"};o("answer",n.question.questionId,C)}function T(){o("dismiss",n.question.questionId)}function E(C){const M=(document.activeElement?.tagName??"").toLowerCase();if(M==="input"||M==="textarea"||r.value&&C.key!=="Escape")return;if(C.key==="Escape"){C.preventDefault(),T();return}if(C.key==="Enter"){C.preventDefault(),k();return}const $=parseInt(C.key,10);if(!isNaN($)&&$>=1&&$<=9){C.preventDefault();const L=l.value,D=$-1,R=L.options[D];R&&(L.multiSelect?g(L.id,R.id):f(L.id,R.id))}}return sn(()=>document.addEventListener("keydown",E)),Gt(()=>document.removeEventListener("keydown",E)),(C,M)=>(S(),I("div",{class:Te(["qcard",{minimized:r.value}])},[h("div",hz,[h("span",pz,N(A(s)("question.title")),1),a.value>1&&!r.value?(S(),I(Me,{key:0},[h("span",mz,N(A(s)("question.step",{current:i.value+1,total:a.value})),1),h("button",{class:"qnav",disabled:i.value===0,onClick:c},N(A(s)("question.prev")),9,gz),h("button",{class:"qnav",disabled:i.value===a.value-1,onClick:u},N(A(s)("question.next")),9,vz)],64)):ue("",!0),r.value?(S(),I("span",yz,N(l.value.question),1)):ue("",!0),h("button",{class:"qmin",title:r.value?A(s)("question.expand"):A(s)("question.minimize"),"aria-label":r.value?A(s)("question.expand"):A(s)("question.minimize"),onClick:M[0]||(M[0]=$=>r.value=!r.value)},[r.value?(S(),I("svg",bz,[...M[4]||(M[4]=[h("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(S(),I("svg",_z,[...M[5]||(M[5]=[h("path",{d:"M3 8h10"},null,-1)])]))],8,kz)]),r.value?ue("",!0):(S(),I("div",wz,[l.value.header?(S(),I("div",Sz,N(l.value.header),1)):ue("",!0),h("div",Cz,N(l.value.question),1),l.value.body?(S(),je(Lf,{key:1,text:l.value.body,class:"qmdbody"},null,8,["text"])):ue("",!0),h("div",xz,[(S(!0),I(Me,null,Ze(l.value.options,($,L)=>(S(),I("label",{key:$.id,class:Te(["qopt",{selected:_(l.value.id,$.id)}]),onClick:Ye(D=>l.value.multiSelect?g(l.value.id,$.id):f(l.value.id,$.id),["prevent"])},[h("span",Az,N(L+1),1),h("span",Mz,[l.value.multiSelect?(S(),I("span",Ez,N(_(l.value.id,$.id)?"■":"□"),1)):(S(),I("span",Iz,N(_(l.value.id,$.id)?"●":"○"),1))]),h("span",$z,[h("span",Nz,N($.label),1),$.description?(S(),I("span",Lz,N($.description),1)):ue("",!0)])],10,Tz))),128)),l.value.allowOther?(S(),I("label",{key:0,class:Te(["qopt",{selected:v(l.value.id)}]),onClick:Ye(()=>{},["prevent"])},[M[6]||(M[6]=h("span",{class:"qopt-key"},null,-1)),h("span",Rz,[l.value.multiSelect?(S(),I("span",Oz,N(v(l.value.id)?"■":"□"),1)):(S(),I("span",Pz,N(v(l.value.id)?"●":"○"),1))]),h("span",Dz,N(l.value.otherLabel??A(s)("question.otherDefault")),1),Lt(h("input",{"onUpdate:modelValue":M[1]||(M[1]=$=>w.value[l.value.id]=$),class:"other-input",type:"text",placeholder:l.value.otherLabel??A(s)("question.otherDefault"),onInput:M[2]||(M[2]=$=>b(l.value.id)),onFocus:M[3]||(M[3]=$=>b(l.value.id))},null,40,Bz),[[_n,w.value[l.value.id]]])],2)):ue("",!0)])])),r.value?ue("",!0):(S(),I("div",Fz,[h("button",{class:"qbtn pri",disabled:!y(),onClick:k},N(A(s)("question.submit")),9,Hz),h("button",{class:"qbtn",onClick:T},N(A(s)("question.dismiss")),1)]))],2))}}),Uz=yt(Wz,[["__scopeId","data-v-e5fa2cb7"]]),qz={class:"ah"},jz={class:"akind"},zz={class:"apath"},Vz={key:0,class:"abadge"},Kz={key:1,class:"aw"},Gz=["title","aria-label"],Yz={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},Xz={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},Zz={key:0,class:"diff"},Jz={class:"dg"},Qz={class:"dc"},eV={key:1,class:"body-shell"},tV={class:"shell-cmd"},nV={key:0,class:"shell-cwd"},sV={key:1,class:"shell-danger"},oV={key:2,class:"body-file"},iV={class:"file-bar"},rV={class:"file-lang"},lV={class:"file-content"},aV={class:"file-ln"},cV={class:"file-text"},uV={key:3,class:"body-chip"},dV={class:"chip-label"},fV={class:"chip-value"},hV={key:0,class:"chip-detail"},pV={key:4,class:"body-chip"},mV={key:0,class:"chip-label"},gV={class:"chip-value"},vV={key:5,class:"body-chip"},yV={class:"chip-label"},kV={class:"chip-value"},bV={key:0,class:"chip-detail"},_V={key:6,class:"body-chip"},wV={class:"chip-label"},SV={class:"chip-value"},CV={key:0,class:"chip-detail"},xV={key:7,class:"body-todo"},TV={class:"todo-glyph"},AV={key:8,class:"body-generic"},MV={class:"gen-text"},EV={key:9,class:"feedback-wrap"},IV=["placeholder"],$V={class:"feedback-hint"},NV={class:"abtn"},LV=Xe({__name:"ApprovalCard",props:{block:{},agentName:{}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=ie(!1),r=["shell","diff","file","fileop","url","search","invocation","todo","generic"];function l(){const v=r.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${v}`)}const a=ie(!1),c=ie(""),u=ie(null);function d(){a.value=!0,c.value="",setTimeout(()=>u.value?.focus(),0)}function p(){const v=c.value.trim();s("decide",{decision:"rejected",feedback:v||void 0}),a.value=!1,c.value=""}function m(){a.value=!1,c.value=""}function f(v){v.key==="Enter"&&!v.shiftKey?(v.preventDefault(),p()):v.key==="Escape"&&(v.preventDefault(),m())}function g(){s("decide",{decision:"approved"})}function w(){s("decide",{decision:"approved",scope:"session"})}function b(){s("decide",{decision:"rejected"})}function _(v){const y=(document.activeElement?.tagName??"").toLowerCase();y==="input"||y==="textarea"||i.value||(v.key==="1"?(v.preventDefault(),g()):v.key==="2"?(v.preventDefault(),w()):v.key==="3"?(v.preventDefault(),b()):v.key==="4"&&(v.preventDefault(),d()))}return sn(()=>document.addEventListener("keydown",_)),Gt(()=>document.removeEventListener("keydown",_)),(v,y)=>(S(),I("div",{class:Te(["appr",{minimized:i.value}])},[h("div",qz,[h("span",jz,N(l()),1),h("span",zz,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(S(),I(Me,{key:0},[vt(N(e.block.path),1)],64)):e.block.kind==="shell"?(S(),I(Me,{key:1},[vt(N(e.block.command),1)],64)):e.block.kind==="url"?(S(),I(Me,{key:2},[vt(N(e.block.url),1)],64)):e.block.kind==="search"?(S(),I(Me,{key:3},[vt(N(e.block.query),1)],64)):e.block.kind==="invocation"?(S(),I(Me,{key:4},[vt(N(e.block.name),1)],64)):e.block.kind==="generic"?(S(),I(Me,{key:5},[vt(N(e.block.summary),1)],64)):ue("",!0)]),e.agentName&&!i.value?(S(),I("span",Vz,N(A(o)("approval.subagentBadge",{name:e.agentName})),1)):ue("",!0),i.value?ue("",!0):(S(),I("span",Kz,N(A(o)("approval.required")),1)),h("button",{class:"amin",title:i.value?A(o)("question.expand"):A(o)("question.minimize"),"aria-label":i.value?A(o)("question.expand"):A(o)("question.minimize"),onClick:y[0]||(y[0]=k=>i.value=!i.value)},[i.value?(S(),I("svg",Yz,[...y[2]||(y[2]=[h("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(S(),I("svg",Xz,[...y[3]||(y[3]=[h("path",{d:"M3 8h10"},null,-1)])]))],8,Gz)]),i.value?ue("",!0):(S(),I(Me,{key:0},[e.block.kind==="diff"?(S(),I("div",Zz,[(S(!0),I(Me,null,Ze(e.block.diff,(k,T)=>(S(),I("div",{key:T,class:Te(["dl",k.kind==="add"?"add":k.kind==="rem"?"del":""])},[h("span",Jz,N(k.gutter),1),h("span",Qz,N(k.text),1)],2))),128))])):e.block.kind==="shell"?(S(),I("div",eV,[h("div",tV,[y[4]||(y[4]=h("span",{class:"shell-dollar"},"$",-1)),vt(" "+N(e.block.command),1)]),e.block.cwd?(S(),I("div",nV,"cwd: "+N(e.block.cwd),1)):ue("",!0),e.block.danger?(S(),I("div",sV,N(A(o)("approval.danger",{detail:e.block.danger})),1)):ue("",!0)])):e.block.kind==="file"?(S(),I("div",oV,[h("div",iV,[h("span",rV,N(e.block.language??""),1)]),h("div",lV,[(S(!0),I(Me,null,Ze(e.block.content.split(`
243
- `),(k,T)=>(S(),I("div",{key:T,class:"file-line"},[h("span",aV,N(T+1),1),h("span",cV,N(k),1)]))),128))])])):e.block.kind==="fileop"?(S(),I("div",uV,[h("span",dV,N(e.block.op),1),h("span",fV,N(e.block.path),1),e.block.detail?(S(),I("span",hV,N(e.block.detail),1)):ue("",!0)])):e.block.kind==="url"?(S(),I("div",pV,[e.block.method?(S(),I("span",mV,N(e.block.method),1)):ue("",!0),h("span",gV,N(e.block.url),1)])):e.block.kind==="search"?(S(),I("div",vV,[h("span",yV,N(A(o)("approval.searchQueryLabel")),1),h("span",kV,N(e.block.query),1),e.block.scope?(S(),I("span",bV,N(A(o)("approval.searchScope",{scope:e.block.scope})),1)):ue("",!0)])):e.block.kind==="invocation"?(S(),I("div",_V,[h("span",wV,N(e.block.kind2),1),h("span",SV,N(e.block.name),1),e.block.description?(S(),I("span",CV,N(e.block.description),1)):ue("",!0)])):e.block.kind==="todo"?(S(),I("div",xV,[(S(!0),I(Me,null,Ze(e.block.items,(k,T)=>(S(),I("div",{key:T,class:"todo-item"},[h("span",TV,N(k.status==="done"||k.status==="completed"?"✓":"○"),1),h("span",{class:Te(["todo-title",{"todo-done":k.status==="done"||k.status==="completed"}])},N(k.title),3)]))),128))])):(S(),I("div",AV,[h("span",MV,N(e.block.summary),1)])),a.value?(S(),I("div",EV,[Lt(h("textarea",{ref_key:"feedbackRef",ref:u,"onUpdate:modelValue":y[1]||(y[1]=k=>c.value=k),class:"feedback-ta",placeholder:A(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:f},null,40,IV),[[_n,c.value]]),h("div",$V,N(A(o)("approval.feedbackHint")),1)])):ue("",!0),h("div",NV,[h("div",{class:"kbtn pri",onClick:g},[vt(N(A(o)("approval.approve")),1),y[5]||(y[5]=h("span",{class:"k"},"[1]",-1))]),h("div",{class:"kbtn",onClick:w},[vt(N(A(o)("approval.approveSession")),1),y[6]||(y[6]=h("span",{class:"k"},"[2]",-1))]),h("div",{class:"kbtn",onClick:b},[vt(N(A(o)("approval.reject")),1),y[7]||(y[7]=h("span",{class:"k"},"[3]",-1))]),h("div",{class:"kbtn",onClick:d},[vt(N(A(o)("approval.feedback")),1),y[8]||(y[8]=h("span",{class:"k"},"[4]",-1))])])],64))],2))}}),RV=yt(LV,[["__scopeId","data-v-01d528a6"]]),OV={class:"taskspane"},PV={class:"tp-head"},DV={class:"tp-title"},BV={class:"tp-count"},FV={class:"tp-list"},HV={key:0,class:"tp-empty"},WV=["role","onClick"],UV={class:"tp-name"},qV={class:"tp-kind"},jV={class:"tp-time"},zV=["onClick"],VV={key:0,class:"tp-detail"},KV={key:0,class:"tp-codebox"},GV=["onClick"],YV={class:"tp-pre"},XV={class:"tp-cmd"},ZV={key:1,class:"tp-codebox"},JV=["onClick"],QV={class:"tp-pre"},eK=Xe({__name:"TasksPane",props:{tasks:{}},emits:["cancel"],setup(e,{emit:t}){const n=t,{t:s}=_t(),o=qs(new Set),i=qs(new Set),r=qs(new Set);function l(f){return!!(f.output&&f.output.length>0||f.meta)}function a(f){l(f)&&(o.has(f.id)?o.delete(f.id):o.add(f.id))}function c(f){switch(f){case"run":return"●";case"done":return"✓";case"fail":return"✗";default:return"○"}}function u(f){switch(f){case"run":return"s-run";case"done":return"s-done";case"fail":return"s-fail";default:return"s-pending"}}async function d(f,g,w){try{await navigator.clipboard.writeText(f),w.add(g),setTimeout(()=>w.delete(g),1500)}catch{}}async function p(f){f.meta&&await d(f.meta,f.id,i)}async function m(f){const g=f.output?.join(`
244
- `)??"";g&&await d(g,f.id,r)}return(f,g)=>(S(),I("div",OV,[h("div",PV,[h("span",DV,N(A(s)("tasks.tag")),1),h("span",BV,N(e.tasks.length),1)]),h("div",FV,[e.tasks.length===0?(S(),I("div",HV,N(A(s)("tasks.emptyTasks")),1)):(S(!0),I(Me,{key:1},Ze(e.tasks,w=>(S(),I("div",{key:w.id,class:Te(["tp-row",{done:w.state==="done",fail:w.state==="fail",expandable:l(w)}])},[h("div",{class:"tp-main",role:l(w)?"button":void 0,onClick:b=>a(w)},[h("span",{class:Te(["tp-glyph",u(w.state)])},N(c(w.state)),3),h("span",UV,N(w.name),1),h("span",qV,N(w.kind),1),h("span",jV,N(w.timing),1),w.state==="run"?(S(),I("button",{key:0,class:"tp-stop",onClick:Ye(b=>n("cancel",w.id),["stop"])},N(A(s)("tasks.stop")),9,zV)):ue("",!0),l(w)?(S(),I("svg",{key:1,class:Te(["tp-chevron",{open:o.has(w.id)}]),viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...g[0]||(g[0]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])],2)):ue("",!0)],8,WV),o.has(w.id)&&l(w)?(S(),I("div",VV,[w.meta?(S(),I("div",KV,[h("button",{class:Te(["tp-copy",{copied:i.has(w.id)}]),onClick:Ye(b=>p(w),["stop"])},N(i.has(w.id)?"已复制":"复制"),11,GV),h("pre",YV,[h("code",null,[h("span",XV,N(w.meta),1)])])])):ue("",!0),w.output&&w.output.length>0?(S(),I("div",ZV,[h("button",{class:Te(["tp-copy",{copied:r.has(w.id)}]),onClick:Ye(b=>m(w),["stop"])},N(r.has(w.id)?"已复制":"复制"),11,JV),h("pre",QV,[h("code",null,[g[1]||(g[1]=vt(`
245
- `,-1)),(S(!0),I(Me,null,Ze(w.output,(b,_)=>(S(),I("span",{key:_,class:"tp-line"},N(b),1))),128)),g[2]||(g[2]=vt(`
246
- `,-1))])])])):ue("",!0)])):ue("",!0)],2))),128))])]))}}),yw=yt(eK,[["__scopeId","data-v-99eb3f76"]]),tK={class:"tc-title"},nK={key:0,class:"tc-count"},sK={key:0,class:"tc-list"},oK={key:0,class:"tc-empty"},iK={class:"tc-name"},rK=Xe({__name:"TodoCard",props:{todos:{},inline:{type:Boolean}},setup(e){const t=e,{t:n}=_t(),s=ie(!1),o=U(()=>!t.inline),i=U(()=>t.inline||!s.value);function r(){o.value&&(s.value=!s.value)}const l=U(()=>t.todos.filter(c=>c.status==="done").length);function a(c){return c==="done"?"done":c==="in_progress"?"in_progress":"pending"}return(c,u)=>(S(),I("div",{class:Te(["todo-card",{"tab-mode":e.inline}])},[(S(),je(ss(o.value?"button":"div"),{class:Te(["tc-head",{static:!o.value}]),type:o.value?"button":void 0,onClick:r},{default:yn(()=>[u[1]||(u[1]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.4","aria-hidden":"true"},[h("polyline",{points:"2,4.5 3.5,6 5.5,3"}),h("polyline",{points:"2,11 3.5,12.5 5.5,9.5"}),h("line",{x1:"8",y1:"4.5",x2:"14",y2:"4.5"}),h("line",{x1:"8",y1:"11",x2:"14",y2:"11"})],-1)),h("span",tK,N(A(n)("tasks.todoTag")),1),e.todos.length>0?(S(),I("span",nK,N(l.value)+"/"+N(e.todos.length),1)):ue("",!0),o.value&&e.todos.length>0?(S(),I("svg",{key:1,class:Te(["tc-chev",{open:!s.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...u[0]||(u[0]=[h("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2)):ue("",!0)]),_:1},8,["class","type"])),i.value?(S(),I("div",sK,[e.todos.length===0?(S(),I("div",oK,N(A(n)("tasks.emptyTodo")),1)):ue("",!0),(S(!0),I(Me,null,Ze(e.todos,(d,p)=>(S(),I("div",{key:p,class:Te(["tc-row",`s-${d.status}`])},[h("span",{class:Te(["tc-glyph",`g-${a(d.status)}`])},null,2),h("span",iK,N(d.title),1)],2))),128))])):ue("",!0)],2))}}),lK=yt(rK,[["__scopeId","data-v-aa76ea4d"]]),aK={key:0,class:"queue-head"},cK={class:"queue-label"},uK=["title"],dK={class:"queue-list"},fK=["disabled","title","onClick"],hK={key:0,class:"queue-img",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},pK=["title","onClick"],mK=Xe({__name:"QueuePane",props:{queued:{},running:{type:Boolean},inline:{type:Boolean}},emits:["steer","unqueue","editQueued"],setup(e,{emit:t}){const n=t,{t:s}=_t();function o(i,r){r.attachmentCount>0||n("editQueued",i)}return(i,r)=>(S(),I("div",{class:Te(["queue-pane",{"tab-mode":e.inline}])},[e.inline?ue("",!0):(S(),I("div",aK,[h("span",cK,N(A(s)("composer.queueLabel"))+" · "+N(e.queued.length),1),e.running?(S(),I("button",{key:0,class:"queue-steer",type:"button",title:A(s)("composer.steerTitle"),onClick:r[0]||(r[0]=l=>n("steer"))},N(A(s)("composer.steerNow")),9,uK)):ue("",!0)])),h("div",dK,[(S(!0),I(Me,null,Ze(e.queued,(l,a)=>(S(),I("div",{key:a,class:"queue-item"},[h("button",{class:"queue-text",type:"button",disabled:l.attachmentCount>0,title:l.attachmentCount>0?A(s)("composer.queuedHasImage",{n:l.attachmentCount}):A(s)("composer.editQueued"),onClick:c=>o(a,l)},[l.attachmentCount>0?(S(),I("svg",hK,[...r[1]||(r[1]=[h("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},null,-1),h("circle",{cx:"5.5",cy:"6.5",r:"1.2"},null,-1),h("path",{d:"M2.5 12l3.5-3.5 2.5 2.5 3-3 2 2"},null,-1)])])):ue("",!0),h("span",{class:Te(["queue-text-inner",{placeholder:!l.text}])},N(l.text||A(s)("composer.queuedImageOnly",{n:l.attachmentCount})),3)],8,fK),h("button",{class:"queue-rm",title:A(s)("composer.remove"),onClick:c=>n("unqueue",a)},[...r[2]||(r[2]=[h("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,pK)]))),128))])],2))}}),gK=yt(mK,[["__scopeId","data-v-32b1ed3b"]]),vK={class:"dock-work-head"},yK={key:0,class:"dock-work-tab static"},kK={key:1,class:"dock-work-tab static"},bK={key:2,class:"dock-work-tab static"},_K={key:3,class:"dock-work-tab static"},wK=["title"],SK={class:"dock-work-body"},CK=["aria-pressed"],xK={class:"dw-count"},TK=["aria-pressed"],AK={class:"dw-count"},MK=["aria-pressed"],EK={class:"dw-count"},IK=["aria-pressed"],$K={class:"dw-count"},NK=Xe({__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:{},pendingApproval:{},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=_t(),r=ie(null),l=ie(null),a=ie(null);function c(p){r.value?.loadForEdit(p)}function u(p){const m=s.queued?.[p]?.text??"";m&&c(m),o("editQueued",p)}function d(p){if(!s.dockPanel)return;const m=p.target;m&&(l.value?.contains(m)||a.value?.contains(m)||o("close-dock-panel"))}return Ve(()=>s.dockPanel,p=>{typeof document>"u"||(document.removeEventListener("mousedown",d,!0),p&&document.addEventListener("mousedown",d,!0))},{immediate:!0}),Gt(()=>{typeof document<"u"&&document.removeEventListener("mousedown",d,!0)}),t({loadForEdit:c}),(p,m)=>(S(),I("div",{class:Te(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:m[31]||(m[31]=Ye(()=>{},["stop"]))},[pt(Si,{name:"dock-panel"},{default:yn(()=>[e.dockPanel?(S(),I("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:m[5]||(m[5]=Ye(()=>{},["stop"]))},[h("div",vK,[e.dockPanel==="bash"?(S(),I("span",yK,N(A(i)("tasks.dockBash"))+" · "+N(e.bashRunning)+" "+N(A(i)("tasks.running")),1)):e.dockPanel==="subagent"?(S(),I("span",kK,N(A(i)("tasks.dockSubagent"))+" · "+N(e.subagentRunning)+" "+N(A(i)("tasks.running")),1)):e.dockPanel==="todos"?(S(),I("span",bK,N(A(i)("tasks.dockTodos"))+" · "+N(e.todoDoneCount)+"/"+N(e.todos?.length??0),1)):e.dockPanel==="queue"?(S(),I("span",_K,N(A(i)("tasks.dockQueue"))+" · "+N(e.queued?.length??0),1)):ue("",!0),e.dockPanel==="queue"&&e.running?(S(),I("button",{key:4,type:"button",class:"dock-queue-steer",title:A(i)("composer.steerTitle"),onClick:m[0]||(m[0]=f=>o("steer",{text:"",attachments:[]}))},N(A(i)("composer.steerNow")),9,wK)):ue("",!0)]),h("div",SK,[e.dockPanel==="bash"?(S(),je(yw,{key:0,tasks:e.bashTasks,onCancel:m[1]||(m[1]=f=>o("cancelTask",f))},null,8,["tasks"])):e.dockPanel==="subagent"?(S(),je(yw,{key:1,tasks:e.subagentTasks,onCancel:m[2]||(m[2]=f=>o("cancelTask",f))},null,8,["tasks"])):e.dockPanel==="todos"?(S(),je(lK,{key:2,todos:e.todos??[],inline:""},null,8,["todos"])):(S(),je(gK,{key:3,queued:e.queued??[],running:e.running,inline:"",onSteer:m[3]||(m[3]=f=>o("steer",{text:"",attachments:[]})),onUnqueue:m[4]||(m[4]=f=>o("unqueue",f)),onEditQueued:u},null,8,["queued","running"]))])],512)):ue("",!0)]),_:1}),e.goal?(S(),je(fz,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:m[6]||(m[6]=f=>o("controlGoal",f))},null,8,["goal","force-expanded"])):ue("",!0),e.hasDockWork?(S(),I("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(S(),I("button",{key:0,type:"button",class:Te(["dock-work-chip",{on:e.dockPanel==="bash"}]),"aria-pressed":e.dockPanel==="bash",onClick:m[7]||(m[7]=f=>o("toggle-dock-panel","bash"))},[m[34]||(m[34]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[h("circle",{cx:"8",cy:"8",r:"5.5"}),h("path",{d:"M8 4.5V8l2.5 1.5"})],-1)),h("span",null,N(A(i)("tasks.dockBash")),1),h("span",xK,[m[32]||(m[32]=vt("(",-1)),h("b",null,N(e.bashTasks.length),1),m[33]||(m[33]=vt(")",-1))])],10,CK)):ue("",!0),e.subagentTasks.length>0?(S(),I("button",{key:1,type:"button",class:Te(["dock-work-chip",{on:e.dockPanel==="subagent"}]),"aria-pressed":e.dockPanel==="subagent",onClick:m[8]||(m[8]=f=>o("toggle-dock-panel","subagent"))},[m[37]||(m[37]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"})],-1)),h("span",null,N(A(i)("tasks.dockSubagent")),1),h("span",AK,[m[35]||(m[35]=vt("(",-1)),h("b",null,N(e.subagentTasks.length),1),m[36]||(m[36]=vt(")",-1))])],10,TK)):ue("",!0),(e.todos?.length??0)>0?(S(),I("button",{key:2,type:"button",class:Te(["dock-work-chip",{on:e.dockPanel==="todos"}]),"aria-pressed":e.dockPanel==="todos",onClick:m[9]||(m[9]=f=>o("toggle-dock-panel","todos"))},[m[40]||(m[40]=ur('<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" data-v-8dab8b74><path d="M3 4.5l1.5 1.5L7 3.5" data-v-8dab8b74></path><path d="M8.5 5h4" data-v-8dab8b74></path><path d="M3 11l1.5 1.5L7 10" data-v-8dab8b74></path><path d="M8.5 11.5h4" data-v-8dab8b74></path></svg>',1)),h("span",null,N(A(i)("tasks.dockTodos")),1),h("span",EK,[m[38]||(m[38]=vt("(",-1)),h("b",null,N(e.todoDoneCount)+"/"+N(e.todos?.length??0),1),m[39]||(m[39]=vt(")",-1))])],10,MK)):ue("",!0),(e.queued?.length??0)>0?(S(),I("button",{key:3,type:"button",class:Te(["dock-work-chip",{on:e.dockPanel==="queue"}]),"aria-pressed":e.dockPanel==="queue",onClick:m[10]||(m[10]=f=>o("toggle-dock-panel","queue"))},[m[43]||(m[43]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[h("path",{d:"M2 4l6 4 6-4"}),h("rect",{x:"2",y:"4",width:"12",height:"8",rx:"1.5"})],-1)),h("span",null,N(A(i)("tasks.dockQueue")),1),h("span",$K,[m[41]||(m[41]=vt("(",-1)),h("b",null,N(e.queued?.length??0),1),m[42]||(m[42]=vt(")",-1))])],10,IK)):ue("",!0)],512)):ue("",!0),e.pendingQuestion?(S(),je(Uz,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,onAnswer:m[11]||(m[11]=(f,g)=>o("answer",f,g)),onDismiss:m[12]||(m[12]=f=>o("dismiss",f))},null,8,["question"])):e.pendingApproval?(S(),je(RV,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,onDecide:m[13]||(m[13]=f=>o("approval",e.pendingApproval.approvalId,f))},null,8,["block","agent-name"])):(S(),je(PT,{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:m[14]||(m[14]=f=>o("submit",f)),onSteer:m[15]||(m[15]=f=>o("steer",f)),onCommand:m[16]||(m[16]=f=>o("command",f)),onInterrupt:m[17]||(m[17]=f=>o("interrupt")),onSetPermission:m[18]||(m[18]=f=>o("setPermission",f)),onSetThinking:m[19]||(m[19]=f=>o("setThinking",f)),onTogglePlan:m[20]||(m[20]=f=>o("togglePlan")),onToggleSwarm:m[21]||(m[21]=f=>o("toggleSwarm")),onToggleGoal:m[22]||(m[22]=f=>o("toggleGoal")),onOpenBtw:m[23]||(m[23]=f=>o("openBtw")),onCreateGoal:m[24]||(m[24]=f=>o("createGoal",f)),onControlGoal:m[25]||(m[25]=f=>o("controlGoal",f)),onFocusGoal:m[26]||(m[26]=f=>o("focusGoal")),onFocusSwarm:m[27]||(m[27]=f=>o("focusSwarm")),onCompact:m[28]||(m[28]=f=>o("compact")),onPickModel:m[29]||(m[29]=f=>o("pickModel")),onSelectModel:m[30]||(m[30]=f=>o("selectModel",f))},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))}}),LK=yt(NK,[["__scopeId","data-v-8dab8b74"]]),RK=5;function OK(e,t,n,s=RK){if(n||e.length<=s)return e;const o=e.slice(0,s);if(t&&!o.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(o[s-1]=i)}return o}const PK=["aria-label"],DK={class:"toc-track"},BK=["aria-label","onMouseenter","onClick"],FK={class:"toc-no"},HK={class:"chat-layout"},WK={class:"empty-hint"},UK={class:"empty-hint-title"},qK={class:"empty-hint-text"},jK={key:0,class:"ws-pick"},zK=["title"],VK={class:"ws-pick-name"},KK={key:1,class:"ws-pick-menu"},GK=["onClick"],YK={class:"ws-pick-item-name"},XK={class:"ws-pick-item-path"},ZK={key:0,class:"swarm-stack"},JK=["aria-label"],QK={key:0,class:"abort-toast",role:"status","aria-live":"polite"},eG={class:"abort-toast-text"},gd=10,tG=56,nG=420,kw=80,sG=1e3,oG=3e3,iG=Xe({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},swarms:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},modern:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},betaToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=ie(!1),r=ie(!1),l=U(()=>s.workspaces?.find(ye=>ye.id===s.activeWorkspaceId)?.name??s.workspaceName??""),a=U(()=>(s.workspaces?.length??0)>0),c=U(()=>OK(s.workspaces??[],s.activeWorkspaceId,r.value)),u=U(()=>(s.workspaces?.length??0)-c.value.length);Ve(i,Ie=>{Ie||(r.value=!1)});const d=U(()=>s.swarms?.filter(Ie=>Ie.members.some(ye=>ye.phase!=="completed"&&ye.phase!=="failed"))??[]);function p(Ie){i.value=!1,Ie!==s.activeWorkspaceId&&o("selectWorkspace",Ie)}const{t:m}=_t();try{localStorage.removeItem("kimi-web.content-align")}catch{}const f=ie(null),g=ie(null),w=ie(null),b=ie(!1),_=ie(0);let v=null;function y(Ie){(w.value??g.value)?.loadForEdit(Ie)}function k(){b.value=!0,v!==null&&clearTimeout(v),v=setTimeout(()=>{v=null,b.value=!1},2e3)}function T(){_.value++}function E(){ut(()=>{F.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const C=U(()=>s.mobile===!0||s.modern===!0),M=U(()=>s.tasks.filter(Ie=>Ie.kind!=="subagent")),$=U(()=>s.tasks.filter(Ie=>Ie.kind==="subagent")),L=U(()=>M.value.filter(Ie=>Ie.state==="run").length),D=U(()=>$.value.filter(Ie=>Ie.state==="run").length),R=U(()=>(s.todos??[]).filter(Ie=>Ie.status==="done").length),P=U(()=>s.tasks.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),O=ie(null),W=U(()=>s.gitInfo?s.changes?.length??0:0);function V(Ie){O.value=O.value===Ie?null:Ie}function z(){O.value=null}Ve(P,Ie=>{Ie||z()});function se(Ie){if(Ie.role==="compaction")return m("conversation.compactedPlain");if(Ie.role==="user"){if(Ie.skillActivation)return`/${Ie.skillActivation.name}`;const Le=Ie.text.trim().replace(/\s+/g," ");return Le.length>0?Le:"user"}const ye=(Ie.text||Ie.thinking||"").trim().replace(/\s+/g," ");return ye.length>0?ye:(Ie.tools?.length??0)>0?`${Ie.tools.length} tools`:"kimi"}const Q=U(()=>s.turns.map((Ie,ye)=>({id:Ie.id,role:Ie.role,no:Ie.no||ye+1,title:se(Ie)})));function me(Ie){return Ie.role==="compaction"?20:Ie.role==="user"?(Ie.text?.length??0)+(Ie.skillActivation?20:0):(Ie.text?.length??0)+(Ie.thinking?.length??0)+(Ie.tools?.reduce((ye,Le)=>ye+Le.name.length+(Le.arg?.length??0)+(Le.output?.join("").length??0),0)??0)}const $e=U(()=>{const Ie=Q.value,ye=Ie.map(St=>{const At=s.turns.find(mn=>mn.id===St.id);return At?me(At):gd}),Le=ye.reduce((St,At)=>St+At,0)||Ie.length*gd;return Ie.map((St,At)=>{const mn=ye[At]??gd,dn=Le>0?mn/Le:0,so=Math.max(gd,Math.min(tG,dn*nG));return{id:St.id,height:Math.round(so)}})}),He=U(()=>$e.value.reduce((Ie,ye)=>Ie+ye.height,0)+(Q.value.length-1)*4),Be=ie(null),Ee=ie(null),te=ie({visible:!1,text:"",top:0});function ee(){const Ie=F.value;if(!Ie)return;const ye=Ie.querySelectorAll(".turn-anchor[data-turn-id]");if(!ye.length)return;const Le=Ie.getBoundingClientRect(),St=Le.height/2;let At=null,mn=1/0;ye.forEach(st=>{const Rn=st.getBoundingClientRect(),en=Rn.top-Le.top,Zn=Math.abs(en+Rn.height/2-St);Zn<mn&&(mn=Zn,At=st.dataset.turnId??null)}),Be.value=At;const dn=Ie.scrollHeight-Ie.clientHeight,so=dn>0?Ie.scrollTop/dn:0,xe=He.value,Re=so*xe,qe=Ie.scrollHeight>0?Ie.clientHeight/Ie.scrollHeight*xe:xe;Ee.value={top:Math.max(0,Re),height:Math.max(8,Math.min(qe,xe-Re))}}function Z(Ie,ye){const Le=ye.currentTarget;Le&&(te.value={visible:!0,text:Ie,top:Le.offsetTop})}function Ae(){te.value.visible=!1}const G=U(()=>!s.mobile&&!s.sessionLoading&&Q.value.length>1),oe=U(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),J=U(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),F=ie(null),Y=ie(null),le=ie(0),re=U(()=>({"--panes-scrollbar-width":`${le.value}px`}));function fe(Ie){return Ie instanceof HTMLElement?Ie:Ie&&"$el"in Ie&&Ie.$el instanceof HTMLElement?Ie.$el:null}function q(){const Ie=F.value;le.value=Ie?Math.max(0,Ie.offsetWidth-Ie.clientWidth):0}function X(Ie){const ye=fe(Ie);F.value=ye,ye&&Qt()}function de(Ie){const ye=fe(Ie);Y.value=ye??null,Ie&&"loadForEdit"in Ie&&typeof Ie.loadForEdit=="function"?w.value={loadForEdit:Ie.loadForEdit.bind(Ie)}:w.value=null,as()}const he=ie(!0),ke=ie(!1);function Ce(){const Ie=F.value;return Ie?Ie.scrollHeight-Ie.scrollTop-Ie.clientHeight:0}let ae=0,_e=0,ze=0,Qe=0,dt=0;function Ge(){return Date.now()<_e}function ft(){const Ie=F.value;if(!Ie)return;const ye=Ie.scrollTop;if(performance.now()-ze<100){ae=ye;return}const Le=Ce();if(Ge()){he.value=!0,ke.value=!1,ae=ye;return}ye<ae-1&&Le>1?he.value=!1:Le<=kw&&ye>ae+1&&(he.value=!0,ke.value=!1),ae=ye,ee()}function Ct(Ie=!1){const ye=F.value;ye&&(Ie&&typeof ye.scrollTo=="function"?(ze=performance.now(),ye.scrollTo({top:ye.scrollHeight,behavior:"smooth"})):ye.scrollTop=ye.scrollHeight,ae=ye.scrollTop,he.value=!0,ke.value=!1)}function Jt(Ie){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ie):Ie.replace(/["\\]/g,"\\$&")}function Ft(Ie){const ye=F.value;if(!ye)return;const Le=ye.querySelector(`.turn-anchor[data-turn-id="${Jt(Ie)}"]`);Le&&(he.value=!1,ke.value=Ce()>kw,Le.scrollIntoView({behavior:"smooth",block:"center"}))}function Xn(){const Ie=F.value;if(!Ie)return"none";const ye=Ie.firstElementChild,Le=ye instanceof HTMLElement?ye.offsetHeight:0,St=Y.value?.offsetHeight??0;return`${Ie.scrollHeight}:${Ie.clientHeight}:${Le}:${St}`}function _s(Ie){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ie):setTimeout(Ie,16)}function Ke(Ie){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ie):clearTimeout(Ie)}function Et(Ie=36){if(!he.value&&!Ge())return;const ye=++dt;let Le="",St=0,At=0;Qe&&(Ke(Qe),Qe=0);const mn=()=>{if(Qe=0,ye!==dt||!he.value&&!Ge())return;Ct(!1);const dn=Xn();St=dn===Le?St+1:0,Le=dn,At++,St<3&&At<Ie&&(Qe=_s(mn))};Qe=_s(mn)}const ls=U(()=>{const Ie=(s.approvals??[]).map(mn=>mn.approvalId).join(","),ye=s.turns;if(ye.length===0)return`0|${Ie}`;const Le=ye.at(-1),St=Le.thinking?.length??0,At=Le.tools?.reduce((mn,dn)=>mn+dn.name.length+(dn.arg?.length??0)+(dn.output?.join("").length??0),0)??0;return`${ye.length}:${Le.text.length}:${St}:${At}|${Ie}`});Ve(ls,async()=>{await ut(),he.value||Ge()?Ct(!1):ke.value=!0,ee()}),Ve(Y,()=>{as()}),Ve(()=>s.mobile,async()=>{await ut(),q()}),Ve(()=>s.fileReloadKey,async()=>{he.value=!0,ae=0,await ut(),Et(),ee()}),Ve(()=>s.sessionLoading,async(Ie,ye)=>{Ie||!ye||(he.value=!0,await ut(),Et(),ee())}),Ve(()=>s.running,async(Ie,ye)=>{Ie||!ye||!he.value&&!Ge()||(await ut(),Et(48),ee())});function Os(){he.value=!0,ke.value=!1,_e=Date.now()+sG,ut(()=>{Ct(!1),Et(16)})}function eo(Ie){Os(),o("submit",Ie)}function Oo(Ie,ye){Os(),o("answer",Ie,ye)}function Ps(Ie,ye){!Ie||!ye||o("approval",Ie,ye)}let Fn=null,un=null,to=null,Mn=null,Hn=0,Wn=!1;function Po(Ie){if(Wn=Wn||Ie,Hn)return;Hn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:Le=>setTimeout(Le,16))(()=>{Hn=0;const Le=Wn;Wn=!1,he.value||Ge()?Ct(!1):Le&&(ke.value=!0)})}function wt(){if(!un)return;const Ie=F.value?.firstElementChild??null;Ie!==to&&(to&&un.unobserve(to),to=Ie,Ie&&un.observe(Ie))}function as(){if(!un)return;const Ie=Y.value;Ie!==Mn&&(Mn&&un.unobserve(Mn),Mn=Ie,Ie&&un.observe(Ie))}function Qt(){const Ie=F.value;q(),Fn&&(Fn.disconnect(),Ie&&Fn.observe(Ie,{childList:!0,subtree:!0,characterData:!0})),un&&(un.disconnect(),to=null,Mn=null,Ie&&un.observe(Ie),wt(),as())}function ni(){wt(),Po(!0)}function no(){typeof document>"u"||document.visibilityState==="visible"&&he.value&&Et()}const ws=ie(!1);let En=null;function Ds(){ws.value=!0,En!==null&&clearTimeout(En),En=setTimeout(()=>{ws.value=!1},oG)}function Un(){Ds(),o("interrupt")}function gt(Ie){Ie.key==="Escape"&&(s.running||s.sending)&&(Ie.preventDefault(),Un())}return sn(()=>{ut(()=>{typeof MutationObserver=="function"&&(Fn=new MutationObserver(ni)),typeof ResizeObserver=="function"&&(un=new ResizeObserver(()=>{q(),Po(!1)})),Qt(),Et(48),ee(),typeof document<"u"&&(document.addEventListener("visibilitychange",no),document.addEventListener("keydown",gt))})}),Gt(()=>{Fn&&Fn.disconnect(),un&&un.disconnect(),Hn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Hn),Qe&&Ke(Qe),En!==null&&clearTimeout(En),v!==null&&(clearTimeout(v),v=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",no),document.removeEventListener("keydown",gt))}),t({loadComposerForEdit:y}),(Ie,ye)=>(S(),I("section",{class:Te(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(S(),je(dq,{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":W.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:b.value,onOpenChanges:ye[0]||(ye[0]=Le=>o("openChanges")),onCopyAll:ye[1]||(ye[1]=Le=>f.value?.copyConversation()),onCopyFinalSummary:ye[2]||(ye[2]=Le=>f.value?.copyFinalSummary()),onOpenPr:ye[3]||(ye[3]=Le=>e.pr&&o("openPr",e.pr.url)),onRenameSession:ye[4]||(ye[4]=(Le,St)=>o("renameSession",Le,St)),onForkSession:ye[5]||(ye[5]=Le=>o("forkSession",Le)),onArchiveSession:ye[6]||(ye[6]=Le=>o("archiveSession",Le))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ue("",!0),G.value&&e.betaToc?(S(),I("nav",{key:1,class:"conversation-toc","aria-label":A(m)("conversation.toc")},[h("div",DK,[(S(!0),I(Me,null,Ze(Q.value,(Le,St)=>(S(),I("button",{key:Le.id,type:"button",class:Te(["toc-bubble",[Le.role,{active:Be.value===Le.id}]]),style:Dt({height:$e.value[St]?.height+"px"}),"aria-label":`#${Le.no} ${Le.title}`,onMouseenter:At=>Z(Le.title,At),onMouseleave:Ae,onClick:At=>Ft(Le.id)},[h("span",FK,N(Le.no),1)],46,BK))),128)),Ee.value?(S(),I("div",{key:0,class:"toc-viewport",style:Dt({top:Ee.value.top+"px",height:Ee.value.height+"px"})},null,4)):ue("",!0)]),pt(Si,{name:"toc-tip"},{default:yn(()=>[Lt(h("div",{class:"toc-tooltip",style:Dt({top:te.value.top+"px"})},N(te.value.text),5),[[Eo,te.value.visible]])]),_:1})],8,PK)):ue("",!0),h("div",HK,[h("div",{ref:X,class:"panes chat-scroll",onScrollPassive:ft},[h("div",{class:Te(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(S(),I(Me,{key:0},[ye[58]||(ye[58]=h("div",{class:"empty-spacer"},null,-1)),h("div",WK,[h("span",UK,N(A(m)("composer.emptyConversationTitle")),1),h("span",qK,N(A(m)("composer.emptyConversation")),1),a.value?(S(),I("div",jK,[h("button",{type:"button",class:"ws-pick-btn",title:A(m)("conversation.switchWorkspace"),onClick:ye[7]||(ye[7]=Ye(Le=>i.value=!i.value,["stop"]))},[ye[54]||(ye[54]=h("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},[h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),h("path",{d:"M1 5.5h12"})],-1)),h("span",VK,N(l.value),1),(S(),I("svg",{class:Te(["ws-pick-chev",{open:i.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...ye[53]||(ye[53]=[h("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2))],8,zK),i.value?(S(),I("div",{key:0,class:"ws-pick-backdrop",onClick:ye[8]||(ye[8]=Le=>i.value=!1)})):ue("",!0),i.value?(S(),I("div",KK,[(S(!0),I(Me,null,Ze(c.value,Le=>(S(),I("button",{key:Le.id,type:"button",class:Te(["ws-pick-item",{on:Le.id===e.activeWorkspaceId}]),onClick:Ye(St=>p(Le.id),["stop"])},[h("span",YK,N(Le.name),1),h("span",XK,N(Le.shortPath),1)],10,GK))),128)),u.value>0?(S(),I("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:ye[9]||(ye[9]=Ye(Le=>r.value=!r.value,["stop"]))},[h("span",null,N(A(m)("conversation.moreWorkspaces",{count:u.value})),1)])):ue("",!0),ye[56]||(ye[56]=h("div",{class:"ws-pick-divider"},null,-1)),h("button",{type:"button",class:"ws-pick-action",onClick:ye[10]||(ye[10]=Ye(Le=>{i.value=!1,o("addWorkspace")},["stop"]))},[ye[55]||(ye[55]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M8 3v10M3 8h10"})],-1)),h("span",null,N(A(m)("conversation.addWorkspace")),1)])])):ue("",!0)])):(S(),I("button",{key:1,type:"button",class:"empty-add-workspace",onClick:ye[11]||(ye[11]=Le=>o("addWorkspace"))},[ye[57]||(ye[57]=h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),h("path",{d:"M1 5.5h12"}),h("path",{d:"M8 7.25v4.5M5.75 9.5h4.5"})],-1)),h("span",null,N(A(m)("conversation.addWorkspace")),1)]))]),pt(PT,{ref_key:"emptyComposerRef",ref:g,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:eo,onSteer:ye[12]||(ye[12]=Le=>o("steer",Le)),onCommand:ye[13]||(ye[13]=Le=>o("command",Le)),onInterrupt:Un,onUnqueue:ye[14]||(ye[14]=Le=>o("unqueue",Le)),onEditQueued:ye[15]||(ye[15]=Le=>o("editQueued",Le)),onSetPermission:ye[16]||(ye[16]=Le=>o("setPermission",Le)),onSetThinking:ye[17]||(ye[17]=Le=>o("setThinking",Le)),onTogglePlan:ye[18]||(ye[18]=Le=>o("togglePlan")),onToggleSwarm:ye[19]||(ye[19]=Le=>o("toggleSwarm")),onToggleGoal:ye[20]||(ye[20]=Le=>o("toggleGoal")),onOpenBtw:ye[21]||(ye[21]=Le=>o("command","/btw")),onCreateGoal:ye[22]||(ye[22]=Le=>o("createGoal",Le)),onControlGoal:ye[23]||(ye[23]=Le=>o("controlGoal",Le)),onFocusGoal:T,onFocusSwarm:E,onCompact:ye[24]||(ye[24]=Le=>o("compact")),onPickModel:ye[25]||(ye[25]=Le=>o("pickModel")),onSelectModel:ye[26]||(ye[26]=Le=>o("selectModel",Le))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),ye[59]||(ye[59]=h("div",{class:"empty-spacer"},null,-1))],64)):(S(),I(Me,{key:1},[(S(),je(NT,{ref_key:"chatPaneRef",ref:f,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,bubble:C.value,mobile:e.mobile,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,onOpenFile:ye[27]||(ye[27]=Le=>o("openFile",Le)),onOpenMedia:ye[28]||(ye[28]=Le=>o("openMedia",Le)),onCopyConversationCopied:k,onOpenThinking:ye[29]||(ye[29]=Le=>o("openThinking",Le)),onOpenCompaction:ye[30]||(ye[30]=Le=>o("openCompaction",Le)),onOpenAgent:ye[31]||(ye[31]=Le=>o("openAgent",Le)),onEditMessage:ye[32]||(ye[32]=Le=>o("editMessage",Le))},null,8,["turns","approvals","bubble","mobile","running","sending","fast-moon","session-loading","compaction"])),d.value.length>0?(S(),I("div",ZK,[(S(!0),I(Me,null,Ze(d.value,Le=>(S(),je(sz,{key:Le.id,group:Le},null,8,["group"]))),128))])):ue("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?ue("",!0):(S(),je(LK,{key:0,ref:de,style:Dt(re.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":_.value,"dock-panel":O.value,"bash-tasks":M.value,"subagent-tasks":$.value,"bash-running":L.value,"subagent-running":D.value,"todo-done-count":R.value,"has-dock-work":P.value,todos:e.todos,"pending-question":oe.value,"pending-approval":J.value,mobile:e.mobile,onToggleDockPanel:ye[33]||(ye[33]=Le=>V(Le)),onCloseDockPanel:ye[34]||(ye[34]=Le=>z()),onAnswer:Oo,onDismiss:ye[35]||(ye[35]=Le=>o("dismiss",Le)),onApproval:Ps,onCancelTask:ye[36]||(ye[36]=Le=>o("cancelTask",Le)),onControlGoal:ye[37]||(ye[37]=Le=>o("controlGoal",Le)),onSubmit:eo,onSteer:ye[38]||(ye[38]=Le=>o("steer",Le)),onCommand:ye[39]||(ye[39]=Le=>o("command",Le)),onInterrupt:Un,onUnqueue:ye[40]||(ye[40]=Le=>o("unqueue",Le)),onEditQueued:ye[41]||(ye[41]=Le=>o("editQueued",Le)),onSetPermission:ye[42]||(ye[42]=Le=>o("setPermission",Le)),onSetThinking:ye[43]||(ye[43]=Le=>o("setThinking",Le)),onTogglePlan:ye[44]||(ye[44]=Le=>o("togglePlan")),onToggleSwarm:ye[45]||(ye[45]=Le=>o("toggleSwarm")),onToggleGoal:ye[46]||(ye[46]=Le=>o("toggleGoal")),onOpenBtw:ye[47]||(ye[47]=Le=>o("command","/btw")),onCreateGoal:ye[48]||(ye[48]=Le=>o("createGoal",Le)),onFocusGoal:T,onFocusSwarm:E,onCompact:ye[49]||(ye[49]=Le=>o("compact")),onPickModel:ye[50]||(ye[50]=Le=>o("pickModel")),onSelectModel:ye[51]||(ye[51]=Le=>o("selectModel",Le))},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","pending-approval","mobile"]))]),pt(Si,{name:"pill"},{default:yn(()=>[ke.value?(S(),I("button",{key:0,class:"newmsg-pill","aria-label":A(m)("conversation.jumpToLatestAria"),onClick:ye[52]||(ye[52]=Le=>Ct(!0))},[ye[60]||(ye[60]=h("svg",{class:"pill-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("polyline",{points:"4,6 8,10 12,6"})],-1)),vt(" "+N(A(m)("conversation.newMessages")),1)],8,JK)):ue("",!0)]),_:1}),pt(Si,{name:"abort-toast"},{default:yn(()=>[ws.value?(S(),I("div",QK,[h("span",eG,N(A(m)("conversation.manuallyAborted")),1)])):ue("",!0)]),_:1})],2))}}),rG=yt(iG,[["__scopeId","data-v-3613f340"]]),lG={key:0,class:"fp-empty fp-error"},aG={key:1,class:"fp-empty"},cG={key:2,class:"fp-loading"},uG={class:"fp-header"},dG={class:"fp-title"},fG=["title"],hG={class:"fp-meta"},pG={key:0,class:"fp-lines"},mG={class:"fp-size"},gG=["aria-label"],vG=["aria-label"],yG=["aria-label"],kG={key:3,class:"fp-search"},bG=["placeholder"],_G={key:0,class:"fp-search-count"},wG=["disabled","title"],SG=["disabled","title"],CG=["title"],xG={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},TG={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},AG=["title"],MG=["title"],EG=["href","title"],IG=["title"],$G={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},NG={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},LG=["title","aria-label"],RG={key:1,class:"fp-code"},OG={class:"fp-line-table"},PG=["data-line"],DG={class:"fp-gutter"},BG=["innerHTML"],FG={key:1,class:"fp-body fp-code"},HG={class:"fp-line-table"},WG=["data-line"],UG={class:"fp-gutter"},qG=["innerHTML"],jG={key:2,class:"fp-body"},zG=["srcdoc","title"],VG={key:1,class:"fp-code"},KG={class:"fp-line-table"},GG=["data-line"],YG={class:"fp-gutter"},XG=["innerHTML"],ZG={key:3,class:"fp-body fp-pdf-wrap"},JG=["src","title"],QG={key:1,class:"fp-binary-card"},eY={class:"fp-binary-label"},tY={key:4,class:"fp-body fp-table-wrap"},nY={class:"fp-table"},sY=["data-line"],oY={key:5,class:"fp-body fp-image-wrap"},iY=["src","alt"],rY={key:1,class:"fp-binary-card"},lY={class:"fp-binary-label"},aY={key:6,class:"fp-body fp-code"},cY={class:"fp-line-table"},uY=["data-line"],dY={class:"fp-gutter"},fY=["innerHTML"],hY={key:7,class:"fp-body fp-binary-wrap"},pY={class:"fp-binary-card"},mY={class:"fp-binary-label"},gY=Xe({__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}=_t();function s(te,ee){const Z=ee?ee.split("/").filter(Boolean):[];for(const Ae of te.split("/"))Ae===""||Ae==="."||(Ae===".."?Z.pop():Z.push(Ae));return Z.join("/")}const o=Rt("resolveImage",async te=>te),i=U(()=>{const te=c.file?.path??"",ee=te.lastIndexOf("/");return ee>0?te.slice(0,ee):""});function r(te){if(/^(https?:|data:|blob:)/i.test(te)||te.startsWith("/"))return te;const ee=i.value;return ee?s(te,ee):te}async function l(te){const ee=r(te);return o?o(ee):ee}an("resolveImage",l);function a(te){let ee=te.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(ee)||ee.startsWith("/"))return te;for(const Ae of["#","?"]){const G=ee.indexOf(Ae);G!==-1&&(ee=ee.slice(0,G))}const Z=i.value;return{...te,path:s(ee,Z)}}const c=e,u=t;function d(te){c.openFile?.(a(te))}const p=ie(null),m=U(()=>{const te=c.file;if(!te)return"binary";const ee=te.mime??"",Z=te.languageId??"",Ae=te.path.toLowerCase();return ee==="text/markdown"||Z==="markdown"||Z==="md"||Ae.endsWith(".mdx")?"markdown":ee==="application/json"||Z==="json"?"json":ee==="text/html"||Z==="html"||Ae.endsWith(".html")||Ae.endsWith(".htm")?"html":ee==="application/pdf"||Ae.endsWith(".pdf")?"pdf":ee==="text/csv"||Z==="csv"||Ae.endsWith(".csv")?"csv":ee.startsWith("image/")?"image":te.isBinary?"binary":ee.startsWith("text/")||Z!==""?"text":"binary"});function f(te){const ee=atob(te),Z=Uint8Array.from(ee,Ae=>Ae.charCodeAt(0));return new TextDecoder().decode(Z)}const g=U(()=>{const te=c.file;if(!te)return"";if(te.encoding==="base64")try{return f(te.content)}catch{return te.content}return te.content}),w=U(()=>{if(m.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),b=U(()=>c.file?(m.value==="json"?w.value:g.value).split(`
247
- `):[]),_=U(()=>c.file?m.value==="json"?w.value:g.value:""),v=ie(""),y=ie(0),k=U(()=>{const te=v.value.trim().toLowerCase();if(!te)return[];const ee=[];return b.value.forEach((Z,Ae)=>{Z.toLowerCase().includes(te)&&ee.push(Ae+1)}),ee});Ve(v,()=>{y.value=0});function T(te,ee=!1){te&&ut(()=>{const Z=p.value?.querySelector(".fp-body"),Ae=Z?.querySelector(`[data-line="${te}"]`);if(!Z||!Ae)return;ee&&(Z.scrollTop=0);const G=Z.getBoundingClientRect(),oe=Ae.getBoundingClientRect(),J=oe.top-G.top+Z.scrollTop;Z.scrollTop=J-Z.clientHeight/2+oe.height/2})}Ve(()=>[c.file?.path,c.line],()=>T(c.line,!0),{immediate:!0});function E(te){const ee=k.value;ee.length!==0&&(y.value=(y.value+te+ee.length)%ee.length,T(ee[y.value]))}function C(te){const ee=k.value;return{target:c.line===te,hit:ee.includes(te),active:ee[y.value]===te}}function M(te){return te<1024?`${te} B`:te<1024*1024?`${(te/1024).toFixed(1)} KB`:`${(te/(1024*1024)).toFixed(1)} MB`}const $=ie(!1),L=ie(!1);function D(){c.file&&navigator.clipboard.writeText(_.value).then(()=>{$.value=!0,setTimeout(()=>{$.value=!1},1400)}).catch(()=>{})}function R(){c.file&&navigator.clipboard.writeText(c.file.path).then(()=>{L.value=!0,setTimeout(()=>{L.value=!1},1400)}).catch(()=>{})}const P=ie("preview"),O=ie("preview"),W=ie("fit");Ve(m,te=>{P.value=te==="html"?"preview":"source",O.value="preview",W.value="fit"});const V=U(()=>{const te=c.file;return!te||m.value!=="image"?null:te.sourceUrl?te.sourceUrl:te.encoding==="base64"?`data:${te.mime};base64,${te.content}`:te.mime==="image/svg+xml"?`data:${te.mime};charset=utf-8,${encodeURIComponent(te.content)}`:null}),z=U(()=>{const te=c.file;return!te||m.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:te.encoding==="base64"?`data:${te.mime};base64,${te.content}`:null}),se=U(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,g.value].join(""):"");function Q(te){const ee=[];let Z="",Ae=!1;for(let G=0;G<te.length;G++){const oe=te[G];oe==='"'&&te[G+1]==='"'?(Z+='"',G++):oe==='"'?Ae=!Ae:oe===","&&!Ae?(ee.push(Z),Z=""):Z+=oe}return ee.push(Z),ee}const me=U(()=>b.value.slice(0,200).map(Q));function $e(te){return te.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function He(){const te=c.file;if(!te)return"";const ee=te.languageId?.toLowerCase();return ee||(te.path.split(".").pop()?.toLowerCase()??"")}function Be(te){const ee=He();let Z=$e(te);return m.value==="json"||ee==="json"||ee==="jsonc"?(Z=Z.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),Z=Z.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),Z=Z.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),Z=Z.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),Z):m.value==="html"||ee==="html"||ee==="xml"||ee==="svg"?(Z=Z.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),Z=Z.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),Z=Z.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),Z):(Z=Z.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>'),Z=Z.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),Z=Z.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),Z)}function Ee(te,ee=55){return!te||te.length<=ee?te:"…"+te.slice(te.length-ee+1)}return(te,ee)=>(S(),I("div",{ref_key:"rootRef",ref:p,class:"file-preview"},[e.error&&!e.loading?(S(),I("div",lG,[h("span",null,N(e.error),1),e.closable?(S(),I("button",{key:0,type:"button",class:"fp-action",onClick:ee[0]||(ee[0]=Z=>u("close"))},N(A(n)("filePreview.close")),1)):ue("",!0)])):!e.file&&!e.loading?(S(),I("div",aG,N(A(n)("filePreview.empty")),1)):e.loading?(S(),I("div",cG,[ee[13]||(ee[13]=h("span",{class:"spinner"},null,-1)),h("span",null,N(A(n)("filePreview.loading")),1)])):e.file?(S(),I(Me,{key:3},[h("div",uG,[h("span",dG,N(A(n)("common.preview")),1),h("span",{class:"fp-path",title:e.file.path},N(Ee(e.file.path)),9,fG),h("span",hG,[e.file.lineCount?(S(),I("span",pG,N(A(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ue("",!0),h("span",mG,N(M(e.file.size)),1)]),m.value==="html"?(S(),I("div",{key:0,class:"fp-seg",role:"group","aria-label":A(n)("filePreview.htmlMode")},[h("button",{type:"button",class:Te(["fp-seg-btn",{on:P.value==="preview"}]),onClick:ee[1]||(ee[1]=Z=>P.value="preview")},N(A(n)("filePreview.preview")),3),h("button",{type:"button",class:Te(["fp-seg-btn",{on:P.value==="source"}]),onClick:ee[2]||(ee[2]=Z=>P.value="source")},N(A(n)("filePreview.source")),3)],8,gG)):ue("",!0),m.value==="markdown"?(S(),I("div",{key:1,class:"fp-seg",role:"group","aria-label":A(n)("filePreview.markdownMode")},[h("button",{type:"button",class:Te(["fp-seg-btn",{on:O.value==="preview"}]),onClick:ee[3]||(ee[3]=Z=>O.value="preview")},N(A(n)("filePreview.preview")),3),h("button",{type:"button",class:Te(["fp-seg-btn",{on:O.value==="source"}]),onClick:ee[4]||(ee[4]=Z=>O.value="source")},N(A(n)("filePreview.source")),3)],8,vG)):ue("",!0),m.value==="image"?(S(),I("div",{key:2,class:"fp-seg",role:"group","aria-label":A(n)("filePreview.imageFit")},[h("button",{type:"button",class:Te(["fp-seg-btn",{on:W.value==="fit"}]),onClick:ee[5]||(ee[5]=Z=>W.value="fit")},N(A(n)("filePreview.fit")),3),h("button",{type:"button",class:Te(["fp-seg-btn",{on:W.value==="actual"}]),onClick:ee[6]||(ee[6]=Z=>W.value="actual")},N(A(n)("filePreview.actual")),3)],8,yG)):ue("",!0),m.value==="text"||m.value==="json"||m.value==="html"||m.value==="csv"?(S(),I("div",kG,[Lt(h("input",{"onUpdate:modelValue":ee[7]||(ee[7]=Z=>v.value=Z),class:"fp-search-input",type:"search",placeholder:A(n)("filePreview.search")},null,8,bG),[[_n,v.value]]),v.value.trim()?(S(),I("span",_G,N(k.value.length),1)):ue("",!0),h("button",{type:"button",class:"fp-icon-btn",disabled:k.value.length===0,title:A(n)("filePreview.prevMatch"),onClick:ee[8]||(ee[8]=Z=>E(-1))},"↑",8,wG),h("button",{type:"button",class:"fp-icon-btn",disabled:k.value.length===0,title:A(n)("filePreview.nextMatch"),onClick:ee[9]||(ee[9]=Z=>E(1))},"↓",8,SG)])):ue("",!0),h("button",{type:"button",class:Te(["fp-action fp-act-icon",{copied:L.value}]),title:L.value?A(n)("filePreview.copied"):A(n)("filePreview.copyPath"),onClick:R},[L.value?(S(),I("svg",TG,[...ee[15]||(ee[15]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(S(),I("svg",xG,[...ee[14]||(ee[14]=[h("path",{d:"M6.5 9.5a3 3 0 0 0 4.2.3l2-2a3 3 0 0 0-4.2-4.2l-1 1"},null,-1),h("path",{d:"M9.5 6.5a3 3 0 0 0-4.2-.3l-2 2a3 3 0 0 0 4.2 4.2l1-1"},null,-1)])]))],10,CG),e.externalActions?(S(),I("button",{key:4,type:"button",class:"fp-action fp-act-icon",title:A(n)("filePreview.openInEditor"),onClick:ee[10]||(ee[10]=Z=>u("openExternal"))},[...ee[16]||(ee[16]=[h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M12 8.7V12a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 12V5.5A1.5 1.5 0 0 1 4 4h3.3"}),h("path",{d:"M9.5 2.5h4v4"}),h("path",{d:"M13.5 2.5 7.5 8.5"})],-1)])],8,AG)):ue("",!0),e.externalActions?(S(),I("button",{key:5,type:"button",class:"fp-action fp-act-icon",title:A(n)("filePreview.reveal"),onClick:ee[11]||(ee[11]=Z=>u("reveal"))},[...ee[17]||(ee[17]=[h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M1.5 4.5A1.5 1.5 0 0 1 3 3h3l1.5 1.5H13A1.5 1.5 0 0 1 14.5 6v6A1.5 1.5 0 0 1 13 13.5H3A1.5 1.5 0 0 1 1.5 12z"})],-1)])],8,MG)):ue("",!0),e.downloadUrl?(S(),I("a",{key:6,class:"fp-action fp-act-icon",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"",title:A(n)("filePreview.download")},[...ee[18]||(ee[18]=[h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 2v8"}),h("path",{d:"M4.5 6.5 8 10l3.5-3.5"}),h("path",{d:"M2.5 13.5h11"})],-1)])],8,EG)):ue("",!0),!e.file.isBinary&&m.value!=="image"?(S(),I("button",{key:7,type:"button",class:Te(["fp-action fp-act-icon",{copied:$.value}]),title:$.value?A(n)("filePreview.copied"):A(n)("filePreview.copy"),onClick:D},[$.value?(S(),I("svg",NG,[...ee[20]||(ee[20]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(S(),I("svg",$G,[...ee[19]||(ee[19]=[h("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),h("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])]))],10,IG)):ue("",!0),e.closable?(S(),I("button",{key:8,type:"button",class:"fp-close",title:A(n)("filePreview.close"),"aria-label":A(n)("filePreview.close"),onClick:ee[12]||(ee[12]=Z=>u("close"))}," × ",8,LG)):ue("",!0)]),m.value==="markdown"?(S(),I("div",{key:0,class:Te(["fp-body",{"fp-markdown":O.value==="preview"}])},[O.value==="preview"?(S(),je(Lf,{key:0,text:g.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(S(),I("div",RG,[h("div",OG,[(S(!0),I(Me,null,Ze(b.value,(Z,Ae)=>(S(),I("div",{key:Ae,class:Te(["fp-line-row",C(Ae+1)]),"data-line":Ae+1},[h("span",DG,N(Ae+1),1),h("span",{class:"fp-line-text",innerHTML:Be(Z)},null,8,BG)],10,PG))),128))])]))],2)):m.value==="json"?(S(),I("div",FG,[h("div",HG,[(S(!0),I(Me,null,Ze(b.value,(Z,Ae)=>(S(),I("div",{key:Ae,class:Te(["fp-line-row",C(Ae+1)]),"data-line":Ae+1},[h("span",UG,N(Ae+1),1),h("span",{class:"fp-line-text",innerHTML:Be(Z)},null,8,qG)],10,WG))),128))])])):m.value==="html"?(S(),I("div",jG,[P.value==="preview"?(S(),I("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:se.value,title:e.file.path},null,8,zG)):(S(),I("div",VG,[h("div",KG,[(S(!0),I(Me,null,Ze(b.value,(Z,Ae)=>(S(),I("div",{key:Ae,class:Te(["fp-line-row",C(Ae+1)]),"data-line":Ae+1},[h("span",YG,N(Ae+1),1),h("span",{class:"fp-line-text",innerHTML:Be(Z)},null,8,XG)],10,GG))),128))])]))])):m.value==="pdf"?(S(),I("div",ZG,[z.value?(S(),I("iframe",{key:0,class:"fp-pdf-frame",src:z.value,title:e.file.path},null,8,JG)):(S(),I("div",QG,[h("span",eY,N(A(n)("filePreview.pdfNoPreview")),1)]))])):m.value==="csv"?(S(),I("div",tY,[h("table",nY,[h("tbody",null,[(S(!0),I(Me,null,Ze(me.value,(Z,Ae)=>(S(),I("tr",{key:Ae,class:Te(C(Ae+1)),"data-line":Ae+1},[h("th",null,N(Ae+1),1),(S(!0),I(Me,null,Ze(Z,(G,oe)=>(S(),I("td",{key:oe},N(G),1))),128))],10,sY))),128))])])])):m.value==="image"?(S(),I("div",oY,[V.value?(S(),I("img",{key:0,src:V.value,alt:e.file.path,class:Te(["fp-image",{actual:W.value==="actual"}])},null,10,iY)):(S(),I("div",rY,[ee[21]||(ee[21]=h("span",{class:"fp-binary-icon"},[h("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[h("rect",{x:"2",y:"2",width:"16",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),h("path",{d:"M7 10h6M10 7v6",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),h("span",lY,N(A(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):m.value==="text"?(S(),I("div",aY,[h("div",cY,[(S(!0),I(Me,null,Ze(b.value,(Z,Ae)=>(S(),I("div",{key:Ae,class:Te(["fp-line-row",C(Ae+1)]),"data-line":Ae+1},[h("span",dY,N(Ae+1),1),h("span",{class:"fp-line-text",innerHTML:Be(Z)},null,8,fY)],10,uY))),128))])])):(S(),I("div",hY,[h("div",pY,[ee[22]||(ee[22]=h("span",{class:"fp-binary-icon"},[h("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[h("path",{d:"M5 3h7l4 4v10H5V3z",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),h("path",{d:"M12 3v4h4",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),h("span",mY,N(A(n)("filePreview.binaryNoPreview",{mime:e.file.mime||A(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):ue("",!0)],512))}}),vY=yt(gY,[["__scopeId","data-v-80fa7366"]]),yY={class:"tp"},kY={class:"tp-header"},bY={class:"tp-title"},_Y={class:"tp-sub"},wY=["title","aria-label"],SY=Xe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=ie(null);return Ve(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||ut(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(S(),I("div",yY,[h("div",kY,[h("span",bY,N(A(o)("common.preview")),1),h("span",_Y,N(e.subtitle??A(o)("thinking.panelTitle")),1),h("button",{type:"button",class:"tp-close",title:A(o)("thinking.close"),"aria-label":A(o)("thinking.close"),onClick:l[0]||(l[0]=a=>s("close"))},[...l[1]||(l[1]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,wY)]),h("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},N(e.text),513)]))}}),bw=yt(SY,[["__scopeId","data-v-5cc773cd"]]),CY={class:"ap"},xY={class:"ap-header"},TY={class:"ap-title"},AY={class:"ap-sub"},MY=["title","aria-label"],EY={key:0,class:"ap-type"},IY={key:1,class:"ap-reason"},$Y={key:2,class:"ap-field"},NY={class:"ap-field-body"},LY={key:3,class:"ap-field"},RY={class:"ap-field-body ap-progress"},OY={key:4,class:"ap-field"},PY={class:"ap-field-body"},DY=Xe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=U(()=>(n.member.outputLines??[]).map(a=>a.trimEnd()).filter(a=>a.length>0));function r(a){switch(a){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const l=ie(null);return Ve(()=>i.value.length,()=>{const a=l.value;!a||!(a.scrollHeight-a.scrollTop-a.clientHeight<24)||ut(()=>{l.value&&(l.value.scrollTop=l.value.scrollHeight)})},{immediate:!0}),(a,c)=>(S(),I("div",CY,[h("div",xY,[h("span",TY,N(A(o)("common.preview")),1),h("span",AY,N(e.member.name),1),h("span",{class:Te(["ap-phase",`phase-${e.member.phase}`])},N(r(e.member.phase)),3),h("button",{type:"button",class:"ap-close",title:A(o)("thinking.close"),"aria-label":A(o)("thinking.close"),onClick:c[0]||(c[0]=u=>s("close"))},[...c[1]||(c[1]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,MY)]),h("div",{ref_key:"bodyEl",ref:l,class:"ap-body"},[e.member.subagentType?(S(),I("div",EY,N(e.member.subagentType),1)):ue("",!0),e.member.suspendedReason?(S(),I("div",IY,N(e.member.suspendedReason),1)):ue("",!0),e.member.prompt?(S(),I("div",$Y,[c[2]||(c[2]=h("span",{class:"ap-field-label"},"Task",-1)),h("div",NY,N(e.member.prompt),1)])):ue("",!0),i.value.length>0?(S(),I("div",LY,[c[3]||(c[3]=h("span",{class:"ap-field-label"},"Progress",-1)),h("div",RY,[(S(!0),I(Me,null,Ze(i.value,(u,d)=>(S(),I("span",{key:d},N(u),1))),128))])])):ue("",!0),e.member.summary?(S(),I("div",OY,[c[4]||(c[4]=h("span",{class:"ap-field-label"},"Result",-1)),h("div",PY,N(e.member.summary),1)])):ue("",!0)],512)]))}}),BY=yt(DY,[["__scopeId","data-v-723eed48"]]),FY={class:"sc"},HY={class:"sc-header"},WY={class:"sc-title"},UY=["title"],qY=["title","aria-label"],jY={key:0,class:"sc-empty"},zY={key:2,class:"sc-loading","aria-hidden":"true"},VY={class:"sc-composer"},KY=["placeholder"],GY=["disabled","title"],YY=Xe({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=U(()=>n.turns.find(_=>_.role==="user")?.text?.trim()??""),r=U(()=>n.title?.trim()||o("sideChat.title")),l=U(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=ie(""),c=ie(null),u=ie(null);function d(){const b=a.value.trim();b&&(s("send",b),a.value="",ut(()=>{c.value&&(c.value.style.height="auto"),p()}))}function p(){const b=u.value;b&&(b.scrollTop=b.scrollHeight)}const m=U(()=>{const b=n.turns;if(b.length===0)return"0";const _=b.at(-1),v=_.thinking?.length??0,y=_.tools?.reduce((k,T)=>k+T.name.length+(T.arg?.length??0)+(T.output?.join("").length??0),0)??0;return`${b.length}:${_.text.length}:${v}:${y}`});Ve(m,async()=>{!n.running&&!n.sending||(await ut(),p())});const f=U(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function g(b){b.key==="Enter"&&!b.shiftKey&&!b.isComposing&&(b.preventDefault(),d())}function w(){const b=c.value;b&&(b.style.height="auto",b.style.height=`${Math.min(b.scrollHeight,160)}px`)}return(b,_)=>(S(),I("div",FY,[h("div",HY,[h("span",WY,N(r.value),1),h("span",{class:"sc-subtitle",title:l.value},N(l.value),9,UY),h("button",{type:"button",class:"sc-close",title:A(o)("thinking.close"),"aria-label":A(o)("thinking.close"),onClick:_[0]||(_[0]=v=>s("close"))},[..._[2]||(_[2]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,qY)]),h("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(S(),I("div",jY,N(A(o)("sideChat.empty")),1)):(S(),je(NT,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending,bubble:""},null,8,["turns","running","sending"])),f.value?(S(),I("div",zY,[pt(r1)])):ue("",!0)],512),h("div",VY,[Lt(h("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":_[1]||(_[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:A(o)("sideChat.placeholder"),onInput:w,onKeydown:g},null,40,KY),[[_n,a.value]]),h("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),title:A(o)("sideChat.send"),onClick:d},[..._[3]||(_[3]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M2 8h10"}),h("path",{d:"M8 4l4 4-4 4"})],-1)])],8,GY)])]))}}),XY=yt(YY,[["__scopeId","data-v-6db6c388"]]),ZY={class:"changes-pane"},JY={class:"dv-panel-head"},QY={class:"dv-title"},eX=["title"],tX=["title","aria-label"],nX={class:"diff-head"},sX=["title"],oX={class:"back-label"},iX={key:0,class:"empty-state"},rX={key:1,class:"diff-lines"},lX={key:0,class:"hunk-text"},aX={class:"dl-gutter old"},cX={class:"dl-gutter new"},uX={class:"dl-sign"},dX={class:"dl-text"},fX={key:2,class:"empty-state"},hX={class:"dv-panel-head"},pX={class:"dv-title"},mX={class:"dv-change-count"},gX=["aria-label"],vX=["aria-pressed"],yX=["aria-pressed"],kX=["title","aria-label"],bX={class:"ch-head"},_X={class:"br-label"},wX={class:"br-name"},SX={key:0,class:"sync-info"},CX=["title"],xX=["title"],TX={key:1,class:"empty-head"},AX={key:0,class:"ch-list"},MX=["title","onClick"],EX={class:"fpath"},IX={key:1,class:"ch-list ch-tree"},$X={class:"tree-list"},NX=["onClick"],LX={class:"tree-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},RX=["d"],OX={class:"tree-name"},PX=["title","onClick"],DX={class:"tree-name"},BX={key:2,class:"empty-state"},FX={key:3,class:"empty-state"},HX=Xe({__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}=_t(),s=e,o=t;function i(O){const W=O.toLowerCase();return W==="modified"?"modified":W==="added"?"added":W==="deleted"?"deleted":W==="renamed"?"renamed":W==="untracked"?"untracked":W==="conflicted"?"conflicted":W==="ignored"?"ignored":W==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(O){return r[i(O)]??"?"}function a(O,W=60){return O.length<=W?O:"…"+O.slice(O.length-W+1)}const c=U(()=>s.gitInfo!==null),u=U(()=>s.changes.length>0),d=U(()=>(s.selectedDiffPath??null)!==null),p=U(()=>s.mode==="detail"||s.mode==="full"&&d.value),m=U(()=>s.fileDiff??[]),f=U(()=>s.fileDiffLoading===!0);function g(O){return O.oldNo!==void 0?String(O.oldNo):""}function w(O){return O.newNo!==void 0?String(O.newNo):""}function b(O){return`dl-${O.type}`}function _(O){o("open",O)}function v(){o("back")}function y(){o("close")}const k=ie("list");function T(O){k.value=O}function E(O){const W={children:[]},V=[...O].sort((z,se)=>z.path.localeCompare(se.path));for(const z of V){const se=z.path.split("/");let Q=W;for(let me=0;me<se.length;me++){const $e=se[me],He=me===se.length-1,Be=se.slice(0,me+1).join("/");let Ee=Q.children.find(te=>te.name===$e&&te.kind===(He?"file":"folder"));Ee||(Ee={name:$e,path:Be,kind:He?"file":"folder",status:He?z.status:void 0,children:[]},Q.children.push(Ee)),Q=Ee}}return W.children}const C=U(()=>E(s.changes)),M=ie(new Set);function $(O){return!M.value.has(O)}const L=U(()=>{const O=[];function W(V,z){for(const se of V)O.push({node:se,depth:z}),se.kind==="folder"&&$(se.path)&&W(se.children,z+1)}return W(C.value,0),O});function D(O){const W=new Set(M.value);W.has(O.path)?W.delete(O.path):W.add(O.path),M.value=W}const R=O=>"M1.5 3.5h3l1.5 2h7a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1z";function P(O){return`${16+O*16}px`}return(O,W)=>(S(),I("div",ZY,[p.value?(S(),I(Me,{key:0},[h("div",JY,[h("span",QY,N(A(n)("diff.title")),1),h("span",{class:"dv-path",title:e.selectedDiffPath??""},N(a(e.selectedDiffPath??"",50)),9,eX),e.closable?(S(),I("button",{key:0,type:"button",class:"dv-close",title:A(n)("diff.close"),"aria-label":A(n)("diff.close"),onClick:y},[...W[2]||(W[2]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,tX)):ue("",!0)]),h("div",nX,[e.hideBack?ue("",!0):(S(),I("button",{key:0,class:"back-btn",type:"button",onClick:v,title:A(n)("diff.back")},[W[3]||(W[3]=h("span",{"aria-hidden":"true"},"←",-1)),h("span",oX,N(A(n)("diff.back")),1)],8,sX))]),f.value?(S(),I("div",iX,N(A(n)("diff.loading")),1)):m.value.length>0?(S(),I("div",rX,[(S(!0),I(Me,null,Ze(m.value,(V,z)=>(S(),I("div",{key:z,class:Te(["dl",b(V)])},[V.type==="hunk"?(S(),I("span",lX,N(V.text),1)):(S(),I(Me,{key:1},[h("span",aX,N(g(V)),1),h("span",cX,N(w(V)),1),h("span",uX,N(V.type==="add"?"+":V.type==="del"?"-":" "),1),h("span",dX,N(V.text),1)],64))],2))),128))])):(S(),I("div",fX,N(A(n)("diff.noDiff")),1))],64)):(S(),I(Me,{key:1},[h("div",hX,[h("span",pX,N(A(n)("diff.title")),1),h("span",mX,N(A(n)("diff.changeCount",{count:e.changes.length})),1),h("div",{class:"dv-toggle",role:"group","aria-label":A(n)("diff.list")+" / "+A(n)("diff.tree")},[h("button",{type:"button",class:Te(["dv-toggle-btn",{active:k.value==="list"}]),"aria-pressed":k.value==="list",onClick:W[0]||(W[0]=V=>T("list"))},N(A(n)("diff.list")),11,vX),h("button",{type:"button",class:Te(["dv-toggle-btn",{active:k.value==="tree"}]),"aria-pressed":k.value==="tree",onClick:W[1]||(W[1]=V=>T("tree"))},N(A(n)("diff.tree")),11,yX)],8,gX),e.closable?(S(),I("button",{key:0,type:"button",class:"dv-close",title:A(n)("diff.close"),"aria-label":A(n)("diff.close"),onClick:y},[...W[4]||(W[4]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,kX)):ue("",!0)]),h("div",bX,[c.value?(S(),I(Me,{key:0},[h("span",_X,N(A(n)("diff.branch")),1),h("span",wX,N(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(S(),I("span",SX,[e.gitInfo.ahead>0?(S(),I("span",{key:0,class:"ahead",title:A(n)("diff.aheadTitle")},"↑"+N(e.gitInfo.ahead),9,CX)):ue("",!0),e.gitInfo.behind>0?(S(),I("span",{key:1,class:"behind",title:A(n)("diff.behindTitle")},"↓"+N(e.gitInfo.behind),9,xX)):ue("",!0)])):ue("",!0)],64)):(S(),I("span",TX,N(A(n)("diff.empty")),1))]),u.value&&k.value==="list"?(S(),I("div",AX,[(S(!0),I(Me,null,Ze(e.changes,V=>(S(),I("button",{key:V.path,type:"button",class:"ch-row",title:V.path,onClick:z=>_(V.path)},[h("span",{class:Te(["badge",i(V.status)])},N(l(V.status)),3),h("span",EX,N(a(V.path)),1)],8,MX))),128))])):u.value&&k.value==="tree"?(S(),I("div",IX,[h("ul",$X,[(S(!0),I(Me,null,Ze(L.value,({node:V,depth:z})=>(S(),I("li",{key:V.path,class:"tree-node"},[V.kind==="folder"?(S(),I("button",{key:0,type:"button",class:"tree-row tree-folder",style:Dt({paddingLeft:P(z)}),onClick:se=>D(V)},[(S(),I("svg",LX,[h("path",{d:R($(V.path))},null,8,RX)])),h("span",OX,N(V.name),1)],12,NX)):(S(),I("button",{key:1,type:"button",class:"tree-row tree-file",style:Dt({paddingLeft:P(z)}),title:V.path,onClick:se=>_(V.path)},[h("span",{class:Te(["badge",i(V.status)])},N(l(V.status)),3),h("span",DX,N(V.name),1)],12,PX))]))),128))])])):c.value?(S(),I("div",BX,N(A(n)("diff.clean")),1)):(S(),I("div",FX,N(A(n)("diff.empty")),1))],64))]))}}),WX=yt(HX,[["__scopeId","data-v-4c13e2b6"]]);function Mh(e,t){let n=null;sn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,ut(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),Js(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const UX=["aria-label"],qX={class:"dh"},jX={class:"dtitle"},zX=["title"],VX={class:"search-wrap"},KX=["placeholder"],GX=["aria-label"],YX=["aria-selected","onClick"],XX={key:1,class:"loading-state"},ZX={key:2,class:"unavail-state"},JX={key:3,class:"model-list"},QX=["aria-selected","onClick","onMouseenter"],eZ={class:"check"},tZ={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},nZ={class:"model-main"},sZ={class:"model-name"},oZ={class:"model-id"},iZ={class:"model-provider"},rZ={class:"model-ctx"},lZ={key:0,class:"caps"},aZ=["title","onClick"],cZ={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},uZ=["fill"],dZ={key:0,class:"empty"},fZ={class:"footer-hint"},hZ=Xe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=U(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=ie(""),a=ie(null),c=ie(null),u=ie("all");Mh(c,a);const d=U(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const k of s.models)v.has(k.provider)||(v.add(k.provider),y.push({id:k.provider,label:k.provider}));return y}),p=U(()=>{const v=l.value.toLowerCase().trim(),y=s.models.filter(k=>{if(u.value!=="all"&&k.provider!==u.value)return!1;const T=(k.displayName??k.model).toLowerCase().includes(v),E=k.provider.toLowerCase().includes(v),C=k.id.toLowerCase().includes(v);return!v||T||E||C});return u.value!=="all"?y:y.sort((k,T)=>{const E=r(k.id)?1:0;return(r(T.id)?1:0)-E})}),m=U(()=>p.value),f=ie(0);Ve([l,u],()=>{f.value=0}),Ve(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ve(m,v=>{f.value=Math.min(f.value,Math.max(v.length-1,0))});function g(v){if(v.key==="Escape"){o("close");return}if(v.key==="ArrowDown")v.preventDefault(),f.value=Math.min(f.value+1,m.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),f.value=Math.max(f.value-1,0);else if(v.key==="Enter"){const y=m.value[f.value];y&&o("select",y.id)}}sn(()=>{document.addEventListener("keydown",g)}),Gt(()=>{document.removeEventListener("keydown",g)});function w(v){o("select",v)}function b(v){return m.value.indexOf(v)}function _(v){u.value=v}return(v,y)=>(S(),I("div",{class:"backdrop",onClick:y[3]||(y[3]=Ye(k=>o("close"),["self"]))},[h("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":A(n)("model.dialogLabel")},[h("div",qX,[h("span",jX,N(A(n)("model.title")),1),h("button",{class:"close-btn",title:A(n)("model.close"),onClick:y[0]||(y[0]=k=>o("close"))},"✕",8,zX)]),h("div",VX,[Lt(h("input",{ref_key:"searchRef",ref:a,"onUpdate:modelValue":y[1]||(y[1]=k=>l.value=k),class:"search-input",type:"text",placeholder:A(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,KX),[[_n,l.value]])]),d.value.length>1?(S(),I("div",{key:0,class:"tab-strip",role:"tablist","aria-label":A(n)("model.providerTabs")},[(S(!0),I(Me,null,Ze(d.value,k=>(S(),I("button",{key:k.id,type:"button",class:Te(["tab-btn",{on:k.id===u.value}]),role:"tab","aria-selected":k.id===u.value,onClick:T=>_(k.id)},N(k.label),11,YX))),128))],8,GX)):ue("",!0),e.loading?(S(),I("div",XX,[y[4]||(y[4]=h("svg",{class:"spin-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"8",cy:"8",r:"6","stroke-dasharray":"24 12","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"1s",repeatCount:"indefinite"})])],-1)),h("span",null,N(A(n)("model.loading")),1)])):e.unavailable?(S(),I("div",ZX,[y[5]||(y[5]=h("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[h("path",{d:"M10 2 L19 18 H1 Z"}),h("line",{x1:"10",y1:"9",x2:"10",y2:"13"}),h("circle",{cx:"10",cy:"16",r:"0.8",fill:"var(--warn)"})],-1)),h("span",null,N(A(n)("model.unavailable")),1)])):(S(),I("div",JX,[(S(!0),I(Me,null,Ze(m.value,k=>(S(),I("div",{key:k.id,class:Te(["model-row",{"is-current":k.id===e.current,"is-selected":b(k)===f.value}]),role:"option","aria-selected":k.id===e.current,onClick:T=>w(k.id),onMouseenter:T=>f.value=b(k)},[h("span",eZ,[k.id===e.current?(S(),I("svg",tZ,[...y[6]||(y[6]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ue("",!0)]),h("span",nZ,[h("span",sZ,N(k.displayName??k.model),1),h("span",oZ,N(k.id),1)]),h("span",iZ,N(k.provider),1),h("span",rZ,N(A(n)("model.contextSuffix",{size:Math.round(k.maxContextSize/1e3)})),1),k.capabilities&&k.capabilities.length>0?(S(),I("span",lZ,N(k.capabilities.join(", ")),1)):ue("",!0),h("button",{type:"button",class:Te(["star-btn",{starred:r(k.id)}]),title:r(k.id)?A(n)("model.unstarTitle"):A(n)("model.starTitle"),onClick:Ye(T=>o("toggle-star",k.id),["stop"]),onMouseenter:y[2]||(y[2]=Ye(()=>{},["stop"]))},[(S(),I("svg",cZ,[h("path",{fill:r(k.id)?"currentColor":"none",stroke:"currentColor","stroke-width":"1.6","stroke-linejoin":"round",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,8,uZ)]))],42,aZ)],42,QX))),128)),m.value.length===0&&!e.loading&&!e.unavailable?(S(),I("div",dZ,N(s.models.length===0?A(n)("model.emptyNoModels"):A(n)("model.emptyNoMatch")),1)):ue("",!0)])),h("div",fZ,N(A(n)("model.footerHint")),1)],8,UX)]))}}),pZ=yt(hZ,[["__scopeId","data-v-cb98ad2b"]]),mZ=["aria-label"],gZ={class:"dh"},vZ={class:"dtitle"},yZ=["title"],kZ={class:"prov-list"},bZ={key:0,class:"state-row"},_Z={key:1,class:"state-row unavail"},wZ={key:2,class:"empty"},SZ=["title"],CZ={key:0,width:"8",height:"8",viewBox:"0 0 8 8"},xZ=["fill"],TZ={key:1,width:"8",height:"8",viewBox:"0 0 8 8"},AZ=["fill"],MZ={key:2,width:"8",height:"8",viewBox:"0 0 8 8"},EZ={class:"prov-info"},IZ={class:"prov-type"},$Z={key:0,class:"prov-url"},NZ={class:"prov-meta"},LZ={key:0},RZ={key:0,class:"confirm-row"},OZ={class:"confirm-text"},PZ={key:1,class:"prov-actions"},DZ=["title","onClick"],BZ=["title","onClick"],FZ={key:0,class:"add-section"},HZ={key:0,class:"add-btns"},WZ={key:1,class:"add-form"},UZ={class:"form-row"},qZ={class:"flabel"},jZ=["value"],zZ={class:"form-row"},VZ={class:"flabel"},KZ={class:"form-row"},GZ={class:"flabel"},YZ=["placeholder"],XZ={class:"form-row"},ZZ={class:"flabel"},JZ=["placeholder"],QZ={key:0,class:"add-error"},eJ={class:"form-btns"},tJ={class:"footer-hint"},nJ=Xe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=_t(),s=ie(null);Mh(s);const o=t,i=ie(null);function r(v){i.value=v}function l(){i.value&&(o("delete",i.value),i.value=null)}function a(){i.value=null}const c=ie(!1),u=qs({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),d=ie(""),p=["moonshot","anthropic","openai","custom"];function m(){u.type="moonshot",u.apiKey="",u.baseUrl="",u.defaultModel="",d.value="",c.value=!0}function f(){c.value=!1}function g(){if(!u.apiKey.trim()){d.value=n("providers.apiKeyRequired");return}d.value="",o("add",{type:u.type,apiKey:u.apiKey.trim()||void 0,baseUrl:u.baseUrl.trim()||void 0,defaultModel:u.defaultModel.trim()||void 0}),c.value=!1}function w(v){if(v.key==="Escape"){if(c.value){f();return}if(i.value){a();return}o("close")}}sn(()=>document.addEventListener("keydown",w)),Gt(()=>document.removeEventListener("keydown",w));function b(v){return v==="connected"?"var(--ok)":v==="error"?"var(--err)":"var(--faint)"}function _(v){return n(v==="connected"?"providers.status.connected":v==="error"?"providers.status.error":"providers.status.unconfigured")}return(v,y)=>(S(),I("div",{class:"backdrop",onClick:y[7]||(y[7]=Ye(k=>o("close"),["self"]))},[h("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":A(n)("providers.dialogLabel")},[h("div",gZ,[h("span",vZ,N(A(n)("providers.title")),1),h("button",{class:"close-btn",title:A(n)("providers.close"),onClick:y[0]||(y[0]=k=>o("close"))},"✕",8,yZ)]),h("div",kZ,[e.loading?(S(),I("div",bZ,[y[8]||(y[8]=h("svg",{class:"spin-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)),h("span",null,N(A(n)("providers.loading")),1)])):e.unavailable?(S(),I("div",_Z,[y[9]||(y[9]=h("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[h("path",{d:"M8 1.5 L15.5 14.5 H0.5 Z"}),h("line",{x1:"8",y1:"7",x2:"8",y2:"10.5"}),h("circle",{cx:"8",cy:"12.5",r:"0.7",fill:"var(--warn)"})],-1)),h("span",null,N(A(n)("providers.unavailable")),1)])):e.providers.length===0?(S(),I("div",wZ,N(A(n)("providers.empty")),1)):(S(!0),I(Me,{key:3},Ze(e.providers,k=>(S(),I("div",{key:k.id,class:"prov-row"},[h("span",{class:"status-dot",style:Dt({color:b(k.status)}),title:_(k.status)},[k.status==="connected"?(S(),I("svg",CZ,[h("circle",{cx:"4",cy:"4",r:"3.5",fill:b(k.status)},null,8,xZ)])):k.status==="error"?(S(),I("svg",TZ,[h("circle",{cx:"4",cy:"4",r:"3.5",fill:b(k.status)},null,8,AZ)])):(S(),I("svg",MZ,[...y[10]||(y[10]=[h("circle",{cx:"4",cy:"4",r:"3",fill:"none",stroke:"var(--faint)","stroke-width":"1"},null,-1)])]))],12,SZ),h("div",EZ,[h("span",IZ,N(k.type),1),k.baseUrl?(S(),I("span",$Z,N(k.baseUrl),1)):ue("",!0),h("span",NZ,[h("span",{class:Te(["prov-key-state",k.hasApiKey?"has-key":"no-key"])},N(k.hasApiKey?A(n)("providers.keySet"):A(n)("providers.keyNotSet")),3),k.models&&k.models.length>0?(S(),I("span",LZ," · "+N(A(n)("providers.modelCount",{count:k.models.length})),1)):ue("",!0)])]),i.value===k.id?(S(),I("div",RZ,[h("span",OZ,N(A(n)("providers.confirmDelete")),1),h("button",{class:"act-btn danger",onClick:l},N(A(n)("providers.confirm")),1),h("button",{class:"act-btn",onClick:a},N(A(n)("providers.cancel")),1)])):(S(),I("div",PZ,[h("button",{class:"act-btn",title:A(n)("providers.refreshTitle",{type:k.type}),onClick:T=>o("refresh",k.id)},N(A(n)("providers.refresh")),9,DZ),h("button",{class:"act-btn danger",title:A(n)("providers.deleteTitle",{type:k.type}),onClick:T=>r(k.id)},N(A(n)("providers.delete")),9,BZ)]))]))),128))]),e.unavailable?ue("",!0):(S(),I("div",FZ,[c.value?(S(),I("div",WZ,[h("div",UZ,[h("label",qZ,N(A(n)("providers.fieldType")),1),Lt(h("select",{"onUpdate:modelValue":y[3]||(y[3]=k=>u.type=k),class:"finput fselect"},[(S(),I(Me,null,Ze(p,k=>h("option",{key:k,value:k},N(k),9,jZ)),64))],512),[[of,u.type]])]),h("div",zZ,[h("label",VZ,N(A(n)("providers.fieldApiKey")),1),Lt(h("input",{"onUpdate:modelValue":y[4]||(y[4]=k=>u.apiKey=k),class:"finput",type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,512),[[_n,u.apiKey]])]),h("div",KZ,[h("label",GZ,N(A(n)("providers.fieldBaseUrl")),1),Lt(h("input",{"onUpdate:modelValue":y[5]||(y[5]=k=>u.baseUrl=k),class:"finput",type:"text",placeholder:A(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,YZ),[[_n,u.baseUrl]])]),h("div",XZ,[h("label",ZZ,N(A(n)("providers.fieldDefaultModel")),1),Lt(h("input",{"onUpdate:modelValue":y[6]||(y[6]=k=>u.defaultModel=k),class:"finput",type:"text",placeholder:A(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,JZ),[[_n,u.defaultModel]])]),d.value?(S(),I("div",QZ,N(d.value),1)):ue("",!0),h("div",eJ,[h("button",{class:"act-btn primary",onClick:g},N(A(n)("providers.add")),1),h("button",{class:"act-btn",onClick:f},N(A(n)("providers.cancel")),1)])])):(S(),I("div",HZ,[h("button",{class:"add-btn-oauth",onClick:y[1]||(y[1]=k=>o("openLogin","moonshot"))},[y[11]||(y[11]=h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("circle",{cx:"5",cy:"3",r:"2"}),h("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),vt(" "+N(A(n)("providers.loginKimi")),1)]),h("button",{class:"add-btn-oauth",onClick:y[2]||(y[2]=k=>o("openLogin","anthropic"))},[y[12]||(y[12]=h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("circle",{cx:"5",cy:"3",r:"2"}),h("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),vt(" "+N(A(n)("providers.loginAnthropic")),1)]),h("button",{class:"add-btn add-btn-key",onClick:m},[y[13]||(y[13]=h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),h("line",{x1:"1",y1:"5",x2:"9",y2:"5"})],-1)),vt(" "+N(A(n)("providers.enterApiKey")),1)])]))])),h("div",tJ,N(A(n)("providers.escClose")),1)],8,mZ)]))}}),sJ=yt(nJ,[["__scopeId","data-v-2fd7e21e"]]),oJ=["aria-label"],iJ={class:"dh"},rJ={class:"dtitle"},lJ=["title"],aJ={key:0,class:"center-body"},cJ={class:"center-text"},uJ={class:"dc-body"},dJ={class:"dc-instruction"},fJ={class:"dc-uri-row"},hJ=["href","title"],pJ={class:"dc-code-wrap"},mJ={class:"dc-code-label"},gJ={class:"dc-code-row"},vJ={class:"dc-code-value"},yJ={class:"dc-status-row"},kJ=["aria-label"],bJ={class:"dc-status-text"},_J={class:"dc-countdown"},wJ={class:"actions"},SJ={class:"footer-hint"},CJ={key:2,class:"center-body"},xJ={class:"center-text success-text"},TJ={class:"center-hint"},AJ={class:"center-body"},MJ={class:"center-text err-text"},EJ={class:"center-hint"},IJ={class:"actions"},$J={class:"footer-hint"},NJ={class:"center-body"},LJ={class:"center-text warn-text"},RJ={class:"center-hint"},OJ={class:"actions"},PJ={class:"footer-hint"},DJ=Xe({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=_t(),s=ie(null);Mh(s);const o=t,i=e,r=ie("starting"),l=ie(null),a=ie(0),c=ie(!1);let u=null,d=null;sn(async()=>{document.addEventListener("keydown",y),await p()}),Gt(()=>{document.removeEventListener("keydown",y),g()});async function p(){g(),l.value=null,r.value="starting";const T=await i.onStartOAuthLogin();if(!T){r.value="error";return}l.value={flowId:T.flowId,verificationUri:T.verificationUri,verificationUriComplete:T.verificationUriComplete,userCode:T.userCode,expiresIn:T.expiresIn,interval:T.interval},a.value=T.expiresIn,r.value="device-code",m(),f(T.interval)}function m(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function f(T){u&&clearTimeout(u),u=setTimeout(async()=>{const E=await i.onPollOAuthLogin();E?.status==="authenticated"?(g(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):E?.status==="expired"||E?.status==="cancelled"?(g(),r.value="expired"):f(T)},T*1e3)}function g(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function w(){await p()}function b(){l.value&&window.open(l.value.verificationUriComplete,"_blank","noopener,noreferrer")}async function _(){if(l.value)try{await navigator.clipboard.writeText(l.value.userCode),c.value=!0,setTimeout(()=>{c.value=!1},2e3)}catch{}}async function v(){g(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function y(T){T.key==="Escape"&&v()}function k(T){const E=Math.floor(T/60),C=T%60;return`${E}:${String(C).padStart(2,"0")}`}return(T,E)=>(S(),I("div",{class:"backdrop",onClick:Ye(v,["self"])},[h("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":A(n)("login.title")},[h("div",iJ,[h("span",rJ,N(A(n)("login.title")),1),h("button",{class:"close-btn",title:A(n)("login.close"),onClick:v},[...E[0]||(E[0]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,lJ)]),r.value==="starting"?(S(),I("div",aJ,[E[1]||(E[1]=h("svg",{class:"spin-icon",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"11",cy:"11",r:"8","stroke-dasharray":"30 18","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 11 11",to:"360 11 11",dur:"0.9s",repeatCount:"indefinite"})])],-1)),h("span",cJ,N(A(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(S(),I(Me,{key:1},[h("div",uJ,[h("div",dJ,N(A(n)("login.instruction")),1),h("div",fJ,[h("a",{href:l.value.verificationUriComplete,class:"dc-uri-btn",target:"_blank",rel:"noopener noreferrer",title:l.value.verificationUriComplete},[E[2]||(E[2]=h("svg",{class:"dc-link-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("path",{d:"M5 2H2a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V7"}),h("path",{d:"M8 1h3v3M11 1 6 6"})],-1)),vt(" "+N(l.value.verificationUri),1)],8,hJ)]),h("div",pJ,[h("div",mJ,N(A(n)("login.deviceCode")),1),h("div",gJ,[h("span",vJ,N(l.value.userCode),1),h("button",{class:Te(["dc-copy-btn",{"is-copied":c.value}]),onClick:_},[c.value?(S(),I(Me,{key:0},[E[3]||(E[3]=h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("polyline",{points:"1,6 4,9 11,2"})],-1)),vt(" "+N(A(n)("login.copied")),1)],64)):(S(),I(Me,{key:1},[E[4]||(E[4]=h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),h("path",{d:"M8 4V2a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h2"})],-1)),vt(" "+N(A(n)("login.copy")),1)],64))],2)])]),h("div",yJ,[h("span",{class:"dc-spinner","aria-label":A(n)("login.waitingAuth")},[...E[5]||(E[5]=[h("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)])],8,kJ),h("span",bJ,N(A(n)("login.waitingAuthEllipsis")),1),h("span",_J,N(k(a.value)),1)])]),h("div",wJ,[h("button",{class:"act-btn",onClick:b},N(A(n)("login.openBrowser")),1),h("button",{class:"act-btn",onClick:v},N(A(n)("login.cancel")),1)]),h("div",SJ,N(A(n)("login.footerHint")),1)],64)):r.value==="success"?(S(),I("div",CJ,[E[6]||(E[6]=h("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--ok)","stroke-width":"2"},[h("circle",{cx:"18",cy:"18",r:"15"}),h("polyline",{points:"10,18 15,24 26,12"})],-1)),h("span",xJ,N(A(n)("login.success")),1),h("span",TJ,N(A(n)("login.successHint")),1)])):r.value==="expired"?(S(),I(Me,{key:3},[h("div",AJ,[E[7]||(E[7]=h("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--err)","stroke-width":"1.5"},[h("circle",{cx:"14",cy:"14",r:"12"}),h("line",{x1:"14",y1:"8",x2:"14",y2:"15"}),h("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--err)"})],-1)),h("span",MJ,N(A(n)("login.expiredTitle")),1),h("span",EJ,N(A(n)("login.expiredHint")),1)]),h("div",IJ,[h("button",{class:"act-btn primary",onClick:w},N(A(n)("login.retry")),1),h("button",{class:"act-btn",onClick:v},N(A(n)("login.closeBtn")),1)]),h("div",$J,N(A(n)("login.escClose")),1)],64)):r.value==="error"?(S(),I(Me,{key:4},[h("div",NJ,[E[8]||(E[8]=h("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[h("path",{d:"M14 3 L26 24 H2 Z"}),h("line",{x1:"14",y1:"12",x2:"14",y2:"18"}),h("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--warn)"})],-1)),h("span",LJ,N(A(n)("login.errorTitle")),1),h("span",RJ,N(A(n)("login.errorHint")),1)]),h("div",OJ,[h("button",{class:"act-btn primary",onClick:w},N(A(n)("login.retry")),1),h("button",{class:"act-btn",onClick:v},N(A(n)("login.closeBtn")),1)]),h("div",PJ,N(A(n)("login.escClose")),1)],64)):ue("",!0)],8,oJ)]))}}),BJ=yt(DJ,[["__scopeId","data-v-8245934e"]]),FJ=["aria-label"],HJ={class:"dh"},WJ={class:"dtitle"},UJ=["title"],qJ={class:"form-body"},jJ={class:"form-row"},zJ={class:"flabel",for:"ns-cwd"},VJ=["placeholder"],KJ={key:0,class:"recent-section"},GJ={class:"recent-label"},YJ={class:"recent-list"},XJ=["title","onClick"],ZJ={class:"recent-path"},JJ={class:"form-row"},QJ={class:"flabel",for:"ns-title"},eQ=["placeholder"],tQ={class:"actions"},nQ=["disabled"],sQ={class:"footer-hint"},oQ=Xe({__name:"NewSessionDialog",props:{recentCwds:{}},emits:["create","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=ie(""),r=ie("");Ve(()=>s.recentCwds,p=>{i.value===""&&p.length>0&&(i.value=p[0])},{immediate:!0});const l=U(()=>i.value.trim()),a=U(()=>l.value.length>0);function c(){if(!a.value)return;const p={cwd:l.value},m=r.value.trim();m&&(p.title=m),o("create",p)}function u(p){i.value=p}function d(p){p.key==="Escape"?o("close"):p.key==="Enter"&&!(p.target instanceof HTMLButtonElement)&&c()}return sn(()=>document.addEventListener("keydown",d)),Gt(()=>document.removeEventListener("keydown",d)),(p,m)=>(S(),I("div",{class:"backdrop",onClick:m[4]||(m[4]=Ye(f=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":A(n)("newSession.title")},[h("div",HJ,[h("span",WJ,N(A(n)("newSession.title")),1),h("button",{class:"close-btn",title:A(n)("newSession.close"),onClick:m[0]||(m[0]=f=>o("close"))},[...m[5]||(m[5]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,UJ)]),h("div",qJ,[h("div",jJ,[h("label",zJ,N(A(n)("newSession.cwdLabel")),1),Lt(h("input",{id:"ns-cwd","onUpdate:modelValue":m[1]||(m[1]=f=>i.value=f),class:"finput",type:"text",placeholder:A(n)("newSession.cwdPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,VJ),[[_n,i.value]])]),e.recentCwds.length>0?(S(),I("div",KJ,[h("div",GJ,N(A(n)("newSession.recentLabel")),1),h("div",YJ,[(S(!0),I(Me,null,Ze(e.recentCwds,f=>(S(),I("button",{key:f,class:Te(["recent-item",{"is-active":i.value===f}]),title:f,onClick:g=>u(f)},[m[6]||(m[6]=h("svg",{class:"dir-icon",width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[h("rect",{x:"1",y:"3",width:"9",height:"6.5",rx:"1"}),h("path",{d:"M1 4.5V3a1 1 0 0 1 1-1h2.5l1 1.5"})],-1)),h("span",ZJ,N(f),1)],10,XJ))),128))])])):ue("",!0),h("div",JJ,[h("label",QJ,N(A(n)("newSession.titleFieldLabel")),1),Lt(h("input",{id:"ns-title","onUpdate:modelValue":m[2]||(m[2]=f=>r.value=f),class:"finput",type:"text",placeholder:A(n)("newSession.titleFieldPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,eQ),[[_n,r.value]])])]),h("div",tQ,[h("button",{class:"act-btn primary",disabled:!a.value,onClick:c},N(A(n)("newSession.create")),9,nQ),h("button",{class:"act-btn",onClick:m[3]||(m[3]=f=>o("close"))},N(A(n)("newSession.cancel")),1)]),h("div",sQ,N(A(n)("newSession.footerHint")),1)],8,FJ)]))}}),iQ=yt(oQ,[["__scopeId","data-v-9238ae59"]]),rQ={class:"lang-switch",role:"group","aria-label":"Language"},lQ=["aria-pressed","onClick"],aQ=Xe({__name:"LanguageSwitcher",setup(e){const{locale:t}=_t();function n(s){t.value!==s&&oC(s)}return(s,o)=>(S(),I("div",rQ,[(S(!0),I(Me,null,Ze(A(sC),i=>(S(),I("button",{key:i.code,type:"button",class:Te(["lang-opt",{on:A(t)===i.code}]),"aria-pressed":A(t)===i.code,onClick:Ye(r=>n(i.code),["stop"])},N(i.label),11,lQ))),128))]))}}),DT=yt(aQ,[["__scopeId","data-v-807a4065"]]),_w="kimi-web.client-id",cQ="kimi-code-web",uQ="web";function dQ(){return{serverHttpUrl:hQ(),clientId:vQ(),clientName:cQ,clientVersion:yQ(),clientUiMode:uQ}}function fQ(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function hQ(e){const t=fQ(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function pQ(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function mQ(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return pQ(e)}function Rf(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function gQ(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 vQ(){const e=globalThis.localStorage?.getItem(_w);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return globalThis.localStorage?.setItem(_w,t),t}function yQ(){return"0.1.1".trim()?"0.1.1":"0.0.0-dev"}const ww=1e3,Um=16384,qm=500,jm=50,kQ=6,bQ=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,_Q=/^[A-Za-z0-9+/=_-]{200,}$/;let zm=null;function ti(){if(zm!==null)return zm;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}if(!e)try{e=localStorage.getItem("kimi-web.debug")==="1"}catch{}return zm=e,e}const nr=[];let wQ=1;const Rv=ie(0),ac=rl(!1);function SQ(){return nr}function CQ(){nr.length=0,Rv.value++}function al(e){ac.value||(nr.push({id:wQ++,ts:Date.now(),...e}),nr.length>ww&&nr.splice(0,nr.length-ww),Rv.value++)}function l1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return _Q.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>qm?`${o.slice(0,qm)}… [+${o.length-qm} chars]`:o}if(n!=="object")return String(e);if(t>=kQ)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,jm).map(i=>l1(i,t+1));return e.length>jm&&o.push(`[+${e.length-jm} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=bQ.test(o)?"[redacted]":l1(i,t+1);return s}function ba(e){if(e===void 0)return;const t=l1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>Um)return{_truncated:`detail JSON was ${n.length} chars; first ${Um} kept`,preview:n.slice(0,Um)}}catch{return"[unserializable detail]"}return t}function Sw(e){ti()&&al({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:ba(e.body)}})}function Cw(e){if(!ti())return;const t=e.code!==0;al({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:ba(e.data)}})}function vd(e){ti()&&al({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 Rl(e,t){ti()&&al({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:ba(t)})}function xQ(e){if(!ti())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;al({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:ba(e)})}function TQ(e){if(!ti())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);al({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:ba(t.payload)})}const AQ={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Vm(e,t,n){ti()&&al({source:"client",kind:`client:${e}`,label:`${AQ[e]} ${t}`,detail:ba(n)})}let xw=!1;function MQ(){if(!(xw||!ti())){xw=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{Vm("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;Vm("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{Vm(e,n.map(EQ).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function EQ(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 BT(e=nr){if(typeof document>"u")return;const t=new Blob([IQ(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function IQ(e=nr){return e.map(t=>JSON.stringify(t)).join(`
248
- `)}const $Q=["aria-label"],NQ={class:"dh"},LQ={class:"dtitle"},RQ=["title"],OQ={class:"settings-layout"},PQ=["aria-label"],DQ=["aria-selected","aria-controls","id","onClick"],BQ={class:"body"},FQ={id:"settings-panel-general",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-general"},HQ={class:"sec"},WQ={class:"sec-title"},UQ={class:"row"},qQ={class:"rlabel"},jQ=["aria-label"],zQ=["aria-pressed"],VQ=["aria-pressed"],KQ={class:"row"},GQ={class:"rlabel"},YQ=["aria-label"],XQ=["aria-pressed"],ZQ=["aria-pressed"],JQ=["aria-pressed"],QQ={class:"row"},eee={class:"rlabel"},tee={class:"num-field"},nee=["value","aria-label"],see={class:"row"},oee={class:"rlabel"},iee={class:"sec"},ree={class:"sec-title"},lee={class:"row"},aee={class:"rlabel"},cee={key:0,class:"hint"},uee=["aria-checked","disabled"],dee={class:"sec"},fee={class:"sec-title"},hee={class:"row"},pee={class:"rlabel"},mee=["title"],gee={class:"actions"},vee={id:"settings-panel-agent",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-agent"},yee={class:"sec"},kee={class:"sec-head"},bee={class:"sec-title"},_ee={key:0,class:"saving"},wee={class:"row"},See={class:"rlabel"},Cee={class:"hint"},xee=["value","disabled","aria-label"],Tee={key:0,value:"",disabled:""},Aee=["value"],Mee={key:1,class:"rvalue mono"},Eee={class:"row"},Iee={class:"rlabel"},$ee={class:"hint"},Nee=["aria-label"],Lee=["aria-pressed","disabled","onClick"],Ree={class:"row"},Oee={class:"rlabel"},Pee={class:"hint"},Dee=["aria-checked","disabled"],Bee={class:"row"},Fee={class:"rlabel"},Hee={class:"hint"},Wee=["aria-checked","disabled"],Uee={class:"row"},qee={class:"rlabel"},jee={class:"hint"},zee=["aria-checked","disabled"],Vee={key:0,class:"row"},Kee={class:"rlabel"},Gee=["aria-checked","disabled"],Yee={key:1,class:"provider-list"},Xee={class:"provider-main"},Zee={class:"provider-id"},Jee={class:"provider-type"},Qee={class:"provider-meta"},ete={key:0,class:"provider-model"},tte={key:1,class:"empty-config"},nte={id:"settings-panel-advanced",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-advanced"},ste={class:"sec"},ote={class:"sec-title"},ite={class:"row"},rte={class:"rlabel"},lte={class:"rvalue mono"},ate={class:"row"},cte={class:"rlabel"},ute={key:0,class:"hint"},dte={id:"settings-panel-experimental",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-experimental"},fte={class:"sec"},hte={class:"sec-title"},pte={class:"row"},mte={class:"rlabel"},gte={class:"hint"},vte=["aria-checked"],yte=Xe({__name:"SettingsDialog",props:{theme:{},colorScheme:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyPermission:{},betaToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean}},emits:["setTheme","setColorScheme","setUiFontSize","setNotify","setBetaToc","login","logout","openOnboarding","updateConfig","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=ie("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"experimental",labelKey:"settings.tabs.experimental"}],l=mQ(),a=["manual","auto","yolo"],c=ie(null);Mh(c);function u(k){k.key==="Escape"&&o("close")}sn(()=>document.addEventListener("keydown",u)),Gt(()=>document.removeEventListener("keydown",u));function d(){BT()}const p=U(()=>{const k=new Map;for(const T of s.models??[])k.set(T.id,T.displayName??T.model??T.id);for(const[T,E]of Object.entries(s.config?.models??{}))k.has(T)||k.set(T,g(T,E));return Array.from(k,([T,E])=>({id:T,label:E})).sort((T,E)=>T.label.localeCompare(E.label))}),m=U(()=>Object.entries(s.config?.providers??{}).map(([k,T])=>({id:k,provider:T})).sort((k,T)=>k.id.localeCompare(T.id))),f=U(()=>{const k=s.config?.defaultPermissionMode;return k==="auto"||k==="yolo"||k==="manual"?k:"manual"});function g(k,T){if(!T||typeof T!="object")return k;const E=T,C=typeof E.model=="string"?E.model:void 0,M=typeof E.provider=="string"?E.provider:void 0;return C&&M?`${k} (${M}/${C})`:C?`${k} (${C})`:k}function w(k){return k===!0}function b(k){const T=k.target.value;!T||T===s.config?.defaultModel||o("updateConfig",{defaultModel:T})}function _(k){k!==f.value&&o("updateConfig",{defaultPermissionMode:k})}function v(k){const T=s.config?.[k];o("updateConfig",{[k]:!w(T)})}function y(k){i.value=k}return(k,T)=>(S(),I("div",{class:"backdrop",onClick:T[16]||(T[16]=Ye(E=>o("close"),["self"]))},[h("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":A(n)("settings.title")},[h("div",NQ,[h("span",LQ,N(A(n)("settings.title")),1),h("button",{class:"close-btn",title:A(n)("newSession.close"),onClick:T[0]||(T[0]=E=>o("close"))},[...T[17]||(T[17]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,RQ)]),h("div",OQ,[h("nav",{class:"settings-tabs",role:"tablist","aria-label":A(n)("settings.title")},[(S(),I(Me,null,Ze(r,E=>h("button",{key:E.id,type:"button",class:Te(["tab",{on:i.value===E.id}]),role:"tab","aria-selected":i.value===E.id,"aria-controls":`settings-panel-${E.id}`,id:`settings-tab-${E.id}`,onClick:C=>y(E.id)},N(A(n)(E.labelKey)),11,DQ)),64))],8,PQ),h("div",BQ,[Lt(h("section",FQ,[h("section",HQ,[h("h3",WQ,N(A(n)("settings.appearance")),1),h("div",UQ,[h("span",qQ,N(A(n)("theme.label")),1),h("div",{class:"seg",role:"group","aria-label":A(n)("theme.label")},[h("button",{type:"button",class:Te(["opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:T[1]||(T[1]=E=>o("setTheme","modern"))},N(A(n)("theme.modern")),11,zQ),h("button",{type:"button",class:Te(["opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:T[2]||(T[2]=E=>o("setTheme","kimi"))},N(A(n)("theme.kimi")),11,VQ)],8,jQ)]),h("div",KQ,[h("span",GQ,N(A(n)("theme.colorSchemeLabel")),1),h("div",{class:"seg",role:"group","aria-label":A(n)("theme.colorSchemeLabel")},[h("button",{type:"button",class:Te(["opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:T[3]||(T[3]=E=>o("setColorScheme","light"))},N(A(n)("theme.light")),11,XQ),h("button",{type:"button",class:Te(["opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:T[4]||(T[4]=E=>o("setColorScheme","dark"))},N(A(n)("theme.dark")),11,ZQ),h("button",{type:"button",class:Te(["opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:T[5]||(T[5]=E=>o("setColorScheme","system"))},N(A(n)("theme.system")),11,JQ)],8,YQ)]),h("div",QQ,[h("span",eee,N(A(n)("settings.uiFontSize")),1),h("label",tee,[h("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":A(n)("settings.uiFontSize"),onInput:T[6]||(T[6]=E=>o("setUiFontSize",Number(E.target.value)))},null,40,nee),T[18]||(T[18]=h("span",{class:"num-unit"},"px",-1))])]),h("div",see,[h("span",oee,N(A(n)("sidebar.language")),1),pt(DT)])]),h("section",iee,[h("h3",ree,N(A(n)("settings.notifications")),1),h("div",lee,[h("span",aee,[vt(N(A(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(S(),I("span",cee,N(A(n)("settings.notifyDenied")),1)):ue("",!0)]),h("button",{type:"button",class:Te(["switch",{on:e.notify}]),role:"switch","aria-checked":e.notify,disabled:e.notifyPermission==="denied",onClick:T[7]||(T[7]=E=>o("setNotify",!e.notify))},[...T[19]||(T[19]=[h("span",{class:"knob"},null,-1)])],10,uee)])]),h("section",dee,[h("h3",fee,N(A(n)("settings.account")),1),h("div",hee,[h("span",pee,N(e.authReady?"managed:kimi-code":A(n)("sidebar.notSignedIn")),1),e.authReady&&e.accountModel?(S(),I("span",{key:0,class:"rvalue",title:e.accountModel},N(e.accountModel),9,mee)):ue("",!0)]),h("div",gee,[h("button",{type:"button",class:"act",onClick:T[8]||(T[8]=E=>{o("openOnboarding"),o("close")})},N(A(n)("onboarding.reopen")),1),e.authReady?(S(),I("button",{key:0,type:"button",class:"act danger",onClick:T[9]||(T[9]=E=>o("logout"))},N(A(n)("sidebar.signOut")),1)):(S(),I("button",{key:1,type:"button",class:"act signin",onClick:T[10]||(T[10]=E=>o("login"))},N(A(n)("sidebar.signIn")),1))])])],512),[[Eo,i.value==="general"]]),Lt(h("section",vee,[h("section",yee,[h("div",kee,[h("h3",bee,N(A(n)("settings.agentDefaults")),1),e.configSaving?(S(),I("span",_ee,N(A(n)("settings.saving")),1)):ue("",!0)]),e.config?(S(),I(Me,{key:0},[h("div",wee,[h("span",See,[vt(N(A(n)("settings.defaultModel"))+" ",1),h("span",Cee,N(A(n)("settings.defaultModelHint")),1)]),p.value.length>0?(S(),I("select",{key:0,class:"select-field",value:e.config.defaultModel??"",disabled:e.configSaving,"aria-label":A(n)("settings.defaultModel"),onChange:b},[e.config.defaultModel?ue("",!0):(S(),I("option",Tee,N(A(n)("settings.noDefaultModel")),1)),(S(!0),I(Me,null,Ze(p.value,E=>(S(),I("option",{key:E.id,value:E.id},N(E.label),9,Aee))),128))],40,xee)):(S(),I("span",Mee,N(e.config.defaultModel??A(n)("settings.noDefaultModel")),1))]),h("div",Eee,[h("span",Iee,[vt(N(A(n)("settings.defaultPermission"))+" ",1),h("span",$ee,N(A(n)("settings.defaultPermissionHint")),1)]),h("div",{class:"seg",role:"group","aria-label":A(n)("settings.defaultPermission")},[(S(),I(Me,null,Ze(a,E=>h("button",{key:E,type:"button",class:Te(["opt",{on:f.value===E}]),"aria-pressed":f.value===E,disabled:e.configSaving,onClick:C=>_(E)},N(A(n)(`settings.permission.${E}`)),11,Lee)),64))],8,Nee)]),h("div",Ree,[h("span",Oee,[vt(N(A(n)("settings.defaultThinking"))+" ",1),h("span",Pee,N(A(n)("settings.defaultThinkingHint")),1)]),h("button",{type:"button",class:Te(["switch",{on:w(e.config.defaultThinking)}]),role:"switch","aria-checked":w(e.config.defaultThinking),disabled:e.configSaving,onClick:T[11]||(T[11]=E=>v("defaultThinking"))},[...T[20]||(T[20]=[h("span",{class:"knob"},null,-1)])],10,Dee)]),h("div",Bee,[h("span",Fee,[vt(N(A(n)("settings.defaultPlanMode"))+" ",1),h("span",Hee,N(A(n)("settings.defaultPlanModeHint")),1)]),h("button",{type:"button",class:Te(["switch",{on:w(e.config.defaultPlanMode)}]),role:"switch","aria-checked":w(e.config.defaultPlanMode),disabled:e.configSaving,onClick:T[12]||(T[12]=E=>v("defaultPlanMode"))},[...T[21]||(T[21]=[h("span",{class:"knob"},null,-1)])],10,Wee)]),h("div",Uee,[h("span",qee,[vt(N(A(n)("settings.mergeSkills"))+" ",1),h("span",jee,N(A(n)("settings.mergeSkillsHint")),1)]),h("button",{type:"button",class:Te(["switch",{on:w(e.config.mergeAllAvailableSkills)}]),role:"switch","aria-checked":w(e.config.mergeAllAvailableSkills),disabled:e.configSaving,onClick:T[13]||(T[13]=E=>v("mergeAllAvailableSkills"))},[...T[22]||(T[22]=[h("span",{class:"knob"},null,-1)])],10,zee)]),e.config.telemetry!==void 0?(S(),I("div",Vee,[h("span",Kee,N(A(n)("settings.telemetry")),1),h("button",{type:"button",class:Te(["switch",{on:w(e.config.telemetry)}]),role:"switch","aria-checked":w(e.config.telemetry),disabled:e.configSaving,onClick:T[14]||(T[14]=E=>v("telemetry"))},[...T[23]||(T[23]=[h("span",{class:"knob"},null,-1)])],10,Gee)])):ue("",!0),m.value.length>0?(S(),I("div",Yee,[(S(!0),I(Me,null,Ze(m.value,({id:E,provider:C})=>(S(),I("div",{key:E,class:"provider-row"},[h("div",Xee,[h("span",Zee,N(E),1),h("span",Jee,N(C.type),1)]),h("div",Qee,[h("span",{class:Te(["provider-badge",C.hasApiKey?"ok":"warn"])},N(C.hasApiKey?A(n)("settings.credentialReady"):A(n)("settings.credentialMissing")),3),C.defaultModel?(S(),I("span",ete,N(C.defaultModel),1)):ue("",!0)])]))),128))])):ue("",!0)],64)):(S(),I("div",tte,N(A(n)("settings.configUnavailable")),1))])],512),[[Eo,i.value==="agent"]]),Lt(h("section",nte,[h("section",ste,[h("h3",ote,N(A(n)("settings.advanced")),1),h("div",ite,[h("span",rte,N(A(n)("sidebar.daemon")),1),h("span",lte,N(A(l)),1)]),h("div",ate,[h("span",cte,[vt(N(A(n)("settings.exportLog"))+" ",1),A(ti)()?ue("",!0):(S(),I("span",ute,N(A(n)("settings.logHint")),1))]),h("button",{type:"button",class:"act",onClick:d},N(A(n)("settings.exportLogBtn")),1)])])],512),[[Eo,i.value==="advanced"]]),Lt(h("section",dte,[h("section",fte,[h("h3",hte,N(A(n)("settings.beta")),1),h("div",pte,[h("span",mte,[vt(N(A(n)("settings.betaToc"))+" ",1),h("span",gte,N(A(n)("settings.betaTocHint")),1)]),h("button",{type:"button",class:Te(["switch",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc,onClick:T[15]||(T[15]=E=>o("setBetaToc",!e.betaToc))},[...T[24]||(T[24]=[h("span",{class:"knob"},null,-1)])],10,vte)])])],512),[[Eo,i.value==="experimental"]])])])],8,$Q)]))}}),kte=yt(yte,[["__scopeId","data-v-2c849551"]]),bte=["aria-label"],_te={class:"dh"},wte={class:"dtitle"},Ste={class:"count"},Cte=["aria-label","title"],xte={class:"search-wrap"},Tte=["placeholder"],Ate={class:"session-list"},Mte=["aria-selected","onClick","onMouseenter"],Ete={class:"meta"},Ite={class:"title"},$te={class:"sub"},Nte={class:"ws"},Lte={class:"time"},Rte={key:0,class:"attn-badge"},Ote={key:0,class:"empty"},Pte={class:"footer-hint"},Dte=Xe({__name:"SessionsDialog",props:{sessions:{},workspaceGroups:{},attentionBySession:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=U(()=>{const f={};for(const g of s.workspaceGroups)for(const w of g.sessions)f[w.id]=g.workspace.name;return f}),r=ie(""),l=ie(null),a=U(()=>{const f=r.value.toLowerCase().trim();return f?s.sessions.filter(g=>g.title.toLowerCase().includes(f)):s.sessions}),c=ie(0);Ve(r,()=>{c.value=0});function u(f){o("select",f)}function d(f){return s.attentionBySession[f]??0}function p(f){return d(f.id)>0||f.status==="awaitingApproval"||f.status==="awaitingQuestion"?"attn":f.busy?"run":f.status==="aborted"?"aborted":"idle"}function m(f){if(f.key==="Escape"){o("close");return}if(f.key==="ArrowDown")f.preventDefault(),c.value=Math.min(c.value+1,a.value.length-1);else if(f.key==="ArrowUp")f.preventDefault(),c.value=Math.max(c.value-1,0);else if(f.key==="Enter"){const g=a.value[c.value];g&&u(g.id)}}return sn(()=>{document.addEventListener("keydown",m),ut(()=>l.value?.focus())}),Gt(()=>{document.removeEventListener("keydown",m)}),(f,g)=>(S(),I("div",{class:"backdrop",onClick:g[2]||(g[2]=Ye(w=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":A(n)("sessions.title")},[h("div",_te,[h("span",wte,N(A(n)("sessions.title")),1),h("span",Ste,N(e.sessions.length),1),h("button",{class:"close-btn","aria-label":A(n)("sessions.close"),title:A(n)("sessions.close"),onClick:g[0]||(g[0]=w=>o("close"))},[...g[3]||(g[3]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Cte)]),h("div",xte,[Lt(h("input",{ref_key:"searchRef",ref:l,"onUpdate:modelValue":g[1]||(g[1]=w=>r.value=w),class:"search-input",type:"text",placeholder:A(n)("sessions.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Tte),[[_n,r.value]])]),h("div",Ate,[(S(!0),I(Me,null,Ze(a.value,(w,b)=>(S(),I("div",{key:w.id,class:Te(["session-row",{"is-active":w.id===e.activeId,"is-selected":b===c.value}]),role:"option","aria-selected":w.id===e.activeId,onClick:_=>u(w.id),onMouseenter:_=>c.value=b},[h("span",{class:Te(["dot",p(w)])},null,2),h("div",Ete,[h("span",Ite,N(w.title),1),h("span",$te,[h("span",Nte,N(i.value[w.id]??A(n)("sessions.noWorkspace")),1),g[4]||(g[4]=h("span",{class:"sep"},"·",-1)),h("span",Lte,N(w.time),1)])]),d(w.id)>0?(S(),I("span",Rte,N(d(w.id)),1)):ue("",!0)],42,Mte))),128)),a.value.length===0?(S(),I("div",Ote,N(e.sessions.length===0?A(n)("sessions.emptyNone"):A(n)("sessions.emptyNoMatch")),1)):ue("",!0)]),h("div",Pte,N(A(n)("sessions.footerHint")),1)],8,bte)]))}}),Bte=yt(Dte,[["__scopeId","data-v-c48c4439"]]),Fte=["aria-label"],Hte={class:"dh"},Wte={class:"dtitle"},Ute=["aria-label"],qte={class:"crumbbar"},jte=["disabled","title","aria-label"],zte={class:"crumbs"},Vte={key:0,class:"crumb-sep"},Kte=["onClick"],Gte={key:0,class:"filterbar"},Yte=["placeholder"],Xte={key:0,class:"search-spin","aria-hidden":"true"},Zte={class:"folder-list"},Jte={key:0,class:"fl-loading"},Qte=["onClick"],ene={class:"folder-name search-rel"},tne={key:0,class:"git-tag"},nne={key:0,class:"git-branch"},sne={key:0,class:"fl-empty"},one={key:1,class:"fl-loading"},ine=["onClick"],rne={class:"folder-name"},lne={key:0,class:"git-tag"},ane={key:0,class:"git-branch"},cne={key:0,class:"fl-empty"},une={class:"paste-label",for:"aw-path"},dne=["placeholder","onKeydown"],fne=["disabled","title"],hne={class:"actions"},pne=["disabled","title"],mne={class:"footer-hint"},gne=600,vne=6,Tw=150,yne=Xe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=ie(!1),r=ie(!1),l=ie(""),a=ie(null),c=ie([]),u=ie(""),d=ie(!1),p=ie([]),m=U(()=>u.value.trim().length>0);let f=0,g=null;function w(R,P){const O=R.toLowerCase(),W=P.toLowerCase();let V=0;for(let z=0;z<W.length&&V<O.length;z++)W[z]===O[V]&&V++;return V===O.length}async function b(R){const P=l.value,O=R.trim();if(!P||O===""){p.value=[],d.value=!1;return}const W=++f;d.value=!0;const V=[],z=[{path:P,depth:0}];let se=0;for(;z.length>0&&se<gne&&V.length<Tw;){if(W!==f)return;const Q=z.shift();se++;let me;try{me=await s.browseFs(Q.path)}catch{continue}if(W!==f)return;for(const $e of me.entries){if(!$e.isDir)continue;const He=$e.path.startsWith(P)?$e.path.slice(P.length).replace(/^\/+/,""):$e.path;if(w(O,He||$e.name)&&(V.push({path:$e.path,name:$e.name,rel:He||$e.name,isGitRepo:$e.isGitRepo,branch:$e.branch}),V.length>=Tw))break;Q.depth+1<vne&&z.push({path:$e.path,depth:Q.depth+1})}W===f&&(p.value=[...V])}W===f&&(d.value=!1)}Ve(u,R=>{if(g&&clearTimeout(g),R.trim()===""){f++,p.value=[],d.value=!1;return}g=setTimeout(()=>void b(R),220)});const _=ie(!1),v=ie(""),y=U(()=>v.value.trim()),k=U(()=>{const R=l.value;if(!R)return[];const P=R.split("/").filter(Boolean),O=[{label:"/",path:"/"}];let W="";for(const V of P)W+=`/${V}`,O.push({label:V,path:W});return O}),T=U(()=>l.value.length>0);async function E(R){i.value=!0;try{const P=await s.browseFs(R);if(!P.path){r.value=!0;return}l.value=P.path,a.value=P.parent,c.value=P.entries,u.value="",r.value=!1}catch{r.value=!0}finally{i.value=!1}}function C(R){R.isDir&&E(R.path)}function M(){a.value&&E(a.value)}function $(){T.value&&o("add",l.value)}function L(){y.value.length!==0&&o("add",y.value)}sn(async()=>{i.value=!0;try{if(s.defaultPath&&(await E(s.defaultPath),!r.value))return;const R=await s.getFsHome();R.home?await E(R.home):r.value=!0}catch{r.value=!0}finally{i.value=!1}});function D(R){R.key==="Escape"&&o("close")}return sn(()=>document.addEventListener("keydown",D)),Gt(()=>{document.removeEventListener("keydown",D),g&&clearTimeout(g)}),(R,P)=>(S(),I("div",{class:"backdrop",onClick:P[6]||(P[6]=Ye(O=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":A(n)("workspace.addTitle")},[h("div",Hte,[h("span",Wte,N(A(n)("workspace.addTitle")),1),h("button",{class:"close-btn","aria-label":A(n)("workspace.cancel"),onClick:P[0]||(P[0]=O=>o("close"))},[...P[7]||(P[7]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Ute)]),r.value?ue("",!0):(S(),I(Me,{key:0},[h("div",qte,[h("button",{class:"up-btn",disabled:!a.value,title:A(n)("workspace.up"),"aria-label":A(n)("workspace.up"),onClick:M},[...P[8]||(P[8]=[h("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[h("path",{d:"M8 12V4M4 7l4-3 4 3"})],-1)])],8,jte),h("div",zte,[(S(!0),I(Me,null,Ze(k.value,(O,W)=>(S(),I(Me,{key:O.path},[W>1?(S(),I("span",Vte,"/")):ue("",!0),h("button",{class:Te(["crumb",{last:W===k.value.length-1}]),onClick:V=>E(O.path)},N(O.label),11,Kte)],64))),128))])]),i.value?ue("",!0):(S(),I("div",Gte,[P[9]||(P[9]=h("svg",{class:"filter-icon",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("circle",{cx:"7",cy:"7",r:"4.5"}),h("path",{d:"M11 11l3 3"})],-1)),Lt(h("input",{"onUpdate:modelValue":P[1]||(P[1]=O=>u.value=O),class:"filter-input",type:"text",placeholder:A(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:P[2]||(P[2]=Ye(()=>{},["stop"]))},null,40,Yte),[[_n,u.value]]),d.value?(S(),I("span",Xte)):ue("",!0)])),h("div",Zte,[i.value?(S(),I("div",Jte,N(A(n)("workspace.browsing")),1)):m.value?(S(),I(Me,{key:1},[(S(!0),I(Me,null,Ze(p.value,O=>(S(),I("button",{key:O.path,class:"folder-row",onClick:W=>E(O.path)},[P[10]||(P[10]=h("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),h("span",ene,N(O.rel),1),O.isGitRepo?(S(),I("span",tne,[vt(N(A(n)("workspace.gitTag")),1),O.branch?(S(),I("span",nne,N(O.branch),1)):ue("",!0)])):ue("",!0)],8,Qte))),128)),!d.value&&p.value.length===0?(S(),I("div",sne,N(A(n)("workspace.noFilterMatch",{q:u.value.trim()})),1)):d.value&&p.value.length===0?(S(),I("div",one,N(A(n)("workspace.searching")),1)):ue("",!0)],64)):(S(),I(Me,{key:2},[(S(!0),I(Me,null,Ze(c.value,O=>(S(),I("button",{key:O.path,class:"folder-row",onClick:W=>C(O)},[P[11]||(P[11]=h("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),h("span",rne,N(O.name),1),O.isGitRepo?(S(),I("span",lne,[vt(N(A(n)("workspace.gitTag")),1),O.branch?(S(),I("span",ane,N(O.branch),1)):ue("",!0)])):ue("",!0)],8,ine))),128)),c.value.length===0?(S(),I("div",cne,N(A(n)("workspace.noSubfolders")),1)):ue("",!0)],64))])],64)),h("div",{class:Te(["paste-section",{"paste-only":r.value}])},[!r.value&&!_.value?(S(),I("button",{key:0,type:"button",class:"paste-toggle",onClick:P[3]||(P[3]=O=>_.value=!0)},N(A(n)("workspace.pasteToggle")),1)):(S(),I(Me,{key:1},[h("label",une,N(A(n)("workspace.pathLabel")),1),Lt(h("input",{id:"aw-path","onUpdate:modelValue":P[4]||(P[4]=O=>v.value=O),class:"paste-input",type:"text",placeholder:A(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:Io(Ye(L,["stop"]),["enter"])},null,40,dne),[[_n,v.value]]),h("button",{class:"paste-add",disabled:y.value.length===0,title:A(n)("workspace.add"),onClick:L},[...P[12]||(P[12]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 3v10M3 8h10"})],-1)])],8,fne)],64))],2),h("div",hne,[r.value?ue("",!0):(S(),I("button",{key:0,class:"act-btn primary",disabled:!T.value,title:l.value,onClick:$},N(A(n)("workspace.openThisFolder")),9,pne)),h("button",{class:"act-btn",onClick:P[5]||(P[5]=O=>o("close"))},N(A(n)("workspace.cancel")),1)]),h("div",mne,N(A(n)("workspace.browseHint")),1)],8,Fte)]))}}),kne=yt(yne,[["__scopeId","data-v-50af6ed0"]]),bne=["aria-label"],_ne={class:"dh"},wne={class:"dtitle"},Sne=["title"],Cne={class:"rows"},xne={class:"row"},Tne={class:"row"},Ane={class:"row"},Mne={class:"row"},Ene={class:"row"},Ine={class:"row"},$ne={class:"ctx-text"},Nne={key:0,class:"bar"},Lne={class:"row"},Rne=Xe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=U(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),r=U(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:i.value}):n("status.statusNone"));function l(f){return n(f==="yolo"?"status.permissionYolo":f==="auto"?"status.permissionAuto":"status.permissionManual")}const a=U(()=>{const f=s.status.permission;return f==="yolo"?"var(--err)":f==="auto"?"var(--warn)":"var(--ink)"}),c=U(()=>s.planMode?n("status.planOn"):n("status.planOff")),u=U(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),d=U(()=>typeof s.costUsd=="number"&&s.costUsd>0),p=U(()=>d.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));function m(f){f.key==="Escape"&&o("close")}return sn(()=>document.addEventListener("keydown",m)),Gt(()=>document.removeEventListener("keydown",m)),(f,g)=>(S(),I("div",{class:"backdrop",onClick:g[1]||(g[1]=Ye(w=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":A(n)("status.statusPanelTitle")},[h("div",_ne,[h("span",wne,N(A(n)("status.statusPanelTitle")),1),h("button",{class:"close-btn",title:A(n)("status.statusPanelClose"),onClick:g[0]||(g[0]=w=>o("close"))},"✕",8,Sne)]),h("dl",Cne,[h("div",xne,[h("dt",null,N(A(n)("status.statusModel")),1),h("dd",null,N(e.status.model),1)]),h("div",Tne,[h("dt",null,N(A(n)("status.statusThinking")),1),h("dd",null,N(e.thinking),1)]),h("div",Ane,[h("dt",null,N(A(n)("status.statusPermission")),1),h("dd",{style:Dt({color:a.value})},N(l(e.status.permission)),5)]),h("div",Mne,[h("dt",null,N(A(n)("status.statusPlanMode")),1),h("dd",{class:Te({"plan-on":e.planMode})},N(c.value),3)]),h("div",Ene,[h("dt",null,N(A(n)("status.statusSwarmMode")),1),h("dd",{class:Te({"swarm-on":e.swarmMode})},N(u.value),3)]),h("div",Ine,[h("dt",null,N(A(n)("status.statusContext")),1),h("dd",null,[h("span",$ne,N(r.value),1),e.status.ctxMax>0?(S(),I("span",Nne,[h("i",{style:Dt({width:i.value+"%"})},null,4)])):ue("",!0)])]),h("div",Lne,[h("dt",null,N(A(n)("status.statusCost")),1),h("dd",null,N(p.value),1)])])],8,bne)]))}}),One=yt(Rne,[["__scopeId","data-v-b8e6208e"]]),Pne={key:0,class:"toasts",role:"status","aria-live":"polite"},Dne=["onPointerenter","onPointerleave"],Bne={class:"body"},Fne={class:"title"},Hne={key:0,class:"msg"},Wne={key:1,class:"actions"},Une=["onClick"],qne=["onClick"],jne={key:2,class:"details"},zne=["aria-label","onClick"],Vne=Xe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t();function i(C){return typeof C=="object"&&C!==null}function r(C){return i(C)?C.title:C}function l(C){return i(C)?C.message??"":""}function a(C){return i(C)?C.details:void 0}function c(C){return i(C)?C.severity==="error":C.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(C)}function u(C){return i(C)?`notice:${C.severity}:${C.title}:${C.message??""}:${JSON.stringify(C.details??[])}`:`text:${C}`}function d(C){if(!i(C))return C;const M=[C.title];C.message&&M.push(C.message);const $=C.details??[];if($.length>0){M.push("",`${o("warnings.diagnostics")}:`);for(const L of $)M.push(`${L.label}: ${L.value}`)}return M.join(`
249
- `)}let p=1;const m=ie([]),f=new Map,g=new Map;function w(C){const M=c(C)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?M+5e3:M}function b(C,M){const $=f.get(C)??{handle:null,deadline:0,remaining:0};$.handle=setTimeout(()=>E(C),M),$.deadline=Date.now()+M,f.set(C,$)}function _(C){const M=f.get(C);M&&M.handle!==null&&clearTimeout(M.handle),f.delete(C)}function v(C){const M=f.get(C);!M||M.handle===null||(clearTimeout(M.handle),M.handle=null,M.remaining=Math.max(0,M.deadline-Date.now()))}function y(C){if(m.value.find(L=>L.id===C)?.detailsOpen)return;const $=f.get(C);!$||$.handle!==null||b(C,$.remaining)}function k(C){C.detailsOpen=!C.detailsOpen,C.detailsOpen?v(C.id):y(C.id)}async function T(C){if(!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(d(C.warning)),C.copied=!0;const M=g.get(C.id);M&&clearTimeout(M),g.set(C.id,setTimeout(()=>{C.copied=!1,g.delete(C.id)},1400))}function E(C){_(C);const M=g.get(C);M&&clearTimeout(M),g.delete(C);const $=m.value.findIndex(L=>L.id===C);$!==-1&&(m.value=m.value.filter(L=>L.id!==C),s("dismiss",$))}return Ve(()=>n.warnings,C=>{const M=[...m.value];m.value=C.map($=>{const L=u($),D=M.findIndex(O=>O.key===L),R=D===-1?void 0:M.splice(D,1)[0];if(R)return R.warning=$,R;const P={id:p++,key:L,warning:$,detailsOpen:!1,copied:!1};return b(P.id,w($)),P});for(const $ of M){_($.id);const L=g.get($.id);L&&clearTimeout(L),g.delete($.id)}},{immediate:!0,flush:"post"}),Gt(()=>{f.forEach(C=>{C.handle!==null&&clearTimeout(C.handle)}),f.clear(),g.forEach(C=>clearTimeout(C)),g.clear()}),(C,M)=>m.value.length?(S(),I("div",Pne,[(S(!0),I(Me,null,Ze(m.value,$=>(S(),I("div",{key:$.id,class:Te(["toast",{err:c($.warning)}]),onPointerenter:L=>v($.id),onPointerleave:L=>y($.id)},[M[1]||(M[1]=h("span",{class:"dot","aria-hidden":"true"},null,-1)),h("div",Bne,[h("div",Fne,N(r($.warning)),1),l($.warning)?(S(),I("div",Hne,N(l($.warning)),1)):ue("",!0),a($.warning)?.length?(S(),I("div",Wne,[h("button",{class:"link",type:"button",onClick:L=>k($)},N($.detailsOpen?A(o)("warnings.hideDetails"):A(o)("warnings.showDetails")),9,Une),h("button",{class:"link",type:"button",onClick:L=>T($)},N($.copied?A(o)("warnings.copied"):A(o)("warnings.copyDetails")),9,qne)])):ue("",!0),$.detailsOpen&&a($.warning)?.length?(S(),I("dl",jne,[(S(!0),I(Me,null,Ze(a($.warning),L=>(S(),I("div",{key:`${L.label}:${L.value}`,class:"detail-row"},[h("dt",null,N(L.label),1),h("dd",null,N(L.value),1)]))),128))])):ue("",!0)]),h("button",{class:"x",type:"button","aria-label":A(o)("warnings.dismiss"),onClick:L=>E($.id)},[...M[0]||(M[0]=[h("svg",{viewBox:"0 0 16 16",width:"12",height:"12"},[h("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round"})],-1)])],8,zne)],42,Dne))),128))])):ue("",!0)}}),Kne=yt(Vne,[["__scopeId","data-v-0a9833a1"]]),Gne={class:"topbar"},Yne={class:"wsq"},Xne=["aria-label"],Zne={class:"tb-path"},Jne={class:"ws"},Qne={class:"se"},ese={class:"tb-sub"},tse=["aria-label"],nse=Xe({__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}=_t(),s=e,o=t,i=U(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=U(()=>s.workspace?.name??n("workspace.noWorkspace")),l=U(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(S(),I("div",Gne,[h("span",Yne,N(i.value),1),h("button",{type:"button",class:"tb-mid","aria-label":A(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[h("span",Zne,[h("span",Jne,N(r.value),1),e.sessionTitle?(S(),I(Me,{key:0},[c[2]||(c[2]=h("span",{class:"sl"},"/",-1)),h("span",Qne,N(e.sessionTitle),1)],64)):ue("",!0),c[3]||(c[3]=h("span",{class:"cv"},"⌄",-1))]),h("span",ese,[h("span",{class:Te(["rd",{on:e.running}])},null,2),h("span",null,N(l.value),1),e.branch?(S(),I(Me,{key:0},[vt(" · "+N(e.branch),1)],64)):ue("",!0),e.sessionCount>0?(S(),I(Me,{key:1},[vt(" · "+N(A(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ue("",!0)])],8,Xne),h("button",{type:"button",class:"tb-set","aria-label":A(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},[...c[4]||(c[4]=[ur('<svg viewBox="0 0 24 24" width="21" height="21" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" aria-hidden="true" data-v-95de12de><line x1="4" y1="8" x2="20" y2="8" data-v-95de12de></line><circle cx="10" cy="8" r="2.5" fill="var(--bg)" data-v-95de12de></circle><line x1="4" y1="16" x2="20" y2="16" data-v-95de12de></line><circle cx="15" cy="16" r="2.5" fill="var(--bg)" data-v-95de12de></circle></svg>',1)])],8,tse)]))}}),sse=yt(nse,[["__scopeId","data-v-95de12de"]]),ose={key:0,class:"sheet-root"},ise=["aria-label"],rse=["aria-label"],lse={key:0,class:"sheet-head"},ase={class:"sheet-title"},cse={class:"sheet-body"},use=Xe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ve(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Gt(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(S(),je(Si,{name:"sheet"},{default:yn(()=>[e.modelValue?(S(),I("div",ose,[h("div",{class:"sheet-scrim",onClick:i}),h("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||A(n)("mobile.sheetLabel")},[h("button",{type:"button",class:"sheet-grab","aria-label":A(n)("mobile.closeSheet"),onClick:i},null,8,rse),e.title?(S(),I("div",lse,[h("span",ase,N(e.title),1)])):ue("",!0),h("div",cse,[Yl(l.$slots,"default",{},void 0,!0)])],8,ise)])):ue("",!0)]),_:3}))}}),FT=yt(use,[["__scopeId","data-v-ee82f5a2"]]),dse={class:"mlist"},fse={key:0,class:"mempty"},hse=["onClick"],pse={class:"mgh-folder",width:"15",height:"15",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},mse={class:"mgh-main"},gse={class:"mgh-name"},vse=["title"],yse={key:0,class:"att"},kse=["title","aria-label","onClick"],bse=["title","aria-label","onClick"],_se=["onClick"],wse=["onClick"],Sse={key:0,class:"mempty small"},Cse=["onClick"],xse={class:"m"},Tse={class:"s"},Ase={key:0,class:"att"},Mse=["title","onClick"],Ese=["onClick"],Ise=["onClick"],$se=["onClick"],Aw=5,Nse=7200*60*1e3,Lse=Xe({__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"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t;function i(){o("update:modelValue",!1)}function r(P){o("select",P),i()}function l(P){o("createInWorkspace",P),i()}function a(){o("create"),i()}function c(){o("addWorkspace"),i()}const u=ie(new Set);function d(P){return u.value.has(P)}function p(P){const O=new Set(u.value);if(O.has(P)){O.delete(P);const W=new Set(f.value);W.delete(P),f.value=W}else O.add(P);u.value=O,_.value=null,C.value=null}function m(P){return s.attentionByWorkspace[P]??0}const f=ie(new Set);function g(P){return f.value.has(P)}function w(P){const O=new Set(f.value);O.has(P)?O.delete(P):O.add(P),f.value=O}function b(P,O,W){if(O||P.length<=Aw)return P;const z=Date.now()-Nse,se=P.slice(0,Aw),Q=new Set(se.map(He=>He.id)),me=P.filter(He=>Q.has(He.id)?!1:(He.updatedAt?Date.parse(He.updatedAt):0)>z),$e=[...se,...me];if(W&&!$e.some(He=>He.id===W)){const He=P.find(Be=>Be.id===W);He&&$e.push(He)}return $e}const _=ie(null),v=ie(null);let y;function k(P){_.value=_.value===P?null:P,C.value=null,clearTimeout(y),v.value=null}function T(P){_.value=null;const W=(typeof window<"u"?window.prompt(n("sidebar.rename"),P.title):null)?.trim();W&&o("rename",P.id,W)}function E(P){if(v.value===P){clearTimeout(y),v.value=null,_.value=null,o("archive",P);return}clearTimeout(y),v.value=P,y=setTimeout(()=>{v.value=null},2500)}const C=ie(null),M=ie(null);let $;function L(P){C.value=C.value===P?null:P,_.value=null,clearTimeout($),M.value=null}function D(P){navigator.clipboard.writeText(P.root),C.value=null}function R(P){if(M.value===P){clearTimeout($),M.value=null,C.value=null,o("deleteWorkspace",P);return}clearTimeout($),M.value=P,$=setTimeout(()=>{M.value=null},2500)}return Gt(()=>{clearTimeout(y),clearTimeout($)}),(P,O)=>(S(),je(FT,{"model-value":e.modelValue,"onUpdate:modelValue":O[2]||(O[2]=W=>o("update:modelValue",W))},{default:yn(()=>[h("button",{type:"button",class:"newrow",onClick:a},[O[3]||(O[3]=h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),vt(" "+N(A(n)("sidebar.newChat")),1)]),h("button",{type:"button",class:"newrow secondary",onClick:c},[O[4]||(O[4]=h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),h("path",{d:"M1 5.5h12"})],-1)),vt(" "+N(A(n)("sidebar.newWorkspace")),1)]),h("div",dse,[e.groups.length===0?(S(),I("div",fse,N(A(n)("workspace.noWorkspace")),1)):ue("",!0),(S(!0),I(Me,null,Ze(e.groups,W=>(S(),I("div",{key:W.workspace.id,class:"mgroup"},[h("div",{class:Te(["mgh",{on:W.workspace.id===e.activeWorkspaceId}]),onClick:V=>p(W.workspace.id)},[(S(),I("svg",pse,[d(W.workspace.id)?(S(),I(Me,{key:0},[O[5]||(O[5]=h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),O[6]||(O[6]=h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(S(),I(Me,{key:1},[O[7]||(O[7]=h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),O[8]||(O[8]=h("path",{d:"M1 5.5h12"},null,-1))],64))])),h("div",mse,[h("span",gse,N(W.workspace.name),1),h("span",{class:"mgh-path",title:W.workspace.root},N(W.workspace.branch||W.workspace.shortPath),9,vse)]),d(W.workspace.id)&&m(W.workspace.id)>0?(S(),I("span",yse,N(m(W.workspace.id)),1)):ue("",!0),h("button",{type:"button",class:"mgh-more",title:A(n)("sidebar.options"),"aria-label":A(n)("sidebar.options"),onClick:Ye(V=>L(W.workspace.id),["stop"])},[...O[9]||(O[9]=[h("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,kse),h("button",{type:"button",class:"mgh-add",title:A(n)("workspace.newInGroup"),"aria-label":A(n)("workspace.newInGroup"),onClick:Ye(V=>l(W.workspace.id),["stop"])},"+",8,bse),C.value===W.workspace.id?(S(),I("div",{key:1,class:"kmenu wsmenu",onClick:O[0]||(O[0]=Ye(()=>{},["stop"]))},[h("button",{class:"kitem",onClick:Ye(V=>D(W.workspace),["stop"])},N(A(n)("sidebar.copyPath")),9,_se),h("button",{class:"kitem archive",onClick:Ye(V=>R(W.workspace.id),["stop"])},N(M.value===W.workspace.id?A(n)("sidebar.confirm"):A(n)("sidebar.delete")),9,wse)])):ue("",!0)],10,hse),Lt(h("div",null,[W.sessions.length===0?(S(),I("div",Sse,N(A(n)("sidebar.noSessions")),1)):ue("",!0),(S(!0),I(Me,null,Ze(b(W.sessions,g(W.workspace.id),e.activeId),V=>(S(),I("div",{key:V.id,class:Te(["srow",{cur:V.id===e.activeId}]),onClick:z=>r(V.id)},[h("div",xse,[h("div",{class:Te(["t",{run:V.busy,aborted:V.status==="aborted"}])},N(V.title),3),h("div",Tse,N(V.time),1)]),(e.attentionBySession[V.id]??0)>0?(S(),I("span",Ase,N(e.attentionBySession[V.id]),1)):ue("",!0),h("button",{type:"button",class:"kb",title:A(n)("sidebar.options"),onClick:Ye(z=>k(V.id),["stop"])},[...O[10]||(O[10]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,Mse),_.value===V.id?(S(),I("div",{key:1,class:"kmenu",onClick:O[1]||(O[1]=Ye(()=>{},["stop"]))},[h("button",{class:"kitem",onClick:Ye(z=>T(V),["stop"])},N(A(n)("sidebar.rename")),9,Ese),h("button",{class:"kitem archive",onClick:Ye(z=>E(V.id),["stop"])},N(v.value===V.id?A(n)("sidebar.archiveConfirm"):A(n)("sidebar.archive")),9,Ise)])):ue("",!0)],10,Cse))),128)),!g(W.workspace.id)&&b(W.sessions,!1,e.activeId).length<W.sessions.length?(S(),I("button",{key:1,type:"button",class:"mshow-more",onClick:Ye(V=>w(W.workspace.id),["stop"])},N(A(n)("sidebar.showMore",{count:W.sessions.length-b(W.sessions,!1,e.activeId).length})),9,$se)):ue("",!0)],512),[[Eo,!d(W.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),Rse=yt(Lse,[["__scopeId","data-v-6125071b"]]),Ose={class:"srow-main"},Pse={class:"srow-label"},Dse={class:"srow-sub"},Bse={class:"srow-main"},Fse={class:"srow-label"},Hse={class:"srow-val"},Wse={class:"srow-main"},Use={class:"srow-label"},qse={class:"srow-sub"},jse=["aria-checked"],zse={class:"srow-main"},Vse={class:"srow-label"},Kse={class:"srow-sub"},Gse=["aria-checked"],Yse={class:"srow-main"},Xse={class:"srow-label"},Zse={class:"srow read-only"},Jse={class:"srow-main"},Qse={class:"srow-label"},eoe={class:"srow-sub"},toe=["aria-label"],noe={class:"srow read-only pref"},soe={class:"srow-main"},ooe={class:"srow-label"},ioe=["aria-label"],roe=["aria-pressed"],loe=["aria-pressed"],aoe={class:"srow read-only pref"},coe={class:"srow-main"},uoe={class:"srow-label"},doe=["aria-label"],foe=["aria-pressed"],hoe=["aria-pressed"],poe=["aria-pressed"],moe={class:"srow read-only pref"},goe={class:"srow-main"},voe={class:"srow-label"},yoe={class:"srow read-only pref"},koe={class:"srow-main"},boe={class:"srow-label"},_oe={class:"num-field"},woe=["value","aria-label"],Soe={class:"srow-main"},Coe={class:"srow-label"},xoe={class:"srow-sub"},Toe=["aria-checked"],Aoe={class:"srow-main"},Moe={class:"srow-label"},Eoe={class:"srow-main"},Ioe={class:"srow-label"},$oe=Xe({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},theme:{default:"terminal"},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},betaToc:{type:Boolean}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setTheme","setColorScheme","setUiFontSize","setBetaToc","login","logout"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=["manual","auto","yolo"],r=U(()=>s.thinking??"high"),l=U(()=>s.planMode===!0),a=U(()=>s.swarmMode===!0),c=U(()=>{const v=s.status.permission;return v==="yolo"?"var(--err)":v==="auto"?"var(--warn)":"var(--faint)"}),u=U(()=>{const v=s.status.permission,y=n(v==="yolo"?"mobile.permYoloSub":v==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${v} · ${y}`}),d=v=>`${Math.round(v/1e3)}k`,p=U(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),m=U(()=>s.status.ctxMax>0?`${d(s.status.ctxUsed)}/${d(s.status.ctxMax)}`:n("status.statusNone"));function f(){o("setThinking",r.value==="off"?"high":"off")}function g(){const v=i.indexOf(s.status.permission),y=i[(v+1)%i.length];o("setPermission",y)}function w(){o("pickModel"),o("update:modelValue",!1)}function b(){o("login"),o("update:modelValue",!1)}function _(){o("logout"),o("update:modelValue",!1)}return(v,y)=>(S(),je(FT,{"model-value":e.modelValue,title:A(n)("mobile.settingsTitle"),"onUpdate:modelValue":y[9]||(y[9]=k=>o("update:modelValue",k))},{default:yn(()=>[h("button",{type:"button",class:"srow",onClick:w},[h("span",Ose,[h("span",Pse,N(A(n)("status.statusModel")),1),h("span",Dse,N(e.status.model),1)]),y[10]||(y[10]=h("span",{class:"chev"},"›",-1))]),h("button",{type:"button",class:"srow",onClick:f},[h("span",Bse,[h("span",Fse,N(A(n)("status.statusThinking")),1)]),h("span",Hse,N(r.value==="off"?A(n)("status.planOff"):A(n)("status.planOn")),1),y[11]||(y[11]=h("span",{class:"chev"},"›",-1))]),h("button",{type:"button",class:"srow",onClick:y[0]||(y[0]=k=>o("togglePlan"))},[h("span",Wse,[h("span",Use,N(A(n)("status.statusPlanMode")),1),h("span",qse,N(A(n)("mobile.planModeSub")),1)]),h("span",{class:Te(["toggle",{on:l.value}]),role:"switch","aria-checked":l.value},null,10,jse)]),h("button",{type:"button",class:"srow",onClick:y[1]||(y[1]=k=>o("toggleSwarm"))},[h("span",zse,[h("span",Vse,N(A(n)("status.statusSwarmMode")),1),h("span",Kse,N(A(n)("mobile.swarmModeSub")),1)]),h("span",{class:Te(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,Gse)]),h("button",{type:"button",class:"srow",onClick:g},[h("span",Yse,[h("span",Xse,N(A(n)("status.statusPermission")),1),h("span",{class:"srow-sub",style:Dt({color:c.value})},N(u.value),5)]),y[12]||(y[12]=h("span",{class:"chev"},"›",-1))]),h("div",Zse,[h("span",Jse,[h("span",Qse,N(A(n)("status.statusContext")),1),h("span",eoe,N(m.value),1)]),h("span",{class:"ctx-meter","aria-label":m.value},[h("i",{style:Dt({width:p.value+"%"})},null,4)],8,toe)]),h("div",noe,[h("span",soe,[h("span",ooe,N(A(n)("theme.label")),1)]),h("div",{class:"seg",role:"group","aria-label":A(n)("theme.label")},[h("button",{type:"button",class:Te(["seg-opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:y[2]||(y[2]=k=>o("setTheme","modern"))},N(A(n)("theme.modern")),11,roe),h("button",{type:"button",class:Te(["seg-opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:y[3]||(y[3]=k=>o("setTheme","kimi"))},N(A(n)("theme.kimi")),11,loe)],8,ioe)]),h("div",aoe,[h("span",coe,[h("span",uoe,N(A(n)("theme.colorSchemeLabel")),1)]),h("div",{class:"seg",role:"group","aria-label":A(n)("theme.colorSchemeLabel")},[h("button",{type:"button",class:Te(["seg-opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:y[4]||(y[4]=k=>o("setColorScheme","light"))},N(A(n)("theme.light")),11,foe),h("button",{type:"button",class:Te(["seg-opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:y[5]||(y[5]=k=>o("setColorScheme","dark"))},N(A(n)("theme.dark")),11,hoe),h("button",{type:"button",class:Te(["seg-opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:y[6]||(y[6]=k=>o("setColorScheme","system"))},N(A(n)("theme.system")),11,poe)],8,doe)]),h("div",moe,[h("span",goe,[h("span",voe,N(A(n)("sidebar.language")),1)]),pt(DT)]),h("div",yoe,[h("span",koe,[h("span",boe,N(A(n)("settings.uiFontSize")),1)]),h("label",_oe,[h("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":A(n)("settings.uiFontSize"),onInput:y[7]||(y[7]=k=>o("setUiFontSize",Number(k.target.value)))},null,40,woe),y[13]||(y[13]=h("span",{class:"num-unit"},"px",-1))])]),h("button",{type:"button",class:"srow",onClick:y[8]||(y[8]=k=>o("setBetaToc",!e.betaToc))},[h("span",Soe,[h("span",Coe,N(A(n)("settings.betaToc")),1),h("span",xoe,N(A(n)("settings.betaTocHint")),1)]),h("span",{class:Te(["toggle",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc},null,10,Toe)]),e.authReady?(S(),I("button",{key:0,type:"button",class:"srow acct out",onClick:_},[h("span",Aoe,[h("span",Moe,N(A(n)("sidebar.signOut")),1)])])):(S(),I("button",{key:1,type:"button",class:"srow acct in",onClick:b},[h("span",Eoe,[h("span",Ioe,N(A(n)("sidebar.signIn")),1)])]))]),_:1},8,["model-value","title"]))}}),Noe=yt($oe,[["__scopeId","data-v-3bea22b2"]]),Loe={class:"ob-backdrop"},Roe=["aria-label"],Ooe=["aria-label"],Poe={class:"ob-brand"},Doe={class:"ob-title"},Boe={class:"ob-sub"},Foe={class:"ob-sec"},Hoe={class:"ob-label"},Woe={class:"ob-seg",role:"group"},Uoe=["aria-pressed","onClick"],qoe={class:"ob-sec"},joe={class:"ob-label"},zoe={class:"ob-themes"},Voe=["aria-pressed"],Koe={class:"ob-theme-name"},Goe={class:"ob-theme-desc"},Yoe=["aria-pressed"],Xoe={class:"ob-theme-name"},Zoe={class:"ob-theme-desc"},Joe=Xe({__name:"Onboarding",props:{theme:{}},emits:["setTheme","complete","skip"],setup(e,{emit:t}){const n=e,s=t,{t:o,locale:i}=_t();function r(c){i.value!==c&&oC(c)}const l=ie(n.theme);function a(){l.value!==n.theme&&s("setTheme",l.value),s("complete")}return(c,u)=>(S(),I("div",Loe,[h("div",{class:"ob-card",role:"dialog","aria-modal":"true","aria-label":A(o)("onboarding.title")},[h("button",{type:"button",class:"ob-close","aria-label":A(o)("onboarding.skip"),onClick:u[0]||(u[0]=d=>s("skip"))},[...u[3]||(u[3]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M4 4l8 8M12 4l-8 8"})],-1)])],8,Ooe),h("div",Poe,[u[4]||(u[4]=h("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[h("defs",null,[h("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[h("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),h("g",{class:"ob-eyes",fill:"#000"},[h("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),h("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),h("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--blue)",mask:"url(#obKimiEyes)"})],-1)),h("div",null,[h("div",Doe,N(A(o)("onboarding.title")),1),h("div",Boe,N(A(o)("onboarding.subtitle")),1)])]),h("section",Foe,[h("div",Hoe,N(A(o)("onboarding.languageLabel")),1),h("div",Woe,[(S(!0),I(Me,null,Ze(A(sC),d=>(S(),I("button",{key:d.code,type:"button",class:Te(["ob-seg-btn",{on:A(i)===d.code}]),"aria-pressed":A(i)===d.code,onClick:p=>r(d.code)},N(d.label),11,Uoe))),128))])]),h("section",qoe,[h("div",joe,N(A(o)("onboarding.themeLabel")),1),h("div",zoe,[h("button",{type:"button",class:Te(["ob-theme",{on:l.value==="modern"}]),"aria-pressed":l.value==="modern",onClick:u[1]||(u[1]=d=>l.value="modern")},[u[5]||(u[5]=h("span",{class:"ob-theme-prev modern","aria-hidden":"true"},[h("span",{class:"bub u"}),h("span",{class:"bub a"})],-1)),h("span",Koe,N(A(o)("theme.modern")),1),h("span",Goe,N(A(o)("onboarding.modernDesc")),1)],10,Voe),h("button",{type:"button",class:Te(["ob-theme",{on:l.value==="kimi"}]),"aria-pressed":l.value==="kimi",onClick:u[2]||(u[2]=d=>l.value="kimi")},[u[6]||(u[6]=h("span",{class:"ob-theme-prev kimi","aria-hidden":"true"},[h("span",{class:"kb u"}),h("span",{class:"kb a"})],-1)),h("span",Xoe,N(A(o)("theme.kimi")),1),h("span",Zoe,N(A(o)("onboarding.kimiDesc")),1)],10,Yoe)])]),h("button",{type:"button",class:"ob-start",onClick:a},N(A(o)("onboarding.start")),1)],8,Roe)]))}}),Qoe=yt(Joe,[["__scopeId","data-v-f94b338e"]]),eie=["aria-label"],tie={class:"gload-box"},nie={class:"gload-text"},sie=Xe({__name:"GlobalLoading",setup(e){const{t}=_t();return(n,s)=>(S(),I("div",{class:"gload",role:"status","aria-label":A(t)("app.connecting")},[h("div",tie,[s[0]||(s[0]=ur('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-d8748888><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-d8748888></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-d8748888></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-d8748888></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-d8748888></path></svg><div class="gload-bar" aria-hidden="true" data-v-d8748888><span class="gload-bar-fill" data-v-d8748888></span></div>',2)),h("div",nie,N(A(t)("app.connecting")),1)])],8,eie))}}),oie=yt(sie,[["__scopeId","data-v-d8748888"]]),iie={class:"kap-root"},rie={class:"kap-head"},lie={class:"kap-count"},aie={class:"kap-head-actions"},cie={class:"kap-filters"},uie=["value"],die={class:"kap-check"},fie={class:"kap-check"},hie={class:"kap-view-toggle",role:"group"},pie={key:0,class:"kap-empty"},mie=["onClick"],gie={class:"kap-ts"},vie={class:"kap-label"},yie={key:0,class:"kap-detail"},kie={class:"kap-detail-actions"},bie=["onClick"],_ie={key:1,class:"kap-agg"},wie={class:"mono"},Sie={class:"mono"},Cie={class:"num"},xie={class:"num"},Tie={key:0},Aie={class:"mono"},Mie={class:"num"},Eie={class:"num"},Iie={key:0},$ie=Xe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=ie("all"),o=ie(""),i=ie(""),r=ie(!1),l=ie("timeline"),a=U(()=>(Rv.value,[...SQ()])),c=U(()=>{const M=new Set;for(const $ of a.value)$.sessionId&&M.add($.sessionId);return[...M].sort()});function u(M){return M.kind==="rest:error"||M.code!==void 0&&M.code!==0||M.eventType==="error"||M.eventType==="parse-error"}const d=U(()=>{const M=o.value.trim().toLowerCase();return a.value.filter($=>!(s.value!=="all"&&$.source!==s.value||i.value&&$.sessionId!==i.value||r.value&&!u($)||M&&!`${$.label} ${$.kind} ${$.eventType??""} ${$.sessionId??""} ${$.requestId??""}`.toLowerCase().includes(M)))}),p=U(()=>{const M=new Map;for(const $ of d.value){if($.kind!=="ws:in"&&$.kind!=="ws:out")continue;const L=$.kind==="ws:in"?"←":"→",D=`${L} ${$.eventType??"?"} @ ${$.sessionId??"-"}`,R=M.get(D)??{key:D,sessionId:$.sessionId??"-",eventType:$.eventType??"?",dir:L,count:0};R.count++,$.seq!==void 0&&(R.lastSeq=$.seq),M.set(D,R)}return[...M.values()].sort(($,L)=>L.count-$.count)}),m=U(()=>{const M=new Map;for(const $ of d.value){if($.source!=="rest"||$.kind==="rest:request")continue;const L=`${$.method??"?"} ${$.path??"?"}`,D=M.get(L)??{count:0,errors:0,totalMs:0,timed:0};D.count++,u($)&&D.errors++,$.durationMs!==void 0&&(D.totalMs+=$.durationMs,D.timed++),M.set(L,D)}return[...M.entries()].map(([$,L])=>({key:$,count:L.count,errors:L.errors,avgMs:L.timed>0?Math.round(L.totalMs/L.timed):0})).sort(($,L)=>L.count-$.count)}),f=ie(null),g=ie(!0),w=ie(null),b=ie(null);Ve(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await ut();const M=w.value;M&&(M.scrollTop=M.scrollHeight)});function _(M){f.value=f.value===M?null:M}function v(M){const $=new Date(M),L=(D,R=2)=>String(D).padStart(R,"0");return`${L($.getHours())}:${L($.getMinutes())}:${L($.getSeconds())}.${L($.getMilliseconds(),3)}`}function y(M){return JSON.stringify(M,null,2)}async function k(M){try{await navigator.clipboard.writeText(y(M)),b.value=M.id,setTimeout(()=>{b.value===M.id&&(b.value=null)},1500)}catch{}}function T(){BT(d.value)}function E(M){return u(M)||M.source==="client"?"b-err":M.source==="rest"?"b-rest":M.kind==="ws:lifecycle"?"b-life":M.kind==="ws:out"?"b-out":"b-in"}function C(M){return M.source==="rest"?"REST":M.source==="client"?"APP":"WS"}return(M,$)=>(S(),I("section",iie,[h("header",rie,[$[11]||($[11]=h("strong",null,"KAP debug",-1)),h("span",lie,N(d.value.length)+"/"+N(a.value.length),1),h("div",aie,[h("button",{type:"button",class:Te({on:A(ac)}),onClick:$[0]||($[0]=L=>ac.value=!A(ac))},N(A(ac)?"resume":"pause"),3),h("button",{type:"button",onClick:$[1]||($[1]=L=>A(CQ)())},"clear"),h("button",{type:"button",onClick:$[2]||($[2]=L=>T())},"export jsonl"),h("button",{type:"button",title:"Close window",onClick:$[3]||($[3]=L=>n("close"))},"✕")])]),h("div",cie,[Lt(h("select",{"onUpdate:modelValue":$[4]||($[4]=L=>s.value=L),"aria-label":"Source filter"},[...$[12]||($[12]=[h("option",{value:"all"},"rest + ws + app",-1),h("option",{value:"rest"},"rest",-1),h("option",{value:"ws"},"ws",-1),h("option",{value:"client"},"app errors",-1)])],512),[[of,s.value]]),Lt(h("select",{"onUpdate:modelValue":$[5]||($[5]=L=>i.value=L),"aria-label":"Session filter"},[$[13]||($[13]=h("option",{value:""},"all sessions",-1)),(S(!0),I(Me,null,Ze(c.value,L=>(S(),I("option",{key:L,value:L},N(L),9,uie))),128))],512),[[of,i.value]]),Lt(h("input",{"onUpdate:modelValue":$[6]||($[6]=L=>o.value=L),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[_n,o.value]]),h("label",die,[Lt(h("input",{"onUpdate:modelValue":$[7]||($[7]=L=>r.value=L),type:"checkbox"},null,512),[[sf,r.value]]),$[14]||($[14]=vt(" errors",-1))]),h("label",fie,[Lt(h("input",{"onUpdate:modelValue":$[8]||($[8]=L=>g.value=L),type:"checkbox"},null,512),[[sf,g.value]]),$[15]||($[15]=vt(" follow",-1))]),h("div",hie,[h("button",{type:"button",class:Te({on:l.value==="timeline"}),onClick:$[9]||($[9]=L=>l.value="timeline")},"timeline",2),h("button",{type:"button",class:Te({on:l.value==="aggregate"}),onClick:$[10]||($[10]=L=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(S(),I("div",{key:0,ref_key:"listRef",ref:w,class:"kap-list"},[d.value.length===0?(S(),I("div",pie," No trace entries yet. REST calls and WS frames will appear here. ")):ue("",!0),(S(!0),I(Me,null,Ze(d.value,L=>(S(),I("div",{key:L.id,class:"kap-row-wrap"},[h("button",{type:"button",class:Te(["kap-row",{expanded:f.value===L.id}]),onClick:D=>_(L.id)},[h("span",gie,N(v(L.ts)),1),h("span",{class:Te(["kap-badge",E(L)])},N(C(L)),3),h("span",vie,N(L.label),1)],10,mie),f.value===L.id?(S(),I("div",yie,[h("div",kie,[h("button",{type:"button",onClick:D=>k(L)},N(b.value===L.id?"copied ✓":"copy json"),9,bie)]),h("pre",null,N(y(L)),1)])):ue("",!0)]))),128))],512)):(S(),I("div",_ie,[$[20]||($[20]=h("h4",null,"WS frames by session / type",-1)),h("table",null,[$[17]||($[17]=h("thead",null,[h("tr",null,[h("th",null,"dir"),h("th",null,"type"),h("th",null,"session"),h("th",null,"count"),h("th",null,"last seq")])],-1)),h("tbody",null,[(S(!0),I(Me,null,Ze(p.value,L=>(S(),I("tr",{key:L.key},[h("td",null,N(L.dir),1),h("td",wie,N(L.eventType),1),h("td",Sie,N(L.sessionId),1),h("td",Cie,N(L.count),1),h("td",xie,N(L.lastSeq??"—"),1)]))),128)),p.value.length===0?(S(),I("tr",Tie,[...$[16]||($[16]=[h("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ue("",!0)])]),$[21]||($[21]=h("h4",null,"REST by endpoint",-1)),h("table",null,[$[19]||($[19]=h("thead",null,[h("tr",null,[h("th",null,"endpoint"),h("th",null,"count"),h("th",null,"errors"),h("th",null,"avg ms")])],-1)),h("tbody",null,[(S(!0),I(Me,null,Ze(m.value,L=>(S(),I("tr",{key:L.key},[h("td",Aie,N(L.key),1),h("td",Mie,N(L.count),1),h("td",{class:Te(["num",{err:L.errors>0}])},N(L.errors),3),h("td",Eie,N(L.avgMs),1)]))),128)),m.value.length===0?(S(),I("tr",Iie,[...$[18]||($[18]=[h("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ue("",!0)])])]))]))}}),Nie=yt($ie,[["__scopeId","data-v-ecab45a5"]]),Lie=["title"],Rie=Xe({__name:"DebugPanel",setup(e){const t=ie(!1);let n=null,s=null,o=null;const i=["data-theme","data-color-scheme","data-accent"];function r(u){const d=document.documentElement,p=u.documentElement;for(const m of i){const f=d.getAttribute(m);f!==null?p.setAttribute(m,f):p.removeAttribute(m)}}function l(u){const d=u.document;d.title="KAP debug";const p=d.createElement("base");p.href=location.href,d.head.appendChild(p);for(const f of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(f.cloneNode(!0));r(d),d.body.style.margin="0";const m=d.createElement("div");return m.style.height="100vh",d.body.appendChild(m),m}function a(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=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),p=rf(Nie,{onClose:()=>u.close()});p.mount(d),s=p,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return sn(()=>{c()}),Js(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(S(),I("button",{class:"kap-fab",type:"button",title:t.value?"Focus KAP debug window":"Open KAP debug window",onClick:c}," KAP ",8,Lie))}}),Oie=yt(Rie,[["__scopeId","data-v-0a50ee88"]]);function HT(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 a1(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 Pie(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 Ko(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:a1(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,cwd:e.metadata.cwd,model:e.agent_config.model,usage:HT(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 Of(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 Mw(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 Ov(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:Mw(e.source)};case"video":return{type:"video",source:Mw(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 c1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Ov),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Die(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 Bie(e){return{content:e.content.map(Die),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 Fie(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function WT(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 Hie(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Wie(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Hie),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function UT(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Wie),expiresAt:e.expires_at,createdAt:e.created_at}}function Uie(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 qie(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=Uie(s);return{answers:t,method:e.method,note:e.note}}function u1(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}}function Ew(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 Vi(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Ol(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function co(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function jie(e){if(!e||typeof e!="object")return null;const t=e,n=Vi(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:Vi(t,"goalId")??Vi(t,"goal_id")??"goal",objective:Vi(t,"objective")??"",completionCriterion:Vi(t,"completionCriterion")??Vi(t,"completion_criterion"),status:n,turnsUsed:Ol(t,"turnsUsed")??Ol(t,"turns_used")??0,tokensUsed:Ol(t,"tokensUsed")??Ol(t,"tokens_used")??0,wallClockMs:Ol(t,"wallClockMs")??Ol(t,"wall_clock_ms")??0,terminalReason:Vi(t,"terminalReason")??Vi(t,"terminal_reason"),budget:{tokenBudget:co(o,"tokenBudget")??co(o,"token_budget"),remainingTokens:co(o,"remainingTokens")??co(o,"remaining_tokens"),turnBudget:co(o,"turnBudget")??co(o,"turn_budget"),remainingTurns:co(o,"remainingTurns")??co(o,"remaining_turns"),wallClockBudgetMs:co(o,"wallClockBudgetMs")??co(o,"wall_clock_budget_ms"),remainingWallClockMs:co(o,"remainingWallClockMs")??co(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function zie(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ko(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ko(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:Of(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Of(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:a1(t.payload.status),previousStatus:a1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:HT(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=jie(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:c1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Ov),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:WT(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:UT(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.question.expired":return{type:"questionExpired",sessionId:t.session_id,questionId:t.payload.question_id};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:u1(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:d1(t.payload.config)};default:return{type:"unknown",raw:e}}}function Vie(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function Km(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 d1(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.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,defaultThinking:e.default_thinking,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 Kie(e){return e.session_id}function Gie(e){return e.seq}const Yie="main",Xie=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 Zi(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 Zie(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 Iw(){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 ts(e,t){const n=e[t];return typeof n=="string"?n:void 0}function qr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function uo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Jie(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=ts(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=ts(t,"goalId")??ts(t,"goal_id")??"goal",r=ts(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:ts(t,"completionCriterion")??ts(t,"completion_criterion"),status:o,turnsUsed:qr(t,"turnsUsed")??qr(t,"turns_used")??0,tokensUsed:qr(t,"tokensUsed")??qr(t,"tokens_used")??0,wallClockMs:qr(t,"wallClockMs")??qr(t,"wall_clock_ms")??0,terminalReason:ts(t,"terminalReason")??ts(t,"terminal_reason"),budget:{tokenBudget:uo(s,"tokenBudget")??uo(s,"token_budget"),remainingTokens:uo(s,"remainingTokens")??uo(s,"remaining_tokens"),turnBudget:uo(s,"turnBudget")??uo(s,"turn_budget"),remainingTurns:uo(s,"remainingTurns")??uo(s,"remaining_turns"),wallClockBudgetMs:uo(s,"wallClockBudgetMs")??uo(s,"wall_clock_budget_ms"),remainingWallClockMs:uo(s,"remainingWallClockMs")??uo(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function cc(e,t,n,s){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"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function Qie(e){if(e==null)return"";try{const t=typeof e=="string"?e:JSON.stringify(e);return t.length>120?`${t.slice(0,117)}...`:t}catch{return""}}function ere(e,t){if(e==="turn.step.started")return"Started a step";if(e==="tool.use"||e==="tool.call.started"){const n=ts(t,"name")??ts(t,"toolName")??"tool",s=Qie(t.args??t.input);return s?`Calling ${n}: ${s}`:`Calling ${n}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=ts(n,"text");if(o)return o;const i=ts(n,"message");if(i)return i}const s=ts(t,"message");if(s)return s}return e==="tool.result"?`Finished ${ts(t,"name")??ts(t,"toolName")??ts(t,"toolCallId")??"tool"}`:null}function tre(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];const r=ere(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=cc(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 yd(e){return{...e,content:e.content.map(t=>({...t}))}}function $w(e,t,n){const s={id:Zi("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function nre(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function sre(e){return Array.isArray(e)?e.map(t=>Ov(t)):[]}function Nw(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function ore(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function ire(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(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:o}:null}function Lw(e,t){e.messages.find(n=>n.id===t)}function rre(e,t,n,s,o,i){const r={id:Zi("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Gm(e,t){return e.messages.find(n=>n.id===t)}function Rw(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 lre(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=Iw(),e.set(u,d)),d}function s(u){e.set(u,Iw())}function o(u){t.add(u)}function i(u,d){const p=n(u);p.currentPromptId=d}function r(u,d){s(u);const p=n(u),m=d.promptId??Zi("pr_");p.currentPromptId=m,p.turnPromptId.set(d.turnId,m);const f=$w(p,u,m);d.thinkingText.length>0&&f.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&f.content.push({type:"text",text:d.assistantText});for(const g of d.runningTools){const w=typeof g.lastProgress?.text=="string"&&g.lastProgress.text.length>0?[g.lastProgress.text]:void 0;f.content.push({type:"toolUse",toolCallId:g.toolCallId,toolName:g.name,input:g.args??{},outputLines:w}),p.toolStartTimes.set(g.toolCallId,Date.now())}return p.currentAssistantMsgId=f.id,p.turnTextLen=d.assistantText.length,p.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:m},{type:"messageCreated",message:yd(f)}]}function l(u,d,p,m){try{return c(u,d,p,m)}catch(f){return console.error("[agentProjector] Error projecting event:",u,f instanceof Error?f.message:f),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,p,m){const f=n(p),g=d,w=[],b=g?.agentId;if(typeof b=="string"&&b!==Yie){const _=t.has(b);if(_&&(u==="thinking.delta"||u==="assistant.delta")){const v=g?.delta??"";return v?[{type:"agentDelta",sessionId:p,agentId:b,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(_&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:p,agentId:b,reason:g?.reason}];if(Xie.has(u))return tre(f,p,b,u,g??{},t)}switch(u){case"session.meta.updated":{const _=g?.patch?.title??g?.title;typeof _=="string"&&_.length>0&&w.push({type:"sessionMetaUpdated",sessionId:p,title:_});break}case"prompt.submitted":{const _=g?.promptId,v=g?.userMessageId;if(!_||!v)break;const y=sre(g?.content);if(y.length===0)break;f.currentPromptId=_;const k=nre(f,p,_,v,y,typeof g?.createdAt=="string"?g.createdAt:new Date().toISOString());w.push({type:"messageCreated",message:yd(k)});break}case"turn.started":{const _=g?.turnId,v=f.currentPromptId??Zi("pr_");f.currentPromptId=v,_!==void 0&&f.turnPromptId.set(_,v),f.turnTextLen=0,f.turnThinkLen=0,w.push({type:"sessionStatusChanged",sessionId:p,status:"running",previousStatus:"idle",currentPromptId:v});break}case"turn.step.started":{const _=g?.turnId;let v=f.turnPromptId.get(_)??f.currentPromptId;v||(v=Zi("pr_"),f.currentPromptId=v,_!==void 0&&f.turnPromptId.set(_,v));const y=$w(f,p,v);f.currentAssistantMsgId=y.id,w.push({type:"messageCreated",message:yd(y)});break}case"thinking.delta":{const _=f.currentAssistantMsgId;if(!_)break;const v=g?.delta??"";if(!v)break;m?.offset===0&&f.turnThinkLen>0&&(f.turnThinkLen=0);const y=a(f.turnThinkLen,m?.offset);if(y==="skip")break;if(y==="gap"){w.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"delta_gap"});break}const k=Nw(f,_,"thinking",v);if(k<0)break;f.turnThinkLen+=v.length,w.push({type:"assistantDelta",sessionId:p,messageId:_,contentIndex:k,delta:{thinking:v}});break}case"assistant.delta":{const _=f.currentAssistantMsgId;if(!_)break;const v=g?.delta??"";if(!v)break;m?.offset===0&&f.turnTextLen>0&&(f.turnTextLen=0);const y=a(f.turnTextLen,m?.offset);if(y==="skip")break;if(y==="gap"){w.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"delta_gap"});break}const k=Nw(f,_,"text",v);if(k<0)break;f.turnTextLen+=v.length,w.push({type:"assistantDelta",sessionId:p,messageId:_,contentIndex:k,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const _=f.currentAssistantMsgId,v=g?.turnId,y=f.turnPromptId.get(v)??f.currentPromptId;if(!_||!y)break;const k=g?.toolCallId,T=g?.name??g?.toolName??"",E=g?.args??g?.input??{};ore(f,_,k,T,E);const C=Gm(f,_);C&&C.content.length-1,f.toolStartTimes.set(k,Date.now()),C&&w.push({type:"messageUpdated",sessionId:p,messageId:_,content:C.content.map(M=>({...M})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const _=g?.toolCallId,v=ire(g??{});_&&v&&w.push({type:"toolOutput",sessionId:p,toolCallId:_,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const _=g?.turnId;let v=f.turnPromptId.get(_)??f.currentPromptId;v||(v=Zi("pr_"),f.currentPromptId=v,_!==void 0&&f.turnPromptId.set(_,v));const y=g?.toolCallId,k=g?.output,T=g?.isError??!1;f.toolStartTimes.get(y)??Date.now(),f.toolStartTimes.delete(y);const E=rre(f,p,y,k,T,v);w.push({type:"messageCreated",message:yd(E)}),f.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const _=f.currentAssistantMsgId,v=Zie(g?.usage);if(f.totalInput+=v.input,f.totalOutput+=v.output,f.totalCacheRead+=v.cacheRead,f.totalCacheCreate+=v.cacheCreate,_){Lw(f,_);const y=Gm(f,_);y&&w.push({type:"messageUpdated",sessionId:p,messageId:_,content:y.content.map(k=>({...k})),status:"completed"})}break}case"agent.status.updated":{g?.model&&(f.model=g.model),g?.contextTokens!==void 0&&(f.contextTokens=g.contextTokens),g?.maxContextTokens!==void 0&&(f.contextLimit=g.maxContextTokens),w.push({type:"sessionUsageUpdated",sessionId:p,usage:Rw(f),model:f.model||void 0,swarmMode:g?.swarmMode===!0?!0:g?.swarmMode===!1?!1:void 0,planMode:g?.planMode===!0?!0:g?.planMode===!1?!1:void 0});break}case"turn.ended":{const _=f.currentAssistantMsgId,v=g?.reason??"completed",y=qr(g??{},"durationMs");if(_){Lw(f,_);const E=Gm(f,_);E&&w.push({type:"messageUpdated",sessionId:p,messageId:_,content:E.content.map(C=>({...C})),status:v==="failed"?"error":"completed",durationMs:y})}f.turnCount++;const k=Rw(f);w.push({type:"sessionUsageUpdated",sessionId:p,usage:k});const T=v==="cancelled"||v==="failed"?"aborted":"idle";w.push({type:"sessionStatusChanged",sessionId:p,status:T,previousStatus:"running"}),f.currentAssistantMsgId=void 0,f.currentPromptId=void 0,f.turnTextLen=0,f.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{f.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof g?.subagentId=="string"&&g.subagentId.length>0?g.subagentId:Zi("task_"),sessionId:p,kind:"subagent",description:typeof g?.description=="string"?g.description:g?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof g?.subagentName=="string"?g.subagentName:void 0,parentToolCallId:typeof g?.parentToolCallId=="string"?g.parentToolCallId:void 0,swarmIndex:typeof g?.swarmIndex=="number"?g.swarmIndex:void 0};f.subagentMeta.set(v.id,v),w.push({type:"taskCreated",sessionId:p,task:v});break}case"subagent.started":{const _=cc(f,p,g?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});_&&w.push({type:"taskCreated",sessionId:p,task:_});break}case"subagent.suspended":{const _=cc(f,p,g?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof g?.reason=="string"?g.reason:void 0});_&&w.push({type:"taskCreated",sessionId:p,task:_});break}case"subagent.completed":{const _=typeof g?.resultSummary=="string"?g.resultSummary:void 0,v=cc(f,p,g?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:_});v&&w.push({type:"taskCreated",sessionId:p,task:v}),w.push({type:"taskCompleted",sessionId:p,taskId:g?.subagentId??"",status:"completed",outputPreview:_});break}case"subagent.failed":{const _=typeof g?.error=="string"?g.error:void 0,v=cc(f,p,g?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:_});v&&w.push({type:"taskCreated",sessionId:p,task:v}),w.push({type:"taskCompleted",sessionId:p,taskId:g?.subagentId??"",status:"failed",outputPreview:_});break}case"error":{w.push({type:"unknown",raw:{_agentError:!0,code:g?.code,message:g?.message}});break}case"warning":{w.push({type:"unknown",raw:{_agentWarning:!0,message:g?.message}});break}case"background.task.started":{const _=g?.info??{},v=typeof _.startedAt=="number"?new Date(_.startedAt).toISOString():void 0,y=typeof _.taskId=="string"?_.taskId:typeof _.taskId=="number"?String(_.taskId):Zi("task_"),k=typeof _.description=="string"?_.description:typeof _.command=="string"?_.command:bn.global.t("tasks.defaultDescription"),T=typeof _.command=="string"?_.command:void 0;w.push({type:"taskCreated",sessionId:p,task:{id:y,sessionId:p,kind:"bash",description:k,command:T,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:T!==void 0?`$ ${T}`:void 0}});break}case"background.task.terminated":{const _=g?.info??{},v=_.status==="failed"||typeof _.exitCode=="number"&&_.exitCode!==0;w.push({type:"taskCompleted",sessionId:p,taskId:typeof _.taskId=="string"?_.taskId:typeof _.taskId=="number"?String(_.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const _=g?.result??{};w.push({type:"compactionCompleted",sessionId:p,tokensBefore:typeof _.tokensBefore=="number"?_.tokensBefore:void 0,tokensAfter:typeof _.tokensAfter=="number"?_.tokensAfter:void 0,summary:typeof _.summary=="string"?_.summary:void 0}),w.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{w.push({type:"compactionStarted",sessionId:p,trigger:g?.trigger==="manual"?"manual":"auto",instruction:typeof g?.instruction=="string"?g.instruction:void 0});break}case"compaction.cancelled":{w.push({type:"compactionCancelled",sessionId:p});break}case"goal.updated":{const _=Jie(g?.snapshot??null);w.push({type:"goalUpdated",sessionId:p,goal:_?.status==="complete"?null:_});break}}return w}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const are=new Set(["server_hello","ack","ping","resync_required","error","pong"]),Ow=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"]),cre=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","question.expired","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"]),ure=new Set(["assistant.delta","thinking.delta"]);function dre(e,t){if(are.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return ure.has(s)?fre(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?cre.has(s)?{route:"protocol"}:Ow.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:Ow.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function fre(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 f1 extends Error{code;requestId;details;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details}}class uc extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;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}}function du(e){return e instanceof f1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function qT(e){return e instanceof uc||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const dc=3e4,jT="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Pw=500;function Dw(){try{return AbortSignal.timeout(dc)}catch{return}}function hre(e,t){let n="",s=e;for(let o=0;o<t;o++)n=jT[s%32]+n,s=Math.floor(s/32);return n}function pre(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=>jT[n%32]).join("")}function Bw(){return`${hre(Date.now(),10)}${pre(16)}`}function mre(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function Fw(e){try{const t=await e.text();return t?t.length>Pw?`${t.slice(0,Pw)}...`:t:void 0}catch{return}}class gre{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=Rf(this.origin,t),o=Bw(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();Sw({method:"POST",path:t,url:s,requestId:o,body:mre(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:Dw()})}catch(u){throw vd({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new uc({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:dc})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw vd({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new uc({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:dc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await Fw(c)})}if(Cw({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),a.code!==0)throw new f1({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details});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,s,o,i=[]){let r=Rf(this.origin,n);if(o){const m=new URLSearchParams;for(const[g,w]of Object.entries(o))w!==void 0&&m.set(g,String(w));const f=m.toString();f&&(r=`${r}?${f}`)}const l=Bw(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();Sw({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:Dw()})}catch(m){throw vd({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:m}),new uc({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:dc})}let d;const p=u.clone();try{d=await u.json()}catch(m){throw vd({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:m}),new uc({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:dc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await Fw(p)})}if(Cw({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}),d.code!==0&&!i.includes(d.code))throw new f1({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details});return d.data}addClientHeaders(t){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)}}class vre{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;Rl("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=new WebSocket(this.wsUrl);this.ws=t,t.onopen=()=>{Rl("open")},t.onmessage=n=>{try{const s=JSON.parse(String(n.data));TQ(s),this.handleFrame(s)}catch(s){Rl("parse-error",{error:String(s)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},t.onerror=()=>{Rl("error"),this.handlers.onError(0,"WebSocket error",!1)},t.onclose=n=>{Rl("close",n?{code:n.code,reason:n.reason,wasClean:n.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,Rl("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 s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t),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,s){const o=kd(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(kd(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(kd(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)}handleFrame(t){const n=t;switch(t.type){case"server_hello":this.onServerHello();break;case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,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 s=n.session_id,o=n.terminal_id,i=n.seq,r=kd(s,o),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?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=dre(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.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 s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),xQ(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function kd(e,t){return`${e}\0${t}`}function Ym(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 Hw(e){return e==="auto_compact"||e==="manual_compact"}class yre{http;config;constructor(t){this.config=t,this.http=new gre(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:[]}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?Pie(t.status):void 0,include_archive:t?.includeArchive,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(Ko),hasMore:s.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 s=await this.http.post("/sessions",n);return Ko(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ko(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return Ko(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,thinkingLevel: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 archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(c1),hasMore:o.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:Ko(n.session),messages:n.messages.items.map(c1),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(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(WT),pendingQuestions:n.pending_questions.map(UT)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Bie(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.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 s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return Ko(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return Ko(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ko)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Fie(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,qie(s));return{resolved:o.resolved,resolvedAt:o.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 s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(u1)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return u1(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(Ym)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return Ym(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Ym(s)}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(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(Ew)])):void 0;return{items:o.items.map(Ew),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return Rf(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Of)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return Of(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}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(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.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(Vie)}async listProviders(){return(await this.http.get("/providers")).items.map(Km)}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 s=await this.http.post("/providers",n);return Km(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return Km(n)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return{changed:t.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.unchanged,failed:t.failed}}async getConfig(){const t=await this.http.get("/config");return d1(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultThinking:"default_thinking",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=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return d1(o)}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 s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return Rf(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=gQ(this.config.serverHttpUrl,this.config.clientId),s=lre(),o=new vre(n,this.config.clientId,{onWireEvent:i=>{const r=Kie(i),l=Gie(i),a=zie(i);a.type==="historyCompacted"&&!Hw(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=s.project(r,c,a,{offset:u});for(const p of d)p.type==="historyCompacted"&&!Hw(p.reason)&&t.onResync(a,l),t.onEvent(p,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.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 o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},close(){o.close()}}}}let Ww;function rt(){return Ww??=new yre(dQ()),Ww}const zT="kimiWeb.compaction",kre="kimiWeb.optimisticUserMessage";function bre(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function _re(e){return{...e,sessions:[...e.sessions],messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function wre(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function Xm(e){return e.role==="user"&&e.metadata?.[kre]===!0}function Sre(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function Uw(e){let t="",n=0;for(const s of e.content)s.type==="text"?t+=s.text:(s.type==="image"||s.type==="file")&&(n+=1);return{text:t,media:n}}function Cre(e,t){const n=Uw(e),s=Uw(t);return n.text===s.text&&n.media===s.media}function xre(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(Xm(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Xm(o)&&Sre(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Xm(o)&&Cre(o,t))return s}return-1}function Tre(e,t,n){let s=!1;const o=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?(s=!0,{...i,content:l}):i});return s?o:e}function Are(e,t,n){const s=_re(e);switch(wre(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[zT]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=s.messagesBySession[o]??[];if(!i.some(l=>l.id===t.message.id)){if(t.message.role==="user"){const l=xre(i,t.message);if(l!==-1){const a=[...i],c=a[l];a[l]={...t.message,id:c.id,promptId:t.message.promptId??c.promptId,metadata:{...t.message.metadata,...c.metadata}},s.messagesBySession[o]=a;break}}s.messagesBySession[o]=[...i,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=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 o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=Tre(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(l=>l.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":case"questionExpired":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i];l[r]=t.task,s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;const l=r.outputLines??[];return l.at(-1)===t.outputChunk?r:{...r,outputLines:[...l,t.outputChunk].slice(-40)}});break}case"taskCompleted":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?bn.global.t("warnings.errorLabel"):bn.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}const h1="/sessions/";function VT(e){const{pathname:t}=e;if(!t.startsWith(h1))return;const n=t.slice(h1.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function Mre(e){return e===void 0||e.length===0?"/":`${h1}${encodeURIComponent(e)}`}function Ere(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 Ire(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
250
- `)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&Ere(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}function KT(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const $re=/^read[_-]?media(?:file)?$/i,Nre=/^agent$/i,Lre=/^data:([^;]+);base64,(.*)$/s,Rre=/^<(image|video|audio)\s+path="([^"]+)">$/,Ore=/Mime type:\s*([^.\s]+)/i,Pre=/Size:\s*(\d+)\s*bytes/i,Dre=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Bre(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 Fre(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 Hre(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 o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function Wre(e,t){if(!$re.test(e))return;const n=Fre(t);if(n===null)return;let s,o,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 m=d.text,f=Rre.exec(m);f&&(o=f[1],s=f[2]);const g=Ore.exec(m);g?.[1]&&(i=g[1]);const w=Pre.exec(m);w?.[1]&&(r=Number(w[1]));const b=Dre.exec(m);b?.[1]&&b[2]&&(l=`${b[1]}x${b[2]}`);continue}const p=Hre(d);p&&(a=p)}if(a===null)return;const c=Lre.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Bre(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function GT(e){if(e!=null){if(typeof e=="string")return e.split(`
251
- `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
252
- `));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
253
- `)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
254
- `)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Ure(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,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function qre(e){let t=null;if(typeof e=="string")try{const n=JSON.parse(e);n&&typeof n=="object"&&(t=n)}catch{t=null}else e&&typeof e=="object"&&(t=e);return t?{description:typeof t.description=="string"?t.description:void 0,subagentType:typeof t.subagent_type=="string"?t.subagent_type:void 0,prompt:typeof t.prompt=="string"?t.prompt:void 0}:{}}function jre(e,t,n,s){const o=qre(t),i=n?n.isError?"failed":"completed":s?"working":"completed",r=n?GT(n.output):void 0;return{id:e,toolCallId:e,name:o.description&&o.description.length>0?o.description:"Sub Agent",subagentType:o.subagentType,prompt:o.prompt,phase:i,status:n?n.isError?"failed":"completed":s?"running":"completed",summary:r&&r.length>0?r.join(`
255
- `):void 0}}function zre(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,s=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==s?n-s:e.createdAt.localeCompare(t.createdAt)}function Vre(e,t){const n=e.split(`
256
- `),s=t.split(`
257
- `),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Kre(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:Vre(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}return n==="shell"||n==="command"?{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}:n==="file_content"||n==="file"?{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}:n==="file_op"||n==="fileop"?{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}:n==="url_fetch"||n==="url"?{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action}:n==="search"?{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0}:n==="invocation"||n==="agent_call"||n==="skill_call"?{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}:n==="todo"||n==="todo_list"?{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"}})}:{kind:"generic",summary:e.action}}function Gre(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"?t?.trigger==="user-slash":!1}function Yre(e){return e.metadata?.origin?.kind==="compaction_summary"}function Xre(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function YT(e,t,n,s=!0,o=[]){const i=[];let r=1;const l=new Map;for(const f of t)l.set(f.toolCallId,f);const a=new Map;for(const f of o){if(f.kind!=="subagent")continue;const g=[f.parentToolCallId,f.id].filter(w=>typeof w=="string"&&w.length>0);for(const w of g){const b=a.get(w)??[];b.push(f),a.set(w,b)}}for(const[f,g]of a.entries())a.set(f,g.toSorted(zre));const c=new Map;for(const f of e)for(const g of f.content)g.type==="toolResult"&&c.set(g.toolCallId,{output:g.output,isError:!!g.isError});let u=null;function d(f=!1){if(!u)return;const g=u;if(u=null,!f||!s)for(let w=0;w<g.tools.length;w++){const b=g.tools[w];if(b.status!=="running")continue;const _={...b,status:"ok"};g.tools[w]=_;const v=g.blocks.find(y=>y.kind==="tool"&&y.tool.id===_.id);v&&v.kind==="tool"&&(v.tool=_)}i.push({id:g.id,role:"assistant",no:r++,text:g.textParts.join(`
258
- `),thinking:g.thinkingParts.length>0?g.thinkingParts.join(`
259
- `):void 0,tools:g.tools.length>0?g.tools:void 0,blocks:g.blocks.length>0?g.blocks:void 0,approval:g.approval,approvalId:g.approvalId,durationMs:g.durationMs})}function p(f,g){for(const w of g)if(w.type==="text"){if(w.text){f.textParts.push(w.text);const b=f.blocks.at(-1);b&&b.kind==="text"?b.text+=`
260
- `+w.text:f.blocks.push({kind:"text",text:w.text})}}else if(w.type==="thinking"){if(w.thinking){f.thinkingParts.push(w.thinking);const b=f.blocks.at(-1);b&&b.kind==="thinking"?b.thinking+=`
261
- `+w.thinking:f.blocks.push({kind:"thinking",thinking:w.thinking})}}else if(w.type==="toolUse"){const b=a.get(w.toolCallId);if(b&&b.length>0){if(b.filter(T=>T.swarmIndex!==void 0).length>1)continue;const k=b.map(Ure);k.length===1?f.blocks.push({kind:"agent",member:k[0]}):f.blocks.push({kind:"agentGroup",members:k});continue}if(Nre.test(w.toolName)){const y=jre(w.toolCallId,w.input,c.get(w.toolCallId),s);f.blocks.push({kind:"agent",member:y});continue}const _=l.get(w.toolCallId),v={id:w.toolCallId,name:w.toolName,arg:typeof w.input=="string"?w.input:JSON.stringify(w.input),status:"running",output:w.outputLines};f.tools.push(v),f.blocks.push({kind:"tool",tool:v}),_&&(f.approval=Kre(_),f.approvalId=_.approvalId)}else if(w.type==="toolResult"){const b=f.tools.findIndex(_=>_.id===w.toolCallId);if(b!==-1){const _=f.tools[b],v={..._,status:w.isError?"error":"ok",output:GT(w.output),media:w.isError?void 0:Wre(_.name,w.output)};f.tools[b]=v;const y=f.blocks.find(k=>k.kind==="tool"&&k.tool.id===w.toolCallId);y&&y.kind==="tool"&&(y.tool=v)}}}function m(f){if(f.type==="image"||f.type==="video"){const g=f.type,w=f.source;if(w.kind==="url")return{url:w.url,kind:g};if(w.kind==="base64")return{url:`data:${w.mediaType};base64,${w.data}`,kind:g};if(w.kind==="file"&&n)return{url:n(w.fileId),kind:g}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image"};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video"}}}for(const f of e){if(f.role==="system")continue;if(Yre(f)){d();const v=f.metadata?.[zT];i.push({id:f.id,role:"compaction",no:r,text:f.content.filter(y=>y.type==="text").map(y=>y.text).join(`
262
- `),compaction:{trigger:v?.trigger,tokensBefore:v?.tokensBefore,tokensAfter:v?.tokensAfter}});continue}if(f.role==="user"){if(d(),!Gre(f))continue;const v=f.metadata?.origin,y=v?.kind==="skill_activation"&&v?.trigger==="user-slash",k=[],T=[];for(const E of f.content){E.type==="text"&&(y?k.push(v.skillArgs??""):k.push(E.text));const C=m(E);C&&T.push({url:C.url,kind:C.kind,alt:E.type==="file"?E.name:void 0})}i.push({id:f.id,role:"user",no:r++,text:k.join(`
263
- `),images:T.length>0?T:void 0,skillActivation:y?{name:v.skillName,args:v.skillArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){u&&p(u,f.content);continue}const g=f.promptId;Xre(u,g)?u!==null&&u.promptId===void 0&&g!==void 0&&(u.promptId=g):(d(),u={id:f.id,promptId:g,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const b=u;if(b===null)continue;const _=JSON.stringify(f.content);b.promptId!==void 0&&b.seenSigs.has(_)||(b.seenSigs.add(_),p(b,f.content))}return d(!0),i}function Zre(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Jre(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||iu(o.toolName)!=="todo")continue;let i=o.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:Zre(a.status)}]:[]})}}return[]}const Qre=["queued","working","suspended","completed","failed"];function ele(e){return e.subagentPhase?e.subagentPhase:e.status==="completed"?"completed":e.status==="failed"?"failed":"working"}function tle(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function nle(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:ele(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=tle();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function sle(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of Qre)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}const XT="kimi-web.permission",Eh="kimi-active-workspace",ZT="kimi-web.thinking",JT="kimi-web.plan-mode",QT="kimi-web.swarm-mode",e3="kimi-web.goal-mode",t3="kimi-web.theme",n3="kimi-web.ui-font-size",s3="kimi-web.starred-models",o3="kimi-web.unread",p1=15,ole=12,ile=20,qw=40401,rle=40402,i3="kimi-web.onboarded",lle=["off","low","medium","high","xhigh","max"];try{localStorage.removeItem("kimi-web.code-font")}catch{}const r3="kimi-web.accent",l3=["blue","mono"];function ale(){try{const e=localStorage.getItem(r3);if(e&&l3.includes(e))return e}catch{}return"blue"}function cle(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}const a3="kimi-web.color-scheme",c3=["light","dark","system"];function ule(){try{const e=localStorage.getItem(a3);if(e&&c3.includes(e))return e}catch{}return"system"}function dle(e){try{localStorage.setItem(a3,e)}catch{}}function fle(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(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function hle(){try{const e=localStorage.getItem(XT);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function ple(e){try{localStorage.setItem(XT,e)}catch{}}function mle(){try{const e=localStorage.getItem(ZT);if(e&&lle.includes(e))return e}catch{}return"high"}function m1(e){try{localStorage.setItem(ZT,e)}catch{}}function gle(){try{return localStorage.getItem(JT)==="true"}catch{return!1}}function vle(e){try{localStorage.setItem(JT,e?"true":"false")}catch{}}function yle(){try{return localStorage.getItem(QT)==="true"}catch{return!1}}function kle(e){try{localStorage.setItem(QT,e?"true":"false")}catch{}}function ble(){try{return localStorage.getItem(e3)==="true"}catch{return!1}}function u3(e){try{localStorage.setItem(e3,e?"true":"false")}catch{}}function _le(){try{const e=localStorage.getItem(o3);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[s,o]of Object.entries(t))o===!0&&(n[s]=!0);return n}catch{return{}}}function d3(e){try{const t={};for(const[n,s]of Object.entries(e))s&&(t[n]=!0);localStorage.setItem(o3,JSON.stringify(t))}catch{}}function wle(){try{const e=localStorage.getItem(s3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Sle(e){try{localStorage.setItem(s3,JSON.stringify(e))}catch{}}function Cle(){try{const e=localStorage.getItem(t3);if(e==="terminal"||e==="modern"||e==="kimi")return e}catch{}return"modern"}function xle(e){try{localStorage.setItem(t3,e)}catch{}}function Ih(e){return Number.isFinite(e)?Math.min(ile,Math.max(ole,Math.round(e))):p1}function Tle(){try{const e=localStorage.getItem(n3);return e===null?p1:Ih(Number(e))}catch{return p1}}function Ale(e){try{localStorage.setItem(n3,String(Ih(e)))}catch{}}function Mle(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${Ih(e)}px`)}function Ele(){try{return localStorage.getItem(Eh)}catch{return null}}const f3="kimi-web.hidden-workspaces";function Ile(){try{const e=localStorage.getItem(f3);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Pv(e){try{localStorage.setItem(f3,JSON.stringify(e))}catch{}}function Dv(e){try{localStorage.setItem(Eh,e)}catch{}}function h3(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function $le(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const H=qs({...bre(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:hle(),thinking:mle(),planMode:gle(),swarmMode:yle(),goalMode:ble(),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:_le(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Ele(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Ile(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{}}),$h=ie([]),Bd=ie(wle()),Pf=ie({}),Df=ie([]),Nle=600,Lle=250,Nh=250,Rle=1e3,Ole=160,Bf=ie(!1);let Kr=[],Xr=null,Ff=-Nh;const Ple=1e3,Dle=4096,p3=32*1024;let Mc=null,g1,Yc=new Set;function m3(){Kr=[],Ff=-Nh,Bf.value=!1,Xr!==null&&(clearTimeout(Xr),Xr=null)}function Ble(){Bf.value=!0,Xr!==null&&clearTimeout(Xr),Xr=setTimeout(()=>{Xr=null,Kr=[],Ff=-Nh,Bf.value=!1},Rle)}function Fle(e){if(e<=0)return;const t=Date.now();Kr.push({time:t,chars:e});const n=t-Nle;if(Kr=Kr.filter(l=>l.time>=n),t-Ff<Nh)return;Ff=t;const s=Kr[0]?.time??t,o=Math.max(t-s,Lle);Kr.reduce((l,a)=>l+a.chars,0)/o*1e3>=Ole&&Ble()}const Xc=ie(null);function g3(e){if(!(e==null||e.length===0))return $h.value.find(t=>t.id===e||t.model===e)}function Hle(){const e=H.activeSessionId?H.sessions.find(t=>t.id===H.activeSessionId):void 0;return g3(e?.model??Xc.value??H.defaultModel)}function Bv(e){const t=OT(Hle(),e);return H.thinking=t,m1(t),t}const ql=ie(null),Ec=ie([]),Hf=ie(!1);async function Lh(e){let t;try{t=await rt().getSessionStatus(e)}catch{return}H.sessions=H.sessions.map(n=>n.id===e?{...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}}:n),H.swarmMode=t.swarmMode,H.planMode=t.planMode}function Rh(e){const t=H.activeSessionId;t&&Promise.resolve(rt().updateSession(t,e)).then(()=>Lh(t)).catch(()=>{})}const Oh=ie(Cle());function Wle(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.theme=e)}Ve(Oh,Wle,{immediate:!0});function v3(e){e!=="terminal"&&e!=="modern"&&e!=="kimi"||(Oh.value=e,xle(e))}function Ule(){v3(Oh.value==="modern"?"terminal":"modern")}const Fv=ie(Tle());Ve(Fv,Mle,{immediate:!0});function qle(e){const t=Ih(e);Fv.value=t,Ale(t)}const y3="kimi-web.beta-toc";function jle(){try{return localStorage.getItem(y3)==="true"}catch{return!1}}function zle(e){try{localStorage.setItem(y3,e?"true":"false")}catch{}}const k3=ie(jle());function Vle(e){k3.value=e,zle(e)}const Hv=ie(ule());Ve(Hv,fle,{immediate:!0});function Kle(e){c3.includes(e)&&(Hv.value=e,dle(e))}const Wv=ie(ale());Ve(Wv,cle,{immediate:!0});function Gle(e){if(l3.includes(e)){Wv.value=e;try{localStorage.setItem(r3,e)}catch{}}}const v1="kimi-web.notify-on-complete";function Yle(){try{const e=localStorage.getItem(v1);return e===null?!0:e==="1"}catch{return!0}}const Wf=ie(Yle()),Uv=ie(typeof Notification<"u"?Notification.permission:"denied");async function Xle(e){if(!e){Wf.value=!1;try{localStorage.setItem(v1,"0")}catch{}return}if(typeof Notification>"u")return;let t=Notification.permission;if(t==="default")try{t=await Notification.requestPermission()}catch{}if(Uv.value=t,t==="granted"){Wf.value=!0;try{localStorage.setItem(v1,"1")}catch{}}}function Zle(e){if(!Wf.value||typeof Notification>"u")return;const t=Notification.permission;if(t!=="denied"){if(t==="default"){Notification.requestPermission().then(n=>{Uv.value=n,n==="granted"&&jw(e)});return}jw(e)}}function jw(e){if(e===H.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible")return;const s=H.sessions.find(o=>o.id===e)?.title?.trim()||"Kimi Code";try{const o=new Notification(s,{body:bn.global.t("settings.notifyBody"),tag:`kimi-complete-${e}`});o.onclick=()=>{try{window.focus()}catch{}Rs(e),o.close()}}catch{}}function Jle(e){try{return localStorage.getItem(e)??""}catch{return""}}const b3=ie(Jle(i3)==="1");function Qle(e){b3.value=e;try{localStorage.setItem(i3,e?"1":"0")}catch{}}let Qo=null,zw=0;function Ph(){return zw+=1,`msg_opt_${Date.now().toString(36)}_${zw}`}const Zo=new Set;function eae(e,t,n){const s={sessions:H.sessions,activeSessionId:H.activeSessionId,messagesBySession:H.messagesBySession,approvalsBySession:H.approvalsBySession,questionsBySession:H.questionsBySession,tasksBySession:H.tasksBySession,goalBySession:H.goalBySession,lastSeqBySession:H.lastSeqBySession,compactionBySession:H.compactionBySession,config:H.config,warnings:H.warnings},o=Are(s,e,{sessionId:t,seq:n});H.sessions=o.sessions,H.activeSessionId=o.activeSessionId,H.messagesBySession=o.messagesBySession,H.approvalsBySession=o.approvalsBySession,H.questionsBySession=o.questionsBySession,H.tasksBySession=o.tasksBySession,H.goalBySession=o.goalBySession,H.lastSeqBySession=o.lastSeqBySession,H.compactionBySession=o.compactionBySession,H.config=o.config??null,H.warnings=o.warnings,e.type==="configChanged"&&(H.defaultModel=e.config.defaultModel??null),e.type==="sessionUsageUpdated"&&e.sessionId===H.activeSessionId&&e.swarmMode!==void 0&&(H.swarmMode=e.swarmMode),e.type==="sessionUsageUpdated"&&e.sessionId===H.activeSessionId&&e.planMode!==void 0&&(H.planMode=e.planMode)}function qv(){if(Qo!==null||typeof WebSocket>"u")return;H.connection="connecting",Qo=rt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){Cce(t);return}eae(t,n.sessionId,n.seq);const s=wo.value[n.sessionId];if(s){const{agentId:o}=s,i=n.sessionId;t.type==="agentDelta"&&t.agentId===o?t.delta.text&&y1(o,i,t.delta.text):t.type==="agentTurnEnded"&&t.agentId===o?Kw(o,i):t.type==="taskProgress"&&t.taskId===o?y1(o,i,t.outputChunk):t.type==="taskCompleted"&&t.taskId===o&&Kw(o,i,t.outputPreview)}if(t.type==="messageCreated"&&t.message.role==="user"&&t.message.promptId!==void 0){const o=t.message.sessionId;H.promptIdBySession[o]!==t.message.promptId&&(H.promptIdBySession={...H.promptIdBySession,[o]:t.message.promptId})}if(t.type==="assistantDelta"&&n.sessionId===H.activeSessionId&&Fle((t.delta.text?.length??0)+(t.delta.thinking?.length??0)),t.type==="sessionStatusChanged"&&(t.status==="idle"||t.status==="aborted")&&kce(t.sessionId),t.type==="approvalRequested"){const o=H.permission;(o==="auto"||o==="yolo")&&Yv(t.approval.approvalId,{decision:"approved",scope:o==="yolo"?"session":void 0})}},onResync(t,n,s){s!==void 0&&(Dh[t]=s),jv(t)},onError(t,n,s){w3({severity:"error",title:bn.global.t("warnings.wsTitle"),message:n,details:[Pn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){H.connected=t,H.connection=t?"connected":"disconnected"}})}const Dh={},Zc=new Set;function tae(e){return du(e)&&e.code===qw?!0:typeof e=="object"&&e!==null&&e.code===qw}function Pn(e,t){if(!(t==null||t===""))return{label:bn.global.t(`warnings.details.${e}`),value:_3(t)}}function _3(e){if(e instanceof Error)return 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 nae(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function sae(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function oae(e,t,n){const s=[Pn("operation",e),Pn("sessionId",n)];return qT(t)?s.push(Pn("request",`${t.method} ${t.path}`),Pn("endpoint",t.url),Pn("requestId",t.requestId),Pn("phase",t.phase),Pn("timeout",`${t.timeoutMs}ms`),Pn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Pn("contentType",t.contentType),Pn("responsePreview",t.bodyPreview),Pn("cause",t.cause)):du(t)?s.push(Pn("code",t.code),Pn("requestId",t.requestId),Pn("message",t.message),Pn("details",t.details)):s.push(Pn("errorName",nae(t)),Pn("message",sae(t)??_3(t))),s.filter(o=>o!==void 0)}function iae(e,t,n={}){const s=qT(t),o=du(t),i=n.title??(s?bn.global.t("warnings.daemonNetworkTitle"):o?bn.global.t("warnings.daemonApiTitle"):bn.global.t("warnings.operationFailedTitle")),r=n.message??(s?bn.global.t("warnings.daemonNetworkMessage"):o?t.message:bn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:oae(e,t,n.sessionId)}}function w3(e){H.warnings=[...H.warnings,e]}function Tt(e,t,n){w3(iae(e,t,n))}const rae={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function S3(e){if(!du(e))return;const t=rae[e.code];return t?bn.global.t(t):void 0}async function lae(e){if(H.sessions=H.sessions.filter(n=>n.id!==e),delete H.messagesBySession[e],delete H.approvalsBySession[e],delete H.questionsBySession[e],delete H.tasksBySession[e],delete H.goalBySession[e],delete H.gitStatusBySession[e],delete H.lastSeqBySession[e],delete H.compactionBySession[e],delete Dh[e],Zc.delete(e),H.activeSessionId!==e)return;const t=H.sessions[0];t?await Rs(t.id,{urlMode:"replace"}):(H.activeSessionId=void 0,H.sessionLoading=!1,_r(void 0,"replace"))}async function jv(e){try{const n=await rt().getSessionSnapshot(e);return H.sessions=H.sessions.map(s=>s.id===e?{...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model}:s),H.messagesBySession={...H.messagesBySession,[e]:n.messages},H.approvalsBySession={...H.approvalsBySession,[e]:n.pendingApprovals},H.questionsBySession={...H.questionsBySession,[e]:n.pendingQuestions},H.lastSeqBySession={...H.lastSeqBySession,[e]:n.asOfSeq},Dh[e]=n.epoch,qv(),Qo&&(Qo.seedSnapshot(e,n),Qo.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch})),"ok"}catch(t){return tae(t)?(await lae(e),"not-found"):(Tt("getSessionSnapshot",t,{title:bn.global.t("warnings.sessionSnapshotTitle"),message:bn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}async function aae(e){try{const n=await rt().listTasks(e);H.tasksBySession={...H.tasksBySession,[e]:KT(n,H.tasksBySession[e]??[])},await cae(e,n)}catch{}}async function cae(e,t){if(H.activeSessionId!==e)return;const n=t??H.tasksBySession[e]??[],s=rt(),o=new Map;if(await Promise.all(n.map(async r=>{if((r.status==="completed"||r.status==="failed"||r.status==="cancelled")&&!Yc.has(r.id)&&!((r.outputLines?.length??0)>0))try{const a=await s.getTask(e,r.id,{withOutput:!0,outputBytes:p3});a.outputPreview!==void 0&&o.set(r.id,{preview:a.outputPreview,bytes:a.outputBytes})}catch{}finally{Yc.add(r.id)}})),o.size===0)return;const i=H.tasksBySession[e]??[];H.tasksBySession={...H.tasksBySession,[e]:i.map(r=>{const l=o.get(r.id);return l?{...r,outputPreview:l.preview,outputBytes:l.bytes}:r})}}async function Vw(e){if(H.activeSessionId!==e)return;const t=rt();let n;try{n=await t.listTasks(e)}catch{return}const s=new Map;await Promise.all(n.map(async l=>{const a=l.status==="running",c=l.status==="completed"||l.status==="failed"||l.status==="cancelled";if(!(!a&&!c)&&!(c&&(Yc.has(l.id)||(l.outputLines?.length??0)>0)))try{const u=await t.getTask(e,l.id,{withOutput:!0,outputBytes:a?Dle:p3});u.outputPreview!==void 0&&s.set(l.id,{preview:u.outputPreview,bytes:u.outputBytes})}catch{}finally{c&&Yc.add(l.id)}}));const o=H.tasksBySession[e]??[],i=new Map(o.map(l=>[l.id,l])),r=n.map(l=>{const a=i.get(l.id),c=s.get(l.id);return{...l,outputLines:a?.outputLines,outputPreview:c?.preview??a?.outputPreview,outputBytes:c?.bytes??a?.outputBytes}});H.tasksBySession={...H.tasksBySession,[e]:KT(r,o)}}function uae(e){Mc!==null&&g1===e||(Uf(),g1=e,Vw(e),Mc=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(H.activeSessionId===e?Vw(e):Uf())},Ple))}function Uf(){Mc!==null&&(clearInterval(Mc),Mc=null),g1=void 0,Yc.clear()}async function dae(e){try{const n=await rt().listSkills(e);Pf.value={...Pf.value,[e]:n}}catch{}}function fae(e){return Object.prototype.hasOwnProperty.call(H.messagesBySession,e)}function hae(e){if(qv(),Qo){const t=H.lastSeqBySession[e]??0,n=Dh[e];Qo.subscribe(e,{seq:t,epoch:n})}}function pae(e){aae(e),Kv(e),Lh(e),Object.prototype.hasOwnProperty.call(Pf.value,e)||dae(e)}function Bh(e){const t=H.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=wo.value[e]?.agentId,o=(H.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&H.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function zv(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;return o<6e4?bn.global.t("sessions.justNow"):i<1?`${Math.round(o/6e4)}m`:i<24?`${Math.round(i)}h`:n.toLocaleDateString(bn.global.locale.value,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}const mae=3e4,Jc=ie(0);let Zm=null;function gae(){Zm===null&&(Zm=setInterval(()=>{Jc.value=(Jc.value+1)%Number.MAX_SAFE_INTEGER},mae),Zm.unref?.())}function vae(e,t){const n=e.split(`
264
- `),s=t.split(`
265
- `),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function yae(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:vae(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}return n==="todo"||n==="todo_list"?{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"}})}:{kind:"generic",summary:e.action}}function kae(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 bae(e){const t=H.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.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 s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function _ae(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=bn.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=bn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??bae(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s}}const wae=U(()=>{const e=H.sessions.find(n=>n.id===H.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:H.workspaceName,branch:t}}),Sae=U(()=>(Jc.value,H.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:zv(e.updatedAt,e.status),status:e.status,busy:Bh(e.id)})))),Cae=U(()=>H.activeSessionId??""),xae=U(()=>{const e=H.activeSessionId;return e?Pf.value[e]??[]:[]}),Tae=U(()=>{const e=H.activeSessionId;return e?H.sendingBySession[e]??!1:!1}),Fh=U(()=>{const e=H.activeSessionId;if(!e)return[];const t=wo.value[e]?.agentId;return(H.tasksBySession[e]??[]).filter(n=>n.id!==t)}),Aae=U(()=>{const e=H.activeSessionId;if(!e)return[];const t=new Set(H.sideChatUserMessageIdsBySession[e]??[]),n=(H.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=H.approvalsBySession[e]??[];return YT(n,s,o=>rt().getFileUrl(o),fu.value!=="idle",Fh.value)}),wo=ie({}),_a=U(()=>{const e=H.activeSessionId;if(!e)return null;const t=wo.value[e];return t?{parentId:e,agentId:t.agentId}:null}),Mae=U(()=>_a.value?.parentId??null),Eae=U(()=>_a.value!==null),Iae=U(()=>{const e=_a.value;return e?!!H.sideChatSendingByAgent[e.agentId]:!1}),C3=U(()=>{const e=_a.value;return e?H.sideChatSendingByAgent[e.agentId]?!0:(H.tasksBySession[e.parentId]??[]).some(t=>t.id===e.agentId&&t.status==="running"):!1}),$ae=U(()=>{const e=_a.value;if(!e)return[];const t=H.sideChatMessagesByAgent[e.agentId]??[];return YT(t,[],n=>rt().getFileUrl(n),C3.value,[])});function Hh(e,t){H.sideChatMessagesByAgent={...H.sideChatMessagesByAgent,[e]:t(H.sideChatMessagesByAgent[e]??[])}}function Nae(e,t){Hh(e,n=>[...n,t])}function Lae(e){Hh(e,t=>{const n=[...t].reverse().findIndex(o=>o.role==="user");if(n===-1)return t;const s=t.length-1-n;return t.filter((o,i)=>i!==s)})}function Rae(e,t){Hh(e,n=>{const s=[...n];for(let o=s.length-1;o>=0;o-=1){const i=s[o];if(i.role==="user")return s[o]={...i,promptId:i.promptId??t},s}return n})}function y1(e,t,n){n&&Hh(e,s=>{const o=s.at(-1);if(o?.role==="assistant"){const i=o.content[0],r=i?.type==="text"?i.text:"";return[...s.slice(0,-1),{...o,content:[{type:"text",text:`${r}${n}`}]}]}return[...s,{id:Ph(),sessionId:t,role:"assistant",content:[{type:"text",text:n}],createdAt:new Date().toISOString()}]})}function Kw(e,t,n){if(H.sideChatSendingByAgent={...H.sideChatSendingByAgent,[e]:!1},!n)return;const o=(H.sideChatMessagesByAgent[e]??[]).at(-1);(o?.role==="assistant"&&o.content[0]?.type==="text"?o.content[0].text:"").trim().length>0||y1(e,t,n)}async function Oae(e){const t=H.activeSessionId;if(t){if(!wo.value[t]){let n;try{({agentId:n}=await rt().startBtw(t))}catch(s){Tt("openSideChat",s,{sessionId:t});return}H.sideChatMessagesByAgent={...H.sideChatMessagesByAgent,[n]:H.sideChatMessagesByAgent[n]??[]},wo.value={...wo.value,[t]:{agentId:n}},qv(),Qo?.markSideChannelAgent(n)}e&&e.trim()&&await x3(e.trim())}}function Pae(){const e=H.activeSessionId;if(!e)return;const{[e]:t,...n}=wo.value;wo.value=n}async function x3(e){const t=_a.value,n=e.trim();if(!t||!n)return;const s=t.parentId,o=t.agentId;H.sideChatSendingByAgent={...H.sideChatSendingByAgent,[o]:!0};const i={id:Ph(),sessionId:s,role:"user",content:[{type:"text",text:n}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};Nae(o,i);try{const r=await rt().submitPrompt(s,{content:[{type:"text",text:n}],agentId:o});Rae(o,r.promptId),H.sideChatUserMessageIdsBySession={...H.sideChatUserMessageIdsBySession,[s]:[...H.sideChatUserMessageIdsBySession[s]??[],r.userMessageId]}}catch(r){Tt("sendSideChatPrompt",r,{sessionId:s}),Lae(o),H.sideChatSendingByAgent={...H.sideChatSendingByAgent,[o]:!1}}}function Dae(e){if(!wo.value[e])return;const{[e]:t,...n}=wo.value;wo.value=n}const k1=ie(0);let tc=null;Ve(()=>Fh.value.some(e=>e.status==="running"),e=>{e&&tc===null?tc=setInterval(()=>{k1.value=(k1.value+1)%Number.MAX_SAFE_INTEGER},1e3):!e&&tc!==null&&(clearInterval(tc),tc=null)},{immediate:!0});Ve(()=>{const e=H.activeSessionId;if(!e)return{sid:void 0,hasRunning:!1};const t=H.tasksBySession[e]??[];return{sid:e,hasRunning:t.some(n=>n.status==="running")}},({sid:e,hasRunning:t},n,s)=>{let o;t&&e!==void 0?uae(e):e!==void 0?o=setTimeout(()=>{(H.tasksBySession[e]??[]).some(r=>r.status==="running")||Uf()},1500):Uf(),s(()=>{o!==void 0&&clearTimeout(o)})},{deep:!0,immediate:!0});const Bae=U(()=>(k1.value,Fh.value.map(_ae))),T3=U(()=>nle(Fh.value)),Fl=U(()=>{const e=H.activeSessionId;return e?H.goalBySession[e]??null:null}),Fae=U(()=>{const e=H.activeSessionId;return e?Jre(H.messagesBySession[e]??[]):[]}),Hae=U(()=>{const e=H.activeSessionId;return e?H.compactionBySession[e]??null:null}),Wae=U(()=>H.connection),Uae=U(()=>H.loading),qae=U(()=>H.sessionLoading),jae=U(()=>H.permission),zae=U(()=>H.thinking),Vae=U(()=>H.planMode),Kae=U(()=>H.swarmMode),Gae=U(()=>H.goalMode),Yae=U(()=>{const e=sle(T3.value);return{plan:H.planMode,goal:Fl.value&&Fl.value.status!=="complete"?{status:Fl.value.status,turnsUsed:Fl.value.turnsUsed,elapsedMs:Fl.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Xae=U(()=>{const e=H.activeSessionId;return e?(H.queuedBySession[e]??[]).map(t=>({text:t.text,attachmentCount:t.attachments?.length??0})):[]}),Zae=U(()=>H.warnings),Jae=U(()=>{const e=H.activeSessionId;return e?(H.questionsBySession[e]??[]).map(kae):[]}),Qae=U(()=>{const e=H.activeSessionId;return e?(H.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:yae(t),agentName:t.agentName})):[]}),fu=U(()=>{const e=H.activeSessionId;return e?(H.approvalsBySession[e]??[]).length>0?"awaiting-approval":(H.questionsBySession[e]??[]).length>0?"awaiting-question":Bh(e)?"running":"idle":"idle"}),qf=U(()=>{const e=H.activeSessionId;if(!e)return null;const t=H.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),ece=U(()=>{const e=H.activeSessionId;return e?H.gitStatusBySession[e]?.pullRequest??null:null}),tce=U(()=>{const e=H.activeSessionId;if(!e)return[];const t=H.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),nce=U(()=>{const e=H.activeSessionId;if(!e)return null;const t=H.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),A3=U(()=>{const e=H.sessions.find(r=>r.id===H.activeSessionId),t=qf.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Xc.value:null,s=(e?.model&&e.model.length>0?e.model:n??H.defaultModel)??"—",o=$h.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:H.permission,branch:t,cwd:e?.cwd??"",isGitRepo:qf.value!==null}}),sce=U(()=>Ec.value),oce=U(()=>H.sessions.find(t=>t.id===H.activeSessionId)?.usage.totalCostUsd??0),ice=U(()=>H.authReady),rce=U(()=>H.defaultModel),lce=U(()=>H.managedProviderStatus),ace=U(()=>H.config),cce=U(()=>{const e=H.activeSessionId;if(!e)return{};const t=H.gitStatusBySession[e];return t?{...t.entries}:{}});function cl(e){return H.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const gr=U(()=>{const e=new Set(H.hiddenWorkspaceRoots),t=new Map;for(const a of H.workspaces)e.has(a.root)||t.set(a.root,{...a});for(const a of H.sessions){const c=a.cwd;c&&(e.has(c)||t.has(c)||t.set(c,{id:a.workspaceId??c,root:c,name:h3(c),isGitRepo:!1,sessionCount:0}))}const n=new Map;for(const a of H.sessions){const c=cl(a);n.set(c,(n.get(c)??0)+1)}const s=qf.value,o=H.sessions.find(a=>a.id===H.activeSessionId)?.cwd,i=H.workspaces.map(a=>a.root),r=[...t.keys()].filter(a=>!i.includes(a));r.sort((a,c)=>a.localeCompare(c));const l=[];for(const a of[...i,...r]){const c=t.get(a),u=n.get(c.id)??n.get(c.root)??c.sessionCount;let d=c.branch;!d&&s&&o===c.root&&(d=s.branch),l.push({...c,sessionCount:u,branch:d})}return l}),Vv=U(()=>gr.value.map(e=>({id:e.id,name:e.name,root:e.root,shortPath:$le(e.root,H.fsHome),branch:e.branch,sessionCount:e.sessionCount}))),M3=U(()=>{const e=H.activeWorkspaceId,t=gr.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),uce=U(()=>{const e=M3.value;return e?Vv.value.find(t=>t.id===e)??null:null}),dce=U(()=>(Jc.value,H.sessions.filter(e=>!e.parentSessionId).map(e=>({id:e.id,title:e.title,time:zv(e.updatedAt,e.status),status:e.status,busy:Bh(e.id)})))),fce=U(()=>{Jc.value;const e=new Map;for(const t of H.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=cl(t),s={id:t.id,title:t.title,time:zv(t.updatedAt,t.status),status:t.status,busy:Bh(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Vv.value.map(t=>({workspace:t,sessions:e.get(t.id)??[]}))}),E3=U(()=>{const e={};for(const[t,n]of Object.entries(H.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(H.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),hce=U(()=>{const e={};for(const[t,n]of Object.entries(H.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(H.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),pce=U(()=>{const e={};for(const[t,n]of Object.entries(H.unreadBySession))n&&(e[t]=!0);return e}),mce=U(()=>{const e={},t=E3.value;for(const n of H.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=cl(n);e[o]=(e[o]??0)+s}return e}),gce=U(()=>H.recentRoots),vce=U(()=>{const e=new Set,t=[];for(const n of H.sessions){const s=n.cwd;if(s&&!e.has(s)&&(e.add(s),t.push(s),t.length>=8))break}return t}),yce=U(()=>H.availableOpenInApps);function kce(e){if(Zo.delete(e),H.sendingBySession={...H.sendingBySession,[e]:!1},H.promptIdBySession[e]!==void 0){const o={...H.promptIdBySession};delete o[e],H.promptIdBySession=o}e===H.activeSessionId?(m3(),Kv(e),Lh(e)):(H.unreadBySession={...H.unreadBySession,[e]:!0},d3(H.unreadBySession)),Zle(e);const t=H.queuedBySession[e]??[];if(t.length===0)return;const[n,...s]=t;H.queuedBySession={...H.queuedBySession,[e]:s},n!==void 0&&Uh(e,n.text,n.attachments).then(o=>{if(!o){const i=H.queuedBySession[e]??[];H.queuedBySession={...H.queuedBySession,[e]:[n,...i]}}})}async function bce(e){const t=H.activeSessionId;if(t){ql.value=e,Ec.value=[],Hf.value=!0;try{const s=await rt().getFileDiff(t,e);if(ql.value!==e)return;Ec.value=Ire(s.diff)}catch(n){ql.value===e&&(Ec.value=[]),console.warn("[loadFileDiff] diff unavailable for",e,n)}finally{ql.value===e&&(Hf.value=!1)}}}function hu(){ql.value=null,Ec.value=[],Hf.value=!1}async function Kv(e){try{const n=await rt().getGitStatus(e);H.gitStatusBySession={...H.gitStatusBySession,[e]:n}}catch{}}async function Gv(){try{const t=await rt().getAuth();H.authReady=t.ready,H.defaultModel=t.defaultModel,H.managedProviderStatus=t.managedProvider?.status??null}catch{}}async function _ce(){try{const e=rt();H.config=await e.getConfig()}catch{}}async function wce(e){try{const n=await rt().setConfig(e);return H.config=n,H.defaultModel=n.defaultModel??null,!0}catch(t){return Tt("setConfig",t),!1}}const I3=ie(!1);async function $3(){H.loading=!0;try{const e=rt(),[,,t]=await Promise.all([e.getHealth().catch(()=>null),e.getMeta().then(r=>{H.serverVersion=r.serverVersion,H.availableOpenInApps=r.openInApps}).catch(()=>null),e.listSessions({pageSize:20}).catch(()=>({items:[],hasMore:!1})),qh()]);await Gv(),await _ce(),H.sessions=t.items,await N3();const n=t.items[0],s=H.activeWorkspaceId;!(s!==null&&gr.value.some(r=>r.id===s))&&n&&ul(cl(n)),Nce();const i=typeof window<"u"?VT(window.location):void 0;!H.activeSessionId&&i!==void 0&&(H.sessions.some(l=>l.id===i)||await L3(i))&&await Rs(i,{urlMode:"replace"}),!H.activeSessionId&&t.items.length>0&&await Rs(t.items[0].id,{urlMode:"replace"})}catch(e){Tt("load",e)}finally{H.loading=!1,I3.value=!0}}async function N3(){try{const e=rt(),[t,n]=await Promise.all([e.listWorkspaces().catch(()=>[]),e.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);H.workspaces=t,H.fsHome=n.home||null,H.recentRoots=n.recentRoots}catch{}}function ul(e){H.activeWorkspaceId=e,Dv(e)}function Sce(e){ul(e);const t=H.sessions.filter(n=>cl(n)===e);if(t.length>0){const n=t[0];n&&n.id!==H.activeSessionId&&Rs(n.id)}else H.activeSessionId=void 0,_r(void 0,"push")}function Wh(e){H.hiddenWorkspaceRoots.includes(e.root)&&(H.hiddenWorkspaceRoots=H.hiddenWorkspaceRoots.filter(s=>s!==e.root),Pv(H.hiddenWorkspaceRoots));const t=H.workspaces.findIndex(s=>s.id===e.id||s.root===e.root);if(t===-1){H.workspaces=[e,...H.workspaces];return}const n=[...H.workspaces];n[t]=e,H.workspaces=n}function Cce(e){if(e.type==="workspaceCreated"||e.type==="workspaceUpdated"){Wh(e.workspace);return}const t=H.workspaces.find(s=>s.id===e.workspaceId)?.root??e.root;if(t&&!H.hiddenWorkspaceRoots.includes(t)&&(H.hiddenWorkspaceRoots=[...H.hiddenWorkspaceRoots,t],Pv(H.hiddenWorkspaceRoots)),H.workspaces=H.workspaces.filter(s=>s.id!==e.workspaceId&&s.root!==t),H.activeWorkspaceId===e.workspaceId||H.activeWorkspaceId===t){const s=gr.value[0]?.id??null;if(H.activeWorkspaceId=s,s)Dv(s);else try{localStorage.removeItem(Eh)}catch{}H.activeSessionId=void 0,H.sessionLoading=!1,hu(),_r(void 0,"replace")}}function xce(){H.activeSessionId=void 0,_r(void 0,"push")}function b1(e){ul(e),xce(),hu()}async function Tce(e){const t=gr.value.find(n=>n.id===e);if(t)try{const n=rt();let s,o=t.root;try{const r=await n.addWorkspace({root:t.root});s=r.id,o=r.root,Wh(r)}catch{}const i=await n.createSession({workspaceId:s,cwd:o});return H.sessions=[i,...H.sessions.filter(r=>r.id!==i.id)],ul(i.workspaceId??s??e),Zc.add(i.id),await Rs(i.id),i}catch(n){Tt("createSessionInWorkspace",n);return}}async function Ace(e,t,n){const s=gr.value.find(o=>o.id===e);if(s)try{const o=rt();let i,r=s.root;try{const u=await o.addWorkspace({root:s.root});i=u.id,r=u.root,Wh(u)}catch{}const l=Xc.value??void 0,a=await o.createSession({workspaceId:i,cwd:r,model:l});Xc.value=null;const c=l!==void 0&&(!a.model||a.model.length===0)?{...a,model:l}:a;H.sessions=[c,...H.sessions.filter(u=>u.id!==a.id)],ul(a.workspaceId??i??e),await Rs(a.id),await Uh(a.id,t,n)}catch(o){Tt("startSessionAndSendPrompt",o)}}async function Mce(e){const t=e.trim();if(!t)return;const n=rt();try{const s=await n.addWorkspace({root:t});Wh(s),b1(s.id)}catch{H.workspaces.find(o=>o.root===t)||(H.workspaces=[{id:t,root:t,name:h3(t),isGitRepo:!1,sessionCount:0},...H.workspaces]),b1(t)}}async function Ece(e){try{return await rt().browseFs(e)}catch{return{path:"",parent:null,entries:[]}}}async function Ice(){try{return await rt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function _r(e,t){if(t==="none"||typeof window>"u"||!window.history)return;const n=Mre(e);if(window.location.pathname!==n)try{t==="push"?window.history.pushState(null,"",n):window.history.replaceState(null,"",n)}catch{}}async function L3(e){try{const t=await rt().getSession(e);return H.sessions.some(n=>n.id===t.id)||(H.sessions=[...H.sessions,t]),!0}catch{return!1}}function $ce(){const e=VT(window.location);if(e===void 0){H.activeSessionId=void 0;return}if(e!==H.activeSessionId){if(H.sessions.some(t=>t.id===e)){Rs(e,{urlMode:"none"});return}(async()=>{if(await L3(e)){await Rs(e,{urlMode:"none"});return}const t=H.sessions[0];t?await Rs(t.id,{urlMode:"replace"}):(H.activeSessionId=void 0,_r(void 0,"replace"))})()}}let Gw=!1;function Nce(){Gw||typeof window>"u"||(Gw=!0,window.addEventListener("popstate",$ce))}async function Rs(e,t){const n=fae(e),s=!n&&Zc.has(e);Zc.delete(e);try{_r(e,t?.urlMode??"push"),H.sessionLoading=!n&&!s,H.activeSessionId=e,m3(),H.unreadBySession[e]&&(H.unreadBySession={...H.unreadBySession,[e]:!1},d3(H.unreadBySession)),hu();const o=H.sessions.find(i=>i.id===e);if(o){const i=cl(o);H.activeWorkspaceId!==i&&ul(i)}if(n)hae(e);else if(await jv(e)==="not-found")return;pae(e)}catch(o){Tt("selectSession",o,{sessionId:e})}finally{H.activeSessionId===e&&(H.sessionLoading=!1)}}async function Lce(e,t){try{const s=await rt().createSession({cwd:e,title:t?.title,model:t?.model});H.sessions=[s,...H.sessions.filter(o=>o.id!==s.id)],Zc.add(s.id),await Rs(s.id)}catch(n){Tt("createSession",n)}}async function Uh(e,t,n){Zo.add(e),H.sendingBySession={...H.sendingBySession,[e]:!0};const s=Ph();try{const o=rt(),i=[];t&&i.push({type:"text",text:t});for(const m of n??[])m.kind==="video"?i.push({type:"video",source:{kind:"file",fileId:m.fileId}}):i.push({type:"image",source:{kind:"file",fileId:m.fileId}});if(i.length===0)return Zo.delete(e),H.sendingBySession={...H.sendingBySession,[e]:!1},!1;const r={id:s,sessionId:e,role:"user",content:i,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}},l=H.messagesBySession[e]??[];H.messagesBySession={...H.messagesBySession,[e]:[...l,r]};const a=H.sessions.find(m=>m.id===e),c=(a?.model&&a.model.length>0?a.model:H.defaultModel)??void 0;if(H.goalMode&&t)try{await o.updateSession(e,{goalObjective:t.trim()})}catch(m){Tt("createGoal",m,{sessionId:e}),Zo.delete(e),H.sendingBySession={...H.sendingBySession,[e]:!1};const f=H.messagesBySession[e]??[];return f.some(g=>g.id===s)&&(H.messagesBySession={...H.messagesBySession,[e]:f.filter(g=>g.id!==s)}),!1}const u=await o.submitPrompt(e,{content:i,model:c,thinking:H.thinking,permissionMode:H.permission,planMode:H.planMode,swarmMode:H.swarmMode});H.goalMode&&(H.goalMode=!1,u3(!1)),H.promptIdBySession={...H.promptIdBySession,[e]:u.promptId};const d=H.messagesBySession[e]??[],p=d.findIndex(m=>m.id===s);if(p!==-1){const m=[...d];m[p]={...m[p],promptId:m[p].promptId??u.promptId},H.messagesBySession={...H.messagesBySession,[e]:m}}return Qo?.bindNextPromptId(e,u.promptId),!0}catch(o){Zo.delete(e),H.sendingBySession={...H.sendingBySession,[e]:!1};const i=H.messagesBySession[e]??[];return i.some(r=>r.id===s)&&(H.messagesBySession={...H.messagesBySession,[e]:i.filter(r=>r.id!==s)}),Tt("sendPrompt",o,{sessionId:e}),!1}}async function R3(e,t){const n=H.activeSessionId;if(n){if(fu.value!=="idle"||Zo.has(n)){O3(e,t);return}await Uh(n,e,t)}}async function Rce(e,t){const n=H.activeSessionId;if(!n)return;const s=H.queuedBySession[n]??[],o=[],i=[];for(const d of s){const p=d.text.trim();p&&o.push(p),d.attachments?.length&&i.push(...d.attachments)}const r=e.trim();if(r&&o.push(r),t?.length&&i.push(...t),o.length===0&&i.length===0)return;s.length>0&&(H.queuedBySession={...H.queuedBySession,[n]:[]});const l=o.join(`
266
-
267
- `);if(fu.value==="idle"&&!Zo.has(n)){await Uh(n,l,i);return}const a=[];l&&a.push({type:"text",text:l});for(const d of i)d.kind==="video"?a.push({type:"video",source:{kind:"file",fileId:d.fileId}}):a.push({type:"image",source:{kind:"file",fileId:d.fileId}});const c=Ph(),u={id:c,sessionId:n,role:"user",content:a,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};H.messagesBySession={...H.messagesBySession,[n]:[...H.messagesBySession[n]??[],u]};try{const d=rt(),p=H.sessions.find(b=>b.id===n),m=(p?.model&&p.model.length>0?p.model:H.defaultModel)??void 0,f=await d.submitPrompt(n,{content:a,model:m,thinking:H.thinking,permissionMode:H.permission,planMode:H.planMode,swarmMode:H.swarmMode}),g=H.messagesBySession[n]??[],w=g.findIndex(b=>b.id===c);if(w!==-1){const b=[...g];b[w]={...b[w],promptId:b[w].promptId??f.promptId},H.messagesBySession={...H.messagesBySession,[n]:b}}if(f.status!=="queued"){H.promptIdBySession={...H.promptIdBySession,[n]:f.promptId},Qo?.bindNextPromptId(n,f.promptId);return}try{await d.steerPrompts(n,[f.promptId])}catch{}}catch(d){const p=H.messagesBySession[n]??[];H.messagesBySession={...H.messagesBySession,[n]:p.filter(m=>m.id!==c)},Tt("steer",d,{sessionId:n})}}async function Oce(e,t){try{const s=await rt().uploadFile({file:e,name:t});return{fileId:s.id,name:s.name,mediaType:s.mediaType}}catch(n){return Tt("uploadImage",n),null}}function O3(e,t){const n=H.activeSessionId;if(!n)return;const s=H.queuedBySession[n]??[];H.queuedBySession={...H.queuedBySession,[n]:[...s,{text:e,attachments:t}]}}async function Pce(){const e=H.activeSessionId;if(!e)return;const t=H.sessions.find(o=>o.id===e);let n=H.promptIdBySession[e];if(n===void 0){const o=t?.currentPromptId;o?.startsWith("prompt_")&&(n=o)}const s=rt();if(n!==void 0)try{await s.abortPrompt(e,n);return}catch(o){if(!(du(o)&&o.code===rle)){Tt("abortCurrentPrompt",o,{sessionId:e});return}}try{await s.abortSession(e)}catch(o){Tt("abortCurrentPrompt",o,{sessionId:e})}}async function Yv(e,t){const n=H.activeSessionId;if(n)try{const s=rt(),o={decision:t.decision,scope:t.scope,feedback:t.feedback};await s.respondApproval(n,e,o);const i=H.approvalsBySession[n]??[];H.approvalsBySession={...H.approvalsBySession,[n]:i.filter(r=>r.approvalId!==e)}}catch(s){Tt("respondApproval",s,{sessionId:n})}}async function Dce(e,t){const n=H.activeSessionId;if(n)try{await rt().respondQuestion(n,e,t);const o=H.questionsBySession[n]??[];H.questionsBySession={...H.questionsBySession,[n]:o.filter(i=>i.questionId!==e)}}catch(s){Tt("respondQuestion",s,{sessionId:n})}}async function Bce(e){const t=H.activeSessionId;if(t)try{await rt().dismissQuestion(t,e);const s=H.questionsBySession[t]??[];H.questionsBySession={...H.questionsBySession,[t]:s.filter(o=>o.questionId!==e)}}catch(n){Tt("dismissQuestion",n,{sessionId:t})}}async function Fce(e){const t=H.activeSessionId;if(t)try{await rt().cancelTask(t,e);const s=H.tasksBySession[t]??[];H.tasksBySession={...H.tasksBySession,[t]:s.map(o=>o.id===e?{...o,status:"cancelled"}:o)}}catch(n){Tt("cancelTask",n,{sessionId:t})}}function Hce(e){const t=Bv(e);Rh({thinking:t})}function P3(e){H.planMode=e,vle(e),Rh({planMode:e})}function Wce(){P3(!H.planMode)}function D3(e){H.swarmMode=e,kle(e),Rh({swarmMode:e})}function Uce(){const e=!H.swarmMode;e&&H.permission==="manual"&&!confirm("Enable swarm mode? The agent will run multiple sub agents in parallel.")||D3(e)}function B3(e){H.goalMode=e,u3(e)}function qce(){B3(!H.goalMode)}async function jce(e){const t=e.trim();if(!t||H.permission==="manual"&&!confirm(`Start goal: "${t}"? The agent will run autonomously toward this objective.`))return;const n=H.activeSessionId;if(n){try{await rt().updateSession(n,{goalObjective:t})}catch(s){Tt("createGoal",s,{sessionId:n,message:S3(s)});return}await R3(t)}}function zce(e){const t=H.activeSessionId;t&&Promise.resolve(rt().updateSession(t,{goalControl:e})).catch(n=>{Tt("controlGoal",n,{sessionId:t,message:S3(n)})})}function Vce(e){if(H.permission=e,ple(e),Rh({permissionMode:e}),e==="auto"||e==="yolo"){const t=H.activeSessionId;if(t){const n=[...H.approvalsBySession[t]??[]];for(const s of n)Yv(s.approvalId,{decision:"approved",scope:e==="yolo"?"session":void 0})}}}function Kce(e){const t=[...H.warnings];t.splice(e,1),H.warnings=t}async function Gce(e,t){try{await rt().updateSession(e,{title:t}),H.sessions=H.sessions.map(s=>s.id===e?{...s,title:t}:s)}catch(n){Tt("renameSession",n,{sessionId:e})}}function Yce(e,t){H.workspaces=H.workspaces.map(n=>n.id===e?{...n,name:t}:n)}async function Xce(e){const t=H.workspaces.find(i=>i.id===e)?.root??gr.value.find(i=>i.id===e)?.root??e,n=H.activeSessionId?H.sessions.find(i=>i.id===H.activeSessionId):void 0,s=H.activeWorkspaceId===e||H.activeWorkspaceId===t,o=!!(n&&(n.cwd===t||n.workspaceId===e||cl(n)===e));t&&!H.hiddenWorkspaceRoots.includes(t)&&(H.hiddenWorkspaceRoots=[...H.hiddenWorkspaceRoots,t],Pv(H.hiddenWorkspaceRoots));try{await rt().deleteWorkspace(e)}catch{}if(H.workspaces=H.workspaces.filter(i=>i.id!==e&&i.root!==t),s||o){const i=gr.value[0]?.id??null;if(H.activeWorkspaceId=i,i)Dv(i);else try{localStorage.removeItem(Eh)}catch{}}(s||o)&&(H.activeSessionId=void 0,H.sessionLoading=!1,hu(),_r(void 0,"replace"))}async function Zce(e){try{await rt().archiveSession(e),H.sessions=H.sessions.filter(o=>o.id!==e),Dae(e);const{[e]:n,...s}=H.sideChatUserMessageIdsBySession;if(H.sideChatUserMessageIdsBySession=s,H.activeSessionId===e){const o=H.sessions[0];o?await Rs(o.id,{urlMode:"replace"}):(H.activeSessionId=void 0,_r(void 0,"replace"))}}catch(t){Tt("archiveSession",t,{sessionId:e})}}async function qh(){try{const e=rt();$h.value=await e.listModels(),Bv(H.thinking)}catch(e){Tt("loadModels",e)}}async function Jce(){try{const e=await rt().refreshOAuthProviderModels();for(const t of e.failed)Tt("refreshOAuthProviderModels",new Error(t.reason),{message:t.provider})}catch{}}async function Xv(){try{const e=rt();Df.value=await e.listProviders()}catch(e){Tt("loadProviders",e)}}async function Qce(e){const t=H.activeSessionId,n=OT(g3(e),H.thinking),s=H.thinking;if(!t){Xc.value=e,Bv(n);return}const o=H.sessions.find(i=>i.id===t)?.model;H.sessions=H.sessions.map(i=>i.id===t?{...i,model:e}:i),n!==s&&(H.thinking=n,m1(n));try{await rt().updateSession(t,{model:e,thinking:n!==s?n:void 0})}catch(i){H.sessions=H.sessions.map(r=>r.id===t?{...r,model:o??r.model}:r),n!==s&&(H.thinking=s,m1(s)),Tt("setModel",i,{sessionId:t});return}await Lh(t)}function eue(e){const t=new Set(Bd.value);t.has(e)?t.delete(e):t.add(e),Bd.value=Array.from(t),Sle(Bd.value)}async function tue(e,t){const n=H.activeSessionId;if(!n)return;const s=fu.value==="idle"&&!Zo.has(n),o=`msg_skill_opt_${Date.now().toString(36)}`;if(s){Zo.add(n),H.sendingBySession={...H.sendingBySession,[n]:!0};const i={id:o,sessionId:n,role:"user",content:[{type:"text",text:`/${e}${t?` ${t}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:e,skillArgs:t}}};H.messagesBySession={...H.messagesBySession,[n]:[...H.messagesBySession[n]??[],i]}}try{await rt().activateSkill(n,e,t)}catch(i){if(s){Zo.delete(n),H.sendingBySession={...H.sendingBySession,[n]:!1};const r=H.messagesBySession[n]??[];H.messagesBySession={...H.messagesBySession,[n]:r.filter(l=>l.id!==o)}}Tt("activateSkill",i,{sessionId:n})}}async function nue(e){try{await rt().addProvider(e),await Promise.all([Xv(),qh()])}catch(t){Tt("addProvider",t)}}async function sue(e){try{await rt().deleteProvider(e),await Promise.all([Xv(),qh()])}catch(t){Tt("deleteProvider",t)}}async function oue(e){try{const n=await rt().refreshProvider(e);Df.value=Df.value.map(s=>s.id===e?n:s)}catch(t){Tt("refreshProvider",t)}}async function iue(){try{return await rt().startOAuthLogin()}catch{return null}}async function rue(){try{return await rt().pollOAuthLogin()}catch{return null}}async function lue(){try{await rt().cancelOAuthLogin()}catch{}}async function aue(){try{await rt().logout(),await Gv(),await $3()}catch(e){Tt("logout",e)}}function cue(e){const t=H.activeSessionId;t&&rt().compactSession(t,e).catch(n=>{Tt("compact",n,{sessionId:t})})}async function uue(e){const t=e??H.activeSessionId;if(t)try{const n=await rt().forkSession(t);H.sessions=[n,...H.sessions.filter(s=>s.id!==n.id)],await Rs(n.id)}catch(n){Tt("fork",n,{sessionId:t})}}async function due(e=1){const t=H.activeSessionId;if(!t)return null;const n=(()=>{const s=H.messagesBySession[t]??[];for(let o=s.length-1;o>=0;o--){const i=s[o];if(i.role==="user"&&!(i.metadata?.origin&&i.metadata.origin.kind!=="user"))return i.content.filter(r=>r.type==="text").map(r=>r.text).join(`
268
- `)}return null})();try{return await rt().undoSession(t,e),await jv(t),n}catch(s){return Tt("undo",s,{sessionId:t}),null}}function fue(e){const t=H.activeSessionId;if(!t)return;const n=H.queuedBySession[t]??[];if(e<0||e>=n.length)return;const s=[...n];s.splice(e,1),H.queuedBySession={...H.queuedBySession,[t]:s}}async function hue(e){const t=H.activeSessionId;if(!t)return[];try{return(await rt().listDirectory(t,{path:e,includeGitStatus:!0})).items}catch{return[]}}async function pue(e){const t=H.activeSessionId;if(!t)return null;try{const s=await rt().readFile(t,{path:e});return{path:s.path,content:s.content,encoding:s.encoding,mime:s.mime,languageId:s.languageId,isBinary:s.isBinary,size:s.size,lineCount:s.lineCount}}catch{return null}}const mue=10485760;function gue(e){const t=H.activeSessionId;return t?rt().getFileDownloadUrl(t,e):null}async function vue(e,t){const n=H.activeSessionId;if(!n)return!1;try{return await rt().openFile(n,{path:e,line:t}),!0}catch(s){return Tt("openFile",s,{sessionId:n}),!1}}async function yue(e){const t=H.activeSessionId;if(!t)return;const n=A3.value.cwd||".";try{await rt().openInApp(t,e,n)}catch(s){Tt("openInApp",s,{sessionId:t})}}async function kue(e){const t=H.activeSessionId;if(!t)return!1;try{return await rt().revealFile(t,{path:e}),!0}catch(n){return Tt("revealFile",n,{sessionId:t}),!1}}async function bue(e){if(/^(https?:|data:|blob:)/i.test(e))return e;const t=H.activeSessionId;if(!t)return e;let n=e;if(n.startsWith("/")){const s=H.sessions.find(o=>o.id===t)?.cwd;if(s&&(n===s||n.startsWith(s.endsWith("/")?s:`${s}/`))){if(n=n.slice(s.length).replace(/^\//,""),!n)return e}else return e}try{const o=await rt().readFile(t,{path:n,length:mue});return!o.isBinary||o.encoding!=="base64"||o.truncated?e:`data:${o.mime};base64,${o.content}`}catch{return e}}async function _ue(e){const t=H.activeSessionId;if(!t)return[];try{return(await rt().searchFiles(t,{query:e,limit:20})).items.map(o=>({path:o.path,name:o.name}))}catch{return[]}}function wue(){return gae(),{workspace:wae,sessions:Sae,activeSessionId:Cae,workspacesView:Vv,visibleWorkspace:uce,activeWorkspaceId:M3,sessionsForView:dce,workspaceGroups:fce,attentionBySession:E3,pendingBySession:hce,attentionByWorkspace:mce,unreadBySession:pce,recentRoots:gce,turns:Aae,tasks:Bae,todos:Fae,goal:Fl,swarms:T3,activationBadges:Yae,compaction:Hae,status:A3,sessionCost:oce,fileDiff:sce,selectedDiffPath:ql,fileDiffLoading:Hf,changes:tce,gitInfo:qf,gitDiffStats:nce,activePullRequest:ece,changesByPath:cce,pendingApprovals:Qae,recentCwds:vce,availableOpenInApps:yce,connection:Wae,loading:Uae,sessionLoading:qae,initialized:I3,permission:jae,thinking:zae,planMode:Vae,swarmMode:Kae,goalMode:Gae,queued:Xae,warnings:Zae,questions:Jae,activity:fu,isSending:Tae,fastMoon:Bf,models:$h,starredModelIds:Bd,providers:Df,theme:Oh,setTheme:v3,toggleTheme:Ule,uiFontSize:Fv,setUiFontSize:qle,betaToc:k3,setBetaToc:Vle,colorScheme:Hv,setColorScheme:Kle,accent:Wv,setAccent:Gle,notifyOnComplete:Wf,notifyPermission:Uv,setNotifyOnComplete:Xle,onboarded:b3,setOnboarded:Qle,load:$3,selectSession:Rs,createSession:Lce,loadWorkspaces:N3,selectWorkspace:ul,openWorkspace:Sce,openWorkspaceDraft:b1,createSessionInWorkspace:Tce,startSessionAndSendPrompt:Ace,addWorkspaceByPath:Mce,browseFs:Ece,getFsHome:Ice,sendPrompt:R3,steerPrompt:Rce,sideChatVisible:Eae,sideChatSessionId:Mae,sideChatTurns:$ae,sideChatRunning:C3,sideChatSending:Iae,openSideChat:Oae,closeSideChat:Pae,sendSideChatPrompt:x3,uploadImage:Oce,abortCurrentPrompt:Pce,respondApproval:Yv,respondQuestion:Dce,dismissQuestion:Bce,cancelTask:Fce,setPermission:Vce,setThinking:Hce,setPlanMode:P3,togglePlanMode:Wce,setSwarmMode:D3,toggleSwarmMode:Uce,setGoalMode:B3,toggleGoalMode:qce,createGoal:jce,controlGoal:zce,enqueue:O3,dismissWarning:Kce,renameSession:Gce,renameWorkspace:Yce,deleteWorkspace:Xce,archiveSession:Zce,compact:cue,forkSession:uue,undo:due,unqueue:fue,searchFiles:_ue,loadGitStatus:Kv,loadFileDiff:bce,clearFileDiff:hu,listDir:hue,readFileContent:pue,getFileDownloadUrl:gue,openWorkspaceFile:vue,openInApp:yue,revealWorkspaceFile:kue,resolveImageUrl:bue,refreshOAuthProviderModels:Jce,loadModels:qh,loadProviders:Xv,skills:xae,activateSkill:tue,setModel:Qce,toggleStarModel:eue,addProvider:nue,deleteProvider:sue,refreshProvider:oue,authReady:ice,defaultModel:rce,managedProviderStatus:lce,config:ace,updateConfig:wce,checkAuth:Gv,startOAuthLogin:iue,pollOAuthLogin:rue,cancelOAuthLogin:lue,logout:aue}}const Sue=640,Cue=`(max-width: ${Sue}px)`;function xue(){const e=ie(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Cue);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Gt(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Gt(()=>t.removeListener(n))),e}const Tue={class:"app-shell"},Aue={key:0,class:"auth-page"},Mue={class:"auth-page-inner"},Eue={class:"auth-page-copy"},Iue={key:0,class:"sidebar-rail"},$ue=["title","aria-label"],Nue={key:3,class:"coming-soon"},Lue={class:"cs-text"},Rue=["aria-label","aria-hidden"],Jm="/login",Oue="kimi-web.sidebar-width",Yw="kimi-web.sidebar-collapsed",Xw=270,Pue=170,Due=420,Bue=36,Fue="kimi-web.file-preview-width",Ur=320,Hue=Xe({__name:"App",setup(e){const t=wue();an("resolveImage",t.resolveImageUrl);const{t:n}=_t(),s=ti(),o=xue(),i=ie(!1),r=ie(!1),l=U(()=>{const Fe=t.activeSessionId.value;return t.sessions.value.find(ce=>ce.id===Fe)?.title??""}),a=U(()=>t.visibleWorkspace.value?.sessionCount??0),c=U(()=>t.activity.value!=="idle"),u=U(()=>t.authReady.value),d=U(()=>t.initialized.value&&!u.value),p=ie(null),m=ie(null);let f=null;function g(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function w(Fe){typeof window>"u"||window.history.replaceState(window.history.state,"",Fe)}Ve(d,Fe=>{if(!(typeof window>"u")){if(Fe){window.location.pathname!==Jm&&(p.value=g(),w(Jm));return}window.location.pathname===Jm&&(w(p.value??"/"),p.value=null)}},{immediate:!0});function b(){const Fe=m.value;Fe&&(Fe.classList.remove("blink-now"),Fe.getBoundingClientRect(),Fe.classList.add("blink-now"),f!==null&&clearTimeout(f),f=setTimeout(()=>{f=null,Fe.classList.remove("blink-now")},300))}const _=["◐","◓","◑","◒"],v=ie(0);let y=null;function k(){y===null&&(v.value=0,y=setInterval(()=>{v.value=(v.value+1)%_.length},250))}function T(){y!==null&&(clearInterval(y),y=null),v.value=0}Ve(c,Fe=>{Fe?k():T()},{immediate:!0});const E=U(()=>{const Fe=c.value?`${_[v.value]} `:"";if(d.value)return`${Fe}${n("app.authPageTitle")} - Kimi Code Web`;const ce=l.value;if(ce)return`${Fe}${ce} - Kimi Code Web`;const be=t.visibleWorkspace.value?.name;return be?`${Fe}${be} - Kimi Code Web`:`${Fe}Kimi Code Web`});TM(()=>{typeof document<"u"&&(document.title=E.value)});function C(Fe){return Fe==="off"?"high":"off"}const M=ie(!t.onboarded.value);function $(){t.setOnboarded(!0),M.value=!1}function L(){M.value=!0}sn(()=>{t.load(),V(),document.addEventListener("keydown",R,!0)}),Gt(()=>{document.removeEventListener("keydown",R,!0),T(),f!==null&&clearTimeout(f)});function D(){return Q.value==="thinking"&&ae.value?(ze(),!0):Q.value==="compaction"&&Ge.value?(Ct(),!0):Q.value==="agent"&&Xn.value?(Ke(),!0):Q.value==="file"?(he(),!0):Q.value==="diff"?(eo(),!0):Q.value==="btw"?(Fn(),!0):!1}function R(Fe){Fe.key==="Escape"&&(St.value||D()&&(Fe.stopPropagation(),Fe.preventDefault()))}const P=ie(Xw),O=ie(!1),W=U(()=>O.value?Bue:P.value);function V(){try{O.value=localStorage.getItem(Yw)==="true"}catch{O.value=!1}}function z(){try{localStorage.setItem(Yw,String(O.value))}catch{}}function se(){O.value=!O.value,z()}const Q=ie(null);function me(){return typeof window>"u"?Ur*2:Math.max(0,window.innerWidth-W.value)}function $e(Fe){const ce=Math.max(Ur,me()-Ur);return Math.min(ce,Math.max(Ur,Math.round(Fe)))}function He(){return $e(me()/2)}const Be=U(()=>He()),Ee=U(()=>Math.max(Ur,me()-Ur)),te=ie(Be.value),ee=ie(null),Z=ie(null),Ae=ie(!1),G=ie(null),oe=ie(null);let J=0;const F=U(()=>{const Fe=oe.value;return Fe?t.getFileDownloadUrl(Fe):null}),Y=U(()=>ee.value!==null);function le(Fe){return Fe.length>1?Fe.replace(/\/+$/,""):Fe}function re(Fe){const ce=[];for(const be of Fe.split(/[\\/]+/))if(!(!be||be===".")){if(be===".."){ce.pop();continue}ce.push(be)}return ce.join("/")}function fe(Fe){const ce=Fe.trim();if(!ce)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(ce))return{error:n("filePreview.errors.unsupportedPath")};if(ce.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const be=le(t.status.value.cwd);if(ce.startsWith("/")){if(!be||ce!==be&&!ce.startsWith(`${be}/`))return{error:n("filePreview.errors.outsideWorkspace")};const Ca=ce===be?"":ce.slice(be.length+1);if(Ca.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const gu=re(Ca);return gu?{path:gu}:{error:n("filePreview.errors.isDirectory")}}if(ce.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const It=re(ce);return It?{path:It}:{error:n("filePreview.errors.emptyPath")}}async function q(Fe){const ce=++J;Q.value="file",Z.value=null,G.value=null,Ae.value=!0,ee.value=Fe,oe.value=null;const be=fe(Fe.path);if("error"in be){Ae.value=!1,G.value=be.error;return}oe.value=be.path;try{const It=await t.readFileContent(be.path);if(ce!==J)return;It?Z.value={...It,path:It.path||be.path}:Z.value={path:be.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(It){if(ce!==J)return;G.value=It instanceof Error?It.message:n("filePreview.errors.loadFailed")}finally{ce===J&&(Ae.value=!1)}}function X(Fe){return/^data:([^;,]+)/i.exec(Fe)?.[1]}function de(Fe){Fe.kind==="image"&&(Q.value="file",ee.value=null,oe.value=null,G.value=null,Ae.value=!1,Z.value={path:Fe.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:Fe.mimeType??X(Fe.url)??"image/*",sourceUrl:Fe.url,isBinary:!0,size:Fe.bytes??0})}function he(){ee.value=null,oe.value=null,Z.value=null,G.value=null,Ae.value=!1,Q.value==="file"&&(Q.value=null)}const ke=ie(null),Ce=U(()=>{const Fe=ke.value;if(!Fe)return null;const be=t.turns.value.find(It=>It.id===Fe.turnId)?.blocks?.[Fe.blockIndex];return be?.kind==="thinking"?be.thinking:null}),ae=U(()=>Ce.value!==null);function _e(Fe){const ce=ke.value;if(ce&&ce.turnId===Fe.turnId&&ce.blockIndex===Fe.blockIndex){ke.value=null,Q.value==="thinking"&&(Q.value=null);return}Q.value="thinking",ke.value=Fe}function ze(){ke.value=null,Q.value==="thinking"&&(Q.value=null)}const Qe=ie(null),dt=U(()=>{const Fe=Qe.value;if(!Fe)return null;const ce=t.turns.value.find(be=>be.id===Fe.turnId);return ce?.role==="compaction"&&ce.text?ce.text:null}),Ge=U(()=>dt.value!==null);function ft(Fe){if(Qe.value?.turnId===Fe.turnId){Qe.value=null,Q.value==="compaction"&&(Q.value=null);return}Q.value="compaction",Qe.value=Fe}function Ct(){Qe.value=null,Q.value==="compaction"&&(Q.value=null)}const Jt=ie(null),Ft=U(()=>{const Fe=Jt.value;if(!Fe)return null;const be=t.turns.value.find(It=>It.id===Fe.turnId)?.blocks?.[Fe.blockIndex];return be?be.kind==="agent"?be.member.id===Fe.memberId?be.member:null:be.kind==="agentGroup"?be.members.find(It=>It.id===Fe.memberId)??null:null:null}),Xn=U(()=>Ft.value!==null);function _s(Fe){const ce=Jt.value;if(ce&&ce.turnId===Fe.turnId&&ce.memberId===Fe.memberId){Jt.value=null,Q.value==="agent"&&(Q.value=null);return}Q.value="agent",Jt.value=Fe}function Ke(){Jt.value=null,Q.value==="agent"&&(Q.value=null)}const Et=ie("list"),ls=ie(null);function Os(){Q.value="diff",Et.value="list",ls.value=null,t.loadGitStatus(t.activeSessionId.value)}function eo(){Q.value==="diff"&&(Q.value=null),Et.value="list",ls.value=null,t.clearFileDiff()}async function Oo(Fe){Et.value="detail",ls.value=Fe,await t.loadFileDiff(Fe)}async function Ps(Fe){await t.openSideChat(Fe),Q.value="btw"}function Fn(){t.closeSideChat(),Q.value==="btw"&&(Q.value=null)}function un(){Q.value==="btw"&&(Q.value=null)}const to=U(()=>t.sideChatVisible.value),Mn=U(()=>Q.value!==null&&(Q.value!=="thinking"||ae.value)&&(Q.value!=="compaction"||Ge.value)&&(Q.value!=="agent"||Xn.value)&&(Q.value!=="btw"||to.value)),Hn=ie(!1);function Wn(){const Fe=Z.value?.path??ee.value?.path;Fe&&t.openWorkspaceFile(Fe,ee.value?.line)}function Po(){const Fe=Z.value?.path??ee.value?.path;Fe&&t.revealWorkspaceFile(Fe)}Ve(t.activeSessionId,()=>{he(),ze(),Ct(),Ke(),eo(),un()});const wt=ie(null),as=ie([]),Qt=U(()=>as.value.length>1);function ni(Fe){as.value=Fe}const no=ie(!1),ws=ie(!1),En=ie(!1),Ds=ie(!1),Un=ie(!1),gt=ie(!1),Ie=ie(!1),ye=ie(!1),Le=ie(null),St=U(()=>no.value||ws.value||En.value||Ds.value||Un.value||gt.value||Ie.value||ye.value||M.value||i.value||r.value),At=ie(!1),mn=ie(!1),dn=ie(!1),so=ie(!1),xe=ie(!1);async function Re(){At.value=!0,mn.value=!1,no.value=!0;try{await t.refreshOAuthProviderModels(),await t.loadModels()}catch{mn.value=!0}finally{At.value=!1}}async function qe(){dn.value=!0,so.value=!1,ws.value=!0;try{await t.loadProviders()}catch{so.value=!0}finally{dn.value=!1}}function st(){En.value=!0}async function Rn(Fe){no.value=!1,await t.setModel(Fe)}async function en(Fe){await t.addProvider(Fe)}async function Zn(Fe){await t.deleteProvider(Fe)}async function rn(Fe){await t.refreshProvider(Fe)}async function Bs(Fe){xe.value=!0;try{await t.updateConfig(Fe)&&await t.checkAuth()}finally{xe.value=!1}}async function wr(){return t.startOAuthLogin()}async function Do(){return t.pollOAuthLogin()}async function pu(){return t.cancelOAuthLogin()}async function cs(){En.value=!1,await t.checkAuth(),await t.load()}async function mu(Fe){await t.undo(1),await ut(),wt.value?.loadComposerForEdit(Fe)}function jh(Fe){if(Fe==="/compact"||Fe.startsWith("/compact ")){t.compact(Fe.slice(8).trim()||void 0);return}if(Fe==="/swarm"||Fe.startsWith("/swarm ")){const ce=Fe.slice(6).trim();ce==="on"?t.setSwarmMode(!0):ce==="off"?t.setSwarmMode(!1):ce?(t.setSwarmMode(!0),t.sendPrompt(ce)):t.toggleSwarmMode();return}if(Fe==="/goal"||Fe.startsWith("/goal ")){const ce=Fe.slice(5).trim();ce==="pause"||ce==="resume"||ce==="cancel"?t.controlGoal(ce):ce?t.createGoal(ce):t.toggleGoalMode();return}if(Fe==="/btw"||Fe.startsWith("/btw ")){const ce=Fe.slice(4).trim();!ce&&t.sideChatVisible.value?t.closeSideChat():Ps(ce||void 0);return}switch(Fe){case"/new":case"/clear":Ds.value=!0;break;case"/sessions":Un.value=!0;break;case"/fork":t.forkSession();break;case"/undo":t.undo();break;case"/permission":{const ce=t.permission.value,be=ce==="manual"?"auto":ce==="auto"?"yolo":"manual";t.setPermission(be);break}case"/plan":t.togglePlanMode();break;case"/auto":t.setPermission("auto");break;case"/yolo":t.setPermission("yolo");break;case"/thinking":t.setThinking(C(t.thinking.value));break;case"/help":t.dismissWarning(-1);break;case"/status":Ie.value=!0;break;case"/model":Re();break;case"/provider":qe();break;case"/login":st();break;default:{const ce=Fe.indexOf(" "),be=(ce===-1?Fe:Fe.slice(0,ce)).slice(1),It=ce===-1?void 0:Fe.slice(ce+1).trim()||void 0;be&&t.activateSkill(be,It);break}}}function Sr(Fe){t.unqueue(Fe)}function us(Fe){t.unqueue(Fe)}async function si(Fe){const ce=t.activeWorkspaceId.value;if(!t.activeSessionId.value&&ce){await t.startSessionAndSendPrompt(ce,Fe.text,Fe.attachments);return}if(!t.activeSessionId.value&&!ce){Le.value=Fe,gt.value=!0;return}t.sendPrompt(Fe.text,Fe.attachments)}async function wa(Fe){gt.value=!1,await t.addWorkspaceByPath(Fe);const ce=Le.value;Le.value=null;const be=t.activeWorkspaceId.value;ce&&be&&await t.startSessionAndSendPrompt(be,ce.text,ce.attachments)}function Cr(){Le.value=null,gt.value=!1}function oi(){const Fe=t.activeWorkspaceId.value;Fe?t.openWorkspaceDraft(Fe):Ds.value=!0}function Sa(Fe){t.openWorkspaceDraft(Fe)}function zh(Fe){Fe&&window.open(Fe,"_blank","noopener")}return(Fe,ce)=>(S(),I("div",Tue,[d.value?(S(),I("section",Aue,[h("div",Mue,[(S(),I("svg",{ref_key:"authLogoRef",ref:m,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:ce[0]||(ce[0]=Ye(()=>{},["prevent"])),onClick:b},[...ce[90]||(ce[90]=[ur('<defs data-v-bf731fc9><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-bf731fc9><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-bf731fc9></rect><g class="ch-eyes" fill="#000" data-v-bf731fc9><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-bf731fc9></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-bf731fc9></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-bf731fc9></rect>',2)])],544)),h("div",Eue,[h("h1",null,N(A(n)("app.authPageTitle")),1),h("p",null,N(A(n)("app.authPageMessage")),1)]),h("button",{type:"button",class:"auth-page-btn",onClick:st},[ce[91]||(ce[91]=h("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M6 3h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6"}),h("path",{d:"M9 8H2"}),h("path",{d:"M5 5l3 3-3 3"})],-1)),h("span",null,N(A(n)("app.authPageLogin")),1)])])])):(S(),I("div",{key:1,class:Te(["app",{mobile:A(o),"sidebar-collapsed":O.value&&!A(o)}]),style:Dt({"--side-w":W.value+"px","--preview-w":te.value+"px"})},[A(o)?(S(),je(sse,{key:1,workspace:A(t).visibleWorkspace.value,"session-title":l.value,running:c.value,branch:A(t).status.value.branch,"session-count":a.value,onOpenSwitcher:ce[12]||(ce[12]=be=>i.value=!0),onOpenSettings:ce[13]||(ce[13]=be=>r.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(S(),I(Me,{key:0},[Lt(pt(l$,{"col-width":P.value,"active-workspace":A(t).visibleWorkspace.value,"active-workspace-id":A(t).activeWorkspaceId.value,sessions:A(t).sessionsForView.value,groups:A(t).workspaceGroups.value,"active-id":A(t).activeSessionId.value,"attention-by-session":A(t).attentionBySession.value,"pending-by-session":A(t).pendingBySession.value,"unread-by-session":A(t).unreadBySession.value,onSelect:ce[1]||(ce[1]=be=>A(t).selectSession(be)),onCreate:oi,onCreateInWorkspace:ce[2]||(ce[2]=be=>Sa(be)),onSelectWorkspace:ce[3]||(ce[3]=be=>A(t).openWorkspace(be)),onAddWorkspace:ce[4]||(ce[4]=be=>gt.value=!0),onRename:ce[5]||(ce[5]=(be,It)=>A(t).renameSession(be,It)),onArchive:ce[6]||(ce[6]=be=>A(t).archiveSession(be)),onFork:ce[7]||(ce[7]=be=>A(t).forkSession(be)),onRenameWorkspace:ce[8]||(ce[8]=(be,It)=>A(t).renameWorkspace(be,It)),onDeleteWorkspace:ce[9]||(ce[9]=be=>A(t).deleteWorkspace(be)),onSelectWorkspaces:ni,onOpenSettings:ce[10]||(ce[10]=be=>ye.value=!0),onCollapse:se},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session"]),[[Eo,!O.value]]),Lt(pt(Nk,{"storage-key":Oue,"default-width":Xw,min:Pue,max:Due,"onUpdate:width":ce[11]||(ce[11]=be=>P.value=be)},null,512),[[Eo,!O.value]]),O.value?(S(),I("div",Iue,[h("button",{type:"button",class:"sidebar-expand-btn",title:A(n)("sidebar.expandSidebar"),"aria-label":A(n)("sidebar.expandSidebar"),onClick:se},[...ce[92]||(ce[92]=[ur('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-bf731fc9><path d="M4 6h9" data-v-bf731fc9></path><path d="M4 12h9" data-v-bf731fc9></path><path d="M4 18h9" data-v-bf731fc9></path><path d="M17 9l3 3-3 3" data-v-bf731fc9></path></svg>',1)])],8,$ue)])):ue("",!0)],64)),Qt.value?(S(),I("div",Nue,[ce[93]||(ce[93]=h("span",{class:"cs-icon"},"🚧",-1)),h("span",Lue,N(A(n)("app.comingSoon")),1)])):(S(),je(rG,{key:2,ref_key:"conversationPaneRef",ref:wt,mobile:A(o),modern:A(t).theme.value==="modern"||A(t).theme.value==="kimi",turns:A(t).turns.value,"session-id":A(t).activeSessionId.value,approvals:A(t).pendingApprovals.value,changes:A(t).changes.value,"git-info":A(t).gitInfo.value,tasks:A(t).tasks.value,todos:A(t).todos.value,goal:A(t).goal.value,swarms:A(t).swarms.value,"activation-badges":A(t).activationBadges.value,status:A(t).status.value,thinking:A(t).thinking.value,"plan-mode":A(t).planMode.value,"swarm-mode":A(t).swarmMode.value,"goal-mode":A(t).goalMode.value,models:A(t).models.value,"starred-ids":A(t).starredModelIds.value,skills:A(t).skills.value,questions:A(t).questions.value,running:c.value,queued:A(t).queued.value,"search-files":A(t).searchFiles,"upload-image":A(t).uploadImage,sending:A(t).isSending.value,"fast-moon":A(t).fastMoon.value,"file-reload-key":A(t).activeSessionId.value,"session-loading":A(t).sessionLoading.value,compaction:A(t).compaction.value,"workspace-name":A(t).visibleWorkspace.value?.name,"workspace-root":A(t).visibleWorkspace.value?.root??A(t).status.value.cwd,"git-diff-stats":A(t).gitDiffStats.value,workspaces:A(t).workspacesView.value,"active-workspace-id":A(t).activeWorkspaceId.value,"session-title":l.value,pr:A(t).activePullRequest.value,"beta-toc":A(t).betaToc.value,onOpenChanges:ce[14]||(ce[14]=be=>Os()),onSelectWorkspace:ce[15]||(ce[15]=be=>Sa(be)),onAddWorkspace:ce[16]||(ce[16]=be=>gt.value=!0),onOpenPr:zh,onSubmit:ce[17]||(ce[17]=be=>si(be)),onSteer:ce[18]||(ce[18]=be=>A(t).steerPrompt(be.text,be.attachments)),onApproval:ce[19]||(ce[19]=(be,It)=>A(t).respondApproval(be,It)),onCancelTask:ce[20]||(ce[20]=be=>A(t).cancelTask(be)),onAnswer:ce[21]||(ce[21]=(be,It)=>A(t).respondQuestion(be,It)),onDismiss:ce[22]||(ce[22]=be=>A(t).dismissQuestion(be)),onCommand:jh,onInterrupt:ce[23]||(ce[23]=be=>A(t).abortCurrentPrompt()),onUnqueue:Sr,onEditQueued:us,onSetPermission:ce[24]||(ce[24]=be=>A(t).setPermission(be)),onSetThinking:ce[25]||(ce[25]=be=>A(t).setThinking(be)),onTogglePlan:ce[26]||(ce[26]=be=>A(t).togglePlanMode()),onToggleSwarm:ce[27]||(ce[27]=be=>A(t).toggleSwarmMode()),onToggleGoal:ce[28]||(ce[28]=be=>A(t).toggleGoalMode()),onCreateGoal:ce[29]||(ce[29]=be=>A(t).createGoal(be)),onControlGoal:ce[30]||(ce[30]=be=>A(t).controlGoal(be)),onRefreshGitStatus:ce[31]||(ce[31]=be=>A(t).activeSessionId.value&&A(t).loadGitStatus(A(t).activeSessionId.value)),onRenameSession:ce[32]||(ce[32]=(be,It)=>A(t).renameSession(be,It)),onForkSession:ce[33]||(ce[33]=be=>A(t).forkSession(be)),onArchiveSession:ce[34]||(ce[34]=be=>A(t).archiveSession(be)),onCompact:ce[35]||(ce[35]=be=>A(t).compact()),onPickModel:ce[36]||(ce[36]=be=>Re()),onSelectModel:ce[37]||(ce[37]=be=>A(t).setModel(be)),onOpenFile:ce[38]||(ce[38]=be=>q(be)),onOpenMedia:ce[39]||(ce[39]=be=>de(be)),onOpenThinking:ce[40]||(ce[40]=be=>_e(be)),onOpenCompaction:ce[41]||(ce[41]=be=>ft(be)),onOpenAgent:ce[42]||(ce[42]=be=>_s(be)),onEditMessage:mu},null,8,["mobile","modern","turns","session-id","approvals","changes","git-info","tasks","todos","goal","swarms","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","running","queued","search-files","upload-image","sending","fast-moon","file-reload-key","session-loading","compaction","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","beta-toc"])),Mn.value&&!A(o)?(S(),je(Nk,{key:4,"storage-key":Fue,"default-width":Be.value,min:Ur,max:Ee.value,reverse:"","aria-label":A(n)("layout.resizePreviewAria"),"onUpdate:width":ce[43]||(ce[43]=be=>te.value=be),"onUpdate:dragging":ce[44]||(ce[44]=be=>Hn.value=be)},null,8,["default-width","max","aria-label"])):ue("",!0),!A(o)||Mn.value?(S(),I("aside",{key:5,class:Te(["global-preview",{open:Mn.value,mobile:A(o),"no-anim":Hn.value}]),role:"complementary","aria-label":A(n)("layout.detailPanelAria"),"aria-hidden":!Mn.value},[Q.value==="thinking"&&ae.value?(S(),je(bw,{key:0,text:Ce.value??"",onClose:ze},null,8,["text"])):Q.value==="compaction"&&Ge.value?(S(),je(bw,{key:1,text:dt.value??"",subtitle:A(n)("conversation.summaryTitle"),onClose:Ct},null,8,["text","subtitle"])):Q.value==="agent"&&Ft.value?(S(),je(BY,{key:2,member:Ft.value,onClose:Ke},null,8,["member"])):Q.value==="btw"&&to.value?(S(),je(XY,{key:3,turns:A(t).sideChatTurns.value,running:A(t).sideChatRunning.value,sending:A(t).sideChatSending.value,onSend:ce[45]||(ce[45]=be=>A(t).sendSideChatPrompt(be)),onClose:Fn},null,8,["turns","running","sending"])):Q.value==="diff"?(S(),je(WX,{key:4,mode:Et.value,changes:A(t).changes.value,"git-info":A(t).gitInfo.value,"file-diff":A(t).fileDiff.value,"selected-diff-path":A(t).selectedDiffPath.value,"file-diff-loading":A(t).fileDiffLoading.value,closable:"",onOpen:Oo,onBack:ce[46]||(ce[46]=be=>{Et.value="list",ls.value=null,A(t).clearFileDiff()}),onClose:eo},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading"])):Q.value==="file"?(S(),je(vY,{key:5,file:Z.value,loading:Ae.value,error:G.value,line:ee.value?.line,"download-url":F.value,closable:"","external-actions":Y.value,"open-file":q,onClose:he,onOpenExternal:Wn,onReveal:Po},null,8,["file","loading","error","line","download-url","external-actions"])):ue("",!0)],10,Rue)):ue("",!0),no.value?(S(),je(pZ,{key:6,models:A(t).models.value,current:A(t).status.value.modelId,"starred-ids":A(t).starredModelIds.value,loading:At.value,unavailable:mn.value,onSelect:ce[47]||(ce[47]=be=>Rn(be)),onToggleStar:ce[48]||(ce[48]=be=>A(t).toggleStarModel(be)),onClose:ce[49]||(ce[49]=be=>no.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ue("",!0),ye.value?(S(),je(kte,{key:7,theme:A(t).theme.value,"color-scheme":A(t).colorScheme.value,"ui-font-size":A(t).uiFontSize.value,"auth-ready":A(t).authReady.value,"account-model":A(t).defaultModel.value,notify:A(t).notifyOnComplete.value,"notify-permission":A(t).notifyPermission.value,"beta-toc":A(t).betaToc.value,config:A(t).config.value,models:A(t).models.value,"config-saving":xe.value,onSetTheme:ce[50]||(ce[50]=be=>A(t).setTheme(be)),onSetColorScheme:ce[51]||(ce[51]=be=>A(t).setColorScheme(be)),onSetUiFontSize:ce[52]||(ce[52]=be=>A(t).setUiFontSize(be)),onSetNotify:ce[53]||(ce[53]=be=>A(t).setNotifyOnComplete(be)),onSetBetaToc:ce[54]||(ce[54]=be=>A(t).setBetaToc(be)),onUpdateConfig:ce[55]||(ce[55]=be=>Bs(be)),onLogin:ce[56]||(ce[56]=()=>{ye.value=!1,st()}),onLogout:A(t).logout,onOpenOnboarding:ce[57]||(ce[57]=()=>{ye.value=!1,L()}),onClose:ce[58]||(ce[58]=be=>ye.value=!1)},null,8,["theme","color-scheme","ui-font-size","auth-ready","account-model","notify","notify-permission","beta-toc","config","models","config-saving","onLogout"])):ue("",!0),ws.value?(S(),je(sJ,{key:8,providers:A(t).providers.value,loading:dn.value,unavailable:so.value,onAdd:ce[59]||(ce[59]=be=>en(be)),onRefresh:ce[60]||(ce[60]=be=>rn(be)),onDelete:ce[61]||(ce[61]=be=>Zn(be)),onOpenLogin:ce[62]||(ce[62]=()=>{ws.value=!1,st()}),onClose:ce[63]||(ce[63]=be=>ws.value=!1)},null,8,["providers","loading","unavailable"])):ue("",!0),Ds.value?(S(),je(iQ,{key:9,"recent-cwds":A(t).recentCwds.value,onCreate:ce[64]||(ce[64]=({cwd:be,title:It})=>{Ds.value=!1,A(t).createSession(be,{title:It})}),onClose:ce[65]||(ce[65]=be=>Ds.value=!1)},null,8,["recent-cwds"])):ue("",!0),Un.value?(S(),je(Bte,{key:10,sessions:A(t).sessions.value,"workspace-groups":A(t).workspaceGroups.value,"attention-by-session":A(t).attentionBySession.value,"active-id":A(t).activeSessionId.value,onSelect:ce[66]||(ce[66]=be=>{A(t).selectSession(be),Un.value=!1}),onClose:ce[67]||(ce[67]=be=>Un.value=!1)},null,8,["sessions","workspace-groups","attention-by-session","active-id"])):ue("",!0),Ie.value?(S(),je(One,{key:11,status:A(t).status.value,thinking:A(t).thinking.value,"plan-mode":A(t).planMode.value,"swarm-mode":A(t).swarmMode.value,"cost-usd":A(t).sessionCost.value,onClose:ce[68]||(ce[68]=be=>Ie.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ue("",!0),gt.value?(S(),je(kne,{key:12,"browse-fs":A(t).browseFs,"get-fs-home":A(t).getFsHome,"default-path":A(t).visibleWorkspace.value?.root??A(t).status.value.cwd,onAdd:ce[69]||(ce[69]=be=>wa(be)),onClose:Cr},null,8,["browse-fs","get-fs-home","default-path"])):ue("",!0),pt(Si,{name:"gload-fade"},{default:yn(()=>[A(t).initialized.value?ue("",!0):(S(),je(oie,{key:0}))]),_:1}),M.value&&!d.value?(S(),je(Qoe,{key:13,theme:A(t).theme.value,onSetTheme:ce[70]||(ce[70]=be=>A(t).setTheme(be)),onComplete:$,onSkip:$},null,8,["theme"])):ue("",!0),pt(Kne,{warnings:A(t).warnings.value,onDismiss:A(t).dismissWarning},null,8,["warnings","onDismiss"]),A(s)?(S(),je(Oie,{key:14})):ue("",!0),A(o)?(S(),je(Rse,{key:15,modelValue:i.value,"onUpdate:modelValue":ce[71]||(ce[71]=be=>i.value=be),groups:A(t).workspaceGroups.value,"active-workspace-id":A(t).activeWorkspaceId.value,"active-id":A(t).activeSessionId.value,"attention-by-session":A(t).attentionBySession.value,"attention-by-workspace":A(t).attentionByWorkspace.value,onSelect:ce[72]||(ce[72]=be=>A(t).selectSession(be)),onCreate:oi,onCreateInWorkspace:ce[73]||(ce[73]=be=>Sa(be)),onAddWorkspace:ce[74]||(ce[74]=be=>gt.value=!0),onRename:ce[75]||(ce[75]=(be,It)=>A(t).renameSession(be,It)),onArchive:ce[76]||(ce[76]=be=>A(t).archiveSession(be)),onDeleteWorkspace:ce[77]||(ce[77]=be=>A(t).deleteWorkspace(be))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ue("",!0),A(o)?(S(),je(Noe,{key:16,modelValue:r.value,"onUpdate:modelValue":ce[78]||(ce[78]=be=>r.value=be),status:A(t).status.value,thinking:A(t).thinking.value,"plan-mode":A(t).planMode.value,"swarm-mode":A(t).swarmMode.value,theme:A(t).theme.value,"color-scheme":A(t).colorScheme.value,"ui-font-size":A(t).uiFontSize.value,"auth-ready":A(t).authReady.value,"beta-toc":A(t).betaToc.value,onPickModel:ce[79]||(ce[79]=be=>Re()),onSetThinking:ce[80]||(ce[80]=be=>A(t).setThinking(be)),onTogglePlan:ce[81]||(ce[81]=be=>A(t).togglePlanMode()),onToggleSwarm:ce[82]||(ce[82]=be=>A(t).toggleSwarmMode()),onSetPermission:ce[83]||(ce[83]=be=>A(t).setPermission(be)),onSetTheme:ce[84]||(ce[84]=be=>A(t).setTheme(be)),onSetColorScheme:ce[85]||(ce[85]=be=>A(t).setColorScheme(be)),onSetUiFontSize:ce[86]||(ce[86]=be=>A(t).setUiFontSize(be)),onSetBetaToc:ce[87]||(ce[87]=be=>A(t).setBetaToc(be)),onLogin:ce[88]||(ce[88]=()=>{r.value=!1,st()}),onLogout:A(t).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","theme","color-scheme","ui-font-size","auth-ready","beta-toc","onLogout"])):ue("",!0)],6)),En.value?(S(),je(BJ,{key:2,"on-start-o-auth-login":wr,"on-poll-o-auth-login":Do,"on-cancel-o-auth-login":pu,onSuccess:cs,onClose:ce[89]||(ce[89]=be=>En.value=!1)})):ue("",!0)]))}}),Wue=yt(Hue,[["__scopeId","data-v-bf731fc9"]]);MQ();rf(Wue).use(bn).mount("#app");export{qA as $,mde as A,LM as B,Sn as C,qde as D,s2 as E,Me as F,ur as G,vt as H,pt as I,fM as J,hde as K,Xo as L,Xe as M,iE as N,yde as O,kde as P,wde as Q,Hd as R,Zl as S,rde as T,bde as U,H1 as V,vde as W,zde as X,_de as Y,Bde as Z,que as _,$2 as a,ss as a$,rs as a0,S1 as a1,Jue as a2,E1 as a3,E4 as a4,jt as a5,ma as a6,ode as a7,Yde as a8,cde as a9,P2 as aA,jM as aB,XM as aC,sn as aD,YM as aE,GM as aF,C1 as aG,KM as aH,Gt as aI,$1 as aJ,vM as aK,S as aL,nE as aM,nde as aN,an as aO,b2 as aP,tde as aQ,zd as aR,qs as aS,Ud as aT,ie as aU,Nde as aV,bE as aW,Ze as aX,Yl as aY,JM as aZ,pde as a_,fde as aa,dde as ab,ude as ac,Rde as ad,Xde as ae,Rt as af,O4 as ag,sh as ah,sr as ai,Mi as aj,xn as ak,Lde as al,zs as am,cr as an,er as ao,xde as ap,Tde as aq,Vt as ar,ut as as,H4 as at,Te as au,Uue as av,Dt as aw,qM as ax,VM as ay,Js as az,ede as b,DB as b$,Wde as b0,Rc as b1,Zd as b2,Fde as b3,ar as b4,aM as b5,zue as b6,rl as b7,CM as b8,Hde as b9,_n as bA,Eo as bB,P4 as bC,Pde as bD,Ve as bE,TM as bF,ide as bG,AM as bH,Mde as bI,yn as bJ,Sde as bK,Lt as bL,Io as bM,Ode as bN,Ye as bO,sde as bP,zt as bQ,js as bR,sfe as bS,TF as bT,nT as bU,ife as bV,pB as bW,xv as bX,ofe as bY,Wg as bZ,rfe as b_,jue as ba,N as bb,bd as bc,gde as bd,Nt as be,Yue as bf,Gue as bg,Kue as bh,$de as bi,Vue as bj,A as bk,su as bl,Kde as bm,jde as bn,lE as bo,lde as bp,Ede as bq,xM as br,Vde as bs,Cde as bt,ade as bu,I2 as bv,sf as bw,mE as bx,wS as by,of as bz,Dde as c,PB as c0,Jx as c1,OB as c2,efe as c3,uB as c4,Qde as c5,RB as c6,afe as c7,bT as c8,$f as c9,vT as ca,cfe as cb,lfe as cc,nfe as cd,mo as ce,Jde as cf,tfe as cg,kT as ch,gT as ci,CH as cj,Zde as ck,Ide as d,or as e,Xue as f,Si as g,Gde as h,Zue as i,Que as j,So as k,eu as l,Ln as m,Yf as n,Ei as o,Ude as p,U as q,rf as r,je as s,ue as t,I as u,h as v,b4 as w,Ade as x,k4 as y,_E as z};