@moonshot-ai/kimi-code 0.20.2 → 0.21.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.
- package/dist/main.mjs +89421 -85219
- package/dist-web/assets/{CodeBlockNode-Cj5GCBwy.js → CodeBlockNode-j7RGe-Ru.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-BZQYvYGg.js → CodeBlockShell.vue_vue_type_style_index_0_lang-D274ciOI.js} +1 -1
- package/dist-web/assets/{Tooltip-FXn3ewBz.js → Tooltip-DtxNXMAM.js} +1 -1
- package/dist-web/assets/arc-DQs9uADf.js +1 -0
- package/dist-web/assets/arc-Doj0wRZ0.js +1 -0
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-Cu5NFSbj.js → architectureDiagram-3BPJPVTR-BlG2tTPz.js} +1 -1
- package/dist-web/assets/architectureDiagram-3BPJPVTR-CQ09RrbH.js +36 -0
- package/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js +132 -0
- package/dist-web/assets/{blockDiagram-GPEHLZMM-eAkllecr.js → blockDiagram-GPEHLZMM-nkQI5ZZa.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-BcJyf2yX.js → c4Diagram-AAUBKEIU-DZN5-qYv.js} +1 -1
- package/dist-web/assets/c4Diagram-AAUBKEIU-DtzacMnD.js +10 -0
- package/dist-web/assets/channel-DNkUo9e6.js +1 -0
- package/dist-web/assets/channel-EUwKK__D.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-DzpuDCg4.js → chunk-2J33WTMH-ByD5PYWi.js} +1 -1
- package/dist-web/assets/chunk-2J33WTMH-w4sdiKFO.js +1 -0
- package/dist-web/assets/{chunk-4BX2VUAB-DPF55Xbc.js → chunk-4BX2VUAB-DPyg-S27.js} +1 -1
- package/dist-web/assets/chunk-4BX2VUAB-WqrE2gaw.js +1 -0
- package/dist-web/assets/chunk-55IACEB6-B5dE1-Um.js +1 -0
- package/dist-web/assets/{chunk-55IACEB6-Ct2k4oQF.js → chunk-55IACEB6-CH4yuhZ8.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-DcWnL_ZJ.js → chunk-727SXJPM-DGgZVtcA.js} +2 -2
- package/dist-web/assets/chunk-727SXJPM-Dn5wkDO_.js +206 -0
- package/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js +231 -0
- package/dist-web/assets/{chunk-AQP2D5EJ-2N1ZTMho.js → chunk-AQP2D5EJ-hJPUZ-_O.js} +1 -1
- package/dist-web/assets/chunk-FMBD7UC4-B2zs_Y-d.js +15 -0
- package/dist-web/assets/{chunk-FMBD7UC4-jNBVe-u1.js → chunk-FMBD7UC4-Barfn9Db.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-BTBgmjVQ.js → chunk-ND2GUHAM-ByZWAnct.js} +1 -1
- package/dist-web/assets/chunk-ND2GUHAM-C4-rwdcv.js +1 -0
- package/dist-web/assets/chunk-QZHKN3VN-_Rz9_NuS.js +1 -0
- package/dist-web/assets/{chunk-QZHKN3VN-xUCxw3pg.js → chunk-QZHKN3VN-i-qEmEeB.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js +1 -0
- package/dist-web/assets/classDiagram-4FO5ZUOK-DugUof1s.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DugUof1s.js +1 -0
- package/dist-web/assets/cose-bilkent-S5V4N54A-Bi19n8m-.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-ByEZXDA-.js → cose-bilkent-S5V4N54A-Cb-FqQcD.js} +1 -1
- package/dist-web/assets/dagre-BM42HDAG-DLMfLCoV.js +4 -0
- package/dist-web/assets/{dagre-BM42HDAG-BSfstE2-.js → dagre-BM42HDAG-vKebiMPC.js} +1 -1
- package/dist-web/assets/defaultLocale-CCNgq9ws.js +1 -0
- package/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js +43 -0
- package/dist-web/assets/{diagram-2AECGRRQ-CpI86-tI.js → diagram-2AECGRRQ-DkhIWqYP.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-B4WYOJbp.js → diagram-5GNKFQAL-DN4cTkR0.js} +1 -1
- package/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js +10 -0
- package/dist-web/assets/diagram-KO2AKTUF-CFQs13i5.js +3 -0
- package/dist-web/assets/{diagram-KO2AKTUF-dmm87H0J.js → diagram-KO2AKTUF-DI-TheQb.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-CAFHWRvJ.js → diagram-LMA3HP47-D39qCe0X.js} +1 -1
- package/dist-web/assets/diagram-LMA3HP47-He5zlyMt.js +24 -0
- package/dist-web/assets/{diagram-OG6HWLK6-CvbELbqm.js → diagram-OG6HWLK6-ChLxsS1Q.js} +1 -1
- package/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js +24 -0
- package/dist-web/assets/{erDiagram-TEJ5UH35-BATGAYdA.js → erDiagram-TEJ5UH35-qvX9VJtw.js} +1 -1
- package/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js +85 -0
- package/dist-web/assets/{flowDiagram-I6XJVG4X-BjHCXPMa.js → flowDiagram-I6XJVG4X-DYLFBHuf.js} +1 -1
- package/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js +162 -0
- package/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js +292 -0
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-DyP4c3YT.js → ganttDiagram-6RSMTGT7-tnxpnL8N.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-NzukZ15I.js → gitGraphDiagram-PVQCEYII-D8AoA9Eo.js} +1 -1
- package/dist-web/assets/gitGraphDiagram-PVQCEYII-DMbTATyw.js +106 -0
- package/dist-web/assets/graph-BwjfAU3j.js +1 -0
- package/dist-web/assets/{index-Cfg9noDi.js → index-16wIPHON.js} +2 -2
- package/dist-web/assets/{index-D4Er4P8I.js → index-CfoTgIKh.js} +1 -1
- package/dist-web/assets/index-DFqBlS-2.css +1 -0
- package/dist-web/assets/index-DTBMRzx_.js +284 -0
- package/dist-web/assets/{index10-C4yIRdle.js → index10-ChP4b_K8.js} +1 -1
- package/dist-web/assets/index11-D6-PIcGb.js +8 -0
- package/dist-web/assets/{index5-DKdkj0GC.js → index5-C_gkYwVK.js} +1 -1
- package/dist-web/assets/{index6-DsK3MiZT.js → index6-fL_9Ohtp.js} +1 -1
- package/dist-web/assets/{index7-DHshPD9x.js → index7-DX_J7I3Z.js} +1 -1
- package/dist-web/assets/{index8-CeUCBmKU.js → index8-D_LvlNqi.js} +2 -2
- package/dist-web/assets/infoDiagram-5YYISTIA-2JF3XEdD.js +2 -0
- package/dist-web/assets/{infoDiagram-5YYISTIA-6n_F_-MA.js → infoDiagram-5YYISTIA-REaaEnj0.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-CoaeNeqj.js → ishikawaDiagram-YF4QCWOH-BiPRDWgG.js} +1 -1
- package/dist-web/assets/ishikawaDiagram-YF4QCWOH-C5OstRVV.js +70 -0
- package/dist-web/assets/{journeyDiagram-JHISSGLW-Bi-m1_1y.js → journeyDiagram-JHISSGLW-DrZSDIQL.js} +1 -1
- package/dist-web/assets/journeyDiagram-JHISSGLW-yctdo4bX.js +139 -0
- package/dist-web/assets/{kanban-definition-UN3LZRKU-DHxtNMaD.js → kanban-definition-UN3LZRKU-BQZXHq9-.js} +1 -1
- package/dist-web/assets/kanban-definition-UN3LZRKU-CxBCv27E.js +89 -0
- package/dist-web/assets/katexRenderer.worker-CO_gEm4q.js +257 -0
- package/dist-web/assets/layout-C1ojF0zw.js +1 -0
- package/dist-web/assets/linear-3mB6q2-g.js +1 -0
- package/dist-web/assets/{linear-CgHyf5UH.js → linear-DqGsUakD.js} +1 -1
- package/dist-web/assets/{mermaid.core-CtXm064v.js → mermaid.core-DYzdrsrJ.js} +5 -5
- package/dist-web/assets/mermaidParser.worker-Dx4jPi9z.js +313 -0
- package/dist-web/assets/mindmap-definition-RKZ34NQL-BmJZpjh6.js +96 -0
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-ClpCUmIA.js → mindmap-definition-RKZ34NQL-D69QyDIc.js} +1 -1
- package/dist-web/assets/pieDiagram-4H26LBE5-BkwDAvbt.js +30 -0
- package/dist-web/assets/{pieDiagram-4H26LBE5-DvYtw1Bp.js → pieDiagram-4H26LBE5-CQwY5Xfh.js} +2 -2
- package/dist-web/assets/quadrantDiagram-W4KKPZXB-BmT_qM09.js +7 -0
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-Dle7c6-0.js → quadrantDiagram-W4KKPZXB-CLVmtX4l.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33--X5AnAhp.js → requirementDiagram-4Y6WPE33-8ptI5UBX.js} +1 -1
- package/dist-web/assets/requirementDiagram-4Y6WPE33-CZrxH1Y2.js +84 -0
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-BUszdT9f.js → sankeyDiagram-5OEKKPKP-CZjapjER.js} +1 -1
- package/dist-web/assets/sankeyDiagram-5OEKKPKP-De_o7hDr.js +40 -0
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-CDwqGrfV.js → sequenceDiagram-3UESZ5HK-CWHjmftc.js} +1 -1
- package/dist-web/assets/sequenceDiagram-3UESZ5HK-VAxffBe7.js +162 -0
- package/dist-web/assets/stateDiagram-AJRCARHV-D2xCeXSD.js +1 -0
- package/dist-web/assets/stateDiagram-AJRCARHV-nDExQydZ.js +1 -0
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BzwD_BIl.js +1 -0
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Dn6bAjEF.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-o-RAswWS.js → timeline-definition-PNZ67QCA-CRlejYtd.js} +1 -1
- package/dist-web/assets/timeline-definition-PNZ67QCA-DsVZdrZa.js +120 -0
- package/dist-web/assets/vennDiagram-CIIHVFJN-BBHQmCFf.js +34 -0
- package/dist-web/assets/{vennDiagram-CIIHVFJN-DljQ_s6w.js → vennDiagram-CIIHVFJN-CTv_68HS.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-BP7sjueK.js → vue.runtime.esm-bundler-CQbR9uOv.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-CW9wuVhK.js → wardley-L42UT6IY-0vHHFPAt.js} +1 -1
- package/dist-web/assets/wardley-L42UT6IY-BJFn8eDD.js +173 -0
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-Bh0wtRMV.js → wardleyDiagram-YWT4CUSO-CpO8VbUu.js} +1 -1
- package/dist-web/assets/wardleyDiagram-YWT4CUSO-DCiyDQNB.js +78 -0
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-BAjJ0sMH.js → xychartDiagram-2RQKCTM6-ClTcdHp2.js} +1 -1
- package/dist-web/assets/xychartDiagram-2RQKCTM6-Db_VoDBV.js +7 -0
- package/dist-web/index.html +3 -3
- package/package.json +5 -5
- package/dist-web/assets/arc---yONsFG.js +0 -1
- package/dist-web/assets/channel-BTxFVrej.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-B47dzfoS.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-B47dzfoS.js +0 -1
- package/dist-web/assets/index-BYnLiw5r.css +0 -1
- package/dist-web/assets/index-CCjot4qV.js +0 -284
- package/dist-web/assets/index11-CqNiMTbJ.js +0 -9
- package/dist-web/assets/stateDiagram-AJRCARHV-Kmd6YXse.js +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CvgWdsVg.js +0 -1
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-Cj5GCBwy.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-BZQYvYGg.js","assets/index8-CeUCBmKU.js","assets/index11-CqNiMTbJ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
|
|
3
|
-
* @vue/shared v3.5.35
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function ih(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Pt={},sa=[],Os=()=>{},iC=()=>!1,du=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),rh=e=>e.startsWith("onUpdate:"),tn=Object.assign,z1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},QM=Object.prototype.hasOwnProperty,Kt=(e,t)=>QM.call(e,t),ut=Array.isArray,ia=e=>Aa(e)==="[object Map]",ml=e=>Aa(e)==="[object Set]",Gy=e=>Aa(e)==="[object Date]",ZM=e=>Aa(e)==="[object RegExp]",wt=e=>typeof e=="function",sn=e=>typeof e=="string",gs=e=>typeof e=="symbol",Gt=e=>e!==null&&typeof e=="object",V1=e=>(Gt(e)||wt(e))&&wt(e.then)&&wt(e.catch),rC=Object.prototype.toString,Aa=e=>rC.call(e),JM=e=>Aa(e).slice(8,-1),lh=e=>Aa(e)==="[object Object]",ah=e=>sn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,rl=ih(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ch=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},eE=/-\w/g,Xn=ch(e=>e.replace(eE,t=>t.slice(1).toUpperCase())),tE=/\B([A-Z])/g,Uo=ch(e=>e.replace(tE,"-$1").toLowerCase()),uh=ch(e=>e.charAt(0).toUpperCase()+e.slice(1)),Nd=ch(e=>e?`on${uh(e)}`:""),ao=(e,t)=>!Object.is(e,t),ra=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},lC=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},dh=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Zd=e=>{const t=sn(e)?Number(e):NaN;return isNaN(t)?e:t};let Yy;const fh=()=>Yy||(Yy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),nE="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",oE=ih(nE);function Wt(e){if(ut(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=sn(o)?lE(o):Wt(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(sn(e)||Gt(e))return e}const sE=/;(?![^(]*\))/g,iE=/:([^]+)/,rE=/\/\*[^]*?\*\//g;function lE(e){const t={};return e.replace(rE,"").split(sE).forEach(n=>{if(n){const o=n.split(iE);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Oe(e){let t="";if(sn(e))t=e;else if(ut(e))for(let n=0;n<e.length;n++){const o=Oe(e[n]);o&&(t+=o+" ")}else if(Gt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Dhe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!sn(t)&&(e.class=Oe(t)),n&&(e.style=Wt(n)),e}const aE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",cE=ih(aE);function aC(e){return!!e||e===""}function uE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Oi(e[o],t[o]);return n}function Oi(e,t){if(e===t)return!0;let n=Gy(e),o=Gy(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=gs(e),o=gs(t),n||o)return e===t;if(n=ut(e),o=ut(t),n||o)return n&&o?uE(e,t):!1;if(n=Gt(e),o=Gt(t),n||o){if(!n||!o)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Oi(e[r],t[r]))return!1}}return String(e)===String(t)}function hh(e,t){return e.findIndex(n=>Oi(n,t))}const cC=e=>!!(e&&e.__v_isRef===!0),O=e=>sn(e)?e:e==null?"":ut(e)||Gt(e)&&(e.toString===rC||!wt(e.toString))?cC(e)?O(e.value):JSON.stringify(e,uC,2):String(e),uC=(e,t)=>cC(t)?uC(e,t.value):ia(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[nm(o,i)+" =>"]=s,n),{})}:ml(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>nm(n))}:gs(t)?nm(t):Gt(t)&&!ut(t)&&!lh(t)?String(t):t,nm=(e,t="")=>{var n;return gs(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function dE(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 Yn;class dC{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Yn&&(Yn.active?(this.parent=Yn,this.index=(Yn.scopes||(Yn.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=Yn;try{return Yn=this,t()}finally{Yn=n}}}on(){++this._on===1&&(this.prevScope=Yn,Yn=this)}off(){if(this._on>0&&--this._on===0){if(Yn===this)Yn=this.prevScope;else{let t=Yn;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function fE(e){return new dC(e)}function K1(){return Yn}function G1(e,t=!1){Yn&&Yn.cleanups.push(e)}let dn;const om=new WeakSet;class Jd{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,Yn&&(Yn.active?Yn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,om.has(this)&&(om.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||hC(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Xy(this),pC(this);const t=dn,n=Vs;dn=this,Vs=!0;try{return this.fn()}finally{mC(this),dn=t,Vs=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Q1(t);this.deps=this.depsTail=void 0,Xy(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?om.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){bg(this)&&this.run()}get dirty(){return bg(this)}}let fC=0,wc,_c;function hC(e,t=!1){if(e.flags|=8,t){e.next=_c,_c=e;return}e.next=wc,wc=e}function Y1(){fC++}function X1(){if(--fC>0)return;if(_c){let t=_c;for(_c=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;wc;){let t=wc;for(wc=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function pC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function mC(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),Q1(o),hE(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function bg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(gC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function gC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Fc)||(e.globalVersion=Fc,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!bg(e))))return;e.flags|=2;const t=e.dep,n=dn,o=Vs;dn=e,Vs=!0;try{pC(e);const s=e.fn(e._value);(t.version===0||ao(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{dn=n,Vs=o,mC(e),e.flags&=-3}}function Q1(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Q1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function hE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Bhe(e,t){e.effect instanceof Jd&&(e=e.effect.fn);const n=new Jd(e);t&&tn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function Fhe(e){e.effect.stop()}let Vs=!0;const vC=[];function Pi(){vC.push(Vs),Vs=!1}function Ri(){const e=vC.pop();Vs=e===void 0?!0:e}function Xy(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=dn;dn=void 0;try{t()}finally{dn=n}}}let Fc=0;class pE{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 ph{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(!dn||!Vs||dn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==dn)n=this.activeLink=new pE(dn,this),dn.deps?(n.prevDep=dn.depsTail,dn.depsTail.nextDep=n,dn.depsTail=n):dn.deps=dn.depsTail=n,yC(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=dn.depsTail,n.nextDep=void 0,dn.depsTail.nextDep=n,dn.depsTail=n,dn.deps===n&&(dn.deps=o)}return n}trigger(t){this.version++,Fc++,this.notify(t)}notify(t){Y1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{X1()}}}function yC(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)yC(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ef=new WeakMap,ll=Symbol(""),wg=Symbol(""),Hc=Symbol("");function yo(e,t,n){if(Vs&&dn){let o=ef.get(e);o||ef.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new ph),s.map=o,s.key=n),s.track()}}function Ai(e,t,n,o,s,i){const r=ef.get(e);if(!r){Fc++;return}const l=a=>{a&&a.trigger()};if(Y1(),t==="clear")r.forEach(l);else{const a=ut(e),c=a&&ah(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===Hc||!gs(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Hc)),t){case"add":a?c&&l(r.get("length")):(l(r.get(ll)),ia(e)&&l(r.get(wg)));break;case"delete":a||(l(r.get(ll)),ia(e)&&l(r.get(wg)));break;case"set":ia(e)&&l(r.get(ll));break}}X1()}function mE(e,t){const n=ef.get(e);return n&&n.get(t)}function Bl(e){const t=Ht(e);return t===e?t:(yo(t,"iterate",Hc),us(e)?t:t.map(Ks))}function mh(e){return yo(e=Ht(e),"iterate",Hc),e}function li(e,t){return Di(e)?ba(mr(e)?Ks(t):t):Ks(t)}const gE={__proto__:null,[Symbol.iterator](){return sm(this,Symbol.iterator,e=>li(this,e))},concat(...e){return Bl(this).concat(...e.map(t=>ut(t)?Bl(t):t))},entries(){return sm(this,"entries",e=>(e[1]=li(this,e[1]),e))},every(e,t){return _i(this,"every",e,t,void 0,arguments)},filter(e,t){return _i(this,"filter",e,t,n=>n.map(o=>li(this,o)),arguments)},find(e,t){return _i(this,"find",e,t,n=>li(this,n),arguments)},findIndex(e,t){return _i(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return _i(this,"findLast",e,t,n=>li(this,n),arguments)},findLastIndex(e,t){return _i(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return _i(this,"forEach",e,t,void 0,arguments)},includes(...e){return im(this,"includes",e)},indexOf(...e){return im(this,"indexOf",e)},join(e){return Bl(this).join(e)},lastIndexOf(...e){return im(this,"lastIndexOf",e)},map(e,t){return _i(this,"map",e,t,void 0,arguments)},pop(){return tc(this,"pop")},push(...e){return tc(this,"push",e)},reduce(e,...t){return Qy(this,"reduce",e,t)},reduceRight(e,...t){return Qy(this,"reduceRight",e,t)},shift(){return tc(this,"shift")},some(e,t){return _i(this,"some",e,t,void 0,arguments)},splice(...e){return tc(this,"splice",e)},toReversed(){return Bl(this).toReversed()},toSorted(e){return Bl(this).toSorted(e)},toSpliced(...e){return Bl(this).toSpliced(...e)},unshift(...e){return tc(this,"unshift",e)},values(){return sm(this,"values",e=>li(this,e))}};function sm(e,t,n){const o=mh(e),s=o[t]();return o!==e&&!us(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const vE=Array.prototype;function _i(e,t,n,o,s,i){const r=mh(e),l=r!==e&&!us(e),a=r[t];if(a!==vE[t]){const d=a.apply(e,i);return l?Ks(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,li(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function Qy(e,t,n,o){const s=mh(e),i=s!==e&&!us(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=li(e,c)),n.call(this,c,li(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](r,...o);return l?li(e,a):a}function im(e,t,n){const o=Ht(e);yo(o,"iterate",Hc);const s=o[t](...n);return(s===-1||s===!1)&&yh(n[0])?(n[0]=Ht(n[0]),o[t](...n)):s}function tc(e,t,n=[]){Pi(),Y1();const o=Ht(e)[t].apply(e,n);return X1(),Ri(),o}const yE=ih("__proto__,__v_isRef,__isVue"),kC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(gs));function kE(e){gs(e)||(e=String(e));const t=Ht(this);return yo(t,"has",e),t.hasOwnProperty(e)}class bC{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?TC:xC:i?SC:CC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=ut(t);if(!s){let a;if(r&&(a=gE[n]))return a;if(n==="hasOwnProperty")return kE}const l=Reflect.get(t,n,Ln(t)?t:o);if((gs(n)?kC.has(n):yE(n))||(s||yo(t,"get",n),i))return l;if(Ln(l)){const a=r&&ah(n)?l:l.value;return s&&Gt(a)?tf(a):a}return Gt(l)?s?tf(l):as(l):l}}class wC extends bC{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=ut(t)&&ah(n);if(!this._isShallow){const c=Di(i);if(!us(o)&&!Di(o)&&(i=Ht(i),o=Ht(o)),!r&&Ln(i)&&!Ln(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:Kt(t,n),a=Reflect.set(t,n,o,Ln(t)?t:s);return t===Ht(s)&&(l?ao(o,i)&&Ai(t,"set",n,o):Ai(t,"add",n,o)),a}deleteProperty(t,n){const o=Kt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&Ai(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!gs(n)||!kC.has(n))&&yo(t,"has",n),o}ownKeys(t){return yo(t,"iterate",ut(t)?"length":ll),Reflect.ownKeys(t)}}class _C extends bC{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const bE=new wC,wE=new _C,_E=new wC(!0),CE=new _C(!0),_g=e=>e,Qu=e=>Reflect.getPrototypeOf(e);function SE(e,t,n){return function(...o){const s=this.__v_raw,i=Ht(s),r=ia(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?_g:t?ba:Ks;return!t&&yo(i,"iterate",a?wg:ll),tn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Zu(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function xE(e,t){const n={get(s){const i=this.__v_raw,r=Ht(i),l=Ht(s);e||(ao(s,l)&&yo(r,"get",s),yo(r,"get",l));const{has:a}=Qu(r),c=t?_g:e?ba:Ks;if(a.call(r,s))return c(i.get(s));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&yo(Ht(s),"iterate",ll),s.size},has(s){const i=this.__v_raw,r=Ht(i),l=Ht(s);return e||(ao(s,l)&&yo(r,"has",s),yo(r,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const r=this,l=r.__v_raw,a=Ht(l),c=t?_g:e?ba:Ks;return!e&&yo(a,"iterate",ll),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return tn(n,e?{add:Zu("add"),set:Zu("set"),delete:Zu("delete"),clear:Zu("clear")}:{add(s){const i=Ht(this),r=Qu(i),l=Ht(s),a=!t&&!us(s)&&!Di(s)?l:s;return r.has.call(i,a)||ao(s,a)&&r.has.call(i,s)||ao(l,a)&&r.has.call(i,l)||(i.add(a),Ai(i,"add",a,a)),this},set(s,i){!t&&!us(i)&&!Di(i)&&(i=Ht(i));const r=Ht(this),{has:l,get:a}=Qu(r);let c=l.call(r,s);c||(s=Ht(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?ao(i,u)&&Ai(r,"set",s,i):Ai(r,"add",s,i),this},delete(s){const i=Ht(this),{has:r,get:l}=Qu(i);let a=r.call(i,s);a||(s=Ht(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Ai(i,"delete",s,void 0),c},clear(){const s=Ht(this),i=s.size!==0,r=s.clear();return i&&Ai(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=SE(s,e,t)}),n}function gh(e,t){const n=xE(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(Kt(n,s)&&s in o?n:o,s,i)}const TE={get:gh(!1,!1)},AE={get:gh(!1,!0)},ME={get:gh(!0,!1)},EE={get:gh(!0,!0)},CC=new WeakMap,SC=new WeakMap,xC=new WeakMap,TC=new WeakMap;function IE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function as(e){return Di(e)?e:vh(e,!1,bE,TE,CC)}function $E(e){return vh(e,!1,_E,AE,SC)}function tf(e){return vh(e,!0,wE,ME,xC)}function Hhe(e){return vh(e,!0,CE,EE,TC)}function vh(e,t,n,o,s){if(!Gt(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=IE(JM(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function mr(e){return Di(e)?mr(e.__v_raw):!!(e&&e.__v_isReactive)}function Di(e){return!!(e&&e.__v_isReadonly)}function us(e){return!!(e&&e.__v_isShallow)}function yh(e){return e?!!e.__v_raw:!1}function Ht(e){const t=e&&e.__v_raw;return t?Ht(t):e}function fr(e){return!Kt(e,"__v_skip")&&Object.isExtensible(e)&&lC(e,"__v_skip",!0),e}const Ks=e=>Gt(e)?as(e):e,ba=e=>Gt(e)?tf(e):e;function Ln(e){return e?e.__v_isRef===!0:!1}function te(e){return AC(e,!1)}function gl(e){return AC(e,!0)}function AC(e,t){return Ln(e)?e:new NE(e,t)}class NE{constructor(t,n){this.dep=new ph,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ht(t),this._value=n?t:Ks(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||us(t)||Di(t);t=o?t:Ht(t),ao(t,n)&&(this._rawValue=t,this._value=o?t:Ks(t),this.dep.trigger())}}function Whe(e){e.dep&&e.dep.trigger()}function S(e){return Ln(e)?e.value:e}function MC(e){return wt(e)?e():S(e)}const LE={get:(e,t,n)=>t==="__v_raw"?e:S(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return Ln(s)&&!Ln(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function EC(e){return mr(e)?e:new Proxy(e,LE)}class OE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ph,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function PE(e){return new OE(e)}function Uhe(e){const t=ut(e)?new Array(e.length):{};for(const n in e)t[n]=IC(e,n);return t}class RE{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=gs(n)?n:String(n),this._raw=Ht(t);let s=!0,i=t;if(!ut(t)||gs(this._key)||!ah(this._key))do s=!yh(i)||us(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=S(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Ln(this._raw[this._key])){const n=this._object[this._key];if(Ln(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return mE(this._raw,this._key)}}class DE{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 qhe(e,t,n){return Ln(e)?e:wt(e)?new DE(e):Gt(e)&&arguments.length>1?IC(e,t,n):te(e)}function IC(e,t,n){return new RE(e,t,n)}class BE{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ph(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Fc-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&dn!==this)return hC(this,!0),!0}get value(){const t=this.dep.track();return gC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function FE(e,t,n=!1){let o,s;return wt(e)?o=e:(o=e.get,s=e.set),new BE(o,s,n)}const jhe={GET:"get",HAS:"has",ITERATE:"iterate"},zhe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Ju={},nf=new WeakMap;let rr;function Vhe(){return rr}function HE(e,t=!1,n=rr){if(n){let o=nf.get(n);o||nf.set(n,o=[]),o.push(e)}}function WE(e,t,n=Pt){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>s?y:us(y)||s===!1||s===0?Mi(y,1):Mi(y);let u,d,f,g,h=!1,m=!1;if(Ln(e)?(d=()=>e.value,h=us(e)):mr(e)?(d=()=>c(e),h=!0):ut(e)?(m=!0,h=e.some(y=>mr(y)||us(y)),d=()=>e.map(y=>{if(Ln(y))return y.value;if(mr(y))return c(y);if(wt(y))return a?a(y,2):y()})):wt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Pi();try{f()}finally{Ri()}}const y=rr;rr=u;try{return a?a(e,3,[g]):e(g)}finally{rr=y}}:d=Os,t&&s){const y=d,x=s===!0?1/0:s;d=()=>Mi(y(),x)}const _=K1(),w=()=>{u.stop(),_&&_.active&&z1(_.effects,u)};if(i&&t){const y=t;t=(...x)=>{y(...x),w()}}let k=m?new Array(e.length).fill(Ju):Ju;const b=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const x=u.run();if(s||h||(m?x.some((L,N)=>ao(L,k[N])):ao(x,k))){f&&f();const L=rr;rr=u;try{const N=[x,k===Ju?void 0:m&&k[0]===Ju?[]:k,g];k=x,a?a(t,3,N):t(...N)}finally{rr=L}}}else u.run()};return l&&l(b),u=new Jd(d),u.scheduler=r?()=>r(b,!1):b,g=y=>HE(y,!1,u),f=u.onStop=()=>{const y=nf.get(u);if(y){if(a)a(y,4);else for(const x of y)x();nf.delete(u)}},t?o?b(!0):k=u.run():r?r(b.bind(null,!0),!0):u.run(),w.pause=u.pause.bind(u),w.resume=u.resume.bind(u),w.stop=w,w}function Mi(e,t=1/0,n){if(t<=0||!Gt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ln(e))Mi(e.value,t,n);else if(ut(e))for(let o=0;o<e.length;o++)Mi(e[o],t,n);else if(ml(e)||ia(e))e.forEach(o=>{Mi(o,t,n)});else if(lh(e)){for(const o in e)Mi(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Mi(e[o],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.35
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/const $C=[];function UE(e){$C.push(e)}function qE(){$C.pop()}function Khe(e,t){}const Ghe={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"},jE={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 fu(e,t,n,o){try{return o?e(...o):e()}catch(s){Ma(s,t,n)}}function Rs(e,t,n,o){if(wt(e)){const s=fu(e,t,n,o);return s&&V1(s)&&s.catch(i=>{Ma(i,t,n)}),s}if(ut(e)){const s=[];for(let i=0;i<e.length;i++)s.push(Rs(e[i],t,n,o));return s}}function Ma(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Pt;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){Pi(),fu(i,null,10,[e,a,c]),Ri();return}}zE(e,n,s,o,r)}function zE(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const Ao=[];let si=-1;const la=[];let lr=null,Kl=0;const NC=Promise.resolve();let of=null;function ht(e){const t=of||NC;return e?t.then(this?e.bind(this):e):t}function VE(e){let t=si+1,n=Ao.length;for(;t<n;){const o=t+n>>>1,s=Ao[o],i=Wc(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function Z1(e){if(!(e.flags&1)){const t=Wc(e),n=Ao[Ao.length-1];!n||!(e.flags&2)&&t>=Wc(n)?Ao.push(e):Ao.splice(VE(t),0,e),e.flags|=1,LC()}}function LC(){of||(of=NC.then(OC))}function sf(e){ut(e)?la.push(...e):lr&&e.id===-1?lr.splice(Kl+1,0,e):e.flags&1||(la.push(e),e.flags|=1),LC()}function Zy(e,t,n=si+1){for(;n<Ao.length;n++){const o=Ao[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;Ao.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function rf(e){if(la.length){const t=[...new Set(la)].sort((n,o)=>Wc(n)-Wc(o));if(la.length=0,lr){lr.push(...t);return}for(lr=t,Kl=0;Kl<lr.length;Kl++){const n=lr[Kl];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}lr=null,Kl=0}}const Wc=e=>e.id==null?e.flags&2?-1:1/0:e.id;function OC(e){try{for(si=0;si<Ao.length;si++){const t=Ao[si];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),fu(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;si<Ao.length;si++){const t=Ao[si];t&&(t.flags&=-2)}si=-1,Ao.length=0,rf(),of=null,(Ao.length||la.length)&&OC()}}let Gl,ed=[];function PC(e,t){var n,o;Gl=e,Gl?(Gl.enabled=!0,ed.forEach(({event:s,args:i})=>Gl.emit(s,...i)),ed=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{PC(i,t)}),setTimeout(()=>{Gl||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ed=[])},3e3)):ed=[]}let uo=null,kh=null;function Uc(e){const t=uo;return uo=e,kh=e&&e.type.__scopeId||null,t}function Yhe(e){kh=e}function Xhe(){kh=null}const Qhe=e=>In;function In(e,t=uo,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&df(-1);const i=Uc(t);let r;try{r=e(...s)}finally{Uc(i),o._d&&df(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function jt(e,t){if(uo===null)return e;const n=gu(uo),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=Pt]=t[s];i&&(wt(i)&&(i={mounted:i,updated:i}),i.deep&&Mi(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function ri(e,t,n,o){const s=e.dirs,i=t&&t.dirs;for(let r=0;r<s.length;r++){const l=s[r];i&&(l.oldValue=i[r].value);let a=l.dir[o];a&&(Pi(),Rs(a,n,8,[e.el,l,e,t]),Ri())}}function yn(e,t){if(co){let n=co.provides;const o=co.parent&&co.parent.provides;o===n&&(n=co.provides=Object.create(o)),n[e]=t}}function Bt(e,t,n=!1){const o=fo();if(o||al){let s=al?al._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&wt(t)?t.call(o&&o.proxy):t}}function Zhe(){return!!(fo()||al)}const KE=Symbol.for("v-scx"),GE=()=>Bt(KE);function YE(e,t){return hu(e,null,t)}function Jhe(e,t){return hu(e,null,{flush:"post"})}function XE(e,t){return hu(e,null,{flush:"sync"})}function ze(e,t,n){return hu(e,t,n)}function hu(e,t,n=Pt){const{immediate:o,deep:s,flush:i,once:r}=n,l=tn({},n),a=t&&o||!t&&i!=="post";let c;if(hl){if(i==="sync"){const g=GE();c=g.__watcherHandles||(g.__watcherHandles=[])}else if(!a){const g=()=>{};return g.stop=Os,g.resume=Os,g.pause=Os,g}}const u=co;l.call=(g,h,m)=>Rs(g,u,h,m);let d=!1;i==="post"?l.scheduler=g=>{Rn(g,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(g,h)=>{h?g():Z1(g)}),l.augmentJob=g=>{t&&(g.flags|=4),d&&(g.flags|=2,u&&(g.id=u.uid,g.i=u))};const f=WE(e,t,l);return hl&&(c?c.push(f):a&&f()),f}function QE(e,t,n){const o=this.proxy,s=sn(e)?e.includes(".")?RC(o,e):()=>o[e]:e.bind(o,o);let i;wt(t)?i=t:(i=t.handler,n=t);const r=Ea(this),l=hu(s,i.bind(o),n);return r(),l}function RC(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const sr=new WeakMap,DC=Symbol("_vte"),BC=e=>e.__isTeleport,Zr=e=>e&&(e.disabled||e.disabled===""),ZE=e=>e&&(e.defer||e.defer===""),Jy=e=>typeof SVGElement<"u"&&e instanceof SVGElement,ek=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Cg=(e,t)=>{const n=e&&e.to;return sn(n)?t?t(n):null:n},JE={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:g,querySelector:h,createText:m,createComment:_,parentNode:w}}=c,k=Zr(t.props);let{dynamicChildren:b}=t;const y=(N,v,M)=>{N.shapeFlag&16&&u(N.children,v,M,s,i,r,l,a)},x=(N=t)=>{const v=Zr(N.props),M=N.target=Cg(N.props,h),$=Sg(M,N,m,g);M&&(r!=="svg"&&Jy(M)?r="svg":r!=="mathml"&&ek(M)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(M),v||(y(N,M,$),uc(N,!1)))},L=N=>{const v=()=>{if(sr.get(N)===v){if(sr.delete(N),Zr(N.props)){const M=w(N.el)||n;y(N,M,N.anchor),uc(N,!0)}x(N)}};sr.set(N,v),Rn(v,i)};if(e==null){const N=t.el=m(""),v=t.anchor=m("");if(g(N,n,o),g(v,n,o),ZE(t.props)||i&&i.pendingBranch){L(t);return}k&&(y(t,n,v),uc(t,!0)),x()}else{t.el=e.el;const N=t.anchor=e.anchor,v=sr.get(e);if(v){v.flags|=8,sr.delete(e),L(t);return}t.targetStart=e.targetStart;const M=t.target=e.target,$=t.targetAnchor=e.targetAnchor,P=Zr(e.props),T=P?n:M,I=P?N:$;if(r==="svg"||Jy(M)?r="svg":(r==="mathml"||ek(M))&&(r="mathml"),b?(f(e.dynamicChildren,b,T,s,i,r,l),av(e,t,!0)):a||d(e,t,T,I,s,i,r,l,!1),k)P?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):td(t,n,N,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=Cg(t.props,h);R&&td(t,R,null,c,0)}else P&&td(t,M,$,c,1);uc(t,k)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,g=i||!Zr(f),h=sr.get(e);if(h&&(h.flags|=8,sr.delete(e)),d&&(s(c),s(u)),i&&s(a),!h&&r&16)for(let m=0;m<l.length;m++){const _=l[m];o(_,t,n,g,!!_.dynamicChildren)}},move:td,hydrate:eI};function td(e,t,n,{o:{insert:o},m:s},i=2){i===0&&o(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&o(r,t,n),!sr.has(e)&&(!d||Zr(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function eI(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(_,w){let k=w;for(;k;){if(k&&k.nodeType===8){if(k.data==="teleport start anchor")t.targetStart=k;else if(k.data==="teleport anchor"){t.targetAnchor=k,_._lpa=t.targetAnchor&&r(t.targetAnchor);break}}k=r(k)}}function g(_,w){w.anchor=d(r(_),w,l(_),n,o,s,i)}const h=t.target=Cg(t.props,a),m=Zr(t.props);if(h){const _=h._lpa||h.firstChild;t.shapeFlag&16&&(m?(g(e,t),f(h,_),t.targetAnchor||Sg(h,t,u,c,l(e)===h?e:null)):(t.anchor=r(e),f(h,_),t.targetAnchor||Sg(h,t,u,c),d(_&&r(_),t,h,n,o,s,i))),uc(t,m)}else m&&t.shapeFlag&16&&(g(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const epe=JE;function uc(e,t){const n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function Sg(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[DC]=r,e&&(o(i,e,s),o(r,e,s)),r}const Es=Symbol("_leaveCb"),nc=Symbol("_enterCb");function FC(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return rn(()=>{e.isMounted=!0}),Yo(()=>{e.isUnmounting=!0}),e}const Ss=[Function,Array],HC={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ss,onEnter:Ss,onAfterEnter:Ss,onEnterCancelled:Ss,onBeforeLeave:Ss,onLeave:Ss,onAfterLeave:Ss,onLeaveCancelled:Ss,onBeforeAppear:Ss,onAppear:Ss,onAfterAppear:Ss,onAppearCancelled:Ss},WC=e=>{const t=e.subTree;return t.component?WC(t.component):t},tI={name:"BaseTransition",props:HC,setup(e,{slots:t}){const n=fo(),o=FC();return()=>{const s=t.default&&J1(t.default(),!0),i=s&&s.length?UC(s):n.subTree?ie():void 0;if(!i)return;const r=Ht(e),{mode:l}=r;if(o.isLeaving)return rm(i);const a=tk(i);if(!a)return rm(i);let c=qc(a,r,o,n,d=>c=d);a.type!==Bn&&br(a,c);let u=n.subTree&&tk(n.subTree);if(u&&u.type!==Bn&&!qs(u,a)&&WC(n).type!==Bn){let d=qc(u,r,o,n);if(br(u,d),l==="out-in"&&a.type!==Bn)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},rm(i);l==="in-out"&&a.type!==Bn?d.delayLeave=(f,g,h)=>{const m=qC(o,u);m[String(u.key)]=u,f[Es]=()=>{g(),f[Es]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{h(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function UC(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Bn){t=n;break}}return t}const nI=tI;function qC(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function qc(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:g,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:_,onAppear:w,onAfterAppear:k,onAppearCancelled:b}=t,y=String(e.key),x=qC(n,e),L=(M,$)=>{M&&Rs(M,o,9,$)},N=(M,$)=>{const P=$[1];L(M,$),ut(M)?M.every(T=>T.length<=1)&&P():M.length<=1&&P()},v={mode:r,persisted:l,beforeEnter(M){let $=a;if(!n.isMounted)if(i)$=_||a;else return;M[Es]&&M[Es](!0);const P=x[y];P&&qs(e,P)&&P.el[Es]&&P.el[Es](),L($,[M])},enter(M){if(x[y]===e)return;let $=c,P=u,T=d;if(!n.isMounted)if(i)$=w||c,P=k||u,T=b||d;else return;let I=!1;M[nc]=D=>{I||(I=!0,D?L(T,[M]):L(P,[M]),v.delayedLeave&&v.delayedLeave(),M[nc]=void 0)};const R=M[nc].bind(null,!1);$?N($,[M,R]):R()},leave(M,$){const P=String(e.key);if(M[nc]&&M[nc](!0),n.isUnmounting)return $();L(f,[M]);let T=!1;M[Es]=R=>{T||(T=!0,$(),R?L(m,[M]):L(h,[M]),M[Es]=void 0,x[P]===e&&delete x[P])};const I=M[Es].bind(null,!1);x[P]=e,g?N(g,[M,I]):I()},clone(M){const $=qc(M,t,n,o,s);return s&&s($),$}};return v}function rm(e){if(pu(e))return e=Bi(e),e.children=null,e}function tk(e){if(!pu(e))return BC(e.type)&&e.children?UC(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&&wt(n.default))return n.default()}}function br(e,t){e.shapeFlag&6&&e.component?(e.transition=t,br(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 J1(e,t=!1,n){let o=[],s=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Pe?(r.patchFlag&128&&s++,o=o.concat(J1(r.children,t,l))):(t||r.type!==Bn)&&o.push(l!=null?Bi(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Qe(e,t){return wt(e)?tn({name:e.name},t,{setup:e}):e}function tpe(){const e=fo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function ev(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function npe(e){const t=fo(),n=gl(null);if(t){const s=t.refs===Pt?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function nk(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const lf=new WeakMap;function aa(e,t,n,o,s=!1){if(ut(e)){e.forEach((m,_)=>aa(m,t&&(ut(t)?t[_]:t),n,o,s));return}if(Ni(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&aa(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?gu(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Pt?l.refs={}:l.refs,d=l.setupState,f=Ht(d),g=d===Pt?iC:m=>nk(u,m)?!1:Kt(f,m),h=(m,_)=>!(_&&nk(u,_));if(c!=null&&c!==a){if(ok(t),sn(c))u[c]=null,g(c)&&(d[c]=null);else if(Ln(c)){const m=t;h(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(wt(a))fu(a,l,12,[r,u]);else{const m=sn(a),_=Ln(a);if(m||_){const w=()=>{if(e.f){const k=m?g(a)?d[a]:u[a]:h()||!e.k?a.value:u[e.k];if(s)ut(k)&&z1(k,i);else if(ut(k))k.includes(i)||k.push(i);else if(m)u[a]=[i],g(a)&&(d[a]=u[a]);else{const b=[i];h(a,e.k)&&(a.value=b),e.k&&(u[e.k]=b)}}else m?(u[a]=r,g(a)&&(d[a]=r)):_&&(h(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const k=()=>{w(),lf.delete(e)};k.id=-1,lf.set(e,k),Rn(k,n)}else ok(e),w()}}}function ok(e){const t=lf.get(e);t&&(t.flags|=8,lf.delete(e))}let sk=!1;const Fl=()=>{sk||(console.error("Hydration completed but contains mismatches."),sk=!0)},oI=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",sI=e=>e.namespaceURI.includes("MathML"),nd=e=>{if(e.nodeType===1){if(oI(e))return"svg";if(sI(e))return"mathml"}},Zl=e=>e.nodeType===8;function iI(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(b,y)=>{if(!y.hasChildNodes()){n(null,b,y),rf(),y._vnode=b;return}d(y.firstChild,b,null,null,null),rf(),y._vnode=b},d=(b,y,x,L,N,v=!1)=>{v=v||!!y.dynamicChildren;const M=Zl(b)&&b.data==="[",$=()=>m(b,y,x,L,N,M),{type:P,ref:T,shapeFlag:I,patchFlag:R}=y;let D=b.nodeType;y.el=b,R===-2&&(v=!1,y.dynamicChildren=null);let F=null;switch(P){case gr:D!==3?y.children===""?(a(y.el=s(""),r(b),b),F=b):F=$():(b.data!==y.children&&(Fl(),b.data=y.children),F=i(b));break;case Bn:k(b)?(F=i(b),w(y.el=b.content.firstChild,b,x)):D!==8||M?F=$():F=i(b);break;case da:if(M&&(b=i(b),D=b.nodeType),D===1||D===3){F=b;const z=!y.children.length;for(let V=0;V<y.staticCount;V++)z&&(y.children+=F.nodeType===1?F.outerHTML:F.data),V===y.staticCount-1&&(y.anchor=F),F=i(F);return M?i(F):F}else $();break;case Pe:M?F=h(b,y,x,L,N,v):F=$();break;default:if(I&1)(D!==1||y.type.toLowerCase()!==b.tagName.toLowerCase())&&!k(b)?F=$():F=f(b,y,x,L,N,v);else if(I&6){y.slotScopeIds=N;const z=r(b);if(M?F=_(b):Zl(b)&&b.data==="teleport start"?F=_(b,b.data,"teleport end"):F=i(b),t(y,z,null,x,L,nd(z),v),Ni(y)&&!y.type.__asyncResolved){let V;M?(V=vt(Pe),V.anchor=F?F.previousSibling:z.lastChild):V=b.nodeType===3?ft(""):vt("div"),V.el=b,y.component.subTree=V}}else I&64?D!==8?F=$():F=y.type.hydrate(b,y,x,L,N,v,e,g):I&128&&(F=y.type.hydrate(b,y,x,L,nd(r(b)),N,v,e,d))}return T!=null&&aa(T,null,L,y),F},f=(b,y,x,L,N,v)=>{v=v||!!y.dynamicChildren;const{type:M,props:$,patchFlag:P,shapeFlag:T,dirs:I,transition:R}=y,D=M==="input"||M==="option";if(D||P!==-1){I&&ri(y,null,x,"created");let F=!1;if(k(b)){F=aS(null,R)&&x&&x.vnode.props&&x.vnode.props.appear;const V=b.content.firstChild;if(F){const ne=V.getAttribute("class");ne&&(V.$cls=ne),R.beforeEnter(V)}w(V,b,x),y.el=b=V}if(T&16&&!($&&($.innerHTML||$.textContent))){let V=g(b.firstChild,y,b,x,L,N,v);for(V&&!od(b,1)&&Fl();V;){const ne=V;V=V.nextSibling,l(ne)}}else if(T&8){let V=y.children;V[0]===`
|
|
15
|
-
`&&(b.tagName==="PRE"||b.tagName==="TEXTAREA")&&(V=V.slice(1));const{textContent:ne}=b;ne!==V&&ne!==V.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(od(b,0)||Fl(),b.textContent=y.children)}if($){if(D||!v||P&48){const V=b.tagName.includes("-");for(const ne in $)(D&&(ne.endsWith("value")||ne==="indeterminate")||du(ne)&&!rl(ne)||ne[0]==="."||V&&!rl(ne))&&o(b,ne,null,$[ne],void 0,x)}else if($.onClick)o(b,"onClick",null,$.onClick,void 0,x);else if(P&4&&mr($.style))for(const V in $.style)$.style[V]}let z;(z=$&&$.onVnodeBeforeMount)&&Fo(z,x,y),I&&ri(y,null,x,"beforeMount"),((z=$&&$.onVnodeMounted)||I||F)&&fS(()=>{z&&Fo(z,x,y),F&&R.enter(b),I&&ri(y,null,x,"mounted")},L)}return b.nextSibling},g=(b,y,x,L,N,v,M)=>{M=M||!!y.dynamicChildren;const $=y.children,P=$.length;let T=!1;for(let I=0;I<P;I++){const R=M?$[I]:$[I]=Wo($[I]),D=R.type===gr;b?(D&&!M&&I+1<P&&Wo($[I+1]).type===gr&&(a(s(b.data.slice(R.children.length)),x,i(b)),b.data=R.children),b=d(b,R,L,N,v,M)):D&&!R.children?a(R.el=s(""),x):(T||(T=!0,od(x,1)||Fl()),n(null,R,x,null,L,N,nd(x),v))}return b},h=(b,y,x,L,N,v)=>{const{slotScopeIds:M}=y;M&&(N=N?N.concat(M):M);const $=r(b),P=g(i(b),y,$,x,L,N,v);return P&&Zl(P)&&P.data==="]"?i(y.anchor=P):(Fl(),a(y.anchor=c("]"),$,P),P)},m=(b,y,x,L,N,v)=>{if(od(b.parentElement,1)||Fl(),y.el=null,v){const P=_(b);for(;;){const T=i(b);if(T&&T!==P)l(T);else break}}const M=i(b),$=r(b);return l(b),n(null,y,$,M,x,L,nd($),N),x&&(x.vnode.el=y.el,_h(x,y.el)),M},_=(b,y="[",x="]")=>{let L=0;for(;b;)if(b=i(b),b&&Zl(b)&&(b.data===y&&L++,b.data===x)){if(L===0)return i(b);L--}return b},w=(b,y,x)=>{const L=y.parentNode;L&&L.replaceChild(b,y);let N=x;for(;N;)N.vnode.el===y&&(N.vnode.el=N.subTree.el=b),N=N.parent},k=b=>b.nodeType===1&&b.tagName==="TEMPLATE";return[u,d]}const ik="data-allow-mismatch",rI={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function od(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(ik);)e=e.parentElement;const n=e&&e.getAttribute(ik);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(rI[t])}}const lI=fh().requestIdleCallback||(e=>setTimeout(e,1)),aI=fh().cancelIdleCallback||(e=>clearTimeout(e)),ope=(e=1e4)=>t=>{const n=lI(t,{timeout:e});return()=>aI(n)};function cI(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||o>0&&o<i)&&(n>0&&n<r||s>0&&s<r)}const spe=e=>(t,n)=>{const o=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(cI(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},ipe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},rpe=(e=[])=>(t,n)=>{sn(e)&&(e=[e]);let o=!1;const s=r=>{o||(o=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,s)})};return n(r=>{for(const l of e)r.addEventListener(l,s,{once:!0})}),i};function uI(e,t){if(Zl(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(Zl(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Ni=e=>!!e.type.__asyncLoader;function ai(e){wt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,g()),g=()=>{let h;return c||(h=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((_,w)=>{a(m,()=>_(f()),()=>w(m),d+1)});throw m}).then(m=>h!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Qe({name:"AsyncComponentWrapper",__asyncLoader:g,__asyncHydrate(h,m,_){let w=!1;(m.bu||(m.bu=[])).push(()=>w=!0);const k=()=>{w||_()},b=i?()=>{const y=i(k,x=>uI(h,x));y&&(m.bum||(m.bum=[])).push(y)}:k;u?b():g().then(()=>!m.isUnmounted&&b())},get __asyncResolved(){return u},setup(){const h=co;if(ev(h),u)return()=>sd(u,h);const m=b=>{c=null,Ma(b,h,13,!o)};if(l&&h.suspense||hl)return g().then(b=>()=>sd(b,h)).catch(b=>(m(b),()=>o?vt(o,{error:b}):null));const _=te(!1),w=te(),k=te(!!s);return s&&setTimeout(()=>{k.value=!1},s),r!=null&&setTimeout(()=>{if(!_.value&&!w.value){const b=new Error(`Async component timed out after ${r}ms.`);m(b),w.value=b}},r),g().then(()=>{_.value=!0,h.parent&&pu(h.parent.vnode)&&h.parent.update()}).catch(b=>{m(b),w.value=b}),()=>{if(_.value&&u)return sd(u,h);if(w.value&&o)return vt(o,{error:w.value});if(n&&!k.value)return sd(n,h)}}})}function sd(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=vt(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const pu=e=>e.type.__isKeepAlive,dI={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=fo(),o=n.ctx;if(!o.renderer)return()=>{const k=t.default&&t.default();return k&&k.length===1?k[0]:k};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(k,b,y,x,L)=>{const N=k.component;c(k,b,y,0,l),a(N.vnode,k,b,y,N,l,x,k.slotScopeIds,L),Rn(()=>{N.isDeactivated=!1,N.a&&ra(N.a);const v=k.props&&k.props.onVnodeMounted;v&&Fo(v,N.parent,k)},l)},o.deactivate=k=>{const b=k.component;cf(b.m),cf(b.a),c(k,f,null,1,l),Rn(()=>{b.da&&ra(b.da);const y=k.props&&k.props.onVnodeUnmounted;y&&Fo(y,b.parent,k),b.isDeactivated=!0},l)};function g(k){lm(k),u(k,n,l,!0)}function h(k){s.forEach((b,y)=>{const x=Lg(Ni(b)?b.type.__asyncResolved||{}:b.type);x&&!k(x)&&m(y)})}function m(k){const b=s.get(k);b&&(!r||!qs(b,r))?g(b):r&&lm(r),s.delete(k),i.delete(k)}ze(()=>[e.include,e.exclude],([k,b])=>{k&&h(y=>dc(k,y)),b&&h(y=>!dc(b,y))},{flush:"post",deep:!0});let _=null;const w=()=>{_!=null&&(uf(n.subTree.type)?Rn(()=>{s.set(_,id(n.subTree))},n.subTree.suspense):s.set(_,id(n.subTree)))};return rn(w),tv(w),Yo(()=>{s.forEach(k=>{const{subTree:b,suspense:y}=n,x=id(b);if(k.type===x.type&&k.key===x.key){lm(x);const L=x.component.da;L&&Rn(L,y);return}g(k)})}),()=>{if(_=null,!t.default)return r=null;const k=t.default(),b=k[0];if(k.length>1)return r=null,k;if(!wr(b)||!(b.shapeFlag&4)&&!(b.shapeFlag&128))return r=null,b;let y=id(b);if(y.type===Bn)return r=null,y;const x=y.type,L=Lg(Ni(y)?y.type.__asyncResolved||{}:x),{include:N,exclude:v,max:M}=e;if(N&&(!L||!dc(N,L))||v&&L&&dc(v,L))return y.shapeFlag&=-257,r=y,b;const $=y.key==null?x:y.key,P=s.get($);return y.el&&(y=Bi(y),b.shapeFlag&128&&(b.ssContent=y)),_=$,P?(y.el=P.el,y.component=P.component,y.transition&&br(y,y.transition),y.shapeFlag|=512,i.delete($),i.add($)):(i.add($),M&&i.size>parseInt(M,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,uf(b.type)?b:y}}},lpe=dI;function dc(e,t){return ut(e)?e.some(n=>dc(n,t)):sn(e)?e.split(",").includes(t):ZM(e)?(e.lastIndex=0,e.test(t)):!1}function fI(e,t){jC(e,"a",t)}function hI(e,t){jC(e,"da",t)}function jC(e,t,n=co){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(bh(t,o,n),n){let s=n.parent;for(;s&&s.parent;)pu(s.parent.vnode)&&pI(o,t,n,s),s=s.parent}}function pI(e,t,n,o){const s=bh(t,e,o,!0);Yt(()=>{z1(o[t],s)},n)}function lm(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function id(e){return e.shapeFlag&128?e.ssContent:e}function bh(e,t,n=co,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Pi();const l=Ea(n),a=Rs(t,n,e,r);return l(),Ri(),a});return o?s.unshift(i):s.push(i),i}}const Wi=e=>(t,n=co)=>{(!hl||e==="sp")&&bh(e,(...o)=>t(...o),n)},mI=Wi("bm"),rn=Wi("m"),zC=Wi("bu"),tv=Wi("u"),Yo=Wi("bum"),Yt=Wi("um"),gI=Wi("sp"),vI=Wi("rtg"),yI=Wi("rtc");function kI(e,t=co){bh("ec",e,t)}const nv="components",bI="directives";function wI(e,t){return ov(nv,e,!0,t)||e}const VC=Symbol.for("v-ndc");function ko(e){return sn(e)?ov(nv,e,!1)||e:e||VC}function ape(e){return ov(bI,e)}function ov(e,t,n=!0,o=!1){const s=uo||co;if(s){const i=s.type;if(e===nv){const l=Lg(i,!1);if(l&&(l===t||l===Xn(t)||l===uh(Xn(t))))return i}const r=rk(s[e]||i[e],t)||rk(s.appContext[e],t);return!r&&o?i:r}}function rk(e,t){return e&&(e[t]||e[Xn(t)]||e[uh(Xn(t))])}function Xe(e,t,n,o){let s;const i=n&&n[o],r=ut(e);if(r||sn(e)){const l=r&&mr(e);let a=!1,c=!1;l&&(a=!us(e),c=Di(e),e=mh(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?ba(Ks(e[u])):Ks(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,i&&i[l])}else if(Gt(e))if(e[Symbol.iterator])s=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];s[a]=t(e[u],u,a,i&&i[a])}}else s=[];return n&&(n[o]=s),s}function cpe(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(ut(o))for(let s=0;s<o.length;s++)e[o[s].name]=o[s].fn;else o&&(e[o.name]=o.key?(...s)=>{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function ca(e,t,n={},o,s){if(uo.ce||uo.parent&&Ni(uo.parent)&&uo.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),C(),Ve(Pe,null,[vt("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),C();const r=i&&sv(i(n)),l=n.key||r&&r.key,a=Ve(Pe,{key:(l&&!gs(l)?l:`_${t}`)+(!r&&o?"_fb":"")},r||(o?o():[]),r&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function sv(e){return e.some(t=>wr(t)?!(t.type===Bn||t.type===Pe&&!sv(t.children)):!0)?e:null}function upe(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:Nd(o)]=e[o];return n}const xg=e=>e?vS(e)?gu(e):xg(e.parent):null,Cc=tn(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=>xg(e.parent),$root:e=>xg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>iv(e),$forceUpdate:e=>e.f||(e.f=()=>{Z1(e.update)}),$nextTick:e=>e.n||(e.n=ht.bind(e.proxy)),$watch:e=>QE.bind(e)}),am=(e,t)=>e!==Pt&&!e.__isScriptSetup&&Kt(e,t),Tg={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(am(o,t))return r[t]=1,o[t];if(s!==Pt&&Kt(s,t))return r[t]=2,s[t];if(Kt(i,t))return r[t]=3,i[t];if(n!==Pt&&Kt(n,t))return r[t]=4,n[t];Ag&&(r[t]=0)}}const c=Cc[t];let u,d;if(c)return t==="$attrs"&&yo(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Pt&&Kt(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,Kt(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return am(s,t)?(s[t]=n,!0):o!==Pt&&Kt(o,t)?(o[t]=n,!0):Kt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:i,type:r}},l){let a;return!!(n[l]||e!==Pt&&l[0]!=="$"&&Kt(e,l)||am(t,l)||Kt(i,l)||Kt(o,l)||Kt(Cc,l)||Kt(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Kt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},_I=tn({},Tg,{get(e,t){if(t!==Symbol.unscopables)return Tg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!oE(t)}});function dpe(){return null}function fpe(){return null}function hpe(e){}function ppe(e){}function mpe(){return null}function gpe(){}function vpe(e,t){return null}function ype(){return KC().slots}function mu(){return KC().attrs}function KC(e){const t=fo();return t.setupContext||(t.setupContext=bS(t))}function jc(e){return ut(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function kpe(e,t){const n=jc(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?ut(s)||wt(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function bpe(e,t){return!e||!t?e||t:ut(e)&&ut(t)?e.concat(t):tn({},jc(e),jc(t))}function wpe(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function _pe(e){const t=fo(),n=hl;let o=e();Vc(),n&&fa(!1);const s=()=>{Ea(t),n&&fa(!0)},i=()=>{fo()!==t&&t.scope.off(),Vc(),n&&fa(!1)};return V1(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Ag=!0;function CI(e){const t=iv(e),n=e.proxy,o=e.ctx;Ag=!1,t.beforeCreate&&lk(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:g,updated:h,activated:m,deactivated:_,beforeDestroy:w,beforeUnmount:k,destroyed:b,unmounted:y,render:x,renderTracked:L,renderTriggered:N,errorCaptured:v,serverPrefetch:M,expose:$,inheritAttrs:P,components:T,directives:I,filters:R}=t;if(c&&SI(c,o,null),r)for(const z in r){const V=r[z];wt(V)&&(o[z]=V.bind(n))}if(s){const z=s.call(n,n);Gt(z)&&(e.data=as(z))}if(Ag=!0,i)for(const z in i){const V=i[z],ne=wt(V)?V.bind(n,n):wt(V.get)?V.get.bind(n,n):Os,K=!wt(V)&&wt(V.set)?V.set.bind(n):Os,G=H({get:ne,set:K});Object.defineProperty(o,z,{enumerable:!0,configurable:!0,get:()=>G.value,set:X=>G.value=X})}if(l)for(const z in l)GC(l[z],o,n,z);if(a){const z=wt(a)?a.call(n):a;Reflect.ownKeys(z).forEach(V=>{yn(V,z[V])})}u&&lk(u,e,"c");function F(z,V){ut(V)?V.forEach(ne=>z(ne.bind(n))):V&&z(V.bind(n))}if(F(mI,d),F(rn,f),F(zC,g),F(tv,h),F(fI,m),F(hI,_),F(kI,v),F(yI,L),F(vI,N),F(Yo,k),F(Yt,y),F(gI,M),ut($))if($.length){const z=e.exposed||(e.exposed={});$.forEach(V=>{Object.defineProperty(z,V,{get:()=>n[V],set:ne=>n[V]=ne,enumerable:!0})})}else e.exposed||(e.exposed={});x&&e.render===Os&&(e.render=x),P!=null&&(e.inheritAttrs=P),T&&(e.components=T),I&&(e.directives=I),M&&ev(e)}function SI(e,t,n=Os){ut(e)&&(e=Mg(e));for(const o in e){const s=e[o];let i;Gt(s)?"default"in s?i=Bt(s.from||o,s.default,!0):i=Bt(s.from||o):i=Bt(s),Ln(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function lk(e,t,n){Rs(ut(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function GC(e,t,n,o){let s=o.includes(".")?RC(n,o):()=>n[o];if(sn(e)){const i=t[e];wt(i)&&ze(s,i)}else if(wt(e))ze(s,e.bind(n));else if(Gt(e))if(ut(e))e.forEach(i=>GC(i,t,n,o));else{const i=wt(e.handler)?e.handler.bind(n):t[e.handler];wt(i)&&ze(s,i,e)}}function iv(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>af(a,c,r,!0)),af(a,t,r)),Gt(t)&&i.set(t,a),a}function af(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&af(e,i,n,!0),s&&s.forEach(r=>af(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=xI[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const xI={data:ak,props:ck,emits:ck,methods:fc,computed:fc,beforeCreate:xo,created:xo,beforeMount:xo,mounted:xo,beforeUpdate:xo,updated:xo,beforeDestroy:xo,beforeUnmount:xo,destroyed:xo,unmounted:xo,activated:xo,deactivated:xo,errorCaptured:xo,serverPrefetch:xo,components:fc,directives:fc,watch:AI,provide:ak,inject:TI};function ak(e,t){return t?e?function(){return tn(wt(e)?e.call(this,this):e,wt(t)?t.call(this,this):t)}:t:e}function TI(e,t){return fc(Mg(e),Mg(t))}function Mg(e){if(ut(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function xo(e,t){return e?[...new Set([].concat(e,t))]:t}function fc(e,t){return e?tn(Object.create(null),e,t):t}function ck(e,t){return e?ut(e)&&ut(t)?[...new Set([...e,...t])]:tn(Object.create(null),jc(e),jc(t??{})):t}function AI(e,t){if(!e)return t;if(!t)return e;const n=tn(Object.create(null),e);for(const o in t)n[o]=xo(e[o],t[o]);return n}function YC(){return{app:null,config:{isNativeTag:iC,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 MI=0;function EI(e,t){return function(o,s=null){wt(o)||(o=tn({},o)),s!=null&&!Gt(s)&&(s=null);const i=YC(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:MI++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:i$,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&wt(u.install)?(r.add(u),u.install(c,...d)):wt(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const g=c._ceVNode||vt(o,s);return g.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(g,u):e(g,u,f),a=!0,c._container=u,u.__vue_app__=c,gu(g.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Rs(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=al;al=c;try{return u()}finally{al=d}}};return c}}let al=null;function Cpe(e,t,n=Pt){const o=fo(),s=Xn(t),i=Uo(t),r=XC(e,s),l=PE((a,c)=>{let u,d=Pt,f;return XE(()=>{const g=e[s];ao(u,g)&&(u=g,c())}),{get(){return a(),n.get?n.get(u):u},set(g){const h=n.set?n.set(g):g;if(!ao(h,u)&&!(d!==Pt&&ao(g,d)))return;const m=o.vnode.props;m&&(t in m||s in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${s}`in m||`onUpdate:${i}`in m)||(u=g,c()),o.emit(`update:${t}`,h),ao(g,h)&&ao(g,d)&&!ao(h,f)&&c(),d=g,f=h}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Pt:l,done:!1}:{done:!0}}}},l}const XC=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Xn(t)}Modifiers`]||e[`${Uo(t)}Modifiers`];function II(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Pt;let s=n;const i=t.startsWith("update:"),r=i&&XC(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>sn(u)?u.trim():u)),r.number&&(s=n.map(dh)));let l,a=o[l=Nd(t)]||o[l=Nd(Xn(t))];!a&&i&&(a=o[l=Nd(Uo(t))]),a&&Rs(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Rs(c,e,6,s)}}const $I=new WeakMap;function QC(e,t,n=!1){const o=n?$I:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!wt(e)){const a=c=>{const u=QC(c,t,!0);u&&(l=!0,tn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(Gt(e)&&o.set(e,null),null):(ut(i)?i.forEach(a=>r[a]=null):tn(r,i),Gt(e)&&o.set(e,r),r)}function wh(e,t){return!e||!du(t)?!1:(t=t.slice(2).replace(/Once$/,""),Kt(e,t[0].toLowerCase()+t.slice(1))||Kt(e,Uo(t))||Kt(e,t))}function Ld(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:g,ctx:h,inheritAttrs:m}=e,_=Uc(e);let w,k;try{if(n.shapeFlag&4){const y=s||o,x=y;w=Wo(c.call(x,y,u,d,g,f,h)),k=l}else{const y=t;w=Wo(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),k=t.props?l:LI(l)}}catch(y){Sc.length=0,Ma(y,e,1),w=vt(Bn)}let b=w;if(k&&m!==!1){const y=Object.keys(k),{shapeFlag:x}=b;y.length&&x&7&&(i&&y.some(rh)&&(k=OI(k,i)),b=Bi(b,k,!1,!0))}return n.dirs&&(b=Bi(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&br(b,n.transition),w=b,Uc(_),w}function NI(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(wr(s)){if(s.type!==Bn||s.children==="v-if"){if(n)return;n=s}}else return}return n}const LI=e=>{let t;for(const n in e)(n==="class"||n==="style"||du(n))&&((t||(t={}))[n]=e[n]);return t},OI=(e,t)=>{const n={};for(const o in e)(!rh(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function PI(e,t,n){const{props:o,children:s,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return o?uk(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(ZC(r,o,f)&&!wh(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?uk(o,r,c):!0:!!r;return!1}function uk(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(ZC(t,e,i)&&!wh(n,i))return!0}return!1}function ZC(e,t,n){const o=e[n],s=t[n];return n==="style"&&Gt(o)&&Gt(s)?!Oi(o,s):o!==s}function _h({vnode:e,parent:t,suspense:n},o){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const JC={},eS=()=>Object.create(JC),tS=e=>Object.getPrototypeOf(e)===JC;function RI(e,t,n,o=!1){const s={},i=eS();e.propsDefaults=Object.create(null),nS(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:$E(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function DI(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=Ht(s),[a]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(wh(e.emitsOptions,f))continue;const g=t[f];if(a)if(Kt(i,f))g!==i[f]&&(i[f]=g,c=!0);else{const h=Xn(f);s[h]=Eg(a,l,h,g,e,!1)}else g!==i[f]&&(i[f]=g,c=!0)}}}else{nS(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!Kt(t,d)&&((u=Uo(d))===d||!Kt(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=Eg(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!Kt(t,d))&&(delete i[d],c=!0)}c&&Ai(e.attrs,"set","")}function nS(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(rl(a))continue;const c=t[a];let u;s&&Kt(s,u=Xn(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:wh(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=Ht(n),c=l||Pt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Eg(s,a,d,c[d],e,!Kt(c,d))}}return r}function Eg(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=Kt(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&wt(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=Ea(s);o=c[n]=a.call(null,t),u()}}else o=a;s.ce&&s.ce._setProp(n,o)}r[0]&&(i&&!l?o=!1:r[1]&&(o===""||o===Uo(n))&&(o=!0))}return o}const BI=new WeakMap;function oS(e,t,n=!1){const o=n?BI:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!wt(e)){const u=d=>{a=!0;const[f,g]=oS(d,t,!0);tn(r,f),g&&l.push(...g)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return Gt(e)&&o.set(e,sa),sa;if(ut(i))for(let u=0;u<i.length;u++){const d=Xn(i[u]);dk(d)&&(r[d]=Pt)}else if(i)for(const u in i){const d=Xn(u);if(dk(d)){const f=i[u],g=r[d]=ut(f)||wt(f)?{type:f}:tn({},f),h=g.type;let m=!1,_=!0;if(ut(h))for(let w=0;w<h.length;++w){const k=h[w],b=wt(k)&&k.name;if(b==="Boolean"){m=!0;break}else b==="String"&&(_=!1)}else m=wt(h)&&h.name==="Boolean";g[0]=m,g[1]=_,(m||Kt(g,"default"))&&l.push(d)}}const c=[r,l];return Gt(e)&&o.set(e,c),c}function dk(e){return e[0]!=="$"&&!rl(e)}const rv=e=>e==="_"||e==="_ctx"||e==="$stable",lv=e=>ut(e)?e.map(Wo):[Wo(e)],FI=(e,t,n)=>{if(t._n)return t;const o=In((...s)=>lv(t(...s)),n);return o._c=!1,o},sS=(e,t,n)=>{const o=e._ctx;for(const s in e){if(rv(s))continue;const i=e[s];if(wt(i))t[s]=FI(s,i,o);else if(i!=null){const r=lv(i);t[s]=()=>r}}},iS=(e,t)=>{const n=lv(t);e.slots.default=()=>n},rS=(e,t,n)=>{for(const o in t)(n||!rv(o))&&(e[o]=t[o])},HI=(e,t,n)=>{const o=e.slots=eS();if(e.vnode.shapeFlag&32){const s=t._;s?(rS(o,t,n),n&&lC(o,"_",s,!0)):sS(t,o)}else t&&iS(e,t)},WI=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=Pt;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:rS(s,t,n):(i=!t.$stable,sS(t,s)),r=t}else t&&(iS(e,t),r={default:1});if(i)for(const l in s)!rv(l)&&r[l]==null&&delete s[l]},Rn=fS;function UI(e){return lS(e)}function qI(e){return lS(e,iI)}function lS(e,t){const n=fh();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:g=Os,insertStaticContent:h}=e,m=(q,ee,he,oe=null,fe=null,W=null,Y=void 0,re=null,ge=!!ee.dynamicChildren)=>{if(q===ee)return;q&&!qs(q,ee)&&(oe=ve(q),X(q,fe,W,!0),q=null),ee.patchFlag===-2&&(ge=!1,ee.dynamicChildren=null);const{type:xe,ref:$e,shapeFlag:se}=ee;switch(xe){case gr:_(q,ee,he,oe);break;case Bn:w(q,ee,he,oe);break;case da:q==null&&k(ee,he,oe,Y);break;case Pe:T(q,ee,he,oe,fe,W,Y,re,ge);break;default:se&1?x(q,ee,he,oe,fe,W,Y,re,ge):se&6?I(q,ee,he,oe,fe,W,Y,re,ge):(se&64||se&128)&&xe.process(q,ee,he,oe,fe,W,Y,re,ge,Q)}$e!=null&&fe?aa($e,q&&q.ref,W,ee||q,!ee):$e==null&&q&&q.ref!=null&&aa(q.ref,null,W,q,!0)},_=(q,ee,he,oe)=>{if(q==null)o(ee.el=l(ee.children),he,oe);else{const fe=ee.el=q.el;ee.children!==q.children&&c(fe,ee.children)}},w=(q,ee,he,oe)=>{q==null?o(ee.el=a(ee.children||""),he,oe):ee.el=q.el},k=(q,ee,he,oe)=>{[q.el,q.anchor]=h(q.children,ee,he,oe,q.el,q.anchor)},b=({el:q,anchor:ee},he,oe)=>{let fe;for(;q&&q!==ee;)fe=f(q),o(q,he,oe),q=fe;o(ee,he,oe)},y=({el:q,anchor:ee})=>{let he;for(;q&&q!==ee;)he=f(q),s(q),q=he;s(ee)},x=(q,ee,he,oe,fe,W,Y,re,ge)=>{if(ee.type==="svg"?Y="svg":ee.type==="math"&&(Y="mathml"),q==null)L(ee,he,oe,fe,W,Y,re,ge);else{const xe=q.el&&q.el._isVueCE?q.el:null;try{xe&&xe._beginPatch(),M(q,ee,fe,W,Y,re,ge)}finally{xe&&xe._endPatch()}}},L=(q,ee,he,oe,fe,W,Y,re)=>{let ge,xe;const{props:$e,shapeFlag:se,transition:ae,dirs:we}=q;if(ge=q.el=r(q.type,W,$e&&$e.is,$e),se&8?u(ge,q.children):se&16&&v(q.children,ge,null,oe,fe,cm(q,W),Y,re),we&&ri(q,null,oe,"created"),N(ge,q,q.scopeId,Y,oe),$e){for(const nt in $e)nt!=="value"&&!rl(nt)&&i(ge,nt,null,$e[nt],W,oe);"value"in $e&&i(ge,"value",null,$e.value,W),(xe=$e.onVnodeBeforeMount)&&Fo(xe,oe,q)}we&&ri(q,null,oe,"beforeMount");const qe=aS(fe,ae);qe&&ae.beforeEnter(ge),o(ge,ee,he),((xe=$e&&$e.onVnodeMounted)||qe||we)&&Rn(()=>{try{xe&&Fo(xe,oe,q),qe&&ae.enter(ge),we&&ri(q,null,oe,"mounted")}finally{}},fe)},N=(q,ee,he,oe,fe)=>{if(he&&g(q,he),oe)for(let W=0;W<oe.length;W++)g(q,oe[W]);if(fe){let W=fe.subTree;if(ee===W||uf(W.type)&&(W.ssContent===ee||W.ssFallback===ee)){const Y=fe.vnode;N(q,Y,Y.scopeId,Y.slotScopeIds,fe.parent)}}},v=(q,ee,he,oe,fe,W,Y,re,ge=0)=>{for(let xe=ge;xe<q.length;xe++){const $e=q[xe]=re?Ti(q[xe]):Wo(q[xe]);m(null,$e,ee,he,oe,fe,W,Y,re)}},M=(q,ee,he,oe,fe,W,Y)=>{const re=ee.el=q.el;let{patchFlag:ge,dynamicChildren:xe,dirs:$e}=ee;ge|=q.patchFlag&16;const se=q.props||Pt,ae=ee.props||Pt;let we;if(he&&jr(he,!1),(we=ae.onVnodeBeforeUpdate)&&Fo(we,he,ee,q),$e&&ri(ee,q,he,"beforeUpdate"),he&&jr(he,!0),(se.innerHTML&&ae.innerHTML==null||se.textContent&&ae.textContent==null)&&u(re,""),xe?$(q.dynamicChildren,xe,re,he,oe,cm(ee,fe),W):Y||V(q,ee,re,null,he,oe,cm(ee,fe),W,!1),ge>0){if(ge&16)P(re,se,ae,he,fe);else if(ge&2&&se.class!==ae.class&&i(re,"class",null,ae.class,fe),ge&4&&i(re,"style",se.style,ae.style,fe),ge&8){const qe=ee.dynamicProps;for(let nt=0;nt<qe.length;nt++){const at=qe[nt],_t=se[at],$t=ae[at];($t!==_t||at==="value")&&i(re,at,_t,$t,fe,he)}}ge&1&&q.children!==ee.children&&u(re,ee.children)}else!Y&&xe==null&&P(re,se,ae,he,fe);((we=ae.onVnodeUpdated)||$e)&&Rn(()=>{we&&Fo(we,he,ee,q),$e&&ri(ee,q,he,"updated")},oe)},$=(q,ee,he,oe,fe,W,Y)=>{for(let re=0;re<ee.length;re++){const ge=q[re],xe=ee[re],$e=ge.el&&(ge.type===Pe||!qs(ge,xe)||ge.shapeFlag&198)?d(ge.el):he;m(ge,xe,$e,null,oe,fe,W,Y,!0)}},P=(q,ee,he,oe,fe)=>{if(ee!==he){if(ee!==Pt)for(const W in ee)!rl(W)&&!(W in he)&&i(q,W,ee[W],null,fe,oe);for(const W in he){if(rl(W))continue;const Y=he[W],re=ee[W];Y!==re&&W!=="value"&&i(q,W,re,Y,fe,oe)}"value"in he&&i(q,"value",ee.value,he.value,fe)}},T=(q,ee,he,oe,fe,W,Y,re,ge)=>{const xe=ee.el=q?q.el:l(""),$e=ee.anchor=q?q.anchor:l("");let{patchFlag:se,dynamicChildren:ae,slotScopeIds:we}=ee;we&&(re=re?re.concat(we):we),q==null?(o(xe,he,oe),o($e,he,oe),v(ee.children||[],he,$e,fe,W,Y,re,ge)):se>0&&se&64&&ae&&q.dynamicChildren&&q.dynamicChildren.length===ae.length?($(q.dynamicChildren,ae,he,fe,W,Y,re),(ee.key!=null||fe&&ee===fe.subTree)&&av(q,ee,!0)):V(q,ee,he,$e,fe,W,Y,re,ge)},I=(q,ee,he,oe,fe,W,Y,re,ge)=>{ee.slotScopeIds=re,q==null?ee.shapeFlag&512?fe.ctx.activate(ee,he,oe,Y,ge):R(ee,he,oe,fe,W,Y,ge):D(q,ee,ge)},R=(q,ee,he,oe,fe,W,Y)=>{const re=q.component=gS(q,oe,fe);if(pu(q)&&(re.ctx.renderer=Q),yS(re,!1,Y),re.asyncDep){if(fe&&fe.registerDep(re,F,Y),!q.el){const ge=re.subTree=vt(Bn);w(null,ge,ee,he),q.placeholder=ge.el}}else F(re,q,ee,he,fe,W,Y)},D=(q,ee,he)=>{const oe=ee.component=q.component;if(PI(q,ee,he))if(oe.asyncDep&&!oe.asyncResolved){z(oe,ee,he);return}else oe.next=ee,oe.update();else ee.el=q.el,oe.vnode=ee},F=(q,ee,he,oe,fe,W,Y)=>{const re=()=>{if(q.isMounted){let{next:se,bu:ae,u:we,parent:qe,vnode:nt}=q;{const Rt=cS(q);if(Rt){se&&(se.el=nt.el,z(q,se,Y)),Rt.asyncDep.then(()=>{Rn(()=>{q.isUnmounted||xe()},fe)});return}}let at=se,_t;jr(q,!1),se?(se.el=nt.el,z(q,se,Y)):se=nt,ae&&ra(ae),(_t=se.props&&se.props.onVnodeBeforeUpdate)&&Fo(_t,qe,se,nt),jr(q,!0);const $t=Ld(q),lt=q.subTree;q.subTree=$t,m(lt,$t,d(lt.el),ve(lt),q,fe,W),se.el=$t.el,at===null&&_h(q,$t.el),we&&Rn(we,fe),(_t=se.props&&se.props.onVnodeUpdated)&&Rn(()=>Fo(_t,qe,se,nt),fe)}else{let se;const{el:ae,props:we}=ee,{bm:qe,m:nt,parent:at,root:_t,type:$t}=q,lt=Ni(ee);if(jr(q,!1),qe&&ra(qe),!lt&&(se=we&&we.onVnodeBeforeMount)&&Fo(se,at,ee),jr(q,!0),ae&&Se){const Rt=()=>{q.subTree=Ld(q),Se(ae,q.subTree,q,fe,null)};lt&&$t.__asyncHydrate?$t.__asyncHydrate(ae,q,Rt):Rt()}else{_t.ce&&_t.ce._hasShadowRoot()&&_t.ce._injectChildStyle($t,q.parent?q.parent.type:void 0);const Rt=q.subTree=Ld(q);m(null,Rt,he,oe,q,fe,W),ee.el=Rt.el}if(nt&&Rn(nt,fe),!lt&&(se=we&&we.onVnodeMounted)){const Rt=ee;Rn(()=>Fo(se,at,Rt),fe)}(ee.shapeFlag&256||at&&Ni(at.vnode)&&at.vnode.shapeFlag&256)&&q.a&&Rn(q.a,fe),q.isMounted=!0,ee=he=oe=null}};q.scope.on();const ge=q.effect=new Jd(re);q.scope.off();const xe=q.update=ge.run.bind(ge),$e=q.job=ge.runIfDirty.bind(ge);$e.i=q,$e.id=q.uid,ge.scheduler=()=>Z1($e),jr(q,!0),xe()},z=(q,ee,he)=>{ee.component=q;const oe=q.vnode.props;q.vnode=ee,q.next=null,DI(q,ee.props,oe,he),WI(q,ee.children,he),Pi(),Zy(q),Ri()},V=(q,ee,he,oe,fe,W,Y,re,ge=!1)=>{const xe=q&&q.children,$e=q?q.shapeFlag:0,se=ee.children,{patchFlag:ae,shapeFlag:we}=ee;if(ae>0){if(ae&128){K(xe,se,he,oe,fe,W,Y,re,ge);return}else if(ae&256){ne(xe,se,he,oe,fe,W,Y,re,ge);return}}we&8?($e&16&&ue(xe,fe,W),se!==xe&&u(he,se)):$e&16?we&16?K(xe,se,he,oe,fe,W,Y,re,ge):ue(xe,fe,W,!0):($e&8&&u(he,""),we&16&&v(se,he,oe,fe,W,Y,re,ge))},ne=(q,ee,he,oe,fe,W,Y,re,ge)=>{q=q||sa,ee=ee||sa;const xe=q.length,$e=ee.length,se=Math.min(xe,$e);let ae;for(ae=0;ae<se;ae++){const we=ee[ae]=ge?Ti(ee[ae]):Wo(ee[ae]);m(q[ae],we,he,null,fe,W,Y,re,ge)}xe>$e?ue(q,fe,W,!0,!1,se):v(ee,he,oe,fe,W,Y,re,ge,se)},K=(q,ee,he,oe,fe,W,Y,re,ge)=>{let xe=0;const $e=ee.length;let se=q.length-1,ae=$e-1;for(;xe<=se&&xe<=ae;){const we=q[xe],qe=ee[xe]=ge?Ti(ee[xe]):Wo(ee[xe]);if(qs(we,qe))m(we,qe,he,null,fe,W,Y,re,ge);else break;xe++}for(;xe<=se&&xe<=ae;){const we=q[se],qe=ee[ae]=ge?Ti(ee[ae]):Wo(ee[ae]);if(qs(we,qe))m(we,qe,he,null,fe,W,Y,re,ge);else break;se--,ae--}if(xe>se){if(xe<=ae){const we=ae+1,qe=we<$e?ee[we].el:oe;for(;xe<=ae;)m(null,ee[xe]=ge?Ti(ee[xe]):Wo(ee[xe]),he,qe,fe,W,Y,re,ge),xe++}}else if(xe>ae)for(;xe<=se;)X(q[xe],fe,W,!0),xe++;else{const we=xe,qe=xe,nt=new Map;for(xe=qe;xe<=ae;xe++){const Nt=ee[xe]=ge?Ti(ee[xe]):Wo(ee[xe]);Nt.key!=null&&nt.set(Nt.key,xe)}let at,_t=0;const $t=ae-qe+1;let lt=!1,Rt=0;const fn=new Array($t);for(xe=0;xe<$t;xe++)fn[xe]=0;for(xe=we;xe<=se;xe++){const Nt=q[xe];if(_t>=$t){X(Nt,fe,W,!0);continue}let Ft;if(Nt.key!=null)Ft=nt.get(Nt.key);else for(at=qe;at<=ae;at++)if(fn[at-qe]===0&&qs(Nt,ee[at])){Ft=at;break}Ft===void 0?X(Nt,fe,W,!0):(fn[Ft-qe]=xe+1,Ft>=Rt?Rt=Ft:lt=!0,m(Nt,ee[Ft],he,null,fe,W,Y,re,ge),_t++)}const An=lt?jI(fn):sa;for(at=An.length-1,xe=$t-1;xe>=0;xe--){const Nt=qe+xe,Ft=ee[Nt],jn=ee[Nt+1],Je=Nt+1<$e?jn.el||uS(jn):oe;fn[xe]===0?m(null,Ft,he,Je,fe,W,Y,re,ge):lt&&(at<0||xe!==An[at]?G(Ft,he,Je,2):at--)}}},G=(q,ee,he,oe,fe=null)=>{const{el:W,type:Y,transition:re,children:ge,shapeFlag:xe}=q;if(xe&6){G(q.component.subTree,ee,he,oe);return}if(xe&128){q.suspense.move(ee,he,oe);return}if(xe&64){Y.move(q,ee,he,Q);return}if(Y===Pe){o(W,ee,he);for(let se=0;se<ge.length;se++)G(ge[se],ee,he,oe);o(q.anchor,ee,he);return}if(Y===da){b(q,ee,he);return}if(oe!==2&&xe&1&&re)if(oe===0)re.persisted&&!W[Es]?o(W,ee,he):(re.beforeEnter(W),o(W,ee,he),Rn(()=>re.enter(W),fe));else{const{leave:se,delayLeave:ae,afterLeave:we}=re,qe=()=>{q.ctx.isUnmounted?s(W):o(W,ee,he)},nt=()=>{const at=W._isLeaving||!!W[Es];W._isLeaving&&W[Es](!0),re.persisted&&!at?qe():se(W,()=>{qe(),we&&we()})};ae?ae(W,qe,nt):nt()}else o(W,ee,he)},X=(q,ee,he,oe=!1,fe=!1)=>{const{type:W,props:Y,ref:re,children:ge,dynamicChildren:xe,shapeFlag:$e,patchFlag:se,dirs:ae,cacheIndex:we,memo:qe}=q;if(se===-2&&(fe=!1),re!=null&&(Pi(),aa(re,null,he,q,!0),Ri()),we!=null&&(ee.renderCache[we]=void 0),$e&256){ee.ctx.deactivate(q);return}const nt=$e&1&&ae,at=!Ni(q);let _t;if(at&&(_t=Y&&Y.onVnodeBeforeUnmount)&&Fo(_t,ee,q),$e&6)We(q.component,he,oe);else{if($e&128){q.suspense.unmount(he,oe);return}nt&&ri(q,null,ee,"beforeUnmount"),$e&64?q.type.remove(q,ee,he,Q,oe):xe&&!xe.hasOnce&&(W!==Pe||se>0&&se&64)?ue(xe,ee,he,!1,!0):(W===Pe&&se&384||!fe&&$e&16)&&ue(ge,ee,he),oe&&be(q)}const $t=qe!=null&&we==null;(at&&(_t=Y&&Y.onVnodeUnmounted)||nt||$t)&&Rn(()=>{_t&&Fo(_t,ee,q),nt&&ri(q,null,ee,"unmounted"),$t&&(q.el=null)},he)},be=q=>{const{type:ee,el:he,anchor:oe,transition:fe}=q;if(ee===Pe){le(he,oe);return}if(ee===da){y(q);return}const W=()=>{s(he),fe&&!fe.persisted&&fe.afterLeave&&fe.afterLeave()};if(q.shapeFlag&1&&fe&&!fe.persisted){const{leave:Y,delayLeave:re}=fe,ge=()=>Y(he,W);re?re(q.el,W,ge):ge()}else W()},le=(q,ee)=>{let he;for(;q!==ee;)he=f(q),s(q),q=he;s(ee)},We=(q,ee,he)=>{const{bum:oe,scope:fe,job:W,subTree:Y,um:re,m:ge,a:xe}=q;cf(ge),cf(xe),oe&&ra(oe),fe.stop(),W&&(W.flags|=8,X(Y,q,ee,he)),re&&Rn(re,ee),Rn(()=>{q.isUnmounted=!0},ee)},ue=(q,ee,he,oe=!1,fe=!1,W=0)=>{for(let Y=W;Y<q.length;Y++)X(q[Y],ee,he,oe,fe)},ve=q=>{if(q.shapeFlag&6)return ve(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const ee=f(q.anchor||q.el),he=ee&&ee[DC];return he?f(he):ee};let Ne=!1;const Re=(q,ee,he)=>{let oe;q==null?ee._vnode&&(X(ee._vnode,null,null,!0),oe=ee._vnode.component):m(ee._vnode||null,q,ee,null,null,null,he),ee._vnode=q,Ne||(Ne=!0,Zy(oe),rf(),Ne=!1)},Q={p:m,um:X,m:G,r:be,mt:R,mc:v,pc:V,pbc:$,n:ve,o:e};let ce,Se;return t&&([ce,Se]=t(Q)),{render:Re,hydrate:ce,createApp:EI(Re,ce)}}function cm({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 jr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function aS(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function av(e,t,n=!1){const o=e.children,s=t.children;if(ut(o)&&ut(s))for(let i=0;i<o.length;i++){const r=o[i];let l=s[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[i]=Ti(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&av(r,l)),l.type===gr&&(l.patchFlag===-1&&(l=s[i]=Ti(l)),l.el=r.el),l.type===Bn&&!l.el&&(l.el=r.el)}}function jI(e){const t=e.slice(),n=[0];let o,s,i,r,l;const a=e.length;for(o=0;o<a;o++){const c=e[o];if(c!==0){if(s=n[n.length-1],e[s]<c){t[o]=s,n.push(o);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function cS(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:cS(t)}function cf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function uS(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?uS(t.subTree):null}const uf=e=>e.__isSuspense;let Ig=0;const zI={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)VI(t,n,o,s,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}KI(e,t,n,o,s,r,l,a,c)}},hydrate:GI,normalize:YI},Spe=zI;function zc(e,t){const n=e.props&&e.props[t];wt(n)&&n()}function VI(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=dS(e,s,o,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,o,f,i,r),f.deps>0?(zc(e,"onPending"),zc(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),ua(f,e.ssFallback)):f.resolve(!1,!0)}function KI(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,g=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:_,isHydrating:w}=d;if(m)d.pendingBranch=f,qs(m,f)?(a(m,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():_&&(w||(a(h,g,n,o,s,null,i,r,l),ua(d,g)))):(d.pendingId=Ig++,w?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),_?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(h,g,n,o,s,null,i,r,l),ua(d,g))):h&&qs(h,f)?(a(h,f,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(h&&qs(h,f))a(h,f,n,o,s,d,i,r,l),ua(d,f);else if(zc(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Ig++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:k,pendingId:b}=d;k>0?setTimeout(()=>{d.pendingId===b&&d.fallback(g)},k):k===0&&d.fallback(g)}}function dS(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:g,n:h,o:{parentNode:m,remove:_}}=c;let w;const k=XI(e);k&&t&&t.pendingBranch&&(w=t.pendingId,t.deps++);const b=e.props?Zd(e.props.timeout):void 0,y=i,x={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:Ig++,timeout:typeof b=="number"?b:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(L=!1,N=!1){const{vnode:v,activeBranch:M,pendingBranch:$,pendingId:P,effects:T,parentComponent:I,container:R,isInFallback:D}=x;let F=!1;if(x.isHydrating)x.isHydrating=!1;else if(!L){F=M&&$.transition&&$.transition.mode==="out-in";let ne=!1;F&&(M.transition.afterLeave=()=>{P===x.pendingId&&(f($,R,i===y&&!ne?h(M):i,0),sf(T),D&&v.ssFallback&&(v.ssFallback.el=null))}),M&&!x.isFallbackMountPending&&(m(M.el)===R&&(i=h(M),ne=!0),g(M,I,x,!0),!F&&D&&v.ssFallback&&Rn(()=>v.ssFallback.el=null,x)),F||f($,R,i,0)}x.isFallbackMountPending=!1,ua(x,$),x.pendingBranch=null,x.isInFallback=!1;let z=x.parent,V=!1;for(;z;){if(z.pendingBranch){z.effects.push(...T),V=!0;break}z=z.parent}!V&&!F&&sf(T),x.effects=[],k&&t&&t.pendingBranch&&w===t.pendingId&&(t.deps--,t.deps===0&&!N&&t.resolve()),zc(v,"onResolve")},fallback(L){if(!x.pendingBranch)return;const{vnode:N,activeBranch:v,parentComponent:M,container:$,namespace:P}=x;zc(N,"onFallback");const T=h(v),I=()=>{x.isFallbackMountPending=!1,x.isInFallback&&(d(null,L,$,T,M,null,P,l,a),ua(x,L))},R=L.transition&&L.transition.mode==="out-in";R&&(x.isFallbackMountPending=!0,v.transition.afterLeave=I),x.isInFallback=!0,g(v,M,null,!0),R||I()},move(L,N,v){x.activeBranch&&f(x.activeBranch,L,N,v),x.container=L},next(){return x.activeBranch&&h(x.activeBranch)},registerDep(L,N,v){const M=!!x.pendingBranch;M&&x.deps++;const $=L.vnode.el;L.asyncDep.catch(P=>{Ma(P,L,0)}).then(P=>{if(L.isUnmounted||x.isUnmounted||x.pendingId!==L.suspenseId)return;Vc(),L.asyncResolved=!0;const{vnode:T}=L;$g(L,P,!1),$&&(T.el=$);const I=!$&&L.subTree.el;N(L,T,m($||L.subTree.el),$?null:h(L.subTree),x,r,v),I&&(T.placeholder=null,_(I)),_h(L,T.el),M&&--x.deps===0&&x.resolve()})},unmount(L,N){x.isUnmounted=!0,x.activeBranch&&g(x.activeBranch,n,L,N),x.pendingBranch&&g(x.pendingBranch,n,L,N)}};return x}function GI(e,t,n,o,s,i,r,l,a){const c=t.suspense=dS(t,o,n,e.parentNode,document.createElement("div"),null,s,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function YI(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=fk(o?n.default:n),e.ssFallback=o?fk(n.fallback):vt(Bn)}function fk(e){let t;if(wt(e)){const n=fl&&e._c;n&&(e._d=!1,C()),e=e(),n&&(e._d=!0,t=bo,hS())}return ut(e)&&(e=NI(e)),e=Wo(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function fS(e,t){t&&t.pendingBranch?ut(e)?t.effects.push(...e):t.effects.push(e):sf(e)}function ua(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,_h(o,s))}function XI(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),gr=Symbol.for("v-txt"),Bn=Symbol.for("v-cmt"),da=Symbol.for("v-stc"),Sc=[];let bo=null;function C(e=!1){Sc.push(bo=e?null:[])}function hS(){Sc.pop(),bo=Sc[Sc.length-1]||null}let fl=1;function df(e,t=!1){fl+=e,e<0&&bo&&t&&(bo.hasOnce=!0)}function pS(e){return e.dynamicChildren=fl>0?bo||sa:null,hS(),fl>0&&bo&&bo.push(e),e}function E(e,t,n,o,s,i){return pS(p(e,t,n,o,s,i,!0))}function Ve(e,t,n,o,s){return pS(vt(e,t,n,o,s,!0))}function wr(e){return e?e.__v_isVNode===!0:!1}function qs(e,t){return e.type===t.type&&e.key===t.key}function xpe(e){}const mS=({key:e})=>e??null,Od=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?sn(e)||Ln(e)||wt(e)?{i:uo,r:e,k:t,f:!!n}:e:null);function p(e,t=null,n=null,o=0,s=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mS(t),ref:t&&Od(t),scopeId:kh,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:uo};return l?(cv(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=sn(n)?8:16),fl>0&&!r&&bo&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&bo.push(a),a}const vt=QI;function QI(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===VC)&&(e=Bn),wr(e)){const l=Bi(e,t,!0);return n&&cv(l,n),fl>0&&!i&&bo&&(l.shapeFlag&6?bo[bo.indexOf(e)]=l:bo.push(l)),l.patchFlag=-2,l}if(o$(e)&&(e=e.__vccOpts),t){t=ZI(t);let{class:l,style:a}=t;l&&!sn(l)&&(t.class=Oe(l)),Gt(a)&&(yh(a)&&!ut(a)&&(a=tn({},a)),t.style=Wt(a))}const r=sn(e)?1:uf(e)?128:BC(e)?64:Gt(e)?4:wt(e)?2:0;return p(e,t,n,o,s,r,i,!0)}function ZI(e){return e?yh(e)||tS(e)?tn({},e):e:null}function Bi(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?en(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&mS(c),ref:t&&t.ref?n&&i?ut(i)?i.concat(Od(t)):[i,Od(t)]:Od(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Pe?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Bi(e.ssContent),ssFallback:e.ssFallback&&Bi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&br(u,a.clone(u)),u}function ft(e=" ",t=0){return vt(gr,null,e,t)}function _r(e,t){const n=vt(da,null,e);return n.staticCount=t,n}function ie(e="",t=!1){return t?(C(),Ve(Bn,null,e)):vt(Bn,null,e)}function Wo(e){return e==null||typeof e=="boolean"?vt(Bn):ut(e)?vt(Pe,null,e.slice()):wr(e)?Ti(e):vt(gr,null,String(e))}function Ti(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Bi(e)}function cv(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(ut(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),cv(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!tS(t)?t._ctx=uo:s===3&&uo&&(uo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else wt(t)?(t={default:t,_ctx:uo},n=32):(t=String(t),o&64?(n=16,t=[ft(t)]):n=8);e.children=t,e.shapeFlag|=n}function en(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=Oe([t.class,o.class]));else if(s==="style")t.style=Wt([t.style,o.style]);else if(du(s)){const i=t[s],r=o[s];r&&i!==r&&!(ut(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!rh(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Fo(e,t,n,o=null){Rs(e,t,7,[n,o])}const JI=YC();let e$=0;function gS(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||JI,i={uid:e$++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new dC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:oS(o,s),emitsOptions:QC(o,s),emit:null,emitted:null,propsDefaults:Pt,inheritAttrs:o.inheritAttrs,ctx:Pt,data:Pt,props:Pt,attrs:Pt,slots:Pt,refs:Pt,setupState:Pt,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=II.bind(null,i),e.ce&&e.ce(i),i}let co=null;const fo=()=>co||uo;let ff,fa;{const e=fh(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};ff=t("__VUE_INSTANCE_SETTERS__",n=>co=n),fa=t("__VUE_SSR_SETTERS__",n=>hl=n)}const Ea=e=>{const t=co;return ff(e),e.scope.on(),()=>{e.scope.off(),ff(t)}},Vc=()=>{co&&co.scope.off(),ff(null)};function vS(e){return e.vnode.shapeFlag&4}let hl=!1;function yS(e,t=!1,n=!1){t&&fa(t);const{props:o,children:s}=e.vnode,i=vS(e);RI(e,o,i,t),HI(e,s,n||t);const r=i?t$(e,t):void 0;return t&&fa(!1),r}function t$(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Tg);const{setup:o}=n;if(o){Pi();const s=e.setupContext=o.length>1?bS(e):null,i=Ea(e),r=fu(o,e,0,[e.props,s]),l=V1(r);if(Ri(),i(),(l||e.sp)&&!Ni(e)&&ev(e),l){if(r.then(Vc,Vc),t)return r.then(a=>{$g(e,a,t)}).catch(a=>{Ma(a,e,0)});e.asyncDep=r}else $g(e,r,t)}else kS(e,t)}function $g(e,t,n){wt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Gt(t)&&(e.setupState=EC(t)),kS(e,n)}let hf,Ng;function Tpe(e){hf=e,Ng=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,_I))}}const Ape=()=>!hf;function kS(e,t,n){const o=e.type;if(!e.render){if(!t&&hf&&!o.render){const s=o.template||iv(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=tn(tn({isCustomElement:i,delimiters:l},r),a);o.render=hf(s,c)}}e.render=o.render||Os,Ng&&Ng(e)}{const s=Ea(e);Pi();try{CI(e)}finally{Ri(),s()}}}const n$={get(e,t){return yo(e,"get",""),e[t]}};function bS(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,n$),slots:e.slots,emit:e.emit,expose:t}}function gu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(EC(fr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Cc)return Cc[n](e)},has(t,n){return n in t||n in Cc}})):e.proxy}function Lg(e,t=!0){return wt(e)?e.displayName||e.name:e.name||t&&e.__name}function o$(e){return wt(e)&&"__vccOpts"in e}const H=(e,t)=>FE(e,t,hl);function Zt(e,t,n){try{df(-1);const o=arguments.length;return o===2?Gt(t)&&!ut(t)?wr(t)?vt(e,null,[t]):vt(e,t):vt(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&wr(n)&&(n=[n]),vt(e,t,n))}finally{df(1)}}function Mpe(){}function Epe(e,t,n,o){const s=n[o];if(s&&s$(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function s$(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(ao(n[o],t[o]))return!1;return fl>0&&bo&&bo.push(e),!0}const i$="3.5.35",Ipe=Os,$pe=jE,Npe=Gl,Lpe=PC,r$={createComponentInstance:gS,setupComponent:yS,renderComponentRoot:Ld,setCurrentRenderingInstance:Uc,isVNode:wr,normalizeVNode:Wo,getComponentPublicInstance:gu,ensureValidVNode:sv,pushWarningContext:UE,popWarningContext:qE},Ope=r$,Ppe=null,Rpe=null,Dpe=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let Og;const hk=typeof window<"u"&&window.trustedTypes;if(hk)try{Og=hk.createPolicy("vue",{createHTML:e=>e})}catch{}const wS=Og?e=>Og.createHTML(e):e=>e,l$="http://www.w3.org/2000/svg",a$="http://www.w3.org/1998/Math/MathML",Si=typeof document<"u"?document:null,pk=Si&&Si.createElement("template"),c$={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?Si.createElementNS(l$,e):t==="mathml"?Si.createElementNS(a$,e):n?Si.createElement(e,{is:n}):Si.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>Si.createTextNode(e),createComment:e=>Si.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Si.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{pk.innerHTML=wS(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=pk.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Zi="transition",oc="animation",wa=Symbol("_vtc"),_S={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},CS=tn({},HC,_S),u$=e=>(e.displayName="Transition",e.props=CS,e),Fi=u$((e,{slots:t})=>Zt(nI,SS(e),t)),zr=(e,t=[])=>{ut(e)?e.forEach(n=>n(...t)):e&&e(...t)},mk=e=>e?ut(e)?e.some(t=>t.length>1):e.length>1:!1;function SS(e){const t={};for(const T in e)T in _S||(t[T]=e[T]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:g=`${n}-leave-to`}=e,h=d$(s),m=h&&h[0],_=h&&h[1],{onBeforeEnter:w,onEnter:k,onEnterCancelled:b,onLeave:y,onLeaveCancelled:x,onBeforeAppear:L=w,onAppear:N=k,onAppearCancelled:v=b}=t,M=(T,I,R,D)=>{T._enterCancelled=D,ir(T,I?u:l),ir(T,I?c:r),R&&R()},$=(T,I)=>{T._isLeaving=!1,ir(T,d),ir(T,g),ir(T,f),I&&I()},P=T=>(I,R)=>{const D=T?N:k,F=()=>M(I,T,R);zr(D,[I,F]),gk(()=>{ir(I,T?a:i),oi(I,T?u:l),mk(D)||vk(I,o,m,F)})};return tn(t,{onBeforeEnter(T){zr(w,[T]),oi(T,i),oi(T,r)},onBeforeAppear(T){zr(L,[T]),oi(T,a),oi(T,c)},onEnter:P(!1),onAppear:P(!0),onLeave(T,I){T._isLeaving=!0;const R=()=>$(T,I);oi(T,d),T._enterCancelled?(oi(T,f),Pg(T)):(Pg(T),oi(T,f)),gk(()=>{T._isLeaving&&(ir(T,d),oi(T,g),mk(y)||vk(T,o,_,R))}),zr(y,[T,R])},onEnterCancelled(T){M(T,!1,void 0,!0),zr(b,[T])},onAppearCancelled(T){M(T,!0,void 0,!0),zr(v,[T])},onLeaveCancelled(T){$(T),zr(x,[T])}})}function d$(e){if(e==null)return null;if(Gt(e))return[um(e.enter),um(e.leave)];{const t=um(e);return[t,t]}}function um(e){return Zd(e)}function oi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[wa]||(e[wa]=new Set)).add(t)}function ir(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[wa];n&&(n.delete(t),n.size||(e[wa]=void 0))}function gk(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let f$=0;function vk(e,t,n,o){const s=e._endId=++f$,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=xS(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=g=>{g.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function xS(e,t){const n=window.getComputedStyle(e),o=h=>(n[h]||"").split(", "),s=o(`${Zi}Delay`),i=o(`${Zi}Duration`),r=yk(s,i),l=o(`${oc}Delay`),a=o(`${oc}Duration`),c=yk(l,a);let u=null,d=0,f=0;t===Zi?r>0&&(u=Zi,d=r,f=i.length):t===oc?c>0&&(u=oc,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Zi:oc:null,f=u?u===Zi?i.length:a.length:0);const g=u===Zi&&/\b(?:transform|all)(?:,|$)/.test(o(`${Zi}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:g}}function yk(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>kk(n)+kk(e[o])))}function kk(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Pg(e){return(e?e.ownerDocument:document).body.offsetHeight}function h$(e,t,n){const o=e[wa];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const pf=Symbol("_vod"),TS=Symbol("_vsh"),js={name:"show",beforeMount(e,{value:t},{transition:n}){e[pf]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):sc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),sc(e,!0),o.enter(e)):o.leave(e,()=>{sc(e,!1)}):sc(e,t))},beforeUnmount(e,{value:t}){sc(e,t)}};function sc(e,t){e.style.display=t?e[pf]:"none",e[TS]=!t}function p$(){js.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const AS=Symbol("");function Bpe(e){const t=fo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>mf(i,s))},o=()=>{const s=e(t.proxy);t.ce?mf(t.ce,s):Rg(t.subTree,s),n(s)};zC(()=>{sf(o)}),rn(()=>{ze(o,Os,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),Yt(()=>s.disconnect())})}function Rg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Rg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)mf(e.el,t);else if(e.type===Pe)e.children.forEach(n=>Rg(n,t));else if(e.type===da){let{el:n,anchor:o}=e;for(;n&&(mf(n,t),n!==o);)n=n.nextSibling}}function mf(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=dE(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[AS]=o}}const m$=/(?:^|;)\s*display\s*:/;function g$(e,t,n){const o=e.style,s=sn(n);let i=!1;if(n&&!s){if(t)if(sn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&hc(o,l,"")}else for(const r in t)n[r]==null&&hc(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?y$(e,r,!sn(t)&&t?t[r]:void 0,l)||hc(o,r,l):hc(o,r,"")}}else if(s){if(t!==n){const r=o[AS];r&&(n+=";"+r),o.cssText=n,i=m$.test(n)}}else t&&e.removeAttribute("style");pf in e&&(e[pf]=i?o.display:"",e[TS]&&(o.display="none"))}const bk=/\s*!important$/;function hc(e,t,n){if(ut(n))n.forEach(o=>hc(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=v$(e,t);bk.test(n)?e.setProperty(Uo(o),n.replace(bk,""),"important"):e[o]=n}}const wk=["Webkit","Moz","ms"],dm={};function v$(e,t){const n=dm[t];if(n)return n;let o=Xn(t);if(o!=="filter"&&o in e)return dm[t]=o;o=uh(o);for(let s=0;s<wk.length;s++){const i=wk[s]+o;if(i in e)return dm[t]=i}return t}function y$(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&sn(o)&&n===o}const _k="http://www.w3.org/1999/xlink";function Ck(e,t,n,o,s,i=cE(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(_k,t.slice(6,t.length)):e.setAttributeNS(_k,t,n):n==null||i&&!aC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":gs(n)?String(n):n)}function Sk(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?wS(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=aC(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function Ei(e,t,n,o){e.addEventListener(t,n,o)}function k$(e,t,n,o){e.removeEventListener(t,n,o)}const xk=Symbol("_vei");function b$(e,t,n,o,s=null){const i=e[xk]||(e[xk]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=w$(t);if(o){const c=i[t]=S$(o,s);Ei(e,l,c,a)}else r&&(k$(e,l,r,a),i[t]=void 0)}}const Tk=/(?:Once|Passive|Capture)$/;function w$(e){let t;if(Tk.test(e)){t={};let o;for(;o=e.match(Tk);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Uo(e.slice(2)),t]}let fm=0;const _$=Promise.resolve(),C$=()=>fm||(_$.then(()=>fm=0),fm=Date.now());function S$(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(ut(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),l=[o];for(let a=0;a<r.length&&!o._stopped;a++){const c=r[a];c&&Rs(c,t,5,l)}}else Rs(s,t,5,[o])};return n.value=e,n.attached=C$(),n}const Ak=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,x$=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?h$(e,o,r):t==="style"?g$(e,n,o):du(t)?rh(t)||b$(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):T$(e,t,o,r))?(Sk(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ck(e,t,o,r,i,t!=="value")):e._isVueCE&&(A$(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!sn(o)))?Sk(e,Xn(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Ck(e,t,o,r))};function T$(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ak(t)&&wt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Ak(t)&&sn(n)?!1:t in e}function A$(e,t){const n=e._def.props;if(!n)return!1;const o=Xn(t);return Array.isArray(n)?n.some(s=>Xn(s)===o):Object.keys(n).some(s=>Xn(s)===o)}const Mk={};function M$(e,t,n){let o=Qe(e,t);lh(o)&&(o=tn({},o,t));class s extends uv{constructor(r){super(o,r,n)}}return s.def=o,s}const Fpe=((e,t)=>M$(e,t,j$)),E$=typeof HTMLElement<"u"?HTMLElement:class{};class uv extends E${constructor(t,n={},o=kf){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&o!==kf?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(tn({},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 uv){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,ht(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!ut(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Zd(this._props[a])),(l||(l=Object.create(null)))[Xn(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(r),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)Kt(this,o)||Object.defineProperty(this,o,{get:()=>S(n[o])})}_resolveProps(t){const{props:n}=t,o=ut(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(Xn))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):Mk;const s=Xn(t);n&&this._numberProps&&this._numberProps[s]&&(o=Zd(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Mk?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Uo(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Uo(t),n+""):n||this.removeAttribute(Uo(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),q$(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=vt(this._def,tn(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(i,r)=>{this.dispatchEvent(new CustomEvent(i,lh(r[0])?tn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),Uo(i)!==i&&s(Uo(i),r)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,r=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(o||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const o=t.childNodes[n];if(!(o instanceof HTMLStyleElement))return o}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const s=t[o],i=s.getAttribute("name")||"default",r=this._slots[i],l=s.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,s)}else for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const s=o.querySelectorAll("slot");for(let i=0;i<s.length;i++)n.add(s[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function I$(e){const t=fo(),n=t&&t.ce;return n||null}function Hpe(){const e=I$();return e&&e.shadowRoot}function Wpe(e="$style"){{const t=fo();if(!t)return Pt;const n=t.type.__cssModules;if(!n)return Pt;const o=n[e];return o||Pt}}const MS=new WeakMap,ES=new WeakMap,gf=Symbol("_moveCb"),Ek=Symbol("_enterCb"),$$=e=>(delete e.props.mode,e),N$=$$({name:"TransitionGroup",props:tn({},CS,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=fo(),o=FC();let s,i;return tv(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!R$(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(L$),s.forEach(O$);const l=s.filter(P$);Pg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;oi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[gf]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[gf]=null,ir(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=Ht(e),l=SS(r);let a=r.tag||Pe;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),br(u,qc(u,l,o,n)),MS.set(u,IS(u.el)))}i=t.default?J1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&br(u,qc(u,l,o,n))}return vt(a,null,i)}}}),Upe=N$;function L$(e){const t=e.el;t[gf]&&t[gf](),t[Ek]&&t[Ek]()}function O$(e){ES.set(e,IS(e.el))}function P$(e){const t=MS.get(e),n=ES.get(e),o=t.left-n.left,s=t.top-n.top;if(o||s){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${o/a}px,${s/c}px)`,r.transitionDuration="0s",e}}function IS(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function R$(e,t,n){const o=e.cloneNode(),s=e[wa];s&&s.forEach(l=>{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=xS(o);return i.removeChild(o),r}const Cr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ut(t)?n=>ra(t,n):t};function D$(e){e.target.composing=!0}function Ik(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ps=Symbol("_assign");function $k(e,t,n){return t&&(e=e.trim()),n&&(e=dh(e)),e}const Wn={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[Ps]=Cr(s);const i=o||s.props&&s.props.type==="number";Ei(e,t?"change":"input",r=>{r.target.composing||e[Ps]($k(e.value,n,i))}),(n||i)&&Ei(e,"change",()=>{e.value=$k(e.value,n,i)}),t||(Ei(e,"compositionstart",D$),Ei(e,"compositionend",Ik),Ei(e,"change",Ik))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[Ps]=Cr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?dh(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},vf={deep:!0,created(e,t,n){e[Ps]=Cr(n),Ei(e,"change",()=>{const o=e._modelValue,s=_a(e),i=e.checked,r=e[Ps];if(ut(o)){const l=hh(o,s),a=l!==-1;if(i&&!a)r(o.concat(s));else if(!i&&a){const c=[...o];c.splice(l,1),r(c)}}else if(ml(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(NS(e,i))})},mounted:Nk,beforeUpdate(e,t,n){e[Ps]=Cr(n),Nk(e,t,n)}};function Nk(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(ut(t))s=hh(t,o.props.value)>-1;else if(ml(t))s=t.has(o.props.value);else{if(t===n)return;s=Oi(t,NS(e,!0))}e.checked!==s&&(e.checked=s)}const $S={created(e,{value:t},n){e.checked=Oi(t,n.props.value),e[Ps]=Cr(n),Ei(e,"change",()=>{e[Ps](_a(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[Ps]=Cr(o),t!==n&&(e.checked=Oi(t,o.props.value))}},yf={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=ml(t);Ei(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?dh(_a(r)):_a(r));e[Ps](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,ht(()=>{e._assigning=!1})}),e[Ps]=Cr(o)},mounted(e,{value:t}){Lk(e,t)},beforeUpdate(e,t,n){e[Ps]=Cr(n)},updated(e,{value:t}){e._assigning||Lk(e,t)}};function Lk(e,t){const n=e.multiple,o=ut(t);if(!(n&&!o&&!ml(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=_a(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=hh(t,l)>-1}else r.selected=t.has(l);else if(Oi(_a(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function _a(e){return"_value"in e?e._value:e.value}function NS(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const B$={created(e,t,n){rd(e,t,n,null,"created")},mounted(e,t,n){rd(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){rd(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){rd(e,t,n,o,"updated")}};function LS(e,t){switch(e){case"SELECT":return yf;case"TEXTAREA":return Wn;default:switch(t){case"checkbox":return vf;case"radio":return $S;default:return Wn}}}function rd(e,t,n,o,s){const r=LS(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function F$(){Wn.getSSRProps=({value:e})=>({value:e}),$S.getSSRProps=({value:e},t)=>{if(t.props&&Oi(t.props.value,e))return{checked:!0}},vf.getSSRProps=({value:e},t)=>{if(ut(e)){if(t.props&&hh(e,t.props.value)>-1)return{checked:!0}}else if(ml(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},B$.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=LS(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const H$=["ctrl","shift","alt","meta"],W$={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)=>H$.some(n=>e[`${n}Key`]&&!t.includes(n))},Ze=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r<t.length;r++){const l=W$[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},U$={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ns=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=Uo(s.key);if(t.some(r=>r===i||U$[r]===i))return e(s)}))},OS=tn({patchProp:x$},c$);let xc,Ok=!1;function PS(){return xc||(xc=UI(OS))}function RS(){return xc=Ok?xc:qI(OS),Ok=!0,xc}const q$=((...e)=>{PS().render(...e)}),qpe=((...e)=>{RS().hydrate(...e)}),kf=((...e)=>{const t=PS().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=BS(o);if(!s)return;const i=t._component;!wt(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,DS(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),j$=((...e)=>{const t=RS().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=BS(o);if(s)return n(s,!0,DS(s))},t});function DS(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function BS(e){return sn(e)?document.querySelector(e):e}let Pk=!1;const jpe=()=>{Pk||(Pk=!0,F$(),p$())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function z$(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const bf=typeof window<"u",Mr=(e,t=!1)=>t?Symbol.for(e):Symbol(e),V$=(e,t,n)=>K$({l:e,k:t,s:n}),K$=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Hn=e=>typeof e=="number"&&isFinite(e),FS=e=>fv(e)==="[object Date]",Ca=e=>fv(e)==="[object RegExp]",Ch=e=>Dt(e)&&Object.keys(e).length===0,Un=Object.assign,G$=Object.create,on=(e=null)=>G$(e);let Rk;const ol=()=>Rk||(Rk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:on());function Dk(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function Y$(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const X$=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,Q$=/^(?:href|src|action|formaction)$/i;function dv(e){return X$.test(e)}function Z$(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const f=e[l];if(c){f===c&&(c=null);continue}if(f==='"'||f==="'")c=f;else if(f==="(")a++;else if(f===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(o,i),n+=dv(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function Bk(e,t){if(Q$.test(e)&&dv(t))return"about:blank";const n=e.toLowerCase()==="style"?Z$(t):t;return Y$(n)}function J$(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${Bk(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${Bk(o,s)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,o,s)=>dv(s)?`${o}about:blank`:n),e}const e4=Object.prototype.hasOwnProperty;function Ls(e,t){return e4.call(e,t)}const En=Array.isArray,kn=e=>typeof e=="function",rt=e=>typeof e=="string",qt=e=>typeof e=="boolean",zt=e=>e!==null&&typeof e=="object",t4=e=>zt(e)&&kn(e.then)&&kn(e.catch),HS=Object.prototype.toString,fv=e=>HS.call(e),Dt=e=>fv(e)==="[object Object]",n4=e=>e==null?"":En(e)||Dt(e)&&e.toString===HS?JSON.stringify(e,null,2):String(e);function hv(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const ld=e=>!zt(e)||En(e);function Pd(e,t){if(ld(e)||ld(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(i=>{i!=="__proto__"&&(zt(o[i])&&!zt(s[i])&&(s[i]=Array.isArray(o[i])?[]:on()),ld(s[i])||ld(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*!
|
|
25
|
-
* message-compiler v11.4.5
|
|
26
|
-
* (c) 2026 kazuya kawaguchi
|
|
27
|
-
* Released under the MIT License.
|
|
28
|
-
*/function o4(e,t,n){return{line:e,column:t,offset:n}}function Dg(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},s4=17;function Sh(e,t,n={}){const{domain:o,messages:s,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=o,l}function i4(e){throw e}const ti=" ",r4="\r",go=`
|
|
29
|
-
`,l4="\u2028",a4="\u2029";function c4(e){const t=e;let n=0,o=1,s=1,i=0;const r=N=>t[N]===r4&&t[N+1]===go,l=N=>t[N]===go,a=N=>t[N]===a4,c=N=>t[N]===l4,u=N=>r(N)||l(N)||a(N)||c(N),d=()=>n,f=()=>o,g=()=>s,h=()=>i,m=N=>r(N)||a(N)||c(N)?go:t[N],_=()=>m(n),w=()=>m(n+i);function k(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function b(){return r(n+i)&&i++,i++,t[n+i]}function y(){n=0,o=1,s=1,i=0}function x(N=0){i=N}function L(){const N=n+i;for(;N!==n;)k();i=0}return{index:d,line:f,column:g,peekOffset:h,charAt:m,currentChar:_,currentPeek:w,next:k,peek:b,reset:y,resetPeek:x,skipToPeek:L}}const Ci=void 0,u4=".",Fk="'",d4="tokenizer";function f4(e,t={}){const n=t.location!==!1,o=c4(e),s=()=>o.index(),i=()=>o4(o.line(),o.column(),o.index()),r=i(),l=s(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(W,Y,re,...ge){const xe=c();if(Y.column+=re,Y.offset+=re,u){const $e=n?Dg(xe.startLoc,Y):null,se=Sh(W,$e,{domain:d4,args:ge});u(se)}}function f(W,Y,re){W.endLoc=i(),W.currentType=Y;const ge={type:Y};return n&&(ge.loc=Dg(W.startLoc,W.endLoc)),re!=null&&(ge.value=re),ge}const g=W=>f(W,13);function h(W,Y){return W.currentChar()===Y?(W.next(),Y):(d(Qt.EXPECTED_TOKEN,i(),0,Y),"")}function m(W){let Y="";for(;W.currentPeek()===ti||W.currentPeek()===go;)Y+=W.currentPeek(),W.peek();return Y}function _(W){const Y=m(W);return W.skipToPeek(),Y}function w(W){if(W===Ci)return!1;const Y=W.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y===95}function k(W){if(W===Ci)return!1;const Y=W.charCodeAt(0);return Y>=48&&Y<=57}function b(W,Y){const{currentType:re}=Y;if(re!==2)return!1;m(W);const ge=w(W.currentPeek());return W.resetPeek(),ge}function y(W,Y){const{currentType:re}=Y;if(re!==2)return!1;m(W);const ge=W.currentPeek()==="-"?W.peek():W.currentPeek(),xe=k(ge);return W.resetPeek(),xe}function x(W,Y){const{currentType:re}=Y;if(re!==2)return!1;m(W);const ge=W.currentPeek()===Fk;return W.resetPeek(),ge}function L(W,Y){const{currentType:re}=Y;if(re!==7)return!1;m(W);const ge=W.currentPeek()===".";return W.resetPeek(),ge}function N(W,Y){const{currentType:re}=Y;if(re!==8)return!1;m(W);const ge=w(W.currentPeek());return W.resetPeek(),ge}function v(W,Y){const{currentType:re}=Y;if(!(re===7||re===11))return!1;m(W);const ge=W.currentPeek()===":";return W.resetPeek(),ge}function M(W,Y){const{currentType:re}=Y;if(re!==9)return!1;const ge=()=>{const $e=W.currentPeek();return $e==="{"?w(W.peek()):$e==="@"||$e==="|"||$e===":"||$e==="."||$e===ti||!$e?!1:$e===go?(W.peek(),ge()):P(W,!1)},xe=ge();return W.resetPeek(),xe}function $(W){m(W);const Y=W.currentPeek()==="|";return W.resetPeek(),Y}function P(W,Y=!0){const re=(xe=!1,$e="")=>{const se=W.currentPeek();return se==="{"||se==="@"||!se?xe:se==="|"?!($e===ti||$e===go):se===ti?(W.peek(),re(!0,ti)):se===go?(W.peek(),re(!0,go)):!0},ge=re();return Y&&W.resetPeek(),ge}function T(W,Y){const re=W.currentChar();return re===Ci?Ci:Y(re)?(W.next(),re):null}function I(W){const Y=W.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36}function R(W){return T(W,I)}function D(W){const Y=W.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36||Y===45}function F(W){return T(W,D)}function z(W){const Y=W.charCodeAt(0);return Y>=48&&Y<=57}function V(W){return T(W,z)}function ne(W){const Y=W.charCodeAt(0);return Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102}function K(W){return T(W,ne)}function G(W){let Y="",re="";for(;Y=V(W);)re+=Y;return re}function X(W){let Y="";for(;;){const re=W.currentChar();if(re==="\\"){const ge=W.peek();ge==="{"||ge==="}"||ge==="@"||ge==="|"||ge==="\\"?(Y+=re+ge,W.next(),W.next()):(W.resetPeek(),Y+=re,W.next())}else{if(re==="{"||re==="}"||re==="@"||re==="|"||!re)break;if(re===ti||re===go)if(P(W))Y+=re,W.next();else{if($(W))break;Y+=re,W.next()}else Y+=re,W.next()}}return Y}function be(W){_(W);let Y="",re="";for(;Y=F(W);)re+=Y;const ge=W.currentChar();if(ge&&ge!=="}"&&ge!==Ci&&ge!==ti&&ge!==go&&ge!==" "){const xe=Q(W);return d(Qt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re+xe),re+xe}return W.currentChar()===Ci&&d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),re}function le(W){_(W);let Y="";return W.currentChar()==="-"?(W.next(),Y+=`-${G(W)}`):Y+=G(W),W.currentChar()===Ci&&d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),Y}function We(W){return W!==Fk&&W!==go}function ue(W){_(W),h(W,"'");let Y="",re="";for(;Y=T(W,We);)Y==="\\"?re+=ve(W):re+=Y;const ge=W.currentChar();return ge===go||ge===Ci?(d(Qt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ge===go&&(W.next(),h(W,"'")),re):(h(W,"'"),re)}function ve(W){const Y=W.currentChar();switch(Y){case"\\":case"'":return W.next(),`\\${Y}`;case"u":return Ne(W,Y,4);case"U":return Ne(W,Y,6);default:return d(Qt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,Y),""}}function Ne(W,Y,re){h(W,Y);let ge="";for(let xe=0;xe<re;xe++){const $e=K(W);if(!$e){d(Qt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${Y}${ge}${W.currentChar()}`);break}ge+=$e}return`\\${Y}${ge}`}function Re(W){return W!=="{"&&W!=="}"&&W!==ti&&W!==go}function Q(W){_(W);let Y="",re="";for(;Y=T(W,Re);)re+=Y;return re}function ce(W){let Y="",re="";for(;Y=R(W);)re+=Y;return re}function Se(W){const Y=re=>{const ge=W.currentChar();return ge==="{"||ge==="@"||ge==="|"||ge==="("||ge===")"||!ge||ge===ti?re:(re+=ge,W.next(),Y(re))};return Y("")}function q(W){_(W);const Y=h(W,"|");return _(W),Y}function ee(W,Y){let re=null;switch(W.currentChar()){case"{":return Y.braceNest>=1&&d(Qt.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),W.next(),re=f(Y,2,"{"),_(W),Y.braceNest++,re;case"}":return Y.braceNest>0&&Y.currentType===2&&d(Qt.EMPTY_PLACEHOLDER,i(),0),W.next(),re=f(Y,3,"}"),Y.braceNest--,Y.braceNest>0&&_(W),Y.inLinked&&Y.braceNest===0&&(Y.inLinked=!1),re;case"@":return Y.braceNest>0&&d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),re=he(W,Y)||g(Y),Y.braceNest=0,re;default:{let xe=!0,$e=!0,se=!0;if($(W))return Y.braceNest>0&&d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),re=f(Y,1,q(W)),Y.braceNest=0,Y.inLinked=!1,re;if(Y.braceNest>0&&(Y.currentType===4||Y.currentType===5||Y.currentType===6))return d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),Y.braceNest=0,oe(W,Y);if(xe=b(W,Y))return re=f(Y,4,be(W)),_(W),re;if($e=y(W,Y))return re=f(Y,5,le(W)),_(W),re;if(se=x(W,Y))return re=f(Y,6,ue(W)),_(W),re;if(!xe&&!$e&&!se)return re=f(Y,12,Q(W)),d(Qt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re.value),_(W),re;break}}return re}function he(W,Y){const{currentType:re}=Y;let ge=null;const xe=W.currentChar();switch((re===7||re===8||re===11||re===9)&&(xe===go||xe===ti)&&d(Qt.INVALID_LINKED_FORMAT,i(),0),xe){case"@":return W.next(),ge=f(Y,7,"@"),Y.inLinked=!0,ge;case".":return _(W),W.next(),f(Y,8,".");case":":return _(W),W.next(),f(Y,9,":");default:return $(W)?(ge=f(Y,1,q(W)),Y.braceNest=0,Y.inLinked=!1,ge):L(W,Y)||v(W,Y)?(_(W),he(W,Y)):N(W,Y)?(_(W),f(Y,11,ce(W))):M(W,Y)?(_(W),xe==="{"?ee(W,Y)||ge:f(Y,10,Se(W))):(re===7&&d(Qt.INVALID_LINKED_FORMAT,i(),0),Y.braceNest=0,Y.inLinked=!1,oe(W,Y))}}function oe(W,Y){let re={type:13};if(Y.braceNest>0)return ee(W,Y)||g(Y);if(Y.inLinked)return he(W,Y)||g(Y);switch(W.currentChar()){case"{":return ee(W,Y)||g(Y);case"}":return d(Qt.UNBALANCED_CLOSING_BRACE,i(),0),W.next(),f(Y,3,"}");case"@":return he(W,Y)||g(Y);default:{if($(W))return re=f(Y,1,q(W)),Y.braceNest=0,Y.inLinked=!1,re;if(P(W))return f(Y,0,X(W));break}}return re}function fe(){const{currentType:W,offset:Y,startLoc:re,endLoc:ge}=a;return a.lastType=W,a.lastOffset=Y,a.lastStartLoc=re,a.lastEndLoc=ge,a.offset=s(),a.startLoc=i(),o.currentChar()===Ci?f(a,13):oe(o,a)}return{nextToken:fe,currentOffset:s,currentPosition:i,context:c}}const h4="parser",p4=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,m4=/\\([\\@{}|])/g;function g4(e,t){return t}function v4(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function y4(e={}){const t=e.location!==!1,{onError:n}=e;function o(w,k,b,y,...x){const L=w.currentPosition();if(L.offset+=y,L.column+=y,n){const N=t?Dg(b,L):null,v=Sh(k,N,{domain:h4,args:x});n(v)}}function s(w,k,b){const y={type:w};return t&&(y.start=k,y.end=k,y.loc={start:b,end:b}),y}function i(w,k,b,y){t&&(w.end=k,w.loc&&(w.loc.end=b))}function r(w,k){const b=w.context(),y=s(3,b.offset,b.startLoc);return y.value=k.replace(m4,g4),i(y,w.currentOffset(),w.currentPosition()),y}function l(w,k){const b=w.context(),{lastOffset:y,lastStartLoc:x}=b,L=s(5,y,x);return L.index=parseInt(k,10),w.nextToken(),i(L,w.currentOffset(),w.currentPosition()),L}function a(w,k){const b=w.context(),{lastOffset:y,lastStartLoc:x}=b,L=s(4,y,x);return L.key=k,w.nextToken(),i(L,w.currentOffset(),w.currentPosition()),L}function c(w,k){const b=w.context(),{lastOffset:y,lastStartLoc:x}=b,L=s(9,y,x);return L.value=k.replace(p4,v4),w.nextToken(),i(L,w.currentOffset(),w.currentPosition()),L}function u(w){const k=w.nextToken(),b=w.context(),{lastOffset:y,lastStartLoc:x}=b,L=s(8,y,x);return k.type!==11?(o(w,Qt.UNEXPECTED_EMPTY_LINKED_MODIFIER,b.lastStartLoc,0),L.value="",i(L,y,x),{nextConsumeToken:k,node:L}):(k.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,ni(k)),L.value=k.value||"",i(L,w.currentOffset(),w.currentPosition()),{node:L})}function d(w,k){const b=w.context(),y=s(7,b.offset,b.startLoc);return y.value=k,i(y,w.currentOffset(),w.currentPosition()),y}function f(w){const k=w.context(),b=s(6,k.offset,k.startLoc);let y=w.nextToken();if(y.type===8){const x=u(w);b.modifier=x.node,y=x.nextConsumeToken||w.nextToken()}switch(y.type!==9&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(y)),y=w.nextToken(),y.type===2&&(y=w.nextToken()),y.type){case 10:y.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(y)),b.key=d(w,y.value||"");break;case 4:y.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(y)),b.key=a(w,y.value||"");break;case 5:y.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(y)),b.key=l(w,y.value||"");break;case 6:y.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(y)),b.key=c(w,y.value||"");break;default:{o(w,Qt.UNEXPECTED_EMPTY_LINKED_KEY,k.lastStartLoc,0);const x=w.context(),L=s(7,x.offset,x.startLoc);return L.value="",i(L,x.offset,x.startLoc),b.key=L,i(b,x.offset,x.startLoc),{nextConsumeToken:y,node:b}}}return i(b,w.currentOffset(),w.currentPosition()),{node:b}}function g(w){const k=w.context(),b=k.currentType===1?w.currentOffset():k.offset,y=k.currentType===1?k.endLoc:k.startLoc,x=s(2,b,y);x.items=[];let L=null;do{const M=L||w.nextToken();switch(L=null,M.type){case 0:M.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(M)),x.items.push(r(w,M.value||""));break;case 5:M.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(M)),x.items.push(l(w,M.value||""));break;case 4:M.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(M)),x.items.push(a(w,M.value||""));break;case 6:M.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(M)),x.items.push(c(w,M.value||""));break;case 7:{const $=f(w);x.items.push($.node),L=$.nextConsumeToken||null;break}}}while(k.currentType!==13&&k.currentType!==1);const N=k.currentType===1?k.lastOffset:w.currentOffset(),v=k.currentType===1?k.lastEndLoc:w.currentPosition();return i(x,N,v),x}function h(w,k,b,y){const x=w.context();let L=y.items.length===0;const N=s(1,k,b);N.cases=[],N.cases.push(y);do{const v=g(w);L||(L=v.items.length===0),N.cases.push(v)}while(x.currentType!==13);return L&&o(w,Qt.MUST_HAVE_MESSAGES_IN_PLURAL,b,0),i(N,w.currentOffset(),w.currentPosition()),N}function m(w){const k=w.context(),{offset:b,startLoc:y}=k,x=g(w);return k.currentType===13?x:h(w,b,y,x)}function _(w){const k=f4(w,Un({},e)),b=k.context(),y=s(0,b.offset,b.startLoc);return t&&y.loc&&(y.loc.source=w),y.body=m(k),e.onCacheKey&&(y.cacheKey=e.onCacheKey(w)),b.currentType!==13&&o(k,Qt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,w[b.offset]||""),i(y,k.currentOffset(),k.currentPosition()),y}return{parse:_}}function ni(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 k4(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Hk(e,t){for(let n=0;n<e.length;n++)pv(e[n],t)}function pv(e,t){switch(e.type){case 1:Hk(e.cases,t),t.helper("plural");break;case 2:Hk(e.items,t);break;case 6:{pv(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 b4(e,t={}){const n=k4(e);n.helper("normalize"),e.body&&pv(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function w4(e){const t=e.body;return t.type===2?Wk(t):t.cases.forEach(n=>Wk(n)),e}function Wk(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const o=e.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;t.push(o.value)}if(t.length===e.items.length){e.static=hv(t);for(let n=0;n<e.items.length;n++){const o=e.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function Yl(e){switch(e.t=e.type,e.type){case 0:{const t=e;Yl(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let o=0;o<n.length;o++)Yl(n[o]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let o=0;o<n.length;o++)Yl(n[o]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;Yl(t.key),t.k=t.key,delete t.key,t.modifier&&(Yl(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 _4(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,_){r.code+=m}function c(m,_=!0){const w=_?o:"";a(s?w+" ".repeat(m):w)}function u(m=!0){const _=++r.indentLevel;m&&c(_)}function d(m=!0){const _=--r.indentLevel;m&&c(_)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function C4(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Sa(e,t.key),t.modifier?(e.push(", "),Sa(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function S4(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let i=0;i<s&&(Sa(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function x4(e,t){const{helper:n,needIndent:o}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let i=0;i<s&&(Sa(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function T4(e,t){t.body?Sa(e,t.body):e.push("null")}function Sa(e,t){const{helper:n}=e;switch(t.type){case 0:T4(e,t);break;case 1:x4(e,t);break;case 2:S4(e,t);break;case 6:C4(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 A4=(e,t={})=>{const n=rt(t.mode)?t.mode:"normal",o=rt(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
-
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=_4(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${hv(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Sa(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 M4(e,t={}){const n=Un({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=y4(n).parse(e);return o?(i&&w4(l),s&&Yl(l),{ast:l,code:""}):(b4(l,n),A4(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function E4(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ol().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ol().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function ci(e){return zt(e)&&mv(e)===0&&(Ls(e,"b")||Ls(e,"body"))}const WS=["b","body"];function I4(e){return Er(e,WS)}const US=["c","cases"];function $4(e){return Er(e,US,[])}const qS=["s","static"];function N4(e){return Er(e,qS)}const jS=["i","items"];function L4(e){return Er(e,jS,[])}const zS=["t","type"];function mv(e){return Er(e,zS)}const VS=["v","value"];function ad(e,t){const n=Er(e,VS);if(n!=null)return n;throw Kc(t)}const KS=["m","modifier"];function O4(e){return Er(e,KS)}const GS=["k","key"];function P4(e){const t=Er(e,GS);if(t)return t;throw Kc(6)}function Er(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(Ls(e,s)&&e[s]!=null)return e[s]}return n}const YS=[...WS,...US,...qS,...jS,...GS,...KS,...VS,...zS];function Kc(e){return new Error(`unhandled node type: ${e}`)}function hm(e){return n=>R4(n,e)}function R4(e,t){const n=I4(t);if(n==null)throw Kc(0);if(mv(n)===1){const i=$4(n);return e.plural(i.reduce((r,l)=>[...r,Uk(e,l)],[]))}else return Uk(e,n)}function Uk(e,t){const n=N4(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=L4(t).reduce((s,i)=>[...s,Bg(e,i)],[]);return e.normalize(o)}}function Bg(e,t){const n=mv(t);switch(n){case 3:return ad(t,n);case 9:return ad(t,n);case 4:{const o=t;if(Ls(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(Ls(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw Kc(n)}case 5:{const o=t;if(Ls(o,"i")&&Hn(o.i))return e.interpolate(e.list(o.i));if(Ls(o,"index")&&Hn(o.index))return e.interpolate(e.list(o.index));throw Kc(n)}case 6:{const o=t,s=O4(o),i=P4(o);return e.linked(Bg(e,i),s?Bg(e,s):void 0,e.type)}case 7:return ad(t,n);case 8:return ad(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const D4=e=>e;let cd=on();function B4(e,t={}){let n=!1;const o=t.onError||i4;return t.onError=s=>{n=!0,o(s)},{...M4(e,t),detectError:n}}function F4(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&rt(e)){qt(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||D4)(e),s=cd[o];if(s)return s;const{ast:i,detectError:r}=B4(e,{...t,location:!1,jit:!0}),l=hm(i);return r?l:cd[o]=l}else{const n=e.cacheKey;if(n){const o=cd[n];return o||(cd[n]=hm(e))}else return hm(e)}}let Gc=null;function H4(e){Gc=e}function W4(e,t,n){Gc&&Gc.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const U4=q4("function:translate");function q4(e){return t=>Gc&&Gc.emit(e,t)}const Ii={INVALID_ARGUMENT:s4,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},j4=24;function $i(e){return Sh(e,null,void 0)}function gv(e,t){return t.locale!=null?qk(t.locale):qk(e.locale)}let pm;function qk(e){if(rt(e))return e;if(kn(e)){if(e.resolvedOnce&&pm!=null)return pm;if(e.constructor.name==="Function"){const t=e();if(t4(t))throw $i(Ii.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return pm=t}else throw $i(Ii.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw $i(Ii.NOT_SUPPORT_LOCALE_TYPE)}function z4(e,t,n){return[...new Set([n,...En(t)?t:zt(t)?Object.keys(t):rt(t)?[t]:[n]])]}function Fg(e,t,n){const o=rt(n)?n:Yc,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;En(r);)r=jk(i,r,t);const l=En(t)||!Dt(t)?t:t.default?t.default:null;r=rt(l)?[l]:l,En(r)&&jk(i,r,!1),s.__localeChainCache.set(o,i)}return i}function jk(e,t,n){let o=!0;for(let s=0;s<t.length&&qt(o);s++){const i=t[s];rt(i)&&(o=V4(e,t[s],n))}return o}function V4(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=K4(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function K4(e,t,n){let o=!1;if(!e.includes(t)&&(o=!0,t)){o=t[t.length-1]!=="!";const s=t.replace(/!/g,"");e.push(s),(En(n)||Dt(n))&&n[s]&&(o=n[s])}return o}const Ir=[];Ir[0]={w:[0],i:[3,0],"[":[4],o:[7]};Ir[1]={w:[1],".":[2],"[":[4],o:[7]};Ir[2]={w:[2],i:[3,0],0:[3,0]};Ir[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Ir[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Ir[5]={"'":[4,0],o:8,l:[5,0]};Ir[6]={'"':[4,0],o:8,l:[6,0]};const G4=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Y4(e){return G4.test(e)}function X4(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 Q4(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 Z4(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:Y4(t)?X4(t):"*"+t}function J4(e){const t=[];let n=-1,o=0,s=0,i,r,l,a,c,u,d;const f=[];f[0]=()=>{r===void 0?r=l:r+=l},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),s++},f[3]=()=>{if(s>0)s--,o=4,f[0]();else{if(s=0,r===void 0||(r=Z4(r),r===!1))return!1;f[1]()}};function g(){const h=e[n+1];if(o===5&&h==="'"||o===6&&h==='"')return n++,l="\\"+h,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&g())){if(a=Q4(i),d=Ir[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const zk=new Map;function e6(e,t){return zt(e)?e[t]:null}function t6(e,t){if(!zt(e))return null;let n=zk.get(t);if(n||(n=J4(t),n&&zk.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(YS.includes(r)&&ci(s)||!zt(s)||!Ls(s,r))return null;const l=s[r];if(l===void 0||kn(s))return null;s=l,i++}return s}const n6="11.4.5",xh=-1,Yc="en-US",wf="",Vk=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function o6(){return{upper:(e,t)=>t==="text"&&rt(e)?e.toUpperCase():t==="vnode"&&zt(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&rt(e)?e.toLowerCase():t==="vnode"&&zt(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&rt(e)?Vk(e):t==="vnode"&&zt(e)&&"__v_isVNode"in e?Vk(e.children):e}}let XS;function s6(e){XS=e}let QS;function i6(e){QS=e}let ZS;function r6(e){ZS=e}let JS=null;const l6=e=>{JS=e},a6=()=>JS;let ex=null;const Kk=e=>{ex=e},c6=()=>ex;let Gk=0;function u6(e={}){const t=kn(e.onWarn)?e.onWarn:z$,n=rt(e.version)?e.version:n6,o=rt(e.locale)||kn(e.locale)?e.locale:Yc,s=kn(o)?Yc:o,i=En(e.fallbackLocale)||Dt(e.fallbackLocale)||rt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=Dt(e.messages)?e.messages:mm(s),l=Dt(e.datetimeFormats)?e.datetimeFormats:mm(s),a=Dt(e.numberFormats)?e.numberFormats:mm(s),c=Un(on(),e.modifiers,o6()),u=e.pluralRules||on(),d=kn(e.missing)?e.missing:null,f=qt(e.missingWarn)||Ca(e.missingWarn)?e.missingWarn:!0,g=qt(e.fallbackWarn)||Ca(e.fallbackWarn)?e.fallbackWarn:!0,h=!!e.fallbackFormat,m=!!e.unresolving,_=kn(e.postTranslation)?e.postTranslation:null,w=Dt(e.processor)?e.processor:null,k=qt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter,y=kn(e.messageCompiler)?e.messageCompiler:XS,x=kn(e.messageResolver)?e.messageResolver:QS||e6,L=kn(e.localeFallbacker)?e.localeFallbacker:ZS||z4,N=zt(e.fallbackContext)?e.fallbackContext:void 0,v=e,M=zt(v.__datetimeFormatters)?v.__datetimeFormatters:new Map,$=zt(v.__numberFormatters)?v.__numberFormatters:new Map,P=zt(v.__meta)?v.__meta:{};Gk++;const T={version:n,cid:Gk,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:g,fallbackFormat:h,unresolving:m,postTranslation:_,processor:w,warnHtmlMessage:k,escapeParameter:b,messageCompiler:y,messageResolver:x,localeFallbacker:L,fallbackContext:N,onWarn:t,__meta:P};return T.datetimeFormats=l,T.numberFormats=a,T.__datetimeFormatters=M,T.__numberFormatters=$,__INTLIFY_PROD_DEVTOOLS__&&W4(T,n,P),T}const mm=e=>({[e]:on()});function vv(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return rt(l)?l:t}else return t}function ic(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function d6(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function f6(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(d6(e,t[o]))return!0;return!1}function Yk(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!rt(t[0])&&!FS(t[0])&&!Hn(t[0]))return wf;const[a,c,u,d]=Hg(...t),f=qt(u.missingWarn)?u.missingWarn:e.missingWarn;qt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const g=!!u.part,h=gv(e,u),m=r(e,s,h);if(!rt(a)||a===""){const L=new Intl.DateTimeFormat(h.replace(/!/g,""),d);return g?L.formatToParts(c):L.format(c)}let _={},w,k=null;const b="datetime format";for(let L=0;L<m.length&&(w=m[L],_=n[w]||{},k=_[a],!Dt(k));L++)vv(e,a,w,f,b);if(!Dt(k)||!rt(w))return o?xh:a;let y=`${w}__${a}`;Ch(d)||(y=`${y}__${JSON.stringify(d)}`);let x=l.get(y);return x||(x=new Intl.DateTimeFormat(w,Un({},k,d)),l.set(y,x)),g?x.formatToParts(c):x.format(c)}const tx=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Hg(...e){const[t,n,o,s]=e,i=on();let r=on(),l;if(rt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw $i(Ii.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(Ii.INVALID_ISO_DATE_ARGUMENT)}}else if(FS(t)){if(isNaN(t.getTime()))throw $i(Ii.INVALID_DATE_ARGUMENT);l=t}else if(Hn(t))l=t;else throw $i(Ii.INVALID_ARGUMENT);return rt(n)?i.key=n:Dt(n)&&Object.keys(n).forEach(a=>{tx.includes(a)?r[a]=n[a]:i[a]=n[a]}),rt(o)?i.locale=o:Dt(o)&&(r=o),Dt(s)&&(r=s),[i.key||"",l,i,r]}function Xk(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function Qk(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!Hn(t[0]))return wf;const[a,c,u,d]=Wg(...t),f=qt(u.missingWarn)?u.missingWarn:e.missingWarn;qt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const g=!!u.part,h=gv(e,u),m=r(e,s,h);if(!rt(a)||a===""){const L=new Intl.NumberFormat(h.replace(/!/g,""),d);return g?L.formatToParts(c):L.format(c)}let _={},w,k=null;const b="number format";for(let L=0;L<m.length&&(w=m[L],_=n[w]||{},k=_[a],!Dt(k));L++)vv(e,a,w,f,b);if(!Dt(k)||!rt(w))return o?xh:a;let y=`${w}__${a}`;Ch(d)||(y=`${y}__${JSON.stringify(d)}`);let x=l.get(y);return x||(x=new Intl.NumberFormat(w,Un({},k,d)),l.set(y,x)),g?x.formatToParts(c):x.format(c)}const nx=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Wg(...e){const[t,n,o,s]=e,i=on();let r=on();if(!Hn(t))throw $i(Ii.INVALID_ARGUMENT);const l=t;return rt(n)?i.key=n:Dt(n)&&Object.keys(n).forEach(a=>{nx.includes(a)?r[a]=n[a]:i[a]=n[a]}),rt(o)?i.locale=o:Dt(o)&&(r=o),Dt(s)&&(r=s),[i.key||"",l,i,r]}function Zk(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const h6=e=>e,p6=e=>"",m6="text",g6=e=>e.length===0?"":hv(e),v6=n4;function gm(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function y6(e){const t=Hn(e.pluralIndex)?e.pluralIndex:-1;return Hn(e.named?.count)?e.named.count:Hn(e.named?.n)?e.named.n:t}function k6(e={}){const t=e.locale,n=y6(e),o=rt(t)&&kn(e.pluralRules?.[t])?e.pluralRules[t]:gm,s=o===gm?void 0:gm,i=w=>w[o(n,w.length,s)],r=e.list||[],l=w=>r[w],a=e.named||on();Hn(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=w=>a[w];function u(w,k){const b=kn(e.messages)?e.messages(w,!!k):zt(e.messages)?e.messages[w]:!1;return b||(e.parent?e.parent.message(w):p6)}const d=w=>e.modifiers?e.modifiers[w]:h6,f=kn(e.processor?.normalize)?e.processor.normalize:g6,g=kn(e.processor?.interpolate)?e.processor.interpolate:v6,h=rt(e.processor?.type)?e.processor.type:m6,_={list:l,named:c,plural:i,linked:(w,...k)=>{const[b,y]=k;let x="text",L="";k.length===1?zt(b)?(L=b.modifier||L,x=b.type||x):rt(b)&&(L=b||L):k.length===2&&(rt(b)&&(L=b||L),rt(y)&&(x=y||x));const N=u(w,!0)(_),v=N===""||N===void 0?w:N,M=x==="vnode"&&En(v)&&L?v[0]:v;return L?d(L)(M,x):M},message:u,type:h,interpolate:g,normalize:f,values:Un(on(),r,a)};return _}const Jk=()=>"",Is=e=>kn(e);function eb(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Ug(...t),u=qt(c.missingWarn)?c.missingWarn:e.missingWarn,d=qt(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=qt(c.escapeParameter)?c.escapeParameter:e.escapeParameter,g=!!c.resolvedMessage,h=rt(c.default)||qt(c.default)?qt(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||h!=null&&(rt(h)||kn(h)),_=gv(e,c);f&&b6(c);let[w,k,b]=g?[a,_,l[_]||on()]:ox(e,a,_,r,d,u),y=w,x=a;if(!g&&!(rt(y)||ci(y)||Is(y))&&m&&(y=h,x=y),!g&&(!(rt(y)||ci(y)||Is(y))||!rt(k)))return s?xh:a;let L=!1;const N=()=>{L=!0},v=Is(y)?y:sx(e,a,k,y,x,N);if(L)return y;const M=C6(e,k,b,c),$=k6(M),P=w6(e,v,$);let T=o?o(P,a):P;if(f&&rt(T)&&(T=J$(T)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:rt(a)?a:Is(y)?y.key:"",locale:k||(Is(y)?y.locale:""),format:rt(y)?y:Is(y)?y.source:"",message:T};I.meta=Un({},e.__meta,a6()||{}),U4(I)}return T}function b6(e){En(e.list)?e.list=e.list.map(t=>rt(t)?Dk(t):t):zt(e.named)&&Object.keys(e.named).forEach(t=>{rt(e.named[t])&&(e.named[t]=Dk(e.named[t]))})}function ox(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=on(),f,g=null;const h="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||on(),(g=a(d,t))===null&&(g=d[t]),!(rt(g)||ci(g)||Is(g)));m++)if(!f6(f,u)){const _=vv(e,t,f,i,h);_!==t&&(g=_)}return[g,f,d]}function sx(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(Is(o)){const c=o;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>o);return c.locale=n,c.key=t,c}const a=r(o,_6(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function w6(e,t,n){return t(n)}function Ug(...e){const[t,n,o]=e,s=on();if(!rt(t)&&!Hn(t)&&!Is(t)&&!ci(t))throw $i(Ii.INVALID_ARGUMENT);const i=Hn(t)?String(t):(Is(t),t);return Hn(n)?s.plural=n:rt(n)?s.default=n:Dt(n)&&!Ch(n)?s.named=n:En(n)&&(s.list=n),Hn(o)?s.plural=o:rt(o)?s.default=o:Dt(o)&&Un(s,o),[i,s]}function _6(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>V$(t,n,r)}}function C6(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:i,messages:(g,h)=>{let m=r(n,g);if(m==null&&(u||h)){const[_,,w]=ox(u||e,g,t,l,a,c);m=_??r(w,g)}if(rt(m)||ci(m)){let _=!1;const k=sx(e,g,t,m,g,()=>{_=!0});return _?Jk:k}else return Is(m)?m:Jk}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),Hn(o.plural)&&(f.pluralIndex=o.plural),f}E4();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const S6="11.4.5";function x6(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ol().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ol().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ol().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ol().__INTLIFY_PROD_DEVTOOLS__=!1)}const Mo={UNEXPECTED_RETURN_TYPE:j4,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 qo(e,...t){return Sh(e,null,void 0)}const qg=Mr("__translateVNode"),jg=Mr("__datetimeParts"),zg=Mr("__numberParts"),ix=Mr("__setPluralRules"),rx=Mr("__injectWithOption"),Jl=Mr("__dispose");function Xc(e){if(!zt(e)||ci(e))return e;for(const t in e)if(Ls(e,t))if(!t.includes("."))zt(e[t])&&Xc(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,i=!1;for(let r=0;r<o;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in s||(s[n[r]]=on()),!zt(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(ci(s)?YS.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!ci(s)){const r=s[n[o]];zt(r)&&Xc(r)}}return e}function yv(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=Dt(n)?n:En(o)?on():{[e]:on()};if(En(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||on(),Pd(c,r[a])):Pd(c,r)}else rt(l)&&Pd(JSON.parse(l),r)}),s==null&&i)for(const l in r)Ls(r,l)&&Xc(r[l]);return r}function lx(e){return e.type}function ax(e,t,n){let o=zt(t.messages)?t.messages:on();"__i18nGlobal"in n&&(o=yv(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(zt(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(zt(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function tb(e){return vt(gr,null,e,0)}function Qc(){return fo()}const nb="__INTLIFY_META__",ob=()=>[],T6=()=>!1;let sb=0;function ib(e){return((t,n,o,s)=>e(n,o,Qc()||void 0,s))}const A6=()=>{const e=Qc();let t=null;return e&&(t=lx(e)[nb])?{[nb]:t}:null};function _f(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=bf?te:gl;let r=qt(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:rt(e.locale)?e.locale:Yc),a=i(t&&r?t.fallbackLocale.value:rt(e.fallbackLocale)||En(e.fallbackLocale)||Dt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(yv(l.value,e)),u=i(Dt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Dt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:qt(e.missingWarn)||Ca(e.missingWarn)?e.missingWarn:!0,g=t?t.fallbackWarn:qt(e.fallbackWarn)||Ca(e.fallbackWarn)?e.fallbackWarn:!0,h=t?t.fallbackRoot:qt(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,_=kn(e.missing)?e.missing:null,w=kn(e.missing)?ib(e.missing):null,k=kn(e.postTranslation)?e.postTranslation:null,b=t?t.warnHtmlMessage:qt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const x=t?t.modifiers:Dt(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,N;N=(()=>{o&&Kk(null);const se={version:S6,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:x,pluralRules:L,missing:w===null?void 0:w,missingWarn:f,fallbackWarn:g,fallbackFormat:m,unresolving:!0,postTranslation:k===null?void 0:k,warnHtmlMessage:b,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};se.datetimeFormats=u.value,se.numberFormats=d.value,se.__datetimeFormatters=Dt(N)?N.__datetimeFormatters:void 0,se.__numberFormatters=Dt(N)?N.__numberFormatters:void 0;const ae=u6(se);return o&&Kk(ae),ae})(),ic(N,l.value,a.value);function M(){return[l.value,a.value,c.value,u.value,d.value]}const $=H({get:()=>l.value,set:se=>{N.locale=se,l.value=se}}),P=H({get:()=>a.value,set:se=>{N.fallbackLocale=se,a.value=se,ic(N,l.value,se)}}),T=H(()=>c.value),I=H(()=>u.value),R=H(()=>d.value);function D(){return kn(k)?k:null}function F(se){k=se,N.postTranslation=se}function z(){return _}function V(se){se!==null&&(w=ib(se)),_=se,N.missing=w}const ne=(se,ae,we,qe,nt,at)=>{M();let _t;try{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=t?c6():void 0),_t=se(N)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=void 0)}if(we!=="translate exists"&&Hn(_t)&&_t===xh||we==="translate exists"&&!_t){const[$t,lt]=ae();return t&&h?qe(t):nt($t)}else{if(at(_t))return _t;throw qo(Mo.UNEXPECTED_RETURN_TYPE)}};function K(...se){return ne(ae=>Reflect.apply(eb,null,[ae,...se]),()=>Ug(...se),"translate",ae=>Reflect.apply(ae.t,ae,[...se]),ae=>ae,ae=>rt(ae))}function G(...se){const[ae,we,qe]=se;if(qe&&!zt(qe))throw qo(Mo.INVALID_ARGUMENT);return K(ae,we,Un({resolvedMessage:!0},qe||{}))}function X(...se){return ne(ae=>Reflect.apply(Yk,null,[ae,...se]),()=>Hg(...se),"datetime format",ae=>Reflect.apply(ae.d,ae,[...se]),()=>wf,ae=>rt(ae)||En(ae))}function be(...se){return ne(ae=>Reflect.apply(Qk,null,[ae,...se]),()=>Wg(...se),"number format",ae=>Reflect.apply(ae.n,ae,[...se]),()=>wf,ae=>rt(ae)||En(ae))}function le(se){return se.map(ae=>rt(ae)||Hn(ae)||qt(ae)?tb(String(ae)):ae)}const ue={normalize:le,interpolate:se=>se,type:"vnode"};function ve(...se){return ne(ae=>{let we;const qe=ae;try{qe.processor=ue,we=Reflect.apply(eb,null,[qe,...se])}finally{qe.processor=null}return we},()=>Ug(...se),"translate",ae=>ae[qg](...se),ae=>[tb(ae)],ae=>En(ae))}function Ne(...se){return ne(ae=>Reflect.apply(Qk,null,[ae,...se]),()=>Wg(...se),"number format",ae=>ae[zg](...se),ob,ae=>rt(ae)||En(ae))}function Re(...se){return ne(ae=>Reflect.apply(Yk,null,[ae,...se]),()=>Hg(...se),"datetime format",ae=>ae[jg](...se),ob,ae=>rt(ae)||En(ae))}function Q(se){L=se,N.pluralRules=L}function ce(se,ae){return ne(()=>{if(!se)return!1;const we=rt(ae)?ae:l.value,qe=rt(ae)?[we]:Fg(N,a.value,we);for(let nt=0;nt<qe.length;nt++){const at=ee(qe[nt]);let _t=N.messageResolver(at,se);if(_t===null&&(_t=at[se]),ci(_t)||Is(_t)||rt(_t))return!0}return!1},()=>[se],"translate exists",we=>Reflect.apply(we.te,we,[se,ae]),T6,we=>qt(we))}function Se(se){let ae=null;const we=Fg(N,a.value,l.value);for(let qe=0;qe<we.length;qe++){const nt=c.value[we[qe]]||{},at=N.messageResolver(nt,se);if(at!=null){ae=at;break}}return ae}function q(se){const ae=Se(se);return ae??(t?t.tm(se)||{}:{})}function ee(se){return c.value[se]||{}}function he(se,ae){if(s){const we={[se]:ae};for(const qe in we)Ls(we,qe)&&Xc(we[qe]);ae=we[se]}c.value[se]=ae,N.messages=c.value}function oe(se,ae){c.value[se]=c.value[se]||{};const we={[se]:ae};if(s)for(const qe in we)Ls(we,qe)&&Xc(we[qe]);ae=we[se],Pd(ae,c.value[se]),N.messages=c.value}function fe(se){return u.value[se]||{}}function W(se,ae){u.value[se]=ae,N.datetimeFormats=u.value,Xk(N,se,ae)}function Y(se,ae){u.value[se]=Un(u.value[se]||{},ae),N.datetimeFormats=u.value,Xk(N,se,ae)}function re(se){return d.value[se]||{}}function ge(se,ae){d.value[se]=ae,N.numberFormats=d.value,Zk(N,se,ae)}function xe(se,ae){d.value[se]=Un(d.value[se]||{},ae),N.numberFormats=d.value,Zk(N,se,ae)}sb++,t&&bf&&(ze(t.locale,se=>{r&&(l.value=se,N.locale=se,ic(N,l.value,a.value))}),ze(t.fallbackLocale,se=>{r&&(a.value=se,N.fallbackLocale=se,ic(N,l.value,a.value))}));const $e={id:sb,locale:$,fallbackLocale:P,get inheritLocale(){return r},set inheritLocale(se){r=se,se&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,ic(N,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:T,get modifiers(){return x},get pluralRules(){return L||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(se){f=se,N.missingWarn=f},get fallbackWarn(){return g},set fallbackWarn(se){g=se,N.fallbackWarn=g},get fallbackRoot(){return h},set fallbackRoot(se){h=se},get fallbackFormat(){return m},set fallbackFormat(se){m=se,N.fallbackFormat=m},get warnHtmlMessage(){return b},set warnHtmlMessage(se){b=se,N.warnHtmlMessage=se},get escapeParameter(){return y},set escapeParameter(se){y=se,N.escapeParameter=se},t:K,getLocaleMessage:ee,setLocaleMessage:he,mergeLocaleMessage:oe,getPostTranslationHandler:D,setPostTranslationHandler:F,getMissingHandler:z,setMissingHandler:V,[ix]:Q};return $e.datetimeFormats=I,$e.numberFormats=R,$e.rt=G,$e.te=ce,$e.tm=q,$e.d=X,$e.n=be,$e.getDateTimeFormat=fe,$e.setDateTimeFormat=W,$e.mergeDateTimeFormat=Y,$e.getNumberFormat=re,$e.setNumberFormat=ge,$e.mergeNumberFormat=xe,$e[rx]=n,$e[qg]=ve,$e[jg]=Re,$e[zg]=Ne,$e}function M6(e){const t=rt(e.locale)?e.locale:Yc,n=rt(e.fallbackLocale)||En(e.fallbackLocale)||Dt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=kn(e.missing)?e.missing:void 0,s=qt(e.silentTranslationWarn)||Ca(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=qt(e.silentFallbackWarn)||Ca(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=qt(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Dt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=kn(e.postTranslation)?e.postTranslation:void 0,d=rt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,g=qt(e.sync)?e.sync:!0;let h=e.messages;if(Dt(e.sharedMessages)){const x=e.sharedMessages;h=Object.keys(x).reduce((N,v)=>{const M=N[v]||(N[v]={});return Un(M,x[v]),N},h||{})}const{__i18n:m,__root:_,__injectWithOption:w}=e,k=e.datetimeFormats,b=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:h,flatJson:y,datetimeFormats:k,numberFormats:b,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:g,__i18n:m,__root:_,__injectWithOption:w}}function Vg(e={}){const t=_f(M6(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(s){t.setMissingHandler(s)},get silentTranslationWarn(){return qt(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=qt(s)?!s:s},get silentFallbackWarn(){return qt(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=qt(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){return Reflect.apply(t.t,t,[...s])},rt(...s){return Reflect.apply(t.rt,t,[...s])},te(s,i){return t.te(s,i)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,i){t.setLocaleMessage(s,i)},mergeLocaleMessage(s,i){t.mergeLocaleMessage(s,i)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,i){t.setDateTimeFormat(s,i)},mergeDateTimeFormat(s,i){t.mergeDateTimeFormat(s,i)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,i){t.setNumberFormat(s,i)},mergeNumberFormat(s,i){t.mergeNumberFormat(s,i)}};return o.__extender=n,o}function E6(e,t,n){return{beforeCreate(){const o=Qc();if(!o)throw qo(Mo.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=rb(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Vg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=rb(e,s);else{this.$i18n=Vg({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&ax(t,s,s),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(o,this.$i18n)},mounted(){},unmounted(){const o=Qc();if(!o)throw qo(Mo.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function rb(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[ix](t.pluralizationRules||e.pluralizationRules);const n=yv(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const kv={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function I6({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Pe?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},on())}function cx(){return Pe}const $6=Qe({name:"i18n-t",props:Un({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Hn(e)||!isNaN(e)}},kv),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||xt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=on();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=rt(e.plural)?+e.plural:e.plural);const u=I6(t,a);return s[qg](e.keypath,u,c)},r=Un(on(),o),l=rt(e.tag)||zt(e.tag)?e.tag:cx();return zt(l)?Zt(l,r,{default:i}):Zt(l,r,i())}}}),lb=$6;function N6(e){return En(e)&&!rt(e[0])}function ux(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=on();e.locale&&(c.locale=e.locale),rt(e.format)?c.key=e.format:zt(e.format)&&(rt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((g,h)=>n.includes(h)?Un(on(),g,{[h]:e.format[h]}):g,on()));const d=o(e.value,c,u);let f=[c.key];return En(d)?f=d.map((g,h)=>{const m=s[g.type],_=m?m({[g.type]:g.value,index:h,parts:d}):[g.value];return N6(_)&&(_[0].key=`${g.type}-${h}`),_}):rt(d)&&(f=[d]),f},l=Un(on(),i),a=rt(e.tag)||zt(e.tag)?e.tag:cx();return zt(a)?Zt(a,l,{default:r}):Zt(a,l,r())}}const L6=Qe({name:"i18n-n",props:Un({value:{type:Number,required:!0},format:{type:[String,Object]}},kv),setup(e,t){const n=e.i18n||xt({useScope:e.scope,__useComponent:!0});return ux(e,t,nx,(...o)=>n[zg](...o))}}),ab=L6;function O6(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function P6(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw qo(Mo.UNEXPECTED_ERROR);const c=O6(e,l.$),u=cb(a);return[Reflect.apply(c.t,c,[...ub(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);bf&&(r.__i18nWatcher=ze(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{bf&&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=cb(l);r.textContent=Reflect.apply(a.t,a,[...ub(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function cb(e){if(rt(e))return{path:e};if(Dt(e)){if(!("path"in e))throw qo(Mo.REQUIRED_VALUE,"path");return e}else throw qo(Mo.INVALID_VALUE)}function ub(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return rt(n)&&(r.locale=n),Hn(s)&&(r.plural=s),Hn(i)&&(r.plural=i),[t,l,r]}function R6(e,t,...n){const o=Dt(n[0])?n[0]:{};(qt(o.globalInstall)?o.globalInstall:!0)&&([lb.name,"I18nT"].forEach(i=>e.component(i,lb)),[ab.name,"I18nN"].forEach(i=>e.component(i,ab)),[hb.name,"I18nD"].forEach(i=>e.component(i,hb))),e.directive("t",P6(t))}const D6=Mr("global-vue-i18n");function B6(e={}){const t=__VUE_I18N_LEGACY_API__&&qt(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=qt(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=F6(e,t),r=Mr("");function l(d){return o.get(d)||null}function a(d,f){o.set(d,f)}function c(d){o.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Dt(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let g=null;!t&&n&&(g=V6(d,u.global)),__VUE_I18N_FULL_INSTALL__&&R6(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(E6(i,i.__composer,u));const h=d.unmount;d.unmount=()=>{g&&g(),u.dispose(),h()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function xt(e={}){const t=Qc();if(t==null)throw qo(Mo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw qo(Mo.NOT_INSTALLED);const n=H6(t),o=U6(n),s=lx(t),i=W6(e,s);if(i==="global")return ax(o,e,s),o;if(i==="parent"){let a=db(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw qo(Mo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=Un({},e),u=db(n,t);c.__root=u||o;const d=_f(c);return a.__composerExtend&&(d[Jl]=a.__composerExtend(d)),K1()&&G1(()=>{const g=d[Jl];g&&(g(),delete d[Jl])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=Un({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=_f(a),r.__composerExtend&&(l[Jl]=r.__composerExtend(l)),j6(r,t,l),r.__setInstance(t,l)}return l}function F6(e,t){const n=fE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Vg(e)):n.run(()=>_f(e));if(o==null)throw qo(Mo.UNEXPECTED_ERROR);return[n,o]}function H6(e){const t=Bt(e.isCE?D6:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw qo(e.isCE?Mo.NOT_INSTALLED_WITH_PROVIDE:Mo.UNEXPECTED_ERROR);return t}function W6(e,t){return Ch(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function U6(e){return e.mode==="composition"?e.global:e.global.__composer}function db(e,t,n=!1){let o=null;const s=t.root;let i=q6(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")o=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(o=l.__composer,n&&o&&!o[rx]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function q6(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function j6(e,t,n){rn(()=>{},t),Yt(()=>{const o=n;e.__deleteInstance(t);const s=o[Jl];s&&(s(),delete o[Jl])},t)}const z6=["locale","fallbackLocale","availableLocales"],fb=["t","rt","d","n","tm","te"];function V6(e,t){const n=Object.create(null);return z6.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw qo(Mo.UNEXPECTED_ERROR);const r=Ln(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,r)}),e.config.globalProperties.$i18n=n,fb.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw qo(Mo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,fb.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const K6=Qe({name:"i18n-d",props:Un({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},kv),setup(e,t){const n=e.i18n||xt({useScope:e.scope,__useComponent:!0});return ux(e,t,tx,(...o)=>n[jg](...o))}}),hb=K6;x6();s6(F4);i6(t6);r6(Fg);if(__INTLIFY_PROD_DEVTOOLS__){const e=ol();e.__INTLIFY__=!0,H4(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Mt={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",theme:"kimi-web.theme",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",betaToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align"};function pb(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function bn(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function Tn(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Zc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function bv(e){const t=bn(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Th(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function wv(){const e=bn(Mt.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function _v(e){const n={...wv()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];Tn(Mt.unread,JSON.stringify(n))}function G6(){const e=bv(Mt.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function Y6(e){Th(Mt.collapsedWorkspaces,Array.from(e))}function X6(){const e=bv(Mt.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function dx(e){Th(Mt.workspaceOrder,Array.from(e))}const mb=Mt.clientId,Q6="kimi-code-web",Z6="web";function J6(){return{serverHttpUrl:t5(),clientId:i5(),clientName:Q6,clientVersion:r5(),clientUiMode:Z6}}function e5(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function t5(e){const t=e5(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function n5(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function o5(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return n5(e)}function Cf(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function s5(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 i5(){const e=bn(mb);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return Tn(mb,t),t}function r5(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function wo(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return l5(e)}function l5(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function a5(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(i=>n.has(i)),s=e.filter(i=>!t.includes(i));return s.length===0&&o.length===t.length?null:[...s,...o]}function c5(e,t){const n=new Map(t.map((o,s)=>[o,s]));return e.toSorted((o,s)=>(n.get(o.id)??-1)-(n.get(s.id)??-1))}function u5(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s<i?i-1:i,a=o==="before"?l:l+1;return r.splice(a,0,t),r}const d5={class:"row"},f5={class:"lead","aria-hidden":"true"},h5={key:0,class:"run-ico",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none"},p5={key:1,class:"unread-dot"},m5={class:"archive-label"},g5={class:"left"},v5=["onKeydown"],y5={class:"ts"},k5=["title"],b5={class:"tag-text"},w5=["title"],_5={class:"tag-text"},C5=["title"],S5={class:"tag-text"},x5=["title"],T5=Qe({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:o}=xt(),s=e,i=n,r=te(!1),l=te(null),a=te(null);function c($){const P=$.target;a.value?.contains(P)||l.value?.contains(P)||d()}function u($){$.stopPropagation(),r.value?d():(r.value=!0,setTimeout(()=>document.addEventListener("mousedown",c),0))}function d(){r.value=!1,document.removeEventListener("mousedown",c)}Yt(()=>document.removeEventListener("mousedown",c));const f=te(!1),g=te(""),h=te(null);async function m(){d(),f.value=!0,g.value=s.session.title,await ht();try{h.value?.focus(),h.value?.select()}catch{}}function _(){const $=g.value.trim();$&&i("rename",s.session.id,$),f.value=!1}function w(){f.value=!1}const k=te(!1),b=te(!1);async function y(){const $=await wo(s.session.id);k.value=$,b.value=!$,setTimeout(()=>{k.value=!1,b.value=!1,d()},1500)}function x(){d(),i("fork",s.session.id)}const L=te(!1);function N(){d(),L.value=!0}function v(){i("archive",s.session.id),L.value=!1}function M(){L.value=!1}return t({closeMenu:d,cancelArchive:M}),($,P)=>(C(),E("div",{class:Oe(["se",{on:e.active}]),onClick:P[5]||(P[5]=T=>i("select",e.session.id))},[p("div",d5,[p("span",f5,[e.session.busy?(C(),E("svg",h5,[...P[6]||(P[6]=[p("circle",{class:"run-track",cx:"8",cy:"8",r:"6","stroke-width":"2"},null,-1),p("path",{class:"run-arc",d:"M8 2 A6 6 0 1 1 2 8","stroke-width":"2","stroke-linecap":"round"},null,-1)])])):e.unread?(C(),E("span",p5)):ie("",!0)]),L.value?(C(),E("div",{key:0,class:"archive-confirm",onClick:P[0]||(P[0]=Ze(()=>{},["stop"]))},[p("span",m5,O(S(o)("sidebar.archiveConfirm")),1),p("button",{class:"btn-confirm",onClick:Ze(v,["stop"])},O(S(o)("sidebar.confirm")),1),p("button",{class:"btn-cancel",onClick:Ze(M,["stop"])},O(S(o)("sidebar.cancel")),1)])):(C(),E(Pe,{key:1},[p("div",g5,[f.value?jt((C(),E("input",{key:0,ref_key:"renameInputRef",ref:h,"onUpdate:modelValue":P[1]||(P[1]=T=>g.value=T),class:"rename-input",onClick:P[2]||(P[2]=Ze(()=>{},["stop"])),onKeydown:[Ns(Ze(_,["stop"]),["enter"]),Ns(Ze(w,["stop"]),["esc"])],onBlur:_},null,40,v5)),[[Wn,g.value]]):(C(),E("span",{key:1,class:"t",onDblclick:Ze(m,["stop"])},O(e.session.title),33))]),p("span",y5,O(e.session.time),1),!f.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(C(),E("span",{key:0,class:"tag tag-ask",title:S(o)("workspace.awaitingAnswerTitle")},[p("span",b5,O(S(o)("workspace.awaitingAnswer")),1)],8,k5)):ie("",!0),!f.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(C(),E("span",{key:1,class:"tag tag-approve",title:S(o)("workspace.awaitingPermissionTitle")},[p("span",_5,O(S(o)("workspace.awaitingPermission")),1)],8,w5)):ie("",!0),!f.value&&e.session.status==="aborted"?(C(),E("span",{key:2,class:"tag tag-aborted",title:S(o)("workspace.abortedTitle")},[p("span",S5,O(S(o)("workspace.aborted")),1)],8,C5)):ie("",!0),f.value?ie("",!0):(C(),E("button",{key:3,ref_key:"kebabRef",ref:l,class:Oe(["kebab",{open:r.value}]),title:S(o)("sidebar.options"),onClick:P[3]||(P[3]=Ze(T=>u(T),["stop"]))},[...P[7]||(P[7]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,x5))],64))]),r.value?(C(),E("div",{key:0,ref_key:"menuRef",ref:a,class:"menu",onClick:P[4]||(P[4]=Ze(()=>{},["stop"]))},[p("button",{class:Oe(["menu-item copy-id",{failed:b.value}]),onClick:Ze(y,["stop"])},O(b.value?S(o)("sidebar.copyFailed"):k.value?S(o)("sidebar.copied"):S(o)("sidebar.copySessionId")),3),P[8]||(P[8]=p("div",{class:"menu-divider"},null,-1)),p("button",{class:"menu-item",onClick:Ze(m,["stop"])},O(S(o)("sidebar.rename")),1),p("button",{class:"menu-item",onClick:Ze(x,["stop"])},O(S(o)("sidebar.fork")),1),p("button",{class:"menu-item archive",onClick:Ze(N,["stop"])},O(S(o)("sidebar.archive")),1)],512)):ie("",!0)],2))}}),bt=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},fx=bt(T5,[["__scopeId","data-v-8222aa18"]]),A5={class:"gh-top"},M5={class:"gh-folder",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},E5={key:0,class:"gh-name"},I5=["title","aria-label","aria-expanded"],$5=["title","aria-label"],N5=["title"],L5={class:"group-sessions"},O5=["disabled"],P5={key:1,class:"group-empty"},R5=Qe({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},selectedIds:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=xt(),o=e,s=t,i=H({get:()=>o.renameValue,set:a=>s("updateRenameValue",a)});function r(a){o.renameInputRef.value=a instanceof HTMLInputElement?a:null}function l(a){a.dataTransfer&&(a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}return(a,c)=>(C(),E("div",{class:Oe(["group",{dragging:e.dragging}])},[p("div",{class:Oe(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,sel:e.selectedIds.has(e.group.workspace.id)}]),draggable:"true",onClick:c[7]||(c[7]=Ze(u=>s("groupClick",e.group.workspace.id,u),["stop"])),onContextmenu:c[8]||(c[8]=u=>s("groupContextmenu",e.group.workspace,u)),onDragstart:l,onDragend:c[9]||(c[9]=u=>s("wsDragend"))},[p("div",A5,[(C(),E("svg",M5,[e.isCollapsed(e.group.workspace.id)?(C(),E(Pe,{key:0},[c[15]||(c[15]=p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),c[16]||(c[16]=p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(C(),E(Pe,{key:1},[c[17]||(c[17]=p("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)),c[18]||(c[18]=p("path",{d:"M1 5.5h12"},null,-1))],64))])),e.renamingId!==e.group.workspace.id?(C(),E("span",E5,O(e.group.workspace.name),1)):jt((C(),E("input",{key:1,ref:r,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),class:"gh-rename",type:"text",onKeydown:[c[1]||(c[1]=Ns(u=>s("confirmRename"),["enter"])),c[2]||(c[2]=Ns(u=>s("cancelRename"),["esc"]))],onBlur:c[3]||(c[3]=u=>s("cancelRename")),onClick:c[4]||(c[4]=Ze(()=>{},["stop"]))},null,544)),[[Wn,i.value]]),p("button",{type:"button",class:Oe(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),title:S(n)("sidebar.options"),"aria-label":S(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:c[5]||(c[5]=Ze(u=>s("toggleWsMenu",e.group.workspace,u),["stop"]))},[...c[19]||(c[19]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,I5),p("button",{type:"button",class:"gh-add",title:S(n)("workspace.newInGroup"),"aria-label":S(n)("workspace.newInGroup"),onClick:c[6]||(c[6]=Ze(u=>s("createInWorkspace",e.group.workspace.id),["stop"]))},[...c[20]||(c[20]=[p("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"},[p("path",{d:"M8 3v10M3 8h10"})],-1)])],8,$5)]),p("div",{class:"gh-path",title:e.group.workspace.root},O(e.group.workspace.shortPath||e.group.workspace.root),9,N5)],34),jt(p("div",L5,[(C(!0),E(Pe,null,Xe(e.group.sessions,u=>(C(),Ve(fx,{key:u.id,session:u,active:u.id===e.activeId,"approval-count":e.pendingBySession[u.id]?.approvals??0,"question-count":e.pendingBySession[u.id]?.questions??0,unread:e.unreadBySession[u.id]??!1,onSelect:c[10]||(c[10]=d=>s("selectSession",d)),onRename:c[11]||(c[11]=(d,f)=>s("renameSession",d,f)),onArchive:c[12]||(c[12]=d=>s("archiveSession",d)),onFork:c[13]||(c[13]=d=>s("forkSession",d))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(C(),E("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:c[14]||(c[14]=Ze(u=>s("loadMore",e.group.workspace.id),["stop"]))},O(e.group.loadingMore?S(n)("sidebar.loadingMore"):S(n)("sidebar.showMore",{count:Math.max(0,e.group.workspace.sessionCount-e.group.sessions.length)})),9,O5)):ie("",!0),e.group.sessions.length===0?(C(),E("div",P5,O(S(n)("sidebar.noSessions")),1)):ie("",!0)],512),[[js,!e.isCollapsed(e.group.workspace.id)]])],2))}}),D5=bt(R5,[["__scopeId","data-v-4c114e7c"]]),B5={class:"side"},F5={class:"ch"},H5={class:"ch-brand"},W5={class:"ch-name"},U5={key:0,class:"ch-endpoint"},q5=["title","aria-label"],j5=["title","aria-label"],z5={class:"search"},V5=["placeholder","aria-label","onKeydown"],K5=["title","aria-label"],G5={class:"btn-wrap"},Y5={key:0,class:"sessions"},X5={key:1,class:"empty"},Q5={key:1,class:"sessions"},Z5={key:0,class:"empty"},J5=["onDragover","onDrop"],eN=Qe({__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","reorderWorkspaces","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=xt(),o=!1,s="",i=e,r=t,l=te(""),a=H(()=>l.value.trim()),c=H(()=>a.value.length>0),u=H(()=>{const ae=a.value.toLowerCase();return ae?i.sessions.filter(we=>{const qe=(we.title??"").toLowerCase(),nt=(we.lastPrompt??"").toLowerCase();return qe.includes(ae)||nt.includes(ae)}):[]});function d(){l.value=""}function f(ae){d(),M(ae)}ze(c,ae=>{ae&&r("loadAllSessions")});const g=te(new Set(G6()));function h(ae){return g.value.has(ae)}function m(ae){const we=new Set(g.value);we.has(ae)?we.delete(ae):we.add(ae),g.value=we,Y6(we)}const _=te(null),w=te(null);function k(ae){_.value=ae}function b(){_.value=null,w.value=null}function y(ae){const we=ae.currentTarget.getBoundingClientRect();return ae.clientY<we.top+we.height/2?"before":"after"}function x(ae,we){_.value===null||_.value===we||(ae.preventDefault(),ae.dataTransfer&&(ae.dataTransfer.dropEffect="move"),w.value={id:we,position:y(ae)})}function L(ae){const we=_.value,qe=w.value?.id===ae?w.value.position:"before";if(w.value=null,_.value=null,!we||we===ae)return;const nt=u5(i.groups.map(at=>at.workspace.id),we,ae,qe);r("reorderWorkspaces",nt)}const N=te(new Set);function v(ae,we){if(we.shiftKey){we.stopPropagation();const qe=new Set(N.value);qe.has(ae)?qe.delete(ae):qe.add(ae),N.value=qe,r("selectWorkspaces",Array.from(qe));return}N.value=new Set,r("selectWorkspaces",[]),m(ae)}function M(ae){N.value=new Set,r("selectWorkspaces",[]),r("select",ae)}const $=te(null),P=te(""),T=te(null);function I(){return T}function R(ae,we){$.value=ae,P.value=we,ht().then(()=>T.value?.focus())}function D(){const ae=$.value,we=P.value.trim();ae&&we&&r("renameWorkspace",ae,we),$.value=null}function F(){$.value=null}function z(ae){P.value=ae}const V=te(!1),ne=te(null),K=te({}),G=te(null);function X(ae){G.value&&!G.value.contains(ae.target)&&le()}function be(ae,we){if(we.shiftKey){we.stopPropagation();const qe=new Set(N.value);qe.has(ae.id)?qe.delete(ae.id):qe.add(ae.id),N.value=qe,r("selectWorkspaces",Array.from(qe));return}we.preventDefault(),we.stopPropagation(),ne.value=ae,K.value={top:`${we.clientY}px`,left:`${we.clientX}px`},V.value=!0,document.addEventListener("mousedown",X,!0)}function le(){V.value=!1,document.removeEventListener("mousedown",X,!0),ne.value=null,Q()}function We(){ne.value&&wo(ne.value.root),le()}function ue(){ne.value&&R(ne.value.id,ne.value.name),le()}function ve(){const ae=ne.value;ae&&ce(ae.id)&&(r("deleteWorkspace",ae.id),le())}const Ne=te(null);let Re;function Q(){clearTimeout(Re),Ne.value=null}function ce(ae){return Ne.value===ae?(Q(),!0):(clearTimeout(Re),Ne.value=ae,Re=setTimeout(()=>{Ne.value=null},2500),!1)}const Se=te(null),q=te(null),ee=te({}),he=te(null);function oe(ae){const we=ae.target;we.closest(".gh-more")||we.closest(".ws-menu")||W()}async function fe(ae,we){if(Se.value===ae.id){W();return}const qe=we.currentTarget;q.value=ae,Se.value=ae.id,document.addEventListener("mousedown",oe),document.addEventListener("scroll",W,!0),window.addEventListener("resize",W),await ht();const nt=he.value,at=qe.getBoundingClientRect(),_t=4,$t=8,lt=nt?.offsetHeight??0,Rt=nt?.offsetWidth??0;let fn=at.bottom+_t;fn+lt>window.innerHeight-$t&&(fn=Math.max($t,at.top-lt-_t));let An=at.right-Rt;An<$t&&(An=$t),ee.value={top:`${Math.round(fn)}px`,left:`${Math.round(An)}px`}}function W(){Se.value=null,q.value=null,Q(),document.removeEventListener("mousedown",oe),document.removeEventListener("scroll",W,!0),window.removeEventListener("resize",W)}function Y(ae){wo(ae.root),W()}function re(ae){R(ae.id,ae.name),W()}function ge(ae){ce(ae.id)&&(r("deleteWorkspace",ae.id),W())}Yo(()=>{document.removeEventListener("mousedown",X,!0),document.removeEventListener("mousedown",oe),document.removeEventListener("scroll",W,!0),window.removeEventListener("resize",W),clearTimeout(Re)});const xe=te(null);let $e;function se(){const ae=xe.value;ae&&(ae.classList.remove("blink-now"),ae.getBoundingClientRect(),ae.classList.add("blink-now"),clearTimeout($e),$e=setTimeout(()=>ae.classList.remove("blink-now"),300))}return(ae,we)=>(C(),E("aside",B5,[p("div",{class:"col",style:Wt({width:e.colWidth+"px"})},[p("div",F5,[p("div",H5,[(C(),E("svg",{ref_key:"logoRef",ref:xe,class:Oe(["ch-logo",{"is-dev":S(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:se},[...we[19]||(we[19]=[_r('<defs data-v-bdcf1ef0><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-bdcf1ef0><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-bdcf1ef0></rect><g class="ch-eyes" fill="#000" data-v-bdcf1ef0><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-bdcf1ef0></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-bdcf1ef0></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-bdcf1ef0></rect>',2)])],2)),p("span",W5,[we[20]||(we[20]=ft("Kimi Code",-1)),S(o)?(C(),E("span",U5," · "+O(S(s)),1)):ie("",!0)])]),p("button",{type:"button",class:"collapse-btn",title:S(n)("sidebar.collapseSidebar"),"aria-label":S(n)("sidebar.collapseSidebar"),onClick:we[0]||(we[0]=Ze(qe=>r("collapse"),["stop"]))},[...we[21]||(we[21]=[_r('<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-bdcf1ef0><path d="M11 6h9" data-v-bdcf1ef0></path><path d="M11 12h9" data-v-bdcf1ef0></path><path d="M11 18h9" data-v-bdcf1ef0></path><path d="M7 9l-3 3 3 3" data-v-bdcf1ef0></path></svg>',1)])],8,q5),p("button",{type:"button",class:"settings-btn",title:S(n)("settings.title"),"aria-label":S(n)("settings.title"),onClick:we[1]||(we[1]=Ze(qe=>r("openSettings"),["stop"]))},[...we[22]||(we[22]=[p("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"},[p("circle",{cx:"12",cy:"12",r:"3"}),p("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,j5)]),p("div",z5,[we[24]||(we[24]=p("svg",{class:"search-icon",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"},[p("circle",{cx:"7",cy:"7",r:"5"}),p("path",{d:"M11 11l3 3"})],-1)),jt(p("input",{"onUpdate:modelValue":we[2]||(we[2]=qe=>l.value=qe),class:"search-input",type:"text",placeholder:S(n)("sidebar.searchPlaceholder"),"aria-label":S(n)("sidebar.searchPlaceholder"),onKeydown:Ns(Ze(d,["stop"]),["esc"])},null,40,V5),[[Wn,l.value]]),c.value?(C(),E("button",{key:0,type:"button",class:"search-clear",title:S(n)("sidebar.searchClear"),"aria-label":S(n)("sidebar.searchClear"),onClick:Ze(d,["stop"])},[...we[23]||(we[23]=[p("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,K5)):ie("",!0)]),p("div",G5,[p("button",{class:"btn-new-chat",onClick:we[3]||(we[3]=Ze(qe=>r("create"),["stop"]))},[we[25]||(we[25]=p("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"},[p("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)),p("span",null,O(S(n)("sidebar.newChat")),1)]),ie("",!0)]),c.value?(C(),E("div",Y5,[u.value.length>0?(C(!0),E(Pe,{key:0},Xe(u.value,qe=>(C(),Ve(fx,{key:qe.id,session:qe,active:qe.id===e.activeId,"approval-count":e.pendingBySession[qe.id]?.approvals??0,"question-count":e.pendingBySession[qe.id]?.questions??0,unread:e.unreadBySession[qe.id]??!1,onSelect:we[5]||(we[5]=nt=>f(nt)),onRename:we[6]||(we[6]=(nt,at)=>r("rename",nt,at)),onArchive:we[7]||(we[7]=nt=>r("archive",nt)),onFork:we[8]||(we[8]=nt=>r("fork",nt))},null,8,["session","active","approval-count","question-count","unread"]))),128)):(C(),E("div",X5,O(S(n)("sidebar.searchNoResults")),1))])):(C(),E("div",Q5,[e.groups.length===0?(C(),E("div",Z5,O(S(n)("workspace.noWorkspace")),1)):(C(!0),E(Pe,{key:1},Xe(e.groups,qe=>(C(),E("div",{key:qe.workspace.id,class:Oe(["ws-drop-target",{"drop-before":w.value?.id===qe.workspace.id&&w.value.position==="before","drop-after":w.value?.id===qe.workspace.id&&w.value.position==="after"}]),onDragover:nt=>x(nt,qe.workspace.id),onDrop:nt=>L(qe.workspace.id)},[vt(D5,{group:qe,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"selected-ids":N.value,"renaming-id":$.value,"rename-value":P.value,"rename-input-ref":I(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":Se.value,dragging:_.value===qe.workspace.id,"is-collapsed":h,onGroupClick:v,onGroupContextmenu:be,onToggleWsMenu:fe,onCreateInWorkspace:we[9]||(we[9]=nt=>r("createInWorkspace",nt)),onSelectSession:M,onRenameSession:we[10]||(we[10]=(nt,at)=>r("rename",nt,at)),onArchiveSession:we[11]||(we[11]=nt=>r("archive",nt)),onForkSession:we[12]||(we[12]=nt=>r("fork",nt)),onLoadMore:we[13]||(we[13]=nt=>r("loadMoreSessions",nt)),onConfirmRename:D,onCancelRename:F,onUpdateRenameValue:z,onWsDragstart:k,onWsDragend:b},null,8,["group","active-workspace-id","active-id","selected-ids","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,J5))),128))]))],4),V.value?(C(),E("div",{key:0,ref_key:"ghMenuRef",ref:G,class:"gh-menu",style:Wt(K.value),onClick:we[14]||(we[14]=Ze(()=>{},["stop"]))},[p("button",{type:"button",class:"ghm-item",onClick:We},O(S(n)("sidebar.copyPath")),1),p("button",{type:"button",class:"ghm-item",onClick:ue},O(S(n)("sidebar.rename")),1),p("button",{type:"button",class:"ghm-item del",onClick:ve},O(ne.value&&Ne.value===ne.value.id?S(n)("sidebar.confirm"):S(n)("sidebar.removeWorkspace")),1)],4)):ie("",!0),Se.value!==null&&q.value?(C(),E("div",{key:1,ref_key:"wsMenuRef",ref:he,class:"ws-menu",style:Wt(ee.value),onClick:we[18]||(we[18]=Ze(()=>{},["stop"]))},[p("button",{class:"ws-menu-item",onClick:we[15]||(we[15]=Ze(qe=>Y(q.value),["stop"]))},O(S(n)("sidebar.copyPath")),1),we[27]||(we[27]=p("div",{class:"ws-menu-divider"},null,-1)),p("button",{class:"ws-menu-item",onClick:we[16]||(we[16]=Ze(qe=>re(q.value),["stop"]))},O(S(n)("sidebar.rename")),1),we[28]||(we[28]=p("div",{class:"ws-menu-divider"},null,-1)),p("button",{class:"ws-menu-item del",onClick:we[17]||(we[17]=Ze(qe=>ge(q.value),["stop"]))},O(Ne.value===q.value.id?S(n)("sidebar.confirm"):S(n)("sidebar.removeWorkspace")),1)],4)):ie("",!0)]))}}),tN=bt(eN,[["__scopeId","data-v-bdcf1ef0"]]);function nN(e){try{const t=bn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function oN(e,t){try{Tn(e,String(t))}catch{}}function sN(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(w){return Number.isFinite(w)?Math.min(MC(s),Math.max(o,Math.round(w))):n}const l=te(r(nN(t)??n)),a=te(!1);function c(w){const k=r(w);l.value=k,oN(t,k)}let u=0,d=0,f=null,g=-1;function h(w){if(!a.value)return;const k=w.clientX-u;c(d+(i?-k:k))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(g)}catch{}f.removeEventListener("pointermove",h),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,g=-1}}function _(w){w.preventDefault(),a.value=!0,u=w.clientX,d=r(l.value),f=w.currentTarget,g=w.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(g)}catch{}f.addEventListener("pointermove",h),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return Yo(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:_}}const iN=["aria-label"],rN=Qe({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),{width:i,dragging:r,onPointerDown:l}=sN({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),ze(i,a=>o("update:width",a)),ze(r,a=>o("update:dragging",a)),(a,c)=>(C(),E("div",{class:Oe(["rh",{dragging:S(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??S(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>S(l)&&S(l)(...u))},[...c[1]||(c[1]=[p("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,iN))}}),gb=bt(rN,[["__scopeId","data-v-0d454900"]]),lN={preview:"Preview"},aN={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…"},cN={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",copySessionId:"Copy session ID ⧉",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Show more ({count})",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchClear:"Clear search",searchNoResults:"No matching sessions"},uN={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"},dN={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",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…"},fN={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"},hN={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)",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking"},pN={title:"Sign in to Kimi Code",close:"Close (Esc)",starting:"Starting authorization flow…",lead:"Click the button below to authorize in a new browser tab.",authorizeInBrowser:"Authorize in browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAutoClose:"Waiting for authorization, signs in automatically…",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade kimi-code and try again"},mN={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"},gN={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"},vN={justNow:"just now"},yN={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",plan_review:"Ready to build with this plan?",generic:"Approve action?"},subagentBadge:"sub agent · {name}",required:"APPROVAL REQUIRED",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Esc to cancel)",feedbackHint:"Enter to submit · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"+Feedback",approvePlan:"Approve plan",revise:"Revise",rejectAndExit:"Reject and Exit"},kN={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},bN={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"},wN={panelTitle:"Thinking",close:"Close"},_N={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"},CN={},SN={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"}},xN={searching:"Searching…",noMatch:"No matches"},TN={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."}},AN={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},MN={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"}},EN={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},IN={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"},$N={label:"Theme",modern:"Explore",kimi:"Native",colorSchemeLabel:"Appearance",light:"Light",dark:"Dark",system:"System"},NN={preview:"预览"},LN={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",comingSoon:"敬请期待"},ON={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",confirm:"确认",cancel:"取消",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID ⧉",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"展开更多 ({count})",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchClear:"清除搜索",searchNoResults:"没有匹配的会话"},PN={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:"此会话在完成前被中断"},RN={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:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…"},DN={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:"进行中"},BN={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",steerNow:"立即插入 ⌃S",steerTitle:"不等当前回合结束,把消息直接插进正在运行的任务(Ctrl+S / ⌘S)",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking"},FN={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试"},HN={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 关闭"},WN={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},UN={justNow:"刚刚"},qN={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},jN={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},zN={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:"展开"},VN={panelTitle:"思考过程",close:"关闭"},KN={title:"改动",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},GN={},YN={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:"无法读取这个文件"}},XN={searching:"搜索中…",noMatch:"无匹配"},QN={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:"目标描述太长了,请精简后重试。"}},ZN={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},JN={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"计划",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"}},e8={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},t8={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},n8={label:"主题",modern:"探索",kimi:"原生",colorSchemeLabel:"外观",light:"浅色",dark:"深色",system:"跟随系统"},o8={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"},s8={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",themeLabel:"主题",modernDesc:"气泡、对话感、更柔和。",kimiDesc:"原生风格:安静、扁平。",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},i8={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",advanced:"Advanced",experimental:"Experimental"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",soundOnComplete:"Play a sound when a turn completes or needs an answer",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",notifyQuestionBody:"A question is waiting for your answer",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",serverVersion:"Server version",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"},r8={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",advanced:"高级",experimental:"实验性"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",soundOnComplete:"会话完成或待回答时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",notifyQuestionBody:"有提问等待你回答",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:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",beta:"实验性",betaToc:"对话目录增强",betaTocHint:"更大的气泡、视口指示器和悬停提示"},l8={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?"},a8={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"detached",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",confirmArchive:"确认归档?"},c8={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"},u8={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},d8={en:{common:lN,app:aN,sidebar:cN,workspace:uN,conversation:dN,status:fN,composer:hN,login:pN,providers:mN,model:gN,sessions:vN,approval:yN,question:kN,tasks:bN,thinking:wN,diff:_N,fileTree:CN,filePreview:SN,mention:xN,warnings:TN,commands:AN,tools:MN,layout:EN,mobile:IN,theme:$N,onboarding:o8,settings:i8,header:l8,sideChat:c8},zh:{common:NN,app:LN,sidebar:ON,workspace:PN,conversation:RN,status:DN,composer:BN,login:FN,providers:HN,model:WN,sessions:UN,approval:qN,question:jN,tasks:zN,thinking:VN,diff:KN,fileTree:GN,filePreview:YN,mention:XN,warnings:QN,commands:ZN,tools:JN,layout:e8,mobile:t8,theme:n8,onboarding:s8,settings:r8,header:a8,sideChat:u8}},hx=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function f8(){const e=bn(Mt.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Cn=B6({legacy:!1,locale:f8(),fallbackLocale:"en",messages:d8});function px(e){Cn.global.locale.value=e,Tn(Mt.locale,e)}const ha=Cn.global.t,h8={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"},p8={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 vl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return p8[t]??t}function Sf(e){const t=h8[vl(e)];return t?ha(t):e}const m8='<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>',g8='<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>',vb='<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>',v8='<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>',yb='<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>',y8='<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>',k8='<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>',b8='<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>',kb='<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>',w8='<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>',_8="";function C8(e){switch(vl(e)){case"read":return m8;case"bash":return g8;case"edit":return vb;case"multi_edit":return vb;case"write":return v8;case"grep":return yb;case"search":return yb;case"glob":return y8;case"ls":return k8;case"web_fetch":return b8;case"todo":return kb;case"task":return kb;default:return(e??"").trim().toLowerCase().includes("skill")?w8:_8}}const mx=80;function S8(e,t=mx){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function x8(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function T8(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 Vt(e){return typeof e=="string"&&e.length>0?e:void 0}function Vr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function A8(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 vm(e){return Vt(e.path)??Vt(e.file_path)??Vt(e.filePath)??Vt(e.filename)}const M8=64;function Kg(e,t,n=!1){const o=(s,i=mx)=>n?s.trim():S8(s,i);try{const s=T8(t);if(!n&&x8(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(vl(e)){case"read":{const r=vm(s);if(!r)return i();const l=Vr(s.offset)??Vr(s.line_start)??Vr(s.start_line),a=Vr(s.limit)??Vr(s.length),c=Vr(s.line_end)??Vr(s.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return o(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=vm(s);return r?o(`${r} ${ha("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=vm(s);return r?o(r):i()}case"bash":{const r=Vt(s.command)??Vt(s.cmd)??Vt(s.script);return r?o(r,M8):i()}case"grep":case"search":{const r=Vt(s.pattern)??Vt(s.query)??Vt(s.regex),l=Vt(s.path)??Vt(s.glob)??Vt(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=Vt(s.pattern)??Vt(s.glob)??Vt(s.query),l=Vt(s.path)??Vt(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):Vt(s.path)?o(Vt(s.path)):i()}case"ls":{const r=Vt(s.path)??Vt(s.dir)??Vt(s.directory)??Vt(s.cwd);return r?o(r):i()}case"web_fetch":{const r=Vt(s.url)??Vt(s.uri);return r?o(A8(r)):i()}case"todo":case"task":{const r=Vt(s.description)??Vt(s.title)??Vt(s.prompt)??Vt(s.name)??Vt(s.subagent_type);if(r)return o(r);const l=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return l?o(ha("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function E8(e){try{switch(vl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return ha("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const o=n.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),o=t.match(/[-−](\d+)/);if(n||o)return`${n?`+${n[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(e.status!=="error")return ha("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?ha("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const I8=1e6,bb=5e3;function wb(e){if(e==="")return[];const t=e.split(`
|
|
39
|
-
`);return t.at(-1)===""&&t.pop(),t}function $8(e,t){const n=wb(e),o=wb(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>bb||i>bb||(s+1)*(i+1)>I8)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let g=1;g<=s;g++)for(let h=1;h<=i;h++)r[g][h]=n[g-1]===o[h-1]?r[g-1][h-1]+1:Math.max(r[g-1][h],r[g][h-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const g of l)g.type==="context"?(u.push({type:"context",text:g.text,oldNo:d,newNo:f}),d++,f++):g.type==="add"?(u.push({type:"add",text:g.text,newNo:f}),f++):(u.push({type:"del",text:g.text,oldNo:d}),d++);return u}function N8(e){let t=0,n=0;for(const o of e)o.type==="add"?t++:o.type==="del"&&n++;return{added:t,removed:n}}function gx(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 vx(e){const t=vl(e.name);if(t!=="edit"&&t!=="write")return null;const n=gx(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const o=typeof n.old_string=="string"?n.old_string:void 0,s=typeof n.new_string=="string"?n.new_string:void 0;return o===void 0||s===void 0?null:$8(o,s)}return null}function L8(e){const t=gx(e);return t&&typeof t.path=="string"?t.path:void 0}function O8(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const P8=["title"],R8=["title"],D8=["src","alt"],B8=["src"],F8=["src"],H8={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"},W8=["points"],U8=["innerHTML"],q8={class:"a"},j8=["title"],z8={class:"rt"},V8=["title"],K8={key:1,class:"chip"},G8={key:2,class:"spin",role:"status","aria-label":"running"},Y8={key:4,class:"tm"},X8={key:0,class:"bb"},Q8={key:0,class:"bb-summary"},Z8={key:1,class:"bb-empty"},J8=!1,eL=Qe({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,o=t,s=H(()=>n.tool.status==="running"&&/^bash$/i.test(n.tool.name)),i=H(()=>!!n.tool.output&&n.tool.output.length>0),r=H(()=>i.value||s.value),l=te(n.tool.defaultExpanded===!0&&r.value),a=H(()=>{const T=vl(n.tool.name);return T==="edit"||T==="write"});function c(){if(a.value&&n.toolDiffPanel){o("openToolDiff",n.tool.id);return}r.value&&(l.value=!l.value)}ze(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status,n.tool.name],()=>{n.tool.defaultExpanded===!0&&r.value&&(l.value=!0)});const u=()=>n.tool.status==="error"?"✕":"✓",d=()=>Sf(n.tool.name),f=()=>C8(n.tool.name),g=()=>Kg(n.tool.name,n.tool.arg),h=()=>Kg(n.tool.name,n.tool.arg,!0),m=()=>{const T=k.value;if(T&&n.tool.status!=="error"){const{added:I,removed:R}=N8(T);if(I||R)return`+${I} −${R}`}return E8({name:n.tool.name,arg:n.tool.arg,output:n.tool.output,timing:n.tool.timing,status:n.tool.status})},_=()=>n.tool.status==="error",w=H(()=>n.tool.status==="ok"?n.tool.media:void 0),k=H(()=>vx(n.tool)),b=H(()=>n.tool.name==="ExitPlanMode"),y=H(()=>b.value?n.tool.planPath:void 0),x=H(()=>{const T=y.value;return T?T.split(/[\\/]+/).pop()||T:""});function L(){y.value&&o("openFile",{path:y.value})}const N=H(()=>J8);function v(T){return T.split(/[\\/]+/).pop()||T}function M(T){return T<1024?`${T} B`:T<1024*1024?`${(T/1024).toFixed(1)} KB`:`${(T/1024/1024).toFixed(1)} MB`}const $=H(()=>{const T=w.value;if(!T)return"";const I=[T.path?v(T.path):Sf(n.tool.name)];return T.mimeType&&I.push(T.mimeType),T.bytes!==void 0&&I.push(M(T.bytes)),T.dimensions&&I.push(T.dimensions),I.join(" · ")});function P(){const T=w.value;T?.kind==="image"&&o("openMedia",T)}return(T,I)=>w.value?(C(),E("div",{key:0,class:Oe(["media-tool",{mob:e.mobile}])},[p("div",{class:"media-title",title:w.value.path||$.value},O($.value),9,P8),w.value.kind==="image"?(C(),E("button",{key:0,type:"button",class:"media-image-button",title:w.value.path||$.value,onClick:P},[p("img",{class:"media-image",src:w.value.url,alt:w.value.path?v(w.value.path):$.value,loading:"lazy"},null,8,D8)],8,R8)):w.value.kind==="video"?(C(),E("video",{key:1,class:"media-video",src:w.value.url,controls:"",preload:"metadata"},null,8,B8)):(C(),E("audio",{key:2,class:"media-audio",src:w.value.url,controls:""},null,8,F8))],2)):(C(),E("div",{key:1,class:Oe(["box",{open:l.value,err:_(),mob:e.mobile,stacked:e.stackPosition!=="single","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[p("div",{class:"bh",onClick:c},[(C(),E("svg",H8,[p("polyline",{points:l.value?"4,6 8,10 12,6":"6,4 10,8 6,12"},null,8,W8)])),f()?(C(),E("span",{key:0,class:"gl",innerHTML:f(),"aria-hidden":"true"},null,8,U8)):ie("",!0),p("span",q8,O(d()),1),l.value?ie("",!0):(C(),E("span",{key:1,class:"p",title:g()},O(g()),9,j8)),p("span",z8,[N.value?(C(),E("button",{key:0,class:"plan-link",type:"button",title:y.value,onClick:Ze(L,["stop"])},"📄 "+O(x.value),9,V8)):ie("",!0),m()?(C(),E("span",K8,O(m()),1)):ie("",!0),e.tool.status==="running"?(C(),E("span",G8)):(C(),E("span",{key:3,class:Oe(e.tool.status==="ok"?"ok":"er")},O(u()),3)),e.tool.timing&&e.tool.name!=="bash"?(C(),E("span",Y8,O(e.tool.timing),1)):ie("",!0)])]),l.value?(C(),E("div",X8,[h()?(C(),E("div",Q8,O(h()),1)):ie("",!0),i.value?ie("",!0):(C(),E("div",Z8,"Waiting for output…")),(C(!0),E(Pe,null,Xe(e.tool.output??[],(R,D)=>(C(),E("div",{key:D},O(R),1))),128))])):ie("",!0)],2))}}),ud=bt(eL,[["__scopeId","data-v-4b9fd75b"]]);var tL=Object.create,Cv=Object.defineProperty,nL=Object.getOwnPropertyDescriptor,yx=Object.getOwnPropertyNames,oL=Object.getPrototypeOf,sL=Object.prototype.hasOwnProperty,kx=(e,t)=>function(){return t||(0,e[yx(e)[0]])((t={exports:{}}).exports,t),t.exports},bx=e=>{let t={};for(var n in e)Cv(t,n,{get:e[n],enumerable:!0});return t},iL=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=yx(t),i=0,r=s.length,l;i<r;i++)l=s[i],!sL.call(e,l)&&l!==n&&Cv(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=nL(t,l))||o.enumerable});return e},wx=(e,t,n)=>(n=e!=null?tL(oL(e)):{},iL(Cv(n,"default",{value:e,enumerable:!0}),e));function rL(e,t,n,o){const s=Number(e[t].meta.id+1).toString();let i="";return typeof o.docId=="string"&&(i=`-${o.docId}-`),i+s}function lL(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function aL(e,t,n,o,s){const i=s.rules.footnote_anchor_name(e,t,n,o,s),r=s.rules.footnote_caption(e,t,n,o,s);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function cL(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
40
|
-
`:`<hr class="footnotes-sep">
|
|
41
|
-
`)+`<section class="footnotes">
|
|
42
|
-
<ol class="footnotes-list">
|
|
43
|
-
`}function uL(){return`</ol>
|
|
44
|
-
</section>
|
|
45
|
-
`}function dL(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function fL(){return`</li>
|
|
46
|
-
`}function hL(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function pL(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=aL,e.renderer.rules.footnote_block_open=cL,e.renderer.rules.footnote_block_close=uL,e.renderer.rules.footnote_open=dL,e.renderer.rules.footnote_close=fL,e.renderer.rules.footnote_anchor=hL,e.renderer.rules.footnote_caption=lL,e.renderer.rules.footnote_anchor_name=rL;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let g;for(g=d+2;g<f;g++){if(l.src.charCodeAt(g)===32)return!1;if(l.src.charCodeAt(g)===93)break}if(g===d+2||g+1>=f||l.src.charCodeAt(++g)!==58)return!1;if(u)return!0;g++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const h=l.src.slice(d+2,g-2);l.env.footnotes.refs[`:${h}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:h},m.level=l.level++,l.tokens.push(m);const _=l.bMarks[a],w=l.tShift[a],k=l.sCount[a],b=l.parentType,y=g,x=l.sCount[a]+g-(l.bMarks[a]+l.tShift[a]);let L=x;for(;g<f;){const v=l.src.charCodeAt(g);if(n(v))v===9?L+=4-L%4:L++;else break;g++}l.tShift[a]=g-y,l.sCount[a]=L-x,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=b,l.blkIndent-=4,l.tShift[a]=w,l.sCount[a]=k,l.bMarks[a]=_;const N=new l.Token("footnote_reference_close","",-1);return N.level=--l.level,l.tokens.push(N),!0}function s(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const g=l.env.footnotes.list.length,h=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,h);const m=l.push("footnote_ref","",0);m.meta={id:g},l.env.footnotes.list[g]={content:l.src.slice(d,f),tokens:h}}return l.pos=f+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let g;l.env.footnotes.refs[`:${f}`]<0?(g=l.env.footnotes.list.length,l.env.footnotes.list[g]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=g):g=l.env.footnotes.refs[`:${f}`];const h=l.env.footnotes.list[g].count;l.env.footnotes.list[g].count++;const m=l.push("footnote_ref","",0);m.meta={id:g,subId:h,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(h){return h.type==="footnote_reference_open"?(d=!0,c=[],u=h.meta.label,!1):h.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(h),!d)}),!l.env.footnotes.list))return;const g=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let h=0,m=g.length;h<m;h++){const _=new l.Token("footnote_open","",1);if(_.meta={id:h,label:g[h].label},l.tokens.push(_),g[h].tokens){a=[];const b=new l.Token("paragraph_open","p",1);b.block=!0,a.push(b);const y=new l.Token("inline","",0);y.children=g[h].tokens,y.content=g[h].content,a.push(y);const x=new l.Token("paragraph_close","p",-1);x.block=!0,a.push(x)}else g[h].label&&(a=f[`:${g[h].label}`]);a&&(l.tokens=l.tokens.concat(a));let w;l.tokens[l.tokens.length-1].type==="paragraph_close"?w=l.tokens.pop():w=null;const k=g[h].count>0?g[h].count:1;for(let b=0;b<k;b++){const y=new l.Token("footnote_anchor","",0);y.meta={id:h,subId:b,label:g[h].label},l.tokens.push(y)}w&&l.tokens.push(w),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",o,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",s),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function mL(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==43)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){let i;const r=[],l=s.length;for(let a=0;a<l;a++){const c=s[a];if(c.marker!==43||c.end===-1)continue;const u=s[c.end];i=o.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=o.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",o.tokens[u.token-1].type==="text"&&o.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<o.tokens.length&&o.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=o.tokens[c],o.tokens[c]=o.tokens[a],o.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(o){const s=o.tokens_meta,i=(o.tokens_meta||[]).length;n(o,o.delimiters);for(let r=0;r<i;r++)s[r]&&s[r].delimiters&&n(o,s[r].delimiters)})}function gL(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==61)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){const i=[],r=s.length;for(let l=0;l<r;l++){const a=s[l];if(a.marker!==61||a.end===-1)continue;const c=s[a.end],u=o.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=o.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",o.tokens[c.token-1].type==="text"&&o.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<o.tokens.length&&o.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=o.tokens[a];o.tokens[a]=o.tokens[l],o.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(o){let s;const i=o.tokens_meta,r=(o.tokens_meta||[]).length;for(n(o,o.delimiters),s=0;s<r;s++)i[s]&&i[s].delimiters&&n(o,i[s].delimiters)})}const vL=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function yL(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==126||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(vL,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function kL(e){e.inline.ruler.after("emphasis","sub",yL)}const bL=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function wL(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==94||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(bL,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function _L(e){e.inline.ruler.after("emphasis","sup",wL)}var CL=kx({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,_){_=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},_),m.core.ruler.after("inline","github-task-lists",function(w){for(var k=w.tokens,b=0,y=2;y<k.length;y++)s(k,y)&&(i(k[y],b,_,w.Token),b+=1,n(k[y-2],"class",_.liClass),n(k[o(k,y-2)],"class",_.ulClass))})};function n(m,_,w){var k=m.attrIndex(_),b=[_,w];k<0?m.attrPush(b):m.attrs[k]=b}function o(m,_){for(var w=m[_].level-1,k=_-1;k>=0;k--)if(m[k].level===w)return k;return-1}function s(m,_){return d(m[_])&&f(m[_-1])&&g(m[_-2])&&h(m[_])}function i(m,_,w,k){var b=w.idPrefix+_;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(b,k)),m.children.push(a(k)),m.children.unshift(r(m,b,w,k)),w.divWrap&&(m.children.unshift(c(w,k)),m.children.push(u(k)))}function r(m,_,w,k){var b=new k("checkbox_input","input",0);return b.attrs=[["type","checkbox"],["id",_]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&b.attrs.push(["checked","true"]),w.disabled===!0&&b.attrs.push(["disabled","true"]),b}function l(m,_){var w=new _("label_open","label",1);return w.attrs=[["for",m]],w}function a(m){return new m("label_close","label",-1)}function c(m,_){var w=new _("checkbox_open","div",0);return w.attrs=[["class",m.divClass]],w}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function g(m){return m.type==="list_item_open"}function h(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),SL=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୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢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;怳Ādpuct;戏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ǣጓ\0y;䐎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Ā;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀ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Ā;elƀ;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\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»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ↄⅪ←ٖ↛ǰ↉\0proø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;䅓Ācrir;榿;쀀𝔬ͯ\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\0m;櫳;櫽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))),xL=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),ym;const TL=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]]),AL=(ym=String.fromCodePoint)!==null&&ym!==void 0?ym: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 ML(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=TL.get(e))!==null&&t!==void 0?t:e}var so;(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"})(so||(so={}));const EL=32;var hr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(hr||(hr={}));function Gg(e){return e>=so.ZERO&&e<=so.NINE}function IL(e){return e>=so.UPPER_A&&e<=so.UPPER_F||e>=so.LOWER_A&&e<=so.LOWER_F}function $L(e){return e>=so.UPPER_A&&e<=so.UPPER_Z||e>=so.LOWER_A&&e<=so.LOWER_Z||Gg(e)}function NL(e){return e===so.EQUALS||$L(e)}var oo;(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"})(oo||(oo={}));var ur;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ur||(ur={}));var LL=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=oo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ur.Strict}startEntity(e){this.decodeMode=e,this.state=oo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case oo.EntityStart:return e.charCodeAt(t)===so.NUM?(this.state=oo.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=oo.NamedEntity,this.stateNamedEntity(e,t));case oo.NumericStart:return this.stateNumericStart(e,t);case oo.NumericDecimal:return this.stateNumericDecimal(e,t);case oo.NumericHex:return this.stateNumericHex(e,t);case oo.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|EL)===so.LOWER_X?(this.state=oo.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=oo.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,o){if(t!==n){const s=n-t;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(t,s),o),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(Gg(o)||IL(o))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(Gg(o))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===so.SEMI)this.consumed+=1;else if(this.decodeMode===ur.Strict)return 0;return this.emitCodePoint(ML(this.result),this.consumed),this.errors&&(e!==so.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let o=n[this.treeIndex],s=(o&hr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=OL(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===ur.Attribute&&(s===0||NL(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&hr.VALUE_LENGTH)>>14,s!==0){if(i===so.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==ur.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,o=(n[t]&hr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[e]&~hr.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case oo.NamedEntity:return this.result!==0&&(this.decodeMode!==ur.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case oo.NumericDecimal:return this.emitNumericEntity(0,2);case oo.NumericHex:return this.emitNumericEntity(0,3);case oo.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case oo.EntityStart:return 0}}};function _x(e){let t="";const n=new LL(e,o=>t+=AL(o));return function(s,i){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(i);const c=n.write(s,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+s.slice(r);return t="",a}}function OL(e,t,n,o){const s=(t&hr.BRANCH_LENGTH)>>7,i=t&hr.JUMP_TABLE;if(s===0)return i!==0&&o===i?n:-1;if(i){const a=o-i;return a<0||a>=s?-1:e[n+a]-1}let r=n,l=r+s-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<o)r=a+1;else if(c>o)l=a-1;else return e[a+s]}return-1}const PL=_x(SL);_x(xL);function Sv(e,t=ur.Legacy){return PL(e,t)}var RL=wx(CL());const _b={};function DL(e){let t=_b[e];if(t)return t;t=_b[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function Ah(e,t){typeof t!="string"&&(t=Ah.defaultChars);const n=DL(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let s="";for(let i=0,r=o.length;i<r;i+=3){const l=parseInt(o.slice(i+1,i+3),16);if(l<128){s+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(o.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?s+="��":s+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16),u=parseInt(o.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}Ah.defaultChars=";/?:@&=+$,#";Ah.componentChars="";var Yg=Ah;const Cb={};function BL(e){let t=Cb[e];if(t)return t;t=Cb[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Mh(e,t,n){typeof t!="string"&&(n=t,t=Mh.defaultChars),typeof n>"u"&&(n=!0);const o=BL(t);let s="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){s+=e.slice(i,i+3),i+=2;continue}if(l<128){s+=o[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}Mh.defaultChars=";/?:@&=+$,-_.!~*'()#";Mh.componentChars="-_.!~*'()";var Cx=Mh;function xv(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 xf(){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 FL=/^([a-z0-9.+-]+:)/i,HL=/:[0-9]*$/,WL=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,UL=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
47
|
-
`," "]),qL=["'"].concat(UL),Sb=["%","/","?",";","#"].concat(qL),xb=["/","?","#"],jL=255,Tb=/^[+a-z0-9A-Z_-]{0,63}$/,zL=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ab={javascript:!0,"javascript:":!0},Mb={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function VL(e,t){if(e&&e instanceof xf)return e;const n=new xf;return n.parse(e,t),n}xf.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=WL.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=FL.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&Ab[r])&&(i=i.substr(2),this.slashes=!0)),!Ab[r]&&(s||r&&!Mb[r])){let c=-1;for(let h=0;h<xb.length;h++)o=i.indexOf(xb[h]),o!==-1&&(c===-1||o<c)&&(c=o);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let h=0;h<Sb.length;h++)o=i.indexOf(Sb[h]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g){const h=this.hostname.split(/\./);for(let m=0,_=h.length;m<_;m++){const w=h[m];if(w&&!w.match(Tb)){let k="";for(let b=0,y=w.length;b<y;b++)w.charCodeAt(b)>127?k+="x":k+=w[b];if(!k.match(Tb)){const b=h.slice(0,m),y=h.slice(m+1),x=w.match(zL);x&&(b.push(x[1]),y.unshift(x[2])),y.length&&(i=y.join(".")+i),this.hostname=b.join(".");break}}}}this.hostname.length>jL&&(this.hostname=""),g&&(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),Mb[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};xf.prototype.parseHost=function(e){let t=HL.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 Tv=VL,Sx=bx({decode:()=>Yg,encode:()=>Cx,format:()=>xv,parse:()=>Tv}),xx=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Tx=/[\0-\x1F\x7F-\x9F]/,KL=/[\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]/,Ax=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,GL=/[\$\+<->\^`\|~\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]/,Mx=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,YL=bx({Any:()=>xx,Cc:()=>Tx,Cf:()=>KL,P:()=>Ax,S:()=>GL,Z:()=>Mx}),XL=Object.defineProperty,Ex=e=>{let t={};for(var n in e)XL(t,n,{get:e[n],enumerable:!0});return t},Fn=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,o=t.length;n<o;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},QL=Ex({arrayReplaceAt:()=>sO,assign:()=>nO,countLines:()=>Mn,escapeHtml:()=>hO,escapeRE:()=>mO,fromCodePoint:()=>eu,has:()=>tO,isMdAsciiPunct:()=>Mf,isPunctChar:()=>Af,isPunctCode:()=>Xg,isSpace:()=>oO,isString:()=>JL,isValidEntityCode:()=>Ih,isWhiteSpace:()=>Jc,lib:()=>gO,mdurl:()=>Sx,normalizeReference:()=>Eh,ucmicro:()=>Tf,unescapeAll:()=>tu,unescapeMd:()=>aO});const Tf=YL;function ZL(e){return Object.prototype.toString.call(e)}function JL(e){return ZL(e)==="[object String]"}const eO=Object.prototype.hasOwnProperty;function tO(e,t){return eO.call(e,t)}function nO(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(o=>{e[o]=n[o]})}}),e}function oO(e){return e===9||e===32}function Jc(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 Af(e){return Tf.P.test(e)||Tf.S.test(e)}const Eb=new Map;function Xg(e){if(Mf(e))return!0;const t=Eb.get(e);if(t!==void 0)return t;const n=Af(String.fromCharCode(e));return Eb.set(e,n),n}function Mf(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 Eh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function sO(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Ih(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 eu(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 Ix=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,iO=new RegExp(`${Ix.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),rO=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function lO(e,t){if(t.charCodeAt(0)===35&&rO.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Ih(o)?eu(o):e}const n=Sv(e);return n!==e?n:e}function aO(e){return e.includes("\\")?e.replace(Ix,"$1"):e}function tu(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(iO,(t,n,o)=>n||lO(t,o))}const cO=/[&<>"]/,uO=/[&<>"]/g,dO={"&":"&","<":"<",">":">",'"':"""};function fO(e){return dO[e]}function hO(e){return cO.test(e)?e.replace(uO,fO):e}const pO=/[.?*+^$[\]\\(){}|-]/g;function mO(e){return e.replace(pO,"\\$&")}const gO={mdurl:Sx,ucmicro:Tf};function Mn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
48
|
-
`,n+1))!==-1;)t++;return t}const vO=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,yO=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,kO=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,Av=["references","footnotes","abbreviations","abbr","abbrs"],Mv=Symbol.for("markdown-it-ts.global-state"),Ev=Object.prototype.hasOwnProperty;function Ib(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function zs(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function vr(e){if(Array.isArray(e))return e.map(t=>vr(t));if(zs(e)){const t={};for(const n of Object.keys(e))t[n]=vr(e[n]);return t}return e}function Ef(e){return Array.isArray(e)?e.map((t,n)=>String(n)):zs(e)?Object.keys(e):[]}function Qg(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(!Qg(e[n],t[n]))return!1;return!0}if(zs(e)||zs(t)){if(!zs(e)||!zs(t))return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n)if(!Ev.call(t,s)||!Qg(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function $x(e,t){if(Array.isArray(e))return e[Number(t)];if(zs(e))return e[t]}function bO(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=vr(t[n]);return e}if(zs(e)&&zs(t)){for(const n of Object.keys(e))Ev.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=vr(t[n]);return e}return vr(t)}function wO(e,t,n){const o=n.ownedKeys??[],s=e[t];if(zs(s)||Array.isArray(s)){const i=new Set(Ef(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=vr($x(n.value,r)):delete s[r];!n.existed&&Ef(s).length===0&&delete e[t];return}n.existed?e[t]=vr(n.value):delete e[t]}function Iv(e){const t=e[Mv];return Ib(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Ib(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function _O(e,t){Object.defineProperty(e,Mv,{value:t,enumerable:!1,configurable:!0,writable:!0})}function Ho(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:vO.test(e)?"footnote-definition":yO.test(e)?"abbreviation-definition":kO.test(e)?"reference-definition":null}function vu(e){return Iv(e)?.reason??null}function pa(e,t,n){if(vu(e)&&Hi(e),!t)return n();$v(e,t);try{const o=n();return Nv(e),o}catch(o){throw Hi(e),o}}function $v(e,t){try{Hi(e);const n={};for(const o of Av)n[o]=Ev.call(e,o)?{existed:!0,value:vr(e[o])}:{existed:!1};_O(e,{reason:t,snapshot:n})}catch{}}function Nv(e){const t=Iv(e);if(t)for(const n of Av){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!zs(s)&&!Array.isArray(s))continue;const i=new Set(Ef(o.existed?o.value:void 0));o.ownedKeys=Ef(s).filter(r=>i.has(r)?!Qg(s[r],$x(o.value,r)):!0)}}function Hi(e){const t=Iv(e);if(t){for(const n of Av){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){wO(e,n,o);continue}o.existed?e[n]=bO(e[n],o.value):delete e[n]}delete e[Mv]}}const Zg=Symbol.for("markdown-it-ts.diagnostics");function $h(e,t){if(e)try{const n=e[Zg];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[Zg]=o,o}catch{return}}function xi(e){return $h(e,!1)}function CO(e){if(e)try{const t=e[Zg];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function To(e){CO(e)}function Dn(e,t){const n=$h(e,!0);n&&(n.strategy=t)}function km(e,t){const n=$h(e,!0);n&&(n.chunk=t)}function Nx(e,t){const n=$h(e,!0);n&&(n.unbounded=t)}function SO(e){const t={};e=e||{},t.src_Any=xx.source,t.src_Cc=Tx.source,t.src_Z=Mx.source,t.src_P=Ax.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 Jg(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Nh(e){return Object.prototype.toString.call(e)}function xO(e){return Nh(e)==="[object String]"}function TO(e){return Nh(e)==="[object Object]"}function AO(e){return Nh(e)==="[object RegExp]"}function $b(e){return Nh(e)==="[object Function]"}function MO(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Lx={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function EO(e){return Object.keys(e||{}).reduce(function(t,n){return t||Lx.hasOwnProperty(n)},!1)}const IO={"http:":{validate:function(e,t,n){const o=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},$O="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]",NO="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function LO(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function Nb(){return function(e,t){t.normalize(e)}}function If(e){const t=e.re=SO(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push($O),n.push(t.src_xn),t.src_tlds=n.join("|");function o(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const s=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,TO(a)){AO(a.validate)?c.validate=LO(a.validate):$b(a.validate)?c.validate=a.validate:i(l,a),$b(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Nb();return}if(xO(a)){s.push(l);return}i(l,a)}),s.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:Nb()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(MO).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function Ox(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function vs(e,t){if(!(this instanceof vs))return new vs(e,t);t||EO(e)&&(t=e,e={}),this.__opts__=Jg({},Lx,t),this.__schemas__=Jg({},IO,e),this.__compiled__={},this.__tlds__=NO,this.__tlds_replaced__=!1,this.re={},If(this)}vs.prototype.add=function(t,n){return this.__schemas__[t]=n,If(this),this};vs.prototype.set=function(t){return this.__opts__=Jg(this.__opts__,t),this};vs.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};vs.prototype.pretest=function(t){return this.re.pretest.test(t)};vs.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};vs.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,g){return f?g?f.index!==g.index?f.index<g.index?f:g:f.lastIndex>=g.lastIndex?f:g:f:g}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[o[u[0]],i[u[1]],s[u[2]]],g=c(c(f[0],f[1]),f[2]);if(!g)break;if(g===f[0]?u[0]++:g===f[1]?u[1]++:u[2]++,g.index<d)continue;const h=new Ox(t,g.schema,g.index,g.lastIndex);this.__compiled__[h.schema].normalize(h,this),n.push(h),d=g.lastIndex}return n.length?n:null};vs.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;const s=new Ox(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};vs.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,s,i){return o!==i[s-1]}).reverse(),If(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,If(this),this)};vs.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};vs.prototype.onCompile=function(){};var Px=vs,OO=kx({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,_=Math.floor,w=String.fromCharCode;function k(D){throw new RangeError(h[D])}function b(D,F){const z=[];let V=D.length;for(;V--;)z[V]=F(D[V]);return z}function y(D,F){const z=D.split("@");let V="";z.length>1&&(V=z[0]+"@",D=z[1]),D=D.replace(g,".");const ne=b(D.split("."),F).join(".");return V+ne}function x(D){const F=[];let z=0;const V=D.length;for(;z<V;){const ne=D.charCodeAt(z++);if(ne>=55296&&ne<=56319&&z<V){const K=D.charCodeAt(z++);(K&64512)==56320?F.push(((ne&1023)<<10)+(K&1023)+65536):(F.push(ne),z--)}else F.push(ne)}return F}const L=D=>String.fromCodePoint(...D),N=function(D){return D>=48&&D<58?26+(D-48):D>=65&&D<91?D-65:D>=97&&D<123?D-97:36},v=function(D,F){return D+22+75*(D<26)-((F!=0)<<5)},M=function(D,F,z){let V=0;for(D=z?_(D/700):D>>1,D+=_(D/F);D>m*26>>1;V+=36)D=_(D/m);return _(V+(m+1)*D/(D+38))},$=function(D){const F=[],z=D.length;let V=0,ne=128,K=72,G=D.lastIndexOf("-");G<0&&(G=0);for(let X=0;X<G;++X)D.charCodeAt(X)>=128&&k("not-basic"),F.push(D.charCodeAt(X));for(let X=G>0?G+1:0;X<z;){const be=V;for(let We=1,ue=36;;ue+=36){X>=z&&k("invalid-input");const ve=N(D.charCodeAt(X++));ve>=36&&k("invalid-input"),ve>_((2147483647-V)/We)&&k("overflow"),V+=ve*We;const Ne=ue<=K?1:ue>=K+26?26:ue-K;if(ve<Ne)break;const Re=36-Ne;We>_(2147483647/Re)&&k("overflow"),We*=Re}const le=F.length+1;K=M(V-be,le,be==0),_(V/le)>2147483647-ne&&k("overflow"),ne+=_(V/le),V%=le,F.splice(V++,0,ne)}return String.fromCodePoint(...F)},P=function(D){const F=[];D=x(D);const z=D.length;let V=128,ne=0,K=72;for(const be of D)be<128&&F.push(w(be));const G=F.length;let X=G;for(G&&F.push("-");X<z;){let be=2147483647;for(const We of D)We>=V&&We<be&&(be=We);const le=X+1;be-V>_((2147483647-ne)/le)&&k("overflow"),ne+=(be-V)*le,V=be;for(const We of D)if(We<V&&++ne>2147483647&&k("overflow"),We===V){let ue=ne;for(let ve=36;;ve+=36){const Ne=ve<=K?1:ve>=K+26?26:ve-K;if(ue<Ne)break;const Re=ue-Ne,Q=36-Ne;F.push(w(v(Ne+Re%Q,0))),ue=_(Re/Q)}F.push(w(v(ue,0))),K=M(ne,le,X===G),ne=0,++X}++ne,++V}return F.join("")},R={version:"2.3.1",ucs2:{decode:x,encode:L},decode:$,encode:P,toASCII:function(D){return y(D,function(F){return f.test(F)?"xn--"+P(F):F})},toUnicode:function(D){return y(D,function(F){return d.test(F)?$(F.slice(4).toLowerCase()):F})}};t.exports=R})}),Rx=wx(OO());function Lv(e,t,n){let o,s=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<n;){if(o=e.charCodeAt(s),o===10||o===60)return i;if(o===62)return i.pos=s+1,i.str=tu(e.slice(t+1,s)),i.ok=!0,i;if(o===92&&s+1<n){s+=2;continue}s++}return i}let r=0;for(;s<n&&(o=e.charCodeAt(s),!(o===32||o<32||o===127));){if(o===92&&s+1<n){if(e.charCodeAt(s+1)===32)break;s+=2;continue}if(o===40&&(r++,r>32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=tu(e.slice(t,s)),i.pos=s,i.ok=!0),i}var Dx=Lv;const Rd=-2;function PO(e,t,n,o){let s=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(s--,s===0)return i;if(o){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return Rd}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return Rd;if(r===91){s++,i++;continue}i++}return-1}function Ov(e,t,n){let o=1,s=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=PO(l,t,a,n);if(f!==Rd)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let g=-1;return s&&(g=e.pos),e.pos=c,g}var $f=Ov;function Pv(e,t,n,o){let s,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)r.str=o.str,r.marker=o.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(s=e.charCodeAt(i),s===r.marker)return r.pos=i+1,r.str+=tu(e.slice(t,i)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=tu(e.slice(t,i)),r}var Bx=Pv;function Lh(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 Rv(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function RO(e,t,n){const o=Lh(e,t),s=[t,n];o<0?Rv(e,s):e.attrs[o]=s}function DO(e,t){const n=Lh(e,t);return n>=0?e.attrs[n][1]:null}function BO(e,t,n){const o=Lh(e,t);o<0?Rv(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var FO=Ex({attrGet:()=>DO,attrIndex:()=>Lh,attrJoin:()=>BO,attrPush:()=>Rv,attrSet:()=>RO,parseLinkDestination:()=>Lv,parseLinkLabel:()=>Ov,parseLinkTitle:()=>Pv});function HO(e){return e.includes("\r")||e.includes("\0")}function Fx(e){return typeof e=="string"?e:e.toString()}function WO(e){if(e.inlineMode){const t=new Fn("inline","",0);t.content=Fx(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 UO=/^([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])?)*)$/,qO=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function jO(e,t){let n=e.pos;const o=e.src;if(o.charCodeAt(n)!==60)return!1;const s=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=o.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=o.slice(s+1,n);if(qO.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(UO.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 zO=jO;function VO(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o<i&&n.charCodeAt(o)===96;)o++;const r=n.slice(s,o),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=s)return t||(e.pending+=r),e.pos+=l,!0;let a=o,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let f=n.slice(o,c);f.includes(`
|
|
49
|
-
`)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var KO=VO;function Lb(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=o-i[o]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const g=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+g,i[c]=g,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function GO(e){const t=e.tokens_meta,n=e.tokens_meta.length;Lb(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Lb(t[o].delimiters)}var YO=GO;function XO(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;const s=e.scanDelims(e.pos,o===42);if(!s||s.length===0)return!1;for(let i=0;i<s.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return e.pos+=s.length,!0}function Ob(e,t){const n=t.length;for(let o=n-1;o>=0;o--){const s=t[o];if(s.marker!==95&&s.marker!==42||s.end===-1)continue;const i=t[s.end],r=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===s.marker&&t[o-1].token===s.token-1&&t[s.end+1].token===i.token+1,l=String.fromCharCode(s.marker),a=e.tokens[s.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[o-1].token].content="",e.tokens[t[s.end+1].token].content="",o--)}}function QO(e){const t=e.tokens_meta,n=e.tokens_meta.length;Ob(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Ob(e,t[o].delimiters)}const Pb={tokenize:XO,postProcess:QO};function Hx(e){return Sv(e)}function Dv(e){return e>=48&&e<=57}function ZO(e){const t=e|32;return Dv(e)||t>=97&&t<=102}function Wx(e){const t=e|32;return t>=97&&t<=122}function JO(e){return Wx(e)||Dv(e)}function eP(e,t,n){let o=t+2;if(o>=n)return null;let s=!1,i=7,r=o;for((e.charCodeAt(o)|32)===120&&(s=!0,i=6,o++,r=o);o<n&&o-r<i;){const l=e.charCodeAt(o);if(!(s?ZO(l):Dv(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function tP(e,t,n){let o=t+1;if(o>=n||!Wx(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&JO(e.charCodeAt(o));)o++;if(o-t-1<2||o>=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return Hx(s)!==s?s:null}function nP(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=eP(e.src,n,o);if(s){if(!t){const i=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=Ih(i)?eu(i):eu(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=tP(e.src,n,o);if(s){const i=Hx(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var oP=nP;const Ux=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),e1=new Array(128),qx=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);e1[e]=`\\${t}`,qx[e]=Ux[e]?t:e1[e]}function Rb(e,t,n){e.pending&&e.pushPending();const o=new Fn("text_special","",0);o.level=e.level,o.content=t,o.markup=n,o.info="escape",e.pendingLevel=e.level,e.tokens.push(o),e.tokens_meta.push(null)}function sP(e,t){let n=e.pos;const o=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=s.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(i=s.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(Rb(e,qx[i],e1[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return Rb(e,i<256&&Ux[i]?r:l,l),e.pos=n+1,!0}var iP=sP;function rP(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=s[t];r&&(r.nesting&&r.nesting<0&&o--,r.level=o,r.nesting&&r.nesting>0&&o++,r.type==="text"&&t+1<i&&s[t+1]?.type==="text"?s[t+1].content=r.content+s[t+1].content:(t!==n&&(s[n]=r),n++))}t!==n&&(s.length=n)}var lP=rP;const jx=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,zx="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",aP=new RegExp(`^(?:${jx}|${zx}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),cP=new RegExp(`^(?:${jx}|${zx})`);function Vx(e){return e===32||e===9||e===10||e===12||e===13}function uP(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||Vx(t)}function dP(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(!Vx(n))return!1}return!1}function fP(e){const t=e|32;return t>=97&&t<=122}function hP(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos,s=e.src;if(s.charCodeAt(o)!==60||o+2>=n)return!1;const i=s.charCodeAt(o+1);if(i!==33&&i!==63&&i!==47&&!fP(i))return!1;const r=s.slice(o).match(aP);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,uP(l)&&e.linkLevel++,dP(l)&&e.linkLevel--}return e.pos+=l.length,!0}var pP=hP;function mP(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const g=e.pos+2,h=$f(e,e.pos+1,!1);if(h<0)return!1;if(i=h+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=Dx(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=Bx(e.src,i,e.posMax),i<f&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(c=i+1,i=$f(e,i),i>=0?s=e.src.slice(c,i++):i=h+1):i=h+1,s||(s=e.src.slice(g,h)),r=e.env.references[Eh(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(g,h);const m=[];e.md.inline.parse(o,e.md,e.env,m);const _=e.push("image","img",0);_.attrs=[["src",u],["alt",""]],_.children=m,_.content=o,a&&_.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var gP=mP;function vP(e,t){let n,o,s,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,g=$f(e,e.pos,!0);if(g<0)return!1;let h=g+1;if(h<d&&e.src.charCodeAt(h)===40){for(c=!1,h++;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);if(h>=d)return!1;if(s=Dx(e.src,h,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?h=s.pos:r="",a=h;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);if(s=Bx(e.src,h,e.posMax),h<d&&a!==h&&s.ok)for(l=s.str,h=s.pos;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);}(h>=d||e.src.charCodeAt(h)!==41)&&(c=!0),h++}if(c){if(typeof e.env.references>"u")return!1;if(h<d&&e.src.charCodeAt(h)===91?(a=h+1,h=$f(e,h),h>=0?o=e.src.slice(a,h++):h=g+1):h=g+1,o||(o=e.src.slice(f,g)),i=e.env.references[Eh(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=g;const m=e.push("link_open","a",1),_=[["href",r]];m.attrs=_,l&&_.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=d,!0}var yP=vP;function Kx(e){const t=e|32;return t>=97&&t<=122}function kP(e){return e>=48&&e<=57}function bP(e){return Kx(e)||kP(e)||e===43||e===45||e===46}function wP(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&bP(e.charCodeAt(t));)t--;return t++,t>=e.length||!Kx(e.charCodeAt(t))?null:e.slice(t)}function _P(e,t,n){let o=t;for(;o<n;){const s=e.charCodeAt(o);if(s<=32||s===127||s===60)break;o++}return e.slice(t,o)}function CP(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=wP(e.pending);if(!s)return!1;const i=_P(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-s.length,!0}function SP(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<s;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var xP=SP;function TP(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const s=e.scanDelims(e.pos,!0);if(!s)return!1;let i=s.length;const r=String.fromCharCode(o);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function Db(e,t){let n;const o=[],s=t.length;for(let i=0;i<s;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&o.push(l.token-1)}for(;o.length;){const i=o.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function AP(e){const t=e.delimiters;Db(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&Db(e,n[o].delimiters)}const Bb={tokenize:TP,postProcess:AP};function Fb(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 MP(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||Fb(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!Fb(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var EP=MP;function Bv(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function IP(e){if(e.length===0)return 0;const t=e.slice().sort((o,s)=>o-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function $P(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 Gx(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,o={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:Bv(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function ma(e,t,n,o,s,i){const r=Gx(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=$P(t,n));a.calls++,a.inclusiveMs+=o,o>a.maxMs&&(a.maxMs=o),a.samples.push(o),i?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=Bv()}function NP(e){const t=Gx(e);if(!t)return null;const n=Object.keys(t.records);for(let o=0;o<n.length;o++){const s=t.records[n[o]];s.medianMs=IP(s.samples)}return t.completedAt=Bv(),t}var Hb=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const o=this.rules.findIndex(s=>s.name===e);o>=0&&this.rules.splice(o,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const o=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(o<0)return;const s=this.rules[o];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(o<0)throw new Error(`Parser rule not found: ${e}`);this.rules[o].fn=t,n?.alt!==void 0&&(this.rules[o].alt=n.alt),this.invalidateCache()}before(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s+1,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const o of this.rules)if(o.enabled&&o.alt)for(const s of o.alt)e.add(s);const t=new Map,n=new Map;for(const o of e){const s=[],i=[];for(const r of this.rules)r.enabled&&(o!==""&&!r.alt?.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(o,s),n.set(o,i)}this.cache=t,this.namedCache=n}},Yx=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.tokens_meta=new Array(o.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Fn("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 Fn(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const o=new Fn(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const{src:n,posMax:o}=this,s=n.charCodeAt(e);let i=e;for(;i<o&&n.charCodeAt(i)===s;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<o?n.charCodeAt(i):32,c=Jc(l),u=Jc(a),d=Xg(l),f=Xg(a),g=!u&&(!f||c||d),h=!c&&(!d||u||f);return{can_open:g&&(t||!h||d),can_close:h&&(t||!g||f),length:r}}};Yx.prototype.Token=Fn;const LP=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function Xx(e){return!LP.test(e)}var OP=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new Hb,this.ruler2=new Hb,this.ruler.push("text",EP),this.ruler.push("linkify",CP),this.ruler.push("newline",xP),this.ruler.push("escape",iP),this.ruler.push("backticks",KO),this.ruler.push("strikethrough",Bb.tokenize),this.ruler.push("emphasis",Pb.tokenize),this.ruler.push("link",yP),this.ruler.push("image",gP),this.ruler.push("autolink",zO),this.ruler.push("html_inline",pP),this.ruler.push("entity",oP),this.ruler2.push("balance_pairs",YO),this.ruler2.push("strikethrough",Bb.postProcess),this.ruler2.push("emphasis",Pb.postProcess),this.ruler2.push("fragments_join",lP),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),o=n.length,s=e.cache,i=s[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<o;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ma(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<o;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,o=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=s[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ma(e.env,"inline",s[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,o){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&Xx(e)){const a=new Fn("text","",0);a.content=e,o.push(a);return}const s=new Yx(e,t,n,o);this.tokenize(s);const i=this.getRules2(),r=i.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](s,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(s,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ma(s.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,o){this.parseSource(e,t,n,o)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function PP(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let o=0,s=t.length;o<s;o++){const i=t[o];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&Xx(i.content)){const r=new Fn("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const RP=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,DP=/[0-9a-z]/i;function BP(e){return/^<a[>\s]/i.test(e)}function FP(e){return/^<\/a\s*>/i.test(e)}function HP(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const o=t.raw[n-1],s=t.raw[n];if(!RP.test(o)||!DP.test(s))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function WP(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const o=t[n];if(o.type!=="inline"||!e.md.linkify.pretest(o.content))continue;let s=o.children;s||(s=[],o.children=s);let i=0;for(let r=s.length-1;r>=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(BP(l.content)&&i>0&&i--,FP(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(g=>HP(e.md.linkify,g));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let g=0;g<c.length;g++){const h=c[g],m=e.md.normalizeLink(h.url);if(!e.md.validateLink(m))continue;let _=h.text;h.schema?h.schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText(`mailto:${_}`).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText(`http://${_}`).replace(/^http:\/\//,"");const w=h.index;if(w>f){const x=new Fn("text","",0);x.content=a.slice(f,w),x.level=d,u.push(x)}const k=new Fn("link_open","a",1);k.attrs=[["href",m]],k.level=d++,k.markup="linkify",k.info="auto",u.push(k);const b=new Fn("text","",0);b.content=_,b.level=d,u.push(b);const y=new Fn("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),f=h.lastIndex}if(f!==0){if(f<a.length){const g=new Fn("text","",0);g.content=a.slice(f),g.level=d,u.push(g)}s.splice(r,1,...u)}}}}const UP=/\r\n?|\n/g,qP=/\0/g;function jP(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),o=t.includes("\0");if(!n&&!o)return;let s=t;n&&(s=s.replace(UP,`
|
|
50
|
-
`)),o&&(s=s.replace(qP,"�")),e.src=s}const Qx=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,zP=/\((?:c|tm|r)\)/i,VP=/\((c|tm|r)\)/gi,KP={c:"©",r:"®",tm:"™"};function GP(e,t){return KP[t.toLowerCase()]}function YP(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(VP,GP)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function XP(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&Qx.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function QP(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");zP.test(o)&&YP(n.children||[]),Qx.test(o)&&XP(n.children||[])}}var ZP=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(o=>o.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(o=>o.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const JP=/['"]/,Wb=/['"]/g,Ub="’";function dd(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function eR(e,t){let n;const o=[],s=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=o.length-1;n>=0&&!(o[n].level<=l);n--);if(o.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){Wb.lastIndex=c;const d=Wb.exec(a);if(!d)break;let f=!0,g=!0;c=d.index+1;const h=d[0]==="'";let m=32;if(d.index-1>=0)m=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let _=32;if(c<u)_=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){_=e[n].content.charCodeAt(0);break}const w=Mf(m)||Af(String.fromCharCode(m)),k=Mf(_)||Af(String.fromCharCode(_)),b=Jc(m),y=Jc(_);if(y?f=!1:k&&(b||w||(f=!1)),b?g=!1:w&&(y||k||(g=!1)),_===34&&d[0]==='"'&&m>=48&&m<=57&&(g=f=!1),f&&g&&(f=w,g=k),!f&&!g){h&&(r.content=dd(r.content,d.index,Ub));continue}if(g)for(n=o.length-1;n>=0;n--){let x=o[n];if(o[n].level<l)break;if(x.single===h&&o[n].level===l){x=o[n];let L,N;h?(L=s[2]||"‘",N=s[3]||"’"):(L=s[0]||"“",N=s[1]||"”"),r.content=dd(r.content,d.index,N),e[x.token].content=dd(e[x.token].content,x.pos,L),c+=N.length-1,x.token===i&&(c+=L.length-1),a=r.content,u=a.length,o.length=n;continue e}}f?o.push({token:i,pos:d.index,single:h,level:l}):g&&h&&(r.content=dd(r.content,d.index,Ub))}}}function tR(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!JP.test(o)||!n.children||eR(n.children,e)}}function nR(e){const t=e.tokens||[],n=t.length;for(let o=0;o<n;o++){const s=t[o];if(s.type!=="inline"||!Array.isArray(s.children))continue;const i=s.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const oR=/^(?:vbscript|javascript|file|data):/,sR=/^data:image\/(?:gif|png|jpeg|webp);/,Zx=["http:","https:","mailto:"];function Jx(e){const t=e.trim().toLowerCase();return oR.test(t)?sR.test(t):!0}function eT(e){const t=Tv(e,!0);if(t.hostname&&(!t.protocol||Zx.includes(t.protocol)))try{t.hostname=Rx.default.toASCII(t.hostname)}catch{}return Cx(xv(t))}function tT(e){const t=Tv(e,!0);if(t.hostname&&(!t.protocol||Zx.includes(t.protocol)))try{t.hostname=Rx.default.toUnicode(t.hostname)}catch{}return Yg(xv(t),`${Yg.defaultChars}%`)}function iR(e){switch(e){case 9:case 32:return!0}return!1}function rR(e,t,n,o){const s=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const f=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const g=[],h=[],m=[],_=[],w=e.md.block.ruler.getRulesForState(e,"blockquote"),k=e.parentType;e.parentType="blockquote";let b=!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(s.charCodeAt(u++)===62&&!M){let P=a[y]+1,T,I;s.charCodeAt(u)===32?(u++,P++,I=!1,T=!0):s.charCodeAt(u)===9?(T=!0,(c[y]+P)%4===3?(u++,P++,I=!1):I=!0):T=!1;let R=P;for(g.push(i[y]),i[y]=u;u<d;){const D=s.charCodeAt(u);if(iR(D))D===9?R+=4-(R+c[y]+(I?1:0))%4:R++;else break;u++}b=u>=d,h.push(c[y]),c[y]=a[y]+1+(T?1:0),m.push(a[y]),a[y]=R-P,_.push(l[y]),l[y]=u-i[y];continue}if(b)break;let $=!1;for(let P=0,T=w.length;P<T;P++)if(w[P](e,y,n,!0)){$=!0;break}if($){e.lineMax=y,e.blkIndent!==0&&(g.push(i[y]),h.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}g.push(i[y]),h.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]=-1}const x=e.blkIndent;e.blkIndent=0;const L=e.push("blockquote_open","blockquote",1);L.markup=">";const N=[t,0];L.map=N,e.md.block.tokenize(e,t,y);const v=e.push("blockquote_close","blockquote",-1);v.markup=">",e.lineMax=f,e.parentType=k,N[1]=e.line;for(let M=0;M<_.length;M++)i[M+t]=g[M],l[M+t]=_[M],a[M+t]=m[M],c[M+t]=h[M];return e.blkIndent=x,!0}function lR(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,s=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,s,4+e.blkIndent,!1)}
|
|
51
|
-
`,i.map=[t,e.line],!0}function aR(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const g=e.push("fence","code",0);return g.info=u,g.content=e.getLines(t+1,d,a,!0),g.markup=c,g.map=[t,e.line],!0}const qb=["","h1","h2","h3","h4","h5","h6"],jb=["","#","##","###","####","#####","######"];function zb(e){switch(e){case 9:case 32:return!0}return!1}function cR(e,t,n,o){const s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=s.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=s.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=s.charCodeAt(++a);if(d>6||a<c&&!zb(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&zb(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const g=e.push("heading_open",qb[d],1);g.markup=jb[d],g.map=[t,e.line];const h=e.push("inline","",0);h.content=s.slice(a,c).trim(),h.map=[t,e.line],h.children=[];const m=e.push("heading_close",qb[d],-1);return m.markup=jb[d],!0}function uR(e){switch(e){case 9:case 32:return!0}return!1}function dR(e,t,n,o){const s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<s;){const c=e.src.charCodeAt(i++);if(c!==r&&!uR(c))return!1;c===r&&l++}if(l<3)return!1;if(o)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const Hl=[[/^<(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(`${cP.source}\\s*$`),/^$/,!1]];function fR(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),l=0;for(;l<Hl.length&&!Hl[l][0].test(r);l++);if(l===Hl.length)return!1;if(o)return Hl[l][2];let a=t+1;if(!Hl[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(s=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(s,i),Hl[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 Vb(e){switch(e){case 9:case 32:return!0}return!1}const Tc={Pipe:1,ParagraphTerminator:2};function hR(e){switch(e){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 124:case 126:return!0}return e>=48&&e<=57}var nT=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u<d;u++){const f=s.charCodeAt(u);if(f===124&&(c|=Tc.Pipe|Tc.ParagraphTerminator),!a)if(Vb(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,hR(f)&&(c|=Tc.ParagraphTerminator);(f===10||u===d-1)&&(f!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineFlags.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const s=new Fn(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new Fn(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;e<s&&!(t[e]+n[e]<o[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const o=t.charCodeAt(e);if(o!==9&&o!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;e<o&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const o=this.src;for(;e>n;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const g=o?this.eMarks[u]+1:this.eMarks[u];let h=0;const m=this.src,_=this.bsCount,w=this.tShift;for(;f<g&&h<n;){const k=m.charCodeAt(f);if(k===9||k===32)k===9?h+=4-(h+_[u])%4:h++;else if(f-d<w[u])h++;else break;f++}return h>n?new Array(h-n+1).join(" ")+m.slice(f,g):m.slice(f,g)}const s=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let f=0;const g=r[d];let h=g,m;for(d+1<t||o?m=l[d]+1:m=l[d];h<m&&f<n;){const _=i.charCodeAt(h);if(Vb(_))_===9?f+=4-(f+a[d])%4:f++;else if(h-g<c[d])f++;else break;h++}f>n?s[u]=new Array(f-n+1).join(" ")+i.slice(h,m):s[u]=i.slice(h,m)}return s.join("")}};nT.prototype.Token=Fn;function pR(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function oT(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function sT(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&Tc.ParagraphTerminator)===0||o>=s)return!1;const i=n.charCodeAt(o);switch(i){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return i>=48&&i<=57?!0:pR(n,o,s)}const Kb=["","h1","h2"];function mR(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=oT(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,g,h=t+1;for(;h<n;h++){const y=i[h]+r[h],x=l[h];if(y>=x)break;if(a[h]-c>3)continue;if(a[h]>=c&&(g=s.charCodeAt(y),g===45||g===61)){let N=y+1,v=N;for(;N<x&&s.charCodeAt(N)===g;)N++;for(v=N;N<x;){const M=s.charCodeAt(N);if(M!==9&&M!==32)break;N++}if(N>=x){f=g===61?1:2;break}if(v-y>1)continue}if(a[h]<0||u&&!sT(e,h,s,y,x))continue;let L=!1;for(let N=0,v=o.length;N<v;N++)if(o[N](e,h,n,!0)){L=!0;break}if(L)break}if(!f)return!1;let m;if(h===t+1){const y=i[t]+r[t];let x=l[t];for(;x>y;){const L=s.charCodeAt(x-1);if(L!==9&&L!==32)break;x--}m=s.slice(y,x)}else m=e.getLines(t,h,c,!1).trim();e.line=h+1;const _=g===61?"=":"-",w=e.push("heading_open",Kb[f],1);w.markup=_,w.map=[t,e.line];const k=e.push("inline","",0);k.content=m,k.map=[t,e.line-1],k.children=[];const b=e.push("heading_close",Kb[f],-1);return b.markup=_,e.parentType=d,!0}function iT(e){switch(e){case 9:case 32:return!0}return!1}function Gb(e,t){const n=e.eMarks,o=e.bMarks,s=e.tShift,i=e.src,r=n[t];let l=o[t]+s[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!iT(i.charCodeAt(l))?-1:l}function Yb(e,t){const n=e.bMarks,o=e.tShift,s=e.eMarks,i=e.src,r=n[t]+o[t],l=s[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!iT(c))?-1:a}function gR(e,t,n){const o=e.bMarks,s=e.tShift,i=e.src,r=o[t]+s[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const vR=["0","1","2","3","4","5","6","7","8","9"];function yR(e,t){const n=e.level+2,o=e.tokens;for(let s=t+2,i=o.length-2;s<i;s++){const r=o[s];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,o[s+2].hidden=!0,s+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++s<i;)l+=o[s].nesting}}}}function kR(e,t,n,o){let s,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const g=e.src,h=e.bMarks,m=e.tShift,_=e.eMarks,w=e.sCount,k=e.bsCount,b=h[l]+m[l];if(b>=_[l])return!1;const y=g.charCodeAt(b);if(y>=48&&y<=57){if(f=Yb(e,l),f<0||(u=!0,r=b,d=gR(e,l,f),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(f=Gb(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=_[l])return!1;if(o)return!0;const x=g.charCodeAt(f-1),L=String.fromCharCode(x);if(u){const T=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(T.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const N=[l,0];e.tokens[e.tokens.length-1].map=N,e.tokens[e.tokens.length-1].markup=L;let v=!1;const M=e.tokens.length-1,$=e.md.block.ruler.getRulesForState(e,"list"),P=e.parentType;for(e.parentType="list";l<n;){i=f,s=_[l];const T=w[l]+f-(h[l]+m[l]);let I=T;for(;i<s;){const le=g.charCodeAt(i);if(le===9)I+=4-(I+k[l])%4;else if(le===32)I++;else break;i++}const R=i;let D;R>=s?D=1:D=I-T,D>4&&(D=1);const F=T+D,z=e.push("list_item_open","li",1);z.markup=L;const V=[l,0];z.map=V,u&&(z.info=f-r-1===1?vR[g.charCodeAt(r)-48]:g.slice(r,f-1));const ne=e.tight,K=e.tShift[l],G=e.sCount[l],X=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=F,e.tight=!0,e.tShift[l]=R-h[l],e.sCount[l]=I,R>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||v)&&(a=!1),v=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=X,e.tShift[l]=K,e.sCount[l]=G,e.tight=ne,e.push("list_item_close","li",-1).markup=L,l=e.line,V[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let be=!1;for(let le=0,We=$.length;le<We;le++)if($[le](e,l,n,!0)){be=!0;break}if(be)break;if(u){if(f=Yb(e,l),f<0)break;r=h[l]+m[l]}else if(f=Gb(e,l),f<0)break;if(x!==g.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=L:e.push("bullet_list_close","ul",-1).markup=L,N[1]=l,e.line=l,e.parentType=P,a&&yR(e,M),!0}function Xb(e){return e===9||e===32}function bR(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=oT(e);let f=t+1;for(e.parentType="paragraph";f<n&&!e.isEmpty(f);f++){if(c[f]-u>3||c[f]<0)continue;if(s==="list"&&c[f]>=u){const b=r[f]+l[f],y=a[f];if(b<y){const x=i.charCodeAt(b);if(x===42||x===45||x===43){if(b+1>=y||Xb(i.charCodeAt(b+1)))break}else if(x>=48&&x<=57&&b+1<y){let L=b+1;for(;;){if(L>=y){L=-1;break}const N=i.charCodeAt(L++);if(N>=48&&N<=57){if(L-b>=10){L=-1;break}continue}if((N===41||N===46)&&(L>=y||Xb(i.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const _=r[f]+l[f],w=a[f];if(d&&!sT(e,f,i,_,w))continue;let k=!1;for(let b=0,y=o.length;b<y;b++)if(o[b](e,f,n,!0)){k=!0;break}if(k)break}const g=e.getLines(t,f,u,!1).trim();e.line=f;const h=e.push("paragraph_open","p",1);h.map=[t,e.line];const m=e.push("inline","",0);return m.content=g,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function fd(e){switch(e){case 9:case 32:return!0}return!1}function wR(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(s)!==91)return!1;function a(b){const y=e.lineMax;if(b>=y||e.isEmpty(b))return null;let x=!1;if(e.sCount[b]-e.blkIndent>3&&(x=!0),e.sCount[b]<0&&(x=!0),!x){const v=e.parentType;e.parentType="reference";let M=!1;for(let $=0,P=l.length;$<P;$++)if(l[$](e,b,y,!0)){M=!0;break}if(e.parentType=v,M)return null}const L=e.bMarks[b]+e.tShift[b],N=e.eMarks[b];return e.src.slice(L,N+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const b=c.charCodeAt(s);if(b===91)return!1;if(b===93){u=s;break}else if(b===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(b===92&&(s++,s<i&&c.charCodeAt(s)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const b=c.charCodeAt(s);if(b===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!fd(b))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;s=d.pos;const g=s,h=r,m=s;for(;s<i;s++){const b=c.charCodeAt(s);if(b===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!fd(b))break}let _=e.md.helpers.parseLinkTitle(c,s,i);for(;_.can_continue;){const b=a(r);if(b===null)break;c+=b,s=i,i=c.length,r++,_=e.md.helpers.parseLinkTitle(c,s,i,_)}let w;for(s<i&&m!==s&&_.ok?(w=_.str,s=_.pos):(w="",s=g,r=h);s<i&&fd(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&w)for(w="",s=g,r=h;s<i&&fd(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const k=Eh(c.slice(1,u));return k?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[k]>"u"&&(e.env.references[k]={title:w,href:f}),e.line=r),!0):!1}function bm(e){switch(e){case 9:case 32:return!0}return!1}const _R=65536;function wm(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function CR(e,t){if(e.lineFlags)return(e.lineFlags[t]&Tc.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];n<o;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function Qb(e){const t=[],n=e.length;let o=0,s=e.charCodeAt(o),i=!1,r=0,l="";for(;o<n;)s===124&&(i?(l+=e.substring(r,o-1),r=o):(t.push(l+e.substring(r,o)),l="",r=o+1)),i=s===92,o++,s=e.charCodeAt(o);return t.push(l+e.substring(r)),t}function SR(e,t,n,o){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!bm(l)||r===45&&bm(l)||!CR(e,t))return!1;for(;i<e.eMarks[s];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!bm(y))return!1;i++}let a=wm(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const x=c[y].trim();if(!x){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(x))return!1;x.charCodeAt(x.length-1)===58?u.push(x.charCodeAt(0)===58?"center":"right"):x.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=wm(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=Qb(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;const f=e.parentType;e.parentType="table";const g=e.md.block.ruler.getRulesForState(e,"blockquote"),h=e.push("table_open","table",1),m=[t,0];h.map=m;const _=e.push("thead_open","thead",1);_.map=[t,t+1];const w=e.push("tr_open","tr",1);w.map=[t,t+1];for(let y=0;y<c.length;y++){const x=e.push("th_open","th",1);u[y]&&(x.attrs=[["style",`text-align:${u[y]}`]]);const L=e.push("inline","",0);L.content=c[y].trim(),L.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let k,b=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let y=!1;for(let L=0,N=g.length;L<N;L++)if(g[L](e,s,n,!0)){y=!0;break}if(y||(a=wm(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=Qb(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),b+=d-c.length,b>_R))break;if(s===t+2){const L=e.push("tbody_open","tbody",1);L.map=k=[t+2,0]}const x=e.push("tr_open","tr",1);x.map=[s,s+1];for(let L=0;L<d;L++){const N=e.push("td_open","td",1);u[L]&&(N.attrs=[["style",`text-align:${u[L]}`]]);const v=e.push("inline","",0);v.content=c[L]?c[L].trim():"",v.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return k&&(e.push("tbody_close","tbody",-1),k[1]=s),e.push("table_close","table",-1),m[1]=s,e.parentType=f,e.line=s,!0}var xR=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}after(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s+1,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:o,fn:s})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=s(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return ma(i?.env,"block",o,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const o=this._rules.findIndex(s=>s.name===e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[o].fn=t,n?.alt&&(this._rules[o].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this._rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const o of this._rules)if(o.enabled)for(const s of o.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const o of e){const s=[],i=[];for(const r of this._rules)r.enabled&&(o!==""&&!r.alt.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t[o]=s,n[o]=i}this.cache=t,this.namedCache=n}};const hd=[["table",SR,["paragraph","reference"]],["code",lR],["fence",aR,["paragraph","reference","blockquote","list"]],["blockquote",rR,["paragraph","reference","blockquote","list"]],["hr",dR,["paragraph","reference","blockquote","list"]],["list",kR,["paragraph","reference","blockquote"]],["reference",wR],["html_block",fR,["paragraph","reference","blockquote"]],["heading",cR,["paragraph","reference","blockquote"]],["lheading",mR],["paragraph",bR]];var TR=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new xR;for(let e=0;e<hd.length;e++)this.ruler.push(hd[e][0],hd[e][1],{alt:(hd[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const o=this.getRules(),s=o.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const g=e.line;let h=!1;for(let m=0;m<s;m++)if(h=o[m](e,u,n,!1),h){if(g>=e.line)throw new Error("block rule didn't increment state.line");break}if(!h)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const f=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const g=e.line;let h=!1;for(let m=0;m<s;m++){const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();h=f[m].fn(e,u,n,!1);const w=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ma(e.env,"block",f[m].name,w-_,h,!1),h){if(g>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!h)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,o){if(!e||e.length===0)return;const s=new nT(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},rT=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}};rT.prototype.Token=Fn;const Zb=[["normalize",jP],["block",WO],["inline",PP],["linkify",WP],["replacements",QP],["smartquotes",tR],["text_join",nR]],AR={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},MR={parseLinkLabel:Ov,parseLinkDestination:Lv,parseLinkTitle:Pv};function ER(){return{...AR}}function IR(){return{...MR}}var $R=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new TR,this.inline=new OP,this.ruler=new ZP;for(let e=0;e<Zb.length;e++){const[t,n]=Zb[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:ER(),helpers:IR(),normalizeLink:eT,normalizeLinkText:tT,validateLink:Jx,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new Px),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 rT(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let o=0;o<n.length;o++)n[o](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ma(e.env,"core",t[n].name,s-o,!0,!1)}NP(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&HO(e))return this.parse(Fx(e),t,n);const o=this.createState(e,t,n);return this.process(o),this.lastState=o,o}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const NR=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function Nf(e){return!NR.test(e)}function pc(e,t){const n=e.indexOf(`
|
|
52
|
-
`,t);return n===-1?e.length:n}function Dd(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function Jb(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function _m(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function LR(e){if(e.length>3)return Nf(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!1}return!0}const OR=["","h1","h2","h3","h4","h5","h6"],PR=["","#","##","###","####","#####","######"],ew=0,Cm=1,Sm=2;function ls(e,t,n,o){const s=new Fn(e,t,n);return s.level=o,s.block=!0,s}function lT(e,t,n){const o=ls("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new Fn("text","",0);return s.content=e,o.children=[s],o}function RR(e,t,n,o,s){let i=0,r=n;for(;r<o&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=o||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<o&&t.charCodeAt(l)===32;)l++;let a=o;for(;a>l&&t.charCodeAt(a-1)===32;)a--;let c=a;for(;c>l&&t.charCodeAt(c-1)===35;)c--;if(c>l&&t.charCodeAt(c-1)===32)for(a=c-1;a>l&&t.charCodeAt(a-1)===32;)a--;const u=t.slice(l,a);if(!Nf(u))return!1;const d=OR[i],f=PR[i],g=ls("heading_open",d,1,0);g.map=[s,s+1],g.markup=f,e.push(g),e.push(lT(u,s,1));const h=ls("heading_close",d,-1,0);return h.markup=f,e.push(h),!0}function DR(e,t,n){const o=ls("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(lT(t,n,1)),e.push(ls("paragraph_close","p",-1,0))}function BR(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function xm(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function FR(e,t){const n=ls("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function HR(e,t,n){const o=ls("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=ls("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=ls("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new Fn("text","",0);r.content=t,i.children=[r],e.push(i);const l=ls("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=ls("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function WR(e){const t=ls("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function UR(e,t,n,o){if(!Jb(e,t,n))return null;const s=e.slice(t+3,n);if(s.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=o+1;for(;l<e.length;){const c=pc(e,l);if(Jb(e,l,c)&&Dd(e,l+3,c)){const u=ls("fence","code",0,0);return u.map=[o,a+1],u.markup="```",u.info=s,u.content=e.slice(i,r),{token:u,nextPos:c<e.length?c+1:c,nextLine:a+1}}l=c<e.length?c+1:c,r=l,a++}return null}function qR(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?ew:Sm,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=pc(e,r);if(r===a){r=a<e.length?a+1:a,l++;continue}const c=e.charCodeAt(r);if(c===32||c===9){if(!Dd(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!RR(t,e,r,a,l))return null;const g=a<e.length?a+1:a;r=xm(e,g),l+=1+r-g;continue}if(c===45){if(!_m(e,r,a))return null;const g=l;let h=r,m=l,_=null,w=null;for(;h<e.length;){const y=pc(e,h);if(!_m(e,h,y))break;const x=h+2,L=y===x+1?e[x]:e.slice(x,y);if(!LR(L))return null;_===null&&(_=FR(t,g)),w=HR(t,L,m),h=y<e.length?y+1:y,m++}if(_===null||w===null)return null;let k=h,b=m;for(;k<e.length;){if(e.charCodeAt(k)===10){k++,b++;continue}const y=pc(e,k);if(!Dd(e,k,y)){if(_m(e,k,y))return null;break}k=y<e.length?y+1:y,b++}_.map[1]=b,w.map[1]=b,WR(t),r=k,l=b;continue}if(c===96){const g=UR(e,r,a,l);if(!g)return null;t.push(g.token),r=xm(e,g.nextPos),l=g.nextLine+r-g.nextPos;continue}const u=BR(e,r,a);let d;if(n===Sm?d=Nf(u):n===Cm&&u===o?d=s:(d=Nf(u),n===ew?(i&&(n=u===o?Cm:Sm),o=u,s=d,i=!0):n===Cm&&(o=u,s=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!Dd(e,f,pc(e,f)))return null;DR(t,u,l),r=xm(e,f),l+=1+r-f}return t}const jR=/[&<>"]/,tw=/[&<>"]/g,zR=/&/g,VR=/[<>"]/g,KR={"&":"&","<":"<",">":">",'"':"""};function Tm(e){return KR[e]||e}function an(e){if(e.length===0)return"";if(e.length<32)return jR.test(e)?e.replace(tw,Tm):e;const t=e.includes("&"),n=e.includes("<"),o=e.includes(">"),s=e.includes('"');return!t&&!n&&!o&&!s?e:t&&!n&&!o&&!s?e.replace(zR,"&"):t?e.replace(tw,Tm):e.replace(VR,Tm)}const GR=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),YR=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function aT(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(GR,(t,n,o)=>{if(n)return n;if(YR.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return Ih(i)?eu(i):"�"}const s=Sv(t);return s!==t?s:t})}const XR=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,QR=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,ZR=/"/g;function ea(e,t){const n=e.indexOf(`
|
|
53
|
-
`,t);return n===-1?e.length:n}function Lf(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function pd(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function JR(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!Lf(e,t,ea(e,t))}function nw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function eD(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function Fv(e){return QR.test(e)?XR.test(e)?null:e.replace(ZR,"""):e}function tD(e,t,n){let o=0,s=t;for(;s<n&&e.charCodeAt(s)===35&&o<6;)s++,o++;if(o===0||s>=n||e.charCodeAt(s)!==32)return null;let i=s+1;for(;i<n&&e.charCodeAt(i)===32;)i++;let r=n;for(;r>i&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>i&&e.charCodeAt(l-1)===35;)l--;if(l>i&&e.charCodeAt(l-1)===32)for(r=l-1;r>i&&e.charCodeAt(r-1)===32;)r--;const a=Fv(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
|
|
54
|
-
`}function ow(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function nD(e,t){switch(e.charCodeAt(t)){case 34:return`<li>"</li>
|
|
55
|
-
`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`<li>${e[t]}</li>
|
|
56
|
-
`}function oD(e,t,n){const o=t+2;if(n===o+1)return nD(e,o);const s=Fv(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
|
|
57
|
-
`}function sD(e,t,n){for(;t<n;){const s=e.charCodeAt(t);if(s!==32&&s!==9)break;t++}for(;n>t;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let o=n;for(let s=t;s<n;s++){const i=e.charCodeAt(s);if(i===96)return null;if(i===32||i===9){o=s;break}}return e.slice(t,o)}function iD(e,t,n,o){if(!nw(e,t,n))return null;const s=sD(e,t+3,n);if(s===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=ea(e,l);if(nw(e,l,a)&&Lf(e,l+3,a)){const c=e.slice(i,r);let u;return s===o.lang?u=o.open:(u=s?`<pre><code class="language-${an(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${an(c)}</code></pre>
|
|
58
|
-
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function sw(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const o=e.length>=25e4,s=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=ea(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!Lf(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=tD(e,t,u);if(m===null)return null;o?s.push(m):n+=m,t=pd(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const b=ea(e,m);if(!ow(e,m,b))break;m=b<e.length?b+1:b}if(m===t)return null;const _=e.slice(t,m);let w;if(_===r)w=l;else{let b=t;for(w=`<ul>
|
|
59
|
-
`;b<m;){const y=ea(e,b),x=oD(e,b,y);if(x===null)return null;w+=x,b=y<e.length?y+1:y}w+=`</ul>
|
|
60
|
-
`,r=_,l=w}let k=pd(e,m);for(;k<e.length;){if(e.charCodeAt(k)===10){k++;continue}const b=ea(e,k);if(!Lf(e,k,b)){if(ow(e,k,b))return null;break}k=b<e.length?b+1:b}o?s.push(w):n+=w,t=k;continue}if(d===96){const m=iD(e,t,u,i);if(!m)return null;o?s.push(m.html):n+=m.html,t=pd(e,m.nextPos);continue}const f=eD(e,t,u);let g;if(f===a)g=c;else{const m=Fv(f);if(m===null)return null;g=`<p>${m}</p>
|
|
61
|
-
`,a=f,c=g}const h=u<e.length?u+1:u;if(h<e.length&&e.charCodeAt(h)!==10&&JR(e,h))return null;o?s.push(g):n+=g,t=pd(e,h)}return o?s.join(""):n}const rD={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function Of(e,t,n={},o){To(n);const s={...rD,...o||{}},i=Ho(t);if(s.fallbackOnGlobalState!==!1&&i)return km(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),pa(n,i,()=>e.core.parse(t,n,e).tokens);let r=Bd(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=uD(r,s.maxChunks)),Fd(t,r))return km(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),pa(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return km(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),pa(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),f=e.core.parse(d,n,e).tokens;l!==0&&f.length&&aD(f,l),cD(a,f),l+=u.lineCount}return a})}function Bd(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(o.push({start:r,end:f,lineCount:l}),r=f,s=0,i=0,l=0)}for(let f=0;f<e.length;){let g=e.indexOf(`
|
|
62
|
-
`,f),h=g;g===-1?(g=e.length,h=e.length):h=g+1;const m=dD(e,f,g);if(t.fenceAware){let k=f;for(;k<g;){const y=e.charCodeAt(k);if(y===32||y===9)k++;else break}const b=e[k];if(b==="`"||b==="~"){let y=k;for(;y<g&&e[y]===b;)y++;const x=y-k;x>=3&&(u?u.marker===b&&x>=u.length&&(u=null):u={marker:b,length:x})}}const _=h-f;s+=_,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=_);const w=m;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(w)d(h);else{const k=Math.max(10,Math.floor(t.maxChunkLines*.5)),b=Math.max(t.maxChunkChars,8e3);(a>=k||c>=b)&&d(h)}f=h}return n&&d(e.length),o}function Fd(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!lD(e,t[s].end))return!0;return!1}function lD(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let o=n+1;o<t-1;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function aD(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function cD(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function uD(e,t){if(e.length<=t)return e;const n=[];let o=0;for(let s=0;s<t;s++){const i=t-s,r=e.length-o,l=Math.ceil(r/i),a=e.slice(o,o+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),o+=l}return n}function dD(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}const cT=4e6,uT=8e4,fD=1e4,hD=200,pD=1e4,mD=200;function dT(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function gD(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function Ji(e){return e.length===0?0:Mn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function vD(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function yD(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
|
|
63
|
-
`,o);s===-1&&(s=e.length);let i=o;for(;i<s;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<s&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}o=s===e.length?e.length:s+1}return n!==null}function kD(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 vD(e,n+1,e.length-1)?!yD(e,t):!1}function bD(e,t,n,o={}){const s=o.mode??"full",i=o.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(o.maxChunkChars!==void 0||o.maxChunkLines!==void 0||o.autoTune===!1){const r=o.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??pD:e.options.fullChunkSizeChars??fD),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??mD:e.options.fullChunkSizeLines??hD);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return s==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var yu=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=Ji(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=Bd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(Fd(this.pending,o,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const s=this.commitRanges(o,e);return this.pending=this.pending.slice(s),this.updateEnvDiagnostics(e,t,Ji(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!kD(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Ji(this.pending)),null;const n=Bd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Ji(this.pending)),null;const o=Fd(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Ji(this.pending)}]:n;return this.commitRanges(o,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const o=this.resolveWindow();return this.updateEnvDiagnostics(e,o,0),this.tokens}const t=this.resolveWindow(),n=Bd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=Fd(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Ji(this.pending)}]:n;this.commitRanges(o,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:Ji(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Ji(this.pending);return bD(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(vu(e)&&Hi(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=Ho(t);n&&($v(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let o=0;o<e.length;o++){const s=e[o],i=this.pending.slice(s.start,s.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&gD(r,a),this.options.retainTokens!==!1&&dT(this.tokens,r),this.committedChars+=i.length,this.committedLines+=s.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:s.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=s.end}return this.markedGlobalStateReason&&Nv(t),n}catch(o){throw this.markedGlobalStateReason&&(Hi(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){Nx(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 wD(e,t,n={},o={}){To(n);const s=new yu(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function _D(e,t,n={},o={}){To(n);const s=new yu(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function CD(e,t,n,o={},s={}){To(o);const i=new yu(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}async function SD(e,t,n,o={},s={}){To(o);const i=new yu(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}function fT(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??cT,s=e.options.autoUnboundedThresholdLines??uT;return t>=o||n>=s}function hT(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??cT))return"yes";const o=e.options.autoUnboundedThresholdLines??uT;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function Ac(e,t,n={},o={}){To(n);const s=Ho(t);if(vu(n)&&Hi(n),o.fallbackOnGlobalState!==!1&&s)return Nx(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:Mn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),pa(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new yu(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){dT(i,l)}});if(s&&$v(n,s),r.feed(t),r.flushForce(n),s&&(Nv(n),o.fallbackOnGlobalState===!1)){const l=xi(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const ga=(e,t,n)=>e<t?t:e>n?n:e;function pT(e){return e.experimental?{...e,...e.experimental}:e}const iw=[{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"}],rw=[{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 mT(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function xD(e,t=Math.max(0,e/40|0),n={}){const o=pT(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<iw.length;l++){const a=iw[l];if(e<=a.max){if(a.strategy!=="adaptive")return mT(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:ga(Math.ceil(e/i),8e3,64e3),maxChunkLines:ga(Math.ceil(t/i),150,700),maxChunks:ga(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function lw(e,t=Math.max(0,e/40|0),n={}){const o=pT(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<rw.length;l++){const a=rw[l];if(e<=a.max){if(a.strategy!=="adaptive")return mT(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:ga(Math.ceil(e/i),8e3,64e3),maxChunkLines:ga(Math.ceil(t/i),150,700),maxChunks:ga(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var TD={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"]}}},AD={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},MD={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Oh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Hd(e,t){if(Oh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const aw=e=>Oh(e)?e:Promise.resolve(e);function Mc(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 an(e)}}function Sr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Mc(t[0])}="${an(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${Mc(s[0])}="${an(s[1])}"`}return n}function gT(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const o=e.charCodeAt(t);if(o===32||o===9||o===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const o=e.charCodeAt(n);if(o!==32&&o!==9&&o!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function Ec(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
|
|
64
|
-
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${an(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
|
|
65
|
-
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Sr(r)}>${t}</code></pre>
|
|
66
|
-
`}return`<pre><code${Sr(e.attrs)}>${t}</code></pre>
|
|
67
|
-
`}function Pf(e){return!e.attrs||e.attrs.length===0?`<code>${an(e.content)}</code>`:`<code${Sr(e.attrs)}>${an(e.content)}</code>`}function t1(e){const t=an(e.content);return e.attrs?`<pre${Sr(e.attrs)}><code>${t}</code></pre>
|
|
68
|
-
`:`<pre><code>${t}</code></pre>
|
|
69
|
-
`}function ED(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="${an(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${an(n[0][1])}">`}return null}function cw(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Mc(t[0][0])}="${an(t[0][1])}">`:t.length===2?`<a ${Mc(t[0][0])}="${an(t[0][1])}" ${Mc(t[1][0])}="${an(t[1][1])}">`:`<a${Sr(t)}>`}function ID(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 uw(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 Rf(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?`</${s}>`:`<${s}>`;let i=(o===-1?"</":"<")+s+Sr(n);return o===0&&t&&(i+=" /"),`${i}>`}const $D={langPrefix:"language-",xhtmlOut:!1,breaks:!1},md=Object.prototype.hasOwnProperty,ln={code_inline(e,t){return Pf(e[t])},code_block(e,t){return t1(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?aT(i.info).trim():"",{langName:l,langAttrs:a}=gT(r),c=n.highlight,u=an(i.content);if(!c)return Ec(i,u,r,l,n);const d=c(i.content,l,a);return Oh(d)?d.then(f=>Ec(i,f||u,r,l,n)):Ec(i,d||u,r,l,n)},image(e,t,n,o,s){const i=e[t],r=s.renderInlineAsText(i.children||[],n,o),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],Rf(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
70
|
-
`:`<br>
|
|
71
|
-
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
72
|
-
`:`<br>
|
|
73
|
-
`:`
|
|
74
|
-
`},text(e,t){return an(e[t].content)},text_special(e,t){return an(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function dw(e,t,n){const o=e.info?aT(e.info).trim():"",{langName:s,langAttrs:i}=gT(o),r=t.highlight,l=an(e.content);if(!r)return Ec(e,l,o,s,t);const a=r(e.content,s,i);if(Oh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Ec(e,a||l,o,s,t)}function gd(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===ln.text)return l.content.length===0?"":an(l.content);break;case"text_special":if(s.text_special===ln.text_special)return l.content.length===0?"":an(l.content);break;case"softbreak":if(s.softbreak===ln.softbreak)return r;break;case"hardbreak":if(s.hardbreak===ln.hardbreak)return i;break;case"html_inline":if(s.html_inline===ln.html_inline)return l.content;break;case"code_inline":if(s.code_inline===ln.code_inline)return Pf(l);break}const a=s[l.type];if(!a)return Rf(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:Hd(c,l.type)}var ND=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...ln}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,f,g="",h="",m=!1,_="";for(let w=0;w<e.length;w++){const k=e[w],b=k.type,y=w>0&&e[w-1].hidden?`
|
|
75
|
-
`:"";if(b==="list_item_open"&&(!k.attrs||k.attrs.length===0)&&w+3<e.length){const N=e[w+1],v=e[w+2],M=e[w+3];if(N.type==="paragraph_open"&&N.hidden&&v.type==="inline"&&M.type==="paragraph_close"&&M.hidden){_+=`${y}<li>${this.renderInlineTokens(v.children||[],o,s)}`,w+=3;continue}}if(w+2<e.length){const N=e[w+1],v=e[w+2];if(N.type==="inline"&&v.nesting===-1&&v.tag===k.tag&&!v.hidden){const M=ED(k,y);if(M!==null){_+=`${M+this.renderInlineTokens(N.children||[],o,s)}</${k.tag}>
|
|
76
|
-
`,w+=2;continue}}}if(b==="inline"){const N=k.children||[];if(N.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,g=o.xhtmlOut?`<br />
|
|
77
|
-
`:`<br>
|
|
78
|
-
`,h=o.breaks?g:`
|
|
79
|
-
`,m=!0);const v=N[0];switch(v.type){case"text":if(l===ln.text){_+=an(v.content);continue}break;case"text_special":if(a===ln.text_special){_+=an(v.content);continue}break;case"softbreak":if(c===ln.softbreak){_+=h;continue}break;case"hardbreak":if(u===ln.hardbreak){_+=g;continue}break;case"html_inline":if(d===ln.html_inline){_+=v.content;continue}break;case"code_inline":if(f===ln.code_inline){_+=Pf(v);continue}break}}_+=this.renderInlineTokens(N,o,s);continue}const x=i[b];if(!x){const N=k.attrs;if(!k.hidden){if(!N||N.length===0)switch(b){case"hr":_+=r?`<hr />
|
|
80
|
-
`:`<hr>
|
|
81
|
-
`;continue;case"heading_open":_+=`<${k.tag}>`;continue;case"heading_close":_+=`</${k.tag}>
|
|
82
|
-
`;continue;case"paragraph_open":_+=`${y}<p>`;continue;case"paragraph_close":_+=`</p>
|
|
83
|
-
`;continue;case"list_item_open":{const v=e[w+1];_+=y+(v&&(v.type==="inline"||v.hidden||v.nesting===-1&&v.tag==="li")?"<li>":`<li>
|
|
84
|
-
`);continue}case"list_item_close":_+=`</li>
|
|
85
|
-
`;continue;case"bullet_list_open":_+=`${y}<ul>
|
|
86
|
-
`;continue;case"bullet_list_close":_+=`</ul>
|
|
87
|
-
`;continue;case"blockquote_open":_+=y+(e[w+1]&&e[w+1].nesting===-1&&e[w+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
88
|
-
`);continue;case"blockquote_close":_+=`</blockquote>
|
|
89
|
-
`;continue;case"ordered_list_open":_+=`${y}<ol>
|
|
90
|
-
`;continue;case"ordered_list_close":_+=`</ol>
|
|
91
|
-
`;continue;case"table_open":_+=`${y}<table>
|
|
92
|
-
`;continue;case"table_close":_+=`</table>
|
|
93
|
-
`;continue;case"thead_open":_+=`${y}<thead>
|
|
94
|
-
`;continue;case"thead_close":_+=`</thead>
|
|
95
|
-
`;continue;case"tbody_open":_+=`${y}<tbody>
|
|
96
|
-
`;continue;case"tbody_close":_+=`</tbody>
|
|
97
|
-
`;continue;case"tr_open":_+=`${y}<tr>
|
|
98
|
-
`;continue;case"tr_close":_+=`</tr>
|
|
99
|
-
`;continue;case"td_open":_+=`${y}<td>`;continue;case"td_close":_+=`</td>
|
|
100
|
-
`;continue;case"th_open":_+=`${y}<th>`;continue;case"th_close":_+=`</th>
|
|
101
|
-
`;continue}else if(N.length===1){const v=N[0];if(b==="ordered_list_open"&&v[0]==="start"){_+=`${y}<ol start="${an(v[1])}">
|
|
102
|
-
`;continue}if(b==="td_open"&&v[0]==="style"){_+=`${y}<td style="${an(v[1])}">`;continue}if(b==="th_open"&&v[0]==="style"){_+=`${y}<th style="${an(v[1])}">`;continue}}}_+=this.renderToken(e,w,o);continue}if(b==="code_block"&&x===ln.code_block){_+=t1(k);continue}if(b==="fence"&&x===ln.fence){_+=dw(k,o);continue}if(b==="html_block"&&x===ln.html_block){_+=k.content;continue}const L=x(e,w,o,s,this);typeof L=="string"?_+=L:_+=Hd(L,k.type)}return _}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],o,s);continue}const c=i[a.type];c?r+=await aw(c(e,l,o,s,this)):r+=this.renderToken(e,l,o)}return r}renderInline(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokens(e,o,s)}async renderInlineAsync(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokensAsync(e,o,s)}renderInlineAsText(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineAsTextInternal(e,o,s)}renderAttrs(e){return Sr(e.attrs)}renderToken(e,t,n){const o=e[t];if(o.hidden)return"";const s=o.block,i=o.nesting,r=o.tag,l=o.attrs;let a=!1;if(s&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=s&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
103
|
-
`:"",u=a?`>
|
|
104
|
-
`:">";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+Sr(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const o=()=>(n||(n={...t}),n);if(md.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),md.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(md.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(md.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...$D,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===ln.code_block)return t1(t);if(i==="html_block"&&s.html_block===ln.html_block)return t.content;const r=this.mergeOptions(n),l=o??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[i];if(!a)return t.block?this.renderToken(e,0,r):Rf(t,r.xhtmlOut===!0);if(i==="fence"&&a===ln.fence)return dw(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Hd(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,f=o.em_open,g=o.em_close,h=o.strong_open,m=o.strong_close,_=t.xhtmlOut===!0,w=_?`<br />
|
|
105
|
-
`:`<br>
|
|
106
|
-
`,k=t.breaks?w:`
|
|
107
|
-
`;if(e.length===1)return gd(e,t,n,this,o,w,k);let b="";for(let y=0;y<e.length;y++){const x=e[y];if(x.type==="link_open"&&!u&&!d&&y+2<e.length){const v=e[y+1];if(e[y+2].type==="link_close"&&ID(v)){const M=`${cw(x)+gd([v],t,n,this,o,w,k)}</a>`;if(r===ln.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){b+=M+k,y+=3;continue}b+=M,y+=2;continue}}if(x.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){b+=`${cw(x)}</a>`,y+=1;continue}if(x.type==="em_open"&&!f&&!g&&y+2<e.length){const v=e[y+1];if(e[y+2].type==="em_close"&&uw(v)){b+=`<em>${gd([v],t,n,this,o,w,k)}</em>`,y+=2;continue}}if(x.type==="strong_open"&&!h&&!m&&y+2<e.length){const v=e[y+1];if(e[y+2].type==="strong_close"&&uw(v)){b+=`<strong>${gd([v],t,n,this,o,w,k)}</strong>`,y+=2;continue}}switch(x.type){case"text":if(s===ln.text){const v=x.content.length===0?"":an(x.content);if(a===ln.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(b+=v+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)b+=e[++y].content;continue}b+=v;continue}break;case"text_special":if(i===ln.text_special){x.content.length!==0&&(b+=an(x.content));continue}break;case"softbreak":if(r===ln.softbreak){b+=k;continue}break;case"hardbreak":if(l===ln.hardbreak){b+=w;continue}break;case"html_inline":if(a===ln.html_inline){for(b+=x.content;y+1<e.length&&e[y+1].type==="html_inline";)b+=e[++y].content;continue}break;case"code_inline":if(c===ln.code_inline){b+=Pf(x);continue}break}const L=o[x.type];if(!L){b+=x.block?this.renderToken(e,y,t):Rf(x,_);continue}const N=L(e,y,t,n,this);typeof N=="string"?b+=N:b+=Hd(N,x.type)}return b}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const o=this.rules;let s="";for(let i=0;i<e.length;i++){const r=o[e[i].type];r?s+=await aw(r(e,i,t,n,this)):s+=this.renderToken(e,i,t)}return s}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let o="";for(let s=0;s<e.length;s++){const i=e[s];switch(i.type){case"text":case"text_special":o+=i.content;break;case"image":o+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":o+=i.content;break;case"softbreak":case"hardbreak":o+=`
|
|
108
|
-
`;break}}return o}},LD=ND;const OD=[],Am=4096;function PD(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
|
|
109
|
-
`,n);o===-1&&(o=t);const s=o<t;let i=n,r=0;for(;i<o;){const l=e.charCodeAt(i);if(l===32){if(r++,i++,r>=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i<o){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<o&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<o){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===o&&s)return!0}break}case 62:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 96:case 126:{let a=i;for(;a<o&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<o;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<o&&e.charCodeAt(a)===46){const c=a+1;if(c<o){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===o&&s)return!0}}break}}if(o===t)break;n=o+1}return!1}function RD(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function DD(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!vT(e[n],t[n]))return!1;return!0}function vT(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,o=t.map;return!!n!=!!o||n&&o&&(n[0]!==o[0]||n[1]!==o[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!RD(e.attrs,t.attrs)||!DD(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function fw(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var BD=class{core;cache=null;stats=fw();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=fw(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(To(o??s?.env),!s||o&&o!==s.env){const I=o??{},R=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,F=!!n.options?.streamChunkedFallback,z=!R&&D,V=F||z,ne=n.options?.streamChunkAdaptive!==!1,K=n.options?.streamChunkTargetChunks??8,G=n.options?.streamChunkSizeChars,X=n.options?.streamChunkSizeLines,be=n.options?.streamChunkMaxChunks,le=!!n.__explicitStreamChunkConfig,We=n.options?.autoTuneChunks!==!1,ue=n.options?.streamChunkFenceAware??!0,ve=n.options?.streamLargeCachePolicy??"retain",Ne=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,Re=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let Q,ce=!1;if(ve==="skip"&&(ce=e.length>=Ne,!ce&&Re!==void 0&&(Q=Mn(e),ce=Q>=Re)),ce){const q=this.parseFullDocument(e,I,n,Q,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn(I,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!xi(I)?.unbounded}),q.tokens}else if(V){const q=(re,ge,xe)=>re<ge?ge:re>xe?xe:re;Q===void 0&&(Q=Mn(e));const ee=We&&!le?lw(e.length,Q,n.options):null,he=ee?.maxChunkChars??(ne?q(Math.ceil(e.length/K),8e3,64e3):G??1e4),oe=ee?.maxChunkLines??(ne?q(Math.ceil(Q/K),150,700):X??200),fe=ee?.maxChunks??(ne?q(Math.ceil(e.length/64e3),K,32):be),W=e.length>0&&e.charCodeAt(e.length-1)===10,Y=z&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&ee?.strategy!=="plain";if((F||Y)&&(e.length>=he*2||Q>=oe*2)&&W){const re=Of(n,e,I,{maxChunkChars:he,maxChunkLines:oe,fenceAware:ee?.fenceAware??ue,maxChunks:fe});return this.cache={src:e,tokens:re,env:I,lineCount:Q,lastSegment:void 0,globalStateReason:Ho(e)},this.updateCacheLineCount(this.cache,Q),this.recordChunkedParseResult(I,F?"explicit-initial-large-doc":"default-initial-large-doc"),re}}const Se=this.parseFullDocument(e,I,n,Q);return Q=Se.lineCount,this.cache={src:e,tokens:Se.tokens,env:I,lineCount:Q,lastSegment:void 0,globalStateReason:Ho(e)},this.updateCacheLineCount(this.cache,Q),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn(I,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!xi(I)?.unbounded}),Se.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",Dn(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const i=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=Ho(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):Ho(e),a=r||l;if(a){const I=o??s.env;Hi(I);const R=Ho(e),D=this.parseFullDocument(e,I,n),F=D.tokens,z=D.lineCount;return this.cache={src:e,tokens:F,env:I,lineCount:z,lastSegment:void 0,globalStateReason:R},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn(I,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!xi(I)?.unbounded}),F}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length<c&&e.length<c*1.5&&!e.startsWith(s.src)){const I=o??s.env,R=this.parseFullDocument(e,I,n),D=R.tokens,F=R.lineCount;return this.cache={src:e,tokens:D,env:I,lineCount:F,lastSegment:void 0,globalStateReason:Ho(e)},this.updateCacheLineCount(this.cache,F),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn(I,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!xi(I)?.unbounded}),D}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const I=s.lineCount??Mn(s.src);let R=3;u.length>5e3?R=8:u.length>1e3?R=6:u.length>200&&(R=4),R=Math.min(R,I);let D=null;const F=n.options?.streamContextParseStrategy??"chars",z=n.options?.streamContextParseMinChars??200,V=n.options?.streamContextParseMinLines??2;let ne;const K=()=>(ne===void 0&&(ne=Mn(u)),ne),G=this.canDirectlyParseAppend(s),X=G&&this.shouldUseUnboundedAppend(e,s,u);let be=!1;if(!G)switch(F){case"lines":be=K()>=V;break;case"constructs":if(u.length>=z){be=!0;break}if(PD(u)){be=!0;break}be=K()>=V;break;case"chars":default:be=u.length>=z}if(R>0&&be){const ue=this.getTailLines(s.src,R)+u;try{const ve=this.core.parse(ue,s.env,n).tokens,Ne=ve.findIndex(Re=>Re.map&&typeof Re.map[1]=="number"&&Re.map[1]>R);if(Ne!==-1){const Re=ve.slice(Ne),Q=I-R;Q!==0&&this.shiftTokenLines(Re,Q),D={tokens:Re}}}catch{D=null}}else D=null;if(!D){const ue=I;if(X)D={tokens:Ac(n,u,s.env,{mode:"stream"})},ue>0&&this.shiftTokenLines(D.tokens,ue);else{const ve=this.core.parse(u,s.env,n);ue>0&&this.shiftTokenLines(ve.tokens,ue),D=ve}}let le=0;if(s.tokens.length>0&&D.tokens.length>0){const ue=s.tokens[s.tokens.length-1],ve=D.tokens[0];try{ue.type==="inline"&&ve.type==="inline"&&(ve.children&&ve.children.length>0&&(ue.children||(ue.children=[]),this.appendTokens(ue.children,ve.children)),ue.content=(ue.content||"")+(ve.content||""),le=1)}catch{le=0}}const We=s.tokens.length;if(D.tokens.length>le){const ue=s.tokens,ve=D.tokens,Ne=Math.min(ue.length,ve.length-le);let Re=0;for(let Q=Ne;Q>0;Q--){let ce=!0;for(let Se=0;Se<Q;Se++){const q=ue[ue.length-Q+Se],ee=ve[le+Se];if(!vT(q,ee)){ce=!1;break}}if(ce){Re=Q;break}}Re>0&&(le+=Re),ve.length>le&&this.appendTokens(s.tokens,ve,le)}if(s.src=e,s.globalStateReason=null,s.lineCount=I+(ne??K()),s.tokens.length>We){const ue=this.getLastSegment(s.tokens,e,We,s.tokens.length,e.length-u.length,I);ue?s.lastSegment=ue:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,X&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",Dn(s.env,{area:"stream",path:X?"stream-unbounded-append":"stream-append",reason:X?"large-delta":"safe-append",unbounded:X}),s.tokens}const d=o??s.env,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",Dn(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const g=!!n.__explicitStreamChunkFallbackSetting,h=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,_=!g&&!u&&h,w=m||_,k=n.options?.streamChunkAdaptive!==!1,b=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,x=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,N=!!n.__explicitStreamChunkConfig,v=n.options?.autoTuneChunks!==!1,M=n.options?.streamChunkFenceAware??!0;let $=u&&s.lineCount!==void 0?s.lineCount+Mn(u):void 0;if(w){$===void 0&&($=Mn(e));const I=(K,G,X)=>K<G?G:K>X?X:K,R=v&&!N?lw(e.length,$,n.options):null,D=R?.maxChunkChars??(k?I(Math.ceil(e.length/b),8e3,64e3):y??1e4),F=R?.maxChunkLines??(k?I(Math.ceil($/b),150,700):x??200),z=R?.maxChunks??(k?I(Math.ceil(e.length/64e3),b,32):L),V=e.length>0&&e.charCodeAt(e.length-1)===10,ne=_&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&R?.strategy!=="plain";if((m||ne)&&(e.length>=D*2||$>=F*2)&&V){const K=Of(n,e,d,{maxChunkChars:D,maxChunkLines:F,fenceAware:R?.fenceAware??M,maxChunks:z});return this.cache={src:e,tokens:K,env:d,lineCount:$,lastSegment:void 0,globalStateReason:Ho(e)},this.updateCacheLineCount(this.cache,$),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),K}}const P=this.parseFullDocument(e,d,n,$),T=P.tokens;return $=P.lineCount,this.cache={src:e,tokens:T,env:d,lineCount:$,lastSegment:void 0,globalStateReason:Ho(e)},this.updateCacheLineCount(this.cache,$),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!xi(d)?.unbounded}),T}recordChunkedParseResult(e,t){const n=xi(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",Dn(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!xi(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",Dn(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=Ho(e);vu(t)&&Hi(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?hT(n,e.length,o):"no";if(r==="yes"){const a=Ac(n,e,t);return Dn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?Mn(e):0)}}let l=o;if(r==="need-lines"&&(l=Mn(e),fT(n,e.length,l))){const a=Ac(n,e,t);return Dn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?Mn(e):0),{tokens:pa(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:Mn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
|
|
110
|
-
`))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let i=0,r=-1;for(let a=0;a<s&&!(o.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?o:o.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
|
|
111
|
-
`);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const i=t.src.slice(0,s.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+Mn(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let i=null,r=0;for(;r<=s;){let l=o.indexOf(`
|
|
112
|
-
`,r);l===-1&&(l=s);let a=r;for(;a<l;){const c=o.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=o.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&o.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===s)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??OD}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;s<o;s++)e.push(t[s])}updateCacheLineCount(e,t){e.lineCount=t??Mn(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-Am))+t,o=Ho(n);return e.globalStateCarry=n.length>Am?n.slice(n.length-Am):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(`
|
|
113
|
-
`,i+1),i===-1)return e.length;s--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(`
|
|
114
|
-
`,s+1),s===-1)return e.length;o--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,o,s,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,i,r);default:return null}}tryListTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const f=t.lineCount??Mn(t.src);f>0&&this.shiftTokenLines(d,f);const g=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),h=this.getListParagraphMode(u,0,u.length,0);(g==="loose"||h==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const m=f+Mn(i);t.lineCount=m;const _=this.getDocLineCount(e,m);return r.map&&(r.map[1]=_),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:_,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(s.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),g=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!f||!g||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const h=g.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(h.length===0)return null;const m=s.lineEnd-2;m!==0&&this.shiftTokenLines(h,m);const _=g.tbodyCloseIndex>=0?g.tbodyCloseIndex:g.tableCloseIndex,w=t.lineCount??Mn(t.src);t.tokens.splice(_,0,...h),t.src=e,t.env=n,t.globalStateReason=null;const k=w+Mn(i);t.lineCount=k;const b=this.getDocLineCount(e,k);if(r.map&&(r.map[1]=b),g.tbodyOpenIndex>=0){const y=t.tokens[g.tbodyOpenIndex];y?.map&&(y.map[1]=b)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:b,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
115
|
-
`);if(t<0)return null;const n=e.indexOf(`
|
|
116
|
-
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let i=-1,r=-1;for(let l=t+1;l<s;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===o+1){i=l;break}}if(i>=0){for(let l=s-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],i=e[e.length-1];if(s.type!==t||i.type!==n||s.level!==0||i.level!==0||o!==void 0&&s.markup!==o)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,o){let s=!1,i=!1;const r=o+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?s=!0:i=!0,s&&i))return"loose"}return i?"loose":s?"tight":"none"}setListParagraphVisibility(e,t,n,o,s){const i=o+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=s)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=Mn(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o<e.length;o++){const s=e[o];if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children){n??=[];for(let i=s.children.length-1;i>=0;i--)n.push(s.children[i]);for(;n.length>0;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let r=i.children.length-1;r>=0;r--)n.push(i.children[r])}}}}};const hw={default:AD,zero:MD,commonmark:TD};function FD(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function HD(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 pw(e){return e.experimental?{...e,...e.experimental}:e}function As(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 mw(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(As(t,s)||As(e,s))return!0}return!1}function gw(e,t,n){return As(t,n)||As(e,n)}function vw(e,t){const n=xi(e)?.chunk;if(n?.fallback){Dn(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}Dn(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function WD(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamLargeCachePolicy:"retain",streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},o="default",s;!t&&typeof e!="string"?(s=e,o="default"):typeof e=="string"&&(o=e,s=t);const i=hw[o];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${o}", check name`);if(i?.options&&(n={...n,...i.options}),s&&(n={...n,...s}),n=pw(n),typeof n.quotes=="string"){const v=n.quotes;v.length>=4?n.quotes=[v[0],v[1],v[2],v[3]]:n.quotes=["“","”","‘","’"]}let r=mw(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=mw(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=gw(i?.options,s,"fullChunkedFallback"),c=gw(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const g=new $R;let h=null;const m=()=>(h||(h=new LD(n)),h);let _=null;const w=()=>(_||(_=new BD(g)),_);let k=null;const b=()=>(k||(k=new Px),k),y=v=>!u&&!!d&&!HD(v,d),x=(v,M)=>o==="default"&&!u&&h===null&&f!==null&&v.parse===f&&y(v)&&!v.stream.enabled&&M<(v.options.autoUnboundedThresholdChars??4e6)&&v.options.html===!1&&v.options.xhtmlOut===!1&&v.options.breaks===!1&&v.options.langPrefix==="language-"&&v.options.linkify===!1&&v.options.typographer===!1&&v.options.highlight===null,L=(v,M)=>o==="default"&&!u&&y(v)&&!v.stream.enabled&&!v.options.fullChunkedFallback&&M<(v.options.autoUnboundedThresholdChars??4e6)&&v.options.html===!1&&v.options.linkify===!1&&v.options.typographer===!1,N={core:g,block:g.block,inline:g.inline,get linkify(){const v=b();return Object.defineProperty(this,"linkify",{value:v,writable:!0,configurable:!0}),v},get renderer(){const v=m();return Object.defineProperty(this,"renderer",{value:v,writable:!0,configurable:!0}),v},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return y(this)},set(v){const M=pw(v);return this.options={...this.options,...M},(As(v,"fullChunkSizeChars")||As(v,"fullChunkSizeLines")||As(v,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(As(v,"streamChunkSizeChars")||As(v,"streamChunkSizeLines")||As(v,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),As(v,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),As(v,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),h&&h.set(M),typeof M.stream=="boolean"&&(this.stream.enabled=M.stream,_&&(_.reset(),_.resetStats())),this},configure(v){const M=typeof v=="string"?hw[v]:v;if(!M)throw new Error("Wrong `markdown-it` preset, can't be empty");if(M.options&&this.set(M.options),M.components){const $=M.components;$.core?.rules&&this.core.ruler.enableOnly($.core.rules),$.block?.rules&&this.block.ruler.enableOnly($.block.rules),$.inline?.rules&&this.inline.ruler.enableOnly($.inline.rules),$.inline2?.rules&&this.inline.ruler2.enableOnly($.inline2.rules)}return this},enable(v,M){const $=Array.isArray(v)?v:[v],P=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],T=new Set;for(const I of P){if(!I)continue;const R=I.enable($,!0);for(let D=0;D<R.length;D++)T.add(R[D])}if(!M){const I=$.filter(R=>!T.has(R));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(v,M){const $=Array.isArray(v)?v:[v],P=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],T=new Set;for(const I of P){if(!I)continue;const R=I.disable($,!0);for(let D=0;D<R.length;D++)T.add(R[D])}if(!M){const I=$.filter(R=>!T.has(R));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(v,...M){const $=typeof v=="function"?v:v&&typeof v.default=="function"?v.default:void 0;if(!$)throw new TypeError("MarkdownIt.use: plugin must be a function");const P=[this,...M],T=v;return u=!0,$.apply(T,P),this},render(v,M){if(x(this,v.length)){M!==void 0&&To(M);const T=sw(v);if(T!==null)return M!==void 0&&Dn(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),T}const $=M??{},P=this.parse(v,$);return m().render(P,this.options,$)},async renderAsync(v,M){if(x(this,v.length)){M!==void 0&&To(M);const T=sw(v);if(T!==null)return M!==void 0&&Dn(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),T}const $=M??{},P=this.parse(v,$);return m().renderAsync(P,this.options,$)},renderIterable(v,M={}){const $=this.parseIterable(v,M);return m().render($,this.options,M)},async renderAsyncIterable(v,M={}){const $=await this.parseAsyncIterable(v,M);return m().renderAsync($,this.options,M)},renderInline(v,M={}){const $=this.parseInline(v,M);return m().render($,this.options,M)},validateLink:Jx,normalizeLink:eT,normalizeLinkText:tT,utils:QL,helpers:{...FO},parse(v,M){if(typeof v!="string")throw new TypeError("Input data should be a String");if(M!==void 0&&To(M),L(this,v.length)){const I=qR(v);if(I!==null)return M!==void 0&&Dn(M,{area:"parse",path:"stock-fast",reason:"stock-subset"}),I}const $=M??{};let P;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const I=hT(this,v.length);if(I==="yes"){const R=Ac(this,v,$);return Dn(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),R}I==="need-lines"&&(P=Mn(v))}if(!this.stream.enabled){const I=v.length,R=this.options.autoTuneChunks!==!1,D=r,F=!a&&y(this),z=!!this.options.fullChunkedFallback,V=F&&I>=2e5;let ne;(z||V||P!==void 0)&&(ne=P??Mn(v));const K=(z||V)&&R&&!D?xD(I,ne,this.options):null;if(z||V){const G=ne??0;if(z?I>=(this.options.fullChunkThresholdChars??2e4)||G>=(this.options.fullChunkThresholdLines??400):V){if(K&&K.strategy!=="plain"){const X=Of(this,v,$,{maxChunkChars:K.maxChunkChars,maxChunkLines:K.maxChunkLines,fenceAware:K.fenceAware,maxChunks:K.maxChunks});return M&&vw(M,z?"explicit-full-chunk":"default-large-string"),X}if(z){const X=(ce,Se,q)=>ce<Se?Se:ce>q?q:ce,be=this.options.fullChunkAdaptive!==!1,le=this.options.fullChunkTargetChunks??8,We=X(Math.ceil(I/le),8e3,64e3),ue=X(Math.ceil(G/le),150,700),ve=be?We:this.options.fullChunkSizeChars??1e4,Ne=be?ue:this.options.fullChunkSizeLines??200,Re=be?X(Math.ceil(I/64e3),le,32):this.options.fullChunkMaxChunks,Q=Of(this,v,$,{maxChunkChars:ve,maxChunkLines:Ne,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Re});return M&&vw(M,"explicit-full-chunk"),Q}}}if(P!==void 0&&y(this)&&fT(this,I,ne??P)){const G=Ac(this,v,$);return Dn(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),G}}const T=Ho(v);return Dn(M,{area:"parse",path:"plain",reason:"default-plain"}),pa($,T,()=>g.parse(v,$,this).tokens)},parseIterable(v,M={}){return To(M),wD(this,v,M)},parseAsyncIterable(v,M={}){return To(M),_D(this,v,M)},parseIterableToSink(v,M,$={}){return To($),CD(this,v,M,$)},parseAsyncIterableToSink(v,M,$={}){return To($),SD(this,v,M,$)},parseInline(v,M={}){if(typeof v!="string")throw new TypeError("Input data should be a String");To(M),vu(M)&&Hi(M);const $=g.createState(v,M,this);return $.inlineMode=!0,g.process($),$.tokens}};if(N.stream={enabled:!!n.stream,parse(v,M){return N.stream.enabled?w().parse(v,M,N):N.parse(v,M??{})},reset(){w().reset()},peek(){return _?_.peek():[]},stats(){return _?_.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){_&&_.resetStats()}},i?.components){const v=i.components;v.core?.rules&&N.core.ruler.enableOnly(v.core.rules),v.block?.rules&&N.block.ruler.enableOnly(v.block.rules),v.inline?.rules&&N.inline.ruler.enableOnly(v.inline.rules),v.inline2?.rules&&N.inline.ruler2.enableOnly(v.inline2.rules)}return d=FD(N),f=N.parse,N}var UD=WD;const yT=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],qD=["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"],kT=["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"],jD=["svg","g","path"],zD=["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"],VD=["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"],KD=["action","data","href","src","srcset","poster","xlink:href","formaction"],GD=["script"],YD=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],yl=new Set(yT),XD=new Set(kT),nu=new Set([...yT,...qD,...kT,...jD]),bT=new Set([...nu,...zD]),QD=new Set(VD),ZD=new Set(KD),ku=new Set(GD),wT=new Set(YD);function _T(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const JD={amp:"&",bsol:"\\",colon:":",newline:`
|
|
117
|
-
`,sol:"/",tab:" "};function CT(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const i=n??o;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return JD[String(s??"").toLowerCase()]??t})}const vd=new Set(["http","https","mailto","tel"]),e7=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Kr=new Set(["http","https"]);function ST(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function t7(e,t,n){if(!Ic(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function Ic(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function n7(e,t){return t==="href"||t==="xlink:href"?Ic(e,t)?vd:Kr:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Kr:(Ic(e,t),vd)}function cl(e,t={}){const n=_T(CT(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return o==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=ST(n);return i?i==="file"?!t7(n,o,s):Ic(o,s)?e7.has(i):!n7(o,s).has(i):!1}function o7(e){const t=CT(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=ST(_T(t).toLowerCase());return n==="http"||n==="https"}function s7(e,t={}){const n=String(e??"").trim();return n?cl(n,t)?"":n:""}function yw(e){return s7(e,{tagName:"img",attrName:"src"})}function i7(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,g,h,m,_){return f[g].nesting===1&&f[g].attrJoin("class",t),_.renderToken(f,g,h,m,_)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(f,g,h,m){let _,w=!1,k=f.bMarks[g]+f.tShift[g],b=f.eMarks[g];if(l!==f.src.charCodeAt(k))return!1;for(_=k+1;_<=b&&r[(_-k)%a]===f.src[_];_++);const y=Math.floor((_-k)/a);if(y<i)return!1;_-=(_-k)%a;const x=f.src.slice(k,_),L=f.src.slice(_,b);if(!c(L,x))return!1;if(m)return!0;let N=g;for(;N++,!(N>=h||(k=f.bMarks[N]+f.tShift[N],b=f.eMarks[N],k<b&&f.sCount[N]<f.blkIndent));)if(l===f.src.charCodeAt(k)&&!(f.sCount[N]-f.blkIndent>=4)){for(_=k+1;_<=b&&r[(_-k)%a]===f.src[_];_++);if(!(Math.floor((_-k)/a)<y)&&(_-=(_-k)%a,_=f.skipSpaces(_),!(_<b))){w=!0;break}}const v=f.parentType,M=f.lineMax;f.parentType="container",f.lineMax=N;const $=f.push("container_"+t+"_open","div",1);$.markup=x,$.block=!0,$.info=L,$.map=[g,N],f.md.block.tokenize(f,g+1,N);const P=f.push("container_"+t+"_close","div",-1);return P.markup=f.src.slice(k,_),P.block=!0,f.parentType=v,f.lineMax=M,f.line=N+(w?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 r7(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const o=[];let s="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){s+=c,a+1<n.length&&(s+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,s+=c;continue}if(!i&&c==='"'){r=!r,s+=c;continue}if(!i&&!r&&c===","){o.push(s.trim()),s="";continue}s+=c}s.trim()&&o.push(s.trim());const l={};for(const a of o){if(!a)continue;let c=!1,u=!1,d=-1;for(let _=0;_<a.length;_++){const w=a[_];if(w==="\\"){_++;continue}if(!u&&w==="'"){c=!c;continue}if(!c&&w==='"'){u=!u;continue}if(!c&&!u&&w===":"){d=_;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),g=a.slice(d+1).trim();if(!f)return null;let h=f;if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{h=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(h))return null;let m;if(!g)m="";else if(g.startsWith('"')&&g.endsWith('"')||g.startsWith("'")&&g.endsWith("'"))try{m=JSON.parse(g.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=g}else/^-?\d+(?:\.\d+)?$/.test(g)?m=Number(g):g==="true"||g==="false"?m=g==="true":g==="null"?m=null:m=g;l[h]=m}return l}function l7(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(i7,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
118
|
-
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,g;const h=d.indexOf("{"),m=h>=0?d.slice(h).trimStart():void 0;if(h===-1)f=d||void 0;else{if(f=d.slice(0,h).trim()||void 0,m?.startsWith("{")){let x=0,L=-1;for(let N=0;N<m.length;N++)if(m[N]==="{"?x++:m[N]==="}"&&x--,x===0){L=N+1;break}L>0&&(g=m.slice(0,L))}g||(f=d||void 0)}if(s)return!0;const _=!!i.env.__markstreamFinal;let w=n+1,k=!1;for(;w<=o;){const x=i.bMarks[w]+i.tShift[w],L=i.eMarks[w];if(i.src.slice(x,L).trim()===":::"){k=!0;break}w++}k||(w=o);const b=i.push("vmr_container_open","div",1);if(b.attrSet("class",`vmr-container vmr-container-${u}`),b.meta={...b.meta??{},unclosed:!k&&!_},f&&b.attrSet("data-args",f),g)try{const x=JSON.parse(g);for(const[L,N]of Object.entries(x)){const v=N!=null&&typeof N=="object";b.attrSet(`data-${L}`,v?JSON.stringify(N):String(N))}}catch{const x=r7(g);if(x)for(const[L,N]of Object.entries(x)){const v=N!=null&&typeof N=="object";b.attrSet(`data-${L}`,v?JSON.stringify(N):String(N))}else b.attrSet("data-attrs",g)}const y=[];for(let x=n+1;x<w;x++){const L=i.bMarks[x]+i.tShift[x],N=i.eMarks[x];y.push(i.src.slice(L,N))}if(y.some(x=>x.trim().length>0)){let x=y.join(`
|
|
119
|
-
`);x.endsWith(`
|
|
120
|
-
`)||(x+=`
|
|
121
|
-
`),x.endsWith(`
|
|
122
|
-
|
|
123
|
-
`)||(x+=`
|
|
124
|
-
`);const L=i.tokens[i.tokens.length-1];L&&(L.raw=x);const N=[];i.md.block.parse(x,i.md,i.env,N),i.tokens.push(...N)}return k&&i.push("vmr_container_close","div",-1),i.line=k?w+1:w,!0},{alt:["paragraph","reference","blockquote","list"]})}function ds(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Sn(e){let t=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="\\"){o++;continue}if(!n&&s==="'"){t=!t;continue}if(!t&&s==='"'){n=!n;continue}if(!t&&!n&&s===">")return o}return-1}function Ph(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=o[2]||o[3]||o[4]||"";t.push([s,i])}return t}const a7=/^[a-z][a-z0-9_-]*$/;function kw(e){return a7.test(String(e??"").trim().toLowerCase())}function Ds(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return kw(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const o=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const s=t.slice(o,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":kw(s)?s:""}function Ia(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=Ds(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function c7(...e){const t=new Set,n=[];for(const o of e)for(const s of Ia(o))t.has(s)||(t.add(s),n.push(s));return n}function u7(e){const t=Ia(e);return{key:t.join(","),tags:t}}function xT(e){return Ds(e)}function d7(e,t){const n=String(e??""),o=Ds(t);if(!o)return!1;const s=ds(o),i=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function TT(e,t){const n=Ds(t);return!!n&&!nu.has(n)&&!d7(e,n)}function f7(e,t){const n=String(e??""),o=Ds(t);if(!o)return n;const s=ds(o),i=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const AT=yl,h7=nu,MT=new Set(XD);MT.delete("details");const p7=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,m7=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,n1=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,g7=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Df(e){return(e.match(n1)?.[1]??"").toLowerCase()}function Hv(e){return/^\s*<\s*\//.test(e)}function Wv(e,t){return AT.has(t)||/\/\s*>\s*$/.test(e)}function v7(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(!s||s.type!=="html_inline")continue;const i=String(s.content??""),r=Df(i);if(r===t){if(Hv(i)){if(n===0)return o;n--;continue}Wv(i,r)||n++}}return-1}function y7(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=Df(s);if(i===t){if(Hv(s)){n>0&&n--;continue}Wv(s,i)||n++}}return n}function bw(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${ds(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,i;for(;(i=o.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:i.index,end:i.index+r.length};s--;continue}a||s++}return null}function k7(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${ds(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const i=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(i);if(r){o>0&&o--;continue}l||o++}return o}function Bf(e){const t=e;return String(t.raw??t.content??t.markup??"")}function b7(e){const t=e;return t.meta||(t.meta={}),t.meta}function Mm(e,t,n){const o=b7(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function w7(e,t){if(!t.size)return;const n=Array.from(t,g=>new RegExp(String.raw`<\s*${ds(g)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=g=>g?n.some(h=>h.test(g)):!1,r=g=>{if(!(!g||!o.length))for(const h of o)h.raw+=g,h.inner+=g},l=()=>{!o.length||!s||(r(`
|
|
125
|
-
`),s=!1)},a=g=>{r(g)},c=g=>{for(let m=0;m<o.length;m++)o[m].raw+=g,m<o.length-1&&(o[m].inner+=g);const h=o.pop();Mm(h.token,h.raw,h.inner)},u=g=>{const h=o[o.length-1]?.tag;if(!h)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${ds(h)}\s*>`,"i");return g.match(m)?.[0]??null},d=g=>!!u(g),f=(g,h,m)=>{const _=m??(g.type==="html_inline"?Df(h):"");if(!(_&&t.has(_))){r(h);return}const w=Hv(h),k=!w&&Wv(h,_);if(w){if(!o.length||o[o.length-1].tag!==_){r(h);return}c(h);return}if(r(h),k){Mm(g,h,"");return}o.push({tag:_,token:g,raw:h,inner:""})};for(const g of e){if(g.type==="inline"&&Array.isArray(g.children)){const h=String(g.content??"");if(d(h)?s=!1:l(),!o.length&&!i(h)){s=!1;continue}let m=0,_=!0;for(const w of g.children){const k=Bf(w),b=w.type==="html_inline"?Df(k):"",y=b&&t.has(b);let x=k;if(_&&h&&k&&(o.length||y)){const L=h.indexOf(k,m);if(L!==-1)a(h.slice(m,L)),x=h.slice(L,L+k.length),m=L+k.length;else{if(o.length&&!y)continue;_=!1}}f(w,x,b)}_&&h&&m<h.length&&o.length&&a(h.slice(m)),s=o.length>0;continue}if(o.length&&typeof g.content=="string"){const h=Bf(g),m=g.type==="html_block"?u(h):null;if(m){c(`${s?`
|
|
126
|
-
`:""}${m}`),s=o.length>0;continue}if(!g.content)continue;l(),r(g.content),s=!0}}for(const g of o)Mm(g.token,g.raw,g.inner)}function _7(e){return/^\s*<\s*[!?]/.test(e)}function C7(e){const t=new Set(h7);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function ww(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function S7(e,t){let n=null;for(const i of e.matchAll(p7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();ww(l,t)&&Sn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(m7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();ww(l,t)&&Sn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const o=/<\/\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const s=/<\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function x7(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function T7(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(x7(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const f=a.slice(d),g=f.match(n1);if(!g){i("<",c),u=d+1;continue}const h=Sn(f);if(h===-1){i("<",c),u=d+1;continue}const m=f.slice(0,h+1),_=(g[1]??"").toLowerCase();t.has(_)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=S7(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),o={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},s=o.buffer}for(const a of e){if(o){o.buffer+=Bf(a),s=o.buffer;const c=Sn(o.buffer);if(c===-1)continue;const u=o.buffer.slice(0,c+1),d=o.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),o=null,s=null,d&&l(d);continue}if(a.type==="html_inline"){const c=Bf(a),u=(c.match(n1)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Sn(c)===-1){o={tag:u,buffer:c,closing:/^<\s*\//.test(c)},s=o.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:s??void 0}}const A7=["a","span","strong","em","b","i","u"];function M7(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const g=Ds(f);g&&n.add(g)}const o=f=>{const g=f,h=new Set(n),m=Array.isArray(g.env?.__markstreamCustomHtmlTags)?g.env.__markstreamCustomHtmlTags:[];for(const b of m){const y=Ds(String(b??""));y&&h.add(y)}const _=C7(Array.from(h)),w=new Set(A7);for(const b of h)w.add(b);return{autoCloseInlineTagSet:w,commonHtmlTags:_,customTagSet:h,shouldMergeHtmlBlockTag:b=>h.has(b)||!_.has(b)||MT.has(b)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const g=f.children[0];return g?.type!=="html_block"?"":String(f.content??g.content??"")},i=(f,g)=>{f.type="html_block",f.content=g,f.raw=g,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,g)=>{const h=r(f);if(!/\S/.test(h))return[];if(l(h))return[{type:"code_block",content:a(h),raw:h}];const m=h.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const _={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return g==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},_,{type:"paragraph_close",tag:"p",nesting:-1}]:g==="text"?[{type:"text",content:m,raw:m}]:[_]},u=(f,g,h)=>f[g-1]?.type==="paragraph_open"&&f[g+1]?.type==="paragraph_close"?"inline":h,d=(f,g)=>{const h=r(g);return!/\S/.test(h)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${h}`,f.children.push({type:"text",content:h,raw:h}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const g=f.tokens??[],{commonHtmlTags:h,customTagSet:m}=o(f);for(const _ of g){const w=_;if(w.type!=="inline"||!Array.isArray(w.children))continue;const k=String(w.content??""),b=w.children.length?w.children:k.includes("<")?[{type:"text",content:k,raw:k}]:null;if(b)try{const y=T7(b,h);if(w.children=y.children,y.pendingBuffer){const x=k.lastIndexOf(y.pendingBuffer);if(x!==-1){const L=k.slice(0,x);w.content=L,typeof w.raw=="string"&&(w.raw=L)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}w7(g,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const g=f.tokens??[],{autoCloseInlineTagSet:h,customTagSet:m,shouldMergeHtmlBlockTag:_}=o(f),w=[];for(let k=0;k<g.length;k++){const b=g[k];if(w.length>0){const[x,L]=w[w.length-1];if(k!==L){if(b.type==="paragraph_open"||b.type==="paragraph_close"){g.splice(k,1),k--;continue}const N=String(b.content??b.raw??"");if(N){const v=g[L],M=`${String(v.content||"")}
|
|
127
|
-
${N}`,$=Sn(M),P=$===-1?null:bw(M,x,$+1);if(P){const T=M.slice(0,P.end),I=M.slice(P.end);v.content=T,v.loading=!1,g.splice(k,1),w.pop();const R=d(v,I)?[]:c(I,u(g,k,"paragraph"));R.length&&g.splice(k,0,...R),k--;continue}v.content=M,v.loading!==!1&&(v.loading=!0)}g.splice(k,1),k--;continue}}const y=s(b);if(y){if(_7(y))continue;const x=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(y);if(!x||!_(x))continue;if(i(b,y),!L)x&&!new RegExp(`^\\s*<\\s*${x}\\b[^>]*\\/\\s*>`,"i").test(y)&&k7(y,x)>0&&w.push([x,k]);else if(w.length>0&&x&&w[w.length-1][0]===x){const[,N]=w[w.length-1],v=g[N];v.content=`${String(v.content||"")}
|
|
128
|
-
${y}`,v.loading=!1,w.pop(),g.splice(k,1),k--}continue}else if(w.length>0){if(b.type==="paragraph_open"||b.type==="paragraph_close"){g.splice(k,1),k--;continue}const x=b.content||"",L=new RegExp(`<\\s*\\/\\s*${w[w.length-1][0]}\\s*>`,"i").test(x);if(x){const[,N]=w[w.length-1],v=g[N];v.content=`${v.content||""}
|
|
129
|
-
${x}`,v.loading!==!1&&(v.loading=!L)}L&&w.pop(),g.splice(k,1),k--}else continue}if(m.size>0){const k=new Map,b=new Map,y=N=>{let v=k.get(N);return v||(v=new RegExp(`<\\s*${N}\\b`,"i"),k.set(N,v)),v},x=N=>{let v=b.get(N);return v||(v=new RegExp(`<\\s*\\/\\s*${N}\\s*>`,"i"),b.set(N,v)),v},L=[];for(let N=0;N<g.length;N++){const v=g[N],M=String(v.content??"");if(L.length>0){const P=L[L.length-1],T=g[P.index],I=v.type==="html_block"?x(P.tag).exec(M):null;if(I){const F=I.index+I[0].length,z=M.slice(0,F),V=M.slice(F);T.content=`${String(T.content??"")}
|
|
130
|
-
${z}`,Array.isArray(T.children)&&T.children.push({type:"html_inline",content:`</${P.tag}>`,raw:`</${P.tag}>`}),L.pop();const ne=d(T,V)?[]:c(V,u(g,N,"paragraph"));ne.length?g.splice(N,1,...ne):(g.splice(N,1),N--);continue}if(v.type!=="inline")continue;const R=Array.isArray(v.children)?v.children:[],D=v7(R,P.tag);if(D!==-1){const F=R.slice(0,D+1),z=R.slice(D+1),V=F.map(ne=>String(ne?.content??ne?.raw??"")).join("");if(T.content=`${String(T.content??"")}
|
|
131
|
-
${V}`,Array.isArray(T.children)&&T.children.push(...F),z.length){const ne=z.map(K=>String(K.content??K.raw??"")).join("");if(ne.trim()){const K=ne.replace(/^\s+/,"");if(d(T,ne))g.splice(N,1),N--;else if(K.startsWith("<"))g.splice(N,1,{type:"html_block",content:K});else{const G=c(ne,u(g,N,"paragraph"));g.splice(N,1,...G)}}else g.splice(N,1),N--}else g.splice(N,1),N--;L.pop();continue}T.content=`${String(T.content??"")}
|
|
132
|
-
${M}`,Array.isArray(T.children)&&T.children.push(...R),g.splice(N,1),N--;continue}if(v.type!=="inline")continue;const $=Array.isArray(v.children)?v.children:[];for(const P of m)if(($.length?y7($,P):y(P).test(M)&&!x(P).test(M)?1:0)>0){L.push({tag:P,index:N});break}}}{let k=0;for(let b=0;b<g.length;b++){const y=g[b];if(y.type==="paragraph_open"){k++;continue}y.type==="paragraph_close"&&(k>0?k--:(g.splice(b,1),b--))}}for(let k=0;k<g.length;k++){const b=g[k];if(b.type==="html_block"){const v=(b.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(v.startsWith("!")||v.startsWith("?")){b.loading=!1;continue}if(m.has(v)){const D=String(b.content??""),F=Sn(D),z=F===-1?null:bw(D,v,F+1);b.loading=z?!1:b.loading!==void 0?b.loading:!0;const V=z?.start??-1,ne=z?z.end-z.start:0;if(V!==-1){const K=D.slice(0,V+ne);let G="";F!==-1&&F<V&&(G=D.slice(F+1,V)),b.children=[{type:v,content:G,raw:K,attrs:[],tag:v,loading:!1}],b.content=K,b.raw=K;const X=c(D.slice(V+ne)||"","text");X.length&&g.splice(k+1,0,...X)}else b.children=[{type:v,content:"",raw:D,attrs:[],tag:v,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(v))continue;b.type="inline";const M=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let $;for(;($=M.exec(b.content||""))!==null;)$[1],$[2]||$[3]||$[4];const P=String(b.content??""),T=new RegExp(`<\\/\\s*${v}\\s*>`,"i").exec(P),I=T?T.index:-1,R=T?T[0].length:0;if(I!==-1){const D=P.slice(0,I+R),F=(P.slice(I+R)||"").replace(/^\s+/,"");b.children=[{type:"html_block",content:D,tag:v,loading:!1}],b.content=D,b.raw=D,F&&g.splice(k+1,0,F.startsWith("<")?{type:"html_block",content:F}:{type:"text",content:F,raw:F})}else b.children=[{type:"html_block",content:b.content,tag:v,loading:!0}];continue}if(!b||b.type!=="inline")continue;if(b.children.length===2&&b.children[0].type==="html_inline"){const v=(b.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),M=b.children[1],$=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&$===v)continue;h.has(v)?(b.children[0].loading=!0,b.children[0].tag=v,b.children.push({type:"html_inline",tag:v,loading:!0,content:`</${v}>`})):b.children=[{type:"html_block",loading:!0,tag:v,content:String(b.children[0]?.content??"")+String(b.children[1]?.content??"")}];continue}else if(b.children.length===3&&b.children[0].type==="html_inline"&&b.children[2].type==="html_inline"){const v=(b.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(h.has(v))continue;b.children=[{type:"html_block",loading:!1,tag:v,content:b.children.map(M=>M.content).join("")}];continue}if(!b.content?.startsWith("<")||b.children?.length!==1)continue;const y=String(b.content),x=b,L=x.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(x.children.length=0);continue}const N=String(L.content??y).match(g7)?.[1]?.toLowerCase()??"";if(N){if(/\/\s*>\s*$/.test(y)||AT.has(N)){x.children=[{type:"html_inline",content:y}];continue}x.children.length=0}}})}function E7(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 I7(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;s<o.length;s++){const i=o[s];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!E7(l[0]??"")){const a=l[0]??"",c=i.level??0;o.splice(s,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),s+=2}}})}const ET=/\.([a-z0-9]{1,15})$/i,$7=/[_()[\]{}<>]/u,N7=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,L7=/[?#@]/u,O7=/[\\/]/u,P7=/^[\p{L}\p{N}./\\-]+$/u,R7=/^[A-Za-z0-9-]{1,63}$/u,D7=/^xn--[a-z0-9-]{2,59}$/i,B7=/^(?:[A-Z]{1,6}|\d{1,8})$/u,F7=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,H7=/文件名\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,W7=/文件名\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,U7=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,q7=new Set(["ai","md","py","rs","sh","zip"]),IT=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),j7=new Set([...IT,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),z7=new Set(["com","dev","io","page","site"]),V7=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),K7=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 ou(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Em(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return ou(n)?n:void 0}function _w(e,t){if(!ou(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 Cw(e){const t=bu(e);return ou(t)?t:void 0}function G7(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Sw(e,t){if(!ou(t))return;const n=String(e??"").trim().split(/\s+/u).map(G7).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>Ff(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>Ff(s,{marketTicker:!0}))&&(o.marketTicker=!0),ou(o)?o:void 0}function $r(e,t=!1){let n;return{options(o){return t||o==null?_w(e,n):_w(e,Em(Cw(o),Sw(o,n)))},remember(o){const s=Cw(o);n=t?Em(n,s):Em(s,Sw(o,n))},reset(){n=void 0}}}function xw(e){return R7.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function Y7(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return xw(n)||D7.test(n)?t.every(xw):!1}function $T(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function X7(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function Q7(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function NT(e,t,n){const o=X7(t);return $T(e)&&Q7(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function bu(e){const t=String(e??"");return{explicitFilename:H7.test(t),filename:W7.test(t),marketTicker:U7.test(t)}}function Z7(e){return Y7(e.split(/[\\/]/)[0]??"")}function J7(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function eB(e){if($7.test(e)||!P7.test(e))return!0;if(O7.test(e))return!Z7(e);const t=e.replace(ET,"");return $T(t)?!0:t.split(".").filter(Boolean).some(J7)}function tB(e,t,n){if(!(n?j7:IT).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?F7:B7).test(o)}function Ff(e,t={}){if(!e||N7.test(e)||L7.test(e))return!1;const n=e.match(ET);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return tB(e,o,t.marketTicker===!0)?!0:K7.has(o)?!q7.has(o)||t.filename?!0:eB(e):!!(t.explicitFilename&&z7.has(o)||t.filename&&V7.has(o))}const Tw=["!"];function Bo(e){return{type:"text",content:e,raw:e}}function Gr(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 Yr(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 er(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function nB(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(Bo(t))}}function Aw(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||s<n)&&(n=s)}return n}function oB(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function sB(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function iB(e,t,n){let o="";for(let s=t+1;s<n;s++){const i=e[s];if(i?.type!=="text"||typeof i.content!="string")return null;o+=i.content}return o||null}function rB(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=lB(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function lB(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=bu(t);for(let o=0;o<=e.length-1;o++){o<0&&(o=0);const s=e[o];if(!s)break;if(s.type==="link_open"&&(s.markup==="linkify"||s.markup==="autolink")){let i=-1;for(let r=o+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=iB(e,o,i),l=oB(s);if(s.markup==="linkify"&&r&&!NT(r,l,t)&&Ff(r,n)){e.splice(o,i-o+1,Bo(r));continue}const a=Aw(l,Tw);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=Aw(u.content,Tw);if(d===-1)continue;const f=u.content[d],g=u.content.slice(0,d);let h=u.content.slice(d);for(let w=c+1;w<i;w++){const k=e[w];k?.type==="text"&&typeof k.content=="string"&&(h+=k.content)}u.content=g,u.raw=g;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let _=l;if(a!==-1)_=l.slice(0,a);else if(h){const w=encodeURI(h);if(w&&l.endsWith(w))_=l.slice(0,l.length-w.length);else{const k=f?encodeURI(f):"",b=k?l.indexOf(k):-1;b!==-1&&(_=l.slice(0,b))}}_!==l&&sB(s,_),h&&e.splice(i+1,0,Bo(h));break}}}if(s?.type==="em_open"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("*")){const i=e[o-1].content?.replace(/(\*+)$/,"")||"";e[o-1].content=i,s.type="strong_open",s.tag="strong",s.markup="**";for(let r=o+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(s?.type==="text"&&s.content?.endsWith("(")&&e[o+1]?.type==="link_open"){const i=s.content.match(/\[([^\]]+)\]/);if(i){let r=s.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Bo(r));const c=i[1],u=l[1].length;Gr(a,u);let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(er(c,d,!e[o+4]?.content?.startsWith(")"))),Yr(a,u),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)\**/,"");f&&a.push(Bo(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(Bo(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let g=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(g+=e[o+4]?.content||"",e[o+4].content=""),Gr(a,f),a.push(er(c,g,!e[o+4]?.content?.startsWith(")"))),Yr(a,f),e[o+4]?.type==="text"){const h=e[o+4].content?.replace(/^\)/,"");h&&a.push(Bo(h)),e.splice(o,5,...a)}else e.splice(o,4,...a);o===0?o=a.length-1:o-=a.length+1;continue}let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(er(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(Bo(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}o-=a.length+1;continue}}else if(s.type==="link_open"&&s.markup==="linkify"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("(")){if(e[o-2]?.type==="link_close"){const i=[],r=e[o-3].content||"";let l=s.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[o+3]?.type==="text"){const a=(e[o+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[o+3]?.content?.slice(0,a)||"",e[o+3].content=""),i.push(er(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(Bo(u)),e.splice(o-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(o-4,7,...i);continue}else if(e[o-1].content==="]("&&e[o-3]?.type==="text"&&e[o-3].content?.endsWith(")"))if(e[o-2]?.type==="strong_open"){const[i,r]=e[o-3].content?.split("[**")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else if(e[o-2]?.type==="em_open"){const[i,r]=e[o-3].content?.split("[*")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else{const[i,r]=e[o-3].content?.split("[")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}}if(s.type==="link_close"&&s.nesting===-1&&e[o-2]?.type==="link_open"&&e[o+1]?.type==="text"&&e[o-1]?.type==="text"){const i=e[o-1].content||"",r=e[o-2].attrs||[],l=r.find(h=>h[0]==="href")?.[1]||"",a=r.find(h=>h[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const h=d[1].length;Gr(f,h)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let h=o+1;h<e.length;h++){const m=d?d[1].length:e[o-3].markup.length,_=e[h];if(m===1&&_.type==="em_close")break;if(m===2&&_.type==="strong_close")break;if(m===3&&(_.type==="em_close"||_.type==="strong_close"))break;c+=1}}const g={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(g),d){const h=d[1].length;Yr(f,h)}e.splice(o-u,c,...f),o-=f.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].markup?.includes("*")&&e[o-4]?.type==="text"&&e[o-4].content?.endsWith("[")){const i=e[o-1].markup.length,r=[],l=e[o-4].content.slice(0,e[o-4].content.length-i);l&&r.push(Bo(l)),Gr(r,i);const a=e[o-2].content||"";let c=s.content.slice(2),u=!0;if(e[o+1]?.type==="text"){const d=(e[o+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[o+1]?.content?.slice(0,d)||"",e[o+1].content="")}if(r.push(er(a,c,u)),Yr(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(Bo(d)),e.splice(o-4,8,...r)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...r):e.splice(o-4,7,...r);o-=r.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].type==="strong_close"&&e[o-4]?.type==="text"&&e[o-4]?.content?.includes("**[")){const i=[],r=e[o-4].content.split("**[")[0];r&&i.push(Bo(r)),Gr(i,2);const l=e[o-2].content||"";let a=s.content.slice(2),c=!0;if(e[o+1]?.type==="text"){const u=(e[o+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[o+1]?.content?.slice(0,u)||"",e[o+1].content="")}if(i.push(er(l,a,c)),Yr(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(Bo(u)),e.splice(o-4,8,...i)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...i):e.splice(o-4,7,...i);o-=i.length+1;continue}else if(s.type==="strong_close"&&e[o+1]?.type==="text"&&e[o+1].content?.includes("](")&&e[o-1].type==="text"&&/\[.*$/.test(e[o-1].content||"")){const i=[],[r,l]=e[o-1].content?.split("[")||["",""];r&&i.push(Bo(r)),Gr(i,2);let[a,c]=e[o+1].content.split("](");a=l+a;let u=4;if(e[o+2]?.type==="link_open"){const f=e[o+2].attrs?.find(g=>g[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(f||c)+e[o+5].content,e[o+5].content=""):c=f||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const f=(e[o+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[o+2]?.content?.slice(0,f)||"",e[o+2].content="")}i.push(er(a,c,d)),Yr(i,2),e.splice(o-2,u,...i)}if(s.type==="text"&&/\*+\[[^\]]*$/.test(s.content||"")&&e[o+1]?.type==="strong_open"&&e[o+2]?.type==="text"&&e[o+2].content==="]("&&e[o+3]?.type==="link_open"&&e[o+5]?.type==="link_close"&&e[o+6]?.type==="text"&&e[o+6].content===")"&&e[o+7]?.type==="strong_close"){const i=(s.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[o+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[o+4]?.type==="text"&&(l=e[o+4].content||"");const a=[];Gr(a,2),a.push(er(r,l,!1)),Yr(a,2),e.splice(o,9,...a),o-=a.length-1;continue}}}for(let o=0;o<e.length-1;o++){const s=e[o],i=e[o+1];if(s?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(s.href??"");if(String(s.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;nB(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function aB(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=cB(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function cB(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 uB(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=dB(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function dB(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const g=String(d.markup??"");let h=u-1;for(;h>=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const w=e[_];g==="__"&&(m?.content?.endsWith("_")||w?.content?.startsWith("_")||w?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=g,d.raw=g,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(f==="em_open"){s++;const g=String(d.markup??"");let h=u-1;for(;h>=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const w=e[_];g==="_"&&(m?.content?.endsWith("_")||w?.content?.startsWith("_")||w?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=g,d.raw=g,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else f==="em_close"&&(o.has(s)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),s--,s<0&&(s=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,f=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],g=c.slice(0,-1);g&&f.unshift({type:"text",content:g,raw:g}),l.splice(i,d,...f)}return l=fB(l),l}function fB(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const f=u.slice(0,d),g=u.slice(d+2);t.push(o),t.push(s),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),g&&t.push({...c,type:"text",content:g,raw:g}),n+=6;continue}}if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=hB(e,n+6);if(u){t.push(o),t.push(s),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(o)}return t}function hB(e,t){for(let n=t;n<e.length;n++){const o=e[n];if(o?.type==="strong_open")return null;if(o?.type!=="text")continue;const s=String(o.content??""),i=s.indexOf("**");if(i!==-1)return{index:n,beforeClose:s.slice(0,i),afterClose:s.slice(i+2)}}return null}function pB(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=bB(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function Mw(){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 Ew(){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 Iw(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 LT(e,t){if(!e.startsWith("|")||e.includes(`
|
|
133
|
-
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function Im(e){return LT(e)!==null}function OT(e){return/^:?-+:?$/.test(e.trim())}function mB(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(OT)}function gB(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function vB(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(OT)&&gB(n)}function yB(e){return e==="|"||e==="|:"}function kB(e){const t=LT(e);return t!==null&&t.every(n=>!n.includes(":"))}function bB(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,i=e[s];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
134
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
135
|
-
`),d=!t&&!r.includes(`
|
|
136
|
-
`)&&/\r?\n$/.test(n)&&Im(r);if(!t&&(r.includes(`
|
|
137
|
-
`)&&u.length===0&&Im(a)&&vB(c)||d)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>Iw(h)),g=[...Mw(),...f,...Ew()];o.splice(s-1,3,...g)}else if(r.includes(`
|
|
138
|
-
`)&&u.length===0&&Im(a)&&mB(c)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>Iw(h)),g=[...Mw(),...f,...Ew()];o.splice(s-1,3,...g)}else r.includes(`
|
|
139
|
-
`)&&u.length===0&&kB(a)&&yB(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function wB(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c<s-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=o;let l=0,a=t;for(;a<s;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var _B=wB;const CB=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Hf=CB.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),SB=/\\[a-z]+/i,PT="(?:\\\\|\\u0008)",xB=new RegExp(String.raw`${PT}(?:${Hf})\s*\{[^}]+\}`,"i"),TB=new RegExp(String.raw`(?:${PT})?(?:${Hf})\s*\{`,"i"),AB=/\\(?:text|frac|left|right|times)/,MB=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,EB=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,IB=/[A-Z]+\s*\([^)]+\)/i,$B=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,NB=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,LB=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,OB={"\b":"\\b","\v":"\\v","\f":"\\f"};function PB(e){let t="";for(const n of e)t+=OB[n]??n;return t}function ta(e){if(!e)return!1;const t=PB(e),n=t.trim();if(LB.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=SB.test(t),s=xB.test(t),i=TB.test(t),r=AB.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=MB.test(t)&&!EB.test(t),c=IB.test(t),u=$B.test(n),d=NB.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),g=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||g}const RT="__markstreamMathPluginApplied",o1=80,DT=2e4,$w=DT+4096;function BT(e){return!!e[RT]}function RB(e){e[RT]=!0}const FT=["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"],DB=["cdot","mathbf{","partial","mu_{"],HT=FT.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),WT="[ \r\b\f\v]",BB=new RegExp(`([^\\\\])(${DB.map(e=>e).join("|")})+`,"g"),FB=/span\{([^}]+)\}/,HB=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,WB=/(^|[^\\])\\\r?\n/g,UB=/(^|[^\\])\\$/g,qB=new RegExp(`(${WT})|(${HT})\\b`,"g"),Nw=new Map,Lw=new Map;function jB(e){if(!e)return qB;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=Nw.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${WT})|(${s})\\b`,"g");return Nw.set(n,i),i}function zB(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=Lw.get(o);if(s)return s;const i=e?[Hf,HT].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Hf].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Lw.set(o,r),r}const Ow={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Pw(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Rw(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function tr(e,t){const n=t?.commands??FT,o=t?.escapeExclamation??!0,s=t?.commands==null,i=jB(s?void 0:n);let r=e.replace(i,(c,u,d,f,g)=>{if(u!==void 0&&Ow[u]!==void 0)return`\\${Ow[u]}`;if(d&&n.includes(d)){const h=g&&typeof f=="number"?g[f-1]:void 0;return h==="\\"||h&&/\w/.test(h)?c:`\\${d}`}return c});o&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=zB(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(FB,"span\\{$1\\}").replace(HB,"\\operatorname{span}\\{$1\\}"),l=l.replace(WB,`$1\\\\
|
|
140
|
-
`),l=l.replace(UB,"$1\\\\"),l=l.replace(BB,"$1\\$2"),l}function Dw(e){const t=e.trim();return!(!ta(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 UT(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const o=n;let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;let i=o+s,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===s){r=i;break}i+=l}if(r!==-1){t.push([o,r+s]),n=r+s;continue}n=o+s}return t}function Wf(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function VB(e,t=!1){const n=[];let o=0;for(;o<e.length-1;){if(e[o]==="!"&&e[o+1]==="["){const s=o;let i=o+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([s,l]),o=l;continue}if(t){n.push([s,e.length]),o=e.length;continue}}}o++}return n}function wu(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function s1(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(wu(e,o)){n=o+1;continue}return o}return-1}function $m(e,t){let n=t;for(;n<e.length;){const o=s1(e,n);if(o===-1)return-1;if(o>0&&e[o-1]==="$"||o+1<e.length&&e[o+1]==="$"){n=o+1;continue}return o}return-1}function mc(e,t,n=0){let o=Math.max(0,n);for(;o<e.length;){const s=e.indexOf(t,o);if(s===-1)return-1;if(!wu(e,s))return s;o=s+Math.max(1,t.length)}return-1}function Bw(e,t,n=0,o=e.length,s=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,o));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=Wf(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}wu(e,a)||i++,r=a+Math.max(1,t.length)}return i}function Uv(e,t,n){const o=iu(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!iu(o.slice(0,s)).trim()||wu(o,s))return-1;const i=UT(o);if(Wf(i,s))return-1;const r=Bw(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>Bw(o,n,0,s,i))return-1;return s}function su(e){return e===" "||e===" "}function iu(e){let t=e.length;for(;t>0&&su(e[t-1]);)t--;return e.slice(0,t)}function Fw(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
141
|
-
`&&t++;return t}function Hw(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function KB(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s===t){n++;continue}if(!su(s))return!1}return n>=3}function GB(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function YB(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(GB)}function XB(e){let t=0;if(!Hw(e[t]))return!1;for(;Hw(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:su(e[t+1])}function qT(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&su(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&su(t[1])||XB(t)||KB(t)||YB(t))}function Ww(e,t){return e?t?`${e}
|
|
142
|
-
${t}`:e:t}function i1(e){const t=String(e??"").trim();return t?ta(t):!1}function Uw(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function jT(e){if(e.length<=$w)return{source:e,lineOffset:0};let t=e.length-$w;const n=e.indexOf(`
|
|
143
|
-
`,t);return n===-1?{source:"",lineOffset:Fw(e)}:(t=n+1,{source:e.slice(t),lineOffset:Fw(e.slice(0,t))})}function zT(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=jT(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-o1-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=iu(o[r]);if(l&&!qT(l)){for(const[a,c]of i)if(Uv(l,a,c)!==-1)return!0}}return!1}function QB(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=jT(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-o1-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=iu(s[l]);for(const[c,u]of r){const d=Uv(a,c,u);if(d===-1)continue;let f="",g=!1;for(let h=l+1;h<s.length;h++){if(h-l>o1){g=!0;break}const m=s[h],_=mc(m,u);if(_!==-1){const w=Ww(f,m.slice(0,_));if(!i1(w)){g=!0;break}const k=m.slice(_+u.length),b=k.trim()?`suffix:${Uw(k)}`:"nosuffix";return["closed",c,o+l,d,o+h,_,Uw(w),b].join(":")}if(qT(m)){g=!0;break}if(f=Ww(f,m),f.length>DT){g=!0;break}}if(!g&&i1(f))return["pending",c,o+l,d].join(":")}}return null}function Nm(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function ZB(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function Lm(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function JB(e,t){RB(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},o=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(k,b)=>{let y=b;for(;y<k.length&&(k[y]===" "||k[y]===" ");)y++;if(y===b||!(k[y]===`
|
|
144
|
-
`||k[y]==="\r"&&k[y+1]===`
|
|
145
|
-
`))return b;const x=k.slice(b,y),L=a.push("text","",0);return L.content=x,y};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let k=a.pos+1;for(;a.src[k]==="$";)k++;const b=k-a.pos,y=a.src[k];if(b>=3&&(!y||/\s/.test(y))){const x=a.push("text","",0);return x.content=a.src.slice(a.pos,k),a.pos=k,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],g=String(a.pending??""),h=Math.max(0,a.pos-g.length);let m=h,_=h;const w=h;for(const[k,b]of f){const y=a.src,x=UT(y),L=VB(y,u);let N=!1;k==="$$"&&m!==w&&(m=w);let v=-1,M=-1,$=0;const P=T=>{if((T==="undefined"||T==null)&&(T=""),T==="\\"){a.pos=a.pos+T.length,m=a.pos;return}if(T==="\\)"||T==="\\("){const D=a.push("text_special","",0);D.content=T==="\\)"?")":"(",D.markup=T,a.pos=a.pos+T.length,m=a.pos;return}if(!T)return;if(k==="$$"&&T.includes("$")){let D=0;for(;D<T.length;){const F=s1(T,D);if(F===-1){const ue=T.slice(D);if(ue){const ve=a.push("text","",0);ve.content=ue,a.pos=a.pos+ue.length,m=a.pos}break}if(F>0&&T[F-1]==="$"||F+1<T.length&&T[F+1]==="$"){const ue=T.slice(D,F+1);if(ue){const ve=a.push("text","",0);ve.content=ue,a.pos=a.pos+ue.length,m=a.pos}D=F+1;continue}const z=T.slice(D,F);if(z){const ue=a.push("text","",0);ue.content=z,a.pos=a.pos+z.length,m=a.pos}const V=$m(T,F+1);if(V===-1){const ue=T.slice(F),ve=a.push("text","",0);ve.content=ue,a.pos=a.pos+ue.length,m=a.pos;break}const ne=T.slice(F+1,V),K=ne.includes("`"),G=!ne||!ne.trim(),X=T[V+1],be=Nm(ne,X),le=Lm(ne);if(!K&&!G&&!be&&!le){const ue=a.push("math_inline","math",0);ue.content=tr(ne,t),ue.markup="$",ue.raw=`$${ne}$`,ue.loading=!1,a.pos=a.pos+(V-F+1),m=a.pos,D=V+1;continue}const We=a.push("text","",0);We.content="$",a.pos=a.pos+1,m=a.pos,D=F+1}return}const I=T.indexOf("![");if(I!==-1){if(I>0){const z=T.slice(0,I),V=a.push("text","",0);V.content=z,a.pos=a.pos+z.length,m=a.pos}const D=T.slice(I).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(D){const[,z,V]=D,ne=V.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),K=ne?ne[1]:V,G=ne&&ne[2]?ne[2]:null,X=a.push("image","img",0);X.attrs=[["src",K],["alt",z]],G&&X.attrs.push(["title",G]),X.content=z,X.children=[{type:"text",content:z,tag:""}],a.pos=a.pos+D[0].length,m=a.pos;const be=T.slice(I+D[0].length);be&&P(be);return}const F=a.push("text","",0);F.content=T,a.pos=a.pos+T.length,m=a.pos;return}const R=a.push("text","",0);R.content=T,a.pos=a.pos+T.length,m=a.pos};for(;!(m>=y.length);){const T=y.indexOf(k,m);if(T===-1)break;if(wu(y,T)){m=T+Math.max(1,k.length);continue}const I=Wf(x,T);if(I){m=I[1];continue}const R=Wf(L,T);if(R){m=R[1];continue}if(T===v&&m===M){if($++,$>2){m=T+Math.max(1,k.length);continue}}else $=0,v=T,M=m;if(k==="("&&T>0){let be=T-1;for(;be>=0&&y[be]===" ";)be--;if(be>=0&&y[be]==="]"){m=T+k.length;continue}}if(k==="$"&&T>0&&y[T-1]==="$"){m=T+1;continue}if(k==="$"&&T<y.length-1&&y[T+1]==="$"){m=T+2;continue}const D=k==="$"?$m(y,T+k.length):_B(y,T+k.length,k,b);if(D===-1){const be=y.slice(T+k.length);if(be.includes(k)){m=y.indexOf(k,T+k.length);continue}if(D===-1){const le=k==="$"&&ZB(be);if(u&&!c&&!le&&ta(be)&&!be.includes("`")){if(m=T+k.length,N=!0,!l){a.pending="";const We=_?y.slice(_,m):y.slice(0,m),ue=Pw(We)%2===1;if(_)P(y.slice(_,m));else{let ve=y.slice(0,m);ve.endsWith(k)&&(ve=ve.slice(0,ve.length-k.length)),P(ve)}if(ue){const ve=Rw(We)?.marker??"**",Ne=a.push("strong_open","",0);Ne.markup=ve;const Re=a.push("math_inline","math",0);Re.content=tr(be,t),Re.markup=k==="$$"?"$$":k==="\\("?"\\(\\)":k==="$"?"$":"()",Re.raw=`${k}${be}${b}`,Re.loading=!0,Ne.content=be,a.push("strong_close","",0)}else{const ve=a.push("math_inline","math",0);ve.content=tr(be,t),ve.markup=k==="$$"?"$$":k==="\\("?"\\(\\)":k==="$"?"$":"()",ve.raw=`${k}${be}${b}`,ve.loading=!0}a.pos=y.length}m=y.length,_=m}break}}const F=y.slice(T+k.length,D),z=F.includes("`"),V=!F||!F.trim(),ne=k==="$",K=y[D+b.length],G=ne&&Nm(F,K),X=ne&&Lm(F);if(c?z||V||G||X:z||V||G||X||!ne&&!ta(F)){m=D+b.length;const be=y.slice(a.pos,m);a.pending||(P(be),_=m);continue}if(N=!0,!l){const be=y.slice(a.pos-(a.pending??"").length,T);let le=y.slice(0,m)?y.slice(_,T):be;const We=Pw(le)%2===1;T!==a.pos&&We&&(le=a.pending+y.slice(a.pos,T));const ue=We?Rw(le):null,ve=ue?.marker??"**";if(a.pending!==le)if(a.pending="",We)if(ue){const Ne=le.slice(ue.index+ve.length);P(le.slice(0,ue.index));const Re=a.push("strong_open","",0);Re.markup=ve;const Q=a.push("text","",0);Q.content=Ne,a.push("strong_close","",0)}else P(le);else P(le);if(We){const Ne=a.push("strong_open","",0);Ne.markup=ve;const Re=a.push("math_inline","math",0);Re.content=tr(F,t),Re.markup=k==="$$"?"$$":k==="\\("?"\\(\\)":k==="$"?"$":"()",Re.raw=`${k}${F}${b}`,Re.loading=!1;const Q=y.slice(D+b.length).startsWith(ve);return Q&&a.push("strong_close","",0),a.pos=d(y,D+b.length),m=a.pos,_=m,Q||a.push("strong_close","",0),!0}else{const Ne=a.push("math_inline","math",0);Ne.content=tr(F,t),Ne.markup=k==="$$"?"$$":k==="\\("?"\\(\\)":k==="$"?"$":"()",Ne.raw=`${k}${F}${b}`,Ne.loading=!1}}return m=d(y,D+b.length),_=m,a.pos=m,!0}if(N){if(l)a.pos=m;else{if(k==="$$"&&m<y.length&&y.slice(m).includes("$")){let T=m;for(;!(T>=y.length);){const I=s1(y,T);if(I===-1)break;if(I+1<y.length&&y[I+1]==="$"){T=I+2;continue}if(I>0&&y[I-1]==="$"){T=I+1;continue}const R=$m(y,I+1);if(R===-1)break;const D=y.slice(I+1,R),F=D.includes("`"),z=!D||!D.trim(),V=y[R+1],ne=Nm(D,V),K=Lm(D);if(!F&&!z&&!ne&&!K){const G=y.slice(m,I);G&&P(G);const X=a.push("math_inline","math",0);X.content=tr(D,t),X.markup="$",X.raw=`$${D}$`,X.loading=!1,m=R+1,T=R+1}else P("$"),T=I+1}T<y.length&&P(y.slice(T))}else m<y.length&&P(y.slice(m));a.pos=y.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,g=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],h=u.bMarks[l]+u.tShift[l];let m=u.src.slice(h,u.eMarks[l]).trim(),_=!1,w="",k="",b=!1,y="",x=!1;for(const[G,X]of g)if(m.startsWith(G))if(G.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){_=!0,w=G,k=X;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){_=!0,w=G,k=X;break}continue}else{const be=u.tokens[u.tokens.length-1];if(be&&be.type==="list_item_open"&&be.mark==="-"&&m.slice(G.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const le=m.indexOf("]");if(m.slice(le).trim()!=="]")continue;const We=m.slice(G.length,le);if(G==="["?Dw(We):ta(We)){_=!0,w=G,k=X;break}continue}}else{_=!0,w=G,k=X;break}else if((G==="$$"||G==="\\[")&&m.endsWith(G)&&l+1<a){const be=Uv(m,G,X);if(be===-1)continue;y=iu(m.slice(0,be)),x=!0;const le=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(le,u.eMarks[l+1]).trim(),b=!0,_=!0,w=G,k=X;break}if(!_)return!1;if(c&&!x)return!0;const L=m.indexOf(w),N=L+w.length,v=!f&&w==="["?m.indexOf("\\]",N):-1,M=v>=0?"\\]":k,$=v>=0?v:mc(m,k,N);if(!b&&$>w.length){const G=m.slice(L+w.length,$),X=u.push("math_block","math",0);X.content=tr(G),X.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",X.map=[l,l+1],X.raw=`${w}${G}${M}`,X.block=!0,X.loading=!1,u.line=l+1;const be=m.slice($+M.length);return be.trim()&&n(u,be,l),!0}let P=l,T="",I=!1,R="",D=l;const F=b?m:m===w?"":m.slice(w.length),z=!f&&w==="\\["?"]":"",V=mc(F,k);if(V!==-1){const G=V;T=F.slice(0,G),R=F.slice(G+k.length),D=b?l+1:l,I=!0,P=D}else for(F&&!b&&(T=F),P=l+1;P<a;P++){const G=u.bMarks[P]+u.tShift[P],X=u.eMarks[P],be=u.src.slice(G,X),le=be.trim();if(!f&&w==="["&&le==="\\]"){k="\\]",I=!0;break}if(z&&be.trim()===z){k=z,I=!0;break}if(le===k){I=!0;break}else if(!f&&w==="["&&be.includes("\\]")){I=!0;const We=be.indexOf("\\]");k="\\]";const ue=be.slice(0,We);ue&&(T+=(T?`
|
|
146
|
-
`:"")+ue),R=be.slice(We+k.length),D=P;break}else if(mc(be,k)!==-1){I=!0;const We=mc(be,k),ue=be.slice(0,We);ue&&(T+=(T?`
|
|
147
|
-
`:"")+ue),R=be.slice(We+k.length),D=P;break}T+=(T?`
|
|
148
|
-
`:"")+be}if((!d||f)&&!I)return!1;const ne=/^\s*!\[/.test(T);if(!(x?!ne&&i1(T):w==="$$"?!ne:w==="["?Dw(T):ta(T)))return!1;if(c)return!0;y&&n(u,y,l);const K=u.push("math_block","math",0);return K.content=tr(T),K.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",K.raw=`${w}${T}${T.startsWith(`
|
|
149
|
-
`)?`
|
|
150
|
-
`:""}${k}`,K.map=[l,P+1],K.block=!0,K.loading=!I,u.line=P+1,R.trim()&&n(u,R,D),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function e9(e){const t=e.renderer.rules.image||function(n,o,s,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,i,r)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],i=String(s.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(s.content??""))}</code></pre>`})}function t9(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new UD({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!cl(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&JB(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&l7(i),e.enableFixIndentedCodeBlock!==!1&&I7(i),rB(i),uB(i),aB(i),pB(i),e9(i),M7(i,{customHtmlTags:e.customHtmlTags}),i}function ul(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=>ul(n))),t}function n9(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function o9(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function s9(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function yd(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];s+=String(e[i].content??l.text??""),r.push(e[i]),i++}return o.push(...xn(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const qw=/\r?\n[ \t]*`+\s*$/,VT=["diff ","index ","--- ","+++ ","@@ "],i9=/\r?\n/;function r9(e){const t=String(e??"");return t?VT.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function jw(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function l9(e,t){const n=[],o=[],s=[],i=[],r=e.split(i9),l=/\r?\n$/.test(e),a=r.some(g=>g.startsWith("diff ")||g.startsWith("--- ")||g.startsWith("+++ ")||g.startsWith("@@ ")),c=g=>{const h=g;if(!VT.some(m=>h.startsWith(m)))if(h.startsWith("-")){const m=h.slice(1);s.push(!a&&m.startsWith(" ")?` ${m}`:m)}else if(h.startsWith("+")){const m=h.slice(1);i.push(!a&&m.startsWith(" ")?` ${m}`:m)}else{jw(n,o,s,i);const m=a&&h.startsWith(" ")?h.slice(1):h;n.push(m),o.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let g=0;g<u;g++){const h=r[g]??"";!t&&!l&&g===u-1&&r9(h)||c(h)}(t||s.length>0||i.length>0)&&jw(n,o,s,i);const d=n.join(`
|
|
151
|
-
`),f=o.join(`
|
|
152
|
-
`);return{original:t&&l&&d?`${d}
|
|
153
|
-
`:d,updated:t&&l&&f?`${f}
|
|
154
|
-
`:f}}function qv(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},o=typeof n.closed=="boolean"?n.closed:void 0,s=o===!0||o!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(qw.test(a)&&(a=a.replace(qw,"")),r){const{original:c,updated:u}=l9(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t}}function a9(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function c9(){return{type:"hardbreak",raw:`\\
|
|
155
|
-
`}}function u9(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...xn(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let Om=null;const Pm=new WeakMap;function zw(){return Om||(Om={customTagSet:null,allowedTagSet:Bh()}),Om}function KT(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function GT(e){return/^<\s*\//.test(e)}function YT(e,t){return/\/\s*>\s*$/.test(t)||yl.has(e)}function d9(e){if(!e||e.length===0)return zw();const t=Pm.get(e);if(t)return t;const n=e.map(Ds).filter(Boolean);if(!n.length){const s=zw();return Pm.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:Bh({customHtmlTags:e})};return Pm.set(e,o),o}function XT(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function f9(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Uf(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function h9(e,t,n){const o=e.slice();return Uf(o,"href")||o.push(["href",t]),n!=null&&!Uf(o,"title")&&o.push(["title",n]),o}function r1(e){return e.map(XT).join("")}function Wd(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${s}`,i.raw=`${i.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:Wd(o.children)});continue}t.push(o)}return t}function p9(e,t,n){let o=0;for(let s=t;s<e.length;s++){const i=e[s];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=KT(r),a=GT(r),c=YT(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function Rm(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?p9(e,t+1,n):-1;return l!==-1?(s=e.slice(t+1,l),o.push(...s,e[l]),i=l+1,r=!0):(s=e.slice(t+1),s.length&&o.push(...s),i=e.length),{closed:r,html:r1(o),innerTokens:s,nextIndex:i}}function m9(e,t,n,o,s,i,r){const l=String(e.content??""),a=KT(l),{customTagSet:c,allowedTagSet:u}=d9(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!Rm(t,n,a).closed){const x=XT(e);return[{type:"text",content:x,raw:x},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=GT(l),f=YT(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const x=Rm(t,n,a),L=Ph(l),N=x.innerTokens,v=String(Uf(L,"href")??""),M=Uf(L,"title"),$=M==null?null:String(M),P=h9(L,v,$),T=Wd(N.length?o(N,s,i,r):[]),I=N.length?r1(N):v||"";return!T.length&&I&&T.push({type:"text",content:I,raw:I}),[{type:"link",href:v,title:$,text:I,attrs:P,children:T,loading:!x.closed,raw:x.html||l},x.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const g=Rm(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Wd(g.innerTokens.length?o(g.innerTokens,s,i,r):[]),raw:g.html},g.nextIndex];const h=Wd(g.innerTokens.length?o(g.innerTokens,s,i,r):[]);let m=g.html||l,_=!g.closed,w=!1;if(!g.closed){const x=`</${a}>`;m.toLowerCase().includes(x.toLowerCase())||(m+=x),w=!0,_=!0}const k=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=b.exec(l))!==null;){const x=y[1],L=y[2]||y[3]||y[4]||"";k.push([x,L])}if(c?.has(a)){const x=f9(e);return[{type:a,tag:a,attrs:k,content:x?x.inner:g.innerTokens.length?r1(g.innerTokens):"",children:g.innerTokens.length?o(g.innerTokens,s,i,r):[],raw:x?.raw??m,loading:e.loading||_,autoClosed:w},g.nextIndex]}return[{type:"html_inline",tag:a,attrs:k,content:m,children:h,raw:m,loading:_,autoClosed:w},g.nextIndex]}function QT(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=>QT(t)).join(""):String(e.content??"")}function g9(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>QT(t)).join("")}function Vw(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=g9(o??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:s,alt:l,title:c,raw:u,loading:t}}function v9(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function y9(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...xn(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function k9(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const o=n?.[0];o&&t.push([String(o),String(n?.[1]??"")])}return t}function qf(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function b9(e,t,n){const o=e.slice();return qf(o,"href")||o.push(["href",t]),n!=null&&!qf(o,"title")&&o.push(["title",n]),o}function kd(e,t,n){const o=e[t],s=k9(o.attrs),i=String(qf(s,"href")??""),r=qf(s,"title"),l=r==null?null:String(r),a=b9(s,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let f=u;const g=u[u.length-1];if(n?.__insideStrong&&g?.type==="text"&&String(g.content??"").endsWith("**")&&!u.some(_=>_.type==="strong_open")){const _=String(g.content??""),w=String(g.raw??_),k=ul(g);k.content=_.slice(0,-2),k.raw=w.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=k}const h=xn(f,void 0,void 0,n),m=h.map(_=>{const w=_;return"content"in _?String(w.content??""):String(w.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:h,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function Kw(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 w9(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function Gw(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...xn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const _9=/\\([\\()[\]`$|*_\-!])/g;function C9(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(_9,"$1")===t))return n}function rc(e,t,n,o){const s=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...o,__insideStrong:!0};return s.push(...xn(l,C9(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function S9(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)s+=String(e[i].content??""),r.push(e[i]),i++;o.push(...xn(r,void 0,void 0,n));const l=String(e[t].content??""),a=s||l;return{node:{type:"subscript",children:o.length>0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function x9(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...xn(r,void 0,void 0,n)),{node:{type:"superscript",children:o.length>0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function T9(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const A9=/[^~]*~{2,}[^~]+/,M9=/\*\*/,E9=/[[_*^~]/,I9=/\\([\\()[\]`$|*_\-!])/g,jv=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),$9=/\s/u,N9=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,L9=/\p{P}/u,O9=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,P9=/:\/\//;function R9(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 ZT(e,t=0){if(!e)return-1;let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&jv.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function xr(e){return!!e&&$9.test(e)}function Tr(e){return!!e&&(N9.test(e)||L9.test(e))}function D9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||xr(o)?!1:!(Tr(o)&&n&&!xr(n)&&!Tr(n))}function B9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||xr(n)?!1:!(Tr(n)&&o&&!xr(o)&&!Tr(o))}function F9(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?ZT(e,o):t.indexOf("*",o);if(i===-1)break;if(B9(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function H9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||xr(o)?!1:!(Tr(o)&&n&&!xr(n)&&!Tr(n))}function W9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||xr(n)?!1:!(Tr(n)&&o&&!xr(o)&&!Tr(o))}function U9(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(W9(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function q9(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let o=0;for(;n+o<e.length&&e[n+o]==="\\";)o++;const s=e[n+o];if(t+="\\".repeat(Math.floor(o/2)),o%2===1){if(s&&jv.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function j9(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&jv.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function z9(e,t,n){const o=j9(e,t);if(o===-1||e[o]!==n)return!1;let s=0;for(let i=o-1;i>=0&&e[i]==="\\";i--)s++;return s%2===1}const V9=/[\p{L}\p{N}]/u,K9=/^[\p{L}\p{N}]+$/u;function l1(e){return e?V9.test(e):!1}function JT(e){return e?K9.test(e):!1}function $c(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const o=t>0?e[t-1]:void 0,s=n<e.length?e[n]:void 0;return{len:n-t,prev:o,next:s,intraword:l1(o)&&l1(s)}}function G9(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=$c(e,n),s=n+o.len;o.len>=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n<t.length-1;n++){const o=t[n],s=t[n+1];if(!JT(e.slice(o.end,s.start)))return s.end}return-1}function Y9(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function X9(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=$c(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function Q9(e){return e?O9.test(e)||P9.test(e):!1}function Z9(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function xn(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=bu(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function g(){return e===f&&(e=e.slice()),e}function h(){c=null}function m(Q,ce){const Se=e.length===1?t:String(ce.content??""),q=[],ee=G9(Q);if(ee!==-1){x(Q.slice(0,ee),Q.slice(0,ee));const oe=Q.slice(ee);return oe&&($({type:"text",content:oe,raw:oe}),u--),u++,!0}if(A9.test(Q)){const oe=Q.indexOf("~~");oe!==-1&&q.push({type:"strikethrough",index:oe})}if(M9.test(Q)){const oe=Q.indexOf("**");oe!==-1&&q.push({type:"strong",index:oe})}if(/[^*]*\*[^*]+/.test(Q)){const oe=Se?ZT(Se,0):Q.indexOf("*");if(Se&&oe===-1)return!1;oe!==-1&&q.push({type:"emphasis",index:oe})}q.sort((oe,fe)=>oe.index!==fe.index?oe.index-fe.index:oe.type===fe.type?0:oe.type==="strong"?-1:fe.type==="strong"?1:0);const he=q[0];if(!he)return!1;if(he.type==="strikethrough"){const oe=he.index,fe=oe>-1?Q.slice(0,oe):"";if(fe&&x(fe,fe),oe===-1)return u++,!0;const W=Q.indexOf("~~",oe+2),Y=W===-1?Q.slice(oe+2):Q.slice(oe+2,W),re=W===-1?"":Q.slice(W+2),{node:ge}=Gw([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:Y,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return h(),y(ge),re&&($({type:"text",content:re,raw:re}),u--),u++,!0}if(he.type==="strong"){const oe=he.index,fe=oe>-1?Q.slice(0,oe):"";if(fe&&x(fe,fe),oe===-1)return u++,!0;if(t&&oe===0){let $e=!1,se=0;for(;se<Q.length&&Q[se]==="*";)se++;if(t.startsWith("\\*")&&($e=!0),$e){let ae=0,we=0;for(;we<t.length&&ae<se;)if(t[we]==="\\"&&we+1<t.length&&t[we+1]==="*")ae+=1,we+=2;else{if(t[we]==="*")break;we++}if(ae>=2)return x(Q,Q),u++,!0}}if(t&&(Q.match(/\*/g)||[]).length>R9(t))return x(Q.slice(fe.length),Q.slice(fe.length)),u++,!0;const W=$c(Q,oe);if(W.len>=3){const $e=X9(Q,oe+W.len);if($e!==-1){const se=Q.slice(oe+W.len,$e);if(Y9(se)){const{node:ae}=rc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:se,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);h(),y(ae);const we=Q.slice($e+3);return we&&($({type:"text",content:we,raw:we}),u--),u++,!0}}}if(!H9(Q,oe)){const $e=Q.slice(oe,oe+W.len);x($e,$e);const se=Q.slice(oe+W.len);return se&&($({type:"text",content:se,raw:se}),u--),u++,!0}const Y=U9(Q,oe+2);let re="",ge="";if(Y.index!==-1){re=Q.slice(oe+2,Y.index),ge=Q.slice(Y.index+2);const $e=Y.index,se=$c(Q,$e);if(W.intraword&&se.intraword&&!JT(re)||!re&&W.len>=4&&W.intraword)return x(Q.slice(fe.length),Q.slice(fe.length)),u++,!0}else{if(d||Y.sawInvalidClose||W.intraword)return x(Q.slice(fe.length),Q.slice(fe.length)),u++,!0;re=Q.slice(oe+2),ge=""}if(!re&&/^\*+$/.test(ge))return x(Q,Q),u++,!0;const{node:xe}=rc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:re,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return h(),y(xe),ge&&($({type:"text",content:ge,raw:ge}),u--),u++,!0}if(he.type==="emphasis"){let oe=he.index;oe===-1&&(oe=0);const fe=Q.slice(0,oe);if(fe&&x(fe,fe),!D9(Q,oe)){x(Q[oe],Q[oe]);const $e=Q.slice(oe+1);return $e&&($({type:"text",content:$e,raw:$e}),u--),u++,!0}const W=$c(Q,oe),Y=F9(Se,Q,oe+1),re=Y.index,ge=e[u+1];if(o?.final&&ge?.type==="em_open"&&re!==-1&&Q.slice(oe+1,re).trim()!==Q.slice(oe+1,re)||re===-1&&(Y.sawInvalidClose||o?.final||W.intraword||!l1(Q[oe+1])))return x(Q.slice(oe),Q.slice(oe)),u++,!0;const{node:xe}=yd([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:re>-1?Q.slice(oe+1,re):Q.slice(oe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(h(),y(xe),re!==-1&&re<Q.length-1){const $e=Q.slice(re+1);$e&&($({type:"text",content:$e,raw:$e}),u--)}return u++,!0}return!1}function _(Q,ce){if(!Q.includes("`"))return!1;const q=(ge=>{for(let xe=0;xe<ge.length;xe++){if(ge[xe]!=="`")continue;let $e=0;for(let se=xe-1;se>=0&&ge[se]==="\\";se--)$e++;if($e%2===0)return xe}return-1})(Q);if(q===-1)return!1;let ee=1;for(let ge=q+1;ge<Q.length&&Q[ge]==="`";ge++)ee++;const he="`".repeat(ee),oe=q+ee,fe=Q.indexOf(he,oe);if(fe===-1){if(ee===1){const xe=Q.slice(0,q),$e=Q.slice(q+1);return xe&&(m(xe,ce)?u--:x(xe,xe)),k({type:"inline_code",code:$e,raw:String($e)}),u++,!0}let ge=Q;for(let xe=u+1;xe<e.length;xe++)ge+=String((e[xe].content??"")+(e[xe].markup??""));return u=e.length-1,x(ge,ge),u++,!0}h();const W=Q.slice(0,q),Y=Q.slice(q+ee,fe),re=Q.slice(fe+ee);return W&&(m(W,ce)?u--:x(W,W)),k({type:"inline_code",code:Y,raw:String(Y??"")}),re&&($({type:"text",content:re,raw:re}),u--),u++,!0}function w(Q){const ce=l?.__markdownIt;if(!ce||e.length<=1||!e.some(he=>he?.type==="math_inline")||!E9.test(Q))return null;const Se=ce.parseInline(Q,{__markstreamFinal:!!o?.final});if(!Array.isArray(Se)||Se.length===0)return null;const q=(Se.find(he=>he?.type==="inline")?.children??[]).filter(he=>!(he?.type==="text"&&String(he.content??"")===""));if(!q.length||!q.some(he=>he?.type!=="text")||q.length===1&&q[0]?.type==="text"&&String(q[0].content??"")===Q)return null;const ee=xn(q,Q,n,o);return ee.length?ee:null}function k(Q){h(),a.push(Q)}function b(Q){h();const ce=ul(Q);a.push(ce)}function y(Q){k(Q)}function x(Q,ce){c?(c.content+=Q,c.raw+=ce??Q):(c={type:"text",content:String(Q??""),raw:String(ce??Q??"")},a.push(c))}function L(Q,ce){if(!Q)return;const Se=xn([{...ce,type:"text",content:Q,raw:Q}],Q,n,o);if(Se.length===1&&Se[0]?.type==="text"){const q=Se[0];x(String(q.content??""),String(q.raw??q.content??""));return}for(const q of Se)y(q)}function N(Q,ce){return String(Q.markup??"").startsWith(ce)}function v(Q){return Q.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(Q,ce){let Se=Q;const q=String(ce.content??"");return Se.endsWith("\\")&&!N(ce,"\\\\")&&!q.endsWith("\\\\")&&(Se=Se.slice(0,-1)),Se.endsWith("(")&&!N(ce,"\\(")&&!q.endsWith("\\(")&&(Se=Se.slice(0,-1)),/\*+$/.test(Se)&&!N(ce,"\\*")&&!q.endsWith("\\*")&&(Se=Se.replace(/\*+$/,"")),Se}for(;u<e.length;){const Q=e[u];$(Q)}function $(Q){switch(Q.type){case"text":T(Q);break;case"softbreak":c?(c.content+=`
|
|
156
|
-
`,c.raw+=`
|
|
157
|
-
`):(c={type:"text",content:`
|
|
158
|
-
`,raw:`
|
|
159
|
-
`},a.push(c)),u++;break;case"code_inline":y(v9(Q)),u++;break;case"html_inline":{const[ce,Se]=m9(Q,e,u,xn,t,n,o);y(ce),u=Se;break}case"link_open":I(Q);break;case"image":be(Q)||(h(),y(Vw(Q)),u++);break;case"strong_open":{h();const{node:ce,nextIndex:Se}=rc(e,u,Q.content,o);y(ce),u=Se;break}case"em_open":{h();const{node:ce,nextIndex:Se}=yd(e,u,o);y(ce),u=Se;break}case"s_open":{h();const{node:ce,nextIndex:Se}=Gw(e,u,o);y(ce),u=Se;break}case"mark_open":{h();const{node:ce,nextIndex:Se}=u9(e,u,o);y(ce),u=Se;break}case"ins_open":{h();const{node:ce,nextIndex:Se}=y9(e,u,o);y(ce),u=Se;break}case"sub_open":{h();const{node:ce,nextIndex:Se}=S9(e,u,o);y(ce),u=Se;break}case"sup_open":{h();const{node:ce,nextIndex:Se}=x9(e,u,o);y(ce),u=Se;break}case"sub":h(),y({type:"subscript",children:[{type:"text",content:String(Q.content??""),raw:String(Q.content??"")}],raw:`~${String(Q.content??"")}~`}),u++;break;case"sup":h(),y({type:"superscript",children:[{type:"text",content:String(Q.content??""),raw:String(Q.content??"")}],raw:`^${String(Q.content??"")}^`}),u++;break;case"emoji":{h();const ce=e[u-1];ce?.type==="text"&&/\|:-+/.test(String(ce.content??""))?x("",""):y(s9(Q)),u++;break}case"checkbox":h(),y(n9(Q)),u++;break;case"checkbox_input":h(),y(o9(Q)),u++;break;case"footnote_ref":h(),y(a9(Q)),u++;break;case"footnote_anchor":{h();const ce=Q.meta??{};k({type:"footnote_anchor",id:String(ce.label??Q.content??""),raw:String(Q.content??"")}),u++;break}case"hardbreak":h(),y(c9()),u++;break;case"fence":h(),y(qv(e[u])),u++;break;case"math_inline":h(),!Q.content&&Q.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(Kw({...Q,content:e[u+1].content})),u+=2):y(Kw(Q)),u++;break;case"reference":D(Q);break;case"text_special":x(String(Q.content??""),String(Q.content??"")),u++;break;default:{const ce=Q;if(Q.type==="link"&&ce.href!=null&&o?.validateLink&&!o.validateLink(String(ce.href))){h();const Se=String(ce.text??"");x(Se,Se),u++}else le(Q)||z(Q)||ne(Q)||F(Q)||b(Q),u++;break}}}function P(Q,ce,Se,q){const ee=T9({...ce,content:Q});if(c){c.content+=M(ee.content,ce),c.raw+=ee.raw;return}const he=Se?.tag==="br"&&e[u-2]?.content==="[";q||(ee.content=M(ee.content,ce)),c=ee,c.center=he,a.push(c)}function T(Q){const ce=String(Q.content??""),Se=e.length===1&&ce.includes("\\")&&typeof t=="string"?String(t):"";let q=Se?q9(Se):ce.replace(I9,"$1");if(Q.content==="<"||q==="1"&&e[u-1]?.tag==="br"){u++;return}const ee=q.indexOf("$");ee!==-1&&ee===q.lastIndexOf("$")&&q.endsWith("$")&&(q=q.slice(0,-1)),q.endsWith("undefined")&&!t?.endsWith("undefined")&&(q=q.slice(0,-9));let he=a.length,oe="";for(let re=a.length-1;re>=0;re--){const ge=a[re];if(ge.type!=="text")break;he=re,oe=String(ge.content??"")+oe}he<a.length&&(q.startsWith(oe)?(c=null,a.length=he):c=a[a.length-1]);const fe=e[u+1];if((q==="`"||q==="|"||q==="$")&&!N(Q,`\\${q}`)||/^\*+$/.test(q)&&!N(Q,"\\*")){u++;return}if(!fe&&/[^\]]\s*\(\s*$/.test(q)&&(q=q.replace(/\(\s*$/,"")),!q){u++;return}if(X(q)||We(q))return;if(!(q.includes("*")||q.includes("_")||q.includes("~")||q.includes("`")||q.includes("[")||q.includes("!")||q.includes("$")||q.includes("|")||q.includes("("))){P(q,Q,e[u-1],fe),u++;return}if(Re(q))return;const W=e[u-1];if(q==="["&&!fe?.markup?.includes("*")&&!N(Q,"\\[")||q==="]"&&!W?.markup?.includes("*")&&!N(Q,"\\]")){u++;return}if(_(ce,Q)||Ne(q)||(e[u+1]?.type!=="link_open"||v(q))&&ve(q,Q))return;const Y=w(ce);if(Y){h();for(const re of Y)y(re);u++;return}m(q,Q)||(P(q,Q,W,fe),u++)}function I(Q){if(R(Q))return;if(ue()){const{node:fe,nextIndex:W}=kd(e,u,o),Y=String(fe.text||fe.href||"");x(Y,Y),u=W;return}h();const{node:ce,nextIndex:Se}=kd(e,u,o);u=Se;const q=ce.text||ce.href||"";if(Q.markup==="linkify"&&!NT(q,ce.href,t)&&Ff(q,l?.__linkifyDemotionContext)){x(q,q);return}const ee=ce.children.length===1&&ce.children[0]?.type==="text";if(ce.loading&&t&&ce.text===ce.href&&ee){const fe=Z9(t,ce.href);fe&&(ce.text=fe,ce.children=[{type:"text",content:fe,raw:fe}],ce.raw=`[${fe}](${ce.href}${ce.title?` "${ce.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(ce.href)){x(ce.text,ce.text);return}const he=Q.attrs?.find(([fe])=>fe==="href")?.[1],oe=String(he??"");if(t&&oe){const fe=t.indexOf("](");if(fe!==-1){const W=t.indexOf(")",fe+2);W===-1?ce.loading=!0:ce.loading&&t.slice(fe+2,W).includes(oe)&&(ce.loading=!1)}}F(ce)||k(ce)}function R(Q){if(Q.markup!=="linkify")return!1;const{node:ce,nextIndex:Se}=kd(e,u,o);return V(ce,Se)?(u=Se,!0):!1}function D(Q){h(),y(w9(Q)),u++}function F(Q){if(Q.type!=="link")return!1;const ce=a[a.length-1];if(!ce||ce.type!=="text")return!1;const Se=String(ce.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!Se)return!1;const q=Q,ee=String(q.href??""),he=String(q.text??""),oe=String(Se[2]??""),fe=ee.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ee||!(he===ee||he===fe||Q9(he)))return!1;const W=String(Se[1]??"");return W?(ce.content=W,ce.raw=W):a.pop(),k({...Q,text:oe,children:[{type:"text",content:oe,raw:oe}],raw:`[${oe}](${ee}${q.title?` "${q.title}"`:""})`}),!0}function z(Q){if(Q.type!=="link")return!1;const ce=Q,Se=String(ce.href??"");return Se?V({href:Se,title:ce.title==null||ce.title===""?null:String(ce.title),loading:!!ce.loading},u+1):!1}function V(Q,ce){const Se=a[a.length-1];if(Se?.type!=="image"||Se.src||!Se.loading||!String(Se.raw??"").endsWith("]("))return!1;const q=e[ce],ee=String(q?.content??"");if(q?.type!=="text"||!ee.startsWith(")"))return!1;a.pop(),c=null;const he=String(Se.alt??"");k({type:"image",src:Q.href,alt:he,title:Q.title,raw:``,loading:!!Q.loading});const oe=ee.slice(1),fe=ul(q);return fe.content=oe,fe.raw=oe,g()[ce]=fe,!0}function ne(Q){if(Q.type!=="link")return!1;const ce=a[a.length-1],Se=e[u-1];if(!ce||ce.type!=="text"||Se?.type!=="text")return!1;const q=String(ce.content??""),ee=String(Se.content??"");if(!q.endsWith("!")||!ee.endsWith("!")||N(Se,"\\!"))return!1;const he=q.slice(0,-1);he?(ce.content=he,ce.raw=he,c=ce):(a.pop(),c=null);const oe=Q,fe=String(oe.text??oe.children?.map(re=>String(re?.content??re?.raw??"")).join("")??""),W=String(oe.href??""),Y=oe.title==null||oe.title===""?null:String(oe.title);return k({type:"image",src:W,alt:fe,title:Y,raw:``,loading:!!oe.loading}),!0}function K(Q,ce="",Se=null){const q=String(Q.alt??Q.raw??"");return{type:"link",href:ce,title:Se,text:q,children:[Q],raw:`[${q}](${ce}${Se?` "${Se}"`:""})`,loading:!0}}function G(Q){const ce=Q.startsWith(";return{type:"image",src:"",alt:q===-1?Se.replace(/\]$/,""):Se.slice(0,q),title:null,raw:ce,loading:!0}}function X(Q){const ce=Q.indexOf("[![");if(ce===-1||typeof t=="string"&&e.length===1&&z9(t,ce,"["))return!1;const Se=Q.slice(0,ce);return Se&&x(Se,Se),k(K(G(Q.slice(ce+1)))),u++,!0}function be(Q){if(o?.final)return!1;const ce=e[u-1];if(ce?.type!=="text"||!String(ce.content??"").endsWith("[")||N(ce,"\\["))return!1;const Se=a[a.length-1];if(Se?.type==="text"&&Se.content.endsWith("[")){const q=Se.content.slice(0,-1);q?(Se.content=q,Se.raw=q,c=Se):(a.pop(),c=null)}return k(K(Vw(Q))),u++,!0}function le(Q){if(Q.type!=="link")return!1;const ce=Q,Se=String(ce.raw??""),q=String(ce.text??"");if(!Se.startsWith("[![")&&!q.startsWith("!["))return!1;const ee=ce.title==null||ce.title===""?null:String(ce.title);return k(K({type:"image",src:String(ce.href??""),alt:q.replace(/^!\[/,"").replace(/\]$/,""),title:ee,raw:Se.startsWith("[)return!1;const ce=e[u-2];if(ce?.type==="text"&&String(ce.content??"").endsWith("[")&&N(ce,"\\["))return!1;const Se=a[a.length-1];if(Se?.type!=="image"&&Se?.type!=="link")return!1;const q=Se,ee=Se?.type==="link"&&Array.isArray(q.children)&&q.children.length===1&&q.children[0]?.type==="image"?a.pop():null,he=ee?ee.children[0]:a.pop();if(!he||he.type!=="image")return!1;const oe=e[u+1];let fe=String(ee?.href??""),W=ee?.title==null?null:String(ee.title),Y=!0;if(oe?.type==="link_open"){const{node:ge,nextIndex:xe}=kd(e,u+1,o);fe=ge.href,W=ge.title,Y=!0,u=xe}else{if(fe=Q.slice(2),fe.includes('"')){const ge=fe.split('"');fe=String(ge[0]??"").trim(),W=ge[1]==null?null:String(ge[1]).trim()}u++}const re=K(he,fe,W);return re.loading=Y,k(re),!0}function ue(){const Q=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&Q?.type==="text"&&String(Q.content??"").endsWith("[")&&N(Q,"\\[")}function ve(Q,ce){const Se=Q.indexOf("[");if(Se===-1)return!1;let q=Q.slice(0,Se);const ee=Q.indexOf("](",Se);if(ee!==-1){const he=e[u+2];let oe=Q.slice(Se+1,ee);if(oe.includes("[")){const $e=oe.indexOf("[");q+=Q.slice(0,Se+$e+1);const se=Se+$e+1;oe=Q.slice(se+1,ee)}const fe=e[u+1];if(Q.endsWith("](")&&fe?.type==="link_open"&&he){const $e=e[u+4];let se=4,ae=!0;if($e?.type==="text"){const qe=String($e.content??"");if(qe.startsWith(")")){ae=!1;const nt=qe.slice(1);if(nt){const at=ul($e);at.content=nt,at.raw=nt,g()[u+4]=at}else se++}else qe==="."&&se++}L(q,ce);const we=String(he.content??"");return o?.validateLink&&!o.validateLink(we)?x(oe,oe):k({type:"link",href:we,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:ae}),u+=se,!0}const W=Q.indexOf(")",ee),Y=W!==-1?Q.slice(ee+2,W):"",re=W===-1;let ge=q.match(/\*+$/);if(ge&&(q=q.replace(/\*+$/,"")),L(q,ce),ge||(ge=oe.match(/^\*+/)),!d&&ge){const $e=ge[0].length;oe=oe.replace(/^\*+/,"").replace(/\*+$/,"");const se=[];if($e===1?se.push({type:"em_open",tag:"em",nesting:1}):$e===2?se.push({type:"strong_open",tag:"strong",nesting:1}):$e===3&&(se.push({type:"strong_open",tag:"strong",nesting:1}),se.push({type:"em_open",tag:"em",nesting:1})),se.push({type:"link",href:Y,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:re}),$e===1){se.push({type:"em_close",tag:"em",nesting:-1});const{node:ae}=yd(se,0,o);y(ae)}else if($e===2){se.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ae}=rc(se,0,void 0,o);y(ae)}else if($e===3){se.push({type:"em_close",tag:"em",nesting:-1}),se.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ae}=rc(se,0,void 0,o);y(ae)}else{const{node:ae}=yd(se,0,o);y(ae)}}else o?.validateLink&&!o.validateLink(Y)?x(oe,oe):k({type:"link",href:Y,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:re});const xe=W!==-1?Q.slice(W+1):"";return xe&&($({type:"text",content:xe,raw:xe}),u--),u++,!0}return!1}function Ne(Q){const ce=Q.indexOf("![");if(ce===-1)return!1;const Se=Q.slice(0,ce);return Se&&!c?c={type:"text",content:Se,raw:Se}:Se&&c&&(c.content+=Se),c&&(a.push(c),c=null),k(G(Q.slice(ce))),u++,!0}function Re(Q){if(!(Q?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ce=Q.slice(1).match(/[^\s\]]/);if(ce===null)return u++,!0;if(ce&&/x/i.test(ce[0])){const Se=ce[0]==="x"||ce[0]==="X";return k({type:"checkbox_input",checked:Se,raw:Se?"[x]":"[ ]"}),u++,!0}return!1}return a}function J9(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){s.content=r;break}o.pop();continue}break}}function eF(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){o.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?s.content=r:o.pop())}break}}function tF(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function $a(e,t,n){const o=e[t],s=[],i=$r(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=tF(c)?ul(c):c,d=e[a-1];u!==c&&(eF(u),J9(u));const f=String(u.content??"");l.push({type:"paragraph",children:xn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=Na(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]=$a(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=Vv(e,a,i.options(),zv);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}s.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const l=o.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:s,raw:s.map(l=>l.raw).join(`
|
|
160
|
-
`)},r+1]}function nF(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=$r(o,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:xn(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]=$a(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=Na(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Rh(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:s,title:i,children:r,raw:`:::${s} ${i}
|
|
161
|
-
${r.map(c=>c.raw).join(`
|
|
162
|
-
`)}
|
|
163
|
-
:::`},a+1]}const oF=new Set(["warning","info","note","tip","danger","caution"]);function sF(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const o=n.search(/\s/),s=(o===-1?n:n.slice(0,o)).toLowerCase();return oF.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function iF(e,t,n){const o=e[t];let s="note",i="";const r=o.type.match(/^container_(\w+)_open$/);if(r){s=r[1];const d=String(o.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(s)){const f=d.slice(s.length).trim();f&&(i=f)}}else{const d=sF(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=$r(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let g=-1;for(let m=f.length-1;m>=0;m--){const _=f[m];if(_.type==="text"&&/:+/.test(_.content)){g=m;break}}const h={type:"paragraph",children:xn((g!==-1?f.slice(0,g):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=$a(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=Na(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Rh(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:i,children:l,raw:`:::${s} ${i}
|
|
164
|
-
${l.map(d=>d.raw).join(`
|
|
165
|
-
`)}
|
|
166
|
-
:::`},c+1]}const rF=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function lF(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=rF.exec(String(o.info??""));return s?nF(e,t,s,n):null}const zv={parseContainer:(e,t,n)=>iF(e,t,n),matchAdmonition:lF};function Na(e,t,n){const o=[],s=$r(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:xn(r.children||[],String(r.content??""),void 0,s.options()),raw:String(r.content??"")};o.push(l),s.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=$a(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=Na(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}default:{const r=Vv(e,i,s.options(),zv);r?(o.push(r[0]),s.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:o,raw:o.map(r=>r.raw).join(`
|
|
167
|
-
`)},i+1]}function aF(e){if(e.info?.startsWith("diff"))return qv(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let o=t;n?.[1]&&(o=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:o,raw:o,loading:!s}}function cF(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=$r(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=xn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:xn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(o.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
168
|
-
`)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
|
|
169
|
-
`)},s+1]}function uF(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=$r(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:xn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:s,children:i,raw:`[^${s}]: ${i.map(a=>a.raw).join(`
|
|
170
|
-
`)}`},l+1]}function dF(e,t,n){const o=e[t],s=o.attrs,i=Array.isArray(s)&&s.length?Object.fromEntries(s.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(o.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:xn(a.children||[],c,void 0,n),raw:c}}function fF(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=Sn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(s.test(c)){const u=Sn(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 eA(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const o=Sn(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=yl.has(n),l=Ph(s),a=(o===-1?-1:fF(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
171
|
-
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function hF(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 pF(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,o]=t;if(!o)continue;const s=String(o).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(s);if(i)return i[1].toLowerCase()}}return"left"}function tA(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function nA(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return tA(n)?n:void 0}function mF(e,t,n){const o=nA(bu(t),n);if(!tA(o))return e;const s=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:s?.filename||o?.filename,explicitFilename:s?.explicitFilename||o?.explicitFilename,marketTicker:s?.marketTicker||o?.marketTicker}}}function gF(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",g=e[c+1],h=String(g.content??""),m=pF(e[c].attrs),_=a.length,w=!f&&!r,k=w?s?.cells[_]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:xn(g.children||[],h,void 0,mF(n,k,w?u:void 0)),raw:h,align:m}),w&&(u=nA(u,bu(h))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
|
|
172
|
-
`)},o+1]}function vF(){return{type:"thematic_break",raw:"---"}}let Dm=null;const Bm=new WeakMap;function Yw(){return Dm||(Dm={allowedTagSet:Bh(),customTagSet:null}),Dm}function yF(e){if(!e||e.length===0)return Yw();const t=Bm.get(e);if(t)return t;const n=e.map(Ds).filter(Boolean);if(!n.length){const s=Yw();return Bm.set(e,s),s}const o={allowedTagSet:Bh({customHtmlTags:e}),customTagSet:new Set(n)};return Bm.set(e,o),o}function kF(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[g,h]of s)if(g==="class"){const m=h.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(g.startsWith("data-")){const m=g.slice(5);try{r[m]=JSON.parse(h)}catch{r[m]=h}}}const l=[],a=$r(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const g=e[c+1];if(g){const h={type:"paragraph",children:xn(g.children||[],void 0,void 0,a.options()),raw:String(g.content??"")};l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[g,h]=$a(e,c,a.options());l.push(g),a.remember(g.raw),c=h}else if(e[c].type==="blockquote_open"){const[g,h]=Na(e,c,a.options());l.push(g),a.remember(g.raw),c=h}else{const g=Rh(e,c,a.options());g?(l.push(g[0]),a.remember(g[0].raw),c=g[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
|
|
173
|
-
`,l.length>0&&(f+=o.raw??l.map(g=>g.raw).join(`
|
|
174
|
-
`),f+=`
|
|
175
|
-
`),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function bF(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function wF(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function _F(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${ds(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${ds(o)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=Sn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(s.test(c)){const u=Sn(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 CF(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=Sn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const h=c+1;return{raw:e.slice(r,h),end:h}}let u=1,d=c+1;const f=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(m)},g=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const h=e.indexOf("<",d);if(h===-1)return{raw:e.slice(r),end:e.length};if(g(h)){const m=e.indexOf(">",h);if(m===-1)return null;if(u--,u===0){const _=m+1;return{raw:e.slice(r,_),end:_}}d=m+1;continue}if(f(h)){const m=Sn(e.slice(h));if(m===-1)return null;u++,d=h+m+1;continue}d=h+1}return{raw:e.slice(r),end:e.length}}function a1(e){return Number.isFinite(e)&&e>0?e:0}function SF(e,t){const n=a1(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
|
|
176
|
-
`&&(o++,o===n))return s+1;return e.length}function Rh(e,t,n){const o=e[t];switch(o.type){case"heading_open":return[dF(e,t,n),t+3];case"code_block":return[aF(o),t+1];case"fence":return[qv(o),t+1];case"math_block":return[hF(o),t+1];case"html_block":{const s=eA(o),i=s.tag?yF(n?.customHtmlTags):null;if(s.tag&&s.loading&&i&&!i.allowedTagSet.has(s.tag)){const r=String(o.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(s.tag&&i?.customTagSet?.has(s.tag)){const r=s.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(o.map)?SF(l,Number(o.map?.[0]??0)):0,u=CF(l,r,Math.max(a1(a),a1(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??s.raw??""),f=Sn(d),g=f!==-1?d.slice(0,f+1):d,h=f!==-1&&/\/\s*>\s*$/.test(g),m=f===-1?null:_F(d,r,f+1),_=m?.start??-1;let w="";f!==-1&&(_!==-1&&f<_?w=d.slice(f+1,_):w=d.slice(f+1)),_===-1&&(w=wF(w,r));const k=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=b.exec(g))!==null;){const L=y[1];if(!L||L.toLowerCase()===r)continue;const N=y[2]||y[3]||y[4]||"";k.push([L,N])}const x=!n?.final&&!h&&m==null;return[{type:r,tag:r,content:bF(w),raw:String(u?.raw??s.raw??d),loading:x,attrs:k.length?k:void 0},t+1]}return[s,t+1]}case"table_open":{const[s,i]=gF(e,t,n);return[s,i]}case"dl_open":{const[s,i]=cF(e,t,n);return[s,i]}case"footnote_open":{const[s,i]=uF(e,t,n);return[s,i]}case"hr":return[vF(),t+1]}return null}function Vv(e,t,n,o){const s=Rh(e,t,n);if(s)return s;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(o?.parseContainer)return o.parseContainer(e,t,n);break;case"container_open":if(o?.matchAdmonition){const i=o.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return kF(e,t,n)}return null}function xF(){return{type:"hardbreak",raw:`\\
|
|
177
|
-
`}}function TF(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:xn(o.children||[],s,void 0,n),raw:s}}const Xw=new WeakMap,Dh=new WeakMap,AF=["$$","\\["];function xa(){return typeof performance<"u"?performance.now():Date.now()}function Kv(e,t,n){e&&(e[t]=(e[t]??0)+n)}function oA(e){return e.__timing}function Fm(e,t,n){return t&&Kv(t,"parseMarkdownToStructureTotalMs",xa()-n),e}function Qw(e,t,n){if(!n)return i_(e,t);const o=xa(),s=i_(e,t);return Kv(n,"processTokensMs",xa()-o),s}function MF(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=Ia(t);return n.length?new Set(n):null}function EF(e,t){const n=e;let o=Xw.get(n);o||(o=new Map,Xw.set(n,o));const s=t.__markstreamFinal===!0?"final":"streaming";let i=o.get(s);i||(i={},o.set(s,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function IF(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function bd(e,t,n){for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!("value"in s))continue;const i=Object.getOwnPropertyDescriptor(t,o);i&&(!("value"in i)||i.writable===!1)||(t[o]=Jr(s.value,n))}}function Jr(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,o=t.get(n);if(o)return o;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(Jr(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Jr(l,t),Jr(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Jr(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),bd(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),bd(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),bd(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!IF(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),bd(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=Jr(i[r],t);return s}function sA(e,t=!0){if(!t)return ul(e);const n=Object.create(Object.getPrototypeOf(e)),o=new WeakMap;for(const s of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,s);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,s,i);continue}const r=i.value;let l=r;s==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):s==="map"&&Array.isArray(r)?l=[...r]:s==="children"&&Array.isArray(r)?l=r.map(a=>sA(a,t)):t&&r&&typeof r=="object"&&(l=Jr(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function Zw(e,t=!0){return e.map(n=>sA(n,t))}function iA(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function $F(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function NF(e){Dh.delete(e)}function LF(e,t,n){Dh.set(e,{source:t,key:n,pendingCandidate:n===null&&zT(t)})}function OF(e){return e.endsWith("$")||e.endsWith("\\")}function PF(e){const t=Math.max(e.lastIndexOf(`
|
|
178
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return AF.some(o=>n.endsWith(o))}function RF(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||PF(e)&&/[\r\n]/.test(t)):!1}function DF(e,t){if(!BT(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=Dh.get(o);if(s?.source===t)return;if(s&&t.startsWith(s.source)){const l=t.slice(s.source.length);if(s.key===null&&s.pendingCandidate===!1&&!RF(s.source,l)&&!OF(t)){s.source=t;return}}const i=QB(t),r=s?!t.startsWith(s.source):!1;(s&&(r||s.key!==i)||!s&&i)&&n.reset(),LF(e,t,i)}function BF(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function FF(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,i)=>s===o[i])}function Hm(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&FF(e,t)}function Jw(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function HF(e){for(let t=0;t+5<e.length;t++)if(Jw(e,t)&&Jw(e,t+3)&&Hm(e[t],e[t+3])&&Hm(e[t+1],e[t+4])&&Hm(e[t+2],e[t+5]))return!0;return!1}function WF(e,t,n){return BT(e)&&zT(t)&&HF(n)}function UF(e){const t=Dh.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function e_(e,t,n,o){if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!iA(e,o)||(DF(e,t),UF(e)))return e.parse(t,n);const s=e.stream.parse(t,EF(e,n));if(WF(e,t,s))return e.stream?.reset?.(),e.parse(t,n);if(!BF(o))return s;const i=oA(o);if(!i)return Zw(s,!0);const r=xa(),l=Zw(s,!0);return Kv(i,"tokenCloneMs",xa()-r),l}function Bh(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return nu;const n=new Set(nu);for(const o of Ia(t))o&&n.add(o);return n}function qF(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 t_(e){return{type:"paragraph",children:e,raw:e.map(qF).join("")}}function n_(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=MF(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const f=o.slice(0,u);if(String(d.content??"").trim()&&f.some(g=>g?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(t_(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(t_(c)),a}function jF(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function Nc(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function zF(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*${ds(t)}\s*>\s*$`,"i").test(n)}function Gv(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${ds(o)}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=Sn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(yl.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*${ds(o)}(?=\s|>|/)`,"i").test(m)},g=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${ds(o)}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const h=e.indexOf("<",d);if(h===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(g(h)){const m=Sn(e.slice(h));if(m===-1)return null;u--;const _=h+m+1;if(u===0)return{raw:e.slice(r,_),start:r,end:_,closed:!0};d=_;continue}if(f(h)){const m=Sn(e.slice(h));if(m===-1)return null;const _=e.slice(h,h+m+1);/\/\s*>$/.test(_)||u++,d=h+m+1;continue}d=h+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function VF(e,t){if(!t)return 0;let n=0,o=0;for(;n<e.length&&o<t.length;){if(e[n]===t[o]){n++,o++;continue}if(e[n]==="\r"||e[n]===`
|
|
179
|
-
`){n++;continue}return-1}return o===t.length?n:-1}function KF(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
180
|
-
</${t}>`}function o_(e){return e.replace(/\r\n/g,`
|
|
181
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function GF(e,t,n){return n?e.includes(n,t)?!0:o_(e.slice(Math.max(0,t))).includes(o_(n)):!1}function YF(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
182
|
-
`&&n++,n):e[n]===`
|
|
183
|
-
`?n+1:t}function s_(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 XF(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function Yv(e,t){const n=new RegExp(String.raw`<\s*\/\s*${ds(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function rA(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const QF=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),ZF=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function JF(e){return/\n\s*\n/.test(e)||ZF.test(e)}function eH(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>QF.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!JF(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function tH(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const i=s,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||wT.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=Sn(l);if(a===-1)return s;const c=Yv(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return s;const d=Lc(u,t,rA(n,o));return eH(u,d)?{...s,children:d}:s})}function Lc(e,t,n){return e.trim()?aA(e,t,{...n,__disableStreamParse:!0}):[]}function nH(e,t,n){const o=Lc(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function oH(e,t,n){const o=eA({content:e}),s=Sn(e),i=Yv(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=nH(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function sH(e,t,n){const o=Sn(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=Gv(s,"summary",0);if(!i)return Lc(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...Lc(r,t,n),oH(i.raw,t,n),...Lc(l,t,n)]}function lA(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=Nc(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!s_(c)){r.push(c);continue}const f=String(c.raw??Nc(c)??""),g=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(g===-1){r.push(c);continue}let h=1,m=-1;for(let ne=a+1;ne<e.length;ne++){const K=e[ne];if(s_(K)){h++;continue}if(XF(K)&&(h--,h===0)){m=ne;break}}const _=Gv(t,"details",g),w=m===-1&&_?.closed===!0,k=w?(()=>{const ne=Yv(f,"details");return ne!==-1?f.slice(0,ne):f})():f,[b]=lA(w?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,o,s,g+f.length),y=sH(k,n,rA(o,s)),x=m===-1?"</details>":String(e[m].raw??Nc(e[m])??"</details>"),L=w||m!==-1&&_?.closed===!0,N=x.replace(/[\t\r\n ]+$/,""),v=L?(()=>{const ne=(_?.raw??"").lastIndexOf(N);return ne===-1?t.length:g+ne})():t.length,M=Sn(f),$=w&&M!==-1?g+M+1:g+f.length,P=t.slice($,v===-1?t.length:v),T=n.parse(P,{__markstreamFinal:s}),I=n.renderer.render(T,n.options,{__markstreamFinal:s}),R=v+N.length,D=L?Math.max(v+x.length,YF(t,R)):t.length,F=L?t.slice(v,D):x,z=L?t.slice(g,D):t.slice(g),V=w&&M!==-1?f.slice(0,M+1):f;if(r.push({...c,tag:"details",attrs:Ph(f.slice(0,M+1)),raw:z,content:`${V}${I}${F}`,children:[...y,...b],loading:!s&&!L}),l=L?D:t.length,m===-1&&!w)break;m!==-1&&(a=m)}return[r,l]}function iH(e,t,n){if(!n)return e;const o=e.slice();let s=0;for(let i=0;i<o.length;i++){const r=o[i],l=Nc(r),a=l?n.indexOf(l,s):-1;if(r?.type!=="html_block"){a!==-1&&(s=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(s=a+l.length);continue}const u=Gv(n,c,a!==-1?a:s);if(!u)continue;s=u.end;const d=String(r.content??l),f=String(r.raw??d),g=KF(u.raw,c,u.closed),h=!t&&!u.closed,m=d!==g||f!==u.raw||!!r.loading!==h,_=Sn(u.raw),w=_===-1?"":u.raw.slice(0,_+1),k=w?Ph(w):[];if(r.content=g,r.raw=u.raw,r.loading=h,r.attrs=k.length?k:void 0,!m)continue;let b=VF(u.raw,f);b===-1&&(b=0);const y=i+1;for(;y<o.length;){if(u.closed&&zF(o[y],c)){o.splice(y,1);continue}const x=Nc(o[y]);if(!x)break;const L=u.raw.indexOf(x,b);if(L===-1){if(GF(n,u.end,x))break;o.splice(y,1);continue}b=L+x.length,o.splice(y,1)}}return o}function rH(e){const t=l=>l===" "||l===" "||l===`
|
|
184
|
-
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=m=>{const _=m.charCodeAt(0);return _>=65&&_<=90||_>=97&&_<=122},u=m=>{const _=m.charCodeAt(0);return _>=48&&_<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",g=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",h=g;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!g(l[a]))return!1;for(a++;a<l.length&&h(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const _=l[a];if(t(_)||_==="<"||_===">"||_==='"'||_==="'"||_==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=k=>k===" "||k===" ",g=k=>{let b=0;for(;b<k.length&&f(k[b]);)b++;const y=k[b];if(y!=="`"&&y!=="~")return null;let x=b;for(;x<k.length&&k[x]===y;)x++;const L=x-b;return L<3?null:{markerChar:y,markerLen:L,rest:k.slice(x)}},h=k=>{let b=0;for(;b<k.length&&f(k[b]);)b++;let y=!1;for(;b<k.length&&k[b]===">";)for(y=!0,b++;b<k.length&&f(k[b]);)b++;return y?k.slice(b):null},m=k=>{const b=g(k);if(b)return b;const y=h(k);return y==null?null:g(y)};let _=0;const w=l.split(/\r?\n/);for(const k of w){const b=_,y=_+k.length;if(a<b)break;const x=m(k);if(x){const L=x.markerChar,N=x.markerLen;c?L===u&&N>=d&&/^\s*$/.test(x.rest)&&(c=!1,u="",d=0):(c=!0,u=L,d=N)}if(a<=y)break;_=y+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===`
|
|
185
|
-
`||l==="\r",c=s[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const r=s.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
186
|
-
`||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function lH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(h=>String(h??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=h=>h===" "||h===" ",s=h=>{const m=h.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||h==="_"||h==="-"||h===":"},i=h=>{if(!h)return!1;if(h[0]===" ")return!0;let m=0;for(let _=0;_<h.length;_++){const w=h[_];if(w===" "){if(m++,m>=4)return!0;continue}if(w===" ")return!0;break}return!1},r=h=>{let m=!1,_=!1;for(let w=0;w<h.length;w++){const k=h[w];if(k==="\\"){w++;continue}if(!_&&k==="'"){m=!m;continue}if(!m&&k==='"'){_=!_;continue}if(!m&&!_&&k===">")return w}return-1},l=h=>{let m=0;for(;m<h.length&&o(h[m]);)m++;const _=h[m];if(_!=="`"&&_!=="~")return null;let w=m;for(;w<h.length&&h[w]===_;)w++;const k=w-m;return k<3?null:{markerChar:_,markerLen:k,rest:h.slice(w)}},a=(h,m)=>{if(i(h))return-1;const _=h.replace(/^[ \t]+/,"");if(!_||_.startsWith(">")||_.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(_))return-1;let w=!1,k=0;for(;k<h.length;){const b=h[k];if(b!=="<"){o(b)||(w=!0),k++;continue}const y=r(h.slice(k));if(y===-1){w=!0,k++;continue}const x=h.slice(k,k+y+1);let L=1;for(;L<x.length&&o(x[L]);)L++;if(L>=x.length){w=!0,k++;continue}const N=x[L];if(N==="!"||N==="?"){w=!0,k+=y+1;continue}if(N==="/"){w=!0,k+=y+1;continue}const v=L;for(;L<x.length&&s(x[L]);)L++;if(L===v){w=!0,k++;continue}const M=x.slice(v,L).toLowerCase(),$=x[L];if($&&$!==" "&&$!==" "&&$!==">"&&$!=="/"){w=!0,k++;continue}const P=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),T=/\/\s*>$/.test(x),I=P.test(h.slice(k+y+1)),R=P.test(e.slice(m+k+y+1)),D=/[\r\n]/.test(e.slice(m+k+y+1));if(w&&n.has(M)&&!T&&!I&&(R||D))return k;w=!0,k+=y+1}return-1};let c=!1,u="",d=0,f="",g=0;for(;g<e.length;){const h=e.indexOf(`
|
|
187
|
-
`,g),m=h!==-1,_=m&&h>g&&e[h-1]==="\r",w=m?_?h-1:h:e.length,k=e.slice(g,w),b=m?_?`\r
|
|
188
|
-
`:`
|
|
189
|
-
`:"",y=l(k);let x=k;if(!c&&!y){const L=a(k,g);if(L!==-1){const N=b||`
|
|
190
|
-
`;x=`${k.slice(0,L).replace(/[ \t]+$/,"")}${N}${N}${k.slice(L).replace(/^[ \t]+/,"")}`}}f+=x,f+=b,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)),g=m?h+1:e.length}return f}function aH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},i=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,g=!1;for(let h=0;h<d.length;h++){const m=d[h];if(m==="\\"){h++;continue}if(!g&&m==="'"){f=!f;continue}if(!f&&m==='"'){g=!g;continue}if(!f&&!g&&m===">")return h}return-1},l=(d,f,g)=>{const h=g.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let _=m+1;for(;_<d.length&&o(d[_]);)_++;if(_>=d.length||d[_]!=="/"){m=d.indexOf("<",m+1);continue}for(_++;_<d.length&&o(d[_]);)_++;if(_+h.length>d.length){m=d.indexOf("<",m+1);continue}let w=!0;for(let b=0;b<h.length;b++){const y=d[_+b];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==h[b]){w=!1;break}}if(!w){m=d.indexOf("<",m+1);continue}let k=_+h.length;if(k<d.length&&s(d[k])){m=d.indexOf("<",m+1);continue}for(;k<d.length&&o(d[k]);)k++;if(k<d.length&&d[k]===">")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const g=f;for(;f<d.length&&s(d[f]);)f++;if(f===g)return d;const h=d.slice(g,f).toLowerCase();if(!n.has(h))return d;const m=r(d.slice(f));if(m===-1)return d;const _=f+m;if(l(d,_+1,h))return d;const w=i(d.slice(_+1));return w?`${d.slice(0,_+1)}
|
|
191
|
-
${w}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
192
|
-
`,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",g=f?d-1:d,h=e.slice(u,g);c+=a(h),c+=f?`\r
|
|
193
|
-
`:`
|
|
194
|
-
`,u=d+1}return c}function cH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let g=0,h=!1,m=0;for(;g<f.length;){for(;g<f.length&&o(f[g]);)g++;if(g>=f.length||f[g]!==">")break;for(h=!0,g++;g<f.length&&o(f[g]);)g++;m=g}return h?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let g=0;for(;g<f.length&&o(f[g]);)g++;const h=f[g];if(h!=="`"&&h!=="~")return null;let m=g;for(;m<f.length&&f[m]===h;)m++;const _=m-g;return _<3?null:{markerChar:h,markerLen:_,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
|
|
195
|
-
`,d),g=f!==-1,h=g&&f>d&&e[f-1]==="\r",m=g?h?f-1:f:e.length,_=e.slice(d,m),w=g?h?`\r
|
|
196
|
-
`:`
|
|
197
|
-
`:"",k=s(_),b=k?.prefix??"",y=k?.content??_,x=i(y);x&&(l?x.markerChar===a&&x.markerLen>=c&&/^\s*$/.test(x.rest)&&(l=!1,a="",c=0):(l=!0,a=x.markerChar,c=x.markerLen));let L=y;if(!l&&L.includes("</"))for(const N of r)L=L.replace(N,(v,M,$,P)=>{if(P.replace(/^[\t ]+/,"").startsWith("|"))return v;const T=P.slice(0,$).replace(/^[\t ]+/,"");if(T.length>0){const I=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",R=T.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!I||!R||I!==R)return v}return`${M}
|
|
198
|
-
|
|
199
|
-
`});if(b){const N=b+L.split(`
|
|
200
|
-
`).join(`
|
|
201
|
-
${b}`);u+=N}else u+=L;u+=w,d=g?f+1:e.length}return u}function uH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(T=>String(T??"").toLowerCase()));if(!n.size)return e;const o=T=>T===" "||T===" ",s=T=>{if(!T)return!1;if(T[0]===" ")return!0;let I=0;for(let R=0;R<T.length;R++){const D=T[R];if(D===" "){if(I++,I>=4)return!0;continue}if(D===" ")return!0;break}return!1},i=T=>{const I=T.charCodeAt(0);return I>=65&&I<=90||I>=97&&I<=122||I>=48&&I<=57||T==="_"||T==="-"||T===":"},r=T=>{let I=0;for(;I<T.length&&o(T[I]);)I++;return T.slice(I)},l=T=>{let I=0,R=!1,D=0;for(;I<T.length;){for(;I<T.length&&o(T[I]);)I++;if(I>=T.length||T[I]!==">")break;for(R=!0,I++;I<T.length&&o(T[I]);)I++;D=I}if(!R)return null;const F=T.slice(0,D);return{prefix:F,key:F.replace(/[ \t]+$/,""),content:T.slice(D)}},a=T=>r(T).startsWith("<"),c=T=>{for(let I=0;I<T.length;I++){const R=T[I];if(R!==" "&&R!==" ")return!1}return!0},u=T=>{if(s(T))return"";const I=r(T);if(!I.startsWith("<"))return"";let R=1;for(;R<I.length&&o(I[R]);)R++;if(R>=I.length||I[R]==="/"||I[R]==="!"||I[R]==="?")return"";const D=R;for(;R<I.length&&i(I[R]);)R++;if(R===D)return"";const F=I.slice(D,R).toLowerCase();if(!n.has(F))return"";const z=I[R];return z&&z!==" "&&z!==" "&&z!==">"&&z!=="/"?"":F},d=T=>{if(s(T))return null;const I=r(T);if(!I.startsWith("<"))return null;let R=1;for(;R<I.length&&o(I[R]);)R++;if(R>=I.length)return null;const D=I[R]==="/";if(D)for(R++;R<I.length&&o(I[R]);)R++;const F=I[R];if(!F||F==="!"||F==="?")return null;const z=R;for(;R<I.length&&i(I[R]);)R++;if(R===z)return null;const V=I.slice(z,R).toLowerCase();if(!n.has(V))return null;const ne=I[R];if(ne&&ne!==" "&&ne!==" "&&ne!==">"&&ne!=="/")return null;if(D)return{type:"close",name:V};if(/\/\s*>\s*$/.test(I))return{type:"open",name:V,complete:!0};const K=I.indexOf(">",R);if(K!==-1){const G=I.slice(K+1);if(new RegExp(`<\\s*\\/\\s*${V}\\s*>`,"i").test(G))return{type:"open",name:V,complete:!0}}return{type:"open",name:V,complete:!1}},f=T=>{if(s(T))return null;const I=r(T).replace(/[ \t]+$/,"");if(!I.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(I))return null;const R=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(R?.[1])return R[1].toLowerCase();const D=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!D?.[1]||!D[2])return null;const F=D[1].toLowerCase();return F===D[2].toLowerCase()?F:null};let g=!1,h="",m=0;const _=T=>{let I=0;for(;I<T.length&&o(T[I]);)I++;const R=T[I];if(R!=="`"&&R!=="~")return null;let D=I;for(;D<T.length&&T[D]===R;)D++;const F=D-I;return F<3?null:{markerChar:R,markerLen:F,rest:T.slice(D)}},w=T=>_(T),k=T=>{const I=r(T);return I?s(T)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(I):!1},b=(T,I,R)=>{let D=T,F=0;for(;D<e.length;){const z=e.indexOf(`
|
|
202
|
-
`,D),V=z!==-1,ne=V&&z>D&&e[z-1]==="\r",K=V?ne?z-1:z:e.length,G=e.slice(D,K),X=l(G),be=X?.key??"";if(F>0&&I&&be!==I)break;const le=X?.content??G,We=d(le);if(We?.name===R){if(We.type==="open")We.complete||F++;else if(F>0&&(F--,F===0))return!1}else if(F>0&&(c(le)||k(le)))return!0;if(V)D=z+1;else break}return!1};let y="",x=0,L=!0,N=!1,v=!1,M=`
|
|
203
|
-
`;const $=[];let P="";for(;x<e.length;){const T=e.indexOf(`
|
|
204
|
-
`,x),I=T!==-1,R=I&&T>x&&e[T-1]==="\r",D=I?R?T-1:T:e.length,F=e.slice(x,D),z=I?R?`\r
|
|
205
|
-
`:`
|
|
206
|
-
`:"",V=l(F),ne=V?.key??"",K=V?.content??F,G=w(K);G&&(g?G.markerChar===h&&G.markerLen>=m&&/^\s*$/.test(G.rest)&&(g=!1,h="",m=0):(g=!0,h=G.markerChar,m=G.markerLen));const X=$.length>0;if(!g&&!X){const le=u(K),We=!!le&&!L&&N&&v&&b(x,ne,le);le&&!L&&(!N||We)&&(ne&&P&&ne===P?y+=`${ne}${M}`:ne||(y+=M))}if(y+=F,y+=z,z&&(M=z),!g){const le=d(K);if(le){if(le.type==="open")le.complete||$.push(le.name);else for(let We=$.length-1;We>=0;We--)if($[We]===le.name){$.length=We;break}}}const be=c(K);L=be,N=!be&&a(K),v=!be&&!!f(K),P=ne,x=I?T+1:e.length}return y}function aA(e,t,n={}){const o=oA(n),s=o?xa():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($F(t,n)&&(t.stream.reset(),NF(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,_=>_.startsWith(`
|
|
207
|
-
`)?`
|
|
208
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,_=>_.startsWith(`
|
|
209
|
-
`)?`
|
|
210
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,_=>_.startsWith(`
|
|
211
|
-
`)?`
|
|
212
|
-
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
213
|
-
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,_=>_.startsWith(`
|
|
214
|
-
`)?`
|
|
215
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(_,w,k)=>`${w}${k.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,_=>_.startsWith(`
|
|
216
|
-
`)?`
|
|
217
|
-
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
218
|
-
`))),n.customHtmlTags?.length&&r.includes("<")){const _=Ia(n.customHtmlTags);if(_.length&&(r=lH(r,_),r=aH(r,_),r=uH(r,_),r=cH(r,_),r.includes("</")))for(const w of _){const k=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${w}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(k,"$1$2$2")}}i||(r=rH(r));const l=jF(r);if(l){const _=n.preTransformTokens,w=n.postTransformTokens;if(iA(t,n)||typeof _=="function"||typeof w=="function"){const k=e_(t,r,{__markstreamFinal:i},n),b=typeof _=="function"&&_(k)||k;typeof w=="function"&&w(b)}return Fm(l,o,s)}const a=e_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return Fm([],o,s);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,g=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),h={...n,validateLink:g,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let m=Qw(d,h,o);if(u&&typeof u=="function"){const _=u(d);if(Array.isArray(_)){const w=_[0],k=w?.type;w&&typeof k=="string"?m=Qw(_,void 0,o):m=_}}if(m=iH(m,i,r),m=lA(m,r,t,n,i)[0],m=tH(m,t,n,i),i){const _=new WeakSet,w=k=>{if(!k||typeof k!="object"||_.has(k))return;if(_.add(k),Array.isArray(k)){for(const y of k)w(y);return}const b=k;b.type==="html_block"&&b.loading===!0&&(b.loading=!1);for(const y of Object.values(b))w(y)};w(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),Fm(m,o,s)}function i_(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=$r(t);let s=0;for(;s<e.length;){const i=Vv(e,s,o.options(),zv);if(i){n.push(i[0]),o.remember(i[0].raw),s=i[1];continue}const r=e[s];switch(r.type){case"paragraph_open":{const l=String(e[s+1]?.content??""),a=TF(e,s,o.options(l)),c=n_(a,t);c?n.push(...c):n.push(a),o.remember(a.raw),s+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=$a(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"blockquote_open":{const[l,a]=Na(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),o.remember(String(r.content??"")),s++;break}case"hardbreak":n.push(xF()),o.reset(),s++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),o.remember(l),s++;break}case"inline":{const l=String(r.content??""),a=xn(r.children||[],l,void 0,o.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=n_(c,t);u?n.push(...u):n.push(c)}o.remember(l)}s+=1;break;default:s+=1;break}}return n}const dH=new Set([...ku,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),fH=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"]),r_=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function l_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function hH(e){return typeof e=="string"?e:e==null?"":String(e)}function cA(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function dr(e){return hH(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function uA(e){return dr(e).replace(/`/g,"`")}function Fh(e){return String(e??"").trim().toLowerCase()}function Xv(e,t="safe"){const n=Fh(e);return n?t==="escape"?!0:t==="trusted"?ku.has(n):!fH.has(n):!1}function dA(e,t="safe"){const n=Fh(e);return n?t==="escape"?!0:t==="trusted"?ku.has(n):dH.has(n):!1}function a_(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${uA(o)}"`).join("")}function pH(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||cl(s,{tagName:t,attrName:"srcset"})})}function fA(e,t,n,o){return QD.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?pH(t,o):!!(ZD.has(e)&&t&&cl(t,{tagName:o,attrName:e}))}function el(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function hA(e,t,n,o=!1){if(t!=="safe"||Fh(n)!=="a")return e;const s=el(e,"href");if(o&&(!s||!e[s])){const a=el(e,"target"),c=el(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=el(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=el(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 c_(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!cA(r)||fA(l,i,t,n)||(o[r]=i)}return hA(o,t,n,!!el(e,"href"))}function pA(e,t){const n=e.toLowerCase();return bT.has(n)?!1:l_(t,n)||l_(t,e)}function Qv(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!cA(r)||fA(l,i,t,n)||(o[r]=i)}return hA(o,t,n,!!el(e,"href"))}function jf(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function c1(e,t="safe",n){const o=Qv(jf(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function mH(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function gH(e){const t={};for(const[n,o]of Object.entries(e))t[n]=mH(o,n);return t}function u_(e){return e.trim().length>0}function vH(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(n<e.length){const a=e.slice(n);u_(a)&&t.push({type:"text",content:a})}break}if(o>n){const a=e.slice(n,o);u_(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",o+1)){const a=e.indexOf("]]>",o);if(a!==-1){t.push({type:"text",content:e.slice(o,a+3)}),n=a+3;continue}break}if(e.startsWith("!",o+1)){const a=e.indexOf(">",o);if(a!==-1){n=a+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let g;for(;(g=f.exec(u))!==null;){const h=g[1],m=g[2]??g[3]??g[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||yl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=s+1}return t}function yH(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const f=e.indexOf("-->",n);if(f!==-1){n=f+3;continue}break}const o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const f=e.indexOf("]]>",o);if(f!==-1){t.push({type:"text",content:e.slice(o,f+3)}),n=f+3;continue}break}if(e.startsWith("!",o+1)){const f=e.indexOf(">",o);if(f!==-1){n=f+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim();if(!i){n=s+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=s+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let g;for(;(g=f.exec(u))!==null;){const h=g[1],m=g[2]??g[3]??g[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||yl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function kH(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${dr(t)}>`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${dr(o)}`:` ${dr(o)}="${uA(s)}"`).join("");return e.type==="self_closing"?`<${dr(t)}${n} />`:`<${dr(t)}${n}>`}function bH(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;r_.lastIndex=0;let n;for(;(n=r_.exec(e))!==null;)if(pA(n[1],t))return!0;return!1}function va(e,t="safe"){if(!e)return"";if(t==="escape")return dr(e);const n=yH(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(dr(r.content??""));continue}const l=Fh(r.tagName);if(!l)continue;if(dA(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"&&Xv(l,t)){s.push(kH(r));continue}if(r.type==="self_closing"){s.push(`<${l}${a_(c_(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${a_(c_(r.attrs??{},t,l))}>`),yl.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(`</${u}>`)}const c=o.pop();c&&s.push(`</${c}>`)}for(;o.length>0;){const r=o.pop();r&&s.push(`</${r}>`)}return s.join("")}const wH=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],d_="http://www.w3.org/2000/svg",_H=new Set(["script","style","iframe","object","embed","link","meta"]),CH=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"]),SH=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),xH=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),TH=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function AH(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function MH(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function EH(e){const t=e.nodeName.toLowerCase();return t==="use"?AH(e):t==="image"?MH(e):t==="text"||t==="tspan"?!!e.textContent?.trim():TH.has(t)}function IH(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 $H(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),i=String(n??"").trim();return i?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?i.startsWith("#")?i:"":o==="a"&&(s==="href"||s==="xlink:href")?cl(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?cl(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":cl(i,{tagName:o,attrName:s})?"":i:""}function NH(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const o=e[n];if(o==='"'||o==="'"){const i=n+1,r=e.indexOf(o,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const s=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(s,n)}}function mA(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function gA(e){const t=mA(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=NH(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function f_(e){const t=mA(e);return wH.some(n=>n.test(t))||gA(t)}function LH(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 wd(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function vA(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!_H.has(o)){if(o==="br"){t.push(`
|
|
219
|
-
`);return}for(const s of Array.from(n.childNodes))vA(s,t)}}function OH(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];vA(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=wd(t.getAttribute("width")),i=wd(t.getAttribute("height")),r=wd(t.getAttribute("x")),l=wd(t.getAttribute("y")),a=e.ownerDocument.createElementNS(d_,"text");a.setAttribute("x",String(r+s/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const g=e.ownerDocument.createElementNS(d_,"tspan");g.setAttribute("x",String(r+s/2)),g.setAttribute("dy",d===0?`${u}em`:"1.2em"),g.textContent=f,a.appendChild(g)}}t.parentNode?.replaceChild(a,t)}}function PH(e){OH(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!CH.has(o)){n.remove();continue}if(o==="style"&&f_(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const i of s){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&f_(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(SH.has(r)&&i.value){const l=$H(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(xH.has(r)&&i.value&&gA(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=IH(i.value);l!==i.value&&n.setAttribute(i.name,l)}}LH(n)}}function zpe(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 PH(n),RH(n)?null:n}catch{return null}}function RH(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const i=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){EH(s)&&(o=!0);for(const i of Array.from(s.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!o}const h_=[];function Wm(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function DH(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function BH(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function p_(e=`editor-${Date.now()}`,t={}){const n=t9(t),o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;s=g=>f[g]??o[g]??g}else s=f=>o[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const g=f;if(Array.isArray(g)){const[h,...m]=g;typeof h=="function"&&n.use(h,...m)}else typeof g=="function"&&n.use(g)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(g){console.error("[getMarkdown] apply function threw an error",g)}if(h_.length)for(const f of h_)if(Array.isArray(f)){const[g,...h]=f;typeof g=="function"&&n.use(g,...h)}else typeof f=="function"&&n.use(f);n.use(kL),n.use(_L),n.use(gL);const i=RL,r=i.default??i;n.use(r),n.use(mL),n.use(pL),n.core.ruler.after("block","mark_fence_closed",f=>{const g=f,h=g.src,m=!!g.env?.__markstreamFinal,_=h.split(/\r?\n/);for(const w of g.tokens){if(w.type!=="fence"||!w.map||!w.markup)continue;const k=w.map[0],b=w.map[1],y=w.markup,x=y[0],L=y.length,N=_[Math.max(0,b-1)]??"";let v=0;for(;v<N.length&&(N[v]===" "||N[v]===" ");)v++;let M=0;for(;v+M<N.length&&N[v+M]===x;)M++;let $=v+M;for(;$<N.length&&(N[$]===" "||N[$]===" ");)$++;const P=m?!0:b>k+1&&M>=L&&$===N.length,T=w;T.meta=T.meta??{},T.meta.unclosed=!P,T.meta.closed=!!P}});const l=(f,g)=>{const h=f,m=h.pos;if(h.src[m]!=="~")return!1;const _=h.src[m-1],w=h.src[m+1];if(/\d/.test(_)&&/\d/.test(w)){if(!g){const k=h.push("text","",0);k.content="~"}return h.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,g)=>{const h=f[g],m=String(h.info??"").trim(),_=String(h.content??""),w=btoa(unescape(encodeURIComponent(_))),k=DH(m),b=Wm(k),y=BH(`editor-${e}-${g}-${k}`),x=Wm(s("common.copy"));return`<div class="code-block" data-code="${w}" data-lang="${b}" id="${y}">
|
|
220
|
-
<div class="code-header">
|
|
221
|
-
<span class="code-lang">${Wm(k.toUpperCase())}</span>
|
|
222
|
-
<button class="copy-button" data-code="${w}">${x}</button>
|
|
223
|
-
</div>
|
|
224
|
-
<div class="code-editor"></div>
|
|
225
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const g=c.exec(f);if(!g)return f!=="["&&!/^\[\d+$/.test(f);const h=String(g[1]??"");return f.slice(g[0].length).startsWith("(")?!1:!/^\d+$/.test(h)},d=(f,g)=>{const h=f;if(h.src[h.pos]!=="[")return!1;const m=a.exec(h.src.slice(h.pos));if(!m)return!1;const _=h.src.slice(Math.max(0,h.pos-120),h.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(_))return!1;const w=h.src.slice(h.pos+m[0].length);if(w.startsWith("](")||w.startsWith("(")||u(w))return!1;if(!g){const k=m[1],b=h.push("reference","span",0);b.content=k,b.markup=m[0],b.raw=m[0]}return h.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,g)=>{const m=String(f[g].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}const FH="modulepreload",HH=function(e){return"/"+e},m_={},cs=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");s=r(n.map(c=>{if(c=HH(c),c in m_)return;m_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":FH,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((g,h)=>{f.addEventListener("load",g),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function WH({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 yA({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:WH({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const g_=new WeakMap;function UH(e){let t=g_.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},g_.set(e,t)),t}function v_(e,t){if(!t?.length)return[...e];const n=[...e],o=new Set(n);for(const s of t)o.has(s)||(o.add(s),n.push(s));return n}function Zv(e){return!!(e.themes?.length||e.langs?.length)}function kA(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function qH(e,t){return!t?.length||e.registeredAllLangs?!0:kA(e.registeredLangs,t)}function Um(e,t){return Zv(t)&&kA(e.registeredThemes,t.themes)&&qH(e,t.langs)}function jH(e,t){if(!Zv(t))return t;const n=v_(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:v_(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const zH={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function VH(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function bA(e){const t=VH(e);return zH[t]??t}function wA(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>bA(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function _A(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function KH(e){return _A(e)?.join("\0")??""}function CA(e,t){const n=_A(e),o=wA(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function zf(e,t){return`${KH(e)}\0\0${wA(t)?.join("\0")??""}`}function Vpe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=CA(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:zf(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function Kpe(e,t={},n){if(!e)return"ready";const o=CA(t.themes,t.langs),s=zf(o.themes,o.langs),i=n&&n===s?n:s,r=UH(e);if(r.completed.has(i))return"ready";if(Um(r,o))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||Um(r,o))return r.completed.add(i),"ready";const c=jH(r,o),u=zf(c.themes,c.langs);return r.completed.has(u)||Um(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(Zv(c)?(r.registeredThemes=c.themes?[...c.themes]:r.registeredThemes,r.registeredLangs=c.langs?[...c.langs]:r.registeredLangs):r.registeredAllLangs=!0,r.completed.add(u),"ready"))}).then(()=>(r.completed.add(i),"ready")).finally(()=>{r.inFlight.get(i)===a&&r.inFlight.delete(i)});return r.inFlight.set(i,a),r.tail=a.catch(()=>{}),a}function Wl(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function y_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var GH=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,g=this.pendingChars<=0;if(this.source+=d,g){const h=k_();this.startedAt=f&&this.hasStarted?h-this.normalizedStartDelayMs:h,this.lastTick=h,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=k_();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const f=1e3/Math.max(1,this.maxCommitFps),g=Math.min(100,Math.max(0,d-this.lastTick));if(g<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const h=this.pendingChars,m=h>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,_=ZH(h/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(_-this.currentCps)*.2,this.charBudget+=this.currentCps*(g/1e3),this.charBudget<1){this.ensureLoop();return}const w=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),k=QH(this.source.slice(this.visible.length),w,this.segmenter);k.text&&(this.visible+=k.text,this.charBudget=Math.max(0,this.charBudget-k.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Wl(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Wl(o,1e3,1)),this.normalizedTargetLatencyMs=Wl(s,900,1),this.normalizedCatchUpLatencyMs=Wl(i,350,1),this.normalizedCatchUpThreshold=y_(r,600),this.normalizedStartDelayMs=y_(a,80),this.maxCommitFps=Math.trunc(Wl(l,30,1)),this.maxCharsPerCommit=Math.trunc(Wl(c,80,1)),this.flushOnFinish=u,this.segmenter=XH(),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 YH(e={},t){const n=new GH(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 XH(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function QH(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function k_(){return typeof performance<"u"?performance.now():Date.now()}function ZH(e,t,n){return Math.min(n,Math.max(t,e))}var JH=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const u1=Symbol.for("markstream-vue:node-lifecycle"),b_='<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>',w_='<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>',eW={id:"material",core:{"":w_,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:w_,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:b_,csharp:b_,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:()=>cs(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},d1=new Map;let __="material";const na=new Map,C_=new Map;let f1=null;function tW(e){d1.set(e.id,e)}function nW(e){return JH(this,null,function*(){var t,n,o;if(na.has(e.id))return(t=na.get(e.id))!=null?t:null;let s=C_.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(na.set(e.id,i),f1?.(),i)).catch(()=>(na.set(e.id,null),null)),C_.set(e.id,s)),s})}const oW=gl(0);f1=()=>{oW.value++},tW(eW);const sW={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Jv(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=sW[n])!=null?t:n}function Gpe(e){const t=Jv(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Ype(e){return(function(o){const s=d1.get(__);if(!s)return;const i=s.core[o];if(i)return i;const r=na.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!na.has(s.id)&&nW(s)})(Jv(e))||((n=(t=d1.get(__))==null?void 0:t.fallback)!=null?n:"");var t,n}const Xpe={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let SA=!1;function Qpe(){return SA}function Zpe(){SA=!0}var Hh=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let rs=null,Ud=!1,Wh=t0;function Uh(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function e0(){try{const e=globalThis;return Uh(e?.katex)}catch{return null}}function t0(){return Hh(null,null,function*(){const e=e0();if(e)return e;const t=yield cs(()=>import("./katex-DnlPpQZa.js"),[]);try{yield cs(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Uh(t)})}function iW(e){Wh=e,rs=null,Ud=!1}function rW(e){iW(t0)}function xA(){return typeof Wh=="function"}function Jpe(){var e;const t=Wh;if(!t||t===t0)return null;if(rs)return rs;const n=e0();if(n)return rs=n,rs;try{const o=t();return o&&typeof o?.then!="function"?(rs=(e=Uh(o))!=null?e:o,rs):null}catch{return null}}function n0(){return Hh(this,null,function*(){var e;const t=e0();if(t)return rs=t,rs;if(rs)return rs;if(Ud)return null;const n=Wh;if(!n)return Ud=!0,null;try{const o=yield n();if(o)return rs=(e=Uh(o))!=null?e:o,rs}catch{}return Ud=!0,null})}function TA(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Ul=null;const AA=new Map,gc=new Map;let MA=5;const sl=new Set;function lW(){if(AA.size<MA&&sl.size){const e=Array.from(sl);sl.clear();for(const t of e)try{t()}catch{}}}function aW(e,t=!0,n=2e3,o){return Hh(this,null,function*(){performance.now();const s=TA(e);if(!xA()){const l=new Error("KaTeX rendering disabled");return l.name="KaTeXDisabled",l.code="KATEX_DISABLED",Promise.reject(l)}if(Ul)return Promise.reject(Ul);const i=`${t?"d":"i"}:${s}`,r=gc.get(i);return r?Promise.resolve(r):(Ul=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ul.name="WorkerInitError",Ul.code="WORKER_INIT_ERROR",Promise.reject(Ul))})}function eme(e,t=!0,n){const o=`${t?"d":"i"}:${TA(e)}`;if(gc.set(o,n),gc.size>200){const s=gc.keys().next().value;gc.delete(s)}}const cW="WORKER_BUSY";function uW(e=2e3,t){return AA.size<MA?Promise.resolve():new Promise((n,o)=>{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),sl.delete(r),n())};if(sl.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,sl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>lW()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),sl.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const lc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function tme(e){return Hh(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!xA()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(s=o.timeout)!=null?s:lc.timeout,c=(i=o.waitTimeout)!=null?i:lc.waitTimeout,u=(r=o.backoffMs)!=null?r:lc.backoffMs,d=(l=o.maxRetries)!=null?l:lc.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):lc.maxRetries,g=o.signal;let h=0;for(;;){if(g?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield aW(t,n,a,g)}catch(m){if(m?.code!==cW||h>=f)throw m;if(h++,yield uW(c,g).catch(()=>{}),g?.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}u>0&&(yield new Promise(_=>globalThis.setTimeout(_,u*h)))}}})}function oa(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function dW(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function h1(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=dW(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function p1(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 EA(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function m1(e,t=360,n=500){return EA(e,t,n)}function g1(e,t=360,n=500){return EA(e,t,n)}var fW=Object.defineProperty,hW=Object.defineProperties,pW=Object.getOwnPropertyDescriptors,S_=Object.getOwnPropertySymbols,mW=Object.prototype.hasOwnProperty,gW=Object.prototype.propertyIsEnumerable,x_=(e,t,n)=>t in e?fW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,et=(e,t)=>{for(var n in t||(t={}))mW.call(t,n)&&x_(e,n,t[n]);if(S_)for(var n of S_(t))gW.call(t,n)&&x_(e,n,t[n]);return e},At=(e,t)=>hW(e,pW(t)),_n=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const vW="__global__",qm="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",v1=(()=>{const e=globalThis;if(e[qm])return e[qm];const t={scopedCustomComponents:{},revision:gl(0)};return e[qm]=t,t})(),T_=v1.revision,yW=Symbol("markstreamCustomComponents"),kW=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 _u(e){return kW.has(String(e).trim().toLowerCase())}function bW(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function jm(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([Ds(n),Ds(bW(n))]))!s||_u(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function qn(e){const t=Bt(yW,null);return H(()=>{var n;return T_.value,(function(o,s={}){return T_.value,et(et(et({},jm(v1.scopedCustomComponents[vW]||{})),jm(s)),jm((function(i){return i&&v1.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const wW=["aria-label"],_W={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"},CW={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"},Jt=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},fs=Jt(Qe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(C(),E("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(C(),E("svg",CW,[...n[1]||(n[1]=[p("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),p("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(C(),E("svg",_W,[...n[0]||(n[0]=[p("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,wW))}),[["__scopeId","data-v-be21ab83"]]);fs.install=e=>{e.component(fs.__name,fs)};const SW={class:"emoji-node"},jo=Jt(Qe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(C(),E("span",SW,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);jo.install=e=>{e.component(jo.__name,jo)};const xW=["id"],TW=["title"],hs=Jt(Qe({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(C(),E("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[p("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,TW)],8,xW))}}),[["__scopeId","data-v-c1463a29"]]);hs.install=e=>{e.component(hs.__name,hs)};const IA=(()=>{try{return!1}catch{}return!1})();function zm(e){IA&&console.warn(e)}function A_(e,t="safe",n){return Qv(e,t,n)}function $A(e){return gH(e)}function Vm(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function o0(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=c1((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),Vm(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Vm(r.value)]):Object.entries(s).map(([r,l])=>[r,Vm(l)]):null,t,n);var s;if(!o)return;const i=$A(jf(o));return Object.keys(i).length>0?i:void 0}function M_(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function ac(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Km(e,t,n,o,s,i,r=!1){const l=(function(d,f){return pA(d,f)})(e,o);if(ku.has(e.toLowerCase())||!l&&dA(e,i))return null;if(!l&&Xv(e,i))return r?[M_(e,t,!0)]:[M_(e,t),...n,`</${e}>`];const a=Qv(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=$A(a);return Zt(d,At(et({},f),{key:u}),n.length>0?n:void 0)}return Zt(e,At(et({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function NA(e,t){return bH(e,t)}function Vf(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const f=Km(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);ac(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let g=-1;for(let h=c.length-1;h>=0;h--)if(c[h].tagName.toLowerCase()===f){g=h;break}if(g!==-1)for(;c.length>g;){const h=c.pop(),m=Km(h.tagName,h.attrs||{},h.children,r,h.autoKey,l);c.length>0?ac(c[c.length-1].children,m):ac(u,m),h.tagName.toLowerCase()!==f&&c.length>g&&zm(`Auto-closing unclosed tag: <${h.tagName}>`)}else zm(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=Km(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?ac(c[c.length-1].children,f):ac(u,f),zm(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(vH(e),t,n)}catch(s){return o=s,IA&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const AW=["innerHTML"],ps=Jt(Qe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Bt("markstreamHtmlPolicy",void 0),o=H(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=qn(()=>t.customId),i=Qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=H(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:va(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Vf(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!NA(l,s.value))return{mode:"html",content:va(l,o.value)};const a=Vf(l,s.value,o.value);return a===null?{mode:"html",content:va(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(C(),E("span",{key:0,class:Oe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[vt(S(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(C(),E("span",{key:1,class:Oe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(C(),E("span",{key:2,class:Oe(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,AW))}}),[["__scopeId","data-v-d17f12b0"]]);ps.install=e=>{e.component(ps.__name,ps)};const MW={class:"inline-code"},EW={key:0},_o=Jt(Qe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=mu(),o=Bt("markstreamFade",void 0),s=Bt("markstreamTextStreamState",void 0),i=Bt("markstreamStreamVersion",void 0),r=H(()=>{const k=n.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),l=H(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=H(()=>{var k;return String((k=t.node.code)!=null?k:"")}),c=H(()=>!l.value),u=H(()=>{var k;const b=(k=n["index-key"])!=null?k:n.indexKey;return b==null||b===""?"":String(b)}),d=te(t.node.code),f=te("");let g=i?.value;const h=te(0);function m(){return d.value+f.value}function _(){f.value&&(d.value=m(),f.value="")}ze([()=>t.node.code,u,l,()=>i?.value],([k,b,y,x])=>{const L=String(k??""),N=u.value,v=x!==g;g=x;const M=yA({nextContent:L,persistedContent:N?s?.get(N):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:v});d.value=M.settledContent,f.value=M.streamedDelta,M.appended&&(h.value+=1),N&&s?.set(N,L)},{immediate:!0}),ze(l,k=>{var b;k||(b=m(),d.value=b,f.value="")});const w=H(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(k,b)=>(C(),E("code",MW,[c.value?(C(),E(Pe,{key:0},[ft(O(a.value),1)],64)):(C(),E(Pe,{key:1},[d.value?(C(),E("span",EW,O(d.value),1)):ie("",!0),f.value?(C(),E("span",{key:1,class:Oe(["inline-code-stream-delta",[w.value]]),onAnimationend:_},O(f.value),35)):ie("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);_o.install=e=>{e.component(_o.__name,_o)};const y1=te(!1),E_=te(""),I_=te("top"),Oc=te(null),Pc=te(null),k1=te(null),b1=te(null),$_=te(null);let qd=null,jd=null,w1=0;function LA(){qd&&(clearTimeout(qd),qd=null),jd&&(clearTimeout(jd),jd=null)}let _d=!1,Cd=null,N_=!1;function IW(e,t,n="top",o=!1,s,i){if(!e)return;const r=++w1;LA();const l=()=>_n(null,null,function*(){var a,c;if(yield(function(){return _n(this,null,function*(){if(!_d&&!N_&&typeof document<"u"){Cd!=null||(Cd=_n(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([cs(()=>import("./vue.runtime.esm-bundler-BP7sjueK.js"),[]),cs(()=>import("./Tooltip-FXn3ewBz.js"),[])]),g=document.createElement("div");g.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(g),u({setup:()=>()=>{var h;return d(f,{visible:y1.value,"anchor-el":Oc.value,content:E_.value,placement:I_.value,id:Pc.value,originX:k1.value,originY:b1.value,isDark:(h=$_.value)!=null?h:void 0})}}).mount(g),_d=!0}));try{yield Cd}catch(u){_d=!1,Cd=null,N_=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),_d&&r===w1){Pc.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Oc.value=e,E_.value=t,I_.value=n,k1.value=(a=s?.x)!=null?a:null,b1.value=(c=s?.y)!=null?c:null,$_.value=typeof i=="boolean"?i:null,y1.value=!0;try{e.setAttribute("aria-describedby",Pc.value)}catch{}}});o?l():qd=setTimeout(l,80)}function $W(e=!1){w1+=1,LA();const t=()=>{if(Oc.value&&Pc.value)try{Oc.value.removeAttribute("aria-describedby")}catch{}y1.value=!1,Oc.value=null,Pc.value=null,k1.value=null,b1.value=null};e?t():jd=setTimeout(t,120)}const _1={"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..."},C1=e=>{var t;return(t=_1[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function L_(e){return{t(t){if(e.te&&_1[t]&&!e.te(t))return C1(t);const n=e.t(t);return n===t&&_1[t]?C1(t):n}}}function NW(){const e=(function(){var t,n;try{const o=fo(),s=o?.proxy,i=s?.$t;if(typeof i=="function"){const a=s?.$te;return{t:i.bind(s),te:typeof a=="function"?a.bind(s):void 0}}const r=(n=(t=o?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return L_(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return L_({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:C1}}function LW(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const OW=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],PW={key:1,class:"image-placeholder"},RW={key:1,class:"image-node__raw-text"},DW={key:0,class:"image-shimmer-overlay"},BW={key:1,class:"image-node__raw-text"},FW={key:2,class:"image-error"},yr=Jt(Qe({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=t,s=te(!1),i=te(!1),r=te(""),l=te("primary"),a=te(null),c=mu(),u=Bt(u1,null);let d="",f=null;const g=H(()=>yw(n.node.src)),h=H(()=>yw(n.fallbackSrc)),m=H(()=>r.value),_=H(()=>!n.lazy),w=H(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),k=H(()=>l.value==="failed"),b=H(()=>!_.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=H(()=>LW(n,c));function x(R=y.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function L(R=y.value){R&&ht(()=>{x(R)})}function N(){f&&(clearTimeout(f),f=null)}function v(){const R=y.value;R&&d!==R&&(d&&u?.markSettled(d),N(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&(L(R),M())},8e3)))}function M(){return _n(this,null,function*(){const R=d;R&&(N(),d="",yield ht(),x(R),u?.markSettled(R))})}function $(){if(l.value==="primary"&&h.value&&h.value!==r.value)return l.value="fallback",r.value=h.value,s.value=!1,i.value=!1,void L();l.value="failed",i.value=!0,o("error",r.value),L()}function P(){s.value=!0,i.value=!1,o("load",m.value),L()}function T(R){R.preventDefault(),s.value&&!i.value&&o("click",[R,m.value])}const{t:I}=NW();return ze([g,h,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||g.value?(r.value=g.value,void(l.value="primary")):h.value?(r.value=h.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),ze([w,s,i,m,()=>n.lazy],([R,D,F,z,V])=>R&&z&&!F?D?(M(),void L()):V?(v(),void L()):void(D||F||v()):(M(),void L()),{flush:"post",immediate:!0}),Yo(()=>{(function(){const R=d;R&&(N(),d="",u?.markSettled(R))})()}),(R,D)=>{var F,z,V,ne,K;return C(),E("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[w.value?(C(),E("img",{key:0,src:m.value,alt:String((z=(F=n.node.alt)!=null?F:n.node.title)!=null?z:""),title:String((ne=(V=n.node.title)!=null?V:n.node.alt)!=null?ne:""),class:Oe(["image-node__img",{"is-loading":!_.value&&!s.value,"is-loaded":_.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:_.value?"high":void 0,decoding:_.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(K=n.node.alt)!=null?K:S(I)("image.preview"),onError:$,onLoad:P,onClick:T},null,42,OW)):ie("",!0),e.node.loading&&!i.value?(C(),E("span",PW,[n.usePlaceholder?ca(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=p("span",{class:"image-shimmer"},null,-1))],!0):(C(),E("span",RW,O(e.node.raw),1))])):ie("",!0),vt(Fi,{name:"shimmer-fade"},{default:In(()=>[b.value&&!e.node.loading?(C(),E("span",DW,[n.usePlaceholder?ca(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=p("span",{class:"image-shimmer"},null,-1))],!0):(C(),E("span",BW,O(e.node.raw),1))])):ie("",!0)]),_:3}),k.value?(C(),E("span",FW,[ca(R.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[2]=p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[p("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)),p("span",null,O(S(I)("image.loadError")),1)],!0)])):ie("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);yr.install=e=>{e.component(yr.__name,yr)};const HW={key:2},di=Qe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=qn(()=>t.customId),o=Bt("markstreamHtmlPolicy",void 0),s=Bt("markstreamNestedRendererProps",void 0),i=H(()=>{var h;return(h=o?.value)!=null?h:"safe"}),r=H(()=>{var h,m;const _=(h=s?.value)!=null?h:{};return At(et({},_),{customId:(m=t.customId)!=null?m:_.customId,htmlPolicy:i.value})}),l=ai({loader:()=>Promise.resolve().then(()=>u0),suspensible:!1}),a=H(()=>t.components[String(t.node.type)]),c=H(()=>!!(a.value&&n.value[t.node.type]&&!_u(String(t.node.type)))),u=H(()=>c.value?o0(t.node,i.value):void 0),d=H(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=H(()=>{var h;return String((h=t.node.content)!=null?h:"")}),g=H(()=>{var h,m;return String((m=(h=t.node.content)!=null?h:t.node.raw)!=null?m:"")});return(h,m)=>a.value&&c.value?(C(),Ve(ko(a.value),en({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:In(()=>[d.value?(C(),Ve(S(l),en({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(C(),Ve(S(l),en({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(C(),Ve(ko(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(C(),E("span",HW,O(g.value),1)):ie("",!0)}}),WW=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],UW={key:0,translate:"no",class:"markstream-pre__diff-code"},qW={class:"markstream-pre__diff-number","aria-hidden":"true"},jW={class:"markstream-pre__diff-content"},zW={class:"markstream-pre__diff-content-inner"},VW={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},KW=["textContent"],ss=Qe({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=H(()=>{var T,I,R;const D=String((I=(T=t.node)==null?void 0:T.language)!=null?I:"");return String((R=String(D).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=H(()=>`language-${n.value}`),s=H(()=>{var T,I,R,D,F;return((T=t.node)==null?void 0:T.diff)===!0?String((R=(I=t.node)==null?void 0:I.code)!=null?R:""):(function(z,V){const ne=String(z??"");return V?ne:ne.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((F=t.node)==null?void 0:F.loading)===!0)}),i=H(()=>s.value.split(/\r\n|\n|\r/)),r=H(()=>Array.from({length:Math.max(1,i.value.length)},(T,I)=>I+1)),l=H(()=>{var T;return t.showLineNumbers===!0&&((T=t.node)==null?void 0:T.diff)===!0}),a=H(()=>l.value&&t.diffInline===!0),c=H(()=>{const T=Number(t.reservedHeightPx);if(!Number.isFinite(T)||T<=0)return;const I=`${Math.ceil(T)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(T){return String(T??"").trim().length===0}function d(T,I="context",R={}){const D=u(T);return{code:T,kind:D&&I!=="hunk"&&!R.preserveBlankKind?"context":I,empty:D}}function f(T){const I=String(T??"");return I?I.split(/\r\n|\n|\r/):[]}function g(T,I){return!u(T[I])||I<T.length-1}function h(T){return T.startsWith("-")&&!T.startsWith("---")}function m(T){return T.startsWith("+")&&!T.startsWith("+++")}function _(T,I){const R=f(T),D=f(I),F=(function(X,be){const le=X.length,We=be.length;if((le+1)*(We+1)>15e5)return null;const ue=We+1,ve=new Uint32Array((le+1)*(We+1));for(let ce=1;ce<=le;ce++)for(let Se=1;Se<=We;Se++){const q=ce*ue+Se;if(X[ce-1]===be[Se-1])ve[q]=ve[(ce-1)*ue+(Se-1)]+1;else{const ee=ve[(ce-1)*ue+Se],he=ve[ce*ue+(Se-1)];ve[q]=ee>=he?ee:he}}const Ne=[];let Re=le,Q=We;for(;Re>0&&Q>0;)X[Re-1]===be[Q-1]?(Ne.push({originalIndex:Re-1,modifiedIndex:Q-1}),Re--,Q--):ve[(Re-1)*ue+Q]>=ve[Re*ue+(Q-1)]?Re--:Q--;return Ne.reverse(),Ne})(R,D);if(F){const X=[];let be=0,le=0;for(const We of F){for(;be<We.originalIndex;)X.push(At(et({},d(R[be],"removed",{preserveBlankKind:g(R,be)})),{key:`inline-removed-source-${be}`,number:""})),be++;for(;le<We.modifiedIndex;)X.push(At(et({},d(D[le],"added",{preserveBlankKind:g(D,le)})),{key:`inline-added-source-${le}`,number:le+1})),le++;X.push(At(et({},d(D[We.modifiedIndex])),{key:`inline-context-source-${We.originalIndex}-${We.modifiedIndex}`,number:We.modifiedIndex+1})),be=We.originalIndex+1,le=We.modifiedIndex+1}for(;be<R.length;)X.push(At(et({},d(R[be],"removed",{preserveBlankKind:g(R,be)})),{key:`inline-removed-source-${be}`,number:""})),be++;for(;le<D.length;)X.push(At(et({},d(D[le],"added",{preserveBlankKind:g(D,le)})),{key:`inline-added-source-${le}`,number:le+1})),le++;return X}const z=[];let V=0,ne=R.length-1,K=D.length-1;for(;V<=ne&&V<=K&&R[V]===D[V];)z.push(At(et({},d(D[V])),{key:`inline-prefix-${V}`,number:V+1})),V++;const G=[];for(;ne>=V&&K>=V&&R[ne]===D[K];)G.unshift(At(et({},d(D[K])),{key:`inline-suffix-${K}`,number:K+1})),ne--,K--;for(let X=V;X<=ne;X++)z.push(At(et({},d(R[X],"removed",{preserveBlankKind:g(R,X)})),{key:`inline-removed-source-${X}`,number:""}));for(let X=V;X<=K;X++)z.push(At(et({},d(D[X],"added",{preserveBlankKind:g(D,X)})),{key:`inline-added-source-${X}`,number:X+1}));return z.concat(G)}const w=H(()=>{var T,I,R,D;const F=(function(K){const G=K.some(be=>h(be)),X=K.some(be=>m(be));return G&&X||(function(){var be,le,We,ue;if(n.value==="diff")return!0;const ve=(ue=(We=String((le=(be=t.node)==null?void 0:be.raw)!=null?le:"").split(/\r?\n/,1)[0])==null?void 0:We.trim())!=null?ue:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(ve)})()&&(G||X)})(i.value),z=(function(){var K,G;return((K=t.node)==null?void 0:K.originalCode)!=null||((G=t.node)==null?void 0:G.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:F?(function(K){const G=[];let X=1;for(const[be,le]of K.entries())if(le.startsWith("@@"))G.push(At(et({},d(le,"hunk")),{key:`inline-hunk-${be}`,number:""}));else if(h(le))G.push(At(et({},d(le.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${be}`,number:""}));else if(m(le))G.push(At(et({},d(le.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${be}`,number:X++}));else{const We=le.startsWith(" ")?le.slice(1):le;G.push(At(et({},d(We)),{key:`inline-context-${be}`,number:X})),X++}return G})(i.value):_((T=t.node)==null?void 0:T.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!F&&z){const K=f((R=t.node)==null?void 0:R.originalCode),G=f((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:K.map((X,be)=>{const le=G[be]===X?"context":"removed";return At(et({},d(X,le,{preserveBlankKind:g(K,be)})),{key:`original-${be}`,number:be+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:G.map((X,be)=>{const le=K[be]===X?"context":"added";return At(et({},d(X,le,{preserveBlankKind:g(G,be)})),{key:`modified-${be}`,number:be+1})})}]}const V=[],ne=[];for(const K of i.value)if(K.startsWith("@@"))V.push(d(K,"hunk")),ne.push(d(K,"hunk"));else if(K.startsWith("-")&&!K.startsWith("---"))V.push(d(K.slice(1),"removed",{preserveBlankKind:!0}));else if(K.startsWith("+")&&!K.startsWith("+++"))ne.push(d(K.slice(1),"added",{preserveBlankKind:!0}));else{const G=K.startsWith(" ")?K.slice(1):K;V.push(d(G)),ne.push(d(G))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:V.map((K,G)=>At(et({},K),{key:`original-${G}`,number:G+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ne.map((K,G)=>At(et({},K),{key:`modified-${G}`,number:G+1}))}]}),k=H(()=>{const T=n.value;return T?`Code block: ${T}`:"Code block"}),b=te(null),y=te([]);let x=null,L=null;function N(T){const I=Number.parseFloat(String(T??""));return Number.isFinite(I)&&I>0?I:0}function v(T,I){var R;if(!T)return I;const D=T.querySelector(".markstream-pre__diff-content"),F=D?.getBoundingClientRect(),z=(R=F?.height)!=null?R:0;return Math.max(I,Math.ceil(z))}function M(){typeof window<"u"&&(x!=null&&window.cancelAnimationFrame(x),x=window.requestAnimationFrame(()=>{(function(){var T,I;x=null;const R=b.value;if(!R||!l.value)return void(y.value.length&&(y.value=[]));const D=(function(X){const be=window.getComputedStyle(X),le=N(be.getPropertyValue("--markstream-pre-diff-line-height"));if(le>0)return le;const We=N(be.lineHeight);return We>0?We:18})(R),F=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),V=Math.max(F.length,z.length),ne=[];for(let X=0;X<V;X++){const be=v((T=F[X])!=null?T:null,D),le=v((I=z[X])!=null?I:null,D),We=Math.max(D,be,le);ne.push({rowHeight:We,originalHeight:be,modifiedHeight:le})}var K,G;K=y.value,G=ne,K.length===G.length&&K.every((X,be)=>{const le=G[be];return le&&Math.abs(X.rowHeight-le.rowHeight)<=.5&&Math.abs(X.originalHeight-le.originalHeight)<=.5&&Math.abs(X.modifiedHeight-le.modifiedHeight)<=.5})||(y.value=ne)})()}))}function $(T){L?.disconnect(),L=null,T&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{M()}),L.observe(T))}function P(T,I){const R=y.value[T];if(!R)return;const D=I==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return ze(b,T=>{$(T),ht(()=>M())},{flush:"post"}),ze([l,w],()=>{$(b.value),ht(()=>M())},{flush:"post",immediate:!0}),Yo(()=>{x!=null&&(window.cancelAnimationFrame(x),x=null),L?.disconnect(),L=null}),(T,I)=>(C(),E("pre",{ref_key:"preRef",ref:b,style:Wt(c.value),class:Oe([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":k.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(C(),E("code",UW,[(C(!0),E(Pe,null,Xe(w.value,R=>(C(),E("span",{key:R.key,class:Oe(["markstream-pre__diff-pane",R.className])},[(C(!0),E(Pe,null,Xe(R.lines,(D,F)=>(C(),E("span",{key:D.key,class:Oe(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Wt(P(F,R.key))},[I[0]||(I[0]=p("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),p("span",qW,O(D.number),1),p("span",jW,[p("span",zW,O(D.code),1)])],6))),128))],2))),128))])):(C(),E(Pe,{key:1},[t.showLineNumbers?(C(),E("span",VW,[(C(!0),E(Pe,null,Xe(r.value,R=>(C(),E("span",{key:R,class:"markstream-pre__line-number"},O(R),1))),128))])):ie("",!0),p("code",{translate:"no",class:"markstream-pre__code",textContent:O(s.value)},null,8,KW)],64))],14,WW))}});ss.install=e=>{e.component(ss.__name,ss)};const Gm=gl(!1);let O_=null;const GW={key:0},$n=Jt(Qe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(O_||(O_=n0().then(w=>{Gm.value=!!w}).catch(()=>{Gm.value=!1})),tf(Gm)),o=mu(),s=Bt("markstreamFade",void 0),i=Bt("markstreamTextStreamState",void 0),r=Bt("markstreamStreamVersion",void 0),l=H(()=>{const w=o.fade;return w===""||w===!0||w==="true"||w!==!1&&w!=="false"&&void 0}),a=H(()=>typeof l.value=="boolean"?l.value:typeof s?.value!="boolean"||s.value),c=H(()=>{var w;const k=(w=o["index-key"])!=null?w:o.indexKey;return k==null||k===""?"":String(k)}),u=te(t.node.content),d=te("");let f=r?.value;const g=te(0);function h(){return u.value+d.value}function m(){d.value&&(u.value=h(),d.value="")}ze([()=>t.node.content,c,a,()=>r?.value],([w,k,b,y])=>{const x=String(w??""),L=c.value,N=y!==f;f=y;const v=yA({nextContent:x,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:N});u.value=v.settledContent,d.value=v.streamedDelta,v.appended&&(g.value+=1),L&&i?.set(L,x)},{immediate:!0}),ze(a,w=>{var k;w||(k=h(),u.value=k,d.value="")});const _=H(()=>g.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(w,k)=>(C(),E("span",{class:Oe([[S(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(C(),E("span",GW,O(u.value),1)):ie("",!0),d.value?(C(),E("span",{key:1,class:Oe(["text-node-stream-delta",[_.value]]),onAnimationend:m},O(d.value),35)):ie("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);$n.install=e=>{e.component($n.__name,$n)};const OA=Qe({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return Zt(ss,At(et({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(o=n.estimatedHeightPx)!=null?o:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),Ym=ai({loader:()=>_n(null,null,function*(){try{return(yield cs(()=>import("./CodeBlockNode-Cj5GCBwy.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),ss}}),loadingComponent:OA,delay:0,suspensible:!1}),Gs=ai(()=>_n(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,o,s,i;return Zt($n,At(et({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{if(yield n0())return(yield cs(()=>import("./index6-DsK3MiZT.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,o,s,i;return Zt($n,At(et({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),PA=ai(()=>_n(null,null,function*(){try{if(yield n0())return(yield cs(()=>import("./index5-DKdkj0GC.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,o,s;return Zt($n,At(et({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),Eo=Jt(Qe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(C(),E("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Eo.install=e=>{e.component(Eo.__name,Eo)};const YW={class:"superscript-node"},zo=Jt(Qe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=H(()=>et({text:$n,inline_code:_o,link:No,html_inline:ps,strong:Io,emphasis:Lo,footnote_reference:hs,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,emoji:jo,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("sup",YW,[(C(!0),E(Pe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(di),{key:`${e.indexKey||"superscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);zo.install=e=>{e.component(zo.__name,zo)};const XW={class:"subscript-node"},Vo=Jt(Qe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=H(()=>et({text:$n,inline_code:_o,link:No,html_inline:ps,strong:Io,emphasis:Lo,footnote_reference:hs,strikethrough:$o,highlight:ms,insert:Ko,superscript:zo,emoji:jo,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("sub",XW,[(C(!0),E(Pe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(di),{key:`${e.indexKey||"subscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Vo.install=e=>{e.component(Vo.__name,Vo)};const QW={class:"strong-node"},Io=Jt(Qe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=H(()=>et({text:$n,inline_code:_o,link:No,html_inline:ps,emphasis:Lo,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,footnote_reference:hs,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("strong",QW,[(C(!0),E(Pe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(di),{key:`${e.indexKey||"strong"}-${l}`,components:o.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Io.install=e=>{e.component(Io.__name,Io)};const ZW={class:"strikethrough-node"},$o=Jt(Qe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=H(()=>et({text:$n,inline_code:_o,link:No,html_inline:ps,strong:Io,emphasis:Lo,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,footnote_reference:hs,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("del",ZW,[(C(!0),E(Pe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(di),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);$o.install=e=>{e.component($o.__name,$o)};const JW=["href","title","aria-label","aria-hidden","target","rel"],eU=["aria-hidden"],tU={class:"link-text-wrapper relative inline-flex"},nU={class:"leading-[normal] link-text"},No=Jt(Qe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Bt("markstreamShowTooltips",void 0),o=H(()=>{const w=n?.value;return typeof w=="boolean"?w:t.showTooltip}),s=H(()=>{var w,k,b,y,x;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",N=(w=t.animationOpacity)!=null?w:.35,v=Math.max(.12,Math.min(.5*N,N)),M={"--underline-height":`${(k=t.underlineHeight)!=null?k:2}px`,"--underline-bottom":L,"--underline-opacity":String(N),"--underline-rest-opacity":String(v),"--underline-duration":`${(b=t.animationDuration)!=null?b:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(x=t.animationIteration)!=null?x:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),i=qn(()=>t.customId),r=H(()=>et({text:$n,strong:Io,strikethrough:$o,emphasis:Lo,image:yr,html_inline:ps,inline_code:_o},i.value)),l=mu(),a=H(()=>{var w,k;const b=(w=t.node)==null?void 0:w.attrs;if(!b||typeof b!="object")return{};const y={};if(Array.isArray(b))for(const x of b)Array.isArray(x)&&x[0]&&(y[String(x[0])]=String((k=x[1])!=null?k:""));else for(const[x,L]of Object.entries(b))x&&L!=null&&L!==!1&&(y[x]=L===!0?"":String(L));return A_(y,"safe","a")}),c=H(()=>et(et({},l),a.value)),u=H(()=>{var w,k;return A_({href:String((k=(w=t.node)==null?void 0:w.href)!=null?k:"")},"safe","a").href}),d=H(()=>{if(!u.value)return;const w=c.value.target;return(typeof w=="string"?w.trim():String(w??"").trim())||(o7(u.value)?"_blank":void 0)}),f=H(()=>{var w;return String((w=d.value)!=null?w:"").trim().toLowerCase()==="_blank"}),g=H(()=>{if(!u.value)return;const w=c.value.rel,k=new Set((typeof w=="string"?w:String(w??"")).split(/\s+/).filter(Boolean)),b=new Set(Array.from(k).filter(y=>y.toLowerCase()!=="opener"));return f.value&&(b.add("noopener"),b.add("noreferrer")),b.size>0?Array.from(b).join(" "):void 0}),h=H(()=>{const w=et({},c.value);return delete w.title,delete w.href,delete w.target,delete w.rel,w});function m(){o.value&&$W()}const _=H(()=>{var w,k;const b=(w=t.node)==null?void 0:w.title;return typeof b=="string"&&b.trim().length>0?b:String((k=u.value)!=null?k:"")});return(w,k)=>{var b,y;return e.node.loading?(C(),E("span",en({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},S(l),{style:s.value}),[p("span",tU,[p("span",nU,[vt(S($n),{class:"leading-[normal] link-text",node:{type:"text",content:String((b=e.node.text)!=null?b:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),k[1]||(k[1]=p("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,eU)):(C(),E("a",en({key:0,class:"link-node",href:u.value,title:o.value?"":_.value,"aria-label":`Link: ${_.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:g.value},h.value,{style:s.value,onMouseenter:k[0]||(k[0]=x=>(function(L){var N,v,M,$;if(!o.value)return;const P=L,T=P?.clientX!=null&&P?.clientY!=null?{x:P.clientX,y:P.clientY}:void 0,I=((N=t.node)==null?void 0:N.title)||((v=u.value)!=null&&v.includes("xn--")&&(($=(M=t.node)==null?void 0:M.text)!=null&&$.includes("://"))?t.node.text:u.value)||"";IW(L.currentTarget,I,"top",!1,T)})(x)),onMouseleave:m}),[(C(!0),E(Pe,null,Xe(e.node.children,(x,L)=>(C(),Ve(S(di),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:x,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,JW))}}}),[["__scopeId","data-v-367e6ca4"]]);No.install=e=>{e.component(No.__name,No)};const oU={class:"insert-node"},Ko=Jt(Qe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=H(()=>et({text:$n,inline_code:_o,link:No,html_inline:ps,strong:Io,emphasis:Lo,strikethrough:$o,highlight:ms,subscript:Vo,superscript:zo,emoji:jo,footnote_reference:hs,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("ins",oU,[(C(!0),E(Pe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(di),{key:`${e.indexKey||"insert"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Ko.install=e=>{e.component(Ko.__name,Ko)};const sU={class:"highlight-node"},ms=Jt(Qe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=H(()=>et({text:$n,inline_code:_o,link:No,html_inline:ps,strong:Io,emphasis:Lo,strikethrough:$o,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,footnote_reference:hs,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("mark",sU,[(C(!0),E(Pe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(di),{key:`${e.indexKey||"highlight"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);ms.install=e=>{e.component(ms.__name,ms)};const iU={class:"emphasis-node"},Lo=Jt(Qe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=H(()=>et({text:$n,inline_code:_o,link:No,html_inline:ps,strong:Io,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,footnote_reference:hs,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("em",iU,[(C(!0),E(Pe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(di),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Lo.install=e=>{e.component(Lo.__name,Lo)};const rU={class:"hard-break"},kr=Jt(Qe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(C(),E("br",rU))}),[["__scopeId","data-v-50c58f70"]]);kr.install=e=>{e.component(kr.__name,kr)};const ru=Qe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=fr({checkbox:fs,checkbox_input:fs,emoji:jo,emphasis:Lo,hardbreak:kr,highlight:ms,inline_code:_o,insert:Ko,link:No,reference:Eo,strikethrough:$o,strong:Io,subscript:Vo,superscript:zo,text:$n}),o=qn(()=>t.customId),s=H(()=>{const i=o.value;return Object.keys(i).length>0?et(et({},n),i):n});return(i,r)=>(C(!0),E(Pe,null,Xe(e.nodes,(l,a)=>(C(),Ve(S(di),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function S1(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(S1)}function Kf(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(S1))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(S1)?s:null}function Ta(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const lU=["cite"],aU={key:0,dir:"auto",class:"paragraph-node"},cU=["custom-id"],zd=Jt(Qe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=qn(()=>t.customId),o=H(()=>!!n.value.paragraph),s=H(()=>!!n.value.text),i=H(()=>Kf(t.node.children,!o.value)),r=H(()=>t.fade!==!1||s.value?null:Ta(i.value));return yn("markstreamShowTooltips",H(()=>t.showTooltips)),yn("markstreamFade",H(()=>t.fade)),(l,a)=>(C(),E("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(C(),E("p",aU,[r.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,cU)):(C(),Ve(S(ru),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(C(),Ve(S(Go),{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,lU))}}),[["__scopeId","data-v-abfecebc"]]);zd.install=e=>{e.component(zd.__name,zd)};const uU={class:"definition-list"},dU={class:"definition-term"},fU={class:"definition-desc"},Vd=Jt(Qe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(C(),E("dl",uU,[(C(!0),E(Pe,null,Xe(t.node.items,(s,i)=>(C(),E(Pe,{key:i},[p("dt",dU,[vt(S(Go),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),p("dd",fU,[vt(S(Go),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Vd.install=e=>{e.component(Vd.__name,Vd)};const hU=["href","title"],Rc=Jt(Qe({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(C(),E("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,hU))}}),[["__scopeId","data-v-e1eb37b6"]]);Rc.install=e=>{e.component(Rc.__name,Rc)};const pU=["id"],mU={class:"flex-1"},Kd=Qe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(C(),E("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[p("div",mU,[vt(S(Go),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,pU))}});Kd.install=e=>{e.component(Kd.__name,Kd)};const gU=["custom-id"],x1=Jt(Qe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=Bt("markstreamFade",void 0),s=H(()=>o?.value!==!1||n.value.text?null:Ta(t.node.children)),i=H(()=>et({text:$n,inline_code:_o,link:No,image:yr,strong:Io,emphasis:Lo,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,checkbox:fs,checkbox_input:fs,footnote_reference:hs,hardbreak:kr,math_inline:Gs,reference:Eo},n.value));return(r,l)=>(C(),Ve(ko(`h${e.node.level}`),en({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:In(()=>[s.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},O(s.value),9,gU)):(C(!0),E(Pe,{key:1},Xe(e.node.children,(a,c)=>(C(),Ve(S(di),{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"]]),Gf=x1;Gf.install=e=>{e.component(x1.__name,x1)};const vU={key:0,dir:"auto",class:"paragraph-node"},yU=["custom-id"],kU={dir:"auto",class:"paragraph-node"},bU=["custom-id"],ya=Jt(Qe({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=H(()=>{var g;return(g=t.node)!=null?g:t.item}),o=qn(()=>t.customId),s=H(()=>!!o.value.paragraph),i=H(()=>!!o.value.text),r=H(()=>{var g;return Kf((g=n.value)==null?void 0:g.children,!s.value)}),l=H(()=>{var g;if(s.value)return null;const h=(g=n.value)==null?void 0:g.children;if(!Array.isArray(h)||h.length<2)return null;const m=h[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const _=h.slice(1);if(!_.every(k=>k?.type==="list"))return null;const w=Kf([m]);return w?{paragraphChildren:w,nestedLists:_}:null});function a(){return t.fade===!1&&!i.value}const c=H(()=>a()?Ta(r.value):null),u=H(()=>{var g;return a()?Ta((g=l.value)==null?void 0:g.paragraphChildren):null}),d=Object.freeze({}),f=H(()=>{const{value:g}=t;return typeof g=="number"&&Number.isFinite(g)?{value:g}:d});return yn("markstreamShowTooltips",H(()=>t.showTooltips)),yn("markstreamFade",H(()=>t.fade)),(g,h)=>{var m,_;return C(),E("li",en({class:"list-item",dir:"auto"},f.value),[r.value?(C(),E("p",vU,[c.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,yU)):(C(),Ve(S(ru),{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?(C(),E(Pe,{key:1},[p("p",kU,[u.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,bU)):(C(),Ve(S(ru),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(C(!0),E(Pe,null,Xe(l.value.nestedLists,(w,k)=>(C(),Ve(S(Go),{key:k,nodes:[w],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${k}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:h[0]||(h[0]=b=>g.$emit("copy",b))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(C(),Ve(S(Go),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(_=(m=n.value)==null?void 0:m.children)!=null?_:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:h[1]||(h[1]=w=>g.$emit("copy",w))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);ya.install=e=>{e.component(ya.__name,ya)};const ka=Jt(Qe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=qn(()=>e.customId),n=H(()=>t.value.list_item||ya);return(o,s)=>(C(),Ve(ko(e.node.ordered?"ol":"ul"),{class:Oe(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:In(()=>[(C(!0),E(Pe,null,Xe(e.node.items,(i,r)=>{var l;return C(),Ve(ko(n.value),en({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);ka.install=e=>{e.component(ka.__name,ka)};const RA=Symbol("ViewportPriority");function wU(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?te(t):t,r=s?(n=window.requestIdleCallback)!=null?n:k=>window.setTimeout(()=>k({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:k=>window.clearTimeout(k):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function g(){if(f!=null){try{l?.(f)}catch{}f=null}}function h(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||g()}}function m(k){const b=u.get(k);if(b){if(!b.visible.value){b.visible.value=!0;try{b.resolve()}catch{}}try{a?.unobserve(k)}catch{}u.delete(k),d.delete(k),h()}}function _(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const k=d.values().next().value;k&&(d.delete(k),m(k),d.size&&_())},{timeout:1200}))}ze(i,k=>{if(!k){for(const b of Array.from(u.keys()))m(b);g()}},{flush:"sync"});const w=(k,b)=>{const y=te(!1);let x,L=!1;const N=new Promise($=>{x=()=>{L||(L=!0,$())}}),v=()=>{try{a?.unobserve(k)}catch{}u.delete(k),d.delete(k),h()};if(!s||!i.value)return y.value=!0,x(),{isVisible:y,whenVisible:N,destroy:v};const M=(function($,P){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const T=(function(D,F){var z,V,ne;return{root:(z=e?.(D??null))!=null?z:null,rootMargin:(V=F?.rootMargin)!=null?V:"300px",threshold:(ne=F?.threshold)!=null?ne:0}})($,P);if(a&&(R=T,(I=c)&&I.root===R.root&&I.rootMargin===R.rootMargin&&I.threshold===R.threshold))return a;var I,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const F of D)(F.isIntersecting||F.intersectionRatio>0)&&m(F.target)},{root:T.root,rootMargin:T.rootMargin,threshold:T.threshold}),c=T;for(const D of u.keys())a.observe(D);return a})(k,b);return M?(u.set(k,{resolve:x,visible:y}),M.observe(k),d.add(k),_(),{isVisible:y,whenVisible:N,destroy:v}):(y.value=!0,x(),{isVisible:y,whenVisible:N,destroy:v})};return yn(RA,w),w}function _U(){var e,t;const n=Bt(RA,void 0);if(n)return n;const o=new WeakMap;let s=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const g=o.get(f);if(g){if(!g.visible.value){g.visible.value=!0;try{g.resolve()}catch{}}try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const g=te(!1);let h,m=!1;const _=new Promise(b=>{h=()=>{m||(m=!0,b())}}),w=()=>{try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()},k=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(b=>{for(const y of b)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),s));return k?(o.set(f,{resolve:h,visible:g}),k.observe(f),i.add(f),d(),{isVisible:g,whenVisible:_,destroy:w}):(g.value=!0,h(),{isVisible:g,whenVisible:_,destroy:w})}}const CU={key:2,class:"html-block-node__raw"},SU=["innerHTML"],xU={key:1,class:"html-block-node__placeholder"},Dc=Jt(Qe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Bt("markstreamHtmlPolicy",void 0),o=Bt("markstreamNestedRendererProps",void 0),s=H(()=>{var L,N;return(N=(L=t.htmlPolicy)!=null?L:n?.value)!=null?N:"safe"}),i=H(()=>{var L,N;const v=(L=o?.value)!=null?L:{};return At(et({},v),{customId:(N=t.customId)!=null?N:v.customId,htmlPolicy:s.value})}),r=ai({loader:()=>Promise.resolve().then(()=>u0),suspensible:!1}),l=H(()=>{const L=c1(t.node.attrs,s.value);if(!L)return;const N=jf(L);return Object.keys(N).length>0?N:void 0}),a=H(()=>{const L=String(t.node.tag||"").trim(),N=c1(t.node.attrs,s.value,L);if(!N)return;const v=jf(N);return Object.keys(v).length>0?v:void 0}),c=qn(()=>t.customId),u=Qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=te(null),f=te(typeof window>"u"),g=te(t.node.content),h=H(()=>Array.isArray(t.node.children)?t.node.children:[]),m=H(()=>String(t.node.tag||"div")),_=H(()=>{const L=m.value.trim().toLowerCase();return wT.has(L)||Xv(L,s.value)}),w=H(()=>h.value.length>0&&!!t.node.tag&&!_.value),k=H(()=>{var L,N,v;if(w.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=g.value)!=null?L:""};const M=(N=g.value)!=null?N:t.node.content;if(!M)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:va(M,s.value)};if(t.node.loading){const P=Vf(M,c.value,s.value);return P===null?{mode:"text",content:(v=t.node.raw)!=null?v:M}:{mode:"dynamic",nodes:P}}if(!NA(M,c.value))return{mode:"html",content:va(M,s.value)};const $=Vf(M,c.value,s.value);return $===null?{mode:"html",content:va(M,s.value)}:{mode:"dynamic",nodes:$}}),b=_U(),y=te(null),x=!!t.node.loading;return typeof window<"u"?(ze(d,L=>{var N,v;if((v=(N=y.value)==null?void 0:N.destroy)==null||v.call(N),y.value=null,!x)return f.value=!0,void(g.value=t.node.content);if(!L)return void(f.value=!1);const M=b(L,{rootMargin:"400px"});y.value=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),ze(()=>t.node.content,L=>{x&&!f.value||(g.value=L)})):f.value=!0,Yo(()=>{var L,N;(N=(L=y.value)==null?void 0:L.destroy)==null||N.call(L),y.value=null}),(L,N)=>(C(),Ve(ko(w.value?m.value:"div"),en({ref_key:"htmlRef",ref:d,class:"html-block-node"},w.value?a.value:void 0),{default:In(()=>[f.value?(C(),E(Pe,{key:0},[k.value.mode==="structured"?(C(),Ve(S(r),en({key:0},i.value,{nodes:h.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):k.value.mode==="dynamic"?(C(),Ve(S(u),{key:1,nodes:k.value.nodes},null,8,["nodes"])):k.value.mode==="text"?(C(),E("pre",CU,O(k.value.content),1)):(C(),E("div",en({key:3},l.value,{innerHTML:k.value.content}),null,16,SU))],64)):(C(),E("div",xU,[ca(L.$slots,"placeholder",{node:e.node},()=>[N[0]||(N[0]=p("span",{class:"html-block-node__placeholder-bar"},null,-1)),N[1]||(N[1]=p("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),N[2]||(N[2]=p("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Dc.install=e=>{e.component(Dc.__name,Dc)};const TU={dir:"auto",class:"paragraph-node"},AU=["custom-id"],dl=Jt(Qe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=qn(()=>t.customId),o=Bt("markstreamHtmlPolicy",void 0),s=Bt("markstreamFade",void 0),i=Bt("markstreamParseOptions",void 0),r=Bt("markstreamCustomMarkdownIt",void 0),l=Bt("markstreamNestedRendererProps",void 0),a=H(()=>{var v;return(v=o?.value)!=null?v:"safe"}),c=H(()=>{var v;return(v=t.parseOptions)!=null?v:i?.value}),u=H(()=>{var v;return(v=t.customMarkdownIt)!=null?v:r?.value}),d=H(()=>{var v,M;return(M=t.customHtmlTags)!=null?M:(v=l?.value)==null?void 0:v.customHtmlTags}),f=H(()=>{var v,M;const $=(v=l?.value)!=null?v:{};return At(et({},$),{customId:(M=t.customId)!=null?M:$.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),g=ai({loader:()=>Promise.resolve().then(()=>u0),suspensible:!1});function h(v){var M;return v.type==="text"&&String((M=v.content)!=null?M:"").trim()===""}const m=H(()=>t.node.children.filter(v=>!h(v))),_=H(()=>m.value.length>0&&m.value.every(v=>v.type==="image"||(function(M){var $;const P=(function(T){return T.type==="link"&&Array.isArray(T.children)?T.children.filter(I=>!h(I)):[]})(M);return P.length===1&&(($=P[0])==null?void 0:$.type)==="image"})(v))),w=H(()=>new Set(Ia(d.value))),k=H(()=>{if(!_.value||m.value.length<=1)return t.node.children;const v=[];for(let M=0;M<t.node.children.length;M++){const $=t.node.children[M];if(!h($)){v.push($);continue}const P=v.length>0,T=t.node.children.slice(M+1).some(I=>!h(I));P&&T&&v.push(At(et({},$),{content:" ",raw:" "}))}return v}),b=H(()=>s?.value===!1&&!n.value.text),y=H(()=>b.value?Ta(k.value):null);function x(v,M){return{node:v,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=H(()=>et({inline_code:_o,image:yr,link:No,hardbreak:kr,emphasis:Lo,strong:Io,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,html_inline:ps,html_block:Dc,emoji:jo,checkbox:fs,math_inline:Gs,checkbox_input:fs,reference:Eo,footnote_anchor:Rc,footnote_reference:hs,text:$n},n.value)),N=H(()=>k.value.map((v,M)=>{var $;const P=(function(T){var I,R,D,F;if(T.type==="html_block"||T.type==="html_inline"){const z=String((I=T.tag)!=null?I:"").trim().toLowerCase()||xT(T.content);if(z&&!w.value.has(z)&&TT((R=T.content)!=null?R:T.raw,z)){const V=String((F=(D=T.content)!=null?D:T.raw)!=null?F:"");return{child:{type:"text",content:V,raw:V},component:$n,isCustomComponent:!1}}}return{child:T,component:L.value[T.type],isCustomComponent:!!(n.value[T.type]&&!_u(String(T.type)))}})(v);return At(et({},P),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:P.isCustomComponent?o0(P.child,a.value):void 0,hasSlotChildren:Array.isArray(P.child.children)&&P.child.children.length>0,slotContent:String(($=P.child.content)!=null?$:""),originalChild:v})}));return(v,M)=>(C(),E("p",TU,[y.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},O(y.value),9,AU)):(C(!0),E(Pe,{key:1},Xe(N.value,$=>{return C(),E(Pe,{key:$.key},[_.value&&h($.originalChild)?(C(),E(Pe,{key:0},[ft(O((P=$.originalChild,String((T=P.content)!=null?T:""))),1)],64)):$.isCustomComponent?(C(),Ve(ko($.component),en({key:1,ref_for:!0},$.customAttrs,{node:$.child,loading:$.child.loading,"index-key":$.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:In(()=>[$.hasSlotChildren?(C(),Ve(S(g),en({key:0,ref_for:!0},f.value,{nodes:$.child.children,"index-key":$.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):$.slotContent?(C(),Ve(S(g),en({key:1,ref_for:!0},f.value,{content:$.slotContent,final:!$.child.loading,"index-key":`${$.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(C(),Ve(ko($.component),en({key:2,ref_for:!0},x($.child,$.index)),null,16))],64);var P,T}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);dl.install=e=>{e.component(dl.__name,dl)};const MU={class:"table-node-wrapper"},EU=["aria-busy"],IU={key:0},$U=["custom-id"],NU=["aria-label","onPointerdown"],LU=["custom-id"],OU={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Bc=Jt(Qe({__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=H(()=>{var w;return(w=t.node.loading)!=null&&w}),o=H(()=>{var w;return(w=t.node.rows)!=null?w:[]}),s=te(null),i=te([]);let r=null;const l=H(()=>t.node.header.cells.length),a=H(()=>i.value.some(w=>Number.isFinite(w)&&w>0)),c=H(()=>a.value?i.value.map(w=>w>0?{width:`${w}px`}:void 0):[]);yn("markstreamShowTooltips",H(()=>t.showTooltips)),yn("markstreamFade",H(()=>t.fade));const u=qn(()=>t.customId),d=H(()=>!!u.value.text),f=H(()=>!!u.value.paragraph),g=new WeakMap;function h(w){const k=t.fade===!1&&!d.value,b=!f.value,y=g.get(w);if(y?.children===w.children&&y.textFastPath===k&&y.paragraphFastPath===b)return y.info;const x=Kf(w.children,b,!0),L={simpleChildren:x,plainText:x&&k?Ta(x):null};return g.set(w,{children:w.children,textFastPath:k,paragraphFastPath:b,info:L}),L}function m(w){if(!r)return;w.preventDefault();const k=r.startWidth+r.nextStartWidth,b=Math.min(48,Math.floor(k/2)),y=Math.max(b,Math.min(k-b,Math.round(r.startWidth+w.clientX-r.startX))),x=[...r.widths];x[r.index]=y,x[r.index+1]=k-y,i.value=x}function _(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),r=null)}return ze(l,()=>{_(),i.value=[]}),Yo(_),(w,k)=>(C(),E("div",MU,[p("table",{ref_key:"tableRef",ref:s,class:Oe(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(C(),E("colgroup",IU,[(C(!0),E(Pe,null,Xe(e.node.header.cells,(b,y)=>(C(),E("col",{key:y,style:Wt(c.value[y])},null,4))),128))])):ie("",!0),p("thead",null,[p("tr",null,[(C(!0),E(Pe,null,Xe(e.node.header.cells,(b,y)=>(C(),E("th",{key:y,dir:"auto",class:Oe([b.align==="right"?"text-right":b.align==="center"?"text-center":"text-left"])},[h(b).plainText!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},O(h(b).plainText),9,$U)):h(b).simpleChildren?(C(),Ve(S(ru),{key:1,nodes:h(b).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(C(),Ve(S(Go),{key:2,nodes:b.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:k[0]||(k[0]=x=>w.$emit("copy",x))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(C(),E("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:x=>(function(L,N){if(N.button!==0)return;const v=(function(){var P;const T=(P=s.value)==null?void 0:P.querySelectorAll("thead th");return Array.from(T??[],I=>Math.round(I.getBoundingClientRect().width))})(),M=v[L],$=v[L+1];M&&$&&(N.preventDefault(),r={index:L,startX:N.clientX,startWidth:M,nextStartWidth:$,widths:v},i.value=v,window.addEventListener("pointermove",m),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_))})(y,x)},null,40,NU)):ie("",!0)],2))),128))])]),p("tbody",null,[(C(!0),E(Pe,null,Xe(o.value,(b,y)=>(C(),E("tr",{key:y},[(C(!0),E(Pe,null,Xe(b.cells,(x,L)=>(C(),E("td",{key:L,class:Oe([x.align==="right"?"text-right":x.align==="center"?"text-center":"text-left"]),dir:"auto"},[h(x).plainText!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},O(h(x).plainText),9,LU)):h(x).simpleChildren?(C(),Ve(S(ru),{key:1,nodes:h(x).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${L}`},null,8,["nodes","custom-id","index-key"])):(C(),Ve(S(Go),{key:2,nodes:x.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:k[1]||(k[1]=N=>w.$emit("copy",N))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,EU),vt(Fi,{name:"table-node-fade"},{default:In(()=>[n.value?(C(),E("div",OU,[ca(w.$slots,"loading",{isLoading:n.value},()=>[k[2]||(k[2]=p("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),k[3]||(k[3]=p("span",{class:"sr-only"},"Loading",-1))],!0)])):ie("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Bc.install=e=>{e.component(Bc.__name,Bc)};const PU={class:"hr-node"},Gd=Jt({},[["render",function(e,t){return C(),E("hr",PU)}],["__scopeId","data-v-39b2349c"]]);Gd.install=e=>{e.component(Gd.__name,Gd)};const RU={class:"unknown-node"},T1=Qe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(C(),E("div",RU,O(e.node.raw),1))}),Yd=Jt(Qe({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=H(()=>`vmr-container vmr-container-${t.node.name}`),o=qn(()=>t.customId),s=H(()=>et({text:$n,paragraph:dl,heading:Gf,inline_code:_o,link:No,image:yr,strong:Io,emphasis:Lo,strikethrough:$o,insert:Ko,subscript:Vo,superscript:zo,checkbox:fs,checkbox_input:fs,hardbreak:kr,math_inline:Gs,reference:Eo,list:ka,math_block:PA,table:Bc},o.value));return(i,r)=>(C(),E("div",en({class:n.value},e.node.attrs),[(C(!0),E(Pe,null,Xe(e.node.children,(l,a)=>{return C(),Ve(ko((c=l.type,s.value[c]||T1)),{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"]]);Yd.install=e=>{e.component(Yd.__name,Yd)};const DU=["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"],P_=[[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 BU(e){if(e<=255)return DU[e];let t=0,n=P_.length-1;for(;t<=n;){const o=t+n>>1,s=P_[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const FU=/[ \t\n\r\f]+/g,HU=/[\t\n\r\f]| {2,}|^ | $/;let Xm=null;const WU=new RegExp("\\p{Script=Arabic}","u"),qh=new RegExp("\\p{M}","u"),DA=new RegExp("\\p{Nd}","u");function R_(e){return WU.test(e)}function D_(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 Li(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){if(D_(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(D_(n))return!0}}return!1}const UU=new Set([" "," ","","\uFEFF"]);function qU(e){return Li(e)}function A1(e){return!(function(t){const n=Yf(t);return n!==null&&(s0.has(n)||pl.has(n))})(e)&&!(function(t){const n=Yf(t);return n!==null&&UU.has(n)})(e)}const s0=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),jh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),i0=new Set(["'","’"]),pl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),jU=new Set([":",".","،","؛"]),zU=new Set(["၏"]),VU=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function KU(e){if(r0(e))return!0;let t=!1;for(const n of e)if(pl.has(n))t=!0;else if(!t||!qh.test(n))return!1;return t}function GU(e){for(const t of e)if(!s0.has(t)&&!pl.has(t))return!1;return e.length>0}function YU(e){if(r0(e))return!0;for(const t of e)if(!jh.has(t)&&!i0.has(t)&&!qh.test(t))return!1;return e.length>0}function r0(e){let t=!1;for(const n of e)if(n!=="\\"&&!qh.test(n)){if(!(jh.has(n)||pl.has(n)||i0.has(n)))return!1;t=!0}return t}function BA(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function Yf(e){if(e.length===0)return null;const t=BA(e,e.length);return e.slice(t)}function XU(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(qh.test(o))n--;else{if(!jh.has(o)&&!i0.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function QU(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function B_(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function F_(e,t){return e&&t!==null&&jU.has(t)}function ZU(e){const t=Yf(e);return t!==null&&zU.has(t)}function JU(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 M1(e){let t=e.length;for(;t>0;){const n=BA(e,t),o=e.slice(n,t);if(VU.has(o))return!0;if(!pl.has(o))return!1;t=n}return!1}function eq(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
226
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const tq=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ms(e){return e.length===1?e[0]:e.join("")}function nq(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Ms(n)}function oq(e,t,n,o){if(!tq.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=eq(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:Ms(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&s.push({text:Ms(r),isWordLike:a,kind:i,start:l}),s}function Qm(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const sq=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function iq(e,t){const n=e.texts[t];return!!n.startsWith("www.")||sq.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function rq(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const lq=new Set([":","-","/","×",",",".","+","–","—"]),H_=/^[A-Za-z0-9_]+[,:;]*$/,W_=/[,:;]+$/;function U_(e){for(const t of e)if(DA.test(t))return!0;return!1}function Xd(e){if(e.length===0)return!1;for(const t of e)if(!DA.test(t)&&!lq.has(t))return!1;return!0}function q_(e,t,n){var o,s,i;const r=(Xm===null&&(Xm=new Intl.Segmenter(void 0,{granularity:"word"})),Xm);let l=0;const a=[],c=[],u=[],d=[],f=[],g=[],h=[],m=[],_=[],w=[],k=[],b=[];for(const v of r.segment(e))for(const M of oq(v.segment,(o=v.isWordLike)!=null&&o,v.index,n)){let $=function(){g[V]!==null&&(c[V]=[B_(a,g,h,V)],g[V]=null),c[V].push(M.text),u[V]=u[V]||M.isWordLike,m[V]=m[V]||I,_[V]=_[V]||R,w[V]=F,k[V]=z,b[V]=F_(_[V],D)};const P=M.kind==="text",T=QU(M.text,M.isWordLike,M.kind),I=Li(M.text),R=R_(M.text),D=Yf(M.text),F=M1(M.text),z=ZU(M.text),V=l-1;t.carryCJKAfterClosingQuote&&P&&l>0&&d[V]==="text"&&I&&m[V]&&w[V]||P&&l>0&&d[V]==="text"&&GU(M.text)&&m[V]||P&&l>0&&d[V]==="text"&&k[V]?$():P&&l>0&&d[V]==="text"&&M.isWordLike&&R&&b[V]?($(),u[V]=!0):T!==null&&l>0&&d[V]==="text"&&g[V]===T?h[V]=((s=h[V])!=null?s:1)+1:P&&!M.isWordLike&&l>0&&d[V]==="text"&&(KU(M.text)||M.text==="-"&&u[V])?$():(a[l]=M.text,c[l]=[M.text],u[l]=M.isWordLike,d[l]=M.kind,f[l]=M.start,g[l]=T,h[l]=T===null?0:1,m[l]=I,_[l]=R,w[l]=F,k[l]=z,b[l]=F_(R,D),l++)}for(let v=0;v<l;v++)g[v]===null?a[v]=Ms(c[v]):a[v]=B_(a,g,h,v);for(let v=1;v<l;v++)d[v]==="text"&&!u[v]&&r0(a[v])&&d[v-1]==="text"&&(a[v-1]+=a[v],u[v-1]=u[v-1]||u[v],a[v]="");const y=Array.from({length:l},()=>null);let x=-1;for(let v=l-1;v>=0;v--){const M=a[v];if(M.length!==0){if(d[v]==="text"&&!u[v]&&YU(M)&&x>=0&&d[x]==="text"){const $=(i=y[x])!=null?i:[];$.push(M),y[x]=$,f[x]=f[v],a[v]="";continue}x=v}}for(let v=0;v<l;v++){const M=y[v];M!=null&&(a[v]=nq(M,a[v]))}let L=0;for(let v=0;v<l;v++){const M=a[v];M.length!==0&&(L!==v&&(a[L]=M,u[L]=u[v],d[L]=d[v],f[L]=f[v]),L++)}a.length=L,u.length=L,d.length=L,f.length=L;const N=(function(v){const M=v.texts.slice(),$=v.isWordLike.slice(),P=v.kinds.slice(),T=v.starts.slice();for(let I=0;I<M.length-1;I++){if(P[I]!=="text"||P[I+1]!=="text"||!Li(M[I])||!Li(M[I+1]))continue;const R=XU(M[I]);R!==null&&(M[I]=R.head,M[I+1]=R.tail+M[I+1],T[I+1]=T[I]+R.head.length)}return{len:M.length,texts:M,isWordLike:$,kinds:P,starts:T}})((function(v){const M=[],$=[],P=[],T=[];for(let I=0;I<v.len;I++){const R=v.texts[I],D=v.kinds[I],F=v.isWordLike[I];if(D==="text"&&F&&H_.test(R)){const z=[R];let V=W_.test(R),ne=I+1;for(;V&&ne<v.len&&v.kinds[ne]==="text"&&v.isWordLike[ne]&&H_.test(v.texts[ne]);){const K=v.texts[ne];z.push(K),V=W_.test(K),ne++}M.push(Ms(z)),$.push(!0),P.push("text"),T.push(v.starts[I]),I=ne-1;continue}M.push(R),$.push(F),P.push(D),T.push(v.starts[I])}return{len:M.length,texts:M,isWordLike:$,kinds:P,starts:T}})((function(v){const M=[],$=[],P=[],T=[];for(let I=0;I<v.len;I++){const R=v.texts[I];if(v.kinds[I]==="text"&&R.includes("-")){const D=R.split("-");let F=D.length>1;for(let z=0;z<D.length;z++){const V=D[z];if(!F)break;V.length!==0&&U_(V)&&Xd(V)||(F=!1)}if(F){let z=0;for(let V=0;V<D.length;V++){const ne=D[V],K=V<D.length-1?`${ne}-`:ne;M.push(K),$.push(!0),P.push("text"),T.push(v.starts[I]+z),z+=K.length}continue}}M.push(R),$.push(v.isWordLike[I]),P.push(v.kinds[I]),T.push(v.starts[I])}return{len:M.length,texts:M,isWordLike:$,kinds:P,starts:T}})((function(v){const M=[],$=[],P=[],T=[];for(let I=0;I<v.len;I++){const R=v.texts[I],D=v.kinds[I];if(D==="text"&&Xd(R)&&U_(R)){const F=[R];let z=I+1;for(;z<v.len&&v.kinds[z]==="text"&&Xd(v.texts[z]);)F.push(v.texts[z]),z++;M.push(Ms(F)),$.push(!0),P.push("text"),T.push(v.starts[I]),I=z-1;continue}M.push(R),$.push(v.isWordLike[I]),P.push(D),T.push(v.starts[I])}return{len:M.length,texts:M,isWordLike:$,kinds:P,starts:T}})((function(v){const M=[],$=[],P=[],T=[];for(let I=0;I<v.len;I++){const R=v.texts[I];if(M.push(R),$.push(v.isWordLike[I]),P.push(v.kinds[I]),T.push(v.starts[I]),!rq(R))continue;const D=I+1;if(D>=v.len||Qm(v.kinds[D]))continue;const F=[],z=v.starts[D];let V=D;for(;V<v.len&&!Qm(v.kinds[V]);)F.push(v.texts[V]),V++;F.length>0&&(M.push(Ms(F)),$.push(!0),P.push("text"),T.push(z),I=V-1)}return{len:M.length,texts:M,isWordLike:$,kinds:P,starts:T}})((function(v){const M=v.texts.slice(),$=v.isWordLike.slice(),P=v.kinds.slice(),T=v.starts.slice();for(let R=0;R<v.len;R++){if(P[R]!=="text"||!iq(v,R))continue;const D=[M[R]];let F=R+1;for(;F<v.len&&!Qm(P[F]);){D.push(M[F]),$[R]=!0;const z=M[F].includes("?");if(P[F]="text",M[F]="",F++,z)break}M[R]=Ms(D)}let I=0;for(let R=0;R<M.length;R++){const D=M[R];D.length!==0&&(I!==R&&(M[I]=D,$[I]=$[R],P[I]=P[R],T[I]=T[R]),I++)}return M.length=I,$.length=I,P.length=I,T.length=I,{len:I,texts:M,isWordLike:$,kinds:P,starts:T}})((function(v){const M=[],$=[],P=[],T=[];let I=0;for(;I<v.len;){const R=[v.texts[I]];let D=v.isWordLike[I],F=v.kinds[I],z=v.starts[I];if(F==="glue"){const V=[R[0]],ne=z;for(I++;I<v.len&&v.kinds[I]==="glue";)V.push(v.texts[I]),I++;const K=Ms(V);if(!(I<v.len&&v.kinds[I]==="text")){M.push(K),$.push(!1),P.push("glue"),T.push(ne);continue}R[0]=K,R.push(v.texts[I]),D=v.isWordLike[I],F="text",z=ne,I++}else I++;if(F==="text")for(;I<v.len&&v.kinds[I]==="glue";){const V=[];for(;I<v.len&&v.kinds[I]==="glue";)V.push(v.texts[I]),I++;const ne=Ms(V);I<v.len&&v.kinds[I]==="text"?(R.push(ne,v.texts[I]),D=D||v.isWordLike[I],I++):R.push(ne)}M.push(Ms(R)),$.push(D),P.push(F),T.push(z)}return{len:M.length,texts:M,isWordLike:$,kinds:P,starts:T}})({len:L,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let v=0;v<N.len-1;v++){const M=JU(N.texts[v]);M!==null&&(N.kinds[v]!=="space"&&N.kinds[v]!=="preserved-space"||N.kinds[v+1]!=="text"||!R_(N.texts[v+1])||(N.texts[v]=M.space,N.isWordLike[v]=!1,N.kinds[v]=N.kinds[v]==="preserved-space"?"preserved-space":"space",N.texts[v+1]=M.marks+N.texts[v+1],N.starts[v+1]=N.starts[v]+M.space.length))}return N}function aq(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let ql=null;const j_=new Map;let jl=null;const cq=new RegExp("\\p{Emoji_Presentation}","u"),uq=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Zm=null;const z_=new Map;function E1(){if(ql!==null)return ql;if(typeof OffscreenCanvas<"u")return ql=new OffscreenCanvas(1,1).getContext("2d"),ql;if(typeof document<"u")return ql=document.createElement("canvas").getContext("2d"),ql;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function nr(e,t){let n=t.get(e);return n===void 0&&(n={width:E1().measureText(e).width,containsCJK:Li(e)},t.set(e,n)),n}function zh(){if(jl!==null)return jl;if(typeof navigator>"u")return jl={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},jl;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 jl={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},jl}function FA(){return Zm===null&&(Zm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Zm}function dq(e){return cq.test(e)||e.includes("️")}function Xr(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=FA();for(const a of l.segment(i))dq(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function fq(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 hq(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function V_(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i}=e;if(o.length===0)return 0;const r=t+zh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,g=0;function h(y=u,x=d,L=a){l++,a=0,c=!1,f=-1,g=0}function m(y,x){c=!0,u=y+1,d=0,a=x}function _(y,x,L){c=!0,u=y,d=x+1,a=L}function w(y,x){c?(a+=x,u=y+1,d=0):m(y,x)}function k(y,x){const L=i[y];for(let N=x;N<L.length;N++){const v=L[N];c?a+v>r?(h(),_(y,N,v)):(a+=v,u=y,d=N+1):_(y,N,v)}c&&u===y&&d===L.length&&(u=y+1,d=0)}let b=0;for(;b<o.length&&(c||(b=fq(e,b),!(b>=o.length)));){const y=o[b],x=s[b],L=x==="space"||x==="preserved-space"||x==="tab"||x==="zero-width-break"||x==="soft-hyphen";if(c)if(a+y>r){if(L){w(b,y),h(b+1,0,a-y),b++;continue}if(f>=0){if(u>f||u===f&&d>0){h();continue}h(f,0,g);continue}if(y>t&&i[b]!==null){h(),k(b,0),b++;continue}h()}else w(b,y),L&&(f=b+1,g=a-y),b++;else y>t&&i[b]!==null?k(b,0):m(b,y),L&&(f=b+1,g=a-y),b++}return c&&h(),l}let Jm=null;function pq(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,g){o=[d],s=f,i=g,r=M1(d),l=jh.has(d)}function u(d,f){o.push(d),i=i||f;const g=M1(d);r=d.length===1&&pl.has(d)&&r||g,l=!1}for(const d of(Jm===null&&(Jm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Jm).segment(e)){const f=d.segment,g=Li(f);o.length!==0?l||s0.has(f)||pl.has(f)||t.carryCJKAfterClosingQuote&&g&&r?u(f,g):i||g?(a(),c(f,d.index,g)):u(f,g):c(f,d.index,g)}return a(),n}function mq(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=Li(e[0].text),i=A1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:o})}for(let l=1;l<e.length;l++){const a=e[l],c=Li(a.text),u=A1(a.text);s&&i?(n.push(a.text),s=s||c,i=u):(r(),n=[a.text],o=a.start,s=c,i=u)}return r(),t}function gq(e,t,n,o){const s=zh(),{cache:i,emojiCorrection:r}=(function(N,v){E1().font=N;const M=(function(T){let I=j_.get(T);return I||(I=new Map,j_.set(T,I)),I})(N),$=(function(T){const I=T.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})(N),P=v?(function(T,I){let R=z_.get(T);if(R!==void 0)return R;const D=E1();D.font=T;const F=D.measureText("😀").width;if(R=0,F>I+.5&&typeof document<"u"&&document.body!==null){const z=document.createElement("span");z.style.font=T,z.style.display="inline-block",z.style.visibility="hidden",z.style.position="absolute",z.textContent="😀",document.body.appendChild(z);const V=z.getBoundingClientRect().width;document.body.removeChild(z),F-V>.5&&(R=F-V)}return z_.set(T,R),R})(N,$):0;return{cache:M,fontSize:$,emojiCorrection:P}})(t,(l=e.normalized,uq.test(l)));var l;const a=Xr("-",nr("-",i),r),c=8*Xr(" ",nr(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],g=[];let h=e.chunks.length<=1;const m=null,_=[],w=n?[]:null,k=Array.from({length:e.len});function b(N,v,M,$,P,T,I){P!=="text"&&P!=="space"&&P!=="zero-width-break"&&(h=!1),u.push(v),d.push(M),f.push($),g.push(P),_.push(I),w!==null&&w.push(N)}function y(N,v,M,$,P){const T=nr(N,i),I=Xr(N,T,r),R=v==="space"||v==="preserved-space"||v==="zero-width-break"?0:I,D=v==="space"||v==="zero-width-break"?0:I;if(P&&$&&N.length>1){let F="sum-graphemes";Xd(N)?F="pair-context":s.preferPrefixWidthsForBreakableRuns&&(F="segment-prefixes");const z=(function(V,ne,K,G,X){if(ne.breakableFitAdvances!==void 0)return ne.breakableFitAdvances;const be=FA(),le=[];for(const Ne of be.segment(V))le.push(Ne.segment);if(le.length<=1)return ne.breakableFitAdvances=null,ne.breakableFitAdvances;if(X==="sum-graphemes"){const Ne=[];for(const Re of le){const Q=nr(Re,K);Ne.push(Xr(Re,Q,G))}return ne.breakableFitAdvances=Ne,ne.breakableFitAdvances}if(X==="pair-context"||le.length>96){const Ne=[];let Re=null,Q=0;for(const ce of le){const Se=Xr(ce,nr(ce,K),G);if(Re===null)Ne.push(Se);else{const q=Re+ce,ee=nr(q,K);Ne.push(Xr(q,ee,G)-Q)}Re=ce,Q=Se}return ne.breakableFitAdvances=Ne,ne.breakableFitAdvances}const We=[];let ue="",ve=0;for(const Ne of le){ue+=Ne;const Re=Xr(ue,nr(ue,K),G);We.push(Re-ve),ve=Re}return ne.breakableFitAdvances=We,ne.breakableFitAdvances})(N,T,i,r,F);return void b(N,I,R,D,v,M,z)}b(N,I,R,D,v,M,null)}for(let N=0;N<e.len;N++){k[N]=u.length;const v=e.texts[N],M=e.isWordLike[N],$=e.kinds[N],P=e.starts[N];if($==="soft-hyphen"){b(v,0,a,a,$,P,null);continue}if($==="hard-break"){b(v,0,0,0,$,P,null);continue}if($==="tab"){b(v,0,0,0,$,P,null);continue}const T=nr(v,i);if($==="text"&&T.containsCJK){const I=pq(v,s),R=o==="keep-all"?mq(I):I;for(let D=0;D<R.length;D++){const F=R[D];y(F.text,"text",P+F.start,M,o==="keep-all"||!Li(F.text))}continue}y(v,$,P,M,!0)}const x=(function(N,v,M){const $=[];for(let P=0;P<N.length;P++){const T=N[P],I=T.startSegmentIndex<v.length?v[T.startSegmentIndex]:M,R=T.endSegmentIndex<v.length?v[T.endSegmentIndex]:M,D=T.consumedEndSegmentIndex<v.length?v[T.consumedEndSegmentIndex]:M;$.push({startSegmentIndex:I,endSegmentIndex:R,consumedEndSegmentIndex:D})}return $})(e.chunks,k,u.length),L=m===null?null:(function(N,v){const M=(function(P){const T=P.length;if(T===0)return null;const I=new Array(T);let R=!1;for(let K=0;K<T;){const G=P.charCodeAt(K);let X=G,be=1;if(G>=55296&&G<=56319&&K+1<T){const We=P.charCodeAt(K+1);We>=56320&&We<=57343&&(X=We-56320+(G-55296<<10)+65536,be=2)}const le=BU(X);le!=="R"&&le!=="AL"&&le!=="AN"||(R=!0);for(let We=0;We<be;We++)I[K+We]=le;K+=be}if(!R)return null;let D=0;for(let K=0;K<T;K++){const G=I[K];if(G==="L"){D=0;break}if(G==="R"||G==="AL"){D=1;break}}const F=new Int8Array(T);for(let K=0;K<T;K++)F[K]=D;const z=1&D?"R":"L",V=z;let ne=V;for(let K=0;K<T;K++)I[K]==="NSM"?I[K]=ne:ne=I[K];ne=V;for(let K=0;K<T;K++){const G=I[K];G==="EN"?I[K]=ne==="AL"?"AN":"EN":G!=="R"&&G!=="L"&&G!=="AL"||(ne=G)}for(let K=0;K<T;K++)I[K]==="AL"&&(I[K]="R");for(let K=1;K<T-1;K++)I[K]==="ES"&&I[K-1]==="EN"&&I[K+1]==="EN"&&(I[K]="EN"),I[K]!=="CS"||I[K-1]!=="EN"&&I[K-1]!=="AN"||I[K+1]!==I[K-1]||(I[K]=I[K-1]);for(let K=0;K<T;K++){if(I[K]!=="EN")continue;let G;for(G=K-1;G>=0&&I[G]==="ET";G--)I[G]="EN";for(G=K+1;G<T&&I[G]==="ET";G++)I[G]="EN"}for(let K=0;K<T;K++){const G=I[K];G!=="WS"&&G!=="ES"&&G!=="ET"&&G!=="CS"||(I[K]="ON")}ne=V;for(let K=0;K<T;K++){const G=I[K];G==="EN"?I[K]=ne==="L"?"L":"EN":G!=="R"&&G!=="L"||(ne=G)}for(let K=0;K<T;K++){if(I[K]!=="ON")continue;let G=K+1;for(;G<T&&I[G]==="ON";)G++;const X=(K>0?I[K-1]:V)!=="L"?"R":"L";if(X===((G<T?I[G]:V)!=="L"?"R":"L"))for(let be=K;be<G;be++)I[be]=X;K=G-1}for(let K=0;K<T;K++)I[K]==="ON"&&(I[K]=z);for(let K=0;K<T;K++){const G=I[K];1&F[K]?G!=="L"&&G!=="AN"&&G!=="EN"||F[K]++:G==="R"?F[K]++:G!=="AN"&&G!=="EN"||(F[K]+=2)}return F})(N);if(M===null)return null;const $=new Int8Array(v.length);for(let P=0;P<v.length;P++)$[P]=M[v[P]];return $})(e.normalized,m);return w!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:g,simpleLineWalkFastPath:h,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:x,segments:w}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:g,simpleLineWalkFastPath:h,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:x}}function vq(e,t,n){return(function(o,s,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return gq((function(c,u,d="normal",f="normal"){const g=(function(_){const w=_??"normal";return w==="pre-wrap"?{mode:w,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:w,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),h=g.mode==="pre-wrap"?(function(_){return/[\r\f]/.test(_)?_.replace(/\r\n/g,`
|
|
227
|
-
`).replace(/[\r\f]/g,`
|
|
228
|
-
`):_.replace(/\r\n/g,`
|
|
229
|
-
`)})(c):(function(_){if(!HU.test(_))return _;let w=_.replace(FU," ");return w.charCodeAt(0)===32&&(w=w.slice(1)),w.length>0&&w.charCodeAt(w.length-1)===32&&(w=w.slice(0,-1)),w})(c);if(h.length===0)return{normalized:h,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(_){if(_.len<=1)return _;const w=[],k=[],b=[],y=[];let x=null,L=!1,N=0,v=!1,M=!1;function $(){x!==null&&(w.push(Ms(x)),k.push(L),b.push("text"),y.push(N),x=null)}for(let P=0;P<_.len;P++){const T=_.texts[P],I=_.kinds[P],R=_.isWordLike[P],D=_.starts[P];if(I==="text"){const F=qU(T),z=A1(T);if(x!==null&&v&&M){x.push(T),L=L||R,v=v||F,M=z;continue}$(),x=[T],L=R,N=D,v=F,M=z;continue}$(),w.push(T),k.push(R),b.push(I),y.push(D)}return $(),{len:w.length,texts:w,isWordLike:k,kinds:b,starts:y}})(q_(h,u,g)):q_(h,u,g);return et({normalized:h,chunks:aq(m,g)},m)})(o,zh(),r?.whiteSpace,a),s,!1,a)})(e,t,0,n)}const eg="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Gn=(()=>{const e=globalThis;if(e[eg])return e[eg];const t={configs:{},controllers:{},revision:gl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[eg]=t,t})();let cc=null;const K_=Gn.revision;function G_(e){var t;return e&&(t=Gn.configs[e])!=null?t:null}function Y_(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function yq(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function tg(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!yq(i))return null;i.type==="text"?s+=String((t=i.content)!=null?t:""):i.type==="emoji"?s+=String((o=(n=i.name)!=null?n:i.raw)!=null?o:""):i.type==="hardbreak"&&(s+=`
|
|
230
|
-
`)}return s.length>0?s:null}function ng(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(cc!=null)return cc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return cc=!!((i=r.getContext)!=null&&i.call(r,"2d")),cc}catch{return cc=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Gn.blockEstimateCache.get(r);if(l)return Gn.blockEstimateCache.delete(r),Gn.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(g,h,m){const _=`${m}\0${h}\0${g}`,w=Gn.preparedCache.get(_);if(w)return Gn.preparedCache.delete(_),Gn.preparedCache.set(_,w),w.prepared;const k=vq(g,h,{whiteSpace:m});for(Gn.preparedCache.set(_,{prepared:k});Gn.preparedCache.size>240;){const b=Gn.preparedCache.keys().next().value;if(!b)break;Gn.preparedCache.delete(b)}return k})(e,n.font,a),u=(function(g,h,m){const _=(function(w,k){return w.simpleLineWalkFastPath?V_(w,k):(function(b,y){if(b.simpleLineWalkFastPath)return V_(b,y);const{widths:x,lineEndFitAdvances:L,lineEndPaintAdvances:N,kinds:v,breakableFitAdvances:M,discretionaryHyphenWidth:$,tabStopAdvance:P,chunks:T}=b;if(x.length===0||T.length===0)return 0;const I=zh(),R=I.lineFitEpsilon,D=y+R;let F=0,z=0,V=!1,ne=0,K=0,G=-1,X=0,be=0,le=null;function We(){G=-1,X=0,be=0,le=null}function ue(ee=ne,he=K,oe=z){F++,z=0,V=!1,We()}function ve(ee,he){V=!0,ne=ee+1,K=0,z=he}function Ne(ee,he,oe){V=!0,ne=ee,K=he+1,z=oe}function Re(ee,he){V?(z+=he,ne=ee+1,K=0):ve(ee,he)}function Q(ee,he,oe,fe){if(!he)return;const W=ee==="tab"?0:L[oe],Y=ee==="tab"?fe:N[oe];G=oe+1,X=z-fe+W,be=z-fe+Y,le=ee}function ce(ee,he){const oe=M[ee];for(let fe=he;fe<oe.length;fe++){const W=oe[fe];V?z+W>D?(ue(),Ne(ee,fe,W)):(z+=W,ne=ee,K=fe+1):Ne(ee,fe,W)}V&&ne===ee&&K===oe.length&&(ne=ee+1,K=0)}function Se(ee){if(le!=="soft-hyphen")return!1;const he=M[ee];if(he==null)return!1;const{fitCount:oe,fittedWidth:fe}=(function(W,Y,re,ge,xe){let $e=0,se=Y;for(;$e<W.length;){const ae=se+W[$e];if(($e+1<W.length?ae+xe:ae)>re+ge)break;se=ae,$e++}return{fitCount:$e,fittedWidth:se}})(he,z,y,R,$);return oe!==0&&(z=fe,ne=ee,K=oe,We(),oe===he.length?(ne=ee+1,K=0,!0):(ue(ee,oe,fe+$),ce(ee,oe),!0))}function q(ee){F++,We()}for(let ee=0;ee<T.length;ee++){const he=T[ee];if(he.startSegmentIndex===he.endSegmentIndex){q();continue}V=!1,z=0,he.startSegmentIndex,ne=he.startSegmentIndex,K=0,We();let oe=he.startSegmentIndex;for(;oe<he.endSegmentIndex;){const fe=v[oe],W=fe==="space"||fe==="preserved-space"||fe==="tab"||fe==="zero-width-break"||fe==="soft-hyphen",Y=fe==="tab"?hq(z,P):x[oe];if(fe!=="soft-hyphen")if(V){if(z+Y>D){const re=z+(fe==="tab"?0:L[oe]),ge=z+(fe==="tab"?Y:N[oe]);if(le==="soft-hyphen"&&I.preferEarlySoftHyphenBreak&&X<=D){ue(G,0,be);continue}if(le==="soft-hyphen"&&Se(oe)){oe++;continue}if(W&&re<=D){Re(oe,Y),ue(oe+1,0,ge),oe++;continue}if(G>=0&&X<=D){if(ne>G||ne===G&&K>0){ue();continue}const xe=G;ue(xe,0,be),oe=xe;continue}if(Y>y&&M[oe]!==null){ue(),ce(oe,0),oe++;continue}ue();continue}Re(oe,Y),Q(fe,W,oe,Y),oe++}else Y>y&&M[oe]!==null?ce(oe,0):ve(oe,Y),Q(fe,W,oe,Y),oe++;else V&&(ne=oe+1,K=0,G=oe+1,X=z+$,be=z+$,le=fe),oe++}if(V){const fe=G===he.consumedEndSegmentIndex?be:z;ue(he.consumedEndSegmentIndex,0,fe)}}return F})(w,k)})(g,h);return{lineCount:_,height:_*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Gn.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Gn.blockEstimateCache.size>4e3;){const g=Gn.blockEstimateCache.keys().next().value;if(!g)break;Gn.blockEstimateCache.delete(g)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function HA(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=tg(e.children);return i&&n.paragraph?ng(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=tg(e.children),l=n.headings[i];return r&&l?ng(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((o=i[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const r=tg((s=i[0])==null?void 0:s.children);return r?ng(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=HA(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 Sd(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function kq(e,t){var n;if(!e||e.type!=="code_block")return null;const o=t.rendererKind,s=t.showHeader!==!1,i=(function(u){var d,f,g;return u.diff?Math.max(Sd(String((d=u.originalCode)!=null?d:"")),Sd(String((f=u.updatedCode)!=null?f:"")),Sd(String((g=u.code)!=null?g:""))):Sd((function(h,m){const _=String(h??"");return m?_:_.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(o==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(g,h){const m=typeof g?.fontSize=="number"&&g.fontSize>0?g.fontSize:h?13:12;return typeof g?.lineHeight=="number"&&g.lineHeight>0?g.lineHeight:h?30:Math.round(1.5*m)})(u,r),f=(function(g,h){var m,_;if(!h)return 0;const w=typeof((m=g?.padding)==null?void 0:m.top)=="number"?g.padding.top:10,k=typeof((_=g?.padding)==null?void 0:_.bottom)=="number"?g.padding.bottom:22;return Math.max(0,w)+Math.max(0,k)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else o==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(s?40:0)),contentHeight:c,rendererKind:o}}function bq(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function og(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=Y_(o.lineHeight,1.5*Y_(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:bq(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const wq=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function X_(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))wq.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const _q=!1;function nme(){return _q}function Q_(e,t,n,o){var s;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,g){return Number.isFinite(f)?Math.min(Math.max(0,f),g):0})(n,i);if(!o.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const g=o.getNormalizedScrollTop(e,t,!1),h=Math.abs(g-r);h<u&&(u=h,c=f)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const WA=Symbol("MarkstreamMathBlockMinHeightCache");function ome(){return Bt(WA,null)}const Cq=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],Sq=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],xq=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),UA=["raw","content","code","originalCode","updatedCode"],Z_=new WeakMap,J_=new WeakMap;let Tq=1;function Us(){return typeof performance<"u"?performance.now():Date.now()}function e2(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function $s(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=Z_.get(t);return n||(n=Tq++,Z_.set(t,n)),String(n)}function t2(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:$s(t),customMarkdownIt:$s(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:$s(e.validateLink),preTransformTokens:$s(e.preTransformTokens),postTransformTokens:$s(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function n2(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
231
|
-
`,t-1)+1;return e.slice(n,t).trim()}function o2(e){const t=qA(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function qA(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function jA(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 l0(e){const t=String(e??"");return`${t.length}:${jA(t)}`}function I1(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?l0(r):`${r.length}:${jA(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${$s(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${$s(o)}`;const i=$s(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>I1(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}:${I1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Xf(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function zA(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>Xf(o)?Ar(o,t,n+1):zA(o,t,n+1)).join(",")}`:Xf(e)?Ar(e,t,n):I1(e,t,n)}function Aq(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!UA.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${l0(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${$s(s)}`:xq.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${zA(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${$s(s)}`:""}).filter(Boolean).join(";")}function Mq(e){return UA.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${l0(n)}`:""}).filter(Boolean).join(";")}function Ar(e,t=new WeakMap,n=0){const o=J_.get(e);if(o)return o;const s=e,i=t.get(s);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${$s(s)}`;const r=$s(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],g=f.length?f.slice(0,200).map(h=>Ar(h,c,u+1)).join("|"):"";return[a.type,Mq(d),Aq(d,c,u),f.length,g].join(":")})(e,t,n);return J_.set(s,l),l}function VA(e,t){return Ar(e)===Ar(t)}function a0(e,t,n){const o=Us(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Us()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function s2(e,t,n){return a0(t,n,()=>Ar(e))}function KA(e,t,n){return s2(e,n,"stabilizeSignatureMs")===s2(t,n,"stabilizeSignatureMs")}function sg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function i2(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function Eq(e,t){return e.length===t.length&&e===t}function c0(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=o[d],g=s[d];if(typeof f!=typeof g)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,g))return!1}else if(typeof g!="string"||!Eq(f,g))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,c=s.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!Xf(d)||!Xf(f))return null;const g=c0(d,f,n+1);if(g==null)return null;if(!g)return!1}return!0}function Iq(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=c0(e,t);return n??VA(e,t)}function $q(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return a0(n,"stabilizeSignatureMs",()=>{o=c0(e,t)}),o??KA(e,t,n)}function Nq(e,t){const n={};for(const o of Cq){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function Lq(e,t){var n;const o=p_(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:H(()=>!1),r=te(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,g=0,h=Us();function m(){l&&(clearTimeout(l),l=void 0)}function _(){m();const M=t.renderContent.value;r.value!==M&&(r.value=M),h=Us()}ze([t.renderContent,t.effectiveFinal,i],([M,$,P])=>{r.value!==M&&(!P||$||(function(T,I){if(!T&&I||I.length<=80||I.length<T.length||!I.startsWith(T))return!0;const R=I.slice(T.length);return!!R&&(!!o2(n2(I))||!(!R.includes(`
|
|
232
|
-
|
|
233
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(R))||R.endsWith(`
|
|
234
|
-
`)&&!(function(D){const F=n2(D);if(o2(F))return!1;const z=qA(F);return z.length>=2&&z.some(V=>V.trim())})(I))})(r.value,M)?_():(function(){if(g+=1,l)return;const T=Math.max(0,(function(I){const R=I.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(Us()-h));T<=0?_():l=setTimeout(_,T)})())},{flush:"sync",immediate:!0}),G1(m);const w=H(()=>{var M,$,P,T;return c7(e.customHtmlTags,(M=e.parseOptions)==null?void 0:M.customHtmlTags,(T=(P=($=t.customComponentsMap)==null?void 0:$.value)!=null?P:{},Object.entries(T).map(([I,R])=>{const D=Ds(I);return R==null||!D||_u(D)||bT.has(D)||ku.has(D)?"":D}).filter(Boolean)))}),k=H(()=>{const{key:M,tags:$}=u7(w.value);if(!M)return o;const P=s.get(M);if(P)return P;const T=p_(t.instanceMsgId,{customHtmlTags:$});return s.set(M,T),T}),b=H(()=>{const M=k.value;return e.customMarkdownIt?e.customMarkdownIt(M):M}),y=H(()=>{var M,$;const P=(M=e.parseOptions)!=null?M:{},T=t.effectiveFinal.value,I=w.value,R=T!=null,D=I.length>0;return R||D||P.streamParse==null?et(et(At(et({},P),{streamParse:($=P.streamParse)==null||$}),R?{final:T}:{}),D?{customHtmlTags:I}:{}):P}),x=H(()=>{var M;return new Set(((M=y.value.customHtmlTags)!=null?M:[]).map($=>String($).trim().toLowerCase()).filter(Boolean))}),L=H(()=>t2(y.value,b.value,e.customMarkdownIt,{includeFinal:!0})),N=H(()=>t2(y.value,b.value,e.customMarkdownIt,{includeFinal:!1}));ze([L,N],([M,$],[P,T])=>{P&&(M===P&&$===T||(_(),$!==T&&(a=[],d="")))},{flush:"sync"});const v=H(()=>{var M,$,P,T,I,R,D,F;if((M=e.nodes)!=null&&M.length)return a=[],d="",fr(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const V=t.debugPerformanceEnabled.value,ne=V?Us():0,K=b.value,G=L.value,X=N.value;c&&G!==c&&(function(he){var oe,fe;(fe=(oe=he.stream)==null?void 0:oe.reset)==null||fe.call(oe)})(K),u&&X!==u&&(a=[],d="");const be=a.length>0&&z.startsWith(d)&&X===u,le=V?e2(K):null,We=V?{}:void 0,ue=We?At(et({},y.value),{__timing:We}):y.value,ve=aA(z,K,ue),Ne=V?Us():0,Re=V?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Q,ce=V?sg(ve.length):void 0,Se=0,q=0;if(be){const he=V?Us():0;if(Re){const oe=(function(fe,W,Y){if(!W.length)return{nodes:fe,metrics:sg(fe.length)};const re=(function($e,se,ae){const we=Math.min($e.length,se.length);for(let qe=0;qe<we;qe++)if(!$q(se[qe],$e[qe],ae))return qe;return $e.length===se.length?-1:we})(fe,W,Y);if(re<0)return{nodes:W,metrics:{reusedNodeCount:fe.length,dirtyStartIndex:re,stablePrefixNodeCount:fe.length,dirtyTailNodeCount:0}};const ge=fe.slice();let xe=re;for(let $e=0;$e<re;$e++)ge[$e]=W[$e];for(let $e=re;$e<fe.length;$e++){const se=W[$e],ae=fe[$e];se&&KA(se,ae,Y)&&(ge[$e]=se,xe+=1)}return{nodes:ge,metrics:{reusedNodeCount:xe,dirtyStartIndex:re,stablePrefixNodeCount:re,dirtyTailNodeCount:i2(re,fe,W)}}})(ve,a,Re);Q=oe.nodes,ce=oe.metrics}else{const oe=(function(fe,W){if(!W.length)return{nodes:fe,metrics:sg(fe.length)};const Y=(function(xe,$e){const se=Math.min(xe.length,$e.length);for(let ae=0;ae<se;ae++)if(!Iq($e[ae],xe[ae]))return ae;return xe.length===$e.length?-1:se})(fe,W);if(Y<0)return{nodes:W,metrics:{reusedNodeCount:fe.length,dirtyStartIndex:Y,stablePrefixNodeCount:fe.length,dirtyTailNodeCount:0}};const re=fe.slice();let ge=Y;for(let xe=0;xe<Y;xe++)re[xe]=W[xe];for(let xe=Y;xe<fe.length;xe++){const $e=W[xe],se=fe[xe];$e&&VA($e,se)&&(re[xe]=$e,ge+=1)}return{nodes:re,metrics:{reusedNodeCount:ge,dirtyStartIndex:Y,stablePrefixNodeCount:Y,dirtyTailNodeCount:i2(Y,fe,W)}}})(ve,a);Q=oe.nodes,ce=oe.metrics}Se=V?Us()-he:0,q=ce?.dirtyStartIndex==null||ce.dirtyStartIndex<0?Q.length:ce.dirtyStartIndex}else Q=ve;Re?(function(he,oe,fe=0){for(let W=Math.max(0,fe);W<he.length;W++)a0(oe,"primeSignatureMs",()=>Ar(he[W]))})(Q,Re,q):(function(he,oe=0){for(let fe=Math.max(0,oe);fe<he.length;fe++)Ar(he[fe])})(Q,q);const ee=V?Us()-Ne:0;if(f+=1,d=z,c=G,u=X,a=Q,V){const he=e2(K),oe=typeof he?.total=="number"&&he.total>(($=le?.total)!=null?$:0);t.logPerf(oe?"parse(stream)":"parse(sync)",et(et(et({rendererId:t.instanceMsgId,ms:Math.round(Us()-ne),nodes:Q.length,contentLength:z.length,parseCommitCount:f,parseCoalescedCount:g,nodeReuseMs:ee,signatureMs:(P=Re?.signatureMs)!=null?P:0,stabilizeSignatureMs:(T=Re?.stabilizeSignatureMs)!=null?T:0,primeSignatureMs:(I=Re?.primeSignatureMs)!=null?I:0,signatureCallCount:(R=Re?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(D=Re?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(F=Re?.primeSignatureCallCount)!=null?F:0,stabilizeMs:Se},ce??{}),We?Object.fromEntries(Sq.map(fe=>{var W;return[fe,(W=We[fe])!=null?W:0]})):{}),he?{streamMode:he.lastMode,streamDelta:Nq(he,le),streamStats:he}:{}))}return fr(Q)});return{effectiveCustomHtmlTags:w,effectiveCustomHtmlTagsSet:x,mdBase:k,mdInstance:b,mergedParseOptions:y,parsedNodes:v}}function Oq(e){const{isClient:t}=e,n=te(new Set),o=new Map,s=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,g){if((m=(h=e.shouldTrackVisibleNodeIndices)==null?void 0:h.call(e))!=null&&!m)return;var h,m;const _=n.value,w=_.has(f);if(g){if(w)return;const b=new Set(_);return b.add(f),void(n.value=b)}if(!w)return;const k=new Set(_);k.delete(f),n.value=k})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,g]of s.entries())f<c||(g(),s.delete(f));for(const[f,g]of o.entries())f<c||(g.destroy(),o.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function Pq(e={}){const t=te(""),n=te(""),o=te(!1),s=YH(e),i=()=>{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},r=s.subscribe(i);i();const l=H(()=>Math.max(0,t.value.length-n.value.length)),a=H(()=>l.value===0),c=H(()=>o.value&&a.value);return K1()&&G1(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const r2=/auto|scroll|overlay/i;function Rq(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return r2.test(t)||r2.test(n)}function Dq(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 Bq=Qe({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=H(()=>{var n,o;return g1((o=oa(e.estimatedPreviewHeightPx))!=null?o:p1(String((n=e.node.code)!=null?n:"")))});return()=>Zt("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?Zt("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)"}},[Zt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Zt("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Zt("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Zt("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},()=>Zt("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,Zt("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Zt("div",{class:"absolute inset-0"},[Zt("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),Fq=Qe({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=H(()=>{var n,o;return m1((o=oa(e.estimatedPreviewHeightPx))!=null?o:h1(String((n=e.node.code)!=null?n:"")))});return()=>Zt("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?Zt("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)"}},[Zt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Zt("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Zt("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},()=>Zt("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Zt("span",{class:"action-icon block"})])))]):null,Zt("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)"}},[Zt("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"}})])])}}),Hq=["data-custom-id"],Wq={class:"m-0 p-0"},Uq=["data-probe"],qq=["data-node-index","data-node-type"],GA=Jt(Qe(At(et({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=fo(),r=Bt("markstreamNestedRendererProps",void 0);function l(A){var B,U;const j=o[A];return(function(Z){const me=i?.vnode.props;return!!me&&(Object.prototype.hasOwnProperty.call(me,Z)||Object.prototype.hasOwnProperty.call(me,String(Z).replace(/[A-Z]/g,ye=>`-${ye.toLowerCase()}`)))})(A)?j:(U=(B=r?.value)==null?void 0:B[A])!=null?U:j}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=H(()=>{return(A=l("mode"))==="chat"||A==="minimal"||A==="docs"?A:"docs";var A}),u=H(()=>{const A=l("renderCodeBlocksAsPre"),B=l("codeRenderer");return A===!0?"pre":B==="pre"||B==="shiki"||B==="monaco"?B:A===!1||c.value==="docs"?"monaco":"pre"}),d=H(()=>a[c.value]),f=H(()=>{var A;return(A=l("showTooltips"))!=null?A:d.value.showTooltips}),g=H(()=>{var A;return(A=l("fade"))!=null?A:d.value.fade}),h=H(()=>{var A;return(A=l("batchRendering"))!=null?A:d.value.batchRendering}),m=H(()=>{var A;return(A=l("initialRenderBatchSize"))!=null?A:d.value.initialRenderBatchSize}),_=H(()=>{var A;return(A=l("renderBatchSize"))!=null?A:d.value.renderBatchSize}),w=H(()=>{var A;return(A=l("renderBatchDelay"))!=null?A:d.value.renderBatchDelay}),k=H(()=>{var A;return(A=l("renderBatchBudgetMs"))!=null?A:d.value.renderBatchBudgetMs}),b=H(()=>{var A;return(A=l("renderBatchIdleTimeoutMs"))!=null?A:d.value.renderBatchIdleTimeoutMs}),y=H(()=>{var A;return(A=l("deferNodesUntilVisible"))!=null?A:d.value.deferNodesUntilVisible}),x=H(()=>{var A;return(A=l("maxLiveNodes"))!=null?A:d.value.maxLiveNodes}),L=H(()=>{var A;return(A=l("liveNodeBuffer"))!=null?A:d.value.liveNodeBuffer}),N=H(()=>{var A;return(A=l("nodeVirtual"))!=null?A:d.value.nodeVirtual}),v={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return o.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return g.value},get batchRendering(){return h.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return _.value},get renderBatchDelay(){return w.value},get renderBatchBudgetMs(){return k.value},get renderBatchIdleTimeoutMs(){return b.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return x.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return N.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function M(A){s("height-change",A)}function $(A){s("virtual-state-change",A)}function P(A){s("anchor-change",A)}const T=te(),I=te(null),R=te(null),D=te(null),F=as({1:null,2:null,3:null,4:null,5:null,6:null}),z=te(!1),V=new Map,ne=te(0),K=te(0),G=te({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function X(){var A,B;if(((A=o.virtualScroll)==null?void 0:A.enabled)!==!0)return null;const U=(B=o.virtualScroll)==null?void 0:B.scrollRoot;return be(typeof U=="function"?U():U)}function be(A){return A?typeof HTMLElement<"u"&&A instanceof HTMLElement?A:typeof A=="object"&&"value"in A?be(A.value):typeof A=="object"&&"$el"in A?be(A.$el):null:null}const{isClient:le,renderAsFragment:We,debugPerformanceEnabled:ue,resolvedShowTooltips:ve,resolvedHtmlPolicy:Ne,inheritedSmoothStreaming:Re,ownsTypewriterCursor:Q}=(function(A){const B=typeof window<"u",U=mu(),j=Bt("markstreamHtmlPolicy",void 0),Z=Bt("markstreamTypewriterCursor",void 0),me=Bt("markstreamSmoothStreaming",void 0),ye=H(()=>A.renderAsFragment===!0),_e=H(()=>!!(A.debugPerformance&&B&&typeof console<"u")),De=H(()=>{var Be;if(typeof A.showTooltips=="boolean")return A.showTooltips;const Ee=(Be=U.showTooltips)!=null?Be:U["show-tooltips"];return Ee===""||Ee===!0||Ee==="true"||Ee!==!1&&Ee!=="false"&&void 0}),Ae=H(()=>{var Be,Ee;return(Ee=(Be=A.htmlPolicy)!=null?Be:j?.value)!=null?Ee:"safe"}),Ue=H(()=>Z?.value!==!0);return{isClient:B,renderAsFragment:ye,debugPerformanceEnabled:_e,resolvedShowTooltips:De,resolvedHtmlPolicy:Ae,inheritedSmoothStreaming:me,inheritedTypewriterCursor:Z,ownsTypewriterCursor:Ue}})(v),{resolveViewportRoot:ce,resolveScrollContainer:Se,isReverseFlexScrollRoot:q,getNormalizedScrollTop:ee,getOffsetTopWithinRoot:he}=(function(A,B){function U(){var _e,De;return(De=(_e=B.scrollRoot)==null?void 0:_e.call(B))!=null?De:null}function j(_e){if(typeof window>"u")return null;const De=U();if(De)return De;const Ae=_e??A.value;if(!Ae)return null;const Ue=Ae.ownerDocument||document,Be=Ue.scrollingElement||Ue.documentElement;let Ee=Ae;for(;Ee&&Ee!==Ue.body&&Ee!==Be;){if(Rq(window.getComputedStyle(Ee))&&Dq(Ee))return Ee;Ee=Ee.parentElement}return null}function Z(_e){if(!B.isClient)return!1;try{const De=window.getComputedStyle(_e);return!!(De.display||"").toLowerCase().includes("flex")&&(De.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function me(_e,De,Ae){var Ue,Be;if(Ae)return ye(De);const Ee=_e.scrollTop;if(!Z(_e))return Ee;const He=Ee<0?-Ee:Ee;return Math.max(0,((Ue=_e.scrollHeight)!=null?Ue:0)-((Be=_e.clientHeight)!=null?Be:0))-He}function ye(_e){var De,Ae,Ue,Be,Ee;const He=Number((De=_e.scrollingElement)==null?void 0:De.scrollTop),Ke=Number((Ue=(Ae=_e.documentElement)==null?void 0:Ae.scrollTop)!=null?Ue:0),Ge=Number((Ee=(Be=_e.body)==null?void 0:Be.scrollTop)!=null?Ee:0);return Math.max(0,Number.isFinite(He)?He:0,Number.isFinite(Ke)?Ke:0,Number.isFinite(Ge)?Ge:0)}return{resolveViewportRoot:j,resolveScrollContainer:function(_e){var De,Ae,Ue,Be;const Ee=U();if(Ee)return Ee;const He=j((De=_e??A.value)!=null?De:null);if(He)return He;const Ke=(Be=(Ue=_e?.ownerDocument)!=null?Ue:(Ae=A.value)==null?void 0:Ae.ownerDocument)!=null?Be:typeof document<"u"?document:null;return Ke?.scrollingElement||Ke?.documentElement||null},isReverseFlexScrollRoot:Z,getNormalizedScrollTop:me,getOffsetTopWithinRoot:function(_e,De){const Ae=De.ownerDocument||_e.ownerDocument||document;if((function(He,Ke){return He===Ke.documentElement||He===Ke.body||He===Ke.scrollingElement})(De,Ae))return _e.getBoundingClientRect().top+ye(Ae);const Ue=De.getBoundingClientRect(),Be=_e.getBoundingClientRect(),Ee=me(De,Ae,!1);return Be.top-Ue.top+Ee}}})(T,{isClient:le,scrollRoot:X});yn("markstreamShowTooltips",ve),yn("markstreamHtmlPolicy",Ne),yn("markstreamTypewriter",H(()=>v.typewriter!==!1)),yn("markstreamFade",H(()=>v.fade!==!1)),yn("markstreamTypewriterCursor",H(()=>!0)),yn("markstreamTextStreamState",V),yn("markstreamStreamVersion",ne),yn("markstreamParseOptions",H(()=>v.parseOptions)),yn("markstreamCustomMarkdownIt",H(()=>v.customMarkdownIt));const{smoothStreamingEnabled:oe,renderContent:fe,effectiveFinal:W}=(function(A,B){const U=Pq(A.smoothStreamingOptions),j=H(()=>{var Ae,Ue,Be;return A.smoothStreaming!==!1&&!((Ae=A.nodes)!=null&&Ae.length)&&(A.smoothStreaming===!0||!((Ue=B.inheritedSmoothStreaming)!=null&&Ue.value))&&(A.smoothStreaming===!0||A.typewriter===!0||((Be=A.maxLiveNodes)!=null?Be:0)<=0)}),Z=te(!B.isClient||A.smoothStreaming===!0);rn(()=>{Z.value=!0});const me=H(()=>Z.value&&j.value),ye=H(()=>{var Ae;return me.value?U.visible.value:(Ae=A.content)!=null?Ae:""}),_e=H(()=>{var Ae,Ue;const Be=(Ae=A.parseOptions)!=null?Ae:{};return(Ue=A.final)!=null?Ue:Be.final}),De=H(()=>{const Ae=_e.value;return me.value&&Ae!=null?!!Ae&&U.caughtUp.value:Ae});return ze([()=>A.content,()=>A.nodes,me,_e],([Ae,Ue,Be,Ee])=>{if(Ue?.length)return void U.reset("");const He=Ae??"";if(!Be)return U.reset(He),void(Ee&&U.finish({flush:!0}));const Ke=U.source.value;He?He===Ke||(He.startsWith(Ke)?U.enqueue(He.slice(Ke.length)):U.reset(He)):U.reset(""),Ee&&U.finish()},{immediate:!0}),{smoothStream:U,smoothStreamingEligible:j,smoothStreamingEnabled:me,renderContent:ye,requestedFinal:_e,effectiveFinal:De}})(v,{isClient:le,inheritedSmoothStreaming:Re});yn("markstreamSmoothStreaming",oe);const Y=te(!1);let re="",ge=!1,xe=null;function $e(){le&&xe!=null&&(window.clearTimeout(xe),xe=null)}function se(){Y.value=!1,$e()}function ae(A,B){if(!ue.value)return;const U=(function(){if(!ue.value)return null;const j=_t(we),Z=_t(qe),me=Math.max(at,Z);if(j<=0&&me<=0)return null;const ye={total:j,maxPerFrame:me,byLabel:(_e=we,Object.fromEntries(Array.from(_e.entries()).sort((De,Ae)=>Ae[1]-De[1]||De[0].localeCompare(Ae[0]))))};var _e;return we.clear(),qe.clear(),at=0,ye})();console.info(`[markstream-vue][perf] ${A}`,U?At(et({},B),{layoutReads:U}):B)}ze([fe,()=>o.nodes,W],([A,B,U])=>{const j=A??"";return B?.length||U===!0?(se(),re=j,void(ge=!0)):ge?(re&&j.length>re.length&&j.startsWith(re)?(Y.value=!0,le&&($e(),xe=window.setTimeout(()=>{var Z;xe=null,W.value===!0||(Z=o.nodes)!=null&&Z.length||(Nl(),Y.value=!1,vi())},1200))):(j.length<re.length||!j.startsWith(re))&&se(),void(re=j)):(re=j,void(ge=!0))},{flush:"sync",immediate:!0});const we=new Map,qe=new Map;let nt=!1,at=0;function _t(A){let B=0;for(const U of A.values())B+=U;return B}function $t(){at=Math.max(at,_t(qe)),qe.clear(),nt=!1}function lt(A,B){return(function(U){var j,Z;ue.value&&(we.set(U,((j=we.get(U))!=null?j:0)+1),qe.set(U,((Z=qe.get(U))!=null?Z:0)+1),nt||(nt=!0,le&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame($t):typeof queueMicrotask!="function"?setTimeout($t,0):queueMicrotask($t)))})(A),B()}const Rt=v.customId?`renderer-${v.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,fn=(function(A){const B=new Map;return{scope:A,cache:B,clear:()=>B.clear()}})(Rt),An=H(()=>`${Rt}:${ne.value}`);yn(WA,fn);const Nt=qn(()=>v.customId),{effectiveCustomHtmlTagsSet:Ft,mergedParseOptions:jn,parsedNodes:Je}=Lq(v,{instanceMsgId:Rt,renderContent:fe,effectiveFinal:W,smoothStreamingEnabled:oe,debugPerformanceEnabled:ue,customComponentsMap:Nt,logPerf:ae});ze(Je,()=>{fn.clear(),ne.value+=1},{immediate:!0});const Qn=H(()=>({customId:v.customId,customHtmlTags:jn.value.customHtmlTags,parseOptions:v.parseOptions,customMarkdownIt:v.customMarkdownIt,htmlPolicy:Ne.value,viewportPriority:v.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:v.codeBlockStream,codeBlockDarkTheme:v.codeBlockDarkTheme,codeBlockLightTheme:v.codeBlockLightTheme,codeBlockMonacoOptions:v.codeBlockMonacoOptions,renderCodeBlocksAsPre:v.renderCodeBlocksAsPre,codeBlockMinWidth:v.codeBlockMinWidth,codeBlockMaxWidth:v.codeBlockMaxWidth,codeBlockProps:v.codeBlockProps,mermaidProps:v.mermaidProps,d2Props:v.d2Props,infographicProps:v.infographicProps,showTooltips:ve.value,themes:v.themes,langs:v.langs,isDark:v.isDark,typewriter:v.typewriter,smoothStreamingOptions:v.smoothStreamingOptions,parseCoalesceMs:v.parseCoalesceMs,fade:v.fade}));yn("markstreamNestedRendererProps",Qn);const Xo=H(()=>Je.value),Oo=H(()=>Je.value.length),ho=te(null),Nn=te(null),cn=te(null),wn=te(null),On=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),zn=!On&&v.customId?G_(v.customId):null,Zn=H(()=>zn?(K_.value,G_(v.customId)):null),Co=H(()=>{var A;return!!(le&&!We.value&&v.customId&&!On&&((A=Zn.value)!=null&&A.enabled))}),po=H(()=>{var A;return!!(!We.value&&((A=o.virtualScroll)!=null&&A.enabled))}),Po=te(!1);rn(()=>{Po.value=!0});const Tt=H(()=>!!(le&&po.value));yn("markstreamHostScrollManaged",Tt);const io=H(()=>!!(Po.value&&Tt.value)),nn=H(()=>Co.value||Tt.value),Ro=H(()=>Co.value||io.value),Qo=H(()=>{var A;return nn.value&&((A=Zn.value)==null?void 0:A.textEstimation)!==!1}),Jn=H(()=>{var A;return nn.value&&((A=Zn.value)==null?void 0:A.codeBlockEstimation)!==!1});function Ye(){const A=K.value||lt("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=T.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(A)&&A>0?A:0}const je=H(()=>{const A=Ye();return A>0?Math.max(1,Math.round(A)):640}),tt=H(()=>{var A;return Math.max(1,(A=v.maxLiveNodes)!=null?A:320)}),it=H(()=>{var A;return!We.value&&v.nodeVirtual!==!1&&!(((A=v.maxLiveNodes)!=null?A:0)<=0)&&(v.nodeVirtual===!0?Je.value.length>0:Je.value.length>tt.value)}),Ie=H(()=>it.value||Co.value||Tt.value),ke=H(()=>v.viewportPriority!==!1&&!z.value),Fe=wU(A=>{var B;return ce((B=A??T.value)!=null?B:null)},ke),{requestFrame:Ct,cancelFrame:St,hasIdleCallback:mn,isTestEnv:gn}=(function(A){const B=A.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,U=A.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,j=A.isClient&&typeof window.requestIdleCallback=="function",Z=(function(){var me;if(typeof globalThis>"u"||!("process"in globalThis))return;const ye=(me=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:me.value;return ye?.env})();return{requestFrame:B,cancelFrame:U,hasIdleCallback:j,isTestEnv:Z?.NODE_ENV==="test"}})({isClient:le}),{resolvedBatchSize:ys,resolvedInitialBatch:Zo,batchingEnabled:Ui,incrementalRenderingActive:fi,renderedCount:Vn,previousRenderContext:hi,adaptiveBatchSize:de,previousBatchConfig:Te}=(function(A,B){var U;const j=H(()=>{var Be;const Ee=Math.trunc((Be=A.renderBatchSize)!=null?Be:80);return Number.isFinite(Ee)?Math.max(0,Ee):0}),Z=H(()=>{var Be;const Ee=Math.trunc((Be=A.initialRenderBatchSize)!=null?Be:j.value);return Number.isFinite(Ee)?Math.max(0,Ee):j.value}),me=H(()=>!B.renderAsFragment.value&&A.batchRendering!==!1&&j.value>0&&B.isClient&&!B.isTestEnv),ye=te(0),_e=te({key:A.indexKey,total:0}),De=te(Math.max(1,j.value||1)),Ae=H(()=>{var Be;return me.value&&((Be=A.maxLiveNodes)!=null?Be:0)<=0}),Ue=te({batchSize:j.value,initial:Z.value,delay:(U=A.renderBatchDelay)!=null?U:16,enabled:Ae.value});return{resolvedBatchSize:j,resolvedInitialBatch:Z,batchingEnabled:me,incrementalRenderingActive:Ae,renderedCount:ye,previousRenderContext:_e,adaptiveBatchSize:De,previousBatchConfig:Ue}})(v,{isClient:le,isTestEnv:gn,renderAsFragment:We}),Le=new Map,Me=new Map,J=new WeakMap;let pe=null;const kt=new WeakMap,Lt=new Map,eo=te(0),Bs=H(()=>(eo.value,Array.from(Le.entries()).sort((A,B)=>A[0]-B[0]))),hn=te(null),Ot=te(null);let pn=null,pi=0,Fs=null;const{activeRestoreAnchor:ks,getRelativeScrollTopWithinContainer:bl,setRelativeScrollTopWithinContainer:wl,resolveAnchorOffset:sp,clearRestoreReconcile:Tu,scheduleRestoreReconcile:Oa,captureRestoreAnchor:T0,restoreAnchor:A0,getAnchorDrift:lM}=(function(A){const{isClient:B,containerRef:U,parsedNodeCount:j,requestFrame:Z,cancelFrame:me,resolveScrollContainer:ye,getNormalizedScrollTop:_e,getOffsetTopWithinRoot:De,isReverseFlexScrollRoot:Ae,estimateIndexForOffset:Ue,estimateHeightRange:Be,getFallbackNodeHeight:Ee,clamp:He}=A,Ke=te(null);let Ge=null,pt=[];function ot(){const yt=ye(),It=U.value;if(!yt||!It)return null;const Et=yt.ownerDocument||It.ownerDocument||document;if(yt===Et.documentElement||yt===Et.body||yt===Et.scrollingElement){const Xt=It.getBoundingClientRect();return Math.max(0,-Xt.top)}return Math.max(0,_e(yt,Et,!1)-De(It,yt))}function st(yt){var It;const Et=ye(),Xt=U.value;if(!Et||!Xt)return;const ns=Math.max(0,yt),So=Et.ownerDocument||Xt.ownerDocument||document,Hs=So.defaultView||(typeof window<"u"?window:null);if(Et===So.documentElement||Et===So.body||Et===So.scrollingElement){const Gi=_e(Et,So,!0)+Xt.getBoundingClientRect().top;return void((It=Hs?.scrollTo)==null||It.call(Hs,0,Math.max(0,Gi+ns)))}Q_(Et,So,De(Xt,Et)+ns,{isReverseFlexScrollRoot:Gi=>{var Yi;return(Yi=Ae?.(Gi))!=null&&Yi},getNormalizedScrollTop:_e})}function gt(yt){const It=j.value,Et=He(yt.nodeIndex,0,Math.max(0,It-1));return Be(0,Et)+Math.max(0,yt.offsetWithinNodePx)}function mt(){if(Ge!=null&&(me?.(Ge),Ge=null),B)for(const yt of pt)window.clearTimeout(yt);pt=[]}function Ut(yt){const It=gt(yt),Et=ot();Et!=null&&Math.abs(Et-It)<=.5||st(It)}return{activeRestoreAnchor:Ke,getRelativeScrollTopWithinContainer:ot,setRelativeScrollTopWithinContainer:st,resolveAnchorOffset:gt,clearRestoreReconcile:mt,applyRestoreAnchor:Ut,scheduleRestoreReconcile:function(){Ke.value&&B&&Ge==null&&(Ge=Z?Z(()=>{Ge=null,Ke.value&&Ut(Ke.value)}):null,Ge==null&&Ke.value&&Ut(Ke.value))},captureRestoreAnchor:function(){const yt=ot(),It=j.value;if(yt==null||It<=0)return null;const Et=He(Ue(yt+1),0,It-1),Xt=Be(0,Et),ns=Ee(Et);return{nodeIndex:Et,offsetWithinNodePx:He(yt-Xt,0,Math.max(0,ns-1))}},restoreAnchor:function(yt){const It=j.value;if(Ke.value={nodeIndex:He(yt.nodeIndex,0,Math.max(0,It-1)),offsetWithinNodePx:Math.max(0,yt.offsetWithinNodePx)},mt(),Ut(Ke.value),B)for(const Et of[0,120,280,480])pt.push(window.setTimeout(()=>{Ke.value&&Ut(Ke.value)},Et))},getAnchorDrift:function(yt){const It=ot();return It==null?null:It-gt(yt)}}})({isClient:le,containerRef:T,parsedNodeCount:Oo,requestFrame:Ct,cancelFrame:St,resolveScrollContainer:()=>hn.value||Se(),getNormalizedScrollTop:ee,getOffsetTopWithinRoot:he,isReverseFlexScrollRoot:q,estimateIndexForOffset:qp,estimateHeightRange:Ki,getFallbackNodeHeight:Ru,clamp:lo}),{nodeHeights:bs,heightStats:ws,heightTreeSize:Pa,heightSumTree:ip,heightKnownTree:rp,averageNodeHeight:Xs,resetHeightMeasurements:aM,pruneHeightMeasurements:cM,rebuildHeightTrees:Au,recordNodeHeight:uM,removeNodeHeights:dM,exportHeightCache:fM,importHeightCache:hM,fenwickRangeSum:Mu}=(function(A={}){const B=as({}),U=as({total:0,count:0}),j=te(0),Z=te([]),me=te([]);function ye(){for(const Ee of Object.keys(B))delete B[Number(Ee)];U.total=0,U.count=0,j.value=0,Z.value=[],me.value=[]}function _e(Ee,He,Ke){for(let Ge=He+1;Ge<Ee.length;Ge+=Ge&-Ge)Ee[Ge]+=Ke}function De(Ee,He){let Ke=0;for(let Ge=He+1;Ge>0;Ge-=Ge&-Ge)Ke+=Ee[Ge];return Ke}function Ae(Ee){j.value=Ee;const He=new Array(Ee+1).fill(0),Ke=new Array(Ee+1).fill(0);for(const[Ge,pt]of Object.entries(B)){const ot=Number(Ge),st=Number(pt);!Number.isFinite(ot)||ot<0||ot>=Ee||!Number.isFinite(st)||st<=0||(_e(He,ot,st),_e(Ke,ot,1))}Z.value=He,me.value=Ke}function Ue(Ee){if(!Number.isInteger(Ee)||Ee<0)return!1;const He=B[Ee];if(!Number.isFinite(He)||He<=0)return!1;if(delete B[Ee],U.total=Math.max(0,U.total-He),U.count=Math.max(0,U.count-1),j.value>Ee){const Ke=Z.value,Ge=me.value;Ke.length&&Ge.length&&(_e(Ke,Ee,-He),_e(Ge,Ee,-1))}return!0}const Be=H(()=>U.count>0?Math.max(12,U.total/U.count):32);return{nodeHeights:B,heightStats:U,heightTreeSize:j,heightSumTree:Z,heightKnownTree:me,averageNodeHeight:Be,resetHeightMeasurements:ye,pruneHeightMeasurements:function(Ee){if(Ee<=0)return void ye();let He=0,Ke=0;for(const[Ge,pt]of Object.entries(B)){const ot=Number(Ge),st=Number(pt);!Number.isFinite(ot)||ot<0||ot>=Ee||!Number.isFinite(st)||st<=0?delete B[ot]:(He+=st,Ke++)}U.total=He,U.count=Ke},rebuildHeightTrees:Ae,recordNodeHeight:function(Ee,He,Ke={}){(function(Ge,pt,ot={}){var st;if(!Number.isFinite(pt)||pt<=0)return!1;const gt=B[Ge];if(gt&&(ot.allowShrink===!1&&pt<gt||Math.abs(pt-gt)<=1))return!1;if(B[Ge]=pt,gt?U.total+=pt-gt:(U.total+=pt,U.count++),j.value>Ge){const mt=Z.value,Ut=me.value;if(mt.length&&Ut.length)if(gt){const yt=pt-gt;yt!==0&&_e(mt,Ge,yt)}else _e(mt,Ge,pt),_e(Ut,Ge,1)}ot.notify!==!1&&((st=A.onHeightRecorded)==null||st.call(A))})(Ee,He,At(et({},Ke),{notify:!0}))},removeNodeHeight:function(Ee,He={}){var Ke;const Ge=Ue(Ee);return Ge&&He.notify!==!1&&((Ke=A.onHeightRecorded)==null||Ke.call(A)),Ge},removeNodeHeights:function(Ee,He={}){var Ke;let Ge=0;for(const pt of Ee)Ue(Number(pt))&&Ge++;return Ge>0&&He.notify!==!1&&((Ke=A.onHeightRecorded)==null||Ke.call(A)),Ge},exportHeightCache:function(){return Object.entries(B).map(([Ee,He])=>({index:Number(Ee),height:Number(He)})).filter(Ee=>Number.isFinite(Ee.index)&&Ee.index>=0&&Number.isFinite(Ee.height)&&Ee.height>0).sort((Ee,He)=>Ee.index-He.index)},importHeightCache:function(Ee,He={}){var Ke;if(!Array.isArray(Ee))return;const Ge=j.value;let pt=!1;if(He.mode!=="merge"){const ot=Object.keys(B);if(ot.length>0){for(const st of ot)delete B[Number(st)];pt=!0}}for(const ot of Ee){const st=Number(ot.index),gt=Number(ot.height);if(!Number.isInteger(st)||st<0||Ge>0&&st>=Ge||!Number.isFinite(gt)||gt<=0)continue;const mt=B[st];mt&&Math.abs(mt-gt)<=1||(B[st]=gt,pt=!0)}pt&&((function(){let ot=0,st=0;const gt=j.value;for(const[mt,Ut]of Object.entries(B)){const yt=Number(mt),It=Number(Ut);!Number.isFinite(yt)||yt<0||gt>0&&yt>=gt||!Number.isFinite(It)||It<=0?delete B[yt]:(ot+=It,st++)}U.total=ot,U.count=st})(),Ge>0&&Ae(Ge),(Ke=A.onHeightRecorded)==null||Ke.call(A))},fenwickRangeSum:function(Ee,He,Ke){if(Ke<=He)return 0;const Ge=De(Ee,Ke-1);return He<=0?Ge:Ge-De(Ee,He-1)}}})({onHeightRecorded:()=>{Cs(),Tt.value&&Qa(),ks.value&&Oa(),Ot.value&&El(),un("node-resize")}});function Eu(){aM(),Lt.clear()}function M0(A){!Number.isInteger(A)||A<0||A>=Je.value.length||Lt.set(A,Ha(A))}function E0(A,B,U={}){const j=bs[A];uM(A,B,U);const Z=bs[A];Z&&Z>0?M0(A):j&&Lt.delete(A)}function I0(A,B){const U=lt("getNodeLayoutHeight.slot.offsetHeight",()=>{var j,Z;return(Z=(j=Le.get(A))==null?void 0:j.offsetHeight)!=null?Z:0});return U>0?U:lt("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function $0(A,B={}){hM(A,B),Op()}const qi=H(()=>{var A;return!We.value&&v.deferNodesUntilVisible!==!1&&!(((A=v.maxLiveNodes)!=null?A:0)<=0)&&!it.value&&!(Je.value.length>900)&&ke.value}),N0=H(()=>!!Fe&&(qi.value||it.value)),L0=H(()=>it.value||Tt.value),{liveNodeBufferResolved:Ra,focusIndex:_s,liveRange:ro,updateLiveRange:Lr}=(function(A,B){const{parsedNodeCount:U,virtualizationEnabled:j,maxLiveNodesResolved:Z,clamp:me}=B,ye=H(()=>{var Ae;return Math.max(0,(Ae=A.liveNodeBuffer)!=null?Ae:60)}),_e=te(0),De=as({start:0,end:0});return{liveNodeBufferResolved:ye,focusIndex:_e,liveRange:De,updateLiveRange:function(){const Ae=U.value;if(!j.value||Ae===0)return De.start=0,void(De.end=Ae);const Ue=Math.min(Z.value,Ae),Be=ye.value,Ee=me(_e.value-Be,0,Math.max(0,Ae-Ue));De.start=Ee,De.end=Math.min(Ae,Ee+Ue)}}})(v,{parsedNodeCount:Oo,virtualizationEnabled:it,maxLiveNodesResolved:tt,clamp:lo}),Qs=new Map,Or=new Map,ji=new Map,Iu=[],mi=new Map,zi=new Set,O0=te(0);let lp=!1;const P0=H(()=>(O0.value,zi.size)),Jo=new Map,Zs=new Map,R0=te(0),ap=H(()=>{R0.value;let A=0;for(const B of Jo.values())A+=Math.max(0,B);return A});let es=null,cp=!0,D0=[0],B0="";function Cs(){cp=!0}const $u=H(()=>{if(!it.value)return Je.value.length;const A=Ra.value,B=Math.max(ro.end+A,Zo.value),U=Math.min(Je.value.length,B);return Math.max(Vn.value,U)});function Nu(){lp||(lp=!0,queueMicrotask(()=>{lp=!1,O0.value+=1}))}function F0(A,B,U="node-resize"){if(!le||typeof window>"u")return null;const j=window.setTimeout(()=>{zi.delete(j)&&Nu();try{B()}finally{un(U)}},Math.max(0,A));return zi.add(j),Nu(),j}function Lu(A){le&&A!=null&&(zi.delete(A)&&Nu(),window.clearTimeout(A))}function H0(){if(le&&typeof window<"u")for(const A of zi)window.clearTimeout(A);zi.size&&(zi.clear(),Nu()),Iu.length=0,ji.clear()}function pM(A){var B,U;return(U=(B=wn.value)==null?void 0:B[A])!=null?U:null}const{cancelScheduledFocusSync:up,scheduleFocusSync:Js}=(function(A){const{isClient:B,containerRef:U,virtualizationEnabled:j,requestFrame:Z,cancelFrame:me,syncFocusToScroll:ye}=A;let _e=null;function De(){var Ue,Be,Ee;return(Ee=(Be=(Ue=U.value)==null?void 0:Ue.ownerDocument)==null?void 0:Be.defaultView)!=null?Ee:typeof window<"u"?window:null}function Ae(){if(!_e)return;const Ue=De();_e.viaTimeout?Ue?Ue.clearTimeout(_e.id):clearTimeout(_e.id):me?.(_e.id),_e=null}return{cancelScheduledFocusSync:Ae,scheduleFocusSync:function(Ue={}){if(!j.value)return;if(!B)return void ye(!0);if(Ue.immediate)return Ae(),void ye(!0);if(_e)return;const Be=()=>{_e=null,ye()};if(Z)return void(_e={id:Z(Be),viaTimeout:!1});const Ee=De();_e={id:Ee?Ee.setTimeout(Be,16):setTimeout(Be,16),viaTimeout:!0}}}})({isClient:le,containerRef:T,virtualizationEnabled:it,requestFrame:Ct,cancelFrame:St,syncFocusToScroll:function(A=!1){var B;if(!it.value)return;const U=hn.value||Se();if(!U)return;const j=U.ownerDocument||((B=T.value)==null?void 0:B.ownerDocument)||document,Z=j?.defaultView||(typeof window<"u"?window:null),me=U===j?.documentElement||U===j?.body,ye=Je.value.length;if(!me&&ye>0&&q(U)){const Ke=lt("syncFocusToScroll.clientHeight",()=>U.clientHeight||0),Ge=lt("syncFocusToScroll.scrollTop",()=>U.scrollTop),pt=Ge<0?-Ge:Ge,ot=(function(gt){var mt,Ut;const yt=Je.value;if(!yt.length)return 0;if(gt<=0)return Math.max(0,yt.length-1);if(nn.value){const Et=(mt=mp()[yt.length])!=null?mt:0;return G0(Math.max(0,Et-gt))}if(Pa.value===yt.length){const Et=Ki(0,yt.length);return qp(Math.max(0,Et-gt))}let It=gt;for(let Et=yt.length-1;Et>=0;Et--){const Xt=(Ut=bs[Et])!=null?Ut:Xs.value;if(It<=Xt)return Et;It-=Xt}return 0})(Math.max(0,pt)+.5*Math.max(0,Ke)),st=lo(ot,0,Math.max(0,ye-1));return void((A||Math.abs(st-_s.value)>1)&&(_s.value=st,Lr()))}const _e=me?null:lt("syncFocusToScroll.root.getBoundingClientRect",()=>U.getBoundingClientRect()),De=me?0:_e.top,Ae=me?lt("syncFocusToScroll.viewport.clientHeight",()=>{var Ke,Ge;return(Ge=(Ke=Z?.innerHeight)!=null?Ke:U.clientHeight)!=null?Ge:0}):_e.bottom,Ue=Bs.value;let Be=null,Ee=null;for(const[Ke,Ge]of Ue){if(!Ge)continue;const pt=lt("syncFocusToScroll.slot.getBoundingClientRect",()=>Ge.getBoundingClientRect());pt.bottom<=De||pt.top>=Ae||(Be==null&&(Be=Ke),Ee=Ke)}if(Be==null||Ee==null){const Ke=T.value;if(!Ke)return;const Ge=me?{top:0}:lt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>U.getBoundingClientRect()),pt=lt("syncFocusToScroll.fallback.scrollTop",()=>ee(U,j,me)),ot=me?(()=>{const mt=lt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Ke.getBoundingClientRect()),Ut=(me?0:Ge.top)-mt.top;return Math.max(0,Ut)})():(()=>{const mt=he(Ke,U);return Math.max(0,pt-mt)})(),st=me?lt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var mt,Ut,yt,It;return(It=(yt=(Ut=Z?.innerHeight)!=null?Ut:(mt=j?.documentElement)==null?void 0:mt.clientHeight)!=null?yt:U.clientHeight)!=null?It:0}):lt("syncFocusToScroll.fallback.root.clientHeight",()=>U.clientHeight),gt=qp(ot+.5*Math.max(0,st));return _s.value=lo(gt,0,Math.max(0,Je.value.length-1)),void Lr()}const He=Math.round((Be+Ee)/2);!A&&Math.abs(He-_s.value)<=1||(_s.value=lo(He,0,Math.max(0,Je.value.length-1)),Lr())}}),{visibleNodeIndices:dp,nodeVisibilityHandles:_l,nodeVisibilityWatchStops:Ou,nodeVisibilityFallbackTimers:W0,clearVisibilityFallback:Pu,markNodeVisible:Vi,cleanupNodeVisibility:mM,destroyNodeVisibilityState:fp}=Oq({isClient:le,shouldTrackVisibleNodeIndices:()=>qi.value,shouldCleanupNodeVisibility:()=>it.value,onNodeMarkedVisible:A=>{it.value?Js():_s.value=lo(A,0,Math.max(0,Je.value.length-1))},onNodeVisibilityCleaned:A=>{Le.delete(A)&&gy()}}),{cleanupScrollListener:U0,setupScrollListener:gM}=(function(A){const{isClient:B,virtualizationEnabled:U,listenerEnabled:j,scrollRootElement:Z,resolveScrollContainer:me,scheduleFocusSync:ye,onScroll:_e}=A;let De=null,Ae=null;function Ue(){De&&(De(),De=null),Ae=null,Z.value=null}function Be(Ee){const He=A.getScrollTop?A.getScrollTop(Ee):Ee.scrollTop;return Math.max(0,Number.isFinite(He)?Math.abs(He):0)}return{cleanupScrollListener:Ue,setupScrollListener:function(){if(!B)return;if(!((Ee=j?.value)!=null?Ee:U.value))return void Ue();var Ee;const He=me();if(!He)return void Ue();if(Z.value===He&&De)return;Ue(),Ae=Be(He);const Ke=()=>{if(_e?.(),U.value){const Ge=(function(pt){const ot=Be(pt),st=Ae;Ae=ot;const gt=Math.max(480,.75*(pt.clientHeight||0));return st==null?ot>gt?{immediate:!0}:void 0:Math.abs(ot-st)>gt?{immediate:!0}:void 0})(He);Ge?ye(Ge):ye()}};He.addEventListener("scroll",Ke,{passive:!0}),Z.value=He,De=()=>{He.removeEventListener("scroll",Ke)}}}})({isClient:le,virtualizationEnabled:it,listenerEnabled:L0,scrollRootElement:hn,resolveScrollContainer:Se,scheduleFocusSync:Js,onScroll:function(){const A=Ot.value;if(!A)return;const B=Fa();if(!B||(function(j){if(za()>=pi)return Fs=null,!1;const Z=Fs;if(Z==null)return!0;const me=Math.abs(j.scrollTop-Z)<=2;return me||(Fs=null),me})(B))return;const U=oy(B);U!=null?(U<-32||Math.abs(Math.max(0,U)-Math.max(0,A.distanceFromBottomPx))>32)&&Ml("restore"):Ml("restore")},getScrollTop:A=>{var B;const U=A.ownerDocument||((B=T.value)==null?void 0:B.ownerDocument)||document,j=A===U.documentElement||A===U.body||A===U.scrollingElement;return lt("scrollListener.getScrollTop",()=>ee(A,U,j))}});function lo(A,B,U){return Math.min(Math.max(A,B),U)}function hp(A){return A?.firstElementChild}function q0(A,B){var U;return A?(U=A.matches)!=null&&U.call(A,B)?A:A.querySelector(B):null}function j0(){if(!nn.value)return void(K.value=0);const A=lt("updateExperimentContainerWidth.clientWidth",()=>{var B,U;return(U=(B=T.value)==null?void 0:B.clientWidth)!=null?U:0});K.value=A>0?A:0}let Da=null;function pp(){Da?.disconnect(),Da=null}const z0=ai({loader:()=>_n(null,null,function*(){return(yield cs(()=>import("./index8-CeUCBmKU.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:OA,delay:0,suspensible:!1});function V0(A){return A===z0}const K0=H(()=>u.value==="pre"?ss:u.value==="shiki"?z0:Ym),Pr=H(()=>{const A=Je.value;if(!A.length||!nn.value)return A.map(()=>null);const B=K.value||lt("estimatedNodeHeights.clientWidth",()=>{var U;return((U=T.value)==null?void 0:U.clientWidth)||0});return!Number.isFinite(B)||B<=0?A.map(()=>null):A.map((U,j)=>{const Z=bs[j],me=typeof Z=="number"&&Z>0;if(Qo.value&&!me){const _e=HA(U,B,G.value);if(_e)return _e}if(Jn.value&&U.type==="code_block"){const _e=(function(De){if(De.type!=="code_block")return null;const Ae=Ey(De,qu(De));return V0(Ae)?"markdown":Ae===ss?"pre":Ae===K0.value||Ae===Ym?"monaco":null})(U);if(_e==="monaco"||_e==="markdown"||_e==="pre")return kq(U,{rendererKind:_e,monacoOptions:v.codeBlockMonacoOptions,showHeader:((ye=v.codeBlockProps)==null?void 0:ye.showHeader)!==!1})}var ye;return null})});function Ru(A){var B;const U=bs[A];if(Number.isFinite(U)&&U>0)return U;const j=(B=Pr.value[A])==null?void 0:B.height;return Number.isFinite(j)&&j>0?j:Math.max(Xs.value,(function(Z){var me,ye,_e,De,Ae,Ue,Be,Ee,He,Ke,Ge,pt,ot;const st=Je.value[Z];if(!st||typeof st!="object")return 32;const gt=String((me=st.type)!=null?me:""),mt=Ye()||640;switch(gt){case"heading":return 44;case"paragraph":return Cl(String((_e=(ye=st.raw)!=null?ye:st.content)!=null?_e:""),mt,34);case"list":{const Ut=Array.isArray(st.items)?st.items.length:1;return Math.max(48,30*Ut+12)}case"list_item":return Cl(String((Ae=(De=st.raw)!=null?De:st.content)!=null?Ae:""),mt,34);case"blockquote":return Cl(String((Be=(Ue=st.raw)!=null?Ue:st.content)!=null?Be:""),mt,56);case"table":{const Ut=Array.isArray(st.rows)?st.rows.length:Array.isArray(st.children)?st.children.length:3;return Math.max(120,38*Ut+48)}case"code_block":return Cl(String((He=(Ee=st.code)!=null?Ee:st.raw)!=null?He:""),mt,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return Cl(String((Ge=(Ke=st.raw)!=null?Ke:st.content)!=null?Ge:""),mt,96);case"thematic_break":return 24;default:return Cl(String((ot=(pt=st.raw)!=null?pt:st.content)!=null?ot:""),mt,40)}})(A))}function Cl(A,B,U,j=22){const Z=String(A??"");if(!Z)return U;const me=Math.max(18,Math.floor(Math.max(320,B)/8)),ye=Z.split(/\r?\n/).length,_e=Math.ceil(Z.length/me),De=Math.max(1,ye,_e);return Math.max(U,Math.ceil(De*j+12))}function Ba(A){const B=Number(A);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function mp(){var A,B;const U=Je.value.length,j=Ba(K.value||lt("getFallbackHeightPrefix.clientWidth",()=>{var _e;return((_e=T.value)==null?void 0:_e.clientWidth)||0})),Z=((A=o.virtualScroll)==null?void 0:A.measurementKey)==null?"":String(o.virtualScroll.measurementKey),me=[U,ws.count,Math.round(ws.total),Math.round(100*Xs.value),Z,j,nn.value?1:0,K_.value,ne.value].join(":");if(!cp&&B0===me)return D0;const ye=new Array(U+1);ye[0]=0;for(let _e=0;_e<U;_e++)ye[_e+1]=ye[_e]+(nn.value?Ru(_e):(B=bs[_e])!=null?B:Xs.value);return D0=ye,B0=me,cp=!1,ye}function G0(A){var B,U;const j=Je.value.length;if(j<=0||A<=0)return 0;const Z=mp();if(A>=((B=Z[j])!=null?B:0))return j-1;let me=0,ye=j-1,_e=j-1;for(;me<=ye;){const De=me+ye>>1;((U=Z[De+1])!=null?U:0)>=A?(_e=De,ye=De-1):me=De+1}return _e}function Ki(A,B){var U,j;if(A>=B)return 0;if(nn.value)return(function(ye,_e){var De,Ae;const Ue=Je.value.length,Be=lo(Math.trunc(ye),0,Ue),Ee=lo(Math.trunc(_e),Be,Ue);if(Be>=Ee)return 0;const He=mp();return((De=He[Ee])!=null?De:0)-((Ae=He[Be])!=null?Ae:0)})(A,B);if(Pa.value!==Je.value.length){let ye=0;for(let _e=A;_e<B;_e++)ye+=(U=bs[_e])!=null?U:Xs.value;return ye}const Z=ip.value,me=rp.value;if(!Z.length||!me.length){let ye=0;for(let _e=A;_e<B;_e++)ye+=(j=bs[_e])!=null?j:Xs.value;return ye}return Mu(Z,A,B)+(B-A-Mu(me,A,B))*Xs.value}ze(()=>Je.value.length,A=>{Cs(),A<=0?Eu():(A<Pa.value&&cM(A),A!==Pa.value&&Au(A))},{immediate:!0});const vM=H(()=>{if(!it.value)return Je.value.map((j,Z)=>({node:j,index:Z}));const A=Je.value.length,B=lo(ro.start,0,A),U=lo(ro.end,B,A);return Je.value.slice(B,U).map((j,Z)=>({node:j,index:B+Z}))}),gp=H(()=>it.value?Ki(0,Math.min(ro.start,Je.value.length)):0),vp=H(()=>{if(!it.value)return 0;const A=Je.value.length;return Ki(Math.min(ro.end,A),A)});function Y0(){if(!nn.value)return 0;let A=0;const B=Pr.value;for(let U=0;U<B.length;U++){if(!B[U])continue;const j=bs[U];Number.isFinite(j)&&j>0||A++}return A}function X0(){const A=Je.value.length;return{totalNodes:A,measuredCount:ws.count,estimatedCount:Y0(),averageNodeHeight:Xs.value,topSpacerHeight:gp.value,bottomSpacerHeight:vp.value,estimatedTotalHeight:Ki(0,A),width:Rr()}}function yM(){const A=Je.value,B=X0();return At(et({},B),{probe:{paragraphReady:!!G.value.paragraph,listItemReady:!!G.value.listItem,listWrapperOverhead:G.value.listWrapperOverhead,headingReadyLevels:Object.entries(G.value.headings).filter(([,U])=>!!U).map(([U])=>Number(U))},nodes:A.map((U,j)=>{var Z,me,ye,_e,De,Ae,Ue,Be,Ee;return{index:j,type:U.type,estimateKind:(me=(Z=Pr.value[j])==null?void 0:Z.kind)!=null?me:null,rendererKind:(_e=(ye=Pr.value[j])==null?void 0:ye.rendererKind)!=null?_e:null,estimatedHeight:(Ae=(De=Pr.value[j])==null?void 0:De.height)!=null?Ae:null,estimatedContentHeight:(Be=(Ue=Pr.value[j])==null?void 0:Ue.contentHeight)!=null?Be:null,measuredHeight:(Ee=bs[j])!=null?Ee:null}})})}function yp(){return o.indexKey!=null?String(o.indexKey):po.value?`virtual-${vn()}`:"markdown-renderer"}function Q0(A){const B=String(A),U=`${yp()}-`;if(!B.startsWith(U))return null;const j=B.slice(U.length).match(/^(\d+)(?:$|-)/);if(!j)return null;const Z=Number(j[1]);return!Number.isInteger(Z)||Z<0||Z>=Je.value.length?null:Z}function vn(){var A,B,U;const j=(A=o.virtualScroll)==null?void 0:A.sessionKey;return String(j!=null&&j!==""?j:(U=(B=o.indexKey)!=null?B:v.customId)!=null?U:Rt)}function Kn(){var A;const B=(A=o.virtualScroll)==null?void 0:A.threadKey;return B==null||B===""?void 0:String(B)}function kp(A){var B;return(A??"")===((B=Kn())!=null?B:"")}function kM(){var A;const B=(A=o.virtualScroll)==null?void 0:A.measurementKey;return B==null?"":String(B)}function bM(){var A,B;const U=u.value,j=U==="monaco"?v.codeBlockMonacoOptions:void 0,Z=v.codeBlockProps,me=U==="shiki";return[v.isDark?"dark":"light",U==="monaco"?"code-rich":U==="pre"?"code-pre":"code-shiki",v.codeBlockStream===!1?"code-static":"code-stream",to(v.codeBlockMinWidth),to(v.codeBlockMaxWidth),...me?[zf((A=Z?.themes)!=null?A:v.themes,(B=Z?.langs)!=null?B:v.langs)]:[],to(j?.fontSize),to(j?.lineHeight),to(j?.fontFamily),to(j?.tabSize),to(j?.MAX_HEIGHT),to(j?.wordWrap),to(j?.wrappingIndent),to(j?.padding),to(Z?.showHeader),to(Z?.showCopyButton),to(Z?.showExpandButton),to(Z?.showPreviewButton),to(Z?.showCollapseButton),to(Z?.showFontSizeButtons)].join("\0")}function gi(){return[kM(),bM()].join("\0")}function Rr(){return Ye()}const Du=H(()=>Ba(Rr())),ts=H(()=>[gi(),Du.value].join("\0")),wM=H(()=>{var A;return po.value?["virtual",(A=Kn())!=null?A:"",vn(),ts.value].join("\0"):o.indexKey});function Sl(){R0.value+=1}function bp(A){return!(!A||!Number.isInteger(A.index)||A.index<0||A.index>=Je.value.length||A.sessionKey!==vn()||A.threadKey!==Kn()||A.layoutEpochKey!==ts.value)}function Z0(A){const B=String(A),U=Zs.get(B);return U?bp(U)?U.index:null:Q0(B)}function J0(A="async-node"){(Jo.size||Zs.size)&&(Jo.clear(),Zs.clear(),Sl(),un(A))}const xl=Bt(u1,null),wp={reportHeight(A,B){if(!Tt.value)return;const U=Z0(A);if(U==null)return;const j=Qs.get(U);if(!j)return;const Z=Number(B),me=I0(U,j);E0(U,Number.isFinite(Z)&&Z>0?Math.max(Z,me||0):me)},markPending(A){if(!Tt.value)return;const B=Q0(A);B!=null&&(function(U,j){var Z;const me=Zs.get(U);if(me&&bp(me))return Jo.set(U,Math.max(0,(Z=Jo.get(U))!=null?Z:0)+1),Sl(),void un("async-node");Jo.set(U,1),Zs.set(U,(function(ye){return{index:ye,sessionKey:vn(),threadKey:Kn(),layoutEpochKey:ts.value}})(j)),Sl(),un("async-node")})(String(A),B)},markSettled(A){if(!Tt.value)return;const B=String(A),U=Z0(A);(U!=null||(function(j){return Jo.has(String(j))})(B))&&(function(j){var Z;const me=(Z=Jo.get(j))!=null?Z:0;return!(me<=0||(me<=1?(Jo.delete(j),Zs.delete(j)):Jo.set(j,me-1),Sl(),me===1&&un("async-node"),0))})(B)&&U!=null&&vi()}};function _M(){let A=0;for(const B of Qs.values())A+=lt("getVisibleDomHeight.offsetHeight",()=>{var U;return(U=B?.offsetHeight)!=null?U:0});return Math.ceil(Math.max(0,A))}yn(u1,{reportHeight(A,B){wp.reportHeight(A,B),xl?.reportHeight(A,B)},markPending(A){wp.markPending(A),xl?.markPending(A)},markSettled(A){wp.markSettled(A),xl?.markSettled(A)}});let _p,Cp=null,Tl=null;function Bu(A){return A!==!1&&A!=null&&A!==""}function ey(){return it.value?(function(){if(!it.value)return!0;const A=Je.value.length,B=lo(ro.start,0,A),U=lo(ro.end,B,A);if(B>=U)return!0;for(let j=B;j<U;j++)if(!Le.has(j)||jp(j)&&!Qs.has(j))return!1;return!0})():Vn.value>=$u.value}function Sp(){return W.value===!0&&!Y.value&&ap.value===0&&zi.size===0&&mi.size===0&&es==null&&ey()}function ty(){var A,B;if(((A=o.virtualScroll)==null?void 0:A.settleMode)!=="manual"||Cp===vn()&&_p===Kn())return!0;const U=(B=o.virtualScroll)==null?void 0:B.settledToken;return!!Bu(U)&&Tl===Za(U)}function xp(){return Sp()&&ty()}function CM(A,B){return B.totalNodes<=0?A==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?A==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function Dr(A="manual",B){const U=X0(),j=(function(Z){return Z||(W.value!==!0?Je.value.length>0?"streaming":"estimating":!ey()||mi.size>0||es!=null?"measuring":xp()?"settled":"settling")})(B);return{sessionKey:vn(),threadKey:Kn(),phase:j,nodeCount:U.totalNodes,liveRange:{start:ro.start,end:ro.end},renderedCount:Vn.value,measuredCount:U.measuredCount,estimatedCount:U.estimatedCount,averageNodeHeight:U.averageNodeHeight,topSpacerHeight:U.topSpacerHeight,bottomSpacerHeight:U.bottomSpacerHeight,visibleDomHeight:_M(),totalHeight:ny(),width:U.width,final:W.value===!0,stable:xp(),confidence:CM(j,U),reason:A}}function Fa(){const A=hn.value||Se(),B=T.value;if(!A||!B)return null;const U=A.ownerDocument||B.ownerDocument||document,j=A===U.documentElement||A===U.body||A===U.scrollingElement,Z=lt("getScrollBox.scrollTop",()=>ee(A,U,j)),me=lt("getScrollBox.scrollHeight",()=>{var _e,De,Ae,Ue,Be;return j?Math.max((De=(_e=U.documentElement)==null?void 0:_e.scrollHeight)!=null?De:0,(Ue=(Ae=U.body)==null?void 0:Ae.scrollHeight)!=null?Ue:0,(Be=A.scrollHeight)!=null?Be:0):A.scrollHeight}),ye=lt("getScrollBox.clientHeight",()=>{var _e;return j?((_e=U.documentElement)==null?void 0:_e.clientHeight)||A.clientHeight||0:A.clientHeight});return{root:A,doc:U,isViewportRoot:j,scrollTop:Z,scrollHeight:me,clientHeight:ye}}function ny(){const A=Je.value.length,B=Math.max(0,Ki(0,A)),U=lt("getRendererLogicalHeight.offsetHeight",()=>{var Z,me;return(me=(Z=T.value)==null?void 0:Z.offsetHeight)!=null?me:0}),j=Math.max(0,U>0?U:lt("getRendererLogicalHeight.scrollHeight",()=>{var Z,me;return(me=(Z=T.value)==null?void 0:Z.scrollHeight)!=null?me:0}));return A<=0?Math.ceil(U):it.value?B>0?Math.max(1,Math.ceil(B),(function(){let Z=gp.value+vp.value;for(const me of Le.values())me&&(Z+=Math.max(0,lt("getVirtualizedDomLogicalHeight.offsetHeight",()=>me.offsetHeight||0)));return Math.ceil(Math.max(0,Z))})(),(function(Z,me){return Z<=0||me<=0?0:me<=Z+Math.max(512,.05*Z)?Math.ceil(me):0})(B,j)):Math.max(1,Math.ceil(j)):Tt.value?B>0||ws.count>0||Y0()>0?(fi.value&&Vn.value,Math.max(1,Math.ceil(j),Math.ceil(B))):Math.ceil(j):Math.max(1,Math.ceil(j),Math.ceil(B))}function oy(A){const B=T.value;if(!B)return null;const U=lt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(Z){return Z.isViewportRoot?Z.clientHeight:lt("getViewportBottomInRoot.getBoundingClientRect",()=>Z.root.getBoundingClientRect().bottom)})(A)-U.bottom}function SM(A={}){const B=A.requireViewport!==!1,U=(function(me=64){const ye=Fa(),_e=T.value;if(!ye||!_e)return!1;const De=(function(Ue){if(Ue.isViewportRoot)return{top:0,bottom:Ue.clientHeight};const Be=lt("getVirtualViewportRect.getBoundingClientRect",()=>Ue.root.getBoundingClientRect());return{top:Be.top,bottom:Be.bottom}})(ye),Ae=lt("isRendererNearVirtualViewport.getBoundingClientRect",()=>_e.getBoundingClientRect());return Ae.bottom>=De.top-me&&Ae.top<=De.bottom+me})();if(B&&!U)return null;const j=(function(){const me=Fa(),ye=T.value;if(!me||!ye||Math.max(0,me.scrollHeight-me.scrollTop-me.clientHeight)>64)return null;const _e=oy(me);return _e==null?null:_e>=-8&&_e<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,_e)}:null})();if(j)return{anchor:j,captured:!0};const Z=T0();if(Z)return{anchor:{type:"node",nodeIndex:Z.nodeIndex,offsetWithinNodePx:Z.offsetWithinNodePx},captured:U};if(A.allowFallback===!0){const me=(function(){const ye=Je.value.length;return ye<=0?null:{type:"node",nodeIndex:lo(_s.value,0,Math.max(0,ye-1)),offsetWithinNodePx:0}})();return me?{anchor:me,captured:!1}:null}return null}function Tp(A){let B=2166136261;for(let U=0;U<A.length;U++)B^=A.charCodeAt(U),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function xM(A,B){let U=A;for(let j=0;j<B.length;j++)U^=B.charCodeAt(j),U=Math.imul(U,16777619);return U^=31,U=Math.imul(U,16777619),U}const TM=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Fu(A,B=new WeakSet,U=0){if(A==null||typeof A=="number"||typeof A=="boolean")return String(A);if(typeof A=="string")return`s:${(function(j){const Z=j.length>8192?`${j.slice(0,8192)}...${j.length}`:j;return`${j.length}:${Tp(Z)}`})(A)}`;if(typeof A=="function")return"fn";if(typeof A!="object")return typeof A;if(B.has(A))return"cycle";if(U>=6)return"max-depth";B.add(A);try{if(Array.isArray(A)){if(A.length<=160){const Ae=[];for(let Ue=0;Ue<A.length;Ue++)Ae.push(Fu(A[Ue],B,U+1));return`a:${A.length}:${Ae.join(",")}`}const me=[],ye=[],_e=Math.max(0,A.length-32);let De=2166136261;for(let Ae=0;Ae<A.length;Ae++){const Ue=Fu(A[Ae],B,U+1);De=xM(De,Ue),Ae<32&&me.push(Ue),Ae>=_e&&ye.push(Ue)}return[`a:${A.length}`,`h=${me.join(",")}`,`t=${ye.join(",")}`,`all=${(De>>>0).toString(36)}`].join(":")}const j=A,Z=Object.keys(j).filter(me=>{const ye=j[me];return me!=="parent"&&me!=="el"&&me!=="component"&&(ye==null||typeof ye=="string"||typeof ye=="number"||typeof ye=="boolean"||TM.has(me))}).sort();return`o:${Z.length}:${Z.map(me=>`${me}=${Fu(j[me],B,U+1)}`).join(";")}`}finally{B.delete(A)}}let sy=-1,Ap="";function Ha(A){const B=Je.value[A];return B?Tp(Fu(B)):""}function Mp(){const A=ne.value;if(sy===A)return Ap;let B=2166136261;for(let U=0;U<Je.value.length;U++){const j=Ha(U);for(let Z=0;Z<j.length;Z++)B^=j.charCodeAt(Z),B=Math.imul(B,16777619)}return Ap=(B>>>0).toString(36),sy=A,Ap}function Al(A,B={}){var U;const j=B.includeHeightCache===!0,Z=(U=B.includeContentHash)!=null?U:j,me=j?(function(_e){const De=(function(){var Ge,pt;const ot=Number((pt=(Ge=o.virtualScroll)==null?void 0:Ge.heightCacheLimit)!=null?pt:5e3);return!Number.isFinite(ot)||ot<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ot))})();if(!Number.isFinite(De)||_e.length<=De)return _e;const Ae=new Map,Ue=Ge=>{!Ge||Ae.size>=De||Ae.set(Ge.index,Ge)},Be=Je.value.length,Ee=lo(ro.start-2*Ra.value,0,Be),He=lo(ro.end+2*Ra.value,Ee,Be);for(const Ge of _e)Ge.index>=Ee&&Ge.index<He&&Ue(Ge);const Ke=Math.max(1,Math.ceil(_e.length/De));for(let Ge=0;Ge<_e.length&&Ae.size<De;Ge+=Ke)Ue(_e[Ge]);for(let Ge=_e.length-1;Ge>=0&&Ae.size<De;Ge-=Ke)Ue(_e[Ge]);return Array.from(Ae.values()).sort((Ge,pt)=>Ge.index-pt.index).slice(0,De)})(fM().map(_e=>{var De;const Ae=Je.value[_e.index];return Ae?At(et({},_e),{nodeType:String((De=Ae.type)!=null?De:""),signature:Ha(_e.index)}):null}).filter(_e=>!!_e)):[],ye=SM({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ye||me.length||B.includeEmptyState===!0?At(et({sessionKey:A.sessionKey,threadKey:A.threadKey},ye?{anchor:ye.anchor,anchorCaptured:ye.captured}:{anchorCaptured:!1}),{metrics:A,width:A.width,contentHash:Z?Mp():void 0,measurementKey:gi()||void 0,heightCache:me.length?me:void 0}):null}function Ep(A){var B,U;const j=Fa();if(!j)return;const Z=(function(_e){const De=T.value;if(!De)return null;const Ae=he(De,_e.root),Ue=Je.value.length,Be=lt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>De.offsetHeight||0),Ee=Math.max(0,Be>0?Be:Ue>0?lt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>De.scrollHeight||0):0),He=ny();return Ae+Math.max(Ee,He)})(j);if(Z==null)return;const me=Math.max(0,A.distanceFromBottomPx),ye=Math.max(0,Z-j.clientHeight-me);(function(_e){pi=za()+120,Fs=_e})(ye),j.isViewportRoot?(U=(B=j.doc.defaultView)==null?void 0:B.scrollTo)==null||U.call(B,0,ye):Q_(j.root,j.doc,ye,{isReverseFlexScrollRoot:q,getNormalizedScrollTop:ee})}const Ip=[];function iy(){if(le)for(pn!=null&&(St?.(pn),pn=null);Ip.length;){const A=Ip.pop();A!=null&&window.clearTimeout(A)}}function Ml(A){const B=!!Ot.value;Ot.value=null,pi=0,Fs=null,iy(),B&&A&&un(A)}function El(){if(!Ot.value||!le||pn!=null)return;const A=()=>{pn=null;const B=Ot.value;B&&Ep(B)};pn=Ct?Ct(A):null,pn==null&&A()}function ry(A,B={}){const U=Je.value.length;return U<=0?[]:A.filter(j=>!(!Number.isInteger(j.index)||j.index<0||j.index>=U)&&!(!Number.isFinite(j.height)||j.height<=0)&&!(B.requireSignature&&!j.signature)&&!(B.requireCompatibilityMetadata&&!j.nodeType&&!j.signature)&&(function(Z){var me;const ye=Je.value[Z.index];return!(!ye||Z.nodeType&&Z.nodeType!==String((me=ye.type)!=null?me:"")||Z.signature&&Z.signature!==Ha(Z.index))})(j))}function ly(A){const B=Ba(Rr()),U=Ba(A);return B!==-1&&U!==-1&&B===U}function $p(A){var B;const U=Number(A?.width);if(Number.isFinite(U)&&U>0)return U;const j=Number((B=A?.metrics)==null?void 0:B.width);return Number.isFinite(j)&&j>0?j:null}function ay(A){var B;return A.sessionKey===vn()&&!!kp(A.threadKey)&&((B=A.measurementKey)!=null?B:"")===gi()&&!!ly($p(A))&&!!(function(U){const j=U.heightCache;return!!j?.length&&(cy(U)?j.some(Z=>!!(Z.nodeType||Z.signature)):j.some(Z=>!!Z.signature))})(A)}function cy(A){return!!(A.contentHash&&A.contentHash===Mp())}function AM(A){return!cy(A)}let Br=null,Fr=null,Hu=null,Wa=null,Ua=null;function Np(A){var B;const U=A.map(Z=>{var me,ye;return[Z.index,Math.round(10*Z.height),(me=Z.nodeType)!=null?me:"",(ye=Z.signature)!=null?ye:""].join("")}).join(""),j=Ba(Rr());return[(B=Kn())!=null?B:"",vn(),gi(),Je.value.length,j,A.length,Tp(U)].join(":")}function uy(A=(B=>(B=o.virtualScroll)==null?void 0:B.heightCache)()){if(!Tt.value||!A?.length||Je.value.length<=0||!ly((B=o.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const U=ry(A,{requireSignature:!0});if(!U.length)return!1;const j=Np(U);return j===Br?(Fr="standalone",!0):($0(U,{mode:"merge"}),Cs(),Br=j,Fr="standalone",Ka(),un("restore"),!0)}function Lp(A,B={}){var U,j,Z;if(!Tt.value||!A||A.sessionKey!==vn()||!kp(A.threadKey)||Je.value.length<=0)return!1;const me=!!((U=A.heightCache)!=null&&U.length)&&!Wu(),ye=!A.anchor||A.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:A.anchor,_e=B.restoreAnchor===!0&&!!ye&&!Wu()&&Number($p(A))>0;let De=!1;if((j=A.heightCache)!=null&&j.length&&ay(A)){const Ue=ry(A.heightCache,{requireCompatibilityMetadata:!A.contentHash,requireSignature:AM(A)});Ue.length&&($0(Ue,{mode:"merge"}),Cs(),Br=Np(Ue),Fr="restore",Ka(),De=!0)}if(me||_e)return!1;if(!B.restoreAnchor||!ye)return De&&un("restore"),!0;const Ae=(function(Ue,Be){var Ee;const He=Ue.anchor,Ke=He?He.type==="bottom"?`bottom:${Math.round(He.distanceFromBottomPx)}`:`node:${He.nodeIndex}:${Math.round(He.offsetWithinNodePx)}`:"none";return[(Ee=Kn())!=null?Ee:"",vn(),gi(),Du.value,Be,Ke].join(":")})(A,(Z=B.restoreToken)!=null?Z:"imperative");return Hu===Ae?(De&&un("restore"),!0):(Hu=Ae,(function(Ue){const Be=()=>{if(Ue.type==="node")return Ml(),void A0({nodeIndex:Ue.nodeIndex,offsetWithinNodePx:Ue.offsetWithinNodePx});if(Tu(),ks.value=null,Ot.value=Ue,iy(),Ep(Ue),le)for(const Ee of[0,120,280,480])Ip.push(window.setTimeout(()=>{const He=Ot.value;He&&Ep(He)},Ee))};(function(Ee){if(!it.value)return!1;const He=Je.value.length;return!(He<=0||(_s.value=Ee.type==="node"?lo(Ee.nodeIndex,0,He-1):He-1,Lr(),0))})(Ue)?ht(Be):Be()})(ye),un("restore"),!0)}function Wu(){const A=Rr();return Number.isFinite(A)&&A>0}function dy(A){var B;return A.sessionKey===vn()&&!!kp(A.threadKey)&&(Je.value.length<=0||!(!((B=A.heightCache)!=null&&B.length)||Wu())||!(!(A.anchor&&Number($p(A))>0)||Wu()))}function Op(){Lt.clear();for(const A of Object.keys(bs)){const B=Number(A);Number.isInteger(B)&&B>=0&&B<Je.value.length&&M0(B)}}function qa(){es!=null&&(St?.(es),es=null),zp()}function fy(){return!le||gn?Promise.resolve():new Promise(A=>{let B=!1,U=null;const j=()=>{B||(B=!0,U!=null&&window.clearTimeout(U),A())};if(Ct)return Ct(j),void(U=window.setTimeout(j,50));U=window.setTimeout(j,0)})}function Pp(A,B=Kn(),U=ts.value){return vn()===A&&Kn()===B&&ts.value===U}function Rp(){return _n(this,arguments,function*(A={}){var B,U,j,Z,me;const ye=vn(),_e=Kn(),De=ts.value,Ae=(B=A.frames)!=null?B:2,Ue=(U=A.timeoutMs)!=null?U:120,Be=(j=A.reason)!=null?j:"manual",Ee=A.expectedSettledTokenKey,He=A.flushPendingTimers===!0,Ke=Dr(Be),Ge=()=>At(et({},Ke),{phase:Ke.final?"settling":Ke.phase,stable:!1,confidence:Ke.confidence==="final"?"mixed":Ke.confidence,reason:Be}),pt=()=>Pp(ye,_e,De)&&(Ee==null||Va()===Ee);for(let mt=0;mt<Ae;mt++){if(yield ht(),!pt()||(yield fy(),!pt()))return Ge();vi(),qa()}if(yield(function(mt){return!le||mt<=0?Promise.resolve():new Promise(Ut=>window.setTimeout(Ut,mt))})(Ue),!pt()||(He&&H0(),vi(),qa(),!pt()))return Ge();const ot=Sp();ot&&(Cp=ye,_p=_e,((Z=o.virtualScroll)==null?void 0:Z.settleMode)==="manual"&&Ee!=null&&Bu((me=o.virtualScroll)==null?void 0:me.settledToken)&&Va()===Ee&&(Tl=Za(o.virtualScroll.settledToken)));const st=pt()&&ot&&ty(),gt=Dr(Be,st?"final":void 0);return Wp(gt,!0),gt})}let Dp="content",Hr=null,Wr=null,Bp=0,ja=null,Il=null,Fp=null,Hp=null;function za(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function hy(A){var B,U;const j=ja;if(!j)return!0;const Z=(U=(B=o.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?U:1;return Math.abs(A.totalHeight-j.totalHeight)>Z||A.sessionKey!==j.sessionKey||A.phase!==j.phase||A.stable!==j.stable||A.final!==j.final||A.threadKey!==j.threadKey||A.nodeCount!==j.nodeCount||A.measuredCount!==j.measuredCount||A.width!==j.width}function to(A){if(A==null)return"";if(typeof A=="string"||typeof A=="number"||typeof A=="boolean")return String(A);try{return JSON.stringify(A)}catch{return String(A)}}function Va(A=(B=>(B=o.virtualScroll)==null?void 0:B.settledToken)()){return to(A)}function py(A,B){var U,j;return[A,B.sessionKey,(U=B.threadKey)!=null?U:"",gi(),Mp(),to((j=o.virtualScroll)==null?void 0:j.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function Ka(){Fp=null,Hp=null,Il=null}function MM(A){const B=A.heightCache;return B?.length?Np(B):""}function Ga(A){var B,U,j;const Z=A.metrics,me=A.anchor?(ye=A.anchor).type==="bottom"?`bottom:${Math.round(ye.distanceFromBottomPx)}`:`node:${ye.nodeIndex}:${Math.round(ye.offsetWithinNodePx)}`:"none";var ye;return[A.sessionKey,(B=A.threadKey)!=null?B:"",(U=A.measurementKey)!=null?U:gi(),(j=A.contentHash)!=null?j:"",MM(A),me,A.anchorCaptured?1:0,Z.liveRange.start,Z.liveRange.end,Z.renderedCount,Z.nodeCount,Math.round(Z.totalHeight),Math.round(Z.width),Z.phase,Z.stable?1:0].join("\0")}function Wp(A,B=!1){if(!Tt.value||(function(ye=!1){return!ye&&po.value&&!io.value})(B))return;const U=B||hy(A),j=(function(ye,_e=!1){return _e||ye.stable||ye.phase==="final"?{state:Al(ye,{includeHeightCache:!0})}:{state:Al(ye)}})(A,B),Z=j.state,me=!!(Z&&(U||(function(ye,_e=!1){return!!_e||Ga(ye)!==Il})(Z,B)));if(U&&(M(A),ja=A,Bp=za()),Z&&me&&($(Z),Z.anchor&&P(Z.anchor),Il=Ga(Z)),A.stable){const ye=py("settled",A);if(ye!==Fp){Fp=ye;const _e=Al(A,{includeHeightCache:!0});_e&&($(_e),Il=Ga(_e)),(function(De){s("render-settled",De)})(A)}}if(A.phase==="final"){const ye=py("final",A);if(ye!==Hp){Hp=ye;const _e=Al(A,{includeHeightCache:!0});_e&&($(_e),Il=Ga(_e)),(function(De){s("render-final",De)})(A)}}}function Up(){Hr!=null&&(St?.(Hr),Hr=null),Wr!=null&&le&&(window.clearTimeout(Wr),Wr=null)}function my(){Hr=null,Wr=null,(function(A){if(mi.size>0||es!=null)return!0;switch(A){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Dp)&&(vi(),qa()),Wp(Dr(Dp))}function un(A){var B,U;if(!Tt.value||(Dp=A,Hr!=null||Wr!=null))return;const j=Math.max(0,(U=(B=o.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?U:32),Z=Math.max(0,j-(za()-Bp)),me=()=>{Wr=null,Hr=Ct?Ct(my):null,Hr==null&&my()};le&&Z>0?Wr=window.setTimeout(me,Z):me()}function qp(A){var B;if(A<=0)return 0;const U=Je.value;if(nn.value)return G0(A);if(Pa.value===U.length&&ip.value.length&&rp.value.length){const Z=Xs.value,me=ip.value,ye=rp.value,_e=Be=>Be<=0?0:Mu(me,0,Be)+(Be-Mu(ye,0,Be))*Z;let De=0,Ae=U.length-1,Ue=U.length-1;for(;De<=Ae;){const Be=De+Ae>>1;_e(Be+1)>=A?(Ue=Be,Ae=Be-1):De=Be+1}return Ue}let j=A;for(let Z=0;Z<U.length;Z++){const me=(B=bs[Z])!=null?B:Xs.value;if(j<=me)return Z;j-=me}return Math.max(0,U.length-1)}function gy(){eo.value+=1}function jp(A){return!(fi.value&&A>=Vn.value)&&(!qi.value||A<Zo.value||dp.value.has(A))}function $l(A){const B=Ou.get(A);B&&(B(),Ou.delete(A));const U=_l.get(A);U&&(U.destroy(),_l.delete(A)),Pu(A)}function vy(A,B){let U=!1;if(B){const me=Le.get(A);Le.set(A,B),me!==B&&(U=!0)}else Le.delete(A)&&(U=!0);if(U&&gy(),B||Pu(A),!N0.value||!Fe||!it.value&&qi.value&&!z.value&&_l.size>=640&&(z.value||(z.value=!0,fp()),!N0.value||!Fe))return $l(A),void(B&&Vi(A,!0));if(A<Zo.value&&!it.value||dp.value.has(A))return $l(A),void Vi(A,!0);if(!B)return void $l(A);$l(A);const j=Fe(B,{rootMargin:"400px"});if(!j)return;_l.set(A,j),Vi(A,j.isVisible.value),qi.value&&(function(me){if(!le||!qi.value)return;Pu(me);const ye=me%17*23,_e=window.setTimeout(()=>{if(W0.delete(me),!qi.value||dp.value.has(me))return;const De=Le.get(me);if(!De)return;const Ae=Se(De),Ue=De.ownerDocument||document,Be=Ue.defaultView||window,Ee=!Ae||Ae===Ue.documentElement||Ae===Ue.body,He=!Ee&&Ae?lt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ae.getBoundingClientRect()):null,Ke=Ee?0:He.top,Ge=Ee?lt("nodeVisibilityFallback.clientHeight",()=>{var ot,st;return(st=(ot=Be.innerHeight)!=null?ot:Ae?.clientHeight)!=null?st:0}):He.bottom,pt=lt("nodeVisibilityFallback.node.getBoundingClientRect",()=>De.getBoundingClientRect());pt.bottom>=Ke-500&&pt.top<=Ge+500&&Vi(me,!0)},1800+ye);W0.set(me,_e)})(A);let Z=null;Z=ze(()=>j.isVisible.value,me=>{if(me){Pu(A),Vi(A,!0),Z?.(),Ou.delete(A),_l.get(A)===j&&_l.delete(A);try{j.destroy()}catch{}}},{immediate:!0}),Ou.set(A,Z),it.value&&Js()}function zp(){es=null;for(const[A,B]of mi)mi.delete(A),Qs.get(A)===B.el&&Or.get(A)===B.version&&E0(A,B.height,{allowShrink:B.allowShrink})}function Nl(){es!=null&&(St?.(es),es=null),mi.clear()}function Uu(A,B){(function(U,j,Z){var me;if(!Number.isFinite(Z)||Z<=0||Qs.get(U)!==j)return;const ye=Or.get(U);if(ye==null)return;const _e=Je.value[U],De=Y.value&&W.value!==!0&&!((me=o.nodes)!=null&&me.length)&&U>=Je.value.length-2,Ae=!(_e?.loading===!0||De),Ue=mi.get(U),Be=Ue?Ue.allowShrink&&Ae:Ae,Ee=Ue&&!Be?Math.max(Ue.height,Z):Z;mi.set(U,{height:Ee,allowShrink:Be,version:ye,el:j}),es==null&&(es=Ct?Ct(zp):null,es==null&&zp())})(A,B,I0(A,B))}function vi(){for(const[A,B]of Qs)B&&Uu(A,B)}function yy(){pe?.disconnect(),pe=null,Me.clear()}function Vp(){for(;Iu.length;)Lu(Iu.pop())}ze(io,A=>{A&&un("content")},{flush:"post"}),t({getVirtualMetrics:Dr,captureVirtualState:function(A={}){var B;return Al(Dr("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:A.allowFallbackAnchor===!0,requireViewport:A.requireViewport===!0,includeEmptyState:(B=A.includeEmptyState)==null||B})},restoreVirtualState:function(A,B={}){const U=B.restoreAnchor===!0,j=B.restoreToken==null?"imperative":String(B.restoreToken);Wa=A,Ua={restoreAnchor:U,restoreToken:j,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!Lp(A,{restoreAnchor:U,restoreToken:j,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&dy(A)||(Wa=null,Ua=null)},forceMeasure:function(A="manual"){return _n(this,null,function*(){yield ht(),yield fy(),vi(),qa(),yield ht();const B=Dr(A);return Wp(B,!0),B})},settle:Rp,scrollToNode:function(A,B="start"){Ml(),Tu();const U=Je.value.length;if(U<=0)return;const j=lo(A,0,U-1),Z=()=>{var me;const ye=sp({nodeIndex:j,offsetWithinNodePx:0}),_e=Ru(j),De=Fa(),Ae=(me=De?.clientHeight)!=null?me:0,Ue=bl();let Be=ye;if(B==="center")Be=ye-Ae/2+_e/2;else if(B==="end")Be=ye-Ae+_e;else if(B==="nearest"&&Ue!=null){if(ye>=Ue&&ye+_e<=Ue+Ae)return;Be=ye<Ue?ye:ye-Ae+_e}wl(Math.max(0,Be)),Js({immediate:!0}),it.value&&(_s.value=j,Lr())};if(it.value)return _s.value=j,Lr(),void ht(Z);Z()}}),ze(()=>Ie.value,A=>{if(!A){yy();for(const B of ji.values())for(const U of B)Lu(U);ji.clear(),Or.clear(),Vp(),Nl()}},{immediate:!0}),ze(W,A=>{A&&(function(){if(le&&W.value&&Qs.size){Vp();for(const B of[80,240,640]){const U=F0(B,()=>{for(const[j,Z]of Qs)Z&&Uu(j,Z)},"final");U!=null&&Iu.push(U)}}})(),un(A?"final":"content")}),ze([()=>Je.value.length,()=>Vn.value],()=>{Ot.value&&El(),un("content")},{flush:"post",immediate:!0}),ze([()=>ro.start,()=>ro.end],()=>{un("batch")},{flush:"post"});const{cleanupBatchScheduler:EM}=(function(A){const{props:B,isClient:U,isTestEnv:j,parsedNodesIdentity:Z,parsedNodeCount:me,desiredRenderedCount:ye,datasetKey:_e,batchingEnabled:De,incrementalRenderingActive:Ae,resolvedBatchSize:Ue,resolvedInitialBatch:Be,renderedCount:Ee,adaptiveBatchSize:He,previousRenderContext:Ke,previousBatchConfig:Ge,requestFrame:pt,cancelFrame:ot,hasIdleCallback:st,cleanupNodeVisibility:gt,onDatasetKeyChanged:mt,onDatasetChanged:Ut}=A;let yt=null,It=null,Et=!1,Xt=null,ns=null,So=0,Hs=!1,Gi=!1;const Yi=new Set,qr=new Set;function Ry(){if(U){yt!=null&&(ot?.(yt),yt=null),It!=null&&(window.clearTimeout(It),It=null),ns!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(ns),ns=null),So+=1;for(const mo of Yi)ot?.(mo);Yi.clear();for(const mo of qr)window.clearTimeout(mo);qr.clear(),Et=!1,Xt=null,Hs=!1,Gi=!1}}function Yu(){return typeof performance<"u"?performance.now():Date.now()}function Dy(mo){(function(yi){var Xi;if(!Ae.value)return;const ki=Math.max(2,(Xi=B.renderBatchBudgetMs)!=null?Xi:6),bi=Math.max(1,Ue.value||1),Ws=Math.max(1,Math.floor(bi/4));yi>1.2*ki?He.value=Math.max(Ws,Math.floor(.7*He.value)):yi<.5*ki&&He.value<bi&&(He.value=Math.min(bi,Math.ceil(1.2*He.value)))})(mo),Hs=!1;const Do=Gi||Ee.value<ye.value;Gi=!1,Do&&Hy()}function By(mo,Do={}){var yi,Xi;if(!Ae.value)return;const ki=ye.value;if(Ee.value>=ki)return;const bi=Math.max(1,mo),Ws=()=>{const Pl=Yu();let Rl=0;yt=null,It=null,ns=null,Et=!1;const Dl=Xt??bi;Xt=null;const em=Yu();Ee.value=Math.min(ki,Ee.value+Dl),gt(Ee.value),Rl=Yu()-em,(function(tm,Wy){if(!U)return void Dy(Wy);Hs=!0;const Uy=++So;ht().then(()=>{var qy;if(Uy!==So)return;const YM=Yu(),XM=Math.max(Wy,YM-tm),jy=()=>{Uy===So&&Dy(XM)};if(pt){let Vy=!1,wi=null;const Ky=()=>{Vy||(Vy=!0,jy())},Xu=pt(()=>{Yi.delete(Xu),wi!=null&&(window.clearTimeout(wi),qr.delete(wi),wi=null),Ky()});return Yi.add(Xu),wi=window.setTimeout(()=>{wi!=null&&qr.delete(wi),wi=null,ot?.(Xu),Yi.delete(Xu),Ky()},Math.max(32,(qy=B.renderBatchIdleTimeoutMs)!=null?qy:120)),void qr.add(wi)}const zy=window.setTimeout(()=>{qr.delete(zy),jy()},0);qr.add(zy)})})(Pl,Rl)};if(!U||Do.immediate)return void Ws();const Qi=Math.max(0,(yi=B.renderBatchDelay)!=null?yi:16);if(Xt=Xt!=null?Math.max(Xt,bi):bi,!Et){if(Et=!0,!j&&st&&window.requestIdleCallback){const Pl=Math.max(0,(Xi=B.renderBatchIdleTimeoutMs)!=null?Xi:120);return void(ns=window.requestIdleCallback(()=>Ws(),{timeout:Pl}))}pt&&!j?yt=pt(()=>{Qi!==0?It=window.setTimeout(()=>Ws(),Qi):Ws()}):It=window.setTimeout(()=>Ws(),Qi)}}function Fy(mo,Do={}){Hs?Gi=!0:mo==null?Hy():By(mo,Do)}function Hy(){Ae.value&&By(De.value?Math.max(1,Math.round(He.value)):Math.max(1,Ue.value))}return ze([Z,me,_e,Ae,Ue,Be,()=>B.renderBatchDelay],()=>{var mo;const Do=me.value,yi=Ke.value,Xi=_e.value,ki=!Object.is(Xi,yi.key),bi=Do!==yi.total,Ws=ki||bi;Ke.value={key:Xi,total:Do};const Qi=Ge.value,Pl=(mo=B.renderBatchDelay)!=null?mo:16,Rl=Qi.batchSize!==Ue.value||Qi.initial!==Be.value||Qi.delay!==Pl||Qi.enabled!==Ae.value;Ge.value={batchSize:Ue.value,initial:Be.value,delay:Pl,enabled:Ae.value},ki&&mt(Do),(Ws||Rl||!Ae.value)&&Ry(),(Ws||Rl)&&(He.value=Math.max(1,Ue.value||1)),Ws&&Ut();const Dl=ye.value;if(!Do)return Ee.value=0,void gt(0);if(!Ae.value)return Ee.value=Dl,void gt(Ee.value);const em=ki||yi.total===0;Ee.value=em||Rl?Math.min(Dl,Be.value):Math.min(Ee.value,Dl);const tm=Math.max(1,Be.value||Ue.value||Do);Ee.value<Dl?Fy(tm,{immediate:!U}):gt(Ee.value)},{immediate:!0}),ze(ye,(mo,Do)=>{Ae.value&&(typeof Do=="number"&&mo<=Do||mo>Ee.value&&Fy())}),{cleanupBatchScheduler:Ry}})({props:v,isClient:le,isTestEnv:gn,parsedNodesIdentity:Xo,parsedNodeCount:Oo,desiredRenderedCount:$u,datasetKey:wM,batchingEnabled:Ui,incrementalRenderingActive:fi,resolvedBatchSize:ys,resolvedInitialBatch:Zo,renderedCount:Vn,adaptiveBatchSize:de,previousRenderContext:hi,previousBatchConfig:Te,requestFrame:Ct,cancelFrame:St,hasIdleCallback:mn,cleanupNodeVisibility:mM,onDatasetKeyChanged:A=>{Nl(),Eu(),Cs(),Ka(),A>0&&Au(A)},onDatasetChanged:()=>{it.value&&Js({immediate:!0})}});ze([L0,it,()=>T.value,()=>X()],([A,B])=>{if(!A)return U0(),void up();gM(),B?Js({immediate:!0}):up()},{flush:"post",immediate:!0}),ze([()=>Je.value.length,()=>it.value],A=>_n(null,[A],function*([B,U]){U&&B&&le&&(yield ht(),Js({immediate:!0}))}),{flush:"post"}),ze(nn,A=>{A&&(function(){var B;if(ho.value&&Nn.value&&cn.value&&((B=wn.value)!=null&&B[1]))return;const U=fr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),j=fr({type:"list_item",children:[U],raw:"- Probe paragraph text"}),Z=fr({type:"list",ordered:!1,items:[j],raw:"- Probe paragraph text"});ho.value=U,Nn.value=j,cn.value=Z;const me={1:null,2:null,3:null,4:null,5:null,6:null};for(let ye=1;ye<=6;ye++)me[ye]=fr({type:"heading",level:ye,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ye)} Probe heading`});wn.value=me})()},{immediate:!0}),ze([()=>T.value,nn],()=>{if(!nn.value)return pp(),void(K.value=0);j0(),pp(),nn.value&&T.value&&typeof ResizeObserver<"u"&&(Da=new ResizeObserver(()=>{j0(),ks.value&&Oa(),Ot.value&&El(),un("resize")}),Da.observe(T.value))},{immediate:!0}),ze([nn,je,ts],()=>_n(null,null,function*(){if(!nn.value)return G.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Cs();yield ht(),(function(){if(!nn.value||typeof window>"u")return G.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Cs();const A={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=q0(hp(I.value),".paragraph-node");A.paragraph=og(I.value,B,"pre-wrap");const U=hp(R.value),j=U?.querySelector(".paragraph-node");A.listItem=og(R.value,j,"pre-wrap");const Z=lt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ye,_e;return(_e=(ye=D.value)==null?void 0:ye.offsetHeight)!=null?_e:0}),me=lt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ye,_e;return(_e=(ye=R.value)==null?void 0:ye.offsetHeight)!=null?_e:0});A.listWrapperOverhead=Math.max(0,Z-me);for(let ye=1;ye<=6;ye++){const _e=q0(hp(F[ye]),`h${ye}`);A.headings[ye]=og(F[ye],_e,"pre-wrap")}G.value=A,Cs()})()}),{flush:"post",immediate:!0}),ze(()=>Je.value.length,()=>{it.value&&Js({immediate:!0})}),ze([nn,K],()=>{Cs(),it.value&&Js({immediate:!0}),ks.value&&Oa(),Ot.value&&El(),un("resize")},{immediate:!1}),ze(()=>qi.value,A=>{if(A)for(const[B,U]of Le)vy(B,U);else{fp();for(const[B,U]of Le)U&&Vi(B,!0)}},{immediate:!1}),ze([()=>v.viewportPriority,()=>Je.value.length],([A,B])=>{A!==!1?z.value&&B<=200&&(z.value=!1):z.value=!1}),ze(()=>Vn.value,()=>{it.value&&Js({immediate:!0})}),ze([_s,tt,Ra,()=>Je.value.length,it],()=>{Lr()},{immediate:!0});let Ya=null,Xa=!1,Ll=null;function Qa(){Ya=null,Cp=null,_p=void 0,Tl=null,Ka()}function Kp(){Nl(),Eu(),Cs(),Lt.clear();const A=Je.value.length;A>0&&Au(A),Op()}function Gp(){Up(),H0(),ja=null,Br=null,Fr=null,Hu=null,Wa=null,Ua=null,Xa=!1,Qa(),J0("restore"),Tu(),Ml()}function Za(A){var B;return[(B=Kn())!=null?B:"",vn(),gi(),Du.value,Va(A),Je.value.length,Math.round(Ki(0,Je.value.length)),Math.round(Rr()),ws.count,Math.round(ws.total)].join(":")}function ky(){return _n(this,null,function*(){var A,B,U,j;const Z=(A=o.virtualScroll)==null?void 0:A.settledToken,me=Va(Z),ye=vn(),_e=Kn(),De=ts.value;if(Tt.value&&((B=o.virtualScroll)==null?void 0:B.settleMode)==="manual"&&Bu(Z))if(Sp()){if(Za(Z)!==Tl&&!Xa){Xa=!0;try{const Ae=yield Rp({reason:"manual",expectedSettledTokenKey:me}),Ue=Va()===me;Pp(ye,_e,De)&&Ae.sessionKey===ye&&Ae.threadKey===_e&&Ue&&Ae.stable&&Ae.phase==="final"&&(Tl=Za((U=o.virtualScroll)==null?void 0:U.settledToken))}finally{Xa=!1,yield ht();const Ae=(j=o.virtualScroll)==null?void 0:j.settledToken,Ue=Bu(Ae)?Za(Ae):"";Pp(ye,_e,De)&&Ue&&Tl!==Ue&&ky()}}}else un("manual")})}ze(Tt,(A,B)=>{if(A!==B){if(!A)return Gp(),void Up();Gp(),Kp(),Ll=ts.value,un("content")}},{flush:"post"}),ze([Tt,ts],([A,B])=>{A?Ll!=null?Ll!==B&&(Ll=B,(function(U="resize"){Nl(),Eu(),Cs(),Lt.clear();const j=Je.value.length;j>0&&Au(j),Op(),Br=null,Fr=null,Hu=null,ja=null,Xa=!1,Qa(),uy(),ht(()=>{vi(),ks.value&&Oa(),Ot.value&&El(),un(U)})})("resize")):Ll=B:Ll=null},{flush:"post",immediate:!0}),ze([Tt,()=>vn(),()=>Kn()],([A])=>{A&&(Gp(),Kp(),J0("content"),un("content"))}),ze([Tt,()=>vn(),()=>Kn(),ts,()=>Je.value.length],([A])=>{A&&(function(B="async-node"){let U=!1;for(const[j,Z]of Array.from(Zs.entries()))bp(Z)||(Zs.delete(j),Jo.delete(j),U=!0);U&&(Sl(),un(B))})("async-node")},{flush:"post"}),ze([Tt,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.sessionKey},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey},()=>o.indexKey,()=>ne.value],([A])=>{A&&(Ka(),(function(B="content"){if(!Tt.value)return;const U=[],j=Je.value.length;for(const Z of Array.from(Lt.keys())){if(Z>=j){U.push(Z);continue}const me=Ha(Z),ye=Lt.get(Z);ye!=null&&ye!==me&&U.push(Z),Lt.set(Z,me)}for(const Z of Array.from(Lt.keys()))Z>=j&&Lt.delete(Z);U.length&&((function(Z,me={}){const ye=Array.from(Z,Number);dM(ye,me)>0&&(function(De){for(const Ae of De)Lt.delete(Ae)})(ye)})(U,{notify:!1}),Cs(),Qa(),ks.value&&Oa(),Ot.value&&El(),un(B))})("content"))},{flush:"post",immediate:!0}),ze([Tt,()=>Je.value.length,()=>vn(),()=>Kn()],([A,B,U,j],[Z,me,ye,_e])=>{A&&Z&&U===ye&&j===_e&&B!==me&&Qa()},{flush:"post"}),ze([Tt,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.heightCache},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.heightCacheWidth},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey},()=>Je.value.length,()=>vn(),K],()=>{uy()},{flush:"post",immediate:!0}),ze([Tt,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreAnchor},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey},()=>Je.value.length,()=>vn(),K],A=>_n(null,[A],function*([B,U]){if(!B||!U)return;yield ht();const j=(function(){var Z;const me=(Z=o.virtualScroll)==null?void 0:Z.restoreAnchor;return me==null||me===!1?null:me===!0?"true":String(me)})();Lp(U,{restoreAnchor:j!=null,restoreToken:j??void 0})}),{flush:"post",immediate:!0}),ze([Tt,K,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey}],([A])=>{var B;if(!A)return;const U=(B=o.virtualScroll)==null?void 0:B.restoreState;U&&Br&&Fr==="restore"&&(ay(U)||(Kp(),Br=null,Fr=null,un("resize")))},{flush:"post"}),ze([Tt,()=>Je.value.length,()=>vn(),K],A=>_n(null,[A],function*([B]){var U;const j=Wa,Z=Ua;B&&j&&(yield ht(),!Lp(j,{restoreAnchor:Z?.restoreAnchor===!0,restoreToken:(U=Z?.restoreToken)!=null?U:"imperative",allowUncapturedAnchor:Z?.allowUncapturedAnchor===!0})&&dy(j)||(Wa=null,Ua=null))}),{flush:"post",immediate:!0}),ze([Tt,W,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.settleMode},()=>vn(),()=>Kn(),ts,ap,P0,()=>Vn.value,$u,()=>ws.count,()=>ws.total],([A,B,U])=>{if(!A||B!==!0||U==="manual"||!xp())return;const j=(function(){var Z;const me=Je.value.length;return[(Z=Kn())!=null?Z:"",vn(),gi(),Du.value,me,Math.round(Ki(0,me)),Math.round(Rr()),ws.count,Math.round(ws.total)].join(":")})();Ya!==j&&(Ya=j,Rp({reason:"final"}).then(Z=>{Z.stable||Ya!==j||(Ya=null)}))},{flush:"post",immediate:!0}),ze([Tt,W,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.settleMode},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.settledToken},()=>vn(),()=>Kn(),ts,ap,P0,()=>Vn.value,$u,()=>Je.value.length,()=>ws.count,()=>ws.total],()=>{ky()},{flush:"post",immediate:!0}),ze([()=>Je.value.length,it,tt,Ra,()=>ro.start,()=>ro.end],([A,B,U,j,Z,me])=>{ue.value&&ae("virtualization",{nodes:A,virtualization:B,maxLiveNodes:U,buffer:j,focusIndex:_s.value,scroll:B?(()=>{const ye=hn.value||Se();return ye?{reverse:q(ye),scrollTop:Math.round(ye.scrollTop),scrollTopAbs:Math.round(Math.abs(ye.scrollTop)),scrollHeight:Math.round(ye.scrollHeight),clientHeight:Math.round(ye.clientHeight)}:null})():null,liveRange:{start:Z,end:me},rendered:Vn.value})}),ze([()=>v.customId],([A],B,U)=>{if(!A||On)return;const j=(function(Z,me){return Z?(Gn.controllers[Z]=me,()=>{Gn.controllers[Z]===me&&delete Gn.controllers[Z]}):()=>{}})(A,{captureRestoreAnchor:T0,restoreAnchor:A0,getAnchorDrift:lM,getReport:yM});U(()=>{j()})},{immediate:!0}),Yo(()=>{(function(){if(Tt.value)try{vi(),qa();const A=Dr("manual");hy(A)&&(M(A),ja=A,Bp=za());const B=Al(A,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&($(B),B.anchor&&P(B.anchor),Il=Ga(B))}catch{}})(),EM(),fp(),$e(),yy();for(const A of ji.values())for(const B of A)Lu(B);ji.clear(),Or.clear(),Lt.clear(),Vp(),Nl(),pp(),Tu(),Ml(),Up(),U0(),up()});const IM=ai({loader:()=>_n(null,null,function*(){try{return(yield cs(()=>import("./index11-CqNiMTbJ.js"),__vite__mapDeps([6,3]))).default}catch(A){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',A),ss}}),loadingComponent:Fq,delay:0}),$M=ai({loader:()=>_n(null,null,function*(){try{return(yield cs(()=>import("./index10-C4yIRdle.js"),[])).default}catch(A){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',A),ss}}),loadingComponent:Bq,delay:0}),NM=ai(()=>_n(null,null,function*(){try{return(yield cs(()=>import("./index7-DHshPD9x.js"),[])).default}catch(A){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',A),ss}})),by={text:$n,paragraph:dl,heading:Gf,code_block:Ym,list:ka,list_item:ya,blockquote:zd,table:Bc,definition_list:Vd,footnote:Kd,footnote_reference:hs,footnote_anchor:Rc,admonition:Qd,vmr_container:Yd,hardbreak:kr,link:No,image:yr,thematic_break:Gd,math_inline:Gs,math_block:PA,strong:Io,emphasis:Lo,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,checkbox:fs,checkbox_input:fs,inline_code:_o,html_inline:ps,reference:Eo,html_block:Dc},LM=H(()=>yp()),wy=H(()=>X_(v.codeBlockProps)),OM=H(()=>X_(v.codeBlockProps,{omit:["langs"]})),_y=H(()=>et(et({stream:v.codeBlockStream,darkTheme:v.codeBlockDarkTheme,lightTheme:v.codeBlockLightTheme,monacoOptions:v.codeBlockMonacoOptions,themes:v.themes,langs:u.value==="shiki"?v.langs:void 0,minWidth:v.codeBlockMinWidth,maxWidth:v.codeBlockMaxWidth},typeof ve.value=="boolean"?{showTooltips:ve.value}:{}),OM.value)),Cy=H(()=>et(At(et({},_y.value),{langs:v.langs}),wy.value));function Sy(A){return typeof A=="boolean"?A:void 0}const PM=H(()=>{const A=v.codeBlockProps||{},B={},U=Sy(A.showLineNumbers);U!==void 0&&(B.showLineNumbers=U);const j=Sy(A.diffInline);j!==void 0&&(B.diffInline=j);const Z=(function(me){const ye=Number(me);return Number.isFinite(ye)&&ye>0?ye:void 0})(A.reservedHeightPx);return Z!==void 0&&(B.reservedHeightPx=Z),B}),RM=H(()=>et(et({stream:v.codeBlockStream,darkTheme:v.codeBlockDarkTheme,lightTheme:v.codeBlockLightTheme,themes:v.themes,langs:v.langs,minWidth:v.codeBlockMinWidth,maxWidth:v.codeBlockMaxWidth},typeof ve.value=="boolean"?{showTooltips:ve.value}:{}),wy.value)),DM=H(()=>et({},v.mermaidProps||{})),xy=H(()=>et({},v.d2Props||{})),BM=H(()=>et({},v.infographicProps||{})),Ja=H(()=>({typewriter:v.typewriter,fade:v.fade,customHtmlTags:jn.value.customHtmlTags})),FM=H(()=>et(et({},Ja.value),typeof ve.value=="boolean"?{showTooltip:ve.value}:{})),HM=H(()=>et(et({},Ja.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{})),WM=H(()=>et(et({},Ja.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{})),UM=H(()=>et(et({},Ja.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{}));function qM(A){return Array.isArray(A.children)&&A.children.length>0}const Yp=H(()=>vM.value.map(A=>{var B,U,j,Z,me,ye,_e,De;let Ae=(function(ot){var st,gt,mt,Ut,yt,It,Et;if(ot.type!=="code_block")return ot;const Xt=ot,ns=[String((st=Xt.language)!=null?st:""),String((gt=Xt.loading)!=null?gt:""),String((mt=Xt.diff)!=null?mt:""),String((Ut=Xt.code)!=null?Ut:""),String((yt=Xt.originalCode)!=null?yt:""),String((It=Xt.updatedCode)!=null?It:""),String((Et=Xt.raw)!=null?Et:"")].join("\0"),So=kt.get(Xt);if(So&&So.signature===ns)return So.node;const Hs=et({},Xt);return kt.set(Xt,{signature:ns,node:Hs}),Hs})(A.node);const Ue=qu(Ae);let Be=Ey(Ae,Ue);if((Ae.type==="html_block"||Ae.type==="html_inline")&&Be===by[Ae.type]){const ot=Ae,st=String((B=ot.tag)!=null?B:"").trim().toLowerCase()||xT(ot.content);if(st){const gt=Nt.value[st];if(Ft.value.has(st)&>)Be=gt,Ae=At(et({},ot),{type:st,tag:st,content:f7(ot.content,st)});else if(TT((U=ot.content)!=null?U:ot.raw,st)){const mt=String((Z=(j=ot.content)!=null?j:ot.raw)!=null?Z:"");Ae.type==="html_inline"?(Be=$n,Ae={type:"text",content:mt,raw:mt}):(Be=dl,Ae={type:"paragraph",children:[{type:"text",content:mt,raw:mt}],raw:mt})}}}const Ee=Ae.type==="code_block"&&u.value==="pre"&&Be===ss&&!Xp(Nt.value,Ue);let He=et({},(function(ot,st,gt){const mt=st??qu(ot);if(ot.type==="code_block"){const Ut=mt?Xp(Nt.value,mt):void 0;if(gt&&u.value==="pre"&&!Ut&>===ss)return PM.value;if(gt&&mt&>===Ut)return mt==="mermaid"?Ay(ot):mt==="infographic"?My(ot):mt==="d2"||mt==="d2lang"?xy.value:Cy.value;if(gt&>===Nt.value.code_block)return Cy.value;if(V0(gt))return RM.value}return mt==="mermaid"?Ay(ot):mt==="infographic"?My(ot):mt==="d2"||mt==="d2lang"?xy.value:ot.type==="link"?FM.value:ot.type==="list"?HM.value:ot.type==="blockquote"?WM.value:ot.type==="table"?UM.value:ot.type==="code_block"?_y.value:Ja.value})(Ae,Ue,Be));const Ke=Pr.value[A.index];Ae.type==="code_block"&&Ke?.kind==="code-block"&&(He=At(et({},He),Ee?{reservedHeightPx:(me=Ke.height)!=null?me:Ke.contentHeight}:{estimatedHeightPx:Ke.height,estimatedContentHeightPx:Ke.contentHeight})),Ee||Ae.type!=="code_block"||Ue!=="mermaid"||oa(He.estimatedPreviewHeightPx)!=null||(He=At(et({},He),{estimatedPreviewHeightPx:m1(h1(String((ye=Ae.code)!=null?ye:"")))})),Ee||Ae.type!=="code_block"||Ue!=="infographic"||oa(He.estimatedPreviewHeightPx)!=null||(He=At(et({},He),{estimatedPreviewHeightPx:g1(p1(String((_e=Ae.code)!=null?_e:"")))})),Ae.type==="math_block"&&(He=At(et({},He),{cacheScope:An.value}));const Ge=(function(ot,st){const gt=String(ot.type);return!_u(gt)&&Nt.value[gt]===st})(Ae,Be),pt=Ge?o0(Ae,Ne.value):void 0;return At(et({},A),{node:Ae,component:Be,bindings:He,customBindings:et(et({},pt??{}),He),rendersCustomNode:Ge,hasSlotChildren:qM(Ae),slotContent:String((De=Ae.content)!=null?De:""),isCodeBlock:Ae.type==="code_block",indexKey:`${LM.value}-${A.index}`})}));function qu(A){var B;return A?.type==="code_block"?String((B=A.language)!=null?B:"").trim().toLowerCase():""}function Xp(A,B){const U=B.trim().toLowerCase();if(U)for(const j of[U,Jv(U),bA(U)]){const Z=j&&A[j];if(Z)return Z}}function Ty(A,B,U,j){var Z,me;const ye=et({},A.value);return oa(ye.estimatedPreviewHeightPx)==null&&(ye.estimatedPreviewHeightPx=j(U(String((Z=B?.code)!=null?Z:"")),void 0,ye.maxHeight==="none"?null:(me=oa(ye.maxHeight))!=null?me:void 0)),ye}function Ay(A){return Ty(DM,A,h1,m1)}function My(A){return Ty(BM,A,p1,g1)}function Ey(A,B){if(!A)return T1;const U=Nt.value,j=U[String(A.type)];if(A.type==="code_block"){const Z=B??qu(A),me=Z?Xp(U,Z):void 0;return me||(u.value==="pre"?U.code_block||ss:Z==="mermaid"?U.mermaid||IM:Z==="infographic"?U.infographic||$M:Z==="d2"||Z==="d2lang"?U.d2||NM:j||U.code_block||K0.value)}return j||by[String(A.type)]||T1}function Qp(A){s("click",A)}function jM(A){var B;(B=A.target)!=null&&B.closest("[data-node-index]")&&s("mouseover",A)}function zM(A){var B;(B=A.target)!=null&&B.closest("[data-node-index]")&&s("mouseout",A)}function Iy(A){s("mouseover",A)}function $y(A){s("mouseout",A)}const Ur=te(null),ei=te(!1);let ec,Ol=null,Zp=0,ju=0,zu=0;const Ny=["code_block","admonition","table","math_block","html_block","image","thematic_break"],VM=new Set(Ny),Ly=[".typewriter-cursor",".height-estimation-probes",...Ny.map(A=>`[data-node-type="${A}"]`),"script","style"].join(",");function Oy(A){if(!A||typeof A!="object")return!1;const B=A.type;return typeof B=="string"&&VM.has(B)}function Vu(A){var B,U;if(!A||typeof A!="object")return 0;const j=A,Z=(U=(B=j.raw)!=null?B:j.content)!=null?U:j.code;if(typeof Z=="string")return Z.length;const me=j.children;if(Array.isArray(me))return me.reduce((_e,De)=>_e+Vu(De),0);const ye=j.items;return Array.isArray(ye)?ye.reduce((_e,De)=>_e+Vu(De),0):0}function Ku(){ec&&(clearTimeout(ec),ec=void 0)}function Py(){Zp+=1,Ol!=null&&(St?.(Ol),Ol=null)}function Gu(){Py(),Ur.value&&(Ur.value.style.visibility="hidden")}function KM(A){var B;if(A.nodeType!==Node.TEXT_NODE||!((B=A.textContent)!=null?B:"").trim())return!1;const U=A.parentElement;return!!U&&!U.closest(Ly)}function GM(A){let B=A.lastChild;for(;B;){if(KM(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const U=B;if(!U.matches(Ly)&&U.lastChild){B=U.lastChild;continue}}for(;B&&B!==A&&!B.previousSibling;)B=B.parentNode;if(!B||B===A)break;B=B.previousSibling}return null}function Jp(){if(!le||!ei.value||Ol!=null)return;const A=Zp,B=()=>{Ol=null,A===Zp&&(function(){var U,j;if(!(le&&ei.value&&T.value&&Ur.value))return;const Z=T.value,me=Ur.value;me.style.visibility="hidden";const ye=(function(){const Be=Yp.value;for(let Ee=Be.length-1;Ee>=0;Ee--){const He=Be[Ee];if(!He||Oy(He.node)||!jp(He.index))continue;const Ke=Le.get(He.index);if(!Ke)continue;const Ge=GM(Ke);if(Ge)return Ge}return null})();if(!ye)return;let _e=0,De=0,Ae=20,Ue=!1;if(ye?.textContent){const Be=ye.textContent.length,Ee=document.createRange();Ee.setStart(ye,Math.max(0,Be-1)),Ee.setEnd(ye,Be);const He=typeof Ee.getClientRects=="function"?Ee.getClientRects():void 0,Ke=(j=He?.[He.length-1])!=null?j:(U=ye.parentElement)==null?void 0:U.getBoundingClientRect();if(Ke){const Ge=lt("typewriterCursor.root.getBoundingClientRect",()=>Z.getBoundingClientRect());_e=Ke.right-Ge.left+Z.scrollLeft,De=Ke.top-Ge.top+Z.scrollTop,Ae=Ke.height||Ae,Ue=!0}Ee.detach()}Ue&&(me.style.transform=`translate(${Math.max(0,_e)}px, ${Math.max(0,De)}px)`,me.style.height=`${Ae}px`,me.style.visibility="visible")})()};Ct?Ol=Ct(B):B()}return ze([fe,()=>o.content,()=>o.nodes,()=>v.typewriter,W],()=>_n(null,null,function*(){var A,B;if(!le||We.value||!Q.value)return;if(W.value)return ei.value=!1,Ku(),void Gu();if((A=o.nodes)!=null&&A.length)return ei.value=!1,Ku(),Gu(),ju=((B=o.content)!=null?B:"").length,void(zu=fe.value.length);const U=(function(){var _e,De;return(_e=o.nodes)!=null&&_e.length?o.nodes.reduce((Ae,Ue)=>Ae+Vu(Ue),0):((De=o.content)!=null?De:"").length})(),j=(function(){var _e;return(_e=o.nodes)!=null&&_e.length?o.nodes.reduce((De,Ae)=>De+Vu(Ae),0):fe.value.length})(),Z=!Oy(Je.value[Je.value.length-1]),me=U>ju,ye=j>zu;if(v.typewriter===!1||!Z||!me&&!ye)return v.typewriter!==!1&&Z||(ei.value=!1,Gu()),ju=U,void(zu=j);ju=U,zu=j,ei.value=!0,Ur.value&&(Ur.value.style.visibility="hidden"),Ku(),yield ht(),Jp(),ec=setTimeout(()=>{ec=void 0,ei.value=!1},3e3)}),{flush:"post",immediate:!0}),ze(ei,A=>_n(null,null,function*(){A?(yield ht(),Jp()):Gu()}),{flush:"post"}),ze([()=>Vn.value,()=>ro.start,()=>ro.end],()=>_n(null,null,function*(){le&&!We.value&&Q.value&&ei.value&&(yield ht(),Jp())}),{flush:"post"}),Yo(()=>{Ku(),Py(),fn.clear()}),(A,B)=>{const U=wI("NodeRenderer",!0);return S(We)?(C(!0),E(Pe,{key:0},Xe(Yp.value,j=>(C(),E(Pe,{key:j.index},[j.rendersCustomNode?(C(),Ve(ko(j.component),en({key:0,ref_for:!0},j.customBindings,{node:j.node,loading:j.node.loading,"index-key":j.indexKey,"custom-id":v.customId,"is-dark":v.isDark,onClick:Qp,onMouseover:Iy,onMouseout:$y,onCopy:B[0]||(B[0]=Z=>s("copy",Z)),onHandleArtifactClick:B[1]||(B[1]=Z=>s("handleArtifactClick",Z))}),{default:In(()=>[j.hasSlotChildren?(C(),Ve(U,en({key:0,ref_for:!0},Qn.value,{nodes:j.node.children,"index-key":j.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):j.slotContent?(C(),Ve(U,en({key:1,ref_for:!0},Qn.value,{content:j.slotContent,final:!j.node.loading,"index-key":`${j.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),Ve(ko(j.component),en({key:1,node:j.node,loading:j.node.loading,"index-key":j.indexKey},{ref_for:!0},j.bindings,{"custom-id":v.customId,"is-dark":v.isDark,onClick:Qp,onMouseover:Iy,onMouseout:$y,onCopy:B[2]||(B[2]=Z=>s("copy",Z)),onHandleArtifactClick:B[3]||(B[3]=Z=>s("handleArtifactClick",Z))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(C(),E("div",{key:1,ref_key:"containerRef",ref:T,class:Oe(["markstream-vue markdown-renderer",[{dark:v.isDark},{virtualized:it.value},{"virtual-scroll-coordinated":io.value}]]),"data-custom-id":v.customId,onClick:Qp,onMouseover:jM,onMouseout:zM},[Ro.value||it.value?(C(),E(Pe,{key:0},[Ro.value?(C(),E("div",{key:0,class:"height-estimation-probes",style:Wt({width:`${je.value}px`}),"aria-hidden":"true"},[p("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[vt(S(dl),{node:ho.value,"index-key":"probe-paragraph"},null,8,["node"])],512),p("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[p("ul",Wq,[vt(S(ya),{node:Nn.value,"index-key":"probe-list-item"},null,8,["node"])])],512),p("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[vt(S(ka),{node:cn.value,"index-key":"probe-list"},null,8,["node"])],512),(C(),E(Pe,null,Xe(6,j=>p("div",{key:`probe-heading-${j}`,ref_for:!0,ref:Z=>(function(me,ye){me<1||me>6||(F[me]=ye)})(j,Z),class:"node-content","data-probe":`heading-${j}`},[vt(S(Gf),{node:pM(j),"index-key":`probe-heading-${j}`},null,8,["node","index-key"])],8,Uq)),64))],4)):ie("",!0),it.value?(C(),E("div",{key:1,class:"node-spacer",style:Wt({height:`${gp.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],64)):ie("",!0),(C(!0),E(Pe,null,Xe(Yp.value,j=>(C(),E("div",{key:j.index,ref_for:!0,ref:Z=>vy(j.index,Z),class:"node-slot","data-node-index":j.index,"data-node-type":j.node.type},[jp(j.index)?(C(),E("div",{key:0,ref_for:!0,ref:Z=>(function(me,ye){var _e;ye||(function(Be){const Ee=`${yp()}-${Be}`;let He=!1;for(const Ke of Array.from(Jo.keys())){const Ge=Zs.get(Ke);(Ge?.index===Be||Ke===Ee||Ke.startsWith(`${Ee}-`))&&(Jo.delete(Ke),Zs.delete(Ke),He=!0)}He&&(Sl(),un("async-node"))})(me),mi.delete(me),(function(Be){var Ee;const He=((Ee=Or.get(Be))!=null?Ee:0)+1;Or.set(Be,He)})(me);const De=ji.get(me);if(De){for(const Be of De)Lu(Be);ji.delete(me)}if((function(Be){const Ee=Me.get(Be);Ee&&(pe?.unobserve(Ee),J.delete(Ee),Me.delete(Be))})(me),!ye||!Ie.value)return Qs.delete(me),void Or.delete(me);Qs.set(me,ye);const Ae=()=>{Uu(me,ye)};queueMicrotask(Ae);const Ue=(pe||typeof ResizeObserver>"u"||(pe=new ResizeObserver(Be=>{if(Be.length)for(const Ee of Be){const He=J.get(Ee.target),Ke=Me.get(He??-1);He!=null&&Ke&&Uu(He,Ke)}else vi()})),pe);if(Ue&&(Me.set(me,ye),J.set(ye,me),Ue.observe(ye)),typeof window<"u"){const Be=((_e=Je.value[me])==null?void 0:_e.type)==="code_block"?[16,80,240,800]:W.value?[80]:[];if(Be.length){const Ee=Be.map(He=>F0(He,Ae,"node-resize")).filter(He=>He!=null);Ee.length&&ji.set(me,Ee)}}})(j.index,Z),class:"node-content"},[j.isCodeBlock?j.rendersCustomNode?(C(),Ve(ko(j.component),en({key:1,ref_for:!0},j.customBindings,{node:j.node,loading:j.node.loading,"index-key":j.indexKey,"custom-id":v.customId,"is-dark":v.isDark,onCopy:B[8]||(B[8]=Z=>s("copy",Z)),onHandleArtifactClick:B[9]||(B[9]=Z=>s("handleArtifactClick",Z))}),{default:In(()=>[j.hasSlotChildren?(C(),Ve(U,en({key:0,ref_for:!0},Qn.value,{nodes:j.node.children,"index-key":j.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):j.slotContent?(C(),Ve(U,en({key:1,ref_for:!0},Qn.value,{content:j.slotContent,final:!j.node.loading,"index-key":`${j.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),Ve(ko(j.component),en({key:2,node:j.node,loading:j.node.loading,"index-key":j.indexKey},{ref_for:!0},j.bindings,{"custom-id":v.customId,"is-dark":v.isDark,onCopy:B[10]||(B[10]=Z=>s("copy",Z)),onHandleArtifactClick:B[11]||(B[11]=Z=>s("handleArtifactClick",Z))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(C(),Ve(Fi,{key:0,name:"fade",css:v.fade!==!1,appear:v.fade!==!1},{default:In(()=>[j.rendersCustomNode?(C(),Ve(ko(j.component),en({key:0,ref_for:!0},j.customBindings,{node:j.node,loading:j.node.loading,"index-key":j.indexKey,"custom-id":v.customId,"is-dark":v.isDark,onCopy:B[4]||(B[4]=Z=>s("copy",Z)),onHandleArtifactClick:B[5]||(B[5]=Z=>s("handleArtifactClick",Z))}),{default:In(()=>[j.hasSlotChildren?(C(),Ve(U,en({key:0,ref_for:!0},Qn.value,{nodes:j.node.children,"index-key":j.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):j.slotContent?(C(),Ve(U,en({key:1,ref_for:!0},Qn.value,{content:j.slotContent,final:!j.node.loading,"index-key":`${j.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),Ve(ko(j.component),en({key:1,node:j.node,loading:j.node.loading,"index-key":j.indexKey},{ref_for:!0},j.bindings,{"custom-id":v.customId,"is-dark":v.isDark,onCopy:B[6]||(B[6]=Z=>s("copy",Z)),onHandleArtifactClick:B[7]||(B[7]=Z=>s("handleArtifactClick",Z))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(C(),E("div",{key:1,class:"node-placeholder",style:Wt({height:`${Ru(j.index)}px`})},null,4))],8,qq))),128)),ei.value?(C(),E("span",{key:1,ref_key:"typewriterCursorRef",ref:Ur,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ie("",!0),it.value?(C(),E("div",{key:2,class:"node-spacer",style:Wt({height:`${vp.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],42,Hq))}}})),[["__scopeId","data-v-2e8e6e17"]]),Go=GA;Go.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Go.__name,Go.name].filter(n=>!!n));for(const n of t)e.component(n,GA)};const u0=Object.freeze(Object.defineProperty({__proto__:null,default:Go},Symbol.toStringTag,{value:"Module"})),jq={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"},zq={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"},Vq={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"},Kq={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"},Gq={class:"admonition-title"},Yq=["aria-expanded","aria-controls"],Xq=["id"],Qd=Jt(Qe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,s=t,i=H(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=te(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(C(),E("div",{class:Oe(["admonition",[`admonition-${o.node.kind}`]])},[p("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(C(),E("svg",jq,[...u[1]||(u[1]=[p("circle",{cx:"12",cy:"12",r:"10"},null,-1),p("path",{d:"M12 16v-4"},null,-1),p("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(C(),E("svg",zq,[...u[2]||(u[2]=[p("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),p("path",{d:"M9 18h6"},null,-1),p("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(C(),E("svg",Vq,[...u[3]||(u[3]=[p("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),p("path",{d:"M12 9v4"},null,-1),p("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(C(),E("svg",Kq,[...u[4]||(u[4]=[p("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),p("path",{d:"M12 8v4"},null,-1),p("path",{d:"M12 16h.01"},null,-1)])])):ie("",!0),p("span",Gq,O(i.value),1),o.node.collapsible?(C(),E("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(C(),E("svg",{style:Wt({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]=[p("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Yq)):ie("",!0)]),jt(p("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[vt(S(Go),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Xq),[[js,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Qd.install=e=>{e.component(Qd.__name,Qd)};const YA=()=>cs(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let xd=null,Qq=YA;function sme(){return _n(this,null,function*(){if(xd)return xd;const e=Qq;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===YA?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(xd=(function(n){var o;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),xd):null})}function ime(){return!1}function rme(){return _n(this,null,function*(){return null})}const Td=te(!1);let l2=!1;function ig(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Zq(){return!l2&&typeof window<"u"&&typeof document<"u"&&(l2=!0,Td.value=ig(),new MutationObserver(()=>{Td.value=ig()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Td.value=ig()})),Td}const XA=["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"],Jq=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),$1=[...XA].sort((e,t)=>t.length-e.length).join("|"),rg=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${$1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${$1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),QA=/[),.;!?,。;!?)]+$/;function ej(e){const t=e.toLowerCase();return XA.some(n=>t.endsWith(`.${n}`))}function tj(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${$1}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function nj(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(QA,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=Jq.has(i),a=ej(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function oj(e,t={}){const n=[];rg.lastIndex=0;let o;for(;(o=rg.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const c=a.replace(QA,""),u=a.length-c.length;a=c;const d=nj(a,t);if(!d)continue;const f=o.index+r,g=f+a.length;n.push({...d,start:f,end:g,text:a}),u>0&&(rg.lastIndex-=u)}return n}const sj=12e4,ij=6e4,rj=32,lj=3e4,a2=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function aj(e){let t=0,n=0,o=0;a2.lastIndex=0;let s;for(;(s=a2.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=sj||n>=ij||t>=rj||o>=lj?"pre":"shiki",codeFenceCount:t,codeChars:n}}const cj={key:1,class:"diff-wrap"},uj={class:"diff-bar"},dj=["title","onClick"],fj={class:"diff-pre"},hj="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",c2="github-light",u2="github-dark",pj=Qe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){rW();function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=xt(),o=Bt("resolveImage"),s=te(null),i=e,r=H(()=>!i.streaming),l=H(()=>tj(i.text??"")),a=H(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:aj(i.text??"")),c=Zq(),u=H(()=>!i.streaming),d=as(new Map),f=new Set,g=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,h=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(R){return!/^(https?:|data:|blob:)/i.test(R)}function _(R){if(!o)return;const D=[];for(const F of[g,h]){F.lastIndex=0;let z;for(;(z=F.exec(R))!==null;)D.push(z[2]??"")}for(const F of D)!F||!m(F)||d.has(F)||f.has(F)||(f.add(F),o(F).then(z=>{d.set(F,z!==F?z:"")}).catch(()=>{d.set(F,"")}).finally(()=>{f.delete(F)}))}function w(R){if(!o)return R;const D=F=>{if(!m(F))return null;const z=d.get(F);return z===void 0?hj:z===""?null:z};return R.replace(g,(F,z,V,ne)=>{const K=D(V);return K===null?F:`${z}${K}${ne}`}).replace(h,(F,z,V,ne)=>{const K=D(V);return K===null?F:`${z}${K}${ne}`})}ze(()=>i.text,R=>_(R??""),{immediate:!0});function k(){if(!s.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),D=[];let F=R.nextNode();for(;F;){const z=F,V=z.parentElement;V&&!V.closest("a, pre, .md-file-link")&&z.data.trim().length>0&&D.push(z),F=R.nextNode()}for(const z of D){const V=oj(z.data,{aliases:l.value});if(V.length===0||!z.parentNode)continue;const ne=document.createDocumentFragment();let K=0;for(const G of V){G.start>K&&ne.append(document.createTextNode(z.data.slice(K,G.start)));const X=document.createElement("button");X.type="button",X.className="md-file-link",X.textContent=G.text,X.title=G.line?`${G.path}:${G.line}`:G.path,X.addEventListener("click",be=>{be.preventDefault(),be.stopPropagation(),i.openFile?.({path:G.path,line:G.line})}),ne.append(X),K=G.end}K<z.data.length&&ne.append(document.createTextNode(z.data.slice(K))),z.parentNode.replaceChild(ne,z)}}function b(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function y(R){let D=R.length;for(const F of["#","?"]){const z=R.indexOf(F);z!==-1&&z<D&&(D=z)}return R.slice(0,D)}function x(){if(!s.value||!i.openFile||i.streaming)return;const R=s.value.querySelectorAll("a[href]");for(const D of R){if(D.dataset.mdLinkHandled==="true")continue;const F=D.getAttribute("href")??"";b(F)&&(D.dataset.mdLinkHandled="true",D.addEventListener("click",z=>{z.preventDefault(),z.stopPropagation(),i.openFile?.({path:y(F)})}))}}function L(){ht().then(()=>{k(),x()})}ze(()=>i.text,L),ze(()=>i.streaming,L);let N=null;rn(()=>{L(),s.value&&(N=new MutationObserver(L),N.observe(s.value,{childList:!0,subtree:!0}))}),Yt(()=>{N?.disconnect()});const v={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},M=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,$=H(()=>{const R=w(i.text??""),D=[];let F=0;M.lastIndex=0;let z;for(;(z=M.exec(R))!==null;){const ne=z[1]??"",K=R.slice(F,z.index)+(ne||"");K.trim()&&D.push({kind:"md",text:K}),D.push({kind:"diff",code:z[2]??""}),F=M.lastIndex}const V=R.slice(F);return(V.trim()||D.length===0)&&D.push({kind:"md",text:V}),D});function P(R){return R.split(`
|
|
235
|
-
`).map(D=>/^\+(?!\+\+)/.test(D)?{cls:"diff-add",text:D}:/^-(?!--)/.test(D)?{cls:"diff-del",text:D}:D.startsWith("@@")?{cls:"diff-hunk",text:D}:{cls:"diff-ctx",text:D})}const T=te(null);function I(R,D){wo(R).then(F=>{F&&(T.value=D,setTimeout(()=>{T.value=null},1400))})}return(R,D)=>(C(),E("div",{ref_key:"mdRef",ref:s,class:"md"},[(C(!0),E(Pe,null,Xe($.value,(F,z)=>(C(),E(Pe,{key:z},[F.kind==="md"?(C(),Ve(S(Go),{key:0,content:F.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":S(c),"code-block-light-theme":c2,"code-block-dark-theme":u2,themes:[c2,u2],"code-block-props":v,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(C(),E("div",cj,[p("div",uj,[D[0]||(D[0]=p("span",{class:"diff-lang"},"diff",-1)),p("button",{class:"diff-copy",title:S(n)("filePreview.copyCode"),onClick:V=>I(F.code,z)},O(T.value===z?"✓":"⧉"),9,dj)]),p("pre",fj,[p("code",null,[(C(!0),E(Pe,null,Xe(P(F.code),(V,ne)=>(C(),E("span",{key:ne,class:Oe(V.cls)},O(V.text),3))),128))])])]))],64))),128))],512))}}),lu=bt(pj,[["__scopeId","data-v-84213e3a"]]),mj={class:"tc-anim"},gj={class:"prev-anim"},vj={class:"prev"},yj=Qe({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,o=t,s=H(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=H(()=>n.foldable&&s.value.length>1),r=H(()=>n.streaming||!i.value),l=H(()=>s.value.pop()??""),a=te(null);return rn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),ze(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||ht(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(C(),E("div",{class:Oe(["think",{mob:e.mobile}])},[i.value?(C(),E("div",{key:0,class:Oe(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[p("div",mj,[p("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),p("div",gj,[p("span",vj,O(l.value),1)])],2)):(C(),E("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),d2=bt(yj,[["__scopeId","data-v-42c6573c"]]),kj={class:"activity-notice",role:"status"},bj={class:"an-moon","aria-hidden":"true"},wj={class:"an-label"},_j=120,Cj=Qe({__name:"ActivityNotice",props:{label:{}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"],n=te(0);let o=null;return rn(()=>{o=setInterval(()=>{n.value=(n.value+1)%t.length},_j)}),Yt(()=>{o&&(clearInterval(o),o=null)}),(s,i)=>(C(),E("div",kj,[p("span",bj,O(t[n.value]),1),p("span",wj,O(e.label),1)]))}}),f2=bt(Cj,[["__scopeId","data-v-dfa53d2b"]]),Sj=["disabled"],xj={class:"agent-main"},Tj={class:"agent-title-row"},Aj={class:"agent-name"},Mj={key:0,class:"agent-type"},Ej={class:"agent-phase"},Ij={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"},$j=Qe({__name:"AgentCard",props:{member:{},compact:{type:Boolean}},emits:["open"],setup(e,{emit:t}){const n=e,o=t,s=H(()=>(n.member.outputLines??[]).map(u=>u.trimEnd()).filter(u=>u.length>0).slice(-8)),i=H(()=>s.value.at(-1)),r=H(()=>n.member.phase==="queued"||n.member.phase==="working"||n.member.phase==="suspended"),l=H(()=>!!(n.member.summary||n.member.suspendedReason||n.member.prompt||s.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&&o("open",n.member.id)}return(u,d)=>(C(),E("div",{class:Oe(["agent-card",[`phase-${e.member.phase}`,{compact:e.compact}]])},[p("button",{class:"agent-head",type:"button",disabled:!l.value,onClick:c},[d[1]||(d[1]=p("span",{class:"agent-dot","aria-hidden":"true"},null,-1)),p("span",xj,[p("span",Tj,[p("span",Aj,O(e.member.name),1),e.member.subagentType?(C(),E("span",Mj,O(e.member.subagentType),1)):ie("",!0),r.value?(C(),E("span",{key:1,class:Oe(["agent-live",{empty:!i.value}])},O(i.value),3)):ie("",!0)])]),p("span",Ej,O(a(e.member.phase)),1),l.value?(C(),E("svg",Ij,[...d[0]||(d[0]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])])):ie("",!0)],8,Sj)],2))}}),N1=bt($j,[["__scopeId","data-v-bb535d33"]]),Nj={class:"agent-group"},Lj={class:"group-count"},Oj={key:0,class:"group-live"},Pj={key:0,class:"group-body"},Rj=Qe({__name:"AgentGroup",props:{members:{}},emits:["open"],setup(e,{emit:t}){const n=e,o=t,s=te(!0),i=H(()=>n.members.filter(l=>l.phase==="completed"||l.phase==="failed").length),r=H(()=>n.members.filter(l=>l.phase==="queued"||l.phase==="working"||l.phase==="suspended").length);return(l,a)=>(C(),E("section",Nj,[p("button",{class:"group-head",type:"button",onClick:a[0]||(a[0]=c=>s.value=!s.value)},[a[3]||(a[3]=p("span",{class:"group-title"},"Agents",-1)),p("span",Lj,O(i.value)+"/"+O(e.members.length),1),r.value>0?(C(),E("span",Oj,O(r.value)+" running",1)):ie("",!0),(C(),E("svg",{class:Oe(["group-chevron",{open:s.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]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),s.value?(C(),E("div",Pj,[(C(!0),E(Pe,null,Xe(e.members,c=>(C(),Ve(N1,{key:c.id,member:c,compact:"",onOpen:a[1]||(a[1]=u=>o("open",u))},null,8,["member"]))),128))])):ie("",!0)]))}}),h2=bt(Rj,[["__scopeId","data-v-17ab3c41"]]),Dj=["aria-label"],Bj=120,Fj=60,Hj=Qe({__name:"MoonSpinner",props:{fast:{type:Boolean},label:{default:"Working…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*Bj}ms`,"--moon-frame-fast-delay":`${o*Fj}ms`}}return(o,s)=>(C(),E("span",{class:Oe(["moon-spin",{"moon-spin--fast":e.fast}]),"aria-label":e.label,role:"img"},[(C(),E(Pe,null,Xe(t,(i,r)=>p("span",{key:i,class:"moon-frame",style:Wt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,Dj))}}),L1=bt(Hj,[["__scopeId","data-v-e7ccbb9a"]]);function Wj(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}function p2(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function m2(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=(e%6e4/1e3).toFixed(1);return`${t}m${n}s`}function Vh(e){if(e.blocks)return e.blocks;const t=[];e.thinking&&t.push({kind:"thinking",thinking:e.thinking}),e.text&&t.push({kind:"text",text:e.text});for(const n of e.tools??[])t.push({kind:"tool",tool:n});return t}function Uj(e){return!(e.tool.status==="ok"&&e.tool.media)}function g2(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function v2(e){const t=Vh(e),n=[];let o=[];const s=()=>{if(o.length===1){const[i]=o;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else o.length>1&&n.push({kind:"tool-stack",tools:o});o=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(Uj(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"?n.push({kind:"text",text:i.text,sourceIndex:r}):i.kind==="agent"?n.push({kind:"agent",member:i.member,sourceIndex:r}):n.push({kind:"agentGroup",members:i.members,sourceIndex:r})}),s(),n}function qj(e){return Vh(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
236
|
-
|
|
237
|
-
`)}function jj(e){const t=[];for(const n of Vh(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
238
|
-
> ${n.thinking.split(`
|
|
239
|
-
`).join(`
|
|
240
|
-
> `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const o=n.tool.output.join(`
|
|
241
|
-
`);t.push(`\`\`\`
|
|
242
|
-
[${n.tool.name}]
|
|
243
|
-
${o}
|
|
244
|
-
\`\`\``)}else n.kind==="agent"?t.push(`**Agent** ${n.member.name} (${n.member.phase})`):n.kind==="agentGroup"&&t.push(`**Agents**
|
|
245
|
-
|
|
246
|
-
${n.members.map(o=>`- ${o.name}: ${o.phase}`).join(`
|
|
247
|
-
`)}`);return t.join(`
|
|
248
|
-
|
|
249
|
-
`)}function O1(e){return e.tool.id||`tool-${e.sourceIndex}`}function y2(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?O1({tool:e.tool,sourceIndex:e.sourceIndex}):e.kind==="agent"?`agent-${e.member.id}-${e.sourceIndex}`:e.kind==="agentGroup"?`agent-group-${e.members[0]?.id??e.sourceIndex}`:`${e.kind}-${e.sourceIndex}`}const zj={key:0,class:"chat"},Vj={key:0,class:"chat-loading"},Kj={class:"chat-loading-text"},Gj={key:1,class:"chat-empty"},Yj={key:1,class:"top-sentinel-text"},Xj=["data-turn-id"],Qj={key:0,class:"u-imgs"},Zj=["src"],Jj=["src","alt"],ez={key:1,class:"skill-act"},tz={class:"skill-act-head"},nz={key:0,class:"skill-act-args"},oz={key:2,class:"u-text"},sz={key:0,class:"u-meta"},iz=["data-tooltip","onClick"],rz={class:"u-edit-text"},lz=["onClick"],az=["data-tooltip","onClick"],cz={key:0,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"},uz={key:1,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"},dz=["onClick"],fz=["data-turn-id"],hz=["onClick"],pz={class:"cd-view"},mz={key:1,class:"cd-label"},gz=["data-turn-id"],vz={key:1,class:"msg"},yz={key:2,class:"tool-stack"},kz={key:0,class:"a-msg-ft"},bz=["title"],wz=["onClick"],_z={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"},Cz={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"},Sz={class:"a-cpbtn-text"},xz={key:4,class:"sending-placeholder"},Tz={key:1,class:"term"},Az={key:0,class:"chat-loading"},Mz={class:"chat-loading-text"},Ez={key:1,class:"chat-empty"},Iz={key:1,class:"top-sentinel-text"},$z=["data-turn-id"],Nz=["onClick"],Lz={class:"cd-view"},Oz={key:1,class:"cd-label"},Pz=["data-turn-id"],Rz={class:"no"},Dz={class:"tx"},Bz={class:"role-row"},Fz=["onClick"],Hz={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"},Wz={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"},Uz={class:"cpbtn-text"},qz=["title"],jz={key:0,class:"u-text"},zz={key:0,class:"skill-act"},Vz={class:"skill-act-head"},Kz={key:0,class:"skill-act-args"},Gz={key:2,class:"tool-stack"},Yz=["data-tooltip","onClick"],Xz={class:"u-edit-text"},Qz=["onClick"],Zz={key:4,class:"ln sending-line"},Jz={class:"tx"},eV=Qe({__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},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages"],setup(e,{expose:t,emit:n}){const{t:o}=xt();Yt(()=>{F!==null&&(clearTimeout(F),F=null),M!==null&&(clearTimeout(M),M=null),k!==null&&(clearTimeout(k),k=null)});const s=e,i=H(()=>s.bubble||s.mobile),r=te(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(K=>{K[0]?.isIntersecting&&s.hasMoreMessages&&!s.loadingMore&&!s.loadingMoreError&&!s.sessionLoading&&!s.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}rn(a),Yt(()=>{l?.disconnect(),l=null}),ze(()=>[s.hasMoreMessages,s.loadingMore,s.loadingMoreError],()=>{ht().then(a)});const c=H(()=>{if(!s.running||s.turns.length===0)return null;const K=s.turns.at(-1);return K.role==="assistant"?K.id:null}),u=H(()=>s.sending||s.running),d=n,f=H(()=>{for(let K=s.turns.length-1;K>=0;K--)if(s.turns[K].role==="user")return s.turns[K].id;return null});function g(K){return K.role==="user"&&K.id===f.value&&!s.running&&!s.sending&&!K.skillActivation}function h(K){const G=K.compaction,X=G?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof G?.tokensBefore=="number"&&typeof G?.tokensAfter=="number"?X+o("conversation.compactedTokens",{before:p2(G.tokensBefore),after:p2(G.tokensAfter)}):X}const m=te(null),_=te(null),w=te(null);let k=null;const b=te(new Set);function y(K){return b.value.has(K)}function x(K){const G=new Set(b.value);G.has(K)?G.delete(K):G.add(K),b.value=G}function L(K,G){if(y(G)){const X=new Date(K);if(Number.isNaN(X.getTime()))return K;const be=le=>String(le).padStart(2,"0");return`${X.getFullYear()}-${be(X.getMonth()+1)}-${be(X.getDate())} ${be(X.getHours())}:${be(X.getMinutes())}`}return Wj(K,o("conversation.yesterday"))}function N(K){w.value===null&&(_.value=null,w.value=K.id,k=setTimeout(()=>{k=null,d("editMessage",K.text),w.value=null},240))}const v=te(!1);let M=null;function $(){if(s.turns.length===0)return;const K=[];for(const X of s.turns){if(X.role==="compaction")continue;const be=X.role==="user"?"User":"Assistant",le=jj(X);le.trim()&&K.push(`**${be}**
|
|
250
|
-
|
|
251
|
-
${le}`)}const G=K.join(`
|
|
252
|
-
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
`);wo(G).then(X=>{X&&(v.value=!0,d("copyConversationCopied"),M!==null&&clearTimeout(M),M=setTimeout(()=>{M=null,v.value=!1},2e3))}).catch(()=>{})}function P(K){const G=[];for(let X=K;X>=0;X--){const be=s.turns[X];if(!be||be.role!=="assistant")break;G.unshift(be)}return G}function T(K){return P(K).map(G=>qj(G)).filter(Boolean).join(`
|
|
256
|
-
|
|
257
|
-
`)}function I(){for(let K=s.turns.length-1;K>=0;K-=1)if(s.turns[K]?.role==="assistant")return T(K);return""}function R(){const K=I();K.trim()&&wo(K).then(G=>{G&&(v.value=!0,d("copyConversationCopied"),M!==null&&clearTimeout(M),M=setTimeout(()=>{M=null,v.value=!1},2e3))}).catch(()=>{})}t({copyConversation:$,copyFinalSummary:R});function D(K){const G=s.turns[K];if(!G||G.role!=="assistant")return!1;const X=s.turns[K+1];return!X||X.role!=="assistant"}let F=null;function z(K){const G=s.turns[K];if(!G)return;const X=T(K);X.trim()&&wo(X).then(be=>{be&&(m.value=G.id,F!==null&&clearTimeout(F),F=setTimeout(()=>{F=null,m.value=null},1400))}).catch(()=>{})}function V(K){const G=K.text;G.trim()&&wo(G).then(X=>{X&&(m.value=K.id,F!==null&&clearTimeout(F),F=setTimeout(()=>{F=null,m.value=null},1400))}).catch(()=>{})}function ne(K,G){return K.id!==c.value?!1:G.sourceIndex===Vh(K).length-1}return(K,G)=>i.value?(C(),E("div",zj,[e.sessionLoading?(C(),E("div",Vj,[G[18]||(G[18]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),p("span",Kj,O(S(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),E("div",Gj)):ie("",!0),e.hasMoreMessages||e.loadingMore?(C(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Oe(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),E("span",Yj,[G[19]||(G[19]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),ft(" "+O(S(o)("conversation.loadingOlder")),1)])):(C(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[0]||(G[0]=X=>d("loadOlderMessages"))},O(S(o)("conversation.loadOlder")),1))],2)):ie("",!0),(C(!0),E(Pe,null,Xe(e.turns,(X,be)=>(C(),E(Pe,{key:X.id},[X.role==="user"?(C(),E(Pe,{key:0},[p("div",{class:Oe(["u-bub turn-anchor",{undoing:w.value===X.id}]),"data-turn-id":X.id},[X.images&&X.images.length>0?(C(),E("div",Qj,[(C(!0),E(Pe,null,Xe(X.images,(le,We)=>(C(),E(Pe,{key:We},[le.kind==="video"?(C(),E("video",{key:0,class:"u-img",src:le.url,controls:"",playsinline:"",preload:"metadata"},null,8,Zj)):(C(),E("img",{key:1,class:"u-img",src:le.url,alt:le.alt||"",loading:"lazy"},null,8,Jj))],64))),128))])):ie("",!0),X.skillActivation?(C(),E("div",ez,[p("div",tz,[G[20]||(G[20]=p("span",{class:"skill-act-arrow"},"▶",-1)),p("span",null,O(S(o)("conversation.activatedSkill",{name:X.skillActivation.name})),1)]),X.skillActivation.args?(C(),E("div",nz,O(X.skillActivation.args),1)):ie("",!0)])):(C(),E("div",oz,O(X.text),1))],10,Xj),X.createdAt||g(X)?(C(),E("div",sz,[g(X)?(C(),E("div",{key:0,class:Oe(["u-edit-wrap",{undoing:w.value===X.id}])},[_.value!==X.id?(C(),E("button",{key:0,type:"button",class:"u-edit","data-tooltip":S(o)("conversation.undoTooltip"),onClick:le=>_.value=X.id},[p("span",rz,O(S(o)("conversation.undo")),1),G[21]||(G[21]=p("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"},[p("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),p("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1))],8,iz)):(C(),E("div",{key:1,class:"u-edit-confirm",onClick:G[2]||(G[2]=Ze(()=>{},["stop"]))},[p("span",null,O(S(o)("conversation.undoConfirm")),1),p("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(le=>N(X),["stop"])},O(S(o)("conversation.confirm")),9,lz),p("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[1]||(G[1]=Ze(le=>_.value=null,["stop"]))},O(S(o)("conversation.cancel")),1)]))],2)):ie("",!0),X.text.trim().length>0?(C(),E("button",{key:1,type:"button",class:"u-copy","data-tooltip":S(o)("filePreview.copy"),onClick:Ze(le=>V(X),["stop"])},[m.value!==X.id?(C(),E("svg",cz,[...G[22]||(G[22]=[p("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),p("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),E("svg",uz,[...G[23]||(G[23]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])]))],8,az)):ie("",!0),X.createdAt?(C(),E("button",{key:2,type:"button",class:"u-time",onClick:Ze(le=>x(X.id),["stop"])},O(L(X.createdAt,X.id)),9,dz)):ie("",!0)])):ie("",!0)],64)):X.role==="compaction"?(C(),E("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":X.id,role:"separator"},[G[24]||(G[24]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1)),X.text?(C(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:le=>d("openCompaction",{turnId:X.id})},[p("span",null,O(h(X)),1),p("span",pz,O(S(o)("conversation.viewSummary")),1)],8,hz)):(C(),E("span",mz,O(h(X)),1)),G[25]||(G[25]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,fz)):(C(),E("div",{key:2,class:"a-msg turn-anchor","data-turn-id":X.id},[(C(!0),E(Pe,null,Xe(S(v2)(X),(le,We)=>(C(),E(Pe,{key:S(y2)(le,We)},[le.kind==="thinking"?(C(),Ve(d2,{key:0,text:le.thinking,mobile:i.value,streaming:ne(X,le),onOpen:ue=>d("openThinking",{turnId:X.id,blockIndex:le.sourceIndex})},null,8,["text","mobile","streaming","onOpen"])):le.kind==="text"&&le.text?(C(),E("div",vz,[vt(lu,{text:le.text,streaming:ne(X,le),"open-file":ue=>d("openFile",ue)},null,8,["text","streaming","open-file"])])):le.kind==="tool-stack"?(C(),E("div",yz,[(C(!0),E(Pe,null,Xe(le.tools,(ue,ve)=>(C(),Ve(ud,{key:S(O1)(ue),tool:ue.tool,mobile:i.value,"stack-position":S(g2)(ve,le.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[3]||(G[3]=Ne=>d("openMedia",Ne)),onOpenFile:G[4]||(G[4]=Ne=>d("openFile",Ne)),onOpenToolDiff:G[5]||(G[5]=Ne=>d("openToolDiff",Ne))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])):le.kind==="agent"?(C(),Ve(N1,{key:3,member:le.member,onOpen:ue=>d("openAgent",{turnId:X.id,blockIndex:le.sourceIndex,memberId:ue})},null,8,["member","onOpen"])):le.kind==="agentGroup"?(C(),Ve(h2,{key:4,members:le.members,onOpen:ue=>d("openAgent",{turnId:X.id,blockIndex:le.sourceIndex,memberId:ue})},null,8,["members","onOpen"])):le.kind==="tool"?(C(),Ve(ud,{key:5,tool:le.tool,mobile:i.value,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[6]||(G[6]=ue=>d("openMedia",ue)),onOpenFile:G[7]||(G[7]=ue=>d("openFile",ue)),onOpenToolDiff:G[8]||(G[8]=ue=>d("openToolDiff",ue))},null,8,["tool","mobile","tool-diff-panel"])):ie("",!0)],64))),128)),X.id!==c.value&&D(be)&&(T(be).trim().length>0||X.durationMs!==void 0)?(C(),E("div",kz,[X.durationMs!==void 0?(C(),E("span",{key:0,class:"a-duration",title:`${X.durationMs} ms`},O(S(m2)(X.durationMs)),9,bz)):ie("",!0),T(be).trim().length>0?(C(),E("button",{key:1,class:"a-cpbtn",tabindex:"-1",onClick:le=>z(be)},[m.value!==X.id?(C(),E("svg",_z,[...G[26]||(G[26]=[p("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),p("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),E("svg",Cz,[...G[27]||(G[27]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),p("span",Sz,O(S(o)("filePreview.copy")),1)],8,wz)):ie("",!0)])):ie("",!0)],8,gz))],64))),128)),e.compaction?(C(),Ve(f2,{key:3,label:S(o)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(C(),E("div",xz,[vt(L1,{fast:e.fastMoon},null,8,["fast"])])):ie("",!0)])):(C(),E("div",Tz,[e.sessionLoading?(C(),E("div",Az,[G[28]||(G[28]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),p("span",Mz,O(S(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),E("div",Ez)):ie("",!0),e.hasMoreMessages||e.loadingMore?(C(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Oe(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),E("span",Iz,[G[29]||(G[29]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),ft(" "+O(S(o)("conversation.loadingOlder")),1)])):(C(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[9]||(G[9]=X=>d("loadOlderMessages"))},O(S(o)("conversation.loadOlder")),1))],2)):ie("",!0),(C(!0),E(Pe,null,Xe(e.turns,(X,be)=>(C(),E(Pe,{key:X.id},[X.role==="compaction"?(C(),E("div",{key:0,class:"compact-divider turn-anchor","data-turn-id":X.id,role:"separator"},[G[30]||(G[30]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1)),X.text?(C(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:le=>d("openCompaction",{turnId:X.id})},[p("span",null,O(h(X)),1),p("span",Lz,O(S(o)("conversation.viewSummary")),1)],8,Nz)):(C(),E("span",Oz,O(h(X)),1)),G[31]||(G[31]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,$z)):(C(),E("div",{key:1,class:Oe(["ln turn-anchor",[X.role==="user"?"userline":"ai",{undoing:w.value===X.id}]]),"data-turn-id":X.id},[p("span",Rz,O(X.no),1),p("div",Dz,[p("div",Bz,[X.role==="user"?(C(),E(Pe,{key:0},[G[32]||(G[32]=p("span",{class:"pr"},"user@kimi",-1)),G[33]||(G[33]=p("span",{class:"who"}," $ ",-1))],64)):(C(),E(Pe,{key:1},[G[34]||(G[34]=p("span",{class:"pr"},"kimi",-1)),G[35]||(G[35]=p("span",{class:"who"}," > ",-1))],64)),X.id!==c.value&&D(be)&&T(be).trim().length>0?(C(),E("button",{key:2,class:"cpbtn",onClick:le=>z(be),tabindex:"-1"},[m.value!==X.id?(C(),E("svg",Hz,[...G[36]||(G[36]=[p("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),p("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),E("svg",Wz,[...G[37]||(G[37]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),p("span",Uz,O(S(o)("filePreview.copy")),1)],8,Fz)):ie("",!0),X.durationMs!==void 0&&X.role==="assistant"?(C(),E("span",{key:3,class:"turn-duration",title:`${X.durationMs} ms`},O(S(m2)(X.durationMs)),9,qz)):ie("",!0)]),X.role==="user"?(C(),E("div",jz,[X.skillActivation?(C(),E("div",zz,[p("div",Vz,[G[38]||(G[38]=p("span",{class:"skill-act-arrow"},"▶",-1)),p("span",null,O(S(o)("conversation.activatedSkill",{name:X.skillActivation.name})),1)]),X.skillActivation.args?(C(),E("div",Kz,O(X.skillActivation.args),1)):ie("",!0)])):(C(),E(Pe,{key:1},[ft(O(X.text),1)],64))])):(C(!0),E(Pe,{key:1},Xe(S(v2)(X),(le,We)=>(C(),E(Pe,{key:S(y2)(le,We)},[le.kind==="thinking"?(C(),Ve(d2,{key:0,text:le.thinking,streaming:ne(X,le),onOpen:ue=>d("openThinking",{turnId:X.id,blockIndex:le.sourceIndex})},null,8,["text","streaming","onOpen"])):le.kind==="text"&&le.text?(C(),Ve(lu,{key:1,text:le.text,streaming:ne(X,le),"open-file":ue=>d("openFile",ue)},null,8,["text","streaming","open-file"])):le.kind==="tool-stack"?(C(),E("div",Gz,[(C(!0),E(Pe,null,Xe(le.tools,(ue,ve)=>(C(),Ve(ud,{key:S(O1)(ue),tool:ue.tool,"stack-position":S(g2)(ve,le.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[10]||(G[10]=Ne=>d("openMedia",Ne)),onOpenFile:G[11]||(G[11]=Ne=>d("openFile",Ne)),onOpenToolDiff:G[12]||(G[12]=Ne=>d("openToolDiff",Ne))},null,8,["tool","stack-position","tool-diff-panel"]))),128))])):le.kind==="agent"?(C(),Ve(N1,{key:3,member:le.member,onOpen:ue=>d("openAgent",{turnId:X.id,blockIndex:le.sourceIndex,memberId:ue})},null,8,["member","onOpen"])):le.kind==="agentGroup"?(C(),Ve(h2,{key:4,members:le.members,onOpen:ue=>d("openAgent",{turnId:X.id,blockIndex:le.sourceIndex,memberId:ue})},null,8,["members","onOpen"])):le.kind==="tool"?(C(),Ve(ud,{key:5,tool:le.tool,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[13]||(G[13]=ue=>d("openMedia",ue)),onOpenFile:G[14]||(G[14]=ue=>d("openFile",ue)),onOpenToolDiff:G[15]||(G[15]=ue=>d("openToolDiff",ue))},null,8,["tool","tool-diff-panel"])):ie("",!0)],64))),128))]),X.role==="user"&&g(X)?(C(),E("div",{key:0,class:Oe(["u-edit-wrap ln-edit-wrap",{undoing:w.value===X.id}])},[_.value!==X.id?(C(),E("button",{key:0,type:"button",class:"u-edit","data-tooltip":S(o)("conversation.undoTooltip"),onClick:le=>_.value=X.id},[G[39]||(G[39]=p("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"},[p("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),p("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1)),p("span",Xz,O(S(o)("conversation.undo")),1)],8,Yz)):(C(),E("div",{key:1,class:"u-edit-confirm",onClick:G[17]||(G[17]=Ze(()=>{},["stop"]))},[p("span",null,O(S(o)("conversation.undoConfirm")),1),p("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(le=>N(X),["stop"])},O(S(o)("conversation.confirm")),9,Qz),p("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[16]||(G[16]=Ze(le=>_.value=null,["stop"]))},O(S(o)("conversation.cancel")),1)]))],2)):ie("",!0)],10,Pz))],64))),128)),e.compaction?(C(),Ve(f2,{key:3,label:S(o)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(C(),E("div",Zz,[G[41]||(G[41]=p("span",{class:"no"},"—",-1)),p("div",Jz,[G[40]||(G[40]=p("div",{class:"role-row"},[p("span",{class:"pr"},"kimi"),p("span",{class:"who"}," > ")],-1)),vt(L1,{fast:e.fastMoon,label:"Sending…"},null,8,["fast"])])])):ie("",!0)]))}}),ZA=bt(eV,[["__scopeId","data-v-4ea264b2"]]),tV={class:"chat-header"},nV={class:"ch-id"},oV={key:0,class:"ch-ws"},sV={key:1,class:"ch-sep"},iV=["onKeydown"],rV=["title"],lV=["title","aria-label","aria-expanded"],aV=["title"],cV=["title"],uV={key:0,class:"ch-pill ch-sync-pill"},dV={key:0,class:"ch-ahead"},fV={key:1,class:"ch-behind"},hV={key:1,class:"ch-pill ch-diff-pill"},pV={key:0,class:"ch-add"},mV={key:1,class:"ch-del"},gV=["title"],vV=Qe({__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}=xt(),o=e,s=t,i=H(()=>o.ahead??0),r=H(()=>o.behind??0),l=H(()=>o.gitDiffStats?.totalAdditions??0),a=H(()=>o.gitDiffStats?.totalDeletions??0),c=H(()=>l.value>0||a.value>0),u=te(!1),d=te(null),f=te(null),g=te({});function h(z){const V=z.target;f.value?.contains(V)||d.value?.contains(V)||w()}function m(){w()}async function _(z){if(z.stopPropagation(),u.value){w();return}u.value=!0,document.addEventListener("mousedown",h),document.addEventListener("scroll",m,!0),window.addEventListener("resize",m),await ht();const V=d.value,ne=f.value;if(!V||!ne)return;const K=V.getBoundingClientRect(),G=4,X=8,be=ne.offsetWidth,le=ne.offsetHeight;let We=K.bottom+G;We+le>window.innerHeight-X&&(We=Math.max(X,K.top-le-G));let ue=K.left;ue+be>window.innerWidth-X&&(ue=Math.max(X,K.right-be)),g.value={top:`${Math.round(We)}px`,left:`${Math.round(ue)}px`}}function w(){u.value=!1,D(),document.removeEventListener("mousedown",h),document.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}Yt(()=>{document.removeEventListener("mousedown",h),document.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)});function k(){s("copyAll"),w()}function b(){s("copyFinalSummary"),w()}const y=te(!1);function x(){o.sessionId&&wo(o.sessionId).then(z=>{z&&(y.value=!0,setTimeout(()=>{y.value=!1},1200))})}const L=te(!1),N=te(""),v=te(null);async function M(){if(w(),!!o.sessionId){L.value=!0,N.value=o.sessionTitle??"",await ht();try{v.value?.focus(),v.value?.select()}catch{}}}function $(){const z=N.value.trim();z&&o.sessionId&&z!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,z),L.value=!1}function P(){L.value=!1}function T(){o.sessionId&&(w(),s("forkSession",o.sessionId))}const I=te(!1);let R;function D(){clearTimeout(R),I.value=!1}function F(){if(o.sessionId){if(I.value){s("archiveSession",o.sessionId),w();return}I.value=!0,R=setTimeout(()=>{I.value=!1},2500)}}return(z,V)=>(C(),E("header",tV,[p("div",nV,[e.workspaceName?(C(),E("span",oV,O(e.workspaceName),1)):ie("",!0),e.workspaceName&&e.sessionTitle?(C(),E("span",sV,"/")):ie("",!0),L.value?jt((C(),E("input",{key:2,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":V[0]||(V[0]=ne=>N.value=ne),class:"ch-rename",type:"text",onKeydown:[Ns(Ze($,["stop"]),["enter"]),Ns(Ze(P,["stop"]),["esc"])],onBlur:$,onClick:V[1]||(V[1]=Ze(()=>{},["stop"]))},null,40,iV)),[[Wn,N.value]]):e.sessionTitle?(C(),E("span",{key:3,class:"ch-ses",title:e.sessionTitle},O(e.sessionTitle),9,rV)):ie("",!0)]),p("button",{ref_key:"kebabRef",ref:d,type:"button",class:Oe(["ch-act ch-act-more",{open:u.value}]),title:S(n)("header.options"),"aria-label":S(n)("header.options"),"aria-expanded":u.value,"aria-haspopup":"menu",onClick:V[2]||(V[2]=Ze(ne=>_(ne),["stop"]))},[...V[6]||(V[6]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"3",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"13",cy:"8",r:"1.3"})],-1)])],10,lV),u.value?(C(),E("div",{key:0,ref_key:"menuRef",ref:f,class:"ch-menu",style:Wt(g.value),onClick:V[3]||(V[3]=Ze(()=>{},["stop"]))},[p("button",{type:"button",class:"chm-item",onClick:Ze(k,["stop"])},O(e.copied?S(n)("header.copied"):S(n)("header.copyAll")),1),p("button",{type:"button",class:"chm-item",onClick:Ze(b,["stop"])},O(S(n)("header.copyFinalSummary")),1),e.sessionId?(C(),E(Pe,{key:0},[V[7]||(V[7]=p("div",{class:"chm-divider"},null,-1)),p("button",{type:"button",class:"chm-item",onClick:Ze(x,["stop"])},[p("span",null,O(y.value?S(n)("header.copied"):S(n)("header.copySessionId")),1)]),p("button",{type:"button",class:"chm-item",onClick:Ze(M,["stop"])},O(S(n)("header.renameSession")),1),p("button",{type:"button",class:"chm-item",onClick:Ze(T,["stop"])},O(S(n)("header.forkSession")),1),p("button",{type:"button",class:"chm-item del",onClick:Ze(F,["stop"])},O(I.value?S(n)("header.confirmArchive"):S(n)("header.archiveSession")),1)],64)):ie("",!0)],4)):ie("",!0),V[9]||(V[9]=p("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(C(),E("button",{key:1,type:"button",class:"ch-git",title:S(n)("header.gitTooltip"),onClick:V[4]||(V[4]=ne=>s("openChanges"))},[p("span",{class:Oe(["ch-branch",{"ch-detached":!e.branch}]),title:e.branch||S(n)("header.detached")},O(e.branch||S(n)("header.detached")),11,cV),i.value>0||r.value>0?(C(),E("span",uV,[i.value>0?(C(),E("span",dV,"↑"+O(i.value),1)):ie("",!0),r.value>0?(C(),E("span",fV,"↓"+O(r.value),1)):ie("",!0)])):ie("",!0),c.value?(C(),E("span",hV,[l.value>0?(C(),E("span",pV,"+"+O(l.value),1)):ie("",!0),a.value>0?(C(),E("span",mV,"-"+O(a.value),1)):ie("",!0)])):ie("",!0)],8,aV)):ie("",!0),e.pr?(C(),E("button",{key:2,type:"button",class:Oe(["ch-pill ch-pr",`pr-${e.pr.state}`]),title:S(n)("header.openPr"),onClick:V[5]||(V[5]=ne=>e.pr&&s("openPr",e.pr.url))},[V[8]||(V[8]=_r('<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-7eb81c61><circle cx="5" cy="6" r="3" data-v-7eb81c61></circle><path d="M5 9v12" data-v-7eb81c61></path><circle cx="19" cy="18" r="3" data-v-7eb81c61></circle><path d="m15 9-3-3 3-3" data-v-7eb81c61></path><path d="M12 6h5a2 2 0 0 1 2 2v7" data-v-7eb81c61></path></svg>',1)),p("span",null,"PR #"+O(e.pr.number)+" · "+O(e.pr.state),1)],10,gV)):ie("",!0)]))}}),yV=bt(vV,[["__scopeId","data-v-7eb81c61"]]),kV={key:0,class:"slash-menu",role:"listbox"},bV=["aria-selected","onMouseenter","onMousedown"],wV={class:"slash-name"},_V={class:"slash-desc"},CV=Qe({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=xt(),o=e,s=t,i=te([]);return ze(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(C(),E("div",kV,[(C(!0),E(Pe,null,Xe(e.items,(a,c)=>(C(),E("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Oe(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:Ze(u=>s("select",a),["prevent"])},[p("span",wV,O(a.name),1),p("span",_V,O(a.isSkill?a.desc:S(n)(a.desc)),1)],42,bV))),128))])):ie("",!0)}}),SV=bt(CV,[["__scopeId","data-v-738976e5"]]),xV={class:"mention-menu",role:"listbox"},TV={key:0,class:"mention-state dim"},AV={key:1,class:"mention-state dim"},MV=["aria-selected","onMouseenter","onMousedown"],EV=["innerHTML"],IV={class:"mention-name"},$V={class:"mention-path"},NV='<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>',LV='<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>',OV='<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>',PV='<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>',k2='<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>',RV=Qe({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),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 NV;const d=c.name||u.split("/").pop()||u,f=d.lastIndexOf("."),g=f>0?d.slice(f+1).toLowerCase():"";return g?i.has(g)?LV:r.has(g)?OV:l.has(g)?PV:k2:k2}return(c,u)=>(C(),E("div",xV,[n.loading?(C(),E("div",TV,O(S(s)("mention.searching")),1)):n.items.length===0?(C(),E("div",AV,O(S(s)("mention.noMatch")),1)):(C(!0),E(Pe,{key:2},Xe(n.items,(d,f)=>(C(),E("div",{key:d.path,class:Oe(["mention-item",{active:f===n.activeIndex}]),role:"option","aria-selected":f===n.activeIndex,onMouseenter:g=>o("hover",f),onMousedown:Ze(g=>o("select",d),["prevent"])},[p("span",{class:"mention-icon",innerHTML:a(d),"aria-hidden":"true"},null,8,EV),p("span",IV,O(d.name),1),p("span",$V,O(d.path),1)],42,MV))),128))]))}}),DV=bt(RV,[["__scopeId","data-v-86e06bbf"]]),JA=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/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 BV(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 e3(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...JA,...t]}function FV(e,t=JA){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const i=o.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:o,index:s,score:r}}).filter(({score:o})=>o>0).sort((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function t3(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 b2(e,t){switch(t3(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const Qf=100;function HV(e){const t=bv(Mt.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>Qf?n.slice(-Qf):n,s={[e]:o};return Th(Mt.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function WV(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=te(HV(s())),r=H(()=>i.value[s()??""]??[]);let l=-1,a="";function c(w){const k=s();if(l=-1,!k)return;const b=w.trim();if(!b)return;const y=i.value[k]??[];if(y.at(-1)===b)return;const x=[...y,b],L=x.length>Qf?x.slice(-Qf):x;i.value={...i.value,[k]:L},Th(Mt.inputHistory,i.value)}function u(){const w=n.value;if(!w)return!1;const k=w.selectionStart??0;return w.value.lastIndexOf(`
|
|
258
|
-
`,k-1)===-1}function d(w){t.value=w,ht(()=>{const k=n.value;if(!k)return;o();const b=w.length;k.setSelectionRange(b,b)})}function f(){const w=r.value;if(w.length!==0){if(l===-1)a=t.value,l=w.length-1;else if(l>0)l-=1;else return;d(w[l])}}function g(){if(l===-1)return;const w=r.value;l<w.length-1?(l+=1,d(w[l])):(l=-1,d(a))}function h(){l=-1}function m(){return l!==-1}function _(){return r.value.length>0}return ze(s,()=>{l=-1}),{push:c,caretAtFirstLine:u,recallOlder:f,recallNewer:g,resetBrowsing:h,isBrowsing:m,hasHistory:_}}function UV(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=te(!1),c=te([]),u=te(0);function d(){const g=t.value;g.startsWith("/")&&!g.includes(" ")?(c.value=FV(g,e3(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(g){if(a.value=!1,g.acceptsInput){t.value=`${g.name} `,ht(()=>{const h=n.value;if(!h)return;const m=t.value.length;h.setSelectionRange(m,m),h.focus(),o()});return}t.value="",l?.(),r(g.name),i(g.name)}return{open:a,items:c,active:u,update:d,select:f}}function qV(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=te(!1),r=te([]),l=te(0),a=te(!1);let c=null;function u(){const g=t.value,h=n.value?.selectionStart??g.length;let m=h-1;for(;m>=0&&!/\s/.test(g[m]);)m--;m++;const _=g.slice(m,h);return _.startsWith("@")?{token:_.slice(1),start:m,end:h}:null}function d(){const g=u(),h=s();if(!g||!h){i.value=!1;return}const m=g.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await h(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(g){const h=u();if(!h)return;const m=t.value;t.value=m.slice(0,h.start)+g.path+m.slice(h.end),i.value=!1,ht(()=>{const _=n.value;if(!_)return;const w=h.start+g.path.length;_.setSelectionRange(w,w),_.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function jV(e){const{sessionId:t}=e;function n(c){return bn(pb(c))??""}function o(c,u){const d=pb(c);u?Tn(d,u):Zc(d)}const s=te(n(t())),i=te(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}ze(s,c=>{ht(r),o(t(),c)}),ze(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),ht(r))});function l(c){s.value=c,ht(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function zV(e){const{uploadImage:t,sessionId:n}=e,o=te({}),s=H(()=>o.value[n()??""]??[]),i=te(null),r=te(null),l=te(!1);let a=0;function c(){return`att_${++a}`}function u(v,M){o.value={...o.value,[v]:M}}function d(v){try{URL.revokeObjectURL(v.previewUrl)}catch{}}function f(v){return v.startsWith("image/")?"image":v.startsWith("video/")?"video":null}async function g(v){const M=t();if(!M)return;const $=n()??"",P=v.map(T=>({file:T,kind:f(T.type)})).filter(T=>T.kind!==null);if(P.length!==0)for(const{file:T,kind:I}of P){const R=c(),D=URL.createObjectURL(T),F={localId:R,name:T.name,kind:I,previewUrl:D,uploading:!0};u($,[...o.value[$]??[],F]),M(T,T.name).then(z=>{const V=o.value[$]??[];u($,V.map(ne=>ne.localId===R?{...ne,uploading:!1,fileId:z?.fileId,error:z===null}:ne))}).catch(()=>{const z=o.value[$]??[];u($,z.map(V=>V.localId===R?{...V,uploading:!1,error:!0}:V))})}}function h(v){const M=n()??"",$=o.value[M]??[],P=$.find(T=>T.localId===v);i.value?.localId===v&&(i.value=null),P&&d(P),u(M,$.filter(T=>T.localId!==v))}function m(v){i.value=v}function _(){i.value=null}function w(){r.value?.click()}function k(v){const M=v.target,$=Array.from(M.files??[]);g($),M.value=""}function b(v){if(!t())return;const M=v.clipboardData;if(!M)return;const $=[],P=new Set,T=(I,R)=>{const D=`${I.size}:${I.type}:${R}`;if(P.has(D))return;P.add(D);const F=I.type.split("/")[1]??"png",z=R.includes(".")?R:`paste-${Date.now()}.${F}`;$.push(I instanceof File?I:new File([I],z,{type:I.type}))};for(const I of Array.from(M.items))if(I.kind==="file"&&f(I.type)){const R=I.getAsFile();R&&T(R,R.name||`paste-${Date.now()}.${I.type.split("/")[1]??"png"}`)}for(const I of Array.from(M.files))f(I.type)&&T(I,I.name);$.length!==0&&(v.preventDefault(),g($))}function y(v){!t()||!Array.from(v.dataTransfer?.items??[]).some($=>$.kind==="file")||(v.preventDefault(),l.value=!0)}function x(){l.value=!1}function L(v){if(l.value=!1,!t())return;v.preventDefault();const M=Array.from(v.dataTransfer?.files??[]);g(M)}function N(){const v=n()??"";for(const M of o.value[v]??[])d(M);u(v,[])}return ze(n,()=>{i.value=null}),rn(()=>{document.addEventListener("paste",b)}),Yt(()=>{document.removeEventListener("paste",b);for(const v of Object.values(o.value))for(const M of v)d(M);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:h,openAttachmentPreview:m,closeAttachmentPreview:_,openFilePicker:w,handleFileInputChange:k,handleDragOver:y,handleDragLeave:x,handleDrop:L,clearAfterSubmit:N}}const VV={key:0,class:"att-strip"},KV=["title","onClick"],GV=["src"],YV=["src","alt"],XV={key:2,class:"att-video-badge","aria-hidden":"true"},QV={class:"att-name"},ZV=["aria-label"],JV=["title"],eK=["title","onClick"],tK={class:"att-lightbox-card"},nK=["title"],oK=["src"],sK=["src","alt"],iK={class:"att-lightbox-name"},rK={class:"composer-card"},lK={class:"cin-wrap"},aK={class:"input-row"},cK=["placeholder"],uK={class:"send-col"},dK=["aria-label","title"],fK={key:0,viewBox:"0 0 24 24",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},hK={key:1,viewBox:"0 0 24 24",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},pK=["aria-label","title"],mK={class:"toolbar-left"},gK=["title"],vK=["title","onKeydown"],yK=["onClick"],kK={class:"pd-check"},bK={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"},wK={class:"pd-info"},_K={class:"pd-desc"},CK=["title"],SK={class:"mode-label"},xK={key:0,class:"mode-tag"},TK={key:1,class:"mode-tag"},AK={key:2,class:"mode-tag"},MK={class:"mode-row-name"},EK={class:"mode-row-name"},IK={class:"mode-row-name"},$K={key:0,class:"mode-row-actions"},NK={class:"toolbar-right"},LK=["title"],OK={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},PK=["stroke-dasharray","stroke-dashoffset"],RK={class:"ctx-num"},DK=["title","onKeydown"],BK={key:0,class:"think-suffix"},FK={key:0,class:"md-section"},HK=["onClick"],WK={class:"md-check"},UK={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"},qK={class:"md-name"},jK={class:"md-provider"},zK={key:1,class:"md-divider"},VK={key:2,class:"md-section"},KK=["onClick"],GK={class:"md-check"},YK={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"},XK={class:"md-name"},QK={key:0,class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},ZK={key:3,class:"md-divider"},JK=["disabled"],eG={class:"md-check"},tG={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"},nG={class:"md-name"},oG={key:0,class:"md-note"},sG={key:1,class:"md-note"},iG={class:"md-name"},w2=56,rG=Qe({__name:"Composer",props:{running:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const o=e,s=H(()=>o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=xt(),{text:l,textareaRef:a,autosize:c,loadForEdit:u,clearDraft:d}=jV({sessionId:()=>o.sessionId}),f=te(!1);function g(){f.value=!f.value,ht(()=>{c(),w(),a.value?.focus()})}function h(){f.value&&(f.value=!1,ht(c))}function m(Ye){if(typeof getComputedStyle>"u")return w2;const je=Number.parseFloat(getComputedStyle(Ye).minHeight);return Number.isFinite(je)&&je>0?je:w2}const _=te(!1);function w(){const Ye=a.value;_.value=!!Ye&&Ye.scrollHeight>m(Ye)}ze(l,()=>{ht(w)}),ze(()=>o.sessionId,()=>{f.value=!1});const k=WV({text:l,textareaRef:a,autosize:c,sessionId:()=>o.sessionId}),{open:b,items:y,active:x,update:L,select:N}=UV({text:l,textareaRef:a,autosize:c,skills:()=>o.skills,emitCommand:Ye=>i("command",Ye),historyPush:Ye=>k.push(Ye),clearDraft:d}),{open:v,items:M,active:$,loading:P,update:T,select:I}=qV({text:l,textareaRef:a,autosize:c,searchFiles:()=>o.searchFiles});function R(){k.resetBrowsing(),L(),T()}const{attachments:D,previewAttachment:F,fileInputRef:z,isDragOver:V,removeAttachment:ne,openAttachmentPreview:K,closeAttachmentPreview:G,openFilePicker:X,handleFileInputChange:be,handleDragOver:le,handleDragLeave:We,handleDrop:ue,clearAfterSubmit:ve}=zV({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});rn(()=>{l.value&&ht(()=>{c(),w()})}),Yt(()=>{document.removeEventListener("mousedown",On),q()});function Ne(){a.value?.focus({preventScroll:!0})}t({loadForEdit:u,focus:Ne});function Re(){const Ye=l.value.trim();if(D.value.some(it=>it.uploading))return;const je=D.value.filter(it=>!it.uploading&&!it.error&&it.fileId);if(!Ye&&je.length===0)return;if(k.push(Ye),Ye){const it=BV(Ye),Ie=it?e3(o.skills).some(ke=>ke.name===it.cmd):!1;if(it&&Ie){l.value="",d(),b.value=!1,h(),i("command",it.arg?`${it.cmd} ${it.arg}`:it.cmd);return}}const tt={text:Ye,attachments:je.map(it=>({fileId:it.fileId,kind:it.kind}))};F.value=null,ve(),l.value="",d(),b.value=!1,v.value=!1,h(),i("submit",tt)}function Q(){if(!o.running||D.value.some(it=>it.uploading))return;const Ye=l.value.trim(),je=D.value.filter(it=>!it.uploading&&!it.error&&it.fileId);if(!Ye&&je.length===0&&o.queued.length===0)return;const tt={text:Ye,attachments:je.map(it=>({fileId:it.fileId,kind:it.kind}))};ve(),k.push(Ye),l.value="",d(),b.value=!1,v.value=!1,h(),i("steer",tt)}let ce=!1,Se=null;function q(){Se!==null&&(clearTimeout(Se),Se=null)}function ee(){q(),ce=!0}function he(){q(),Se=setTimeout(()=>{Se=null,ce=!1},0)}function oe(Ye){return ce||Ye.isComposing||Ye.keyCode===229}function fe(Ye){if(!oe(Ye)){if(Ye.key==="Escape"){if(re.value){Ye.preventDefault(),se();return}if(ge.value){Ye.preventDefault(),we();return}}if(b.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),x.value=(x.value+1)%y.value.length;return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),x.value=(x.value-1+y.value.length)%y.value.length;return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const je=y.value[x.value];je&&N(je);return}if(Ye.key==="Escape"){Ye.preventDefault(),b.value=!1;return}}if(v.value&&!P.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),$.value=($.value+1)%Math.max(1,M.value.length);return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),$.value=($.value-1+Math.max(1,M.value.length))%Math.max(1,M.value.length);return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const je=M.value[$.value];je&&I(je);return}if(Ye.key==="Escape"){Ye.preventDefault(),v.value=!1;return}}if(Ye.key==="s"&&(Ye.ctrlKey||Ye.metaKey)&&!Ye.shiftKey&&!Ye.altKey){o.running&&(Ye.preventDefault(),Q());return}if(!b.value&&!v.value&&!Ye.shiftKey&&!Ye.altKey&&!Ye.metaKey&&!Ye.ctrlKey){const je=k.isBrowsing();if(Ye.key==="ArrowUp"&&k.hasHistory()&&(je||k.caretAtFirstLine())){Ye.preventDefault(),k.recallOlder();return}if(Ye.key==="ArrowDown"&&je){Ye.preventDefault(),k.recallNewer();return}}if(Ye.key==="Enter"&&!Ye.shiftKey){if(f.value&&!(Ye.metaKey||Ye.ctrlKey))return;Ye.preventDefault(),Re()}}}const W=H(()=>o.running?r("composer.interrupt"):r("composer.send")),Y=H(()=>!!o.uploadImage),re=te(!1),ge=te(!1),xe=te(null);function $e(){re.value=!re.value,re.value?(ge.value=!1,document.addEventListener("click",qe,!0)):document.removeEventListener("click",qe,!0)}function se(){re.value=!1,ge.value||document.removeEventListener("click",qe,!0)}function ae(){ge.value=!ge.value,ge.value?(re.value=!1,document.addEventListener("click",qe,!0)):document.removeEventListener("click",qe,!0)}function we(){ge.value=!1,re.value||document.removeEventListener("click",qe,!0)}function qe(Ye){xe.value&&!xe.value.contains(Ye.target)&&(se(),we())}Yt(()=>{document.removeEventListener("click",qe,!0)});const nt=Ye=>`${Math.round(Ye/1e3)}k`,at=H(()=>{const Ye=o.status?.ctxMax??0;return Ye<=0?0:Math.min(100,Math.max(0,Math.round((o.status?.ctxUsed??0)/Ye*100)))}),_t=H(()=>{const Ye=(o.status?.ctxUsed??0).toLocaleString(),je=(o.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ye,max:je,pct:at.value})}),$t=H(()=>at.value>=80),lt=H(()=>{const Ye=o.status?.modelId??o.status?.model??"";return o.models?.find(je=>je.id===Ye||je.model===Ye||je.displayName===o.status?.model)}),Rt=H(()=>t3(lt.value)),fn=H(()=>Rt.value==="toggle"),An=H(()=>Rt.value==="always-on"?!0:Rt.value==="unsupported"?!1:(o.thinking??"off")!=="off");function Nt(){fn.value&&i("setThinking",An.value?"off":"high")}const Ft=H(()=>o.planMode===!0),jn=H(()=>o.swarmMode===!0),Je=H(()=>o.activationBadges?.goal!==null),Qn=H(()=>Je.value||o.goalMode===!0),Xo=te(!1),Oo=te(null),ho=te(null),Nn=te({}),cn=H(()=>Ft.value||jn.value||Qn.value);function wn(){Xo.value=!1,document.removeEventListener("mousedown",On)}function On(Ye){const je=Ye.target;Oo.value?.contains(je)||ho.value?.contains(je)||wn()}function zn(){if(Xo.value){wn();return}const Ye=Oo.value?.getBoundingClientRect();Ye&&(Nn.value={left:`${Math.round(Ye.left)}px`,bottom:`${Math.round(window.innerHeight-Ye.top+8)}px`}),Xo.value=!0,setTimeout(()=>document.addEventListener("mousedown",On),0)}const Zn=[{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 Co(Ye){i("setPermission",Ye),we()}const po=H(()=>Zn.find(Ye=>Ye.mode===o.status?.permission)),Po=H(()=>po.value?r(po.value.labelKey):""),Tt=H(()=>lt.value?.provider??""),io=H(()=>!Tt.value||!o.models?.length?[]:o.models.filter(Ye=>Ye.provider===Tt.value)),nn=H(()=>new Set(o.starredIds??[]));function Ro(Ye){return nn.value.has(Ye)}const Qo=H(()=>o.models?.length?o.models.filter(Ye=>Ro(Ye.id)&&Ye.provider!==Tt.value):[]);function Jn(Ye){i("selectModel",Ye),se()}return(Ye,je)=>(C(),E("div",{class:Oe(["composer",{"drag-over":S(V),expanded:f.value}]),onDragover:je[18]||(je[18]=(...tt)=>S(le)&&S(le)(...tt)),onDragleave:je[19]||(je[19]=(...tt)=>S(We)&&S(We)(...tt)),onDrop:je[20]||(je[20]=(...tt)=>S(ue)&&S(ue)(...tt))},[S(D).length>0?(C(),E("div",VV,[(C(!0),E(Pe,null,Xe(S(D),tt=>(C(),E("div",{key:tt.localId,class:Oe(["att-chip",{"att-error":tt.error}])},[p("button",{type:"button",class:"att-preview",title:S(r)("composer.previewAttachment",{name:tt.name}),onClick:it=>S(K)(tt)},[tt.kind==="video"?(C(),E("video",{key:0,class:"att-thumb",src:tt.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,GV)):(C(),E("img",{key:1,class:"att-thumb",src:tt.previewUrl,alt:tt.name},null,8,YV)),tt.kind==="video"?(C(),E("span",XV,[...je[21]||(je[21]=[p("svg",{viewBox:"0 0 16 16",width:"9",height:"9",fill:"currentColor"},[p("path",{d:"M5 3.5v9l7-4.5z"})],-1)])])):ie("",!0)],8,KV),p("span",QV,O(tt.name),1),tt.uploading?(C(),E("span",{key:0,class:"att-spinner","aria-label":S(r)("composer.uploading")},[...je[22]||(je[22]=[p("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"},[p("circle",{cx:"8",cy:"8",r:"6","stroke-opacity":"0.25"}),p("path",{d:"M8 2 A6 6 0 0 1 14 8","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"0.8s",repeatCount:"indefinite"})])],-1)])],8,ZV)):tt.error?(C(),E("span",{key:1,class:"att-err-icon",title:S(r)("composer.uploadFailed")},[...je[23]||(je[23]=[p("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"},[p("circle",{cx:"6",cy:"6",r:"5"}),p("line",{x1:"6",y1:"3.5",x2:"6",y2:"6.5"}),p("circle",{cx:"6",cy:"8.5",r:"0.5",fill:"currentColor"})],-1)])],8,JV)):ie("",!0),p("button",{class:"att-rm",title:S(r)("composer.removeNamed",{name:tt.name}),onClick:it=>S(ne)(tt.localId)},[...je[24]||(je[24]=[p("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"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,eK)],2))),128))])):ie("",!0),S(F)?(C(),E("div",{key:1,class:"att-lightbox",onClick:je[1]||(je[1]=Ze((...tt)=>S(G)&&S(G)(...tt),["self"]))},[p("div",tK,[p("button",{type:"button",class:"att-lightbox-close",title:S(r)("model.close"),onClick:je[0]||(je[0]=(...tt)=>S(G)&&S(G)(...tt))},"✕",8,nK),S(F).kind==="video"?(C(),E("video",{key:0,class:"att-lightbox-media",src:S(F).previewUrl,controls:"",playsinline:""},null,8,oK)):(C(),E("img",{key:1,class:"att-lightbox-media",src:S(F).previewUrl,alt:S(F).name},null,8,sK)),p("div",iK,O(S(F).name),1)])])):ie("",!0),p("div",rK,[p("div",lK,[S(b)?(C(),Ve(SV,{key:0,items:S(y),"active-index":S(x),onSelect:S(N),onHover:je[2]||(je[2]=tt=>x.value=tt)},null,8,["items","active-index","onSelect"])):ie("",!0),S(v)?(C(),Ve(DV,{key:1,items:S(M),"active-index":S($),loading:S(P),onSelect:S(I),onHover:je[3]||(je[3]=tt=>$.value=tt)},null,8,["items","active-index","loading","onSelect"])):ie("",!0),p("div",aK,[jt(p("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":je[4]||(je[4]=tt=>Ln(l)?l.value=tt:null),class:"ph",placeholder:s.value,rows:"1",onKeydown:fe,onCompositionstart:ee,onCompositionend:he,onInput:R},null,40,cK),[[Wn,S(l)]]),p("div",uK,[f.value||_.value?(C(),E("button",{key:0,class:"expand-btn",type:"button","aria-label":f.value?S(r)("composer.collapseTitle"):S(r)("composer.expandTitle"),title:f.value?S(r)("composer.collapseTitle"):S(r)("composer.expandTitle"),onClick:g},[f.value?(C(),E("svg",fK,[...je[25]||(je[25]=[p("path",{d:"M4 14h6v6"},null,-1),p("path",{d:"M20 10h-6V4"},null,-1),p("path",{d:"M14 10l7-7"},null,-1),p("path",{d:"M3 21l7-7"},null,-1)])])):(C(),E("svg",hK,[...je[26]||(je[26]=[p("path",{d:"M15 3h6v6"},null,-1),p("path",{d:"M9 21H3v-6"},null,-1),p("path",{d:"M21 3l-7 7"},null,-1),p("path",{d:"M3 21l7-7"},null,-1)])]))],8,dK)):ie("",!0),p("button",{class:Oe(["send",{aborting:e.running}]),"aria-label":W.value,title:e.running?S(r)("composer.interruptTitle"):W.value,onClick:je[5]||(je[5]=tt=>e.running?i("interrupt"):Re())},[(C(),E("svg",{class:Oe(["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"},[...je[27]||(je[27]=[p("path",{d:"M8 3l6 5.5M8 3L2 8.5M8 3v10"},null,-1)])],2)),(C(),E("svg",{class:Oe(["send-icon",{hidden:!e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[...je[28]||(je[28]=[p("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1.5"},null,-1)])],2))],10,pK)])])]),Y.value?(C(),E("input",{key:0,ref_key:"fileInputRef",ref:z,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:je[6]||(je[6]=(...tt)=>S(be)&&S(be)(...tt))},null,544)):ie("",!0),p("div",{ref_key:"toolbarRef",ref:xe,class:"toolbar"},[p("div",mK,[Y.value?(C(),E("button",{key:0,class:"attach-btn",title:S(r)("composer.attachImage"),type:"button",onClick:je[7]||(je[7]=(...tt)=>S(X)&&S(X)(...tt))},[...je[29]||(je[29]=[p("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"},[p("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),p("circle",{cx:"5",cy:"6",r:"1.2"}),p("path",{d:"M2 10.5l3-2.5L8 11l2.5-2L14 11"})],-1)])],8,gK)):ie("",!0),e.status?(C(),E("span",{key:1,class:Oe(["perm-pill",["perm-"+e.status.permission,{open:ge.value}]]),role:"button",tabindex:"0",title:S(r)("status.permissionTooltip"),onClick:Ze(ae,["stop"]),onKeydown:[Ns(ae,["enter"]),Ns(Ze(ae,["prevent"]),["space"])]},O(Po.value),43,vK)):ie("",!0),ge.value&&e.status?(C(),E("div",{key:2,class:"perm-dropdown",role:"menu",onClick:je[8]||(je[8]=Ze(()=>{},["stop"]))},[(C(),E(Pe,null,Xe(Zn,tt=>p("button",{key:tt.mode,class:Oe(["pd-row",{"is-current":tt.mode===e.status.permission}]),role:"menuitem",onClick:it=>Co(tt.mode)},[p("span",kK,[tt.mode===e.status.permission?(C(),E("svg",bK,[...je[30]||(je[30]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),p("span",wK,[p("span",{class:"pd-name",style:Wt({color:tt.color})},O(S(r)(tt.labelKey)),5),p("span",_K,O(S(r)(tt.descKey)),1)])],10,yK)),64))])):ie("",!0),e.status?(C(),E("div",{key:3,ref_key:"modesRef",ref:Oo,class:"modes"},[p("button",{type:"button",class:Oe(["mode-pill",{on:cn.value}]),title:S(r)("status.modesTooltip"),onClick:Ze(zn,["stop"])},[p("span",SK,O(S(r)("status.modesLabel")),1),Ft.value?(C(),E("span",xK,O(S(r)("status.planLabel")),1)):ie("",!0),jn.value?(C(),E("span",TK,O(S(r)("status.swarmLabel")),1)):ie("",!0),Qn.value?(C(),E("span",AK,O(S(r)("status.goalLabel")),1)):ie("",!0)],10,CK),Xo.value?(C(),E("div",{key:0,ref_key:"modesMenuRef",ref:ho,class:"modes-menu",style:Wt(Nn.value)},[p("button",{type:"button",class:Oe(["mode-row",{on:Ft.value}]),onClick:je[9]||(je[9]=tt=>i("togglePlan"))},[p("span",MK,O(S(r)("status.planLabel")),1),p("span",{class:Oe(["mode-switch",{on:Ft.value}])},[...je[31]||(je[31]=[p("span",{class:"mode-knob"},null,-1)])],2)],2),p("button",{type:"button",class:Oe(["mode-row",{on:jn.value}]),onClick:je[10]||(je[10]=tt=>i("toggleSwarm"))},[p("span",EK,O(S(r)("status.swarmLabel")),1),p("span",{class:Oe(["mode-switch",{on:jn.value}])},[...je[32]||(je[32]=[p("span",{class:"mode-knob"},null,-1)])],2)],2),p("div",{class:Oe(["mode-row mode-row-goal",{on:Je.value||o.goalMode}])},[p("button",{type:"button",class:"mode-row-main",onClick:je[11]||(je[11]=tt=>Je.value?i("controlGoal","cancel"):i("toggleGoal"))},[p("span",IK,O(S(r)("status.goalLabel")),1),Je.value?ie("",!0):(C(),E("span",{key:0,class:Oe(["mode-switch",{on:o.goalMode}])},[...je[33]||(je[33]=[p("span",{class:"mode-knob"},null,-1)])],2))]),Je.value?(C(),E("div",$K,[p("button",{type:"button",class:"mode-row-action",onClick:je[12]||(je[12]=tt=>i("controlGoal","pause"))},O(S(r)("status.goalPause")),1),p("button",{type:"button",class:"mode-row-action",onClick:je[13]||(je[13]=tt=>i("controlGoal","resume"))},O(S(r)("status.goalResume")),1)])):ie("",!0)],2)],4)):ie("",!0)],512)):ie("",!0)]),p("div",NK,[$t.value?(C(),E("button",{key:0,class:"compact-chip",onClick:je[14]||(je[14]=Ze(tt=>i("compact"),["stop"]))},"/compact")):ie("",!0),e.status&&!e.hideContext?(C(),E("span",{key:1,class:"ctx-group",title:_t.value},[(C(),E("svg",OK,[je[34]||(je[34]=p("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5"},null,-1)),p("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-at.value/100)}`},null,8,PK)])),p("span",RK,O(nt(e.status.ctxUsed))+"/"+O(nt(e.status.ctxMax)),1)],8,LK)):ie("",!0),e.status?(C(),E("span",{key:2,class:Oe(["model-pill",{open:re.value}]),role:"button",tabindex:"0",title:S(r)("status.modelTooltip"),onClick:Ze($e,["stop"]),onKeydown:[Ns($e,["enter"]),Ns(Ze($e,["prevent"]),["space"])]},[p("b",null,O(e.status.model),1),An.value?(C(),E("span",BK,O(S(r)("composer.thinkingSuffix")),1)):ie("",!0),je[35]||(je[35]=p("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"},[p("path",{d:"M4 6l4 4 4-4"})],-1))],42,DK)):ie("",!0)]),re.value&&e.status?(C(),E("div",{key:0,class:"model-dropdown",role:"menu",onClick:je[17]||(je[17]=Ze(()=>{},["stop"]))},[Qo.value.length>0?(C(),E("div",FK,O(S(r)("status.starredModels")),1)):ie("",!0),(C(!0),E(Pe,null,Xe(Qo.value,tt=>(C(),E("button",{key:tt.id,class:Oe(["md-row",{"is-current":tt.id===e.status.modelId}]),role:"menuitem",onClick:it=>Jn(tt.id)},[p("span",WK,[tt.id===e.status.model||tt.model===e.status.model||tt.displayName===e.status.model?(C(),E("svg",UK,[...je[36]||(je[36]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),p("span",qK,O(tt.displayName??tt.model),1),p("span",jK,O(tt.provider),1),je[37]||(je[37]=p("svg",{class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},[p("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,HK))),128)),Qo.value.length>0?(C(),E("div",zK)):ie("",!0),io.value.length>0?(C(),E("div",VK,O(Tt.value),1)):ie("",!0),(C(!0),E(Pe,null,Xe(io.value,tt=>(C(),E("button",{key:tt.id,class:Oe(["md-row",{"is-current":tt.id===e.status.modelId}]),role:"menuitem",onClick:it=>Jn(tt.id)},[p("span",GK,[tt.id===e.status.model||tt.model===e.status.model||tt.displayName===e.status.model?(C(),E("svg",YK,[...je[38]||(je[38]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),p("span",XK,O(tt.displayName??tt.model),1),Ro(tt.id)?(C(),E("svg",QK,[...je[39]||(je[39]=[p("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)])])):ie("",!0)],10,KK))),128)),io.value.length>0?(C(),E("div",ZK)):ie("",!0),p("button",{class:Oe(["md-row md-row-toggle",{"is-on":An.value,"is-disabled":!fn.value}]),role:"menuitem",disabled:!fn.value,onClick:je[15]||(je[15]=tt=>Nt())},[p("span",eG,[An.value?(C(),E("svg",tG,[...je[40]||(je[40]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),p("span",nG,O(S(r)("status.thinkingLabel")),1),Rt.value==="always-on"?(C(),E("span",oG,O(S(r)("status.planOn")),1)):Rt.value==="unsupported"?(C(),E("span",sG,O(S(r)("status.modeNotSupported")),1)):ie("",!0)],10,JK),je[41]||(je[41]=p("div",{class:"md-divider"},null,-1)),p("button",{class:"md-row md-row-more",role:"menuitem",onClick:je[16]||(je[16]=tt=>{se(),i("pickModel")})},[p("span",iG,O(S(r)("status.moreModels")),1)])])):ie("",!0)],512)])],34))}}),n3=bt(rG,[["__scopeId","data-v-02652603"]]),lG=["id"],aG={class:"swarm-head"},cG={class:"swarm-count"},uG={class:"swarm-grid"},dG={class:"member-top"},fG={class:"member-name"},hG={class:"member-phase"},pG={class:"member-mid"},mG={class:"member-bar"},gG={key:0,class:"member-type"},vG={key:0,class:"member-bottom"},yG=Qe({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=H(()=>t.group.members.length),o=H(()=>t.group.counts.completed+t.group.counts.failed);function s(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)=>(C(),E("section",{class:"swarm-card",id:`swarm-${e.group.id}`},[p("header",aG,[a[0]||(a[0]=p("div",{class:"swarm-title"},[p("span",{class:"swarm-mark","aria-hidden":"true"}),p("span",null,"Swarm")],-1)),p("div",cG,O(o.value)+"/"+O(n.value),1)]),p("div",uG,[(C(!0),E(Pe,null,Xe(e.group.members,c=>(C(),E("article",{key:c.id,class:Oe(["swarm-member",`phase-${c.phase}`])},[p("div",dG,[p("span",fG,O(c.name),1),p("span",hG,O(s(c.phase)),1)]),p("div",pG,[p("span",mG,O(i(c)),1),c.subagentType?(C(),E("span",gG,O(c.subagentType),1)):ie("",!0)]),c.suspendedReason||r(c)||c.summary?(C(),E("div",vG,O(c.suspendedReason||r(c)||c.summary),1)):ie("",!0)],2))),128))])],8,lG))}}),kG=bt(yG,[["__scopeId","data-v-2cfb7bcf"]]),bG={class:"goal-progress","aria-hidden":"true"},wG={key:0,class:"goal-body"},_G={class:"goal-full"},CG={key:0,class:"goal-criterion"},SG={class:"goal-stats"},xG={key:0},TG={class:"goal-actions"},AG=Qe({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),i=te(!1);ze(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=H(()=>{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)=>(C(),E("section",{class:Oe(["goal-strip",{expanded:i.value}])},[p("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[5]||(c[5]=p("span",{class:"goal-kicker"},"Goal",-1)),p("span",{class:Oe(["goal-objective",{"expanded-hidden":i.value}])},O(e.goal.objective),3),p("span",{class:Oe(["goal-status",`status-${e.goal.status}`])},O(e.goal.status),3),p("span",bG,[p("span",{class:"goal-progress-fill",style:Wt({width:`${r.value}%`})},null,4)]),(C(),E("svg",{class:Oe(["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]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),i.value?(C(),E("div",wG,[p("div",_G,O(e.goal.objective),1),e.goal.completionCriterion?(C(),E("div",CG,[c[6]||(c[6]=p("span",null,"Done when",-1)),p("p",null,O(e.goal.completionCriterion),1)])):ie("",!0),p("div",SG,[p("span",null,O(e.goal.turnsUsed)+" turns",1),p("span",null,O(e.goal.tokensUsed.toLocaleString())+" tokens",1),p("span",null,O(l(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(C(),E("span",xG,O(r.value)+"% token budget",1)):ie("",!0)]),p("div",TG,[e.goal.status!=="paused"?(C(),E("button",{key:0,type:"button",class:"goal-action",onClick:c[1]||(c[1]=Ze(u=>o("controlGoal","pause"),["stop"]))},O(S(s)("status.goalPause")),1)):ie("",!0),e.goal.status==="paused"?(C(),E("button",{key:1,type:"button",class:"goal-action primary",onClick:c[2]||(c[2]=Ze(u=>o("controlGoal","resume"),["stop"]))},O(S(s)("status.goalResume")),1)):ie("",!0),p("button",{type:"button",class:"goal-action danger",onClick:c[3]||(c[3]=Ze(u=>o("controlGoal","cancel"),["stop"]))},O(S(s)("status.goalCancel")),1)])])):ie("",!0)],2))}}),MG=bt(AG,[["__scopeId","data-v-dcbae4b7"]]),EG={class:"qh"},IG={class:"qtitle"},$G={key:0,class:"qstep"},NG={key:1,class:"qmin-peek"},LG=["title","aria-label"],OG={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"},PG={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"},RG={key:0,class:"qbody"},DG=["aria-label"],BG=["aria-selected","aria-label","onClick"],FG={class:"qstep-num"},HG={key:1,class:"qheader-chip"},WG={class:"qtext"},UG={class:"qopts"},qG=["onClick"],jG={class:"qopt-key"},zG={class:"qopt-glyph"},VG={key:0,class:"chk"},KG={key:1,class:"rad"},GG={class:"qopt-text"},YG={class:"qopt-label"},XG={key:0,class:"qopt-desc"},QG={class:"qopt-glyph"},ZG={key:0,class:"chk"},JG={key:1,class:"rad"},eY={class:"qopt-label"},tY=["placeholder"],nY={key:1,class:"qfooter"},oY=["disabled"],sY=["disabled"],iY=["disabled"],rY=Qe({__name:"QuestionCard",props:{question:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=xt(),s=t,i=te(0),r=te(!1),l=H(()=>n.question.questions[i.value]),a=H(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(P){P>=0&&P<a.value&&(i.value=P)}function f(P){const T=h.value[P];return T?T.kind==="multi"?T.optionIds.length>0:T.kind==="multiWithOther"?T.optionIds.length>0||T.otherText.trim().length>0:T.kind==="other"?T.text.trim().length>0:!0:!1}function g(){return f(l.value.id)}const h=te({});function m(P){return P.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${P.label} ${P.description??""}`.toLowerCase())}function _(){const P={...h.value};let T=!1;for(const I of n.question.questions){if(P[I.id])continue;const R=I.options.filter(m);R.length!==0&&(P[I.id]=I.multiSelect?{kind:"multi",optionIds:R.map(D=>D.id)}:{kind:"single",optionId:R[0].id},T=!0)}T&&(h.value=P)}ze(()=>n.question.questionId,()=>{i.value=0,r.value=!1,h.value={},b.value={}}),ze(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),_()},{immediate:!0,deep:!0});function w(P,T){const I=h.value[P];if(I&&I.kind==="single"&&I.optionId===T){const R={...h.value};delete R[P],h.value=R}else h.value={...h.value,[P]:{kind:"single",optionId:T}}}function k(P,T){const I=h.value[P],R=I&&(I.kind==="multi"||I.kind==="multiWithOther")?I.kind==="multi"?[...I.optionIds]:[...I.optionIds]:[],D=R.indexOf(T);D>=0?R.splice(D,1):R.push(T);const F=h.value[P],z=F&&F.kind==="multiWithOther"?F.otherText:"";z?h.value={...h.value,[P]:{kind:"multiWithOther",optionIds:R,otherText:z}}:h.value={...h.value,[P]:{kind:"multi",optionIds:R}}}const b=te({});function y(P){const T=n.question.questions.find(R=>R.id===P),I=b.value[P]??"";if(T.multiSelect){const R=h.value[P],D=R&&(R.kind==="multi"||R.kind==="multiWithOther")?R.kind==="multi"?[...R.optionIds]:[...R.optionIds]:[];h.value={...h.value,[P]:{kind:"multiWithOther",optionIds:D,otherText:I}}}else h.value={...h.value,[P]:{kind:"other",text:I}}}function x(P,T){const I=h.value[P];return I?I.kind==="single"?I.optionId===T:I.kind==="multi"||I.kind==="multiWithOther"?I.optionIds.includes(T):!1:!1}function L(P){const T=h.value[P];return!!(T&&(T.kind==="other"||T.kind==="multiWithOther"))}function N(){return n.question.questions.every(P=>f(P.id))}function v(){if(!N())return;const P={answers:h.value,method:"click"};s("answer",n.question.questionId,P)}function M(){s("dismiss",n.question.questionId)}function $(P){const T=(document.activeElement?.tagName??"").toLowerCase();if(T==="input"||T==="textarea"||r.value&&P.key!=="Escape")return;if(P.key==="Escape"){P.preventDefault(),M();return}if(P.key==="Enter"){P.preventDefault(),i.value<a.value-1&&g()?u():N()&&v();return}const I=parseInt(P.key,10);if(!isNaN(I)&&I>=1&&I<=9){P.preventDefault();const R=l.value,D=I-1,F=R.options[D];F&&(R.multiSelect?k(R.id,F.id):w(R.id,F.id))}}return rn(()=>document.addEventListener("keydown",$)),Yt(()=>document.removeEventListener("keydown",$)),(P,T)=>(C(),E("div",{class:Oe(["qcard",{minimized:r.value}])},[p("div",EG,[p("span",IG,O(S(o)("question.title")),1),a.value>1&&!r.value?(C(),E("span",$G,O(S(o)("question.step",{current:i.value+1,total:a.value})),1)):ie("",!0),r.value?(C(),E("span",NG,O(l.value.question),1)):ie("",!0),p("button",{class:"qmin",title:r.value?S(o)("question.expand"):S(o)("question.minimize"),"aria-label":r.value?S(o)("question.expand"):S(o)("question.minimize"),onClick:T[0]||(T[0]=I=>r.value=!r.value)},[r.value?(C(),E("svg",OG,[...T[4]||(T[4]=[p("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),E("svg",PG,[...T[5]||(T[5]=[p("path",{d:"M3 8h10"},null,-1)])]))],8,LG)]),r.value?ie("",!0):(C(),E("div",RG,[a.value>1?(C(),E("div",{key:0,class:"qsteps",role:"tablist","aria-label":S(o)("question.step",{current:i.value+1,total:a.value})},[(C(!0),E(Pe,null,Xe(n.question.questions,(I,R)=>(C(),E("button",{key:I.id,type:"button",class:Oe(["qstep-dot",{active:R===i.value,answered:f(I.id)}]),"aria-selected":R===i.value,"aria-label":S(o)("question.step",{current:R+1,total:a.value}),onClick:D=>d(R)},[p("span",FG,O(R+1),1)],10,BG))),128))],8,DG)):ie("",!0),l.value.header?(C(),E("div",HG,O(l.value.header),1)):ie("",!0),p("div",WG,O(l.value.question),1),l.value.body?(C(),Ve(lu,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ie("",!0),p("div",UG,[(C(!0),E(Pe,null,Xe(l.value.options,(I,R)=>(C(),E("label",{key:I.id,class:Oe(["qopt",{selected:x(l.value.id,I.id)}]),onClick:Ze(D=>l.value.multiSelect?k(l.value.id,I.id):w(l.value.id,I.id),["prevent"])},[p("span",jG,O(R+1),1),p("span",zG,[l.value.multiSelect?(C(),E("span",VG,O(x(l.value.id,I.id)?"■":"□"),1)):(C(),E("span",KG,O(x(l.value.id,I.id)?"●":"○"),1))]),p("span",GG,[p("span",YG,O(I.label),1),I.description?(C(),E("span",XG,O(I.description),1)):ie("",!0)])],10,qG))),128)),l.value.allowOther?(C(),E("label",{key:0,class:Oe(["qopt",{selected:L(l.value.id)}]),onClick:Ze(()=>{},["prevent"])},[T[6]||(T[6]=p("span",{class:"qopt-key"},null,-1)),p("span",QG,[l.value.multiSelect?(C(),E("span",ZG,O(L(l.value.id)?"■":"□"),1)):(C(),E("span",JG,O(L(l.value.id)?"●":"○"),1))]),p("span",eY,O(l.value.otherLabel??S(o)("question.otherDefault")),1),jt(p("input",{"onUpdate:modelValue":T[1]||(T[1]=I=>b.value[l.value.id]=I),class:"other-input",type:"text",placeholder:l.value.otherLabel??S(o)("question.otherDefault"),onInput:T[2]||(T[2]=I=>y(l.value.id)),onFocus:T[3]||(T[3]=I=>y(l.value.id))},null,40,tY),[[Wn,b.value[l.value.id]]])],2)):ie("",!0)])])),r.value?ie("",!0):(C(),E("div",nY,[i.value<a.value-1?(C(),E("button",{key:0,type:"button",class:"qbtn pri qfooter-main",disabled:!g(),onClick:u},O(S(o)("question.nextQuestion")),9,oY)):(C(),E("button",{key:1,type:"button",class:"qbtn pri qfooter-main",disabled:!N(),onClick:v},O(S(o)("question.submit")),9,sY)),a.value>1?(C(),E("button",{key:2,type:"button",class:"qbtn",disabled:i.value===0,onClick:c},O(S(o)("question.back")),9,iY)):ie("",!0),p("button",{type:"button",class:"qbtn qbtn-text",onClick:M},O(S(o)("question.dismiss")),1)]))],2))}}),lY=bt(rY,[["__scopeId","data-v-8babd5ae"]]),aY={class:"ah"},cY={class:"akind"},uY={class:"apath"},dY={key:0,class:"abadge"},fY={key:1,class:"aw"},hY=["title","aria-label"],pY={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"},mY={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"},gY=["title"],vY={key:1,class:"diff"},yY={class:"dg"},kY={class:"dc"},bY={key:2,class:"body-shell"},wY={class:"shell-cmd"},_Y={key:0,class:"shell-cwd"},CY={key:1,class:"shell-danger"},SY={key:3,class:"body-file"},xY={class:"file-bar"},TY={class:"file-lang"},AY={class:"file-content"},MY={class:"file-ln"},EY={class:"file-text"},IY={key:4,class:"body-chip"},$Y={class:"chip-label"},NY={class:"chip-value"},LY={key:0,class:"chip-detail"},OY={key:5,class:"body-chip"},PY={key:0,class:"chip-label"},RY={class:"chip-value"},DY={key:6,class:"body-chip"},BY={class:"chip-label"},FY={class:"chip-value"},HY={key:0,class:"chip-detail"},WY={key:7,class:"body-chip"},UY={class:"chip-label"},qY={class:"chip-value"},jY={key:0,class:"chip-detail"},zY={key:8,class:"body-todo"},VY={class:"todo-glyph"},KY={key:9,class:"body-plan"},GY={key:10,class:"body-generic"},YY={class:"gen-text"},XY={key:11,class:"feedback-wrap"},QY=["placeholder"],ZY={class:"feedback-hint"},JY={key:12,class:"plan-actions"},eX=["title","onClick"],tX={class:"k"},nX={key:0,class:"k"},oX={key:0,class:"k"},sX={key:13,class:"abtn"},iX=Qe({__name:"ApprovalCard",props:{block:{},agentName:{}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),i=H(()=>{const v=n.block;return v.kind!=="plan_review"?null:{plan:v.plan,path:v.path,options:v.options??[]}}),r=te(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const v=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${v}`)}const c=te(!1),u=te(""),d=te(null);function f(){c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0)}function g(){const v=u.value.trim();i.value?o("decide",{decision:"rejected",selectedLabel:"Revise",feedback:v||void 0}):o("decide",{decision:"rejected",feedback:v||void 0}),c.value=!1,u.value=""}function h(){c.value=!1,u.value=""}function m(v){v.key==="Enter"&&!v.shiftKey?(v.preventDefault(),g()):v.key==="Escape"&&(v.preventDefault(),h())}function _(){o("decide",{decision:"approved"})}function w(){o("decide",{decision:"approved",scope:"session"})}function k(){o("decide",{decision:"rejected"})}function b(){o("decide",{decision:"approved"})}function y(v){o("decide",{decision:"approved",selectedLabel:v})}function x(){f()}function L(){o("decide",{decision:"rejected",selectedLabel:"Reject and Exit"})}function N(v){const M=(document.activeElement?.tagName??"").toLowerCase();if(M==="input"||M==="textarea"||r.value)return;const $=i.value;if($){if($.options.length===0){v.key==="1"?(v.preventDefault(),b()):v.key==="2"?(v.preventDefault(),x()):v.key==="3"&&(v.preventDefault(),L());return}v.key==="1"&&$.options[0]?(v.preventDefault(),y($.options[0].label)):v.key==="2"&&$.options[1]?(v.preventDefault(),y($.options[1].label)):v.key==="3"&&$.options[2]&&(v.preventDefault(),y($.options[2].label));return}v.key==="1"?(v.preventDefault(),_()):v.key==="2"?(v.preventDefault(),w()):v.key==="3"?(v.preventDefault(),k()):v.key==="4"&&(v.preventDefault(),f())}return rn(()=>document.addEventListener("keydown",N)),Yt(()=>document.removeEventListener("keydown",N)),(v,M)=>(C(),E("div",{class:Oe(["appr",{minimized:r.value}])},[p("div",aY,[p("span",cY,O(a()),1),p("span",uY,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(C(),E(Pe,{key:0},[ft(O(e.block.path),1)],64)):e.block.kind==="shell"?(C(),E(Pe,{key:1},[ft(O(e.block.command),1)],64)):e.block.kind==="url"?(C(),E(Pe,{key:2},[ft(O(e.block.url),1)],64)):e.block.kind==="search"?(C(),E(Pe,{key:3},[ft(O(e.block.query),1)],64)):e.block.kind==="invocation"?(C(),E(Pe,{key:4},[ft(O(e.block.name),1)],64)):e.block.kind==="generic"?(C(),E(Pe,{key:5},[ft(O(e.block.summary),1)],64)):ie("",!0)]),e.agentName&&!r.value?(C(),E("span",dY,O(S(s)("approval.subagentBadge",{name:e.agentName})),1)):ie("",!0),r.value?ie("",!0):(C(),E("span",fY,O(S(s)("approval.required")),1)),p("button",{class:"amin",title:r.value?S(s)("question.expand"):S(s)("question.minimize"),"aria-label":r.value?S(s)("question.expand"):S(s)("question.minimize"),onClick:M[0]||(M[0]=$=>r.value=!r.value)},[r.value?(C(),E("svg",pY,[...M[2]||(M[2]=[p("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),E("svg",mY,[...M[3]||(M[3]=[p("path",{d:"M3 8h10"},null,-1)])]))],8,hY)]),r.value?ie("",!0):(C(),E(Pe,{key:0},[e.block.kind==="plan_review"&&e.block.path?(C(),E("div",{key:0,class:"ah-path",title:e.block.path},O(e.block.path),9,gY)):ie("",!0),e.block.kind==="diff"?(C(),E("div",vY,[(C(!0),E(Pe,null,Xe(e.block.diff,($,P)=>(C(),E("div",{key:P,class:Oe(["dl",$.kind==="add"?"add":$.kind==="rem"?"del":""])},[p("span",yY,O($.gutter),1),p("span",kY,O($.text),1)],2))),128))])):e.block.kind==="shell"?(C(),E("div",bY,[p("div",wY,[M[4]||(M[4]=p("span",{class:"shell-dollar"},"$",-1)),ft(" "+O(e.block.command),1)]),e.block.cwd?(C(),E("div",_Y,"cwd: "+O(e.block.cwd),1)):ie("",!0),e.block.danger?(C(),E("div",CY,O(S(s)("approval.danger",{detail:e.block.danger})),1)):ie("",!0)])):e.block.kind==="file"?(C(),E("div",SY,[p("div",xY,[p("span",TY,O(e.block.language??""),1)]),p("div",AY,[(C(!0),E(Pe,null,Xe(e.block.content.split(`
|
|
259
|
-
`),($,P)=>(C(),E("div",{key:P,class:"file-line"},[p("span",MY,O(P+1),1),p("span",EY,O($),1)]))),128))])])):e.block.kind==="fileop"?(C(),E("div",IY,[p("span",$Y,O(e.block.op),1),p("span",NY,O(e.block.path),1),e.block.detail?(C(),E("span",LY,O(e.block.detail),1)):ie("",!0)])):e.block.kind==="url"?(C(),E("div",OY,[e.block.method?(C(),E("span",PY,O(e.block.method),1)):ie("",!0),p("span",RY,O(e.block.url),1)])):e.block.kind==="search"?(C(),E("div",DY,[p("span",BY,O(S(s)("approval.searchQueryLabel")),1),p("span",FY,O(e.block.query),1),e.block.scope?(C(),E("span",HY,O(S(s)("approval.searchScope",{scope:e.block.scope})),1)):ie("",!0)])):e.block.kind==="invocation"?(C(),E("div",WY,[p("span",UY,O(e.block.kind2),1),p("span",qY,O(e.block.name),1),e.block.description?(C(),E("span",jY,O(e.block.description),1)):ie("",!0)])):e.block.kind==="todo"?(C(),E("div",zY,[(C(!0),E(Pe,null,Xe(e.block.items,($,P)=>(C(),E("div",{key:P,class:"todo-item"},[p("span",VY,O($.status==="done"||$.status==="completed"?"✓":"○"),1),p("span",{class:Oe(["todo-title",{"todo-done":$.status==="done"||$.status==="completed"}])},O($.title),3)]))),128))])):e.block.kind==="plan_review"?(C(),E("div",KY,[vt(lu,{text:e.block.plan},null,8,["text"])])):(C(),E("div",GY,[p("span",YY,O(e.block.summary),1)])),c.value?(C(),E("div",XY,[jt(p("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":M[1]||(M[1]=$=>u.value=$),class:"feedback-ta",placeholder:S(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,QY),[[Wn,u.value]]),p("div",ZY,O(S(s)("approval.feedbackHint")),1)])):ie("",!0),i.value?(C(),E("div",JY,[i.value.options.length>0?(C(!0),E(Pe,{key:0},Xe(i.value.options,($,P)=>(C(),E("div",{key:P,class:"kbtn pri",title:$.description,onClick:T=>y($.label)},[ft(O($.label),1),p("span",tX,"["+O(P+1)+"]",1)],8,eX))),128)):(C(),E("div",{key:1,class:"kbtn pri",onClick:b},[ft(O(S(s)("approval.approvePlan")),1),M[5]||(M[5]=p("span",{class:"k"},"[1]",-1))])),p("div",{class:"kbtn",onClick:x},[ft(O(S(s)("approval.revise")),1),i.value.options.length===0?(C(),E("span",nX,"[2]")):ie("",!0)]),p("div",{class:"kbtn danger",onClick:L},[ft(O(S(s)("approval.rejectAndExit")),1),i.value.options.length===0?(C(),E("span",oX,"[3]")):ie("",!0)])])):(C(),E("div",sX,[p("div",{class:"kbtn pri",onClick:_},[ft(O(S(s)("approval.approve")),1),M[6]||(M[6]=p("span",{class:"k"},"[1]",-1))]),p("div",{class:"kbtn",onClick:w},[ft(O(S(s)("approval.approveSession")),1),M[7]||(M[7]=p("span",{class:"k"},"[2]",-1))]),p("div",{class:"kbtn",onClick:k},[ft(O(S(s)("approval.reject")),1),M[8]||(M[8]=p("span",{class:"k"},"[3]",-1))]),p("div",{class:"kbtn",onClick:f},[ft(O(S(s)("approval.feedback")),1),M[9]||(M[9]=p("span",{class:"k"},"[4]",-1))])]))],64))],2))}}),rX=bt(iX,[["__scopeId","data-v-341cf3fd"]]),lX={class:"taskspane"},aX={class:"tp-head"},cX={class:"tp-title"},uX={class:"tp-count"},dX={class:"tp-list"},fX={key:0,class:"tp-empty"},hX=["role","onClick"],pX={class:"tp-name"},mX={class:"tp-kind"},gX={class:"tp-time"},vX=["onClick"],yX={key:0,class:"tp-detail"},kX={key:0,class:"tp-codebox"},bX=["onClick"],wX={class:"tp-pre"},_X={class:"tp-cmd"},CX={key:1,class:"tp-codebox"},SX=["onClick"],xX={class:"tp-pre"},TX=Qe({__name:"TasksPane",props:{tasks:{}},emits:["cancel"],setup(e,{emit:t}){const n=t,{t:o}=xt(),s=as(new Set),i=as(new Set),r=as(new Set);function l(h){return!!(h.output&&h.output.length>0||h.meta)}function a(h){l(h)&&(s.has(h.id)?s.delete(h.id):s.add(h.id))}function c(h){switch(h){case"run":return"●";case"done":return"✓";case"fail":return"✗";default:return"○"}}function u(h){switch(h){case"run":return"s-run";case"done":return"s-done";case"fail":return"s-fail";default:return"s-pending"}}async function d(h,m,_){await wo(h)&&(_.add(m),setTimeout(()=>_.delete(m),1500))}async function f(h){h.meta&&await d(h.meta,h.id,i)}async function g(h){const m=h.output?.join(`
|
|
260
|
-
`)??"";m&&await d(m,h.id,r)}return(h,m)=>(C(),E("div",lX,[p("div",aX,[p("span",cX,O(S(o)("tasks.tag")),1),p("span",uX,O(e.tasks.length),1)]),p("div",dX,[e.tasks.length===0?(C(),E("div",fX,O(S(o)("tasks.emptyTasks")),1)):(C(!0),E(Pe,{key:1},Xe(e.tasks,_=>(C(),E("div",{key:_.id,class:Oe(["tp-row",{done:_.state==="done",fail:_.state==="fail",expandable:l(_)}])},[p("div",{class:"tp-main",role:l(_)?"button":void 0,onClick:w=>a(_)},[p("span",{class:Oe(["tp-glyph",u(_.state)])},O(c(_.state)),3),p("span",pX,O(_.name),1),p("span",mX,O(_.kind),1),p("span",gX,O(_.timing),1),_.state==="run"?(C(),E("button",{key:0,class:"tp-stop",onClick:Ze(w=>n("cancel",_.id),["stop"])},O(S(o)("tasks.stop")),9,vX)):ie("",!0),l(_)?(C(),E("svg",{key:1,class:Oe(["tp-chevron",{open:s.has(_.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"},[...m[0]||(m[0]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])],2)):ie("",!0)],8,hX),s.has(_.id)&&l(_)?(C(),E("div",yX,[_.meta?(C(),E("div",kX,[p("button",{class:Oe(["tp-copy",{copied:i.has(_.id)}]),onClick:Ze(w=>f(_),["stop"])},O(i.has(_.id)?"已复制":"复制"),11,bX),p("pre",wX,[p("code",null,[p("span",_X,O(_.meta),1)])])])):ie("",!0),_.output&&_.output.length>0?(C(),E("div",CX,[p("button",{class:Oe(["tp-copy",{copied:r.has(_.id)}]),onClick:Ze(w=>g(_),["stop"])},O(r.has(_.id)?"已复制":"复制"),11,SX),p("pre",xX,[p("code",null,[m[1]||(m[1]=ft(`
|
|
261
|
-
`,-1)),(C(!0),E(Pe,null,Xe(_.output,(w,k)=>(C(),E("span",{key:k,class:"tp-line"},O(w),1))),128)),m[2]||(m[2]=ft(`
|
|
262
|
-
`,-1))])])])):ie("",!0)])):ie("",!0)],2))),128))])]))}}),_2=bt(TX,[["__scopeId","data-v-bdbdc201"]]),AX={class:"tc-title"},MX={key:0,class:"tc-count"},EX={key:0,class:"tc-list"},IX={key:0,class:"tc-empty"},$X={class:"tc-name"},NX=Qe({__name:"TodoCard",props:{todos:{},inline:{type:Boolean}},setup(e){const t=e,{t:n}=xt(),o=te(!1),s=H(()=>!t.inline),i=H(()=>t.inline||!o.value);function r(){s.value&&(o.value=!o.value)}const l=H(()=>t.todos.filter(c=>c.status==="done").length);function a(c){return c==="done"?"done":c==="in_progress"?"in_progress":"pending"}return(c,u)=>(C(),E("div",{class:Oe(["todo-card",{"tab-mode":e.inline}])},[(C(),Ve(ko(s.value?"button":"div"),{class:Oe(["tc-head",{static:!s.value}]),type:s.value?"button":void 0,onClick:r},{default:In(()=>[u[1]||(u[1]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.4","aria-hidden":"true"},[p("polyline",{points:"2,4.5 3.5,6 5.5,3"}),p("polyline",{points:"2,11 3.5,12.5 5.5,9.5"}),p("line",{x1:"8",y1:"4.5",x2:"14",y2:"4.5"}),p("line",{x1:"8",y1:"11",x2:"14",y2:"11"})],-1)),p("span",AX,O(S(n)("tasks.todoTag")),1),e.todos.length>0?(C(),E("span",MX,O(l.value)+"/"+O(e.todos.length),1)):ie("",!0),s.value&&e.todos.length>0?(C(),E("svg",{key:1,class:Oe(["tc-chev",{open:!o.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]=[p("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2)):ie("",!0)]),_:1},8,["class","type"])),i.value?(C(),E("div",EX,[e.todos.length===0?(C(),E("div",IX,O(S(n)("tasks.emptyTodo")),1)):ie("",!0),(C(!0),E(Pe,null,Xe(e.todos,(d,f)=>(C(),E("div",{key:f,class:Oe(["tc-row",`s-${d.status}`])},[p("span",{class:Oe(["tc-glyph",`g-${a(d.status)}`])},null,2),p("span",$X,O(d.title),1)],2))),128))])):ie("",!0)],2))}}),LX=bt(NX,[["__scopeId","data-v-26afda08"]]),OX={key:0,class:"queue-head"},PX={class:"queue-label"},RX=["title"],DX={class:"queue-list"},BX=["disabled","title","onClick"],FX={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"},HX=["title","onClick"],WX=Qe({__name:"QueuePane",props:{queued:{},running:{type:Boolean},inline:{type:Boolean}},emits:["steer","unqueue","editQueued"],setup(e,{emit:t}){const n=t,{t:o}=xt();function s(i,r){r.attachmentCount>0||n("editQueued",i)}return(i,r)=>(C(),E("div",{class:Oe(["queue-pane",{"tab-mode":e.inline}])},[e.inline?ie("",!0):(C(),E("div",OX,[p("span",PX,O(S(o)("composer.queueLabel"))+" · "+O(e.queued.length),1),e.running?(C(),E("button",{key:0,class:"queue-steer",type:"button",title:S(o)("composer.steerTitle"),onClick:r[0]||(r[0]=l=>n("steer"))},O(S(o)("composer.steerNow")),9,RX)):ie("",!0)])),p("div",DX,[(C(!0),E(Pe,null,Xe(e.queued,(l,a)=>(C(),E("div",{key:a,class:"queue-item"},[p("button",{class:"queue-text",type:"button",disabled:l.attachmentCount>0,title:l.attachmentCount>0?S(o)("composer.queuedHasImage",{n:l.attachmentCount}):S(o)("composer.editQueued"),onClick:c=>s(a,l)},[l.attachmentCount>0?(C(),E("svg",FX,[...r[1]||(r[1]=[p("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},null,-1),p("circle",{cx:"5.5",cy:"6.5",r:"1.2"},null,-1),p("path",{d:"M2.5 12l3.5-3.5 2.5 2.5 3-3 2 2"},null,-1)])])):ie("",!0),p("span",{class:Oe(["queue-text-inner",{placeholder:!l.text}])},O(l.text||S(o)("composer.queuedImageOnly",{n:l.attachmentCount})),3)],8,BX),p("button",{class:"queue-rm",title:S(o)("composer.remove"),onClick:c=>n("unqueue",a)},[...r[2]||(r[2]=[p("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"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,HX)]))),128))])],2))}}),UX=bt(WX,[["__scopeId","data-v-b5832f1f"]]),qX={class:"dock-work-head"},jX={key:0,class:"dock-work-tab static"},zX={key:1,class:"dock-work-tab static"},VX={key:2,class:"dock-work-tab static"},KX={key:3,class:"dock-work-tab static"},GX=["title"],YX={class:"dock-work-body"},XX=["aria-pressed"],QX={class:"dw-count"},ZX=["aria-pressed"],JX={class:"dw-count"},eQ=["aria-pressed"],tQ={class:"dw-count"},nQ=["aria-pressed"],oQ={class:"dw-count"},sQ=Qe({__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 o=e,s=n,{t:i}=xt(),r=te(null),l=te(null),a=te(null);function c(g){r.value?.loadForEdit(g)}function u(){r.value?.focus()}function d(g){const h=o.queued?.[g]?.text??"";h&&c(h),s("editQueued",g)}function f(g){if(!o.dockPanel)return;const h=g.target;h&&(l.value?.contains(h)||a.value?.contains(h)||s("close-dock-panel"))}return ze(()=>o.dockPanel,g=>{typeof document>"u"||(document.removeEventListener("mousedown",f,!0),g&&document.addEventListener("mousedown",f,!0))},{immediate:!0}),Yt(()=>{typeof document<"u"&&document.removeEventListener("mousedown",f,!0)}),t({loadForEdit:c,focus:u}),(g,h)=>(C(),E("div",{class:Oe(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:h[31]||(h[31]=Ze(()=>{},["stop"]))},[vt(Fi,{name:"dock-panel"},{default:In(()=>[e.dockPanel?(C(),E("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:h[5]||(h[5]=Ze(()=>{},["stop"]))},[p("div",qX,[e.dockPanel==="bash"?(C(),E("span",jX,O(S(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(S(i)("tasks.running")),1)):e.dockPanel==="subagent"?(C(),E("span",zX,O(S(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(S(i)("tasks.running")),1)):e.dockPanel==="todos"?(C(),E("span",VX,O(S(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):e.dockPanel==="queue"?(C(),E("span",KX,O(S(i)("tasks.dockQueue"))+" · "+O(e.queued?.length??0),1)):ie("",!0),e.dockPanel==="queue"&&e.running?(C(),E("button",{key:4,type:"button",class:"dock-queue-steer",title:S(i)("composer.steerTitle"),onClick:h[0]||(h[0]=m=>s("steer",{text:"",attachments:[]}))},O(S(i)("composer.steerNow")),9,GX)):ie("",!0)]),p("div",YX,[e.dockPanel==="bash"?(C(),Ve(_2,{key:0,tasks:e.bashTasks,onCancel:h[1]||(h[1]=m=>s("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(C(),Ve(_2,{key:1,tasks:e.subagentTasks,onCancel:h[2]||(h[2]=m=>s("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="todos"?(C(),Ve(LX,{key:2,todos:e.todos??[],inline:""},null,8,["todos"])):(C(),Ve(UX,{key:3,queued:e.queued??[],running:e.running,inline:"",onSteer:h[3]||(h[3]=m=>s("steer",{text:"",attachments:[]})),onUnqueue:h[4]||(h[4]=m=>s("unqueue",m)),onEditQueued:d},null,8,["queued","running"]))])],512)):ie("",!0)]),_:1}),e.goal?(C(),Ve(MG,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:h[6]||(h[6]=m=>s("controlGoal",m))},null,8,["goal","force-expanded"])):ie("",!0),e.hasDockWork?(C(),E("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(C(),E("button",{key:0,type:"button",class:Oe(["dock-work-chip",{on:e.dockPanel==="bash"}]),"aria-pressed":e.dockPanel==="bash",onClick:h[7]||(h[7]=m=>s("toggle-dock-panel","bash"))},[h[34]||(h[34]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[p("circle",{cx:"8",cy:"8",r:"5.5"}),p("path",{d:"M8 4.5V8l2.5 1.5"})],-1)),p("span",null,O(S(i)("tasks.dockBash")),1),p("span",QX,[h[32]||(h[32]=ft("(",-1)),p("b",null,O(e.bashTasks.length),1),h[33]||(h[33]=ft(")",-1))])],10,XX)):ie("",!0),e.subagentTasks.length>0?(C(),E("button",{key:1,type:"button",class:Oe(["dock-work-chip",{on:e.dockPanel==="subagent"}]),"aria-pressed":e.dockPanel==="subagent",onClick:h[8]||(h[8]=m=>s("toggle-dock-panel","subagent"))},[h[37]||(h[37]=p("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"},[p("path",{d:"M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"})],-1)),p("span",null,O(S(i)("tasks.dockSubagent")),1),p("span",JX,[h[35]||(h[35]=ft("(",-1)),p("b",null,O(e.subagentTasks.length),1),h[36]||(h[36]=ft(")",-1))])],10,ZX)):ie("",!0),(e.todos?.length??0)>0?(C(),E("button",{key:2,type:"button",class:Oe(["dock-work-chip",{on:e.dockPanel==="todos"}]),"aria-pressed":e.dockPanel==="todos",onClick:h[9]||(h[9]=m=>s("toggle-dock-panel","todos"))},[h[40]||(h[40]=_r('<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" data-v-b7c4b6e1><path d="M3 4.5l1.5 1.5L7 3.5" data-v-b7c4b6e1></path><path d="M8.5 5h4" data-v-b7c4b6e1></path><path d="M3 11l1.5 1.5L7 10" data-v-b7c4b6e1></path><path d="M8.5 11.5h4" data-v-b7c4b6e1></path></svg>',1)),p("span",null,O(S(i)("tasks.dockTodos")),1),p("span",tQ,[h[38]||(h[38]=ft("(",-1)),p("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),h[39]||(h[39]=ft(")",-1))])],10,eQ)):ie("",!0),(e.queued?.length??0)>0?(C(),E("button",{key:3,type:"button",class:Oe(["dock-work-chip",{on:e.dockPanel==="queue"}]),"aria-pressed":e.dockPanel==="queue",onClick:h[10]||(h[10]=m=>s("toggle-dock-panel","queue"))},[h[43]||(h[43]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[p("path",{d:"M2 4l6 4 6-4"}),p("rect",{x:"2",y:"4",width:"12",height:"8",rx:"1.5"})],-1)),p("span",null,O(S(i)("tasks.dockQueue")),1),p("span",oQ,[h[41]||(h[41]=ft("(",-1)),p("b",null,O(e.queued?.length??0),1),h[42]||(h[42]=ft(")",-1))])],10,nQ)):ie("",!0)],512)):ie("",!0),e.pendingQuestion?(C(),Ve(lY,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,onAnswer:h[11]||(h[11]=(m,_)=>s("answer",m,_)),onDismiss:h[12]||(h[12]=m=>s("dismiss",m))},null,8,["question"])):e.pendingApproval?(C(),Ve(rX,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,onDecide:h[13]||(h[13]=m=>s("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name"])):(C(),Ve(n3,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:h[14]||(h[14]=m=>s("submit",m)),onSteer:h[15]||(h[15]=m=>s("steer",m)),onCommand:h[16]||(h[16]=m=>s("command",m)),onInterrupt:h[17]||(h[17]=m=>s("interrupt")),onSetPermission:h[18]||(h[18]=m=>s("setPermission",m)),onSetThinking:h[19]||(h[19]=m=>s("setThinking",m)),onTogglePlan:h[20]||(h[20]=m=>s("togglePlan")),onToggleSwarm:h[21]||(h[21]=m=>s("toggleSwarm")),onToggleGoal:h[22]||(h[22]=m=>s("toggleGoal")),onOpenBtw:h[23]||(h[23]=m=>s("openBtw")),onCreateGoal:h[24]||(h[24]=m=>s("createGoal",m)),onControlGoal:h[25]||(h[25]=m=>s("controlGoal",m)),onFocusGoal:h[26]||(h[26]=m=>s("focusGoal")),onFocusSwarm:h[27]||(h[27]=m=>s("focusSwarm")),onCompact:h[28]||(h[28]=m=>s("compact")),onPickModel:h[29]||(h[29]=m=>s("pickModel")),onSelectModel:h[30]||(h[30]=m=>s("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]))],2))}}),iQ=bt(sQ,[["__scopeId","data-v-b7c4b6e1"]]),rQ=["aria-label"],lQ={class:"toc-track"},aQ=["aria-label","onMouseenter","onClick"],cQ={class:"toc-no"},uQ=Qe({__name:"ConversationToc",props:{items:{},metrics:{},activeTurnId:{},viewport:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),i=H(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1),r=te({visible:!1,text:"",top:0});function l(c,u){const d=u.currentTarget;d&&(r.value={visible:!0,text:c,top:d.offsetTop})}function a(){r.value.visible=!1}return(c,u)=>i.value?(C(),E("nav",{key:0,class:"conversation-toc","aria-label":S(s)("conversation.toc")},[p("div",lQ,[(C(!0),E(Pe,null,Xe(e.items,(d,f)=>(C(),E("button",{key:d.id,type:"button",class:Oe(["toc-bubble",[d.role,{active:e.activeTurnId===d.id}]]),style:Wt({height:e.metrics[f]?.height+"px"}),"aria-label":`#${d.no} ${d.title}`,onMouseenter:g=>l(d.title,g),onMouseleave:a,onClick:g=>o("select",d.id)},[p("span",cQ,O(d.no),1)],46,aQ))),128)),e.viewport?(C(),E("div",{key:0,class:"toc-viewport",style:Wt({top:e.viewport.top+"px",height:e.viewport.height+"px"})},null,4)):ie("",!0)]),vt(Fi,{name:"toc-tip"},{default:In(()=>[jt(p("div",{class:"toc-tooltip",style:Wt({top:r.value.top+"px"})},O(r.value.text),5),[[js,r.value.visible]])]),_:1})],8,rQ)):ie("",!0)}}),dQ=bt(uQ,[["__scopeId","data-v-dc54da9a"]]),fQ=5;function hQ(e,t,n,o=fQ){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(s[o-1]=i)}return s}const pQ={class:"chat-layout"},mQ={class:"empty-hint"},gQ={class:"empty-hint-title"},vQ={class:"empty-hint-text"},yQ={key:0,class:"ws-pick"},kQ=["title"],bQ={class:"ws-pick-name"},wQ={key:1,class:"ws-pick-menu"},_Q=["onClick"],CQ={class:"ws-pick-item-name"},SQ={class:"ws-pick-item-path"},xQ={key:0,class:"swarm-stack"},TQ=["aria-label"],AQ={key:0,class:"abort-toast",role:"status","aria-live":"polite"},MQ={class:"abort-toast-text"},Ad=10,EQ=56,IQ=420,C2=80,$Q=1e3,NQ=3e3,LQ=Qe({__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:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},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","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=te(!1),r=te(!1),l=H(()=>o.workspaces?.find(ke=>ke.id===o.activeWorkspaceId)?.name??o.workspaceName??""),a=H(()=>(o.workspaces?.length??0)>0),c=H(()=>hQ(o.workspaces??[],o.activeWorkspaceId,r.value)),u=H(()=>(o.workspaces?.length??0)-c.value.length);ze(i,Ie=>{Ie||(r.value=!1)});const d=H(()=>o.swarms?.filter(Ie=>Ie.members.some(ke=>ke.phase!=="completed"&&ke.phase!=="failed"))??[]);function f(Ie){i.value=!1,Ie!==o.activeWorkspaceId&&s("selectWorkspace",Ie)}const{t:g}=xt();Zc(Mt.contentAlign);const h=te(null),m=te(null),_=te(null),w=te(!1),k=te(0);let b=null;function y(Ie){(_.value??m.value)?.loadForEdit(Ie)}function x(){w.value=!0,b!==null&&clearTimeout(b),b=setTimeout(()=>{b=null,w.value=!1},2e3)}function L(){k.value++}function N(){ht(()=>{Re.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const v=H(()=>o.mobile===!0||o.modern===!0),M=H(()=>o.tasks.filter(Ie=>Ie.kind!=="subagent")),$=H(()=>o.tasks.filter(Ie=>Ie.kind==="subagent")),P=H(()=>M.value.filter(Ie=>Ie.state==="run").length),T=H(()=>$.value.filter(Ie=>Ie.state==="run").length),I=H(()=>(o.todos??[]).filter(Ie=>Ie.status==="done").length),R=H(()=>o.tasks.length>0||(o.todos?.length??0)>0||(o.queued?.length??0)>0),D=te(null),F=H(()=>o.gitInfo?o.changes?.length??0:0);function z(Ie){D.value=D.value===Ie?null:Ie}function V(){D.value=null}ze(R,Ie=>{Ie||V()});function ne(Ie){if(Ie.role==="compaction")return g("conversation.compactedPlain");if(Ie.role==="user"){if(Ie.skillActivation)return`/${Ie.skillActivation.name}`;const Fe=Ie.text.trim().replaceAll(/\s+/g," ");return Fe.length>0?Fe:"user"}const ke=(Ie.text||Ie.thinking||"").trim().replaceAll(/\s+/g," ");return ke.length>0?ke:(Ie.tools?.length??0)>0?`${Ie.tools.length} tools`:"kimi"}const K=H(()=>o.turns.map((Ie,ke)=>({id:Ie.id,role:Ie.role,no:Ie.no||ke+1,title:ne(Ie)})));function G(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((ke,Fe)=>ke+Fe.name.length+(Fe.arg?.length??0)+(Fe.output?.join("").length??0),0)??0)}const X=H(()=>{const Ie=K.value,ke=Ie.map(Ct=>{const St=o.turns.find(mn=>mn.id===Ct.id);return St?G(St):Ad}),Fe=ke.reduce((Ct,St)=>Ct+St,0)||Ie.length*Ad;return Ie.map((Ct,St)=>{const mn=ke[St]??Ad,gn=Fe>0?mn/Fe:0,ys=Math.max(Ad,Math.min(EQ,gn*IQ));return{id:Ct.id,height:Math.round(ys)}})}),be=H(()=>X.value.reduce((Ie,ke)=>Ie+ke.height,0)+(K.value.length-1)*4),le=te(null),We=te(null);function ue(){const Ie=Re.value;if(!Ie)return;const ke=Ie.querySelectorAll(".turn-anchor[data-turn-id]");if(ke.length===0)return;const Fe=Ie.getBoundingClientRect(),Ct=Fe.height/2;let St=null,mn=1/0;ke.forEach(Vn=>{const hi=Vn.getBoundingClientRect(),de=hi.top-Fe.top,Te=Math.abs(de+hi.height/2-Ct);Te<mn&&(mn=Te,St=Vn.dataset.turnId??null)}),le.value=St;const gn=Ie.scrollHeight-Ie.clientHeight,ys=gn>0?Ie.scrollTop/gn:0,Zo=be.value,Ui=ys*Zo,fi=Ie.scrollHeight>0?Ie.clientHeight/Ie.scrollHeight*Zo:Zo;We.value={top:Math.max(0,Ui),height:Math.max(8,Math.min(fi,Zo-Ui))}}const ve=H(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),Ne=H(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),Re=te(null),Q=te(null),ce=te(0),Se=te(0),q=H(()=>({"--panes-scrollbar-width":`${ce.value}px`}));function ee(Ie){return Ie instanceof HTMLElement?Ie:Ie&&"$el"in Ie&&Ie.$el instanceof HTMLElement?Ie.$el:null}function he(){const Ie=Re.value;ce.value=Ie?Math.max(0,Ie.offsetWidth-Ie.clientWidth):0,Se.value=Q.value?.offsetHeight??0}function oe(Ie){const ke=ee(Ie);Re.value=ke,ke&&io()}function fe(Ie){const ke=ee(Ie);Q.value=ke??null,Ie&&"loadForEdit"in Ie&&typeof Ie.loadForEdit=="function"&&"focus"in Ie&&typeof Ie.focus=="function"?_.value={loadForEdit:Ie.loadForEdit.bind(Ie),focus:Ie.focus.bind(Ie)}:_.value=null,Tt()}const W=te(!0),Y=te(!1);function re(){const Ie=Re.value;return Ie?Ie.scrollHeight-Ie.scrollTop-Ie.clientHeight:0}let ge=0,xe=0,$e=0,se=0,ae=0;function we(){return Date.now()<xe}function qe(){const Ie=Re.value;if(!Ie)return;const ke=Ie.scrollTop;if(performance.now()-$e<100){ge=ke;return}const Fe=re();if(we()){W.value=!0,Y.value=!1,ge=ke;return}ke<ge-1&&Fe>1?W.value=!1:Fe<=C2&&ke>ge+1&&(W.value=!0,Y.value=!1),ge=ke,ue()}function nt(Ie=!1){const ke=Re.value;ke&&(Ie&&typeof ke.scrollTo=="function"?($e=performance.now(),ke.scrollTo({top:ke.scrollHeight,behavior:"smooth"})):ke.scrollTop=ke.scrollHeight,ge=ke.scrollTop,W.value=!0,Y.value=!1)}function at(Ie,ke){const Fe=Ie.querySelectorAll(".turn-anchor");for(const Ct of Fe)if(Ct.offsetTop>=ke){const St=Ct.dataset.turnId;if(St)return{id:St,top:Ct.offsetTop}}return null}async function _t(){if(!o.sessionId||!o.loadOlderMessages||o.loadingMore||!o.hasMoreMessages)return;const Ie=o.sessionId,ke=Re.value,Fe=ke?.scrollTop??0,Ct=ke?.scrollHeight??0,St=ke?at(ke,Fe):null;Co.value=!0;try{await o.loadOlderMessages(Ie),await ht()}finally{Co.value=!1}if(o.sessionId!==Ie)return;const mn=Re.value;if(!mn)return;let gn=0;if(St){const ys=mn.querySelector(`.turn-anchor[data-turn-id="${$t(St.id)}"]`);ys&&(gn=ys.offsetTop-St.top)}gn===0&&(gn=mn.scrollHeight-Ct),mn.scrollTop=Fe+gn}function $t(Ie){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ie):Ie.replaceAll(/["\\]/g,"\\$&")}function lt(Ie){const ke=Re.value;if(!ke)return;const Fe=ke.querySelector(`.turn-anchor[data-turn-id="${$t(Ie)}"]`);Fe&&(W.value=!1,Y.value=re()>C2,Fe.scrollIntoView({behavior:"smooth",block:"center"}))}function Rt(){const Ie=Re.value;if(!Ie)return"none";const ke=Ie.firstElementChild,Fe=ke instanceof HTMLElement?ke.offsetHeight:0,Ct=Q.value?.offsetHeight??0;return`${Ie.scrollHeight}:${Ie.clientHeight}:${Fe}:${Ct}`}function fn(Ie){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ie):setTimeout(Ie,16)}function An(Ie){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ie):clearTimeout(Ie)}function Nt(Ie=36){if(!W.value&&!we())return;const ke=++ae;let Fe="",Ct=0,St=0;se&&(An(se),se=0);const mn=()=>{if(se=0,ke!==ae||!W.value&&!we())return;nt(!1);const gn=Rt();Ct=gn===Fe?Ct+1:0,Fe=gn,St++,Ct<3&&St<Ie&&(se=fn(mn))};se=fn(mn)}function Ft(Ie,ke){return Ie!==void 0&&Ie.length>0&&ke.length>=Ie.length&&Ie.firstId!==ke.firstId&&Ie.lastId===ke.lastId&&Ie.lastTextLen===ke.lastTextLen&&Ie.lastThinkingLen===ke.lastThinkingLen&&Ie.lastToolsLen===ke.lastToolsLen&&Ie.approvalIds===ke.approvalIds}const jn=H(()=>{const Ie=(o.approvals??[]).map(mn=>mn.approvalId).join(","),ke=o.turns,Fe=ke.at(-1),Ct=Fe?.thinking?.length??0,St=Fe?.tools?.reduce((mn,gn)=>mn+gn.name.length+(gn.arg?.length??0)+(gn.output?.join("").length??0),0)??0;return{length:ke.length,firstId:ke[0]?.id??"",lastId:Fe?.id??"",lastTextLen:Fe?.text.length??0,lastThinkingLen:Ct,lastToolsLen:St,approvalIds:Ie}});ze(jn,async(Ie,ke)=>{if(Co.value&&Ft(ke,Ie)){ue();return}await ht(),W.value||we()?nt(!1):Y.value=!0,ue()}),ze(Q,()=>{Tt()}),ze(()=>o.mobile,async()=>{await ht(),he()});const Je=new Map;ze(()=>o.fileReloadKey,async(Ie,ke)=>{const Fe=Re.value;ke&&Fe&&Je.set(String(ke),{top:Fe.scrollTop,following:W.value}),await ht();const Ct=Re.value,St=Ie?Je.get(String(Ie)):void 0;St&&Ct?(W.value=St.following,Ct.scrollTop=St.top,ge=St.top,St.following&&Nt()):(W.value=!0,ge=0,nt(!1),Nt()),ue()}),ze(()=>o.sessionLoading,async(Ie,ke)=>{Ie||!ke||(W.value=!0,await ht(),Nt(),ue())}),ze(()=>o.running,async(Ie,ke)=>{Ie||!ke||!W.value&&!we()||(await ht(),Nt(48),ue())});function Qn(){W.value=!0,Y.value=!1,xe=Date.now()+$Q,ht(()=>{nt(!1),Nt(16)})}function Xo(Ie){Qn(),s("submit",Ie)}function Oo(Ie,ke){Qn(),s("answer",Ie,ke)}function ho(Ie,ke){!Ie||!ke||s("approval",Ie,ke)}let Nn=null,cn=null,wn=null,On=null,zn=0,Zn=!1;const Co=te(!1);function po(Ie){if(Co.value||(Zn=Zn||Ie,zn))return;zn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:Fe=>setTimeout(Fe,16))(()=>{zn=0;const Fe=Zn;Zn=!1,W.value||we()?nt(!1):Fe&&(Y.value=!0)})}function Po(){if(!cn)return;const Ie=Re.value?.firstElementChild??null;Ie!==wn&&(wn&&cn.unobserve(wn),wn=Ie,Ie&&cn.observe(Ie))}function Tt(){if(!cn)return;const Ie=Q.value;Ie!==On&&(On&&cn.unobserve(On),On=Ie,Ie&&cn.observe(Ie))}function io(){const Ie=Re.value;he(),Nn&&(Nn.disconnect(),Ie&&Nn.observe(Ie,{childList:!0,subtree:!0,characterData:!0})),cn&&(cn.disconnect(),wn=null,On=null,Ie&&cn.observe(Ie),Po(),Tt())}function nn(){Po(),po(!0)}function Ro(){typeof document>"u"||document.visibilityState==="visible"&&W.value&&Nt()}const Qo=te(!1);let Jn=null;function Ye(){Qo.value=!0,Jn!==null&&clearTimeout(Jn),Jn=setTimeout(()=>{Qo.value=!1},NQ)}function je(){Ye(),s("interrupt")}function tt(Ie){Ie.key==="Escape"&&(o.running||o.sending)&&(Ie.preventDefault(),je())}rn(()=>{ht(()=>{typeof MutationObserver=="function"&&(Nn=new MutationObserver(nn)),typeof ResizeObserver=="function"&&(cn=new ResizeObserver(()=>{he(),po(!1)})),io(),Nt(48),ue(),typeof document<"u"&&(document.addEventListener("visibilitychange",Ro),document.addEventListener("keydown",tt))})}),Yt(()=>{Nn&&Nn.disconnect(),cn&&cn.disconnect(),zn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(zn),se&&An(se),Jn!==null&&clearTimeout(Jn),b!==null&&(clearTimeout(b),b=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ro),document.removeEventListener("keydown",tt))});function it(){(_.value??m.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:it}),(Ie,ke)=>(C(),E("section",{class:Oe(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(C(),Ve(yV,{key:0,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":F.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:w.value,onOpenChanges:ke[0]||(ke[0]=Fe=>s("openChanges")),onCopyAll:ke[1]||(ke[1]=Fe=>h.value?.copyConversation()),onCopyFinalSummary:ke[2]||(ke[2]=Fe=>h.value?.copyFinalSummary()),onOpenPr:ke[3]||(ke[3]=Fe=>e.pr&&s("openPr",e.pr.url)),onRenameSession:ke[4]||(ke[4]=(Fe,Ct)=>s("renameSession",Fe,Ct)),onForkSession:ke[5]||(ke[5]=Fe=>s("forkSession",Fe)),onArchiveSession:ke[6]||(ke[6]=Fe=>s("archiveSession",Fe))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ie("",!0),e.betaToc?(C(),Ve(dQ,{key:1,items:K.value,metrics:X.value,"active-turn-id":le.value,viewport:We.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:lt},null,8,["items","metrics","active-turn-id","viewport","mobile","session-loading"])):ie("",!0),p("div",pQ,[p("div",{ref:oe,class:"panes chat-scroll",onScrollPassive:qe},[p("div",{class:Oe(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(C(),E(Pe,{key:0},[ke[59]||(ke[59]=p("div",{class:"empty-spacer"},null,-1)),p("div",mQ,[p("span",gQ,O(S(g)("composer.emptyConversationTitle")),1),p("span",vQ,O(S(g)("composer.emptyConversation")),1),a.value?(C(),E("div",yQ,[p("button",{type:"button",class:"ws-pick-btn",title:S(g)("conversation.switchWorkspace"),onClick:ke[7]||(ke[7]=Ze(Fe=>i.value=!i.value,["stop"]))},[ke[55]||(ke[55]=p("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},[p("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"}),p("path",{d:"M1 5.5h12"})],-1)),p("span",bQ,O(l.value),1),(C(),E("svg",{class:Oe(["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"},[...ke[54]||(ke[54]=[p("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2))],8,kQ),i.value?(C(),E("div",{key:0,class:"ws-pick-backdrop",onClick:ke[8]||(ke[8]=Fe=>i.value=!1)})):ie("",!0),i.value?(C(),E("div",wQ,[(C(!0),E(Pe,null,Xe(c.value,Fe=>(C(),E("button",{key:Fe.id,type:"button",class:Oe(["ws-pick-item",{on:Fe.id===e.activeWorkspaceId}]),onClick:Ze(Ct=>f(Fe.id),["stop"])},[p("span",CQ,O(Fe.name),1),p("span",SQ,O(Fe.shortPath),1)],10,_Q))),128)),u.value>0?(C(),E("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:ke[9]||(ke[9]=Ze(Fe=>r.value=!r.value,["stop"]))},[p("span",null,O(S(g)("conversation.moreWorkspaces",{count:u.value})),1)])):ie("",!0),ke[57]||(ke[57]=p("div",{class:"ws-pick-divider"},null,-1)),p("button",{type:"button",class:"ws-pick-action",onClick:ke[10]||(ke[10]=Ze(Fe=>{i.value=!1,s("addWorkspace")},["stop"]))},[ke[56]||(ke[56]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("path",{d:"M8 3v10M3 8h10"})],-1)),p("span",null,O(S(g)("conversation.addWorkspace")),1)])])):ie("",!0)])):(C(),E("button",{key:1,type:"button",class:"empty-add-workspace",onClick:ke[11]||(ke[11]=Fe=>s("addWorkspace"))},[ke[58]||(ke[58]=p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("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"}),p("path",{d:"M1 5.5h12"}),p("path",{d:"M8 7.25v4.5M5.75 9.5h4.5"})],-1)),p("span",null,O(S(g)("conversation.addWorkspace")),1)]))]),vt(n3,{ref_key:"emptyComposerRef",ref:m,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:Xo,onSteer:ke[12]||(ke[12]=Fe=>s("steer",Fe)),onCommand:ke[13]||(ke[13]=Fe=>s("command",Fe)),onInterrupt:je,onUnqueue:ke[14]||(ke[14]=Fe=>s("unqueue",Fe)),onEditQueued:ke[15]||(ke[15]=Fe=>s("editQueued",Fe)),onSetPermission:ke[16]||(ke[16]=Fe=>s("setPermission",Fe)),onSetThinking:ke[17]||(ke[17]=Fe=>s("setThinking",Fe)),onTogglePlan:ke[18]||(ke[18]=Fe=>s("togglePlan")),onToggleSwarm:ke[19]||(ke[19]=Fe=>s("toggleSwarm")),onToggleGoal:ke[20]||(ke[20]=Fe=>s("toggleGoal")),onOpenBtw:ke[21]||(ke[21]=Fe=>s("command","/btw")),onCreateGoal:ke[22]||(ke[22]=Fe=>s("createGoal",Fe)),onControlGoal:ke[23]||(ke[23]=Fe=>s("controlGoal",Fe)),onFocusGoal:L,onFocusSwarm:N,onCompact:ke[24]||(ke[24]=Fe=>s("compact")),onPickModel:ke[25]||(ke[25]=Fe=>s("pickModel")),onSelectModel:ke[26]||(ke[26]=Fe=>s("selectModel",Fe))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),ke[60]||(ke[60]=p("div",{class:"empty-spacer"},null,-1))],64)):(C(),E(Pe,{key:1},[(C(),Ve(ZA,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,bubble:v.value,mobile:e.mobile,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":W.value,"tool-diff-panel":!0,onOpenFile:ke[27]||(ke[27]=Fe=>s("openFile",Fe)),onOpenMedia:ke[28]||(ke[28]=Fe=>s("openMedia",Fe)),onCopyConversationCopied:x,onOpenThinking:ke[29]||(ke[29]=Fe=>s("openThinking",Fe)),onOpenCompaction:ke[30]||(ke[30]=Fe=>s("openCompaction",Fe)),onOpenAgent:ke[31]||(ke[31]=Fe=>s("openAgent",Fe)),onOpenToolDiff:ke[32]||(ke[32]=Fe=>s("openToolDiff",Fe)),onEditMessage:ke[33]||(ke[33]=Fe=>s("editMessage",Fe)),onLoadOlderMessages:_t},null,8,["turns","approvals","bubble","mobile","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following"])),d.value.length>0?(C(),E("div",xQ,[(C(!0),E(Pe,null,Xe(d.value,Fe=>(C(),Ve(kG,{key:Fe.id,group:Fe},null,8,["group"]))),128))])):ie("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?ie("",!0):(C(),Ve(iQ,{key:0,ref:fe,style:Wt(q.value),"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":k.value,"dock-panel":D.value,"bash-tasks":M.value,"subagent-tasks":$.value,"bash-running":P.value,"subagent-running":T.value,"todo-done-count":I.value,"has-dock-work":R.value,todos:e.todos,"pending-question":ve.value,"pending-approval":Ne.value,mobile:e.mobile,onToggleDockPanel:ke[34]||(ke[34]=Fe=>z(Fe)),onCloseDockPanel:ke[35]||(ke[35]=Fe=>V()),onAnswer:Oo,onDismiss:ke[36]||(ke[36]=Fe=>s("dismiss",Fe)),onApproval:ho,onCancelTask:ke[37]||(ke[37]=Fe=>s("cancelTask",Fe)),onControlGoal:ke[38]||(ke[38]=Fe=>s("controlGoal",Fe)),onSubmit:Xo,onSteer:ke[39]||(ke[39]=Fe=>s("steer",Fe)),onCommand:ke[40]||(ke[40]=Fe=>s("command",Fe)),onInterrupt:je,onUnqueue:ke[41]||(ke[41]=Fe=>s("unqueue",Fe)),onEditQueued:ke[42]||(ke[42]=Fe=>s("editQueued",Fe)),onSetPermission:ke[43]||(ke[43]=Fe=>s("setPermission",Fe)),onSetThinking:ke[44]||(ke[44]=Fe=>s("setThinking",Fe)),onTogglePlan:ke[45]||(ke[45]=Fe=>s("togglePlan")),onToggleSwarm:ke[46]||(ke[46]=Fe=>s("toggleSwarm")),onToggleGoal:ke[47]||(ke[47]=Fe=>s("toggleGoal")),onOpenBtw:ke[48]||(ke[48]=Fe=>s("command","/btw")),onCreateGoal:ke[49]||(ke[49]=Fe=>s("createGoal",Fe)),onFocusGoal:L,onFocusSwarm:N,onCompact:ke[50]||(ke[50]=Fe=>s("compact")),onPickModel:ke[51]||(ke[51]=Fe=>s("pickModel")),onSelectModel:ke[52]||(ke[52]=Fe=>s("selectModel",Fe))},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"]))]),vt(Fi,{name:"pill"},{default:In(()=>[Y.value?(C(),E("button",{key:0,class:"newmsg-pill",style:Wt({bottom:`${Se.value+12}px`}),"aria-label":S(g)("conversation.jumpToLatestAria"),onClick:ke[53]||(ke[53]=Fe=>nt(!0))},[ke[61]||(ke[61]=p("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"},[p("polyline",{points:"4,6 8,10 12,6"})],-1)),ft(" "+O(S(g)("conversation.newMessages")),1)],12,TQ)):ie("",!0)]),_:1}),vt(Fi,{name:"abort-toast"},{default:In(()=>[Qo.value?(C(),E("div",AQ,[p("span",MQ,O(S(g)("conversation.manuallyAborted")),1)])):ie("",!0)]),_:1})],2))}}),OQ=bt(LQ,[["__scopeId","data-v-6f934ca2"]]),PQ={key:0,class:"fp-empty fp-error"},RQ={key:1,class:"fp-empty"},DQ={key:2,class:"fp-loading"},BQ={class:"fp-header"},FQ={class:"fp-title"},HQ=["title"],WQ={class:"fp-meta"},UQ={key:0,class:"fp-lines"},qQ={class:"fp-size"},jQ=["aria-label"],zQ=["aria-label"],VQ=["aria-label"],KQ={key:3,class:"fp-search"},GQ=["placeholder"],YQ={key:0,class:"fp-search-count"},XQ=["disabled","title"],QQ=["disabled","title"],ZQ=["title"],JQ={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"},eZ={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"},tZ=["title"],nZ=["title"],oZ=["href","title"],sZ=["title"],iZ={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"},rZ={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"},lZ=["title","aria-label"],aZ={key:1,class:"fp-code"},cZ={class:"fp-line-table"},uZ=["data-line"],dZ={class:"fp-gutter"},fZ=["innerHTML"],hZ={key:1,class:"fp-body fp-code"},pZ={class:"fp-line-table"},mZ=["data-line"],gZ={class:"fp-gutter"},vZ=["innerHTML"],yZ={key:2,class:"fp-body"},kZ=["srcdoc","title"],bZ={key:1,class:"fp-code"},wZ={class:"fp-line-table"},_Z=["data-line"],CZ={class:"fp-gutter"},SZ=["innerHTML"],xZ={key:3,class:"fp-body fp-pdf-wrap"},TZ=["src","title"],AZ={key:1,class:"fp-binary-card"},MZ={class:"fp-binary-label"},EZ={key:4,class:"fp-body fp-table-wrap"},IZ={class:"fp-table"},$Z=["data-line"],NZ={key:5,class:"fp-body fp-image-wrap"},LZ=["src","alt"],OZ={key:1,class:"fp-binary-card"},PZ={class:"fp-binary-label"},RZ={key:6,class:"fp-body fp-code"},DZ={class:"fp-line-table"},BZ=["data-line"],FZ={class:"fp-gutter"},HZ=["innerHTML"],WZ={key:7,class:"fp-body fp-binary-wrap"},UZ={class:"fp-binary-card"},qZ={class:"fp-binary-label"},jZ=Qe({__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}=xt();function o(ue,ve){const Ne=ve?ve.split("/").filter(Boolean):[];for(const Re of ue.split("/"))Re===""||Re==="."||(Re===".."?Ne.pop():Ne.push(Re));return Ne.join("/")}const s=Bt("resolveImage",async ue=>ue),i=H(()=>{const ue=c.file?.path??"",ve=ue.lastIndexOf("/");return ve>0?ue.slice(0,ve):""});function r(ue){if(/^(https?:|data:|blob:)/i.test(ue)||ue.startsWith("/"))return ue;const ve=i.value;return ve?o(ue,ve):ue}async function l(ue){const ve=r(ue);return s?s(ve):ve}yn("resolveImage",l);function a(ue){let ve=ue.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(ve)||ve.startsWith("/"))return ue;for(const Re of["#","?"]){const Q=ve.indexOf(Re);Q!==-1&&(ve=ve.slice(0,Q))}const Ne=i.value;return{...ue,path:o(ve,Ne)}}const c=e,u=t;function d(ue){c.openFile?.(a(ue))}const f=te(null),g=H(()=>{const ue=c.file;if(!ue)return"binary";const ve=ue.mime??"",Ne=ue.languageId??"",Re=ue.path.toLowerCase();return ve==="text/markdown"||Ne==="markdown"||Ne==="md"||Re.endsWith(".mdx")?"markdown":ve==="application/json"||Ne==="json"?"json":ve==="text/html"||Ne==="html"||Re.endsWith(".html")||Re.endsWith(".htm")?"html":ve==="application/pdf"||Re.endsWith(".pdf")?"pdf":ve==="text/csv"||Ne==="csv"||Re.endsWith(".csv")?"csv":ve.startsWith("image/")?"image":ue.isBinary?"binary":ve.startsWith("text/")||Ne!==""?"text":"binary"});function h(ue){const ve=atob(ue),Ne=Uint8Array.from(ve,Re=>Re.charCodeAt(0));return new TextDecoder().decode(Ne)}const m=H(()=>{const ue=c.file;if(!ue)return"";if(ue.encoding==="base64")try{return h(ue.content)}catch{return ue.content}return ue.content}),_=H(()=>{if(g.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),w=H(()=>c.file?(g.value==="json"?_.value:m.value).split(`
|
|
263
|
-
`):[]),k=H(()=>c.file?g.value==="json"?_.value:m.value:""),b=te(""),y=te(0),x=H(()=>{const ue=b.value.trim().toLowerCase();if(!ue)return[];const ve=[];return w.value.forEach((Ne,Re)=>{Ne.toLowerCase().includes(ue)&&ve.push(Re+1)}),ve});ze(b,()=>{y.value=0});function L(ue,ve=!1){ue&&ht(()=>{const Ne=f.value?.querySelector(".fp-body"),Re=Ne?.querySelector(`[data-line="${ue}"]`);if(!Ne||!Re)return;ve&&(Ne.scrollTop=0);const Q=Ne.getBoundingClientRect(),ce=Re.getBoundingClientRect(),Se=ce.top-Q.top+Ne.scrollTop;Ne.scrollTop=Se-Ne.clientHeight/2+ce.height/2})}ze(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function N(ue){const ve=x.value;ve.length!==0&&(y.value=(y.value+ue+ve.length)%ve.length,L(ve[y.value]))}function v(ue){const ve=x.value;return{target:c.line===ue,hit:ve.includes(ue),active:ve[y.value]===ue}}function M(ue){return ue<1024?`${ue} B`:ue<1024*1024?`${(ue/1024).toFixed(1)} KB`:`${(ue/(1024*1024)).toFixed(1)} MB`}const $=te(!1),P=te(!1);function T(){c.file&&wo(k.value).then(ue=>{ue&&($.value=!0,setTimeout(()=>{$.value=!1},1400))})}function I(){c.file&&wo(c.file.path).then(ue=>{ue&&(P.value=!0,setTimeout(()=>{P.value=!1},1400))})}const R=te("preview"),D=te("preview"),F=te("fit");ze(g,ue=>{R.value=ue==="html"?"preview":"source",D.value="preview",F.value="fit"});const z=H(()=>{const ue=c.file;return!ue||g.value!=="image"?null:ue.sourceUrl?ue.sourceUrl:ue.encoding==="base64"?`data:${ue.mime};base64,${ue.content}`:ue.mime==="image/svg+xml"?`data:${ue.mime};charset=utf-8,${encodeURIComponent(ue.content)}`:null}),V=H(()=>{const ue=c.file;return!ue||g.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ue.encoding==="base64"?`data:${ue.mime};base64,${ue.content}`:null}),ne=H(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,m.value].join(""):"");function K(ue){const ve=[];let Ne="",Re=!1;for(let Q=0;Q<ue.length;Q++){const ce=ue[Q];ce==='"'&&ue[Q+1]==='"'?(Ne+='"',Q++):ce==='"'?Re=!Re:ce===","&&!Re?(ve.push(Ne),Ne=""):Ne+=ce}return ve.push(Ne),ve}const G=H(()=>w.value.slice(0,200).map(K));function X(ue){return ue.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function be(){const ue=c.file;if(!ue)return"";const ve=ue.languageId?.toLowerCase();return ve||(ue.path.split(".").pop()?.toLowerCase()??"")}function le(ue){const ve=be();let Ne=X(ue);return g.value==="json"||ve==="json"||ve==="jsonc"?(Ne=Ne.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),Ne=Ne.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),Ne=Ne.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),Ne=Ne.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),Ne):g.value==="html"||ve==="html"||ve==="xml"||ve==="svg"?(Ne=Ne.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),Ne=Ne.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),Ne=Ne.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),Ne):(Ne=Ne.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>'),Ne=Ne.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),Ne=Ne.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),Ne)}function We(ue,ve=55){return!ue||ue.length<=ve?ue:"…"+ue.slice(ue.length-ve+1)}return(ue,ve)=>(C(),E("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(C(),E("div",PQ,[p("span",null,O(e.error),1),e.closable?(C(),E("button",{key:0,type:"button",class:"fp-action",onClick:ve[0]||(ve[0]=Ne=>u("close"))},O(S(n)("filePreview.close")),1)):ie("",!0)])):!e.file&&!e.loading?(C(),E("div",RQ,O(S(n)("filePreview.empty")),1)):e.loading?(C(),E("div",DQ,[ve[13]||(ve[13]=p("span",{class:"spinner"},null,-1)),p("span",null,O(S(n)("filePreview.loading")),1)])):e.file?(C(),E(Pe,{key:3},[p("div",BQ,[p("span",FQ,O(S(n)("common.preview")),1),p("span",{class:"fp-path",title:e.file.path},O(We(e.file.path)),9,HQ),p("span",WQ,[e.file.lineCount?(C(),E("span",UQ,O(S(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ie("",!0),p("span",qQ,O(M(e.file.size)),1)]),g.value==="html"?(C(),E("div",{key:0,class:"fp-seg",role:"group","aria-label":S(n)("filePreview.htmlMode")},[p("button",{type:"button",class:Oe(["fp-seg-btn",{on:R.value==="preview"}]),onClick:ve[1]||(ve[1]=Ne=>R.value="preview")},O(S(n)("filePreview.preview")),3),p("button",{type:"button",class:Oe(["fp-seg-btn",{on:R.value==="source"}]),onClick:ve[2]||(ve[2]=Ne=>R.value="source")},O(S(n)("filePreview.source")),3)],8,jQ)):ie("",!0),g.value==="markdown"?(C(),E("div",{key:1,class:"fp-seg",role:"group","aria-label":S(n)("filePreview.markdownMode")},[p("button",{type:"button",class:Oe(["fp-seg-btn",{on:D.value==="preview"}]),onClick:ve[3]||(ve[3]=Ne=>D.value="preview")},O(S(n)("filePreview.preview")),3),p("button",{type:"button",class:Oe(["fp-seg-btn",{on:D.value==="source"}]),onClick:ve[4]||(ve[4]=Ne=>D.value="source")},O(S(n)("filePreview.source")),3)],8,zQ)):ie("",!0),g.value==="image"?(C(),E("div",{key:2,class:"fp-seg",role:"group","aria-label":S(n)("filePreview.imageFit")},[p("button",{type:"button",class:Oe(["fp-seg-btn",{on:F.value==="fit"}]),onClick:ve[5]||(ve[5]=Ne=>F.value="fit")},O(S(n)("filePreview.fit")),3),p("button",{type:"button",class:Oe(["fp-seg-btn",{on:F.value==="actual"}]),onClick:ve[6]||(ve[6]=Ne=>F.value="actual")},O(S(n)("filePreview.actual")),3)],8,VQ)):ie("",!0),g.value==="text"||g.value==="json"||g.value==="html"||g.value==="csv"?(C(),E("div",KQ,[jt(p("input",{"onUpdate:modelValue":ve[7]||(ve[7]=Ne=>b.value=Ne),class:"fp-search-input",type:"search",placeholder:S(n)("filePreview.search")},null,8,GQ),[[Wn,b.value]]),b.value.trim()?(C(),E("span",YQ,O(x.value.length),1)):ie("",!0),p("button",{type:"button",class:"fp-icon-btn",disabled:x.value.length===0,title:S(n)("filePreview.prevMatch"),onClick:ve[8]||(ve[8]=Ne=>N(-1))},"↑",8,XQ),p("button",{type:"button",class:"fp-icon-btn",disabled:x.value.length===0,title:S(n)("filePreview.nextMatch"),onClick:ve[9]||(ve[9]=Ne=>N(1))},"↓",8,QQ)])):ie("",!0),p("button",{type:"button",class:Oe(["fp-action fp-act-icon",{copied:P.value}]),title:P.value?S(n)("filePreview.copied"):S(n)("filePreview.copyPath"),onClick:I},[P.value?(C(),E("svg",eZ,[...ve[15]||(ve[15]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),E("svg",JQ,[...ve[14]||(ve[14]=[p("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),p("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,ZQ),e.externalActions?(C(),E("button",{key:4,type:"button",class:"fp-action fp-act-icon",title:S(n)("filePreview.openInEditor"),onClick:ve[10]||(ve[10]=Ne=>u("openExternal"))},[...ve[16]||(ve[16]=[p("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"},[p("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"}),p("path",{d:"M9.5 2.5h4v4"}),p("path",{d:"M13.5 2.5 7.5 8.5"})],-1)])],8,tZ)):ie("",!0),e.externalActions?(C(),E("button",{key:5,type:"button",class:"fp-action fp-act-icon",title:S(n)("filePreview.reveal"),onClick:ve[11]||(ve[11]=Ne=>u("reveal"))},[...ve[17]||(ve[17]=[p("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"},[p("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,nZ)):ie("",!0),e.downloadUrl?(C(),E("a",{key:6,class:"fp-action fp-act-icon",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"",title:S(n)("filePreview.download")},[...ve[18]||(ve[18]=[p("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"},[p("path",{d:"M8 2v8"}),p("path",{d:"M4.5 6.5 8 10l3.5-3.5"}),p("path",{d:"M2.5 13.5h11"})],-1)])],8,oZ)):ie("",!0),!e.file.isBinary&&g.value!=="image"?(C(),E("button",{key:7,type:"button",class:Oe(["fp-action fp-act-icon",{copied:$.value}]),title:$.value?S(n)("filePreview.copied"):S(n)("filePreview.copy"),onClick:T},[$.value?(C(),E("svg",rZ,[...ve[20]||(ve[20]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),E("svg",iZ,[...ve[19]||(ve[19]=[p("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),p("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])]))],10,sZ)):ie("",!0),e.closable?(C(),E("button",{key:8,type:"button",class:"fp-close",title:S(n)("filePreview.close"),"aria-label":S(n)("filePreview.close"),onClick:ve[12]||(ve[12]=Ne=>u("close"))}," × ",8,lZ)):ie("",!0)]),g.value==="markdown"?(C(),E("div",{key:0,class:Oe(["fp-body",{"fp-markdown":D.value==="preview"}])},[D.value==="preview"?(C(),Ve(lu,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(C(),E("div",aZ,[p("div",cZ,[(C(!0),E(Pe,null,Xe(w.value,(Ne,Re)=>(C(),E("div",{key:Re,class:Oe(["fp-line-row",v(Re+1)]),"data-line":Re+1},[p("span",dZ,O(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Ne)},null,8,fZ)],10,uZ))),128))])]))],2)):g.value==="json"?(C(),E("div",hZ,[p("div",pZ,[(C(!0),E(Pe,null,Xe(w.value,(Ne,Re)=>(C(),E("div",{key:Re,class:Oe(["fp-line-row",v(Re+1)]),"data-line":Re+1},[p("span",gZ,O(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Ne)},null,8,vZ)],10,mZ))),128))])])):g.value==="html"?(C(),E("div",yZ,[R.value==="preview"?(C(),E("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ne.value,title:e.file.path},null,8,kZ)):(C(),E("div",bZ,[p("div",wZ,[(C(!0),E(Pe,null,Xe(w.value,(Ne,Re)=>(C(),E("div",{key:Re,class:Oe(["fp-line-row",v(Re+1)]),"data-line":Re+1},[p("span",CZ,O(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Ne)},null,8,SZ)],10,_Z))),128))])]))])):g.value==="pdf"?(C(),E("div",xZ,[V.value?(C(),E("iframe",{key:0,class:"fp-pdf-frame",src:V.value,title:e.file.path},null,8,TZ)):(C(),E("div",AZ,[p("span",MZ,O(S(n)("filePreview.pdfNoPreview")),1)]))])):g.value==="csv"?(C(),E("div",EZ,[p("table",IZ,[p("tbody",null,[(C(!0),E(Pe,null,Xe(G.value,(Ne,Re)=>(C(),E("tr",{key:Re,class:Oe(v(Re+1)),"data-line":Re+1},[p("th",null,O(Re+1),1),(C(!0),E(Pe,null,Xe(Ne,(Q,ce)=>(C(),E("td",{key:ce},O(Q),1))),128))],10,$Z))),128))])])])):g.value==="image"?(C(),E("div",NZ,[z.value?(C(),E("img",{key:0,src:z.value,alt:e.file.path,class:Oe(["fp-image",{actual:F.value==="actual"}])},null,10,LZ)):(C(),E("div",OZ,[ve[21]||(ve[21]=p("span",{class:"fp-binary-icon"},[p("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[p("rect",{x:"2",y:"2",width:"16",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),p("path",{d:"M7 10h6M10 7v6",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),p("span",PZ,O(S(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):g.value==="text"?(C(),E("div",RZ,[p("div",DZ,[(C(!0),E(Pe,null,Xe(w.value,(Ne,Re)=>(C(),E("div",{key:Re,class:Oe(["fp-line-row",v(Re+1)]),"data-line":Re+1},[p("span",FZ,O(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Ne)},null,8,HZ)],10,BZ))),128))])])):(C(),E("div",WZ,[p("div",UZ,[ve[22]||(ve[22]=p("span",{class:"fp-binary-icon"},[p("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[p("path",{d:"M5 3h7l4 4v10H5V3z",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),p("path",{d:"M12 3v4h4",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),p("span",qZ,O(S(n)("filePreview.binaryNoPreview",{mime:e.file.mime||S(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):ie("",!0)],512))}}),zZ=bt(jZ,[["__scopeId","data-v-93380983"]]),VZ={class:"tp"},KZ={class:"tp-header"},GZ={class:"tp-title"},YZ={class:"tp-sub"},XZ=["title","aria-label"],QZ=Qe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),i=te(null);return ze(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||ht(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(C(),E("div",VZ,[p("div",KZ,[p("span",GZ,O(S(s)("common.preview")),1),p("span",YZ,O(e.subtitle??S(s)("thinking.panelTitle")),1),p("button",{type:"button",class:"tp-close",title:S(s)("thinking.close"),"aria-label":S(s)("thinking.close"),onClick:l[0]||(l[0]=a=>o("close"))},[...l[1]||(l[1]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,XZ)]),p("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),S2=bt(QZ,[["__scopeId","data-v-2f5e8c0f"]]),ZZ={class:"ap"},JZ={class:"ap-header"},eJ={class:"ap-title"},tJ={class:"ap-sub"},nJ=["title","aria-label"],oJ={key:0,class:"ap-type"},sJ={key:1,class:"ap-reason"},iJ={key:2,class:"ap-field"},rJ={class:"ap-field-body"},lJ={key:3,class:"ap-field"},aJ={class:"ap-field-body ap-progress"},cJ={key:0,class:"ap-call"},uJ={key:1,class:"ap-output"},dJ=["onClick"],fJ={key:4,class:"ap-field"},hJ={class:"ap-field-body"},pJ=8,x2=5,T2=2,mJ=Qe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),i=H(()=>(n.member.outputLines??[]).map(h=>h.trimEnd()).filter(h=>h.length>0));function r(h){const m=[];let _=null,w=0;for(const k of h)k.startsWith("Calling ")?(_={key:`g${w++}`,call:k,output:[]},m.push(_)):_?_.output.push(k):(_={key:`g${w++}`,call:"",output:[k]},m.push(_));return m}const l=H(()=>r(i.value)),a=te(new Set);function c(h){return a.value.has(h)}function u(h){const m=new Set(a.value);m.has(h)?m.delete(h):m.add(h),a.value=m}function d(h){return h.output.length-x2-T2}function f(h){switch(h){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const g=te(null);return ze(()=>i.value.length,()=>{const h=g.value;!h||!(h.scrollHeight-h.scrollTop-h.clientHeight<24)||ht(()=>{g.value&&(g.value.scrollTop=g.value.scrollHeight)})},{immediate:!0}),(h,m)=>(C(),E("div",ZZ,[p("div",JZ,[p("span",eJ,O(S(s)("common.preview")),1),p("span",tJ,O(e.member.name),1),p("span",{class:Oe(["ap-phase",`phase-${e.member.phase}`])},O(f(e.member.phase)),3),p("button",{type:"button",class:"ap-close",title:S(s)("thinking.close"),"aria-label":S(s)("thinking.close"),onClick:m[0]||(m[0]=_=>o("close"))},[...m[1]||(m[1]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,nJ)]),p("div",{ref_key:"bodyEl",ref:g,class:"ap-body"},[e.member.subagentType?(C(),E("div",oJ,O(e.member.subagentType),1)):ie("",!0),e.member.suspendedReason?(C(),E("div",sJ,O(e.member.suspendedReason),1)):ie("",!0),e.member.prompt?(C(),E("div",iJ,[m[2]||(m[2]=p("span",{class:"ap-field-label"},"Task",-1)),p("div",rJ,O(e.member.prompt),1)])):ie("",!0),l.value.length>0?(C(),E("div",lJ,[m[4]||(m[4]=p("span",{class:"ap-field-label"},"Progress",-1)),p("div",aJ,[(C(!0),E(Pe,null,Xe(l.value,_=>(C(),E("div",{key:_.key,class:"ap-group"},[_.call?(C(),E("div",cJ,[m[3]||(m[3]=p("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),ft(" "+O(_.call),1)])):ie("",!0),_.output.length>0?(C(),E("div",uJ,[_.output.length<=pJ||c(_.key)?(C(!0),E(Pe,{key:0},Xe(_.output,(w,k)=>(C(),E("div",{key:k,class:"ap-out-line"},O(w),1))),128)):(C(),E(Pe,{key:1},[(C(!0),E(Pe,null,Xe(_.output.slice(0,x2),(w,k)=>(C(),E("div",{key:k,class:"ap-out-line"},O(w),1))),128)),p("button",{type:"button",class:"ap-fold",onClick:w=>u(_.key)}," … ("+O(d(_))+" more) ",9,dJ),(C(!0),E(Pe,null,Xe(_.output.slice(-T2),(w,k)=>(C(),E("div",{key:"t"+k,class:"ap-out-line"},O(w),1))),128))],64))])):ie("",!0)]))),128))])])):ie("",!0),e.member.summary?(C(),E("div",fJ,[m[5]||(m[5]=p("span",{class:"ap-field-label"},"Result",-1)),p("div",hJ,O(e.member.summary),1)])):ie("",!0)],512)]))}}),gJ=bt(mJ,[["__scopeId","data-v-66bf53d2"]]),vJ={class:"diff-lines"},yJ={key:0,class:"hunk-text"},kJ={class:"dl-gutter old"},bJ={class:"dl-gutter new"},wJ={class:"dl-sign"},_J={class:"dl-text"},CJ=Qe({__name:"DiffLines",props:{lines:{}},setup(e){function t(s){return s.oldNo!==void 0?String(s.oldNo):""}function n(s){return s.newNo!==void 0?String(s.newNo):""}function o(s){return`dl-${s.type}`}return(s,i)=>(C(),E("div",vJ,[(C(!0),E(Pe,null,Xe(e.lines,(r,l)=>(C(),E("div",{key:l,class:Oe(["dl",o(r)])},[r.type==="hunk"?(C(),E("span",yJ,O(r.text),1)):(C(),E(Pe,{key:1},[p("span",kJ,O(t(r)),1),p("span",bJ,O(n(r)),1),p("span",wJ,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),p("span",_J,O(r.text),1)],64))],2))),128))]))}}),o3=bt(CJ,[["__scopeId","data-v-b73eaacc"]]),SJ={class:"tdp"},xJ={class:"tdp-header"},TJ={class:"tdp-title"},AJ=["title"],MJ=["title","aria-label"],EJ={class:"tdp-body"},IJ={key:1,class:"tdp-output"},$J={key:2,class:"tdp-empty"},NJ=Qe({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=xt();return(s,i)=>(C(),E("div",SJ,[p("div",xJ,[p("span",TJ,O(e.target.title),1),e.target.path?(C(),E("span",{key:0,class:"tdp-sub",title:e.target.path},O(e.target.path),9,AJ)):ie("",!0),p("button",{type:"button",class:"tdp-close",title:S(o)("thinking.close"),"aria-label":S(o)("thinking.close"),onClick:i[0]||(i[0]=r=>n("close"))},[...i[1]||(i[1]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,MJ)]),p("div",EJ,[e.target.lines&&e.target.lines.length>0?(C(),Ve(o3,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(C(),E("div",IJ,[(C(!0),E(Pe,null,Xe(e.target.output,(r,l)=>(C(),E("div",{key:l},O(r),1))),128))])):(C(),E("div",$J,O(S(o)("diff.noDiff")),1))])]))}}),LJ=bt(NJ,[["__scopeId","data-v-9d022f5b"]]),OJ={class:"sc"},PJ={class:"sc-header"},RJ={class:"sc-title"},DJ=["title"],BJ=["title","aria-label"],FJ={key:0,class:"sc-empty"},HJ={key:2,class:"sc-loading","aria-hidden":"true"},WJ={class:"sc-composer"},UJ=["placeholder"],qJ=["disabled","title"],jJ=Qe({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),i=H(()=>n.turns.find(k=>k.role==="user")?.text?.trim()??""),r=H(()=>n.title?.trim()||s("sideChat.title")),l=H(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=te(""),c=te(null),u=te(null);function d(){const w=a.value.trim();w&&(o("send",w),a.value="",ht(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const w=u.value;w&&(w.scrollTop=w.scrollHeight)}const g=H(()=>{const w=n.turns;if(w.length===0)return"0";const k=w.at(-1),b=k.thinking?.length??0,y=k.tools?.reduce((x,L)=>x+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${w.length}:${k.text.length}:${b}:${y}`});ze(g,async()=>{!n.running&&!n.sending||(await ht(),f())});const h=H(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(w){w.key==="Enter"&&!w.shiftKey&&!w.isComposing&&(w.preventDefault(),d())}function _(){const w=c.value;w&&(w.style.height="auto",w.style.height=`${Math.min(w.scrollHeight,160)}px`)}return(w,k)=>(C(),E("div",OJ,[p("div",PJ,[p("span",RJ,O(r.value),1),p("span",{class:"sc-subtitle",title:l.value},O(l.value),9,DJ),p("button",{type:"button",class:"sc-close",title:S(s)("thinking.close"),"aria-label":S(s)("thinking.close"),onClick:k[0]||(k[0]=b=>o("close"))},[...k[2]||(k[2]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,BJ)]),p("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(C(),E("div",FJ,O(S(s)("sideChat.empty")),1)):(C(),Ve(ZA,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending,bubble:""},null,8,["turns","running","sending"])),h.value?(C(),E("div",HJ,[vt(L1)])):ie("",!0)],512),p("div",WJ,[jt(p("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":k[1]||(k[1]=b=>a.value=b),class:"sc-input",rows:"1",placeholder:S(s)("sideChat.placeholder"),onInput:_,onKeydown:m},null,40,UJ),[[Wn,a.value]]),p("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),title:S(s)("sideChat.send"),onClick:d},[...k[3]||(k[3]=[p("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"},[p("path",{d:"M2 8h10"}),p("path",{d:"M8 4l4 4-4 4"})],-1)])],8,qJ)])]))}}),zJ=bt(jJ,[["__scopeId","data-v-5d7c220f"]]),VJ={class:"changes-pane"},KJ={class:"dv-panel-head"},GJ={class:"dv-title"},YJ=["title"],XJ=["title","aria-label"],QJ={class:"diff-head"},ZJ=["title"],JJ={class:"back-label"},eee={key:0,class:"empty-state"},tee={key:1,class:"dv-lines-wrap"},nee={key:2,class:"empty-state"},oee={class:"dv-panel-head"},see={class:"dv-title"},iee={class:"dv-change-count"},ree=["aria-label"],lee=["aria-pressed"],aee=["aria-pressed"],cee=["title","aria-label"],uee={class:"ch-head"},dee={class:"br-label"},fee={class:"br-name"},hee={key:0,class:"sync-info"},pee=["title"],mee=["title"],gee={key:1,class:"empty-head"},vee={key:0,class:"ch-list"},yee=["title","onClick"],kee={class:"fpath"},bee={key:1,class:"ch-list ch-tree"},wee={class:"tree-list"},_ee=["onClick"],Cee={class:"tree-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},See=["d"],xee={class:"tree-name"},Tee=["title","onClick"],Aee={class:"tree-name"},Mee={key:2,class:"empty-state"},Eee={key:3,class:"empty-state"},Iee=Qe({__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}=xt(),o=e,s=t;function i(T){const I=T.toLowerCase();return I==="modified"?"modified":I==="added"?"added":I==="deleted"?"deleted":I==="renamed"?"renamed":I==="untracked"?"untracked":I==="conflicted"?"conflicted":I==="ignored"?"ignored":I==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(T){return r[i(T)]??"?"}function a(T,I=60){return T.length<=I?T:"…"+T.slice(T.length-I+1)}const c=H(()=>o.gitInfo!==null),u=H(()=>o.changes.length>0),d=H(()=>(o.selectedDiffPath??null)!==null),f=H(()=>o.mode==="detail"||o.mode==="full"&&d.value),g=H(()=>o.fileDiff??[]),h=H(()=>o.fileDiffLoading===!0);function m(T){s("open",T)}function _(){s("back")}function w(){s("close")}const k=te("list");function b(T){k.value=T}function y(T){const I={children:[]},R=[...T].sort((D,F)=>D.path.localeCompare(F.path));for(const D of R){const F=D.path.split("/");let z=I;for(let V=0;V<F.length;V++){const ne=F[V],K=V===F.length-1,G=F.slice(0,V+1).join("/");let X=z.children.find(be=>be.name===ne&&be.kind===(K?"file":"folder"));X||(X={name:ne,path:G,kind:K?"file":"folder",status:K?D.status:void 0,children:[]},z.children.push(X)),z=X}}return I.children}const x=H(()=>y(o.changes)),L=te(new Set);function N(T){return!L.value.has(T)}const v=H(()=>{const T=[];function I(R,D){for(const F of R)T.push({node:F,depth:D}),F.kind==="folder"&&N(F.path)&&I(F.children,D+1)}return I(x.value,0),T});function M(T){const I=new Set(L.value);I.has(T.path)?I.delete(T.path):I.add(T.path),L.value=I}const $=T=>"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(T){return`${16+T*16}px`}return(T,I)=>(C(),E("div",VJ,[f.value?(C(),E(Pe,{key:0},[p("div",KJ,[p("span",GJ,O(S(n)("diff.title")),1),p("span",{class:"dv-path",title:e.selectedDiffPath??""},O(a(e.selectedDiffPath??"",50)),9,YJ),e.closable?(C(),E("button",{key:0,type:"button",class:"dv-close",title:S(n)("diff.close"),"aria-label":S(n)("diff.close"),onClick:w},[...I[2]||(I[2]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,XJ)):ie("",!0)]),p("div",QJ,[e.hideBack?ie("",!0):(C(),E("button",{key:0,class:"back-btn",type:"button",onClick:_,title:S(n)("diff.back")},[I[3]||(I[3]=p("span",{"aria-hidden":"true"},"←",-1)),p("span",JJ,O(S(n)("diff.back")),1)],8,ZJ))]),h.value?(C(),E("div",eee,O(S(n)("diff.loading")),1)):g.value.length>0?(C(),E("div",tee,[vt(o3,{lines:g.value},null,8,["lines"])])):(C(),E("div",nee,O(S(n)("diff.noDiff")),1))],64)):(C(),E(Pe,{key:1},[p("div",oee,[p("span",see,O(S(n)("diff.title")),1),p("span",iee,O(S(n)("diff.changeCount",{count:e.changes.length})),1),p("div",{class:"dv-toggle",role:"group","aria-label":S(n)("diff.list")+" / "+S(n)("diff.tree")},[p("button",{type:"button",class:Oe(["dv-toggle-btn",{active:k.value==="list"}]),"aria-pressed":k.value==="list",onClick:I[0]||(I[0]=R=>b("list"))},O(S(n)("diff.list")),11,lee),p("button",{type:"button",class:Oe(["dv-toggle-btn",{active:k.value==="tree"}]),"aria-pressed":k.value==="tree",onClick:I[1]||(I[1]=R=>b("tree"))},O(S(n)("diff.tree")),11,aee)],8,ree),e.closable?(C(),E("button",{key:0,type:"button",class:"dv-close",title:S(n)("diff.close"),"aria-label":S(n)("diff.close"),onClick:w},[...I[4]||(I[4]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,cee)):ie("",!0)]),p("div",uee,[c.value?(C(),E(Pe,{key:0},[p("span",dee,O(S(n)("diff.branch")),1),p("span",fee,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(C(),E("span",hee,[e.gitInfo.ahead>0?(C(),E("span",{key:0,class:"ahead",title:S(n)("diff.aheadTitle")},"↑"+O(e.gitInfo.ahead),9,pee)):ie("",!0),e.gitInfo.behind>0?(C(),E("span",{key:1,class:"behind",title:S(n)("diff.behindTitle")},"↓"+O(e.gitInfo.behind),9,mee)):ie("",!0)])):ie("",!0)],64)):(C(),E("span",gee,O(S(n)("diff.empty")),1))]),u.value&&k.value==="list"?(C(),E("div",vee,[(C(!0),E(Pe,null,Xe(e.changes,R=>(C(),E("button",{key:R.path,type:"button",class:"ch-row",title:R.path,onClick:D=>m(R.path)},[p("span",{class:Oe(["badge",i(R.status)])},O(l(R.status)),3),p("span",kee,O(a(R.path)),1)],8,yee))),128))])):u.value&&k.value==="tree"?(C(),E("div",bee,[p("ul",wee,[(C(!0),E(Pe,null,Xe(v.value,({node:R,depth:D})=>(C(),E("li",{key:R.path,class:"tree-node"},[R.kind==="folder"?(C(),E("button",{key:0,type:"button",class:"tree-row tree-folder",style:Wt({paddingLeft:P(D)}),onClick:F=>M(R)},[(C(),E("svg",Cee,[p("path",{d:$(N(R.path))},null,8,See)])),p("span",xee,O(R.name),1)],12,_ee)):(C(),E("button",{key:1,type:"button",class:"tree-row tree-file",style:Wt({paddingLeft:P(D)}),title:R.path,onClick:F=>m(R.path)},[p("span",{class:Oe(["badge",i(R.status)])},O(l(R.status)),3),p("span",Aee,O(R.name),1)],12,Tee))]))),128))])])):c.value?(C(),E("div",Mee,O(S(n)("diff.clean")),1)):(C(),E("div",Eee,O(S(n)("diff.empty")),1))],64))]))}}),$ee=bt(Iee,[["__scopeId","data-v-bb3f7593"]]);function Kh(e,t){let n=null;rn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,ht(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),Yo(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const Nee=["aria-label"],Lee={class:"dh"},Oee={class:"dtitle"},Pee=["title"],Ree={class:"search-wrap"},Dee=["placeholder"],Bee=["aria-label"],Fee=["aria-selected","onClick"],Hee={key:1,class:"loading-state"},Wee={key:2,class:"unavail-state"},Uee={key:3,class:"model-list"},qee=["aria-selected","onClick","onMouseenter"],jee={class:"check"},zee={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"},Vee={class:"model-main"},Kee={class:"model-name"},Gee={class:"model-id"},Yee={class:"model-provider"},Xee={class:"model-ctx"},Qee={key:0,class:"caps"},Zee=["title","onClick"],Jee={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},ete=["fill"],tte={key:0,class:"empty"},nte={class:"footer-hint"},ote=Qe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=xt(),o=e,s=t,i=H(()=>new Set(o.starredIds??[]));function r(b){return i.value.has(b)}const l=te(""),a=te(null),c=te(null),u=te("all");Kh(c,a);const d=H(()=>{const b=new Set,y=[{id:"all",label:n("model.allTab")}];for(const x of o.models)b.has(x.provider)||(b.add(x.provider),y.push({id:x.provider,label:x.provider}));return y}),f=H(()=>{const b=l.value.toLowerCase().trim(),y=o.models.filter(x=>{if(u.value!=="all"&&x.provider!==u.value)return!1;const L=(x.displayName??x.model).toLowerCase().includes(b),N=x.provider.toLowerCase().includes(b),v=x.id.toLowerCase().includes(b);return!b||L||N||v});return u.value!=="all"?y:y.sort((x,L)=>{const N=r(x.id)?1:0;return(r(L.id)?1:0)-N})}),g=H(()=>f.value),h=te(0);ze([l,u],()=>{h.value=0}),ze(d,b=>{b.some(y=>y.id===u.value)||(u.value="all")}),ze(g,b=>{h.value=Math.min(h.value,Math.max(b.length-1,0))});function m(b){if(b.key==="Escape"){s("close");return}if(b.key==="ArrowDown")b.preventDefault(),h.value=Math.min(h.value+1,g.value.length-1);else if(b.key==="ArrowUp")b.preventDefault(),h.value=Math.max(h.value-1,0);else if(b.key==="Enter"){const y=g.value[h.value];y&&s("select",y.id)}}rn(()=>{document.addEventListener("keydown",m)}),Yt(()=>{document.removeEventListener("keydown",m)});function _(b){s("select",b)}function w(b){return g.value.indexOf(b)}function k(b){u.value=b}return(b,y)=>(C(),E("div",{class:"backdrop",onClick:y[3]||(y[3]=Ze(x=>s("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":S(n)("model.dialogLabel")},[p("div",Lee,[p("span",Oee,O(S(n)("model.title")),1),p("button",{class:"close-btn",title:S(n)("model.close"),onClick:y[0]||(y[0]=x=>s("close"))},"✕",8,Pee)]),p("div",Ree,[jt(p("input",{ref_key:"searchRef",ref:a,"onUpdate:modelValue":y[1]||(y[1]=x=>l.value=x),class:"search-input",type:"text",placeholder:S(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Dee),[[Wn,l.value]])]),d.value.length>1?(C(),E("div",{key:0,class:"tab-strip",role:"tablist","aria-label":S(n)("model.providerTabs")},[(C(!0),E(Pe,null,Xe(d.value,x=>(C(),E("button",{key:x.id,type:"button",class:Oe(["tab-btn",{on:x.id===u.value}]),role:"tab","aria-selected":x.id===u.value,onClick:L=>k(x.id)},O(x.label),11,Fee))),128))],8,Bee)):ie("",!0),e.loading?(C(),E("div",Hee,[y[4]||(y[4]=p("svg",{class:"spin-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"8",cy:"8",r:"6","stroke-dasharray":"24 12","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"1s",repeatCount:"indefinite"})])],-1)),p("span",null,O(S(n)("model.loading")),1)])):e.unavailable?(C(),E("div",Wee,[y[5]||(y[5]=p("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[p("path",{d:"M10 2 L19 18 H1 Z"}),p("line",{x1:"10",y1:"9",x2:"10",y2:"13"}),p("circle",{cx:"10",cy:"16",r:"0.8",fill:"var(--warn)"})],-1)),p("span",null,O(S(n)("model.unavailable")),1)])):(C(),E("div",Uee,[(C(!0),E(Pe,null,Xe(g.value,x=>(C(),E("div",{key:x.id,class:Oe(["model-row",{"is-current":x.id===e.current,"is-selected":w(x)===h.value}]),role:"option","aria-selected":x.id===e.current,onClick:L=>_(x.id),onMouseenter:L=>h.value=w(x)},[p("span",jee,[x.id===e.current?(C(),E("svg",zee,[...y[6]||(y[6]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),p("span",Vee,[p("span",Kee,O(x.displayName??x.model),1),p("span",Gee,O(x.id),1)]),p("span",Yee,O(x.provider),1),p("span",Xee,O(S(n)("model.contextSuffix",{size:Math.round(x.maxContextSize/1e3)})),1),x.capabilities&&x.capabilities.length>0?(C(),E("span",Qee,O(x.capabilities.join(", ")),1)):ie("",!0),p("button",{type:"button",class:Oe(["star-btn",{starred:r(x.id)}]),title:r(x.id)?S(n)("model.unstarTitle"):S(n)("model.starTitle"),onClick:Ze(L=>s("toggle-star",x.id),["stop"]),onMouseenter:y[2]||(y[2]=Ze(()=>{},["stop"]))},[(C(),E("svg",Jee,[p("path",{fill:r(x.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,ete)]))],42,Zee)],42,qee))),128)),g.value.length===0&&!e.loading&&!e.unavailable?(C(),E("div",tte,O(o.models.length===0?S(n)("model.emptyNoModels"):S(n)("model.emptyNoMatch")),1)):ie("",!0)])),p("div",nte,O(S(n)("model.footerHint")),1)],8,Nee)]))}}),ste=bt(ote,[["__scopeId","data-v-34f036d8"]]),ite=["aria-label"],rte={class:"dh"},lte={class:"dtitle"},ate=["title"],cte={class:"prov-list"},ute={key:0,class:"state-row"},dte={key:1,class:"state-row unavail"},fte={key:2,class:"empty"},hte=["title"],pte={key:0,width:"8",height:"8",viewBox:"0 0 8 8"},mte=["fill"],gte={key:1,width:"8",height:"8",viewBox:"0 0 8 8"},vte=["fill"],yte={key:2,width:"8",height:"8",viewBox:"0 0 8 8"},kte={class:"prov-info"},bte={class:"prov-type"},wte={key:0,class:"prov-url"},_te={class:"prov-meta"},Cte={key:0},Ste={key:0,class:"confirm-row"},xte={class:"confirm-text"},Tte={key:1,class:"prov-actions"},Ate=["title","onClick"],Mte=["title","onClick"],Ete={key:0,class:"add-section"},Ite={key:0,class:"add-btns"},$te={key:1,class:"add-form"},Nte={class:"form-row"},Lte={class:"flabel"},Ote=["value"],Pte={class:"form-row"},Rte={class:"flabel"},Dte={class:"form-row"},Bte={class:"flabel"},Fte=["placeholder"],Hte={class:"form-row"},Wte={class:"flabel"},Ute=["placeholder"],qte={key:0,class:"add-error"},jte={class:"form-btns"},zte={class:"footer-hint"},Vte=Qe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=xt(),o=te(null);Kh(o);const s=t,i=te(null);function r(b){i.value=b}function l(){i.value&&(s("delete",i.value),i.value=null)}function a(){i.value=null}const c=te(!1),u=as({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),d=te(""),f=["moonshot","anthropic","openai","custom"];function g(){u.type="moonshot",u.apiKey="",u.baseUrl="",u.defaultModel="",d.value="",c.value=!0}function h(){c.value=!1}function m(){if(!u.apiKey.trim()){d.value=n("providers.apiKeyRequired");return}d.value="",s("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 _(b){if(b.key==="Escape"){if(c.value){h();return}if(i.value){a();return}s("close")}}rn(()=>document.addEventListener("keydown",_)),Yt(()=>document.removeEventListener("keydown",_));function w(b){return b==="connected"?"var(--ok)":b==="error"?"var(--err)":"var(--faint)"}function k(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,y)=>(C(),E("div",{class:"backdrop",onClick:y[7]||(y[7]=Ze(x=>s("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:o,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":S(n)("providers.dialogLabel")},[p("div",rte,[p("span",lte,O(S(n)("providers.title")),1),p("button",{class:"close-btn",title:S(n)("providers.close"),onClick:y[0]||(y[0]=x=>s("close"))},"✕",8,ate)]),p("div",cte,[e.loading?(C(),E("div",ute,[y[8]||(y[8]=p("svg",{class:"spin-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)),p("span",null,O(S(n)("providers.loading")),1)])):e.unavailable?(C(),E("div",dte,[y[9]||(y[9]=p("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[p("path",{d:"M8 1.5 L15.5 14.5 H0.5 Z"}),p("line",{x1:"8",y1:"7",x2:"8",y2:"10.5"}),p("circle",{cx:"8",cy:"12.5",r:"0.7",fill:"var(--warn)"})],-1)),p("span",null,O(S(n)("providers.unavailable")),1)])):e.providers.length===0?(C(),E("div",fte,O(S(n)("providers.empty")),1)):(C(!0),E(Pe,{key:3},Xe(e.providers,x=>(C(),E("div",{key:x.id,class:"prov-row"},[p("span",{class:"status-dot",style:Wt({color:w(x.status)}),title:k(x.status)},[x.status==="connected"?(C(),E("svg",pte,[p("circle",{cx:"4",cy:"4",r:"3.5",fill:w(x.status)},null,8,mte)])):x.status==="error"?(C(),E("svg",gte,[p("circle",{cx:"4",cy:"4",r:"3.5",fill:w(x.status)},null,8,vte)])):(C(),E("svg",yte,[...y[10]||(y[10]=[p("circle",{cx:"4",cy:"4",r:"3",fill:"none",stroke:"var(--faint)","stroke-width":"1"},null,-1)])]))],12,hte),p("div",kte,[p("span",bte,O(x.type),1),x.baseUrl?(C(),E("span",wte,O(x.baseUrl),1)):ie("",!0),p("span",_te,[p("span",{class:Oe(["prov-key-state",x.hasApiKey?"has-key":"no-key"])},O(x.hasApiKey?S(n)("providers.keySet"):S(n)("providers.keyNotSet")),3),x.models&&x.models.length>0?(C(),E("span",Cte," · "+O(S(n)("providers.modelCount",{count:x.models.length})),1)):ie("",!0)])]),i.value===x.id?(C(),E("div",Ste,[p("span",xte,O(S(n)("providers.confirmDelete")),1),p("button",{class:"act-btn danger",onClick:l},O(S(n)("providers.confirm")),1),p("button",{class:"act-btn",onClick:a},O(S(n)("providers.cancel")),1)])):(C(),E("div",Tte,[p("button",{class:"act-btn",title:S(n)("providers.refreshTitle",{type:x.type}),onClick:L=>s("refresh",x.id)},O(S(n)("providers.refresh")),9,Ate),p("button",{class:"act-btn danger",title:S(n)("providers.deleteTitle",{type:x.type}),onClick:L=>r(x.id)},O(S(n)("providers.delete")),9,Mte)]))]))),128))]),e.unavailable?ie("",!0):(C(),E("div",Ete,[c.value?(C(),E("div",$te,[p("div",Nte,[p("label",Lte,O(S(n)("providers.fieldType")),1),jt(p("select",{"onUpdate:modelValue":y[3]||(y[3]=x=>u.type=x),class:"finput fselect"},[(C(),E(Pe,null,Xe(f,x=>p("option",{key:x,value:x},O(x),9,Ote)),64))],512),[[yf,u.type]])]),p("div",Pte,[p("label",Rte,O(S(n)("providers.fieldApiKey")),1),jt(p("input",{"onUpdate:modelValue":y[4]||(y[4]=x=>u.apiKey=x),class:"finput",type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,512),[[Wn,u.apiKey]])]),p("div",Dte,[p("label",Bte,O(S(n)("providers.fieldBaseUrl")),1),jt(p("input",{"onUpdate:modelValue":y[5]||(y[5]=x=>u.baseUrl=x),class:"finput",type:"text",placeholder:S(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Fte),[[Wn,u.baseUrl]])]),p("div",Hte,[p("label",Wte,O(S(n)("providers.fieldDefaultModel")),1),jt(p("input",{"onUpdate:modelValue":y[6]||(y[6]=x=>u.defaultModel=x),class:"finput",type:"text",placeholder:S(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,Ute),[[Wn,u.defaultModel]])]),d.value?(C(),E("div",qte,O(d.value),1)):ie("",!0),p("div",jte,[p("button",{class:"act-btn primary",onClick:m},O(S(n)("providers.add")),1),p("button",{class:"act-btn",onClick:h},O(S(n)("providers.cancel")),1)])])):(C(),E("div",Ite,[p("button",{class:"add-btn-oauth",onClick:y[1]||(y[1]=x=>s("openLogin","moonshot"))},[y[11]||(y[11]=p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("circle",{cx:"5",cy:"3",r:"2"}),p("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),ft(" "+O(S(n)("providers.loginKimi")),1)]),p("button",{class:"add-btn-oauth",onClick:y[2]||(y[2]=x=>s("openLogin","anthropic"))},[y[12]||(y[12]=p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("circle",{cx:"5",cy:"3",r:"2"}),p("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),ft(" "+O(S(n)("providers.loginAnthropic")),1)]),p("button",{class:"add-btn add-btn-key",onClick:g},[y[13]||(y[13]=p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),p("line",{x1:"1",y1:"5",x2:"9",y2:"5"})],-1)),ft(" "+O(S(n)("providers.enterApiKey")),1)])]))])),p("div",zte,O(S(n)("providers.escClose")),1)],8,ite)]))}}),Kte=bt(Vte,[["__scopeId","data-v-28ec3774"]]),Gte={class:"backdrop"},Yte=["aria-label"],Xte={class:"dh"},Qte={class:"dtitle"},Zte=["title"],Jte={key:0,class:"center-body"},ene={class:"center-text"},tne={key:1,class:"nb"},nne={class:"nb-lead"},one=["href"],sne={class:"nb-or"},ine={class:"nb-fallback"},rne={class:"nb-fb-text"},lne=["href"],ane={class:"nb-code-row"},cne={class:"nb-code"},une={class:"nb-status"},dne=["aria-label"],fne={class:"nb-status-text"},hne={class:"nb-countdown"},pne={key:2,class:"center-body"},mne={class:"center-text success-text"},gne={class:"center-hint"},vne={class:"center-body"},yne={class:"center-text err-text"},kne={class:"center-hint"},bne={class:"actions"},wne={class:"center-body"},_ne={class:"center-text warn-text"},Cne={class:"center-hint"},Sne={class:"actions"},xne=Qe({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=xt(),o=te(null);Kh(o);const s=t,i=e,r=te("starting"),l=te(null),a=te(0),c=te(!1);let u=null,d=null;rn(async()=>{document.addEventListener("keydown",b),await f()}),Yt(()=>{document.removeEventListener("keydown",b),m()});async function f(){m(),l.value=null,r.value="starting";const x=await i.onStartOAuthLogin();if(!x){r.value="error";return}l.value={flowId:x.flowId,verificationUri:x.verificationUri,verificationUriComplete:x.verificationUriComplete,userCode:x.userCode,expiresIn:x.expiresIn,interval:x.interval},a.value=x.expiresIn,r.value="device-code",g(),h(x.interval)}function g(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function h(x){u&&clearTimeout(u),u=setTimeout(async()=>{const L=await i.onPollOAuthLogin();L?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):L?.status==="expired"||L?.status==="cancelled"?(m(),r.value="expired"):h(x)},x*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function _(){await f()}async function w(){!l.value||!await wo(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function k(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function b(x){x.key==="Escape"&&k()}function y(x){const L=Math.floor(x/60),N=x%60;return`${L}:${String(N).padStart(2,"0")}`}return(x,L)=>(C(),E("div",Gte,[p("div",{ref_key:"dialogRef",ref:o,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":S(n)("login.title")},[p("div",Xte,[p("span",Qte,O(S(n)("login.title")),1),p("button",{class:"close-btn",title:S(n)("login.close"),onClick:k},[...L[0]||(L[0]=[p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Zte)]),r.value==="starting"?(C(),E("div",Jte,[L[1]||(L[1]=p("svg",{class:"spin-icon",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"11",cy:"11",r:"8","stroke-dasharray":"30 18","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 11 11",to:"360 11 11",dur:"0.9s",repeatCount:"indefinite"})])],-1)),p("span",ene,O(S(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(C(),E("div",tne,[p("div",nne,O(S(n)("login.lead")),1),p("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[ft(O(S(n)("login.authorizeInBrowser"))+" ",1),L[2]||(L[2]=p("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.6"},[p("path",{d:"M6 2H2.5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8"}),p("path",{d:"M9.5 1.5h3v3M12.5 1.5 7 7"})],-1))],8,one),p("div",sne,O(S(n)("login.orDivider")),1),p("div",ine,[p("div",rne,[ft(O(S(n)("login.fallbackPrefix")),1),p("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(l.value.verificationUri),9,lne),ft(O(S(n)("login.fallbackSuffix")),1)]),p("div",ane,[p("span",cne,O(l.value.userCode),1),p("button",{class:Oe(["nb-copy",{"is-copied":c.value}]),onClick:w},[c.value?(C(),E(Pe,{key:0},[L[3]||(L[3]=p("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2"},[p("polyline",{points:"1,6 4,9 11,2"})],-1)),ft(" "+O(S(n)("login.copied")),1)],64)):(C(),E(Pe,{key:1},[L[4]||(L[4]=p("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),p("path",{d:"M8 4V2a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h2"})],-1)),ft(" "+O(S(n)("login.copy")),1)],64))],2)])]),p("div",une,[p("span",{class:"nb-spinner","aria-label":S(n)("login.waitingAuth")},[...L[5]||(L[5]=[p("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)])],8,dne),p("span",fne,O(S(n)("login.waitingAutoClose")),1),p("span",hne,O(y(a.value)),1)])])):r.value==="success"?(C(),E("div",pne,[L[6]||(L[6]=p("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--ok)","stroke-width":"2"},[p("circle",{cx:"18",cy:"18",r:"15"}),p("polyline",{points:"10,18 15,24 26,12"})],-1)),p("span",mne,O(S(n)("login.success")),1),p("span",gne,O(S(n)("login.successHint")),1)])):r.value==="expired"?(C(),E(Pe,{key:3},[p("div",vne,[L[7]||(L[7]=p("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--err)","stroke-width":"1.5"},[p("circle",{cx:"14",cy:"14",r:"12"}),p("line",{x1:"14",y1:"8",x2:"14",y2:"15"}),p("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--err)"})],-1)),p("span",yne,O(S(n)("login.expiredTitle")),1),p("span",kne,O(S(n)("login.expiredHint")),1)]),p("div",bne,[p("button",{class:"act-btn primary",onClick:_},O(S(n)("login.retry")),1),p("button",{class:"act-btn",onClick:k},O(S(n)("login.closeBtn")),1)])],64)):r.value==="error"?(C(),E(Pe,{key:4},[p("div",wne,[L[8]||(L[8]=p("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[p("path",{d:"M14 3 L26 24 H2 Z"}),p("line",{x1:"14",y1:"12",x2:"14",y2:"18"}),p("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--warn)"})],-1)),p("span",_ne,O(S(n)("login.errorTitle")),1),p("span",Cne,O(S(n)("login.errorHint")),1)]),p("div",Sne,[p("button",{class:"act-btn primary",onClick:_},O(S(n)("login.retry")),1),p("button",{class:"act-btn",onClick:k},O(S(n)("login.closeBtn")),1)])],64)):ie("",!0)],8,Yte)]))}}),Tne=bt(xne,[["__scopeId","data-v-98c6ec96"]]),Ane={class:"lang-switch",role:"group","aria-label":"Language"},Mne=["aria-pressed","onClick"],Ene=Qe({__name:"LanguageSwitcher",setup(e){const{locale:t}=xt();function n(o){t.value!==o&&px(o)}return(o,s)=>(C(),E("div",Ane,[(C(!0),E(Pe,null,Xe(S(hx),i=>(C(),E("button",{key:i.code,type:"button",class:Oe(["lang-opt",{on:S(t)===i.code}]),"aria-pressed":S(t)===i.code,onClick:Ze(r=>n(i.code),["stop"])},O(i.label),11,Mne))),128))]))}}),s3=bt(Ene,[["__scopeId","data-v-907613b6"]]),A2=1e3,lg=16384,ag=500,cg=50,Ine=6,$ne=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Nne=/^[A-Za-z0-9+/=_-]{200,}$/;let ug=null;function Ys(){if(ug!==null)return ug;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=bn(Mt.debug)==="1"),ug=e,e}const pr=[];let Lne=1;const d0=te(0),vc=gl(!1);function One(){return pr}function Pne(){pr.length=0,d0.value++}function Nr(e){vc.value||(pr.push({id:Lne++,ts:Date.now(),...e}),pr.length>A2&&pr.splice(0,pr.length-A2),d0.value++)}function P1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const s=e;return Nne.test(s)?`[base64-like, ${s.length} chars omitted]`:s.length>ag?`${s.slice(0,ag)}… [+${s.length-ag} chars]`:s}if(n!=="object")return String(e);if(t>=Ine)return"[max depth]";if(Array.isArray(e)){const s=e.slice(0,cg).map(i=>P1(i,t+1));return e.length>cg&&s.push(`[+${e.length-cg} more items]`),s}const o={};for(const[s,i]of Object.entries(e))o[s]=$ne.test(s)?"[redacted]":P1(i,t+1);return o}function kl(e){if(e===void 0)return;const t=P1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>lg)return{_truncated:`detail JSON was ${n.length} chars; first ${lg} kept`,preview:n.slice(0,lg)}}catch{return"[unserializable detail]"}return t}function M2(e){Ys()&&Nr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:kl(e.body)}})}function E2(e){if(!Ys())return;const t=e.code!==0;Nr({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:kl(e.data)}})}function Md(e){Ys()&&Nr({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 zl(e,t){Ys()&&Nr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:kl(t)})}function Rne(e){if(!Ys())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;Nr({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:kl(e)})}function Dne(e){if(!Ys())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);Nr({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:kl(t.payload)})}const Bne={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function dg(e,t,n){Ys()&&Nr({source:"client",kind:`client:${e}`,label:`${Bne[e]} ${t}`,detail:kl(n)})}function ar(e,t){Ys()&&Nr({source:"client",kind:"client:event",label:`· ${e}`,detail:kl(t)})}let I2=!1;function Fne(){if(!(I2||!Ys())){I2=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{dg("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;dg("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{dg(e,n.map(Hne).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function Hne(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 i3(e=pr){if(typeof document>"u")return;const t=new Blob([Wne(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}function Wne(e=pr){return e.map(t=>JSON.stringify(t)).join(`
|
|
264
|
-
`)}const Une=["aria-label"],qne={class:"dh"},jne={class:"dtitle"},zne=["title"],Vne={class:"settings-layout"},Kne=["aria-label"],Gne=["aria-selected","aria-controls","id","onClick"],Yne={class:"body"},Xne={id:"settings-panel-general",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-general"},Qne={class:"sec"},Zne={class:"sec-title"},Jne={class:"row"},eoe={class:"rlabel"},toe=["aria-label"],noe=["aria-pressed"],ooe=["aria-pressed"],soe={class:"row"},ioe={class:"rlabel"},roe=["aria-label"],loe=["aria-pressed"],aoe=["aria-pressed"],coe=["aria-pressed"],uoe={class:"row"},doe={class:"rlabel"},foe={class:"num-field"},hoe=["value","aria-label"],poe={class:"row"},moe={class:"rlabel"},goe={class:"sec"},voe={class:"sec-title"},yoe={class:"row"},koe={class:"rlabel"},boe={key:0,class:"hint"},woe=["aria-checked","disabled"],_oe={class:"row"},Coe={class:"rlabel"},Soe={key:0,class:"hint"},xoe=["aria-checked","disabled"],Toe={class:"row"},Aoe={class:"rlabel"},Moe=["aria-checked"],Eoe={class:"sec"},Ioe={class:"sec-title"},$oe={class:"row"},Noe={class:"rlabel"},Loe=["title"],Ooe={class:"actions"},Poe={class:"sec"},Roe={class:"sec-title"},Doe={class:"row"},Boe={class:"rlabel"},Foe={class:"rvalue mono"},Hoe={id:"settings-panel-agent",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-agent"},Woe={class:"sec"},Uoe={class:"sec-head"},qoe={class:"sec-title"},joe={key:0,class:"saving"},zoe={class:"row"},Voe={class:"rlabel"},Koe={class:"hint"},Goe=["value","disabled","aria-label"],Yoe={key:0,value:"",disabled:""},Xoe=["label"],Qoe=["value"],Zoe={key:1,class:"rvalue mono"},Joe={class:"row"},ese={class:"rlabel"},tse={class:"hint"},nse=["aria-label"],ose=["aria-pressed","disabled","onClick"],sse={class:"row"},ise={class:"rlabel"},rse={class:"hint"},lse=["aria-checked","disabled"],ase={class:"row"},cse={class:"rlabel"},use={class:"hint"},dse=["aria-checked","disabled"],fse={class:"row"},hse={class:"rlabel"},pse={class:"hint"},mse=["aria-checked","disabled"],gse={key:0,class:"row"},vse={class:"rlabel"},yse=["aria-checked","disabled"],kse={key:1,class:"provider-list"},bse={class:"provider-main"},wse={class:"provider-id"},_se={class:"provider-type"},Cse={class:"provider-meta"},Sse={key:0,class:"provider-model"},xse={key:1,class:"empty-config"},Tse={id:"settings-panel-advanced",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-advanced"},Ase={class:"sec"},Mse={class:"sec-title"},Ese={class:"row"},Ise={class:"rlabel"},$se={class:"rvalue mono"},Nse={class:"row"},Lse={class:"rlabel"},Ose={key:0,class:"hint"},Pse={id:"settings-panel-experimental",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-experimental"},Rse={class:"sec"},Dse={class:"sec-title"},Bse={class:"row"},Fse={class:"rlabel"},Hse={class:"hint"},Wse=["aria-checked"],Use=Qe({__name:"SettingsDialog",props:{theme:{},colorScheme:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyPermission:{},sound:{type:Boolean},betaToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setTheme","setColorScheme","setUiFontSize","setNotify","setNotifyQuestion","setSound","setBetaToc","login","logout","openOnboarding","updateConfig","close"],setup(e,{emit:t}){const{t:n}=xt(),o=e,s=t,i=te("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=o5(),a=["manual","auto","yolo"],c=te(null);Kh(c);function u(N){N.key==="Escape"&&s("close")}rn(()=>document.addEventListener("keydown",u)),Yt(()=>document.removeEventListener("keydown",u));function d(){i3()}const f=H(()=>{const N=new Map;for(const v of o.models??[])N.set(v.id,{id:v.id,label:v.displayName??v.model??v.id,provider:v.provider});for(const[v,M]of Object.entries(o.config?.models??{})){if(N.has(v))continue;const $=_(M);N.set(v,{id:v,label:w(v,M,$),provider:$??v})}return Array.from(N.values())}),g=H(()=>{const N=new Map;for(const v of f.value){const M=N.get(v.provider)??[];M.push(v),N.set(v.provider,M)}for(const v of N.values())v.sort((M,$)=>M.label.localeCompare($.label));return Array.from(N.entries()).toSorted(([v],[M])=>v.localeCompare(M)).map(([v,M])=>({provider:v,options:M}))}),h=H(()=>Object.entries(o.config?.providers??{}).map(([N,v])=>({id:N,provider:v})).sort((N,v)=>N.id.localeCompare(v.id))),m=H(()=>{const N=o.config?.defaultPermissionMode;return N==="auto"||N==="yolo"||N==="manual"?N:"manual"});function _(N){if(!N||typeof N!="object")return;const v=N;return typeof v.provider=="string"?v.provider:void 0}function w(N,v,M){if(!v||typeof v!="object")return N;const $=v,P=typeof $.model=="string"?$.model:void 0,T=M??_(v);return P&&T?`${N} (${T}/${P})`:P?`${N} (${P})`:N}function k(N){return N===!0}function b(N){const v=N.target.value;!v||v===o.config?.defaultModel||s("updateConfig",{defaultModel:v})}function y(N){N!==m.value&&s("updateConfig",{defaultPermissionMode:N})}function x(N){const v=o.config?.[N];s("updateConfig",{[N]:!k(v)})}function L(N){i.value=N}return(N,v)=>(C(),E("div",{class:"backdrop",onClick:v[18]||(v[18]=Ze(M=>s("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":S(n)("settings.title")},[p("div",qne,[p("span",jne,O(S(n)("settings.title")),1),p("button",{class:"close-btn",title:S(n)("settings.close"),onClick:v[0]||(v[0]=M=>s("close"))},[...v[19]||(v[19]=[p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,zne)]),p("div",Vne,[p("nav",{class:"settings-tabs",role:"tablist","aria-label":S(n)("settings.title")},[(C(),E(Pe,null,Xe(r,M=>p("button",{key:M.id,type:"button",class:Oe(["tab",{on:i.value===M.id}]),role:"tab","aria-selected":i.value===M.id,"aria-controls":`settings-panel-${M.id}`,id:`settings-tab-${M.id}`,onClick:$=>L(M.id)},O(S(n)(M.labelKey)),11,Gne)),64))],8,Kne),p("div",Yne,[jt(p("section",Xne,[p("section",Qne,[p("h3",Zne,O(S(n)("settings.appearance")),1),p("div",Jne,[p("span",eoe,O(S(n)("theme.label")),1),p("div",{class:"seg",role:"group","aria-label":S(n)("theme.label")},[p("button",{type:"button",class:Oe(["opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:v[1]||(v[1]=M=>s("setTheme","modern"))},O(S(n)("theme.modern")),11,noe),p("button",{type:"button",class:Oe(["opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:v[2]||(v[2]=M=>s("setTheme","kimi"))},O(S(n)("theme.kimi")),11,ooe)],8,toe)]),p("div",soe,[p("span",ioe,O(S(n)("theme.colorSchemeLabel")),1),p("div",{class:"seg",role:"group","aria-label":S(n)("theme.colorSchemeLabel")},[p("button",{type:"button",class:Oe(["opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:v[3]||(v[3]=M=>s("setColorScheme","light"))},O(S(n)("theme.light")),11,loe),p("button",{type:"button",class:Oe(["opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:v[4]||(v[4]=M=>s("setColorScheme","dark"))},O(S(n)("theme.dark")),11,aoe),p("button",{type:"button",class:Oe(["opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:v[5]||(v[5]=M=>s("setColorScheme","system"))},O(S(n)("theme.system")),11,coe)],8,roe)]),p("div",uoe,[p("span",doe,O(S(n)("settings.uiFontSize")),1),p("label",foe,[p("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":S(n)("settings.uiFontSize"),onInput:v[6]||(v[6]=M=>s("setUiFontSize",Number(M.target.value)))},null,40,hoe),v[20]||(v[20]=p("span",{class:"num-unit"},"px",-1))])]),p("div",poe,[p("span",moe,O(S(n)("sidebar.language")),1),vt(s3)])]),p("section",goe,[p("h3",voe,O(S(n)("settings.notifications")),1),p("div",yoe,[p("span",koe,[ft(O(S(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(C(),E("span",boe,O(S(n)("settings.notifyDenied")),1)):ie("",!0)]),p("button",{type:"button",class:Oe(["switch",{on:e.notify}]),role:"switch","aria-checked":e.notify,disabled:e.notifyPermission==="denied",onClick:v[7]||(v[7]=M=>s("setNotify",!e.notify))},[...v[21]||(v[21]=[p("span",{class:"knob"},null,-1)])],10,woe)]),p("div",_oe,[p("span",Coe,[ft(O(S(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(C(),E("span",Soe,O(S(n)("settings.notifyDenied")),1)):ie("",!0)]),p("button",{type:"button",class:Oe(["switch",{on:e.notifyQuestion}]),role:"switch","aria-checked":e.notifyQuestion,disabled:e.notifyPermission==="denied",onClick:v[8]||(v[8]=M=>s("setNotifyQuestion",!e.notifyQuestion))},[...v[22]||(v[22]=[p("span",{class:"knob"},null,-1)])],10,xoe)]),p("div",Toe,[p("span",Aoe,O(S(n)("settings.soundOnComplete")),1),p("button",{type:"button",class:Oe(["switch",{on:e.sound}]),role:"switch","aria-checked":e.sound,onClick:v[9]||(v[9]=M=>s("setSound",!e.sound))},[...v[23]||(v[23]=[p("span",{class:"knob"},null,-1)])],10,Moe)])]),p("section",Eoe,[p("h3",Ioe,O(S(n)("settings.account")),1),p("div",$oe,[p("span",Noe,O(e.authReady?"managed:kimi-code":S(n)("sidebar.notSignedIn")),1),e.authReady&&e.accountModel?(C(),E("span",{key:0,class:"rvalue",title:e.accountModel},O(e.accountModel),9,Loe)):ie("",!0)]),p("div",Ooe,[p("button",{type:"button",class:"act",onClick:v[10]||(v[10]=M=>{s("openOnboarding"),s("close")})},O(S(n)("onboarding.reopen")),1),e.authReady?(C(),E("button",{key:0,type:"button",class:"act danger",onClick:v[11]||(v[11]=M=>s("logout"))},O(S(n)("sidebar.signOut")),1)):(C(),E("button",{key:1,type:"button",class:"act signin",onClick:v[12]||(v[12]=M=>s("login"))},O(S(n)("sidebar.signIn")),1))])]),p("section",Poe,[p("h3",Roe,O(S(n)("settings.build")),1),p("div",Doe,[p("span",Boe,O(S(n)("settings.serverVersion")),1),p("span",Foe,O(e.serverVersion||"-"),1)])])],512),[[js,i.value==="general"]]),jt(p("section",Hoe,[p("section",Woe,[p("div",Uoe,[p("h3",qoe,O(S(n)("settings.agentDefaults")),1),e.configSaving?(C(),E("span",joe,O(S(n)("settings.saving")),1)):ie("",!0)]),e.config?(C(),E(Pe,{key:0},[p("div",zoe,[p("span",Voe,[ft(O(S(n)("settings.defaultModel"))+" ",1),p("span",Koe,O(S(n)("settings.defaultModelHint")),1)]),g.value.length>0?(C(),E("select",{key:0,class:"select-field",value:e.config.defaultModel??"",disabled:e.configSaving,"aria-label":S(n)("settings.defaultModel"),onChange:b},[e.config.defaultModel?ie("",!0):(C(),E("option",Yoe,O(S(n)("settings.noDefaultModel")),1)),(C(!0),E(Pe,null,Xe(g.value,M=>(C(),E("optgroup",{key:M.provider,label:M.provider},[(C(!0),E(Pe,null,Xe(M.options,$=>(C(),E("option",{key:$.id,value:$.id},O($.label),9,Qoe))),128))],8,Xoe))),128))],40,Goe)):(C(),E("span",Zoe,O(e.config.defaultModel??S(n)("settings.noDefaultModel")),1))]),p("div",Joe,[p("span",ese,[ft(O(S(n)("settings.defaultPermission"))+" ",1),p("span",tse,O(S(n)("settings.defaultPermissionHint")),1)]),p("div",{class:"seg",role:"group","aria-label":S(n)("settings.defaultPermission")},[(C(),E(Pe,null,Xe(a,M=>p("button",{key:M,type:"button",class:Oe(["opt",{on:m.value===M}]),"aria-pressed":m.value===M,disabled:e.configSaving,onClick:$=>y(M)},O(S(n)(`settings.permission.${M}`)),11,ose)),64))],8,nse)]),p("div",sse,[p("span",ise,[ft(O(S(n)("settings.defaultThinking"))+" ",1),p("span",rse,O(S(n)("settings.defaultThinkingHint")),1)]),p("button",{type:"button",class:Oe(["switch",{on:k(e.config.defaultThinking)}]),role:"switch","aria-checked":k(e.config.defaultThinking),disabled:e.configSaving,onClick:v[13]||(v[13]=M=>x("defaultThinking"))},[...v[24]||(v[24]=[p("span",{class:"knob"},null,-1)])],10,lse)]),p("div",ase,[p("span",cse,[ft(O(S(n)("settings.defaultPlanMode"))+" ",1),p("span",use,O(S(n)("settings.defaultPlanModeHint")),1)]),p("button",{type:"button",class:Oe(["switch",{on:k(e.config.defaultPlanMode)}]),role:"switch","aria-checked":k(e.config.defaultPlanMode),disabled:e.configSaving,onClick:v[14]||(v[14]=M=>x("defaultPlanMode"))},[...v[25]||(v[25]=[p("span",{class:"knob"},null,-1)])],10,dse)]),p("div",fse,[p("span",hse,[ft(O(S(n)("settings.mergeSkills"))+" ",1),p("span",pse,O(S(n)("settings.mergeSkillsHint")),1)]),p("button",{type:"button",class:Oe(["switch",{on:k(e.config.mergeAllAvailableSkills)}]),role:"switch","aria-checked":k(e.config.mergeAllAvailableSkills),disabled:e.configSaving,onClick:v[15]||(v[15]=M=>x("mergeAllAvailableSkills"))},[...v[26]||(v[26]=[p("span",{class:"knob"},null,-1)])],10,mse)]),e.config.telemetry!==void 0?(C(),E("div",gse,[p("span",vse,O(S(n)("settings.telemetry")),1),p("button",{type:"button",class:Oe(["switch",{on:k(e.config.telemetry)}]),role:"switch","aria-checked":k(e.config.telemetry),disabled:e.configSaving,onClick:v[16]||(v[16]=M=>x("telemetry"))},[...v[27]||(v[27]=[p("span",{class:"knob"},null,-1)])],10,yse)])):ie("",!0),h.value.length>0?(C(),E("div",kse,[(C(!0),E(Pe,null,Xe(h.value,({id:M,provider:$})=>(C(),E("div",{key:M,class:"provider-row"},[p("div",bse,[p("span",wse,O(M),1),p("span",_se,O($.type),1)]),p("div",Cse,[p("span",{class:Oe(["provider-badge",$.hasApiKey?"ok":"warn"])},O($.hasApiKey?S(n)("settings.credentialReady"):S(n)("settings.credentialMissing")),3),$.defaultModel?(C(),E("span",Sse,O($.defaultModel),1)):ie("",!0)])]))),128))])):ie("",!0)],64)):(C(),E("div",xse,O(S(n)("settings.configUnavailable")),1))])],512),[[js,i.value==="agent"]]),jt(p("section",Tse,[p("section",Ase,[p("h3",Mse,O(S(n)("settings.advanced")),1),p("div",Ese,[p("span",Ise,O(S(n)("sidebar.daemon")),1),p("span",$se,O(S(l)),1)]),p("div",Nse,[p("span",Lse,[ft(O(S(n)("settings.exportLog"))+" ",1),S(Ys)()?ie("",!0):(C(),E("span",Ose,O(S(n)("settings.logHint")),1))]),p("button",{type:"button",class:"act",onClick:d},O(S(n)("settings.exportLogBtn")),1)])])],512),[[js,i.value==="advanced"]]),jt(p("section",Pse,[p("section",Rse,[p("h3",Dse,O(S(n)("settings.beta")),1),p("div",Bse,[p("span",Fse,[ft(O(S(n)("settings.betaToc"))+" ",1),p("span",Hse,O(S(n)("settings.betaTocHint")),1)]),p("button",{type:"button",class:Oe(["switch",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc,onClick:v[17]||(v[17]=M=>s("setBetaToc",!e.betaToc))},[...v[28]||(v[28]=[p("span",{class:"knob"},null,-1)])],10,Wse)])])],512),[[js,i.value==="experimental"]])])])],8,Une)]))}}),qse=bt(Use,[["__scopeId","data-v-d022b51c"]]),jse=["aria-label"],zse={class:"dh"},Vse={class:"dtitle"},Kse=["aria-label"],Gse={class:"crumbbar"},Yse=["disabled","title","aria-label"],Xse={class:"crumbs"},Qse={key:0,class:"crumb-sep"},Zse=["onClick"],Jse={key:0,class:"filterbar"},eie=["placeholder"],tie={key:0,class:"search-spin","aria-hidden":"true"},nie={class:"folder-list"},oie={key:0,class:"fl-loading"},sie=["onClick"],iie={class:"folder-name search-rel"},rie={key:0,class:"git-tag"},lie={key:0,class:"git-branch"},aie={key:0,class:"fl-empty"},cie={key:1,class:"fl-loading"},uie=["onClick"],die={class:"folder-name"},fie={key:0,class:"git-tag"},hie={key:0,class:"git-branch"},pie={key:0,class:"fl-empty"},mie={class:"paste-label",for:"aw-path"},gie=["placeholder","onKeydown"],vie=["disabled","title"],yie={class:"actions"},kie=["disabled","title"],bie={class:"footer-hint"},wie=600,_ie=6,$2=150,Cie=Qe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=xt(),o=e,s=t,i=te(!1),r=te(!1),l=te(""),a=te(null),c=te([]),u=te(""),d=te(!1),f=te([]),g=H(()=>u.value.trim().length>0);let h=0,m=null;function _(I,R){const D=I.toLowerCase(),F=R.toLowerCase();let z=0;for(let V=0;V<F.length&&z<D.length;V++)F[V]===D[z]&&z++;return z===D.length}async function w(I){const R=l.value,D=I.trim();if(!R||D===""){f.value=[],d.value=!1;return}const F=++h;d.value=!0;const z=[],V=[{path:R,depth:0}];let ne=0;for(;V.length>0&&ne<wie&&z.length<$2;){if(F!==h)return;const K=V.shift();ne++;let G;try{G=await o.browseFs(K.path)}catch{continue}if(F!==h)return;for(const X of G.entries){if(!X.isDir)continue;const be=X.path.startsWith(R)?X.path.slice(R.length).replace(/^\/+/,""):X.path;if(_(D,be||X.name)&&(z.push({path:X.path,name:X.name,rel:be||X.name,isGitRepo:X.isGitRepo,branch:X.branch}),z.length>=$2))break;K.depth+1<_ie&&V.push({path:X.path,depth:K.depth+1})}F===h&&(f.value=[...z])}F===h&&(d.value=!1)}ze(u,I=>{if(m&&clearTimeout(m),I.trim()===""){h++,f.value=[],d.value=!1;return}m=setTimeout(()=>void w(I),220)});const k=te(!1),b=te(""),y=H(()=>b.value.trim()),x=H(()=>{const I=l.value;if(!I)return[];const R=I.split("/").filter(Boolean),D=[{label:"/",path:"/"}];let F="";for(const z of R)F+=`/${z}`,D.push({label:z,path:F});return D}),L=H(()=>l.value.length>0);async function N(I){i.value=!0;try{const R=await o.browseFs(I);if(!R.path){r.value=!0;return}l.value=R.path,a.value=R.parent,c.value=R.entries,u.value="",r.value=!1}catch{r.value=!0}finally{i.value=!1}}function v(I){I.isDir&&N(I.path)}function M(){a.value&&N(a.value)}function $(){L.value&&s("add",l.value)}function P(){y.value.length!==0&&s("add",y.value)}rn(async()=>{i.value=!0;try{if(o.defaultPath&&(await N(o.defaultPath),!r.value))return;const I=await o.getFsHome();I.home?await N(I.home):r.value=!0}catch{r.value=!0}finally{i.value=!1}});function T(I){I.key==="Escape"&&s("close")}return rn(()=>document.addEventListener("keydown",T)),Yt(()=>{document.removeEventListener("keydown",T),m&&clearTimeout(m)}),(I,R)=>(C(),E("div",{class:"backdrop",onClick:R[6]||(R[6]=Ze(D=>s("close"),["self"]))},[p("div",{class:"dialog",role:"dialog","aria-label":S(n)("workspace.addTitle")},[p("div",zse,[p("span",Vse,O(S(n)("workspace.addTitle")),1),p("button",{class:"close-btn","aria-label":S(n)("workspace.cancel"),onClick:R[0]||(R[0]=D=>s("close"))},[...R[7]||(R[7]=[p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Kse)]),r.value?ie("",!0):(C(),E(Pe,{key:0},[p("div",Gse,[p("button",{class:"up-btn",disabled:!a.value,title:S(n)("workspace.up"),"aria-label":S(n)("workspace.up"),onClick:M},[...R[8]||(R[8]=[p("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[p("path",{d:"M8 12V4M4 7l4-3 4 3"})],-1)])],8,Yse),p("div",Xse,[(C(!0),E(Pe,null,Xe(x.value,(D,F)=>(C(),E(Pe,{key:D.path},[F>1?(C(),E("span",Qse,"/")):ie("",!0),p("button",{class:Oe(["crumb",{last:F===x.value.length-1}]),onClick:z=>N(D.path)},O(D.label),11,Zse)],64))),128))])]),i.value?ie("",!0):(C(),E("div",Jse,[R[9]||(R[9]=p("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"},[p("circle",{cx:"7",cy:"7",r:"4.5"}),p("path",{d:"M11 11l3 3"})],-1)),jt(p("input",{"onUpdate:modelValue":R[1]||(R[1]=D=>u.value=D),class:"filter-input",type:"text",placeholder:S(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:R[2]||(R[2]=Ze(()=>{},["stop"]))},null,40,eie),[[Wn,u.value]]),d.value?(C(),E("span",tie)):ie("",!0)])),p("div",nie,[i.value?(C(),E("div",oie,O(S(n)("workspace.browsing")),1)):g.value?(C(),E(Pe,{key:1},[(C(!0),E(Pe,null,Xe(f.value,D=>(C(),E("button",{key:D.path,class:"folder-row",onClick:F=>N(D.path)},[R[10]||(R[10]=p("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),p("span",iie,O(D.rel),1),D.isGitRepo?(C(),E("span",rie,[ft(O(S(n)("workspace.gitTag")),1),D.branch?(C(),E("span",lie,O(D.branch),1)):ie("",!0)])):ie("",!0)],8,sie))),128)),!d.value&&f.value.length===0?(C(),E("div",aie,O(S(n)("workspace.noFilterMatch",{q:u.value.trim()})),1)):d.value&&f.value.length===0?(C(),E("div",cie,O(S(n)("workspace.searching")),1)):ie("",!0)],64)):(C(),E(Pe,{key:2},[(C(!0),E(Pe,null,Xe(c.value,D=>(C(),E("button",{key:D.path,class:"folder-row",onClick:F=>v(D)},[R[11]||(R[11]=p("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),p("span",die,O(D.name),1),D.isGitRepo?(C(),E("span",fie,[ft(O(S(n)("workspace.gitTag")),1),D.branch?(C(),E("span",hie,O(D.branch),1)):ie("",!0)])):ie("",!0)],8,uie))),128)),c.value.length===0?(C(),E("div",pie,O(S(n)("workspace.noSubfolders")),1)):ie("",!0)],64))])],64)),p("div",{class:Oe(["paste-section",{"paste-only":r.value}])},[!r.value&&!k.value?(C(),E("button",{key:0,type:"button",class:"paste-toggle",onClick:R[3]||(R[3]=D=>k.value=!0)},O(S(n)("workspace.pasteToggle")),1)):(C(),E(Pe,{key:1},[p("label",mie,O(S(n)("workspace.pathLabel")),1),jt(p("input",{id:"aw-path","onUpdate:modelValue":R[4]||(R[4]=D=>b.value=D),class:"paste-input",type:"text",placeholder:S(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:Ns(Ze(P,["stop"]),["enter"])},null,40,gie),[[Wn,b.value]]),p("button",{class:"paste-add",disabled:y.value.length===0,title:S(n)("workspace.add"),onClick:P},[...R[12]||(R[12]=[p("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"},[p("path",{d:"M8 3v10M3 8h10"})],-1)])],8,vie)],64))],2),p("div",yie,[r.value?ie("",!0):(C(),E("button",{key:0,class:"act-btn primary",disabled:!L.value,title:l.value,onClick:$},O(S(n)("workspace.openThisFolder")),9,kie)),p("button",{class:"act-btn",onClick:R[5]||(R[5]=D=>s("close"))},O(S(n)("workspace.cancel")),1)]),p("div",bie,O(S(n)("workspace.browseHint")),1)],8,jse)]))}}),Sie=bt(Cie,[["__scopeId","data-v-da51b020"]]),xie=["aria-label"],Tie={class:"dh"},Aie={class:"dtitle"},Mie=["title"],Eie={class:"rows"},Iie={class:"row"},$ie={class:"row"},Nie={class:"row"},Lie={class:"row"},Oie={class:"row"},Pie={class:"row"},Rie={class:"ctx-text"},Die={key:0,class:"bar"},Bie={class:"row"},Fie=Qe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=xt(),o=e,s=t,i=H(()=>o.status.ctxMax>0?Math.round(o.status.ctxUsed/o.status.ctxMax*100):0),r=H(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:o.status.ctxUsed.toLocaleString(),max:o.status.ctxMax.toLocaleString(),pct:i.value}):n("status.statusNone"));function l(h){return n(h==="yolo"?"status.permissionYolo":h==="auto"?"status.permissionAuto":"status.permissionManual")}const a=H(()=>{const h=o.status.permission;return h==="yolo"?"var(--err)":h==="auto"?"var(--warn)":"var(--ink)"}),c=H(()=>o.planMode?n("status.planOn"):n("status.planOff")),u=H(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),d=H(()=>typeof o.costUsd=="number"&&o.costUsd>0),f=H(()=>d.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));function g(h){h.key==="Escape"&&s("close")}return rn(()=>document.addEventListener("keydown",g)),Yt(()=>document.removeEventListener("keydown",g)),(h,m)=>(C(),E("div",{class:"backdrop",onClick:m[1]||(m[1]=Ze(_=>s("close"),["self"]))},[p("div",{class:"dialog",role:"dialog","aria-label":S(n)("status.statusPanelTitle")},[p("div",Tie,[p("span",Aie,O(S(n)("status.statusPanelTitle")),1),p("button",{class:"close-btn",title:S(n)("status.statusPanelClose"),onClick:m[0]||(m[0]=_=>s("close"))},"✕",8,Mie)]),p("dl",Eie,[p("div",Iie,[p("dt",null,O(S(n)("status.statusModel")),1),p("dd",null,O(e.status.model),1)]),p("div",$ie,[p("dt",null,O(S(n)("status.statusThinking")),1),p("dd",null,O(e.thinking),1)]),p("div",Nie,[p("dt",null,O(S(n)("status.statusPermission")),1),p("dd",{style:Wt({color:a.value})},O(l(e.status.permission)),5)]),p("div",Lie,[p("dt",null,O(S(n)("status.statusPlanMode")),1),p("dd",{class:Oe({"plan-on":e.planMode})},O(c.value),3)]),p("div",Oie,[p("dt",null,O(S(n)("status.statusSwarmMode")),1),p("dd",{class:Oe({"swarm-on":e.swarmMode})},O(u.value),3)]),p("div",Pie,[p("dt",null,O(S(n)("status.statusContext")),1),p("dd",null,[p("span",Rie,O(r.value),1),e.status.ctxMax>0?(C(),E("span",Die,[p("i",{style:Wt({width:i.value+"%"})},null,4)])):ie("",!0)])]),p("div",Bie,[p("dt",null,O(S(n)("status.statusCost")),1),p("dd",null,O(f.value),1)])])],8,xie)]))}}),Hie=bt(Fie,[["__scopeId","data-v-230d4b38"]]),Wie={key:0,class:"toasts",role:"status","aria-live":"polite"},Uie=["onPointerenter","onPointerleave"],qie={class:"body"},jie={class:"title"},zie={key:0,class:"msg"},Vie={key:1,class:"actions"},Kie=["onClick"],Gie=["onClick"],Yie={key:2,class:"details"},Xie=["aria-label","onClick"],Qie=Qe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt();function i(v){return typeof v=="object"&&v!==null}function r(v){return i(v)?v.title:v}function l(v){return i(v)?v.message??"":""}function a(v){return i(v)?v.details:void 0}function c(v){return i(v)?v.severity==="error":v.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(v)}function u(v){return i(v)?`notice:${v.severity}:${v.title}:${v.message??""}:${JSON.stringify(v.details??[])}`:`text:${v}`}function d(v){if(!i(v))return v;const M=[v.title];v.message&&M.push(v.message);const $=v.details??[];if($.length>0){M.push("",`${s("warnings.diagnostics")}:`);for(const P of $)M.push(`${P.label}: ${P.value}`)}return M.join(`
|
|
265
|
-
`)}let f=1;const g=te([]),h=new Map,m=new Map;function _(v){const M=c(v)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?M+5e3:M}function w(v,M){const $=h.get(v)??{handle:null,deadline:0,remaining:0};$.handle=setTimeout(()=>N(v),M),$.deadline=Date.now()+M,h.set(v,$)}function k(v){const M=h.get(v);M&&M.handle!==null&&clearTimeout(M.handle),h.delete(v)}function b(v){const M=h.get(v);!M||M.handle===null||(clearTimeout(M.handle),M.handle=null,M.remaining=Math.max(0,M.deadline-Date.now()))}function y(v){if(g.value.find(P=>P.id===v)?.detailsOpen)return;const $=h.get(v);!$||$.handle!==null||w(v,$.remaining)}function x(v){v.detailsOpen=!v.detailsOpen,v.detailsOpen?b(v.id):y(v.id)}async function L(v){if(!await wo(d(v.warning)))return;v.copied=!0;const $=m.get(v.id);$&&clearTimeout($),m.set(v.id,setTimeout(()=>{v.copied=!1,m.delete(v.id)},1400))}function N(v){k(v);const M=m.get(v);M&&clearTimeout(M),m.delete(v);const $=g.value.findIndex(P=>P.id===v);$!==-1&&(g.value=g.value.filter(P=>P.id!==v),o("dismiss",$))}return ze(()=>n.warnings,v=>{const M=[...g.value];g.value=v.map($=>{const P=u($),T=M.findIndex(D=>D.key===P),I=T===-1?void 0:M.splice(T,1)[0];if(I)return I.warning=$,I;const R={id:f++,key:P,warning:$,detailsOpen:!1,copied:!1};return w(R.id,_($)),R});for(const $ of M){k($.id);const P=m.get($.id);P&&clearTimeout(P),m.delete($.id)}},{immediate:!0,flush:"post"}),Yt(()=>{h.forEach(v=>{v.handle!==null&&clearTimeout(v.handle)}),h.clear(),m.forEach(v=>clearTimeout(v)),m.clear()}),(v,M)=>g.value.length?(C(),E("div",Wie,[(C(!0),E(Pe,null,Xe(g.value,$=>(C(),E("div",{key:$.id,class:Oe(["toast",{err:c($.warning)}]),onPointerenter:P=>b($.id),onPointerleave:P=>y($.id)},[M[1]||(M[1]=p("span",{class:"dot","aria-hidden":"true"},null,-1)),p("div",qie,[p("div",jie,O(r($.warning)),1),l($.warning)?(C(),E("div",zie,O(l($.warning)),1)):ie("",!0),a($.warning)?.length?(C(),E("div",Vie,[p("button",{class:"link",type:"button",onClick:P=>x($)},O($.detailsOpen?S(s)("warnings.hideDetails"):S(s)("warnings.showDetails")),9,Kie),p("button",{class:"link",type:"button",onClick:P=>L($)},O($.copied?S(s)("warnings.copied"):S(s)("warnings.copyDetails")),9,Gie)])):ie("",!0),$.detailsOpen&&a($.warning)?.length?(C(),E("dl",Yie,[(C(!0),E(Pe,null,Xe(a($.warning),P=>(C(),E("div",{key:`${P.label}:${P.value}`,class:"detail-row"},[p("dt",null,O(P.label),1),p("dd",null,O(P.value),1)]))),128))])):ie("",!0)]),p("button",{class:"x",type:"button","aria-label":S(s)("warnings.dismiss"),onClick:P=>N($.id)},[...M[0]||(M[0]=[p("svg",{viewBox:"0 0 16 16",width:"12",height:"12"},[p("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round"})],-1)])],8,Xie)],42,Uie))),128))])):ie("",!0)}}),Zie=bt(Qie,[["__scopeId","data-v-45432ab6"]]),Jie={class:"topbar"},ere={class:"wsq"},tre=["aria-label"],nre={class:"tb-path"},ore={class:"ws"},sre={class:"se"},ire={class:"tb-sub"},rre=["aria-label"],lre=Qe({__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}=xt(),o=e,s=t,i=H(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=H(()=>o.workspace?.name??n("workspace.noWorkspace")),l=H(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(C(),E("div",Jie,[p("span",ere,O(i.value),1),p("button",{type:"button",class:"tb-mid","aria-label":S(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[p("span",nre,[p("span",ore,O(r.value),1),e.sessionTitle?(C(),E(Pe,{key:0},[c[2]||(c[2]=p("span",{class:"sl"},"/",-1)),p("span",sre,O(e.sessionTitle),1)],64)):ie("",!0),c[3]||(c[3]=p("span",{class:"cv"},"⌄",-1))]),p("span",ire,[p("span",{class:Oe(["rd",{on:e.running}])},null,2),p("span",null,O(l.value),1),e.branch?(C(),E(Pe,{key:0},[ft(" · "+O(e.branch),1)],64)):ie("",!0),e.sessionCount>0?(C(),E(Pe,{key:1},[ft(" · "+O(S(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ie("",!0)])],8,tre),p("button",{type:"button",class:"tb-set","aria-label":S(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},[...c[4]||(c[4]=[_r('<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-135bd6bf><line x1="4" y1="8" x2="20" y2="8" data-v-135bd6bf></line><circle cx="10" cy="8" r="2.5" fill="var(--bg)" data-v-135bd6bf></circle><line x1="4" y1="16" x2="20" y2="16" data-v-135bd6bf></line><circle cx="15" cy="16" r="2.5" fill="var(--bg)" data-v-135bd6bf></circle></svg>',1)])],8,rre)]))}}),are=bt(lre,[["__scopeId","data-v-135bd6bf"]]),cre={key:0,class:"sheet-root"},ure=["aria-label"],dre=["aria-label"],fre={key:0,class:"sheet-head"},hre={class:"sheet-title"},pre={class:"sheet-body"},mre=Qe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=xt(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return ze(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Yt(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(C(),Ve(Fi,{name:"sheet"},{default:In(()=>[e.modelValue?(C(),E("div",cre,[p("div",{class:"sheet-scrim",onClick:i}),p("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||S(n)("mobile.sheetLabel")},[p("button",{type:"button",class:"sheet-grab","aria-label":S(n)("mobile.closeSheet"),onClick:i},null,8,dre),e.title?(C(),E("div",fre,[p("span",hre,O(e.title),1)])):ie("",!0),p("div",pre,[ca(l.$slots,"default",{},void 0,!0)])],8,ure)])):ie("",!0)]),_:3}))}}),r3=bt(mre,[["__scopeId","data-v-aa55810a"]]),gre={class:"mlist"},vre={key:0,class:"mempty"},yre=["onClick"],kre={class:"mgh-folder",width:"15",height:"15",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},bre={class:"mgh-main"},wre={class:"mgh-name"},_re=["title"],Cre={key:0,class:"att"},Sre=["title","aria-label","onClick"],xre=["title","aria-label","onClick"],Tre=["onClick"],Are=["onClick"],Mre={key:0,class:"mempty small"},Ere=["onClick"],Ire={class:"m"},$re={class:"s"},Nre={key:0,class:"att"},Lre=["title","onClick"],Ore=["onClick"],Pre=["onClick"],Rre=["disabled","onClick"],Dre=Qe({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=xt(),o=e,s=t;function i(){s("update:modelValue",!1)}function r($){s("select",$),i()}function l($){s("createInWorkspace",$),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=te(new Set);function d($){return u.value.has($)}function f($){const P=new Set(u.value);P.has($)?P.delete($):P.add($),u.value=P,h.value=null,y.value=null}function g($){return o.attentionByWorkspace[$]??0}const h=te(null),m=te(null);let _;function w($){h.value=h.value===$?null:$,y.value=null,clearTimeout(_),m.value=null}function k($){h.value=null;const T=(typeof window<"u"?window.prompt(n("sidebar.rename"),$.title):null)?.trim();T&&s("rename",$.id,T)}function b($){if(m.value===$){clearTimeout(_),m.value=null,h.value=null,s("archive",$);return}clearTimeout(_),m.value=$,_=setTimeout(()=>{m.value=null},2500)}const y=te(null),x=te(null);let L;function N($){y.value=y.value===$?null:$,h.value=null,clearTimeout(L),x.value=null}function v($){wo($.root),y.value=null}function M($){if(x.value===$){clearTimeout(L),x.value=null,y.value=null,s("deleteWorkspace",$);return}clearTimeout(L),x.value=$,L=setTimeout(()=>{x.value=null},2500)}return Yt(()=>{clearTimeout(_),clearTimeout(L)}),($,P)=>(C(),Ve(r3,{"model-value":e.modelValue,"onUpdate:modelValue":P[2]||(P[2]=T=>s("update:modelValue",T))},{default:In(()=>[p("button",{type:"button",class:"newrow",onClick:a},[P[3]||(P[3]=p("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"},[p("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)),ft(" "+O(S(n)("sidebar.newChat")),1)]),p("button",{type:"button",class:"newrow secondary",onClick:c},[P[4]||(P[4]=p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[p("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"}),p("path",{d:"M1 5.5h12"})],-1)),ft(" "+O(S(n)("sidebar.newWorkspace")),1)]),p("div",gre,[e.groups.length===0?(C(),E("div",vre,O(S(n)("workspace.noWorkspace")),1)):ie("",!0),(C(!0),E(Pe,null,Xe(e.groups,T=>(C(),E("div",{key:T.workspace.id,class:"mgroup"},[p("div",{class:Oe(["mgh",{on:T.workspace.id===e.activeWorkspaceId}]),onClick:I=>f(T.workspace.id)},[(C(),E("svg",kre,[d(T.workspace.id)?(C(),E(Pe,{key:0},[P[5]||(P[5]=p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),P[6]||(P[6]=p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(C(),E(Pe,{key:1},[P[7]||(P[7]=p("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)),P[8]||(P[8]=p("path",{d:"M1 5.5h12"},null,-1))],64))])),p("div",bre,[p("span",wre,O(T.workspace.name),1),p("span",{class:"mgh-path",title:T.workspace.root},O(T.workspace.branch||T.workspace.shortPath),9,_re)]),d(T.workspace.id)&&g(T.workspace.id)>0?(C(),E("span",Cre,O(g(T.workspace.id)),1)):ie("",!0),p("button",{type:"button",class:"mgh-more",title:S(n)("sidebar.options"),"aria-label":S(n)("sidebar.options"),onClick:Ze(I=>N(T.workspace.id),["stop"])},[...P[9]||(P[9]=[p("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,Sre),p("button",{type:"button",class:"mgh-add",title:S(n)("workspace.newInGroup"),"aria-label":S(n)("workspace.newInGroup"),onClick:Ze(I=>l(T.workspace.id),["stop"])},"+",8,xre),y.value===T.workspace.id?(C(),E("div",{key:1,class:"kmenu wsmenu",onClick:P[0]||(P[0]=Ze(()=>{},["stop"]))},[p("button",{class:"kitem",onClick:Ze(I=>v(T.workspace),["stop"])},O(S(n)("sidebar.copyPath")),9,Tre),p("button",{class:"kitem archive",onClick:Ze(I=>M(T.workspace.id),["stop"])},O(x.value===T.workspace.id?S(n)("sidebar.confirm"):S(n)("sidebar.delete")),9,Are)])):ie("",!0)],10,yre),jt(p("div",null,[T.sessions.length===0?(C(),E("div",Mre,O(S(n)("sidebar.noSessions")),1)):ie("",!0),(C(!0),E(Pe,null,Xe(T.sessions,I=>(C(),E("div",{key:I.id,class:Oe(["srow",{cur:I.id===e.activeId}]),onClick:R=>r(I.id)},[p("div",Ire,[p("div",{class:Oe(["t",{run:I.busy,aborted:I.status==="aborted"}])},O(I.title),3),p("div",$re,O(I.time),1)]),(e.attentionBySession[I.id]??0)>0?(C(),E("span",Nre,O(e.attentionBySession[I.id]),1)):ie("",!0),p("button",{type:"button",class:"kb",title:S(n)("sidebar.options"),onClick:Ze(R=>w(I.id),["stop"])},[...P[10]||(P[10]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,Lre),h.value===I.id?(C(),E("div",{key:1,class:"kmenu",onClick:P[1]||(P[1]=Ze(()=>{},["stop"]))},[p("button",{class:"kitem",onClick:Ze(R=>k(I),["stop"])},O(S(n)("sidebar.rename")),9,Ore),p("button",{class:"kitem archive",onClick:Ze(R=>b(I.id),["stop"])},O(m.value===I.id?S(n)("sidebar.archiveConfirm"):S(n)("sidebar.archive")),9,Pre)])):ie("",!0)],10,Ere))),128)),T.hasMore||T.loadingMore?(C(),E("button",{key:1,type:"button",class:"mshow-more",disabled:T.loadingMore,onClick:Ze(I=>s("loadMore",T.workspace.id),["stop"])},O(T.loadingMore?S(n)("sidebar.loadingMore"):S(n)("sidebar.showMore",{count:Math.max(0,T.workspace.sessionCount-T.sessions.length)})),9,Rre)):ie("",!0)],512),[[js,!d(T.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),Bre=bt(Dre,[["__scopeId","data-v-d8b693db"]]),Fre={class:"srow-main"},Hre={class:"srow-label"},Wre={class:"srow-sub"},Ure={class:"srow-main"},qre={class:"srow-label"},jre={class:"srow-val"},zre={class:"srow-main"},Vre={class:"srow-label"},Kre={class:"srow-sub"},Gre=["aria-checked"],Yre={class:"srow-main"},Xre={class:"srow-label"},Qre={class:"srow-sub"},Zre=["aria-checked"],Jre={class:"srow-main"},ele={class:"srow-label"},tle={class:"srow read-only"},nle={class:"srow-main"},ole={class:"srow-label"},sle={class:"srow-sub"},ile=["aria-label"],rle={class:"srow read-only pref"},lle={class:"srow-main"},ale={class:"srow-label"},cle=["aria-label"],ule=["aria-pressed"],dle=["aria-pressed"],fle={class:"srow read-only pref"},hle={class:"srow-main"},ple={class:"srow-label"},mle=["aria-label"],gle=["aria-pressed"],vle=["aria-pressed"],yle=["aria-pressed"],kle={class:"srow read-only pref"},ble={class:"srow-main"},wle={class:"srow-label"},_le={class:"srow read-only pref"},Cle={class:"srow-main"},Sle={class:"srow-label"},xle={class:"num-field"},Tle=["value","aria-label"],Ale={class:"srow-main"},Mle={class:"srow-label"},Ele={class:"srow-sub"},Ile=["aria-checked"],$le={class:"srow-main"},Nle={class:"srow-label"},Lle={class:"srow-main"},Ole={class:"srow-label"},Ple={key:2,class:"srow read-only"},Rle={class:"srow-main"},Dle={class:"srow-label"},Ble={class:"srow-val dim"},Fle=Qe({__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},serverVersion:{default:""}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setTheme","setColorScheme","setUiFontSize","setBetaToc","login","logout"],setup(e,{emit:t}){const{t:n}=xt(),o=e,s=t,i=["manual","auto","yolo"],r=H(()=>o.thinking??"high"),l=H(()=>o.planMode===!0),a=H(()=>o.swarmMode===!0),c=H(()=>{const b=o.status.permission;return b==="yolo"?"var(--err)":b==="auto"?"var(--warn)":"var(--faint)"}),u=H(()=>{const b=o.status.permission,y=n(b==="yolo"?"mobile.permYoloSub":b==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${b} · ${y}`}),d=b=>`${Math.round(b/1e3)}k`,f=H(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(o.status.ctxUsed/o.status.ctxMax*100))):0),g=H(()=>o.status.ctxMax>0?`${d(o.status.ctxUsed)}/${d(o.status.ctxMax)}`:n("status.statusNone"));function h(){s("setThinking",r.value==="off"?"high":"off")}function m(){const b=i.indexOf(o.status.permission),y=i[(b+1)%i.length];s("setPermission",y)}function _(){s("pickModel"),s("update:modelValue",!1)}function w(){s("login"),s("update:modelValue",!1)}function k(){s("logout"),s("update:modelValue",!1)}return(b,y)=>(C(),Ve(r3,{"model-value":e.modelValue,title:S(n)("mobile.settingsTitle"),"onUpdate:modelValue":y[9]||(y[9]=x=>s("update:modelValue",x))},{default:In(()=>[p("button",{type:"button",class:"srow",onClick:_},[p("span",Fre,[p("span",Hre,O(S(n)("status.statusModel")),1),p("span",Wre,O(e.status.model),1)]),y[10]||(y[10]=p("span",{class:"chev"},"›",-1))]),p("button",{type:"button",class:"srow",onClick:h},[p("span",Ure,[p("span",qre,O(S(n)("status.statusThinking")),1)]),p("span",jre,O(r.value==="off"?S(n)("status.planOff"):S(n)("status.planOn")),1),y[11]||(y[11]=p("span",{class:"chev"},"›",-1))]),p("button",{type:"button",class:"srow",onClick:y[0]||(y[0]=x=>s("togglePlan"))},[p("span",zre,[p("span",Vre,O(S(n)("status.statusPlanMode")),1),p("span",Kre,O(S(n)("mobile.planModeSub")),1)]),p("span",{class:Oe(["toggle",{on:l.value}]),role:"switch","aria-checked":l.value},null,10,Gre)]),p("button",{type:"button",class:"srow",onClick:y[1]||(y[1]=x=>s("toggleSwarm"))},[p("span",Yre,[p("span",Xre,O(S(n)("status.statusSwarmMode")),1),p("span",Qre,O(S(n)("mobile.swarmModeSub")),1)]),p("span",{class:Oe(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,Zre)]),p("button",{type:"button",class:"srow",onClick:m},[p("span",Jre,[p("span",ele,O(S(n)("status.statusPermission")),1),p("span",{class:"srow-sub",style:Wt({color:c.value})},O(u.value),5)]),y[12]||(y[12]=p("span",{class:"chev"},"›",-1))]),p("div",tle,[p("span",nle,[p("span",ole,O(S(n)("status.statusContext")),1),p("span",sle,O(g.value),1)]),p("span",{class:"ctx-meter","aria-label":g.value},[p("i",{style:Wt({width:f.value+"%"})},null,4)],8,ile)]),p("div",rle,[p("span",lle,[p("span",ale,O(S(n)("theme.label")),1)]),p("div",{class:"seg",role:"group","aria-label":S(n)("theme.label")},[p("button",{type:"button",class:Oe(["seg-opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:y[2]||(y[2]=x=>s("setTheme","modern"))},O(S(n)("theme.modern")),11,ule),p("button",{type:"button",class:Oe(["seg-opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:y[3]||(y[3]=x=>s("setTheme","kimi"))},O(S(n)("theme.kimi")),11,dle)],8,cle)]),p("div",fle,[p("span",hle,[p("span",ple,O(S(n)("theme.colorSchemeLabel")),1)]),p("div",{class:"seg",role:"group","aria-label":S(n)("theme.colorSchemeLabel")},[p("button",{type:"button",class:Oe(["seg-opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:y[4]||(y[4]=x=>s("setColorScheme","light"))},O(S(n)("theme.light")),11,gle),p("button",{type:"button",class:Oe(["seg-opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:y[5]||(y[5]=x=>s("setColorScheme","dark"))},O(S(n)("theme.dark")),11,vle),p("button",{type:"button",class:Oe(["seg-opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:y[6]||(y[6]=x=>s("setColorScheme","system"))},O(S(n)("theme.system")),11,yle)],8,mle)]),p("div",kle,[p("span",ble,[p("span",wle,O(S(n)("sidebar.language")),1)]),vt(s3)]),p("div",_le,[p("span",Cle,[p("span",Sle,O(S(n)("settings.uiFontSize")),1)]),p("label",xle,[p("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":S(n)("settings.uiFontSize"),onInput:y[7]||(y[7]=x=>s("setUiFontSize",Number(x.target.value)))},null,40,Tle),y[13]||(y[13]=p("span",{class:"num-unit"},"px",-1))])]),p("button",{type:"button",class:"srow",onClick:y[8]||(y[8]=x=>s("setBetaToc",!e.betaToc))},[p("span",Ale,[p("span",Mle,O(S(n)("settings.betaToc")),1),p("span",Ele,O(S(n)("settings.betaTocHint")),1)]),p("span",{class:Oe(["toggle",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc},null,10,Ile)]),e.authReady?(C(),E("button",{key:0,type:"button",class:"srow acct out",onClick:k},[p("span",$le,[p("span",Nle,O(S(n)("sidebar.signOut")),1)])])):(C(),E("button",{key:1,type:"button",class:"srow acct in",onClick:w},[p("span",Lle,[p("span",Ole,O(S(n)("sidebar.signIn")),1)])])),e.serverVersion?(C(),E("div",Ple,[p("span",Rle,[p("span",Dle,O(S(n)("settings.serverVersion")),1)]),p("span",Ble,O(e.serverVersion),1)])):ie("",!0)]),_:1},8,["model-value","title"]))}}),Hle=bt(Fle,[["__scopeId","data-v-33721a82"]]),Wle={class:"ob-backdrop"},Ule=["aria-label"],qle=["aria-label"],jle={class:"ob-brand"},zle={class:"ob-title"},Vle={class:"ob-sub"},Kle={class:"ob-sec"},Gle={class:"ob-label"},Yle={class:"ob-seg",role:"group"},Xle=["aria-pressed","onClick"],Qle={class:"ob-sec"},Zle={class:"ob-label"},Jle={class:"ob-themes"},eae=["aria-pressed"],tae={class:"ob-theme-name"},nae={class:"ob-theme-desc"},oae=["aria-pressed"],sae={class:"ob-theme-name"},iae={class:"ob-theme-desc"},rae=Qe({__name:"Onboarding",props:{theme:{}},emits:["setTheme","complete","skip"],setup(e,{emit:t}){const n=e,o=t,{t:s,locale:i}=xt();function r(c){i.value!==c&&px(c)}const l=te(n.theme);function a(){l.value!==n.theme&&o("setTheme",l.value),o("complete")}return(c,u)=>(C(),E("div",Wle,[p("div",{class:"ob-card",role:"dialog","aria-modal":"true","aria-label":S(s)("onboarding.title")},[p("button",{type:"button",class:"ob-close","aria-label":S(s)("onboarding.skip"),onClick:u[0]||(u[0]=d=>o("skip"))},[...u[3]||(u[3]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[p("path",{d:"M4 4l8 8M12 4l-8 8"})],-1)])],8,qle),p("div",jle,[u[4]||(u[4]=p("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[p("defs",null,[p("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[p("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),p("g",{class:"ob-eyes",fill:"#000"},[p("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),p("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),p("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--blue)",mask:"url(#obKimiEyes)"})],-1)),p("div",null,[p("div",zle,O(S(s)("onboarding.title")),1),p("div",Vle,O(S(s)("onboarding.subtitle")),1)])]),p("section",Kle,[p("div",Gle,O(S(s)("onboarding.languageLabel")),1),p("div",Yle,[(C(!0),E(Pe,null,Xe(S(hx),d=>(C(),E("button",{key:d.code,type:"button",class:Oe(["ob-seg-btn",{on:S(i)===d.code}]),"aria-pressed":S(i)===d.code,onClick:f=>r(d.code)},O(d.label),11,Xle))),128))])]),p("section",Qle,[p("div",Zle,O(S(s)("onboarding.themeLabel")),1),p("div",Jle,[p("button",{type:"button",class:Oe(["ob-theme",{on:l.value==="modern"}]),"aria-pressed":l.value==="modern",onClick:u[1]||(u[1]=d=>l.value="modern")},[u[5]||(u[5]=p("span",{class:"ob-theme-prev modern","aria-hidden":"true"},[p("span",{class:"bub u"}),p("span",{class:"bub a"})],-1)),p("span",tae,O(S(s)("theme.modern")),1),p("span",nae,O(S(s)("onboarding.modernDesc")),1)],10,eae),p("button",{type:"button",class:Oe(["ob-theme",{on:l.value==="kimi"}]),"aria-pressed":l.value==="kimi",onClick:u[2]||(u[2]=d=>l.value="kimi")},[u[6]||(u[6]=p("span",{class:"ob-theme-prev kimi","aria-hidden":"true"},[p("span",{class:"kb u"}),p("span",{class:"kb a"})],-1)),p("span",sae,O(S(s)("theme.kimi")),1),p("span",iae,O(S(s)("onboarding.kimiDesc")),1)],10,oae)])]),p("button",{type:"button",class:"ob-start",onClick:a},O(S(s)("onboarding.start")),1)],8,Ule)]))}}),lae=bt(rae,[["__scopeId","data-v-0527a631"]]),aae=["aria-label"],cae={class:"gload-box"},uae={class:"gload-text"},dae=Qe({__name:"GlobalLoading",setup(e){const{t}=xt();return(n,o)=>(C(),E("div",{class:"gload",role:"status","aria-label":S(t)("app.connecting")},[p("div",cae,[o[0]||(o[0]=_r('<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)),p("div",uae,O(S(t)("app.connecting")),1)])],8,aae))}}),fae=bt(dae,[["__scopeId","data-v-d8748888"]]),hae={class:"kap-root"},pae={class:"kap-head"},mae={class:"kap-count"},gae={class:"kap-head-actions"},vae={class:"kap-filters"},yae=["value"],kae={class:"kap-check"},bae={class:"kap-check"},wae={class:"kap-view-toggle",role:"group"},_ae={key:0,class:"kap-empty"},Cae=["onClick"],Sae={class:"kap-ts"},xae={class:"kap-label"},Tae={key:0,class:"kap-detail"},Aae={class:"kap-detail-actions"},Mae=["onClick"],Eae={key:1,class:"kap-agg"},Iae={class:"mono"},$ae={class:"mono"},Nae={class:"num"},Lae={class:"num"},Oae={key:0},Pae={class:"mono"},Rae={class:"num"},Dae={class:"num"},Bae={key:0},Fae=Qe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=te("all"),s=te(""),i=te(""),r=te(!1),l=te("timeline"),a=H(()=>(d0.value,[...One()])),c=H(()=>{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=H(()=>{const M=s.value.trim().toLowerCase();return a.value.filter($=>!(o.value!=="all"&&$.source!==o.value||i.value&&$.sessionId!==i.value||r.value&&!u($)||M&&!`${$.label} ${$.kind} ${$.eventType??""} ${$.sessionId??""} ${$.requestId??""}`.toLowerCase().includes(M)))}),f=H(()=>{const M=new Map;for(const $ of d.value){if($.kind!=="ws:in"&&$.kind!=="ws:out")continue;const P=$.kind==="ws:in"?"←":"→",T=`${P} ${$.eventType??"?"} @ ${$.sessionId??"-"}`,I=M.get(T)??{key:T,sessionId:$.sessionId??"-",eventType:$.eventType??"?",dir:P,count:0};I.count++,$.seq!==void 0&&(I.lastSeq=$.seq),M.set(T,I)}return[...M.values()].sort(($,P)=>P.count-$.count)}),g=H(()=>{const M=new Map;for(const $ of d.value){if($.source!=="rest"||$.kind==="rest:request")continue;const P=`${$.method??"?"} ${$.path??"?"}`,T=M.get(P)??{count:0,errors:0,totalMs:0,timed:0};T.count++,u($)&&T.errors++,$.durationMs!==void 0&&(T.totalMs+=$.durationMs,T.timed++),M.set(P,T)}return[...M.entries()].map(([$,P])=>({key:$,count:P.count,errors:P.errors,avgMs:P.timed>0?Math.round(P.totalMs/P.timed):0})).sort(($,P)=>P.count-$.count)}),h=te(null),m=te(!0),_=te(null),w=te(null);ze(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await ht();const M=_.value;M&&(M.scrollTop=M.scrollHeight)});function k(M){h.value=h.value===M?null:M}function b(M){const $=new Date(M),P=(T,I=2)=>String(T).padStart(I,"0");return`${P($.getHours())}:${P($.getMinutes())}:${P($.getSeconds())}.${P($.getMilliseconds(),3)}`}function y(M){return JSON.stringify(M,null,2)}async function x(M){await wo(y(M))&&(w.value=M.id,setTimeout(()=>{w.value===M.id&&(w.value=null)},1500))}function L(){i3(d.value)}function N(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 v(M){return M.source==="rest"?"REST":M.source==="client"?"APP":"WS"}return(M,$)=>(C(),E("section",hae,[p("header",pae,[$[11]||($[11]=p("strong",null,"KAP debug",-1)),p("span",mae,O(d.value.length)+"/"+O(a.value.length),1),p("div",gae,[p("button",{type:"button",class:Oe({on:S(vc)}),onClick:$[0]||($[0]=P=>vc.value=!S(vc))},O(S(vc)?"resume":"pause"),3),p("button",{type:"button",onClick:$[1]||($[1]=P=>S(Pne)())},"clear"),p("button",{type:"button",onClick:$[2]||($[2]=P=>L())},"export jsonl"),p("button",{type:"button",title:"Close window",onClick:$[3]||($[3]=P=>n("close"))},"✕")])]),p("div",vae,[jt(p("select",{"onUpdate:modelValue":$[4]||($[4]=P=>o.value=P),"aria-label":"Source filter"},[...$[12]||($[12]=[p("option",{value:"all"},"rest + ws + app",-1),p("option",{value:"rest"},"rest",-1),p("option",{value:"ws"},"ws",-1),p("option",{value:"client"},"app errors",-1)])],512),[[yf,o.value]]),jt(p("select",{"onUpdate:modelValue":$[5]||($[5]=P=>i.value=P),"aria-label":"Session filter"},[$[13]||($[13]=p("option",{value:""},"all sessions",-1)),(C(!0),E(Pe,null,Xe(c.value,P=>(C(),E("option",{key:P,value:P},O(P),9,yae))),128))],512),[[yf,i.value]]),jt(p("input",{"onUpdate:modelValue":$[6]||($[6]=P=>s.value=P),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[Wn,s.value]]),p("label",kae,[jt(p("input",{"onUpdate:modelValue":$[7]||($[7]=P=>r.value=P),type:"checkbox"},null,512),[[vf,r.value]]),$[14]||($[14]=ft(" errors",-1))]),p("label",bae,[jt(p("input",{"onUpdate:modelValue":$[8]||($[8]=P=>m.value=P),type:"checkbox"},null,512),[[vf,m.value]]),$[15]||($[15]=ft(" follow",-1))]),p("div",wae,[p("button",{type:"button",class:Oe({on:l.value==="timeline"}),onClick:$[9]||($[9]=P=>l.value="timeline")},"timeline",2),p("button",{type:"button",class:Oe({on:l.value==="aggregate"}),onClick:$[10]||($[10]=P=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(C(),E("div",{key:0,ref_key:"listRef",ref:_,class:"kap-list"},[d.value.length===0?(C(),E("div",_ae," No trace entries yet. REST calls and WS frames will appear here. ")):ie("",!0),(C(!0),E(Pe,null,Xe(d.value,P=>(C(),E("div",{key:P.id,class:"kap-row-wrap"},[p("button",{type:"button",class:Oe(["kap-row",{expanded:h.value===P.id}]),onClick:T=>k(P.id)},[p("span",Sae,O(b(P.ts)),1),p("span",{class:Oe(["kap-badge",N(P)])},O(v(P)),3),p("span",xae,O(P.label),1)],10,Cae),h.value===P.id?(C(),E("div",Tae,[p("div",Aae,[p("button",{type:"button",onClick:T=>x(P)},O(w.value===P.id?"copied ✓":"copy json"),9,Mae)]),p("pre",null,O(y(P)),1)])):ie("",!0)]))),128))],512)):(C(),E("div",Eae,[$[20]||($[20]=p("h4",null,"WS frames by session / type",-1)),p("table",null,[$[17]||($[17]=p("thead",null,[p("tr",null,[p("th",null,"dir"),p("th",null,"type"),p("th",null,"session"),p("th",null,"count"),p("th",null,"last seq")])],-1)),p("tbody",null,[(C(!0),E(Pe,null,Xe(f.value,P=>(C(),E("tr",{key:P.key},[p("td",null,O(P.dir),1),p("td",Iae,O(P.eventType),1),p("td",$ae,O(P.sessionId),1),p("td",Nae,O(P.count),1),p("td",Lae,O(P.lastSeq??"—"),1)]))),128)),f.value.length===0?(C(),E("tr",Oae,[...$[16]||($[16]=[p("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ie("",!0)])]),$[21]||($[21]=p("h4",null,"REST by endpoint",-1)),p("table",null,[$[19]||($[19]=p("thead",null,[p("tr",null,[p("th",null,"endpoint"),p("th",null,"count"),p("th",null,"errors"),p("th",null,"avg ms")])],-1)),p("tbody",null,[(C(!0),E(Pe,null,Xe(g.value,P=>(C(),E("tr",{key:P.key},[p("td",Pae,O(P.key),1),p("td",Rae,O(P.count),1),p("td",{class:Oe(["num",{err:P.errors>0}])},O(P.errors),3),p("td",Dae,O(P.avgMs),1)]))),128)),g.value.length===0?(C(),E("tr",Bae,[...$[18]||($[18]=[p("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ie("",!0)])])]))]))}}),Hae=bt(Fae,[["__scopeId","data-v-79eb55ae"]]),Wae=["title"],Uae=Qe({__name:"DebugPanel",setup(e){const t=te(!1);let n=null,o=null,s=null;const i=["data-theme","data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const g of i){const h=d.getAttribute(g);h!==null?f.setAttribute(g,h):f.removeAttribute(g)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const h of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(h.cloneNode(!0));r(d),d.body.style.margin="0";const g=d.createElement("div");return g.style.height="100vh",d.body.appendChild(g),g}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=kf(Hae,{onClose:()=>u.close()});f.mount(d),o=f,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return rn(()=>{c()}),Yo(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(C(),E("button",{class:"kap-fab",type:"button",title:t.value?"Focus KAP debug window":"Open KAP debug window",onClick:c}," KAP ",8,Wae))}}),qae=bt(Uae,[["__scopeId","data-v-0a50ee88"]]);function l3(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 R1(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 jae(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 ii(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:R1(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:l3(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 Zf(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 N2(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 f0(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:N2(e.source)};case"video":return{type:"video",source:N2(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 D1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(f0),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function zae(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 Vae(e){return{content:e.content.map(zae),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 Kae(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function a3(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 Gae(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Yae(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Gae),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function c3(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Yae),createdAt:e.created_at}}function Xae(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 Qae(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=Xae(o);return{answers:t,method:e.method,note:e.note}}function B1(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 L2(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 or(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Vl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function xs(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Zae(e){if(!e||typeof e!="object")return null;const t=e,n=or(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:or(t,"goalId")??or(t,"goal_id")??"goal",objective:or(t,"objective")??"",completionCriterion:or(t,"completionCriterion")??or(t,"completion_criterion"),status:n,turnsUsed:Vl(t,"turnsUsed")??Vl(t,"turns_used")??0,tokensUsed:Vl(t,"tokensUsed")??Vl(t,"tokens_used")??0,wallClockMs:Vl(t,"wallClockMs")??Vl(t,"wall_clock_ms")??0,terminalReason:or(t,"terminalReason")??or(t,"terminal_reason"),budget:{tokenBudget:xs(s,"tokenBudget")??xs(s,"token_budget"),remainingTokens:xs(s,"remainingTokens")??xs(s,"remaining_tokens"),turnBudget:xs(s,"turnBudget")??xs(s,"turn_budget"),remainingTurns:xs(s,"remainingTurns")??xs(s,"remaining_turns"),wallClockBudgetMs:xs(s,"wallClockBudgetMs")??xs(s,"wall_clock_budget_ms"),remainingWallClockMs:xs(s,"remainingWallClockMs")??xs(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Jae(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:ii(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:ii(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:Zf(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Zf(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:R1(t.payload.status),previousStatus:R1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:l3(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=Zae(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:D1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(f0),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:a3(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:c3(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:B1(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:F1(t.payload.config)};default:return{type:"unknown",raw:e}}}function ece(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function fg(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 F1(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,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 tce(e){return e.session_id}function nce(e){return e.seq}const oce="main",sce=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 cr(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 ice(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 O2(){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 is(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 Ts(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function rce(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=is(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=is(t,"goalId")??is(t,"goal_id")??"goal",r=is(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:is(t,"completionCriterion")??is(t,"completion_criterion"),status:s,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:is(t,"terminalReason")??is(t,"terminal_reason"),budget:{tokenBudget:Ts(o,"tokenBudget")??Ts(o,"token_budget"),remainingTokens:Ts(o,"remainingTokens")??Ts(o,"remaining_tokens"),turnBudget:Ts(o,"turnBudget")??Ts(o,"turn_budget"),remainingTurns:Ts(o,"remainingTurns")??Ts(o,"remaining_turns"),wallClockBudgetMs:Ts(o,"wallClockBudgetMs")??Ts(o,"wall_clock_budget_ms"),remainingWallClockMs:Ts(o,"remainingWallClockMs")??Ts(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function yc(e,t,n,o){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function lce(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=is(t,"name")??is(t,"toolName")??"tool",o=Sf(ace(n)),s=cce(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=is(n,"text");if(s)return hg(s);const i=is(n,"message");if(i)return hg(i)}const o=is(t,"message");if(o)return hg(o)}return null}function ace(e){return e.replace(/_\d+$/,"")}const P2=2e3;function hg(e){return e.length>P2?`${e.slice(0,P2)}…`:e}function cce(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Kg(e,n)}function uce(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];const r=lce(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=yc(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 Ed(e){return{...e,content:e.content.map(t=>({...t}))}}function R2(e,t,n){const o={id:cr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function dce(e,t,n,o,s,i){const r={id:o,sessionId:t,role:"user",content:s,createdAt:i,promptId:n};return e.messages.push(r),r}function fce(e){return Array.isArray(e)?e.map(t=>f0(t)):[]}function D2(e,t,n,o){const s=e.messages.find(r=>r.id===t);if(!s)return-1;const i=s.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=o:i.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function hce(e,t,n,o,s,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:i})}function pce(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:s}:null}function B2(e,t){e.messages.find(n=>n.id===t)}function mce(e,t,n,o,s,i){const r={id:cr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function pg(e,t){return e.messages.find(n=>n.id===t)}function F2(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 gce(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=O2(),e.set(u,d)),d}function o(u){e.set(u,O2())}function s(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){o(u);const f=n(u),g=d.promptId??cr("pr_");f.currentPromptId=g,f.turnPromptId.set(d.turnId,g);const h=R2(f,u,g);d.thinkingText.length>0&&h.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&h.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const _=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;h.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:_}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=h.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:g},{type:"messageCreated",message:Ed(h)}]}function l(u,d,f,g){try{return c(u,d,f,g)}catch(h){return console.error("[agentProjector] Error projecting event:",u,h instanceof Error?h.message:h),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,g){const h=n(f),m=d,_=[],w=m?.agentId;if(typeof w=="string"&&w!==oce){const k=t.has(w);if(k&&(u==="thinking.delta"||u==="assistant.delta")){const b=m?.delta??"";return b?[{type:"agentDelta",sessionId:f,agentId:w,delta:{[u==="thinking.delta"?"thinking":"text"]:b}}]:[]}if(k&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:w,reason:m?.reason}];if(sce.has(u))return uce(h,f,w,u,m??{},t)}switch(u){case"session.meta.updated":{const k=m?.patch?.title??m?.title,b=m?.patch?.lastPrompt,y={};typeof k=="string"&&k.length>0&&(y.title=k),typeof b=="string"&&(y.lastPrompt=b),(y.title!==void 0||y.lastPrompt!==void 0)&&_.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const k=m?.promptId,b=m?.userMessageId;if(!k||!b)break;const y=fce(m?.content);if(y.length===0)break;h.currentPromptId=k;const x=dce(h,f,k,b,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());_.push({type:"messageCreated",message:Ed(x)});break}case"turn.started":{const k=m?.turnId,b=h.currentPromptId??cr("pr_");h.currentPromptId=b,k!==void 0&&h.turnPromptId.set(k,b),h.turnTextLen=0,h.turnThinkLen=0,_.push({type:"sessionStatusChanged",sessionId:f,status:"running",previousStatus:"idle",currentPromptId:b});break}case"turn.step.started":{const k=m?.turnId;let b=h.turnPromptId.get(k)??h.currentPromptId;b||(b=cr("pr_"),h.currentPromptId=b,k!==void 0&&h.turnPromptId.set(k,b));const y=R2(h,f,b);h.currentAssistantMsgId=y.id,_.push({type:"messageCreated",message:Ed(y)});break}case"thinking.delta":{const k=h.currentAssistantMsgId;if(!k)break;const b=m?.delta??"";if(!b)break;g?.offset===0&&h.turnThinkLen>0&&(h.turnThinkLen=0);const y=a(h.turnThinkLen,g?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const x=D2(h,k,"thinking",b);if(x<0)break;h.turnThinkLen+=b.length,_.push({type:"assistantDelta",sessionId:f,messageId:k,contentIndex:x,delta:{thinking:b}});break}case"assistant.delta":{const k=h.currentAssistantMsgId;if(!k)break;const b=m?.delta??"";if(!b)break;g?.offset===0&&h.turnTextLen>0&&(h.turnTextLen=0);const y=a(h.turnTextLen,g?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const x=D2(h,k,"text",b);if(x<0)break;h.turnTextLen+=b.length,_.push({type:"assistantDelta",sessionId:f,messageId:k,contentIndex:x,delta:{text:b}});break}case"tool.use":case"tool.call.started":{const k=h.currentAssistantMsgId,b=m?.turnId,y=h.turnPromptId.get(b)??h.currentPromptId;if(!k||!y)break;const x=m?.toolCallId,L=m?.name??m?.toolName??"",N=m?.args??m?.input??{};hce(h,k,x,L,N);const v=pg(h,k);v&&v.content.length-1,h.toolStartTimes.set(x,Date.now()),v&&_.push({type:"messageUpdated",sessionId:f,messageId:k,content:v.content.map(M=>({...M})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const k=m?.toolCallId,b=pce(m??{});k&&b&&_.push({type:"toolOutput",sessionId:f,toolCallId:k,outputChunk:b.outputChunk,stream:b.stream});break}case"tool.result":{const k=m?.turnId;let b=h.turnPromptId.get(k)??h.currentPromptId;b||(b=cr("pr_"),h.currentPromptId=b,k!==void 0&&h.turnPromptId.set(k,b));const y=m?.toolCallId,x=m?.output,L=m?.isError??!1;h.toolStartTimes.get(y)??Date.now(),h.toolStartTimes.delete(y);const N=mce(h,f,y,x,L,b);_.push({type:"messageCreated",message:Ed(N)}),h.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const k=h.currentAssistantMsgId,b=ice(m?.usage);if(h.totalInput+=b.input,h.totalOutput+=b.output,h.totalCacheRead+=b.cacheRead,h.totalCacheCreate+=b.cacheCreate,k){B2(h,k);const y=pg(h,k);y&&_.push({type:"messageUpdated",sessionId:f,messageId:k,content:y.content.map(x=>({...x})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(h.model=m.model),m?.contextTokens!==void 0&&(h.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(h.contextLimit=m.maxContextTokens),_.push({type:"sessionUsageUpdated",sessionId:f,usage:F2(h),model:h.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const k=h.currentAssistantMsgId,b=m?.reason??"completed",y=Qr(m??{},"durationMs");if(k){B2(h,k);const N=pg(h,k);N&&_.push({type:"messageUpdated",sessionId:f,messageId:k,content:N.content.map(v=>({...v})),status:b==="failed"||b==="filtered"?"error":"completed",durationMs:y})}h.turnCount++;const x=F2(h);_.push({type:"sessionUsageUpdated",sessionId:f,usage:x});const L=b==="cancelled"||b==="failed"||b==="filtered"?"aborted":"idle";_.push({type:"sessionStatusChanged",sessionId:f,status:L,previousStatus:"running"}),h.currentAssistantMsgId=void 0,h.currentPromptId=void 0,h.turnTextLen=0,h.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{h.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const b={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:cr("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0};h.subagentMeta.set(b.id,b),_.push({type:"taskCreated",sessionId:f,task:b});break}case"subagent.started":{const k=yc(h,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});k&&_.push({type:"taskCreated",sessionId:f,task:k});break}case"subagent.suspended":{const k=yc(h,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});k&&_.push({type:"taskCreated",sessionId:f,task:k});break}case"subagent.completed":{const k=typeof m?.resultSummary=="string"?m.resultSummary:void 0,b=yc(h,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:k});b&&_.push({type:"taskCreated",sessionId:f,task:b}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:k});break}case"subagent.failed":{const k=typeof m?.error=="string"?m.error:void 0,b=yc(h,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:k});b&&_.push({type:"taskCreated",sessionId:f,task:b}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:k});break}case"error":{_.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{_.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const k=m?.info??{},b=typeof k.startedAt=="number"?new Date(k.startedAt).toISOString():void 0,y=typeof k.taskId=="string"?k.taskId:typeof k.taskId=="number"?String(k.taskId):cr("task_"),x=typeof k.description=="string"?k.description:typeof k.command=="string"?k.command:Cn.global.t("tasks.defaultDescription"),L=typeof k.command=="string"?k.command:void 0;_.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:x,command:L,status:"running",createdAt:b??new Date().toISOString(),startedAt:b,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"background.task.terminated":{const k=m?.info??{},b=k.status==="failed"||typeof k.exitCode=="number"&&k.exitCode!==0;_.push({type:"taskCompleted",sessionId:f,taskId:typeof k.taskId=="string"?k.taskId:typeof k.taskId=="number"?String(k.taskId):"",status:b?"failed":"completed"});break}case"compaction.completed":{const k=m?.result??{};_.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof k.tokensBefore=="number"?k.tokensBefore:void 0,tokensAfter:typeof k.tokensAfter=="number"?k.tokensAfter:void 0,summary:typeof k.summary=="string"?k.summary:void 0}),_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{_.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{_.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const k=rce(m?.snapshot??null);_.push({type:"goalUpdated",sessionId:f,goal:k?.status==="complete"?null:k});break}}return _}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const vce=new Set(["server_hello","ack","ping","resync_required","error","pong"]),H2=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"]),yce=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),kce=new Set(["assistant.delta","thinking.delta"]);function bce(e,t){if(vce.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return kce.has(o)?wce(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?yce.has(o)?{route:"protocol"}:H2.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:H2.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function wce(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 H1 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 kc 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 Cu(e){return e instanceof H1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function u3(e){return e instanceof kc||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const h0="kimi-web.server-credential",_ce="token";let au;const W1=new Set;function Cce(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(_ce);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function Sce(){try{return globalThis.sessionStorage?.getItem(h0)??void 0}catch{return}}function xce(){const e=Cce();return e?(f3(e),!0):(au=Sce(),au!==void 0)}function d3(){return au}function f3(e){au=e;try{globalThis.sessionStorage?.setItem(h0,e)}catch{}}function Tce(){au=void 0;try{globalThis.sessionStorage?.removeItem(h0)}catch{}}function Ace(e){return W1.add(e),()=>{W1.delete(e)}}function Mce(){Tce();for(const e of W1)try{e()}catch{}}const bc=3e4,h3="0123456789ABCDEFGHJKMNPQRSTVWXYZ",W2=500,Ece=40101;function U2(){try{return AbortSignal.timeout(bc)}catch{return}}function Ice(e,t){let n="",o=e;for(let s=0;s<t;s++)n=h3[o%32]+n,o=Math.floor(o/32);return n}function $ce(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=>h3[n%32]).join("")}function q2(){return`${Ice(Date.now(),10)}${$ce(16)}`}function Nce(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function j2(e){try{const t=await e.text();return t?t.length>W2?`${t.slice(0,W2)}...`:t:void 0}catch{return}}class Lce{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,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postForm(t,n){const o=Cf(this.origin,t),s=q2(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();M2({method:"POST",path:t,url:o,requestId:s,body:Nce(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:U2()})}catch(u){throw Md({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new kc({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:bc})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw Md({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new kc({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:bc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await j2(c)})}if(E2({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new H1({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,o,s,i=[]){let r=Cf(this.origin,n);if(s){const g=new URLSearchParams;for(const[m,_]of Object.entries(s))_!==void 0&&g.set(m,String(_));const h=g.toString();h&&(r=`${r}?${h}`)}const l=q2(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();M2({method:t,path:n,url:r,requestId:l,body:o});let u;try{u=await fetch(r,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:U2()})}catch(g){throw Md({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:g}),new kc({message:`Network error calling ${t} ${n}`,cause:g,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:bc})}let d;const f=u.clone();try{d=await u.json()}catch(g){throw Md({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:g}),new kc({message:`Failed to parse JSON response from ${t} ${n}`,cause:g,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:bc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await j2(f)})}if(E2({method:t,path:n,requestId:l,status:u.status,durationMs:Date.now()-c,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthRequired(u,d.code),d.code!==0&&!i.includes(d.code))throw new H1({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details});return d.data}addClientHeaders(t){const n=d3();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Kimi-Client-Id"]=this.identity.clientId,t["X-Kimi-Client-Name"]=this.identity.clientName,t["X-Kimi-Client-Version"]=this.identity.clientVersion,t["X-Kimi-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===Ece)&&Mce()}}const Oce="kimi-code.bearer.";class Pce{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;zl("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=d3(),n=t!==void 0?[`${Oce}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{zl("open")},o.onmessage=s=>{try{const i=JSON.parse(String(s.data));Dne(i),this.handleFrame(i)}catch(i){zl("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{zl("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{zl("close",s?{code:s.code,reason:s.reason,wasClean:s.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,zl("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,o){const s=Id(t,n),i=this.terminalAttachments.get(s),r=o??i?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(Id(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(Id(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 o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,i=n.seq,r=Id(o,s),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(o,s,a,i);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(o,s,r);break}default:{this.trackCursor(n);const o=n.type,s=bce(o,n.payload);if(s.route==="protocol"){this.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:s.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Rne(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Id(e,t){return`${e}\0${t}`}function mg(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 z2(e){return e==="auto_compact"||e==="manual_compact"}class Rce{http;config;constructor(t){this.config=t,this.http=new Lce(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?jae(t.status):void 0,include_archive:t?.includeArchive,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(ii),hasMore:o.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const o=await this.http.post("/sessions",n);return ii(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return ii(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.swarmMode!==void 0&&(s.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return ii(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 getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(D1),hasMore:s.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:ii(n.session),messages:n.messages.items.map(D1),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(o=>({toolCallId:o.tool_call_id,name:o.name,args:o.args,description:o.description,lastProgress:o.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(a3),pendingQuestions:n.pending_questions.map(c3)}}async submitPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Vae(n));return{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return ii(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return ii(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(ii)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Kae(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,Qae(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(B1)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return B1(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(mg)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return mg(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return mg(o)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),i=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([r,l])=>[r,l.map(L2)])):void 0;return{items:s.items.map(L2),childrenByPath:i,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async searchFiles(t,n){const o={query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,o);return{items:s.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return Cf(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,o,s){const i={app_id:n,path:o};s!==void 0&&(i.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Zf)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return Zf(o)}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(o=>({name:o.name,path:o.path,isDir:o.is_dir,isGitRepo:o.is_git_repo,branch:o.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(ece)}async listProviders(){return(await this.http.get("/providers")).items.map(fg)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const o=await this.http.post("/providers",n);return fg(o)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return fg(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 F1(t)}async setConfig(t){const n={},o={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=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return F1(s)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return Cf(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=s5(this.config.serverHttpUrl,this.config.clientId),o=gce(),s=new Pce(n,this.config.clientId,{onWireEvent:i=>{const r=tce(i),l=nce(i),a=Jae(i);a.type==="historyCompacted"&&!z2(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=o.project(r,c,a,{offset:u});for(const f of d)f.type==="historyCompacted"&&!z2(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},onResync:(i,r,l)=>{o.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},close(){s.close()}}}}let V2;function ct(){return V2??=new Rce(J6()),V2}function Dce(e){const t=new Map,n=new Set;function o(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&o(i)});return t.set(i,l),l}function s(i){if(t.has(i)){n.add(i);return}o(i)}return{run:o,request:s}}const Bce=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function Fce(e){return Bce.has(e.type)}function Hce(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Wce(e,t,n=Hce){let o=[],s=null;const i=()=>{if(s=null,o.length===0)return;const l=o;o=[];for(const a of l)e(a)},r=(l=>{if(t(l)){o.push(l),s===null&&(s=n(i));return}i(),e(l)});return r.flush=i,r}const p3=["blue","mono"],m3=["light","dark","system"],g3=15,Uce=12,qce=20;function jce(){const e=bn(Mt.accent);return e&&p3.includes(e)?e:"blue"}function zce(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Vce(){const e=bn(Mt.colorScheme);return e&&m3.includes(e)?e:"system"}function Kce(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";o.setAttribute("content",n??i)})}function Gce(){const e=bn(Mt.theme);return e==="terminal"||e==="modern"||e==="kimi"?e:"modern"}function Yce(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.theme=e)}function p0(e){return Number.isFinite(e)?Math.min(qce,Math.max(Uce,Math.round(e))):g3}function Xce(){const e=bn(Mt.uiFontSize);return e===null?g3:p0(Number(e))}function Qce(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${p0(e)}px`)}const Gh=te(Gce()),m0=te(Vce()),g0=te(jce()),v0=te(Xce());ze(Gh,Yce,{immediate:!0});ze(m0,Kce,{immediate:!0});ze(g0,zce,{immediate:!0});ze(v0,Qce,{immediate:!0});function v3(e){e!=="terminal"&&e!=="modern"&&e!=="kimi"||(Gh.value=e,Tn(Mt.theme,e))}function Zce(){v3(Gh.value==="modern"?"terminal":"modern")}function Jce(e){m3.includes(e)&&(m0.value=e,Tn(Mt.colorScheme,e))}function eue(e){p3.includes(e)&&(g0.value=e,Tn(Mt.accent,e))}function tue(e){const t=p0(e);v0.value=t,Tn(Mt.uiFontSize,String(t))}const nue=600,oue=250,Yh=250,sue=1e3,iue=160,Jf=te(!1);let tl=[],il=null,eh=-Yh;function rue(){tl=[],eh=-Yh,Jf.value=!1,il!==null&&(clearTimeout(il),il=null)}function lue(){Jf.value=!0,il!==null&&clearTimeout(il),il=setTimeout(()=>{il=null,tl=[],eh=-Yh,Jf.value=!1},sue)}function aue(e){if(e<=0)return;const t=Date.now();tl.push({time:t,chars:e});const n=t-nue;if(tl=tl.filter(l=>l.time>=n),t-eh<Yh)return;eh=t;const o=tl[0]?.time??t,s=Math.max(t-o,oue);tl.reduce((l,a)=>l+a.chars,0)/s*1e3>=iue&&lue()}function cue(){return{theme:Gh,colorScheme:m0,accent:g0,uiFontSize:v0,fastMoon:Jf,setTheme:v3,toggleTheme:Zce,setColorScheme:Jce,setAccent:eue,setUiFontSize:tue,resetFastMoon:rue,recordMoonDelta:aue}}function y3(e,t){const n=bn(e);return n===null?t:n==="1"}const y0=te(y3(Mt.notifyOnComplete,!0)),k0=te(y3(Mt.notifyOnQuestion,!1)),b0=te(typeof Notification<"u"?Notification.permission:"denied");async function k3(e,t,n){if(!n){e.value=!1,Tn(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}b0.value=o,o==="granted"&&(e.value=!0,Tn(t,"1"))}function uue(e){return k3(y0,Mt.notifyOnComplete,e)}function due(e){return k3(k0,Mt.notifyOnQuestion,e)}function b3(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{b0.value=i,i==="granted"&&K2(t,n,o)});return}K2(t,n,o)}}function K2(e,t,n){if(e.isActiveAndVisible)return;const o=e.sessionTitle.trim()||"Kimi Code";try{const s=new Notification(o,{body:t,tag:n});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function fue(e,t){b3(y0.value,t,Cn.global.t("settings.notifyBody"),`kimi-complete-${e}`)}function hue(e,t){const n=t.questionPreview||Cn.global.t("settings.notifyQuestionBody");b3(k0.value,t,n,`kimi-question-${e}`)}function pue(){return{notifyOnComplete:y0,notifyOnQuestion:k0,notifyPermission:b0,setNotifyOnComplete:uue,setNotifyOnQuestion:due,maybeNotifyCompletion:fue,maybeNotifyQuestion:hue}}function mue(){return bn(Mt.soundOnComplete)==="1"}const Su=te(mue());function gue(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let gg=null;function w3(){const e=gue();if(!e)return null;if(gg===null)try{gg=new e}catch{return null}return gg}function _3(){if(!Su.value)return;const e=w3();e!==null&&e.state==="suspended"&&e.resume().then(()=>{ar("sound: audio context resumed",{state:e.state})},t=>{ar("sound: audio context resume rejected",{error:String(t)})})}let G2=!1;function vue(){if(G2||typeof window>"u")return;G2=!0;const e=()=>{_3()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}vue();function yue(e){Su.value=e,Tn(Mt.soundOnComplete,e?"1":"0"),e&&_3()}function Y2(e,t,n,o,s){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(s,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+o),i.start(l),i.stop(l+o+.02)}function C3(){const e=w3();if(e===null){ar("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){ar("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{ar("sound: context resumed for next time",{state:e.state})},t=>{ar("sound: resume rejected",{error:String(t)})});return}try{Y2(e,880,0,.16,.18),Y2(e,1320,.1,.22,.16),ar("sound: chime scheduled",{state:e.state})}catch(t){ar("sound: failed to play",{error:String(t)})}}function kue(){Su.value&&C3()}function bue(){Su.value&&C3()}function wue(){return{soundOnComplete:Su,setSoundOnComplete:yue,maybePlayCompletionSound:kue,maybePlayQuestionSound:bue}}function X2(e,t){const n=new Set(e.map(s=>s.id)),o=t.filter(s=>s.kind==="subagent"&&!n.has(s.id));return o.length===0?e:[...e,...o]}const _ue=1e3,Cue=4096,Q2=32*1024;function Sue(e,t){let n=null,o;const s=new Set;async function i(f){try{const h=await ct().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:X2(h,e.tasksBySession[f]??[])},await r(f,h)}catch{}}async function r(f,g){if(e.activeSessionId!==f)return;const h=g??e.tasksBySession[f]??[],m=ct(),_=new Map;if(await Promise.all(h.map(async k=>{if((k.status==="completed"||k.status==="failed"||k.status==="cancelled")&&!s.has(k.id)&&!((k.outputLines?.length??0)>0))try{const y=await m.getTask(f,k.id,{withOutput:!0,outputBytes:Q2});y.outputPreview!==void 0&&_.set(k.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{s.add(k.id)}})),_.size===0)return;const w=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:w.map(k=>{const b=_.get(k.id);return b?{...k,outputPreview:b.preview,outputBytes:b.bytes}:k})}}async function l(f){if(e.activeSessionId!==f)return;const g=ct();let h;try{h=await g.listTasks(f)}catch{return}const m=new Map;await Promise.all(h.map(async b=>{const y=b.status==="running",x=b.status==="completed"||b.status==="failed"||b.status==="cancelled";if(!(!y&&!x)&&!(x&&(s.has(b.id)||(b.outputLines?.length??0)>0)))try{const L=await g.getTask(f,b.id,{withOutput:!0,outputBytes:y?Cue:Q2});L.outputPreview!==void 0&&m.set(b.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{x&&s.add(b.id)}}));const _=e.tasksBySession[f]??[],w=new Map(_.map(b=>[b.id,b])),k=h.map(b=>{const y=w.get(b.id),x=m.get(b.id);return{...b,outputLines:y?.outputLines,outputPreview:x?.preview??y?.outputPreview,outputBytes:x?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:X2(k,_)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},_ue))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=te(0);let d=null;return ze(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),ze(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const g=e.tasksBySession[f]??[];return{sid:f,hasRunning:g.some(h=>h.status==="running")}},({sid:f,hasRunning:g},h,m)=>{let _;g&&f!==void 0?a(f):f!==void 0?_=setTimeout(()=>{(e.tasksBySession[f]??[]).some(k=>k.status==="running")||c()},1500):c(),m(()=>{_!==void 0&&clearTimeout(_)})},{deep:!0,immediate:!0}),{taskClock:H(()=>u.value),loadTasksForSession:i}}const S3=Mt.starredModels;function xue(){try{const e=bn(S3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Tue(e){try{Tn(S3,JSON.stringify(e))}catch{}}function Aue(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=te([]),d=te(xue()),f=te({}),g=te([]),h=te(null);function m(F){if(!(F==null||F.length===0))return u.value.find(z=>z.id===F||z.model===F)}function _(){const F=e.activeSessionId?e.sessions.find(z=>z.id===e.activeSessionId):void 0;return m(F?.model??h.value??e.defaultModel)}function w(F){const z=b2(_(),F);return e.thinking=z,l(z),z}async function k(F){try{const V=await ct().listSkills(F);f.value={...f.value,[F]:V}}catch{}}async function b(){try{const F=ct();u.value=await F.listModels(),w(e.thinking)}catch(F){n("loadModels",F)}}async function y(){try{const F=await ct().refreshOAuthProviderModels();for(const z of F.failed)n("refreshOAuthProviderModels",new Error(z.reason),{message:z.provider})}catch{}}async function x(){try{const F=ct();g.value=await F.listProviders()}catch(F){n("loadProviders",F)}}async function L(F){const z=e.activeSessionId,V=b2(m(F),e.thinking),ne=e.thinking;if(!z){h.value=F,w(V);return}const K=e.sessions.find(G=>G.id===z)?.model;a(z,G=>({...G,model:F})),V!==ne&&(e.thinking=V,l(V));try{await ct().updateSession(z,{model:F,thinking:V!==ne?V:void 0})}catch(G){a(z,X=>({...X,model:K??X.model})),V!==ne&&(e.thinking=ne,l(ne)),n("setModel",G,{sessionId:z});return}await o(z)}function N(F){const z=new Set(d.value);z.has(F)?z.delete(F):z.add(F),d.value=Array.from(z),Tue(d.value)}async function v(F,z){const V=e.activeSessionId;if(!V)return;const ne=i.value==="idle"&&!r.has(V),K=`msg_skill_opt_${Date.now().toString(36)}`;if(ne){r.add(V),e.sendingBySession={...e.sendingBySession,[V]:!0};const G={id:K,sessionId:V,role:"user",content:[{type:"text",text:`/${F}${z?` ${z}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:F,skillArgs:z}}};c(V,X=>[...X,G])}try{await ct().activateSkill(V,F,z)}catch(G){ne&&(r.delete(V),e.sendingBySession={...e.sendingBySession,[V]:!1},c(V,X=>X.filter(be=>be.id!==K))),n("activateSkill",G,{sessionId:V})}}async function M(F){try{await ct().addProvider(F),await Promise.all([x(),b()])}catch(z){n("addProvider",z)}}async function $(F){try{await ct().deleteProvider(F),await Promise.all([x(),b()])}catch(z){n("deleteProvider",z)}}async function P(F){try{const V=await ct().refreshProvider(F);g.value=g.value.map(ne=>ne.id===F?V:ne)}catch(z){n("refreshProvider",z)}}async function T(){try{return await ct().startOAuthLogin()}catch{return null}}async function I(){try{return await ct().pollOAuthLogin()}catch{return null}}async function R(){try{await ct().cancelOAuthLogin()}catch{}}function D(F){const z=w(F);s({thinking:z})}return{models:u,starredModelIds:d,providers:g,draftModel:h,skillsBySession:f,loadSkillsForSession:k,loadModels:b,refreshOAuthProviderModels:y,loadProviders:x,setModel:L,toggleStarModel:N,activateSkill:v,addProvider:M,deleteProvider:$,refreshProvider:P,startOAuthLogin:T,pollOAuthLogin:I,cancelOAuthLogin:R,setThinking:D}}const x3="kimiWeb.compaction",Mue=/^read[_-]?media(?:file)?$/i,Eue=/^agent$/i,Iue=/^data:([^;]+);base64,(.*)$/s,$ue=/^<(image|video|audio)\s+path="([^"]+)">$/,Nue=/Mime type:\s*([^.\s]+)/i,Lue=/Size:\s*(\d+)\s*bytes/i,Oue=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Pue(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 Rue(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 Due(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const i=s.url;return typeof i=="string"?{kind:n,url:i}:null}function Bue(e,t){if(!Mue.test(e))return;const n=Rue(t);if(n===null)return;let o,s,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const g=d.text,h=$ue.exec(g);h&&(s=h[1],o=h[2]);const m=Nue.exec(g);m?.[1]&&(i=m[1]);const _=Lue.exec(g);_?.[1]&&(r=Number(_[1]));const w=Oue.exec(g);w?.[1]&&w[2]&&(l=`${w[1]}x${w[2]}`);continue}const f=Due(d);f&&(a=f)}if(a===null)return;const c=Iue.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Pue(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function T3(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
266
|
-
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
267
|
-
`));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
|
|
268
|
-
`)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
|
|
269
|
-
`)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Fue(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 Hue(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 Wue(e,t,n,o){const s=Hue(t),i=n?n.isError?"failed":"completed":o?"working":"completed",r=n?T3(n.output):void 0;return{id:e,toolCallId:e,name:s.description&&s.description.length>0?s.description:"Sub Agent",subagentType:s.subagentType,prompt:s.prompt,phase:i,status:n?n.isError?"failed":"completed":o?"running":"completed",summary:r&&r.length>0?r.join(`
|
|
270
|
-
`):void 0}}function Uue(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,o=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==o?n-o:e.createdAt.localeCompare(t.createdAt)}function que(e,t){const n=e.split(`
|
|
271
|
-
`),o=t.split(`
|
|
272
|
-
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function jue(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:que(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0};if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function zue(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 Vue(e){return e.metadata?.origin?.kind==="compaction_summary"}function Kue(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Gue(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function A3(e,t,n,o=!0,s=[],i={}){const r=[];let l=1;const a=new Map;for(const m of t)a.set(m.toolCallId,m);const c=new Map;for(const m of s){if(m.kind!=="subagent")continue;const _=[m.parentToolCallId,m.id].filter(w=>typeof w=="string"&&w.length>0);for(const w of _){const k=c.get(w)??[];k.push(m),c.set(w,k)}}for(const[m,_]of c.entries())c.set(m,_.toSorted(Uue));const u=new Map;for(const m of e)for(const _ of m.content)_.type==="toolResult"&&u.set(_.toolCallId,{output:_.output,isError:!!_.isError});let d=null;function f(m=!1){if(!d)return;const _=d;if(d=null,!m||!o)for(let w=0;w<_.tools.length;w++){const k=_.tools[w];if(k.status!=="running")continue;const b={...k,status:"ok"};_.tools[w]=b;const y=_.blocks.find(x=>x.kind==="tool"&&x.tool.id===b.id);y&&y.kind==="tool"&&(y.tool=b)}r.push({id:_.id,role:"assistant",no:l++,text:_.textParts.join(`
|
|
273
|
-
`),thinking:_.thinkingParts.length>0?_.thinkingParts.join(`
|
|
274
|
-
`):void 0,tools:_.tools.length>0?_.tools:void 0,blocks:_.blocks.length>0?_.blocks:void 0,approval:_.approval,approvalId:_.approvalId,durationMs:_.durationMs})}function g(m,_){for(const w of _)if(w.type==="text"){if(w.text){m.textParts.push(w.text);const k=m.blocks.at(-1);k&&k.kind==="text"?k.text+=`
|
|
275
|
-
`+w.text:m.blocks.push({kind:"text",text:w.text})}}else if(w.type==="thinking"){if(w.thinking){m.thinkingParts.push(w.thinking);const k=m.blocks.at(-1);k&&k.kind==="thinking"?k.thinking+=`
|
|
276
|
-
`+w.thinking:m.blocks.push({kind:"thinking",thinking:w.thinking})}}else if(w.type==="toolUse"){const k=c.get(w.toolCallId);if(k&&k.length>0){if(k.filter(N=>N.swarmIndex!==void 0).length>1)continue;const L=k.map(Fue);L.length===1?m.blocks.push({kind:"agent",member:L[0]}):m.blocks.push({kind:"agentGroup",members:L});continue}if(Eue.test(w.toolName)){const x=Wue(w.toolCallId,w.input,u.get(w.toolCallId),o);m.blocks.push({kind:"agent",member:x});continue}const b=a.get(w.toolCallId),y={id:w.toolCallId,name:w.toolName,arg:typeof w.input=="string"?w.input:JSON.stringify(w.input),status:"running",output:w.outputLines,planPath:w.toolName==="ExitPlanMode"?i[w.toolCallId]?.path:void 0};m.tools.push(y),m.blocks.push({kind:"tool",tool:y}),b&&(m.approval=jue(b),m.approvalId=b.approvalId)}else if(w.type==="toolResult"){const k=m.tools.findIndex(b=>b.id===w.toolCallId);if(k!==-1){const b=m.tools[k],y={...b,status:w.isError?"error":"ok",output:T3(w.output),media:w.isError?void 0:Bue(b.name,w.output)};y.name==="ExitPlanMode"&&!y.planPath&&(y.planPath=Gue(y.output)),m.tools[k]=y;const x=m.blocks.find(L=>L.kind==="tool"&&L.tool.id===w.toolCallId);x&&x.kind==="tool"&&(x.tool=y)}}}function h(m){if(m.type==="image"||m.type==="video"){const _=m.type,w=m.source;if(w.kind==="url")return{url:w.url,kind:_};if(w.kind==="base64")return{url:`data:${w.mediaType};base64,${w.data}`,kind:_};if(w.kind==="file"&&n)return{url:n(w.fileId),kind:_}}if(m.type==="file"&&n){if(m.mediaType.startsWith("image/"))return{url:n(m.fileId),kind:"image"};if(m.mediaType.startsWith("video/"))return{url:n(m.fileId),kind:"video"}}}for(const m of e){if(m.role==="system")continue;if(Vue(m)){f();const y=m.metadata?.[x3];r.push({id:m.id,role:"compaction",no:l,text:m.content.filter(x=>x.type==="text").map(x=>x.text).join(`
|
|
277
|
-
`),compaction:{trigger:y?.trigger,tokensBefore:y?.tokensBefore,tokensAfter:y?.tokensAfter}});continue}if(m.role==="user"){if(f(),!zue(m))continue;const y=m.metadata?.origin,x=y?.kind==="skill_activation"&&y?.trigger==="user-slash",L=[],N=[];for(const v of m.content){v.type==="text"&&(x?L.push(y.skillArgs??""):L.push(v.text));const M=h(v);M&&N.push({url:M.url,kind:M.kind,alt:v.type==="file"?v.name:void 0})}r.push({id:m.id,role:"user",no:l++,text:L.join(`
|
|
278
|
-
`),images:N.length>0?N:void 0,skillActivation:x?{name:y.skillName,args:y.skillArgs}:void 0,createdAt:m.createdAt});continue}if(m.role==="tool"){d&&g(d,m.content);continue}const _=m.promptId;Kue(d,_)?d!==null&&d.promptId===void 0&&_!==void 0&&(d.promptId=_):(f(),d={id:m.id,promptId:_,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:m.durationMs});const k=d;if(k===null)continue;const b=JSON.stringify(m.content);k.promptId!==void 0&&k.seenSigs.has(b)||(k.seenSigs.add(b),g(k,m.content))}return f(!0),r}function Yue(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i}=t,r=te({}),l=H(()=>{const N=e.activeSessionId;if(!N)return null;const v=r.value[N];return v?{parentId:N,agentId:v.agentId}:null}),a=H(()=>l.value?.parentId??null),c=H(()=>l.value!==null),u=H(()=>{const N=l.value;return N?!!e.sideChatSendingByAgent[N.agentId]:!1}),d=H(()=>{const N=l.value;return N?e.sideChatSendingByAgent[N.agentId]?!0:(e.tasksBySession[N.parentId]??[]).some(v=>v.id===N.agentId&&v.status==="running"):!1}),f=H(()=>{const N=l.value;if(!N)return[];const v=e.sideChatMessagesByAgent[N.agentId]??[];return A3(v,[],M=>ct().getFileUrl(M),d.value,[])});function g(N,v){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[N]:v(e.sideChatMessagesByAgent[N]??[])}}function h(N,v){g(N,M=>[...M,v])}function m(N){g(N,v=>{const M=[...v].reverse().findIndex(P=>P.role==="user");if(M===-1)return v;const $=v.length-1-M;return v.filter((P,T)=>T!==$)})}function _(N,v){g(N,M=>{const $=[...M];for(let P=$.length-1;P>=0;P-=1){const T=$[P];if(T.role==="user")return $[P]={...T,promptId:T.promptId??v},$}return M})}function w(N,v,M){M&&g(N,$=>{const P=$.at(-1);if(P?.role==="assistant"){const T=P.content[0],I=T?.type==="text"?T.text:"";return[...$.slice(0,-1),{...P,content:[{type:"text",text:`${I}${M}`}]}]}return[...$,{id:o(),sessionId:v,role:"assistant",content:[{type:"text",text:M}],createdAt:new Date().toISOString()}]})}function k(N,v,M){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[N]:!1},!M)return;const P=(e.sideChatMessagesByAgent[N]??[]).at(-1);(P?.role==="assistant"&&P.content[0]?.type==="text"?P.content[0].text:"").trim().length>0||w(N,v,M)}async function b(N){const v=e.activeSessionId;if(v){if(!r.value[v]){let M;try{({agentId:M}=await ct().startBtw(v))}catch($){n("openSideChat",$,{sessionId:v});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[M]:e.sideChatMessagesByAgent[M]??[]},r.value={...r.value,[v]:{agentId:M}},s(),i()?.markSideChannelAgent(M)}N&&N.trim()&&await x(N.trim())}}function y(){const N=e.activeSessionId;if(!N)return;const{[N]:v,...M}=r.value;r.value=M}async function x(N){const v=l.value,M=N.trim();if(!v||!M)return;const $=v.parentId,P=v.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!0};const T={id:o(),sessionId:$,role:"user",content:[{type:"text",text:M}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};h(P,T);try{const I=await ct().submitPrompt($,{content:[{type:"text",text:M}],agentId:P});_(P,I.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[$]:[...e.sideChatUserMessageIdsBySession[$]??[],I.userMessageId]}}catch(I){n("sendSideChatPrompt",I,{sessionId:$}),m(P),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!1}}}function L(N){if(!r.value[N])return;const{[N]:v,...M}=r.value;r.value=M}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:w,finishSideChatAgent:k,openSideChat:b,closeSideChat:y,sendSideChatPrompt:x,clearSideChatForSession:L}}function Xue(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 Que(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
|
|
279
|
-
`)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&Xue(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:i});continue}if(!s||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const U1="/sessions/";function Z2(e){const{pathname:t}=e;if(!t.startsWith(U1))return;const n=t.slice(U1.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function Zue(e){return e===void 0||e.length===0?"/":`${U1}${encodeURIComponent(e)}`}const Jue=50,ede=40402;function tde(e,t){const{taskPoller:n,sideChat:o,modelProvider:s,pushOperationFailure:i,activity:r,inFlightPromptSessions:l,sessionsKnownEmpty:a,setSessions:c,updateSession:u,upsertSessionFront:d,appendSession:f,forgetSession:g,setActiveSessionId:h,updateSessionMessages:m,nextOptimisticMsgId:_,getEventConn:w,syncSessionFromSnapshot:k,subscribeToSessionEvents:b,hasLoadedMessages:y,refreshSessionStatus:x,persistSessionProfile:L,mergedWorkspaces:N,workspacesView:v,status:M,workspaceIdForSession:$,savePermissionToStorage:P,savePlanModeToStorage:T,saveSwarmModeToStorage:I,saveGoalModeToStorage:R,saveUnread:D,saveActiveWorkspaceToStorage:F,saveHiddenWorkspacesToStorage:z,goalErrorMessage:V,basename:ne,resetFastMoon:K,initialized:G,selectedDiffPath:X,fileDiffLines:be,fileDiffLoading:le}=t;async function We(de){if(e.messagesLoadingMoreBySession[de])return;const Te=e.messagesBySession[de];if(!Te||Te.length===0)return;const Le=Te[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[de]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[de]:!1};try{const Me=await ct().listMessages(de,{beforeId:Le,pageSize:Jue}),J=[...Me.items].reverse();m(de,pe=>[...J,...pe]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[de]:Me.hasMore}}catch(Me){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[de]:!0},i("loadOlderMessages",Me,{sessionId:de})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[de]:!1}}}function ue(de){n.loadTasksForSession(de),Re(de),x(de),Object.prototype.hasOwnProperty.call(s.skillsBySession.value,de)||s.loadSkillsForSession(de)}async function ve(de){const Te=e.activeSessionId;if(Te){X.value=de,be.value=[],le.value=!0;try{const Me=await ct().getFileDiff(Te,de);if(X.value!==de)return;be.value=Que(Me.diff)}catch(Le){X.value===de&&(be.value=[]),console.warn("[loadFileDiff] diff unavailable for",de,Le)}finally{X.value===de&&(le.value=!1)}}}function Ne(){X.value=null,be.value=[],le.value=!1}async function Re(de){try{const Le=await ct().getGitStatus(de);e.gitStatusBySession={...e.gitStatusBySession,[de]:Le}}catch{}}async function Q(){try{const Te=await ct().getAuth();e.authReady=Te.ready,e.defaultModel=Te.defaultModel,e.managedProviderStatus=Te.managedProvider?.status??null}catch{}}async function ce(){try{const de=ct();e.config=await de.getConfig()}catch{}}async function Se(de){try{const Le=await ct().setConfig(de);return e.config=Le,e.defaultModel=Le.defaultModel??null,!0}catch(Te){return i("setConfig",Te),!1}}const q=100,ee=5,he=30;async function oe(){const de=ct(),Te=[];let Le;for(;;){const Me=await de.listSessions({pageSize:q,beforeId:Le,excludeEmpty:!0});if(Te.push(...Me.items),!Me.hasMore||Me.items.length===0)break;Le=Me.items[Me.items.length-1].id}return Te}async function fe(){const de=ct(),Te=e.workspaces;if(Te.length===0){const kt=await oe().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsFullyLoaded=!0,kt}const Le=await Promise.all(Te.map(kt=>de.listSessions({workspaceId:kt.id,pageSize:ee,excludeEmpty:!0}).then(Lt=>({workspaceId:kt.id,page:Lt})).catch(()=>({workspaceId:kt.id,page:{items:[],hasMore:!1}})))),Me=[],J={},pe={};for(const{workspaceId:kt,page:Lt}of Le)Me.push(...Lt.items),J[kt]=Lt.hasMore,pe[kt]=Lt.items.length>0?Lt.items[Lt.items.length-1].id:void 0;return e.sessionsHasMoreByWorkspace=J,e.sessionsCursorByWorkspace=pe,e.sessionsFullyLoaded=!1,Me.sort((kt,Lt)=>new Date(Lt.updatedAt).getTime()-new Date(kt.updatedAt).getTime()),Me}async function W(de){if(e.sessionsLoadingMoreByWorkspace[de]||e.sessionsHasMoreByWorkspace[de]===!1)return;const Te=e.sessionsCursorByWorkspace[de];if(Te!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[de]:!0};try{const Le=await ct().listSessions({workspaceId:de,pageSize:he,beforeId:Te,excludeEmpty:!0}),Me=new Set(e.sessions.map(pe=>pe.id)),J=Le.items.filter(pe=>!Me.has(pe.id));J.length>0&&c([...e.sessions,...J]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[de]:Le.items.length>0?Le.items[Le.items.length-1].id:Te},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[de]:Le.hasMore}}catch(Le){i("loadMoreSessions",Le)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[de]:!1}}}}async function Y(){if(e.sessionsFullyLoaded)return;const de=await oe().catch(()=>null);if(de===null)return;c(de),e.sessionsFullyLoaded=!0;const Te={};for(const Le of e.workspaces)Te[Le.id]=!1;e.sessionsHasMoreByWorkspace=Te}async function re(){e.loading=!0;try{const de=ct();await Promise.all([de.getHealth().catch(()=>null),de.getMeta().then(kt=>{e.serverVersion=kt.serverVersion,e.availableOpenInApps=kt.openInApps}).catch(()=>null),s.loadModels()]),await Q(),await ce(),await ge();const Te=await fe();c(Te);const Le=Te[0],Me=e.activeWorkspaceId;!(Me!==null&&N.value.some(kt=>kt.id===Me))&&Le&&xe($(Le)),Nt();const pe=typeof window<"u"?Z2(window.location):void 0;!e.activeSessionId&&pe!==void 0&&(e.sessions.some(Lt=>Lt.id===pe)||await Rt(pe))&&await Ft(pe,{urlMode:"replace"}),!e.activeSessionId&&Te.length>0&&await Ft(Te[0].id,{urlMode:"replace"})}catch(de){i("load",de)}finally{e.loading=!1,G.value=!0}}async function ge(){try{const de=ct(),[Te,Le]=await Promise.all([de.listWorkspaces().catch(()=>[]),de.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Te,e.fsHome=Le.home||null,e.recentRoots=Le.recentRoots}catch{}}function xe(de){e.activeWorkspaceId=de,F(de)}function $e(de){xe(de);const Te=e.sessions.filter(Le=>$(Le)===de);if(Te.length>0){const Le=Te[0];Le&&Le.id!==e.activeSessionId&&Ft(Le.id)}else h(void 0),lt(void 0,"push")}function se(de){e.hiddenWorkspaceRoots.includes(de.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(Me=>Me!==de.root),z(e.hiddenWorkspaceRoots));const Te=e.workspaces.findIndex(Me=>Me.id===de.id||Me.root===de.root);if(Te===-1){e.workspaces=[de,...e.workspaces];return}const Le=[...e.workspaces];Le[Te]=de,e.workspaces=Le}function ae(de){if(de.type==="workspaceCreated"||de.type==="workspaceUpdated"){se(de.workspace);return}const Te=e.workspaces.find(Me=>Me.id===de.workspaceId)?.root??de.root;if(Te&&!e.hiddenWorkspaceRoots.includes(Te)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Te],z(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Me=>Me.id!==de.workspaceId&&Me.root!==Te),e.activeWorkspaceId===de.workspaceId||e.activeWorkspaceId===Te){const Me=v.value[0]?.id??null;if(e.activeWorkspaceId=Me,Me)F(Me);else try{Zc(Mt.activeWorkspace)}catch{}h(void 0),e.sessionLoading=!1,Ne(),lt(void 0,"replace")}}function we(){h(void 0),lt(void 0,"push")}function qe(de){xe(de),we(),Ne()}async function nt(de,Te,Le){const Me=N.value.find(J=>J.id===de);if(Me)try{const J=ct();let pe,kt=Me.root;try{const hn=await J.addWorkspace({root:Me.root});pe=hn.id,kt=hn.root,se(hn)}catch{}const Lt=s.draftModel.value??void 0,eo=await J.createSession({workspaceId:pe,cwd:kt,model:Lt});s.draftModel.value=null;const Bs=Lt!==void 0&&(!eo.model||eo.model.length===0)?{...eo,model:Lt}:eo;d(Bs),xe(eo.workspaceId??pe??de),await Ft(eo.id),await jn(eo.id,Te,Le)}catch(J){i("startSessionAndSendPrompt",J)}}async function at(de){const Te=de.trim();if(!Te)return;const Le=ct();try{const Me=await Le.addWorkspace({root:Te});se(Me),qe(Me.id)}catch{e.workspaces.find(J=>J.root===Te)||(e.workspaces=[{id:Te,root:Te,name:ne(Te),isGitRepo:!1,sessionCount:0},...e.workspaces]),qe(Te)}}async function _t(de){try{return await ct().browseFs(de)}catch{return{path:"",parent:null,entries:[]}}}async function $t(){try{return await ct().getFsHome()}catch{return{home:"",recentRoots:[]}}}function lt(de,Te){if(Te==="none"||typeof window>"u"||!window.history)return;const Le=Zue(de);if(window.location.pathname!==Le)try{Te==="push"?window.history.pushState(null,"",Le):window.history.replaceState(null,"",Le)}catch{}}async function Rt(de){try{const Te=await ct().getSession(de);return e.sessions.some(Le=>Le.id===Te.id)||f(Te),!0}catch{return!1}}function fn(){const de=Z2(window.location);if(de===void 0){h(void 0);return}if(de!==e.activeSessionId){if(e.sessions.some(Te=>Te.id===de)){Ft(de,{urlMode:"none"});return}(async()=>{if(await Rt(de)){await Ft(de,{urlMode:"none"});return}const Te=e.sessions[0];Te?await Ft(Te.id,{urlMode:"replace"}):(h(void 0),lt(void 0,"replace"))})()}}let An=!1;function Nt(){An||typeof window>"u"||(An=!0,window.addEventListener("popstate",fn))}async function Ft(de,Te){const Le=y(de),Me=!Le&&a.has(de);a.delete(de);try{lt(de,Te?.urlMode??"push"),e.sessionLoading=!Le&&!Me,h(de),K(),e.unreadBySession[de]&&(e.unreadBySession={...e.unreadBySession,[de]:!1},D({[de]:!1})),Ne();const J=e.sessions.find(pe=>pe.id===de);if(J){const pe=$(J);e.activeWorkspaceId!==pe&&xe(pe)}if(Le)b(de);else if(await k(de)==="not-found")return;ue(de)}catch(J){i("selectSession",J,{sessionId:de})}finally{e.activeSessionId===de&&(e.sessionLoading=!1)}}async function jn(de,Te,Le){l.add(de),e.sendingBySession={...e.sendingBySession,[de]:!0};const Me=_();try{const J=ct(),pe=[];Te&&pe.push({type:"text",text:Te});for(const hn of Le??[])hn.kind==="video"?pe.push({type:"video",source:{kind:"file",fileId:hn.fileId}}):pe.push({type:"image",source:{kind:"file",fileId:hn.fileId}});if(pe.length===0)return l.delete(de),e.sendingBySession={...e.sendingBySession,[de]:!1},!1;const kt={id:Me,sessionId:de,role:"user",content:pe,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};m(de,hn=>[...hn,kt]);const Lt=e.sessions.find(hn=>hn.id===de),eo=(Lt?.model&&Lt.model.length>0?Lt.model:e.defaultModel)??void 0;if(e.goalMode&&Te)try{await J.updateSession(de,{goalObjective:Te.trim()})}catch(hn){return i("createGoal",hn,{sessionId:de}),l.delete(de),e.sendingBySession={...e.sendingBySession,[de]:!1},m(de,Ot=>Ot.some(pn=>pn.id===Me)?Ot.filter(pn=>pn.id!==Me):Ot),!1}const Bs=await J.submitPrompt(de,{content:pe,model:eo,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});return e.goalMode&&(e.goalMode=!1,R(!1)),e.promptIdBySession={...e.promptIdBySession,[de]:Bs.promptId},m(de,hn=>{const Ot=hn.findIndex(pi=>pi.id===Me);if(Ot===-1)return hn;const pn=[...hn];return pn[Ot]={...pn[Ot],promptId:pn[Ot].promptId??Bs.promptId},pn}),w()?.bindNextPromptId(de,Bs.promptId),!0}catch(J){return l.delete(de),e.sendingBySession={...e.sendingBySession,[de]:!1},m(de,pe=>pe.some(kt=>kt.id===Me)?pe.filter(kt=>kt.id!==Me):pe),i("sendPrompt",J,{sessionId:de}),!1}}async function Je(de,Te){const Le=e.activeSessionId;if(Le){if(r.value!=="idle"||l.has(Le)){Oo(de,Te);return}await jn(Le,de,Te)}}async function Qn(de,Te){const Le=e.activeSessionId;if(!Le)return;const Me=e.queuedBySession[Le]??[],J=[],pe=[];for(const Ot of Me){const pn=Ot.text.trim();pn&&J.push(pn),Ot.attachments?.length&&pe.push(...Ot.attachments)}const kt=de.trim();if(kt&&J.push(kt),Te?.length&&pe.push(...Te),J.length===0&&pe.length===0)return;Me.length>0&&(e.queuedBySession={...e.queuedBySession,[Le]:[]});const Lt=J.join(`
|
|
280
|
-
|
|
281
|
-
`);if(r.value==="idle"&&!l.has(Le)){await jn(Le,Lt,pe);return}const eo=[];Lt&&eo.push({type:"text",text:Lt});for(const Ot of pe)Ot.kind==="video"?eo.push({type:"video",source:{kind:"file",fileId:Ot.fileId}}):eo.push({type:"image",source:{kind:"file",fileId:Ot.fileId}});const Bs=_(),hn={id:Bs,sessionId:Le,role:"user",content:eo,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};m(Le,Ot=>[...Ot,hn]);try{const Ot=ct(),pn=e.sessions.find(ks=>ks.id===Le),pi=(pn?.model&&pn.model.length>0?pn.model:e.defaultModel)??void 0,Fs=await Ot.submitPrompt(Le,{content:eo,model:pi,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});if(m(Le,ks=>{const bl=ks.findIndex(sp=>sp.id===Bs);if(bl===-1)return ks;const wl=[...ks];return wl[bl]={...wl[bl],promptId:wl[bl].promptId??Fs.promptId},wl}),Fs.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Le]:Fs.promptId},w()?.bindNextPromptId(Le,Fs.promptId);return}try{await Ot.steerPrompts(Le,[Fs.promptId])}catch{}}catch(Ot){m(Le,pn=>pn.filter(pi=>pi.id!==Bs)),i("steer",Ot,{sessionId:Le})}}async function Xo(de,Te){try{const Me=await ct().uploadFile({file:de,name:Te});return{fileId:Me.id,name:Me.name,mediaType:Me.mediaType}}catch(Le){return i("uploadImage",Le),null}}function Oo(de,Te){const Le=e.activeSessionId;if(!Le)return;const Me=e.queuedBySession[Le]??[];e.queuedBySession={...e.queuedBySession,[Le]:[...Me,{text:de,attachments:Te}]}}async function ho(){const de=e.activeSessionId;if(!de)return;const Te=e.sessions.find(J=>J.id===de);let Le=e.promptIdBySession[de];if(Le===void 0){const J=Te?.currentPromptId;J?.startsWith("prompt_")&&(Le=J)}const Me=ct();if(Le!==void 0)try{if((await Me.abortPrompt(de,Le)).aborted)return;const pe={...e.promptIdBySession};delete pe[de],e.promptIdBySession=pe}catch(J){if(Cu(J)&&J.code===ede){const pe={...e.promptIdBySession};delete pe[de],e.promptIdBySession=pe}else{i("abortCurrentPrompt",J,{sessionId:de});return}}try{await Me.abortSession(de)}catch(J){i("abortCurrentPrompt",J,{sessionId:de})}}async function Nn(de,Te){const Le=e.activeSessionId;if(Le)try{const Me=ct(),J={decision:Te.decision,scope:Te.scope,feedback:Te.feedback,selectedLabel:Te.selectedLabel};await Me.respondApproval(Le,de,J);const pe=e.approvalsBySession[Le]??[];e.approvalsBySession={...e.approvalsBySession,[Le]:pe.filter(kt=>kt.approvalId!==de)}}catch(Me){i("respondApproval",Me,{sessionId:Le})}}async function cn(de,Te){const Le=e.activeSessionId;if(Le)try{await ct().respondQuestion(Le,de,Te);const J=e.questionsBySession[Le]??[];e.questionsBySession={...e.questionsBySession,[Le]:J.filter(pe=>pe.questionId!==de)}}catch(Me){i("respondQuestion",Me,{sessionId:Le})}}async function wn(de){const Te=e.activeSessionId;if(Te)try{await ct().dismissQuestion(Te,de);const Me=e.questionsBySession[Te]??[];e.questionsBySession={...e.questionsBySession,[Te]:Me.filter(J=>J.questionId!==de)}}catch(Le){i("dismissQuestion",Le,{sessionId:Te})}}async function On(de){const Te=e.activeSessionId;if(Te)try{await ct().cancelTask(Te,de);const Me=e.tasksBySession[Te]??[];e.tasksBySession={...e.tasksBySession,[Te]:Me.map(J=>J.id===de?{...J,status:"cancelled"}:J)}}catch(Le){i("cancelTask",Le,{sessionId:Te})}}function zn(de){e.planMode=de,T(de),L({planMode:de})}function Zn(){zn(!e.planMode)}function Co(de){e.swarmMode=de,I(de),L({swarmMode:de})}function po(){const de=!e.swarmMode;de&&e.permission==="manual"&&!confirm("Enable swarm mode? The agent will run multiple sub agents in parallel.")||Co(de)}function Po(de){e.goalMode=de,R(de)}function Tt(){Po(!e.goalMode)}async function io(de){const Te=de.trim();if(!Te||e.permission==="manual"&&!confirm(`Start goal: "${Te}"? The agent will run autonomously toward this objective.`))return;const Le=e.activeSessionId;if(Le){try{await ct().updateSession(Le,{goalObjective:Te})}catch(Me){i("createGoal",Me,{sessionId:Le,message:V(Me)});return}await Je(Te)}}function nn(de){const Te=e.activeSessionId;Te&&Promise.resolve(ct().updateSession(Te,{goalControl:de})).catch(Le=>{i("controlGoal",Le,{sessionId:Te,message:V(Le)})})}function Ro(de){e.permission=de,P(de),L({permissionMode:de})}function Qo(de){const Te=[...e.warnings];Te.splice(de,1),e.warnings=Te}async function Jn(de,Te){try{await ct().updateSession(de,{title:Te}),u(de,Me=>({...Me,title:Te}))}catch(Le){i("renameSession",Le,{sessionId:de})}}function Ye(de,Te){e.workspaces=e.workspaces.map(Le=>Le.id===de?{...Le,name:Te}:Le)}async function je(de){const Te=e.workspaces.find(pe=>pe.id===de)?.root??N.value.find(pe=>pe.id===de)?.root??de,Le=e.activeSessionId?e.sessions.find(pe=>pe.id===e.activeSessionId):void 0,Me=e.activeWorkspaceId===de||e.activeWorkspaceId===Te,J=!!(Le&&(Le.cwd===Te||Le.workspaceId===de||$(Le)===de));Te&&!e.hiddenWorkspaceRoots.includes(Te)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Te],z(e.hiddenWorkspaceRoots));try{await ct().deleteWorkspace(de)}catch{}if(e.workspaces=e.workspaces.filter(pe=>pe.id!==de&&pe.root!==Te),Me||J){const pe=v.value[0]?.id??null;if(e.activeWorkspaceId=pe,pe)F(pe);else try{Zc(Mt.activeWorkspace)}catch{}}(Me||J)&&(h(void 0),e.sessionLoading=!1,Ne(),lt(void 0,"replace"))}async function tt(de){try{await ct().archiveSession(de),g(de),o.clearSideChatForSession(de);const{[de]:Le,...Me}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Me,e.activeSessionId===de){const J=e.sessions[0];J?await Ft(J.id,{urlMode:"replace"}):(h(void 0),lt(void 0,"replace"))}}catch(Te){i("archiveSession",Te,{sessionId:de})}}async function it(){try{await ct().logout(),await Q(),await re()}catch(de){i("logout",de)}}function Ie(de){const Te=e.activeSessionId;Te&&ct().compactSession(Te,de).catch(Le=>{i("compact",Le,{sessionId:Te})})}async function ke(de){const Te=de??e.activeSessionId;if(Te)try{const Le=await ct().forkSession(Te);d(Le),await Ft(Le.id)}catch(Le){i("fork",Le,{sessionId:Te})}}async function Fe(de=1){const Te=e.activeSessionId;if(!Te)return null;const Le=(()=>{const Me=e.messagesBySession[Te]??[];for(let J=Me.length-1;J>=0;J--){const pe=Me[J];if(pe.role==="user"&&!(pe.metadata?.origin&&pe.metadata.origin.kind!=="user"))return pe.content.filter(kt=>kt.type==="text").map(kt=>kt.text).join(`
|
|
282
|
-
`)}return null})();try{return await ct().undoSession(Te,de),await k(Te),Le}catch(Me){return i("undo",Me,{sessionId:Te}),null}}function Ct(de){const Te=e.activeSessionId;if(!Te)return;const Le=e.queuedBySession[Te]??[];if(de<0||de>=Le.length)return;const Me=[...Le];Me.splice(de,1),e.queuedBySession={...e.queuedBySession,[Te]:Me}}async function St(de){const Te=e.activeSessionId;if(!Te)return[];try{return(await ct().listDirectory(Te,{path:de,includeGitStatus:!0})).items}catch{return[]}}async function mn(de){const Te=e.activeSessionId;if(!Te)return null;try{const Me=await ct().readFile(Te,{path:de});return{path:Me.path,content:Me.content,encoding:Me.encoding,mime:Me.mime,languageId:Me.languageId,isBinary:Me.isBinary,size:Me.size,lineCount:Me.lineCount}}catch{return null}}const gn=10485760;function ys(de){const Te=e.activeSessionId;return Te?ct().getFileDownloadUrl(Te,de):null}async function Zo(de,Te){const Le=e.activeSessionId;if(!Le)return!1;try{return await ct().openFile(Le,{path:de,line:Te}),!0}catch(Me){return i("openFile",Me,{sessionId:Le}),!1}}async function Ui(de){const Te=e.activeSessionId;if(!Te)return;const Le=M.value.cwd||".";try{await ct().openInApp(Te,de,Le)}catch(Me){i("openInApp",Me,{sessionId:Te})}}async function fi(de){const Te=e.activeSessionId;if(!Te)return!1;try{return await ct().revealFile(Te,{path:de}),!0}catch(Le){return i("revealFile",Le,{sessionId:Te}),!1}}async function Vn(de){if(/^(https?:|data:|blob:)/i.test(de))return de;const Te=e.activeSessionId;if(!Te)return de;let Le=de;if(Le.startsWith("/")){const Me=e.sessions.find(J=>J.id===Te)?.cwd;if(Me&&(Le===Me||Le.startsWith(Me.endsWith("/")?Me:`${Me}/`))){if(Le=Le.slice(Me.length).replace(/^\//,""),!Le)return de}else return de}try{const J=await ct().readFile(Te,{path:Le,length:gn});return!J.isBinary||J.encoding!=="base64"||J.truncated?de:`data:${J.mime};base64,${J.content}`}catch{return de}}async function hi(de){const Te=e.activeSessionId;if(!Te)return[];try{return(await ct().searchFiles(Te,{query:de,limit:20})).items.map(J=>({path:J.path,name:J.name}))}catch{return[]}}return{loadFileDiff:ve,clearFileDiff:Ne,loadGitStatus:Re,checkAuth:Q,loadConfig:ce,updateConfig:Se,listAllSessionsGlobal:oe,load:re,loadWorkspaces:ge,loadMoreSessions:W,loadAllSessions:Y,selectWorkspace:xe,openWorkspace:$e,upsertWorkspacePreserveOrder:se,applyWorkspaceEvent:ae,clearActiveSession:we,openWorkspaceDraft:qe,startSessionAndSendPrompt:nt,addWorkspaceByPath:at,browseFs:_t,getFsHome:$t,writeSessionUrl:lt,fetchSessionIntoList:Rt,onSessionRoutePopState:fn,bindSessionRoute:Nt,selectSession:Ft,submitPromptInternal:jn,sendPrompt:Je,steerPrompt:Qn,uploadImage:Xo,enqueue:Oo,unqueue:Ct,abortCurrentPrompt:ho,respondApproval:Nn,respondQuestion:cn,dismissQuestion:wn,cancelTask:On,setPlanMode:zn,togglePlanMode:Zn,setSwarmMode:Co,toggleSwarmMode:po,setGoalMode:Po,toggleGoalMode:Tt,createGoal:io,controlGoal:nn,setPermission:Ro,dismissWarning:Qo,renameSession:Jn,renameWorkspace:Ye,deleteWorkspace:je,archiveSession:tt,logout:it,compact:Ie,forkSession:ke,undo:Fe,listDir:St,readFileContent:mn,getFileDownloadUrl:ys,openWorkspaceFile:Zo,openInApp:Ui,revealWorkspaceFile:fi,resolveImageUrl:Vn,searchFiles:hi,loadOlderMessages:We,refreshSessionSidecars:ue}}const nde="kimiWeb.optimisticUserMessage";function ode(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function sde(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function ide(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function vg(e){return e.role==="user"&&e.metadata?.[nde]===!0}function rde(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function J2(e){let t="",n=0;for(const o of e.content)o.type==="text"?t+=o.text:(o.type==="image"||o.type==="file")&&(n+=1);return{text:t,media:n}}function lde(e,t){const n=J2(e),o=J2(t);return n.text===o.text&&n.media===o.media}function ade(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(vg(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(vg(s)&&rde(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(vg(s)&&lde(s,t))return o}return-1}function cde(e,t,n){let o=!1;const s=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(o=!0,{...i,content:l}):i});return o?s:e}function ude(e,t,n){const o=sde(e);switch(ide(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(i=>i.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionStatusChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const i=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,i=o.compactionBySession[s],{[s]:r,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[x3]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...i}=o.compactionBySession;o.compactionBySession=i;break}case"messageCreated":{const s=t.message.sessionId,i=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=o.messagesBySession[s]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"){const a=ade(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...r,t.message]}break}case"messageUpdated":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=cde(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,i=o.approvalsBySession[s]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,i=t.approvalId,r=o.approvalsBySession[s]??[];o.approvalsBySession[s]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const s=t.sessionId,i=o.questionsBySession[s]??[];i.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,i=t.questionId,r=o.questionsBySession[s]??[];o.questionsBySession[s]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const s=t.sessionId,i=o.tasksBySession[s]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)o.tasksBySession[s]=[...i,t.task];else{const l=[...i];l[r]={...t.task,outputLines:i[r].outputLines},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const s=t.sessionId;t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"agentDelta":case"agentTurnEnded":break;case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&(s._agentError||s._agentWarning)){const i=s._agentError?Cn.global.t("warnings.errorLabel"):Cn.global.t("warnings.noteLabel"),r=s.message??s.code??"agent error";o.warnings=[...o.warnings,`${i}: ${r}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function dde(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function fde(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||vl(s.toolName)!=="todo")continue;let i=s.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:dde(a.status)}]:[]})}}return[]}const hde=["queued","working","suspended","completed","failed"];function pde(e){return e.subagentPhase?e.subagentPhase:e.status==="completed"?"completed":e.status==="failed"?"failed":"working"}function mde(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function gde(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const o=n.parentToolCallId??"swarm",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:pde(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=mde();for(const r of s)i[r.phase]++;return{id:n,members:s,counts:i}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.swarmIndex??0,i=o.members.at(0)?.swarmIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function vde(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of hde)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}const os=cue(),nl=pue(),th=wue(),M3=Mt.permission,E3=Mt.activeWorkspace,I3=Mt.thinking,$3=Mt.planMode,N3=Mt.swarmMode,L3=Mt.goalMode,eC=40401,O3=Mt.onboarded,yde=["off","low","medium","high","xhigh","max"];Zc(Mt.codeFont);function kde(){try{const e=bn(M3);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function bde(e){try{Tn(M3,e)}catch{}}function wde(){try{const e=bn(I3);if(e&&yde.includes(e))return e}catch{}return"high"}function _de(e){try{Tn(I3,e)}catch{}}function Cde(){try{return bn($3)==="true"}catch{return!1}}function Sde(e){try{Tn($3,e?"true":"false")}catch{}}function xde(){try{return bn(N3)==="true"}catch{return!1}}function Tde(e){try{Tn(N3,e?"true":"false")}catch{}}function Ade(){try{return bn(L3)==="true"}catch{return!1}}function Mde(e){try{Tn(L3,e?"true":"false")}catch{}}function Ede(){try{return bn(E3)}catch{return null}}const P3=Mt.hiddenWorkspaces;function Ide(){try{const e=bn(P3);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function $de(e){try{Tn(P3,JSON.stringify(e))}catch{}}function Nde(e){try{Tn(E3,e)}catch{}}function R3(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Lde(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Ce=as({...ode(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:kde(),thinking:wde(),planMode:Cde(),swarmMode:xde(),goalMode:Ade(),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:wv(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Ede(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Ide(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsFullyLoaded:!1});function D3(e){Ce.sessions=e}function Xh(e,t){Ce.sessions=Ce.sessions.map(n=>n.id===e?t(n):n)}function Ode(e){Ce.sessions=[e,...Ce.sessions.filter(t=>t.id!==e.id)]}function Pde(e){Ce.sessions=[...Ce.sessions,e]}function Rde(e){Ce.sessions=Ce.sessions.filter(t=>t.id!==e)}function B3(){const e=Ce.activeSessionId;e&&Ce.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!1},_v({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Mt.unread&&(Ce.unreadBySession=wv(),B3())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&B3()});function w0(e){Ce.activeSessionId=e}function Dde(e){Ce.messagesBySession=e}function Bde(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t}}function F3(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t(Ce.messagesBySession[e]??[])}}function Fde(e){const{[e]:t,...n}=Ce.messagesBySession;Ce.messagesBySession=n}function H3(e){ui?.unsubscribe(e),cu.flush(),Rde(e),Fde(e),delete Ce.approvalsBySession[e],delete Ce.questionsBySession[e],delete Ce.tasksBySession[e],delete Ce.goalBySession[e],delete Ce.gitStatusBySession[e],delete Ce.lastSeqBySession[e],delete Ce.compactionBySession[e],delete Ce.messagesLoadingMoreBySession[e],delete Ce.messagesHasMoreBySession[e],delete Ce.messagesLoadMoreErrorBySession[e],delete Jh[e],X3.delete(e),Zh.delete(e),delete Ce.queuedBySession[e],delete Ce.promptIdBySession[e],delete Ce.sendingBySession[e]}const W3=te(null),U3=te([]),q3=te(!1),j3=te(!1);async function Qh(e){let t;try{t=await ct().getSessionStatus(e)}catch{return}Xh(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Ce.swarmMode=t.swarmMode,Ce.planMode=t.planMode}function z3(e){const t=Ce.activeSessionId;t&&Promise.resolve(ct().updateSession(t,e)).then(()=>Qh(t)).catch(()=>{})}const V3=Mt.betaToc;function Hde(){try{return bn(V3)==="true"}catch{return!1}}function Wde(e){try{Tn(V3,e?"true":"false")}catch{}}const K3=te(Hde());function Ude(e){K3.value=e,Wde(e)}function qde(e){try{return bn(e)??""}catch{return""}}const G3=te(qde(O3)==="1");function jde(e){G3.value=e;try{Tn(O3,e?"1":"0")}catch{}}let ui=null,tC=0;function Y3(){return tC+=1,`msg_opt_${Date.now().toString(36)}_${tC}`}const Zh=new Set;function zde(e,t,n){const o={sessions:Ce.sessions,activeSessionId:Ce.activeSessionId,messagesBySession:Ce.messagesBySession,approvalsBySession:Ce.approvalsBySession,planReviewByToolCallId:Ce.planReviewByToolCallId,questionsBySession:Ce.questionsBySession,tasksBySession:Ce.tasksBySession,goalBySession:Ce.goalBySession,lastSeqBySession:Ce.lastSeqBySession,compactionBySession:Ce.compactionBySession,config:Ce.config,warnings:Ce.warnings},s=ude(o,e,{sessionId:t,seq:n});D3(s.sessions),w0(s.activeSessionId),Dde(s.messagesBySession),Ce.approvalsBySession=s.approvalsBySession,Ce.planReviewByToolCallId=s.planReviewByToolCallId,Ce.questionsBySession=s.questionsBySession,Ce.tasksBySession=s.tasksBySession,Ce.goalBySession=s.goalBySession,Ce.lastSeqBySession=s.lastSeqBySession,Ce.compactionBySession=s.compactionBySession,Ce.config=s.config??null,Ce.warnings=s.warnings,e.type==="configChanged"&&(Ce.defaultModel=e.config.defaultModel??null),e.type==="sessionUsageUpdated"&&e.sessionId===Ce.activeSessionId&&e.swarmMode!==void 0&&(Ce.swarmMode=e.swarmMode),e.type==="sessionUsageUpdated"&&e.sessionId===Ce.activeSessionId&&e.planMode!==void 0&&(Ce.planMode=e.planMode)}function Vde(e,t){zde(e,t.sessionId,t.seq);const n=vo.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:o}=n,s=t.sessionId;e.type==="agentDelta"&&e.agentId===o?e.delta.text&&vo.appendSideChatAssistantText(o,s,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===o?vo.finishSideChatAgent(o,s):e.type==="taskProgress"&&e.taskId===o?vo.appendSideChatAssistantText(o,s,e.outputChunk):e.type==="taskCompleted"&&e.taskId===o&&vo.finishSideChatAgent(o,s,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const o=e.message.sessionId;Ce.promptIdBySession[o]!==e.message.promptId&&(Ce.promptIdBySession={...Ce.promptIdBySession,[o]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Ce.activeSessionId&&os.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&ohe(e.sessionId,e.status),e.type==="questionRequested"&&she(e.sessionId,e.question)}const cu=Wce(({appEvent:e,meta:t})=>Vde(e,t),({appEvent:e})=>Fce(e));function _0(){if(ui!==null||typeof WebSocket>"u")return;Ce.connection="connecting",ui=ct().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){dt.applyWorkspaceEvent(t);return}cu({appEvent:t,meta:n})},onResync(t,n,o){cu.flush(),o!==void 0&&(Jh[t]=o),nfe.request(t)},onError(t,n,o){C0({severity:"error",title:Cn.global.t("warnings.wsTitle"),message:n,details:[no("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){Ce.connected=t,Ce.connection=t?"connected":"disconnected"}})}const Jh={},X3=new Set;function Kde(e){return Cu(e)&&e.code===eC?!0:typeof e=="object"&&e!==null&&e.code===eC}function no(e,t){if(!(t==null||t===""))return{label:Cn.global.t(`warnings.details.${e}`),value:Q3(t)}}function Q3(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 Gde(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Yde(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Xde(e,t,n){const o=[no("operation",e),no("sessionId",n)];return u3(t)?o.push(no("request",`${t.method} ${t.path}`),no("endpoint",t.url),no("requestId",t.requestId),no("phase",t.phase),no("timeout",`${t.timeoutMs}ms`),no("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),no("contentType",t.contentType),no("responsePreview",t.bodyPreview),no("cause",t.cause)):Cu(t)?o.push(no("code",t.code),no("requestId",t.requestId),no("message",t.message),no("details",t.details)):o.push(no("errorName",Gde(t)),no("message",Yde(t)??Q3(t))),o.filter(s=>s!==void 0)}function Qde(e,t,n={}){const o=u3(t),s=Cu(t),i=n.title??(o?Cn.global.t("warnings.daemonNetworkTitle"):s?Cn.global.t("warnings.daemonApiTitle"):Cn.global.t("warnings.operationFailedTitle")),r=n.message??(o?Cn.global.t("warnings.daemonNetworkMessage"):s?t.message:Cn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:Xde(e,t,n.sessionId)}}function C0(e){Ce.warnings=[...Ce.warnings,e]}function ep(e,t,n){C0(Qde(e,t,n))}const Zde={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function Jde(e){if(!Cu(e))return;const t=Zde[e.code];return t?Cn.global.t(t):void 0}async function efe(e){if(H3(e),Ce.activeSessionId!==e)return;const t=Ce.sessions[0];t?await dt.selectSession(t.id,{urlMode:"replace"}):(w0(void 0),Ce.sessionLoading=!1,dt.writeSessionUrl(void 0,"replace"))}const nC=new Set;async function tfe(e){if(!nC.has(e)){nC.add(e);try{const t=await ct().getSessionWarnings(e),n=Cn.global.t("warnings.noteLabel");for(const o of t)C0(`${n}: ${o.message}`)}catch{}}}async function Z3(e){try{const n=await ct().getSessionSnapshot(e);cu.flush(),Xh(e,o=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:o.model})),Bde(e,n.messages),Ce.messagesHasMoreBySession={...Ce.messagesHasMoreBySession,[e]:n.hasMoreMessages},Ce.approvalsBySession={...Ce.approvalsBySession,[e]:n.pendingApprovals};for(const o of n.pendingApprovals){const s=o.display;s?.kind==="plan_review"&&typeof s.plan=="string"&&s.plan.length>0&&(Ce.planReviewByToolCallId={...Ce.planReviewByToolCallId,[o.toolCallId]:{plan:s.plan,path:typeof s.path=="string"?s.path:void 0}})}return Ce.questionsBySession={...Ce.questionsBySession,[e]:n.pendingQuestions},Ce.lastSeqBySession={...Ce.lastSeqBySession,[e]:n.asOfSeq},Jh[e]=n.epoch,_0(),ui&&(ui.seedSnapshot(e,n),ui.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch})),tfe(e),"ok"}catch(t){return Kde(t)?(await efe(e),"not-found"):(ep("getSessionSnapshot",t,{title:Cn.global.t("warnings.sessionSnapshotTitle"),message:Cn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const nfe=Dce(Z3);function ofe(e){return Object.prototype.hasOwnProperty.call(Ce.messagesBySession,e)}function sfe(e){if(_0(),ui){cu.flush();const t=Ce.lastSeqBySession[e]??0,n=Jh[e];ui.subscribe(e,{seq:t,epoch:n})}}function tp(e){const t=Ce.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=vo.sideChatTargetBySession.value[e]?.agentId,s=(Ce.tasksBySession[e]??[]).filter(i=>i.status==="running");return s.length===0?!(n&&Ce.sideChatSendingByAgent[n]):s.some(i=>i.id!==n)}function S0(e,t){try{const n=new Date(e),s=Date.now()-n.getTime(),i=s/36e5;return s<6e4?Cn.global.t("sessions.justNow"):i<1?`${Math.round(s/6e4)}m`:i<24?`${Math.round(i)}h`:n.toLocaleDateString(Cn.global.locale.value,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}const ife=3e4,uu=te(0);let yg=null;function rfe(){yg===null&&(yg=setInterval(()=>{uu.value=(uu.value+1)%Number.MAX_SAFE_INTEGER},ife),yg.unref?.())}function lfe(e,t){const n=e.split(`
|
|
283
|
-
`),o=t.split(`
|
|
284
|
-
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function afe(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:lfe(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function cfe(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 ufe(e){const t=Ce.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function dfe(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=Cn.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=Cn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??ufe(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o}}const ffe=H(()=>{const e=Ce.sessions.find(n=>n.id===Ce.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Ce.workspaceName,branch:t}}),hfe=H(()=>(uu.value,Ce.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:S0(e.updatedAt,e.status),status:e.status,busy:tp(e.id)})))),pfe=H(()=>Ce.activeSessionId??""),mfe=H(()=>{const e=Ce.activeSessionId;return e?Pn.skillsBySession.value[e]??[]:[]}),gfe=H(()=>{const e=Ce.activeSessionId;return e?Ce.sendingBySession[e]??!1:!1}),vo=Yue(Ce,{pushOperationFailure:ep,nextOptimisticMsgId:Y3,connectEventsIfNeeded:_0,getEventConn:()=>ui}),np=H(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=vo.sideChatTargetBySession.value[e]?.agentId;return(Ce.tasksBySession[e]??[]).filter(n=>n.id!==t)}),J3=Sue(Ce,np),vfe=H(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=new Set(Ce.sideChatUserMessageIdsBySession[e]??[]),n=(Ce.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=Ce.approvalsBySession[e]??[];return A3(n,o,s=>ct().getFileUrl(s),op.value!=="idle",np.value,Ce.planReviewByToolCallId)}),yfe=H(()=>(J3.taskClock.value,np.value.map(dfe))),eM=H(()=>gde(np.value)),Xl=H(()=>{const e=Ce.activeSessionId;return e?Ce.goalBySession[e]??null:null}),kfe=H(()=>{const e=Ce.activeSessionId;return e?fde(Ce.messagesBySession[e]??[]):[]}),bfe=H(()=>{const e=Ce.activeSessionId;return e?Ce.compactionBySession[e]??null:null}),wfe=H(()=>Ce.connection),_fe=H(()=>Ce.loading),Cfe=H(()=>Ce.sessionLoading),Sfe=H(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadingMoreBySession[e]??!1:!1}),xfe=H(()=>{const e=Ce.activeSessionId;return e?Ce.messagesHasMoreBySession[e]??!1:!1}),Tfe=H(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadMoreErrorBySession[e]??!1:!1}),Afe=H(()=>Ce.serverVersion),Mfe=H(()=>Ce.permission),Efe=H(()=>Ce.thinking),Ife=H(()=>Ce.planMode),$fe=H(()=>Ce.swarmMode),Nfe=H(()=>Ce.goalMode),Lfe=H(()=>{const e=vde(eM.value);return{plan:Ce.planMode,goal:Xl.value&&Xl.value.status!=="complete"?{status:Xl.value.status,turnsUsed:Xl.value.turnsUsed,elapsedMs:Xl.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Ofe=H(()=>{const e=Ce.activeSessionId;return e?(Ce.queuedBySession[e]??[]).map(t=>({text:t.text,attachmentCount:t.attachments?.length??0})):[]}),Pfe=H(()=>Ce.warnings),Rfe=H(()=>{const e=Ce.activeSessionId;return e?(Ce.questionsBySession[e]??[]).map(cfe):[]}),Dfe=H(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:afe(t),agentName:t.agentName})):[]}),op=H(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Ce.questionsBySession[e]??[]).length>0?"awaiting-question":tp(e)?"running":"idle":"idle"}),Pn=Aue(Ce,{pushOperationFailure:ep,refreshSessionStatus:Qh,persistSessionProfile:z3,activity:op,inFlightPromptSessions:Zh,saveThinkingToStorage:_de,updateSession:Xh,updateSessionMessages:F3}),nh=H(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Bfe=H(()=>{const e=Ce.activeSessionId;return e?Ce.gitStatusBySession[e]?.pullRequest??null:null}),Ffe=H(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=Ce.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),Hfe=H(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),tM=H(()=>{const e=Ce.sessions.find(r=>r.id===Ce.activeSessionId),t=nh.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Pn.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??Ce.defaultModel)??"—",s=Pn.models.value.find(r=>r.id===o||r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Ce.permission,branch:t,cwd:e?.cwd??"",isGitRepo:nh.value!==null}}),Wfe=H(()=>U3.value),Ufe=H(()=>Ce.sessions.find(t=>t.id===Ce.activeSessionId)?.usage.totalCostUsd??0),qfe=H(()=>Ce.authReady),jfe=H(()=>Ce.defaultModel),zfe=H(()=>Ce.managedProviderStatus),Vfe=H(()=>Ce.config),Kfe=H(()=>{const e=Ce.activeSessionId;if(!e)return{};const t=Ce.gitStatusBySession[e];return t?{...t.entries}:{}});function xu(e){return Ce.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const x0=H(()=>{const e=new Set(Ce.hiddenWorkspaceRoots),t=new Map;for(const a of Ce.workspaces)e.has(a.root)||t.set(a.root,{...a});for(const a of Ce.sessions){const c=a.cwd;c&&(e.has(c)||t.has(c)||t.set(c,{id:a.workspaceId??c,root:c,name:R3(c),isGitRepo:!1,sessionCount:0}))}const n=new Map;for(const a of Ce.sessions){const c=xu(a);n.set(c,(n.get(c)??0)+1)}const o=nh.value,s=Ce.sessions.find(a=>a.id===Ce.activeSessionId)?.cwd,i=Ce.workspaces.filter(a=>!e.has(a.root)).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)??0,d=Ce.sessionsHasMoreByWorkspace[c.id]===!1?u:Math.max(c.sessionCount,u);let f=c.branch;!f&&o&&s===c.root&&(f=o.branch),l.push({...c,sessionCount:d,branch:f})}return l}),oh=te(X6());ze(()=>[x0.value.map(e=>e.id).join("\0"),Ce.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=a5(n,oh.value);o!==null&&(oh.value=o,dx(o))});const La=H(()=>{const e=x0.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Lde(t.root,Ce.fsHome),branch:t.branch,sessionCount:t.sessionCount}));return c5(e,oh.value)}),nM=H(()=>{const e=Ce.activeWorkspaceId,t=La.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),Gfe=H(()=>{const e=nM.value;return e?La.value.find(t=>t.id===e)??null:null}),Yfe=H(()=>{uu.value;const e=new Set(La.value.map(t=>t.id));return Ce.sessions.filter(t=>!t.parentSessionId&&e.has(xu(t))).map(t=>({id:t.id,title:t.title,time:S0(t.updatedAt,t.status),status:t.status,busy:tp(t.id),lastPrompt:t.lastPrompt}))}),Xfe=H(()=>{uu.value;const e=new Map;for(const t of Ce.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=xu(t),o={id:t.id,title:t.title,time:S0(t.updatedAt,t.status),status:t.status,busy:tp(t.id),updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return La.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Ce.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Ce.sessionsLoadingMoreByWorkspace[t.id]??!1}))});function Qfe(e){oh.value=e,dx(e)}const oM=H(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),Zfe=H(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),Jfe=H(()=>{const e={};for(const[t,n]of Object.entries(Ce.unreadBySession))n&&(e[t]=!0);return e}),ehe=H(()=>{const e={},t=oM.value;for(const n of Ce.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=xu(n);e[s]=(e[s]??0)+o}return e}),the=H(()=>Ce.recentRoots),nhe=H(()=>Ce.availableOpenInApps),dt=tde(Ce,{taskPoller:J3,sideChat:vo,modelProvider:Pn,pushOperationFailure:ep,activity:op,inFlightPromptSessions:Zh,sessionsKnownEmpty:X3,setSessions:D3,updateSession:Xh,upsertSessionFront:Ode,appendSession:Pde,forgetSession:H3,setActiveSessionId:w0,updateSessionMessages:F3,nextOptimisticMsgId:Y3,getEventConn:()=>ui,syncSessionFromSnapshot:Z3,subscribeToSessionEvents:sfe,hasLoadedMessages:ofe,refreshSessionStatus:Qh,persistSessionProfile:z3,mergedWorkspaces:x0,workspacesView:La,status:tM,workspaceIdForSession:xu,savePermissionToStorage:bde,savePlanModeToStorage:Sde,saveSwarmModeToStorage:Tde,saveGoalModeToStorage:Mde,saveUnread:_v,saveActiveWorkspaceToStorage:Nde,saveHiddenWorkspacesToStorage:$de,goalErrorMessage:Jde,basename:R3,resetFastMoon:os.resetFastMoon,initialized:j3,selectedDiffPath:W3,fileDiffLines:U3,fileDiffLoading:q3});function ohe(e,t){if(Zh.delete(e),Ce.sendingBySession={...Ce.sendingBySession,[e]:!1},Ce.promptIdBySession[e]!==void 0){const i={...Ce.promptIdBySession};delete i[e],Ce.promptIdBySession=i}e===Ce.activeSessionId?(os.resetFastMoon(),dt.loadGitStatus(e),Qh(e)):t==="idle"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!0},_v({[e]:!0})),nl.maybeNotifyCompletion(e,{isActiveAndVisible:e===Ce.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:Ce.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{dt.selectSession(e)}}),t==="idle"&&th.maybePlayCompletionSound();const n=Ce.queuedBySession[e]??[];if(n.length===0)return;const[o,...s]=n;Ce.queuedBySession={...Ce.queuedBySession,[e]:s},o!==void 0&&dt.submitPromptInternal(e,o.text,o.attachments).then(i=>{if(!i){const r=Ce.queuedBySession[e]??[];Ce.queuedBySession={...Ce.queuedBySession,[e]:[o,...r]}}})}function she(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;nl.maybeNotifyQuestion(e,{isActiveAndVisible:e===Ce.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:Ce.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,onClick:()=>{dt.selectSession(e)}}),th.maybePlayQuestionSound()}function ihe(){return rfe(),{workspace:ffe,sessions:hfe,activeSessionId:pfe,workspacesView:La,visibleWorkspace:Gfe,activeWorkspaceId:nM,sessionsForView:Yfe,workspaceGroups:Xfe,attentionBySession:oM,pendingBySession:Zfe,attentionByWorkspace:ehe,unreadBySession:Jfe,recentRoots:the,turns:vfe,tasks:yfe,todos:kfe,goal:Xl,swarms:eM,activationBadges:Lfe,compaction:bfe,status:tM,sessionCost:Ufe,fileDiff:Wfe,selectedDiffPath:W3,fileDiffLoading:q3,changes:Ffe,gitInfo:nh,gitDiffStats:Hfe,activePullRequest:Bfe,changesByPath:Kfe,pendingApprovals:Dfe,availableOpenInApps:nhe,connection:wfe,loading:_fe,sessionLoading:Cfe,loadingMoreMessages:Sfe,hasMoreMessages:xfe,loadMoreMessagesError:Tfe,serverVersion:Afe,initialized:j3,permission:Mfe,thinking:Efe,planMode:Ife,swarmMode:$fe,goalMode:Nfe,queued:Ofe,warnings:Pfe,questions:Rfe,activity:op,isSending:gfe,fastMoon:os.fastMoon,models:Pn.models,starredModelIds:Pn.starredModelIds,providers:Pn.providers,theme:os.theme,setTheme:os.setTheme,toggleTheme:os.toggleTheme,uiFontSize:os.uiFontSize,setUiFontSize:os.setUiFontSize,betaToc:K3,setBetaToc:Ude,colorScheme:os.colorScheme,setColorScheme:os.setColorScheme,accent:os.accent,setAccent:os.setAccent,notifyOnComplete:nl.notifyOnComplete,notifyOnQuestion:nl.notifyOnQuestion,notifyPermission:nl.notifyPermission,setNotifyOnComplete:nl.setNotifyOnComplete,setNotifyOnQuestion:nl.setNotifyOnQuestion,soundOnComplete:th.soundOnComplete,setSoundOnComplete:th.setSoundOnComplete,onboarded:G3,setOnboarded:jde,load:dt.load,selectSession:dt.selectSession,clearActiveSession:dt.clearActiveSession,loadOlderMessages:dt.loadOlderMessages,loadWorkspaces:dt.loadWorkspaces,loadMoreSessions:dt.loadMoreSessions,loadAllSessions:dt.loadAllSessions,selectWorkspace:dt.selectWorkspace,openWorkspace:dt.openWorkspace,openWorkspaceDraft:dt.openWorkspaceDraft,startSessionAndSendPrompt:dt.startSessionAndSendPrompt,addWorkspaceByPath:dt.addWorkspaceByPath,browseFs:dt.browseFs,getFsHome:dt.getFsHome,sendPrompt:dt.sendPrompt,steerPrompt:dt.steerPrompt,sideChatVisible:vo.sideChatVisible,sideChatSessionId:vo.sideChatSessionId,sideChatTurns:vo.sideChatTurns,sideChatRunning:vo.sideChatRunning,sideChatSending:vo.sideChatSending,openSideChat:vo.openSideChat,closeSideChat:vo.closeSideChat,sendSideChatPrompt:vo.sendSideChatPrompt,uploadImage:dt.uploadImage,abortCurrentPrompt:dt.abortCurrentPrompt,respondApproval:dt.respondApproval,respondQuestion:dt.respondQuestion,dismissQuestion:dt.dismissQuestion,cancelTask:dt.cancelTask,setPermission:dt.setPermission,setThinking:Pn.setThinking,setPlanMode:dt.setPlanMode,togglePlanMode:dt.togglePlanMode,setSwarmMode:dt.setSwarmMode,toggleSwarmMode:dt.toggleSwarmMode,setGoalMode:dt.setGoalMode,toggleGoalMode:dt.toggleGoalMode,createGoal:dt.createGoal,controlGoal:dt.controlGoal,enqueue:dt.enqueue,dismissWarning:dt.dismissWarning,renameSession:dt.renameSession,renameWorkspace:dt.renameWorkspace,deleteWorkspace:dt.deleteWorkspace,reorderWorkspaces:Qfe,archiveSession:dt.archiveSession,compact:dt.compact,forkSession:dt.forkSession,undo:dt.undo,unqueue:dt.unqueue,searchFiles:dt.searchFiles,loadGitStatus:dt.loadGitStatus,loadFileDiff:dt.loadFileDiff,clearFileDiff:dt.clearFileDiff,listDir:dt.listDir,readFileContent:dt.readFileContent,getFileDownloadUrl:dt.getFileDownloadUrl,openWorkspaceFile:dt.openWorkspaceFile,openInApp:dt.openInApp,revealWorkspaceFile:dt.revealWorkspaceFile,resolveImageUrl:dt.resolveImageUrl,refreshOAuthProviderModels:Pn.refreshOAuthProviderModels,loadModels:Pn.loadModels,loadProviders:Pn.loadProviders,skills:mfe,activateSkill:Pn.activateSkill,setModel:Pn.setModel,toggleStarModel:Pn.toggleStarModel,addProvider:Pn.addProvider,deleteProvider:Pn.deleteProvider,refreshProvider:Pn.refreshProvider,authReady:qfe,defaultModel:jfe,managedProviderStatus:zfe,config:Vfe,updateConfig:dt.updateConfig,checkAuth:dt.checkAuth,startOAuthLogin:Pn.startOAuthLogin,pollOAuthLogin:Pn.pollOAuthLogin,cancelOAuthLogin:Pn.cancelOAuthLogin,logout:dt.logout}}function rhe({client:e,authLogoRef:t}){const n=H(()=>e.authReady.value),o=H(()=>e.initialized.value&&!n.value),s="/login",i=te(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}ze(o,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==s&&(i.value=l(),a(s));return}window.location.pathname===s&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return Yt(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function lhe({running:e,showAuthGate:t}){const{t:n}=xt(),o=["◐","◓","◑","◒"],s=te(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}ze(e,c=>{c?r():l()},{immediate:!0});const a=H(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});YE(()=>{typeof document<"u"&&(document.title=a.value)}),Yt(()=>{l()})}const sM=te(typeof window>"u"?0:window.innerWidth);let $d=0,sh=!1;function q1(){sM.value=window.innerWidth}function ahe(){sh||typeof window>"u"||(window.addEventListener("resize",q1),sh=!0,q1())}function che(){!sh||typeof window>"u"||(window.removeEventListener("resize",q1),sh=!1)}function iM(e,t,n){return Math.max(t,e-n)}function j1(e,t,n){return Math.min(n,Math.max(t,e))}function rM(){return rn(()=>{$d+=1,ahe()}),Yo(()=>{$d=Math.max(0,$d-1),$d===0&&che()}),{viewportWidth:sM}}const uhe="kimi-web.file-preview-width",Ql=320;function dhe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=rM(),i=H(()=>Math.max(0,s.value-t.value)),r=H(()=>iM(i.value,Ql,Ql));function l(ce){return j1(Math.round(ce),Ql,r.value)}function a(){return l(i.value/2)}const c=H(()=>a()),u=te(c.value),d=H(()=>j1(u.value,Ql,r.value)),f=te(null),g=H(()=>{const ce=f.value;if(!ce)return null;const q=e.turns.value.find(ee=>ee.id===ce.turnId)?.blocks?.[ce.blockIndex];return q?.kind==="thinking"?q.thinking:null}),h=H(()=>g.value!==null);function m(ce){const Se=f.value;if(Se&&Se.turnId===ce.turnId&&Se.blockIndex===ce.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=ce}function _(){f.value=null,n.value==="thinking"&&(n.value=null)}const w=te(null),k=H(()=>{const ce=w.value;if(!ce)return null;const Se=e.turns.value.find(q=>q.id===ce.turnId);return Se?.role==="compaction"&&Se.text?Se.text:null}),b=H(()=>k.value!==null);function y(ce){if(w.value?.turnId===ce.turnId){w.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",w.value=ce}function x(){w.value=null,n.value==="compaction"&&(n.value=null)}const L=te(null),N=H(()=>{const ce=L.value;if(!ce)return null;const q=e.turns.value.find(ee=>ee.id===ce.turnId)?.blocks?.[ce.blockIndex];return q?q.kind==="agent"?q.member.id===ce.memberId?q.member:null:q.kind==="agentGroup"?q.members.find(ee=>ee.id===ce.memberId)??null:null:null}),v=H(()=>N.value!==null);function M(ce){const Se=L.value;if(Se&&Se.turnId===ce.turnId&&Se.memberId===ce.memberId){L.value=null,n.value==="agent"&&(n.value=null);return}n.value="agent",L.value=ce}function $(){L.value=null,n.value==="agent"&&(n.value=null)}const P=te(null),T=H(()=>{const ce=P.value;if(!ce)return null;const Se=O8(e.turns.value,ce);return Se?{id:ce,title:Sf(Se.name),path:L8(Se.arg),lines:Se.status==="error"?null:vx(Se),output:Se.output}:null}),I=H(()=>T.value!==null);function R(ce){if(n.value==="toolDiff"&&P.value===ce){D();return}n.value="toolDiff",P.value=ce}function D(){P.value=null,n.value==="toolDiff"&&(n.value=null)}const F=te("list"),z=te(null);function V(){if(n.value==="diff"){ne();return}n.value="diff",F.value="list",z.value=null,e.loadGitStatus(e.activeSessionId.value)}function ne(){n.value==="diff"&&(n.value=null),F.value="list",z.value=null,e.clearFileDiff()}async function K(ce){F.value="detail",z.value=ce,await e.loadFileDiff(ce)}async function G(ce){await e.openSideChat(ce),n.value="btw"}function X(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function be(){n.value==="btw"&&(n.value=null)}const le=H(()=>e.sideChatVisible.value),We=H(()=>n.value!==null&&(n.value!=="thinking"||h.value)&&(n.value!=="compaction"||b.value)&&(n.value!=="agent"||v.value)&&(n.value!=="toolDiff"||I.value)&&(n.value!=="btw"||le.value)),ue=te(!1),ve=te({});function Ne(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return w.value?{kind:"compaction",...w.value}:null;case"agent":return L.value?{kind:"agent",...L.value}:null;case"toolDiff":return P.value?{kind:"toolDiff",toolId:P.value}:null;case"btw":return{kind:"btw"};default:return null}}function Re(ce){if(ce)switch(ce.kind){case"thinking":f.value={turnId:ce.turnId,blockIndex:ce.blockIndex},n.value="thinking";break;case"compaction":w.value={turnId:ce.turnId},n.value="compaction";break;case"agent":L.value={turnId:ce.turnId,blockIndex:ce.blockIndex,memberId:ce.memberId},n.value="agent";break;case"toolDiff":P.value=ce.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function Q(){return n.value==="thinking"&&h.value?(_(),!0):n.value==="compaction"&&b.value?(x(),!0):n.value==="agent"&&v.value?($(),!0):n.value==="toolDiff"&&I.value?(D(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(ne(),!0):n.value==="btw"?(X(),!0):!1}return ze(e.activeSessionId,(ce,Se)=>{if(Se){const q=Ne();q?ve.value[Se]=q:delete ve.value[Se]}o(),_(),x(),$(),D(),ne(),be(),ce&&Re(ve.value[ce])}),{PREVIEW_WIDTH_KEY:uhe,PREVIEW_MIN:Ql,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:g,thinkingVisible:h,openThinkingPanel:m,closeThinkingPanel:_,compactionPanelText:k,compactionPanelVisible:b,openCompactionPanel:y,closeCompactionPanel:x,agentPanelMember:N,agentPanelVisible:v,openAgentPanel:M,closeAgentPanel:$,toolDiffTarget:T,toolDiffVisible:I,openToolDiff:R,closeToolDiff:D,detailDiffMode:F,detailDiffPath:z,openDiffDetail:V,closeDiffDetail:ne,selectDiffFile:K,btwVisible:le,openSideChatTab:G,closeSideChat:X,hideSideChatPanel:be,sidePanelVisible:We,panelDragging:ue,closeOpenSidePanel:Q}}const fhe=Mt.sidebarWidth,oC=Mt.sidebarCollapsed,sC=270,kg=170,hhe=36,phe=320;function mhe(e={}){const{viewportWidth:t}=rM(),n=te(sC),o=te(!1),s=H(()=>{const c=phe+(MC(e.previewOpen)?Ql:0);return iM(t.value,kg,c)}),i=H(()=>o.value?hhe:j1(n.value,kg,s.value));function r(){try{o.value=bn(oC)==="true"}catch{o.value=!1}}function l(){try{Tn(oC,String(o.value))}catch{}}function a(){o.value=!o.value,l()}return{SIDEBAR_WIDTH_KEY:fhe,SIDEBAR_DEFAULT:sC,SIDEBAR_MIN:kg,sidebarMax:s,sessionColWidth:n,sidebarCollapsed:o,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function ghe({client:e,detailTarget:t}){const{t:n}=xt(),o=te(null),s=te(null),i=te(!1),r=te(null),l=te(null);let a=0;const c=H(()=>{const y=l.value;return y?e.getFileDownloadUrl(y):null}),u=H(()=>o.value!==null);function d(y){return y.length>1?y.replace(/\/+$/,""):y}function f(y){const x=[];for(const L of y.split(/[\\/]+/))if(!(!L||L===".")){if(L===".."){x.pop();continue}x.push(L)}return x.join("/")}function g(y){const x=y.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const L=d(e.status.value.cwd);if(x.startsWith("/")){if(!L||x!==L&&!x.startsWith(`${L}/`))return{error:n("filePreview.errors.outsideWorkspace")};const v=x===L?"":x.slice(L.length+1);if(v.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const M=f(v);return M?{path:M}:{error:n("filePreview.errors.isDirectory")}}if(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=f(x);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function h(y){const x=o.value;if(t.value==="file"&&x&&x.path===y.path&&x.line===y.line){w();return}const L=++a;t.value="file",s.value=null,r.value=null,i.value=!0,o.value=y,l.value=null;const N=g(y.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const v=await e.readFileContent(N.path);if(L!==a)return;v?s.value={...v,path:v.path||N.path}:s.value={path:N.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(v){if(L!==a)return;r.value=v instanceof Error?v.message:n("filePreview.errors.loadFailed")}finally{L===a&&(i.value=!1)}}function m(y){return/^data:([^;,]+)/i.exec(y)?.[1]}function _(y){y.kind==="image"&&(t.value="file",o.value=null,l.value=null,r.value=null,i.value=!1,s.value={path:y.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:y.mimeType??m(y.url)??"image/*",sourceUrl:y.url,isBinary:!0,size:y.bytes??0})}function w(){o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,t.value==="file"&&(t.value=null)}function k(){const y=s.value?.path??o.value?.path;y&&e.openWorkspaceFile(y,o.value?.line)}function b(){const y=s.value?.path??o.value?.path;y&&e.revealWorkspaceFile(y)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:h,openMediaPreview:_,closeFilePreview:w,openPreviewInEditor:k,revealPreviewFile:b}}const vhe=640,yhe=`(max-width: ${vhe}px)`;function khe(){const e=te(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(yhe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Yt(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Yt(()=>t.removeListener(n))),e}const bhe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},whe={class:"server-auth-card"},_he=["disabled"],Che=["disabled"],She=Qe({__name:"ServerAuthDialog",setup(e){const t=te(""),n=te(null),o=te(!1);rn(()=>{ht(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,f3(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(C(),E("div",bhe,[p("div",whe,[l[1]||(l[1]=p("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required",-1)),l[2]||(l[2]=p("p",{class:"server-auth-hint"},[ft(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),p("code",null,"KIMI_CODE_PASSWORD"),ft("). ")],-1)),jt(p("input",{ref_key:"inputRef",ref:n,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",class:"server-auth-input",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:i},null,40,_he),[[Wn,t.value]]),p("button",{type:"button",class:"server-auth-button",disabled:!t.value||o.value,onClick:s},O(o.value?"Connecting…":"Connect"),9,Che)])]))}}),xhe=bt(She,[["__scopeId","data-v-fb2ac094"]]),The={class:"app-shell"},Ahe={key:1,class:"auth-page"},Mhe={class:"auth-page-inner"},Ehe={class:"auth-page-copy"},Ihe={key:0,class:"sidebar-rail"},$he=["title","aria-label"],Nhe={key:3,class:"coming-soon"},Lhe={class:"cs-text"},Ohe=["aria-label","aria-hidden"],Phe=Qe({__name:"App",setup(e){const t=xce(),n=te(!t);let o=null;const s=ihe();yn("resolveImage",s.resolveImageUrl);const{t:i}=xt(),r=Ys(),l=khe(),a=te(!1),c=te(!1),u=H(()=>{const Me=s.activeSessionId.value;return s.sessions.value.find(J=>J.id===Me)?.title??""}),d=H(()=>s.visibleWorkspace.value?.sessionCount??0),f=H(()=>s.activity.value!=="idle"),g=te(null),{showAuthGate:h,blinkAuthLogo:m}=rhe({client:s,authLogoRef:g});lhe({running:f,showAuthGate:h});function _(Me){return Me==="off"?"high":"off"}const w=te(!s.onboarded.value);function k(){s.setOnboarded(!0),w.value=!1}function b(){w.value=!0}rn(()=>{s.load(),ue(),document.addEventListener("keydown",y,!0),o=Ace(()=>{n.value=!0})}),Yt(()=>{document.removeEventListener("keydown",y,!0),o!==null&&(o(),o=null)});function y(Me){Me.key==="Escape"&&(Co.value||jn()&&(Me.stopPropagation(),Me.preventDefault()))}const x=te(null),L=te(!1);ze(s.activeSessionId,()=>{L.value=!0,ht(()=>{L.value=!1})});const{previewTarget:N,previewFile:v,previewLoading:M,previewError:$,previewDownloadUrl:P,previewExternalActions:T,openFilePreview:I,openMediaPreview:R,closeFilePreview:D,openPreviewInEditor:F,revealPreviewFile:z}=ghe({client:s,detailTarget:x}),V=H(()=>x.value!==null),{SIDEBAR_WIDTH_KEY:ne,SIDEBAR_DEFAULT:K,SIDEBAR_MIN:G,sidebarMax:X,sessionColWidth:be,sidebarCollapsed:le,sideWidth:We,loadSidebarCollapsed:ue,toggleSidebarCollapse:ve}=mhe({previewOpen:V}),{PREVIEW_WIDTH_KEY:Ne,PREVIEW_MIN:Re,previewDefaultWidth:Q,previewMax:ce,previewWidth:Se,previewPanelWidth:q,thinkingPanelText:ee,thinkingVisible:he,openThinkingPanel:oe,closeThinkingPanel:fe,compactionPanelText:W,compactionPanelVisible:Y,openCompactionPanel:re,closeCompactionPanel:ge,agentPanelMember:xe,openAgentPanel:$e,closeAgentPanel:se,toolDiffTarget:ae,openToolDiff:we,closeToolDiff:qe,detailDiffMode:nt,detailDiffPath:at,openDiffDetail:_t,closeDiffDetail:$t,selectDiffFile:lt,btwVisible:Rt,openSideChatTab:fn,closeSideChat:An,sidePanelVisible:Nt,panelDragging:Ft,closeOpenSidePanel:jn}=dhe({client:s,sideWidth:We,detailTarget:x,closeFilePreview:D}),Je=te(null),Qn=te([]),Xo=H(()=>Qn.value.length>1);function Oo(Me){Qn.value=Me}const ho=te(!1),Nn=te(!1),cn=te(!1),wn=te(!1),On=te(!1),zn=te(!1),Zn=te(null),Co=H(()=>ho.value||Nn.value||cn.value||wn.value||On.value||zn.value||w.value||a.value||c.value),po=te(!1),Po=te(!1),Tt=te(!1),io=te(!1),nn=te(!1);async function Ro(){po.value=!0,Po.value=!1,ho.value=!0;try{await s.refreshOAuthProviderModels(),await s.loadModels()}catch{Po.value=!0}finally{po.value=!1}}async function Qo(){Tt.value=!0,io.value=!1,Nn.value=!0;try{await s.loadProviders()}catch{io.value=!0}finally{Tt.value=!1}}function Jn(){cn.value=!0}async function Ye(Me){ho.value=!1,await s.setModel(Me)}async function je(Me){await s.addProvider(Me)}async function tt(Me){await s.deleteProvider(Me)}async function it(Me){await s.refreshProvider(Me)}async function Ie(Me){nn.value=!0;try{await s.updateConfig(Me)&&await s.checkAuth()}finally{nn.value=!1}}async function ke(){return s.startOAuthLogin()}async function Fe(){return s.pollOAuthLogin()}async function Ct(){return s.cancelOAuthLogin()}async function St(){cn.value=!1,await s.checkAuth(),await s.load()}async function mn(Me){await s.undo(1),await ht(),Je.value?.loadComposerForEdit(Me)}function gn(Me){if(Me==="/compact"||Me.startsWith("/compact ")){s.compact(Me.slice(8).trim()||void 0);return}if(Me==="/swarm"||Me.startsWith("/swarm ")){const J=Me.slice(6).trim();J==="on"?s.setSwarmMode(!0):J==="off"?s.setSwarmMode(!1):J?(s.setSwarmMode(!0),s.sendPrompt(J)):s.toggleSwarmMode();return}if(Me==="/goal"||Me.startsWith("/goal ")){const J=Me.slice(5).trim();J==="pause"||J==="resume"||J==="cancel"?s.controlGoal(J):J?s.createGoal(J):s.toggleGoalMode();return}if(Me==="/btw"||Me.startsWith("/btw ")){const J=Me.slice(4).trim();!J&&s.sideChatVisible.value?An():fn(J||void 0);return}switch(Me){case"/new":case"/clear":de();break;case"/fork":s.forkSession();break;case"/undo":s.undo();break;case"/permission":{const J=s.permission.value,pe=J==="manual"?"auto":J==="auto"?"yolo":"manual";s.setPermission(pe);break}case"/plan":s.togglePlanMode();break;case"/auto":s.setPermission("auto");break;case"/yolo":s.setPermission("yolo");break;case"/thinking":s.setThinking(_(s.thinking.value));break;case"/help":s.dismissWarning(-1);break;case"/status":On.value=!0;break;case"/model":Ro();break;case"/provider":Qo();break;case"/login":Jn();break;default:{const J=Me.indexOf(" "),pe=(J===-1?Me:Me.slice(0,J)).slice(1),kt=J===-1?void 0:Me.slice(J+1).trim()||void 0;pe&&s.activateSkill(pe,kt);break}}}function ys(Me){s.unqueue(Me)}function Zo(Me){s.unqueue(Me)}async function Ui(Me){const J=s.activeWorkspaceId.value;if(!s.activeSessionId.value&&J){await s.startSessionAndSendPrompt(J,Me.text,Me.attachments);return}if(!s.activeSessionId.value&&!J){Zn.value=Me,wn.value=!0;return}s.sendPrompt(Me.text,Me.attachments)}async function fi(Me){wn.value=!1,await s.addWorkspaceByPath(Me);const J=Zn.value;Zn.value=null;const pe=s.activeWorkspaceId.value;J&&pe&&await s.startSessionAndSendPrompt(pe,J.text,J.attachments)}function Vn(){Zn.value=null,wn.value=!1}function hi(){ht(()=>{Je.value?.focusComposer()})}function de(){const Me=s.activeWorkspaceId.value;Me?s.openWorkspaceDraft(Me):s.clearActiveSession(),hi()}function Te(Me){s.openWorkspaceDraft(Me),hi()}function Le(Me){Me&&window.open(Me,"_blank","noopener")}return(Me,J)=>(C(),E("div",The,[n.value?(C(),Ve(xhe,{key:0})):ie("",!0),S(h)?(C(),E("section",Ahe,[p("div",Mhe,[(C(),E("svg",{ref_key:"authLogoRef",ref:g,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:J[0]||(J[0]=Ze(()=>{},["prevent"])),onClick:J[1]||(J[1]=(...pe)=>S(m)&&S(m)(...pe))},[...J[95]||(J[95]=[_r('<defs data-v-1b7a96bd><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-1b7a96bd><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-1b7a96bd></rect><g class="ch-eyes" fill="#000" data-v-1b7a96bd><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-1b7a96bd></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-1b7a96bd></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-1b7a96bd></rect>',2)])],544)),p("div",Ehe,[p("h1",null,O(S(i)("app.authPageTitle")),1),p("p",null,O(S(i)("app.authPageMessage")),1)]),p("button",{type:"button",class:"auth-page-btn",onClick:Jn},[J[96]||(J[96]=p("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"},[p("path",{d:"M6 3h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6"}),p("path",{d:"M9 8H2"}),p("path",{d:"M5 5l3 3-3 3"})],-1)),p("span",null,O(S(i)("app.authPageLogin")),1)])])])):(C(),E("div",{key:2,class:Oe(["app",{mobile:S(l),"sidebar-collapsed":S(le)&&!S(l)}]),style:Wt({"--side-w":S(We)+"px","--preview-w":S(q)+"px"})},[S(l)?(C(),Ve(are,{key:1,workspace:S(s).visibleWorkspace.value,"session-title":u.value,running:f.value,branch:S(s).status.value.branch,"session-count":d.value,onOpenSwitcher:J[17]||(J[17]=pe=>a.value=!0),onOpenSettings:J[18]||(J[18]=pe=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(C(),E(Pe,{key:0},[jt(vt(tN,{"col-width":S(We),"active-workspace":S(s).visibleWorkspace.value,"active-workspace-id":S(s).activeWorkspaceId.value,sessions:S(s).sessionsForView.value,groups:S(s).workspaceGroups.value,"active-id":S(s).activeSessionId.value,"attention-by-session":S(s).attentionBySession.value,"pending-by-session":S(s).pendingBySession.value,"unread-by-session":S(s).unreadBySession.value,onSelect:J[2]||(J[2]=pe=>S(s).selectSession(pe)),onCreate:de,onCreateInWorkspace:J[3]||(J[3]=pe=>Te(pe)),onSelectWorkspace:J[4]||(J[4]=pe=>S(s).openWorkspace(pe)),onAddWorkspace:J[5]||(J[5]=pe=>wn.value=!0),onRename:J[6]||(J[6]=(pe,kt)=>S(s).renameSession(pe,kt)),onArchive:J[7]||(J[7]=pe=>S(s).archiveSession(pe)),onFork:J[8]||(J[8]=pe=>S(s).forkSession(pe)),onRenameWorkspace:J[9]||(J[9]=(pe,kt)=>S(s).renameWorkspace(pe,kt)),onDeleteWorkspace:J[10]||(J[10]=pe=>S(s).deleteWorkspace(pe)),onReorderWorkspaces:J[11]||(J[11]=pe=>S(s).reorderWorkspaces(pe)),onLoadMoreSessions:J[12]||(J[12]=pe=>void S(s).loadMoreSessions(pe)),onLoadAllSessions:J[13]||(J[13]=pe=>void S(s).loadAllSessions()),onSelectWorkspaces:Oo,onOpenSettings:J[14]||(J[14]=pe=>zn.value=!0),onCollapse:S(ve)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","onCollapse"]),[[js,!S(le)]]),jt(vt(gb,{"storage-key":S(ne),"default-width":S(K),min:S(G),max:S(X),"onUpdate:width":J[15]||(J[15]=pe=>be.value=pe)},null,8,["storage-key","default-width","min","max"]),[[js,!S(le)]]),S(le)?(C(),E("div",Ihe,[p("button",{type:"button",class:"sidebar-expand-btn",title:S(i)("sidebar.expandSidebar"),"aria-label":S(i)("sidebar.expandSidebar"),onClick:J[16]||(J[16]=(...pe)=>S(ve)&&S(ve)(...pe))},[...J[97]||(J[97]=[_r('<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-1b7a96bd><path d="M4 6h9" data-v-1b7a96bd></path><path d="M4 12h9" data-v-1b7a96bd></path><path d="M4 18h9" data-v-1b7a96bd></path><path d="M17 9l3 3-3 3" data-v-1b7a96bd></path></svg>',1)])],8,$he)])):ie("",!0)],64)),Xo.value?(C(),E("div",Nhe,[J[98]||(J[98]=p("span",{class:"cs-icon"},"🚧",-1)),p("span",Lhe,O(S(i)("app.comingSoon")),1)])):(C(),Ve(OQ,{key:2,ref_key:"conversationPaneRef",ref:Je,mobile:S(l),modern:S(s).theme.value==="modern"||S(s).theme.value==="kimi",turns:S(s).turns.value,"session-id":S(s).activeSessionId.value,approvals:S(s).pendingApprovals.value,changes:S(s).changes.value,"git-info":S(s).gitInfo.value,tasks:S(s).tasks.value,todos:S(s).todos.value,goal:S(s).goal.value,swarms:S(s).swarms.value,"activation-badges":S(s).activationBadges.value,status:S(s).status.value,thinking:S(s).thinking.value,"plan-mode":S(s).planMode.value,"swarm-mode":S(s).swarmMode.value,"goal-mode":S(s).goalMode.value,models:S(s).models.value,"starred-ids":S(s).starredModelIds.value,skills:S(s).skills.value,questions:S(s).questions.value,running:f.value,queued:S(s).queued.value,"search-files":S(s).searchFiles,"upload-image":S(s).uploadImage,sending:S(s).isSending.value,"fast-moon":S(s).fastMoon.value,"file-reload-key":S(s).activeSessionId.value,"session-loading":S(s).sessionLoading.value,compaction:S(s).compaction.value,"has-more-messages":S(s).hasMoreMessages.value,"loading-more":S(s).loadingMoreMessages.value,"loading-more-error":S(s).loadMoreMessagesError.value,"load-older-messages":S(s).loadOlderMessages,"workspace-name":S(s).visibleWorkspace.value?.name,"workspace-root":S(s).visibleWorkspace.value?.root??S(s).status.value.cwd,"git-diff-stats":S(s).gitDiffStats.value,workspaces:S(s).workspacesView.value,"active-workspace-id":S(s).activeWorkspaceId.value,"session-title":u.value,pr:S(s).activePullRequest.value,"beta-toc":S(s).betaToc.value,onOpenChanges:J[19]||(J[19]=pe=>S(_t)()),onSelectWorkspace:J[20]||(J[20]=pe=>Te(pe)),onAddWorkspace:J[21]||(J[21]=pe=>wn.value=!0),onOpenPr:Le,onSubmit:J[22]||(J[22]=pe=>Ui(pe)),onSteer:J[23]||(J[23]=pe=>S(s).steerPrompt(pe.text,pe.attachments)),onApproval:J[24]||(J[24]=(pe,kt)=>S(s).respondApproval(pe,kt)),onCancelTask:J[25]||(J[25]=pe=>S(s).cancelTask(pe)),onAnswer:J[26]||(J[26]=(pe,kt)=>S(s).respondQuestion(pe,kt)),onDismiss:J[27]||(J[27]=pe=>S(s).dismissQuestion(pe)),onCommand:gn,onInterrupt:J[28]||(J[28]=pe=>S(s).abortCurrentPrompt()),onUnqueue:ys,onEditQueued:Zo,onSetPermission:J[29]||(J[29]=pe=>S(s).setPermission(pe)),onSetThinking:J[30]||(J[30]=pe=>S(s).setThinking(pe)),onTogglePlan:J[31]||(J[31]=pe=>S(s).togglePlanMode()),onToggleSwarm:J[32]||(J[32]=pe=>S(s).toggleSwarmMode()),onToggleGoal:J[33]||(J[33]=pe=>S(s).toggleGoalMode()),onCreateGoal:J[34]||(J[34]=pe=>S(s).createGoal(pe)),onControlGoal:J[35]||(J[35]=pe=>S(s).controlGoal(pe)),onRefreshGitStatus:J[36]||(J[36]=pe=>S(s).activeSessionId.value&&S(s).loadGitStatus(S(s).activeSessionId.value)),onRenameSession:J[37]||(J[37]=(pe,kt)=>S(s).renameSession(pe,kt)),onForkSession:J[38]||(J[38]=pe=>S(s).forkSession(pe)),onArchiveSession:J[39]||(J[39]=pe=>S(s).archiveSession(pe)),onCompact:J[40]||(J[40]=pe=>S(s).compact()),onPickModel:J[41]||(J[41]=pe=>Ro()),onSelectModel:J[42]||(J[42]=pe=>S(s).setModel(pe)),onOpenFile:J[43]||(J[43]=pe=>S(I)(pe)),onOpenMedia:J[44]||(J[44]=pe=>S(R)(pe)),onOpenThinking:J[45]||(J[45]=pe=>S(oe)(pe)),onOpenCompaction:J[46]||(J[46]=pe=>S(re)(pe)),onOpenAgent:J[47]||(J[47]=pe=>S($e)(pe)),onOpenToolDiff:J[48]||(J[48]=pe=>S(we)(pe)),onEditMessage:mn},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","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","beta-toc"])),S(Nt)&&!S(l)?(C(),Ve(gb,{key:4,"storage-key":S(Ne),"default-width":S(Q),min:S(Re),max:S(ce),reverse:"","aria-label":S(i)("layout.resizePreviewAria"),"onUpdate:width":J[49]||(J[49]=pe=>Se.value=pe),"onUpdate:dragging":J[50]||(J[50]=pe=>Ft.value=pe)},null,8,["storage-key","default-width","min","max","aria-label"])):ie("",!0),!S(l)||S(Nt)?(C(),E("aside",{key:5,class:Oe(["global-preview",{open:S(Nt),mobile:S(l),"no-anim":S(Ft)||L.value}]),role:"complementary","aria-label":S(i)("layout.detailPanelAria"),"aria-hidden":!S(Nt)},[x.value==="thinking"&&S(he)?(C(),Ve(S2,{key:0,text:S(ee)??"",onClose:S(fe)},null,8,["text","onClose"])):x.value==="compaction"&&S(Y)?(C(),Ve(S2,{key:1,text:S(W)??"",subtitle:S(i)("conversation.summaryTitle"),onClose:S(ge)},null,8,["text","subtitle","onClose"])):x.value==="agent"&&S(xe)?(C(),Ve(gJ,{key:2,member:S(xe),onClose:S(se)},null,8,["member","onClose"])):x.value==="btw"&&S(Rt)?(C(),Ve(zJ,{key:3,turns:S(s).sideChatTurns.value,running:S(s).sideChatRunning.value,sending:S(s).sideChatSending.value,onSend:J[51]||(J[51]=pe=>S(s).sendSideChatPrompt(pe)),onClose:S(An)},null,8,["turns","running","sending","onClose"])):x.value==="diff"?(C(),Ve($ee,{key:4,mode:S(nt),changes:S(s).changes.value,"git-info":S(s).gitInfo.value,"file-diff":S(s).fileDiff.value,"selected-diff-path":S(s).selectedDiffPath.value,"file-diff-loading":S(s).fileDiffLoading.value,closable:"",onOpen:S(lt),onBack:J[52]||(J[52]=pe=>{nt.value="list",at.value=null,S(s).clearFileDiff()}),onClose:S($t)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):x.value==="toolDiff"&&S(ae)?(C(),Ve(LJ,{key:5,target:S(ae),onClose:S(qe)},null,8,["target","onClose"])):x.value==="file"?(C(),Ve(zZ,{key:6,file:S(v),loading:S(M),error:S($),line:S(N)?.line,"download-url":S(P),closable:"","external-actions":S(T),"open-file":S(I),onClose:S(D),onOpenExternal:S(F),onReveal:S(z)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ie("",!0)],10,Ohe)):ie("",!0),ho.value?(C(),Ve(ste,{key:6,models:S(s).models.value,current:S(s).status.value.modelId,"starred-ids":S(s).starredModelIds.value,loading:po.value,unavailable:Po.value,onSelect:J[53]||(J[53]=pe=>Ye(pe)),onToggleStar:J[54]||(J[54]=pe=>S(s).toggleStarModel(pe)),onClose:J[55]||(J[55]=pe=>ho.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ie("",!0),zn.value?(C(),Ve(qse,{key:7,theme:S(s).theme.value,"color-scheme":S(s).colorScheme.value,"ui-font-size":S(s).uiFontSize.value,"auth-ready":S(s).authReady.value,"account-model":S(s).defaultModel.value,notify:S(s).notifyOnComplete.value,"notify-question":S(s).notifyOnQuestion.value,"notify-permission":S(s).notifyPermission.value,sound:S(s).soundOnComplete.value,"beta-toc":S(s).betaToc.value,config:S(s).config.value,models:S(s).models.value,"config-saving":nn.value,"server-version":S(s).serverVersion.value,onSetTheme:J[56]||(J[56]=pe=>S(s).setTheme(pe)),onSetColorScheme:J[57]||(J[57]=pe=>S(s).setColorScheme(pe)),onSetUiFontSize:J[58]||(J[58]=pe=>S(s).setUiFontSize(pe)),onSetNotify:J[59]||(J[59]=pe=>S(s).setNotifyOnComplete(pe)),onSetNotifyQuestion:J[60]||(J[60]=pe=>S(s).setNotifyOnQuestion(pe)),onSetSound:J[61]||(J[61]=pe=>S(s).setSoundOnComplete(pe)),onSetBetaToc:J[62]||(J[62]=pe=>S(s).setBetaToc(pe)),onUpdateConfig:J[63]||(J[63]=pe=>Ie(pe)),onLogin:J[64]||(J[64]=()=>{zn.value=!1,Jn()}),onLogout:S(s).logout,onOpenOnboarding:J[65]||(J[65]=()=>{zn.value=!1,b()}),onClose:J[66]||(J[66]=pe=>zn.value=!1)},null,8,["theme","color-scheme","ui-font-size","auth-ready","account-model","notify","notify-question","notify-permission","sound","beta-toc","config","models","config-saving","server-version","onLogout"])):ie("",!0),Nn.value?(C(),Ve(Kte,{key:8,providers:S(s).providers.value,loading:Tt.value,unavailable:io.value,onAdd:J[67]||(J[67]=pe=>je(pe)),onRefresh:J[68]||(J[68]=pe=>it(pe)),onDelete:J[69]||(J[69]=pe=>tt(pe)),onOpenLogin:J[70]||(J[70]=()=>{Nn.value=!1,Jn()}),onClose:J[71]||(J[71]=pe=>Nn.value=!1)},null,8,["providers","loading","unavailable"])):ie("",!0),On.value?(C(),Ve(Hie,{key:9,status:S(s).status.value,thinking:S(s).thinking.value,"plan-mode":S(s).planMode.value,"swarm-mode":S(s).swarmMode.value,"cost-usd":S(s).sessionCost.value,onClose:J[72]||(J[72]=pe=>On.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ie("",!0),wn.value?(C(),Ve(Sie,{key:10,"browse-fs":S(s).browseFs,"get-fs-home":S(s).getFsHome,"default-path":S(s).visibleWorkspace.value?.root??S(s).status.value.cwd,onAdd:J[73]||(J[73]=pe=>fi(pe)),onClose:Vn},null,8,["browse-fs","get-fs-home","default-path"])):ie("",!0),vt(Fi,{name:"gload-fade"},{default:In(()=>[S(s).initialized.value?ie("",!0):(C(),Ve(fae,{key:0}))]),_:1}),w.value&&!S(h)?(C(),Ve(lae,{key:11,theme:S(s).theme.value,onSetTheme:J[74]||(J[74]=pe=>S(s).setTheme(pe)),onComplete:k,onSkip:k},null,8,["theme"])):ie("",!0),vt(Zie,{warnings:S(s).warnings.value,onDismiss:S(s).dismissWarning},null,8,["warnings","onDismiss"]),S(r)?(C(),Ve(qae,{key:12})):ie("",!0),S(l)?(C(),Ve(Bre,{key:13,modelValue:a.value,"onUpdate:modelValue":J[75]||(J[75]=pe=>a.value=pe),groups:S(s).workspaceGroups.value,"active-workspace-id":S(s).activeWorkspaceId.value,"active-id":S(s).activeSessionId.value,"attention-by-session":S(s).attentionBySession.value,"attention-by-workspace":S(s).attentionByWorkspace.value,onSelect:J[76]||(J[76]=pe=>S(s).selectSession(pe)),onCreate:de,onCreateInWorkspace:J[77]||(J[77]=pe=>Te(pe)),onAddWorkspace:J[78]||(J[78]=pe=>wn.value=!0),onRename:J[79]||(J[79]=(pe,kt)=>S(s).renameSession(pe,kt)),onArchive:J[80]||(J[80]=pe=>S(s).archiveSession(pe)),onDeleteWorkspace:J[81]||(J[81]=pe=>S(s).deleteWorkspace(pe)),onLoadMore:J[82]||(J[82]=pe=>void S(s).loadMoreSessions(pe))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ie("",!0),S(l)?(C(),Ve(Hle,{key:14,modelValue:c.value,"onUpdate:modelValue":J[83]||(J[83]=pe=>c.value=pe),status:S(s).status.value,thinking:S(s).thinking.value,"plan-mode":S(s).planMode.value,"swarm-mode":S(s).swarmMode.value,theme:S(s).theme.value,"color-scheme":S(s).colorScheme.value,"ui-font-size":S(s).uiFontSize.value,"auth-ready":S(s).authReady.value,"beta-toc":S(s).betaToc.value,"server-version":S(s).serverVersion.value,onPickModel:J[84]||(J[84]=pe=>Ro()),onSetThinking:J[85]||(J[85]=pe=>S(s).setThinking(pe)),onTogglePlan:J[86]||(J[86]=pe=>S(s).togglePlanMode()),onToggleSwarm:J[87]||(J[87]=pe=>S(s).toggleSwarmMode()),onSetPermission:J[88]||(J[88]=pe=>S(s).setPermission(pe)),onSetTheme:J[89]||(J[89]=pe=>S(s).setTheme(pe)),onSetColorScheme:J[90]||(J[90]=pe=>S(s).setColorScheme(pe)),onSetUiFontSize:J[91]||(J[91]=pe=>S(s).setUiFontSize(pe)),onSetBetaToc:J[92]||(J[92]=pe=>S(s).setBetaToc(pe)),onLogin:J[93]||(J[93]=()=>{c.value=!1,Jn()}),onLogout:S(s).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","theme","color-scheme","ui-font-size","auth-ready","beta-toc","server-version","onLogout"])):ie("",!0)],6)),cn.value?(C(),Ve(Tne,{key:3,"on-start-o-auth-login":ke,"on-poll-o-auth-login":Fe,"on-cancel-o-auth-login":Ct,onSuccess:St,onClose:J[94]||(J[94]=pe=>cn.value=!1)})):ie("",!0)]))}}),Rhe=bt(Phe,[["__scopeId","data-v-1b7a96bd"]]);Fne();kf(Rhe).use(Cn).mount("#app");export{fE as $,cpe as A,nI as B,Bn as C,Dpe as D,dC as E,Pe as F,_r as G,ft as H,vt as I,PE as J,lpe as K,ai as L,Qe as M,M$ as N,fpe as O,hpe as P,gpe as Q,Jd as R,da as S,epe as T,ppe as U,uv as V,dpe as W,Fpe as X,mpe as Y,Npe as Z,Bhe as _,HC as a,ko as a$,fo as a0,K1 as a1,Vhe as a2,J1 as a3,ZI as a4,Zt as a5,Ma as a6,Zhe as a7,qpe as a8,ope as a9,zC as aA,hI as aB,kI as aC,rn as aD,yI as aE,vI as aF,G1 as aG,gI as aH,Yt as aI,tv as aJ,HE as aK,C as aL,x$ as aM,Xhe as aN,yn as aO,EC as aP,Yhe as aQ,sf as aR,as as aS,tf as aT,te as aU,Tpe as aV,q$ as aW,Xe as aX,ca as aY,wI as aZ,ape as a_,rpe as aa,ipe as ab,spe as ac,Mpe as ad,jpe as ae,Bt as af,s$ as ag,yh as ah,mr as ai,Di as aj,Ln as ak,Ape as al,us as am,wr as an,fr as ao,kpe as ap,bpe as aq,en as ar,ht as as,c$ as at,Oe as au,Dhe as av,Wt as aw,fI as ax,mI as ay,Yo as az,Ghe as b,LW as b$,Ppe as b0,qc as b1,df as b2,Lpe as b3,br as b4,$E as b5,Hhe as b6,gl as b7,KE as b8,Ope as b9,Wn as bA,js as bB,i$ as bC,Ipe as bD,ze as bE,YE as bF,Jhe as bG,XE as bH,_pe as bI,In as bJ,vpe as bK,jt as bL,Ns as bM,Epe as bN,Ze as bO,Qhe as bP,Jt as bQ,cs as bR,Jpe as bS,_U as bT,TA as bU,tme as bV,cW as bW,n0 as bX,eme as bY,u1 as bZ,ome as b_,Fhe as ba,O as bb,Nd as bc,upe as bd,Ht as be,qhe as bf,Uhe as bg,MC as bh,xpe as bi,Whe as bj,S as bk,mu as bl,Wpe as bm,Bpe as bn,I$ as bo,tpe as bp,Cpe as bq,GE as br,Hpe as bs,ype as bt,npe as bu,FC as bv,vf as bw,B$ as bx,$S as by,yf as bz,$pe as c,NW as c0,Jv as c1,$W as c2,Xpe as c3,oW as c4,Ype as c5,zf as c6,Vpe as c7,IW as c8,bA as c9,nme as ca,Kpe as cb,ime as cc,g1 as cd,oa as ce,p1 as cf,rme as cg,sme as ch,Zpe as ci,ss as cj,Gpe as ck,Qpe as cl,dW as cm,m1 as cn,h1 as co,zpe as cp,Spe as d,gr as e,jhe as f,Fi as g,Upe as h,zhe as i,Khe as j,Rs as k,fu as l,Xn as m,uh as n,Bi as o,Rpe as p,H as q,kf as r,Ve as s,ie as t,E as u,p as v,qI as w,wpe as x,UI as y,j$ as z};
|